@microsoft/windows-admin-center-sdk 2.186.0 → 2.295.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular/assets/strings/cs-CZ/strings.json +1 -1
- package/angular/assets/strings/de-DE/strings.json +1 -1
- package/angular/assets/strings/es-ES/strings.json +1 -1
- package/angular/assets/strings/fr-FR/strings.json +1 -1
- package/angular/assets/strings/hu-HU/strings.json +1 -1
- package/angular/assets/strings/it-IT/strings.json +1 -1
- package/angular/assets/strings/ja-JP/strings.json +1 -1
- package/angular/assets/strings/ko-KR/strings.json +1 -1
- package/angular/assets/strings/nl-NL/strings.json +1 -1
- package/angular/assets/strings/pl-PL/strings.json +1 -1
- package/angular/assets/strings/pt-BR/strings.json +1 -1
- package/angular/assets/strings/pt-PT/strings.json +1 -1
- package/angular/assets/strings/ru-RU/strings.json +1 -1
- package/angular/assets/strings/strings.json +1 -1
- package/angular/assets/strings/sv-SE/strings.json +1 -1
- package/angular/assets/strings/tr-TR/strings.json +1 -1
- package/angular/assets/strings/zh-CN/strings.json +1 -1
- package/angular/assets/strings/zh-TW/strings.json +1 -1
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js +1103 -1209
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js.map +1 -1
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js +2 -2
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js.map +1 -1
- package/angular/esm2015/src/controls/actions/actions.module.js +2 -2
- package/angular/esm2015/src/controls/actions/containers/action-bar/action-bar.component.js +2 -2
- package/angular/esm2015/src/controls/actions/items/action-button/action-button-renderer.component.js +5 -5
- package/angular/esm2015/src/controls/actions/items/action-dropdown/action-dropdown.component.js +31 -13
- package/angular/esm2015/src/controls/actions/items/action-item.component.js +7 -3
- package/angular/esm2015/src/controls/badge/badge-base.component.js +2 -13
- package/angular/esm2015/src/controls/badge/bugfixes-feature-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/coming-soon-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/credssp-enabled-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/critical-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/custom-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/feedback-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/improvement-feature-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/new-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/new-feature-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/preview-badge.component.js +42 -70
- package/angular/esm2015/src/controls/badge/warning-badge.component.js +42 -70
- package/angular/esm2015/src/controls/breadcrumb/breadcrumb.component.js +6 -6
- package/angular/esm2015/src/controls/breadcrumb-header/breadcrumb-header.component.js +2 -2
- package/angular/esm2015/src/controls/data-table/data-table-column.component.js +5 -3
- package/angular/esm2015/src/controls/data-table/data-table.component.js +20 -26
- package/angular/esm2015/src/controls/data-table/extensions/data-table-column-picker-extension.js +2 -1
- package/angular/esm2015/src/controls/details/details.component.js +2 -2
- package/angular/esm2015/src/controls/dialog/base-dialog.component.js +1 -1
- package/angular/esm2015/src/controls/dialog/confirmation-dialog/confirmation-dialog.component.js +20 -30
- package/angular/esm2015/src/controls/dialog/dialog.service.js +7 -3
- package/angular/esm2015/src/controls/dropdown/dropdown.component.js +2 -2
- package/angular/esm2015/src/controls/form/form-field/array/array-form-field.component.js +50 -40
- package/angular/esm2015/src/controls/form/form-field/checklist/checklist-form-field.component.js +3 -3
- package/angular/esm2015/src/controls/form/form-field/combobox/combobox-form-field.component.js +14 -13
- package/angular/esm2015/src/controls/form/form-field/datetime/datetime-form-field.component.js +2 -2
- package/angular/esm2015/src/controls/form/form-field/form-field.component.js +16 -4
- package/angular/esm2015/src/controls/form/form-field/options-form-field/form-field-option.component.js +5 -3
- package/angular/esm2015/src/controls/form/form-field/ordered-list/ordered-list-form-field.component.js +25 -21
- package/angular/esm2015/src/controls/form/form-field/radio-group/classic/radio-group-form-field.component.js +5 -5
- package/angular/esm2015/src/controls/form/form-field/search/search-form-field.component.js +2 -2
- package/angular/esm2015/src/controls/form/form-field/tags/tags-form-field.component.js +2 -2
- package/angular/esm2015/src/controls/form/validation-alert/validation-alert.component.js +4 -10
- package/angular/esm2015/src/controls/form/validation-alert/validation-alert.js +1 -1
- package/angular/esm2015/src/controls/horizontal-bar-chart/stacked-horizontal-bar-chart.component.js +17 -1
- package/angular/esm2015/src/controls/icon/layered-icon/layered-icon.component.js +12 -1
- package/angular/esm2015/src/controls/icon/layered-icon/status/status-icon.component.js +53 -9
- package/angular/esm2015/src/controls/loading-wheel/loading-wheel.component.js +17 -1
- package/angular/esm2015/src/controls/master-view/master-view.component.js +34 -30
- package/angular/esm2015/src/controls/pivot/pivot-tab.component.js +1 -1
- package/angular/esm2015/src/controls/pivot/pivot.component.js +21 -9
- package/angular/esm2015/src/controls/property-grid/property-grid.component.js +13 -29
- package/angular/esm2015/src/controls/schema-form/schema-form-content.component.js +7 -4
- package/angular/esm2015/src/controls/settings/common-settings/common-settings.component.js +23 -35
- package/angular/esm2015/src/controls/settings/settings.component.js +28 -1
- package/angular/esm2015/src/controls/settings/settings.module.js +8 -3
- package/angular/esm2015/src/controls/tooltip/tooltip-host.component.js +16 -5
- package/angular/esm2015/src/controls/wizard/wizard.component.js +38 -6
- package/angular/esm2015/src/directives/clamp/clamp.directive.js +26 -7
- package/angular/esm2015/src/directives/discard/discard.directive.js +2 -2
- package/angular/esm2015/src/directives/markdown/markdown.directive.js +5 -18
- package/angular/esm2015/src/generated/strings.js +1 -1
- package/angular/esm2015/src/guards/experiment.guard.service.js +14 -1
- package/angular/esm2015/src/pipes/boolean-converter-pipe.js +11 -1
- package/angular/esm2015/src/pipes/byte-unit-converter-pipe.js +11 -1
- package/angular/esm2015/src/pipes/enum-converter-pipe.js +16 -1
- package/angular/esm2015/src/pipes/format-pipe.js +11 -1
- package/angular/esm2015/src/pipes/highlight-pipe.js +11 -1
- package/angular/esm2015/src/pipes/yesno-converter-pipe.js +11 -1
- package/angular/esm2015/src/service/gateway.service.js +8 -5
- package/angular/esm2015/src/service/notification.service.js +23 -1
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js +1042 -1069
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js.map +1 -1
- package/angular/package.json +0 -1
- package/angular/src/controls/actions/items/action-dropdown/action-dropdown.component.d.ts +2 -0
- package/angular/src/controls/actions/items/action-item.component.d.ts +11 -1
- package/angular/src/controls/badge/badge-base.component.d.ts +0 -4
- package/angular/src/controls/data-table/data-table-column.component.d.ts +2 -1
- package/angular/src/controls/data-table/data-table.component.d.ts +4 -0
- package/angular/src/controls/dialog/base-dialog.component.d.ts +1 -1
- package/angular/src/controls/form/form-field/form-field.component.d.ts +10 -1
- package/angular/src/controls/form/form-field/options-form-field/form-field-option.component.d.ts +5 -1
- package/angular/src/controls/form/validation-alert/validation-alert.component.d.ts +0 -4
- package/angular/src/controls/form/validation-alert/validation-alert.d.ts +0 -1
- package/angular/src/controls/horizontal-bar-chart/stacked-horizontal-bar-chart.component.d.ts +16 -0
- package/angular/src/controls/icon/layered-icon/layered-icon.component.d.ts +11 -0
- package/angular/src/controls/icon/layered-icon/status/status-icon.component.d.ts +13 -2
- package/angular/src/controls/loading-wheel/loading-wheel.component.d.ts +16 -0
- package/angular/src/controls/master-view/master-view.component.d.ts +1 -0
- package/angular/src/controls/pivot/pivot-tab.component.d.ts +0 -1
- package/angular/src/controls/pivot/pivot.component.d.ts +4 -0
- package/angular/src/controls/settings/common-settings/common-settings.component.d.ts +6 -5
- package/angular/src/controls/settings/settings.component.d.ts +27 -0
- package/angular/src/controls/settings/settings.module.d.ts +7 -6
- package/angular/src/controls/tooltip/tooltip-host.component.d.ts +1 -1
- package/angular/src/controls/wizard/wizard.component.d.ts +23 -0
- package/angular/src/directives/clamp/clamp.directive.d.ts +5 -0
- package/angular/src/directives/markdown/markdown.directive.d.ts +2 -3
- package/angular/src/generated/strings.d.ts +9 -0
- package/angular/src/guards/experiment.guard.service.d.ts +13 -0
- package/angular/src/pipes/boolean-converter-pipe.d.ts +10 -0
- package/angular/src/pipes/byte-unit-converter-pipe.d.ts +10 -0
- package/angular/src/pipes/enum-converter-pipe.d.ts +15 -0
- package/angular/src/pipes/format-pipe.d.ts +10 -0
- package/angular/src/pipes/highlight-pipe.d.ts +10 -0
- package/angular/src/pipes/yesno-converter-pipe.d.ts +10 -0
- package/angular/src/service/gateway.service.d.ts +3 -1
- package/angular/src/service/notification.service.d.ts +22 -0
- package/core/base/environment.d.ts +7 -0
- package/core/base/environment.js.map +1 -1
- package/core/base/versioned-object.js +2 -2
- package/core/base/versioned-object.js.map +1 -1
- package/core/data/cim-stream.js +8 -1
- package/core/data/cim-stream.js.map +1 -1
- package/core/data/core-environment.d.ts +4 -0
- package/core/data/core-environment.js +1 -0
- package/core/data/core-environment.js.map +1 -1
- package/core/data/crypto.js +10 -9
- package/core/data/crypto.js.map +1 -1
- package/core/data/file-transfer.js +5 -1
- package/core/data/file-transfer.js.map +1 -1
- package/core/data/gateway-connection.d.ts +11 -1
- package/core/data/gateway-connection.js +51 -9
- package/core/data/gateway-connection.js.map +1 -1
- package/core/data/http-constants.d.ts +5 -1
- package/core/data/http-constants.js +5 -1
- package/core/data/http-constants.js.map +1 -1
- package/core/data/net.d.ts +15 -11
- package/core/data/net.js +44 -41
- package/core/data/net.js.map +1 -1
- package/core/data/node-connection.d.ts +2 -2
- package/core/data/node-connection.js.map +1 -1
- package/core/data/powershell-stream.js +11 -3
- package/core/data/powershell-stream.js.map +1 -1
- package/core/data/powershell.d.ts +17 -1
- package/core/data/powershell.js +35 -9
- package/core/data/powershell.js.map +1 -1
- package/core/data/settings-manager.d.ts +9 -0
- package/core/data/settings-manager.js +18 -1
- package/core/data/settings-manager.js.map +1 -1
- package/core/generated/powershell-scripts.d.ts +5 -4
- package/core/generated/powershell-scripts.js +5 -4
- package/core/generated/powershell-scripts.js.map +1 -1
- package/core/host/host-core-manager.d.ts +36 -0
- package/core/host/host-core-manager.js +134 -0
- package/core/host/host-core-manager.js.map +1 -0
- package/core/host/host-core-message-type.d.ts +12 -0
- package/core/host/host-core-message-type.js +17 -0
- package/core/host/host-core-message-type.js.map +1 -0
- package/core/host/host-core-messages.d.ts +14 -0
- package/core/host/host-core-messages.js +3 -0
- package/core/host/host-core-messages.js.map +1 -0
- package/core/manifest/manifest-loader.d.ts +2 -1
- package/core/manifest/manifest-loader.js +27 -18
- package/core/manifest/manifest-loader.js.map +1 -1
- package/core/notification/notification.js +4 -0
- package/core/notification/notification.js.map +1 -1
- package/core/security/authorization-manager.d.ts +44 -0
- package/core/security/authorization-manager.js +111 -5
- package/core/security/authorization-manager.js.map +1 -1
- package/core/security/sign-on-manager.d.ts +109 -0
- package/core/security/sign-on-manager.js +119 -0
- package/core/security/sign-on-manager.js.map +1 -0
- package/core/security/tag-manager.js.map +1 -1
- package/core/shared/cluster-inventory/cluster-inventory-cache.js +3 -2
- package/core/shared/cluster-inventory/cluster-inventory-cache.js.map +1 -1
- package/core/shared/gateway-inventory/gateway-inventory-cache.d.ts +1 -1
- package/core/shared/gateway-inventory/gateway-inventory-cache.js +1 -1
- package/core/shared/gateway-inventory/gateway-inventory-cache.js.map +1 -1
- package/core/shared/server-inventory/server-inventory-cache.js +2 -1
- package/core/shared/server-inventory/server-inventory-cache.js.map +1 -1
- package/core/shared/tool-inventory/tool-inventory-cache.js +1 -1
- package/core/shared/tool-inventory/tool-inventory-cache.js.map +1 -1
- package/e2e/assets/strings/cs-CZ/strings.json +1 -1
- package/e2e/assets/strings/de-DE/strings.json +1 -1
- package/e2e/assets/strings/es-ES/strings.json +1 -1
- package/e2e/assets/strings/fr-FR/strings.json +1 -1
- package/e2e/assets/strings/hu-HU/strings.json +1 -1
- package/e2e/assets/strings/it-IT/strings.json +1 -1
- package/e2e/assets/strings/ja-JP/strings.json +1 -1
- package/e2e/assets/strings/ko-KR/strings.json +1 -1
- package/e2e/assets/strings/nl-NL/strings.json +1 -1
- package/e2e/assets/strings/pl-PL/strings.json +1 -1
- package/e2e/assets/strings/pt-BR/strings.json +1 -1
- package/e2e/assets/strings/pt-PT/strings.json +1 -1
- package/e2e/assets/strings/ru-RU/strings.json +1 -1
- package/e2e/assets/strings/strings.json +1 -1
- package/e2e/assets/strings/sv-SE/strings.json +1 -1
- package/e2e/assets/strings/tr-TR/strings.json +1 -1
- package/e2e/assets/strings/zh-CN/strings.json +1 -1
- package/e2e/assets/strings/zh-TW/strings.json +1 -1
- package/package.json +5 -5
- package/styles/css/fonts.css +2 -2
- package/styles/css/main.css +1 -1
- package/styles/fonts/ServMDL2/ServMDL2-4.62.woff +0 -0
- package/styles/fonts/ServMDL2/ServMDL2.json +238 -2039
- package/styles/fonts/ServMDL2/ServMDL2.scss +238 -2039
- package/tools/gulp-manifest-resource/index.js +3 -1
- package/tools/gulp-manifest-resource/index.js.map +1 -1
- package/tools/gulp-ps-cim/index.js +1 -1
- package/tools/gulp-ps-cim/index.js.map +1 -1
- package/tools/gulp-ps-cim/powershell-cim-config-schema.json +1 -1
- package/tools/gulp-ps-code/index.js +36 -2
- package/tools/gulp-ps-code/index.js.map +1 -1
- package/tools/gulp-ps-code/ps-code-convert.js +4 -8
- package/tools/gulp-ps-code/ps-code-convert.js.map +1 -1
- package/tools/gulp-ps-resjson/index.js +79 -74
- package/tools/gulp-ps-resjson/index.js.map +1 -1
- package/tools/module-template/build/pipelines/codeinspector.yml +27 -0
- package/tools/module-template/gulpfile.ts/common/lint.ts +3 -3
- package/tools/module-template/gulpfile.ts/common/pack.ts +14 -14
- package/tools/module-template/gulpfile.ts/common/ui-test-automation.ts +40 -0
- package/tools/module-template/gulpfile.ts/common/utilities.ts +10 -10
- package/tools/module-template/gulpfile.ts/common/validate.ts +14 -4
- package/tools/module-template/gulpfile.ts/index.ts +20 -8
- package/tools/wac-cli/src/upgrade/file-updater.d.ts +1 -0
- package/tools/wac-cli/src/upgrade/file-updater.js +7 -1
- package/tools/wac-cli/src/upgrade/file-updater.js.map +1 -1
- package/styles/fonts/ServMDL2/ServMDL2-4.33.woff +0 -0
|
@@ -6,7 +6,7 @@ import { RpcObservableElevateServer } from '../rpc/elevate/rpc-observable-elevat
|
|
|
6
6
|
import { RpcServiceForwarder } from '../rpc/rpc-forwarder';
|
|
7
7
|
import { CoreEnvironment } from './core-environment';
|
|
8
8
|
import { GatewayUrlBuilder } from './gateway-url-builder';
|
|
9
|
-
import { HttpMethod } from './http';
|
|
9
|
+
import { Http, HttpMethod } from './http';
|
|
10
10
|
import { headerConstants } from './http-constants';
|
|
11
11
|
import { Net } from './net';
|
|
12
12
|
/**
|
|
@@ -18,10 +18,13 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
18
18
|
*
|
|
19
19
|
* @param http the Http object.
|
|
20
20
|
* @param rpc the Rpc class.
|
|
21
|
+
* @patam authorizationManager the authorization manager class object.
|
|
21
22
|
*/
|
|
22
|
-
constructor(http, rpc) {
|
|
23
|
+
constructor(http, rpc, authorizationManager) {
|
|
24
|
+
var _a, _b;
|
|
23
25
|
super('gateway-connection', rpc);
|
|
24
26
|
this.http = http;
|
|
27
|
+
this.authorizationManager = authorizationManager;
|
|
25
28
|
/**
|
|
26
29
|
* The replay subject for gateway url to settle.
|
|
27
30
|
*/
|
|
@@ -38,6 +41,8 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
38
41
|
* The elevate callback observable.
|
|
39
42
|
*/
|
|
40
43
|
this.elevateCallbackInternal = () => of(false);
|
|
44
|
+
// restore the AAD token if exist becase ealier access of token is required for gateway calls.
|
|
45
|
+
authorizationManager.signOnManager.applySignedHttpRequestToken((_b = (_a = MsftSme.self().Environment.configuration) === null || _a === void 0 ? void 0 : _a.signOn) === null || _b === void 0 ? void 0 : _b.signedHttpRequestToken);
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
43
48
|
* Sets the elevate callback observable.
|
|
@@ -206,6 +211,9 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
206
211
|
if (this.staticVersion) {
|
|
207
212
|
headers[headerConstants.STATIC_VERSION] = this.staticVersion;
|
|
208
213
|
}
|
|
214
|
+
if (this.authorizationManager.signOnManager.isSignOnTokenEnabled) {
|
|
215
|
+
this.authorizationManager.signOnManager.SetAadAuthorizationHeader(headers);
|
|
216
|
+
}
|
|
209
217
|
const url = Net.gatewayApi(this.gatewayUrl, relativeUrl);
|
|
210
218
|
this.http.deleteQuick(url, headers);
|
|
211
219
|
}
|
|
@@ -229,6 +237,18 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
229
237
|
if (this.staticVersion) {
|
|
230
238
|
request.headers[headerConstants.STATIC_VERSION] = this.staticVersion;
|
|
231
239
|
}
|
|
240
|
+
// use default retry options if none are provided
|
|
241
|
+
const retryHandlers = [];
|
|
242
|
+
if (this.authorizationManager.signOnManager.isSignOnTokenEnabled) {
|
|
243
|
+
this.authorizationManager.signOnManager.SetAadAuthorizationHeader(request.headers);
|
|
244
|
+
retryHandlers.push({
|
|
245
|
+
canHandle: (code, error) => this.authorizationManager.signOnManager.canHandleUnauthorizedLogin(code, error),
|
|
246
|
+
handle: (code, originalRequest, error) => this.authorizationManager.signOnManager.handleUnauthorizedLogin(code, originalRequest, error)
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
if (request.retryHandlers != null && request.retryHandlers.length > 0) {
|
|
250
|
+
retryHandlers.push(...request.retryHandlers);
|
|
251
|
+
}
|
|
232
252
|
return Object.assign(request, {
|
|
233
253
|
method: method,
|
|
234
254
|
url: relativeUrl,
|
|
@@ -240,8 +260,7 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
240
260
|
withCredentials: request.withCredentials === false ? false : true,
|
|
241
261
|
crossDomain: request.crossDomain === false ? false : true,
|
|
242
262
|
createXHR: () => new XMLHttpRequest(),
|
|
243
|
-
|
|
244
|
-
retryHandlers: request.retryHandlers || [],
|
|
263
|
+
retryHandlers,
|
|
245
264
|
maxRetryCount: request.maxRetryCount === 0 ? 0 : request.maxRetryCount || defaultMaxRetry
|
|
246
265
|
});
|
|
247
266
|
}
|
|
@@ -272,6 +291,18 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
272
291
|
}
|
|
273
292
|
return requestObservable;
|
|
274
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Gets default secure request options.
|
|
296
|
+
*
|
|
297
|
+
* @returns updated request object.
|
|
298
|
+
*/
|
|
299
|
+
get defaultHttpSecureOptions() {
|
|
300
|
+
const request = Object.assign({ headers: {} }, Http.defaultHttpOptions);
|
|
301
|
+
if (this.authorizationManager.signOnManager.isSignOnTokenEnabled) {
|
|
302
|
+
this.authorizationManager.signOnManager.SetAadAuthorizationHeader(request.headers);
|
|
303
|
+
}
|
|
304
|
+
return request;
|
|
305
|
+
}
|
|
275
306
|
/**
|
|
276
307
|
* Check if elevation is required from the error object.
|
|
277
308
|
*
|
|
@@ -311,6 +342,7 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
311
342
|
// user might not respond for elevation prompt, maximum waiting time is 2.5 min.
|
|
312
343
|
// getElevatedStatus() takes 5000ms when the gateway is not responding.
|
|
313
344
|
// 2.5 min = count [30] * 5000 msec.
|
|
345
|
+
const uniQueId = MsftSme.getUniqueId();
|
|
314
346
|
const maxWaitingCount = 30;
|
|
315
347
|
let count = maxWaitingCount;
|
|
316
348
|
return this.getElevatedStatus()
|
|
@@ -325,17 +357,22 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
325
357
|
// 5rd query: Maybe timeout because the gateway is down.
|
|
326
358
|
// 25 = 30 - 5
|
|
327
359
|
const pollingStartCount = 25;
|
|
328
|
-
if ((count <= pollingStartCount
|
|
360
|
+
if (((count <= pollingStartCount
|
|
361
|
+
&& (!status.error || status.isGatewayProcessElevated))
|
|
362
|
+
|| status.completed)
|
|
363
|
+
&& (status.id === uniQueId)) {
|
|
329
364
|
return of({
|
|
330
365
|
completed: true,
|
|
366
|
+
id: uniQueId,
|
|
331
367
|
isGatewayProcessElevated: status.isGatewayProcessElevated
|
|
332
368
|
});
|
|
333
369
|
}
|
|
334
370
|
// no response for more than 2.5 minutes.
|
|
335
371
|
// gateway was stopped for long or user never responded to UAC prompt.
|
|
336
|
-
if (count-- <= 0) {
|
|
372
|
+
if (count-- <= 0 && status.id === uniQueId) {
|
|
337
373
|
return of({
|
|
338
374
|
completed: true,
|
|
375
|
+
id: uniQueId,
|
|
339
376
|
isGatewayProcessElevated: status.isGatewayProcessElevated
|
|
340
377
|
});
|
|
341
378
|
}
|
|
@@ -353,7 +390,7 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
353
390
|
let timer = setTimeout(() => {
|
|
354
391
|
// handle pending timeout of the query when the gateway doesn't respond.
|
|
355
392
|
if (subscription) {
|
|
356
|
-
observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined });
|
|
393
|
+
observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined, id: undefined });
|
|
357
394
|
observer.complete();
|
|
358
395
|
subscription.unsubscribe();
|
|
359
396
|
subscription = null;
|
|
@@ -362,7 +399,12 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
362
399
|
}, callCancelTime);
|
|
363
400
|
subscription = this.getStatus()
|
|
364
401
|
.subscribe(data => {
|
|
365
|
-
observer.next({
|
|
402
|
+
observer.next({
|
|
403
|
+
error: false,
|
|
404
|
+
isGatewayProcessElevated: data.isGatewayProcessElevated,
|
|
405
|
+
completed: undefined,
|
|
406
|
+
id: undefined
|
|
407
|
+
});
|
|
366
408
|
observer.complete();
|
|
367
409
|
subscription.unsubscribe();
|
|
368
410
|
subscription = null;
|
|
@@ -370,7 +412,7 @@ export class GatewayConnection extends RpcServiceForwarder {
|
|
|
370
412
|
clearTimeout(timer);
|
|
371
413
|
}
|
|
372
414
|
}, () => {
|
|
373
|
-
observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined });
|
|
415
|
+
observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined, id: undefined });
|
|
374
416
|
observer.complete();
|
|
375
417
|
subscription.unsubscribe();
|
|
376
418
|
subscription = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/data/gateway-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAyB,UAAU,EAAE,MAAM,MAAM,CAAC;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAI1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAI1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAA8C,MAAM,QAAQ,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA2F5B;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IAkItD;;;;;OAKG;IACH,YAAmB,IAAU,EAAE,GAAQ;QACnC,KAAK,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;QADlB,SAAI,GAAJ,IAAI,CAAM;QApH7B;;WAEG;QACK,sBAAiB,GAAG,IAAI,aAAa,CAAS,CAAC,CAAC,CAAC;QAEzD;;WAEG;QACK,kBAAa,GAA+B,IAAI,CAAC;QAEzD;;WAEG;QACK,kBAAa,GAA+B,IAAI,CAAC;QAEzD;;WAEG;QACK,4BAA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IG;IACO,aAAa;QACnB,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,OAAO,EAAE,CAAC;gBACN,WAAW,EAAE,IAAI,CAAC,UAAU;gBAC5B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;gBAC7C,aAAa,EAAE,IAAI,CAAC,aAAa;aACpC,CAAC,CAAC;SACN;aAAM;YACH,0DAA0D;YAC1D,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAC3D,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;aACnB;YAED,OAAO,IAAI,CAAC,iBAAiB;iBACxB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACd,WAAW,EAAE,GAAG;gBAChB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;gBAC7C,aAAa,EAAE,IAAI,CAAC,aAAa;aACpC,CAAC,CAAC,CAAC,CAAC;SACZ;IACL,CAAC;IAED;;;;;;OAMG;IACO,gBAAgB,CAAC,IAAyB,EAAE,IAAY,EAAE,IAAW;QAC3E,iEAAiE;QACjE,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACO,eAAe,CAAC,IAAyB,EAAE,IAAY,EAAE,KAAU;QACzE,IAAI,IAAI,kBAA8B,IAAI,IAAI,KAAK,iBAAiB,CAAC,WAAW,CAAC,iBAAiB,EAAE;YAChG,qEAAqE;YACrE,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;SACnB;QACD,wEAAwE;QACxE,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;;AAjjBc,6BAAW,GAAG;IACzB,iBAAiB,EAAE,mBAAmB;CACzC,CAAC","file":"gateway-connection.js","sourcesContent":["import { Observable, of, ReplaySubject, Subject, Subscription, throwError } from 'rxjs';\r\nimport { AjaxError, AjaxRequest, AjaxResponse } from 'rxjs/ajax';\r\nimport { catchError, expand, filter, map, mergeMap, switchMap, take } from 'rxjs/operators';\r\nimport { Strings } from '../generated/strings';\r\nimport { EnvironmentModule } from '../manifest/environment-modules';\r\nimport { RpcObservableElevateClient } from '../rpc/elevate/rpc-observable-elevate-client';\r\nimport {\r\n RpcObservableElevateError, RpcObservableElevateRequest, RpcObservableElevateResult\r\n} from '../rpc/elevate/rpc-observable-elevate-model';\r\nimport { RpcObservableElevateServer } from '../rpc/elevate/rpc-observable-elevate-server';\r\nimport { RpcForwardResponse } from '../rpc/forward/rpc-forward-model';\r\nimport { Rpc } from '../rpc/rpc';\r\nimport { RpcRelationshipType } from '../rpc/rpc-base';\r\nimport { RpcServiceForwarder } from '../rpc/rpc-forwarder';\r\nimport { CoreEnvironment } from './core-environment';\r\nimport { GatewayUrlBuilder } from './gateway-url-builder';\r\nimport { Http, HttpMethod, HttpResponseRetryHandler, HttpRetryOptions } from './http';\r\nimport { headerConstants } from './http-constants';\r\nimport { Net } from './net';\r\n\r\n/**\r\n * Gateway Request options that we use to extend the AjaxRequest interface\r\n */\r\nexport interface GatewayRequestOptions {\r\n /**\r\n * Retry handler implementation for a request.\r\n * These handlers are used to invoke specific functionality for non-200 status codes in the http response.\r\n */\r\n retryHandlers?: HttpResponseRetryHandler[];\r\n\r\n /**\r\n * Determines the maximum number of times that any of the retry handlers will be tried.\r\n * before giving up and surfacing the error to the original caller\r\n */\r\n maxRetryCount?: number;\r\n\r\n /**\r\n * Observable handler to insert asynchronous logic before the actual http response is sent.\r\n * For Example: Waiting for pending authentication to complete before adding an authentication header\r\n */\r\n beforeCall?: (request: GatewayRequest) => Observable<void>;\r\n}\r\n\r\n/**\r\n * Extension of AjaxRequest interface for calling the Gateway API\r\n */\r\nexport interface GatewayRequest extends AjaxRequest, GatewayRequestOptions {\r\n}\r\n\r\n/**\r\n * Initialization object data for the Gateway's base class.\r\n */\r\nexport interface GatewayRPCForwardedProperties {\r\n /**\r\n * The gateway URL.\r\n */\r\n gatewayName: string;\r\n\r\n /**\r\n * Indicate whether gatewayUrl option was specified. (default to be false)\r\n */\r\n gatewayUrlSpecified: boolean;\r\n\r\n /**\r\n * The stative version. (default to be null)\r\n */\r\n staticVersion: string;\r\n}\r\n\r\n/**\r\n * The gateway information on current gateway URL.\r\n */\r\nexport interface GatewayInformation {\r\n /**\r\n * The name of gateway node.\r\n */\r\n name: string;\r\n\r\n /**\r\n * Indicating if https is used.\r\n */\r\n secure: boolean;\r\n\r\n /**\r\n * The port number of gateway.\r\n */\r\n port: number;\r\n}\r\n\r\n/**\r\n * Condition of gateway.\r\n */\r\nexport interface GatewayCondition {\r\n /**\r\n * the gateway is running as service mode (installed on server operating system).\r\n */\r\n isServiceMode: boolean;\r\n\r\n /**\r\n * the gateway is elevated on the desktop mode.\r\n */\r\n isGatewayProcessElevated: boolean;\r\n\r\n /**\r\n * the user account is a member of the gateway administrators.\r\n */\r\n isGatewayAdmin: boolean;\r\n}\r\n\r\n/**\r\n * The Gateway Connection class for creating requests and calling the Gateway's REST API\r\n */\r\nexport class GatewayConnection extends RpcServiceForwarder {\r\n private static rpcCommands = {\r\n forbiddenReceived: 'forbiddenRecieved'\r\n };\r\n\r\n /**\r\n * internally maintained gateway URL.\r\n */\r\n private internalGatewayUrl: string;\r\n\r\n /**\r\n * internally maintained static version.\r\n */\r\n private internalStaticVersion: string;\r\n\r\n /**\r\n * gatewayUrl param is specified.\r\n */\r\n private internalGatewayUrlSpecified: boolean;\r\n\r\n /**\r\n * The replay subject for gateway url to settle.\r\n */\r\n private gatewayUrlAwaiter = new ReplaySubject<string>(1);\r\n\r\n /**\r\n * The RPC observable elevate client.\r\n */\r\n private elevateClient: RpcObservableElevateClient = null;\r\n\r\n /**\r\n * The RPC observable elevate server.\r\n */\r\n private elevateServer: RpcObservableElevateServer = null;\r\n\r\n /**\r\n * The elevate callback observable.\r\n */\r\n private elevateCallbackInternal: () => Observable<boolean> = () => of(false);\r\n\r\n /**\r\n * Sets the elevate callback observable.\r\n */\r\n public set elevateCallback(value: () => Observable<boolean>) {\r\n this.elevateCallbackInternal = value;\r\n if (!this.elevateServer) {\r\n this.elevateServer = new RpcObservableElevateServer(this.rpc);\r\n this.elevateServer.register((_context: RpcObservableElevateRequest) => {\r\n return this.elevateCallbackInternal()\r\n .pipe(\r\n catchError((error, _caught) =>\r\n throwError(<RpcObservableElevateError>{ error: Net.getErrorMessage(error) })),\r\n map(result =>\r\n <RpcObservableElevateResult>{ elevated: result })\r\n );\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Indicates that the gateway is disabled and therefore should not be called.\r\n */\r\n public get disabled(): boolean {\r\n const environment = MsftSme.self().Environment;\r\n return environment && environment.configuration.gateway.disabled;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL to connect to.\r\n */\r\n public get gatewayUrl(): string {\r\n return this.internalGatewayUrl;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL specified state.\r\n */\r\n public get staticVersion() {\r\n return this.internalStaticVersion;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL specified state.\r\n */\r\n public get gatewayUrlSpecified(): boolean {\r\n return this.internalGatewayUrlSpecified;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL observable while setting up.\r\n */\r\n public get gatewayUrlObservable(): Observable<string> {\r\n return this.gatewayUrlAwaiter.asObservable();\r\n }\r\n\r\n /**\r\n * Gets the gateway information.\r\n */\r\n public get gatewayInfo(): GatewayInformation {\r\n if (!this.internalGatewayUrl) {\r\n throw new Error(MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.GatewayUrlNotConfigured.message);\r\n }\r\n\r\n // RegEx: ('http' or 'https') '://' (('<gatewayName1>'):('<port>') or ('<gatewayName2>'))\r\n // 0: url\r\n // 1: https or http\r\n // 2: <gatewayName1>:<port> or <gatewayName2>\r\n // 3: <gatewayName1> or undefined\r\n // 4: <port> or undefined\r\n // 5: <gatewayName2>\r\n const url = MsftSme.trimEnd(this.internalGatewayUrl.toLowerCase(), '/');\r\n const match = url.match(/(http|https):\\/\\/((.+):(\\d+)|(.+))/);\r\n if (!match) {\r\n throw new Error(MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.GatewayUrlMalformed.message);\r\n }\r\n\r\n const secure = (match[1] === 'https');\r\n const name = match[3] || match[2];\r\n const port = parseInt(match[4], 10) || (secure ? 443 : 80);\r\n return { name, secure, port };\r\n }\r\n\r\n /**\r\n * Gets the gateway node name to make a CIM/PowerShell query to the gateway node.\r\n */\r\n public get gatewayName(): string {\r\n // localhost will be used to locally query gateway node. if this causes any access problem, need to be replaced.\r\n return 'localhost';\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the Gateway class.\r\n *\r\n * @param http the Http object.\r\n * @param rpc the Rpc class.\r\n */\r\n constructor(public http: Http, rpc: Rpc) {\r\n super('gateway-connection', rpc);\r\n }\r\n\r\n /**\r\n * Configure the gateway URL to connect to.\r\n */\r\n public configureGatewayEnvironment(url: string, urlSpecified: boolean, staticVersion: string): void {\r\n // trim last \"/\"\r\n if (url[url.length - 1] === '/') {\r\n url = url.substr(0, url.length - 1);\r\n }\r\n\r\n this.internalGatewayUrl = url;\r\n this.internalGatewayUrlSpecified = urlSpecified,\r\n this.internalStaticVersion = staticVersion;\r\n this.gatewayUrlAwaiter.next(url);\r\n }\r\n\r\n /**\r\n * Update the url with static version option.\r\n * @param url the original URL including options.\r\n * @returns updated url with \"version=\" option if staticVersion present.\r\n */\r\n public addStaticVersion(url: string): string {\r\n if (MsftSme.isNullOrWhiteSpace(this.staticVersion) || this.staticVersion.indexOf('staticVersion=') < 0) {\r\n return url;\r\n }\r\n\r\n const splitter = url.indexOf('?') > 0 ? '&' : '?';\r\n return `${url}${splitter}staticVersion=${this.staticVersion}`;\r\n }\r\n\r\n /**\r\n * Makes a POST call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public post(relativeUrl: string, body?: any, request?: GatewayRequest): Observable<any> {\r\n const postRequest = this.createRequest(HttpMethod.Post, relativeUrl, body, request);\r\n return this.call(postRequest);\r\n }\r\n\r\n /**\r\n * Makes a GET call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param request the gateway request object.\r\n */\r\n public get(relativeUrl: string, request?: GatewayRequest): Observable<any> {\r\n const getRequest = this.createRequest(HttpMethod.Get, relativeUrl, null, request);\r\n return this.call(getRequest);\r\n }\r\n\r\n /**\r\n * Makes a PUT call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public put(relativeUrl: string, body?: string, request?: GatewayRequest): Observable<any> {\r\n const putRequest = this.createRequest(HttpMethod.Put, relativeUrl, body, request);\r\n return this.call(putRequest);\r\n }\r\n\r\n /**\r\n * Makes a PATCH call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public patch(relativeUrl: string, body?: string, request?: GatewayRequest): Observable<any> {\r\n const patchRequest = this.createRequest(HttpMethod.Patch, relativeUrl, body, request);\r\n return this.call(patchRequest);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public delete(relativeUrl: string, body?: string, request?: GatewayRequest): Observable<any> {\r\n const deleteRequest = this.createRequest(HttpMethod.Delete, relativeUrl, body, request);\r\n return this.call(deleteRequest);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway without waiting for the response.\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param request the gateway request object.\r\n */\r\n public deleteQuick(relativeUrl: string, headers?: any): void {\r\n headers[headerConstants.MODULE_NAME] = EnvironmentModule.getModuleName();\r\n headers[headerConstants.MODULE_VERSION] = EnvironmentModule.getModuleVersion();\r\n headers[headerConstants.ACCEPT_LANGUAGE] = CoreEnvironment.localizationManager.getLocaleId().neutral;\r\n if (this.staticVersion) {\r\n headers[headerConstants.STATIC_VERSION] = this.staticVersion;\r\n }\r\n const url = Net.gatewayApi(this.gatewayUrl, relativeUrl);\r\n this.http.deleteQuick(url, headers);\r\n }\r\n\r\n /**\r\n * Creates a GatewayRequest.\r\n *\r\n * @param method the http method to use\r\n * @param relativeUrl the relative Url after \"/api/\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object to extend.\r\n */\r\n public createRequest(\r\n method: string,\r\n relativeUrl: string,\r\n body?: any,\r\n request?: GatewayRequest): GatewayRequest {\r\n\r\n const defaultMaxRetry = 3;\r\n request = MsftSme.deepAssign({}, request);\r\n\r\n // if request is undefined, default to empty object\r\n request = request || {};\r\n request.headers = request.headers || {};\r\n request.headers[headerConstants.MODULE_NAME] = EnvironmentModule.getModuleName();\r\n request.headers[headerConstants.MODULE_VERSION] = EnvironmentModule.getModuleVersion();\r\n request.headers[headerConstants.ACCEPT_LANGUAGE] = CoreEnvironment.localizationManager.getLocaleId().neutral;\r\n if (this.staticVersion) {\r\n request.headers[headerConstants.STATIC_VERSION] = this.staticVersion;\r\n }\r\n\r\n return Object.assign(request, <GatewayRequest>{\r\n method: method,\r\n url: relativeUrl,\r\n\r\n // default to the passed in body, the request body, or an empty string\r\n body: body || request.body || '',\r\n\r\n // default to the request headers, or an empty object\r\n headers: request.headers,\r\n\r\n // for the next 2 props, default to true unless explicitly set to false\r\n withCredentials: request.withCredentials === false ? false : true,\r\n crossDomain: request.crossDomain === false ? false : true,\r\n createXHR: () => new XMLHttpRequest(),\r\n\r\n // use default retry options if none are provided\r\n retryHandlers: request.retryHandlers || [],\r\n maxRetryCount: request.maxRetryCount === 0 ? 0 : request.maxRetryCount || defaultMaxRetry\r\n });\r\n }\r\n\r\n /**\r\n * Make a request.\r\n *\r\n * @param request the request to execute against the gateway.\r\n * @return Observable<any> the query result observable.\r\n */\r\n public call(request: GatewayRequest): Observable<any> {\r\n if (!this.gatewayUrl) {\r\n return this.gatewayUrlAwaiter.pipe(mergeMap(() => this.call(request)));\r\n }\r\n\r\n // create gateway url from current url if not set yet.\r\n if (!request.url || (!request.url.startsWith('http://') && !request.url.startsWith('https://'))) {\r\n request.url = Net.gatewayApi(this.gatewayUrl, request.url);\r\n }\r\n\r\n // create retry options from request\r\n const retryOptions: HttpRetryOptions = {\r\n handlers: (request.retryHandlers || []),\r\n maxRetry: request.maxRetryCount\r\n };\r\n\r\n // create observable for our request\r\n const requestObservable = this.http.request(request, retryOptions)\r\n .pipe(map((response: AjaxResponse) => response ? response.response : {}));\r\n\r\n if (request.beforeCall) {\r\n return request.beforeCall(request).pipe(mergeMap(() => requestObservable));\r\n }\r\n\r\n return requestObservable;\r\n }\r\n\r\n /**\r\n * Check if elevation is required from the error object.\r\n *\r\n * @param error the ajax error object.\r\n */\r\n public isElevationRequired(error: AjaxError): boolean {\r\n const code = error.xhr && error.xhr.response && error.xhr.response.error && error.xhr.response.error.code;\r\n return code === 'ElevationRequired';\r\n }\r\n\r\n /**\r\n * Elevate the gateway if it's desktop mode running.\r\n */\r\n public elevate(): Observable<boolean> {\r\n if (!this.elevateClient) {\r\n this.elevateClient = new RpcObservableElevateClient(this.rpc);\r\n }\r\n\r\n return this.elevateClient.elevate().pipe(map(result => result.elevated));\r\n }\r\n\r\n /**\r\n * Creates and returns a new URL builder for the current connection.\r\n */\r\n public url(): GatewayUrlBuilder {\r\n return new GatewayUrlBuilder(this.gatewayUrl);\r\n }\r\n\r\n /**\r\n * Clear the DNS cache.\r\n */\r\n public clearDnsCache(): Observable<void> {\r\n const dnsCacheClearUrl = 'gateway/dnsCacheClear';\r\n return this.delete(dnsCacheClearUrl)\r\n .pipe(map(_ => null));\r\n }\r\n\r\n /**\r\n * Polling to check if the gateway is elevated.\r\n */\r\n public pollingGatewayElevated(): Observable<boolean> {\r\n // user might not respond for elevation prompt, maximum waiting time is 2.5 min.\r\n // getElevatedStatus() takes 5000ms when the gateway is not responding.\r\n // 2.5 min = count [30] * 5000 msec.\r\n const maxWaitingCount = 30;\r\n let count = maxWaitingCount;\r\n return this.getElevatedStatus()\r\n .pipe(\r\n expand(status => {\r\n // user accepted.\r\n // adds 5 calls for the gateway dead period.\r\n // < Restart Requested from UI >\r\n // 1st query: it shows success on slow performed system, the gateway is even not shutdown yet.\r\n // 2nd query: It could success still.\r\n // 3rd query: Maybe timeout because the gateway is not started yet.\r\n // 4rd query: Maybe timeout because the gateway is not started yet.\r\n // 5rd query: Maybe timeout because the gateway is down.\r\n // 25 = 30 - 5\r\n const pollingStartCount = 25;\r\n if ((count <= pollingStartCount && (!status.error || status.isGatewayProcessElevated)) || status.completed) {\r\n return of({\r\n completed: true,\r\n isGatewayProcessElevated: status.isGatewayProcessElevated\r\n });\r\n }\r\n\r\n // no response for more than 2.5 minutes.\r\n // gateway was stopped for long or user never responded to UAC prompt.\r\n if (count-- <= 0) {\r\n return of({\r\n completed: true,\r\n isGatewayProcessElevated: status.isGatewayProcessElevated\r\n });\r\n }\r\n\r\n return this.getElevatedStatus();\r\n }),\r\n filter(result => result.isGatewayProcessElevated || result.completed),\r\n take(1),\r\n map(result => result.isGatewayProcessElevated)\r\n );\r\n }\r\n\r\n /**\r\n * Perform gateway status query but cut off if it exceeds 2.5 seconds.\r\n */\r\n public getElevatedStatus(): Observable<{ error: boolean, isGatewayProcessElevated: boolean, completed: boolean }> {\r\n // if the gateway is not responding for 5000ms, cancel the call.\r\n const callCancelTime = 5000;\r\n return new Observable(observer => {\r\n let subscription: Subscription = null;\r\n let timer = setTimeout(\r\n () => {\r\n // handle pending timeout of the query when the gateway doesn't respond.\r\n if (subscription) {\r\n observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined });\r\n observer.complete();\r\n subscription.unsubscribe();\r\n subscription = null;\r\n timer = null;\r\n }\r\n },\r\n callCancelTime);\r\n subscription = this.getStatus()\r\n .subscribe(\r\n data => {\r\n observer.next({ error: false, isGatewayProcessElevated: data.isGatewayProcessElevated, completed: undefined });\r\n observer.complete();\r\n subscription.unsubscribe();\r\n subscription = null;\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n },\r\n () => {\r\n observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined });\r\n observer.complete();\r\n subscription.unsubscribe();\r\n subscription = null;\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Check gateway condition.\r\n */\r\n public checkCondition(): Observable<GatewayCondition> {\r\n const result = <GatewayCondition>{};\r\n return this.getStatus()\r\n .pipe(\r\n switchMap(gateway => {\r\n if (gateway.gatewayMode === 'Service') {\r\n result.isServiceMode = true;\r\n result.isGatewayProcessElevated = false;\r\n return this.getAccessCheck();\r\n }\r\n\r\n result.isServiceMode = false;\r\n result.isGatewayProcessElevated = gateway.isGatewayProcessElevated;\r\n return of(true);\r\n }),\r\n map((isAdmin) => {\r\n result.isGatewayAdmin = !!isAdmin;\r\n return result;\r\n }),\r\n take(1)\r\n );\r\n }\r\n\r\n /**\r\n * Get gateway status.\r\n */\r\n public getStatus(): Observable<any> {\r\n return this.get('gateway/status');\r\n }\r\n\r\n /**\r\n * Get user access check.\r\n */\r\n public getAccessCheck(): Observable<any> {\r\n return this.get('gateway/access/check');\r\n }\r\n\r\n /**\r\n * Called on a child service instance when onForwardInit returns from the parent\r\n * @param data The response from the forwardInit call\r\n */\r\n protected onForwardInitResponse(data: RpcForwardResponse<GatewayRPCForwardedProperties>): void {\r\n if (data.error) {\r\n // if there is an error, we cannot continue, so throw its\r\n throw data.error;\r\n }\r\n\r\n if (!MsftSme.self().Environment.configuration.gateway.disabled) {\r\n this.internalGatewayUrl = data.result.gatewayName;\r\n this.internalGatewayUrlSpecified = data.result.gatewayUrlSpecified;\r\n this.internalStaticVersion = data.result.staticVersion;\r\n }\r\n }\r\n\r\n /**\r\n * Called when a new instance of the service in another window is initialized and needs to synchronize with its parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @returns an observable for the all the values needed to initialize the service\r\n */\r\n protected onForwardInit(): Observable<GatewayRPCForwardedProperties> {\r\n if (this.gatewayUrl) {\r\n return of({\r\n gatewayName: this.gatewayUrl,\r\n gatewayUrlSpecified: this.gatewayUrlSpecified,\r\n staticVersion: this.staticVersion\r\n });\r\n } else {\r\n // if gateway value hasn't been set yet, then wait for it.\r\n if (MsftSme.self().Environment.configuration.gateway.disabled) {\r\n return of(null);\r\n }\r\n\r\n return this.gatewayUrlAwaiter\r\n .pipe(map(url => ({\r\n gatewayName: url,\r\n gatewayUrlSpecified: this.gatewayUrlSpecified,\r\n staticVersion: this.staticVersion\r\n })));\r\n }\r\n }\r\n\r\n /**\r\n * Called when the forwarded services counterpart wants to get data from the parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the method to forward to\r\n * @param args The arguments of the method\r\n * @returns an observable for the result of the method call\r\n */\r\n protected onForwardExecute(from: RpcRelationshipType, name: string, args: any[]): Observable<any> {\r\n // gatewayConnection does not allow any method calls at this time\r\n return this.nameNotFound(name);\r\n }\r\n\r\n /**\r\n * Called when the forwarded services counterpart sends a notify message\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the property to change\r\n * @param value The new value of the property\r\n * @returns an observable that completes when the property has been changed.\r\n */\r\n protected onForwardNotify(from: RpcRelationshipType, name: string, value: any): Observable<void> {\r\n if (from === RpcRelationshipType.Child && name === GatewayConnection.rpcCommands.forbiddenReceived) {\r\n // Deprecated noop version 1.1100.0 at 10/1/2020. Using ErrorMonitor.\r\n return of(null);\r\n }\r\n // gatewayConnection does not allow any other notifications at this time\r\n return this.nameNotFound(name);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/data/gateway-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAgB,UAAU,EAAE,MAAM,MAAM,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,E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,mBAAmB;CACzC,CAAC","file":"gateway-connection.js","sourcesContent":["import { Observable, of, ReplaySubject, Subscription, throwError } from 'rxjs';\r\nimport { AjaxError, AjaxRequest, AjaxResponse } from 'rxjs/ajax';\r\nimport { catchError, expand, filter, map, mergeMap, switchMap, take } from 'rxjs/operators';\r\nimport { Strings } from '../generated/strings';\r\nimport { EnvironmentModule } from '../manifest/environment-modules';\r\nimport { RpcObservableElevateClient } from '../rpc/elevate/rpc-observable-elevate-client';\r\nimport {\r\n RpcObservableElevateError, RpcObservableElevateRequest, RpcObservableElevateResult\r\n} from '../rpc/elevate/rpc-observable-elevate-model';\r\nimport { RpcObservableElevateServer } from '../rpc/elevate/rpc-observable-elevate-server';\r\nimport { RpcForwardResponse } from '../rpc/forward/rpc-forward-model';\r\nimport { Rpc } from '../rpc/rpc';\r\nimport { RpcRelationshipType } from '../rpc/rpc-base';\r\nimport { RpcServiceForwarder } from '../rpc/rpc-forwarder';\r\nimport { AuthorizationManager } from '../security/authorization-manager';\r\nimport { SignedHttpRequestToken } from '../security/sign-on-manager';\r\nimport { CoreEnvironment } from './core-environment';\r\nimport { GatewayUrlBuilder } from './gateway-url-builder';\r\nimport { Http, HttpMethod, HttpResponseRetryHandler, HttpRetryOptions } from './http';\r\nimport { headerConstants } from './http-constants';\r\nimport { Net } from './net';\r\n\r\n/**\r\n * Gateway Request options that we use to extend the AjaxRequest interface\r\n */\r\nexport interface GatewayRequestOptions {\r\n /**\r\n * Retry handler implementation for a request.\r\n * These handlers are used to invoke specific functionality for non-200 status codes in the http response.\r\n */\r\n retryHandlers?: HttpResponseRetryHandler[];\r\n\r\n /**\r\n * Determines the maximum number of times that any of the retry handlers will be tried.\r\n * before giving up and surfacing the error to the original caller\r\n */\r\n maxRetryCount?: number;\r\n\r\n /**\r\n * Observable handler to insert asynchronous logic before the actual http response is sent.\r\n * For Example: Waiting for pending authentication to complete before adding an authentication header\r\n */\r\n beforeCall?: (request: GatewayRequest) => Observable<void>;\r\n}\r\n\r\n/**\r\n * Extension of AjaxRequest interface for calling the Gateway API\r\n */\r\nexport interface GatewayRequest extends AjaxRequest, GatewayRequestOptions {\r\n}\r\n\r\n/**\r\n * Initialization object data for the Gateway's base class.\r\n */\r\nexport interface GatewayRPCForwardedProperties {\r\n /**\r\n * The gateway URL.\r\n */\r\n gatewayName: string;\r\n\r\n /**\r\n * Indicate whether gatewayUrl option was specified. (default to be false)\r\n */\r\n gatewayUrlSpecified: boolean;\r\n\r\n /**\r\n * The stative version. (default to be null)\r\n */\r\n staticVersion: string;\r\n}\r\n\r\n/**\r\n * The gateway information on current gateway URL.\r\n */\r\nexport interface GatewayInformation {\r\n /**\r\n * The name of gateway node.\r\n */\r\n name: string;\r\n\r\n /**\r\n * Indicating if https is used.\r\n */\r\n secure: boolean;\r\n\r\n /**\r\n * The port number of gateway.\r\n */\r\n port: number;\r\n}\r\n\r\n/**\r\n * Condition of gateway.\r\n */\r\nexport interface GatewayCondition {\r\n /**\r\n * the gateway is running as service mode (installed on server operating system).\r\n */\r\n isServiceMode: boolean;\r\n\r\n /**\r\n * the gateway is elevated on the desktop mode.\r\n */\r\n isGatewayProcessElevated: boolean;\r\n\r\n /**\r\n * the user account is a member of the gateway administrators.\r\n */\r\n isGatewayAdmin: boolean;\r\n}\r\n\r\n/**\r\n * The Gateway Connection class for creating requests and calling the Gateway's REST API\r\n */\r\nexport class GatewayConnection extends RpcServiceForwarder {\r\n private static rpcCommands = {\r\n forbiddenReceived: 'forbiddenRecieved'\r\n };\r\n\r\n /**\r\n * internally maintained gateway URL.\r\n */\r\n private internalGatewayUrl: string;\r\n\r\n /**\r\n * internally maintained static version.\r\n */\r\n private internalStaticVersion: string;\r\n\r\n /**\r\n * gatewayUrl param is specified.\r\n */\r\n private internalGatewayUrlSpecified: boolean;\r\n\r\n /**\r\n * The replay subject for gateway url to settle.\r\n */\r\n private gatewayUrlAwaiter = new ReplaySubject<string>(1);\r\n\r\n /**\r\n * The RPC observable elevate client.\r\n */\r\n private elevateClient: RpcObservableElevateClient = null;\r\n\r\n /**\r\n * The RPC observable elevate server.\r\n */\r\n private elevateServer: RpcObservableElevateServer = null;\r\n\r\n /**\r\n * The elevate callback observable.\r\n */\r\n private elevateCallbackInternal: () => Observable<boolean> = () => of(false);\r\n\r\n /**\r\n * Sets the elevate callback observable.\r\n */\r\n public set elevateCallback(value: () => Observable<boolean>) {\r\n this.elevateCallbackInternal = value;\r\n if (!this.elevateServer) {\r\n this.elevateServer = new RpcObservableElevateServer(this.rpc);\r\n this.elevateServer.register((_context: RpcObservableElevateRequest) => {\r\n return this.elevateCallbackInternal()\r\n .pipe(\r\n catchError((error, _caught) =>\r\n throwError(<RpcObservableElevateError>{ error: Net.getErrorMessage(error) })),\r\n map(result =>\r\n <RpcObservableElevateResult>{ elevated: result })\r\n );\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Indicates that the gateway is disabled and therefore should not be called.\r\n */\r\n public get disabled(): boolean {\r\n const environment = MsftSme.self().Environment;\r\n return environment && environment.configuration.gateway.disabled;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL to connect to.\r\n */\r\n public get gatewayUrl(): string {\r\n return this.internalGatewayUrl;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL specified state.\r\n */\r\n public get staticVersion() {\r\n return this.internalStaticVersion;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL specified state.\r\n */\r\n public get gatewayUrlSpecified(): boolean {\r\n return this.internalGatewayUrlSpecified;\r\n }\r\n\r\n /**\r\n * Gets the gateway URL observable while setting up.\r\n */\r\n public get gatewayUrlObservable(): Observable<string> {\r\n return this.gatewayUrlAwaiter.asObservable();\r\n }\r\n\r\n /**\r\n * Gets the gateway information.\r\n */\r\n public get gatewayInfo(): GatewayInformation {\r\n if (!this.internalGatewayUrl) {\r\n throw new Error(MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.GatewayUrlNotConfigured.message);\r\n }\r\n\r\n // RegEx: ('http' or 'https') '://' (('<gatewayName1>'):('<port>') or ('<gatewayName2>'))\r\n // 0: url\r\n // 1: https or http\r\n // 2: <gatewayName1>:<port> or <gatewayName2>\r\n // 3: <gatewayName1> or undefined\r\n // 4: <port> or undefined\r\n // 5: <gatewayName2>\r\n const url = MsftSme.trimEnd(this.internalGatewayUrl.toLowerCase(), '/');\r\n const match = url.match(/(http|https):\\/\\/((.+):(\\d+)|(.+))/);\r\n if (!match) {\r\n throw new Error(MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.GatewayUrlMalformed.message);\r\n }\r\n\r\n const secure = (match[1] === 'https');\r\n const name = match[3] || match[2];\r\n const port = parseInt(match[4], 10) || (secure ? 443 : 80);\r\n return { name, secure, port };\r\n }\r\n\r\n /**\r\n * Gets the gateway node name to make a CIM/PowerShell query to the gateway node.\r\n */\r\n public get gatewayName(): string {\r\n // localhost will be used to locally query gateway node. if this causes any access problem, need to be replaced.\r\n return 'localhost';\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the Gateway class.\r\n *\r\n * @param http the Http object.\r\n * @param rpc the Rpc class.\r\n * @patam authorizationManager the authorization manager class object.\r\n */\r\n constructor(public http: Http, rpc: Rpc, private authorizationManager: AuthorizationManager) {\r\n super('gateway-connection', rpc);\r\n\r\n // restore the AAD token if exist becase ealier access of token is required for gateway calls.\r\n authorizationManager.signOnManager.applySignedHttpRequestToken(\r\n <SignedHttpRequestToken>MsftSme.self().Environment.configuration?.signOn?.signedHttpRequestToken);\r\n }\r\n\r\n /**\r\n * Configure the gateway URL to connect to.\r\n */\r\n public configureGatewayEnvironment(url: string, urlSpecified: boolean, staticVersion: string): void {\r\n // trim last \"/\"\r\n if (url[url.length - 1] === '/') {\r\n url = url.substr(0, url.length - 1);\r\n }\r\n\r\n this.internalGatewayUrl = url;\r\n this.internalGatewayUrlSpecified = urlSpecified,\r\n this.internalStaticVersion = staticVersion;\r\n this.gatewayUrlAwaiter.next(url);\r\n }\r\n\r\n /**\r\n * Update the url with static version option.\r\n * @param url the original URL including options.\r\n * @returns updated url with \"version=\" option if staticVersion present.\r\n */\r\n public addStaticVersion(url: string): string {\r\n if (MsftSme.isNullOrWhiteSpace(this.staticVersion) || this.staticVersion.indexOf('staticVersion=') < 0) {\r\n return url;\r\n }\r\n\r\n const splitter = url.indexOf('?') > 0 ? '&' : '?';\r\n return `${url}${splitter}staticVersion=${this.staticVersion}`;\r\n }\r\n\r\n /**\r\n * Makes a POST call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public post(relativeUrl: string, body?: any, request?: GatewayRequest): Observable<any> {\r\n const postRequest = this.createRequest(HttpMethod.Post, relativeUrl, body, request);\r\n return this.call(postRequest);\r\n }\r\n\r\n /**\r\n * Makes a GET call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param request the gateway request object.\r\n */\r\n public get(relativeUrl: string, request?: GatewayRequest): Observable<any> {\r\n const getRequest = this.createRequest(HttpMethod.Get, relativeUrl, null, request);\r\n return this.call(getRequest);\r\n }\r\n\r\n /**\r\n * Makes a PUT call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public put(relativeUrl: string, body?: string, request?: GatewayRequest): Observable<any> {\r\n const putRequest = this.createRequest(HttpMethod.Put, relativeUrl, body, request);\r\n return this.call(putRequest);\r\n }\r\n\r\n /**\r\n * Makes a PATCH call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public patch(relativeUrl: string, body?: string, request?: GatewayRequest): Observable<any> {\r\n const patchRequest = this.createRequest(HttpMethod.Patch, relativeUrl, body, request);\r\n return this.call(patchRequest);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object.\r\n */\r\n public delete(relativeUrl: string, body?: string, request?: GatewayRequest): Observable<any> {\r\n const deleteRequest = this.createRequest(HttpMethod.Delete, relativeUrl, body, request);\r\n return this.call(deleteRequest);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway without waiting for the response.\r\n *\r\n * @param relativeUrl the relative Url after \"/api\"\r\n * @param request the gateway request object.\r\n */\r\n public deleteQuick(relativeUrl: string, headers?: any): void {\r\n headers[headerConstants.MODULE_NAME] = EnvironmentModule.getModuleName();\r\n headers[headerConstants.MODULE_VERSION] = EnvironmentModule.getModuleVersion();\r\n headers[headerConstants.ACCEPT_LANGUAGE] = CoreEnvironment.localizationManager.getLocaleId().neutral;\r\n if (this.staticVersion) {\r\n headers[headerConstants.STATIC_VERSION] = this.staticVersion;\r\n }\r\n\r\n if (this.authorizationManager.signOnManager.isSignOnTokenEnabled) {\r\n this.authorizationManager.signOnManager.SetAadAuthorizationHeader(headers);\r\n }\r\n\r\n const url = Net.gatewayApi(this.gatewayUrl, relativeUrl);\r\n this.http.deleteQuick(url, headers);\r\n }\r\n\r\n /**\r\n * Creates a GatewayRequest.\r\n *\r\n * @param method the http method to use\r\n * @param relativeUrl the relative Url after \"/api/\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the gateway request object to extend.\r\n */\r\n public createRequest(\r\n method: string,\r\n relativeUrl: string,\r\n body?: any,\r\n request?: GatewayRequest): GatewayRequest {\r\n\r\n const defaultMaxRetry = 3;\r\n request = MsftSme.deepAssign({}, request);\r\n\r\n // if request is undefined, default to empty object\r\n request = request || {};\r\n request.headers = request.headers || {};\r\n request.headers[headerConstants.MODULE_NAME] = EnvironmentModule.getModuleName();\r\n request.headers[headerConstants.MODULE_VERSION] = EnvironmentModule.getModuleVersion();\r\n request.headers[headerConstants.ACCEPT_LANGUAGE] = CoreEnvironment.localizationManager.getLocaleId().neutral;\r\n if (this.staticVersion) {\r\n request.headers[headerConstants.STATIC_VERSION] = this.staticVersion;\r\n }\r\n\r\n // use default retry options if none are provided\r\n const retryHandlers: HttpResponseRetryHandler[] = [];\r\n if (this.authorizationManager.signOnManager.isSignOnTokenEnabled) {\r\n this.authorizationManager.signOnManager.SetAadAuthorizationHeader(request.headers);\r\n retryHandlers.push({\r\n canHandle: (code, error) => this.authorizationManager.signOnManager.canHandleUnauthorizedLogin(code, error),\r\n handle: (code, originalRequest, error) =>\r\n this.authorizationManager.signOnManager.handleUnauthorizedLogin(code, originalRequest, error)\r\n });\r\n }\r\n\r\n if (request.retryHandlers != null && request.retryHandlers.length > 0) {\r\n retryHandlers.push(...request.retryHandlers);\r\n }\r\n\r\n return Object.assign(request, <GatewayRequest>{\r\n method: method,\r\n url: relativeUrl,\r\n\r\n // default to the passed in body, the request body, or an empty string\r\n body: body || request.body || '',\r\n\r\n // default to the request headers, or an empty object\r\n headers: request.headers,\r\n\r\n // for the next 2 props, default to true unless explicitly set to false\r\n withCredentials: request.withCredentials === false ? false : true,\r\n crossDomain: request.crossDomain === false ? false : true,\r\n createXHR: () => new XMLHttpRequest(),\r\n\r\n retryHandlers,\r\n maxRetryCount: request.maxRetryCount === 0 ? 0 : request.maxRetryCount || defaultMaxRetry\r\n });\r\n }\r\n\r\n /**\r\n * Make a request.\r\n *\r\n * @param request the request to execute against the gateway.\r\n * @return Observable<any> the query result observable.\r\n */\r\n public call(request: GatewayRequest): Observable<any> {\r\n if (!this.gatewayUrl) {\r\n return this.gatewayUrlAwaiter.pipe(mergeMap(() => this.call(request)));\r\n }\r\n\r\n // create gateway url from current url if not set yet.\r\n if (!request.url || (!request.url.startsWith('http://') && !request.url.startsWith('https://'))) {\r\n request.url = Net.gatewayApi(this.gatewayUrl, request.url);\r\n }\r\n\r\n // create retry options from request\r\n const retryOptions: HttpRetryOptions = {\r\n handlers: (request.retryHandlers || []),\r\n maxRetry: request.maxRetryCount\r\n };\r\n\r\n // create observable for our request\r\n const requestObservable = this.http.request(request, retryOptions)\r\n .pipe(map((response: AjaxResponse) => response ? response.response : {}));\r\n\r\n if (request.beforeCall) {\r\n return request.beforeCall(request).pipe(mergeMap(() => requestObservable));\r\n }\r\n\r\n return requestObservable;\r\n }\r\n\r\n /**\r\n * Gets default secure request options.\r\n *\r\n * @returns updated request object.\r\n */\r\n public get defaultHttpSecureOptions(): AjaxRequest {\r\n const request = { ...{ headers: {} }, ...Http.defaultHttpOptions };\r\n if (this.authorizationManager.signOnManager.isSignOnTokenEnabled) {\r\n this.authorizationManager.signOnManager.SetAadAuthorizationHeader(request.headers);\r\n }\r\n\r\n return request;\r\n }\r\n\r\n /**\r\n * Check if elevation is required from the error object.\r\n *\r\n * @param error the ajax error object.\r\n */\r\n public isElevationRequired(error: AjaxError): boolean {\r\n const code = error.xhr && error.xhr.response && error.xhr.response.error && error.xhr.response.error.code;\r\n return code === 'ElevationRequired';\r\n }\r\n\r\n /**\r\n * Elevate the gateway if it's desktop mode running.\r\n */\r\n public elevate(): Observable<boolean> {\r\n if (!this.elevateClient) {\r\n this.elevateClient = new RpcObservableElevateClient(this.rpc);\r\n }\r\n\r\n return this.elevateClient.elevate().pipe(map(result => result.elevated));\r\n }\r\n\r\n /**\r\n * Creates and returns a new URL builder for the current connection.\r\n */\r\n public url(): GatewayUrlBuilder {\r\n return new GatewayUrlBuilder(this.gatewayUrl);\r\n }\r\n\r\n /**\r\n * Clear the DNS cache.\r\n */\r\n public clearDnsCache(): Observable<void> {\r\n const dnsCacheClearUrl = 'gateway/dnsCacheClear';\r\n return this.delete(dnsCacheClearUrl)\r\n .pipe(map(_ => null));\r\n }\r\n\r\n /**\r\n * Polling to check if the gateway is elevated.\r\n */\r\n public pollingGatewayElevated(): Observable<boolean> {\r\n // user might not respond for elevation prompt, maximum waiting time is 2.5 min.\r\n // getElevatedStatus() takes 5000ms when the gateway is not responding.\r\n // 2.5 min = count [30] * 5000 msec.\r\n const uniQueId = MsftSme.getUniqueId();\r\n const maxWaitingCount = 30;\r\n let count = maxWaitingCount;\r\n return this.getElevatedStatus()\r\n .pipe(\r\n expand(status => {\r\n // user accepted.\r\n // adds 5 calls for the gateway dead period.\r\n // < Restart Requested from UI >\r\n // 1st query: it shows success on slow performed system, the gateway is even not shutdown yet.\r\n // 2nd query: It could success still.\r\n // 3rd query: Maybe timeout because the gateway is not started yet.\r\n // 4rd query: Maybe timeout because the gateway is not started yet.\r\n // 5rd query: Maybe timeout because the gateway is down.\r\n // 25 = 30 - 5\r\n const pollingStartCount = 25;\r\n if (\r\n (\r\n (count <= pollingStartCount\r\n && (!status.error || status.isGatewayProcessElevated))\r\n || status.completed\r\n )\r\n && (status.id === uniQueId)\r\n ) {\r\n return of({\r\n completed: true,\r\n id: uniQueId,\r\n isGatewayProcessElevated: status.isGatewayProcessElevated\r\n });\r\n }\r\n\r\n // no response for more than 2.5 minutes.\r\n // gateway was stopped for long or user never responded to UAC prompt.\r\n if (count-- <= 0 && status.id === uniQueId) {\r\n return of({\r\n completed: true,\r\n id: uniQueId,\r\n isGatewayProcessElevated: status.isGatewayProcessElevated\r\n });\r\n }\r\n\r\n return this.getElevatedStatus();\r\n }),\r\n filter(result => result.isGatewayProcessElevated || result.completed),\r\n take(1),\r\n map(result => result.isGatewayProcessElevated)\r\n );\r\n }\r\n\r\n /**\r\n * Perform gateway status query but cut off if it exceeds 2.5 seconds.\r\n */\r\n public getElevatedStatus(): Observable<{ error: boolean, isGatewayProcessElevated: boolean, completed: boolean, id: string }> {\r\n // if the gateway is not responding for 5000ms, cancel the call.\r\n const callCancelTime = 5000;\r\n return new Observable(observer => {\r\n let subscription: Subscription = null;\r\n let timer = setTimeout(\r\n () => {\r\n // handle pending timeout of the query when the gateway doesn't respond.\r\n if (subscription) {\r\n observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined, id: undefined });\r\n observer.complete();\r\n subscription.unsubscribe();\r\n subscription = null;\r\n timer = null;\r\n }\r\n },\r\n callCancelTime);\r\n subscription = this.getStatus()\r\n .subscribe(\r\n data => {\r\n observer.next({\r\n error: false,\r\n isGatewayProcessElevated: data.isGatewayProcessElevated,\r\n completed: undefined,\r\n id: undefined\r\n });\r\n observer.complete();\r\n subscription.unsubscribe();\r\n subscription = null;\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n },\r\n () => {\r\n observer.next({ error: true, isGatewayProcessElevated: false, completed: undefined, id: undefined });\r\n observer.complete();\r\n subscription.unsubscribe();\r\n subscription = null;\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Check gateway condition.\r\n */\r\n public checkCondition(): Observable<GatewayCondition> {\r\n const result = <GatewayCondition>{};\r\n return this.getStatus()\r\n .pipe(\r\n switchMap(gateway => {\r\n if (gateway.gatewayMode === 'Service') {\r\n result.isServiceMode = true;\r\n result.isGatewayProcessElevated = false;\r\n return this.getAccessCheck();\r\n }\r\n\r\n result.isServiceMode = false;\r\n result.isGatewayProcessElevated = gateway.isGatewayProcessElevated;\r\n return of(true);\r\n }),\r\n map((isAdmin) => {\r\n result.isGatewayAdmin = !!isAdmin;\r\n return result;\r\n }),\r\n take(1)\r\n );\r\n }\r\n\r\n /**\r\n * Get gateway status.\r\n */\r\n public getStatus(): Observable<any> {\r\n return this.get('gateway/status');\r\n }\r\n\r\n /**\r\n * Get user access check.\r\n */\r\n public getAccessCheck(): Observable<any> {\r\n return this.get('gateway/access/check');\r\n }\r\n\r\n /**\r\n * Called on a child service instance when onForwardInit returns from the parent\r\n * @param data The response from the forwardInit call\r\n */\r\n protected onForwardInitResponse(data: RpcForwardResponse<GatewayRPCForwardedProperties>): void {\r\n if (data.error) {\r\n // if there is an error, we cannot continue, so throw its\r\n throw data.error;\r\n }\r\n\r\n if (!MsftSme.self().Environment.configuration.gateway.disabled) {\r\n this.internalGatewayUrl = data.result.gatewayName;\r\n this.internalGatewayUrlSpecified = data.result.gatewayUrlSpecified;\r\n this.internalStaticVersion = data.result.staticVersion;\r\n }\r\n }\r\n\r\n /**\r\n * Called when a new instance of the service in another window is initialized and needs to synchronize with its parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @returns an observable for the all the values needed to initialize the service\r\n */\r\n protected onForwardInit(): Observable<GatewayRPCForwardedProperties> {\r\n if (this.gatewayUrl) {\r\n return of({\r\n gatewayName: this.gatewayUrl,\r\n gatewayUrlSpecified: this.gatewayUrlSpecified,\r\n staticVersion: this.staticVersion\r\n });\r\n } else {\r\n // if gateway value hasn't been set yet, then wait for it.\r\n if (MsftSme.self().Environment.configuration.gateway.disabled) {\r\n return of(null);\r\n }\r\n\r\n return this.gatewayUrlAwaiter\r\n .pipe(map(url => ({\r\n gatewayName: url,\r\n gatewayUrlSpecified: this.gatewayUrlSpecified,\r\n staticVersion: this.staticVersion\r\n })));\r\n }\r\n }\r\n\r\n /**\r\n * Called when the forwarded services counterpart wants to get data from the parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the method to forward to\r\n * @param args The arguments of the method\r\n * @returns an observable for the result of the method call\r\n */\r\n protected onForwardExecute(from: RpcRelationshipType, name: string, args: any[]): Observable<any> {\r\n // gatewayConnection does not allow any method calls at this time\r\n return this.nameNotFound(name);\r\n }\r\n\r\n /**\r\n * Called when the forwarded services counterpart sends a notify message\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the property to change\r\n * @param value The new value of the property\r\n * @returns an observable that completes when the property has been changed.\r\n */\r\n protected onForwardNotify(from: RpcRelationshipType, name: string, value: any): Observable<void> {\r\n if (from === RpcRelationshipType.Child && name === GatewayConnection.rpcCommands.forbiddenReceived) {\r\n // Deprecated noop version 1.1100.0 at 10/1/2020. Using ErrorMonitor.\r\n return of(null);\r\n }\r\n // gatewayConnection does not allow any other notifications at this time\r\n return this.nameNotFound(name);\r\n }\r\n}\r\n"]}
|
|
@@ -439,8 +439,12 @@ export declare const headerConstants: {
|
|
|
439
439
|
*/
|
|
440
440
|
SME_AUTHORIZATION: string;
|
|
441
441
|
/**
|
|
442
|
-
* The
|
|
442
|
+
* The SME AAD authorization header.
|
|
443
443
|
*/
|
|
444
|
+
SME_AAD_AUTHORIZATION: string;
|
|
445
|
+
/**
|
|
446
|
+
* The secure extension data header
|
|
447
|
+
*/
|
|
444
448
|
SECURE_EXTENSION: string;
|
|
445
449
|
/**
|
|
446
450
|
* The Use Laps Header.
|
|
@@ -439,8 +439,12 @@ export const headerConstants = {
|
|
|
439
439
|
*/
|
|
440
440
|
SME_AUTHORIZATION: 'x-ms-sme-authorization',
|
|
441
441
|
/**
|
|
442
|
-
* The
|
|
442
|
+
* The SME AAD authorization header.
|
|
443
443
|
*/
|
|
444
|
+
SME_AAD_AUTHORIZATION: 'authorization-aad',
|
|
445
|
+
/**
|
|
446
|
+
* The secure extension data header
|
|
447
|
+
*/
|
|
444
448
|
SECURE_EXTENSION: 'x-ms-sme-secureExtension',
|
|
445
449
|
/**
|
|
446
450
|
* The Use Laps Header.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/data/http-constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,yBAAyB,EAAE,2BAA2B;IAEtD;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAEhB;;OAEG;IACH,QAAQ,EAAE,UAAU;IAEpB;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,oBAAoB,EAAE,oBAAoB;IAE1C;;OAEG;IACH,wBAAwB,EAAE,uBAAuB;IAEjD;;OAEG;IACH,kBAAkB,EAAE,OAAO;IAE3B;;OAEG;IACH,iBAAiB,EAAE,wBAAwB;IAE3C;;OAEG;IACH,0BAA0B,EAAE,iCAAiC;IAE7D;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,kBAAkB,EAAE,yBAAyB;IAE7C;;OAEG;IACH,SAAS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AE7D;;OAEG;IACH,gBAAgB,EAAE,uBAAuB;IAEzC;;OAEG;IACH,iBAAiB,EAAE,wBAAwB;IAE3C;;OAEG;IACH,gBAAgB,EAAE,0BAA0B;IAE5C;;OAEG;IACH,QAAQ,EAAE,kBAAkB;IAE5B;;OAEG;IACH,mBAAmB,EAAE,6BAA6B;IAElD;;OAEG;IACH,SAAS,EAAE,oBAAoB;IAE/B;;OAEG;IACH,aAAa,EAAE,wBAAwB;IAEvC;;OAEG;IACH,WAAW,EAAE,sBAAsB;IAEnC;;OAEG;IACH,cAAc,EAAE,yBAAyB;IAEzC;;OAEG;IACH,mBAAmB,EAAE,uBAAuB;IAE5C;;;OAGG;IACH,gCAAgC,EAAE,cAAc;IAEhD;;OAEG;IACH,wBAAwB,EAAE,mCAAmC;IAE7D;;OAEG;IACH,cAAc,EAAE,yBAAyB;CAC5C,CAAC","file":"http-constants.js","sourcesContent":["/**\r\n * Defines constants for use with HTTP headers.\r\n */\r\nexport const headerConstants = {\r\n /**\r\n * The accept language header.\r\n */\r\n ACCEPT_LANGUAGE: 'accept-language',\r\n\r\n /**\r\n * The accept ranges header.\r\n */\r\n ACCEPT_RANGES: 'accept-ranges',\r\n\r\n /**\r\n * The content transfer encoding header.\r\n */\r\n CONTENT_TRANSFER_ENCODING: 'content-transfer-encoding',\r\n\r\n /**\r\n * The transfer encoding header.\r\n */\r\n TRANSFER_ENCODING: 'transfer-encoding',\r\n\r\n /**\r\n * The server header.\r\n */\r\n SERVER: 'server',\r\n\r\n /**\r\n * The location header.\r\n */\r\n LOCATION: 'location',\r\n\r\n /**\r\n * The Last-Modified header\r\n */\r\n LAST_MODIFIED: 'Last-Modified',\r\n\r\n /**\r\n * The data service version.\r\n */\r\n DATA_SERVICE_VERSION: 'dataserviceversion',\r\n\r\n /**\r\n * The maximum data service version.\r\n */\r\n MAX_DATA_SERVICE_VERSION: 'maxdataserviceversion',\r\n\r\n /**\r\n * The master Windows Azure Storage header prefix.\r\n */\r\n PREFIX_FOR_STORAGE: 'x-ms-',\r\n\r\n /**\r\n * The client request Id header.\r\n */\r\n CLIENT_REQUEST_ID: 'x-ms-client-request-id',\r\n\r\n /**\r\n * The header that specifies the approximate message count of a queue.\r\n */\r\n APPROXIMATE_MESSAGES_COUNT: 'x-ms-approximate-messages-count',\r\n\r\n /**\r\n * The Authorization header.\r\n */\r\n AUTHORIZATION: 'authorization',\r\n\r\n /**\r\n * The header that specifies public access to blobs.\r\n */\r\n BLOB_PUBLIC_ACCESS: 'x-ms-blob-public-access',\r\n\r\n /**\r\n * The header for the blob type.\r\n */\r\n BLOB_TYPE: 'x-ms-blob-type',\r\n\r\n /**\r\n * The header for the type.\r\n */\r\n TYPE: 'x-ms-type',\r\n\r\n /**\r\n * Specifies the block blob type.\r\n */\r\n BLOCK_BLOB: 'blockblob',\r\n\r\n /**\r\n * The CacheControl header.\r\n */\r\n CACHE_CONTROL: 'cache-control',\r\n\r\n /**\r\n * The header that specifies blob caching control.\r\n */\r\n BLOB_CACHE_CONTROL: 'x-ms-blob-cache-control',\r\n\r\n /**\r\n * The header that specifies caching control.\r\n */\r\n FILE_CACHE_CONTROL: 'x-ms-cache-control',\r\n\r\n /**\r\n * The copy status.\r\n */\r\n COPY_STATUS: 'x-ms-copy-status',\r\n\r\n /**\r\n * The copy completion time\r\n */\r\n COPY_COMPLETION_TIME: 'x-ms-copy-completion-time',\r\n\r\n /**\r\n * The copy status message\r\n */\r\n COPY_STATUS_DESCRIPTION: 'x-ms-copy-status-description',\r\n\r\n /**\r\n * The copy identifier.\r\n */\r\n COPY_ID: 'x-ms-copy-id',\r\n\r\n /**\r\n * Progress of any copy operation\r\n */\r\n COPY_PROGRESS: 'x-ms-copy-progress',\r\n\r\n /**\r\n * The copy action.\r\n */\r\n COPY_ACTION: 'x-ms-copy-action',\r\n\r\n /**\r\n * The ContentID header.\r\n */\r\n CONTENT_ID: 'content-id',\r\n\r\n /**\r\n * The ContentEncoding header.\r\n */\r\n CONTENT_ENCODING: 'content-encoding',\r\n\r\n /**\r\n * The header that specifies blob content encoding.\r\n */\r\n BLOB_CONTENT_ENCODING: 'x-ms-blob-content-encoding',\r\n\r\n /**\r\n * The header that specifies content encoding.\r\n */\r\n FILE_CONTENT_ENCODING: 'x-ms-content-encoding',\r\n\r\n /**\r\n * The ContentLangauge header.\r\n */\r\n CONTENT_LANGUAGE: 'content-language',\r\n\r\n /**\r\n * The header that specifies blob content language.\r\n */\r\n BLOB_CONTENT_LANGUAGE: 'x-ms-blob-content-language',\r\n\r\n /**\r\n * The header that specifies content language.\r\n */\r\n FILE_CONTENT_LANGUAGE: 'x-ms-content-language',\r\n\r\n /**\r\n * The ContentLength header.\r\n */\r\n CONTENT_LENGTH: 'content-length',\r\n\r\n /**\r\n * The header that specifies blob content length.\r\n */\r\n BLOB_CONTENT_LENGTH: 'x-ms-blob-content-length',\r\n\r\n /**\r\n * The header that specifies content length.\r\n */\r\n FILE_CONTENT_LENGTH: 'x-ms-content-length',\r\n\r\n /**\r\n * The ContentDisposition header.\r\n */\r\n CONTENT_DISPOSITION: 'content-disposition',\r\n\r\n /**\r\n * The header that specifies blob content disposition.\r\n */\r\n BLOB_CONTENT_DISPOSITION: 'x-ms-blob-content-disposition',\r\n\r\n /**\r\n * The header that specifies content disposition.\r\n */\r\n FILE_CONTENT_DISPOSITION: 'x-ms-content-disposition',\r\n\r\n /**\r\n * The ContentMD5 header.\r\n */\r\n CONTENT_MD5: 'content-md5',\r\n\r\n /**\r\n * The header that specifies blob content MD5.\r\n */\r\n BLOB_CONTENT_MD5: 'x-ms-blob-content-md5',\r\n\r\n /**\r\n * The header that specifies content MD5.\r\n */\r\n FILE_CONTENT_MD5: 'x-ms-content-md5',\r\n\r\n /**\r\n * The ContentRange header.\r\n */\r\n CONTENT_RANGE: 'Content-Range',\r\n\r\n /**\r\n * The ContentType header.\r\n */\r\n CONTENT_TYPE: 'Content-Type',\r\n\r\n /**\r\n * The header that specifies blob content type.\r\n */\r\n BLOB_CONTENT_TYPE: 'x-ms-blob-content-type',\r\n\r\n /**\r\n * The header that specifies content type.\r\n */\r\n FILE_CONTENT_TYPE: 'x-ms-content-type',\r\n\r\n /**\r\n * The header for copy source.\r\n */\r\n COPY_SOURCE: 'x-ms-copy-source',\r\n\r\n /**\r\n * The header that specifies the date.\r\n */\r\n DATE: 'date',\r\n\r\n /**\r\n * The header that specifies the date.\r\n */\r\n MS_DATE: 'x-ms-date',\r\n\r\n /**\r\n * The header to delete snapshots.\r\n */\r\n DELETE_SNAPSHOT: 'x-ms-delete-snapshots',\r\n\r\n /**\r\n * The ETag header.\r\n */\r\n ETAG: 'etag',\r\n\r\n /**\r\n * The IfMatch header.\r\n */\r\n IF_MATCH: 'if-match',\r\n\r\n /**\r\n * The IfModifiedSince header.\r\n */\r\n IF_MODIFIED_SINCE: 'if-modified-since',\r\n\r\n /**\r\n * The IfNoneMatch header.\r\n */\r\n IF_NONE_MATCH: 'if-none-match',\r\n\r\n /**\r\n * The IfUnmodifiedSince header.\r\n */\r\n IF_UNMODIFIED_SINCE: 'if-unmodified-since',\r\n\r\n /**\r\n * Specifies snapshots are to be included.\r\n */\r\n INCLUDE_SNAPSHOTS_VALUE: 'include',\r\n\r\n /**\r\n * Specifies that the content-type is JSON.\r\n */\r\n JSON_CONTENT_TYPE_VALUE: 'application/json;',\r\n\r\n /**\r\n * The header that specifies lease ID.\r\n */\r\n LEASE_ID: 'x-ms-lease-id',\r\n\r\n /**\r\n * The header that specifies the lease break period.\r\n */\r\n LEASE_BREAK_PERIOD: 'x-ms-lease-break-period',\r\n\r\n /**\r\n * The header that specifies the proposed lease identifier.\r\n */\r\n PROPOSED_LEASE_ID: 'x-ms-proposed-lease-id',\r\n\r\n /**\r\n * The header that specifies the lease duration.\r\n */\r\n LEASE_DURATION: 'x-ms-lease-duration',\r\n\r\n /**\r\n * The header that specifies the source lease ID.\r\n */\r\n SOURCE_LEASE_ID: 'x-ms-source-lease-id',\r\n\r\n /**\r\n * The header that specifies lease time.\r\n */\r\n LEASE_TIME: 'x-ms-lease-time',\r\n\r\n /**\r\n * The header that specifies lease status.\r\n */\r\n LEASE_STATUS: 'x-ms-lease-status',\r\n\r\n /**\r\n * The header that specifies lease state.\r\n */\r\n LEASE_STATE: 'x-ms-lease-state',\r\n\r\n /**\r\n * Specifies the page blob type.\r\n */\r\n PAGE_BLOB: 'PageBlob',\r\n\r\n /**\r\n * The header that specifies page write mode.\r\n */\r\n PAGE_WRITE: 'x-ms-page-write',\r\n\r\n /**\r\n * The header that specifies file range write mode.\r\n */\r\n FILE_WRITE: 'x-ms-write',\r\n\r\n /**\r\n * The header that specifies whether the response should include the inserted entity.\r\n */\r\n PREFER: 'Prefer',\r\n\r\n /**\r\n * The header value which specifies that the response should include the inserted entity.\r\n */\r\n PREFER_CONTENT: 'return-content',\r\n\r\n /**\r\n * The header value which specifies that the response should not include the inserted entity.\r\n */\r\n PREFER_NO_CONTENT: 'return-no-content',\r\n\r\n /**\r\n * The header prefix for metadata.\r\n */\r\n PREFIX_FOR_STORAGE_METADATA: 'x-ms-meta-',\r\n\r\n /**\r\n * The header prefix for properties.\r\n */\r\n PREFIX_FOR_STORAGE_PROPERTIES: 'x-ms-prop-',\r\n\r\n /**\r\n * The Range header.\r\n */\r\n RANGE: 'Range',\r\n\r\n /**\r\n * The header that specifies if the request will populate the ContentMD5 header for range gets.\r\n */\r\n RANGE_GET_CONTENT_MD5: 'x-ms-range-get-content-md5',\r\n\r\n /**\r\n * The format string for specifying ranges.\r\n */\r\n RANGE_HEADER_FORMAT: 'bytes:%d-%d',\r\n\r\n /**\r\n * The header that indicates the request ID.\r\n */\r\n REQUEST_ID: 'x-ms-request-id',\r\n\r\n /**\r\n * The header for specifying the sequence number.\r\n */\r\n SEQUENCE_NUMBER: 'x-ms-blob-sequence-number',\r\n\r\n /**\r\n * The header for specifying the If-Sequence-Number-EQ condition.\r\n */\r\n SEQUENCE_NUMBER_EQUAL: 'x-ms-if-sequence-number-eq',\r\n\r\n /**\r\n * The header for specifying the If-Sequence-Number-LT condition.\r\n */\r\n SEQUENCE_NUMBER_LESS_THAN: 'x-ms-if-sequence-number-lt',\r\n\r\n /**\r\n * The header for specifying the If-Sequence-Number-LE condition.\r\n */\r\n SEQUENCE_NUMBER_LESS_THAN_OR_EQUAL: 'x-ms-if-sequence-number-le',\r\n\r\n /**\r\n * The header that specifies sequence number action.\r\n */\r\n SEQUENCE_NUMBER_ACTION: 'x-ms-sequence-number-action',\r\n\r\n /**\r\n * The header for the blob content length.\r\n */\r\n SIZE: 'x-ms-blob-content-length',\r\n\r\n /**\r\n * The header for snapshots.\r\n */\r\n SNAPSHOT: 'x-ms-snapshot',\r\n\r\n /**\r\n * Specifies only snapshots are to be included.\r\n */\r\n SNAPSHOTS_ONLY_VALUE: 'only',\r\n\r\n /**\r\n * The header for the If-Match condition.\r\n */\r\n SOURCE_IF_MATCH: 'x-ms-source-if-match',\r\n\r\n /**\r\n * The header for the If-Modified-Since condition.\r\n */\r\n SOURCE_IF_MODIFIED_SINCE: 'x-ms-source-if-modified-since',\r\n\r\n /**\r\n * The header for the If-None-Match condition.\r\n */\r\n SOURCE_IF_NONE_MATCH: 'x-ms-source-if-none-match',\r\n\r\n /**\r\n * The header for the If-Unmodified-Since condition.\r\n */\r\n SOURCE_IF_UNMODIFIED_SINCE: 'x-ms-source-if-unmodified-since',\r\n\r\n /**\r\n * The header for data ranges.\r\n */\r\n STORAGE_RANGE: 'x-ms-range',\r\n\r\n /**\r\n * The header for storage version.\r\n */\r\n STORAGE_VERSION: 'x-ms-version',\r\n\r\n /**\r\n * The current storage version header value.\r\n */\r\n TARGET_STORAGE_VERSION: '2015-12-11',\r\n\r\n /**\r\n * The UserAgent header.\r\n */\r\n USER_AGENT: 'user-agent',\r\n\r\n /**\r\n * The pop receipt header.\r\n */\r\n POP_RECEIPT: 'x-ms-popreceipt',\r\n\r\n /**\r\n * The time next visibile header.\r\n */\r\n TIME_NEXT_VISIBLE: 'x-ms-time-next-visible',\r\n\r\n /**\r\n * The approximate message counter header.\r\n */\r\n APPROXIMATE_MESSAGE_COUNT: 'x-ms-approximate-message-count',\r\n\r\n /**\r\n * The lease action header.\r\n */\r\n LEASE_ACTION: 'x-ms-lease-action',\r\n\r\n /**\r\n * The accept header.\r\n */\r\n ACCEPT: 'accept',\r\n\r\n /**\r\n * The accept charset header.\r\n */\r\n ACCEPT_CHARSET: 'Accept-Charset',\r\n\r\n /**\r\n * The host header.\r\n */\r\n HOST: 'host',\r\n\r\n /**\r\n * The correlation identifier header.\r\n */\r\n CORRELATION_ID: 'x-ms-correlation-id',\r\n\r\n /**\r\n * The group identifier header.\r\n */\r\n GROUP_ID: 'x-ms-group-id',\r\n\r\n /**\r\n * The share quota header.\r\n */\r\n SHARE_QUOTA: 'x-ms-share-quota',\r\n\r\n /**\r\n * The max blob size header.\r\n */\r\n BLOB_CONDITION_MAX_SIZE: 'x-ms-blob-condition-maxsize',\r\n\r\n /**\r\n * The append blob position header.\r\n */\r\n BLOB_CONDITION_APPEND_POSITION: 'x-ms-blob-condition-appendpos',\r\n\r\n /**\r\n * The append blob append offset header.\r\n */\r\n BLOB_APPEND_OFFSET: 'x-ms-blob-append-offset',\r\n\r\n /**\r\n * The append blob committed block header.\r\n */\r\n BLOB_COMMITTED_BLOCK_COUNT: 'x-ms-blob-committed-block-count',\r\n\r\n /**\r\n * If the data and application metadata are completely encrypted using the specified algorithm.\r\n */\r\n SERVER_ENCRYPTED: 'x-ms-server-encrypted',\r\n\r\n /**\r\n * The SME authorization header.\r\n */\r\n SME_AUTHORIZATION: 'x-ms-sme-authorization',\r\n\r\n /**\r\n * The secure extension data header\r\n */\r\n SECURE_EXTENSION: 'x-ms-sme-secureExtension',\r\n\r\n /**\r\n * The Use Laps Header.\r\n */\r\n USE_LAPS: 'x-ms-sme-useLaps',\r\n\r\n /**\r\n * The Laps local admin name.\r\n */\r\n LAPS_LOCALADMINNAME: 'x-ms-sme-lapsLocalAdminName',\r\n\r\n /**\r\n * Flag to log audit for the request\r\n */\r\n LOG_AUDIT: 'x-ms-sme-log-audit',\r\n\r\n /**\r\n * Flag to log telemetry for the request\r\n */\r\n LOG_TELEMETRY: 'x-ms-sme-log-telemetry',\r\n\r\n /**\r\n * Name of module making the request\r\n */\r\n MODULE_NAME: 'x-ms-sme-module-name',\r\n\r\n /**\r\n * Version of module making the request.\r\n */\r\n MODULE_VERSION: 'x-ms-sme-module-version',\r\n\r\n /**\r\n * PowerShell JEA endpoint.\r\n */\r\n POWERSHELL_ENDPOINT: 'x-ms-sme-jea-endpoint',\r\n\r\n /**\r\n * Cross-site request forgery token.\r\n * Use `X-XSRF-TOKEN` for the header name and `XSRF-TOKEN` for the cookie name.\r\n */\r\n CROSS_SITE_REQUEST_FORGERY_TOKEN: 'x-xsrf-token',\r\n\r\n /**\r\n * Authentication mechanism request.\r\n */\r\n AUTHENTICATION_MECHANISM: 'x-ms-sme-authentication-mechanism',\r\n\r\n /**\r\n * Version of requested static content.\r\n */\r\n STATIC_VERSION: 'x-ms-sme-static-version'\r\n};\r\n\r\nexport const enum HttpStatusCode {\r\n // GenericError is defined for Status code 0. It has been observed when a http call was not completed due to\r\n // network communication error, security error, the gateway server was not running or something else, however\r\n // it doesn't give exact reason of the error.\r\n GenericError = 0,\r\n\r\n CorsRequestFailed = 0,\r\n Continue = 100,\r\n SwitchingProtocols = 101,\r\n Ok = 200,\r\n Created = 201,\r\n Accepted = 202,\r\n NonAuthoritativeInformation = 203,\r\n NoContent = 204,\r\n ResetContent = 205,\r\n PartialContent = 206,\r\n Ambiguous = 300,\r\n MultipleChoices = 300,\r\n Moved = 301,\r\n MovedPermanently = 301,\r\n Found = 302,\r\n Redirect = 302,\r\n RedirectMethod = 303,\r\n SeeOther = 303,\r\n NotModified = 304,\r\n UseProxy = 305,\r\n Unused = 306,\r\n RedirectKeepVerb = 307,\r\n TemporaryRedirect = 307,\r\n BadRequest = 400,\r\n Unauthorized = 401,\r\n PaymentRequired = 402,\r\n Forbidden = 403,\r\n NotFound = 404,\r\n MethodNotAllowed = 405,\r\n NotAcceptable = 406,\r\n ProxyAuthenticationRequired = 407,\r\n RequestTimeout = 408,\r\n Conflict = 409,\r\n Gone = 410,\r\n LengthRequired = 411,\r\n PreconditionFailed = 412,\r\n RequestEntityTooLarge = 413,\r\n RequestUriTooLong = 414,\r\n UnsupportedMediaType = 415,\r\n RequestedRangeNotSatisfiable = 416,\r\n ExpectationFailed = 417,\r\n UpgradeRequired = 426,\r\n PreconditionRequired = 428,\r\n InternalServerError = 500,\r\n NotImplemented = 501,\r\n BadGateway = 502,\r\n ServiceUnavailable = 503,\r\n GatewayTimeout = 504,\r\n HttpVersionNotSupported = 505\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/data/http-constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,yBAAyB,EAAE,2BAA2B;IAEtD;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAEhB;;OAEG;IACH,QAAQ,EAAE,UAAU;IAEpB;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,oBAAoB,EAAE,oBAAoB;IAE1C;;OAEG;IACH,wBAAwB,EAAE,uBAAuB;IAEjD;;OAEG;IACH,kBAAkB,EAAE,OAAO;IAE3B;;OAEG;IACH,iBAAiB,EAAE,wBAAwB;IAE3C;;OAEG;IACH,0BAA0B,EAAE,iCAAiC;IAE7D;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,kBAAkB,EAAE,yBAAyB;IAE7C;;OAEG;IACH,SAAS,EAAE,gBAAgB;IAE3B;;OAEG;IACH,IAAI,EAAE,WAAW;IAEjB;;OAEG;IACH,UAAU,EAAE,WAAW;IAEvB;;OAEG;IACH,aAAa,EAAE,eAAe;I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zC;;MAEE;IACH,gBAAgB,EAAE,0BAA0B;IAE5C;;OAEG;IACH,QAAQ,EAAE,kBAAkB;IAE5B;;OAEG;IACH,mBAAmB,EAAE,6BAA6B;IAElD;;OAEG;IACH,SAAS,EAAE,oBAAoB;IAE/B;;OAEG;IACH,aAAa,EAAE,wBAAwB;IAEvC;;OAEG;IACH,WAAW,EAAE,sBAAsB;IAEnC;;OAEG;IACH,cAAc,EAAE,yBAAyB;IAEzC;;OAEG;IACH,mBAAmB,EAAE,uBAAuB;IAE5C;;;OAGG;IACH,gCAAgC,EAAE,cAAc;IAEhD;;OAEG;IACH,wBAAwB,EAAE,mCAAmC;IAE7D;;OAEG;IACH,cAAc,EAAE,yBAAyB;CAC5C,CAAC","file":"http-constants.js","sourcesContent":["/**\r\n * Defines constants for use with HTTP headers.\r\n */\r\nexport const headerConstants = {\r\n /**\r\n * The accept language header.\r\n */\r\n ACCEPT_LANGUAGE: 'accept-language',\r\n\r\n /**\r\n * The accept ranges header.\r\n */\r\n ACCEPT_RANGES: 'accept-ranges',\r\n\r\n /**\r\n * The content transfer encoding header.\r\n */\r\n CONTENT_TRANSFER_ENCODING: 'content-transfer-encoding',\r\n\r\n /**\r\n * The transfer encoding header.\r\n */\r\n TRANSFER_ENCODING: 'transfer-encoding',\r\n\r\n /**\r\n * The server header.\r\n */\r\n SERVER: 'server',\r\n\r\n /**\r\n * The location header.\r\n */\r\n LOCATION: 'location',\r\n\r\n /**\r\n * The Last-Modified header\r\n */\r\n LAST_MODIFIED: 'Last-Modified',\r\n\r\n /**\r\n * The data service version.\r\n */\r\n DATA_SERVICE_VERSION: 'dataserviceversion',\r\n\r\n /**\r\n * The maximum data service version.\r\n */\r\n MAX_DATA_SERVICE_VERSION: 'maxdataserviceversion',\r\n\r\n /**\r\n * The master Windows Azure Storage header prefix.\r\n */\r\n PREFIX_FOR_STORAGE: 'x-ms-',\r\n\r\n /**\r\n * The client request Id header.\r\n */\r\n CLIENT_REQUEST_ID: 'x-ms-client-request-id',\r\n\r\n /**\r\n * The header that specifies the approximate message count of a queue.\r\n */\r\n APPROXIMATE_MESSAGES_COUNT: 'x-ms-approximate-messages-count',\r\n\r\n /**\r\n * The Authorization header.\r\n */\r\n AUTHORIZATION: 'authorization',\r\n\r\n /**\r\n * The header that specifies public access to blobs.\r\n */\r\n BLOB_PUBLIC_ACCESS: 'x-ms-blob-public-access',\r\n\r\n /**\r\n * The header for the blob type.\r\n */\r\n BLOB_TYPE: 'x-ms-blob-type',\r\n\r\n /**\r\n * The header for the type.\r\n */\r\n TYPE: 'x-ms-type',\r\n\r\n /**\r\n * Specifies the block blob type.\r\n */\r\n BLOCK_BLOB: 'blockblob',\r\n\r\n /**\r\n * The CacheControl header.\r\n */\r\n CACHE_CONTROL: 'cache-control',\r\n\r\n /**\r\n * The header that specifies blob caching control.\r\n */\r\n BLOB_CACHE_CONTROL: 'x-ms-blob-cache-control',\r\n\r\n /**\r\n * The header that specifies caching control.\r\n */\r\n FILE_CACHE_CONTROL: 'x-ms-cache-control',\r\n\r\n /**\r\n * The copy status.\r\n */\r\n COPY_STATUS: 'x-ms-copy-status',\r\n\r\n /**\r\n * The copy completion time\r\n */\r\n COPY_COMPLETION_TIME: 'x-ms-copy-completion-time',\r\n\r\n /**\r\n * The copy status message\r\n */\r\n COPY_STATUS_DESCRIPTION: 'x-ms-copy-status-description',\r\n\r\n /**\r\n * The copy identifier.\r\n */\r\n COPY_ID: 'x-ms-copy-id',\r\n\r\n /**\r\n * Progress of any copy operation\r\n */\r\n COPY_PROGRESS: 'x-ms-copy-progress',\r\n\r\n /**\r\n * The copy action.\r\n */\r\n COPY_ACTION: 'x-ms-copy-action',\r\n\r\n /**\r\n * The ContentID header.\r\n */\r\n CONTENT_ID: 'content-id',\r\n\r\n /**\r\n * The ContentEncoding header.\r\n */\r\n CONTENT_ENCODING: 'content-encoding',\r\n\r\n /**\r\n * The header that specifies blob content encoding.\r\n */\r\n BLOB_CONTENT_ENCODING: 'x-ms-blob-content-encoding',\r\n\r\n /**\r\n * The header that specifies content encoding.\r\n */\r\n FILE_CONTENT_ENCODING: 'x-ms-content-encoding',\r\n\r\n /**\r\n * The ContentLangauge header.\r\n */\r\n CONTENT_LANGUAGE: 'content-language',\r\n\r\n /**\r\n * The header that specifies blob content language.\r\n */\r\n BLOB_CONTENT_LANGUAGE: 'x-ms-blob-content-language',\r\n\r\n /**\r\n * The header that specifies content language.\r\n */\r\n FILE_CONTENT_LANGUAGE: 'x-ms-content-language',\r\n\r\n /**\r\n * The ContentLength header.\r\n */\r\n CONTENT_LENGTH: 'content-length',\r\n\r\n /**\r\n * The header that specifies blob content length.\r\n */\r\n BLOB_CONTENT_LENGTH: 'x-ms-blob-content-length',\r\n\r\n /**\r\n * The header that specifies content length.\r\n */\r\n FILE_CONTENT_LENGTH: 'x-ms-content-length',\r\n\r\n /**\r\n * The ContentDisposition header.\r\n */\r\n CONTENT_DISPOSITION: 'content-disposition',\r\n\r\n /**\r\n * The header that specifies blob content disposition.\r\n */\r\n BLOB_CONTENT_DISPOSITION: 'x-ms-blob-content-disposition',\r\n\r\n /**\r\n * The header that specifies content disposition.\r\n */\r\n FILE_CONTENT_DISPOSITION: 'x-ms-content-disposition',\r\n\r\n /**\r\n * The ContentMD5 header.\r\n */\r\n CONTENT_MD5: 'content-md5',\r\n\r\n /**\r\n * The header that specifies blob content MD5.\r\n */\r\n BLOB_CONTENT_MD5: 'x-ms-blob-content-md5',\r\n\r\n /**\r\n * The header that specifies content MD5.\r\n */\r\n FILE_CONTENT_MD5: 'x-ms-content-md5',\r\n\r\n /**\r\n * The ContentRange header.\r\n */\r\n CONTENT_RANGE: 'Content-Range',\r\n\r\n /**\r\n * The ContentType header.\r\n */\r\n CONTENT_TYPE: 'Content-Type',\r\n\r\n /**\r\n * The header that specifies blob content type.\r\n */\r\n BLOB_CONTENT_TYPE: 'x-ms-blob-content-type',\r\n\r\n /**\r\n * The header that specifies content type.\r\n */\r\n FILE_CONTENT_TYPE: 'x-ms-content-type',\r\n\r\n /**\r\n * The header for copy source.\r\n */\r\n COPY_SOURCE: 'x-ms-copy-source',\r\n\r\n /**\r\n * The header that specifies the date.\r\n */\r\n DATE: 'date',\r\n\r\n /**\r\n * The header that specifies the date.\r\n */\r\n MS_DATE: 'x-ms-date',\r\n\r\n /**\r\n * The header to delete snapshots.\r\n */\r\n DELETE_SNAPSHOT: 'x-ms-delete-snapshots',\r\n\r\n /**\r\n * The ETag header.\r\n */\r\n ETAG: 'etag',\r\n\r\n /**\r\n * The IfMatch header.\r\n */\r\n IF_MATCH: 'if-match',\r\n\r\n /**\r\n * The IfModifiedSince header.\r\n */\r\n IF_MODIFIED_SINCE: 'if-modified-since',\r\n\r\n /**\r\n * The IfNoneMatch header.\r\n */\r\n IF_NONE_MATCH: 'if-none-match',\r\n\r\n /**\r\n * The IfUnmodifiedSince header.\r\n */\r\n IF_UNMODIFIED_SINCE: 'if-unmodified-since',\r\n\r\n /**\r\n * Specifies snapshots are to be included.\r\n */\r\n INCLUDE_SNAPSHOTS_VALUE: 'include',\r\n\r\n /**\r\n * Specifies that the content-type is JSON.\r\n */\r\n JSON_CONTENT_TYPE_VALUE: 'application/json;',\r\n\r\n /**\r\n * The header that specifies lease ID.\r\n */\r\n LEASE_ID: 'x-ms-lease-id',\r\n\r\n /**\r\n * The header that specifies the lease break period.\r\n */\r\n LEASE_BREAK_PERIOD: 'x-ms-lease-break-period',\r\n\r\n /**\r\n * The header that specifies the proposed lease identifier.\r\n */\r\n PROPOSED_LEASE_ID: 'x-ms-proposed-lease-id',\r\n\r\n /**\r\n * The header that specifies the lease duration.\r\n */\r\n LEASE_DURATION: 'x-ms-lease-duration',\r\n\r\n /**\r\n * The header that specifies the source lease ID.\r\n */\r\n SOURCE_LEASE_ID: 'x-ms-source-lease-id',\r\n\r\n /**\r\n * The header that specifies lease time.\r\n */\r\n LEASE_TIME: 'x-ms-lease-time',\r\n\r\n /**\r\n * The header that specifies lease status.\r\n */\r\n LEASE_STATUS: 'x-ms-lease-status',\r\n\r\n /**\r\n * The header that specifies lease state.\r\n */\r\n LEASE_STATE: 'x-ms-lease-state',\r\n\r\n /**\r\n * Specifies the page blob type.\r\n */\r\n PAGE_BLOB: 'PageBlob',\r\n\r\n /**\r\n * The header that specifies page write mode.\r\n */\r\n PAGE_WRITE: 'x-ms-page-write',\r\n\r\n /**\r\n * The header that specifies file range write mode.\r\n */\r\n FILE_WRITE: 'x-ms-write',\r\n\r\n /**\r\n * The header that specifies whether the response should include the inserted entity.\r\n */\r\n PREFER: 'Prefer',\r\n\r\n /**\r\n * The header value which specifies that the response should include the inserted entity.\r\n */\r\n PREFER_CONTENT: 'return-content',\r\n\r\n /**\r\n * The header value which specifies that the response should not include the inserted entity.\r\n */\r\n PREFER_NO_CONTENT: 'return-no-content',\r\n\r\n /**\r\n * The header prefix for metadata.\r\n */\r\n PREFIX_FOR_STORAGE_METADATA: 'x-ms-meta-',\r\n\r\n /**\r\n * The header prefix for properties.\r\n */\r\n PREFIX_FOR_STORAGE_PROPERTIES: 'x-ms-prop-',\r\n\r\n /**\r\n * The Range header.\r\n */\r\n RANGE: 'Range',\r\n\r\n /**\r\n * The header that specifies if the request will populate the ContentMD5 header for range gets.\r\n */\r\n RANGE_GET_CONTENT_MD5: 'x-ms-range-get-content-md5',\r\n\r\n /**\r\n * The format string for specifying ranges.\r\n */\r\n RANGE_HEADER_FORMAT: 'bytes:%d-%d',\r\n\r\n /**\r\n * The header that indicates the request ID.\r\n */\r\n REQUEST_ID: 'x-ms-request-id',\r\n\r\n /**\r\n * The header for specifying the sequence number.\r\n */\r\n SEQUENCE_NUMBER: 'x-ms-blob-sequence-number',\r\n\r\n /**\r\n * The header for specifying the If-Sequence-Number-EQ condition.\r\n */\r\n SEQUENCE_NUMBER_EQUAL: 'x-ms-if-sequence-number-eq',\r\n\r\n /**\r\n * The header for specifying the If-Sequence-Number-LT condition.\r\n */\r\n SEQUENCE_NUMBER_LESS_THAN: 'x-ms-if-sequence-number-lt',\r\n\r\n /**\r\n * The header for specifying the If-Sequence-Number-LE condition.\r\n */\r\n SEQUENCE_NUMBER_LESS_THAN_OR_EQUAL: 'x-ms-if-sequence-number-le',\r\n\r\n /**\r\n * The header that specifies sequence number action.\r\n */\r\n SEQUENCE_NUMBER_ACTION: 'x-ms-sequence-number-action',\r\n\r\n /**\r\n * The header for the blob content length.\r\n */\r\n SIZE: 'x-ms-blob-content-length',\r\n\r\n /**\r\n * The header for snapshots.\r\n */\r\n SNAPSHOT: 'x-ms-snapshot',\r\n\r\n /**\r\n * Specifies only snapshots are to be included.\r\n */\r\n SNAPSHOTS_ONLY_VALUE: 'only',\r\n\r\n /**\r\n * The header for the If-Match condition.\r\n */\r\n SOURCE_IF_MATCH: 'x-ms-source-if-match',\r\n\r\n /**\r\n * The header for the If-Modified-Since condition.\r\n */\r\n SOURCE_IF_MODIFIED_SINCE: 'x-ms-source-if-modified-since',\r\n\r\n /**\r\n * The header for the If-None-Match condition.\r\n */\r\n SOURCE_IF_NONE_MATCH: 'x-ms-source-if-none-match',\r\n\r\n /**\r\n * The header for the If-Unmodified-Since condition.\r\n */\r\n SOURCE_IF_UNMODIFIED_SINCE: 'x-ms-source-if-unmodified-since',\r\n\r\n /**\r\n * The header for data ranges.\r\n */\r\n STORAGE_RANGE: 'x-ms-range',\r\n\r\n /**\r\n * The header for storage version.\r\n */\r\n STORAGE_VERSION: 'x-ms-version',\r\n\r\n /**\r\n * The current storage version header value.\r\n */\r\n TARGET_STORAGE_VERSION: '2015-12-11',\r\n\r\n /**\r\n * The UserAgent header.\r\n */\r\n USER_AGENT: 'user-agent',\r\n\r\n /**\r\n * The pop receipt header.\r\n */\r\n POP_RECEIPT: 'x-ms-popreceipt',\r\n\r\n /**\r\n * The time next visibile header.\r\n */\r\n TIME_NEXT_VISIBLE: 'x-ms-time-next-visible',\r\n\r\n /**\r\n * The approximate message counter header.\r\n */\r\n APPROXIMATE_MESSAGE_COUNT: 'x-ms-approximate-message-count',\r\n\r\n /**\r\n * The lease action header.\r\n */\r\n LEASE_ACTION: 'x-ms-lease-action',\r\n\r\n /**\r\n * The accept header.\r\n */\r\n ACCEPT: 'accept',\r\n\r\n /**\r\n * The accept charset header.\r\n */\r\n ACCEPT_CHARSET: 'Accept-Charset',\r\n\r\n /**\r\n * The host header.\r\n */\r\n HOST: 'host',\r\n\r\n /**\r\n * The correlation identifier header.\r\n */\r\n CORRELATION_ID: 'x-ms-correlation-id',\r\n\r\n /**\r\n * The group identifier header.\r\n */\r\n GROUP_ID: 'x-ms-group-id',\r\n\r\n /**\r\n * The share quota header.\r\n */\r\n SHARE_QUOTA: 'x-ms-share-quota',\r\n\r\n /**\r\n * The max blob size header.\r\n */\r\n BLOB_CONDITION_MAX_SIZE: 'x-ms-blob-condition-maxsize',\r\n\r\n /**\r\n * The append blob position header.\r\n */\r\n BLOB_CONDITION_APPEND_POSITION: 'x-ms-blob-condition-appendpos',\r\n\r\n /**\r\n * The append blob append offset header.\r\n */\r\n BLOB_APPEND_OFFSET: 'x-ms-blob-append-offset',\r\n\r\n /**\r\n * The append blob committed block header.\r\n */\r\n BLOB_COMMITTED_BLOCK_COUNT: 'x-ms-blob-committed-block-count',\r\n\r\n /**\r\n * If the data and application metadata are completely encrypted using the specified algorithm.\r\n */\r\n SERVER_ENCRYPTED: 'x-ms-server-encrypted',\r\n\r\n /**\r\n * The SME authorization header.\r\n */\r\n SME_AUTHORIZATION: 'x-ms-sme-authorization',\r\n\r\n /**\r\n * The SME AAD authorization header.\r\n */\r\n SME_AAD_AUTHORIZATION: 'authorization-aad',\r\n\r\n /**\r\n * The secure extension data header\r\n */\r\n SECURE_EXTENSION: 'x-ms-sme-secureExtension',\r\n\r\n /**\r\n * The Use Laps Header.\r\n */\r\n USE_LAPS: 'x-ms-sme-useLaps',\r\n\r\n /**\r\n * The Laps local admin name.\r\n */\r\n LAPS_LOCALADMINNAME: 'x-ms-sme-lapsLocalAdminName',\r\n\r\n /**\r\n * Flag to log audit for the request\r\n */\r\n LOG_AUDIT: 'x-ms-sme-log-audit',\r\n\r\n /**\r\n * Flag to log telemetry for the request\r\n */\r\n LOG_TELEMETRY: 'x-ms-sme-log-telemetry',\r\n\r\n /**\r\n * Name of module making the request\r\n */\r\n MODULE_NAME: 'x-ms-sme-module-name',\r\n\r\n /**\r\n * Version of module making the request.\r\n */\r\n MODULE_VERSION: 'x-ms-sme-module-version',\r\n\r\n /**\r\n * PowerShell JEA endpoint.\r\n */\r\n POWERSHELL_ENDPOINT: 'x-ms-sme-jea-endpoint',\r\n\r\n /**\r\n * Cross-site request forgery token.\r\n * Use `X-XSRF-TOKEN` for the header name and `XSRF-TOKEN` for the cookie name.\r\n */\r\n CROSS_SITE_REQUEST_FORGERY_TOKEN: 'x-xsrf-token',\r\n\r\n /**\r\n * Authentication mechanism request.\r\n */\r\n AUTHENTICATION_MECHANISM: 'x-ms-sme-authentication-mechanism',\r\n\r\n /**\r\n * Version of requested static content.\r\n */\r\n STATIC_VERSION: 'x-ms-sme-static-version'\r\n};\r\n\r\nexport const enum HttpStatusCode {\r\n // GenericError is defined for Status code 0. It has been observed when a http call was not completed due to\r\n // network communication error, security error, the gateway server was not running or something else, however\r\n // it doesn't give exact reason of the error.\r\n GenericError = 0,\r\n\r\n CorsRequestFailed = 0,\r\n Continue = 100,\r\n SwitchingProtocols = 101,\r\n Ok = 200,\r\n Created = 201,\r\n Accepted = 202,\r\n NonAuthoritativeInformation = 203,\r\n NoContent = 204,\r\n ResetContent = 205,\r\n PartialContent = 206,\r\n Ambiguous = 300,\r\n MultipleChoices = 300,\r\n Moved = 301,\r\n MovedPermanently = 301,\r\n Found = 302,\r\n Redirect = 302,\r\n RedirectMethod = 303,\r\n SeeOther = 303,\r\n NotModified = 304,\r\n UseProxy = 305,\r\n Unused = 306,\r\n RedirectKeepVerb = 307,\r\n TemporaryRedirect = 307,\r\n BadRequest = 400,\r\n Unauthorized = 401,\r\n PaymentRequired = 402,\r\n Forbidden = 403,\r\n NotFound = 404,\r\n MethodNotAllowed = 405,\r\n NotAcceptable = 406,\r\n ProxyAuthenticationRequired = 407,\r\n RequestTimeout = 408,\r\n Conflict = 409,\r\n Gone = 410,\r\n LengthRequired = 411,\r\n PreconditionFailed = 412,\r\n RequestEntityTooLarge = 413,\r\n RequestUriTooLong = 414,\r\n UnsupportedMediaType = 415,\r\n RequestedRangeNotSatisfiable = 416,\r\n ExpectationFailed = 417,\r\n UpgradeRequired = 426,\r\n PreconditionRequired = 428,\r\n InternalServerError = 500,\r\n NotImplemented = 501,\r\n BadGateway = 502,\r\n ServiceUnavailable = 503,\r\n GatewayTimeout = 504,\r\n HttpVersionNotSupported = 505\r\n}\r\n"]}
|
package/core/data/net.d.ts
CHANGED
|
@@ -196,21 +196,19 @@ export declare class Net {
|
|
|
196
196
|
* @param jwk the JWK (Json Web Key)
|
|
197
197
|
* @param usersName name of user.
|
|
198
198
|
* @param password the password.
|
|
199
|
+
* @param logonUser the gateway user
|
|
200
|
+
* @param expirationTimeInMs manage as token expiration time in milliseconds
|
|
199
201
|
* @return the token string.
|
|
200
202
|
*/
|
|
201
|
-
static createEncryptedAuthenticationHeader(jwk: string, userNames: string[], password: string): Observable<string>;
|
|
202
|
-
static
|
|
203
|
+
static createEncryptedAuthenticationHeader(jwk: string, userNames: string[], password: string, logonUser: string, expirationTimeInMs: number): Observable<string>;
|
|
204
|
+
private static createPasswordData;
|
|
203
205
|
/**
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* @param
|
|
207
|
-
* @
|
|
208
|
-
* @return the token string.
|
|
206
|
+
* Creates encrypted data for auth header
|
|
207
|
+
* @param jwk the JSON web key to be used to encrypt data
|
|
208
|
+
* @param data the data to be encrypted
|
|
209
|
+
* @returns an encrypted string
|
|
209
210
|
*/
|
|
210
|
-
static
|
|
211
|
-
upgraded: boolean;
|
|
212
|
-
token: string;
|
|
213
|
-
}>;
|
|
211
|
+
static createEncryptedExtensionDataHeader(jwk: string, data: string): Observable<string>;
|
|
214
212
|
/**
|
|
215
213
|
* Create /api/nodes URL with relativeUrl.
|
|
216
214
|
*
|
|
@@ -264,6 +262,12 @@ export declare class Net {
|
|
|
264
262
|
* @return string the related error string.
|
|
265
263
|
*/
|
|
266
264
|
static translateErrorCode(code: number): string;
|
|
265
|
+
/**
|
|
266
|
+
* Determine if this is an authorization login error. This code never work if it uses NTLM or Kerberos.
|
|
267
|
+
*
|
|
268
|
+
* @param error The ajax error object.
|
|
269
|
+
*/
|
|
270
|
+
static isUnauthorizedLogin(error: AjaxError): boolean;
|
|
267
271
|
/**
|
|
268
272
|
* Determine if this is an authorization error.
|
|
269
273
|
*
|