@microsoft/windows-admin-center-sdk 2.298.1 → 2.301.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular/assets/strings/cs-CZ/strings.json +1 -1
- package/angular/assets/strings/de-DE/strings.json +1 -1
- package/angular/assets/strings/es-ES/strings.json +1 -1
- package/angular/assets/strings/fr-FR/strings.json +1 -1
- package/angular/assets/strings/hu-HU/strings.json +1 -1
- package/angular/assets/strings/it-IT/strings.json +1 -1
- package/angular/assets/strings/ja-JP/strings.json +1 -1
- package/angular/assets/strings/ko-KR/strings.json +1 -1
- package/angular/assets/strings/nl-NL/strings.json +1 -1
- package/angular/assets/strings/pl-PL/strings.json +1 -1
- package/angular/assets/strings/pt-BR/strings.json +1 -1
- package/angular/assets/strings/pt-PT/strings.json +1 -1
- package/angular/assets/strings/ru-RU/strings.json +1 -1
- package/angular/assets/strings/strings.json +1 -1
- package/angular/assets/strings/sv-SE/strings.json +1 -1
- package/angular/assets/strings/tr-TR/strings.json +1 -1
- package/angular/assets/strings/zh-CN/strings.json +1 -1
- package/angular/assets/strings/zh-TW/strings.json +1 -1
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js +239 -568
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js.map +1 -1
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js +2 -2
- package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js.map +1 -1
- package/angular/esm2015/src/controls/actions/containers/action-bar/action-bar.component.js +2 -7
- package/angular/esm2015/src/controls/alert-bar/alert-bar.component.js +5 -5
- package/angular/esm2015/src/controls/common/base.component.js +1 -8
- package/angular/esm2015/src/controls/data-table/data-table.component.js +9 -39
- package/angular/esm2015/src/controls/form/form-field/checklist/checklist-form-field.component.js +8 -11
- package/angular/esm2015/src/controls/form/form-field/combobox/combobox-form-field.component.js +9 -8
- package/angular/esm2015/src/controls/form/form-field/file/file-form-field.component.js +2 -14
- package/angular/esm2015/src/controls/form/form-field/form-field.component.js +2 -9
- package/angular/esm2015/src/controls/layout/layout-definition.component.js +2 -9
- package/angular/esm2015/src/controls/layout/layout.component.js +2 -11
- package/angular/esm2015/src/controls/master-view/master-view.component.js +5 -32
- package/angular/esm2015/src/controls/page-alert-bar/models/index.js +1 -1
- package/angular/esm2015/src/controls/pivot/pivot-tab.component.js +1 -1
- package/angular/esm2015/src/controls/pivot/pivot.component.js +4 -21
- package/angular/esm2015/src/controls/property-grid/property-grid-item.component.js +2 -50
- package/angular/esm2015/src/controls/property-grid/property-grid.component.js +60 -73
- package/angular/esm2015/src/controls/property-grid/property-grid.module.js +1 -5
- package/angular/esm2015/src/controls/settings/common-settings/common-settings.component.js +70 -151
- package/angular/esm2015/src/controls/settings/settings.component.js +8 -48
- package/angular/esm2015/src/controls/settings/settings.module.js +9 -21
- package/angular/esm2015/src/controls/wizard/wizard.component.js +65 -55
- package/angular/esm2015/src/generated/strings.js +1 -1
- package/angular/esm2015/src/service/app-context.service.js +1 -3
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js +239 -545
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js.map +1 -1
- package/angular/package.json +0 -2
- package/angular/src/controls/common/base.component.d.ts +0 -5
- package/angular/src/controls/data-table/data-table.component.d.ts +0 -15
- package/angular/src/controls/form/form-field/checklist/checklist-form-field.component.d.ts +0 -1
- package/angular/src/controls/form/form-field/file/file-form-field.component.d.ts +0 -4
- package/angular/src/controls/layout/layout-definition.component.d.ts +1 -6
- package/angular/src/controls/master-view/master-view.component.d.ts +2 -118
- package/angular/src/controls/page-alert-bar/models/index.d.ts +1 -1
- package/angular/src/controls/pivot/pivot-tab.component.d.ts +1 -0
- package/angular/src/controls/pivot/pivot.component.d.ts +0 -7
- package/angular/src/controls/property-grid/property-grid-item.component.d.ts +3 -53
- package/angular/src/controls/property-grid/property-grid.component.d.ts +2 -1
- package/angular/src/controls/property-grid/property-grid.module.d.ts +3 -4
- package/angular/src/controls/settings/common-settings/common-settings.component.d.ts +1 -32
- package/angular/src/controls/settings/settings.component.d.ts +1 -18
- package/angular/src/controls/settings/settings.module.d.ts +1 -3
- package/angular/src/generated/strings.d.ts +0 -3
- package/core/base/environment.d.ts +0 -10
- package/core/base/environment.js.map +1 -1
- package/core/data/gateway-connection.d.ts +0 -34
- package/core/data/gateway-connection.js +2 -59
- package/core/data/gateway-connection.js.map +1 -1
- package/core/data/node-connection.d.ts +0 -4
- package/core/data/node-connection.js.map +1 -1
- package/core/data/powershell.d.ts +0 -4
- package/core/data/powershell.js +0 -1
- package/core/data/powershell.js.map +1 -1
- package/core/diagnostics/sme-web-telemetry-models.d.ts +3 -20
- package/core/diagnostics/sme-web-telemetry-models.js +2 -6
- package/core/diagnostics/sme-web-telemetry-models.js.map +1 -1
- package/core/diagnostics/sme-web-telemetry.d.ts +1 -13
- package/core/diagnostics/sme-web-telemetry.js +11 -51
- package/core/diagnostics/sme-web-telemetry.js.map +1 -1
- package/core/generated/powershell-scripts.d.ts +0 -4
- package/core/generated/powershell-scripts.js +0 -4
- package/core/generated/powershell-scripts.js.map +1 -1
- package/core/index.d.ts +0 -2
- package/core/index.js +0 -1
- package/core/index.js.map +1 -1
- package/core/manifest/environment-modules.js +0 -10
- package/core/manifest/environment-modules.js.map +1 -1
- package/core/notification/powershell-notification.js +1 -1
- package/core/notification/powershell-notification.js.map +1 -1
- package/core/performance/performance-tracker.d.ts +0 -67
- package/core/performance/performance-tracker.js +4 -211
- package/core/performance/performance-tracker.js.map +1 -1
- package/core/rpc/credssp/rpc-credssp-model.d.ts +2 -27
- package/core/rpc/credssp/rpc-credssp-model.js +0 -10
- package/core/rpc/credssp/rpc-credssp-model.js.map +1 -1
- package/core/security/credssp-manager.d.ts +1 -15
- package/core/security/credssp-manager.js +0 -28
- package/core/security/credssp-manager.js.map +1 -1
- package/core/shared/gateway-inventory/gateway-inventory.d.ts +0 -10
- package/core/shared/gateway-inventory/gateway-inventory.js +0 -11
- package/core/shared/gateway-inventory/gateway-inventory.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 +3 -5
- package/styles/css/main.css +1 -1
- package/tools/module-template/gulpfile.ts/index.ts +1 -1
- package/tools/package-lock.json +975 -14946
- package/tools/wac-cli/src/create/main.d.ts +3 -6
- package/tools/wac-cli/src/create/main.js +35 -87
- package/tools/wac-cli/src/create/main.js.map +1 -1
- package/tools/wac-cli/src/index.js +2 -2
- package/tools/wac-cli/src/index.js.map +1 -1
- package/tools/wac-cli/templates/{solution/manifest.json → manifest/solution-manifest.json} +0 -19
- package/tools/wac-cli/templates/{wac-template/src/manifest.json → manifest/tool-manifest.json} +0 -0
- package/tools/wac-cli/templates/wac-template/angular.json +2 -2
- package/tools/wac-cli/templates/wac-template/gulpfile.ts/config-data.ts +1 -1
- package/tools/wac-cli/templates/wac-template/package.json +8 -0
- package/tools/wac-cli/templates/wac-template/src/app/app-routing.module.ts +1 -1
- package/tools/wac-cli/templates/wac-template/src/main.ts +0 -2
- package/tools/wac-cli/templates/wac-template/src/polyfills.ts +1 -1
- package/tools/wac-cli/templates/wac-template/src/test.ts +2 -2
- package/core/data/gateway-status.d.ts +0 -24
- package/core/data/gateway-status.js +0 -3
- package/core/data/gateway-status.js.map +0 -1
- package/core/data/wdac-operations.d.ts +0 -123
- package/core/data/wdac-operations.js +0 -144
- package/core/data/wdac-operations.js.map +0 -1
- package/tools/wac-cli/templates/internal/npmrc.txt +0 -6
- package/tools/wac-cli/templates/internal/package.json +0 -101
- package/tools/wac-cli/templates/solution/strings.resjson +0 -16
- package/tools/wac-cli/templates/wac-template/src/version.ts +0 -3
- package/tools/wac-cli/templates/wac-template/version.json +0 -5
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { AppContext } from './app-context';
|
|
3
|
-
import { HttpStatusCode } from './http-constants';
|
|
4
|
-
/**
|
|
5
|
-
* Windows Defender Application Control (WDAC) status values based on DeviceGuardConfigCodeIntegrityStatus.
|
|
6
|
-
*/
|
|
7
|
-
export declare enum WdacMode {
|
|
8
|
-
/**
|
|
9
|
-
* WDAC is off.
|
|
10
|
-
*/
|
|
11
|
-
Off = 0,
|
|
12
|
-
/**
|
|
13
|
-
* WDAC is in Audit mode
|
|
14
|
-
*/
|
|
15
|
-
AuditMode = 1,
|
|
16
|
-
/**
|
|
17
|
-
* WDAC is in Enforcement mode.
|
|
18
|
-
*/
|
|
19
|
-
EnforcementMode = 2,
|
|
20
|
-
/**
|
|
21
|
-
* PS session language is ConstrainedLanguage.
|
|
22
|
-
* This is a custom enum value we added (not based off the official DeviceGuardConfigCodeIntegrityStatus).
|
|
23
|
-
* It was introduced to handle any edge-cases where DeviceGuard properties are not set but PS is in Constrained Language mode.
|
|
24
|
-
* If DeviceGuard properties are set in addition to this language mode, the result of Wdac mode should be "EnforcementMode".
|
|
25
|
-
*/
|
|
26
|
-
PowershellConstrainedLanguageMode = 3
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* PowerShell Language modes
|
|
30
|
-
* https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.pslanguagemode
|
|
31
|
-
*/
|
|
32
|
-
export declare enum PSLanguageMode {
|
|
33
|
-
FullLanguage = 0,
|
|
34
|
-
RestrictedLanguage = 1,
|
|
35
|
-
NoLanguage = 2,
|
|
36
|
-
ConstrainedLanguage = 3
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Represents the data returned from the GetWdacMode endpoint - /api/wdac/{targetNodename}/{psLanguageMode}
|
|
40
|
-
*/
|
|
41
|
-
export interface WdacModeResult {
|
|
42
|
-
/**
|
|
43
|
-
* Status of the request/response.
|
|
44
|
-
*/
|
|
45
|
-
name: HttpStatusCode;
|
|
46
|
-
/**
|
|
47
|
-
* WdacMode of the target node.
|
|
48
|
-
*/
|
|
49
|
-
wdacMode: WdacMode;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Represents the data returned from the TransferModules endpoint - /api/wdac/{targetNodename}/transfer/async
|
|
53
|
-
*/
|
|
54
|
-
export interface TransferModulesResult {
|
|
55
|
-
/**
|
|
56
|
-
* (msft.sme.x) name of the transferred module.
|
|
57
|
-
*/
|
|
58
|
-
moduleName: string;
|
|
59
|
-
/**
|
|
60
|
-
* Version of the transferred module.
|
|
61
|
-
*/
|
|
62
|
-
moduleVersion: string;
|
|
63
|
-
/**
|
|
64
|
-
* (Microsoft.SME.X) name of the transferred module.
|
|
65
|
-
*/
|
|
66
|
-
powerShellModuleName: string;
|
|
67
|
-
/**
|
|
68
|
-
* Indicates if the transferred module is localized.
|
|
69
|
-
*/
|
|
70
|
-
isLocalized: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Indicates if all subdirectories & files within the module folder were successfully copied.
|
|
73
|
-
*/
|
|
74
|
-
isFullyCopied: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Error message (if any).
|
|
77
|
-
*/
|
|
78
|
-
errorMessage: string;
|
|
79
|
-
/**
|
|
80
|
-
* Time taken (in seconds) to transfer the module.
|
|
81
|
-
*/
|
|
82
|
-
totalTime: string;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Windows Defender Application Control (WDAC) operations class.
|
|
86
|
-
*/
|
|
87
|
-
export declare class WdacOperations {
|
|
88
|
-
private appContext;
|
|
89
|
-
/**
|
|
90
|
-
* {0} corresponds to the target node name.
|
|
91
|
-
* {1} corresponds to the PSLanguageMode enum value.
|
|
92
|
-
*/
|
|
93
|
-
private static wdacModeUrl;
|
|
94
|
-
/**
|
|
95
|
-
* {0} corresponds to the target node name.
|
|
96
|
-
*/
|
|
97
|
-
private static wdacTransferToTargetUrl;
|
|
98
|
-
/**
|
|
99
|
-
* Initializes a new instance of the WdacOperations class.
|
|
100
|
-
*
|
|
101
|
-
* @param appContext the application context.
|
|
102
|
-
*/
|
|
103
|
-
constructor(appContext: AppContext);
|
|
104
|
-
/**
|
|
105
|
-
* Retrieve the LanguageMode property for PowerShell session(s) / runspace(s).
|
|
106
|
-
*
|
|
107
|
-
* @param targetNodeName the machine name to get the WdacMode for.
|
|
108
|
-
*/
|
|
109
|
-
getPsLanguageMode(targetNodeName: string): Observable<PSLanguageMode>;
|
|
110
|
-
/**
|
|
111
|
-
* Gets the WdacMode of a specified targetNodeName.
|
|
112
|
-
*
|
|
113
|
-
* @param targetNodeName the machine name to get the WdacMode for.
|
|
114
|
-
*/
|
|
115
|
-
getWdacMode(targetNodeName: string): Observable<WdacModeResult>;
|
|
116
|
-
/**
|
|
117
|
-
* Transfer WAC module(s) to the target node specified. (Elevate the desktop gateway if required.)
|
|
118
|
-
*
|
|
119
|
-
* @param targetNodeName the node modules are being transferred to.
|
|
120
|
-
* @param moduleNames the array containing information about the module(s) being transferred.
|
|
121
|
-
*/
|
|
122
|
-
transferModulesToTargetNode(targetNodeName: string, moduleNames?: string[]): Observable<TransferModulesResult>;
|
|
123
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { throwError } from 'rxjs';
|
|
2
|
-
import { catchError, map, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { PowerShellScripts } from '../generated/powershell-scripts';
|
|
4
|
-
import { PowerShell } from './powershell';
|
|
5
|
-
/**
|
|
6
|
-
* Windows Defender Application Control (WDAC) status values based on DeviceGuardConfigCodeIntegrityStatus.
|
|
7
|
-
*/
|
|
8
|
-
export var WdacMode;
|
|
9
|
-
(function (WdacMode) {
|
|
10
|
-
/**
|
|
11
|
-
* WDAC is off.
|
|
12
|
-
*/
|
|
13
|
-
WdacMode[WdacMode["Off"] = 0] = "Off";
|
|
14
|
-
/**
|
|
15
|
-
* WDAC is in Audit mode
|
|
16
|
-
*/
|
|
17
|
-
WdacMode[WdacMode["AuditMode"] = 1] = "AuditMode";
|
|
18
|
-
/**
|
|
19
|
-
* WDAC is in Enforcement mode.
|
|
20
|
-
*/
|
|
21
|
-
WdacMode[WdacMode["EnforcementMode"] = 2] = "EnforcementMode";
|
|
22
|
-
/**
|
|
23
|
-
* PS session language is ConstrainedLanguage.
|
|
24
|
-
* This is a custom enum value we added (not based off the official DeviceGuardConfigCodeIntegrityStatus).
|
|
25
|
-
* It was introduced to handle any edge-cases where DeviceGuard properties are not set but PS is in Constrained Language mode.
|
|
26
|
-
* If DeviceGuard properties are set in addition to this language mode, the result of Wdac mode should be "EnforcementMode".
|
|
27
|
-
*/
|
|
28
|
-
WdacMode[WdacMode["PowershellConstrainedLanguageMode"] = 3] = "PowershellConstrainedLanguageMode";
|
|
29
|
-
})(WdacMode || (WdacMode = {}));
|
|
30
|
-
/**
|
|
31
|
-
* PowerShell Language modes
|
|
32
|
-
* https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.pslanguagemode
|
|
33
|
-
*/
|
|
34
|
-
export var PSLanguageMode;
|
|
35
|
-
(function (PSLanguageMode) {
|
|
36
|
-
PSLanguageMode[PSLanguageMode["FullLanguage"] = 0] = "FullLanguage";
|
|
37
|
-
PSLanguageMode[PSLanguageMode["RestrictedLanguage"] = 1] = "RestrictedLanguage";
|
|
38
|
-
PSLanguageMode[PSLanguageMode["NoLanguage"] = 2] = "NoLanguage";
|
|
39
|
-
PSLanguageMode[PSLanguageMode["ConstrainedLanguage"] = 3] = "ConstrainedLanguage";
|
|
40
|
-
})(PSLanguageMode || (PSLanguageMode = {}));
|
|
41
|
-
/**
|
|
42
|
-
* Windows Defender Application Control (WDAC) operations class.
|
|
43
|
-
*/
|
|
44
|
-
export class WdacOperations {
|
|
45
|
-
/**
|
|
46
|
-
* Initializes a new instance of the WdacOperations class.
|
|
47
|
-
*
|
|
48
|
-
* @param appContext the application context.
|
|
49
|
-
*/
|
|
50
|
-
constructor(appContext) {
|
|
51
|
-
this.appContext = appContext;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Retrieve the LanguageMode property for PowerShell session(s) / runspace(s).
|
|
55
|
-
*
|
|
56
|
-
* @param targetNodeName the machine name to get the WdacMode for.
|
|
57
|
-
*/
|
|
58
|
-
getPsLanguageMode(targetNodeName) {
|
|
59
|
-
const command = PowerShell.createCommand(PowerShellScripts.Get_LanguageMode);
|
|
60
|
-
return this.appContext.powerShell.run(targetNodeName, command, {})
|
|
61
|
-
.pipe(map(response => {
|
|
62
|
-
switch (parseInt(response.results[0], 10)) {
|
|
63
|
-
case 0:
|
|
64
|
-
return PSLanguageMode.FullLanguage;
|
|
65
|
-
case 1:
|
|
66
|
-
return PSLanguageMode.RestrictedLanguage;
|
|
67
|
-
case 2:
|
|
68
|
-
return PSLanguageMode.NoLanguage;
|
|
69
|
-
case 3:
|
|
70
|
-
return PSLanguageMode.ConstrainedLanguage;
|
|
71
|
-
}
|
|
72
|
-
}), catchError(error => {
|
|
73
|
-
return throwError(error);
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Gets the WdacMode of a specified targetNodeName.
|
|
78
|
-
*
|
|
79
|
-
* @param targetNodeName the machine name to get the WdacMode for.
|
|
80
|
-
*/
|
|
81
|
-
getWdacMode(targetNodeName) {
|
|
82
|
-
return this.getPsLanguageMode(targetNodeName)
|
|
83
|
-
.pipe(mergeMap(psLanguageMode => {
|
|
84
|
-
const url = WdacOperations.wdacModeUrl.format(targetNodeName, PSLanguageMode[psLanguageMode]);
|
|
85
|
-
return this.appContext.gateway.get(url)
|
|
86
|
-
.pipe(catchError((error, caught) => {
|
|
87
|
-
// catch elevation error and retry after elevated.
|
|
88
|
-
if (this.appContext.gateway.isElevationRequired(error)) {
|
|
89
|
-
return this.appContext.gateway.pollingGatewayElevated()
|
|
90
|
-
.pipe(switchMap(elevated => elevated ? caught : throwError(error)));
|
|
91
|
-
}
|
|
92
|
-
return throwError(error);
|
|
93
|
-
}), map((response) => {
|
|
94
|
-
if (!response) {
|
|
95
|
-
throw new Error('WdacOperations getWdacMode() call failed with a null response result.');
|
|
96
|
-
}
|
|
97
|
-
return response;
|
|
98
|
-
}));
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Transfer WAC module(s) to the target node specified. (Elevate the desktop gateway if required.)
|
|
103
|
-
*
|
|
104
|
-
* @param targetNodeName the node modules are being transferred to.
|
|
105
|
-
* @param moduleNames the array containing information about the module(s) being transferred.
|
|
106
|
-
*/
|
|
107
|
-
transferModulesToTargetNode(targetNodeName, moduleNames) {
|
|
108
|
-
let url = '';
|
|
109
|
-
if (moduleNames) {
|
|
110
|
-
// Convert array of moduleNames to a string separated by '&' to be used in the API URL.
|
|
111
|
-
// Example API endpoint: wdac/{targetNodeName}/transfer/async/Microsoft.SME.AppsAndFeatures&Microsoft.SME.LocalUsersGroups
|
|
112
|
-
const modulesToTransfer = moduleNames.join('&');
|
|
113
|
-
url = WdacOperations.wdacTransferToTargetUrl.format(targetNodeName, modulesToTransfer);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
url = WdacOperations.wdacTransferToTargetUrl.format(targetNodeName);
|
|
117
|
-
}
|
|
118
|
-
return this.appContext.gateway.put(url)
|
|
119
|
-
.pipe(catchError((error, caught) => {
|
|
120
|
-
// catch elevation error and retry after elevated.
|
|
121
|
-
if (this.appContext.gateway.isElevationRequired(error)) {
|
|
122
|
-
return this.appContext.gateway.pollingGatewayElevated()
|
|
123
|
-
.pipe(switchMap(elevated => elevated ? caught : throwError(error)));
|
|
124
|
-
}
|
|
125
|
-
return throwError(error);
|
|
126
|
-
}), map((response) => {
|
|
127
|
-
if (!response) {
|
|
128
|
-
throw new Error('WdacOperations transferModulesToTargetNode() call failed with a null response result.');
|
|
129
|
-
}
|
|
130
|
-
return response;
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* {0} corresponds to the target node name.
|
|
136
|
-
* {1} corresponds to the PSLanguageMode enum value.
|
|
137
|
-
*/
|
|
138
|
-
WdacOperations.wdacModeUrl = 'wdac/{0}/{1}';
|
|
139
|
-
/**
|
|
140
|
-
* {0} corresponds to the target node name.
|
|
141
|
-
*/
|
|
142
|
-
WdacOperations.wdacTransferToTargetUrl = 'wdac/{0}/transfer/async';
|
|
143
|
-
|
|
144
|
-
//# sourceMappingURL=wdac-operations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/data/wdac-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAN,IAAY,QAoBX;AApBD,WAAY,QAAQ;IAChB;;OAEG;IACH,qCAAO,CAAA;IACP;;OAEG;IACH,iDAAa,CAAA;IACb;;OAEG;IACH,6DAAmB,CAAA;IACnB;;;;;OAKG;IACH,iGAAqC,CAAA;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,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;aAClC,IAAI,CACD,UAAU,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACzB,kDAAkD;YAClD,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE;gBACpD,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,sBAAsB,EAAE;qBAClD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAC3E;YACD,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,EACF,GAAG,CAAC,CAAC,QAA+B,EAAE,EAAE;YACpC,IAAI,CAAC,QAAQ,EAAE;gBACX,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAC;aAC5G;YAED,OAAO,QAAQ,CAAC;QACpB,CAAC,CAAC,CACL,CAAC;IACV,CAAC;;AAhHD;;;GAGG;AACY,0BAAW,GAAG,cAAc,CAAC;AAE5C;;GAEG;AACY,sCAAuB,GAAG,yBAAyB,CAAC","file":"wdac-operations.js","sourcesContent":["import { Observable, throwError } from 'rxjs';\r\nimport { catchError, map, mergeMap, switchMap } from 'rxjs/operators';\r\nimport { PowerShellScripts } from '../generated/powershell-scripts';\r\nimport { AppContext } from './app-context';\r\nimport { HttpStatusCode } from './http-constants';\r\nimport { PowerShell } from './powershell';\r\n\r\n/**\r\n * Windows Defender Application Control (WDAC) status values based on DeviceGuardConfigCodeIntegrityStatus.\r\n */\r\nexport enum WdacMode {\r\n /**\r\n * WDAC is off.\r\n */\r\n Off = 0,\r\n /**\r\n * WDAC is in Audit mode\r\n */\r\n AuditMode = 1,\r\n /**\r\n * WDAC is in Enforcement mode.\r\n */\r\n EnforcementMode = 2,\r\n /**\r\n * PS session language is ConstrainedLanguage.\r\n * This is a custom enum value we added (not based off the official DeviceGuardConfigCodeIntegrityStatus).\r\n * It was introduced to handle any edge-cases where DeviceGuard properties are not set but PS is in Constrained Language mode.\r\n * If DeviceGuard properties are set in addition to this language mode, the result of Wdac mode should be \"EnforcementMode\".\r\n */\r\n PowershellConstrainedLanguageMode = 3\r\n}\r\n\r\n/**\r\n * PowerShell Language modes\r\n * https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.pslanguagemode\r\n */\r\nexport enum PSLanguageMode {\r\n FullLanguage = 0,\r\n RestrictedLanguage = 1,\r\n NoLanguage = 2,\r\n ConstrainedLanguage = 3\r\n}\r\n\r\n/**\r\n * Represents the data returned from the GetWdacMode endpoint - /api/wdac/{targetNodename}/{psLanguageMode}\r\n */\r\nexport interface WdacModeResult {\r\n /**\r\n * Status of the request/response.\r\n */\r\n name: HttpStatusCode;\r\n\r\n /**\r\n * WdacMode of the target node.\r\n */\r\n wdacMode: WdacMode;\r\n}\r\n\r\n/**\r\n * Represents the data returned from the TransferModules endpoint - /api/wdac/{targetNodename}/transfer/async\r\n */\r\nexport interface TransferModulesResult {\r\n /**\r\n * (msft.sme.x) name of the transferred module.\r\n */\r\n moduleName: string;\r\n\r\n /**\r\n * Version of the transferred module.\r\n */\r\n moduleVersion: string;\r\n\r\n /**\r\n * (Microsoft.SME.X) name of the transferred module.\r\n */\r\n powerShellModuleName: string;\r\n\r\n /**\r\n * Indicates if the transferred module is localized.\r\n */\r\n isLocalized: boolean;\r\n\r\n /**\r\n * Indicates if all subdirectories & files within the module folder were successfully copied.\r\n */\r\n isFullyCopied: boolean;\r\n\r\n /**\r\n * Error message (if any).\r\n */\r\n errorMessage: string;\r\n\r\n /**\r\n * Time taken (in seconds) to transfer the module.\r\n */\r\n totalTime: string;\r\n}\r\n\r\n/**\r\n * Windows Defender Application Control (WDAC) operations class.\r\n */\r\nexport class WdacOperations {\r\n /**\r\n * {0} corresponds to the target node name.\r\n * {1} corresponds to the PSLanguageMode enum value.\r\n */\r\n private static wdacModeUrl = 'wdac/{0}/{1}';\r\n\r\n /**\r\n * {0} corresponds to the target node name.\r\n */\r\n private static wdacTransferToTargetUrl = 'wdac/{0}/transfer/async';\r\n\r\n /**\r\n * Initializes a new instance of the WdacOperations class.\r\n *\r\n * @param appContext the application context.\r\n */\r\n constructor(private appContext: AppContext) { }\r\n\r\n /**\r\n * Retrieve the LanguageMode property for PowerShell session(s) / runspace(s).\r\n *\r\n * @param targetNodeName the machine name to get the WdacMode for.\r\n */\r\n public getPsLanguageMode(targetNodeName: string): Observable<PSLanguageMode> {\r\n const command = PowerShell.createCommand(PowerShellScripts.Get_LanguageMode);\r\n return this.appContext.powerShell.run(targetNodeName, command, {})\r\n .pipe(\r\n map(response => {\r\n switch (parseInt(response.results[0], 10)) {\r\n case 0:\r\n return PSLanguageMode.FullLanguage;\r\n case 1:\r\n return PSLanguageMode.RestrictedLanguage;\r\n case 2:\r\n return PSLanguageMode.NoLanguage;\r\n case 3:\r\n return PSLanguageMode.ConstrainedLanguage;\r\n }\r\n }),\r\n catchError(error => {\r\n return throwError(error);\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Gets the WdacMode of a specified targetNodeName.\r\n *\r\n * @param targetNodeName the machine name to get the WdacMode for.\r\n */\r\n public getWdacMode(targetNodeName: string): Observable<WdacModeResult> {\r\n return this.getPsLanguageMode(targetNodeName)\r\n .pipe(\r\n mergeMap(psLanguageMode => {\r\n const url = WdacOperations.wdacModeUrl.format(targetNodeName, PSLanguageMode[psLanguageMode]);\r\n return this.appContext.gateway.get(url)\r\n .pipe(\r\n catchError((error, caught) => {\r\n // catch elevation error and retry after elevated.\r\n if (this.appContext.gateway.isElevationRequired(error)) {\r\n return this.appContext.gateway.pollingGatewayElevated()\r\n .pipe(switchMap(elevated => elevated ? caught : throwError(error)));\r\n }\r\n return throwError(error);\r\n }),\r\n map((response: WdacModeResult) => {\r\n if (!response) {\r\n throw new Error('WdacOperations getWdacMode() call failed with a null response result.');\r\n }\r\n return response;\r\n })\r\n );\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Transfer WAC module(s) to the target node specified. (Elevate the desktop gateway if required.)\r\n *\r\n * @param targetNodeName the node modules are being transferred to.\r\n * @param moduleNames the array containing information about the module(s) being transferred.\r\n */\r\n public transferModulesToTargetNode(targetNodeName: string, moduleNames?: string[]): Observable<TransferModulesResult> {\r\n let url = '';\r\n\r\n if (moduleNames) {\r\n // Convert array of moduleNames to a string separated by '&' to be used in the API URL.\r\n // Example API endpoint: wdac/{targetNodeName}/transfer/async/Microsoft.SME.AppsAndFeatures&Microsoft.SME.LocalUsersGroups\r\n const modulesToTransfer = moduleNames.join('&');\r\n url = WdacOperations.wdacTransferToTargetUrl.format(targetNodeName, modulesToTransfer);\r\n } else {\r\n url = WdacOperations.wdacTransferToTargetUrl.format(targetNodeName);\r\n }\r\n\r\n return this.appContext.gateway.put(url)\r\n .pipe(\r\n catchError((error, caught) => {\r\n // catch elevation error and retry after elevated.\r\n if (this.appContext.gateway.isElevationRequired(error)) {\r\n return this.appContext.gateway.pollingGatewayElevated()\r\n .pipe(switchMap(elevated => elevated ? caught : throwError(error)));\r\n }\r\n return throwError(error);\r\n }),\r\n map((response: TransferModulesResult) => {\r\n if (!response) {\r\n throw new Error('WdacOperations transferModulesToTargetNode() call failed with a null response result.');\r\n }\r\n\r\n return response;\r\n })\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{!company-name}/{!product-name}",
|
|
3
|
-
"license": "MIT",
|
|
4
|
-
"main": "index.js",
|
|
5
|
-
"version": "0.0.0-placeholder",
|
|
6
|
-
"private": true,
|
|
7
|
-
"scripts": {
|
|
8
|
-
"ng": "ng",
|
|
9
|
-
"build": "ng build",
|
|
10
|
-
"start": "ng serve",
|
|
11
|
-
"lint": "ng lint",
|
|
12
|
-
"test": "ng test"
|
|
13
|
-
},
|
|
14
|
-
"peerDependencies": {
|
|
15
|
-
"@msft-sme/core": "2.306.0",
|
|
16
|
-
"@msft-sme/angular": "2.306.0",
|
|
17
|
-
"@msft-sme/styles": "2.306.0",
|
|
18
|
-
"@angular/animations": "11.2.14",
|
|
19
|
-
"@angular/common": "11.2.14",
|
|
20
|
-
"@angular/compiler": "11.2.14",
|
|
21
|
-
"@angular/core": "11.2.14",
|
|
22
|
-
"@angular/forms": "11.2.14",
|
|
23
|
-
"@angular/language-service": "11.2.14",
|
|
24
|
-
"@angular/platform-browser": "11.2.14",
|
|
25
|
-
"@angular/platform-browser-dynamic": "11.2.14",
|
|
26
|
-
"@angular/router": "11.2.14",
|
|
27
|
-
"chart.js": "2.9.4",
|
|
28
|
-
"core-js": "2.6.0",
|
|
29
|
-
"rxjs": "6.6.0",
|
|
30
|
-
"zone.js": "0.11.3"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@msft-sme/core": "2.306.0",
|
|
34
|
-
"@msft-sme/angular": "2.306.0",
|
|
35
|
-
"@msft-sme/styles": "2.306.0",
|
|
36
|
-
"@microsoft/windows-admin-center-sdk/tools": "2.306.0",
|
|
37
|
-
"@msft-sme/ui-test-automation": "2.306.0",
|
|
38
|
-
"@angular-devkit/build-angular": "0.1102.13",
|
|
39
|
-
"@angular-devkit/build-ng-packagr": "0.1002.0",
|
|
40
|
-
"@angular-devkit/build-optimizer": "0.1102.13",
|
|
41
|
-
"@angular/animations": "11.2.14",
|
|
42
|
-
"@angular/cli": "11.2.13",
|
|
43
|
-
"@angular/common": "11.2.14",
|
|
44
|
-
"@angular/compiler": "11.2.14",
|
|
45
|
-
"@angular/compiler-cli": "11.2.14",
|
|
46
|
-
"@angular/core": "11.2.14",
|
|
47
|
-
"@angular/forms": "11.2.14",
|
|
48
|
-
"@angular/language-service": "11.2.14",
|
|
49
|
-
"@angular/platform-browser": "11.2.14",
|
|
50
|
-
"@angular/platform-browser-dynamic": "11.2.14",
|
|
51
|
-
"@angular/router": "11.2.14",
|
|
52
|
-
"@types/chart.js": "2.9.32",
|
|
53
|
-
"@types/gulp": "^4.0.8",
|
|
54
|
-
"@types/jasmine": "~3.6.0",
|
|
55
|
-
"@types/jquery": "3.3.29",
|
|
56
|
-
"@types/karma": "~5.0.0",
|
|
57
|
-
"@types/node": "^12.11.1",
|
|
58
|
-
"@types/signalr": "2.2.36",
|
|
59
|
-
"ajv": "6.4.0",
|
|
60
|
-
"chart.js": "2.9.4",
|
|
61
|
-
"codelyzer": "^6.0.0",
|
|
62
|
-
"core-js": "2.6.0",
|
|
63
|
-
"gulp": "4.0.0",
|
|
64
|
-
"gulp-clean": "0.4.0",
|
|
65
|
-
"gulp-inline-ng2-template": "5.0.1",
|
|
66
|
-
"gulp-jasmine": "4.0.0",
|
|
67
|
-
"gulp-plumber": "1.1.0",
|
|
68
|
-
"gulp-sourcemaps": "2.6.4",
|
|
69
|
-
"gulp-tslint": "8.1.3",
|
|
70
|
-
"gulp-typescript": "5.0.1",
|
|
71
|
-
"jasmine-core": "~3.6.0",
|
|
72
|
-
"jasmine-reporters": "2.4.0",
|
|
73
|
-
"jasmine-spec-reporter": "~5.0.0",
|
|
74
|
-
"jquery": "3.6.0",
|
|
75
|
-
"karma": "~6.1.0",
|
|
76
|
-
"karma-chrome-launcher": "~3.1.0",
|
|
77
|
-
"karma-coverage": "~2.0.3",
|
|
78
|
-
"karma-jasmine": "~4.0.0",
|
|
79
|
-
"karma-jasmine-html-reporter": "^1.5.0",
|
|
80
|
-
"karma-typescript": "5.5.1",
|
|
81
|
-
"ng-packagr": "11.2.4",
|
|
82
|
-
"ng-mocks": "11.10.1",
|
|
83
|
-
"plugin-error": "1.0.1",
|
|
84
|
-
"protractor": "~7.0.0",
|
|
85
|
-
"puppeteer": "^10.0.0",
|
|
86
|
-
"rxjs": "6.6.0",
|
|
87
|
-
"rxjs-tslint": "0.1.8",
|
|
88
|
-
"rxjs-tslint-rules": "4.10.0",
|
|
89
|
-
"selenium-webdriver": "3.6.0",
|
|
90
|
-
"signalr": "2.4.1",
|
|
91
|
-
"ts-helpers": "^1.1.1",
|
|
92
|
-
"ts-node": "~8.3.0",
|
|
93
|
-
"tsickle": "0.37.0",
|
|
94
|
-
"tslint": "~6.1.0",
|
|
95
|
-
"tslint-consistent-codestyle": "1.14.0",
|
|
96
|
-
"tslint-eslint-rules": "5.4.0",
|
|
97
|
-
"tslint-microsoft-contrib": "5.2.1",
|
|
98
|
-
"typescript": "4.1.5",
|
|
99
|
-
"zone.js": "0.11.3"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"//": "manifest section",
|
|
3
|
-
"{!CompanyName}{!ProductName}_Manifest_displayName": "{!product-display-name}",
|
|
4
|
-
"{!CompanyName}{!ProductName}_Manifest_description": "{!product-description}",
|
|
5
|
-
"{!CompanyName}{!ProductName}_Manifest_solutionName": "{!primary-display-name}",
|
|
6
|
-
"{!CompanyName}{!ProductName}_Manifest_solutionDescription": "{!secondary-display-name}",
|
|
7
|
-
"{!CompanyName}{!ProductName}_Manifest_connectionsListHeader": "Connections",
|
|
8
|
-
"{!CompanyName}{!ProductName}_Manifest_keywords": "{!CompanyName}",
|
|
9
|
-
|
|
10
|
-
"//": "{!ProductName}",
|
|
11
|
-
"{!CompanyName}{!ProductName}_title": "{!product-title}",
|
|
12
|
-
|
|
13
|
-
"//": "about",
|
|
14
|
-
"{!CompanyName}{!ProductName}_about": "{!product-about}",
|
|
15
|
-
"{!CompanyName}{!ProductName}_aboutDescription": "{!product-about-description}"
|
|
16
|
-
}
|