UNPKG

14.3 kBTypeScriptView Raw
1import basem = require('./ClientApiBases');
2import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
3import ExtensionManagementInterfaces = require("./interfaces/ExtensionManagementInterfaces");
4import GalleryInterfaces = require("./interfaces/GalleryInterfaces");
5export interface IExtensionManagementApi extends basem.ClientApiBase {
6 getAcquisitionOptions(itemId: string, testCommerce?: boolean, isFreeOrTrialInstall?: boolean, isAccountOwner?: boolean, isLinked?: boolean, isConnectedServer?: boolean, isBuyOperationValid?: boolean): Promise<ExtensionManagementInterfaces.AcquisitionOptions>;
7 requestAcquisition(acquisitionRequest: ExtensionManagementInterfaces.ExtensionAcquisitionRequest): Promise<ExtensionManagementInterfaces.ExtensionAcquisitionRequest>;
8 getAuditLog(publisherName: string, extensionName: string): Promise<ExtensionManagementInterfaces.ExtensionAuditLog>;
9 registerAuthorization(publisherName: string, extensionName: string, registrationId: string): Promise<ExtensionManagementInterfaces.ExtensionAuthorization>;
10 createDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>;
11 deleteDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): Promise<void>;
12 getDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): Promise<any>;
13 getDocumentsByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any[]>;
14 setDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>;
15 updateDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>;
16 queryCollectionsByName(collectionQuery: ExtensionManagementInterfaces.ExtensionDataCollectionQuery, publisherName: string, extensionName: string): Promise<ExtensionManagementInterfaces.ExtensionDataCollection[]>;
17 getStates(includeDisabled?: boolean, includeErrors?: boolean, includeInstallationIssues?: boolean, forceRefresh?: boolean): Promise<ExtensionManagementInterfaces.ExtensionState[]>;
18 queryExtensions(query: ExtensionManagementInterfaces.InstalledExtensionQuery): Promise<ExtensionManagementInterfaces.InstalledExtension[]>;
19 getInstalledExtensions(includeDisabledExtensions?: boolean, includeErrors?: boolean, assetTypes?: string[], includeInstallationIssues?: boolean): Promise<ExtensionManagementInterfaces.InstalledExtension[]>;
20 updateInstalledExtension(extension: ExtensionManagementInterfaces.InstalledExtension): Promise<ExtensionManagementInterfaces.InstalledExtension>;
21 getInstalledExtensionByName(publisherName: string, extensionName: string, assetTypes?: string[]): Promise<ExtensionManagementInterfaces.InstalledExtension>;
22 installExtensionByName(publisherName: string, extensionName: string, version?: string): Promise<ExtensionManagementInterfaces.InstalledExtension>;
23 uninstallExtensionByName(publisherName: string, extensionName: string, reason?: string, reasonCode?: string): Promise<void>;
24 getPolicies(userId: string): Promise<GalleryInterfaces.UserExtensionPolicy>;
25 resolveRequest(rejectMessage: string, publisherName: string, extensionName: string, requesterId: string, state: ExtensionManagementInterfaces.ExtensionRequestState): Promise<number>;
26 getRequests(): Promise<ExtensionManagementInterfaces.RequestedExtension[]>;
27 resolveAllRequests(rejectMessage: string, publisherName: string, extensionName: string, state: ExtensionManagementInterfaces.ExtensionRequestState): Promise<number>;
28 deleteRequest(publisherName: string, extensionName: string): Promise<void>;
29 requestExtension(publisherName: string, extensionName: string, requestMessage: string): Promise<ExtensionManagementInterfaces.RequestedExtension>;
30 getToken(): Promise<string>;
31}
32export declare class ExtensionManagementApi extends basem.ClientApiBase implements IExtensionManagementApi {
33 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
34 static readonly RESOURCE_AREA_ID = "6c2b0933-3600-42ae-bf8b-93d4f7e83594";
35 /**
36 * This API is called by acquisition/install page to get possible user actions like Buy/Request
37 *
38 * @param {string} itemId - Fully qualified name of extension (<publisher_id>.<extension_id>)
39 * @param {boolean} testCommerce - Parameter to test paid preview extension without making azure plans public
40 * @param {boolean} isFreeOrTrialInstall - Parameter represents install or trial workflow (required for legacy install flows)
41 * @param {boolean} isAccountOwner - Parameter represents whether user is owner or PCA of an account
42 * @param {boolean} isLinked - Parameter represents whether account is linked with a subscription
43 * @param {boolean} isConnectedServer - Parameter represents whether Buy operation should be evaluated
44 * @param {boolean} isBuyOperationValid
45 */
46 getAcquisitionOptions(itemId: string, testCommerce?: boolean, isFreeOrTrialInstall?: boolean, isAccountOwner?: boolean, isLinked?: boolean, isConnectedServer?: boolean, isBuyOperationValid?: boolean): Promise<ExtensionManagementInterfaces.AcquisitionOptions>;
47 /**
48 * @param {ExtensionManagementInterfaces.ExtensionAcquisitionRequest} acquisitionRequest
49 */
50 requestAcquisition(acquisitionRequest: ExtensionManagementInterfaces.ExtensionAcquisitionRequest): Promise<ExtensionManagementInterfaces.ExtensionAcquisitionRequest>;
51 /**
52 * @param {string} publisherName
53 * @param {string} extensionName
54 */
55 getAuditLog(publisherName: string, extensionName: string): Promise<ExtensionManagementInterfaces.ExtensionAuditLog>;
56 /**
57 * @param {string} publisherName
58 * @param {string} extensionName
59 * @param {string} registrationId
60 */
61 registerAuthorization(publisherName: string, extensionName: string, registrationId: string): Promise<ExtensionManagementInterfaces.ExtensionAuthorization>;
62 /**
63 * @param {any} doc
64 * @param {string} publisherName
65 * @param {string} extensionName
66 * @param {string} scopeType
67 * @param {string} scopeValue
68 * @param {string} collectionName
69 */
70 createDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>;
71 /**
72 * @param {string} publisherName
73 * @param {string} extensionName
74 * @param {string} scopeType
75 * @param {string} scopeValue
76 * @param {string} collectionName
77 * @param {string} documentId
78 */
79 deleteDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): Promise<void>;
80 /**
81 * @param {string} publisherName
82 * @param {string} extensionName
83 * @param {string} scopeType
84 * @param {string} scopeValue
85 * @param {string} collectionName
86 * @param {string} documentId
87 */
88 getDocumentByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string, documentId: string): Promise<any>;
89 /**
90 * @param {string} publisherName
91 * @param {string} extensionName
92 * @param {string} scopeType
93 * @param {string} scopeValue
94 * @param {string} collectionName
95 */
96 getDocumentsByName(publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any[]>;
97 /**
98 * @param {any} doc
99 * @param {string} publisherName
100 * @param {string} extensionName
101 * @param {string} scopeType
102 * @param {string} scopeValue
103 * @param {string} collectionName
104 */
105 setDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>;
106 /**
107 * @param {any} doc
108 * @param {string} publisherName
109 * @param {string} extensionName
110 * @param {string} scopeType
111 * @param {string} scopeValue
112 * @param {string} collectionName
113 */
114 updateDocumentByName(doc: any, publisherName: string, extensionName: string, scopeType: string, scopeValue: string, collectionName: string): Promise<any>;
115 /**
116 * 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.
117 *
118 * @param {ExtensionManagementInterfaces.ExtensionDataCollectionQuery} collectionQuery
119 * @param {string} publisherName - Name of the publisher. Example: "fabrikam".
120 * @param {string} extensionName - Name of the extension. Example: "ops-tools".
121 */
122 queryCollectionsByName(collectionQuery: ExtensionManagementInterfaces.ExtensionDataCollectionQuery, publisherName: string, extensionName: string): Promise<ExtensionManagementInterfaces.ExtensionDataCollection[]>;
123 /**
124 * List state and version information for all installed extensions.
125 *
126 * @param {boolean} includeDisabled - If true (the default), include disabled extensions in the results.
127 * @param {boolean} includeErrors - If true, include installed extensions in an error state in the results.
128 * @param {boolean} includeInstallationIssues
129 * @param {boolean} forceRefresh
130 */
131 getStates(includeDisabled?: boolean, includeErrors?: boolean, includeInstallationIssues?: boolean, forceRefresh?: boolean): Promise<ExtensionManagementInterfaces.ExtensionState[]>;
132 /**
133 * @param {ExtensionManagementInterfaces.InstalledExtensionQuery} query
134 */
135 queryExtensions(query: ExtensionManagementInterfaces.InstalledExtensionQuery): Promise<ExtensionManagementInterfaces.InstalledExtension[]>;
136 /**
137 * List the installed extensions in the account / project collection.
138 *
139 * @param {boolean} includeDisabledExtensions - If true (the default), include disabled extensions in the results.
140 * @param {boolean} includeErrors - If true, include installed extensions with errors.
141 * @param {string[]} assetTypes - 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.
142 * @param {boolean} includeInstallationIssues
143 */
144 getInstalledExtensions(includeDisabledExtensions?: boolean, includeErrors?: boolean, assetTypes?: string[], includeInstallationIssues?: boolean): Promise<ExtensionManagementInterfaces.InstalledExtension[]>;
145 /**
146 * Update an installed extension. Typically this API is used to enable or disable an extension.
147 *
148 * @param {ExtensionManagementInterfaces.InstalledExtension} extension
149 */
150 updateInstalledExtension(extension: ExtensionManagementInterfaces.InstalledExtension): Promise<ExtensionManagementInterfaces.InstalledExtension>;
151 /**
152 * Get an installed extension by its publisher and extension name.
153 *
154 * @param {string} publisherName - Name of the publisher. Example: "fabrikam".
155 * @param {string} extensionName - Name of the extension. Example: "ops-tools".
156 * @param {string[]} assetTypes - 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.
157 */
158 getInstalledExtensionByName(publisherName: string, extensionName: string, assetTypes?: string[]): Promise<ExtensionManagementInterfaces.InstalledExtension>;
159 /**
160 * Install the specified extension into the account / project collection.
161 *
162 * @param {string} publisherName - Name of the publisher. Example: "fabrikam".
163 * @param {string} extensionName - Name of the extension. Example: "ops-tools".
164 * @param {string} version
165 */
166 installExtensionByName(publisherName: string, extensionName: string, version?: string): Promise<ExtensionManagementInterfaces.InstalledExtension>;
167 /**
168 * Uninstall the specified extension from the account / project collection.
169 *
170 * @param {string} publisherName - Name of the publisher. Example: "fabrikam".
171 * @param {string} extensionName - Name of the extension. Example: "ops-tools".
172 * @param {string} reason
173 * @param {string} reasonCode
174 */
175 uninstallExtensionByName(publisherName: string, extensionName: string, reason?: string, reasonCode?: string): Promise<void>;
176 /**
177 * @param {string} userId
178 */
179 getPolicies(userId: string): Promise<GalleryInterfaces.UserExtensionPolicy>;
180 /**
181 * @param {string} rejectMessage
182 * @param {string} publisherName
183 * @param {string} extensionName
184 * @param {string} requesterId
185 * @param {ExtensionManagementInterfaces.ExtensionRequestState} state
186 */
187 resolveRequest(rejectMessage: string, publisherName: string, extensionName: string, requesterId: string, state: ExtensionManagementInterfaces.ExtensionRequestState): Promise<number>;
188 /**
189 */
190 getRequests(): Promise<ExtensionManagementInterfaces.RequestedExtension[]>;
191 /**
192 * @param {string} rejectMessage
193 * @param {string} publisherName
194 * @param {string} extensionName
195 * @param {ExtensionManagementInterfaces.ExtensionRequestState} state
196 */
197 resolveAllRequests(rejectMessage: string, publisherName: string, extensionName: string, state: ExtensionManagementInterfaces.ExtensionRequestState): Promise<number>;
198 /**
199 * @param {string} publisherName
200 * @param {string} extensionName
201 */
202 deleteRequest(publisherName: string, extensionName: string): Promise<void>;
203 /**
204 * @param {string} publisherName
205 * @param {string} extensionName
206 * @param {string} requestMessage
207 */
208 requestExtension(publisherName: string, extensionName: string, requestMessage: string): Promise<ExtensionManagementInterfaces.RequestedExtension>;
209 /**
210 */
211 getToken(): Promise<string>;
212}