@microsoft/windows-admin-center-sdk 4.52.0 → 4.123.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/esm2020/src/controls/actions/containers/action-bar/action-bar.component.mjs +2 -2
- package/angular/esm2020/src/controls/master-view/master-view.component.mjs +8 -6
- package/angular/esm2020/src/controls/ux/sme-ux-footer/sme-ux-footer-template/sme-wizard-lite-footer-template/sme-wizard-lite-footer-template.component.mjs +56 -1
- package/angular/esm2020/src/service/navigation.service.mjs +3 -1
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs +66 -6
- package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
- package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs +65 -6
- package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
- package/angular/src/controls/master-view/master-view.component.d.ts +6 -2
- package/angular/src/controls/ux/sme-ux-footer/sme-ux-footer-template/sme-wizard-lite-footer-template/sme-wizard-lite-footer-template.component.d.ts +64 -0
- package/core/assets/strings/cs-CZ/strings.json +1 -1
- package/core/assets/strings/de-DE/strings.json +1 -1
- package/core/assets/strings/es-ES/strings.json +1 -1
- package/core/assets/strings/fr-FR/strings.json +1 -1
- package/core/assets/strings/hu-HU/strings.json +1 -1
- package/core/assets/strings/id-ID/strings.json +1 -1
- package/core/assets/strings/it-IT/strings.json +1 -1
- package/core/assets/strings/ja-JP/strings.json +1 -1
- package/core/assets/strings/ko-KR/strings.json +1 -1
- package/core/assets/strings/nl-NL/strings.json +1 -1
- package/core/assets/strings/pl-PL/strings.json +1 -1
- package/core/assets/strings/pt-BR/strings.json +1 -1
- package/core/assets/strings/pt-PT/strings.json +1 -1
- package/core/assets/strings/ru-RU/strings.json +1 -1
- package/core/assets/strings/strings.json +1 -1
- package/core/assets/strings/sv-SE/strings.json +1 -1
- package/core/assets/strings/tr-TR/strings.json +1 -1
- package/core/assets/strings/zh-CN/strings.json +1 -1
- package/core/assets/strings/zh-TW/strings.json +1 -1
- package/core/azure/azure-constants.d.ts +7 -3
- package/core/azure/azure-constants.d.ts.map +1 -1
- package/core/azure/azure-constants.js +8 -4
- package/core/azure/azure-constants.js.map +1 -1
- package/core/azure/models/azureArcStatusEnum.d.ts +4 -2
- package/core/azure/models/azureArcStatusEnum.d.ts.map +1 -1
- package/core/azure/models/azureArcStatusEnum.js +3 -1
- package/core/azure/models/azureArcStatusEnum.js.map +1 -1
- package/core/base/utilities.d.ts +3 -3
- package/core/base/utilities.d.ts.map +1 -1
- package/core/base/utilities.js +2 -2
- package/core/base/utilities.js.map +1 -1
- package/core/data/active-directory/active-directory.d.ts.map +1 -1
- package/core/data/active-directory/active-directory.js +1 -1
- package/core/data/active-directory/active-directory.js.map +1 -1
- package/core/data/cookie.d.ts.map +1 -1
- package/core/data/cookie.js +7 -0
- package/core/data/cookie.js.map +1 -1
- package/core/data/gateway-connection.d.ts +12 -0
- package/core/data/gateway-connection.d.ts.map +1 -1
- package/core/data/gateway-connection.js +16 -0
- package/core/data/gateway-connection.js.map +1 -1
- package/core/data/gateway-url-translator.d.ts +1 -0
- package/core/data/gateway-url-translator.d.ts.map +1 -1
- package/core/data/gateway-url-translator.js +15 -0
- package/core/data/gateway-url-translator.js.map +1 -1
- package/core/data/gateway-urls.d.ts +6 -0
- package/core/data/gateway-urls.d.ts.map +1 -1
- package/core/data/gateway-urls.js +8 -0
- package/core/data/gateway-urls.js.map +1 -1
- package/core/data/net.d.ts +1 -0
- package/core/data/net.d.ts.map +1 -1
- package/core/data/net.js +26 -1
- package/core/data/net.js.map +1 -1
- package/core/data/websocket-stream.d.ts.map +1 -1
- package/core/data/websocket-stream.js +2 -2
- package/core/data/websocket-stream.js.map +1 -1
- package/core/generated/powershell-scripts.d.ts.map +1 -1
- package/core/generated/powershell-scripts.js +1 -1
- package/core/generated/powershell-scripts.js.map +1 -1
- package/core/generated/strings.d.ts +3 -0
- package/core/generated/strings.d.ts.map +1 -1
- package/core/generated/strings.js.map +1 -1
- package/core/notification/notification.d.ts.map +1 -1
- package/core/notification/notification.js +1 -3
- package/core/notification/notification.js.map +1 -1
- package/core/resources/scripts/public/inventory/Get-ServerInventory.ps1 +8 -8
- package/core/security/tool-condition-validator.d.ts.map +1 -1
- package/core/security/tool-condition-validator.js +5 -5
- package/core/security/tool-condition-validator.js.map +1 -1
- package/core/shared/server-inventory/server-inventory-cache.d.ts.map +1 -1
- package/core/shared/server-inventory/server-inventory-cache.js +1 -2
- package/core/shared/server-inventory/server-inventory-cache.js.map +1 -1
- package/core/shared/server-inventory/server-inventory.d.ts +4 -4
- package/core/shared/server-inventory/server-inventory.d.ts.map +1 -1
- package/core/shared/server-inventory/server-inventory.js +2 -2
- package/core/shared/server-inventory/server-inventory.js.map +1 -1
- package/microsoft-windows-admin-center-sdk-4.123.0.tgz +0 -0
- package/package.json +4 -4
- package/styles/css/main-v2.css +1 -1
- package/tools/module-template/build/pipelines/ci-build.yml +2 -2
- package/tools/wac-cli/src/angular15/configs/angular-json-config.d.ts +2 -7
- package/tools/wac-cli/src/angular15/configs/angular-json-config.d.ts.map +1 -1
- package/tools/wac-cli/src/angular15/configs/angular-json-config.js +8 -1
- package/tools/wac-cli/src/angular15/configs/angular-json-config.js.map +1 -1
- package/tools/wac-cli/src/angular15/configs/package-json-config.d.ts +4 -0
- package/tools/wac-cli/src/angular15/configs/package-json-config.d.ts.map +1 -1
- package/tools/wac-cli/src/angular15/configs/package-json-config.js +13 -9
- package/tools/wac-cli/src/angular15/configs/package-json-config.js.map +1 -1
- package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.d.ts +14 -0
- package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.d.ts.map +1 -0
- package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.js +21 -0
- package/tools/wac-cli/src/angular15/configs/ui-test-automation-lagacy-config.js.map +1 -0
- package/tools/wac-cli/src/angular15/main.d.ts +33 -3
- package/tools/wac-cli/src/angular15/main.d.ts.map +1 -1
- package/tools/wac-cli/src/angular15/main.js +69 -7
- package/tools/wac-cli/src/angular15/main.js.map +1 -1
- package/tools/wac-cli/src/angular15/test/ui-test-automation-package.json/after.json +14 -0
- package/tools/wac-cli/src/angular15/test/ui-test-automation-package.json/before.json +13 -0
- package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.d.ts +15 -0
- package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.d.ts.map +1 -0
- package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.js +48 -0
- package/tools/wac-cli/src/angular15/upgrader/ui-test-automation-legacy-upgrader.js.map +1 -0
- package/tools/wac-cli/src/angular15/utils/main-debugger.d.ts.map +1 -1
- package/tools/wac-cli/src/angular15/utils/main-debugger.js +3 -0
- package/tools/wac-cli/src/angular15/utils/main-debugger.js.map +1 -1
- package/tools/wac-cli/src/angular15/utils/update-shell-references.d.ts +2 -0
- package/tools/wac-cli/src/angular15/utils/update-shell-references.d.ts.map +1 -0
- package/tools/wac-cli/src/angular15/utils/update-shell-references.js +69 -0
- package/tools/wac-cli/src/angular15/utils/update-shell-references.js.map +1 -0
- package/tools/wac-cli/src/common.d.ts +6 -0
- package/tools/wac-cli/src/common.d.ts.map +1 -1
- package/tools/wac-cli/src/common.js +13 -0
- package/tools/wac-cli/src/common.js.map +1 -1
- package/tools/wac-cli/src/create/main.d.ts.map +1 -1
- package/tools/wac-cli/src/create/main.js +3 -51
- package/tools/wac-cli/src/create/main.js.map +1 -1
- package/tools/wac-cli/src/eslint/main.d.ts +5 -1
- package/tools/wac-cli/src/eslint/main.d.ts.map +1 -1
- package/tools/wac-cli/src/eslint/main.js +17 -2
- package/tools/wac-cli/src/eslint/main.js.map +1 -1
- package/tools/wac-cli/src/index.d.ts.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/wac-template/package.json +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/security/tool-condition-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAc,EAAE,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,UAAU,EAAqB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EACH,iBAAiB,EAMjB,0BAA0B,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAsDnF;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IA6MX;IA5MpB;;;OAGG;IACK,MAAM,CAAC,yBAAyB,GAAkD;QACtF,SAAS;QACT;YACI,aAAa,EAAE,sBAAsB;YACrC,QAAQ,EAAE,sBAAsB;SACnC;QAED,SAAS;QACT;YACI,aAAa,EAAE,eAAe;YAC9B,QAAQ,EAAE,eAAe;SAC5B;QAED,SAAS;QACT;YACI,aAAa,EAAE,oBAAoB;YACnC,QAAQ,EAAE,oBAAoB;SACjC;QAED,iBAAiB;QACjB;YACI,aAAa,EAAE,wBAAwB;YACvC,QAAQ,EAAE,wBAAwB;SACrC;QAED,SAAS;QACT;YACI,aAAa,EAAE,oBAAoB;YACnC,QAAQ,EAAE,aAAa;SAC1B;QAED,SAAS;QACT;YACI,aAAa,EAAE,aAAa;YAC5B,QAAQ,EAAE,aAAa;SAC1B;QAED,UAAU;QACV;YACI,aAAa,EAAE,uBAAuB;YACtC,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gBACpC,OAAO,MAAM,GAAG,CAAC,CAAC;YACtB,KAAK,sBAAsB,CAAC,SAAS,CAAC,EAAE;gBACpC,OAAO,MAAM,IAAI,CAAC,CAAC;YACvB,KAAK,sBAAsB,CAAC,SAAS,CAAC,EAAE;gBACpC,OAAO,MAAM,KAAK,CAAC,CAAC;YACxB,KAAK,sBAAsB,CAAC,SAAS,CAAC,EAAE;gBACpC,OAAO,MAAM,KAAK,CAAC,CAAC;YACxB;gBACI,MAAM,IAAI,KAAK,CACX,IAAI,CAAC,YAAY,CAAC,iCAAiC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;SAC/F;IACL,CAAC;IAEO,eAAe,CAAC,IAAS;QAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACtC,CAAC","file":"tool-condition-validator.js","sourcesContent":["import { EMPTY, Observable, of } from 'rxjs';\r\nimport { catchError, expand, filter, map, take } from 'rxjs/operators';\r\nimport { AppContext } from '../data/app-context';\r\nimport { Net } from '../data/net';\r\nimport { PowerShell, PowerShellCommand } from '../data/powershell';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\nimport {\r\n EnvironmentModule,\r\n EnvironmentModuleConditionMap,\r\n EnvironmentModuleConditionStatement,\r\n EnvironmentModuleEntryPoint,\r\n EnvironmentModuleEntryPointWithToolConditionResult,\r\n EnvironmentModuleToolConditionResult,\r\n EnvironmentModuleToolState\r\n} from '../manifest/environment-modules';\r\nimport { Connection } from '../security/connection';\r\nimport { GatewayMode } from '../shared/gateway-inventory/gateway-inventory';\r\nimport { InventoryQueryCaches } from '../shared/inventory-query-caches';\r\nimport { ServerInventory } from '../shared/server-inventory/server-inventory';\r\nimport { ToolInventoryCache } from '../shared/tool-inventory/tool-inventory-cache';\r\n\r\n/**\r\n * The interface object to be used by expand calculation.\r\n */\r\ninterface ToolConditionExpandResult extends EnvironmentModuleToolConditionResult {\r\n ends: boolean;\r\n}\r\n\r\n/**\r\n * The calculation weight ratio base on performance.\r\n */\r\nexport const enum ToolConditionWeight {\r\n /**\r\n * Not using any observable calculation.\r\n */\r\n NonObservable,\r\n\r\n /**\r\n * Using the connection property.\r\n */\r\n Property,\r\n\r\n /**\r\n * Using the gateway inventory data.\r\n */\r\n Gateway,\r\n\r\n /**\r\n * Using the server inventory data.\r\n */\r\n Server,\r\n\r\n /**\r\n * Using a custom PowerShell script.\r\n */\r\n Script\r\n}\r\n\r\n/**\r\n * The condition result with weight information.\r\n */\r\nexport interface ToolConditionResultWithWeight {\r\n /**\r\n * The calculation weight.\r\n */\r\n weight: ToolConditionWeight;\r\n\r\n /**\r\n * The result data.\r\n */\r\n result: Observable<EnvironmentModuleEntryPointWithToolConditionResult> | EnvironmentModuleEntryPointWithToolConditionResult;\r\n}\r\n\r\n/**\r\n * The class handles conditions of tools to be presented on tools' menu.\r\n * @dynamic\r\n */\r\nexport class ToolConditionValidator {\r\n /**\r\n * Support the following condition name.\r\n * It can be a string, number, boolean and version string.\r\n */\r\n private static serverInventoryProperties: { conditionName: string, dataName: string }[] = [\r\n // string\r\n {\r\n conditionName: 'computerManufacturer',\r\n dataName: 'computerManufacturer'\r\n },\r\n\r\n // string\r\n {\r\n conditionName: 'computerModel',\r\n dataName: 'computerModel'\r\n },\r\n\r\n // number\r\n {\r\n conditionName: 'operatingSystemSKU',\r\n dataName: 'operatingSystemSKU'\r\n },\r\n\r\n // version string\r\n {\r\n conditionName: 'operatingSystemVersion',\r\n dataName: 'operatingSystemVersion'\r\n },\r\n\r\n // number\r\n {\r\n conditionName: 'windowsProductType',\r\n dataName: 'productType'\r\n },\r\n\r\n // string\r\n {\r\n conditionName: 'clusterFqdn',\r\n dataName: 'clusterFqdn'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isHyperVRoleInstalled',\r\n dataName: 'isHyperVRoleInstalled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isHyperVPowershellInstalled',\r\n dataName: 'isHyperVPowershellInstalled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isManagementToolsAvailable',\r\n dataName: 'isManagementToolsAvailable'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isWmfInstalled',\r\n dataName: 'isWmfInstalled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isRemoteAppEnabled',\r\n dataName: 'isRemoteAppEnabled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isDomainController',\r\n dataName: 'isDomainController'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isS2dEnabled',\r\n dataName: 'isS2dEnabled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isBritannicaEnabled',\r\n dataName: 'isBritannicaEnabled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isSystemLockdownPolicyEnforced',\r\n dataName: 'isSystemLockdownPolicyEnforced'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isHciServer',\r\n dataName: 'isHciServer'\r\n }\r\n ];\r\n\r\n /**\r\n * The following operators are supported.\r\n * String comparison uses caseinsesitive pattern.\r\n */\r\n private static operators = {\r\n /**\r\n * Greater than: number, string (caseinsesitive), version\r\n */\r\n gt: 'gt',\r\n\r\n /**\r\n * Greater or equal: number, string (caseinsesitive), version\r\n */\r\n ge: 'ge',\r\n\r\n /**\r\n * Less than: number, string (caseinsesitive), version\r\n */\r\n lt: 'lt',\r\n\r\n /**\r\n * Less or equal: number, string (caseinsesitive), version\r\n */\r\n le: 'le',\r\n\r\n /**\r\n * Equal: number, string (caseinsesitive), version (Accept '*' like \"1.2.*\")\r\n */\r\n eq: 'eq',\r\n\r\n /**\r\n * Not equal: number, string (caseinsesitive), version (Accept '*' like \"1.2.*\")\r\n */\r\n ne: 'ne',\r\n\r\n /**\r\n * Test true: number, string, boolean\r\n */\r\n is: 'is',\r\n\r\n /**\r\n * Test false: number, string, boolean\r\n */\r\n not: 'not',\r\n\r\n /**\r\n * Contains a string: string (caseinsesitive)\r\n */\r\n contains: 'contains',\r\n\r\n /**\r\n * Not contains a string: string (caseinsesitive)\r\n */\r\n notContains: 'notContains',\r\n\r\n /**\r\n * Any one of value (number or string) equal: numberArray, stringArray\r\n */\r\n anyEq: 'anyEq',\r\n\r\n /**\r\n * Any one of value (number or string) not equal: numberArray, stringArray\r\n */\r\n anyNe: 'anyNe',\r\n\r\n /**\r\n * Any one of string contains: stringArray\r\n */\r\n anyContains: 'anyContains',\r\n\r\n /**\r\n * Any one of string not contains: stringArray\r\n */\r\n anyNotContains: 'anyNotContains'\r\n };\r\n\r\n private static internalCurrent: ToolConditionValidator;\r\n\r\n private caches: InventoryQueryCaches;\r\n private toolInventoryCache: ToolInventoryCache;\r\n private errorStrings = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error;\r\n\r\n /**\r\n * Gets the current object of the ToolConditionValidator class, and maintains as singleton.\r\n *\r\n * @param appContext the application context.\r\n * @param caches the instance of the inventory query caches to share the resource.\r\n */\r\n public static current(appContext: AppContext, caches: InventoryQueryCaches): ToolConditionValidator {\r\n if (!ToolConditionValidator.internalCurrent) {\r\n ToolConditionValidator.internalCurrent = new ToolConditionValidator(appContext, caches);\r\n }\r\n\r\n return ToolConditionValidator.internalCurrent;\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the ToolConditionValidator class.\r\n *\r\n * @param appContext the application context.\r\n * @param caches the instance of the inventory query caches to share the resource.\r\n */\r\n constructor(private appContext: AppContext, caches: InventoryQueryCaches) {\r\n const statusExpiration = 4 * 60 * 1000; // 4 min\r\n this.caches = caches;\r\n this.toolInventoryCache = new ToolInventoryCache(appContext, { expiration: statusExpiration });\r\n }\r\n\r\n /**\r\n * Scan the tool condition to be present or not.\r\n *\r\n * @param connection the connection object.\r\n * @param solution The entry point object of solution.\r\n * @param tool The entry point object of tool.\r\n * @param scanMode The mode of scanning.\r\n * @return the result observable.\r\n */\r\n public scanToolCondition(\r\n connection: Connection,\r\n solution: EnvironmentModuleEntryPoint,\r\n tool: EnvironmentModuleEntryPoint): ToolConditionResultWithWeight {\r\n\r\n if (!tool.requirements) {\r\n // tool is missing requirements, never show.\r\n return {\r\n weight: ToolConditionWeight.NonObservable,\r\n result: {\r\n ...tool,\r\n ...<EnvironmentModuleToolConditionResult>{\r\n show: false,\r\n detail: EnvironmentModuleToolState.NotSupported\r\n }\r\n }\r\n };\r\n }\r\n\r\n const solutionId = EnvironmentModule.createFormattedEntrypoint(solution);\r\n const toolId = EnvironmentModule.createFormattedEntrypoint(tool);\r\n const checkersCollection = [];\r\n let weight = ToolConditionWeight.NonObservable;\r\n for (const requirement of tool.requirements) {\r\n const checkers: Observable<EnvironmentModuleToolConditionResult>[] = [];\r\n\r\n // tool must specify the solutions it can show in\r\n if (!requirement.solutionIds || requirement.solutionIds.every(id => id !== solutionId)) {\r\n continue;\r\n }\r\n\r\n // if ths solution is a connections type, then the tool must specify the connection type\r\n if (solution.rootNavigationBehavior === 'connections'\r\n && (!requirement.connectionTypes || requirement.connectionTypes.every(type => type !== connection.type))) {\r\n continue;\r\n }\r\n\r\n // if there are no conditions to check, then this tool has been satisfied.\r\n if (!requirement.conditions || requirement.conditions.length === 0) {\r\n checkers.push(this.installationTypeValidate(connection));\r\n weight = Math.max(weight, ToolConditionWeight.Gateway);\r\n } else {\r\n for (const condition of requirement.conditions) {\r\n\r\n checkers.push(this.installationTypeValidate(connection, condition.installationTypes));\r\n weight = Math.max(weight, ToolConditionWeight.Gateway);\r\n\r\n if (condition.localhost !== undefined && !condition.localhost) {\r\n // if connection is localhost and not supported.\r\n checkers.push(this.localhostValidate(connection));\r\n weight = Math.max(weight, ToolConditionWeight.Gateway);\r\n }\r\n\r\n if (condition.inventory) {\r\n checkers.push(this.inventoryValidate(connection, condition.inventory));\r\n weight = Math.max(weight, ToolConditionWeight.Server);\r\n }\r\n\r\n if (condition.properties) {\r\n checkers.push(this.propertyValidate(connection, condition.properties));\r\n weight = Math.max(weight, ToolConditionWeight.Property);\r\n }\r\n\r\n if (condition.powerShell) {\r\n // powerShell { command, script }\r\n checkers.push(this.toolInventoryValidate(connection, toolId, condition.powerShell));\r\n weight = Math.max(weight, ToolConditionWeight.Script);\r\n } else if (condition.script) {\r\n // deprecated\r\n checkers.push(this.toolInventoryValidate(connection, toolId, condition.script));\r\n weight = Math.max(weight, ToolConditionWeight.Script);\r\n }\r\n }\r\n }\r\n\r\n checkersCollection.push(checkers);\r\n }\r\n\r\n if (checkersCollection.length === 0) {\r\n return {\r\n weight: ToolConditionWeight.NonObservable,\r\n result: {\r\n ...tool,\r\n ...<EnvironmentModuleToolConditionResult>{\r\n show: false,\r\n detail: EnvironmentModuleToolState.NotSupported,\r\n connectionId: connection ? connection.id : null\r\n }\r\n }\r\n };\r\n }\r\n\r\n let collectionIndex = 0;\r\n let checkerIndex = 0;\r\n let lastDetail: EnvironmentModuleToolState = null;\r\n let lastMessage: string = null;\r\n return {\r\n weight: weight,\r\n result: this.runChecker(checkersCollection[collectionIndex][checkerIndex])\r\n .pipe(catchError(() => {\r\n Logging.log({\r\n level: LogLevel.Error,\r\n message: this.errorStrings.ToolValidationResult.message.format(\r\n tool.parentModule.name,\r\n tool.displayName),\r\n source: 'ToolConditionValidator'\r\n });\r\n return of(<ToolConditionExpandResult>{\r\n show: false,\r\n ends: true\r\n });\r\n }),\r\n expand((value) => {\r\n checkerIndex++;\r\n if (value.ends) {\r\n return EMPTY;\r\n }\r\n\r\n if (value.detail !== undefined && lastDetail == null) {\r\n lastDetail = value.detail;\r\n }\r\n\r\n if (value.message !== undefined && lastMessage == null) {\r\n lastMessage = value.message;\r\n }\r\n\r\n if (!value.show) {\r\n // failed result. increment collection index and reset checkerIndex.\r\n if (checkersCollection.length > ++collectionIndex) {\r\n // still has another condition, try next checker set.\r\n return this.runChecker(checkersCollection[collectionIndex][checkerIndex = 0]);\r\n } else {\r\n // no more condition, end to return 'false'.\r\n return of(<ToolConditionExpandResult>{\r\n show: false,\r\n detail: lastDetail,\r\n message: lastMessage,\r\n ends: true\r\n });\r\n }\r\n }\r\n\r\n if (checkersCollection[collectionIndex].length > checkerIndex) {\r\n // check next checker.\r\n return this.runChecker(checkersCollection[collectionIndex][checkerIndex]);\r\n } else {\r\n // all state/succeeded within the checker set.\r\n return of({\r\n show: true,\r\n detail: lastDetail,\r\n message: lastMessage,\r\n ends: true\r\n });\r\n }\r\n }),\r\n filter(combined => combined.ends),\r\n map(combined => {\r\n return {\r\n ...tool,\r\n ...<EnvironmentModuleToolConditionResult>{\r\n show: combined.show,\r\n detail: combined.detail,\r\n message: combined.message,\r\n connectionId: connection ? connection.id : null\r\n }\r\n };\r\n }))\r\n };\r\n }\r\n\r\n private runChecker(checker: Observable<EnvironmentModuleToolConditionResult>): Observable<ToolConditionExpandResult> {\r\n return checker.pipe(\r\n take(1),\r\n map(result => <ToolConditionExpandResult>{ ...result, ends: false }));\r\n }\r\n\r\n private localhostValidate(\r\n connection: Connection): Observable<EnvironmentModuleToolConditionResult> {\r\n return this.caches.gatewayCache.createObservable({})\r\n .pipe(\r\n map(instance => <EnvironmentModuleToolConditionResult>{\r\n show: !(instance.mode !== GatewayMode.Service\r\n && connection.properties\r\n && connection.properties.displayName === 'localhost')\r\n }));\r\n }\r\n\r\n private installationTypeValidate(\r\n connection: Connection, installationType?: String[]): Observable<EnvironmentModuleToolConditionResult> {\r\n if (MsftSme.getValue<boolean>(MsftSme.self().Environment.configuration, 'gateway.disabled')) {\r\n return of({ show: true });\r\n }\r\n\r\n if (!installationType || !Array.isArray(installationType) || installationType.length === 0) {\r\n // Default to standard if property doesnt exist in the manifest.\r\n installationType = ['Standard'];\r\n }\r\n\r\n return this.caches.gatewayCache.createObservable({ params: {} })\r\n .pipe(\r\n catchError((error) => {\r\n const errorStrings = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error;\r\n const notification = this.appContext.notification.create(connection.name);\r\n notification.showError(\r\n errorStrings.ToolValidationGatewayInventoryError.title,\r\n errorStrings.ToolValidationGatewayInventoryError.message.format(Net.getErrorMessage(error)));\r\n return of(null);\r\n }),\r\n map(instance => <EnvironmentModuleToolConditionResult>{\r\n show: installationType.some(t => instance.installationType === t)\r\n }));\r\n }\r\n\r\n private inventoryValidate(\r\n connection: Connection, condition: EnvironmentModuleConditionMap): Observable<EnvironmentModuleToolConditionResult> {\r\n const nodeName = connection.activeAlias ? connection.activeAlias : connection.name;\r\n return this.caches.serverCache.createObservable({ params: { name: nodeName } })\r\n .pipe(\r\n catchError((error) => {\r\n const errorStrings = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error;\r\n const notification = this.appContext.notification.create(connection.name);\r\n notification.showError(\r\n errorStrings.ToolValidationInventoryError.title,\r\n errorStrings.ToolValidationInventoryError.message.format(Net.getErrorMessage(error)));\r\n return of(null);\r\n }),\r\n filter((instance: ServerInventory) => instance.serverName === nodeName),\r\n map(instance => <EnvironmentModuleToolConditionResult>{\r\n show: this.checkServerInventoryCondition(condition, instance)\r\n }));\r\n }\r\n\r\n private propertyValidate(\r\n connection: Connection, condition: EnvironmentModuleConditionMap): Observable<EnvironmentModuleToolConditionResult> {\r\n const propertyNames = Object.keys(condition);\r\n let result = true;\r\n for (const propertyName of propertyNames) {\r\n const propertyValue = connection.properties && connection.properties[propertyName];\r\n const conditionItem = condition[propertyName];\r\n if (conditionItem && !this.checkCondition(propertyValue, conditionItem)) {\r\n result = false;\r\n break;\r\n }\r\n }\r\n\r\n return of(<EnvironmentModuleToolConditionResult>{ show: result });\r\n }\r\n\r\n private toolInventoryValidate(\r\n connection: Connection,\r\n id: string,\r\n scriptOrCommand: string | PowerShellCommand): Observable<EnvironmentModuleToolConditionResult> {\r\n const command = PowerShell.getPowerShellCommand(scriptOrCommand);\r\n return this.toolInventoryCache.query(\r\n { ...{ name: connection.activeAlias ? connection.activeAlias : connection.name, id: id }, ...command })\r\n .pipe(\r\n map(inventory => <EnvironmentModuleToolConditionResult>{\r\n show: inventory.instance.state === EnvironmentModuleToolState.Available\r\n || inventory.instance.state === EnvironmentModuleToolState.NotConfigured,\r\n detail: inventory.instance.state,\r\n message: inventory.instance.message\r\n }),\r\n catchError((error) => {\r\n const message = Net.getErrorMessage(error);\r\n Logging.logError('ToolConditionValidator', `${id}: ${message}`);\r\n return of(<EnvironmentModuleToolConditionResult>{\r\n show: false,\r\n detail: EnvironmentModuleToolState.NotSupported,\r\n message\r\n });\r\n })\r\n );\r\n }\r\n\r\n private checkServerInventoryCondition(condition: EnvironmentModuleConditionMap, instance: ServerInventory): boolean {\r\n for (const property of ToolConditionValidator.serverInventoryProperties) {\r\n const conditionItem = condition[property.conditionName];\r\n if (conditionItem && !this.checkCondition(instance[property.dataName], conditionItem)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private checkCondition(data: any, condition: EnvironmentModuleConditionStatement): boolean {\r\n switch (condition.type) {\r\n case 'number':\r\n const numberValue: number = this.getNumberOrZero(data);\r\n const numberTest: number = this.getNumberOrZero(condition.value);\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.gt:\r\n return numberValue > numberTest;\r\n case ToolConditionValidator.operators.ge:\r\n return numberValue >= numberTest;\r\n case ToolConditionValidator.operators.lt:\r\n return numberValue < numberTest;\r\n case ToolConditionValidator.operators.le:\r\n return numberValue <= numberTest;\r\n case ToolConditionValidator.operators.eq:\r\n return numberValue === numberTest;\r\n case ToolConditionValidator.operators.ne:\r\n return numberValue !== numberTest;\r\n case ToolConditionValidator.operators.is:\r\n return !!numberValue;\r\n case ToolConditionValidator.operators.not:\r\n return !numberValue;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n case 'string':\r\n const stringValue: string = '' + data;\r\n const stringTest: string = '' + condition.value;\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.gt:\r\n return stringValue.toLowerCase() > stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.ge:\r\n return stringValue.toLowerCase() >= stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.lt:\r\n return stringValue.toLowerCase() < stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.le:\r\n return stringValue.toLowerCase() <= stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.eq:\r\n return stringValue.toLowerCase() === stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.ne:\r\n return stringValue.toLowerCase() !== stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.is:\r\n return !!data;\r\n case ToolConditionValidator.operators.not:\r\n return !data;\r\n case ToolConditionValidator.operators.contains:\r\n return stringValue.toLowerCase().indexOf(stringTest.toLowerCase()) >= 0;\r\n case ToolConditionValidator.operators.notContains:\r\n return stringValue.toLowerCase().indexOf(stringTest.toLowerCase()) < 0;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n case 'boolean':\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.is:\r\n return !!data;\r\n case ToolConditionValidator.operators.not:\r\n return !data;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n case 'version':\r\n const versionValue: string = data;\r\n const versionTest: string = <string>condition.value;\r\n return this.compareVersion(versionValue, versionTest, condition.operator);\r\n\r\n case 'numberArray':\r\n const checkNumber: any = condition.value;\r\n if (!checkNumber\r\n || typeof checkNumber === 'string'\r\n || !checkNumber.length\r\n || typeof checkNumber[0] !== 'number') {\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedDataType.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n const numberArrayValue: number = this.getNumberOrZero(data);\r\n const numberArray: number[] = <number[]>condition.value;\r\n for (const numberItem of numberArray) {\r\n const numberArrayTest = this.getNumberOrZero(numberItem);\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.anyEq:\r\n if (numberArrayValue === numberArrayTest) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyNe:\r\n if (numberArrayValue !== numberArrayTest) {\r\n return true;\r\n }\r\n\r\n break;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n }\r\n\r\n return false;\r\n\r\n case 'stringArray':\r\n const checkString: any = condition.value;\r\n if (!checkString\r\n || typeof checkString === 'string'\r\n || !checkString.length\r\n || typeof checkString[0] !== 'string') {\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedDataType.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n const stringArrayValue: string = '' + data;\r\n const stringArray: string[] = <string[]>condition.value;\r\n for (const stringArrayTest of stringArray) {\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.anyEq:\r\n if (stringArrayValue.toLowerCase() === stringArrayTest.toLowerCase()) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyNe:\r\n if (stringArrayValue.toLowerCase() !== stringArrayTest.toLowerCase()) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyContains:\r\n if (stringArrayValue.toLowerCase().indexOf(stringArrayTest.toLowerCase()) >= 0) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyNotContains:\r\n if (stringArrayValue.toLowerCase().indexOf(stringArrayTest.toLowerCase()) < 0) {\r\n return true;\r\n }\r\n\r\n break;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n }\r\n\r\n return false;\r\n\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedDataType.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n }\r\n\r\n private compareVersion(left: string, right: string, operator: string): boolean {\r\n const leftSegments = left.split('.');\r\n const rightSegments = right.split('.');\r\n if (!leftSegments || leftSegments.length <= 0 || !rightSegments || rightSegments.length <= 0) {\r\n throw new Error(this.errorStrings.ToolValidationVersionFormat.message);\r\n }\r\n\r\n const count = Math.max(leftSegments.length, rightSegments.length);\r\n let status;\r\n for (let index = 0; index < count; index++) {\r\n if (rightSegments[index] === '*') {\r\n // quit comparison with wildcard.\r\n status = 0;\r\n break;\r\n }\r\n\r\n const leftSegment = this.getNumberOrZero(leftSegments[index]);\r\n const rightSegment = this.getNumberOrZero(rightSegments[index]);\r\n if (leftSegment === rightSegment) {\r\n // equal.\r\n status = 0;\r\n } else if (leftSegment > rightSegment) {\r\n // greater.\r\n status = 1;\r\n break;\r\n } else {\r\n // lesser.\r\n status = -1;\r\n break;\r\n }\r\n }\r\n\r\n switch (operator) {\r\n case ToolConditionValidator.operators.gt:\r\n return status > 0;\r\n case ToolConditionValidator.operators.ge:\r\n return status >= 0;\r\n case ToolConditionValidator.operators.lt:\r\n return status < 0;\r\n case ToolConditionValidator.operators.le:\r\n return status <= 0;\r\n case ToolConditionValidator.operators.eq:\r\n return status === 0;\r\n case ToolConditionValidator.operators.ne:\r\n return status !== 0;\r\n default:\r\n throw new Error(\r\n this.errorStrings.ToolValidationUnsupportedOperator.message.format(operator, left));\r\n }\r\n }\r\n\r\n private getNumberOrZero(data: any): number {\r\n const result = Number(data);\r\n return isNaN(result) ? 0 : result;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/security/tool-condition-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAc,EAAE,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,I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,CAAC,EAAE;gBACpC,OAAO,MAAM,KAAK,CAAC,CAAC;YACxB;gBACI,MAAM,IAAI,KAAK,CACX,IAAI,CAAC,YAAY,CAAC,iCAAiC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;SAC/F;IACL,CAAC;IAEO,eAAe,CAAC,IAAS;QAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACtC,CAAC","file":"tool-condition-validator.js","sourcesContent":["import { EMPTY, Observable, of } from 'rxjs';\r\nimport { catchError, expand, filter, map, take } from 'rxjs/operators';\r\nimport { AppContext } from '../data/app-context';\r\nimport { Net } from '../data/net';\r\nimport { PowerShell, PowerShellCommand } from '../data/powershell';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\nimport {\r\n EnvironmentModule,\r\n EnvironmentModuleConditionMap,\r\n EnvironmentModuleConditionStatement,\r\n EnvironmentModuleEntryPoint,\r\n EnvironmentModuleEntryPointWithToolConditionResult,\r\n EnvironmentModuleToolConditionResult,\r\n EnvironmentModuleToolState\r\n} from '../manifest/environment-modules';\r\nimport { Connection } from '../security/connection';\r\nimport { GatewayMode } from '../shared/gateway-inventory/gateway-inventory';\r\nimport { InventoryQueryCaches } from '../shared/inventory-query-caches';\r\nimport { ServerInventory } from '../shared/server-inventory/server-inventory';\r\nimport { ToolInventoryCache } from '../shared/tool-inventory/tool-inventory-cache';\r\n\r\n/**\r\n * The interface object to be used by expand calculation.\r\n */\r\ninterface ToolConditionExpandResult extends EnvironmentModuleToolConditionResult {\r\n ends: boolean;\r\n}\r\n\r\n/**\r\n * The calculation weight ratio base on performance.\r\n */\r\nexport const enum ToolConditionWeight {\r\n /**\r\n * Not using any observable calculation.\r\n */\r\n NonObservable,\r\n\r\n /**\r\n * Using the connection property.\r\n */\r\n Property,\r\n\r\n /**\r\n * Using the gateway inventory data.\r\n */\r\n Gateway,\r\n\r\n /**\r\n * Using the server inventory data.\r\n */\r\n Server,\r\n\r\n /**\r\n * Using a custom PowerShell script.\r\n */\r\n Script\r\n}\r\n\r\n/**\r\n * The condition result with weight information.\r\n */\r\nexport interface ToolConditionResultWithWeight {\r\n /**\r\n * The calculation weight.\r\n */\r\n weight: ToolConditionWeight;\r\n\r\n /**\r\n * The result data.\r\n */\r\n result: Observable<EnvironmentModuleEntryPointWithToolConditionResult> | EnvironmentModuleEntryPointWithToolConditionResult;\r\n}\r\n\r\n/**\r\n * The class handles conditions of tools to be presented on tools' menu.\r\n * @dynamic\r\n */\r\nexport class ToolConditionValidator {\r\n /**\r\n * Support the following condition name.\r\n * It can be a string, number, boolean and version string.\r\n */\r\n private static serverInventoryProperties: { conditionName: string, dataName: string }[] = [\r\n // string\r\n {\r\n conditionName: 'computerManufacturer',\r\n dataName: 'computerManufacturer'\r\n },\r\n\r\n // string\r\n {\r\n conditionName: 'computerModel',\r\n dataName: 'computerModel'\r\n },\r\n\r\n // number\r\n {\r\n conditionName: 'operatingSystemSKU',\r\n dataName: 'operatingSystemSKU'\r\n },\r\n\r\n // version string\r\n {\r\n conditionName: 'operatingSystemVersion',\r\n dataName: 'operatingSystemVersion'\r\n },\r\n\r\n // number\r\n {\r\n conditionName: 'windowsProductType',\r\n dataName: 'productType'\r\n },\r\n\r\n // string\r\n {\r\n conditionName: 'clusterFqdn',\r\n dataName: 'clusterFqdn'\r\n },\r\n\r\n // string\r\n {\r\n conditionName: 'systemLockdownPolicy',\r\n dataName: 'systemLockdownPolicy'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isHyperVRoleInstalled',\r\n dataName: 'isHyperVRoleInstalled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isHyperVPowershellInstalled',\r\n dataName: 'isHyperVPowershellInstalled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isManagementToolsAvailable',\r\n dataName: 'isManagementToolsAvailable'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isWmfInstalled',\r\n dataName: 'isWmfInstalled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isRemoteAppEnabled',\r\n dataName: 'isRemoteAppEnabled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isDomainController',\r\n dataName: 'isDomainController'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isS2dEnabled',\r\n dataName: 'isS2dEnabled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isBritannicaEnabled',\r\n dataName: 'isBritannicaEnabled'\r\n },\r\n\r\n // boolean\r\n {\r\n conditionName: 'isHciServer',\r\n dataName: 'isHciServer'\r\n }\r\n ];\r\n\r\n /**\r\n * The following operators are supported.\r\n * String comparison uses caseinsesitive pattern.\r\n */\r\n private static operators = {\r\n /**\r\n * Greater than: number, string (caseinsesitive), version\r\n */\r\n gt: 'gt',\r\n\r\n /**\r\n * Greater or equal: number, string (caseinsesitive), version\r\n */\r\n ge: 'ge',\r\n\r\n /**\r\n * Less than: number, string (caseinsesitive), version\r\n */\r\n lt: 'lt',\r\n\r\n /**\r\n * Less or equal: number, string (caseinsesitive), version\r\n */\r\n le: 'le',\r\n\r\n /**\r\n * Equal: number, string (caseinsesitive), version (Accept '*' like \"1.2.*\")\r\n */\r\n eq: 'eq',\r\n\r\n /**\r\n * Not equal: number, string (caseinsesitive), version (Accept '*' like \"1.2.*\")\r\n */\r\n ne: 'ne',\r\n\r\n /**\r\n * Test true: number, string, boolean\r\n */\r\n is: 'is',\r\n\r\n /**\r\n * Test false: number, string, boolean\r\n */\r\n not: 'not',\r\n\r\n /**\r\n * Contains a string: string (caseinsesitive)\r\n */\r\n contains: 'contains',\r\n\r\n /**\r\n * Not contains a string: string (caseinsesitive)\r\n */\r\n notContains: 'notContains',\r\n\r\n /**\r\n * Any one of value (number or string) equal: numberArray, stringArray\r\n */\r\n anyEq: 'anyEq',\r\n\r\n /**\r\n * Any one of value (number or string) not equal: numberArray, stringArray\r\n */\r\n anyNe: 'anyNe',\r\n\r\n /**\r\n * Any one of string contains: stringArray\r\n */\r\n anyContains: 'anyContains',\r\n\r\n /**\r\n * Any one of string not contains: stringArray\r\n */\r\n anyNotContains: 'anyNotContains'\r\n };\r\n\r\n private static internalCurrent: ToolConditionValidator;\r\n\r\n private caches: InventoryQueryCaches;\r\n private toolInventoryCache: ToolInventoryCache;\r\n private errorStrings = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error;\r\n\r\n /**\r\n * Gets the current object of the ToolConditionValidator class, and maintains as singleton.\r\n *\r\n * @param appContext the application context.\r\n * @param caches the instance of the inventory query caches to share the resource.\r\n */\r\n public static current(appContext: AppContext, caches: InventoryQueryCaches): ToolConditionValidator {\r\n if (!ToolConditionValidator.internalCurrent) {\r\n ToolConditionValidator.internalCurrent = new ToolConditionValidator(appContext, caches);\r\n }\r\n\r\n return ToolConditionValidator.internalCurrent;\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the ToolConditionValidator class.\r\n *\r\n * @param appContext the application context.\r\n * @param caches the instance of the inventory query caches to share the resource.\r\n */\r\n constructor(private appContext: AppContext, caches: InventoryQueryCaches) {\r\n const statusExpiration = 4 * 60 * 1000; // 4 min\r\n this.caches = caches;\r\n this.toolInventoryCache = new ToolInventoryCache(appContext, { expiration: statusExpiration });\r\n }\r\n\r\n /**\r\n * Scan the tool condition to be present or not.\r\n *\r\n * @param connection the connection object.\r\n * @param solution The entry point object of solution.\r\n * @param tool The entry point object of tool.\r\n * @param scanMode The mode of scanning.\r\n * @return the result observable.\r\n */\r\n public scanToolCondition(\r\n connection: Connection,\r\n solution: EnvironmentModuleEntryPoint,\r\n tool: EnvironmentModuleEntryPoint): ToolConditionResultWithWeight {\r\n\r\n if (!tool.requirements) {\r\n // tool is missing requirements, never show.\r\n return {\r\n weight: ToolConditionWeight.NonObservable,\r\n result: {\r\n ...tool,\r\n ...<EnvironmentModuleToolConditionResult>{\r\n show: false,\r\n detail: EnvironmentModuleToolState.NotSupported\r\n }\r\n }\r\n };\r\n }\r\n\r\n const solutionId = EnvironmentModule.createFormattedEntrypoint(solution);\r\n const toolId = EnvironmentModule.createFormattedEntrypoint(tool);\r\n const checkersCollection = [];\r\n let weight = ToolConditionWeight.NonObservable;\r\n for (const requirement of tool.requirements) {\r\n const checkers: Observable<EnvironmentModuleToolConditionResult>[] = [];\r\n\r\n // tool must specify the solutions it can show in\r\n if (!requirement.solutionIds || requirement.solutionIds.every(id => id !== solutionId)) {\r\n continue;\r\n }\r\n\r\n // if ths solution is a connections type, then the tool must specify the connection type\r\n if (solution.rootNavigationBehavior === 'connections'\r\n && (!requirement.connectionTypes || requirement.connectionTypes.every(type => type !== connection.type))) {\r\n continue;\r\n }\r\n\r\n // if there are no conditions to check, then this tool has been satisfied.\r\n if (!requirement.conditions || requirement.conditions.length === 0) {\r\n checkers.push(this.installationTypeValidate(connection));\r\n weight = Math.max(weight, ToolConditionWeight.Gateway);\r\n } else {\r\n for (const condition of requirement.conditions) {\r\n\r\n checkers.push(this.installationTypeValidate(connection, condition.installationTypes));\r\n weight = Math.max(weight, ToolConditionWeight.Gateway);\r\n\r\n if (condition.localhost !== undefined && !condition.localhost) {\r\n // if connection is localhost and not supported.\r\n checkers.push(this.localhostValidate(connection));\r\n weight = Math.max(weight, ToolConditionWeight.Gateway);\r\n }\r\n\r\n if (condition.inventory) {\r\n checkers.push(this.inventoryValidate(connection, condition.inventory));\r\n weight = Math.max(weight, ToolConditionWeight.Server);\r\n }\r\n\r\n if (condition.properties) {\r\n checkers.push(this.propertyValidate(connection, condition.properties));\r\n weight = Math.max(weight, ToolConditionWeight.Property);\r\n }\r\n\r\n if (condition.powerShell) {\r\n // powerShell { command, script }\r\n checkers.push(this.toolInventoryValidate(connection, toolId, condition.powerShell));\r\n weight = Math.max(weight, ToolConditionWeight.Script);\r\n } else if (condition.script) {\r\n // deprecated\r\n checkers.push(this.toolInventoryValidate(connection, toolId, condition.script));\r\n weight = Math.max(weight, ToolConditionWeight.Script);\r\n }\r\n }\r\n }\r\n\r\n checkersCollection.push(checkers);\r\n }\r\n\r\n if (checkersCollection.length === 0) {\r\n return {\r\n weight: ToolConditionWeight.NonObservable,\r\n result: {\r\n ...tool,\r\n ...<EnvironmentModuleToolConditionResult>{\r\n show: false,\r\n detail: EnvironmentModuleToolState.NotSupported,\r\n connectionId: connection ? connection.id : null\r\n }\r\n }\r\n };\r\n }\r\n\r\n let collectionIndex = 0;\r\n let checkerIndex = 0;\r\n let lastDetail: EnvironmentModuleToolState = null;\r\n let lastMessage: string = null;\r\n return {\r\n weight: weight,\r\n result: this.runChecker(checkersCollection[collectionIndex][checkerIndex])\r\n .pipe(catchError(() => {\r\n Logging.log({\r\n level: LogLevel.Error,\r\n message: this.errorStrings.ToolValidationResult.message.format(\r\n tool.parentModule.name,\r\n tool.displayName),\r\n source: 'ToolConditionValidator'\r\n });\r\n return of(<ToolConditionExpandResult>{\r\n show: false,\r\n ends: true\r\n });\r\n }),\r\n expand((value) => {\r\n checkerIndex++;\r\n if (value.ends) {\r\n return EMPTY;\r\n }\r\n\r\n if (value.detail !== undefined && lastDetail == null) {\r\n lastDetail = value.detail;\r\n }\r\n\r\n if (value.message !== undefined && lastMessage == null) {\r\n lastMessage = value.message;\r\n }\r\n\r\n if (!value.show) {\r\n // failed result. increment collection index and reset checkerIndex.\r\n if (checkersCollection.length > ++collectionIndex) {\r\n // still has another condition, try next checker set.\r\n return this.runChecker(checkersCollection[collectionIndex][checkerIndex = 0]);\r\n } else {\r\n // no more condition, end to return 'false'.\r\n return of(<ToolConditionExpandResult>{\r\n show: false,\r\n detail: lastDetail,\r\n message: lastMessage,\r\n ends: true\r\n });\r\n }\r\n }\r\n\r\n if (checkersCollection[collectionIndex].length > checkerIndex) {\r\n // check next checker.\r\n return this.runChecker(checkersCollection[collectionIndex][checkerIndex]);\r\n } else {\r\n // all state/succeeded within the checker set.\r\n return of({\r\n show: true,\r\n detail: lastDetail,\r\n message: lastMessage,\r\n ends: true\r\n });\r\n }\r\n }),\r\n filter(combined => combined.ends),\r\n map(combined => {\r\n return {\r\n ...tool,\r\n ...<EnvironmentModuleToolConditionResult>{\r\n show: combined.show,\r\n detail: combined.detail,\r\n message: combined.message,\r\n connectionId: connection ? connection.id : null\r\n }\r\n };\r\n }))\r\n };\r\n }\r\n\r\n private runChecker(checker: Observable<EnvironmentModuleToolConditionResult>): Observable<ToolConditionExpandResult> {\r\n return checker.pipe(\r\n take(1),\r\n map(result => <ToolConditionExpandResult>{ ...result, ends: false }));\r\n }\r\n\r\n private localhostValidate(\r\n connection: Connection): Observable<EnvironmentModuleToolConditionResult> {\r\n return this.caches.gatewayCache.createObservable({})\r\n .pipe(\r\n map(instance => <EnvironmentModuleToolConditionResult>{\r\n show: !(instance.mode !== GatewayMode.Service\r\n && connection.properties\r\n && connection.properties.displayName === 'localhost')\r\n }));\r\n }\r\n\r\n private installationTypeValidate(\r\n connection: Connection, installationType?: String[]): Observable<EnvironmentModuleToolConditionResult> {\r\n if (MsftSme.getValue<boolean>(MsftSme.self().Environment.configuration, 'gateway.disabled')) {\r\n return of({ show: true });\r\n }\r\n\r\n if (!installationType || !Array.isArray(installationType) || installationType.length === 0) {\r\n // Default to standard if property doesnt exist in the manifest.\r\n installationType = ['Standard'];\r\n }\r\n\r\n return this.caches.gatewayCache.createObservable({ params: {} })\r\n .pipe(\r\n catchError((error) => {\r\n const errorStrings = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error;\r\n const notification = this.appContext.notification.create(connection.name);\r\n notification.showError(\r\n errorStrings.ToolValidationGatewayInventoryError.title,\r\n errorStrings.ToolValidationGatewayInventoryError.message.format(Net.getErrorMessage(error)));\r\n return of(null);\r\n }),\r\n map(instance => <EnvironmentModuleToolConditionResult>{\r\n show: installationType.some(t => instance.installationType === t)\r\n }));\r\n }\r\n\r\n private inventoryValidate(\r\n connection: Connection, condition: EnvironmentModuleConditionMap): Observable<EnvironmentModuleToolConditionResult> {\r\n const nodeName = connection.activeAlias ? connection.activeAlias : connection.name;\r\n return this.caches.serverCache.createObservable({ params: { name: nodeName } })\r\n .pipe(\r\n catchError((error) => {\r\n const errorStrings = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error;\r\n const notification = this.appContext.notification.create(connection.name);\r\n notification.showError(\r\n errorStrings.ToolValidationInventoryError.title,\r\n errorStrings.ToolValidationInventoryError.message.format(Net.getErrorMessage(error)));\r\n return of(null);\r\n }),\r\n filter((instance: ServerInventory) => instance.serverName === nodeName),\r\n map(instance => <EnvironmentModuleToolConditionResult>{\r\n show: this.checkServerInventoryCondition(condition, instance)\r\n }));\r\n }\r\n\r\n private propertyValidate(\r\n connection: Connection, condition: EnvironmentModuleConditionMap): Observable<EnvironmentModuleToolConditionResult> {\r\n const propertyNames = Object.keys(condition);\r\n let result = true;\r\n for (const propertyName of propertyNames) {\r\n const propertyValue = connection.properties && connection.properties[propertyName];\r\n const conditionItem = condition[propertyName];\r\n if (conditionItem && !this.checkCondition(propertyValue, conditionItem)) {\r\n result = false;\r\n break;\r\n }\r\n }\r\n\r\n return of(<EnvironmentModuleToolConditionResult>{ show: result });\r\n }\r\n\r\n private toolInventoryValidate(\r\n connection: Connection,\r\n id: string,\r\n scriptOrCommand: string | PowerShellCommand): Observable<EnvironmentModuleToolConditionResult> {\r\n const command = PowerShell.getPowerShellCommand(scriptOrCommand);\r\n return this.toolInventoryCache.query(\r\n { ...{ name: connection.activeAlias ? connection.activeAlias : connection.name, id: id }, ...command })\r\n .pipe(\r\n map(inventory => <EnvironmentModuleToolConditionResult>{\r\n show: inventory.instance.state === EnvironmentModuleToolState.Available\r\n || inventory.instance.state === EnvironmentModuleToolState.NotConfigured,\r\n detail: inventory.instance.state,\r\n message: inventory.instance.message\r\n }),\r\n catchError((error) => {\r\n const message = Net.getErrorMessage(error);\r\n Logging.logError('ToolConditionValidator', `${id}: ${message}`);\r\n return of(<EnvironmentModuleToolConditionResult>{\r\n show: false,\r\n detail: EnvironmentModuleToolState.NotSupported,\r\n message\r\n });\r\n })\r\n );\r\n }\r\n\r\n private checkServerInventoryCondition(condition: EnvironmentModuleConditionMap, instance: ServerInventory): boolean {\r\n for (const property of ToolConditionValidator.serverInventoryProperties) {\r\n const conditionItem = condition[property.conditionName];\r\n if (conditionItem && !this.checkCondition(instance[property.dataName], conditionItem)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private checkCondition(data: any, condition: EnvironmentModuleConditionStatement): boolean {\r\n switch (condition.type) {\r\n case 'number':\r\n const numberValue: number = this.getNumberOrZero(data);\r\n const numberTest: number = this.getNumberOrZero(condition.value);\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.gt:\r\n return numberValue > numberTest;\r\n case ToolConditionValidator.operators.ge:\r\n return numberValue >= numberTest;\r\n case ToolConditionValidator.operators.lt:\r\n return numberValue < numberTest;\r\n case ToolConditionValidator.operators.le:\r\n return numberValue <= numberTest;\r\n case ToolConditionValidator.operators.eq:\r\n return numberValue === numberTest;\r\n case ToolConditionValidator.operators.ne:\r\n return numberValue !== numberTest;\r\n case ToolConditionValidator.operators.is:\r\n return !!numberValue;\r\n case ToolConditionValidator.operators.not:\r\n return !numberValue;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n case 'string':\r\n const stringValue: string = '' + data;\r\n const stringTest: string = '' + condition.value;\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.gt:\r\n return stringValue.toLowerCase() > stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.ge:\r\n return stringValue.toLowerCase() >= stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.lt:\r\n return stringValue.toLowerCase() < stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.le:\r\n return stringValue.toLowerCase() <= stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.eq:\r\n return stringValue.toLowerCase() === stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.ne:\r\n return stringValue.toLowerCase() !== stringTest.toLowerCase();\r\n case ToolConditionValidator.operators.is:\r\n return !!data;\r\n case ToolConditionValidator.operators.not:\r\n return !data;\r\n case ToolConditionValidator.operators.contains:\r\n return stringValue.toLowerCase().indexOf(stringTest.toLowerCase()) >= 0;\r\n case ToolConditionValidator.operators.notContains:\r\n return stringValue.toLowerCase().indexOf(stringTest.toLowerCase()) < 0;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n case 'boolean':\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.is:\r\n return !!data;\r\n case ToolConditionValidator.operators.not:\r\n return !data;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n case 'version':\r\n const versionValue: string = data;\r\n const versionTest: string = <string>condition.value;\r\n return this.compareVersion(versionValue, versionTest, condition.operator);\r\n\r\n case 'numberArray':\r\n const checkNumber: any = condition.value;\r\n if (!checkNumber\r\n || typeof checkNumber === 'string'\r\n || !checkNumber.length\r\n || typeof checkNumber[0] !== 'number') {\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedDataType.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n const numberArrayValue: number = this.getNumberOrZero(data);\r\n const numberArray: number[] = <number[]>condition.value;\r\n for (const numberItem of numberArray) {\r\n const numberArrayTest = this.getNumberOrZero(numberItem);\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.anyEq:\r\n if (numberArrayValue === numberArrayTest) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyNe:\r\n if (numberArrayValue !== numberArrayTest) {\r\n return true;\r\n }\r\n\r\n break;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n }\r\n\r\n return false;\r\n\r\n case 'stringArray':\r\n const checkString: any = condition.value;\r\n if (!checkString\r\n || typeof checkString === 'string'\r\n || !checkString.length\r\n || typeof checkString[0] !== 'string') {\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedDataType.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n\r\n const stringArrayValue: string = '' + data;\r\n const stringArray: string[] = <string[]>condition.value;\r\n for (const stringArrayTest of stringArray) {\r\n switch (condition.operator) {\r\n case ToolConditionValidator.operators.anyEq:\r\n if (stringArrayValue.toLowerCase() === stringArrayTest.toLowerCase()) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyNe:\r\n if (stringArrayValue.toLowerCase() !== stringArrayTest.toLowerCase()) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyContains:\r\n if (stringArrayValue.toLowerCase().indexOf(stringArrayTest.toLowerCase()) >= 0) {\r\n return true;\r\n }\r\n\r\n break;\r\n case ToolConditionValidator.operators.anyNotContains:\r\n if (stringArrayValue.toLowerCase().indexOf(stringArrayTest.toLowerCase()) < 0) {\r\n return true;\r\n }\r\n\r\n break;\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedOperator.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n }\r\n\r\n return false;\r\n\r\n default:\r\n throw new Error(this.errorStrings.ToolValidationUnsupportedDataType.message.format(\r\n JSON.stringify(condition),\r\n JSON.stringify(data)));\r\n }\r\n }\r\n\r\n private compareVersion(left: string, right: string, operator: string): boolean {\r\n const leftSegments = left.split('.');\r\n const rightSegments = right.split('.');\r\n if (!leftSegments || leftSegments.length <= 0 || !rightSegments || rightSegments.length <= 0) {\r\n throw new Error(this.errorStrings.ToolValidationVersionFormat.message);\r\n }\r\n\r\n const count = Math.max(leftSegments.length, rightSegments.length);\r\n let status;\r\n for (let index = 0; index < count; index++) {\r\n if (rightSegments[index] === '*') {\r\n // quit comparison with wildcard.\r\n status = 0;\r\n break;\r\n }\r\n\r\n const leftSegment = this.getNumberOrZero(leftSegments[index]);\r\n const rightSegment = this.getNumberOrZero(rightSegments[index]);\r\n if (leftSegment === rightSegment) {\r\n // equal.\r\n status = 0;\r\n } else if (leftSegment > rightSegment) {\r\n // greater.\r\n status = 1;\r\n break;\r\n } else {\r\n // lesser.\r\n status = -1;\r\n break;\r\n }\r\n }\r\n\r\n switch (operator) {\r\n case ToolConditionValidator.operators.gt:\r\n return status > 0;\r\n case ToolConditionValidator.operators.ge:\r\n return status >= 0;\r\n case ToolConditionValidator.operators.lt:\r\n return status < 0;\r\n case ToolConditionValidator.operators.le:\r\n return status <= 0;\r\n case ToolConditionValidator.operators.eq:\r\n return status === 0;\r\n case ToolConditionValidator.operators.ne:\r\n return status !== 0;\r\n default:\r\n throw new Error(\r\n this.errorStrings.ToolValidationUnsupportedOperator.message.format(operator, left));\r\n }\r\n }\r\n\r\n private getNumberOrZero(data: any): number {\r\n const result = Number(data);\r\n return isNaN(result) ? 0 : result;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/shared/server-inventory/server-inventory-cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEjG;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW,CAAC,eAAe,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/shared/server-inventory/server-inventory-cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEjG;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW,CAAC,eAAe,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;IA2ElG,OAAO,CAAC,UAAU;IA1E9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAqC;IAC5D,OAAO,CAAC,MAAM,CAAC,aAAa,CAAM;IAElC;;;;;OAKG;WACW,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,eAAe;IA2DjF;;;;;OAKG;gBACiB,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,kBAAkB;IAWxE;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAMjB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAKvB;;;;OAIG;IACH,OAAO,CAAC,aAAa;CAIxB","file":"server-inventory-cache.d.ts","sourcesContent":["import { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { AppContext } from '../../data/app-context';\r\nimport { PowerShell } from '../../data/powershell';\r\nimport { PowerShellScripts } from '../../generated/powershell-scripts';\r\nimport { SharedCache, SharedCacheOptions } from '../shared-cache';\r\nimport { ServerInventory, ServerInventoryData, ServerInventoryParams } from './server-inventory';\r\n\r\n/**\r\n * Server Inventory cache class.\r\n */\r\nexport class ServerInventoryCache extends SharedCache<ServerInventory, ServerInventoryData, ServerInventoryParams> {\r\n private static uniqueId = '@msft-sme/shell:serverInventory';\r\n private static uniqueVersion = 17;\r\n\r\n /**\r\n * Create Server Inventory data from the script result data.\r\n *\r\n * @param name the name of server node.\r\n * @param data the PowerShell script result data.\r\n */\r\n public static createServerInventoryData(name: string, data: any): ServerInventory {\r\n const inventory = new ServerInventory(name);\r\n\r\n if (data && data.results && data.results.length > 0) {\r\n const result = data.results[0];\r\n const operatingSystem = result.operatingSystem;\r\n const computerSystem = result.computerSystem;\r\n\r\n inventory.isAdministrator = result.isAdministrator;\r\n inventory.isWmfInstalled = result.isWmfInstalled;\r\n inventory.name = operatingSystem.csName ? operatingSystem.csName.toString().toLowerCase() : null;\r\n inventory.operatingSystemName = operatingSystem.caption;\r\n inventory.operatingSystemSKU = operatingSystem.operatingSystemSKU;\r\n inventory.operatingSystemVersion = operatingSystem.version;\r\n inventory.productType = operatingSystem.productType;\r\n inventory.osType = operatingSystem.osType;\r\n inventory.lastBootUpTime = operatingSystem.lastBootUpTime;\r\n inventory.osSerialNumber = operatingSystem.serialNumber;\r\n inventory.buildNumber = operatingSystem.currentBuild;\r\n inventory.updateBuildRevision = operatingSystem.updateBuildRevision;\r\n inventory.operatingSystemDisplayVersion = operatingSystem.displayVersion;\r\n\r\n inventory.totalPhysicalMemory = computerSystem.totalPhysicalMemory;\r\n inventory.domainRole = computerSystem.domainRole;\r\n inventory.computerManufacturer = computerSystem.manufacturer;\r\n inventory.computerModel = computerSystem.model;\r\n inventory.totalLogicalProcessors = computerSystem.numberOfLogicalProcessors;\r\n inventory.isRemoteAppEnabled = result.isRemoteAppEnabled;\r\n\r\n if (computerSystem.partOfDomain) {\r\n inventory.domainName = computerSystem.domain;\r\n } else {\r\n inventory.workgroupName = computerSystem.workgroup;\r\n }\r\n\r\n inventory.fullyQualifiedDomainName = result.fqdn.toLowerCase();\r\n inventory.fullyQualifiedDomainNameRaw = result.fqdn;\r\n inventory.addressList = result.addressList;\r\n inventory.hostname = result.hostname.toLowerCase();\r\n inventory.hostnameRaw = result.hostname;\r\n inventory.netBios = result.netBios;\r\n inventory.clusterFqdn = result.clusterFqdn ? result.clusterFqdn.toLowerCase() : null;\r\n inventory.isCluster = result.isCluster;\r\n inventory.isManagementToolsAvailable = result.isManagementToolsAvailable;\r\n inventory.isServerManagerAvailable = result.isServerManagerAvailable;\r\n inventory.isS2dEnabled = result.isS2dEnabled;\r\n inventory.isBritannicaEnabled = result.isBritannicaEnabled;\r\n inventory.isHyperVRoleInstalled = result.isHyperVRoleInstalled;\r\n inventory.isHyperVPowershellInstalled = result.isHyperVPowershellInstalled;\r\n inventory.isCredSSPEnabled = result.isCredSSPEnabled;\r\n inventory.smbiosData = result.smbiosData;\r\n inventory.azureArcStatus = result.azureArcStatus;\r\n inventory.systemLockdownPolicy = result.systemLockdownPolicy;\r\n inventory.isHciServer = result.isHciServer;\r\n }\r\n\r\n return inventory;\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the ServerInventoryCache class.\r\n *\r\n * @param appContext the app context.\r\n * @param options the option of shared cache.\r\n */\r\n constructor(private appContext: AppContext, options?: SharedCacheOptions) {\r\n super(\r\n ServerInventoryCache.uniqueId,\r\n ServerInventoryCache.uniqueVersion,\r\n (params) => this.dataInstanceId(params),\r\n (instance) => this.dataSerialize(instance),\r\n (serialized) => this.dataDeserialize(serialized),\r\n (params) => this.dataQuery(params),\r\n options);\r\n }\r\n\r\n /**\r\n * Defines how to collect the server inventory data.\r\n *\r\n * @param params the server inventory query params.\r\n * @return the Observable of ServerInventory data.\r\n */\r\n private dataQuery(params: ServerInventoryParams): Observable<ServerInventory> {\r\n const psSession = this.appContext.powerShell.createSession(params.name, null, { ...{ automatic: true }, ...params.requestOptions });\r\n return this.appContext.powerShell.run(psSession, PowerShell.createCommand(PowerShellScripts.Get_ServerInventory))\r\n .pipe(map((data: any) => ServerInventoryCache.createServerInventoryData(params.name, data)));\r\n }\r\n\r\n /**\r\n * Defines how to identify the cache entry by params.\r\n *\r\n * @param params the server inventory query params.\r\n * @return the id string.\r\n */\r\n private dataInstanceId(params: ServerInventoryParams): string {\r\n return params.name;\r\n }\r\n\r\n /**\r\n * Defines how to deserialize the class object from serialized data.\r\n *\r\n * @param serialized the serialized string;\r\n */\r\n private dataDeserialize(serialized: string): ServerInventory {\r\n const inventory: ServerInventoryData = JSON.parse(serialized);\r\n return new ServerInventory(inventory.serverName, inventory);\r\n }\r\n\r\n /**\r\n * Defines how to serialize the class object to serialized data.\r\n *\r\n * @param instance the class instance.\r\n */\r\n private dataSerialize(instance: ServerInventory): string {\r\n // automatically stripped out class related data.\r\n return JSON.stringify(instance);\r\n }\r\n}\r\n"]}
|
|
@@ -64,9 +64,8 @@ export class ServerInventoryCache extends SharedCache {
|
|
|
64
64
|
inventory.isCredSSPEnabled = result.isCredSSPEnabled;
|
|
65
65
|
inventory.smbiosData = result.smbiosData;
|
|
66
66
|
inventory.azureArcStatus = result.azureArcStatus;
|
|
67
|
-
inventory.
|
|
67
|
+
inventory.systemLockdownPolicy = result.systemLockdownPolicy;
|
|
68
68
|
inventory.isHciServer = result.isHciServer;
|
|
69
|
-
inventory.azureArcStatus = result.azureArcStatus;
|
|
70
69
|
}
|
|
71
70
|
return inventory;
|
|
72
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/shared/server-inventory/server-inventory-cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,eAAe,EAA8C,MAAM,oBAAoB,CAAC;AAEjG;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAwE;IA4E1F;IA3EZ,MAAM,CAAC,QAAQ,GAAG,iCAAiC,CAAC;IACpD,MAAM,CAAC,aAAa,GAAG,EAAE,CAAC;IAElC;;;;;OAKG;IACI,MAAM,CAAC,yBAAyB,CAAC,IAAY,EAAE,IAAS;QAC3D,MAAM,SAAS,GAAG,IAAI,eAA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,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;aAC5G,IAAI,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,oBAAoB,CAAC,yBAAyB,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;IAED;;;;;OAKG;IACK,cAAc,CAAC,MAA6B;QAChD,OAAO,MAAM,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACK,eAAe,CAAC,UAAkB;QACtC,MAAM,SAAS,GAAwB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC9D,OAAO,IAAI,eAAe,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACK,aAAa,CAAC,QAAyB;QAC3C,iDAAiD;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC","file":"server-inventory-cache.js","sourcesContent":["import { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { AppContext } from '../../data/app-context';\r\nimport { PowerShell } from '../../data/powershell';\r\nimport { PowerShellScripts } from '../../generated/powershell-scripts';\r\nimport { SharedCache, SharedCacheOptions } from '../shared-cache';\r\nimport { ServerInventory, ServerInventoryData, ServerInventoryParams } from './server-inventory';\r\n\r\n/**\r\n * Server Inventory cache class.\r\n */\r\nexport class ServerInventoryCache extends SharedCache<ServerInventory, ServerInventoryData, ServerInventoryParams> {\r\n private static uniqueId = '@msft-sme/shell:serverInventory';\r\n private static uniqueVersion = 17;\r\n\r\n /**\r\n * Create Server Inventory data from the script result data.\r\n *\r\n * @param name the name of server node.\r\n * @param data the PowerShell script result data.\r\n */\r\n public static createServerInventoryData(name: string, data: any): ServerInventory {\r\n const inventory = new ServerInventory(name);\r\n\r\n if (data && data.results && data.results.length > 0) {\r\n const result = data.results[0];\r\n const operatingSystem = result.operatingSystem;\r\n const computerSystem = result.computerSystem;\r\n\r\n inventory.isAdministrator = result.isAdministrator;\r\n inventory.isWmfInstalled = result.isWmfInstalled;\r\n inventory.name = operatingSystem.csName ? operatingSystem.csName.toString().toLowerCase() : null;\r\n inventory.operatingSystemName = operatingSystem.caption;\r\n inventory.operatingSystemSKU = operatingSystem.operatingSystemSKU;\r\n inventory.operatingSystemVersion = operatingSystem.version;\r\n inventory.productType = operatingSystem.productType;\r\n inventory.osType = operatingSystem.osType;\r\n inventory.lastBootUpTime = operatingSystem.lastBootUpTime;\r\n inventory.osSerialNumber = operatingSystem.serialNumber;\r\n inventory.buildNumber = operatingSystem.currentBuild;\r\n inventory.updateBuildRevision = operatingSystem.updateBuildRevision;\r\n inventory.operatingSystemDisplayVersion = operatingSystem.displayVersion;\r\n\r\n inventory.totalPhysicalMemory = computerSystem.totalPhysicalMemory;\r\n inventory.domainRole = computerSystem.domainRole;\r\n inventory.computerManufacturer = computerSystem.manufacturer;\r\n inventory.computerModel = computerSystem.model;\r\n inventory.totalLogicalProcessors = computerSystem.numberOfLogicalProcessors;\r\n inventory.isRemoteAppEnabled = result.isRemoteAppEnabled;\r\n\r\n if (computerSystem.partOfDomain) {\r\n inventory.domainName = computerSystem.domain;\r\n } else {\r\n inventory.workgroupName = computerSystem.workgroup;\r\n }\r\n\r\n inventory.fullyQualifiedDomainName = result.fqdn.toLowerCase();\r\n inventory.fullyQualifiedDomainNameRaw = result.fqdn;\r\n inventory.addressList = result.addressList;\r\n inventory.hostname = result.hostname.toLowerCase();\r\n inventory.hostnameRaw = result.hostname;\r\n inventory.netBios = result.netBios;\r\n inventory.clusterFqdn = result.clusterFqdn ? result.clusterFqdn.toLowerCase() : null;\r\n inventory.isCluster = result.isCluster;\r\n inventory.isManagementToolsAvailable = result.isManagementToolsAvailable;\r\n inventory.isServerManagerAvailable = result.isServerManagerAvailable;\r\n inventory.isS2dEnabled = result.isS2dEnabled;\r\n inventory.isBritannicaEnabled = result.isBritannicaEnabled;\r\n inventory.isHyperVRoleInstalled = result.isHyperVRoleInstalled;\r\n inventory.isHyperVPowershellInstalled = result.isHyperVPowershellInstalled;\r\n inventory.isCredSSPEnabled = result.isCredSSPEnabled;\r\n inventory.smbiosData = result.smbiosData;\r\n inventory.azureArcStatus = result.azureArcStatus;\r\n inventory.isSystemLockdownPolicyEnforced = result.isSystemLockdownPolicyEnforced;\r\n inventory.isHciServer = result.isHciServer;\r\n inventory.azureArcStatus = result.azureArcStatus;\r\n }\r\n\r\n return inventory;\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the ServerInventoryCache class.\r\n *\r\n * @param appContext the app context.\r\n * @param options the option of shared cache.\r\n */\r\n constructor(private appContext: AppContext, options?: SharedCacheOptions) {\r\n super(\r\n ServerInventoryCache.uniqueId,\r\n ServerInventoryCache.uniqueVersion,\r\n (params) => this.dataInstanceId(params),\r\n (instance) => this.dataSerialize(instance),\r\n (serialized) => this.dataDeserialize(serialized),\r\n (params) => this.dataQuery(params),\r\n options);\r\n }\r\n\r\n /**\r\n * Defines how to collect the server inventory data.\r\n *\r\n * @param params the server inventory query params.\r\n * @return the Observable of ServerInventory data.\r\n */\r\n private dataQuery(params: ServerInventoryParams): Observable<ServerInventory> {\r\n const psSession = this.appContext.powerShell.createSession(params.name, null, { ...{ automatic: true }, ...params.requestOptions });\r\n return this.appContext.powerShell.run(psSession, PowerShell.createCommand(PowerShellScripts.Get_ServerInventory))\r\n .pipe(map((data: any) => ServerInventoryCache.createServerInventoryData(params.name, data)));\r\n }\r\n\r\n /**\r\n * Defines how to identify the cache entry by params.\r\n *\r\n * @param params the server inventory query params.\r\n * @return the id string.\r\n */\r\n private dataInstanceId(params: ServerInventoryParams): string {\r\n return params.name;\r\n }\r\n\r\n /**\r\n * Defines how to deserialize the class object from serialized data.\r\n *\r\n * @param serialized the serialized string;\r\n */\r\n private dataDeserialize(serialized: string): ServerInventory {\r\n const inventory: ServerInventoryData = JSON.parse(serialized);\r\n return new ServerInventory(inventory.serverName, inventory);\r\n }\r\n\r\n /**\r\n * Defines how to serialize the class object to serialized data.\r\n *\r\n * @param instance the class instance.\r\n */\r\n private dataSerialize(instance: ServerInventory): string {\r\n // automatically stripped out class related data.\r\n return JSON.stringify(instance);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/shared/server-inventory/server-inventory-cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,eAAe,EAA8C,MAAM,oBAAoB,CAAC;AAEjG;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAwE;IA2E1F;IA1EZ,MAAM,CAAC,QAAQ,GAAG,iCAAiC,CAAC;IACpD,MAAM,CAAC,aAAa,GAAG,EAAE,CAAC;IAElC;;;;;OAKG;IACI,MAAM,CAAC,yBAAyB,CAAC,IAAY,EAAE,IAAS;QAC3D,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAE5C,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACjD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;YAC/C,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;YAE7C,SAAS,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;YACnD,SAAS,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;YACjD,SAAS,CAAC,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,C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C3C,iDAAiD;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC","file":"server-inventory-cache.js","sourcesContent":["import { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { AppContext } from '../../data/app-context';\r\nimport { PowerShell } from '../../data/powershell';\r\nimport { PowerShellScripts } from '../../generated/powershell-scripts';\r\nimport { SharedCache, SharedCacheOptions } from '../shared-cache';\r\nimport { ServerInventory, ServerInventoryData, ServerInventoryParams } from './server-inventory';\r\n\r\n/**\r\n * Server Inventory cache class.\r\n */\r\nexport class ServerInventoryCache extends SharedCache<ServerInventory, ServerInventoryData, ServerInventoryParams> {\r\n private static uniqueId = '@msft-sme/shell:serverInventory';\r\n private static uniqueVersion = 17;\r\n\r\n /**\r\n * Create Server Inventory data from the script result data.\r\n *\r\n * @param name the name of server node.\r\n * @param data the PowerShell script result data.\r\n */\r\n public static createServerInventoryData(name: string, data: any): ServerInventory {\r\n const inventory = new ServerInventory(name);\r\n\r\n if (data && data.results && data.results.length > 0) {\r\n const result = data.results[0];\r\n const operatingSystem = result.operatingSystem;\r\n const computerSystem = result.computerSystem;\r\n\r\n inventory.isAdministrator = result.isAdministrator;\r\n inventory.isWmfInstalled = result.isWmfInstalled;\r\n inventory.name = operatingSystem.csName ? operatingSystem.csName.toString().toLowerCase() : null;\r\n inventory.operatingSystemName = operatingSystem.caption;\r\n inventory.operatingSystemSKU = operatingSystem.operatingSystemSKU;\r\n inventory.operatingSystemVersion = operatingSystem.version;\r\n inventory.productType = operatingSystem.productType;\r\n inventory.osType = operatingSystem.osType;\r\n inventory.lastBootUpTime = operatingSystem.lastBootUpTime;\r\n inventory.osSerialNumber = operatingSystem.serialNumber;\r\n inventory.buildNumber = operatingSystem.currentBuild;\r\n inventory.updateBuildRevision = operatingSystem.updateBuildRevision;\r\n inventory.operatingSystemDisplayVersion = operatingSystem.displayVersion;\r\n\r\n inventory.totalPhysicalMemory = computerSystem.totalPhysicalMemory;\r\n inventory.domainRole = computerSystem.domainRole;\r\n inventory.computerManufacturer = computerSystem.manufacturer;\r\n inventory.computerModel = computerSystem.model;\r\n inventory.totalLogicalProcessors = computerSystem.numberOfLogicalProcessors;\r\n inventory.isRemoteAppEnabled = result.isRemoteAppEnabled;\r\n\r\n if (computerSystem.partOfDomain) {\r\n inventory.domainName = computerSystem.domain;\r\n } else {\r\n inventory.workgroupName = computerSystem.workgroup;\r\n }\r\n\r\n inventory.fullyQualifiedDomainName = result.fqdn.toLowerCase();\r\n inventory.fullyQualifiedDomainNameRaw = result.fqdn;\r\n inventory.addressList = result.addressList;\r\n inventory.hostname = result.hostname.toLowerCase();\r\n inventory.hostnameRaw = result.hostname;\r\n inventory.netBios = result.netBios;\r\n inventory.clusterFqdn = result.clusterFqdn ? result.clusterFqdn.toLowerCase() : null;\r\n inventory.isCluster = result.isCluster;\r\n inventory.isManagementToolsAvailable = result.isManagementToolsAvailable;\r\n inventory.isServerManagerAvailable = result.isServerManagerAvailable;\r\n inventory.isS2dEnabled = result.isS2dEnabled;\r\n inventory.isBritannicaEnabled = result.isBritannicaEnabled;\r\n inventory.isHyperVRoleInstalled = result.isHyperVRoleInstalled;\r\n inventory.isHyperVPowershellInstalled = result.isHyperVPowershellInstalled;\r\n inventory.isCredSSPEnabled = result.isCredSSPEnabled;\r\n inventory.smbiosData = result.smbiosData;\r\n inventory.azureArcStatus = result.azureArcStatus;\r\n inventory.systemLockdownPolicy = result.systemLockdownPolicy;\r\n inventory.isHciServer = result.isHciServer;\r\n }\r\n\r\n return inventory;\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the ServerInventoryCache class.\r\n *\r\n * @param appContext the app context.\r\n * @param options the option of shared cache.\r\n */\r\n constructor(private appContext: AppContext, options?: SharedCacheOptions) {\r\n super(\r\n ServerInventoryCache.uniqueId,\r\n ServerInventoryCache.uniqueVersion,\r\n (params) => this.dataInstanceId(params),\r\n (instance) => this.dataSerialize(instance),\r\n (serialized) => this.dataDeserialize(serialized),\r\n (params) => this.dataQuery(params),\r\n options);\r\n }\r\n\r\n /**\r\n * Defines how to collect the server inventory data.\r\n *\r\n * @param params the server inventory query params.\r\n * @return the Observable of ServerInventory data.\r\n */\r\n private dataQuery(params: ServerInventoryParams): Observable<ServerInventory> {\r\n const psSession = this.appContext.powerShell.createSession(params.name, null, { ...{ automatic: true }, ...params.requestOptions });\r\n return this.appContext.powerShell.run(psSession, PowerShell.createCommand(PowerShellScripts.Get_ServerInventory))\r\n .pipe(map((data: any) => ServerInventoryCache.createServerInventoryData(params.name, data)));\r\n }\r\n\r\n /**\r\n * Defines how to identify the cache entry by params.\r\n *\r\n * @param params the server inventory query params.\r\n * @return the id string.\r\n */\r\n private dataInstanceId(params: ServerInventoryParams): string {\r\n return params.name;\r\n }\r\n\r\n /**\r\n * Defines how to deserialize the class object from serialized data.\r\n *\r\n * @param serialized the serialized string;\r\n */\r\n private dataDeserialize(serialized: string): ServerInventory {\r\n const inventory: ServerInventoryData = JSON.parse(serialized);\r\n return new ServerInventory(inventory.serverName, inventory);\r\n }\r\n\r\n /**\r\n * Defines how to serialize the class object to serialized data.\r\n *\r\n * @param instance the class instance.\r\n */\r\n private dataSerialize(instance: ServerInventory): string {\r\n // automatically stripped out class related data.\r\n return JSON.stringify(instance);\r\n }\r\n}\r\n"]}
|
|
@@ -224,9 +224,9 @@ export interface ServerInventoryData {
|
|
|
224
224
|
*/
|
|
225
225
|
smbiosData: SmbiosData;
|
|
226
226
|
/**
|
|
227
|
-
*
|
|
227
|
+
* The system lockdown policy enforcement mode.
|
|
228
228
|
*/
|
|
229
|
-
|
|
229
|
+
systemLockdownPolicy: string;
|
|
230
230
|
/**
|
|
231
231
|
* Type of operating system value
|
|
232
232
|
*/
|
|
@@ -394,9 +394,9 @@ export declare class ServerInventory implements ServerInventoryData {
|
|
|
394
394
|
*/
|
|
395
395
|
smbiosData: SmbiosData;
|
|
396
396
|
/**
|
|
397
|
-
*
|
|
397
|
+
* The system lockdown policy enforcement mode.
|
|
398
398
|
*/
|
|
399
|
-
|
|
399
|
+
systemLockdownPolicy: string;
|
|
400
400
|
/**
|
|
401
401
|
* Type of operating system value
|
|
402
402
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/shared/server-inventory/server-inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,CAAC,EAAE,+BAA+B,CAAC;CACpD;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAC9B,OAAO,IAAI;IACX,MAAM,IAAI;IACV,YAAY,IAAI;IAChB,QAAQ,IAAI;IACZ,iBAAiB,IAAI;IACrB,mBAAmB,IAAI;IACvB,QAAQ,IAAI;IACZ,iBAAiB,IAAI;IACrB,cAAc,IAAI;IAClB,mBAAmB,IAAI;IACvB,SAAS,KAAK;IACd,iBAAiB,KAAK;IACtB,iBAAiB,KAAK;CACzB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,WAAW,IAAI;IACf,gBAAgB,IAAI;IACpB,MAAM,IAAI;CACb;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;MAIE;IACF,gBAAgB,EAAE,MAAM,CAAC;IACzB;;MAEE;IACF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;MAEE;IACF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;MAE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AAM,CAAC;IAEtB;;OAEG;IACI,KAAK,EAAE,MAAM,CAAC;IAErB;;OAEG;IACI,cAAc,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,cAAc,EAAE,kBAAkB,CAAC;IAKnC,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACI,WAAW,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACI,mBAAmB,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACI,6BAA6B,EAAE,MAAM,CAAC;IAE7C;;OAEG;IACI,WAAW,EAAE,OAAO,CAAC;IAE5B;;;;;OAKG;gBACgB,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB;IAMjE;;;;OAIG;IACH,IAAW,MAAM,IAAI,OAAO,CAG3B;IAED;;;;OAIG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED;;;;OAIG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED;;;;OAIG;IACH,IAAW,kBAAkB,IAAI,OAAO,CAIvC;IAED;;OAEG;IACH,IAAW,0BAA0B,IAAI,MAAM,CAE9C;IAED;;OAEG;IACH,IAAW,8BAA8B,IAAI,MAAM,CAElD;IAED;;;OAGG;IACH,IAAW,eAAe,IAAI,sBAAsB,CAsDnD;CACJ","file":"server-inventory.d.ts","sourcesContent":["import { AzureArcStatusEnum } from '../../azure/models/azureArcStatusEnum';\r\nimport { PowerShellSessionRequestOptions } from '../../data/powershell';\r\nimport { MediaConversion, MediaConversionBase } from '../../data/units';\r\n\r\n/**\r\n * Server Inventory query parameters.\r\n */\r\nexport interface ServerInventoryParams {\r\n /**\r\n * name of server node.\r\n */\r\n name: string;\r\n\r\n /**\r\n * options for PowerShell session request.\r\n */\r\n requestOptions?: PowerShellSessionRequestOptions;\r\n}\r\n\r\n/**\r\n * Windows Operating Systems\r\n */\r\nexport enum WindowsOperatingSystem {\r\n Unknown = 0,\r\n Legacy = 1, // XP, Server 2003, Windows NT, etc.\r\n WindowsVista = 2,\r\n Windows7 = 3,\r\n WindowsServer2008 = 4,\r\n WindowsServer2008R2 = 5,\r\n Windows8 = 6,\r\n WindowsServer2012 = 7,\r\n Windows8Point1 = 8,\r\n WindowsServer2012R2 = 9,\r\n Windows10 = 10,\r\n WindowsServer2016 = 11,\r\n WindowsServer2019 = 12\r\n}\r\n\r\n/**\r\n * Windows Product Types\r\n */\r\nexport enum WindowsProductType {\r\n Workstation = 1,\r\n DomainController = 2,\r\n Server = 3\r\n}\r\n\r\n/**\r\n * Smbios Info\r\n */\r\nexport interface SmbiosData {\r\n /**\r\n * indicator of the Serial Number assigned from Company and is accessible on exterior of device.\r\n */\r\n serialNumber: string;\r\n /**\r\n * identifies the company brand name under which the device is marketed to the end user.\r\n */\r\n manufacturer: string;\r\n /**\r\n * This is a unique value and is intended to be associated with this specific machine.\r\n * This can be null depending on the machine\r\n */\r\n uuid: string;\r\n /**\r\n * identifies the baseboard and should accurately reflect\r\n * variances in baseboards across different devices in the same family and product name.\r\n * This can be null depending on the machine\r\n */\r\n baseBoardProduct: string;\r\n /**\r\n * physical frames or structures of a machine\r\n */\r\n chassis: string[];\r\n /**\r\n * Types of Chassis defined in the specification.\r\n */\r\n chassisTypes: string[];\r\n /**\r\n * identifies the company sub-brand name, specific to a grouping of similar devices known as a product line,\r\n * under which the device is marketed to end users\r\n */\r\n systemFamily: string;\r\n /**\r\n * identifies the device in a format that can be determined by Company.\r\n */\r\n systemSkuNumber: string;\r\n\r\n /**\r\n * Asset tag number of the system enclosure\r\n */\r\n smBiosAssetTag: string;\r\n}\r\n\r\n/**\r\n * The address entry for address list.\r\n */\r\nexport interface ServerInventoryAddressEntry {\r\n ipAddress: string;\r\n addressFamily: 'InterNetwork' | 'InterNetworkV6';\r\n}\r\n\r\n/**\r\n * Server Inventory data interface.\r\n */\r\nexport interface ServerInventoryData {\r\n /**\r\n * The server name.\r\n */\r\n serverName: string;\r\n\r\n /**\r\n * The name of server. (CSName/OperatingSystem)\r\n */\r\n name: string;\r\n\r\n /**\r\n * The domain name of server. (Domain/ComputerSystem)\r\n */\r\n domainName: string;\r\n\r\n /**\r\n * The workgroup name of server if any. (Workgroup/ComputerSystem)\r\n */\r\n workgroupName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem)\r\n */\r\n fullyQualifiedDomainName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem) Not lower cased.\r\n */\r\n fullyQualifiedDomainNameRaw: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer.\r\n */\r\n hostname: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer. Not lower cased.\r\n */\r\n hostnameRaw: string;\r\n\r\n /**\r\n * The NetBios name which might be trimmed by 15 characters.\r\n */\r\n netBios: string;\r\n\r\n /**\r\n * The IP address list.\r\n */\r\n addressList: ServerInventoryAddressEntry[];\r\n\r\n /**\r\n * The operating system name of server. (Caption/OperatingSystem)\r\n */\r\n operatingSystemName: string;\r\n\r\n /**\r\n * The operating system name of server. (SKU/OperatingSystem)\r\n */\r\n operatingSystemSKU: number;\r\n\r\n /**\r\n * The operating system version of server. (Version/OperatingSystem)\r\n */\r\n operatingSystemVersion: string;\r\n\r\n /**\r\n * The total size of physical memory.\r\n */\r\n totalPhysicalMemory: number;\r\n\r\n /**\r\n * The domain role.\r\n */\r\n domainRole: number;\r\n\r\n /**\r\n * The windows product type.\r\n */\r\n productType: WindowsProductType;\r\n\r\n /**\r\n * The computer manufacturer.\r\n */\r\n computerManufacturer: string;\r\n\r\n /**\r\n * The computer model.\r\n */\r\n computerModel: string;\r\n\r\n /**\r\n * The number of logical processors.\r\n */\r\n totalLogicalProcessors: number;\r\n\r\n /**\r\n * Indicating if the server has ManagementTools namespace to support TaskManager provider.\r\n */\r\n isManagementToolsAvailable: boolean;\r\n\r\n /**\r\n * Indicating if the computer has ServerManager namespace to support ServerManager provider.\r\n */\r\n isServerManagerAvailable: boolean;\r\n\r\n /**\r\n * Whether or not Windows Management Framework v5.0 or higher is installed.\r\n */\r\n isWmfInstalled: boolean;\r\n\r\n /**\r\n * Indicating if the server node is a part of Microsoft Cluster.\r\n */\r\n isCluster: boolean;\r\n\r\n /**\r\n * The FQDN of Microsoft Cluster if it's a part of Microsoft Cluster.\r\n */\r\n clusterFqdn: string;\r\n\r\n /**\r\n * Indicating if current user is a member of administrators group.\r\n */\r\n isAdministrator: boolean;\r\n\r\n /**\r\n * Indicates if the node has S2D enabled\r\n */\r\n isS2dEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the node has Britannica enabled\r\n */\r\n isBritannicaEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v role is installed\r\n */\r\n isHyperVRoleInstalled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v powershell feature is installed\r\n */\r\n isHyperVPowershellInstalled: boolean;\r\n\r\n /**\r\n * Indicates if CredSSP is enabled.\r\n */\r\n isCredSSPEnabled: boolean;\r\n\r\n /**\r\n * Indicating if remote app enabled.\r\n */\r\n isRemoteAppEnabled: boolean;\r\n\r\n /**\r\n * SMBIOS Data\r\n */\r\n smbiosData: SmbiosData;\r\n\r\n /**\r\n * Indicating if system lockdown policy is enforced which would put PowerShell in ConstrainedLanguage mode (WDAC).\r\n */\r\n isSystemLockdownPolicyEnforced: boolean;\r\n\r\n /**\r\n * Type of operating system value\r\n */\r\n osType: string;\r\n\r\n /**\r\n * Product name that a manufacturer gives to a computer\r\n */\r\n model: string;\r\n\r\n /**\r\n * Last reboot time\r\n */\r\n lastBootUpTime: string;\r\n\r\n /**\r\n * The status of the azure arc in the server\r\n * i.e connectioned, disconnected etc\r\n */\r\n azureArcStatus: AzureArcStatusEnum;\r\n\r\n /**\r\n * The operating system build number\r\n */\r\n buildNumber: string;\r\n\r\n /**\r\n * The operating system update build revision\r\n */\r\n updateBuildRevision: number;\r\n\r\n /**\r\n * The operating system display version eg: 22H2\r\n */\r\n operatingSystemDisplayVersion: string;\r\n\r\n /**\r\n * Indicating if the server is HCI.\r\n */\r\n isHciServer: boolean;\r\n}\r\n\r\n/**\r\n * Server Inventory class.\r\n */\r\nexport class ServerInventory implements ServerInventoryData {\r\n private static nanoDisplayFormat = '{0} Nano';\r\n private static server19PreviewBuildNumber = 17623;\r\n\r\n /*\r\n * OperatingSystemSKU: from https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx\r\n * PRODUCT_DATACENTER_NANO_SERVER (143)\r\n * Windows Server Datacenter Edition (Nano Server installation)\r\n * PRODUCT_STANDARD_NANO_SERVER (144)\r\n * Windows Server Standard Edition (Nano Server installation)\r\n */\r\n private static nanoServerSkus: number[] = [143, 144];\r\n\r\n /**\r\n * The name of server. (CSName/OperatingSystem)\r\n */\r\n public name: string;\r\n\r\n /**\r\n * The domain name of server. (Domain/ComputerSystem)\r\n */\r\n public domainName: string;\r\n\r\n /**\r\n * The workgroup name of server if any. (Workgroup/ComputerSystem)\r\n */\r\n public workgroupName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem)\r\n */\r\n public fullyQualifiedDomainName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem) Not lower cased.\r\n */\r\n public fullyQualifiedDomainNameRaw: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer.\r\n */\r\n public hostname: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer. Not lower cased.\r\n */\r\n public hostnameRaw: string;\r\n\r\n /**\r\n * The NetBios name which might be trimmed by 15 characters.\r\n */\r\n public netBios: string;\r\n\r\n /**\r\n * The IP address list.\r\n */\r\n public addressList: ServerInventoryAddressEntry[];\r\n\r\n /**\r\n * The operating system name of server. (Caption/OperatingSystem)\r\n */\r\n public operatingSystemName: string;\r\n\r\n /**\r\n * The operating system name of server. (SKU/OperatingSystem)\r\n */\r\n public operatingSystemSKU: number;\r\n\r\n /**\r\n * The operating system version of server. (Version/OperatingSystem)\r\n */\r\n public operatingSystemVersion: string;\r\n\r\n /**\r\n * The total size of physical memory.\r\n */\r\n public totalPhysicalMemory: number;\r\n\r\n /**\r\n * The domain role.\r\n */\r\n public domainRole: number;\r\n\r\n /**\r\n * The windows product type.\r\n */\r\n public productType: WindowsProductType;\r\n\r\n /**\r\n * The computer manufacturer.\r\n */\r\n public computerManufacturer: string;\r\n\r\n /**\r\n * The computer model.\r\n */\r\n public computerModel: string;\r\n\r\n /**\r\n * The number of logical processors.\r\n */\r\n public totalLogicalProcessors: number;\r\n\r\n /**\r\n * Indicating if the server has ManagementTools namespace to support TaskManager provider.\r\n */\r\n public isManagementToolsAvailable: boolean;\r\n\r\n /**\r\n * Indicating if the computer has ServerManager namespace to support ServerManager provider.\r\n */\r\n public isServerManagerAvailable: boolean;\r\n\r\n /**\r\n * Whether or not Windows Management Framework v5.0 or higher is installed.\r\n */\r\n public isWmfInstalled: boolean;\r\n\r\n /**\r\n * Indicating if the server node is a part of Microsoft Cluster.\r\n */\r\n public isCluster: boolean;\r\n\r\n /**\r\n * The FQDN of Microsoft Cluster if it's a part of Microsoft Cluster.\r\n */\r\n public clusterFqdn: string;\r\n\r\n /**\r\n * Indicating if current user is a member of administrators group.\r\n */\r\n public isAdministrator: boolean;\r\n\r\n /**\r\n * Indicates if the node has S2D enabled\r\n */\r\n public isS2dEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the node has Britannica enabled\r\n */\r\n public isBritannicaEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v role is installed\r\n */\r\n public isHyperVRoleInstalled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v powershell feature is installed\r\n */\r\n public isHyperVPowershellInstalled: boolean;\r\n\r\n /**\r\n * Indicates if CredSSP is enabled.\r\n */\r\n public isCredSSPEnabled: boolean;\r\n\r\n /**\r\n * Indicating if remote app enabled.\r\n */\r\n public isRemoteAppEnabled: boolean;\r\n\r\n /**\r\n * SMBIOS Data\r\n */\r\n public smbiosData: SmbiosData;\r\n\r\n /**\r\n * Indicating if system lockdown policy is enforced which would put PowerShell in ConstrainedLanguage mode (WDAC).\r\n */\r\n public isSystemLockdownPolicyEnforced: boolean;\r\n\r\n /**\r\n * Type of operating system value\r\n */\r\n public osType: string;\r\n\r\n /**\r\n * Product name that a manufacturer gives to a computer\r\n */\r\n public model: string;\r\n\r\n /**\r\n * Last reboot time\r\n */\r\n public lastBootUpTime: string;\r\n\r\n /**\r\n * The status of the azure arc in the server\r\n * i.e connectioned, disconnected etc\r\n */\r\n azureArcStatus: AzureArcStatusEnum;\r\n\r\n /*\r\n * Operating system serial number\r\n */\r\n osSerialNumber: string;\r\n\r\n /**\r\n * The operating system build number\r\n */\r\n public buildNumber: string;\r\n\r\n /**\r\n * The operating system update build revision\r\n */\r\n public updateBuildRevision: number;\r\n\r\n /**\r\n * The operating system display version eg: 22H2\r\n */\r\n public operatingSystemDisplayVersion: string;\r\n\r\n /**\r\n * Indicating if the server is HCI.\r\n */\r\n public isHciServer: boolean;\r\n\r\n /**\r\n * Initializes a new instance of the ServerInventory Class.\r\n *\r\n * @param serverName the server name to query.\r\n * @param data the server inventory recovered data.\r\n */\r\n constructor(public serverName: string, data?: ServerInventoryData) {\r\n if (data) {\r\n Object.assign(this, data);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the sku number indicating whether the computer is Nano server.\r\n *\r\n * @return boolean true if nano\r\n */\r\n public get isNano(): boolean {\r\n // given sku number is in nanoServerSkus array?\r\n return ServerInventory.nanoServerSkus.indexOf(this.operatingSystemSKU) > -1;\r\n }\r\n\r\n /**\r\n * Gets a value indicating if this is a windows server\r\n *\r\n * @return boolean true if this is a server\r\n */\r\n public get isServer(): boolean {\r\n return this.productType === WindowsProductType.Server;\r\n }\r\n\r\n /**\r\n * Gets a value indicating if this is a windows client\r\n *\r\n * @return boolean true if this is a client\r\n */\r\n public get isClient(): boolean {\r\n return this.productType === WindowsProductType.Workstation;\r\n }\r\n\r\n /**\r\n * Indicates whether the computer is domain controller or not.\r\n *\r\n * @return boolean true if domain controller\r\n */\r\n public get isDomainController(): boolean {\r\n // As per https://msdn.microsoft.com/en-us/library/windows/desktop/aa394102(v=vs.85)\r\n // domainRole of 4 or 5 means it's a domain controller.\r\n return (this.domainRole === 4 || this.domainRole === 5);\r\n }\r\n\r\n /**\r\n * Gets the display name of operating system.\r\n */\r\n public get operatingSystemDisplayName(): string {\r\n return this.isNano ? ServerInventory.nanoDisplayFormat.format(this.operatingSystemName) : this.operatingSystemName;\r\n }\r\n\r\n /**\r\n * Gets the display name of total physical memory.\r\n */\r\n public get totalPhysicalMemoryDisplayName(): string {\r\n return MediaConversion.getConvertedValue(this.totalPhysicalMemory, MediaConversionBase.Binary);\r\n }\r\n\r\n /**\r\n * Gets the operating system enumb of the machine\r\n * see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx for operating system version mapping.\r\n */\r\n public get operatingSystem(): WindowsOperatingSystem {\r\n\r\n if (!this.operatingSystemVersion) {\r\n return WindowsOperatingSystem.Unknown;\r\n }\r\n\r\n // windows 10, server 2016, and server 2019\r\n // report anything newer as one of these options.\r\n if (this.operatingSystemVersion.indexOf('.') > 1) {\r\n // since . is more than 2 digits from the start of the screen we are going to assume its '10.', '11.', etc...\r\n if (this.isServer) {\r\n if (+this.operatingSystemVersion.split('.').last() >= ServerInventory.server19PreviewBuildNumber) {\r\n // 17623 first insiders preview of 2019\r\n return WindowsOperatingSystem.WindowsServer2019;\r\n } else {\r\n // 14393 official release version of 2016\r\n // fall back to 2016 for versions between 14393 and 17623\r\n return WindowsOperatingSystem.WindowsServer2016;\r\n }\r\n } else {\r\n return WindowsOperatingSystem.Windows10;\r\n }\r\n }\r\n\r\n // windows 8.1 and server 2012r2\r\n if (this.operatingSystemVersion.startsWith('6.3')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2012R2\r\n : WindowsOperatingSystem.Windows8Point1;\r\n }\r\n\r\n // windows 8 and server 2012\r\n if (this.operatingSystemVersion.startsWith('6.2')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2012\r\n : WindowsOperatingSystem.Windows8;\r\n }\r\n\r\n // windows 7 and server 2008 R2\r\n if (this.operatingSystemVersion.startsWith('6.1')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2008R2\r\n : WindowsOperatingSystem.Windows7;\r\n }\r\n\r\n // windows vista and server 2008\r\n if (this.operatingSystemVersion.startsWith('6.0')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2008\r\n : WindowsOperatingSystem.WindowsVista;\r\n }\r\n\r\n // assume a legacy os that somehow was able to run powershell.(unlikely)\r\n return WindowsOperatingSystem.Legacy;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/shared/server-inventory/server-inventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,CAAC,EAAE,+BAA+B,CAAC;CACpD;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAC9B,OAAO,IAAI;IACX,MAAM,IAAI;IACV,YAAY,IAAI;IAChB,QAAQ,IAAI;IACZ,iBAAiB,IAAI;IACrB,mBAAmB,IAAI;IACvB,QAAQ,IAAI;IACZ,iBAAiB,IAAI;IACrB,cAAc,IAAI;IAClB,mBAAmB,IAAI;IACvB,SAAS,KAAK;IACd,iBAAiB,KAAK;IACtB,iBAAiB,KAAK;CACzB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,WAAW,IAAI;IACf,gBAAgB,IAAI;IACpB,MAAM,IAAI;CACb;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;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2B,EAAE,OAAO,CAAC;IAE5C;;OAEG;IACI,gBAAgB,EAAE,OAAO,CAAC;IAEjC;;OAEG;IACI,kBAAkB,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACI,UAAU,EAAE,UAAU,CAAC;IAE9B;;OAEG;IACI,oBAAoB,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACI,MAAM,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACI,KAAK,EAAE,MAAM,CAAC;IAErB;;OAEG;IACI,cAAc,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,cAAc,EAAE,kBAAkB,CAAC;IAKnC,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACI,WAAW,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACI,mBAAmB,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACI,6BAA6B,EAAE,MAAM,CAAC;IAE7C;;OAEG;IACI,WAAW,EAAE,OAAO,CAAC;IAE5B;;;;;OAKG;gBACgB,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB;IAMjE;;;;OAIG;IACH,IAAW,MAAM,IAAI,OAAO,CAG3B;IAED;;;;OAIG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED;;;;OAIG;IACH,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED;;;;OAIG;IACH,IAAW,kBAAkB,IAAI,OAAO,CAIvC;IAED;;OAEG;IACH,IAAW,0BAA0B,IAAI,MAAM,CAE9C;IAED;;OAEG;IACH,IAAW,8BAA8B,IAAI,MAAM,CAElD;IAED;;;OAGG;IACH,IAAW,eAAe,IAAI,sBAAsB,CAsDnD;CACJ","file":"server-inventory.d.ts","sourcesContent":["import { AzureArcStatusEnum } from '../../azure/models/azureArcStatusEnum';\r\nimport { PowerShellSessionRequestOptions } from '../../data/powershell';\r\nimport { MediaConversion, MediaConversionBase } from '../../data/units';\r\n\r\n/**\r\n * Server Inventory query parameters.\r\n */\r\nexport interface ServerInventoryParams {\r\n /**\r\n * name of server node.\r\n */\r\n name: string;\r\n\r\n /**\r\n * options for PowerShell session request.\r\n */\r\n requestOptions?: PowerShellSessionRequestOptions;\r\n}\r\n\r\n/**\r\n * Windows Operating Systems\r\n */\r\nexport enum WindowsOperatingSystem {\r\n Unknown = 0,\r\n Legacy = 1, // XP, Server 2003, Windows NT, etc.\r\n WindowsVista = 2,\r\n Windows7 = 3,\r\n WindowsServer2008 = 4,\r\n WindowsServer2008R2 = 5,\r\n Windows8 = 6,\r\n WindowsServer2012 = 7,\r\n Windows8Point1 = 8,\r\n WindowsServer2012R2 = 9,\r\n Windows10 = 10,\r\n WindowsServer2016 = 11,\r\n WindowsServer2019 = 12\r\n}\r\n\r\n/**\r\n * Windows Product Types\r\n */\r\nexport enum WindowsProductType {\r\n Workstation = 1,\r\n DomainController = 2,\r\n Server = 3\r\n}\r\n\r\n/**\r\n * Smbios Info\r\n */\r\nexport interface SmbiosData {\r\n /**\r\n * indicator of the Serial Number assigned from Company and is accessible on exterior of device.\r\n */\r\n serialNumber: string;\r\n /**\r\n * identifies the company brand name under which the device is marketed to the end user.\r\n */\r\n manufacturer: string;\r\n /**\r\n * This is a unique value and is intended to be associated with this specific machine.\r\n * This can be null depending on the machine\r\n */\r\n uuid: string;\r\n /**\r\n * identifies the baseboard and should accurately reflect\r\n * variances in baseboards across different devices in the same family and product name.\r\n * This can be null depending on the machine\r\n */\r\n baseBoardProduct: string;\r\n /**\r\n * physical frames or structures of a machine\r\n */\r\n chassis: string[];\r\n /**\r\n * Types of Chassis defined in the specification.\r\n */\r\n chassisTypes: string[];\r\n /**\r\n * identifies the company sub-brand name, specific to a grouping of similar devices known as a product line,\r\n * under which the device is marketed to end users\r\n */\r\n systemFamily: string;\r\n /**\r\n * identifies the device in a format that can be determined by Company.\r\n */\r\n systemSkuNumber: string;\r\n\r\n /**\r\n * Asset tag number of the system enclosure\r\n */\r\n smBiosAssetTag: string;\r\n}\r\n\r\n/**\r\n * The address entry for address list.\r\n */\r\nexport interface ServerInventoryAddressEntry {\r\n ipAddress: string;\r\n addressFamily: 'InterNetwork' | 'InterNetworkV6';\r\n}\r\n\r\n/**\r\n * Server Inventory data interface.\r\n */\r\nexport interface ServerInventoryData {\r\n /**\r\n * The server name.\r\n */\r\n serverName: string;\r\n\r\n /**\r\n * The name of server. (CSName/OperatingSystem)\r\n */\r\n name: string;\r\n\r\n /**\r\n * The domain name of server. (Domain/ComputerSystem)\r\n */\r\n domainName: string;\r\n\r\n /**\r\n * The workgroup name of server if any. (Workgroup/ComputerSystem)\r\n */\r\n workgroupName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem)\r\n */\r\n fullyQualifiedDomainName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem) Not lower cased.\r\n */\r\n fullyQualifiedDomainNameRaw: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer.\r\n */\r\n hostname: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer. Not lower cased.\r\n */\r\n hostnameRaw: string;\r\n\r\n /**\r\n * The NetBios name which might be trimmed by 15 characters.\r\n */\r\n netBios: string;\r\n\r\n /**\r\n * The IP address list.\r\n */\r\n addressList: ServerInventoryAddressEntry[];\r\n\r\n /**\r\n * The operating system name of server. (Caption/OperatingSystem)\r\n */\r\n operatingSystemName: string;\r\n\r\n /**\r\n * The operating system name of server. (SKU/OperatingSystem)\r\n */\r\n operatingSystemSKU: number;\r\n\r\n /**\r\n * The operating system version of server. (Version/OperatingSystem)\r\n */\r\n operatingSystemVersion: string;\r\n\r\n /**\r\n * The total size of physical memory.\r\n */\r\n totalPhysicalMemory: number;\r\n\r\n /**\r\n * The domain role.\r\n */\r\n domainRole: number;\r\n\r\n /**\r\n * The windows product type.\r\n */\r\n productType: WindowsProductType;\r\n\r\n /**\r\n * The computer manufacturer.\r\n */\r\n computerManufacturer: string;\r\n\r\n /**\r\n * The computer model.\r\n */\r\n computerModel: string;\r\n\r\n /**\r\n * The number of logical processors.\r\n */\r\n totalLogicalProcessors: number;\r\n\r\n /**\r\n * Indicating if the server has ManagementTools namespace to support TaskManager provider.\r\n */\r\n isManagementToolsAvailable: boolean;\r\n\r\n /**\r\n * Indicating if the computer has ServerManager namespace to support ServerManager provider.\r\n */\r\n isServerManagerAvailable: boolean;\r\n\r\n /**\r\n * Whether or not Windows Management Framework v5.0 or higher is installed.\r\n */\r\n isWmfInstalled: boolean;\r\n\r\n /**\r\n * Indicating if the server node is a part of Microsoft Cluster.\r\n */\r\n isCluster: boolean;\r\n\r\n /**\r\n * The FQDN of Microsoft Cluster if it's a part of Microsoft Cluster.\r\n */\r\n clusterFqdn: string;\r\n\r\n /**\r\n * Indicating if current user is a member of administrators group.\r\n */\r\n isAdministrator: boolean;\r\n\r\n /**\r\n * Indicates if the node has S2D enabled\r\n */\r\n isS2dEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the node has Britannica enabled\r\n */\r\n isBritannicaEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v role is installed\r\n */\r\n isHyperVRoleInstalled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v powershell feature is installed\r\n */\r\n isHyperVPowershellInstalled: boolean;\r\n\r\n /**\r\n * Indicates if CredSSP is enabled.\r\n */\r\n isCredSSPEnabled: boolean;\r\n\r\n /**\r\n * Indicating if remote app enabled.\r\n */\r\n isRemoteAppEnabled: boolean;\r\n\r\n /**\r\n * SMBIOS Data\r\n */\r\n smbiosData: SmbiosData;\r\n\r\n /**\r\n * The system lockdown policy enforcement mode.\r\n */\r\n systemLockdownPolicy: string;\r\n\r\n /**\r\n * Type of operating system value\r\n */\r\n osType: string;\r\n\r\n /**\r\n * Product name that a manufacturer gives to a computer\r\n */\r\n model: string;\r\n\r\n /**\r\n * Last reboot time\r\n */\r\n lastBootUpTime: string;\r\n\r\n /**\r\n * The status of the azure arc in the server\r\n * i.e connectioned, disconnected etc\r\n */\r\n azureArcStatus: AzureArcStatusEnum;\r\n\r\n /**\r\n * The operating system build number\r\n */\r\n buildNumber: string;\r\n\r\n /**\r\n * The operating system update build revision\r\n */\r\n updateBuildRevision: number;\r\n\r\n /**\r\n * The operating system display version eg: 22H2\r\n */\r\n operatingSystemDisplayVersion: string;\r\n\r\n /**\r\n * Indicating if the server is HCI.\r\n */\r\n isHciServer: boolean;\r\n}\r\n\r\n/**\r\n * Server Inventory class.\r\n */\r\nexport class ServerInventory implements ServerInventoryData {\r\n private static nanoDisplayFormat = '{0} Nano';\r\n private static server19PreviewBuildNumber = 17623;\r\n\r\n /*\r\n * OperatingSystemSKU: from https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx\r\n * PRODUCT_DATACENTER_NANO_SERVER (143)\r\n * Windows Server Datacenter Edition (Nano Server installation)\r\n * PRODUCT_STANDARD_NANO_SERVER (144)\r\n * Windows Server Standard Edition (Nano Server installation)\r\n */\r\n private static nanoServerSkus: number[] = [143, 144];\r\n\r\n /**\r\n * The name of server. (CSName/OperatingSystem)\r\n */\r\n public name: string;\r\n\r\n /**\r\n * The domain name of server. (Domain/ComputerSystem)\r\n */\r\n public domainName: string;\r\n\r\n /**\r\n * The workgroup name of server if any. (Workgroup/ComputerSystem)\r\n */\r\n public workgroupName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem)\r\n */\r\n public fullyQualifiedDomainName: string;\r\n\r\n /**\r\n * The FQDN of server if any. (ComputerSystem) Not lower cased.\r\n */\r\n public fullyQualifiedDomainNameRaw: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer.\r\n */\r\n public hostname: string;\r\n\r\n /**\r\n * The hostname of computer which was configured on the computer. Not lower cased.\r\n */\r\n public hostnameRaw: string;\r\n\r\n /**\r\n * The NetBios name which might be trimmed by 15 characters.\r\n */\r\n public netBios: string;\r\n\r\n /**\r\n * The IP address list.\r\n */\r\n public addressList: ServerInventoryAddressEntry[];\r\n\r\n /**\r\n * The operating system name of server. (Caption/OperatingSystem)\r\n */\r\n public operatingSystemName: string;\r\n\r\n /**\r\n * The operating system name of server. (SKU/OperatingSystem)\r\n */\r\n public operatingSystemSKU: number;\r\n\r\n /**\r\n * The operating system version of server. (Version/OperatingSystem)\r\n */\r\n public operatingSystemVersion: string;\r\n\r\n /**\r\n * The total size of physical memory.\r\n */\r\n public totalPhysicalMemory: number;\r\n\r\n /**\r\n * The domain role.\r\n */\r\n public domainRole: number;\r\n\r\n /**\r\n * The windows product type.\r\n */\r\n public productType: WindowsProductType;\r\n\r\n /**\r\n * The computer manufacturer.\r\n */\r\n public computerManufacturer: string;\r\n\r\n /**\r\n * The computer model.\r\n */\r\n public computerModel: string;\r\n\r\n /**\r\n * The number of logical processors.\r\n */\r\n public totalLogicalProcessors: number;\r\n\r\n /**\r\n * Indicating if the server has ManagementTools namespace to support TaskManager provider.\r\n */\r\n public isManagementToolsAvailable: boolean;\r\n\r\n /**\r\n * Indicating if the computer has ServerManager namespace to support ServerManager provider.\r\n */\r\n public isServerManagerAvailable: boolean;\r\n\r\n /**\r\n * Whether or not Windows Management Framework v5.0 or higher is installed.\r\n */\r\n public isWmfInstalled: boolean;\r\n\r\n /**\r\n * Indicating if the server node is a part of Microsoft Cluster.\r\n */\r\n public isCluster: boolean;\r\n\r\n /**\r\n * The FQDN of Microsoft Cluster if it's a part of Microsoft Cluster.\r\n */\r\n public clusterFqdn: string;\r\n\r\n /**\r\n * Indicating if current user is a member of administrators group.\r\n */\r\n public isAdministrator: boolean;\r\n\r\n /**\r\n * Indicates if the node has S2D enabled\r\n */\r\n public isS2dEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the node has Britannica enabled\r\n */\r\n public isBritannicaEnabled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v role is installed\r\n */\r\n public isHyperVRoleInstalled: boolean;\r\n\r\n /**\r\n * Indicates if the hyper-v powershell feature is installed\r\n */\r\n public isHyperVPowershellInstalled: boolean;\r\n\r\n /**\r\n * Indicates if CredSSP is enabled.\r\n */\r\n public isCredSSPEnabled: boolean;\r\n\r\n /**\r\n * Indicating if remote app enabled.\r\n */\r\n public isRemoteAppEnabled: boolean;\r\n\r\n /**\r\n * SMBIOS Data\r\n */\r\n public smbiosData: SmbiosData;\r\n\r\n /**\r\n * The system lockdown policy enforcement mode.\r\n */\r\n public systemLockdownPolicy: string;\r\n\r\n /**\r\n * Type of operating system value\r\n */\r\n public osType: string;\r\n\r\n /**\r\n * Product name that a manufacturer gives to a computer\r\n */\r\n public model: string;\r\n\r\n /**\r\n * Last reboot time\r\n */\r\n public lastBootUpTime: string;\r\n\r\n /**\r\n * The status of the azure arc in the server\r\n * i.e connectioned, disconnected etc\r\n */\r\n azureArcStatus: AzureArcStatusEnum;\r\n\r\n /*\r\n * Operating system serial number\r\n */\r\n osSerialNumber: string;\r\n\r\n /**\r\n * The operating system build number\r\n */\r\n public buildNumber: string;\r\n\r\n /**\r\n * The operating system update build revision\r\n */\r\n public updateBuildRevision: number;\r\n\r\n /**\r\n * The operating system display version eg: 22H2\r\n */\r\n public operatingSystemDisplayVersion: string;\r\n\r\n /**\r\n * Indicating if the server is HCI.\r\n */\r\n public isHciServer: boolean;\r\n\r\n /**\r\n * Initializes a new instance of the ServerInventory Class.\r\n *\r\n * @param serverName the server name to query.\r\n * @param data the server inventory recovered data.\r\n */\r\n constructor(public serverName: string, data?: ServerInventoryData) {\r\n if (data) {\r\n Object.assign(this, data);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the sku number indicating whether the computer is Nano server.\r\n *\r\n * @return boolean true if nano\r\n */\r\n public get isNano(): boolean {\r\n // given sku number is in nanoServerSkus array?\r\n return ServerInventory.nanoServerSkus.indexOf(this.operatingSystemSKU) > -1;\r\n }\r\n\r\n /**\r\n * Gets a value indicating if this is a windows server\r\n *\r\n * @return boolean true if this is a server\r\n */\r\n public get isServer(): boolean {\r\n return this.productType === WindowsProductType.Server;\r\n }\r\n\r\n /**\r\n * Gets a value indicating if this is a windows client\r\n *\r\n * @return boolean true if this is a client\r\n */\r\n public get isClient(): boolean {\r\n return this.productType === WindowsProductType.Workstation;\r\n }\r\n\r\n /**\r\n * Indicates whether the computer is domain controller or not.\r\n *\r\n * @return boolean true if domain controller\r\n */\r\n public get isDomainController(): boolean {\r\n // As per https://msdn.microsoft.com/en-us/library/windows/desktop/aa394102(v=vs.85)\r\n // domainRole of 4 or 5 means it's a domain controller.\r\n return (this.domainRole === 4 || this.domainRole === 5);\r\n }\r\n\r\n /**\r\n * Gets the display name of operating system.\r\n */\r\n public get operatingSystemDisplayName(): string {\r\n return this.isNano ? ServerInventory.nanoDisplayFormat.format(this.operatingSystemName) : this.operatingSystemName;\r\n }\r\n\r\n /**\r\n * Gets the display name of total physical memory.\r\n */\r\n public get totalPhysicalMemoryDisplayName(): string {\r\n return MediaConversion.getConvertedValue(this.totalPhysicalMemory, MediaConversionBase.Binary);\r\n }\r\n\r\n /**\r\n * Gets the operating system enumb of the machine\r\n * see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx for operating system version mapping.\r\n */\r\n public get operatingSystem(): WindowsOperatingSystem {\r\n\r\n if (!this.operatingSystemVersion) {\r\n return WindowsOperatingSystem.Unknown;\r\n }\r\n\r\n // windows 10, server 2016, and server 2019\r\n // report anything newer as one of these options.\r\n if (this.operatingSystemVersion.indexOf('.') > 1) {\r\n // since . is more than 2 digits from the start of the screen we are going to assume its '10.', '11.', etc...\r\n if (this.isServer) {\r\n if (+this.operatingSystemVersion.split('.').last() >= ServerInventory.server19PreviewBuildNumber) {\r\n // 17623 first insiders preview of 2019\r\n return WindowsOperatingSystem.WindowsServer2019;\r\n } else {\r\n // 14393 official release version of 2016\r\n // fall back to 2016 for versions between 14393 and 17623\r\n return WindowsOperatingSystem.WindowsServer2016;\r\n }\r\n } else {\r\n return WindowsOperatingSystem.Windows10;\r\n }\r\n }\r\n\r\n // windows 8.1 and server 2012r2\r\n if (this.operatingSystemVersion.startsWith('6.3')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2012R2\r\n : WindowsOperatingSystem.Windows8Point1;\r\n }\r\n\r\n // windows 8 and server 2012\r\n if (this.operatingSystemVersion.startsWith('6.2')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2012\r\n : WindowsOperatingSystem.Windows8;\r\n }\r\n\r\n // windows 7 and server 2008 R2\r\n if (this.operatingSystemVersion.startsWith('6.1')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2008R2\r\n : WindowsOperatingSystem.Windows7;\r\n }\r\n\r\n // windows vista and server 2008\r\n if (this.operatingSystemVersion.startsWith('6.0')) {\r\n return this.isServer\r\n ? WindowsOperatingSystem.WindowsServer2008\r\n : WindowsOperatingSystem.WindowsVista;\r\n }\r\n\r\n // assume a legacy os that somehow was able to run powershell.(unlikely)\r\n return WindowsOperatingSystem.Legacy;\r\n }\r\n}\r\n"]}
|
|
@@ -167,9 +167,9 @@ export class ServerInventory {
|
|
|
167
167
|
*/
|
|
168
168
|
smbiosData;
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
170
|
+
* The system lockdown policy enforcement mode.
|
|
171
171
|
*/
|
|
172
|
-
|
|
172
|
+
systemLockdownPolicy;
|
|
173
173
|
/**
|
|
174
174
|
* Type of operating system value
|
|
175
175
|
*/
|