@microsoft/windows-admin-center-sdk 2.296.0 → 2.298.1

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.
Files changed (147) hide show
  1. package/angular/assets/strings/cs-CZ/strings.json +1 -1
  2. package/angular/assets/strings/de-DE/strings.json +1 -1
  3. package/angular/assets/strings/es-ES/strings.json +1 -1
  4. package/angular/assets/strings/fr-FR/strings.json +1 -1
  5. package/angular/assets/strings/hu-HU/strings.json +1 -1
  6. package/angular/assets/strings/it-IT/strings.json +1 -1
  7. package/angular/assets/strings/ja-JP/strings.json +1 -1
  8. package/angular/assets/strings/ko-KR/strings.json +1 -1
  9. package/angular/assets/strings/nl-NL/strings.json +1 -1
  10. package/angular/assets/strings/pl-PL/strings.json +1 -1
  11. package/angular/assets/strings/pt-BR/strings.json +1 -1
  12. package/angular/assets/strings/pt-PT/strings.json +1 -1
  13. package/angular/assets/strings/ru-RU/strings.json +1 -1
  14. package/angular/assets/strings/strings.json +1 -1
  15. package/angular/assets/strings/sv-SE/strings.json +1 -1
  16. package/angular/assets/strings/tr-TR/strings.json +1 -1
  17. package/angular/assets/strings/zh-CN/strings.json +1 -1
  18. package/angular/assets/strings/zh-TW/strings.json +1 -1
  19. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js +558 -240
  20. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js.map +1 -1
  21. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js +2 -2
  22. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js.map +1 -1
  23. package/angular/esm2015/src/controls/actions/containers/action-bar/action-bar.component.js +7 -2
  24. package/angular/esm2015/src/controls/alert-bar/alert-bar.component.js +5 -5
  25. package/angular/esm2015/src/controls/common/base.component.js +8 -1
  26. package/angular/esm2015/src/controls/data-table/data-table.component.js +39 -9
  27. package/angular/esm2015/src/controls/form/form-field/checklist/checklist-form-field.component.js +11 -8
  28. package/angular/esm2015/src/controls/form/form-field/combobox/combobox-form-field.component.js +8 -9
  29. package/angular/esm2015/src/controls/form/form-field/file/file-form-field.component.js +14 -2
  30. package/angular/esm2015/src/controls/form/form-field/form-field.component.js +9 -2
  31. package/angular/esm2015/src/controls/layout/layout-definition.component.js +9 -2
  32. package/angular/esm2015/src/controls/layout/layout.component.js +11 -2
  33. package/angular/esm2015/src/controls/master-view/master-view.component.js +32 -5
  34. package/angular/esm2015/src/controls/page-alert-bar/models/index.js +1 -1
  35. package/angular/esm2015/src/controls/pivot/pivot.component.js +11 -5
  36. package/angular/esm2015/src/controls/property-grid/property-grid-item.component.js +50 -2
  37. package/angular/esm2015/src/controls/property-grid/property-grid.component.js +73 -60
  38. package/angular/esm2015/src/controls/property-grid/property-grid.module.js +5 -1
  39. package/angular/esm2015/src/controls/settings/common-settings/common-settings.component.js +151 -70
  40. package/angular/esm2015/src/controls/settings/settings.component.js +48 -8
  41. package/angular/esm2015/src/controls/settings/settings.module.js +21 -9
  42. package/angular/esm2015/src/controls/wizard/wizard.component.js +55 -65
  43. package/angular/esm2015/src/generated/strings.js +1 -1
  44. package/angular/esm2015/src/service/app-context.service.js +3 -1
  45. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js +535 -240
  46. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js.map +1 -1
  47. package/angular/package.json +2 -0
  48. package/angular/src/controls/common/base.component.d.ts +5 -0
  49. package/angular/src/controls/data-table/data-table.component.d.ts +15 -0
  50. package/angular/src/controls/form/form-field/checklist/checklist-form-field.component.d.ts +1 -0
  51. package/angular/src/controls/form/form-field/file/file-form-field.component.d.ts +4 -0
  52. package/angular/src/controls/layout/layout-definition.component.d.ts +6 -1
  53. package/angular/src/controls/master-view/master-view.component.d.ts +118 -2
  54. package/angular/src/controls/page-alert-bar/models/index.d.ts +1 -1
  55. package/angular/src/controls/pivot/pivot.component.d.ts +4 -1
  56. package/angular/src/controls/property-grid/property-grid-item.component.d.ts +53 -3
  57. package/angular/src/controls/property-grid/property-grid.component.d.ts +1 -2
  58. package/angular/src/controls/property-grid/property-grid.module.d.ts +4 -3
  59. package/angular/src/controls/settings/common-settings/common-settings.component.d.ts +32 -1
  60. package/angular/src/controls/settings/settings.component.d.ts +18 -1
  61. package/angular/src/controls/settings/settings.module.d.ts +3 -1
  62. package/angular/src/generated/strings.d.ts +3 -0
  63. package/core/base/environment.d.ts +10 -0
  64. package/core/base/environment.js.map +1 -1
  65. package/core/data/gateway-connection.d.ts +34 -0
  66. package/core/data/gateway-connection.js +59 -2
  67. package/core/data/gateway-connection.js.map +1 -1
  68. package/core/data/gateway-status.d.ts +24 -0
  69. package/core/data/gateway-status.js +3 -0
  70. package/core/data/gateway-status.js.map +1 -0
  71. package/core/data/node-connection.d.ts +4 -0
  72. package/core/data/node-connection.js.map +1 -1
  73. package/core/data/powershell.d.ts +4 -0
  74. package/core/data/powershell.js +1 -0
  75. package/core/data/powershell.js.map +1 -1
  76. package/core/data/wdac-operations.d.ts +123 -0
  77. package/core/data/wdac-operations.js +144 -0
  78. package/core/data/wdac-operations.js.map +1 -0
  79. package/core/diagnostics/sme-web-telemetry-models.d.ts +20 -3
  80. package/core/diagnostics/sme-web-telemetry-models.js +6 -2
  81. package/core/diagnostics/sme-web-telemetry-models.js.map +1 -1
  82. package/core/diagnostics/sme-web-telemetry.d.ts +13 -1
  83. package/core/diagnostics/sme-web-telemetry.js +51 -11
  84. package/core/diagnostics/sme-web-telemetry.js.map +1 -1
  85. package/core/generated/powershell-scripts.d.ts +8 -4
  86. package/core/generated/powershell-scripts.js +8 -4
  87. package/core/generated/powershell-scripts.js.map +1 -1
  88. package/core/index.d.ts +2 -0
  89. package/core/index.js +1 -0
  90. package/core/index.js.map +1 -1
  91. package/core/manifest/environment-modules.js +10 -0
  92. package/core/manifest/environment-modules.js.map +1 -1
  93. package/core/notification/powershell-notification.js +1 -1
  94. package/core/notification/powershell-notification.js.map +1 -1
  95. package/core/performance/performance-tracker.d.ts +67 -0
  96. package/core/performance/performance-tracker.js +211 -4
  97. package/core/performance/performance-tracker.js.map +1 -1
  98. package/core/rpc/credssp/rpc-credssp-model.d.ts +27 -2
  99. package/core/rpc/credssp/rpc-credssp-model.js +10 -0
  100. package/core/rpc/credssp/rpc-credssp-model.js.map +1 -1
  101. package/core/security/credssp-manager.d.ts +15 -1
  102. package/core/security/credssp-manager.js +28 -0
  103. package/core/security/credssp-manager.js.map +1 -1
  104. package/core/shared/gateway-inventory/gateway-inventory.d.ts +10 -0
  105. package/core/shared/gateway-inventory/gateway-inventory.js +11 -0
  106. package/core/shared/gateway-inventory/gateway-inventory.js.map +1 -1
  107. package/e2e/assets/strings/cs-CZ/strings.json +1 -1
  108. package/e2e/assets/strings/de-DE/strings.json +1 -1
  109. package/e2e/assets/strings/es-ES/strings.json +1 -1
  110. package/e2e/assets/strings/fr-FR/strings.json +1 -1
  111. package/e2e/assets/strings/hu-HU/strings.json +1 -1
  112. package/e2e/assets/strings/it-IT/strings.json +1 -1
  113. package/e2e/assets/strings/ja-JP/strings.json +1 -1
  114. package/e2e/assets/strings/ko-KR/strings.json +1 -1
  115. package/e2e/assets/strings/nl-NL/strings.json +1 -1
  116. package/e2e/assets/strings/pl-PL/strings.json +1 -1
  117. package/e2e/assets/strings/pt-BR/strings.json +1 -1
  118. package/e2e/assets/strings/pt-PT/strings.json +1 -1
  119. package/e2e/assets/strings/ru-RU/strings.json +1 -1
  120. package/e2e/assets/strings/strings.json +1 -1
  121. package/e2e/assets/strings/sv-SE/strings.json +1 -1
  122. package/e2e/assets/strings/tr-TR/strings.json +1 -1
  123. package/e2e/assets/strings/zh-CN/strings.json +1 -1
  124. package/e2e/assets/strings/zh-TW/strings.json +1 -1
  125. package/package.json +5 -3
  126. package/styles/css/main.css +1 -1
  127. package/tools/module-template/gulpfile.ts/index.ts +1 -1
  128. package/tools/package-lock.json +18081 -4110
  129. package/tools/wac-cli/src/create/main.d.ts +6 -3
  130. package/tools/wac-cli/src/create/main.js +87 -35
  131. package/tools/wac-cli/src/create/main.js.map +1 -1
  132. package/tools/wac-cli/src/index.js +2 -2
  133. package/tools/wac-cli/src/index.js.map +1 -1
  134. package/tools/wac-cli/templates/internal/npmrc.txt +6 -0
  135. package/tools/wac-cli/templates/internal/package.json +101 -0
  136. package/tools/wac-cli/templates/{manifest/solution-manifest.json → solution/manifest.json} +19 -0
  137. package/tools/wac-cli/templates/solution/strings.resjson +16 -0
  138. package/tools/wac-cli/templates/wac-template/angular.json +2 -2
  139. package/tools/wac-cli/templates/wac-template/gulpfile.ts/config-data.ts +1 -1
  140. package/tools/wac-cli/templates/wac-template/package.json +0 -8
  141. package/tools/wac-cli/templates/wac-template/src/app/app-routing.module.ts +1 -1
  142. package/tools/wac-cli/templates/wac-template/src/main.ts +2 -0
  143. package/tools/wac-cli/templates/{manifest/tool-manifest.json → wac-template/src/manifest.json} +0 -0
  144. package/tools/wac-cli/templates/wac-template/src/polyfills.ts +1 -1
  145. package/tools/wac-cli/templates/wac-template/src/test.ts +2 -2
  146. package/tools/wac-cli/templates/wac-template/src/version.ts +3 -0
  147. package/tools/wac-cli/templates/wac-template/version.json +5 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/manifest/environment-modules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AA0FjD;;GAEG;AACH,MAAM,CAAN,IAAY,+BAUX;AAVD,WAAY,+BAA+B;IACvC,4EAAyC,CAAA;IACzC,wDAAqB,CAAA;IACrB,gDAAa,CAAA;IACb,sDAAmB,CAAA;IACnB,gEAA6B,CAAA;IAC7B,kEAA+B,CAAA;IAC/B,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;AACrB,CAAC,EAVW,+BAA+B,KAA/B,+BAA+B,QAU1C;AAqYD;;GAEG;AACH,MAAM,CAAN,IAAY,mBAEX;AAFD,WAAY,mBA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CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;eAChE,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YACvG,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;;AAn1BuB,+BAAa,GAAG,gBAAgB,CAAC;AAEzD;;GAEG;AACY,+BAAa,GAAsD,IAAI,CAAC;AAOvF;;GAEG;AACY,gCAAc,GAAqC,IAAI,CAAC;AAEvE;;GAEG;AACW,6BAAW,GAAG,gBAAgB,CAAC;AAE7C;;GAEG;AACW,kCAAgB,GAAG,eAAe,CAAC;AAEjD;;GAEG;AACW,+BAAa,GAAG,WAAW,CAAC;AAE1C;;GAEG;AACW,gCAAc,GAAkC,IAAI,CAAC;AAEnE;;GAEG;AACW,mCAAiB,GAAqD,IAAI,CAAC;AAEzF;;GAEG;AACW,iCAAe,GAAmD,IAAI,CAAC;AAErF;;GAEG;AACW,qCAAmB,GAAsB,IAAI,CAAC;AAE5D;;GAEG;AACW,wCAAsB,GAAyC,IAAI,CAAC;AAElF;;GAEG;AACW,sCAAoB,GAAuC,IAAI,CAAC;AAE9E;;GAEG;AACW,kCAAgB,GAAgB,IAAI,CAAC","file":"environment-modules.js","sourcesContent":["import { PowerShellCommand } from '../data/powershell';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { LogRecord } from '../diagnostics/log-record';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\n\r\n/**\r\n * Defines an object or property for other extensions to reference\r\n */\r\nexport interface EnvironmentModulePropertyDescriptor {\r\n /**\r\n * The type of value of this property.\r\n * required if schema is not defined.\r\n */\r\n type?: 'array' | 'boolean' | 'null' | 'object' | 'number' | 'string';\r\n\r\n /**\r\n * A reference to a schema resource defining this property\r\n */\r\n schema?: string;\r\n\r\n /**\r\n * Tells other extension developers more information about this property\r\n */\r\n comment?: string;\r\n\r\n /**\r\n * Indicates if this field is required\r\n */\r\n required?: boolean;\r\n\r\n /**\r\n * The default value of this property\r\n * The type should be of the same type defined in the 'type' property.\r\n */\r\n defaultsTo?: any;\r\n\r\n /**\r\n * The contract for the array items.\r\n * Required if the type property is set to 'array'\r\n */\r\n items?: EnvironmentModulePropertyDescriptor;\r\n\r\n /**\r\n * The contract for the sub properties.\r\n * Required if the type property is set to 'object'\r\n */\r\n properties?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n}\r\n\r\nexport interface EnvironmentModuleDisplayable {\r\n /**\r\n * display name of module\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * description of module\r\n */\r\n description: string;\r\n\r\n /**\r\n * icon url or smeIcon reference. Absolute or relative urls\r\n */\r\n icon: string;\r\n\r\n /**\r\n * The scale of icon. (1.0 is default if not specified)\r\n */\r\n iconScale?: number;\r\n\r\n /**\r\n * The dark theme data. (Optional)\r\n */\r\n darkTheme?: {\r\n /**\r\n * The icon path on the package.\r\n */\r\n icon: string;\r\n\r\n /**\r\n * The scale of icon. (1.0 is default if not specified)\r\n */\r\n iconScale?: number;\r\n };\r\n\r\n\r\n /**\r\n * keywords for module search\r\n */\r\n keywords: string[];\r\n}\r\n\r\n/**\r\n * The type of entry point.\r\n */\r\nexport enum EnvironmentModuleEntryPointType {\r\n ConnectionProvider = 'connectionProvider',\r\n Solution = 'solution',\r\n Tool = 'tool',\r\n Service = 'service',\r\n SettingsForm = 'settingsForm',\r\n GroupProvider = 'groupProvider',\r\n Worker = 'worker',\r\n Dialog = 'dialog',\r\n SnapIn = 'snapIn'\r\n}\r\n\r\n/**\r\n * The type of behavior to solution root navigation.\r\n */\r\nexport type SolutionRootNavigationBehaviorType = 'path' | 'connections' | 'tools';\r\n\r\n/**\r\n * The interface of condition check of server inventory data.\r\n */\r\nexport interface EnvironmentModuleConditionStatement {\r\n /**\r\n * The operator of the condition.\r\n */\r\n operator: 'gt' | 'ge' | 'lt' | 'le' | 'eq' | 'ne' | 'is' | 'not' | 'contains' | 'notContains'\r\n | 'anyEq' | 'anyNe' | 'anyContains' | 'anyNotContains';\r\n\r\n /**\r\n * The data type of value.\r\n */\r\n type: 'version' | 'number' | 'string' | 'boolean' | 'numberArray' | 'stringArray';\r\n\r\n /**\r\n * The test value of the condition.\r\n */\r\n value: string | number | boolean | number[] | string[];\r\n}\r\n\r\n/**\r\n * The mapped inventory conditions.\r\n */\r\nexport type EnvironmentModuleConditionMap = MsftSme.StringMap<EnvironmentModuleConditionStatement>;\r\n\r\n/**\r\n * The requirement of entry point to be activated on the view.\r\n */\r\nexport interface EnvironmentModuleEntryPointRequirement {\r\n /**\r\n * The id of solutions of the connection type that satisfies this requirement.\r\n */\r\n solutionIds?: string[];\r\n\r\n /**\r\n * The id of the connection type that satisfies this requirement\r\n */\r\n connectionTypes?: string[];\r\n\r\n /**\r\n * The conditions of tool status.\r\n */\r\n conditions?: {\r\n /**\r\n * Check if app/desktop localhost. Only tested if it sets \"false\".\r\n */\r\n localhost?: boolean,\r\n\r\n /**\r\n * Check if specific condition against ServerInventory data.\r\n */\r\n inventory?: EnvironmentModuleConditionMap,\r\n\r\n /**\r\n * Check if specific condition against supported installation type data.\r\n */\r\n installationTypes?: string[],\r\n\r\n /**\r\n * Check if specific condition against Connection properties data.\r\n */\r\n properties?: EnvironmentModuleConditionMap,\r\n\r\n /**\r\n * @deprecated\r\n * Check by using PowerShell script.\r\n *\r\n * must return the following format.\r\n * {\r\n * state: 'Available', 'NotConfigured', 'NotSupported'\r\n * message: string\r\n * keyValuePairs: [ { name: string, value: string, type: string } ]\r\n * }\r\n */\r\n script?: string\r\n\r\n /**\r\n * Check by using PowerShell script and command.\r\n *\r\n * must return the following format.\r\n * {\r\n * state: 'Available', 'NotConfigured', 'NotSupported'\r\n * message: string\r\n * keyValuePairs: [ { name: string, value: string, type: string } ]\r\n * }\r\n */\r\n powerShell?: PowerShellCommand;\r\n }[];\r\n}\r\n\r\n/**\r\n * Defines an object that describes the identity of an extension method\r\n */\r\nexport interface ExtensionMethodIdentifier {\r\n /**\r\n * The name of the module in which the extension method can be found\r\n */\r\n module: string;\r\n /**\r\n * The name of the entry point in which the extension method can be found\r\n */\r\n name: string;\r\n /**\r\n * The method to find\r\n */\r\n method: string;\r\n /**\r\n * The version of the method to be found\r\n */\r\n version: number;\r\n}\r\n\r\n\r\n/**\r\n * Defines an object that describes the identity of an extension dialog\r\n */\r\nexport interface ExtensionDialogIdentifier {\r\n /**\r\n * The name of the module in which the extension dialog can be found\r\n */\r\n module: string;\r\n /**\r\n * The name of the entry point of the extension dialog\r\n */\r\n name: string;\r\n /**\r\n * The version of the dialog\r\n */\r\n version: number;\r\n}\r\n\r\nexport interface EnvironmentModuleConnectionStatusProvider {\r\n /**\r\n * If defined, powershell will be used to query a connections status\r\n */\r\n powerShell?: PowerShellCommand;\r\n\r\n /**\r\n * If defined, the gateways REST api will be used to query a connections status\r\n */\r\n relativeGatewayUrl?: string;\r\n\r\n /**\r\n * Specifies to get the connection status from a worker extension method.\r\n * The worker method is expected to take a connection name as its only input\r\n */\r\n worker?: ExtensionMethodIdentifier;\r\n\r\n /**\r\n * Specifies to get the connection status from a service extension method.\r\n * The service method is expected to take a connection name as its only input\r\n */\r\n service?: ExtensionMethodIdentifier;\r\n\r\n /**\r\n * If defined, will be used to look up display strings for the label and description of the status object\r\n */\r\n displayValueMap?: MsftSme.StringMap<string>;\r\n\r\n /**\r\n * If defined, will be used to skip status checks\r\n */\r\n skipStatusCheck?: boolean;\r\n}\r\n\r\nexport interface SolutionConnectionsViewConfiguration {\r\n /**\r\n * List of connections types to show in the view of the connections list\r\n * each entry should be a valid connection type string identifier from any\r\n * modules entrypoints of type @see EnvironmentModuleEntryPointType.ConnectionProvider\r\n */\r\n connectionTypes: string[];\r\n\r\n /**\r\n * The title of the connections list for this solution.\r\n * Optional. A default header will be provided if this field is left out\r\n */\r\n header?: string;\r\n}\r\n\r\nexport interface SolutionToolsViewConfiguration {\r\n /**\r\n * Enables/Disable ths tools menu\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * Sets the title of the tools menu\r\n */\r\n title: string;\r\n\r\n /**\r\n * Sets the title of the search field on the tools menu\r\n */\r\n searchTitle: string;\r\n\r\n\r\n /**\r\n * Indicates the default tool to open if no tool is provided. This value should be the name of an entrypoint in the same module\r\n */\r\n defaultTool: string;\r\n\r\n /**\r\n * The list of known tools that will be displayed at the first section of tool menu.\r\n * 1) entry and group are mandatory.\r\n * 2) create groups and sort members by priority then alphabetical.\r\n * 3) sort the groups by highest priority number in the group members.\r\n * 4) settings creates single group and sort members by priority then alphabetical.\r\n */\r\n predefined: {\r\n /**\r\n * The entry point ID with \"<module name>!<entry point name>\" format.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The group display name.\r\n */\r\n group: string;\r\n\r\n /**\r\n * The ordering priority.\r\n * (0 is highest)\r\n */\r\n priority?: number;\r\n\r\n /**\r\n * Indicating the tool is settings menu.\r\n */\r\n settings?: boolean;\r\n }[];\r\n}\r\n\r\n/**\r\n * Defines the configuration for a connection provider experience\r\n */\r\nexport interface ConnectionProviderExperienceConfiguration {\r\n /**\r\n * The path to the experience.\r\n */\r\n path: string;\r\n\r\n /**\r\n * The label to display for the experience.\r\n * ex) Add Server Connection, Create Failover Cluster Connection and so on.\r\n */\r\n label: string;\r\n\r\n /**\r\n * The dialog mode to use for the dialog that contains this experience\r\n */\r\n dialogMode?: 'normal' | 'wide' | 'compact' | 'fullscreen';\r\n}\r\n\r\n/**\r\n * The type of lifetime to implement when creating a worker\r\n */\r\nexport type WorkerLifetime = 'default' | 'long';\r\n\r\n/**\r\n * The type of startup type to implement when creating a service\r\n */\r\nexport type ServiceStartupType = 'automatic' | 'onDemand';\r\n\r\n/**\r\n * The type of cleanup type to implement when creating a service\r\n * 'never' means that that service will start and only be destroyed if specifically requested or the application ends\r\n * 'onIdle' means that the shell will clean up the service when no one has used it within a certain time limit.\r\n * This time limit is currently controlled by the shell.\r\n */\r\nexport type ServiceCleanupType = 'never' | 'onIdle';\r\n/**\r\n * Defines the target of an entry point\r\n */\r\nexport interface ExtenderDefinition {\r\n /**\r\n * The module to target\r\n */\r\n module: string;\r\n /**\r\n * The name of the extension target (within the 'module') to provide this entry point to\r\n */\r\n target: string;\r\n}\r\n\r\n/**\r\n * Defines the target of a worker entry point\r\n */\r\nexport interface WorkerExtenderDefinition extends ExtenderDefinition {\r\n /**\r\n * A map of method names to the versions that are implemented in this worker\r\n */\r\n methodVersions: MsftSme.StringMap<number>;\r\n}\r\n\r\n/**\r\n * Describes the method contract exposed by a worker for other modules to call.\r\n * When making breaking changes, make sure to use the version properties so dependent modules still work with an older contract\r\n */\r\nexport interface ExtensionMethodContract {\r\n /**\r\n * The version of this method. Create a new version for every breaking change\r\n */\r\n version?: number;\r\n /**\r\n * The name of the method\r\n */\r\n method: string;\r\n /**\r\n * a comment describing this method to consumers\r\n */\r\n comment?: string;\r\n /**\r\n * Defines the arguments expected to be passed to this method\r\n */\r\n arguments?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n /**\r\n * Defines the contract that this method will return\r\n */\r\n returns: EnvironmentModulePropertyDescriptor;\r\n}\r\n\r\n/**\r\n * Describes the declaration for a dialog\r\n * When making breaking changes, make sure to use the version properties so dependent modules still work with an older contract\r\n */\r\nexport interface DialogExtensionDeclaration {\r\n /**\r\n * The version of this method. Create a new version for every breaking change\r\n */\r\n version?: number;\r\n /**\r\n * a comment describing this dialog to consumers\r\n */\r\n comment?: string;\r\n /**\r\n * The dialog mode to use for the dialog\r\n */\r\n dialogMode?: 'pane' | 'wide-pane' | 'compact' | 'compact-square' | 'fullscreen' | 'centered' | 'centered-large';\r\n /**\r\n * Defines the arguments expected to be passed to this method\r\n */\r\n arguments?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n /**\r\n * Defines the contract that this dialog will return\r\n */\r\n returns: EnvironmentModulePropertyDescriptor;\r\n}\r\n\r\n/**\r\n * Define the minimum and maximum footprint of a snap in\r\n */\r\nexport interface SnapInSizeConstraints {\r\n minWidth: number;\r\n minHeight: number;\r\n maxWidth: number;\r\n maxHeight: number;\r\n}\r\n\r\n/**\r\n * Define the component interaction of inputs and outputs between the entry point and its consumer\r\n */\r\nexport interface ExtensionInteraction {\r\n /**\r\n * The version of this interaction. Create a new version for every breaking change\r\n */\r\n version?: number;\r\n /**\r\n * a comment describing this interaction model\r\n */\r\n comment?: string;\r\n /**\r\n * Defines the inputs that can be passed to this entry point\r\n */\r\n inputs?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n /**\r\n * Defines the outputs that this entry point can return\r\n */\r\n outputs?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n}\r\n\r\n/**\r\n * The type of lifetime to implement when creating a worker\r\n */\r\nexport enum ExtensionTargetType {\r\n WorkerTarget = 'workerTarget'\r\n}\r\n\r\nexport interface ExtensionTarget {\r\n /**\r\n * The type of extension target\r\n */\r\n extensionTargetType: ExtensionTargetType;\r\n\r\n /**\r\n * Description of the workerTarget.\r\n * This should tell the consumer what workers who target this are expected to do.\r\n */\r\n description: string;\r\n\r\n /**\r\n * The name of this extension target.\r\n * Should be unique to this modules other extension targets\r\n */\r\n name: string;\r\n\r\n /**\r\n * Mapping to the parent module of this target\r\n */\r\n parentModule?: EnvironmentModule;\r\n}\r\n\r\nexport interface WorkerExtensionTarget extends ExtensionTarget {\r\n\r\n /**\r\n * The type of extension target\r\n */\r\n extensionTargetType: ExtensionTargetType.WorkerTarget;\r\n\r\n /**\r\n * worker only -- The contract that is expected to be fulfilled by worker entry points that extend this target\r\n */\r\n contract: ExtensionMethodContract[];\r\n}\r\n\r\n/**\r\n * Defines the provider for collecting active managing as information\r\n */\r\nexport interface ManagingAsProvider {\r\n /**\r\n * If Defined, Specifies to collect managing as data from a worker method\r\n */\r\n worker?: ExtensionMethodIdentifier;\r\n /**\r\n * If Defined, Specifies to collect managing as data from a service method\r\n */\r\n service?: ExtensionMethodIdentifier;\r\n}\r\n\r\n/**\r\n * Defines how to apply manage as scenarios to this connection type\r\n */\r\nexport interface EnvironmentModuleManageAsScheme {\r\n /**\r\n * If Defined, Specifies to configure manage as credentials from an extension dialog\r\n */\r\n configurationDialog: ExtensionDialogIdentifier;\r\n /**\r\n * If Defined, Specifies how to collect active managing as data\r\n */\r\n managingAsProvider: ManagingAsProvider;\r\n}\r\n\r\n/**\r\n * Defines a modules entry point\r\n */\r\nexport interface EnvironmentModuleEntryPoint extends EnvironmentModuleDisplayable {\r\n /**\r\n * The type of entry point.\r\n */\r\n entryPointType: EnvironmentModuleEntryPointType;\r\n\r\n /**\r\n * The name of entry point, unique to its parent module\r\n */\r\n name?: string;\r\n\r\n /**\r\n * The friendly url name to use to reference this entrypoint. This must be unique among all entrypoints\r\n */\r\n urlName?: string;\r\n\r\n /**\r\n * The path of entry point.\r\n */\r\n path: string;\r\n\r\n /**\r\n * The frame Id to share single iframe within the module.\r\n */\r\n iframeId?: string;\r\n\r\n /**\r\n * Experiment keys that must all be enabled to enable this entry point\r\n */\r\n experimentKeys?: string[];\r\n\r\n /**\r\n * The id of the group provider.\r\n * Used to indicate which group provider should be used for grouping extensions\r\n */\r\n groupId?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * NOTE: This SHOULD be for SOLUTION types. since a connection type can exist in multiple solutions.\r\n * If true, the search bar will shown the tools list for this connection type\r\n * Otherwise, search bar will be hidden. Default is true.\r\n */\r\n searchBar?: boolean;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * Alternative to providing \"path\".\r\n * Configures the experiences for manipulating the connections provided by this entry point\r\n */\r\n experiences: {\r\n add: ConnectionProviderExperienceConfiguration;\r\n create: ConnectionProviderExperienceConfiguration;\r\n };\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The id of the connection type that this entry point provides\r\n */\r\n connectionType?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The friendly url name to use to reference the connection type that this entry point provides.\r\n * This must be unique among all connection types\r\n */\r\n connectionTypeUrlName?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The display name of the connection type that this entry point provides\r\n */\r\n connectionTypeName?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The default solution to use when opening the connection type that this entry point provides\r\n */\r\n connectionTypeDefaultSolution?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The status provider implementation for the connection type that this entry point provides\r\n */\r\n connectionStatusProvider?: EnvironmentModuleConnectionStatusProvider;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The manage as scheme to use for changing how the connection is managed\r\n */\r\n manageAsScheme?: EnvironmentModuleManageAsScheme;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Tool types only.\r\n * A list of requirements, if any requirement is met then this tool is applicable to a given connection\r\n */\r\n requirements?: EnvironmentModuleEntryPointRequirement[];\r\n\r\n /**\r\n * Mapping to the parent module of this entry point\r\n */\r\n parentModule?: EnvironmentModule;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Solution types only.\r\n * Defines how navigating to the root of this solution will behave.\r\n * Setting this to 'path' will load this module to the 'path' property.\r\n * Setting this to 'connections' will navigate instead to the connections list, customized for this solution\r\n */\r\n rootNavigationBehavior?: SolutionRootNavigationBehaviorType;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Solution types only.\r\n * Only applicable when 'rootNavigationBehavior' us set to 'connections'.\r\n * Describes how to customize the view of the connections list.\r\n */\r\n connections?: SolutionConnectionsViewConfiguration;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Solution types only. If provided, Configures the tools menu for this solution.\r\n */\r\n tools?: SolutionToolsViewConfiguration;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Worker types only. If provided, Configures the lifetime of this worker.\r\n */\r\n lifetime?: WorkerLifetime;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Service types only. If provided, Configures the startup type of this service.\r\n */\r\n startupType?: ServiceStartupType;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Service types only. If provided, Configures the cleanup of this service.\r\n */\r\n cleanupType?: ServiceCleanupType;\r\n\r\n /**\r\n * Defines specific extensionTargets to provide this entry point to\r\n */\r\n extends?: ExtenderDefinition[];\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Worker and @see EnvironmentModuleEntryPointType.Service types only.\r\n * Describes the method contracts exposed by this worker or service for other modules to call.\r\n */\r\n exposes?: ExtensionMethodContract[];\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Dialog types only\r\n * Defines the declaration for this dialog - inputs and outputs.\r\n */\r\n declaration?: DialogExtensionDeclaration[];\r\n\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.SnapIn types only\r\n * Defines the size requirements for this snap in\r\n */\r\n sizeConstrains?: SnapInSizeConstraints;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.SnapIn types only\r\n * Defines the component interaction model for the snap in\r\n */\r\n interaction?: ExtensionInteraction;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.SnapIn types only\r\n * Defines the author of the snap in.\r\n */\r\n author?: string;\r\n}\r\n\r\n/**\r\n * The state definition of Tool condition.\r\n */\r\nexport enum EnvironmentModuleToolState {\r\n /**\r\n * Tool is available on the connection.\r\n */\r\n Available,\r\n\r\n /**\r\n * Tool is not available because it's not configured properly.\r\n */\r\n NotConfigured,\r\n\r\n /**\r\n * Tool it not supported on the connection.\r\n */\r\n NotSupported\r\n}\r\n\r\n/**\r\n * The result of Tool conditions.\r\n */\r\nexport interface EnvironmentModuleToolConditionResult {\r\n /**\r\n * Display the tool.\r\n */\r\n show: boolean;\r\n\r\n /**\r\n * The connection id of node.\r\n */\r\n connectionId?: string;\r\n\r\n /**\r\n * The state of tool condition.\r\n */\r\n detail?: EnvironmentModuleToolState;\r\n\r\n /**\r\n * The message of condition.\r\n */\r\n message?: string;\r\n}\r\n\r\n/**\r\n * Tool's combined entry point and inventory result.\r\n */\r\nexport interface EnvironmentModuleEntryPointWithToolConditionResult\r\n extends EnvironmentModuleEntryPoint, EnvironmentModuleToolConditionResult {\r\n}\r\n\r\n/**\r\n * Environment module resource class.\r\n */\r\nexport interface EnvironmentModuleResource {\r\n /**\r\n * locale key string.\r\n */\r\n locale: string;\r\n\r\n /**\r\n * string map object.\r\n */\r\n strings: MsftSme.StringMap<string>;\r\n}\r\n\r\nexport const defaultEnvironmentConfiguration: MsftSme.EnvironmentConfiguration = {\r\n gateway: {\r\n disabled: false\r\n },\r\n appBar: {\r\n title: {\r\n hide: false\r\n },\r\n solution: {\r\n hide: false,\r\n hideDropdown: false\r\n },\r\n navigation: {\r\n allowHistory: false,\r\n allowRefresh: false,\r\n allowUrlInput: false,\r\n allowHome: false\r\n },\r\n urlField: {\r\n hideSolutionUrl: true\r\n },\r\n rightMenu: {\r\n showScripts: true,\r\n showSettings: true,\r\n showAbout: true,\r\n showWindowControls: false,\r\n showShareLink: false\r\n },\r\n aboutDialog: {\r\n showFeedback: true,\r\n feedbackLink: 'https://go.microsoft.com/fwlink/?linkid=2033442',\r\n showDocumentation: true,\r\n documentationLink: 'https://go.microsoft.com/fwlink/?linkid=2150525',\r\n releaseNotesLink: 'https://aka.ms/honolulucurrent',\r\n seeMoreReleaseDetailsLink: 'https://go.microsoft.com/fwlink/?linkid=2152971',\r\n showLicense: true,\r\n showScriptsUseRights: true,\r\n showLicenseExtensions: true,\r\n showPrivacyStatement: true,\r\n privacyLink: 'https://aka.ms/winserverprivacy',\r\n showSupportPolicy: true,\r\n supportLink: 'https://aka.ms/wac-support-policy',\r\n showThirdPartyNotice: true,\r\n showShortcuts: true,\r\n openLinkWithoutHref: false\r\n },\r\n overview: {\r\n gatewayStatusUpdateLink: 'settings/updates',\r\n updateLearnMoreLink: 'https://aka.ms/honolulucurrent'\r\n }\r\n },\r\n tools: {\r\n hide: false\r\n },\r\n connections: {\r\n type: 'standard',\r\n header: {\r\n hide: false\r\n }\r\n },\r\n telemetry: {\r\n sourceLibraryCdnLink: 'https://js.monitor.azure.com/scripts/c/ms.analytics-web-3.0.2.min.js',\r\n // Integrity hash generated via srihash.org\r\n sourceLibraryCdnIntegrityHash: 'sha384-ZCsysyTvHb4xqC4BgJSay4nwlNIGlT1w5t5YQS5htghoD2XEL2b4SrkhRPhtr9GD'\r\n },\r\n settings: {\r\n account: {\r\n show: true\r\n },\r\n personalization: {\r\n show: true\r\n },\r\n diagnostic: {\r\n show: true\r\n },\r\n language: {\r\n show: true\r\n },\r\n notification: {\r\n show: true\r\n },\r\n extension: {\r\n show: true\r\n },\r\n azure: {\r\n show: true\r\n },\r\n access: {\r\n show: true\r\n },\r\n sharedConnections: {\r\n show: true\r\n },\r\n general: {\r\n show: true\r\n },\r\n connectivity: {\r\n show: true\r\n },\r\n updates: {\r\n show: true\r\n },\r\n extensionUpdates: {\r\n show: true\r\n },\r\n performance: {\r\n show: true\r\n },\r\n advanced: {\r\n show: true\r\n },\r\n proxy: {\r\n show: true\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Defines an object that provides information about a connection type.\r\n */\r\nexport interface EnvironmentConnectionTypeInfo {\r\n /**\r\n * The provider entry point.\r\n */\r\n provider: EnvironmentModuleEntryPoint;\r\n\r\n /**\r\n * The solution entry point.\r\n */\r\n solution: EnvironmentModuleEntryPoint;\r\n}\r\n\r\nexport interface EnvironmentModuleFriendlyUrlMap {\r\n to: MsftSme.StringMap<string>;\r\n from: MsftSme.StringMap<string>;\r\n}\r\n\r\nexport interface EnvironmentModuleFriendlyUrlMaps {\r\n connectionTypes: EnvironmentModuleFriendlyUrlMap;\r\n solutions: EnvironmentModuleFriendlyUrlMap;\r\n tools: EnvironmentModuleFriendlyUrlMap;\r\n settingsForms: EnvironmentModuleFriendlyUrlMap;\r\n}\r\n\r\n/**\r\n * Environment module class.\r\n */\r\nexport class EnvironmentModule {\r\n private static readonly logSourceName = 'ManifestLoader';\r\n\r\n /**\r\n * Static mapping for connection information.\r\n */\r\n private static connectionMap: { [name: string]: EnvironmentConnectionTypeInfo } = null;\r\n\r\n /**\r\n * Static mapping for extensionTargetTypes to a map of extensionTargetIds to entry point ids that fulfill that target\r\n */\r\n private static extensionTargetFulfillmentMap: MsftSme.StringMap<string[]>;\r\n\r\n /**\r\n * Static mapping for friendly url strings to entrypoint ids\r\n */\r\n private static friendlyUrlMap: EnvironmentModuleFriendlyUrlMaps = null;\r\n\r\n /**\r\n * The name of shell.\r\n */\r\n public static nameOfShell = 'msft.sme.shell';\r\n\r\n /**\r\n * The default signature if missing manifest.\r\n */\r\n public static defaultSignature = 'version 0.0.0';\r\n\r\n /**\r\n * The prefix for identifying an sme-icon reference\r\n */\r\n public static smeIconPrefix = 'sme-icon:';\r\n\r\n /**\r\n * All entry points from all modules\r\n */\r\n public static allEntryPoints: EnvironmentModuleEntryPoint[] = null;\r\n\r\n /**\r\n * All entry points by type\r\n */\r\n public static entryPointsByType: MsftSme.StringMap<EnvironmentModuleEntryPoint[]> = null;\r\n\r\n /**\r\n * All entry points by type\r\n */\r\n public static entryPointsById: MsftSme.StringMap<EnvironmentModuleEntryPoint> = null;\r\n\r\n /**\r\n * All extension targets from all modules\r\n */\r\n public static allExtensionTargets: ExtensionTarget[] = null;\r\n\r\n /**\r\n * All extension targets by type\r\n */\r\n public static extensionTargetsByType: MsftSme.StringMap<ExtensionTarget[]> = null;\r\n\r\n /**\r\n * All extension targets by type\r\n */\r\n public static extensionTargetsById: MsftSme.StringMap<ExtensionTarget> = null;\r\n\r\n /**\r\n * All extension targets by type\r\n */\r\n public static extensionOrigins: Set<String> = null;\r\n\r\n /**\r\n * schema file information.\r\n */\r\n public $schema?: string;\r\n\r\n /**\r\n * name of module.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * display name of module.\r\n */\r\n public displayName: string;\r\n\r\n /**\r\n * description of set of tools.\r\n */\r\n public description?: string;\r\n\r\n /**\r\n * keywords of the module.\r\n */\r\n public keywords?: string[];\r\n\r\n /**\r\n * origin absolute url.\r\n */\r\n public origin: string;\r\n\r\n /**\r\n * target url to open the iframe.\r\n */\r\n public target?: string;\r\n\r\n /**\r\n * signature.\r\n */\r\n public signature: string;\r\n\r\n /**\r\n * The version of this module\r\n */\r\n public version: string;\r\n\r\n /**\r\n * icon url, absolute or relative to Shell url.\r\n */\r\n public icon?: string;\r\n\r\n /**\r\n * The support JEA endpoint with PowerShell module.\r\n */\r\n public jea?: boolean;\r\n\r\n /**\r\n * extension targets for this extension\r\n * Defines things that can be extended in this module.\r\n */\r\n public extensionTargets?: ExtensionTarget[];\r\n\r\n /**\r\n * entry points to launch the tool.\r\n */\r\n public entryPoints: EnvironmentModuleEntryPoint[];\r\n\r\n /**\r\n * Assets shared by the module\r\n */\r\n public assets?: MsftSme.MsftSmeModuleAssets;\r\n\r\n /**\r\n * localized resources of strings.\r\n */\r\n public resources: EnvironmentModuleResource[];\r\n\r\n /**\r\n * Schemas provided for use in this manifest\r\n */\r\n public schemas?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n\r\n /**\r\n * list of all other available modules for shell.\r\n */\r\n public modules?: EnvironmentModule[];\r\n\r\n /**\r\n * Indicates that this module is being sideLoaded\r\n */\r\n public isSideLoaded?: boolean;\r\n\r\n /**\r\n * The Environment configuration\r\n */\r\n public configuration: MsftSme.EnvironmentConfiguration;\r\n\r\n /**\r\n * returns true if the provided origin is a known extension origin\r\n */\r\n public static isExtensionOrigin(origin: string): boolean {\r\n return this.extensionOrigins.has(origin);\r\n }\r\n\r\n /**\r\n * Indicates if a given icon reference is an sme-icon or some other form\r\n * @param iconRef the reference to check\r\n */\r\n public static isSmeIconRef(iconRef: string): boolean {\r\n return (!MsftSme.isNullOrUndefined(iconRef) && iconRef.startsWith(EnvironmentModule.smeIconPrefix));\r\n }\r\n\r\n /**\r\n * Gets the icon class from an iconRef or returns null if the iconRef is not an sme-icon reference\r\n * @param iconRef the reference to check\r\n */\r\n public static getSmeIconClassFromRef(iconRef: string): string {\r\n return (!MsftSme.isNullOrUndefined(iconRef) && EnvironmentModule.isSmeIconRef(iconRef))\r\n ? iconRef.substr(EnvironmentModule.smeIconPrefix.length) : null;\r\n }\r\n\r\n /**\r\n * Gets the icon url from an iconRef or returns null if the iconRef is an sme-icon reference\r\n * @param iconRef the reference to check\r\n */\r\n public static getFormattedIconRefUrl(iconRef: string): string {\r\n return (MsftSme.isNullOrUndefined(iconRef) || EnvironmentModule.isSmeIconRef(iconRef)) ? null : `url(${iconRef})`;\r\n }\r\n\r\n /**\r\n * Processes an icon reference to resolve it to either a sme-icon or absolute url\r\n * @param iconRef The icon reference\r\n * @param module the module that the icon belongs to\r\n */\r\n public static processIconReference(iconRef: string, module: EnvironmentModule): string {\r\n // leave icon ref alone if it is an sme-icon, absolute uri, or null/whitespace\r\n if (MsftSme.isNullOrWhiteSpace(iconRef) || EnvironmentModule.isSmeIconRef(iconRef) || MsftSme.isUriAbsolute(iconRef)) {\r\n return iconRef;\r\n }\r\n\r\n return this.toAbsolutePath(module, iconRef);\r\n }\r\n\r\n /**\r\n * Converts relative module paths into absolute uris\r\n */\r\n private static toAbsolutePath(module: EnvironmentModule, relativePath: string): string {\r\n const pathComponents = [relativePath];\r\n\r\n if (module.target && !module.isSideLoaded) {\r\n pathComponents.unshift(module.target);\r\n }\r\n\r\n pathComponents.unshift(module.origin);\r\n return MsftSme.pathJoin('/', pathComponents);\r\n }\r\n\r\n /**\r\n * Find resource string for the key.\r\n *\r\n * @param resources The resource.\r\n * @param locale The locale.\r\n * @param key The key string.\r\n */\r\n public static findResource(resources: EnvironmentModuleResource[], locale: string, key: string): string {\r\n const prefix = 'resources:strings:';\r\n if (!key.startsWith(prefix)) {\r\n return key;\r\n }\r\n\r\n key = key.substr(prefix.length);\r\n const en: EnvironmentModuleResource = resources.first((value: EnvironmentModuleResource) => value.locale === 'default');\r\n const current: EnvironmentModuleResource = resources.first((value: EnvironmentModuleResource) => value.locale === locale);\r\n if (current && current.strings[key]) {\r\n return current.strings[key];\r\n } else if (en && en.strings[key]) {\r\n return en.strings[key];\r\n }\r\n\r\n return key;\r\n }\r\n\r\n /**\r\n * Recursively processes manifest resources\r\n *\r\n * @param module the manifest object.\r\n * @param locale the locale string such as 'en'.\r\n * @param obj current object, defaults to the module itself\r\n */\r\n private static processModuleResources(module: EnvironmentModule, locale: string, obj: any = module): void {\r\n if (!Array.isArray(module.resources)) {\r\n module.resources = [];\r\n }\r\n\r\n const keys = Object.keys(obj);\r\n keys.forEach(key => {\r\n if (typeof obj[key] === 'string') {\r\n // first check the string for localized values\r\n obj[key] = EnvironmentModule.findResource(module.resources, locale, obj[key]);\r\n\r\n // if the key is 'icon' treat this field as an icon\r\n if (key === 'icon') {\r\n obj[key] = EnvironmentModule.processIconReference(obj[key], module);\r\n }\r\n } else if (typeof obj[key] === 'object') {\r\n EnvironmentModule.processModuleResources(module, locale, obj[key]);\r\n }\r\n });\r\n }\r\n\r\n public static getModuleAssetUri(moduleName: string, resourceName: string, version: string): string {\r\n const assets = MsftSme.self().Resources.moduleAssets;\r\n if (assets[moduleName] && assets[moduleName][resourceName] && assets[moduleName][resourceName][version]) {\r\n return assets[moduleName][resourceName][version];\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Create environment object from the manifest.\r\n *\r\n * @param manifest the manifest object.\r\n * @param locale the locale string such as 'en'.\r\n */\r\n public static createEnvironment(manifest: any, locale: string): any {\r\n // use local origin automatically.\r\n manifest.origin = MsftSme.getSafeOrigin();\r\n\r\n // initialize tracking of known trusted origins\r\n this.extensionOrigins = new Set<string>();\r\n this.extensionOrigins.add(manifest.origin);\r\n\r\n // use current time if version is missing so this enforce browser caching if v= option is used.\r\n manifest.version = manifest.version ? manifest.version : Date.now().toString();\r\n\r\n // merge manifest configuration with default configuration\r\n manifest.configuration = MsftSme.deepAssign({}, defaultEnvironmentConfiguration, manifest.configuration);\r\n\r\n const modules = manifest.modules || [];\r\n\r\n // process manifest entry points separately from children modules\r\n if (manifest.name === 'msft.sme.shell') {\r\n const shellExtensionManifest = { ...manifest };\r\n delete shellExtensionManifest.modules;\r\n shellExtensionManifest.name = 'msft.sme.shell-extensions';\r\n shellExtensionManifest.target = '/extensions';\r\n modules.push(shellExtensionManifest);\r\n }\r\n // Initialize Module Assets\r\n MsftSme.self().Resources.moduleAssets = {};\r\n\r\n // process Modules\r\n if (modules && modules.length > 0) {\r\n\r\n // first process resources, signature, and origin\r\n for (const module of modules) {\r\n // TODO: signature is going to be removed from modules, for now always use default.\r\n module.signature = EnvironmentModule.defaultSignature;\r\n\r\n // if the module has no origin, use the global one.\r\n module.origin = module.origin || manifest.origin;\r\n this.extensionOrigins.add(module.origin);\r\n\r\n // process module parts\r\n EnvironmentModule.processModuleResources(module, locale);\r\n delete module['resources'];\r\n\r\n // add assets to module assets using absolute paths\r\n if (module.assets) {\r\n const moduleAssets: MsftSme.MsftSmeModuleAssets = {};\r\n const assetKeys = Object.keys(module.assets);\r\n assetKeys.forEach(key => {\r\n moduleAssets[key] = {};\r\n const versionKeys = Object.keys(module.assets[key]);\r\n versionKeys.forEach(version => {\r\n moduleAssets[key][version] = this.toAbsolutePath(module, module.assets[key][version]);\r\n });\r\n });\r\n\r\n MsftSme.self().Resources.moduleAssets[module.name] = moduleAssets;\r\n }\r\n }\r\n\r\n // now process extension targets\r\n for (const module of modules) {\r\n EnvironmentModule.processExtensionTargets(module);\r\n }\r\n\r\n // finally process entry points\r\n for (const module of modules) {\r\n EnvironmentModule.processEntryPoints(module);\r\n }\r\n\r\n // default entry point collections to be sorted alphabetically\r\n const alphaSort = (a, b) => a.displayName ? a.displayName.localeCompareIgnoreCase(b.displayName) : -1;\r\n if (this.allEntryPoints) {\r\n this.allEntryPoints.sort(alphaSort);\r\n } else {\r\n this.allEntryPoints = [];\r\n }\r\n\r\n if (this.entryPointsByType) {\r\n this.entryPointsByType[EnvironmentModuleEntryPointType.Solution].sort(alphaSort);\r\n this.entryPointsByType[EnvironmentModuleEntryPointType.Tool].sort(alphaSort);\r\n }\r\n\r\n // TODO: do we want settings alphabetized?\r\n }\r\n return manifest;\r\n }\r\n\r\n /**\r\n * Gets the environment module.\r\n *\r\n * @param name the name of module.\r\n * @return EnvironmentModule the environment module.\r\n */\r\n public static checkEnvironmentInitialized(): void {\r\n if (!MsftSme || !MsftSme.self().Environment) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.EnvironmentNotInitialized.message;\r\n throw Error(message);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the environment module.\r\n *\r\n * @param name the name of module.\r\n * @return EnvironmentModule the environment module.\r\n */\r\n public static getEnvironmentModule(name: string): EnvironmentModule {\r\n const shellEnvironment = MsftSme.self().Environment;\r\n const modules = shellEnvironment && shellEnvironment.modules;\r\n if (modules) {\r\n for (const module of modules) {\r\n if (module.name === name) {\r\n return <EnvironmentModule>module;\r\n }\r\n }\r\n }\r\n\r\n if (shellEnvironment.name === name) {\r\n return <EnvironmentModule>shellEnvironment;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Process extension targets for quick and easy access later\r\n * @param module the modules to process\r\n */\r\n private static processExtensionTargets(module: EnvironmentModule) {\r\n // initialize tracking structures if they have not been\r\n if (!EnvironmentModule.allExtensionTargets) {\r\n EnvironmentModule.allExtensionTargets = [];\r\n EnvironmentModule.extensionTargetsByType = {};\r\n EnvironmentModule.extensionTargetsById = {};\r\n EnvironmentModule.extensionTargetFulfillmentMap = {};\r\n Object.keys(ExtensionTargetType).forEach(key => this.extensionTargetsByType[ExtensionTargetType[key]] = []);\r\n }\r\n\r\n // stop if there are no extension targets in this module\r\n if (!module.extensionTargets) {\r\n return;\r\n }\r\n\r\n module.extensionTargets.forEach(extensionTarget => {\r\n // ignore invalid types in the manifest\r\n if (!EnvironmentModule.extensionTargetsByType[extensionTarget.extensionTargetType]) {\r\n Logging.log(<LogRecord>{\r\n source: EnvironmentModule.logSourceName,\r\n level: LogLevel.Warning,\r\n consoleGroupHeader: `Unable to determine extensionTargetType.`,\r\n // tslint:disable-next-line:max-line-length\r\n message: `Entry point \"${extensionTarget.name}\" in module \"${module.displayName} has a extensionTargetType of: ${extensionTarget.extensionTargetType}`\r\n });\r\n return;\r\n }\r\n // save the module information into the extension target\r\n extensionTarget.parentModule = module;\r\n\r\n const extensionTargetId = EnvironmentModule.createFormattedExtensionTarget(extensionTarget);\r\n\r\n // save the module information into the extension target\r\n extensionTarget.parentModule = module;\r\n\r\n // push to data structures\r\n EnvironmentModule.allExtensionTargets.push(extensionTarget);\r\n EnvironmentModule.extensionTargetsByType[extensionTarget.extensionTargetType].push(extensionTarget);\r\n EnvironmentModule.extensionTargetsById[extensionTargetId] = extensionTarget;\r\n\r\n // initialize fulfillment map\r\n EnvironmentModule.extensionTargetFulfillmentMap[extensionTargetId] = [];\r\n });\r\n }\r\n\r\n /**\r\n * Process Entry points for quick and easy access later\r\n * @param module the modules to process\r\n */\r\n private static processEntryPoints(module: EnvironmentModule) {\r\n // initialize tracking structures if they have not been\r\n if (!EnvironmentModule.allEntryPoints) {\r\n EnvironmentModule.allEntryPoints = [];\r\n EnvironmentModule.entryPointsByType = {};\r\n EnvironmentModule.entryPointsById = {};\r\n Object.keys(EnvironmentModuleEntryPointType).forEach(key => this.entryPointsByType[EnvironmentModuleEntryPointType[key]] = []);\r\n this.friendlyUrlMap = {\r\n connectionTypes: { to: {}, from: {} },\r\n solutions: { to: {}, from: {} },\r\n tools: { to: {}, from: {} },\r\n settingsForms: { to: {}, from: {} }\r\n };\r\n }\r\n\r\n if (!module.entryPoints) {\r\n return;\r\n }\r\n\r\n module.entryPoints.forEach(entryPoint => {\r\n // ignore invalid types in the manifest\r\n if (!EnvironmentModule.entryPointsByType[entryPoint.entryPointType]) {\r\n Logging.log(<LogRecord>{\r\n source: EnvironmentModule.logSourceName,\r\n level: LogLevel.Warning,\r\n consoleGroupHeader: `Unable to determine entryPointType.`,\r\n // tslint:disable-next-line:max-line-length\r\n message: `Entry point \"${entryPoint.displayName}\" in module \"${module.displayName} has a entryPointType of: ${entryPoint.entryPointType}`\r\n });\r\n return;\r\n }\r\n\r\n // if we have experiment keys, dont process the entry point if any key is not enabled\r\n if (entryPoint.experimentKeys && entryPoint.experimentKeys.some(key => !MsftSme.isExperimentEnabledRaw(key))) {\r\n return;\r\n }\r\n\r\n // save the module information into the entry point\r\n entryPoint.parentModule = module;\r\n\r\n const entryPointId = EnvironmentModule.createFormattedEntrypoint(entryPoint);\r\n\r\n // push to data structures\r\n EnvironmentModule.allEntryPoints.push(entryPoint);\r\n EnvironmentModule.entryPointsByType[entryPoint.entryPointType].push(entryPoint);\r\n EnvironmentModule.entryPointsById[entryPointId] = entryPoint;\r\n\r\n // process url mappings\r\n if (entryPoint.urlName) {\r\n\r\n switch (entryPoint.entryPointType) {\r\n case EnvironmentModuleEntryPointType.Solution:\r\n this.friendlyUrlMap.solutions.to[entryPointId] = entryPoint.urlName;\r\n this.friendlyUrlMap.solutions.from[entryPoint.urlName] = entryPointId;\r\n break;\r\n case EnvironmentModuleEntryPointType.Tool:\r\n this.friendlyUrlMap.tools.to[entryPointId] = entryPoint.urlName;\r\n this.friendlyUrlMap.tools.from[entryPoint.urlName] = entryPointId;\r\n break;\r\n case EnvironmentModuleEntryPointType.SettingsForm:\r\n this.friendlyUrlMap.settingsForms.to[entryPointId] = entryPoint.urlName;\r\n this.friendlyUrlMap.settingsForms.from[entryPoint.urlName] = entryPointId;\r\n break;\r\n case EnvironmentModuleEntryPointType.ConnectionProvider:\r\n if (entryPoint.connectionTypeUrlName) {\r\n this.friendlyUrlMap.connectionTypes.to[entryPoint.connectionType] = entryPoint.connectionTypeUrlName;\r\n this.friendlyUrlMap.connectionTypes.from[entryPoint.connectionTypeUrlName] = entryPoint.connectionType;\r\n }\r\n }\r\n }\r\n\r\n if (entryPoint.entryPointType === EnvironmentModuleEntryPointType.ConnectionProvider && entryPoint.connectionTypeUrlName) {\r\n this.friendlyUrlMap.connectionTypes.to[entryPoint.connectionType] = entryPoint.connectionTypeUrlName;\r\n this.friendlyUrlMap.connectionTypes.from[entryPoint.connectionTypeUrlName] = entryPoint.connectionType;\r\n }\r\n\r\n // process extension mappings\r\n if (entryPoint.extends) {\r\n entryPoint.extends.forEach(extender => {\r\n const extensionTarget = EnvironmentModule.getExtensionTargets(target => {\r\n return target.parentModule.name === extender.module\r\n && target.name === extender.target;\r\n }).first();\r\n\r\n if (MsftSme.isNullOrUndefined(extensionTarget)) {\r\n // if we get here, either that target is no longer supported or the target extension is not installed.\r\n return;\r\n }\r\n\r\n const extensionTargetId = EnvironmentModule.createFormattedExtensionTarget(extensionTarget);\r\n EnvironmentModule.extensionTargetFulfillmentMap[extensionTargetId].push(entryPointId);\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Evaluates all of the modules in the environment and returns a flat list of all of their entry points.\r\n * optionally filtered by the 'filter' function\r\n *\r\n * @param filter the filter to apply to the entry points.\r\n * @return a flat list of all module entry points\r\n */\r\n private static getExtensionTargets(filter?: (extensionTarget: ExtensionTarget) => boolean): ExtensionTarget[] {\r\n return filter ? EnvironmentModule.allExtensionTargets.filter(filter) : EnvironmentModule.allExtensionTargets;\r\n }\r\n\r\n /**\r\n * Evaluates all of the modules in the environment and returns a flat list of all of their entry points.\r\n * optionally filtered by the 'filter' function\r\n *\r\n * @param filter the filter to apply to the entry points.\r\n * @return a flat list of all module entry points\r\n */\r\n public static getEntryPoints(filter?: (entryPoint: EnvironmentModuleEntryPoint) => boolean): EnvironmentModuleEntryPoint[] {\r\n EnvironmentModule.checkEnvironmentInitialized();\r\n return filter ? EnvironmentModule.allEntryPoints.filter(filter) : EnvironmentModule.allEntryPoints;\r\n }\r\n\r\n /**\r\n * Gets the available entry points from all of the modules in the environment, filtered by type.\r\n *\r\n * @param name the name of module.\r\n * @return EnvironmentModule the environment module.\r\n */\r\n public static getEntryPointsByType(entryPointTypes: EnvironmentModuleEntryPointType[]): EnvironmentModuleEntryPoint[] {\r\n EnvironmentModule.checkEnvironmentInitialized();\r\n return entryPointTypes.mapMany<EnvironmentModuleEntryPoint>(type => EnvironmentModule.entryPointsByType[type]);\r\n }\r\n\r\n /**\r\n * Gets the connection type mapping data.\r\n *\r\n * @return the mapping object.\r\n */\r\n public static fulfillExtensionTarget(extensionTargetId): string[] {\r\n EnvironmentModule.checkEnvironmentInitialized();\r\n return EnvironmentModule.extensionTargetFulfillmentMap[extensionTargetId];\r\n }\r\n\r\n /**\r\n * Gets the connection type mapping data.\r\n *\r\n * @return the mapping object.\r\n */\r\n public static getConnectionMap(): { [name: string]: EnvironmentConnectionTypeInfo } {\r\n if (!EnvironmentModule.connectionMap) {\r\n EnvironmentModule.connectionMap = EnvironmentModule.createConnectionMap();\r\n }\r\n\r\n return EnvironmentModule.connectionMap;\r\n }\r\n\r\n /**\r\n * Gets a friendly url segment from a connection type\r\n * @param connectionType the connection type to map.\r\n * @return string friendly url for the connection type or the connection type if no friendly name exists.\r\n */\r\n public static getFriendlyUrlSegmentForConnectionType(connectionType: string, fallbackToUnfriendlySegment = true): string {\r\n return EnvironmentModule.friendlyUrlMap.connectionTypes.to[connectionType] || (fallbackToUnfriendlySegment ? connectionType : null);\r\n }\r\n\r\n /**\r\n * Gets a connection type from a friendly url segment\r\n * @param urlSegment the url segment to map\r\n * @return string connection type found using the friendly url segment\r\n */\r\n public static getConnectionTypeFromFriendlyUrlSegment(urlSegment: string): string {\r\n return EnvironmentModule.friendlyUrlMap.connectionTypes.from[urlSegment];\r\n }\r\n\r\n /**\r\n * Gets a friendly url segment from an entry point id\r\n * @param urlSegment the url segment.\r\n * @param entryPointType the type of entry point to look for.\r\n * @return string friendly url for the entry point id\r\n */\r\n public static getFriendlyUrlSegmentForEntryPoint(\r\n entryPoint: string, entryPointType: EnvironmentModuleEntryPointType, fallbackToUnfriendlySegment = true): string {\r\n switch (entryPointType) {\r\n case EnvironmentModuleEntryPointType.Solution:\r\n return EnvironmentModule.friendlyUrlMap.solutions.to[entryPoint] || (fallbackToUnfriendlySegment ? entryPoint : null);\r\n case EnvironmentModuleEntryPointType.Tool:\r\n return EnvironmentModule.friendlyUrlMap.tools.to[entryPoint] || (fallbackToUnfriendlySegment ? entryPoint : null);\r\n case EnvironmentModuleEntryPointType.SettingsForm:\r\n return EnvironmentModule.friendlyUrlMap.settingsForms.to[entryPoint] || (fallbackToUnfriendlySegment ? entryPoint : null);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets a friendly url segment for an entry point\r\n * @param urlSegment the url segment.\r\n * @param entryPointType the type of entry point to look for.\r\n * @return string friendly url for the entry point\r\n */\r\n public static getEntryPointFromFriendlyUrlSegment(urlSegment: string, entryPointType: EnvironmentModuleEntryPointType): string {\r\n switch (entryPointType) {\r\n case EnvironmentModuleEntryPointType.Solution:\r\n return EnvironmentModule.friendlyUrlMap.solutions.from[urlSegment];\r\n case EnvironmentModuleEntryPointType.Tool:\r\n return EnvironmentModule.friendlyUrlMap.tools.from[urlSegment];\r\n case EnvironmentModuleEntryPointType.SettingsForm:\r\n return EnvironmentModule.friendlyUrlMap.settingsForms.from[urlSegment];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the connection type information.\r\n *\r\n * @param typeName the type name.\r\n * @return EnvironmentConnectionTypeInfo the connection type information.\r\n */\r\n public static getConnectionTypeInfo(typeName: string): EnvironmentConnectionTypeInfo {\r\n return EnvironmentModule.getConnectionMap()[typeName];\r\n }\r\n\r\n private static createConnectionMap(): { [name: string]: EnvironmentConnectionTypeInfo } {\r\n const map: { [name: string]: EnvironmentConnectionTypeInfo } = {};\r\n const providers = this.getEntryPointsByType([EnvironmentModuleEntryPointType.ConnectionProvider]);\r\n providers.forEach(provider => {\r\n if (!provider.connectionTypeDefaultSolution) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.EnvironmentMissingDefault.message;\r\n throw new Error(message);\r\n }\r\n\r\n const solutionEntrypoint = EnvironmentModule.splitFormattedEntrypoint(provider.connectionTypeDefaultSolution);\r\n const solution = this.getEntryPointsByType([EnvironmentModuleEntryPointType.Solution])\r\n .first(ep => ep.parentModule.name === solutionEntrypoint.moduleName && ep.name === solutionEntrypoint.entrypointName);\r\n map[provider.connectionType] = <EnvironmentConnectionTypeInfo>{ provider, solution };\r\n if (solution && solution.parentModule && solution.parentModule.name) {\r\n map[solution.parentModule.name] = map[provider.connectionType];\r\n }\r\n });\r\n\r\n return map;\r\n }\r\n\r\n /**\r\n * splits an entrypoint identifier string into its respective module and entrypoint names\r\n * @param format the formatted entrypoint identifier string\r\n */\r\n public static splitFormattedEntrypoint(format: string) {\r\n const parts = format.split('!');\r\n return { moduleName: parts[0], entrypointName: parts[1] };\r\n }\r\n\r\n /**\r\n * creates a formatted entrypoint identifier string from an entrypoint\r\n * @param entryPoint the entrypoint to create the string from\r\n */\r\n public static createFormattedEntrypoint(entryPoint: EnvironmentModuleEntryPoint) {\r\n return EnvironmentModule.createEntrypointId(entryPoint.parentModule.name, entryPoint.name);\r\n }\r\n\r\n public static createEntrypointId(moduleName: string, entryPointName: string) {\r\n return `${moduleName}!${entryPointName}`;\r\n }\r\n\r\n /**\r\n * Create a formatted iframe ID used to link iframes and their html element\r\n * Replace . with - because . is not permitted in css selectors required for testing\r\n * @param parentModuleName the name of the parent module of the iframe content\r\n * @param entryPointName the name of the entry point loaded by the iframe\r\n */\r\n public static createFormattedIFrameId(parentModuleName: string, entryPointName: string): string {\r\n const parentModuleId = MsftSme.replaceAll(parentModuleName, '.', '-');\r\n return '{0}-{1}'.format(parentModuleId, entryPointName);\r\n }\r\n\r\n /**\r\n * splits an extension target identifier string into its respective module and extension target names\r\n * @param format the formatted extension target identifier string\r\n */\r\n public static splitFormattedExtensionTarget(format: string) {\r\n const parts = format.split('!');\r\n return { moduleName: parts[0], extensionTargetName: parts[1] };\r\n }\r\n\r\n /**\r\n * creates a formatted extension target identifier string from an extension target\r\n * @param entryPoint the extension target to create the string from\r\n */\r\n public static createFormattedExtensionTarget(extensionTarget: ExtensionTarget) {\r\n return `${extensionTarget.parentModule.name}!${extensionTarget.name}`;\r\n }\r\n\r\n /**\r\n * resolves an entrypoint from a formatted entrypoint identifier string\r\n * @param formattedEntrypointIdentifier the formatted entrypoint identifier string\r\n */\r\n public static resolveEntrypoint(formattedEntrypointIdentifier: string): EnvironmentModuleEntryPoint {\r\n if (!formattedEntrypointIdentifier) {\r\n return null;\r\n }\r\n const parts = EnvironmentModule.splitFormattedEntrypoint(formattedEntrypointIdentifier);\r\n if (!parts.moduleName || !parts.entrypointName) {\r\n return null;\r\n }\r\n const entryPoints = this.getEntryPoints(ep => ep.name === parts.entrypointName && ep.parentModule.name === parts.moduleName);\r\n return entryPoints[0] || null;\r\n }\r\n\r\n /**\r\n * Gets the name of current shell or module.\r\n */\r\n public static getModuleName(): string {\r\n const self = MsftSme.self();\r\n return self.Init.moduleName;\r\n }\r\n\r\n /**\r\n * Gets the version of current shell or module.\r\n */\r\n public static getModuleVersion(): string {\r\n const self = MsftSme.self();\r\n if (self.Environment.version) {\r\n return self.Environment.version;\r\n }\r\n\r\n for (const module of self.Environment.modules) {\r\n if (module.name === self.Init.moduleName && module.version) {\r\n self.Environment.version = module.version;\r\n return module.version;\r\n }\r\n }\r\n\r\n return '0.0.0';\r\n }\r\n\r\n /**\r\n * Compare the shell version with specified version.\r\n * - this function must be called after NavigationService Init was called, otherwise it\r\n * cannot get current shell version and return false.\r\n *\r\n * @param version the version to compare.\r\n * @return true if shell has newer version running.\r\n */\r\n public static shellGreaterOrEqual(version: string): boolean {\r\n const versionSegments = version.split('.');\r\n if (MsftSme.isNullOrWhiteSpace(version)) {\r\n // shell doesn't give version.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'version is empty.');\r\n return false;\r\n }\r\n\r\n if (versionSegments.length !== 3) {\r\n // shell doesn't give right version format.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'version format is not right.');\r\n return false;\r\n }\r\n\r\n const shellVersion = MsftSme.self().Init.shellVersion;\r\n if (MsftSme.isNullOrWhiteSpace(shellVersion)) {\r\n // shell doesn't give version.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'shell version is not available.');\r\n return false;\r\n }\r\n\r\n const shellSegments = shellVersion.split('.');\r\n if (shellSegments.length !== 3) {\r\n // shell doesn't give right version format.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'shell version is corrupted.');\r\n return false;\r\n }\r\n\r\n const digits = versionSegments.map(digit => {\r\n const num = Number(digit);\r\n return isNaN(num) ? 0 : num;\r\n });\r\n const shellVersions = shellSegments.map(digit => {\r\n const num = Number(digit);\r\n return isNaN(num) ? 0 : num;\r\n });\r\n if (shellVersions[0] < digits[0]\r\n || (shellVersions[0] === digits[0] && shellVersions[1] < digits[1])\r\n || (shellVersions[0] === digits[0] && shellVersions[1] === digits[1] && shellVersions[2] < digits[2])) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/manifest/environment-modules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AA0FjD;;GAEG;AACH,MAAM,CAAN,IAAY,+BAUX;AAVD,WAAY,+BAA+B;IACvC,4EAAyC,CAAA;IACzC,wDAAqB,CAAA;IACrB,gDAAa,CAAA;IACb,sDAAmB,CAAA;IACnB,gEAA6B,CAAA;IAC7B,kEAA+B,CAAA;IAC/B,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;AACrB,CAAC,EAVW,+BAA+B,KAA/B,+BAA+B,QAU1C;AAqYD;;GAEG;AACH,MAAM,CA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,CAAC,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;eACzB,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;eAChE,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YACvG,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;;AAn1BuB,+BAAa,GAAG,gBAAgB,CAAC;AAEzD;;GAEG;AACY,+BAAa,GAAsD,IAAI,CAAC;AAOvF;;GAEG;AACY,gCAAc,GAAqC,IAAI,CAAC;AAEvE;;GAEG;AACW,6BAAW,GAAG,gBAAgB,CAAC;AAE7C;;GAEG;AACW,kCAAgB,GAAG,eAAe,CAAC;AAEjD;;GAEG;AACW,+BAAa,GAAG,WAAW,CAAC;AAE1C;;GAEG;AACW,gCAAc,GAAkC,IAAI,CAAC;AAEnE;;GAEG;AACW,mCAAiB,GAAqD,IAAI,CAAC;AAEzF;;GAEG;AACW,iCAAe,GAAmD,IAAI,CAAC;AAErF;;GAEG;AACW,qCAAmB,GAAsB,IAAI,CAAC;AAE5D;;GAEG;AACW,wCAAsB,GAAyC,IAAI,CAAC;AAElF;;GAEG;AACW,sCAAoB,GAAuC,IAAI,CAAC;AAE9E;;GAEG;AACW,kCAAgB,GAAgB,IAAI,CAAC","file":"environment-modules.js","sourcesContent":["import { PowerShellCommand } from '../data/powershell';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { LogRecord } from '../diagnostics/log-record';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\n\r\n/**\r\n * Defines an object or property for other extensions to reference\r\n */\r\nexport interface EnvironmentModulePropertyDescriptor {\r\n /**\r\n * The type of value of this property.\r\n * required if schema is not defined.\r\n */\r\n type?: 'array' | 'boolean' | 'null' | 'object' | 'number' | 'string';\r\n\r\n /**\r\n * A reference to a schema resource defining this property\r\n */\r\n schema?: string;\r\n\r\n /**\r\n * Tells other extension developers more information about this property\r\n */\r\n comment?: string;\r\n\r\n /**\r\n * Indicates if this field is required\r\n */\r\n required?: boolean;\r\n\r\n /**\r\n * The default value of this property\r\n * The type should be of the same type defined in the 'type' property.\r\n */\r\n defaultsTo?: any;\r\n\r\n /**\r\n * The contract for the array items.\r\n * Required if the type property is set to 'array'\r\n */\r\n items?: EnvironmentModulePropertyDescriptor;\r\n\r\n /**\r\n * The contract for the sub properties.\r\n * Required if the type property is set to 'object'\r\n */\r\n properties?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n}\r\n\r\nexport interface EnvironmentModuleDisplayable {\r\n /**\r\n * display name of module\r\n */\r\n displayName: string;\r\n\r\n /**\r\n * description of module\r\n */\r\n description: string;\r\n\r\n /**\r\n * icon url or smeIcon reference. Absolute or relative urls\r\n */\r\n icon: string;\r\n\r\n /**\r\n * The scale of icon. (1.0 is default if not specified)\r\n */\r\n iconScale?: number;\r\n\r\n /**\r\n * The dark theme data. (Optional)\r\n */\r\n darkTheme?: {\r\n /**\r\n * The icon path on the package.\r\n */\r\n icon: string;\r\n\r\n /**\r\n * The scale of icon. (1.0 is default if not specified)\r\n */\r\n iconScale?: number;\r\n };\r\n\r\n\r\n /**\r\n * keywords for module search\r\n */\r\n keywords: string[];\r\n}\r\n\r\n/**\r\n * The type of entry point.\r\n */\r\nexport enum EnvironmentModuleEntryPointType {\r\n ConnectionProvider = 'connectionProvider',\r\n Solution = 'solution',\r\n Tool = 'tool',\r\n Service = 'service',\r\n SettingsForm = 'settingsForm',\r\n GroupProvider = 'groupProvider',\r\n Worker = 'worker',\r\n Dialog = 'dialog',\r\n SnapIn = 'snapIn'\r\n}\r\n\r\n/**\r\n * The type of behavior to solution root navigation.\r\n */\r\nexport type SolutionRootNavigationBehaviorType = 'path' | 'connections' | 'tools';\r\n\r\n/**\r\n * The interface of condition check of server inventory data.\r\n */\r\nexport interface EnvironmentModuleConditionStatement {\r\n /**\r\n * The operator of the condition.\r\n */\r\n operator: 'gt' | 'ge' | 'lt' | 'le' | 'eq' | 'ne' | 'is' | 'not' | 'contains' | 'notContains'\r\n | 'anyEq' | 'anyNe' | 'anyContains' | 'anyNotContains';\r\n\r\n /**\r\n * The data type of value.\r\n */\r\n type: 'version' | 'number' | 'string' | 'boolean' | 'numberArray' | 'stringArray';\r\n\r\n /**\r\n * The test value of the condition.\r\n */\r\n value: string | number | boolean | number[] | string[];\r\n}\r\n\r\n/**\r\n * The mapped inventory conditions.\r\n */\r\nexport type EnvironmentModuleConditionMap = MsftSme.StringMap<EnvironmentModuleConditionStatement>;\r\n\r\n/**\r\n * The requirement of entry point to be activated on the view.\r\n */\r\nexport interface EnvironmentModuleEntryPointRequirement {\r\n /**\r\n * The id of solutions of the connection type that satisfies this requirement.\r\n */\r\n solutionIds?: string[];\r\n\r\n /**\r\n * The id of the connection type that satisfies this requirement\r\n */\r\n connectionTypes?: string[];\r\n\r\n /**\r\n * The conditions of tool status.\r\n */\r\n conditions?: {\r\n /**\r\n * Check if app/desktop localhost. Only tested if it sets \"false\".\r\n */\r\n localhost?: boolean,\r\n\r\n /**\r\n * Check if specific condition against ServerInventory data.\r\n */\r\n inventory?: EnvironmentModuleConditionMap,\r\n\r\n /**\r\n * Check if specific condition against supported installation type data.\r\n */\r\n installationTypes?: string[],\r\n\r\n /**\r\n * Check if specific condition against Connection properties data.\r\n */\r\n properties?: EnvironmentModuleConditionMap,\r\n\r\n /**\r\n * @deprecated\r\n * Check by using PowerShell script.\r\n *\r\n * must return the following format.\r\n * {\r\n * state: 'Available', 'NotConfigured', 'NotSupported'\r\n * message: string\r\n * keyValuePairs: [ { name: string, value: string, type: string } ]\r\n * }\r\n */\r\n script?: string\r\n\r\n /**\r\n * Check by using PowerShell script and command.\r\n *\r\n * must return the following format.\r\n * {\r\n * state: 'Available', 'NotConfigured', 'NotSupported'\r\n * message: string\r\n * keyValuePairs: [ { name: string, value: string, type: string } ]\r\n * }\r\n */\r\n powerShell?: PowerShellCommand;\r\n }[];\r\n}\r\n\r\n/**\r\n * Defines an object that describes the identity of an extension method\r\n */\r\nexport interface ExtensionMethodIdentifier {\r\n /**\r\n * The name of the module in which the extension method can be found\r\n */\r\n module: string;\r\n /**\r\n * The name of the entry point in which the extension method can be found\r\n */\r\n name: string;\r\n /**\r\n * The method to find\r\n */\r\n method: string;\r\n /**\r\n * The version of the method to be found\r\n */\r\n version: number;\r\n}\r\n\r\n\r\n/**\r\n * Defines an object that describes the identity of an extension dialog\r\n */\r\nexport interface ExtensionDialogIdentifier {\r\n /**\r\n * The name of the module in which the extension dialog can be found\r\n */\r\n module: string;\r\n /**\r\n * The name of the entry point of the extension dialog\r\n */\r\n name: string;\r\n /**\r\n * The version of the dialog\r\n */\r\n version: number;\r\n}\r\n\r\nexport interface EnvironmentModuleConnectionStatusProvider {\r\n /**\r\n * If defined, powershell will be used to query a connections status\r\n */\r\n powerShell?: PowerShellCommand;\r\n\r\n /**\r\n * If defined, the gateways REST api will be used to query a connections status\r\n */\r\n relativeGatewayUrl?: string;\r\n\r\n /**\r\n * Specifies to get the connection status from a worker extension method.\r\n * The worker method is expected to take a connection name as its only input\r\n */\r\n worker?: ExtensionMethodIdentifier;\r\n\r\n /**\r\n * Specifies to get the connection status from a service extension method.\r\n * The service method is expected to take a connection name as its only input\r\n */\r\n service?: ExtensionMethodIdentifier;\r\n\r\n /**\r\n * If defined, will be used to look up display strings for the label and description of the status object\r\n */\r\n displayValueMap?: MsftSme.StringMap<string>;\r\n\r\n /**\r\n * If defined, will be used to skip status checks\r\n */\r\n skipStatusCheck?: boolean;\r\n}\r\n\r\nexport interface SolutionConnectionsViewConfiguration {\r\n /**\r\n * List of connections types to show in the view of the connections list\r\n * each entry should be a valid connection type string identifier from any\r\n * modules entrypoints of type @see EnvironmentModuleEntryPointType.ConnectionProvider\r\n */\r\n connectionTypes: string[];\r\n\r\n /**\r\n * The title of the connections list for this solution.\r\n * Optional. A default header will be provided if this field is left out\r\n */\r\n header?: string;\r\n}\r\n\r\nexport interface SolutionToolsViewConfiguration {\r\n /**\r\n * Enables/Disable ths tools menu\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * Sets the title of the tools menu\r\n */\r\n title: string;\r\n\r\n /**\r\n * Sets the title of the search field on the tools menu\r\n */\r\n searchTitle: string;\r\n\r\n\r\n /**\r\n * Indicates the default tool to open if no tool is provided. This value should be the name of an entrypoint in the same module\r\n */\r\n defaultTool: string;\r\n\r\n /**\r\n * The list of known tools that will be displayed at the first section of tool menu.\r\n * 1) entry and group are mandatory.\r\n * 2) create groups and sort members by priority then alphabetical.\r\n * 3) sort the groups by highest priority number in the group members.\r\n * 4) settings creates single group and sort members by priority then alphabetical.\r\n */\r\n predefined: {\r\n /**\r\n * The entry point ID with \"<module name>!<entry point name>\" format.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The group display name.\r\n */\r\n group: string;\r\n\r\n /**\r\n * The ordering priority.\r\n * (0 is highest)\r\n */\r\n priority?: number;\r\n\r\n /**\r\n * Indicating the tool is settings menu.\r\n */\r\n settings?: boolean;\r\n }[];\r\n}\r\n\r\n/**\r\n * Defines the configuration for a connection provider experience\r\n */\r\nexport interface ConnectionProviderExperienceConfiguration {\r\n /**\r\n * The path to the experience.\r\n */\r\n path: string;\r\n\r\n /**\r\n * The label to display for the experience.\r\n * ex) Add Server Connection, Create Failover Cluster Connection and so on.\r\n */\r\n label: string;\r\n\r\n /**\r\n * The dialog mode to use for the dialog that contains this experience\r\n */\r\n dialogMode?: 'normal' | 'wide' | 'compact' | 'fullscreen';\r\n}\r\n\r\n/**\r\n * The type of lifetime to implement when creating a worker\r\n */\r\nexport type WorkerLifetime = 'default' | 'long';\r\n\r\n/**\r\n * The type of startup type to implement when creating a service\r\n */\r\nexport type ServiceStartupType = 'automatic' | 'onDemand';\r\n\r\n/**\r\n * The type of cleanup type to implement when creating a service\r\n * 'never' means that that service will start and only be destroyed if specifically requested or the application ends\r\n * 'onIdle' means that the shell will clean up the service when no one has used it within a certain time limit.\r\n * This time limit is currently controlled by the shell.\r\n */\r\nexport type ServiceCleanupType = 'never' | 'onIdle';\r\n/**\r\n * Defines the target of an entry point\r\n */\r\nexport interface ExtenderDefinition {\r\n /**\r\n * The module to target\r\n */\r\n module: string;\r\n /**\r\n * The name of the extension target (within the 'module') to provide this entry point to\r\n */\r\n target: string;\r\n}\r\n\r\n/**\r\n * Defines the target of a worker entry point\r\n */\r\nexport interface WorkerExtenderDefinition extends ExtenderDefinition {\r\n /**\r\n * A map of method names to the versions that are implemented in this worker\r\n */\r\n methodVersions: MsftSme.StringMap<number>;\r\n}\r\n\r\n/**\r\n * Describes the method contract exposed by a worker for other modules to call.\r\n * When making breaking changes, make sure to use the version properties so dependent modules still work with an older contract\r\n */\r\nexport interface ExtensionMethodContract {\r\n /**\r\n * The version of this method. Create a new version for every breaking change\r\n */\r\n version?: number;\r\n /**\r\n * The name of the method\r\n */\r\n method: string;\r\n /**\r\n * a comment describing this method to consumers\r\n */\r\n comment?: string;\r\n /**\r\n * Defines the arguments expected to be passed to this method\r\n */\r\n arguments?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n /**\r\n * Defines the contract that this method will return\r\n */\r\n returns: EnvironmentModulePropertyDescriptor;\r\n}\r\n\r\n/**\r\n * Describes the declaration for a dialog\r\n * When making breaking changes, make sure to use the version properties so dependent modules still work with an older contract\r\n */\r\nexport interface DialogExtensionDeclaration {\r\n /**\r\n * The version of this method. Create a new version for every breaking change\r\n */\r\n version?: number;\r\n /**\r\n * a comment describing this dialog to consumers\r\n */\r\n comment?: string;\r\n /**\r\n * The dialog mode to use for the dialog\r\n */\r\n dialogMode?: 'pane' | 'wide-pane' | 'compact' | 'compact-square' | 'fullscreen' | 'centered' | 'centered-large';\r\n /**\r\n * Defines the arguments expected to be passed to this method\r\n */\r\n arguments?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n /**\r\n * Defines the contract that this dialog will return\r\n */\r\n returns: EnvironmentModulePropertyDescriptor;\r\n}\r\n\r\n/**\r\n * Define the minimum and maximum footprint of a snap in\r\n */\r\nexport interface SnapInSizeConstraints {\r\n minWidth: number;\r\n minHeight: number;\r\n maxWidth: number;\r\n maxHeight: number;\r\n}\r\n\r\n/**\r\n * Define the component interaction of inputs and outputs between the entry point and its consumer\r\n */\r\nexport interface ExtensionInteraction {\r\n /**\r\n * The version of this interaction. Create a new version for every breaking change\r\n */\r\n version?: number;\r\n /**\r\n * a comment describing this interaction model\r\n */\r\n comment?: string;\r\n /**\r\n * Defines the inputs that can be passed to this entry point\r\n */\r\n inputs?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n /**\r\n * Defines the outputs that this entry point can return\r\n */\r\n outputs?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n}\r\n\r\n/**\r\n * The type of lifetime to implement when creating a worker\r\n */\r\nexport enum ExtensionTargetType {\r\n WorkerTarget = 'workerTarget'\r\n}\r\n\r\nexport interface ExtensionTarget {\r\n /**\r\n * The type of extension target\r\n */\r\n extensionTargetType: ExtensionTargetType;\r\n\r\n /**\r\n * Description of the workerTarget.\r\n * This should tell the consumer what workers who target this are expected to do.\r\n */\r\n description: string;\r\n\r\n /**\r\n * The name of this extension target.\r\n * Should be unique to this modules other extension targets\r\n */\r\n name: string;\r\n\r\n /**\r\n * Mapping to the parent module of this target\r\n */\r\n parentModule?: EnvironmentModule;\r\n}\r\n\r\nexport interface WorkerExtensionTarget extends ExtensionTarget {\r\n\r\n /**\r\n * The type of extension target\r\n */\r\n extensionTargetType: ExtensionTargetType.WorkerTarget;\r\n\r\n /**\r\n * worker only -- The contract that is expected to be fulfilled by worker entry points that extend this target\r\n */\r\n contract: ExtensionMethodContract[];\r\n}\r\n\r\n/**\r\n * Defines the provider for collecting active managing as information\r\n */\r\nexport interface ManagingAsProvider {\r\n /**\r\n * If Defined, Specifies to collect managing as data from a worker method\r\n */\r\n worker?: ExtensionMethodIdentifier;\r\n /**\r\n * If Defined, Specifies to collect managing as data from a service method\r\n */\r\n service?: ExtensionMethodIdentifier;\r\n}\r\n\r\n/**\r\n * Defines how to apply manage as scenarios to this connection type\r\n */\r\nexport interface EnvironmentModuleManageAsScheme {\r\n /**\r\n * If Defined, Specifies to configure manage as credentials from an extension dialog\r\n */\r\n configurationDialog: ExtensionDialogIdentifier;\r\n /**\r\n * If Defined, Specifies how to collect active managing as data\r\n */\r\n managingAsProvider: ManagingAsProvider;\r\n}\r\n\r\n/**\r\n * Defines a modules entry point\r\n */\r\nexport interface EnvironmentModuleEntryPoint extends EnvironmentModuleDisplayable {\r\n /**\r\n * The type of entry point.\r\n */\r\n entryPointType: EnvironmentModuleEntryPointType;\r\n\r\n /**\r\n * The name of entry point, unique to its parent module\r\n */\r\n name?: string;\r\n\r\n /**\r\n * The friendly url name to use to reference this entrypoint. This must be unique among all entrypoints\r\n */\r\n urlName?: string;\r\n\r\n /**\r\n * The path of entry point.\r\n */\r\n path: string;\r\n\r\n /**\r\n * The frame Id to share single iframe within the module.\r\n */\r\n iframeId?: string;\r\n\r\n /**\r\n * Experiment keys that must all be enabled to enable this entry point\r\n */\r\n experimentKeys?: string[];\r\n\r\n /**\r\n * The id of the group provider.\r\n * Used to indicate which group provider should be used for grouping extensions\r\n */\r\n groupId?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * NOTE: This SHOULD be for SOLUTION types. since a connection type can exist in multiple solutions.\r\n * If true, the search bar will shown the tools list for this connection type\r\n * Otherwise, search bar will be hidden. Default is true.\r\n */\r\n searchBar?: boolean;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * Alternative to providing \"path\".\r\n * Configures the experiences for manipulating the connections provided by this entry point\r\n */\r\n experiences: {\r\n add: ConnectionProviderExperienceConfiguration;\r\n create: ConnectionProviderExperienceConfiguration;\r\n };\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The id of the connection type that this entry point provides\r\n */\r\n connectionType?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The friendly url name to use to reference the connection type that this entry point provides.\r\n * This must be unique among all connection types\r\n */\r\n connectionTypeUrlName?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The display name of the connection type that this entry point provides\r\n */\r\n connectionTypeName?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The default solution to use when opening the connection type that this entry point provides\r\n */\r\n connectionTypeDefaultSolution?: string;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The status provider implementation for the connection type that this entry point provides\r\n */\r\n connectionStatusProvider?: EnvironmentModuleConnectionStatusProvider;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.ConnectionProvider types only.\r\n * The manage as scheme to use for changing how the connection is managed\r\n */\r\n manageAsScheme?: EnvironmentModuleManageAsScheme;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Tool types only.\r\n * A list of requirements, if any requirement is met then this tool is applicable to a given connection\r\n */\r\n requirements?: EnvironmentModuleEntryPointRequirement[];\r\n\r\n /**\r\n * Mapping to the parent module of this entry point\r\n */\r\n parentModule?: EnvironmentModule;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Solution types only.\r\n * Defines how navigating to the root of this solution will behave.\r\n * Setting this to 'path' will load this module to the 'path' property.\r\n * Setting this to 'connections' will navigate instead to the connections list, customized for this solution\r\n */\r\n rootNavigationBehavior?: SolutionRootNavigationBehaviorType;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Solution types only.\r\n * Only applicable when 'rootNavigationBehavior' us set to 'connections'.\r\n * Describes how to customize the view of the connections list.\r\n */\r\n connections?: SolutionConnectionsViewConfiguration;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Solution types only. If provided, Configures the tools menu for this solution.\r\n */\r\n tools?: SolutionToolsViewConfiguration;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Worker types only. If provided, Configures the lifetime of this worker.\r\n */\r\n lifetime?: WorkerLifetime;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Service types only. If provided, Configures the startup type of this service.\r\n */\r\n startupType?: ServiceStartupType;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Service types only. If provided, Configures the cleanup of this service.\r\n */\r\n cleanupType?: ServiceCleanupType;\r\n\r\n /**\r\n * Defines specific extensionTargets to provide this entry point to\r\n */\r\n extends?: ExtenderDefinition[];\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Worker and @see EnvironmentModuleEntryPointType.Service types only.\r\n * Describes the method contracts exposed by this worker or service for other modules to call.\r\n */\r\n exposes?: ExtensionMethodContract[];\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.Dialog types only\r\n * Defines the declaration for this dialog - inputs and outputs.\r\n */\r\n declaration?: DialogExtensionDeclaration[];\r\n\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.SnapIn types only\r\n * Defines the size requirements for this snap in\r\n */\r\n sizeConstrains?: SnapInSizeConstraints;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.SnapIn types only\r\n * Defines the component interaction model for the snap in\r\n */\r\n interaction?: ExtensionInteraction;\r\n\r\n /**\r\n * @see EnvironmentModuleEntryPointType.SnapIn types only\r\n * Defines the author of the snap in.\r\n */\r\n author?: string;\r\n}\r\n\r\n/**\r\n * The state definition of Tool condition.\r\n */\r\nexport enum EnvironmentModuleToolState {\r\n /**\r\n * Tool is available on the connection.\r\n */\r\n Available,\r\n\r\n /**\r\n * Tool is not available because it's not configured properly.\r\n */\r\n NotConfigured,\r\n\r\n /**\r\n * Tool it not supported on the connection.\r\n */\r\n NotSupported\r\n}\r\n\r\n/**\r\n * The result of Tool conditions.\r\n */\r\nexport interface EnvironmentModuleToolConditionResult {\r\n /**\r\n * Display the tool.\r\n */\r\n show: boolean;\r\n\r\n /**\r\n * The connection id of node.\r\n */\r\n connectionId?: string;\r\n\r\n /**\r\n * The state of tool condition.\r\n */\r\n detail?: EnvironmentModuleToolState;\r\n\r\n /**\r\n * The message of condition.\r\n */\r\n message?: string;\r\n}\r\n\r\n/**\r\n * Tool's combined entry point and inventory result.\r\n */\r\nexport interface EnvironmentModuleEntryPointWithToolConditionResult\r\n extends EnvironmentModuleEntryPoint, EnvironmentModuleToolConditionResult {\r\n}\r\n\r\n/**\r\n * Environment module resource class.\r\n */\r\nexport interface EnvironmentModuleResource {\r\n /**\r\n * locale key string.\r\n */\r\n locale: string;\r\n\r\n /**\r\n * string map object.\r\n */\r\n strings: MsftSme.StringMap<string>;\r\n}\r\n\r\nexport const defaultEnvironmentConfiguration: MsftSme.EnvironmentConfiguration = {\r\n gateway: {\r\n disabled: false\r\n },\r\n appBar: {\r\n title: {\r\n hide: false\r\n },\r\n solution: {\r\n hide: false,\r\n hideDropdown: false\r\n },\r\n navigation: {\r\n allowHistory: false,\r\n allowRefresh: false,\r\n allowUrlInput: false,\r\n allowHome: false\r\n },\r\n urlField: {\r\n hideSolutionUrl: true\r\n },\r\n rightMenu: {\r\n showScripts: true,\r\n showSettings: true,\r\n showAbout: true,\r\n showWindowControls: false,\r\n showShareLink: false\r\n },\r\n aboutDialog: {\r\n showFeedback: true,\r\n feedbackLink: 'https://go.microsoft.com/fwlink/?linkid=2033442',\r\n showDocumentation: true,\r\n documentationLink: 'https://go.microsoft.com/fwlink/?linkid=2150525',\r\n releaseNotesLink: 'https://aka.ms/honolulucurrent',\r\n seeMoreReleaseDetailsLink: 'https://go.microsoft.com/fwlink/?linkid=2152971',\r\n showLicense: true,\r\n showScriptsUseRights: true,\r\n showLicenseExtensions: true,\r\n showPrivacyStatement: true,\r\n privacyLink: 'https://aka.ms/winserverprivacy',\r\n showSupportPolicy: true,\r\n supportLink: 'https://aka.ms/wac-support-policy',\r\n showThirdPartyNotice: true,\r\n showShortcuts: true,\r\n openLinkWithoutHref: false\r\n },\r\n overview: {\r\n gatewayStatusUpdateLink: 'settings/updates',\r\n updateLearnMoreLink: 'https://aka.ms/honolulucurrent'\r\n }\r\n },\r\n extensionsAutoUpdate: {\r\n enable : true,\r\n showAlert: true\r\n },\r\n gatewayAutoUpdate: {\r\n enable: true,\r\n },\r\n whatsNew: {\r\n showDialog: true\r\n },\r\n tools: {\r\n hide: false\r\n },\r\n connections: {\r\n type: 'standard',\r\n header: {\r\n hide: false\r\n }\r\n },\r\n telemetry: {\r\n sourceLibraryCdnLink: 'https://js.monitor.azure.com/scripts/c/ms.analytics-web-3.0.2.min.js',\r\n // Integrity hash generated via srihash.org\r\n sourceLibraryCdnIntegrityHash: 'sha384-ZCsysyTvHb4xqC4BgJSay4nwlNIGlT1w5t5YQS5htghoD2XEL2b4SrkhRPhtr9GD'\r\n },\r\n settings: {\r\n account: {\r\n show: true\r\n },\r\n personalization: {\r\n show: true\r\n },\r\n diagnostic: {\r\n show: true\r\n },\r\n language: {\r\n show: true\r\n },\r\n notification: {\r\n show: true\r\n },\r\n extension: {\r\n show: true\r\n },\r\n azure: {\r\n show: true\r\n },\r\n access: {\r\n show: true\r\n },\r\n sharedConnections: {\r\n show: true\r\n },\r\n general: {\r\n show: true\r\n },\r\n connectivity: {\r\n show: true\r\n },\r\n updates: {\r\n show: true\r\n },\r\n extensionUpdates: {\r\n show: true\r\n },\r\n performance: {\r\n show: true\r\n },\r\n advanced: {\r\n show: true\r\n },\r\n proxy: {\r\n show: true\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Defines an object that provides information about a connection type.\r\n */\r\nexport interface EnvironmentConnectionTypeInfo {\r\n /**\r\n * The provider entry point.\r\n */\r\n provider: EnvironmentModuleEntryPoint;\r\n\r\n /**\r\n * The solution entry point.\r\n */\r\n solution: EnvironmentModuleEntryPoint;\r\n}\r\n\r\nexport interface EnvironmentModuleFriendlyUrlMap {\r\n to: MsftSme.StringMap<string>;\r\n from: MsftSme.StringMap<string>;\r\n}\r\n\r\nexport interface EnvironmentModuleFriendlyUrlMaps {\r\n connectionTypes: EnvironmentModuleFriendlyUrlMap;\r\n solutions: EnvironmentModuleFriendlyUrlMap;\r\n tools: EnvironmentModuleFriendlyUrlMap;\r\n settingsForms: EnvironmentModuleFriendlyUrlMap;\r\n}\r\n\r\n/**\r\n * Environment module class.\r\n */\r\nexport class EnvironmentModule {\r\n private static readonly logSourceName = 'ManifestLoader';\r\n\r\n /**\r\n * Static mapping for connection information.\r\n */\r\n private static connectionMap: { [name: string]: EnvironmentConnectionTypeInfo } = null;\r\n\r\n /**\r\n * Static mapping for extensionTargetTypes to a map of extensionTargetIds to entry point ids that fulfill that target\r\n */\r\n private static extensionTargetFulfillmentMap: MsftSme.StringMap<string[]>;\r\n\r\n /**\r\n * Static mapping for friendly url strings to entrypoint ids\r\n */\r\n private static friendlyUrlMap: EnvironmentModuleFriendlyUrlMaps = null;\r\n\r\n /**\r\n * The name of shell.\r\n */\r\n public static nameOfShell = 'msft.sme.shell';\r\n\r\n /**\r\n * The default signature if missing manifest.\r\n */\r\n public static defaultSignature = 'version 0.0.0';\r\n\r\n /**\r\n * The prefix for identifying an sme-icon reference\r\n */\r\n public static smeIconPrefix = 'sme-icon:';\r\n\r\n /**\r\n * All entry points from all modules\r\n */\r\n public static allEntryPoints: EnvironmentModuleEntryPoint[] = null;\r\n\r\n /**\r\n * All entry points by type\r\n */\r\n public static entryPointsByType: MsftSme.StringMap<EnvironmentModuleEntryPoint[]> = null;\r\n\r\n /**\r\n * All entry points by type\r\n */\r\n public static entryPointsById: MsftSme.StringMap<EnvironmentModuleEntryPoint> = null;\r\n\r\n /**\r\n * All extension targets from all modules\r\n */\r\n public static allExtensionTargets: ExtensionTarget[] = null;\r\n\r\n /**\r\n * All extension targets by type\r\n */\r\n public static extensionTargetsByType: MsftSme.StringMap<ExtensionTarget[]> = null;\r\n\r\n /**\r\n * All extension targets by type\r\n */\r\n public static extensionTargetsById: MsftSme.StringMap<ExtensionTarget> = null;\r\n\r\n /**\r\n * All extension targets by type\r\n */\r\n public static extensionOrigins: Set<String> = null;\r\n\r\n /**\r\n * schema file information.\r\n */\r\n public $schema?: string;\r\n\r\n /**\r\n * name of module.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * display name of module.\r\n */\r\n public displayName: string;\r\n\r\n /**\r\n * description of set of tools.\r\n */\r\n public description?: string;\r\n\r\n /**\r\n * keywords of the module.\r\n */\r\n public keywords?: string[];\r\n\r\n /**\r\n * origin absolute url.\r\n */\r\n public origin: string;\r\n\r\n /**\r\n * target url to open the iframe.\r\n */\r\n public target?: string;\r\n\r\n /**\r\n * signature.\r\n */\r\n public signature: string;\r\n\r\n /**\r\n * The version of this module\r\n */\r\n public version: string;\r\n\r\n /**\r\n * icon url, absolute or relative to Shell url.\r\n */\r\n public icon?: string;\r\n\r\n /**\r\n * The support JEA endpoint with PowerShell module.\r\n */\r\n public jea?: boolean;\r\n\r\n /**\r\n * extension targets for this extension\r\n * Defines things that can be extended in this module.\r\n */\r\n public extensionTargets?: ExtensionTarget[];\r\n\r\n /**\r\n * entry points to launch the tool.\r\n */\r\n public entryPoints: EnvironmentModuleEntryPoint[];\r\n\r\n /**\r\n * Assets shared by the module\r\n */\r\n public assets?: MsftSme.MsftSmeModuleAssets;\r\n\r\n /**\r\n * localized resources of strings.\r\n */\r\n public resources: EnvironmentModuleResource[];\r\n\r\n /**\r\n * Schemas provided for use in this manifest\r\n */\r\n public schemas?: MsftSme.StringMap<EnvironmentModulePropertyDescriptor>;\r\n\r\n /**\r\n * list of all other available modules for shell.\r\n */\r\n public modules?: EnvironmentModule[];\r\n\r\n /**\r\n * Indicates that this module is being sideLoaded\r\n */\r\n public isSideLoaded?: boolean;\r\n\r\n /**\r\n * The Environment configuration\r\n */\r\n public configuration: MsftSme.EnvironmentConfiguration;\r\n\r\n /**\r\n * returns true if the provided origin is a known extension origin\r\n */\r\n public static isExtensionOrigin(origin: string): boolean {\r\n return this.extensionOrigins.has(origin);\r\n }\r\n\r\n /**\r\n * Indicates if a given icon reference is an sme-icon or some other form\r\n * @param iconRef the reference to check\r\n */\r\n public static isSmeIconRef(iconRef: string): boolean {\r\n return (!MsftSme.isNullOrUndefined(iconRef) && iconRef.startsWith(EnvironmentModule.smeIconPrefix));\r\n }\r\n\r\n /**\r\n * Gets the icon class from an iconRef or returns null if the iconRef is not an sme-icon reference\r\n * @param iconRef the reference to check\r\n */\r\n public static getSmeIconClassFromRef(iconRef: string): string {\r\n return (!MsftSme.isNullOrUndefined(iconRef) && EnvironmentModule.isSmeIconRef(iconRef))\r\n ? iconRef.substr(EnvironmentModule.smeIconPrefix.length) : null;\r\n }\r\n\r\n /**\r\n * Gets the icon url from an iconRef or returns null if the iconRef is an sme-icon reference\r\n * @param iconRef the reference to check\r\n */\r\n public static getFormattedIconRefUrl(iconRef: string): string {\r\n return (MsftSme.isNullOrUndefined(iconRef) || EnvironmentModule.isSmeIconRef(iconRef)) ? null : `url(${iconRef})`;\r\n }\r\n\r\n /**\r\n * Processes an icon reference to resolve it to either a sme-icon or absolute url\r\n * @param iconRef The icon reference\r\n * @param module the module that the icon belongs to\r\n */\r\n public static processIconReference(iconRef: string, module: EnvironmentModule): string {\r\n // leave icon ref alone if it is an sme-icon, absolute uri, or null/whitespace\r\n if (MsftSme.isNullOrWhiteSpace(iconRef) || EnvironmentModule.isSmeIconRef(iconRef) || MsftSme.isUriAbsolute(iconRef)) {\r\n return iconRef;\r\n }\r\n\r\n return this.toAbsolutePath(module, iconRef);\r\n }\r\n\r\n /**\r\n * Converts relative module paths into absolute uris\r\n */\r\n private static toAbsolutePath(module: EnvironmentModule, relativePath: string): string {\r\n const pathComponents = [relativePath];\r\n\r\n if (module.target && !module.isSideLoaded) {\r\n pathComponents.unshift(module.target);\r\n }\r\n\r\n pathComponents.unshift(module.origin);\r\n return MsftSme.pathJoin('/', pathComponents);\r\n }\r\n\r\n /**\r\n * Find resource string for the key.\r\n *\r\n * @param resources The resource.\r\n * @param locale The locale.\r\n * @param key The key string.\r\n */\r\n public static findResource(resources: EnvironmentModuleResource[], locale: string, key: string): string {\r\n const prefix = 'resources:strings:';\r\n if (!key.startsWith(prefix)) {\r\n return key;\r\n }\r\n\r\n key = key.substr(prefix.length);\r\n const en: EnvironmentModuleResource = resources.first((value: EnvironmentModuleResource) => value.locale === 'default');\r\n const current: EnvironmentModuleResource = resources.first((value: EnvironmentModuleResource) => value.locale === locale);\r\n if (current && current.strings[key]) {\r\n return current.strings[key];\r\n } else if (en && en.strings[key]) {\r\n return en.strings[key];\r\n }\r\n\r\n return key;\r\n }\r\n\r\n /**\r\n * Recursively processes manifest resources\r\n *\r\n * @param module the manifest object.\r\n * @param locale the locale string such as 'en'.\r\n * @param obj current object, defaults to the module itself\r\n */\r\n private static processModuleResources(module: EnvironmentModule, locale: string, obj: any = module): void {\r\n if (!Array.isArray(module.resources)) {\r\n module.resources = [];\r\n }\r\n\r\n const keys = Object.keys(obj);\r\n keys.forEach(key => {\r\n if (typeof obj[key] === 'string') {\r\n // first check the string for localized values\r\n obj[key] = EnvironmentModule.findResource(module.resources, locale, obj[key]);\r\n\r\n // if the key is 'icon' treat this field as an icon\r\n if (key === 'icon') {\r\n obj[key] = EnvironmentModule.processIconReference(obj[key], module);\r\n }\r\n } else if (typeof obj[key] === 'object') {\r\n EnvironmentModule.processModuleResources(module, locale, obj[key]);\r\n }\r\n });\r\n }\r\n\r\n public static getModuleAssetUri(moduleName: string, resourceName: string, version: string): string {\r\n const assets = MsftSme.self().Resources.moduleAssets;\r\n if (assets[moduleName] && assets[moduleName][resourceName] && assets[moduleName][resourceName][version]) {\r\n return assets[moduleName][resourceName][version];\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Create environment object from the manifest.\r\n *\r\n * @param manifest the manifest object.\r\n * @param locale the locale string such as 'en'.\r\n */\r\n public static createEnvironment(manifest: any, locale: string): any {\r\n // use local origin automatically.\r\n manifest.origin = MsftSme.getSafeOrigin();\r\n\r\n // initialize tracking of known trusted origins\r\n this.extensionOrigins = new Set<string>();\r\n this.extensionOrigins.add(manifest.origin);\r\n\r\n // use current time if version is missing so this enforce browser caching if v= option is used.\r\n manifest.version = manifest.version ? manifest.version : Date.now().toString();\r\n\r\n // merge manifest configuration with default configuration\r\n manifest.configuration = MsftSme.deepAssign({}, defaultEnvironmentConfiguration, manifest.configuration);\r\n\r\n const modules = manifest.modules || [];\r\n\r\n // process manifest entry points separately from children modules\r\n if (manifest.name === 'msft.sme.shell') {\r\n const shellExtensionManifest = { ...manifest };\r\n delete shellExtensionManifest.modules;\r\n shellExtensionManifest.name = 'msft.sme.shell-extensions';\r\n shellExtensionManifest.target = '/extensions';\r\n modules.push(shellExtensionManifest);\r\n }\r\n // Initialize Module Assets\r\n MsftSme.self().Resources.moduleAssets = {};\r\n\r\n // process Modules\r\n if (modules && modules.length > 0) {\r\n\r\n // first process resources, signature, and origin\r\n for (const module of modules) {\r\n // TODO: signature is going to be removed from modules, for now always use default.\r\n module.signature = EnvironmentModule.defaultSignature;\r\n\r\n // if the module has no origin, use the global one.\r\n module.origin = module.origin || manifest.origin;\r\n this.extensionOrigins.add(module.origin);\r\n\r\n // process module parts\r\n EnvironmentModule.processModuleResources(module, locale);\r\n delete module['resources'];\r\n\r\n // add assets to module assets using absolute paths\r\n if (module.assets) {\r\n const moduleAssets: MsftSme.MsftSmeModuleAssets = {};\r\n const assetKeys = Object.keys(module.assets);\r\n assetKeys.forEach(key => {\r\n moduleAssets[key] = {};\r\n const versionKeys = Object.keys(module.assets[key]);\r\n versionKeys.forEach(version => {\r\n moduleAssets[key][version] = this.toAbsolutePath(module, module.assets[key][version]);\r\n });\r\n });\r\n\r\n MsftSme.self().Resources.moduleAssets[module.name] = moduleAssets;\r\n }\r\n }\r\n\r\n // now process extension targets\r\n for (const module of modules) {\r\n EnvironmentModule.processExtensionTargets(module);\r\n }\r\n\r\n // finally process entry points\r\n for (const module of modules) {\r\n EnvironmentModule.processEntryPoints(module);\r\n }\r\n\r\n // default entry point collections to be sorted alphabetically\r\n const alphaSort = (a, b) => a.displayName ? a.displayName.localeCompareIgnoreCase(b.displayName) : -1;\r\n if (this.allEntryPoints) {\r\n this.allEntryPoints.sort(alphaSort);\r\n } else {\r\n this.allEntryPoints = [];\r\n }\r\n\r\n if (this.entryPointsByType) {\r\n this.entryPointsByType[EnvironmentModuleEntryPointType.Solution].sort(alphaSort);\r\n this.entryPointsByType[EnvironmentModuleEntryPointType.Tool].sort(alphaSort);\r\n }\r\n\r\n // TODO: do we want settings alphabetized?\r\n }\r\n return manifest;\r\n }\r\n\r\n /**\r\n * Gets the environment module.\r\n *\r\n * @param name the name of module.\r\n * @return EnvironmentModule the environment module.\r\n */\r\n public static checkEnvironmentInitialized(): void {\r\n if (!MsftSme || !MsftSme.self().Environment) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.EnvironmentNotInitialized.message;\r\n throw Error(message);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the environment module.\r\n *\r\n * @param name the name of module.\r\n * @return EnvironmentModule the environment module.\r\n */\r\n public static getEnvironmentModule(name: string): EnvironmentModule {\r\n const shellEnvironment = MsftSme.self().Environment;\r\n const modules = shellEnvironment && shellEnvironment.modules;\r\n if (modules) {\r\n for (const module of modules) {\r\n if (module.name === name) {\r\n return <EnvironmentModule>module;\r\n }\r\n }\r\n }\r\n\r\n if (shellEnvironment.name === name) {\r\n return <EnvironmentModule>shellEnvironment;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Process extension targets for quick and easy access later\r\n * @param module the modules to process\r\n */\r\n private static processExtensionTargets(module: EnvironmentModule) {\r\n // initialize tracking structures if they have not been\r\n if (!EnvironmentModule.allExtensionTargets) {\r\n EnvironmentModule.allExtensionTargets = [];\r\n EnvironmentModule.extensionTargetsByType = {};\r\n EnvironmentModule.extensionTargetsById = {};\r\n EnvironmentModule.extensionTargetFulfillmentMap = {};\r\n Object.keys(ExtensionTargetType).forEach(key => this.extensionTargetsByType[ExtensionTargetType[key]] = []);\r\n }\r\n\r\n // stop if there are no extension targets in this module\r\n if (!module.extensionTargets) {\r\n return;\r\n }\r\n\r\n module.extensionTargets.forEach(extensionTarget => {\r\n // ignore invalid types in the manifest\r\n if (!EnvironmentModule.extensionTargetsByType[extensionTarget.extensionTargetType]) {\r\n Logging.log(<LogRecord>{\r\n source: EnvironmentModule.logSourceName,\r\n level: LogLevel.Warning,\r\n consoleGroupHeader: `Unable to determine extensionTargetType.`,\r\n // tslint:disable-next-line:max-line-length\r\n message: `Entry point \"${extensionTarget.name}\" in module \"${module.displayName} has a extensionTargetType of: ${extensionTarget.extensionTargetType}`\r\n });\r\n return;\r\n }\r\n // save the module information into the extension target\r\n extensionTarget.parentModule = module;\r\n\r\n const extensionTargetId = EnvironmentModule.createFormattedExtensionTarget(extensionTarget);\r\n\r\n // save the module information into the extension target\r\n extensionTarget.parentModule = module;\r\n\r\n // push to data structures\r\n EnvironmentModule.allExtensionTargets.push(extensionTarget);\r\n EnvironmentModule.extensionTargetsByType[extensionTarget.extensionTargetType].push(extensionTarget);\r\n EnvironmentModule.extensionTargetsById[extensionTargetId] = extensionTarget;\r\n\r\n // initialize fulfillment map\r\n EnvironmentModule.extensionTargetFulfillmentMap[extensionTargetId] = [];\r\n });\r\n }\r\n\r\n /**\r\n * Process Entry points for quick and easy access later\r\n * @param module the modules to process\r\n */\r\n private static processEntryPoints(module: EnvironmentModule) {\r\n // initialize tracking structures if they have not been\r\n if (!EnvironmentModule.allEntryPoints) {\r\n EnvironmentModule.allEntryPoints = [];\r\n EnvironmentModule.entryPointsByType = {};\r\n EnvironmentModule.entryPointsById = {};\r\n Object.keys(EnvironmentModuleEntryPointType).forEach(key => this.entryPointsByType[EnvironmentModuleEntryPointType[key]] = []);\r\n this.friendlyUrlMap = {\r\n connectionTypes: { to: {}, from: {} },\r\n solutions: { to: {}, from: {} },\r\n tools: { to: {}, from: {} },\r\n settingsForms: { to: {}, from: {} }\r\n };\r\n }\r\n\r\n if (!module.entryPoints) {\r\n return;\r\n }\r\n\r\n module.entryPoints.forEach(entryPoint => {\r\n // ignore invalid types in the manifest\r\n if (!EnvironmentModule.entryPointsByType[entryPoint.entryPointType]) {\r\n Logging.log(<LogRecord>{\r\n source: EnvironmentModule.logSourceName,\r\n level: LogLevel.Warning,\r\n consoleGroupHeader: `Unable to determine entryPointType.`,\r\n // tslint:disable-next-line:max-line-length\r\n message: `Entry point \"${entryPoint.displayName}\" in module \"${module.displayName} has a entryPointType of: ${entryPoint.entryPointType}`\r\n });\r\n return;\r\n }\r\n\r\n // if we have experiment keys, dont process the entry point if any key is not enabled\r\n if (entryPoint.experimentKeys && entryPoint.experimentKeys.some(key => !MsftSme.isExperimentEnabledRaw(key))) {\r\n return;\r\n }\r\n\r\n // save the module information into the entry point\r\n entryPoint.parentModule = module;\r\n\r\n const entryPointId = EnvironmentModule.createFormattedEntrypoint(entryPoint);\r\n\r\n // push to data structures\r\n EnvironmentModule.allEntryPoints.push(entryPoint);\r\n EnvironmentModule.entryPointsByType[entryPoint.entryPointType].push(entryPoint);\r\n EnvironmentModule.entryPointsById[entryPointId] = entryPoint;\r\n\r\n // process url mappings\r\n if (entryPoint.urlName) {\r\n\r\n switch (entryPoint.entryPointType) {\r\n case EnvironmentModuleEntryPointType.Solution:\r\n this.friendlyUrlMap.solutions.to[entryPointId] = entryPoint.urlName;\r\n this.friendlyUrlMap.solutions.from[entryPoint.urlName] = entryPointId;\r\n break;\r\n case EnvironmentModuleEntryPointType.Tool:\r\n this.friendlyUrlMap.tools.to[entryPointId] = entryPoint.urlName;\r\n this.friendlyUrlMap.tools.from[entryPoint.urlName] = entryPointId;\r\n break;\r\n case EnvironmentModuleEntryPointType.SettingsForm:\r\n this.friendlyUrlMap.settingsForms.to[entryPointId] = entryPoint.urlName;\r\n this.friendlyUrlMap.settingsForms.from[entryPoint.urlName] = entryPointId;\r\n break;\r\n case EnvironmentModuleEntryPointType.ConnectionProvider:\r\n if (entryPoint.connectionTypeUrlName) {\r\n this.friendlyUrlMap.connectionTypes.to[entryPoint.connectionType] = entryPoint.connectionTypeUrlName;\r\n this.friendlyUrlMap.connectionTypes.from[entryPoint.connectionTypeUrlName] = entryPoint.connectionType;\r\n }\r\n }\r\n }\r\n\r\n if (entryPoint.entryPointType === EnvironmentModuleEntryPointType.ConnectionProvider && entryPoint.connectionTypeUrlName) {\r\n this.friendlyUrlMap.connectionTypes.to[entryPoint.connectionType] = entryPoint.connectionTypeUrlName;\r\n this.friendlyUrlMap.connectionTypes.from[entryPoint.connectionTypeUrlName] = entryPoint.connectionType;\r\n }\r\n\r\n // process extension mappings\r\n if (entryPoint.extends) {\r\n entryPoint.extends.forEach(extender => {\r\n const extensionTarget = EnvironmentModule.getExtensionTargets(target => {\r\n return target.parentModule.name === extender.module\r\n && target.name === extender.target;\r\n }).first();\r\n\r\n if (MsftSme.isNullOrUndefined(extensionTarget)) {\r\n // if we get here, either that target is no longer supported or the target extension is not installed.\r\n return;\r\n }\r\n\r\n const extensionTargetId = EnvironmentModule.createFormattedExtensionTarget(extensionTarget);\r\n EnvironmentModule.extensionTargetFulfillmentMap[extensionTargetId].push(entryPointId);\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Evaluates all of the modules in the environment and returns a flat list of all of their entry points.\r\n * optionally filtered by the 'filter' function\r\n *\r\n * @param filter the filter to apply to the entry points.\r\n * @return a flat list of all module entry points\r\n */\r\n private static getExtensionTargets(filter?: (extensionTarget: ExtensionTarget) => boolean): ExtensionTarget[] {\r\n return filter ? EnvironmentModule.allExtensionTargets.filter(filter) : EnvironmentModule.allExtensionTargets;\r\n }\r\n\r\n /**\r\n * Evaluates all of the modules in the environment and returns a flat list of all of their entry points.\r\n * optionally filtered by the 'filter' function\r\n *\r\n * @param filter the filter to apply to the entry points.\r\n * @return a flat list of all module entry points\r\n */\r\n public static getEntryPoints(filter?: (entryPoint: EnvironmentModuleEntryPoint) => boolean): EnvironmentModuleEntryPoint[] {\r\n EnvironmentModule.checkEnvironmentInitialized();\r\n return filter ? EnvironmentModule.allEntryPoints.filter(filter) : EnvironmentModule.allEntryPoints;\r\n }\r\n\r\n /**\r\n * Gets the available entry points from all of the modules in the environment, filtered by type.\r\n *\r\n * @param name the name of module.\r\n * @return EnvironmentModule the environment module.\r\n */\r\n public static getEntryPointsByType(entryPointTypes: EnvironmentModuleEntryPointType[]): EnvironmentModuleEntryPoint[] {\r\n EnvironmentModule.checkEnvironmentInitialized();\r\n return entryPointTypes.mapMany<EnvironmentModuleEntryPoint>(type => EnvironmentModule.entryPointsByType[type]);\r\n }\r\n\r\n /**\r\n * Gets the connection type mapping data.\r\n *\r\n * @return the mapping object.\r\n */\r\n public static fulfillExtensionTarget(extensionTargetId): string[] {\r\n EnvironmentModule.checkEnvironmentInitialized();\r\n return EnvironmentModule.extensionTargetFulfillmentMap[extensionTargetId];\r\n }\r\n\r\n /**\r\n * Gets the connection type mapping data.\r\n *\r\n * @return the mapping object.\r\n */\r\n public static getConnectionMap(): { [name: string]: EnvironmentConnectionTypeInfo } {\r\n if (!EnvironmentModule.connectionMap) {\r\n EnvironmentModule.connectionMap = EnvironmentModule.createConnectionMap();\r\n }\r\n\r\n return EnvironmentModule.connectionMap;\r\n }\r\n\r\n /**\r\n * Gets a friendly url segment from a connection type\r\n * @param connectionType the connection type to map.\r\n * @return string friendly url for the connection type or the connection type if no friendly name exists.\r\n */\r\n public static getFriendlyUrlSegmentForConnectionType(connectionType: string, fallbackToUnfriendlySegment = true): string {\r\n return EnvironmentModule.friendlyUrlMap.connectionTypes.to[connectionType] || (fallbackToUnfriendlySegment ? connectionType : null);\r\n }\r\n\r\n /**\r\n * Gets a connection type from a friendly url segment\r\n * @param urlSegment the url segment to map\r\n * @return string connection type found using the friendly url segment\r\n */\r\n public static getConnectionTypeFromFriendlyUrlSegment(urlSegment: string): string {\r\n return EnvironmentModule.friendlyUrlMap.connectionTypes.from[urlSegment];\r\n }\r\n\r\n /**\r\n * Gets a friendly url segment from an entry point id\r\n * @param urlSegment the url segment.\r\n * @param entryPointType the type of entry point to look for.\r\n * @return string friendly url for the entry point id\r\n */\r\n public static getFriendlyUrlSegmentForEntryPoint(\r\n entryPoint: string, entryPointType: EnvironmentModuleEntryPointType, fallbackToUnfriendlySegment = true): string {\r\n switch (entryPointType) {\r\n case EnvironmentModuleEntryPointType.Solution:\r\n return EnvironmentModule.friendlyUrlMap.solutions.to[entryPoint] || (fallbackToUnfriendlySegment ? entryPoint : null);\r\n case EnvironmentModuleEntryPointType.Tool:\r\n return EnvironmentModule.friendlyUrlMap.tools.to[entryPoint] || (fallbackToUnfriendlySegment ? entryPoint : null);\r\n case EnvironmentModuleEntryPointType.SettingsForm:\r\n return EnvironmentModule.friendlyUrlMap.settingsForms.to[entryPoint] || (fallbackToUnfriendlySegment ? entryPoint : null);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets a friendly url segment for an entry point\r\n * @param urlSegment the url segment.\r\n * @param entryPointType the type of entry point to look for.\r\n * @return string friendly url for the entry point\r\n */\r\n public static getEntryPointFromFriendlyUrlSegment(urlSegment: string, entryPointType: EnvironmentModuleEntryPointType): string {\r\n switch (entryPointType) {\r\n case EnvironmentModuleEntryPointType.Solution:\r\n return EnvironmentModule.friendlyUrlMap.solutions.from[urlSegment];\r\n case EnvironmentModuleEntryPointType.Tool:\r\n return EnvironmentModule.friendlyUrlMap.tools.from[urlSegment];\r\n case EnvironmentModuleEntryPointType.SettingsForm:\r\n return EnvironmentModule.friendlyUrlMap.settingsForms.from[urlSegment];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the connection type information.\r\n *\r\n * @param typeName the type name.\r\n * @return EnvironmentConnectionTypeInfo the connection type information.\r\n */\r\n public static getConnectionTypeInfo(typeName: string): EnvironmentConnectionTypeInfo {\r\n return EnvironmentModule.getConnectionMap()[typeName];\r\n }\r\n\r\n private static createConnectionMap(): { [name: string]: EnvironmentConnectionTypeInfo } {\r\n const map: { [name: string]: EnvironmentConnectionTypeInfo } = {};\r\n const providers = this.getEntryPointsByType([EnvironmentModuleEntryPointType.ConnectionProvider]);\r\n providers.forEach(provider => {\r\n if (!provider.connectionTypeDefaultSolution) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.EnvironmentMissingDefault.message;\r\n throw new Error(message);\r\n }\r\n\r\n const solutionEntrypoint = EnvironmentModule.splitFormattedEntrypoint(provider.connectionTypeDefaultSolution);\r\n const solution = this.getEntryPointsByType([EnvironmentModuleEntryPointType.Solution])\r\n .first(ep => ep.parentModule.name === solutionEntrypoint.moduleName && ep.name === solutionEntrypoint.entrypointName);\r\n map[provider.connectionType] = <EnvironmentConnectionTypeInfo>{ provider, solution };\r\n if (solution && solution.parentModule && solution.parentModule.name) {\r\n map[solution.parentModule.name] = map[provider.connectionType];\r\n }\r\n });\r\n\r\n return map;\r\n }\r\n\r\n /**\r\n * splits an entrypoint identifier string into its respective module and entrypoint names\r\n * @param format the formatted entrypoint identifier string\r\n */\r\n public static splitFormattedEntrypoint(format: string) {\r\n const parts = format.split('!');\r\n return { moduleName: parts[0], entrypointName: parts[1] };\r\n }\r\n\r\n /**\r\n * creates a formatted entrypoint identifier string from an entrypoint\r\n * @param entryPoint the entrypoint to create the string from\r\n */\r\n public static createFormattedEntrypoint(entryPoint: EnvironmentModuleEntryPoint) {\r\n return EnvironmentModule.createEntrypointId(entryPoint.parentModule.name, entryPoint.name);\r\n }\r\n\r\n public static createEntrypointId(moduleName: string, entryPointName: string) {\r\n return `${moduleName}!${entryPointName}`;\r\n }\r\n\r\n /**\r\n * Create a formatted iframe ID used to link iframes and their html element\r\n * Replace . with - because . is not permitted in css selectors required for testing\r\n * @param parentModuleName the name of the parent module of the iframe content\r\n * @param entryPointName the name of the entry point loaded by the iframe\r\n */\r\n public static createFormattedIFrameId(parentModuleName: string, entryPointName: string): string {\r\n const parentModuleId = MsftSme.replaceAll(parentModuleName, '.', '-');\r\n return '{0}-{1}'.format(parentModuleId, entryPointName);\r\n }\r\n\r\n /**\r\n * splits an extension target identifier string into its respective module and extension target names\r\n * @param format the formatted extension target identifier string\r\n */\r\n public static splitFormattedExtensionTarget(format: string) {\r\n const parts = format.split('!');\r\n return { moduleName: parts[0], extensionTargetName: parts[1] };\r\n }\r\n\r\n /**\r\n * creates a formatted extension target identifier string from an extension target\r\n * @param entryPoint the extension target to create the string from\r\n */\r\n public static createFormattedExtensionTarget(extensionTarget: ExtensionTarget) {\r\n return `${extensionTarget.parentModule.name}!${extensionTarget.name}`;\r\n }\r\n\r\n /**\r\n * resolves an entrypoint from a formatted entrypoint identifier string\r\n * @param formattedEntrypointIdentifier the formatted entrypoint identifier string\r\n */\r\n public static resolveEntrypoint(formattedEntrypointIdentifier: string): EnvironmentModuleEntryPoint {\r\n if (!formattedEntrypointIdentifier) {\r\n return null;\r\n }\r\n const parts = EnvironmentModule.splitFormattedEntrypoint(formattedEntrypointIdentifier);\r\n if (!parts.moduleName || !parts.entrypointName) {\r\n return null;\r\n }\r\n const entryPoints = this.getEntryPoints(ep => ep.name === parts.entrypointName && ep.parentModule.name === parts.moduleName);\r\n return entryPoints[0] || null;\r\n }\r\n\r\n /**\r\n * Gets the name of current shell or module.\r\n */\r\n public static getModuleName(): string {\r\n const self = MsftSme.self();\r\n return self.Init.moduleName;\r\n }\r\n\r\n /**\r\n * Gets the version of current shell or module.\r\n */\r\n public static getModuleVersion(): string {\r\n const self = MsftSme.self();\r\n if (self.Environment.version) {\r\n return self.Environment.version;\r\n }\r\n\r\n for (const module of self.Environment.modules) {\r\n if (module.name === self.Init.moduleName && module.version) {\r\n self.Environment.version = module.version;\r\n return module.version;\r\n }\r\n }\r\n\r\n return '0.0.0';\r\n }\r\n\r\n /**\r\n * Compare the shell version with specified version.\r\n * - this function must be called after NavigationService Init was called, otherwise it\r\n * cannot get current shell version and return false.\r\n *\r\n * @param version the version to compare.\r\n * @return true if shell has newer version running.\r\n */\r\n public static shellGreaterOrEqual(version: string): boolean {\r\n const versionSegments = version.split('.');\r\n if (MsftSme.isNullOrWhiteSpace(version)) {\r\n // shell doesn't give version.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'version is empty.');\r\n return false;\r\n }\r\n\r\n if (versionSegments.length !== 3) {\r\n // shell doesn't give right version format.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'version format is not right.');\r\n return false;\r\n }\r\n\r\n const shellVersion = MsftSme.self().Init.shellVersion;\r\n if (MsftSme.isNullOrWhiteSpace(shellVersion)) {\r\n // shell doesn't give version.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'shell version is not available.');\r\n return false;\r\n }\r\n\r\n const shellSegments = shellVersion.split('.');\r\n if (shellSegments.length !== 3) {\r\n // shell doesn't give right version format.\r\n Logging.logError('EnvironmentModule.shellGreaterOrEqual', 'shell version is corrupted.');\r\n return false;\r\n }\r\n\r\n const digits = versionSegments.map(digit => {\r\n const num = Number(digit);\r\n return isNaN(num) ? 0 : num;\r\n });\r\n const shellVersions = shellSegments.map(digit => {\r\n const num = Number(digit);\r\n return isNaN(num) ? 0 : num;\r\n });\r\n if (shellVersions[0] < digits[0]\r\n || (shellVersions[0] === digits[0] && shellVersions[1] < digits[1])\r\n || (shellVersions[0] === digits[0] && shellVersions[1] === digits[1] && shellVersions[2] < digits[2])) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n"]}
@@ -71,7 +71,7 @@ export class PowerShellNotification extends SocketSignalR {
71
71
  this.subscribeSession(metadata.id);
72
72
  return of({ id: metadata.id, state: NotificationState.Started, error: null });
73
73
  }
74
- const data = Net.createPropertiesJSONString(Object.assign(Object.assign({}, command), { metadata: metadata }));
74
+ const data = Net.createPropertiesJSONString(Object.assign(Object.assign(Object.assign({}, command), { useInProcRunspace: nodeRequestOptions.useInProcRunspace }), { metadata: metadata }));
75
75
  return nodeConnection.post(nodeName, Net.powerShellApiInvokeCommand, data, nodeRequestOptions)
76
76
  .pipe(catchError((error, obj) => {
77
77
  SmeWebTelemetry.tracePowershellEvent(command, TelemetryEventStates.Error, { response: error.response });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/notification/powershell-notification.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAc,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAiB,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAyBpF;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,aAAwC;IAgChF,8BAA8B;IAE9B;;OAEG;IACH,YAAY,UAAkB;QAC1B,KAAK,CAAC,UAAU,EAAE,sBAAsB,CAAC,aAAa,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAC9F,CAAC;IAhCD,+BAA+B;IACxB,MAAM,CAAC,kBAAkB,CAAC,IAA8C;QAC3E,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,eAAe,CAAC,KAAK,kBAAkB,CAAC,eAAe,CAAC;IACnG,CAAC;IAEM,MAAM,CAAC,Q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,QAAQ,CAAC;AAClB,gCAAS,GAAG,WAAW,CAAC","file":"powershell-notification.js","sourcesContent":["/// <reference types='jquery' />\r\n\r\nimport { Observable, of, Subject } from 'rxjs';\r\nimport { AjaxError } from 'rxjs/ajax';\r\nimport { catchError, map } from 'rxjs/operators';\r\nimport { Net } from '../data/net';\r\nimport { NodeConnection, NodeRequestOptions } from '../data/node-connection';\r\nimport { PowerShellCommand } from '../data/powershell';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { SmeWebTelemetry } from '../diagnostics/sme-web-telemetry';\r\nimport { TelemetryEventStates } from '../diagnostics/sme-web-telemetry-models';\r\nimport { Strings } from '../generated/strings';\r\nimport { NotificationState } from './notification-state';\r\nimport { SocketMessage, SocketMessageFlags, SocketSignalR } from './socket-signalr';\r\nimport { WorkItemResult } from './work-item-request';\r\n\r\n/**\r\n * PowerShell Submit result object.\r\n */\r\nexport interface PowerShellSubmitResult {\r\n id: string;\r\n completed: boolean;\r\n error: any;\r\n state: NotificationState;\r\n}\r\n\r\n/**\r\n * Powershell work item message.\r\n */\r\nexport interface PowerShellWorkItemMessage {\r\n sessionId?: string;\r\n completed?: string; // True, False\r\n results?: any[];\r\n progress?: any[];\r\n errors?: any[];\r\n exception?: string;\r\n}\r\n\r\n/**\r\n * The PowerShell script based notification class.\r\n */\r\nexport class PowerShellNotification extends SocketSignalR<PowerShellWorkItemMessage> {\r\n private static connectionUrl = '/api/notifications';\r\n private static proxyName = 'notificationHub';\r\n private static notify = 'notify';\r\n private static subscribe = 'Subscribe';\r\n private subjectInternal: Subject<SocketMessage<PowerShellWorkItemMessage>>;\r\n\r\n /* tslint:disable:no-bitwise */\r\n public static hasConnectionError(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.ConnectionError) === SocketMessageFlags.ConnectionError;\r\n }\r\n\r\n public static hasError(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Error) === SocketMessageFlags.Error;\r\n }\r\n\r\n public static hasException(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Exception) === SocketMessageFlags.Exception;\r\n }\r\n\r\n public static hasCompleted(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Completed) === SocketMessageFlags.Completed;\r\n }\r\n\r\n public static hasData(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Data) === SocketMessageFlags.Data;\r\n }\r\n\r\n public static hasProgress(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Progress) === SocketMessageFlags.Progress;\r\n }\r\n\r\n /* tslint:enable:no-bitwise */\r\n\r\n /**\r\n * Initializes a new instance of the GatewaySocket class.\r\n */\r\n constructor(gatewayUrl: string) {\r\n super(gatewayUrl, PowerShellNotification.connectionUrl, PowerShellNotification.proxyName);\r\n }\r\n\r\n /**\r\n * Gets the subject observable to get notifications.\r\n */\r\n public get subject(): Subject<SocketMessage<PowerShellWorkItemMessage>> {\r\n return this.subjectInternal;\r\n }\r\n\r\n /**\r\n * Submit PowerShell command as a work item.\r\n *\r\n * @param nodeConnection The node connection.\r\n * @param command The PowerShell command.\r\n * @param metadata The meta data.\r\n * @param nodeRequestOptions The node request options.\r\n * @param create The callback to create new notification.\r\n * @return Observable the observable of initial powershell query result.\r\n */\r\n public submit(\r\n nodeConnection: NodeConnection,\r\n nodeName: string,\r\n command: PowerShellCommand,\r\n metadata: any,\r\n nodeRequestOptions?: NodeRequestOptions,\r\n create?: (result: PowerShellSubmitResult) => void): Observable<WorkItemResult> {\r\n // For a non-powershell long running task (eg: azure site recovery setup):\r\n // The 'command' parameter is null.\r\n // The metadata.id is the workitem id generated by a gateway api.\r\n if (!command && metadata.id) {\r\n const result = <PowerShellSubmitResult>{\r\n id: metadata.id,\r\n completed: false,\r\n error: null,\r\n state: NotificationState.Started\r\n };\r\n if (create) {\r\n create(result);\r\n }\r\n\r\n this.subscribeSession(metadata.id);\r\n return of(<WorkItemResult>{ id: metadata.id, state: NotificationState.Started, error: null });\r\n }\r\n\r\n const data: any = Net.createPropertiesJSONString({ ...command, ...{ metadata: metadata } });\r\n return nodeConnection.post(nodeName, Net.powerShellApiInvokeCommand, data, nodeRequestOptions)\r\n .pipe(\r\n catchError((error: AjaxError, obj) => {\r\n SmeWebTelemetry.tracePowershellEvent(command, TelemetryEventStates.Error,\r\n {response: error.response});\r\n\r\n const result = <PowerShellSubmitResult>{\r\n id: MsftSme.newGuid(),\r\n completed: true,\r\n error: { message: Net.getErrorMessage(error) },\r\n state: NotificationState.Error\r\n };\r\n if (create) {\r\n create(result);\r\n }\r\n\r\n return of(<WorkItemResult>{ id: result.id, state: result.state, error: result.error });\r\n }),\r\n map((response: any) => {\r\n const completed = response.completed === 'True';\r\n\r\n if (response.id) {\r\n // sending back the client for the error.\r\n return <WorkItemResult>response;\r\n }\r\n\r\n let error: any = null;\r\n if (response.errors && response.errors.length > 0) {\r\n const errorObj: any = MsftSme.first(response.errors);\r\n error = { message: errorObj.message };\r\n\r\n SmeWebTelemetry.tracePowershellEvent(command,\r\n TelemetryEventStates.Error,\r\n {response: response});\r\n }\r\n\r\n const result = <PowerShellSubmitResult>{\r\n id: response.sessionId,\r\n completed: completed,\r\n error: error,\r\n state: completed ?\r\n (response.errors ? NotificationState.Error : NotificationState.Success)\r\n : NotificationState.Started\r\n };\r\n\r\n if (result.state === NotificationState.Success) {\r\n result.error = response.results[0];\r\n }\r\n\r\n if (create) {\r\n create(result);\r\n }\r\n\r\n if (!result.completed) {\r\n this.subscribeSession(response.sessionId);\r\n\r\n // store ID here to correlate command with the gateway notification later\r\n const powershellCommandId = response.id ? response.id : response.sessionId;\r\n SmeWebTelemetry.addPowershellId(powershellCommandId, command);\r\n }\r\n\r\n this.processData(response);\r\n\r\n // sending back the client.\r\n return <WorkItemResult>{ id: result.id, state: result.state, error: error };\r\n }));\r\n }\r\n\r\n /**\r\n * Initialize to subscribe the web socket connection.\r\n */\r\n public initialize(): JQueryPromise<any> {\r\n if (this.subjectInternal) {\r\n this.subjectInternal.complete();\r\n }\r\n\r\n this.subjectInternal = new Subject<SocketMessage<PowerShellWorkItemMessage>>();\r\n this.subscribe(PowerShellNotification.notify);\r\n return this.start();\r\n }\r\n\r\n /**\r\n * Uninitialize to subscribe the web socket connection.\r\n */\r\n public uninitialize(): void {\r\n if (this.subjectInternal) {\r\n this.subjectInternal.complete();\r\n this.subjectInternal = null;\r\n }\r\n\r\n this.unsubscribe(PowerShellNotification.notify);\r\n this.stop();\r\n }\r\n\r\n /**\r\n * Invoke subscribe method to a session.\r\n *\r\n * @param id the session ID of work item.\r\n * @return Promise the promise object.\r\n */\r\n public subscribeSession(id: string): JQueryPromise<any> {\r\n return this.invoke(PowerShellNotification.subscribe, id);\r\n }\r\n\r\n /**\r\n * The client handler to process message.\r\n *\r\n * @param notification the message notification.\r\n */\r\n protected clientHandler(notification: SocketMessage<PowerShellWorkItemMessage>): void {\r\n this.subjectInternal.next(notification);\r\n }\r\n\r\n /**\r\n * Process the message.\r\n *\r\n * @param messages the messages.\r\n */\r\n protected processMessage(message: string): void {\r\n if (!message) {\r\n const message2 = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationEmptyMessage.message;\r\n Logging.log({ source: 'socket', level: LogLevel.Warning, message: message2 });\r\n return;\r\n }\r\n\r\n const data: any = JSON.parse(message);\r\n this.processData(data);\r\n }\r\n\r\n private processData(data: any): void {\r\n /* tslint:disable:no-bitwise */\r\n let type: SocketMessageFlags = SocketMessageFlags.None;\r\n if (data.results && data.results.length > 0) {\r\n type |= SocketMessageFlags.Data;\r\n }\r\n\r\n if (data.progress && data.progress.length > 0) {\r\n type |= SocketMessageFlags.Progress;\r\n }\r\n\r\n if (data.errors && data.errors.length > 0) {\r\n type |= SocketMessageFlags.Error;\r\n }\r\n\r\n if (data.exception) {\r\n type |= SocketMessageFlags.Exception;\r\n }\r\n\r\n if (data.completed === 'True') {\r\n type |= SocketMessageFlags.Completed;\r\n }\r\n\r\n /* tslint:enable:no-bitwise */\r\n\r\n this.clientHandler({ type: type, message: data });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/notification/powershell-notification.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAc,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAiB,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAyBpF;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,aAAwC;IAgChF,8BAA8B;IAE9B;;OAEG;IACH,YAAY,UAAkB;QAC1B,KAAK,CAAC,UAAU,EAAE,sBAAsB,CAAC,aAAa,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAC9F,CAAC;IAhCD,+BAA+B;IACxB,MAAM,CAAC,kBAAkB,CAAC,IAA8C;QAC3E,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,eAAe,CAAC,KAAK,kBAAkB,CAAC,eAAe,CAAC;IACnG,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA8C;QACjE,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,KAAK,kBAAkB,CAAC,KAAK,C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types='jquery' />\r\n\r\nimport { Observable, of, Subject } from 'rxjs';\r\nimport { AjaxError } from 'rxjs/ajax';\r\nimport { catchError, map } from 'rxjs/operators';\r\nimport { Net } from '../data/net';\r\nimport { NodeConnection, NodeRequestOptions } from '../data/node-connection';\r\nimport { PowerShellCommand } from '../data/powershell';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { SmeWebTelemetry } from '../diagnostics/sme-web-telemetry';\r\nimport { TelemetryEventStates } from '../diagnostics/sme-web-telemetry-models';\r\nimport { Strings } from '../generated/strings';\r\nimport { NotificationState } from './notification-state';\r\nimport { SocketMessage, SocketMessageFlags, SocketSignalR } from './socket-signalr';\r\nimport { WorkItemResult } from './work-item-request';\r\n\r\n/**\r\n * PowerShell Submit result object.\r\n */\r\nexport interface PowerShellSubmitResult {\r\n id: string;\r\n completed: boolean;\r\n error: any;\r\n state: NotificationState;\r\n}\r\n\r\n/**\r\n * Powershell work item message.\r\n */\r\nexport interface PowerShellWorkItemMessage {\r\n sessionId?: string;\r\n completed?: string; // True, False\r\n results?: any[];\r\n progress?: any[];\r\n errors?: any[];\r\n exception?: string;\r\n}\r\n\r\n/**\r\n * The PowerShell script based notification class.\r\n */\r\nexport class PowerShellNotification extends SocketSignalR<PowerShellWorkItemMessage> {\r\n private static connectionUrl = '/api/notifications';\r\n private static proxyName = 'notificationHub';\r\n private static notify = 'notify';\r\n private static subscribe = 'Subscribe';\r\n private subjectInternal: Subject<SocketMessage<PowerShellWorkItemMessage>>;\r\n\r\n /* tslint:disable:no-bitwise */\r\n public static hasConnectionError(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.ConnectionError) === SocketMessageFlags.ConnectionError;\r\n }\r\n\r\n public static hasError(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Error) === SocketMessageFlags.Error;\r\n }\r\n\r\n public static hasException(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Exception) === SocketMessageFlags.Exception;\r\n }\r\n\r\n public static hasCompleted(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Completed) === SocketMessageFlags.Completed;\r\n }\r\n\r\n public static hasData(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Data) === SocketMessageFlags.Data;\r\n }\r\n\r\n public static hasProgress(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n return (item.type & SocketMessageFlags.Progress) === SocketMessageFlags.Progress;\r\n }\r\n\r\n /* tslint:enable:no-bitwise */\r\n\r\n /**\r\n * Initializes a new instance of the GatewaySocket class.\r\n */\r\n constructor(gatewayUrl: string) {\r\n super(gatewayUrl, PowerShellNotification.connectionUrl, PowerShellNotification.proxyName);\r\n }\r\n\r\n /**\r\n * Gets the subject observable to get notifications.\r\n */\r\n public get subject(): Subject<SocketMessage<PowerShellWorkItemMessage>> {\r\n return this.subjectInternal;\r\n }\r\n\r\n /**\r\n * Submit PowerShell command as a work item.\r\n *\r\n * @param nodeConnection The node connection.\r\n * @param command The PowerShell command.\r\n * @param metadata The meta data.\r\n * @param nodeRequestOptions The node request options.\r\n * @param create The callback to create new notification.\r\n * @return Observable the observable of initial powershell query result.\r\n */\r\n public submit(\r\n nodeConnection: NodeConnection,\r\n nodeName: string,\r\n command: PowerShellCommand,\r\n metadata: any,\r\n nodeRequestOptions?: NodeRequestOptions,\r\n create?: (result: PowerShellSubmitResult) => void): Observable<WorkItemResult> {\r\n // For a non-powershell long running task (eg: azure site recovery setup):\r\n // The 'command' parameter is null.\r\n // The metadata.id is the workitem id generated by a gateway api.\r\n if (!command && metadata.id) {\r\n const result = <PowerShellSubmitResult>{\r\n id: metadata.id,\r\n completed: false,\r\n error: null,\r\n state: NotificationState.Started\r\n };\r\n if (create) {\r\n create(result);\r\n }\r\n\r\n this.subscribeSession(metadata.id);\r\n return of(<WorkItemResult>{ id: metadata.id, state: NotificationState.Started, error: null });\r\n }\r\n\r\n const data: any = Net.createPropertiesJSONString({\r\n ...command,\r\n useInProcRunspace: nodeRequestOptions.useInProcRunspace,\r\n ...{ metadata: metadata } });\r\n return nodeConnection.post(nodeName, Net.powerShellApiInvokeCommand, data, nodeRequestOptions)\r\n .pipe(\r\n catchError((error: AjaxError, obj) => {\r\n SmeWebTelemetry.tracePowershellEvent(command, TelemetryEventStates.Error,\r\n {response: error.response});\r\n\r\n const result = <PowerShellSubmitResult>{\r\n id: MsftSme.newGuid(),\r\n completed: true,\r\n error: { message: Net.getErrorMessage(error) },\r\n state: NotificationState.Error\r\n };\r\n if (create) {\r\n create(result);\r\n }\r\n\r\n return of(<WorkItemResult>{ id: result.id, state: result.state, error: result.error });\r\n }),\r\n map((response: any) => {\r\n const completed = response.completed === 'True';\r\n\r\n if (response.id) {\r\n // sending back the client for the error.\r\n return <WorkItemResult>response;\r\n }\r\n\r\n let error: any = null;\r\n if (response.errors && response.errors.length > 0) {\r\n const errorObj: any = MsftSme.first(response.errors);\r\n error = { message: errorObj.message };\r\n\r\n SmeWebTelemetry.tracePowershellEvent(command,\r\n TelemetryEventStates.Error,\r\n {response: response});\r\n }\r\n\r\n const result = <PowerShellSubmitResult>{\r\n id: response.sessionId,\r\n completed: completed,\r\n error: error,\r\n state: completed ?\r\n (response.errors ? NotificationState.Error : NotificationState.Success)\r\n : NotificationState.Started\r\n };\r\n\r\n if (result.state === NotificationState.Success) {\r\n result.error = response.results[0];\r\n }\r\n\r\n if (create) {\r\n create(result);\r\n }\r\n\r\n if (!result.completed) {\r\n this.subscribeSession(response.sessionId);\r\n\r\n // store ID here to correlate command with the gateway notification later\r\n const powershellCommandId = response.id ? response.id : response.sessionId;\r\n SmeWebTelemetry.addPowershellId(powershellCommandId, command);\r\n }\r\n\r\n this.processData(response);\r\n\r\n // sending back the client.\r\n return <WorkItemResult>{ id: result.id, state: result.state, error: error };\r\n }));\r\n }\r\n\r\n /**\r\n * Initialize to subscribe the web socket connection.\r\n */\r\n public initialize(): JQueryPromise<any> {\r\n if (this.subjectInternal) {\r\n this.subjectInternal.complete();\r\n }\r\n\r\n this.subjectInternal = new Subject<SocketMessage<PowerShellWorkItemMessage>>();\r\n this.subscribe(PowerShellNotification.notify);\r\n return this.start();\r\n }\r\n\r\n /**\r\n * Uninitialize to subscribe the web socket connection.\r\n */\r\n public uninitialize(): void {\r\n if (this.subjectInternal) {\r\n this.subjectInternal.complete();\r\n this.subjectInternal = null;\r\n }\r\n\r\n this.unsubscribe(PowerShellNotification.notify);\r\n this.stop();\r\n }\r\n\r\n /**\r\n * Invoke subscribe method to a session.\r\n *\r\n * @param id the session ID of work item.\r\n * @return Promise the promise object.\r\n */\r\n public subscribeSession(id: string): JQueryPromise<any> {\r\n return this.invoke(PowerShellNotification.subscribe, id);\r\n }\r\n\r\n /**\r\n * The client handler to process message.\r\n *\r\n * @param notification the message notification.\r\n */\r\n protected clientHandler(notification: SocketMessage<PowerShellWorkItemMessage>): void {\r\n this.subjectInternal.next(notification);\r\n }\r\n\r\n /**\r\n * Process the message.\r\n *\r\n * @param messages the messages.\r\n */\r\n protected processMessage(message: string): void {\r\n if (!message) {\r\n const message2 = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationEmptyMessage.message;\r\n Logging.log({ source: 'socket', level: LogLevel.Warning, message: message2 });\r\n return;\r\n }\r\n\r\n const data: any = JSON.parse(message);\r\n this.processData(data);\r\n }\r\n\r\n private processData(data: any): void {\r\n /* tslint:disable:no-bitwise */\r\n let type: SocketMessageFlags = SocketMessageFlags.None;\r\n if (data.results && data.results.length > 0) {\r\n type |= SocketMessageFlags.Data;\r\n }\r\n\r\n if (data.progress && data.progress.length > 0) {\r\n type |= SocketMessageFlags.Progress;\r\n }\r\n\r\n if (data.errors && data.errors.length > 0) {\r\n type |= SocketMessageFlags.Error;\r\n }\r\n\r\n if (data.exception) {\r\n type |= SocketMessageFlags.Exception;\r\n }\r\n\r\n if (data.completed === 'True') {\r\n type |= SocketMessageFlags.Completed;\r\n }\r\n\r\n /* tslint:enable:no-bitwise */\r\n\r\n this.clientHandler({ type: type, message: data });\r\n }\r\n}\r\n"]}
@@ -9,6 +9,41 @@ export declare class SmePerformanceSummary {
9
9
  [index: string]: number;
10
10
  };
11
11
  }
12
+ /**
13
+ * Web Vitals metrics to track. See more details at https://web.dev/vitals/
14
+ */
15
+ export declare enum WebVitalFields {
16
+ CLS = "CumulativeLayoutShift",
17
+ LCP = "LargestContentfulPaint",
18
+ FCP = "FirstContentfulPaint",
19
+ FID = "FirstInputDelay",
20
+ TTFB = "TimeToFirstByte",
21
+ TBT = "TotalBlockingTime",
22
+ TTI = "TimeToInteractive"
23
+ }
24
+ /**
25
+ * List performance entry types that are relevant for our metrics.
26
+ */
27
+ export declare enum PerformanceEntryType {
28
+ LongTask = "longtask",
29
+ Resource = "resource",
30
+ Mark = "mark",
31
+ Navigation = "navigation"
32
+ }
33
+ /**
34
+ * Simplified performance entry type with only a start time, end time, and entryType.
35
+ */
36
+ export declare class TaskTiming {
37
+ startTime: number;
38
+ endTime: number;
39
+ entryType: PerformanceEntryType;
40
+ }
41
+ /**
42
+ * Performance tracker class handles two things:
43
+ * 1) Tracking lighthouse metrics (see https://web.dev/vitals/)
44
+ * 2) Providing a wrapper to mark various times in code for performance measurement.
45
+ * This is used primarily for shell and various tools to determine load times.
46
+ */
12
47
  export declare class PerformanceTracker {
13
48
  static get smePrefix(): string;
14
49
  private static markIndexLoaded;
@@ -32,6 +67,38 @@ export declare class PerformanceTracker {
32
67
  * Used to keep track of various marks when measuring arbitrary timings.
33
68
  */
34
69
  private static dataLoadMap;
70
+ /**
71
+ * Counter for total blocking time on initial loadup. This should be reset every time a new page is initialized.
72
+ */
73
+ private static totalBlockingTime;
74
+ private static lighthouseMetrics;
75
+ private static ttiIntervalCheck;
76
+ private static ttiInProgress;
77
+ private static wacPo;
78
+ private static fcp;
79
+ private static tasks;
80
+ static readonly timeToInteractiveNotFound = -1;
81
+ static readonly quietWindowLength = 5000;
82
+ static readonly ttiTimeout = 10000;
83
+ static readonly ttiTimeoutThreshold = 2;
84
+ static readonly totalBlockingTimeThresholdRequirement = 50;
85
+ private static setLighthouseField;
86
+ /**
87
+ * Calculate Time to Interactive using list of longtask and resource events. Time to Interactive calculation
88
+ * method can be found at https://web.dev/tti#what-is-tti
89
+ * @param taskList List of all longtask and resource events from current time.
90
+ * @returns Returns time to interactive if it exists, TTI_NOT_FOUND if not.
91
+ */
92
+ static tryFindTti(taskList: TaskTiming[]): number;
93
+ /**
94
+ * Initialize interval to calculate time to interactive. TTI will only be calculated if WAC is in non-production mode;
95
+ * b/c calculation itself is non-performant. In production, we will use FID as a proxy for TTI.
96
+ */
97
+ static tryStartCalculatingTimeToInteractive(): void;
98
+ /**
99
+ * Initialize web-vitals trackers for all lighthouse metrics.
100
+ */
101
+ static initializeLighthouseMetricsTrackers(): void;
35
102
  static coreEnvironmentInitStarted(): void;
36
103
  static coreEnvironmentInitCompleted(): void;
37
104
  static manifestLoadStarted(): void;