@microsoft/windows-admin-center-sdk 2.154.1 → 2.165.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/bundles/microsoft-windows-admin-center-sdk-angular.umd.js +150 -142
- 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 +1 -1
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js.map +1 -1
- package/angular/esm2015/src/controls/data-table/data-table.component.js +133 -127
- package/angular/esm2015/src/controls/dialog/dialog.component.js +10 -4
- package/angular/esm2015/src/controls/dialog/dialog.service.js +6 -13
- package/angular/esm2015/src/service/connectivity-enforcer.js +5 -2
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js +150 -142
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js.map +1 -1
- package/core/azure/azure-constants.d.ts +8 -0
- package/core/azure/azure-constants.js +8 -0
- package/core/azure/azure-constants.js.map +1 -1
- package/core/azure/azure-manager.d.ts +1 -0
- package/core/azure/azure-manager.js +7 -1
- package/core/azure/azure-manager.js.map +1 -1
- package/core/base/environment.d.ts +3 -0
- package/core/base/environment.js.map +1 -1
- package/core/base/msft-sme.mock.js +3 -0
- package/core/base/msft-sme.mock.js.map +1 -1
- package/core/base/utilities.d.ts +0 -3
- package/core/base/utilities.js +0 -34
- package/core/base/utilities.js.map +1 -1
- package/core/data/settings-manager.d.ts +3 -0
- package/core/data/settings-manager.js +14 -1
- package/core/data/settings-manager.js.map +1 -1
- package/core/dom/dom.d.ts +5 -0
- package/core/dom/dom.js +20 -0
- package/core/dom/dom.js.map +1 -1
- package/core/manifest/environment-modules.js +3 -0
- package/core/manifest/environment-modules.js.map +1 -1
- package/core/notification/client-notification-instance.d.ts +5 -2
- package/core/notification/client-notification-instance.js +9 -5
- package/core/notification/client-notification-instance.js.map +1 -1
- package/core/notification/client-notification.d.ts +4 -0
- package/core/notification/client-notification.js.map +1 -1
- package/core/notification/notification.d.ts +6 -1
- package/core/notification/notification.js +3 -1
- package/core/notification/notification.js.map +1 -1
- package/core/rpc/credssp/rpc-credssp-model.d.ts +4 -0
- package/core/rpc/credssp/rpc-credssp-model.js.map +1 -1
- package/core/rpc/dialog/rpc-dialog-client.js +11 -5
- package/core/rpc/dialog/rpc-dialog-client.js.map +1 -1
- package/core/rpc/rpc.d.ts +6 -6
- package/core/rpc/rpc.js +7 -7
- package/core/rpc/rpc.js.map +1 -1
- package/core/security/credssp-manager.d.ts +13 -6
- package/core/security/credssp-manager.js +37 -21
- package/core/security/credssp-manager.js.map +1 -1
- package/core/shared/cluster-inventory/cluster-inventory-cache.js +2 -1
- package/core/shared/cluster-inventory/cluster-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 +7 -2
- package/angular/assets/strings/en-US/strings.json +0 -1
- package/core/assets/strings/en-US/strings.json +0 -1
- package/e2e/assets/strings/en-US/strings.json +0 -1
|
@@ -15,6 +15,14 @@ export declare class AzureConstants {
|
|
|
15
15
|
* Azure China portal.
|
|
16
16
|
*/
|
|
17
17
|
static readonly azureChinaPortal = "https://portal.azure.cn";
|
|
18
|
+
/**
|
|
19
|
+
* Azure Resource Manager endpoint - Azure US Govenment/Fairfax/Arlington.
|
|
20
|
+
*/
|
|
21
|
+
static readonly azureUSGovArmEndpoint = "https://management.usgovcloudapi.net";
|
|
22
|
+
/**
|
|
23
|
+
* Azure US Government portal.
|
|
24
|
+
*/
|
|
25
|
+
static readonly azureUSGovPortal = "https://portal.azure.us";
|
|
18
26
|
static readonly armApiVersion = "?api-version=2016-06-01";
|
|
19
27
|
static readonly azureSubscriptionUrl = "{0}/subscriptions?api-version=2016-06-01";
|
|
20
28
|
static readonly armDeploymentUrl = "{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01";
|
|
@@ -16,6 +16,14 @@ AzureConstants.azureChinaArmEndpoint = 'https://management.chinacloudapi.cn';
|
|
|
16
16
|
* Azure China portal.
|
|
17
17
|
*/
|
|
18
18
|
AzureConstants.azureChinaPortal = 'https://portal.azure.cn';
|
|
19
|
+
/**
|
|
20
|
+
* Azure Resource Manager endpoint - Azure US Govenment/Fairfax/Arlington.
|
|
21
|
+
*/
|
|
22
|
+
AzureConstants.azureUSGovArmEndpoint = 'https://management.usgovcloudapi.net';
|
|
23
|
+
/**
|
|
24
|
+
* Azure US Government portal.
|
|
25
|
+
*/
|
|
26
|
+
AzureConstants.azureUSGovPortal = 'https://portal.azure.us';
|
|
19
27
|
AzureConstants.armApiVersion = '?api-version=2016-06-01';
|
|
20
28
|
AzureConstants.azureSubscriptionUrl = '{0}/subscriptions?api-version=2016-06-01';
|
|
21
29
|
AzureConstants.armDeploymentUrl = '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/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CAAmB,CAAA;IACnB,yDAAiC,CAAA;IACjC,yDAAiC,CAAA;IACjC,qDAA6B,CAAA;IAC7B,uDAA+B,CAAA;IAC/B,yCAAiB,CAAA;IACjB,6DAAqC,CAAA;IACrC,yEAAiD,CAAA;IACjD,2EAAmD,CAAA;AACvD,CAAC,EAdW,oBAAoB,KAApB,oBAAoB,QAc/B;AAED,MAAM,KAAW,YAAY,CAgB5B;AAhBD,WAAiB,YAAY;IACzB,SAAgB,iBAAiB,CAAC,UAAkB;QAChD,QAAQ,UAAU,EAAE;YAChB,KAAK,yBAAyB,CAAC,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC;YACnE,KAAK,0BAA0B,CAAC,CAAC,OAAO,oBAAoB,CAAC,QAAQ,CAAC;YACtE,KAAK,uBAAuB,CAAC,CAAC,OAAO,oBAAoB,CAAC,cAAc,CAAC;YACzE,KAAK,yBAAyB,CAAC,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC;YACpE,KAAK,2BAA2B,CAAC,CAAC,OAAO,oBAAoB,CAAC,cAAc,CAAC;YAC7E,KAAK,4BAA4B,CAAC,CAAC,OAAO,oBAAoB,CAAC,cAAc,CAAC;YAC9E,KAAK,iBAAiB,CAAC,CAAC,OAAO,oBAAoB,CAAC,YAAY,CAAC;YACjE,KAAK,yBAAyB,CAAC,CAAC,OAAO,oBAAoB,CAAC,aAAa,CAAC;YAC1E,KAAK,iCAAiC,CAAC,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC;YAC3E,KAAK,yBAAyB,CAAC,CAAC,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;YAC7E,OAAO,CAAC,CAAC,OAAO,UAAU,CAAC;SAC9B;IACL,CAAC;IAde,8BAAiB,oBAchC,CAAA;AACL,CAAC,EAhBgB,YAAY,KAAZ,YAAY,QAgB5B","file":"azure-constants.js","sourcesContent":["export class AzureConstants {\r\n /**\r\n * Azure Resource Manager endpoint - Azure Global/Public cloud.\r\n */\r\n public static readonly azureGlobalArmEndpoint = 'https://management.azure.com';\r\n\r\n /**\r\n * Azure public portal.\r\n */\r\n public static readonly azureGlobalPortal = 'https://portal.azure.com';\r\n\r\n /**\r\n * Azure Resource Manager endpoint - Azure China cloud.\r\n */\r\n public static readonly azureChinaArmEndpoint = 'https://management.chinacloudapi.cn';\r\n\r\n /**\r\n * Azure China portal.\r\n */\r\n public static readonly azureChinaPortal = 'https://portal.azure.cn';\r\n\r\n public static readonly armApiVersion = '?api-version=2016-06-01';\r\n public static readonly azureSubscriptionUrl = '{0}/subscriptions?api-version=2016-06-01';\r\n public static readonly armDeploymentUrl =\r\n '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01';\r\n public static readonly validateAzureTemplate =\r\n '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}/validate?api-version=2018-05-01';\r\n public static readonly getAllGeoLocations = '{0}/subscriptions/{1}/locations?api-version=2016-06-01';\r\n public static readonly getResourceGroupsUri = '{0}/subscriptions/{1}/resourcegroups?api-version=2018-02-01';\r\n\r\n // Resource groups.\r\n public static readonly listResourceGroups = '{0}/subscriptions/{1}/resourcegroups?api-version=2018-05-01';\r\n public static readonly listResourceGroupsWithParameters =\r\n '{0}/subscriptions/{1}/resourcegroups?$filter={2}&$top={3}api-version=2018-05-01';\r\n public static readonly resourceGroupUrl = '{0}/subscriptions/{1}/resourcegroups/{2}?api-version=2018-05-01';\r\n\r\n // Template deployment urls.\r\n public static readonly ArmDeploymentUrl =\r\n '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01';\r\n\r\n // Request header keys and values\r\n public static readonly bearer = 'Bearer ';\r\n public static readonly authorizationHeaderKey = 'Authorization';\r\n public static readonly acceptLanguageHeaderKey = 'Accept-Language';\r\n public static readonly clientRequestHeaderKey = 'x-ms-client-request-id';\r\n public static readonly returnClientRequestHeaderKey = 'x-ms-return-client-request-id';\r\n\r\n // TODO: Remove work around for telemetry. Client request id shouldnt have any parameters.\r\n public static readonly telemetryDataParameter = 'telemetryData={0}; ';\r\n public static readonly telemetryDataInvalidValue = 'invalid';\r\n public static readonly integrationTypeDataParameter = 'integrationType={0}; ';\r\n public static readonly clientRequestIdQualifier = '{0}; ';\r\n public static readonly sourceParameter = 'source=WindowsAdminCenter';\r\n public static readonly maxEncodedTelemetryDataLength = 512;\r\n public static readonly resourceDeploymentSubstring = 'Microsoft.Resources/deployments';\r\n}\r\n\r\n/*\r\n * Azure integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set when calling this.appContextService.azureManagerService.createRequestWithHeaders() or when a\r\n * method like this.appContextService.azureManagerService.getSubscriptions() is called.\r\n */\r\nexport enum AzureIntegrationType {\r\n Backup = 'Backup',\r\n Bridge = 'Bridge',\r\n FileSync = 'FileSync',\r\n HybridServices = 'HybridServices',\r\n Monitor = 'Monitor',\r\n NetworkAdapter = 'NetworkAdapter',\r\n SecurityCenter = 'SecurityCenter',\r\n SiteRecovery = 'SiteRecovery',\r\n SubnetStretch = 'SubnetStretch',\r\n S2SVPN = 'S2SVPN',\r\n UpdateManagement = 'UpdateManagement',\r\n VirtualMachineCreation = 'VirtualMachineCreation',\r\n VirtualMachineSelection = 'VirtualMachineSelection'\r\n}\r\n\r\nexport namespace ArmTelemetry {\r\n export function toIntegrationType(moduleName: string): string {\r\n switch (moduleName) {\r\n case 'msft.azure.azure-backup': return AzureIntegrationType.Backup;\r\n case 'msft.sme.azure-file-sync': return AzureIntegrationType.FileSync;\r\n case 'msft.sme.azure-center': return AzureIntegrationType.HybridServices;\r\n case 'msft.sme.server-manager': return AzureIntegrationType.Monitor;\r\n case 'msft.sme.network-settings': return AzureIntegrationType.NetworkAdapter;\r\n case 'msft.azure.security-center': return AzureIntegrationType.SecurityCenter;\r\n case 'msft.sme.hyperv': return AzureIntegrationType.SiteRecovery;\r\n case 'msft.sme.subnet-stretch': return AzureIntegrationType.SubnetStretch;\r\n case 'msft.sdn.vgw-network-connection': return AzureIntegrationType.S2SVPN;\r\n case 'msft.sme.windows-update': return AzureIntegrationType.UpdateManagement;\r\n default: return moduleName;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/azure/azure-constants.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAc;;AACvB;;GAEG;AACoB,qCAAsB,GAAG,8BAA8B,CAAC;AAE/E;;GAEG;AACoB,gCAAiB,GAAG,0BAA0B,CAAC;AAEtE;;GAEG;AACoB,oCAAqB,GAAG,qCAAqC,CAAC;AAErF;;GAEG;AACoB,+BAAgB,GAAG,yBAAyB,CAAC;AAEpE;;GAEG;AACqB,oCAAqB,GAAG,sCAAsC,CAAC;AAEvF;;GAEG;AACoB,+BAAgB,GAAG,yBAAyB,CAAC;AAE7C,4BAAa,GAAG,yBAAyB,CAAC;AAC1C,mCAAoB,GAAG,0CAA0C,CAAC;AAClE,+BAAgB,GACnC,+GAA+G,CAAC;AAC7F,oCAAqB,GACxC,wHAAwH,CAAC;AACtG,iCAAkB,GAAG,wDAAwD,CAAC;AAC9E,mCAAoB,GAAG,6DAA6D,CAAC;AAE5G,mBAAmB;AACI,iCAAkB,GAAG,6DAA6D,CAAC;AACnF,+CAAgC,GACnD,iFAAiF,CAAC;AAC/D,+BAAgB,GAAG,iEAAiE,CAAC;AAE5G,4BAA4B;AACL,+BAAgB,GACnC,+GAA+G,CAAC;AAEpH,iCAAiC;AACV,qBAAM,GAAG,SAAS,CAAC;AACnB,qCAAsB,GAAG,eAAe,CAAC;AACzC,sCAAuB,GAAG,iBAAiB,CAAC;AAC5C,qCAAsB,GAAG,wBAAwB,CAAC;AAClD,2CAA4B,GAAG,+BAA+B,CAAC;AAEtF,0FAA0F;AACnE,qCAAsB,GAAG,qBAAqB,CAAC;AAC/C,wCA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AiC,CAAC,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC;YAC3E,KAAK,yBAAyB,CAAC,CAAC,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;YAC7E,OAAO,CAAC,CAAC,OAAO,UAAU,CAAC;SAC9B;IACL,CAAC;IAde,8BAAiB,oBAchC,CAAA;AACL,CAAC,EAhBgB,YAAY,KAAZ,YAAY,QAgB5B","file":"azure-constants.js","sourcesContent":["export class AzureConstants {\r\n /**\r\n * Azure Resource Manager endpoint - Azure Global/Public cloud.\r\n */\r\n public static readonly azureGlobalArmEndpoint = 'https://management.azure.com';\r\n\r\n /**\r\n * Azure public portal.\r\n */\r\n public static readonly azureGlobalPortal = 'https://portal.azure.com';\r\n\r\n /**\r\n * Azure Resource Manager endpoint - Azure China cloud.\r\n */\r\n public static readonly azureChinaArmEndpoint = 'https://management.chinacloudapi.cn';\r\n\r\n /**\r\n * Azure China portal.\r\n */\r\n public static readonly azureChinaPortal = 'https://portal.azure.cn';\r\n\r\n /**\r\n * Azure Resource Manager endpoint - Azure US Govenment/Fairfax/Arlington.\r\n */\r\n public static readonly azureUSGovArmEndpoint = 'https://management.usgovcloudapi.net';\r\n\r\n /**\r\n * Azure US Government portal.\r\n */\r\n public static readonly azureUSGovPortal = 'https://portal.azure.us';\r\n\r\n public static readonly armApiVersion = '?api-version=2016-06-01';\r\n public static readonly azureSubscriptionUrl = '{0}/subscriptions?api-version=2016-06-01';\r\n public static readonly armDeploymentUrl =\r\n '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01';\r\n public static readonly validateAzureTemplate =\r\n '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}/validate?api-version=2018-05-01';\r\n public static readonly getAllGeoLocations = '{0}/subscriptions/{1}/locations?api-version=2016-06-01';\r\n public static readonly getResourceGroupsUri = '{0}/subscriptions/{1}/resourcegroups?api-version=2018-02-01';\r\n\r\n // Resource groups.\r\n public static readonly listResourceGroups = '{0}/subscriptions/{1}/resourcegroups?api-version=2018-05-01';\r\n public static readonly listResourceGroupsWithParameters =\r\n '{0}/subscriptions/{1}/resourcegroups?$filter={2}&$top={3}api-version=2018-05-01';\r\n public static readonly resourceGroupUrl = '{0}/subscriptions/{1}/resourcegroups/{2}?api-version=2018-05-01';\r\n\r\n // Template deployment urls.\r\n public static readonly ArmDeploymentUrl =\r\n '{0}/subscriptions/{1}/resourcegroups/{2}/providers/Microsoft.Resources/deployments/{3}?api-version=2018-02-01';\r\n\r\n // Request header keys and values\r\n public static readonly bearer = 'Bearer ';\r\n public static readonly authorizationHeaderKey = 'Authorization';\r\n public static readonly acceptLanguageHeaderKey = 'Accept-Language';\r\n public static readonly clientRequestHeaderKey = 'x-ms-client-request-id';\r\n public static readonly returnClientRequestHeaderKey = 'x-ms-return-client-request-id';\r\n\r\n // TODO: Remove work around for telemetry. Client request id shouldnt have any parameters.\r\n public static readonly telemetryDataParameter = 'telemetryData={0}; ';\r\n public static readonly telemetryDataInvalidValue = 'invalid';\r\n public static readonly integrationTypeDataParameter = 'integrationType={0}; ';\r\n public static readonly clientRequestIdQualifier = '{0}; ';\r\n public static readonly sourceParameter = 'source=WindowsAdminCenter';\r\n public static readonly maxEncodedTelemetryDataLength = 512;\r\n public static readonly resourceDeploymentSubstring = 'Microsoft.Resources/deployments';\r\n}\r\n\r\n/*\r\n * Azure integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set when calling this.appContextService.azureManagerService.createRequestWithHeaders() or when a\r\n * method like this.appContextService.azureManagerService.getSubscriptions() is called.\r\n */\r\nexport enum AzureIntegrationType {\r\n Backup = 'Backup',\r\n Bridge = 'Bridge',\r\n FileSync = 'FileSync',\r\n HybridServices = 'HybridServices',\r\n Monitor = 'Monitor',\r\n NetworkAdapter = 'NetworkAdapter',\r\n SecurityCenter = 'SecurityCenter',\r\n SiteRecovery = 'SiteRecovery',\r\n SubnetStretch = 'SubnetStretch',\r\n S2SVPN = 'S2SVPN',\r\n UpdateManagement = 'UpdateManagement',\r\n VirtualMachineCreation = 'VirtualMachineCreation',\r\n VirtualMachineSelection = 'VirtualMachineSelection'\r\n}\r\n\r\nexport namespace ArmTelemetry {\r\n export function toIntegrationType(moduleName: string): string {\r\n switch (moduleName) {\r\n case 'msft.azure.azure-backup': return AzureIntegrationType.Backup;\r\n case 'msft.sme.azure-file-sync': return AzureIntegrationType.FileSync;\r\n case 'msft.sme.azure-center': return AzureIntegrationType.HybridServices;\r\n case 'msft.sme.server-manager': return AzureIntegrationType.Monitor;\r\n case 'msft.sme.network-settings': return AzureIntegrationType.NetworkAdapter;\r\n case 'msft.azure.security-center': return AzureIntegrationType.SecurityCenter;\r\n case 'msft.sme.hyperv': return AzureIntegrationType.SiteRecovery;\r\n case 'msft.sme.subnet-stretch': return AzureIntegrationType.SubnetStretch;\r\n case 'msft.sdn.vgw-network-connection': return AzureIntegrationType.S2SVPN;\r\n case 'msft.sme.windows-update': return AzureIntegrationType.UpdateManagement;\r\n default: return moduleName;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -18,6 +18,7 @@ export declare class AzureManager {
|
|
|
18
18
|
private azureLogging;
|
|
19
19
|
private readonly AzureGlobal;
|
|
20
20
|
private readonly AzureChina;
|
|
21
|
+
private readonly AzureUSGov;
|
|
21
22
|
/**
|
|
22
23
|
* Initializes a new instance of the Azure Manager class
|
|
23
24
|
* @param rpc The rpc to forward auth requests to a parent window
|
|
@@ -20,6 +20,7 @@ export class AzureManager {
|
|
|
20
20
|
this.http = http;
|
|
21
21
|
this.AzureGlobal = 'azureglobal';
|
|
22
22
|
this.AzureChina = 'azurechina';
|
|
23
|
+
this.AzureUSGov = 'azureusgov';
|
|
23
24
|
this.watcher = new Subject();
|
|
24
25
|
this.azureLogging = new AzureLogging();
|
|
25
26
|
}
|
|
@@ -493,6 +494,9 @@ export class AzureManager {
|
|
|
493
494
|
else if (cloudName === this.AzureChina) {
|
|
494
495
|
return AzureConstants.azureChinaArmEndpoint;
|
|
495
496
|
}
|
|
497
|
+
else if (cloudName === this.AzureUSGov) {
|
|
498
|
+
return AzureConstants.azureUSGovArmEndpoint;
|
|
499
|
+
}
|
|
496
500
|
}
|
|
497
501
|
/**
|
|
498
502
|
* Make a GET request using ARM token.
|
|
@@ -532,7 +536,9 @@ export class AzureManager {
|
|
|
532
536
|
*/
|
|
533
537
|
putRequestWithArmToken(url, body, integrationType) {
|
|
534
538
|
if (!MsftSme.self().Init.isProduction &&
|
|
535
|
-
(url.includes(AzureConstants.azureGlobalArmEndpoint) ||
|
|
539
|
+
(url.includes(AzureConstants.azureGlobalArmEndpoint) ||
|
|
540
|
+
url.includes(AzureConstants.azureChinaArmEndpoint) ||
|
|
541
|
+
url.includes(AzureConstants.azureUSGovArmEndpoint)) &&
|
|
536
542
|
url.includes(AzureConstants.resourceDeploymentSubstring)) {
|
|
537
543
|
Logging.logWarning('putRequestWithArmToken', 'Use DeployAzure Template to create resource.');
|
|
538
544
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/azure/azure-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAGH,qBAAqB,EACrB,mBAAmB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,C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oBAAoB,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;YAC/F,IAAI,CAAC,YAAY,CAAC,6BAA6B,CAAC,MAAM,EAAE,oBAAoB,EACxE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;SAC1C;aAAM;YACH,IAAI,CAAC,YAAY,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;SAC3D;IACL,CAAC;CACJ","file":"azure-manager.js","sourcesContent":["import { from, Observable, Subject, throwError } from 'rxjs';\r\nimport { AjaxRequest, AjaxResponse } from 'rxjs/ajax';\r\nimport { filter, map, mergeMap, take, tap } from 'rxjs/operators';\r\nimport { CoreEnvironment } from '../data/core-environment';\r\nimport { Http } from '../data/http';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\nimport {\r\n RpcAzureOperation,\r\n RpcAzureOperationResult,\r\n RpcAzureOperationType,\r\n RpcAzureResponseKey\r\n} from '../rpc/azure/rpc-azure-model';\r\nimport { RpcAzureRequestClient } from '../rpc/azure/rpc-azure-request-client';\r\nimport { Rpc } from '../rpc/rpc';\r\nimport { ConnectionProperties } from '../security/connection';\r\nimport { ArmTelemetry, AzureConstants, AzureIntegrationType } from './azure-constants';\r\nimport { AzureLogging } from './azure-logging';\r\nimport { AadAppConfig } from './models/aadAppConfig-data';\r\nimport { DeploymentOperationRequestBody } from './resources/deployment-operation-request-body';\r\nimport { DeploymentOperationResponse } from './resources/deployment-operation-response';\r\nimport { LocationsOperationResult } from './resources/location-data';\r\nimport {\r\n ResourceGroupOperationResult,\r\n ResourceGroupRequestBody,\r\n ResourceGroupsOperationResult\r\n} from './resources/resource-group-data';\r\nimport { SubscriptionsOperationResult } from './resources/subscription-data';\r\n\r\n/**\r\n * Azure Manager class. Handles detecting and configuring Azure on a set of servers.\r\n */\r\nexport class AzureManager {\r\n\r\n private watcher: Subject<RpcAzureOperationResult>;\r\n private azureLogging: AzureLogging;\r\n private readonly AzureGlobal = 'azureglobal';\r\n private readonly AzureChina = 'azurechina';\r\n\r\n /**\r\n * Initializes a new instance of the Azure Manager class\r\n * @param rpc The rpc to forward auth requests to a parent window\r\n */\r\n constructor(private rpc: Rpc, private http: Http) {\r\n this.watcher = new Subject<RpcAzureOperationResult>();\r\n this.azureLogging = new AzureLogging();\r\n }\r\n\r\n /**\r\n * Initialize the azure manager\r\n */\r\n public initialize() {\r\n // When in Shell (the top window) do not register. Only extension register.\r\n if (MsftSme.isExtension()) {\r\n this.rpc.register(RpcAzureResponseKey.command, this.onRpcResponse.bind(this));\r\n }\r\n }\r\n\r\n /**\r\n * Get application from gateway\r\n */\r\n public getAppInfo(): Observable<any> {\r\n return this.sendRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadStatus\r\n });\r\n }\r\n\r\n /**\r\n * Open the register Aad dialog\r\n */\r\n public openRegisterAadDialog(): Observable<any> {\r\n return this.sendRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.OpenAzureDialog\r\n });\r\n }\r\n\r\n /**\r\n * Signs in user.\r\n */\r\n public signIn(): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.SignIn\r\n });\r\n }\r\n\r\n /**\r\n * Signs out user.\r\n */\r\n public signOut(): Observable<any> {\r\n return this.sendRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.SignOut\r\n });\r\n }\r\n\r\n /**\r\n * Switches user accounts.\r\n */\r\n public switchAccounts(): Observable<any> {\r\n throw new Error('To be implemented');\r\n }\r\n\r\n /**\r\n * Get user token from azure\r\n */\r\n public getToken(): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadToken\r\n });\r\n }\r\n\r\n /**\r\n * Get the Azure AD graph token from azure\r\n */\r\n public getGraphToken(): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadGraphToken\r\n });\r\n }\r\n\r\n /**\r\n * Get the Microsoft graph token from azure\r\n * @param scopes The set of permissions for which the token has to be requested.\r\n * https://docs.microsoft.com/en-us/graph/permissions-reference\r\n * A null value will request default scopes - openid and profile.\r\n */\r\n public getMicrosoftGraphToken(scopes: string[] = null): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetMicrosoftGraphToken,\r\n tokenScopes: scopes\r\n });\r\n }\r\n\r\n /**\r\n * Checks to see if user is signed in. Returns true if signed in, else false.\r\n */\r\n public checkUserSignedIn(): Observable<boolean> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.CheckUserSignedIn\r\n }).pipe(map(result => {\r\n const isSignedIn = result && result.appInfo && result.appInfo.token;\r\n return !!isSignedIn;\r\n }));\r\n }\r\n\r\n /**\r\n * Get Azure subscriptions.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getSubscriptions(integrationType?: AzureIntegrationType): Observable<SubscriptionsOperationResult> {\r\n let armEndpoint = null;\r\n const url = AzureConstants.azureSubscriptionUrl;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n return this.getRequestWithArmToken(url.format(armEndpoint), integrationType);\r\n }),\r\n map(result => {\r\n const response: SubscriptionsOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Check whether a resource group exists or not.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public checkResourceGroupExists(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n integrationType?: AzureIntegrationType): Observable<{ status: number }> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n return this.getArmToken();\r\n }),\r\n mergeMap(token => {\r\n const url = AzureConstants.resourceGroupUrl.format(armEndpoint, subscriptionId, resourceGroupName);\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.head(url, ajaxRequest);\r\n }),\r\n map(result => {\r\n return { status: result.status };\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Create or update (if it exists) resource group.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param body request body. Optional. See definition of ResourceGroupRequestBody for what fields can be inside this body.\r\n * If this is not provided, a default of { \\'location\\': \\'West US\\' } will be used.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public createResourceGroup(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n body?: ResourceGroupRequestBody,\r\n integrationType?: AzureIntegrationType): Observable<ResourceGroupOperationResult> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.resourceGroupUrl.format(armEndpoint, subscriptionId, resourceGroupName);\r\n if (!body) {\r\n body = <ResourceGroupRequestBody>{ location: 'West US' };\r\n }\r\n return this.putRequestWithArmToken(url, body, integrationType);\r\n }),\r\n map(result => {\r\n const response: ResourceGroupOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * List all resource groups in a subscription.\r\n * @param subscriptionId The subscription id.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getResourceGroups(subscriptionId: string, integrationType?: AzureIntegrationType): Observable<ResourceGroupsOperationResult> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.listResourceGroups.format(armEndpoint, subscriptionId);\r\n return this.getRequestWithArmToken(url, integrationType);\r\n }),\r\n map(result => {\r\n const response: ResourceGroupsOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Delete resource group.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public deleteResourceGroup(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n integrationType?: AzureIntegrationType): Observable<{ status: number }> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.resourceGroupUrl.format(armEndpoint, subscriptionId, resourceGroupName);\r\n return this.deleteRequestWithArmToken(url, integrationType);\r\n }),\r\n map(result => {\r\n // result.status will either be 200 or 202.\r\n return { status: result.status };\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Get all available geo-locations.\r\n * @param subscriptionId The subscription id.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getAllAzureLocations(subscriptionId: string, integrationType?: AzureIntegrationType): Observable<LocationsOperationResult> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.getAllGeoLocations.format(armEndpoint, subscriptionId);\r\n return this.getRequestWithArmToken(url, integrationType);\r\n }),\r\n map(result => {\r\n const response: LocationsOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Deploy resources with Resource Manager templates and Resource Manager REST API.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param deploymentName The deployment name.\r\n * @param resourceTemplate The resource template content.\r\n * @param templateParameters The resource template parameters.\r\n * @param deploymentMode The mode that is used to deploy resources.This value can be either Incremental or Complete.\r\n * In Incremental mode, resources are deployed without deleting existing resources that are not included in the template.\r\n In Complete mode, resources are deployed and existing resources in the resource group that are not included in the\r\n template are deleted.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public DeployAzureTemplate(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n deploymentName: string,\r\n resourceTemplate: string,\r\n templateParameters: string,\r\n deploymentMode: string = 'Incremental',\r\n integrationType?: AzureIntegrationType): Observable<DeploymentOperationResponse> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.ArmDeploymentUrl.format(armEndpoint, subscriptionId, resourceGroupName, deploymentName);\r\n const body: DeploymentOperationRequestBody = {\r\n properties: {\r\n template: JSON.parse(resourceTemplate),\r\n parameters: JSON.parse(templateParameters),\r\n mode: deploymentMode\r\n }\r\n };\r\n\r\n return this.putRequestWithArmToken(url, body, integrationType);\r\n }),\r\n tap(result => this.logTelemetry(result)),\r\n map(result => this.createDeploymentOperationResponse(result))\r\n );\r\n }\r\n\r\n /**\r\n * Validate resources with Resource Manager templates and Resource Manager REST API.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param deploymentName The deployment name.\r\n * @param resourceTemplate The resource template content.\r\n * @param templateParameters The resource template parameters.\r\n * @param deploymentMode The mode that is used to deploy resources.This value can be either Incremental or Complete.\r\n * In Incremental mode, resources are deployed without deleting existing resources that are not included in the template.\r\n In Complete mode, resources are deployed and existing resources in the resource group that are not included in the\r\n template are deleted.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public validateAzureTemplate(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n deploymentName: string,\r\n resourceTemplate: string,\r\n templateParameters: string,\r\n deploymentMode: string = 'Incremental',\r\n integrationType?: AzureIntegrationType\r\n ): Observable<DeploymentOperationResponse> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.validateAzureTemplate.format(armEndpoint, subscriptionId, resourceGroupName, deploymentName);\r\n const body: DeploymentOperationRequestBody = {\r\n properties: {\r\n template: JSON.parse(resourceTemplate),\r\n parameters: JSON.parse(templateParameters),\r\n mode: deploymentMode\r\n }\r\n };\r\n\r\n return this.postRequestWithArmToken(url, body, integrationType);\r\n }),\r\n map(result => this.createDeploymentOperationResponse(result))\r\n );\r\n }\r\n\r\n /**\r\n * Creates azure request with headers\r\n * @param token bearer token for ARM request\r\n * @param options additional information that can be send in the headers of the request.\r\n * - additionalHeaders any headers besides 'Authorization'\r\n * - integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n * 'x-ms-client-request-id', 'x-ms-return-client-request-id', and 'Accept-Language'.\r\n * @return formatted AjaxRequest for an ARM call\r\n */\r\n public createRequestWithHeaders(\r\n token: string,\r\n options?: {\r\n additionalHeaders?: any,\r\n integrationType?: AzureIntegrationType,\r\n connectionProperties?: ConnectionProperties\r\n }): AjaxRequest {\r\n const ajaxRequest: AjaxRequest = { headers: {} };\r\n\r\n ajaxRequest.headers = (options && options.additionalHeaders) || {};\r\n ajaxRequest.headers[AzureConstants.authorizationHeaderKey] = AzureConstants.bearer + token;\r\n\r\n const integrationType = (options && options.integrationType) || ArmTelemetry.toIntegrationType(MsftSme.self().Init.moduleName);\r\n\r\n // TODO: Remove work around. Only intended for the quality release for Jan 2020.\r\n const connectionProperties = options && options.connectionProperties;\r\n ajaxRequest.headers[AzureConstants.clientRequestHeaderKey] =\r\n this.formatClientRequestId(\r\n integrationType,\r\n this.hexEncodeTelemetryData(connectionProperties));\r\n\r\n ajaxRequest.headers[AzureConstants.returnClientRequestHeaderKey] = 'True';\r\n ajaxRequest.headers[AzureConstants.acceptLanguageHeaderKey] = CoreEnvironment.localizationManager.getLocaleId().neutral;\r\n return ajaxRequest;\r\n }\r\n\r\n /**\r\n * Gets the arm token.\r\n */\r\n public getArmToken(): Observable<string> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadToken\r\n })\r\n .pipe(\r\n map(result => {\r\n return result && result.appInfo && result.appInfo.token;\r\n }));\r\n }\r\n\r\n // TODO: Remove work around. Only intended for the quality release for Jan 2020.\r\n /**\r\n * Parses connection properties for ARM telemetry data and encode in hex\r\n * @param connectionProperties properties on the current active connection\r\n * @return hex encoded json object.\r\n */\r\n public hexEncodeTelemetryData(connectionProperties?: ConnectionProperties): string {\r\n if (connectionProperties\r\n && connectionProperties['operatingSystem']\r\n && connectionProperties['version']\r\n && connectionProperties['computerModel']\r\n && connectionProperties['computerManufacturer']\r\n && connectionProperties['isS2dEnabled'] != null) {\r\n const telemetryData = {\r\n operatingSystem: connectionProperties['operatingSystem'],\r\n version: connectionProperties['version'],\r\n computerManufacturer: connectionProperties['computerManufacturer'],\r\n computerModel: connectionProperties['computerModel'],\r\n isS2dEnabled: connectionProperties['isS2dEnabled']\r\n };\r\n const stringifiedData = JSON.stringify(telemetryData);\r\n try {\r\n return MsftSme.toHex(stringifiedData);\r\n } catch {\r\n return null;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n // TODO: Remove work around. Only intended for the quality release for Jan 2020.\r\n private formatClientRequestId(integrationType: string, encodedData?: string): string {\r\n let clientRequestId = AzureConstants.clientRequestIdQualifier.format(MsftSme.newGuid());\r\n\r\n if (integrationType) {\r\n clientRequestId += AzureConstants.integrationTypeDataParameter.format(integrationType);\r\n }\r\n\r\n if (encodedData != null) {\r\n if (encodedData.length < AzureConstants.maxEncodedTelemetryDataLength) {\r\n clientRequestId += AzureConstants.telemetryDataParameter.format(encodedData);\r\n } else {\r\n clientRequestId += AzureConstants.telemetryDataParameter.format(AzureConstants.telemetryDataInvalidValue);\r\n }\r\n }\r\n\r\n // Ordering of parameters is important for parsing in telemetry pipeline.\r\n clientRequestId += AzureConstants.sourceParameter;\r\n\r\n return clientRequestId;\r\n }\r\n\r\n /**\r\n * Send request to RPC\r\n * @param request RpcAzureOperation\r\n */\r\n private sendRequest(request: RpcAzureOperation): Observable<any> {\r\n Logging.log({\r\n level: LogLevel.Debug,\r\n message: 'Sending request to AzureManagerShellService. Request:{0}'.format(JSON.stringify(request)),\r\n source: 'AzureManager'\r\n });\r\n\r\n return from(RpcAzureRequestClient.azureRequest(this.rpc, request))\r\n .pipe(\r\n mergeMap(() => this.watcher),\r\n filter((result) => result.requestId === request.requestId),\r\n take(1),\r\n map((result) => result));\r\n }\r\n\r\n /**\r\n * Send token request to RPC\r\n * @param request RpcAzureOperation\r\n */\r\n private sendTokenRequest(request: RpcAzureOperation): Observable<any> {\r\n Logging.log({\r\n level: LogLevel.Debug,\r\n message: 'Sending request to AzureManagerShellService. Request:{0}'.format(JSON.stringify(request)),\r\n source: 'AzureManager'\r\n });\r\n\r\n return from(RpcAzureRequestClient.azureRequest(this.rpc, request))\r\n .pipe(\r\n mergeMap(() => this.watcher),\r\n filter((result) => result.requestId === request.requestId),\r\n take(1),\r\n map((result) => {\r\n if (result.appInfo) {\r\n return result;\r\n } else if (result.error) {\r\n throw new Error(result.error);\r\n }\r\n\r\n throw new Error(MsftSme.getStrings<Strings>().MsftSmeShell.Core.Rpc.Azure.Unexpected.Error.message);\r\n }));\r\n }\r\n\r\n /**\r\n * Handles Rpc response.\r\n */\r\n private onRpcResponse(data: RpcAzureOperationResult): Promise<any> {\r\n this.watcher.next(data);\r\n return Promise.resolve();\r\n }\r\n\r\n /**\r\n * Determine cloud specific ARM endpoint based on the cloud that gateway is registered to.\r\n * @param cloudName cloudName from gateway's app registration.\r\n * @returns Returns cloud specific ARM endpoint.\r\n */\r\n private getArmEndpoint(cloudNameParam: string): string {\r\n const cloudName = MsftSme.replaceAll(cloudNameParam, ' ', '').toLowerCase();\r\n\r\n if (cloudName === this.AzureGlobal) {\r\n return AzureConstants.azureGlobalArmEndpoint;\r\n } else if (cloudName === this.AzureChina) {\r\n return AzureConstants.azureChinaArmEndpoint;\r\n }\r\n }\r\n\r\n /**\r\n * Make a GET request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getRequestWithArmToken(url: string, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.get(url, ajaxRequest);\r\n }));\r\n }\r\n\r\n /**\r\n * Make a POST request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public postRequestWithArmToken(url: string, body: any, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.post(url, body, ajaxRequest);\r\n }));\r\n }\r\n\r\n /**\r\n * Make a PUT request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public putRequestWithArmToken(url: string, body: any, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n if (!MsftSme.self().Init.isProduction &&\r\n (url.includes(AzureConstants.azureGlobalArmEndpoint) || url.includes(AzureConstants.azureChinaArmEndpoint)) &&\r\n url.includes(AzureConstants.resourceDeploymentSubstring)) {\r\n Logging.logWarning('putRequestWithArmToken', 'Use DeployAzure Template to create resource.');\r\n }\r\n\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.put(url, body, ajaxRequest);\r\n }));\r\n }\r\n\r\n /**\r\n * Make a DELETE request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public deleteRequestWithArmToken(url: string, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.delete(url, ajaxRequest);\r\n }));\r\n }\r\n\r\n public createDeploymentOperationResponse(result: AjaxResponse): DeploymentOperationResponse {\r\n const headers = result.xhr.getAllResponseHeaders();\r\n const headerArray = headers && headers.trim().split(/[\\r\\n]+/);\r\n const headerMap: Map<string, string> = new Map<string, string>();\r\n headerArray.forEach(x => {\r\n const parts = x.split(': ');\r\n const header = parts && parts.shift();\r\n const value = parts && parts.join(': ');\r\n headerMap.set(header, value);\r\n });\r\n\r\n const response: DeploymentOperationResponse = {\r\n httpStatusCode: result.status ? result.status : null,\r\n responseHeaders: headerMap ? headerMap : null,\r\n response: result.response ? result.response : null\r\n };\r\n\r\n return response;\r\n }\r\n\r\n public logTelemetry(response: any): void {\r\n const status = response.status;\r\n response = response.response ? response.response : response;\r\n\r\n if (response && response.properties && response.properties.dependencies) {\r\n let dependentResourceIds = response.properties.dependencies;\r\n dependentResourceIds = dependentResourceIds.map(dependentResourceId => dependentResourceId.id);\r\n this.azureLogging.submitCreateResourceTelemetry(status, dependentResourceIds,\r\n response.properties.correlationId);\r\n } else {\r\n this.azureLogging.submitCreateResourceTelemetry(status);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/azure/azure-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAGH,qBAAqB,EACrB,mBAAmB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE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YACrE,IAAI,oBAAoB,GAAG,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;YAC5D,oBAAoB,GAAG,oBAAoB,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;YAC/F,IAAI,CAAC,YAAY,CAAC,6BAA6B,CAAC,MAAM,EAAE,oBAAoB,EACxE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;SAC1C;aAAM;YACH,IAAI,CAAC,YAAY,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;SAC3D;IACL,CAAC;CACJ","file":"azure-manager.js","sourcesContent":["import { from, Observable, Subject, throwError } from 'rxjs';\r\nimport { AjaxRequest, AjaxResponse } from 'rxjs/ajax';\r\nimport { filter, map, mergeMap, take, tap } from 'rxjs/operators';\r\nimport { CoreEnvironment } from '../data/core-environment';\r\nimport { Http } from '../data/http';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\nimport {\r\n RpcAzureOperation,\r\n RpcAzureOperationResult,\r\n RpcAzureOperationType,\r\n RpcAzureResponseKey\r\n} from '../rpc/azure/rpc-azure-model';\r\nimport { RpcAzureRequestClient } from '../rpc/azure/rpc-azure-request-client';\r\nimport { Rpc } from '../rpc/rpc';\r\nimport { ConnectionProperties } from '../security/connection';\r\nimport { ArmTelemetry, AzureConstants, AzureIntegrationType } from './azure-constants';\r\nimport { AzureLogging } from './azure-logging';\r\nimport { AadAppConfig } from './models/aadAppConfig-data';\r\nimport { DeploymentOperationRequestBody } from './resources/deployment-operation-request-body';\r\nimport { DeploymentOperationResponse } from './resources/deployment-operation-response';\r\nimport { LocationsOperationResult } from './resources/location-data';\r\nimport {\r\n ResourceGroupOperationResult,\r\n ResourceGroupRequestBody,\r\n ResourceGroupsOperationResult\r\n} from './resources/resource-group-data';\r\nimport { SubscriptionsOperationResult } from './resources/subscription-data';\r\n\r\n/**\r\n * Azure Manager class. Handles detecting and configuring Azure on a set of servers.\r\n */\r\nexport class AzureManager {\r\n\r\n private watcher: Subject<RpcAzureOperationResult>;\r\n private azureLogging: AzureLogging;\r\n private readonly AzureGlobal = 'azureglobal';\r\n private readonly AzureChina = 'azurechina';\r\n private readonly AzureUSGov = 'azureusgov';\r\n\r\n /**\r\n * Initializes a new instance of the Azure Manager class\r\n * @param rpc The rpc to forward auth requests to a parent window\r\n */\r\n constructor(private rpc: Rpc, private http: Http) {\r\n this.watcher = new Subject<RpcAzureOperationResult>();\r\n this.azureLogging = new AzureLogging();\r\n }\r\n\r\n /**\r\n * Initialize the azure manager\r\n */\r\n public initialize() {\r\n // When in Shell (the top window) do not register. Only extension register.\r\n if (MsftSme.isExtension()) {\r\n this.rpc.register(RpcAzureResponseKey.command, this.onRpcResponse.bind(this));\r\n }\r\n }\r\n\r\n /**\r\n * Get application from gateway\r\n */\r\n public getAppInfo(): Observable<any> {\r\n return this.sendRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadStatus\r\n });\r\n }\r\n\r\n /**\r\n * Open the register Aad dialog\r\n */\r\n public openRegisterAadDialog(): Observable<any> {\r\n return this.sendRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.OpenAzureDialog\r\n });\r\n }\r\n\r\n /**\r\n * Signs in user.\r\n */\r\n public signIn(): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.SignIn\r\n });\r\n }\r\n\r\n /**\r\n * Signs out user.\r\n */\r\n public signOut(): Observable<any> {\r\n return this.sendRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.SignOut\r\n });\r\n }\r\n\r\n /**\r\n * Switches user accounts.\r\n */\r\n public switchAccounts(): Observable<any> {\r\n throw new Error('To be implemented');\r\n }\r\n\r\n /**\r\n * Get user token from azure\r\n */\r\n public getToken(): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadToken\r\n });\r\n }\r\n\r\n /**\r\n * Get the Azure AD graph token from azure\r\n */\r\n public getGraphToken(): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadGraphToken\r\n });\r\n }\r\n\r\n /**\r\n * Get the Microsoft graph token from azure\r\n * @param scopes The set of permissions for which the token has to be requested.\r\n * https://docs.microsoft.com/en-us/graph/permissions-reference\r\n * A null value will request default scopes - openid and profile.\r\n */\r\n public getMicrosoftGraphToken(scopes: string[] = null): Observable<any> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetMicrosoftGraphToken,\r\n tokenScopes: scopes\r\n });\r\n }\r\n\r\n /**\r\n * Checks to see if user is signed in. Returns true if signed in, else false.\r\n */\r\n public checkUserSignedIn(): Observable<boolean> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.CheckUserSignedIn\r\n }).pipe(map(result => {\r\n const isSignedIn = result && result.appInfo && result.appInfo.token;\r\n return !!isSignedIn;\r\n }));\r\n }\r\n\r\n /**\r\n * Get Azure subscriptions.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getSubscriptions(integrationType?: AzureIntegrationType): Observable<SubscriptionsOperationResult> {\r\n let armEndpoint = null;\r\n const url = AzureConstants.azureSubscriptionUrl;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n return this.getRequestWithArmToken(url.format(armEndpoint), integrationType);\r\n }),\r\n map(result => {\r\n const response: SubscriptionsOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Check whether a resource group exists or not.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public checkResourceGroupExists(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n integrationType?: AzureIntegrationType): Observable<{ status: number }> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n return this.getArmToken();\r\n }),\r\n mergeMap(token => {\r\n const url = AzureConstants.resourceGroupUrl.format(armEndpoint, subscriptionId, resourceGroupName);\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.head(url, ajaxRequest);\r\n }),\r\n map(result => {\r\n return { status: result.status };\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Create or update (if it exists) resource group.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param body request body. Optional. See definition of ResourceGroupRequestBody for what fields can be inside this body.\r\n * If this is not provided, a default of { \\'location\\': \\'West US\\' } will be used.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public createResourceGroup(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n body?: ResourceGroupRequestBody,\r\n integrationType?: AzureIntegrationType): Observable<ResourceGroupOperationResult> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.resourceGroupUrl.format(armEndpoint, subscriptionId, resourceGroupName);\r\n if (!body) {\r\n body = <ResourceGroupRequestBody>{ location: 'West US' };\r\n }\r\n return this.putRequestWithArmToken(url, body, integrationType);\r\n }),\r\n map(result => {\r\n const response: ResourceGroupOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * List all resource groups in a subscription.\r\n * @param subscriptionId The subscription id.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getResourceGroups(subscriptionId: string, integrationType?: AzureIntegrationType): Observable<ResourceGroupsOperationResult> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.listResourceGroups.format(armEndpoint, subscriptionId);\r\n return this.getRequestWithArmToken(url, integrationType);\r\n }),\r\n map(result => {\r\n const response: ResourceGroupsOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Delete resource group.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public deleteResourceGroup(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n integrationType?: AzureIntegrationType): Observable<{ status: number }> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.resourceGroupUrl.format(armEndpoint, subscriptionId, resourceGroupName);\r\n return this.deleteRequestWithArmToken(url, integrationType);\r\n }),\r\n map(result => {\r\n // result.status will either be 200 or 202.\r\n return { status: result.status };\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Get all available geo-locations.\r\n * @param subscriptionId The subscription id.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getAllAzureLocations(subscriptionId: string, integrationType?: AzureIntegrationType): Observable<LocationsOperationResult> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.getAllGeoLocations.format(armEndpoint, subscriptionId);\r\n return this.getRequestWithArmToken(url, integrationType);\r\n }),\r\n map(result => {\r\n const response: LocationsOperationResult = {\r\n httpStatusCode: result.status,\r\n value: result.response\r\n };\r\n return response;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Deploy resources with Resource Manager templates and Resource Manager REST API.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param deploymentName The deployment name.\r\n * @param resourceTemplate The resource template content.\r\n * @param templateParameters The resource template parameters.\r\n * @param deploymentMode The mode that is used to deploy resources.This value can be either Incremental or Complete.\r\n * In Incremental mode, resources are deployed without deleting existing resources that are not included in the template.\r\n In Complete mode, resources are deployed and existing resources in the resource group that are not included in the\r\n template are deleted.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public DeployAzureTemplate(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n deploymentName: string,\r\n resourceTemplate: string,\r\n templateParameters: string,\r\n deploymentMode: string = 'Incremental',\r\n integrationType?: AzureIntegrationType): Observable<DeploymentOperationResponse> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.ArmDeploymentUrl.format(armEndpoint, subscriptionId, resourceGroupName, deploymentName);\r\n const body: DeploymentOperationRequestBody = {\r\n properties: {\r\n template: JSON.parse(resourceTemplate),\r\n parameters: JSON.parse(templateParameters),\r\n mode: deploymentMode\r\n }\r\n };\r\n\r\n return this.putRequestWithArmToken(url, body, integrationType);\r\n }),\r\n tap(result => this.logTelemetry(result)),\r\n map(result => this.createDeploymentOperationResponse(result))\r\n );\r\n }\r\n\r\n /**\r\n * Validate resources with Resource Manager templates and Resource Manager REST API.\r\n * @param subscriptionId The subscription id.\r\n * @param resourceGroupName The resource group name.\r\n * @param deploymentName The deployment name.\r\n * @param resourceTemplate The resource template content.\r\n * @param templateParameters The resource template parameters.\r\n * @param deploymentMode The mode that is used to deploy resources.This value can be either Incremental or Complete.\r\n * In Incremental mode, resources are deployed without deleting existing resources that are not included in the template.\r\n In Complete mode, resources are deployed and existing resources in the resource group that are not included in the\r\n template are deleted.\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public validateAzureTemplate(\r\n subscriptionId: string,\r\n resourceGroupName: string,\r\n deploymentName: string,\r\n resourceTemplate: string,\r\n templateParameters: string,\r\n deploymentMode: string = 'Incremental',\r\n integrationType?: AzureIntegrationType\r\n ): Observable<DeploymentOperationResponse> {\r\n let armEndpoint = null;\r\n return this.getAppInfo().pipe(\r\n mergeMap(({ appInfo }: { appInfo: AadAppConfig }) => {\r\n if (appInfo) {\r\n armEndpoint = this.getArmEndpoint(appInfo.cloudName);\r\n } else {\r\n return throwError(new Error('Gateway is not registered to Azure.'));\r\n }\r\n\r\n const url = AzureConstants.validateAzureTemplate.format(armEndpoint, subscriptionId, resourceGroupName, deploymentName);\r\n const body: DeploymentOperationRequestBody = {\r\n properties: {\r\n template: JSON.parse(resourceTemplate),\r\n parameters: JSON.parse(templateParameters),\r\n mode: deploymentMode\r\n }\r\n };\r\n\r\n return this.postRequestWithArmToken(url, body, integrationType);\r\n }),\r\n map(result => this.createDeploymentOperationResponse(result))\r\n );\r\n }\r\n\r\n /**\r\n * Creates azure request with headers\r\n * @param token bearer token for ARM request\r\n * @param options additional information that can be send in the headers of the request.\r\n * - additionalHeaders any headers besides 'Authorization'\r\n * - integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n * 'x-ms-client-request-id', 'x-ms-return-client-request-id', and 'Accept-Language'.\r\n * @return formatted AjaxRequest for an ARM call\r\n */\r\n public createRequestWithHeaders(\r\n token: string,\r\n options?: {\r\n additionalHeaders?: any,\r\n integrationType?: AzureIntegrationType,\r\n connectionProperties?: ConnectionProperties\r\n }): AjaxRequest {\r\n const ajaxRequest: AjaxRequest = { headers: {} };\r\n\r\n ajaxRequest.headers = (options && options.additionalHeaders) || {};\r\n ajaxRequest.headers[AzureConstants.authorizationHeaderKey] = AzureConstants.bearer + token;\r\n\r\n const integrationType = (options && options.integrationType) || ArmTelemetry.toIntegrationType(MsftSme.self().Init.moduleName);\r\n\r\n // TODO: Remove work around. Only intended for the quality release for Jan 2020.\r\n const connectionProperties = options && options.connectionProperties;\r\n ajaxRequest.headers[AzureConstants.clientRequestHeaderKey] =\r\n this.formatClientRequestId(\r\n integrationType,\r\n this.hexEncodeTelemetryData(connectionProperties));\r\n\r\n ajaxRequest.headers[AzureConstants.returnClientRequestHeaderKey] = 'True';\r\n ajaxRequest.headers[AzureConstants.acceptLanguageHeaderKey] = CoreEnvironment.localizationManager.getLocaleId().neutral;\r\n return ajaxRequest;\r\n }\r\n\r\n /**\r\n * Gets the arm token.\r\n */\r\n public getArmToken(): Observable<string> {\r\n return this.sendTokenRequest({\r\n requestId: MsftSme.newGuid(),\r\n operation: RpcAzureOperationType.GetAadToken\r\n })\r\n .pipe(\r\n map(result => {\r\n return result && result.appInfo && result.appInfo.token;\r\n }));\r\n }\r\n\r\n // TODO: Remove work around. Only intended for the quality release for Jan 2020.\r\n /**\r\n * Parses connection properties for ARM telemetry data and encode in hex\r\n * @param connectionProperties properties on the current active connection\r\n * @return hex encoded json object.\r\n */\r\n public hexEncodeTelemetryData(connectionProperties?: ConnectionProperties): string {\r\n if (connectionProperties\r\n && connectionProperties['operatingSystem']\r\n && connectionProperties['version']\r\n && connectionProperties['computerModel']\r\n && connectionProperties['computerManufacturer']\r\n && connectionProperties['isS2dEnabled'] != null) {\r\n const telemetryData = {\r\n operatingSystem: connectionProperties['operatingSystem'],\r\n version: connectionProperties['version'],\r\n computerManufacturer: connectionProperties['computerManufacturer'],\r\n computerModel: connectionProperties['computerModel'],\r\n isS2dEnabled: connectionProperties['isS2dEnabled']\r\n };\r\n const stringifiedData = JSON.stringify(telemetryData);\r\n try {\r\n return MsftSme.toHex(stringifiedData);\r\n } catch {\r\n return null;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n // TODO: Remove work around. Only intended for the quality release for Jan 2020.\r\n private formatClientRequestId(integrationType: string, encodedData?: string): string {\r\n let clientRequestId = AzureConstants.clientRequestIdQualifier.format(MsftSme.newGuid());\r\n\r\n if (integrationType) {\r\n clientRequestId += AzureConstants.integrationTypeDataParameter.format(integrationType);\r\n }\r\n\r\n if (encodedData != null) {\r\n if (encodedData.length < AzureConstants.maxEncodedTelemetryDataLength) {\r\n clientRequestId += AzureConstants.telemetryDataParameter.format(encodedData);\r\n } else {\r\n clientRequestId += AzureConstants.telemetryDataParameter.format(AzureConstants.telemetryDataInvalidValue);\r\n }\r\n }\r\n\r\n // Ordering of parameters is important for parsing in telemetry pipeline.\r\n clientRequestId += AzureConstants.sourceParameter;\r\n\r\n return clientRequestId;\r\n }\r\n\r\n /**\r\n * Send request to RPC\r\n * @param request RpcAzureOperation\r\n */\r\n private sendRequest(request: RpcAzureOperation): Observable<any> {\r\n Logging.log({\r\n level: LogLevel.Debug,\r\n message: 'Sending request to AzureManagerShellService. Request:{0}'.format(JSON.stringify(request)),\r\n source: 'AzureManager'\r\n });\r\n\r\n return from(RpcAzureRequestClient.azureRequest(this.rpc, request))\r\n .pipe(\r\n mergeMap(() => this.watcher),\r\n filter((result) => result.requestId === request.requestId),\r\n take(1),\r\n map((result) => result));\r\n }\r\n\r\n /**\r\n * Send token request to RPC\r\n * @param request RpcAzureOperation\r\n */\r\n private sendTokenRequest(request: RpcAzureOperation): Observable<any> {\r\n Logging.log({\r\n level: LogLevel.Debug,\r\n message: 'Sending request to AzureManagerShellService. Request:{0}'.format(JSON.stringify(request)),\r\n source: 'AzureManager'\r\n });\r\n\r\n return from(RpcAzureRequestClient.azureRequest(this.rpc, request))\r\n .pipe(\r\n mergeMap(() => this.watcher),\r\n filter((result) => result.requestId === request.requestId),\r\n take(1),\r\n map((result) => {\r\n if (result.appInfo) {\r\n return result;\r\n } else if (result.error) {\r\n throw new Error(result.error);\r\n }\r\n\r\n throw new Error(MsftSme.getStrings<Strings>().MsftSmeShell.Core.Rpc.Azure.Unexpected.Error.message);\r\n }));\r\n }\r\n\r\n /**\r\n * Handles Rpc response.\r\n */\r\n private onRpcResponse(data: RpcAzureOperationResult): Promise<any> {\r\n this.watcher.next(data);\r\n return Promise.resolve();\r\n }\r\n\r\n /**\r\n * Determine cloud specific ARM endpoint based on the cloud that gateway is registered to.\r\n * @param cloudName cloudName from gateway's app registration.\r\n * @returns Returns cloud specific ARM endpoint.\r\n */\r\n private getArmEndpoint(cloudNameParam: string): string {\r\n const cloudName = MsftSme.replaceAll(cloudNameParam, ' ', '').toLowerCase();\r\n\r\n if (cloudName === this.AzureGlobal) {\r\n return AzureConstants.azureGlobalArmEndpoint;\r\n } else if (cloudName === this.AzureChina) {\r\n return AzureConstants.azureChinaArmEndpoint;\r\n } else if (cloudName === this.AzureUSGov) {\r\n return AzureConstants.azureUSGovArmEndpoint;\r\n }\r\n }\r\n\r\n /**\r\n * Make a GET request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public getRequestWithArmToken(url: string, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.get(url, ajaxRequest);\r\n }));\r\n }\r\n\r\n /**\r\n * Make a POST request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public postRequestWithArmToken(url: string, body: any, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.post(url, body, ajaxRequest);\r\n }));\r\n }\r\n\r\n /**\r\n * Make a PUT request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public putRequestWithArmToken(url: string, body: any, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n if (!MsftSme.self().Init.isProduction &&\r\n (url.includes(AzureConstants.azureGlobalArmEndpoint) ||\r\n url.includes(AzureConstants.azureChinaArmEndpoint) ||\r\n url.includes(AzureConstants.azureUSGovArmEndpoint)) &&\r\n url.includes(AzureConstants.resourceDeploymentSubstring)) {\r\n Logging.logWarning('putRequestWithArmToken', 'Use DeployAzure Template to create resource.');\r\n }\r\n\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.put(url, body, ajaxRequest);\r\n }));\r\n }\r\n\r\n /**\r\n * Make a DELETE request using ARM token.\r\n * @param url endpoint for request\r\n * @param integrationType integration type is used to distinguish which Azure tool/service in Windows Admin Center is making a\r\n * Azure resource management (ARM) call. If only one repository has one tool/service, this will be inferred based\r\n * on the name of the module. If a repository has more than one tool/service then the integration type needs to be\r\n * explicitly set.\r\n */\r\n public deleteRequestWithArmToken(url: string, integrationType?: AzureIntegrationType): Observable<AjaxResponse> {\r\n return this.getArmToken().pipe(\r\n mergeMap(token => {\r\n const ajaxRequest = this.createRequestWithHeaders(token, { integrationType: integrationType });\r\n return this.http.delete(url, ajaxRequest);\r\n }));\r\n }\r\n\r\n public createDeploymentOperationResponse(result: AjaxResponse): DeploymentOperationResponse {\r\n const headers = result.xhr.getAllResponseHeaders();\r\n const headerArray = headers && headers.trim().split(/[\\r\\n]+/);\r\n const headerMap: Map<string, string> = new Map<string, string>();\r\n headerArray.forEach(x => {\r\n const parts = x.split(': ');\r\n const header = parts && parts.shift();\r\n const value = parts && parts.join(': ');\r\n headerMap.set(header, value);\r\n });\r\n\r\n const response: DeploymentOperationResponse = {\r\n httpStatusCode: result.status ? result.status : null,\r\n responseHeaders: headerMap ? headerMap : null,\r\n response: result.response ? result.response : null\r\n };\r\n\r\n return response;\r\n }\r\n\r\n public logTelemetry(response: any): void {\r\n const status = response.status;\r\n response = response.response ? response.response : response;\r\n\r\n if (response && response.properties && response.properties.dependencies) {\r\n let dependentResourceIds = response.properties.dependencies;\r\n dependentResourceIds = dependentResourceIds.map(dependentResourceId => dependentResourceId.id);\r\n this.azureLogging.submitCreateResourceTelemetry(status, dependentResourceIds,\r\n response.properties.correlationId);\r\n } else {\r\n this.azureLogging.submitCreateResourceTelemetry(status);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/base/environment.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAkVhB;AAlVD,WAAU,OAAO;IACb,YAAY,CAAC;AAiVjB,CAAC,EAlVS,OAAO,KAAP,OAAO,QAkVhB","file":"environment.js","sourcesContent":["namespace MsftSme {\r\n 'use strict';\r\n export interface MsftSmeInit {\r\n entryPointType?: string;\r\n entryPointName?: string;\r\n mode: number;\r\n moduleName?: string;\r\n moduleVersion?: string;\r\n shellOrigin?: string;\r\n isProduction?: boolean;\r\n sessionId?: string;\r\n logLevel?: number;\r\n powerShellModuleName?: string;\r\n websocket?: boolean;\r\n powerShellEndpoint?: string;\r\n sessionExpiration: number;\r\n performanceProfile: boolean;\r\n experiments?: string[];\r\n developerGuide: boolean;\r\n connectivityLevel: string;\r\n isShell: boolean;\r\n shellVersion: string;\r\n }\r\n\r\n export interface MsftSmeEnvironment {\r\n name: string;\r\n displayName: string;\r\n origin: string;\r\n signature: string;\r\n shell: {\r\n name: string;\r\n origin: string;\r\n };\r\n resources: any[];\r\n entryPoints: any[];\r\n modules: any[];\r\n configuration: EnvironmentConfiguration;\r\n version: string;\r\n loadPath?: string;\r\n }\r\n\r\n export interface MsftSmeAssets {\r\n css: string[];\r\n js: string[];\r\n }\r\n\r\n export interface MsftSmeExternalLibraries {\r\n // mapping of supported library versions to there library locations.\r\n // Caution. New library versions will almost always have a minimal\r\n // time where older versions must still be supported. (generally 2 GA releases)\r\n monaco: {\r\n '0.17.1': string;\r\n };\r\n jsll: {\r\n '4.2.18': string;\r\n };\r\n }\r\n\r\n /**\r\n * Defines a mapping of an assets versions to its relative module paths\r\n */\r\n export interface MsftSmeVersionedAsset extends MsftSme.StringMap<string> { }\r\n\r\n /**\r\n * Defines a mapping of an asset name to its versioned paths\r\n */\r\n export interface MsftSmeModuleAssets extends MsftSme.StringMap<MsftSmeVersionedAsset> { }\r\n\r\n /**\r\n * Defines a mapping of an modules names to its shared asset collection\r\n */\r\n export interface MsftSmeSharedAssets extends MsftSme.StringMap<MsftSmeModuleAssets> { }\r\n\r\n export interface MsftSmeResources {\r\n localeId: string;\r\n localeRegionalId: string;\r\n strings: any;\r\n theme: string;\r\n assets: MsftSmeAssets;\r\n moduleAssets: MsftSmeSharedAssets;\r\n accessibilityMode: boolean;\r\n lib: MsftSmeExternalLibraries;\r\n }\r\n\r\n export interface EnvironmentConfiguration {\r\n gateway?: {\r\n disabled?: boolean\r\n };\r\n application?: {\r\n theme?: 'light' | 'dark';\r\n locale?: string;\r\n };\r\n nodes?: {\r\n defaultCredentials?: {\r\n username: string,\r\n password: string\r\n encryptedWith?: 'jwk' | string\r\n }\r\n };\r\n notifications?: {\r\n redirectToHostWindow?: boolean\r\n };\r\n tools?: {\r\n hide?: boolean\r\n };\r\n connections?: {\r\n type?: 'standard' | 'server' | 'cluster',\r\n name?: string,\r\n nodeFqdns?: string[],\r\n header?: {\r\n hide?: boolean\r\n }\r\n };\r\n telemetry?: {\r\n sourceLibraryCdnLink?: string,\r\n sourceLibraryCdnIntegrityHash?: string\r\n };\r\n appBar?: {\r\n hide?: boolean\r\n title?: {\r\n hide?: boolean,\r\n value?: string,\r\n disableNavigation?: boolean\r\n },\r\n solution?: {\r\n default?: string,\r\n hide: boolean,\r\n hideDropdown: boolean\r\n },\r\n navigation?: {\r\n allowHistory: boolean,\r\n allowRefresh: boolean,\r\n allowUrlInput: boolean,\r\n allowHome: boolean\r\n },\r\n urlField?: {\r\n hideSolutionUrl: boolean\r\n },\r\n rightMenu?: {\r\n showScripts: boolean,\r\n showSettings: boolean,\r\n showAbout: boolean,\r\n showWindowControls: boolean,\r\n showShareLink: boolean\r\n },\r\n aboutDialog?: {\r\n showFeedback: boolean,\r\n feedbackLink: string,\r\n showDocumentation: boolean,\r\n documentationLink: string,\r\n releaseNotesLink: string,\r\n seeMoreReleaseDetailsLink: string,\r\n showLicense: boolean,\r\n showScriptsUseRights: boolean,\r\n showLicenseExtensions: boolean,\r\n showPrivacyStatement: boolean,\r\n privacyLink: string,\r\n showSupportPolicy: boolean,\r\n supportLink: string,\r\n showThirdPartyNotice: boolean,\r\n showShortcuts: boolean,\r\n openLinkWithoutHref: boolean\r\n },\r\n overview?: {\r\n gatewayStatusUpdateLink: string,\r\n updateLearnMoreLink: string\r\n }\r\n };\r\n settings?: {\r\n account?: {\r\n show: boolean\r\n },\r\n personalization?: {\r\n show: boolean\r\n },\r\n diagnostic?: {\r\n show: boolean\r\n },\r\n language?: {\r\n show: boolean\r\n },\r\n notification?: {\r\n show: boolean\r\n },\r\n extension?: {\r\n show: boolean\r\n },\r\n azure?: {\r\n show: boolean\r\n },\r\n access?: {\r\n show: boolean\r\n },\r\n sharedConnections?: {\r\n show: boolean\r\n },\r\n connectivity?: {\r\n show: boolean\r\n },\r\n updates?: {\r\n show: boolean\r\n }\r\n extensionUpdates?: {\r\n show: boolean\r\n }\r\n performance?: {\r\n show: boolean\r\n },\r\n advanced?: {\r\n show: boolean\r\n },\r\n proxy?: {\r\n show: boolean\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Electron Renderer\r\n * @see http://electron.atom.io/docs/api/ipc-renderer\r\n */\r\n export interface MsftSmeElectronIpcRenderer {\r\n on(channel: string, listener: Function): this;\r\n once(channel: string, listener: Function): this;\r\n removeAllListeners(channel: string): this;\r\n removeListener(channel: string, listener: Function): this;\r\n send(channel: string, ...args: any[]): void;\r\n sendSync(channel: string, ...args: any[]): any;\r\n sendTo(webContentsId: number, channel: string, ...args: any[]): void;\r\n sendToHost(channel: string, ...args: any[]): void;\r\n }\r\n\r\n /**\r\n * Electron Remote\r\n * @see http://electron.atom.io/docs/api/remote\r\n */\r\n export interface MsftSmeElectronRemote {\r\n getCurrentWindow(): {\r\n close(): void,\r\n minimize(): void,\r\n maximize(): void,\r\n unmaximize(): void,\r\n isMaximized(): boolean,\r\n };\r\n }\r\n\r\n export interface MsftSmeElectron {\r\n ipcRenderer: MsftSmeElectronIpcRenderer;\r\n remote: MsftSmeElectronRemote;\r\n }\r\n\r\n export interface MsftSmeHost {\r\n isElectron: boolean;\r\n isWeb: boolean;\r\n electron?: MsftSmeElectron;\r\n }\r\n\r\n export interface MsftSmeWindowContext {\r\n Init: MsftSmeInit;\r\n Environment: MsftSmeEnvironment;\r\n Resources: MsftSmeResources;\r\n Host: MsftSmeHost;\r\n }\r\n\r\n export interface SMEWindow extends Window {\r\n MsftSme: MsftSmeWindowContext;\r\n }\r\n\r\n export interface MessageEventListener extends EventListener {\r\n (evt: MessageEvent): void;\r\n }\r\n\r\n // The following focus is available on HTMLElement, however, focus is available on Element\r\n export interface Element {\r\n focus(): void;\r\n }\r\n\r\n export interface StringMap<T> {\r\n [key: string]: T;\r\n }\r\n\r\n export interface NumberMap<T> {\r\n [key: number]: T;\r\n length?: number;\r\n }\r\n\r\n export interface NameValue<N, T> {\r\n name: N;\r\n value: T;\r\n }\r\n\r\n export type Action = () => void;\r\n\r\n export type Action1<T> = (arg: T) => void;\r\n\r\n export type Action2<T1, T2> = (arg1: T1, arg2: T2) => void;\r\n\r\n export type Action3<T1, T2, T3> = (arg1: T1, arg2: T2, arg3: T3) => void;\r\n\r\n export type Func<R> = () => R;\r\n\r\n export type Func1<T, R> = (arg: T) => R;\r\n\r\n export type Func2<T1, T2, R> = (arg1: T1, arg2: T2) => R;\r\n\r\n export type Primitive = number | string | Date | boolean;\r\n\r\n export interface StringMapPrimitive extends StringMap<StringMapRecursive | Primitive | Array<Primitive | StringMapRecursive>> { }\r\n\r\n export type StringMapRecursive = StringMapPrimitive;\r\n\r\n // tslint:disable-next-line:no-empty-interface\r\n export interface Obsolete { }\r\n\r\n ////////////////////////////////////////\r\n /// BEGIN: IE11 ECMAScript Extensions\r\n ////////////////////////////////////////\r\n\r\n // tslint:disable-next-line:no-empty-interface\r\n export interface CollatorOptions extends Intl.CollatorOptions {\r\n }\r\n\r\n export interface Map<K, V> {\r\n delete(key: K): boolean;\r\n get(key: K): V;\r\n has(key: K): boolean;\r\n set(key: K, value: V): void;\r\n clear(): void;\r\n forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;\r\n }\r\n\r\n ////////////////////////////////////////\r\n /// END: IE11 ECMAScript Extensions\r\n ////////////////////////////////////////\r\n\r\n export interface RandomSource {\r\n getRandomValues(array: ArrayBufferView): ArrayBufferView;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/base/environment.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAqVhB;AArVD,WAAU,OAAO;IACb,YAAY,CAAC;AAoVjB,CAAC,EArVS,OAAO,KAAP,OAAO,QAqVhB","file":"environment.js","sourcesContent":["namespace MsftSme {\r\n 'use strict';\r\n export interface MsftSmeInit {\r\n entryPointType?: string;\r\n entryPointName?: string;\r\n mode: number;\r\n moduleName?: string;\r\n moduleVersion?: string;\r\n shellOrigin?: string;\r\n isProduction?: boolean;\r\n sessionId?: string;\r\n logLevel?: number;\r\n powerShellModuleName?: string;\r\n websocket?: boolean;\r\n powerShellEndpoint?: string;\r\n sessionExpiration: number;\r\n performanceProfile: boolean;\r\n experiments?: string[];\r\n developerGuide: boolean;\r\n connectivityLevel: string;\r\n isShell: boolean;\r\n shellVersion: string;\r\n }\r\n\r\n export interface MsftSmeEnvironment {\r\n name: string;\r\n displayName: string;\r\n origin: string;\r\n signature: string;\r\n shell: {\r\n name: string;\r\n origin: string;\r\n };\r\n resources: any[];\r\n entryPoints: any[];\r\n modules: any[];\r\n configuration: EnvironmentConfiguration;\r\n version: string;\r\n loadPath?: string;\r\n }\r\n\r\n export interface MsftSmeAssets {\r\n css: string[];\r\n js: string[];\r\n }\r\n\r\n export interface MsftSmeExternalLibraries {\r\n // mapping of supported library versions to there library locations.\r\n // Caution. New library versions will almost always have a minimal\r\n // time where older versions must still be supported. (generally 2 GA releases)\r\n monaco: {\r\n '0.17.1': string;\r\n };\r\n jsll: {\r\n '4.2.18': string;\r\n };\r\n }\r\n\r\n /**\r\n * Defines a mapping of an assets versions to its relative module paths\r\n */\r\n export interface MsftSmeVersionedAsset extends MsftSme.StringMap<string> { }\r\n\r\n /**\r\n * Defines a mapping of an asset name to its versioned paths\r\n */\r\n export interface MsftSmeModuleAssets extends MsftSme.StringMap<MsftSmeVersionedAsset> { }\r\n\r\n /**\r\n * Defines a mapping of an modules names to its shared asset collection\r\n */\r\n export interface MsftSmeSharedAssets extends MsftSme.StringMap<MsftSmeModuleAssets> { }\r\n\r\n export interface MsftSmeResources {\r\n localeId: string;\r\n localeRegionalId: string;\r\n strings: any;\r\n theme: string;\r\n assets: MsftSmeAssets;\r\n moduleAssets: MsftSmeSharedAssets;\r\n accessibilityMode: boolean;\r\n lib: MsftSmeExternalLibraries;\r\n }\r\n\r\n export interface EnvironmentConfiguration {\r\n gateway?: {\r\n disabled?: boolean\r\n };\r\n application?: {\r\n theme?: 'light' | 'dark';\r\n locale?: string;\r\n };\r\n nodes?: {\r\n defaultCredentials?: {\r\n username: string,\r\n password: string\r\n encryptedWith?: 'jwk' | string\r\n }\r\n };\r\n notifications?: {\r\n redirectToHostWindow?: boolean\r\n };\r\n tools?: {\r\n hide?: boolean\r\n };\r\n connections?: {\r\n type?: 'standard' | 'server' | 'cluster',\r\n name?: string,\r\n nodeFqdns?: string[],\r\n header?: {\r\n hide?: boolean\r\n }\r\n };\r\n telemetry?: {\r\n sourceLibraryCdnLink?: string,\r\n sourceLibraryCdnIntegrityHash?: string\r\n };\r\n appBar?: {\r\n hide?: boolean\r\n title?: {\r\n hide?: boolean,\r\n value?: string,\r\n disableNavigation?: boolean\r\n },\r\n solution?: {\r\n default?: string,\r\n hide: boolean,\r\n hideDropdown: boolean\r\n },\r\n navigation?: {\r\n allowHistory: boolean,\r\n allowRefresh: boolean,\r\n allowUrlInput: boolean,\r\n allowHome: boolean\r\n },\r\n urlField?: {\r\n hideSolutionUrl: boolean\r\n },\r\n rightMenu?: {\r\n showScripts: boolean,\r\n showSettings: boolean,\r\n showAbout: boolean,\r\n showWindowControls: boolean,\r\n showShareLink: boolean\r\n },\r\n aboutDialog?: {\r\n showFeedback: boolean,\r\n feedbackLink: string,\r\n showDocumentation: boolean,\r\n documentationLink: string,\r\n releaseNotesLink: string,\r\n seeMoreReleaseDetailsLink: string,\r\n showLicense: boolean,\r\n showScriptsUseRights: boolean,\r\n showLicenseExtensions: boolean,\r\n showPrivacyStatement: boolean,\r\n privacyLink: string,\r\n showSupportPolicy: boolean,\r\n supportLink: string,\r\n showThirdPartyNotice: boolean,\r\n showShortcuts: boolean,\r\n openLinkWithoutHref: boolean\r\n },\r\n overview?: {\r\n gatewayStatusUpdateLink: string,\r\n updateLearnMoreLink: string\r\n }\r\n };\r\n settings?: {\r\n account?: {\r\n show: boolean\r\n },\r\n personalization?: {\r\n show: boolean\r\n },\r\n diagnostic?: {\r\n show: boolean\r\n },\r\n language?: {\r\n show: boolean\r\n },\r\n notification?: {\r\n show: boolean\r\n },\r\n extension?: {\r\n show: boolean\r\n },\r\n azure?: {\r\n show: boolean\r\n },\r\n access?: {\r\n show: boolean\r\n },\r\n sharedConnections?: {\r\n show: boolean\r\n },\r\n connectivity?: {\r\n show: boolean\r\n },\r\n general?: {\r\n show: boolean\r\n };\r\n updates?: {\r\n show: boolean\r\n }\r\n extensionUpdates?: {\r\n show: boolean\r\n }\r\n performance?: {\r\n show: boolean\r\n },\r\n advanced?: {\r\n show: boolean\r\n },\r\n proxy?: {\r\n show: boolean\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Electron Renderer\r\n * @see http://electron.atom.io/docs/api/ipc-renderer\r\n */\r\n export interface MsftSmeElectronIpcRenderer {\r\n on(channel: string, listener: Function): this;\r\n once(channel: string, listener: Function): this;\r\n removeAllListeners(channel: string): this;\r\n removeListener(channel: string, listener: Function): this;\r\n send(channel: string, ...args: any[]): void;\r\n sendSync(channel: string, ...args: any[]): any;\r\n sendTo(webContentsId: number, channel: string, ...args: any[]): void;\r\n sendToHost(channel: string, ...args: any[]): void;\r\n }\r\n\r\n /**\r\n * Electron Remote\r\n * @see http://electron.atom.io/docs/api/remote\r\n */\r\n export interface MsftSmeElectronRemote {\r\n getCurrentWindow(): {\r\n close(): void,\r\n minimize(): void,\r\n maximize(): void,\r\n unmaximize(): void,\r\n isMaximized(): boolean,\r\n };\r\n }\r\n\r\n export interface MsftSmeElectron {\r\n ipcRenderer: MsftSmeElectronIpcRenderer;\r\n remote: MsftSmeElectronRemote;\r\n }\r\n\r\n export interface MsftSmeHost {\r\n isElectron: boolean;\r\n isWeb: boolean;\r\n electron?: MsftSmeElectron;\r\n }\r\n\r\n export interface MsftSmeWindowContext {\r\n Init: MsftSmeInit;\r\n Environment: MsftSmeEnvironment;\r\n Resources: MsftSmeResources;\r\n Host: MsftSmeHost;\r\n }\r\n\r\n export interface SMEWindow extends Window {\r\n MsftSme: MsftSmeWindowContext;\r\n }\r\n\r\n export interface MessageEventListener extends EventListener {\r\n (evt: MessageEvent): void;\r\n }\r\n\r\n // The following focus is available on HTMLElement, however, focus is available on Element\r\n export interface Element {\r\n focus(): void;\r\n }\r\n\r\n export interface StringMap<T> {\r\n [key: string]: T;\r\n }\r\n\r\n export interface NumberMap<T> {\r\n [key: number]: T;\r\n length?: number;\r\n }\r\n\r\n export interface NameValue<N, T> {\r\n name: N;\r\n value: T;\r\n }\r\n\r\n export type Action = () => void;\r\n\r\n export type Action1<T> = (arg: T) => void;\r\n\r\n export type Action2<T1, T2> = (arg1: T1, arg2: T2) => void;\r\n\r\n export type Action3<T1, T2, T3> = (arg1: T1, arg2: T2, arg3: T3) => void;\r\n\r\n export type Func<R> = () => R;\r\n\r\n export type Func1<T, R> = (arg: T) => R;\r\n\r\n export type Func2<T1, T2, R> = (arg1: T1, arg2: T2) => R;\r\n\r\n export type Primitive = number | string | Date | boolean;\r\n\r\n export interface StringMapPrimitive extends StringMap<StringMapRecursive | Primitive | Array<Primitive | StringMapRecursive>> { }\r\n\r\n export type StringMapRecursive = StringMapPrimitive;\r\n\r\n // tslint:disable-next-line:no-empty-interface\r\n export interface Obsolete { }\r\n\r\n ////////////////////////////////////////\r\n /// BEGIN: IE11 ECMAScript Extensions\r\n ////////////////////////////////////////\r\n\r\n // tslint:disable-next-line:no-empty-interface\r\n export interface CollatorOptions extends Intl.CollatorOptions {\r\n }\r\n\r\n export interface Map<K, V> {\r\n delete(key: K): boolean;\r\n get(key: K): V;\r\n has(key: K): boolean;\r\n set(key: K, value: V): void;\r\n clear(): void;\r\n forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;\r\n }\r\n\r\n ////////////////////////////////////////\r\n /// END: IE11 ECMAScript Extensions\r\n ////////////////////////////////////////\r\n\r\n export interface RandomSource {\r\n getRandomValues(array: ArrayBufferView): ArrayBufferView;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/base/msft-sme.mock.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IAOb,MAAM,CAAC,WAAW,CAAC,OAAY;QAClC,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACtC,WAAW,CAAC,aAAa,GAAG,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrG,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,SAAgD;QACnE,MAAM,IAAI,GAAiC;YACvC,IAAI,EAAE;gBACF,IAAI,EAAE,CAAC;gBACP,YAAY,EAAE,KAAK;gBACnB,QAAQ,EAAE,CAAC;gBACX,iBAAiB,EAAE,CAAC;gBACpB,kBAAkB,EAAE,KAAK;gBACzB,cAAc,EAAE,KAAK;gBACrB,iBAAiB,EAAE,EAAE;gBACrB,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,UAAU;aAC3B;YACD,IAAI,EAAE;gBACF,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,IAAI;aACd;YACD,WAAW,EAAE;gBACT,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,IAAI;gBACjB,SAAS,EAAE,IAAI;gBACf,MAAM,EAAE,IAAI;gBACZ,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,WAAW,EAAE,IAAI;gBACjB,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,IAAI;gBACb,aAAa,EAAE;oBACX,QAAQ,EAAE;wBACN,OAAO,EAAE;4BACL,IAAI,EAAE,IAAI;yBACb;wBACD,eAAe,EAAE;4BACb,IAAI,EAAE,IAAI;yBACb;wBACD,UAAU,EAAE;4BACR,IAAI,EAAE,IAAI;yBACb;wBACD,QAAQ,EAAE;4BACN,IAAI,EAAE,IAAI;yBACb;wBACD,YAAY,EAAE;4BACV,IAAI,EAAE,IAAI;yBACb;wBACD,SAAS,EAAE;4BACP,IAAI,EAAE,IAAI;yBACb;wBACD,KAAK,EAAE;4BACH,IAAI,EAAE,IAAI;yBACb;wBACD,MAAM,EAAE;4BACJ,IAAI,EAAE,IAAI;yBACb;wBACD,iBAAiB,EAAE;4BACf,IAAI,EAAE,IAAI;yBACb;wBACD,YAAY,EAAE;4BACV,IAAI,EAAE,IAAI;yBACb;wBACD,OAAO,EAAE;4BACL,IAAI,EAAE,IAAI;yBACb;wBACD,WAAW,EAAE;4BACT,IAAI,EAAE,IAAI;yBACb;wBACD,QAAQ,EAAE;4BACN,IAAI,EAAE,IAAI;yBACb;qBACJ;iBACJ;aACJ;YACD,SAAS,EAAE;gBACP,QAAQ,EAAE,OAAO;gBACjB,gBAAgB,EAAE,OAAO;gBACzB,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;gBAC3B,YAAY,EAAE,EAAE;gBAChB,iBAAiB,EAAE,KAAK;gBACxB,GAAG,EAAE,IAAI;aACZ;SACJ,CAAC;QACF,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;QAC1C,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;CACJ","file":"msft-sme.mock.js","sourcesContent":["export class MsftSmeMock {\r\n\r\n public static strings: any;\r\n\r\n public static selfSpy: jasmine.Spy;\r\n public static getStringsSpy: jasmine.Spy;\r\n\r\n public static mockStrings(strings: any) {\r\n MsftSmeMock.strings = strings.Strings;\r\n MsftSmeMock.getStringsSpy = spyOn(MsftSme, 'getStrings').and.callFake(() => MsftSmeMock.strings);\r\n }\r\n\r\n public static mockSelf(overrides?: (MsftSme.MsftSmeWindowContext | any)) {\r\n const mock: MsftSme.MsftSmeWindowContext = {\r\n Init: {\r\n mode: 1,\r\n isProduction: false,\r\n logLevel: 7,\r\n sessionExpiration: 0,\r\n performanceProfile: false,\r\n developerGuide: false,\r\n connectivityLevel: '',\r\n isShell: false,\r\n shellVersion: '11.22.33'\r\n },\r\n Host: {\r\n isElectron: false,\r\n isWeb: true\r\n },\r\n Environment: {\r\n name: null,\r\n displayName: null,\r\n resources: null,\r\n origin: null,\r\n signature: null,\r\n shell: null,\r\n entryPoints: null,\r\n modules: null,\r\n version: null,\r\n configuration: {\r\n settings: {\r\n account: {\r\n show: true\r\n },\r\n personalization: {\r\n show: true\r\n },\r\n diagnostic: {\r\n show: true,\r\n },\r\n language: {\r\n show: true\r\n },\r\n notification: {\r\n show: true\r\n },\r\n extension: {\r\n show: true\r\n },\r\n azure: {\r\n show: true\r\n },\r\n access: {\r\n show: true\r\n },\r\n sharedConnections: {\r\n show: true\r\n },\r\n connectivity: {\r\n show: true\r\n },\r\n updates: {\r\n show: true\r\n },\r\n performance: {\r\n show: true\r\n },\r\n advanced: {\r\n show: true\r\n }\r\n }\r\n }\r\n },\r\n Resources: {\r\n localeId: 'en-US',\r\n localeRegionalId: 'en-US',\r\n strings: MsftSmeMock.strings,\r\n theme: 'light',\r\n assets: { css: [], js: [] },\r\n moduleAssets: {},\r\n accessibilityMode: false,\r\n lib: null\r\n }\r\n };\r\n MsftSme.deepAssign(mock, overrides || {});\r\n MsftSmeMock.selfSpy = spyOn(MsftSme, 'self').and.callFake(() => mock);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/base/msft-sme.mock.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IAOb,MAAM,CAAC,WAAW,CAAC,OAAY;QAClC,WAAW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AI,EAAE,IAAI;yBACb;wBACD,iBAAiB,EAAE;4BACf,IAAI,EAAE,IAAI;yBACb;wBACD,OAAO,EAAE;4BACL,IAAI,EAAE,IAAI;yBACb;wBACD,YAAY,EAAE;4BACV,IAAI,EAAE,IAAI;yBACb;wBACD,OAAO,EAAE;4BACL,IAAI,EAAE,IAAI;yBACb;wBACD,WAAW,EAAE;4BACT,IAAI,EAAE,IAAI;yBACb;wBACD,QAAQ,EAAE;4BACN,IAAI,EAAE,IAAI;yBACb;qBACJ;iBACJ;aACJ;YACD,SAAS,EAAE;gBACP,QAAQ,EAAE,OAAO;gBACjB,gBAAgB,EAAE,OAAO;gBACzB,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;gBAC3B,YAAY,EAAE,EAAE;gBAChB,iBAAiB,EAAE,KAAK;gBACxB,GAAG,EAAE,IAAI;aACZ;SACJ,CAAC;QACF,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;QAC1C,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;CACJ","file":"msft-sme.mock.js","sourcesContent":["export class MsftSmeMock {\r\n\r\n public static strings: any;\r\n\r\n public static selfSpy: jasmine.Spy;\r\n public static getStringsSpy: jasmine.Spy;\r\n\r\n public static mockStrings(strings: any) {\r\n MsftSmeMock.strings = strings.Strings;\r\n MsftSmeMock.getStringsSpy = spyOn(MsftSme, 'getStrings').and.callFake(() => MsftSmeMock.strings);\r\n }\r\n\r\n public static mockSelf(overrides?: (MsftSme.MsftSmeWindowContext | any)) {\r\n const mock: MsftSme.MsftSmeWindowContext = {\r\n Init: {\r\n mode: 1,\r\n isProduction: false,\r\n logLevel: 7,\r\n sessionExpiration: 0,\r\n performanceProfile: false,\r\n developerGuide: false,\r\n connectivityLevel: '',\r\n isShell: false,\r\n shellVersion: '11.22.33'\r\n },\r\n Host: {\r\n isElectron: false,\r\n isWeb: true\r\n },\r\n Environment: {\r\n name: null,\r\n displayName: null,\r\n resources: null,\r\n origin: null,\r\n signature: null,\r\n shell: null,\r\n entryPoints: null,\r\n modules: null,\r\n version: null,\r\n configuration: {\r\n settings: {\r\n account: {\r\n show: true\r\n },\r\n personalization: {\r\n show: true\r\n },\r\n diagnostic: {\r\n show: true,\r\n },\r\n language: {\r\n show: true\r\n },\r\n notification: {\r\n show: true\r\n },\r\n extension: {\r\n show: true\r\n },\r\n azure: {\r\n show: true\r\n },\r\n access: {\r\n show: true\r\n },\r\n sharedConnections: {\r\n show: true\r\n },\r\n general: {\r\n show: true\r\n },\r\n connectivity: {\r\n show: true\r\n },\r\n updates: {\r\n show: true\r\n },\r\n performance: {\r\n show: true\r\n },\r\n advanced: {\r\n show: true\r\n }\r\n }\r\n }\r\n },\r\n Resources: {\r\n localeId: 'en-US',\r\n localeRegionalId: 'en-US',\r\n strings: MsftSmeMock.strings,\r\n theme: 'light',\r\n assets: { css: [], js: [] },\r\n moduleAssets: {},\r\n accessibilityMode: false,\r\n lib: null\r\n }\r\n };\r\n MsftSme.deepAssign(mock, overrides || {});\r\n MsftSmeMock.selfSpy = spyOn(MsftSme, 'self').and.callFake(() => mock);\r\n }\r\n}\r\n"]}
|
package/core/base/utilities.d.ts
CHANGED
|
@@ -706,9 +706,6 @@ declare namespace MsftSme {
|
|
|
706
706
|
function setPerformanceProfile(profile: boolean): void;
|
|
707
707
|
function getDeveloperGuide(): boolean;
|
|
708
708
|
function setDeveloperGuide(developerGuide: boolean): void;
|
|
709
|
-
function getSessionExpiration(): number;
|
|
710
|
-
function getSessionExpirationMinutes(): string;
|
|
711
|
-
function setSessionExpirationMinutes(timeString: string): void;
|
|
712
709
|
/**
|
|
713
710
|
* Override environment setting with experiment setting on current loaded domain. requires reload to really be effective *
|
|
714
711
|
* @param value The experiments to turn on. Each entry should be in the format: <extension name>.<key>
|
package/core/base/utilities.js
CHANGED
|
@@ -1876,40 +1876,6 @@ var MsftSme;
|
|
|
1876
1876
|
}
|
|
1877
1877
|
MsftSme.setDeveloperGuide = setDeveloperGuide;
|
|
1878
1878
|
// #endregion // Developer guide management
|
|
1879
|
-
// #region Expire Session management
|
|
1880
|
-
/**
|
|
1881
|
-
* Expire Session management.
|
|
1882
|
-
*/
|
|
1883
|
-
const defaultSessionExpirationMinutes = '60';
|
|
1884
|
-
const sessionExpirationStorageKey = '@msft-sme/shell:sessionExpiration';
|
|
1885
|
-
let cachedSessionExpiration;
|
|
1886
|
-
function getSessionExpiration() {
|
|
1887
|
-
if (MsftSme.isNullOrUndefined(this.cachedSessionExpiration)) {
|
|
1888
|
-
const timeString = localStorage.getItem(sessionExpirationStorageKey);
|
|
1889
|
-
cachedSessionExpiration = Number(ensureValidSessionExpirationTime(timeString)) * 60 * 1000;
|
|
1890
|
-
}
|
|
1891
|
-
return cachedSessionExpiration;
|
|
1892
|
-
}
|
|
1893
|
-
MsftSme.getSessionExpiration = getSessionExpiration;
|
|
1894
|
-
function getSessionExpirationMinutes() {
|
|
1895
|
-
const timeString = localStorage.getItem(sessionExpirationStorageKey);
|
|
1896
|
-
return ensureValidSessionExpirationTime(timeString);
|
|
1897
|
-
}
|
|
1898
|
-
MsftSme.getSessionExpirationMinutes = getSessionExpirationMinutes;
|
|
1899
|
-
function setSessionExpirationMinutes(timeString) {
|
|
1900
|
-
timeString = ensureValidSessionExpirationTime(timeString);
|
|
1901
|
-
localStorage.setItem(sessionExpirationStorageKey, timeString);
|
|
1902
|
-
this.cachedSessionExpiration = undefined;
|
|
1903
|
-
}
|
|
1904
|
-
MsftSme.setSessionExpirationMinutes = setSessionExpirationMinutes;
|
|
1905
|
-
function ensureValidSessionExpirationTime(timeString) {
|
|
1906
|
-
const time = Math.round(Number(timeString));
|
|
1907
|
-
if (isNaN(time) || time < 0) {
|
|
1908
|
-
return defaultSessionExpirationMinutes;
|
|
1909
|
-
}
|
|
1910
|
-
return time.toString();
|
|
1911
|
-
}
|
|
1912
|
-
// #endregion // Expire Session management
|
|
1913
1879
|
/**
|
|
1914
1880
|
* Constants for experiment flags
|
|
1915
1881
|
*/
|