ExtensionManagementRestClient class
Base class that should be used (derived from) to make requests to VSS REST apis
- Extends
Constructors
Extension |
Properties
RESOURCE_AREA_ID |
Methods
Constructor Details
ExtensionManagementRestClient(IVssRestClientOptions)
new ExtensionManagementRestClient(options: IVssRestClientOptions)
Parameters
- options
- IVssRestClientOptions
Property Details
RESOURCE_AREA_ID
static RESOURCE_AREA_ID: string
Property Value
string
Method Details
createDocumentByName(any, string, string, string, string, string)
function createDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>
Parameters
- doc
-
any
- publisherName
-
string
- extensionName
-
string
- scopeType
-
string
- scopeValue
-
string
- collectionName
-
string
Returns
Promise<any>
deleteDocumentByName(string, string, string, string, string, string)
function deleteDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): Promise<void>
Parameters
- publisherName
-
string
- extensionName
-
string
- scopeType
-
string
- scopeValue
-
string
- collectionName
-
string
- documentId
-
string
Returns
Promise<void>
deleteRequest(string, string)
function deleteRequest(publisherName: string, extensionName: string): Promise<void>
Parameters
- publisherName
-
string
- extensionName
-
string
Returns
Promise<void>
getAcquisitionOptions(string, boolean, boolean, boolean, boolean, boolean, boolean)
This API is called by acquisition/install page to get possible user actions like Buy/Request
function getAcquisitionOptions(itemId: string, testCommerce?: boolean, isFreeOrTrialInstall?: boolean, isAccountOwner?: boolean, isLinked?: boolean, isConnectedServer?: boolean, isBuyOperationValid?: boolean): Promise<AcquisitionOptions>
Parameters
- itemId
-
string
Fully qualified name of extension (<publisher_id>.<extension_id>)
- testCommerce
-
boolean
Parameter to test paid preview extension without making azure plans public
- isFreeOrTrialInstall
-
boolean
Parameter represents install or trial workflow (required for legacy install flows)
- isAccountOwner
-
boolean
Parameter represents whether user is owner or PCA of an account
- isLinked
-
boolean
Parameter represents whether account is linked with a subscription
- isConnectedServer
-
boolean
Parameter represents whether Buy operation should be evaluated
- isBuyOperationValid
-
boolean
Returns
Promise<AcquisitionOptions>
getAuditLog(string, string)
function getAuditLog(publisherName: string, extensionName: string): Promise<ExtensionAuditLog>
Parameters
- publisherName
-
string
- extensionName
-
string
Returns
Promise<ExtensionAuditLog>
getDocumentByName(string, string, string, string, string, string)
function getDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): Promise<any>
Parameters
- publisherName
-
string
- extensionName
-
string
- scopeType
-
string
- scopeValue
-
string
- collectionName
-
string
- documentId
-
string
Returns
Promise<any>
getDocumentsByName(string, string, string, string, string)
function getDocumentsByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any[]>
Parameters
- publisherName
-
string
- extensionName
-
string
- scopeType
-
string
- scopeValue
-
string
- collectionName
-
string
Returns
Promise<any[]>
getInstalledExtensionByName(string, string, string[])
Get an installed extension by its publisher and extension name.
function getInstalledExtensionByName(publisherName: string, extensionName: string, assetTypes?: string[]): Promise<InstalledExtension>
Parameters
- publisherName
-
string
Name of the publisher. Example: "fabrikam".
- extensionName
-
string
Name of the extension. Example: "ops-tools".
- assetTypes
-
string[]
Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific asset types.
Returns
Promise<InstalledExtension>
getInstalledExtensions(boolean, boolean, string[], boolean)
List the installed extensions in the account / project collection.
function getInstalledExtensions(includeDisabledExtensions?: boolean, includeErrors?: boolean, assetTypes?: string[], includeInstallationIssues?: boolean): Promise<InstalledExtension[]>
Parameters
- includeDisabledExtensions
-
boolean
If true (the default), include disabled extensions in the results.
- includeErrors
-
boolean
If true, include installed extensions with errors.
- assetTypes
-
string[]
Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific asset types.
- includeInstallationIssues
-
boolean
Returns
Promise<InstalledExtension[]>
getPolicies(string)
function getPolicies(userId: string): Promise<UserExtensionPolicy>
Parameters
- userId
-
string
Returns
Promise<UserExtensionPolicy>
getRequests()
getStates(boolean, boolean, boolean, boolean)
List state and version information for all installed extensions.
function getStates(includeDisabled?: boolean, includeErrors?: boolean, includeInstallationIssues?: boolean, forceRefresh?: boolean): Promise<ExtensionState[]>
Parameters
- includeDisabled
-
boolean
If true (the default), include disabled extensions in the results.
- includeErrors
-
boolean
If true, include installed extensions in an error state in the results.
- includeInstallationIssues
-
boolean
- forceRefresh
-
boolean
Returns
Promise<ExtensionState[]>
getToken()
function getToken(): Promise<string>
Returns
Promise<string>
installExtensionByName(string, string, string)
Install the specified extension into the account / project collection.
function installExtensionByName(publisherName: string, extensionName: string, version?: string): Promise<InstalledExtension>
Parameters
- publisherName
-
string
Name of the publisher. Example: "fabrikam".
- extensionName
-
string
Name of the extension. Example: "ops-tools".
- version
-
string
Returns
Promise<InstalledExtension>
queryCollectionsByName(ExtensionDataCollectionQuery, string, string)
Query for one or more data collections for the specified extension. Note: the token used for authorization must have been issued on behalf of the specified extension.
function queryCollectionsByName(collectionQuery: ExtensionDataCollectionQuery, publisherName: string, extensionName: string): Promise<ExtensionDataCollection[]>
Parameters
- collectionQuery
- ExtensionDataCollectionQuery
- publisherName
-
string
Name of the publisher. Example: "fabrikam".
- extensionName
-
string
Name of the extension. Example: "ops-tools".
Returns
Promise<ExtensionDataCollection[]>
queryExtensions(InstalledExtensionQuery)
function queryExtensions(query: InstalledExtensionQuery): Promise<InstalledExtension[]>
Parameters
- query
- InstalledExtensionQuery
Returns
Promise<InstalledExtension[]>
registerAuthorization(string, string, string)
function registerAuthorization(publisherName: string, extensionName: string, registrationId: string): Promise<ExtensionAuthorization>
Parameters
- publisherName
-
string
- extensionName
-
string
- registrationId
-
string
Returns
Promise<ExtensionAuthorization>
requestAcquisition(ExtensionAcquisitionRequest)
function requestAcquisition(acquisitionRequest: ExtensionAcquisitionRequest): Promise<ExtensionAcquisitionRequest>
Parameters
- acquisitionRequest
- ExtensionAcquisitionRequest
Returns
Promise<ExtensionAcquisitionRequest>
requestExtension(string, string, string)
function requestExtension(publisherName: string, extensionName: string, requestMessage: string): Promise<RequestedExtension>
Parameters
- publisherName
-
string
- extensionName
-
string
- requestMessage
-
string
Returns
Promise<RequestedExtension>
resolveAllRequests(string, string, string, ExtensionRequestState)
function resolveAllRequests(rejectMessage: string, publisherName: string, extensionName: string, state: ExtensionRequestState): Promise<number>
Parameters
- rejectMessage
-
string
- publisherName
-
string
- extensionName
-
string
- state
- ExtensionRequestState
Returns
Promise<number>
resolveRequest(string, string, string, string, ExtensionRequestState)
function resolveRequest(rejectMessage: string, publisherName: string, extensionName: string, requesterId: string, state: ExtensionRequestState): Promise<number>
Parameters
- rejectMessage
-
string
- publisherName
-
string
- extensionName
-
string
- requesterId
-
string
- state
- ExtensionRequestState
Returns
Promise<number>
setDocumentByName(any, string, string, string, string, string)
function setDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>
Parameters
- doc
-
any
- publisherName
-
string
- extensionName
-
string
- scopeType
-
string
- scopeValue
-
string
- collectionName
-
string
Returns
Promise<any>
uninstallExtensionByName(string, string, string, string)
Uninstall the specified extension from the account / project collection.
function uninstallExtensionByName(publisherName: string, extensionName: string, reason?: string, reasonCode?: string): Promise<void>
Parameters
- publisherName
-
string
Name of the publisher. Example: "fabrikam".
- extensionName
-
string
Name of the extension. Example: "ops-tools".
- reason
-
string
- reasonCode
-
string
Returns
Promise<void>
updateDocumentByName(any, string, string, string, string, string)
function updateDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>
Parameters
- doc
-
any
- publisherName
-
string
- extensionName
-
string
- scopeType
-
string
- scopeValue
-
string
- collectionName
-
string
Returns
Promise<any>
updateInstalledExtension(InstalledExtension)
Update an installed extension. Typically this API is used to enable or disable an extension.
function updateInstalledExtension(extension: InstalledExtension): Promise<InstalledExtension>
Parameters
- extension
- InstalledExtension
Returns
Promise<InstalledExtension>