@microsoft/windows-admin-center-sdk 4.87.0 → 4.167.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) 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/id-ID/strings.json +1 -1
  7. package/angular/assets/strings/it-IT/strings.json +1 -1
  8. package/angular/assets/strings/ja-JP/strings.json +1 -1
  9. package/angular/assets/strings/ko-KR/strings.json +1 -1
  10. package/angular/assets/strings/nl-NL/strings.json +1 -1
  11. package/angular/assets/strings/pl-PL/strings.json +1 -1
  12. package/angular/assets/strings/pt-BR/strings.json +1 -1
  13. package/angular/assets/strings/pt-PT/strings.json +1 -1
  14. package/angular/assets/strings/ru-RU/strings.json +1 -1
  15. package/angular/assets/strings/strings.json +1 -1
  16. package/angular/assets/strings/sv-SE/strings.json +1 -1
  17. package/angular/assets/strings/tr-TR/strings.json +1 -1
  18. package/angular/assets/strings/zh-CN/strings.json +1 -1
  19. package/angular/assets/strings/zh-TW/strings.json +1 -1
  20. package/angular/esm2020/src/controls/actions/containers/action-bar/action-bar.component.mjs +2 -2
  21. package/angular/esm2020/src/controls/actions/containers/action-container.component.mjs +2 -3
  22. package/angular/esm2020/src/controls/alert-bar/alert-bar.component.mjs +2 -2
  23. package/angular/esm2020/src/controls/breadcrumb-header/breadcrumb-header.component.mjs +1 -1
  24. package/angular/esm2020/src/controls/common/base.component.mjs +1 -1
  25. package/angular/esm2020/src/controls/common/spacer-base.component.mjs +25 -1
  26. package/angular/esm2020/src/controls/context-menu/context-menu.component.mjs +2 -3
  27. package/angular/esm2020/src/controls/data-table/data-table.component.mjs +7 -7
  28. package/angular/esm2020/src/controls/dialog/base-dialog.component.mjs +2 -4
  29. package/angular/esm2020/src/controls/dialog/confirmation-list-dialog/confirmation-list-dialog.component.mjs +2 -2
  30. package/angular/esm2020/src/controls/dropdown/dropdown.component.mjs +1 -4
  31. package/angular/esm2020/src/controls/form/form-field/clock/clock-form-field.component.mjs +10 -7
  32. package/angular/esm2020/src/controls/form/form-field/form-field.component.mjs +1 -1
  33. package/angular/esm2020/src/controls/form/form-field/number/number-form-field.component.mjs +22 -4
  34. package/angular/esm2020/src/controls/form/form-field/radio-group/classic/radio-group-form-field.component.mjs +5 -5
  35. package/angular/esm2020/src/controls/icon/icon-text/icon-text.component.mjs +6 -6
  36. package/angular/esm2020/src/controls/icon/layered-icon/status/status-icon.component.mjs +1 -1
  37. package/angular/esm2020/src/controls/layout/editable-layout.component.mjs +2 -3
  38. package/angular/esm2020/src/controls/node-credentials-form/node-credentials-form.component.mjs +2 -2
  39. package/angular/esm2020/src/controls/property-grid/property-grid.component.mjs +33 -13
  40. package/angular/esm2020/src/controls/schema/tabbed-form-loader.component.mjs +2 -2
  41. package/angular/esm2020/src/controls/settings/common-settings/common-settings.component.mjs +5 -5
  42. package/angular/esm2020/src/controls/settings/settings-form.directive.mjs +3 -7
  43. package/angular/esm2020/src/controls/settings/settings-form.service.mjs +2 -4
  44. package/angular/esm2020/src/controls/snap-in-extension/snap-in-extension.component.mjs +1 -1
  45. package/angular/esm2020/src/controls/split-view/split-view.component.mjs +2 -2
  46. package/angular/esm2020/src/directives/router/router-link.directive.mjs +2 -2
  47. package/angular/esm2020/src/directives/svg/svg.directive.mjs +2 -3
  48. package/angular/esm2020/src/generated/strings.mjs +1 -1
  49. package/angular/esm2020/src/service/navigation.service.mjs +3 -8
  50. package/angular/esm2020/src/service/user-alive.service.mjs +2 -4
  51. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs +128 -73
  52. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
  53. package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs +116 -71
  54. package/angular/fesm2020/microsoft-windows-admin-center-sdk-angular.mjs.map +1 -1
  55. package/angular/package.json +1 -1
  56. package/angular/src/controls/common/spacer-base.component.d.ts +11 -2
  57. package/angular/src/controls/form/form-field/number/number-form-field.component.d.ts +8 -0
  58. package/angular/src/controls/icon/icon-text/icon-text.component.d.ts +1 -1
  59. package/angular/src/controls/property-grid/property-grid.component.d.ts +2 -0
  60. package/angular/src/directives/svg/svg.directive.d.ts +1 -2
  61. package/angular/src/generated/strings.d.ts +12 -0
  62. package/core/assets/strings/cs-CZ/strings.json +1 -1
  63. package/core/assets/strings/es-ES/strings.json +1 -1
  64. package/core/assets/strings/fr-FR/strings.json +1 -1
  65. package/core/assets/strings/hu-HU/strings.json +1 -1
  66. package/core/assets/strings/id-ID/strings.json +1 -1
  67. package/core/assets/strings/it-IT/strings.json +1 -1
  68. package/core/assets/strings/ja-JP/strings.json +1 -1
  69. package/core/assets/strings/ko-KR/strings.json +1 -1
  70. package/core/assets/strings/pl-PL/strings.json +1 -1
  71. package/core/assets/strings/pt-BR/strings.json +1 -1
  72. package/core/assets/strings/pt-PT/strings.json +1 -1
  73. package/core/assets/strings/ru-RU/strings.json +1 -1
  74. package/core/assets/strings/sv-SE/strings.json +1 -1
  75. package/core/assets/strings/tr-TR/strings.json +1 -1
  76. package/core/assets/strings/zh-CN/strings.json +1 -1
  77. package/core/assets/strings/zh-TW/strings.json +1 -1
  78. package/core/azure/azure-constants.d.ts +3 -2
  79. package/core/azure/azure-constants.d.ts.map +1 -1
  80. package/core/azure/azure-constants.js +11 -3
  81. package/core/azure/azure-constants.js.map +1 -1
  82. package/core/base/utilities.d.ts +3 -3
  83. package/core/base/utilities.d.ts.map +1 -1
  84. package/core/base/utilities.js +2 -2
  85. package/core/base/utilities.js.map +1 -1
  86. package/core/data/active-directory/active-directory.d.ts.map +1 -1
  87. package/core/data/active-directory/active-directory.js +1 -1
  88. package/core/data/active-directory/active-directory.js.map +1 -1
  89. package/core/data/cookie.d.ts.map +1 -1
  90. package/core/data/cookie.js +7 -0
  91. package/core/data/cookie.js.map +1 -1
  92. package/core/data/gateway-url-translator.d.ts +1 -0
  93. package/core/data/gateway-url-translator.d.ts.map +1 -1
  94. package/core/data/gateway-url-translator.js +21 -6
  95. package/core/data/gateway-url-translator.js.map +1 -1
  96. package/core/data/gateway-urls.d.ts +6 -0
  97. package/core/data/gateway-urls.d.ts.map +1 -1
  98. package/core/data/gateway-urls.js +8 -0
  99. package/core/data/gateway-urls.js.map +1 -1
  100. package/core/data/node-connection.d.ts.map +1 -1
  101. package/core/data/node-connection.js +0 -2
  102. package/core/data/node-connection.js.map +1 -1
  103. package/core/generated/powershell-scripts.d.ts.map +1 -1
  104. package/core/generated/powershell-scripts.js +1 -1
  105. package/core/generated/powershell-scripts.js.map +1 -1
  106. package/core/resources/scripts/public/inventory/Get-ServerInventory.ps1 +38 -16
  107. package/core/security/tool-condition-validator.d.ts.map +1 -1
  108. package/core/security/tool-condition-validator.js +5 -5
  109. package/core/security/tool-condition-validator.js.map +1 -1
  110. package/core/shared/server-inventory/server-inventory-cache.d.ts.map +1 -1
  111. package/core/shared/server-inventory/server-inventory-cache.js +1 -1
  112. package/core/shared/server-inventory/server-inventory-cache.js.map +1 -1
  113. package/core/shared/server-inventory/server-inventory.d.ts +4 -4
  114. package/core/shared/server-inventory/server-inventory.d.ts.map +1 -1
  115. package/core/shared/server-inventory/server-inventory.js +2 -2
  116. package/core/shared/server-inventory/server-inventory.js.map +1 -1
  117. package/microsoft-windows-admin-center-sdk-4.167.0.tgz +0 -0
  118. package/package.json +10 -8
  119. package/styles/css/main-v2.css +1 -1
  120. package/tools/code-formatter/.eslintrc.base.json +1 -0
  121. package/tools/code-formatter/lint.d.ts.map +1 -1
  122. package/tools/code-formatter/lint.js +7 -1
  123. package/tools/code-formatter/lint.js.map +1 -1
  124. package/tools/code-formatter/utilities.d.ts +7 -0
  125. package/tools/code-formatter/utilities.d.ts.map +1 -0
  126. package/tools/code-formatter/utilities.js +79 -0
  127. package/tools/code-formatter/utilities.js.map +1 -0
  128. package/tools/gulp-update-notes-resource/index.d.ts.map +1 -1
  129. package/tools/gulp-update-notes-resource/index.js +4 -4
  130. package/tools/gulp-update-notes-resource/index.js.map +1 -1
  131. package/tools/module-template/.eslintrc.json +3 -0
  132. package/tools/module-template/build/pipelines/ci-build.yml +2 -2
  133. package/tools/module-template/gulpfile.ts/common/utilities.ts +1 -0
  134. package/tools/wac-cli/src/angular15/configs/angular-json-config.d.ts +2 -7
  135. package/tools/wac-cli/src/angular15/configs/angular-json-config.d.ts.map +1 -1
  136. package/tools/wac-cli/src/angular15/configs/angular-json-config.js +8 -1
  137. package/tools/wac-cli/src/angular15/configs/angular-json-config.js.map +1 -1
  138. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.d.ts +9 -0
  139. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.d.ts.map +1 -0
  140. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.js +16 -0
  141. package/tools/wac-cli/src/angular15/configs/eslint-auto-fix-config.js.map +1 -0
  142. package/tools/wac-cli/src/angular15/configs/package-json-config.d.ts +4 -0
  143. package/tools/wac-cli/src/angular15/configs/package-json-config.d.ts.map +1 -1
  144. package/tools/wac-cli/src/angular15/configs/package-json-config.js +13 -9
  145. package/tools/wac-cli/src/angular15/configs/package-json-config.js.map +1 -1
  146. package/tools/wac-cli/src/angular15/main.d.ts +20 -4
  147. package/tools/wac-cli/src/angular15/main.d.ts.map +1 -1
  148. package/tools/wac-cli/src/angular15/main.js +44 -8
  149. package/tools/wac-cli/src/angular15/main.js.map +1 -1
  150. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.d.ts +18 -0
  151. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.d.ts.map +1 -0
  152. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.js +49 -0
  153. package/tools/wac-cli/src/angular15/upgrader/eslint-auto-fix-upgrader.js.map +1 -0
  154. package/tools/wac-cli/templates/wac-template/package.json +3 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/active-directory/active-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA6B,MAAM,MAAM,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAGxF;;GAEG;AACH,qBAAa,eAAe;IAUZ,OAAO,CAAC,OAAO;IARpB,+BAA+B,EAAE,MAAM,CAAC;IAC/C,SAAgB,qBAAqB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3D,OAAO,CAAC,4BAA4B,CAAyB;IAE7D;;;OAGG;gBACiB,OAAO,EAAE,iBAAiB;IAiB9C;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,4BAA4B,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IAkB/E;;OAEG;IACH,OAAO,CAAC,aAAa;CAiBxB","file":"active-directory.d.ts","sourcesContent":["import { Observable, ReplaySubject, throwError } from 'rxjs';\r\nimport { catchError } from 'rxjs/operators';\r\nimport { GatewayConnection } from '../gateway-connection';\r\nimport { GatewayUrls } from '../gateway-urls';\r\nimport { AccountInfo } from './models/account-info';\r\nimport { ActiveDirectorySearchOptions } from './models/active-directory-search-options';\r\nimport { SearchType } from './models/search-type';\r\n\r\n/**\r\n * Active Directory Service implementation.\r\n */\r\nexport class ActiveDirectory {\r\n\r\n public defaultDirectorySearchSizeLimit: number;\r\n public readonly isGatewayDomainJoined: Observable<boolean>;\r\n private isGatewayDomainJoinedSubject: ReplaySubject<boolean>;\r\n\r\n /**\r\n * Initializes a new instance of the ActiveDirectory class.\r\n * @param gateway the gateway instance.\r\n */\r\n constructor(private gateway: GatewayConnection) {\r\n this.defaultDirectorySearchSizeLimit = 150;\r\n this.isGatewayDomainJoinedSubject = new ReplaySubject(1);\r\n this.isGatewayDomainJoined = this.isGatewayDomainJoinedSubject.asObservable();\r\n\r\n this.gateway.get(GatewayUrls.adDomainRelativeUrl).subscribe({\r\n next: (response: any) => {\r\n // if response is not empty, the gateway is domain joined\r\n this.isGatewayDomainJoinedSubject.next(!!response);\r\n },\r\n error: () => {\r\n this.isGatewayDomainJoinedSubject.next(false);\r\n // TODO: LOG THIS ERROR\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Search computer list from active directory through gateway api\r\n */\r\n public search(options: ActiveDirectorySearchOptions): Observable<AccountInfo[]> {\r\n const type = encodeURIComponent(this.getSearchType(options));\r\n const searchString = encodeURIComponent(options.searchString) || '';\r\n if (MsftSme.isNullOrUndefined(options.sizeLimit)) {\r\n options.sizeLimit = this.defaultDirectorySearchSizeLimit;\r\n }\r\n const requestUrl = `activeDirectory/accounts?type=${type}&filter=${searchString}&size=${options.sizeLimit}`;\r\n return this.gateway.get(requestUrl).pipe(\r\n catchError(error => {\r\n const exceptionMessage = MsftSme.getValue(error, 'response.exceptionMessage');\r\n if (exceptionMessage) {\r\n return throwError(() => exceptionMessage);\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Get the appropriate search type string from the search options\r\n */\r\n private getSearchType(options: ActiveDirectorySearchOptions): string {\r\n if (Array.isArray(options.searchOn)) {\r\n options.searchOn = options.searchOn[0];\r\n }\r\n\r\n if (MsftSme.isNullOrUndefined(options.searchOn)) {\r\n return 'any';\r\n }\r\n\r\n options.searchOn = options.searchOn.toLowerCase();\r\n\r\n if (MsftSme.isNullOrUndefined(SearchType[options.searchOn])) {\r\n return options.searchOn;\r\n }\r\n\r\n return SearchType[options.searchOn];\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/active-directory/active-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA6B,MAAM,MAAM,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAGxF;;GAEG;AACH,qBAAa,eAAe;IAUZ,OAAO,CAAC,OAAO;IARpB,+BAA+B,EAAE,MAAM,CAAC;IAC/C,SAAgB,qBAAqB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3D,OAAO,CAAC,4BAA4B,CAAyB;IAE7D;;;OAGG;gBACiB,OAAO,EAAE,iBAAiB;IAiB9C;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,4BAA4B,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IAkB/E;;OAEG;IACH,OAAO,CAAC,aAAa;CAiBxB","file":"active-directory.d.ts","sourcesContent":["import { Observable, ReplaySubject, throwError } from 'rxjs';\r\nimport { catchError } from 'rxjs/operators';\r\nimport { GatewayConnection } from '../gateway-connection';\r\nimport { GatewayUrls } from '../gateway-urls';\r\nimport { AccountInfo } from './models/account-info';\r\nimport { ActiveDirectorySearchOptions } from './models/active-directory-search-options';\r\nimport { SearchType } from './models/search-type';\r\n\r\n/**\r\n * Active Directory Service implementation.\r\n */\r\nexport class ActiveDirectory {\r\n\r\n public defaultDirectorySearchSizeLimit: number;\r\n public readonly isGatewayDomainJoined: Observable<boolean>;\r\n private isGatewayDomainJoinedSubject: ReplaySubject<boolean>;\r\n\r\n /**\r\n * Initializes a new instance of the ActiveDirectory class.\r\n * @param gateway the gateway instance.\r\n */\r\n constructor(private gateway: GatewayConnection) {\r\n this.defaultDirectorySearchSizeLimit = 150;\r\n this.isGatewayDomainJoinedSubject = new ReplaySubject(1);\r\n this.isGatewayDomainJoined = this.isGatewayDomainJoinedSubject.asObservable();\r\n\r\n this.gateway.get(GatewayUrls.adDomainRelativeUrl).subscribe({\r\n next: (response: any) => {\r\n // if response is not empty, the gateway is domain joined\r\n this.isGatewayDomainJoinedSubject.next(!!response);\r\n },\r\n error: () => {\r\n this.isGatewayDomainJoinedSubject.next(false);\r\n // TODO: LOG THIS ERROR\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Search computer list from active directory through gateway api\r\n */\r\n public search(options: ActiveDirectorySearchOptions): Observable<AccountInfo[]> {\r\n const type = encodeURIComponent(this.getSearchType(options));\r\n const searchString = encodeURIComponent(options.searchString) || '';\r\n if (MsftSme.isNullOrUndefined(options.sizeLimit)) {\r\n options.sizeLimit = this.defaultDirectorySearchSizeLimit;\r\n }\r\n const requestUrl = `${GatewayUrls.adAccountsRelativeUrl}?type=${type}&filter=${searchString}&size=${options.sizeLimit}`;\r\n return this.gateway.get(requestUrl).pipe(\r\n catchError(error => {\r\n const exceptionMessage = MsftSme.getValue(error, 'response.exceptionMessage');\r\n if (exceptionMessage) {\r\n return throwError(() => exceptionMessage);\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Get the appropriate search type string from the search options\r\n */\r\n private getSearchType(options: ActiveDirectorySearchOptions): string {\r\n if (Array.isArray(options.searchOn)) {\r\n options.searchOn = options.searchOn[0];\r\n }\r\n\r\n if (MsftSme.isNullOrUndefined(options.searchOn)) {\r\n return 'any';\r\n }\r\n\r\n options.searchOn = options.searchOn.toLowerCase();\r\n\r\n if (MsftSme.isNullOrUndefined(SearchType[options.searchOn])) {\r\n return options.searchOn;\r\n }\r\n\r\n return SearchType[options.searchOn];\r\n }\r\n}\r\n"]}
@@ -39,7 +39,7 @@ export class ActiveDirectory {
39
39
  if (MsftSme.isNullOrUndefined(options.sizeLimit)) {
40
40
  options.sizeLimit = this.defaultDirectorySearchSizeLimit;
41
41
  }
42
- const requestUrl = `activeDirectory/accounts?type=${type}&filter=${searchString}&size=${options.sizeLimit}`;
42
+ const requestUrl = `${GatewayUrls.adAccountsRelativeUrl}?type=${type}&filter=${searchString}&size=${options.sizeLimit}`;
43
43
  return this.gateway.get(requestUrl).pipe(catchError(error => {
44
44
  const exceptionMessage = MsftSme.getValue(error, 'response.exceptionMessage');
45
45
  if (exceptionMessage) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/active-directory/active-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,eAAe;IAUJ;IARb,+BAA+B,CAAS;IAC/B,qBAAqB,CAAsB;IACnD,4BAA4B,CAAyB;IAE7D;;;OAGG;IACH,YAAoB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;QAC1C,IAAI,CAAC,+BAA+B,GAAG,GAAG,CAAC;QAC3C,IAAI,CAAC,4BAA4B,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,4BAA4B,CAAC,YAAY,EAAE,CAAC;QAE9E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC;YACxD,IAAI,EAAE,CAAC,QAAa,EAAE,EAAE;gBACpB,yDAAyD;gBACzD,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACvD,CAAC;YACD,KAAK,EAAE,GAAG,EAAE;gBACR,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC9C,uBAAuB;YAC3B,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAAqC;QAC/C,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7D,MAA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AAC;CACJ","file":"active-directory.js","sourcesContent":["import { Observable, ReplaySubject, throwError } from 'rxjs';\r\nimport { catchError } from 'rxjs/operators';\r\nimport { GatewayConnection } from '../gateway-connection';\r\nimport { GatewayUrls } from '../gateway-urls';\r\nimport { AccountInfo } from './models/account-info';\r\nimport { ActiveDirectorySearchOptions } from './models/active-directory-search-options';\r\nimport { SearchType } from './models/search-type';\r\n\r\n/**\r\n * Active Directory Service implementation.\r\n */\r\nexport class ActiveDirectory {\r\n\r\n public defaultDirectorySearchSizeLimit: number;\r\n public readonly isGatewayDomainJoined: Observable<boolean>;\r\n private isGatewayDomainJoinedSubject: ReplaySubject<boolean>;\r\n\r\n /**\r\n * Initializes a new instance of the ActiveDirectory class.\r\n * @param gateway the gateway instance.\r\n */\r\n constructor(private gateway: GatewayConnection) {\r\n this.defaultDirectorySearchSizeLimit = 150;\r\n this.isGatewayDomainJoinedSubject = new ReplaySubject(1);\r\n this.isGatewayDomainJoined = this.isGatewayDomainJoinedSubject.asObservable();\r\n\r\n this.gateway.get(GatewayUrls.adDomainRelativeUrl).subscribe({\r\n next: (response: any) => {\r\n // if response is not empty, the gateway is domain joined\r\n this.isGatewayDomainJoinedSubject.next(!!response);\r\n },\r\n error: () => {\r\n this.isGatewayDomainJoinedSubject.next(false);\r\n // TODO: LOG THIS ERROR\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Search computer list from active directory through gateway api\r\n */\r\n public search(options: ActiveDirectorySearchOptions): Observable<AccountInfo[]> {\r\n const type = encodeURIComponent(this.getSearchType(options));\r\n const searchString = encodeURIComponent(options.searchString) || '';\r\n if (MsftSme.isNullOrUndefined(options.sizeLimit)) {\r\n options.sizeLimit = this.defaultDirectorySearchSizeLimit;\r\n }\r\n const requestUrl = `activeDirectory/accounts?type=${type}&filter=${searchString}&size=${options.sizeLimit}`;\r\n return this.gateway.get(requestUrl).pipe(\r\n catchError(error => {\r\n const exceptionMessage = MsftSme.getValue(error, 'response.exceptionMessage');\r\n if (exceptionMessage) {\r\n return throwError(() => exceptionMessage);\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Get the appropriate search type string from the search options\r\n */\r\n private getSearchType(options: ActiveDirectorySearchOptions): string {\r\n if (Array.isArray(options.searchOn)) {\r\n options.searchOn = options.searchOn[0];\r\n }\r\n\r\n if (MsftSme.isNullOrUndefined(options.searchOn)) {\r\n return 'any';\r\n }\r\n\r\n options.searchOn = options.searchOn.toLowerCase();\r\n\r\n if (MsftSme.isNullOrUndefined(SearchType[options.searchOn])) {\r\n return options.searchOn;\r\n }\r\n\r\n return SearchType[options.searchOn];\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/active-directory/active-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,eAAe;IAUJ;IARb,+BAA+B,CAAS;IAC/B,qBAAqB,CAAsB;IACnD,4BAA4B,CAAyB;IAE7D;;;OAGG;IACH,YAAoB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;QAC1C,IAAI,CAAC,+BAA+B,GAAG,GAAG,CAAC;QAC3C,IAAI,CAAC,4BAA4B,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,4BAA4B,CAAC,YAAY,EAAE,CAAC;QAE9E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC;YACxD,IAAI,EAAE,CAAC,QAAa,EAAE,EAAE;gBACpB,yDAAyD;gBACzD,IAAI,CAAC,4BAA4B,CAAC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ED,IAAI,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC7C,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QAElD,IAAI,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;YACzD,OAAO,OAAO,CAAC,QAAQ,CAAC;SAC3B;QAED,OAAO,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;CACJ","file":"active-directory.js","sourcesContent":["import { Observable, ReplaySubject, throwError } from 'rxjs';\r\nimport { catchError } from 'rxjs/operators';\r\nimport { GatewayConnection } from '../gateway-connection';\r\nimport { GatewayUrls } from '../gateway-urls';\r\nimport { AccountInfo } from './models/account-info';\r\nimport { ActiveDirectorySearchOptions } from './models/active-directory-search-options';\r\nimport { SearchType } from './models/search-type';\r\n\r\n/**\r\n * Active Directory Service implementation.\r\n */\r\nexport class ActiveDirectory {\r\n\r\n public defaultDirectorySearchSizeLimit: number;\r\n public readonly isGatewayDomainJoined: Observable<boolean>;\r\n private isGatewayDomainJoinedSubject: ReplaySubject<boolean>;\r\n\r\n /**\r\n * Initializes a new instance of the ActiveDirectory class.\r\n * @param gateway the gateway instance.\r\n */\r\n constructor(private gateway: GatewayConnection) {\r\n this.defaultDirectorySearchSizeLimit = 150;\r\n this.isGatewayDomainJoinedSubject = new ReplaySubject(1);\r\n this.isGatewayDomainJoined = this.isGatewayDomainJoinedSubject.asObservable();\r\n\r\n this.gateway.get(GatewayUrls.adDomainRelativeUrl).subscribe({\r\n next: (response: any) => {\r\n // if response is not empty, the gateway is domain joined\r\n this.isGatewayDomainJoinedSubject.next(!!response);\r\n },\r\n error: () => {\r\n this.isGatewayDomainJoinedSubject.next(false);\r\n // TODO: LOG THIS ERROR\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Search computer list from active directory through gateway api\r\n */\r\n public search(options: ActiveDirectorySearchOptions): Observable<AccountInfo[]> {\r\n const type = encodeURIComponent(this.getSearchType(options));\r\n const searchString = encodeURIComponent(options.searchString) || '';\r\n if (MsftSme.isNullOrUndefined(options.sizeLimit)) {\r\n options.sizeLimit = this.defaultDirectorySearchSizeLimit;\r\n }\r\n const requestUrl = `${GatewayUrls.adAccountsRelativeUrl}?type=${type}&filter=${searchString}&size=${options.sizeLimit}`;\r\n return this.gateway.get(requestUrl).pipe(\r\n catchError(error => {\r\n const exceptionMessage = MsftSme.getValue(error, 'response.exceptionMessage');\r\n if (exceptionMessage) {\r\n return throwError(() => exceptionMessage);\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Get the appropriate search type string from the search options\r\n */\r\n private getSearchType(options: ActiveDirectorySearchOptions): string {\r\n if (Array.isArray(options.searchOn)) {\r\n options.searchOn = options.searchOn[0];\r\n }\r\n\r\n if (MsftSme.isNullOrUndefined(options.searchOn)) {\r\n return 'any';\r\n }\r\n\r\n options.searchOn = options.searchOn.toLowerCase();\r\n\r\n if (MsftSme.isNullOrUndefined(SearchType[options.searchOn])) {\r\n return options.searchOn;\r\n }\r\n\r\n return SearchType[options.searchOn];\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/cookie.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,MAAM;IAEf;;OAEG;WACW,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAgB7C;;OAEG;WACW,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAK7C;;OAEG;WACW,+BAA+B,IAAI,MAAM;IAIvD;;OAEG;WACW,uBAAuB,IAAI,MAAM;IAI/C;;OAEG;WACW,yBAAyB,IAAI,IAAI;CAGlD","file":"cookie.d.ts","sourcesContent":["/**\r\n * Cookie class.\r\n */\r\nexport class Cookie {\r\n\r\n /**\r\n * Gets cookie by name.\r\n */\r\n public static get(cookieName: string): string {\r\n const name = cookieName + '=';\r\n const ca = document.cookie.split(';');\r\n for (let i = 0; i < ca.length; i++) {\r\n let c = ca[i];\r\n while (c.charAt(0) === ' ') {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) === 0) {\r\n return c.substring(name.length, c.length);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * \"clears\" cookie by name. Setting its expiration date to \"Thu, 01 Jan 1970 00:00:00 GMT\"\r\n */\r\n public static clear(cookieName: string): void {\r\n const dawnOfTime = new Date(0).toUTCString();\r\n document.cookie = `${cookieName}=;expires=${dawnOfTime}`;\r\n }\r\n\r\n /**\r\n * Gets the cross site request forgery token.\r\n */\r\n public static getCrossSiteRequestForgeryToken(): string {\r\n return Cookie.get('XSRF-TOKEN');\r\n }\r\n\r\n /**\r\n * Gets the gateway identity token.\r\n */\r\n public static getGatewayIdentityToken(): string {\r\n return Cookie.get('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n\r\n /**\r\n * Clears the gateway identity token.\r\n */\r\n public static clearGatewayIdentityToken(): void {\r\n Cookie.clear('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/cookie.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,MAAM;IAEf;;OAEG;WACW,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAgB7C;;OAEG;WACW,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAK7C;;OAEG;WACW,+BAA+B,IAAI,MAAM;IAWvD;;OAEG;WACW,uBAAuB,IAAI,MAAM;IAI/C;;OAEG;WACW,yBAAyB,IAAI,IAAI;CAGlD","file":"cookie.d.ts","sourcesContent":["import { EnvironmentModule } from '../manifest/environment-modules';\r\n\r\n/**\r\n * Cookie class.\r\n */\r\nexport class Cookie {\r\n\r\n /**\r\n * Gets cookie by name.\r\n */\r\n public static get(cookieName: string): string {\r\n const name = cookieName + '=';\r\n const ca = document.cookie.split(';');\r\n for (let i = 0; i < ca.length; i++) {\r\n let c = ca[i];\r\n while (c.charAt(0) === ' ') {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) === 0) {\r\n return c.substring(name.length, c.length);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * \"clears\" cookie by name. Setting its expiration date to \"Thu, 01 Jan 1970 00:00:00 GMT\"\r\n */\r\n public static clear(cookieName: string): void {\r\n const dawnOfTime = new Date(0).toUTCString();\r\n document.cookie = `${cookieName}=;expires=${dawnOfTime}`;\r\n }\r\n\r\n /**\r\n * Gets the cross site request forgery token.\r\n */\r\n public static getCrossSiteRequestForgeryToken(): string {\r\n if (EnvironmentModule.isGatewayV200) {\r\n const xsrf = Cookie.get('WAC-XSRF');\r\n if (xsrf) {\r\n return xsrf;\r\n }\r\n }\r\n\r\n return Cookie.get('XSRF-TOKEN');\r\n }\r\n\r\n /**\r\n * Gets the gateway identity token.\r\n */\r\n public static getGatewayIdentityToken(): string {\r\n return Cookie.get('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n\r\n /**\r\n * Clears the gateway identity token.\r\n */\r\n public static clearGatewayIdentityToken(): void {\r\n Cookie.clear('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n}\r\n"]}
@@ -1,3 +1,4 @@
1
+ import { EnvironmentModule } from '../manifest/environment-modules';
1
2
  /**
2
3
  * Cookie class.
3
4
  */
@@ -30,6 +31,12 @@ export class Cookie {
30
31
  * Gets the cross site request forgery token.
31
32
  */
32
33
  static getCrossSiteRequestForgeryToken() {
34
+ if (EnvironmentModule.isGatewayV200) {
35
+ const xsrf = Cookie.get('WAC-XSRF');
36
+ if (xsrf) {
37
+ return xsrf;
38
+ }
39
+ }
33
40
  return Cookie.get('XSRF-TOKEN');
34
41
  }
35
42
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/cookie.ts"],"names":[],"mappings":"AAAA;;GAEG;A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/**\r\n * Cookie class.\r\n */\r\nexport class Cookie {\r\n\r\n /**\r\n * Gets cookie by name.\r\n */\r\n public static get(cookieName: string): string {\r\n const name = cookieName + '=';\r\n const ca = document.cookie.split(';');\r\n for (let i = 0; i < ca.length; i++) {\r\n let c = ca[i];\r\n while (c.charAt(0) === ' ') {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) === 0) {\r\n return c.substring(name.length, c.length);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * \"clears\" cookie by name. Setting its expiration date to \"Thu, 01 Jan 1970 00:00:00 GMT\"\r\n */\r\n public static clear(cookieName: string): void {\r\n const dawnOfTime = new Date(0).toUTCString();\r\n document.cookie = `${cookieName}=;expires=${dawnOfTime}`;\r\n }\r\n\r\n /**\r\n * Gets the cross site request forgery token.\r\n */\r\n public static getCrossSiteRequestForgeryToken(): string {\r\n return Cookie.get('XSRF-TOKEN');\r\n }\r\n\r\n /**\r\n * Gets the gateway identity token.\r\n */\r\n public static getGatewayIdentityToken(): string {\r\n return Cookie.get('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n\r\n /**\r\n * Clears the gateway identity token.\r\n */\r\n public static clearGatewayIdentityToken(): void {\r\n Cookie.clear('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE;;GAEG;AACH,MAAM,OAAO,MAAM;IAEf;;OAEG;IACI,MAAM,CAAC,GAAG,CAAC,UAAkB;QAChC,MAAM,IAAI,GAAG,UAAU,GAAG,GAAG,CAAC;QAC9B,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YACd,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;gBACxB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aACtB;YACD,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBACvB,OAAO,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;aAC7C;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAkB;QAClC,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC7C,QAAQ,CAAC,MAAM,GAAG,GAAG,UAAU,aAAa,UAAU,EAAE,CAAC;IAC7D,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,+BAA+B;QACzC,IAAI,iBAAiB,CAAC,aAAa,EAAE;YACjC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACpC,IAAI,IAAI,EAAE;gBACN,OAAO,IAAI,CAAC;aACf;SACJ;QAED,OAAO,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,uBAAuB;QACjC,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,yBAAyB;QACnC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC3C,CAAC;CACJ","file":"cookie.js","sourcesContent":["import { EnvironmentModule } from '../manifest/environment-modules';\r\n\r\n/**\r\n * Cookie class.\r\n */\r\nexport class Cookie {\r\n\r\n /**\r\n * Gets cookie by name.\r\n */\r\n public static get(cookieName: string): string {\r\n const name = cookieName + '=';\r\n const ca = document.cookie.split(';');\r\n for (let i = 0; i < ca.length; i++) {\r\n let c = ca[i];\r\n while (c.charAt(0) === ' ') {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) === 0) {\r\n return c.substring(name.length, c.length);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * \"clears\" cookie by name. Setting its expiration date to \"Thu, 01 Jan 1970 00:00:00 GMT\"\r\n */\r\n public static clear(cookieName: string): void {\r\n const dawnOfTime = new Date(0).toUTCString();\r\n document.cookie = `${cookieName}=;expires=${dawnOfTime}`;\r\n }\r\n\r\n /**\r\n * Gets the cross site request forgery token.\r\n */\r\n public static getCrossSiteRequestForgeryToken(): string {\r\n if (EnvironmentModule.isGatewayV200) {\r\n const xsrf = Cookie.get('WAC-XSRF');\r\n if (xsrf) {\r\n return xsrf;\r\n }\r\n }\r\n\r\n return Cookie.get('XSRF-TOKEN');\r\n }\r\n\r\n /**\r\n * Gets the gateway identity token.\r\n */\r\n public static getGatewayIdentityToken(): string {\r\n return Cookie.get('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n\r\n /**\r\n * Clears the gateway identity token.\r\n */\r\n public static clearGatewayIdentityToken(): void {\r\n Cookie.clear('GATEWAY-IDENTITY-TOKEN');\r\n }\r\n}\r\n"]}
@@ -18,4 +18,5 @@ export declare class GatewayUrlTranslator {
18
18
  private static translateFileTransferRequest;
19
19
  private static translateWdacRequest;
20
20
  private static translateCounterRequest;
21
+ private static translateExtensionsRequest;
21
22
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/gateway-url-translator.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,oBAAoB;IAC7B,OAAO,CAAC,MAAM,CAAC,YAAY,CAOzB;IACF;;;;;;OAMG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc;IA4BpD,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAazC,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAalC,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAalC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAa3C,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAanC,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAYzC","file":"gateway-url-translator.d.ts","sourcesContent":["import { Net } from './net';\r\n\r\nexport interface UrlTranslation {\r\n newUrl: string;\r\n startUrl: string;\r\n}\r\n\r\nexport class GatewayUrlTranslator {\r\n private static translations = {\r\n powerShellTranslationMatcher: /features\\/powershellApi\\/(.*)/,\r\n cimTranslationMatcher: /features\\/cim\\/(.*)/,\r\n wdacMatcher: /features\\/wdac\\/(.*)/,\r\n jeaMatcher: /features\\/jea\\/(.*)/,\r\n fileTransferMatcher: /features\\/fileTransfer\\/(.*)/,\r\n counterMatcher: /counter\\/(.*)/\r\n };\r\n /**\r\n * Given url return a gateway v2 translation object that will work well with\r\n * nodes/node api.\r\n *\r\n * @param url a gateway v1 url\r\n * @returns\r\n */\r\n public static translate(url: string): UrlTranslation {\r\n if (this.translations.powerShellTranslationMatcher.test(url)) {\r\n return this.translatePowerShellRequest(url);\r\n }\r\n\r\n if (this.translations.cimTranslationMatcher.test(url)) {\r\n return this.translateCimRequest(url);\r\n }\r\n\r\n if (this.translations.jeaMatcher.test(url)) {\r\n return this.translateJeaRequest(url);\r\n }\r\n\r\n if (this.translations.wdacMatcher.test(url)) {\r\n return this.translateWdacRequest(url);\r\n }\r\n\r\n if (this.translations.fileTransferMatcher.test(url)) {\r\n return this.translateFileTransferRequest(url);\r\n }\r\n\r\n if (this.translations.counterMatcher.test(url)) {\r\n return this.translateCounterRequest(url);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translatePowerShellRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.powerShellTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPowerShell}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCimRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.cimTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerCim}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateJeaRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.jeaMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerJea}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateFileTransferRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.fileTransferMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerFileTransfer}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateWdacRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.wdacMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerWdac}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCounterRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.counterMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPerformanceCounter}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/gateway-url-translator.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,oBAAoB;IAC7B,OAAO,CAAC,MAAM,CAAC,YAAY,CAQzB;IACF;;;;;;OAMG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc;IAgCpD,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAazC,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAalC,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAalC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAa3C,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAanC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAatC,OAAO,CAAC,MAAM,CAAC,0BAA0B;CAY5C","file":"gateway-url-translator.d.ts","sourcesContent":["import { Net } from './net';\r\n\r\nexport interface UrlTranslation {\r\n newUrl: string;\r\n startUrl: string;\r\n}\r\n\r\nexport class GatewayUrlTranslator {\r\n private static translations = {\r\n powerShellTranslationMatcher: /features\\/powershellApi\\/(.*)/i,\r\n cimTranslationMatcher: /features\\/cim\\/(.*)/i,\r\n wdacMatcher: /features\\/wdac\\/(.*)/i,\r\n jeaMatcher: /features\\/jea\\/(.*)/i,\r\n fileTransferMatcher: /features\\/fileTransfer\\/(.*)/i,\r\n counterMatcher: /counter\\/(.*)/i,\r\n extensionsTranslationMatcher: /features\\/extensions\\/(.*)/i\r\n };\r\n /**\r\n * Given url return a gateway v2 translation object that will work well with\r\n * nodes/node api.\r\n *\r\n * @param url a gateway v1 url\r\n * @returns\r\n */\r\n public static translate(url: string): UrlTranslation {\r\n if (this.translations.powerShellTranslationMatcher.test(url)) {\r\n return this.translatePowerShellRequest(url);\r\n }\r\n\r\n if (this.translations.cimTranslationMatcher.test(url)) {\r\n return this.translateCimRequest(url);\r\n }\r\n\r\n if (this.translations.jeaMatcher.test(url)) {\r\n return this.translateJeaRequest(url);\r\n }\r\n\r\n if (this.translations.wdacMatcher.test(url)) {\r\n return this.translateWdacRequest(url);\r\n }\r\n\r\n if (this.translations.fileTransferMatcher.test(url)) {\r\n return this.translateFileTransferRequest(url);\r\n }\r\n\r\n if (this.translations.counterMatcher.test(url)) {\r\n return this.translateCounterRequest(url);\r\n }\r\n\r\n if (this.translations.extensionsTranslationMatcher.test(url)) {\r\n return this.translateExtensionsRequest(url);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translatePowerShellRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.powerShellTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPowerShell}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCimRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.cimTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerCim}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateJeaRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.jeaMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerJea}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateFileTransferRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.fileTransferMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerFileTransfer}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateWdacRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.wdacMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerWdac}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCounterRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.counterMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPerformanceCounter}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateExtensionsRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.extensionsTranslationMatcher);\r\n if (matches) {\r\n const restOfString = `extensions/${matches[1]}`;\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerExtensions}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
@@ -1,12 +1,13 @@
1
1
  import { Net } from './net';
2
2
  export class GatewayUrlTranslator {
3
3
  static translations = {
4
- powerShellTranslationMatcher: /features\/powershellApi\/(.*)/,
5
- cimTranslationMatcher: /features\/cim\/(.*)/,
6
- wdacMatcher: /features\/wdac\/(.*)/,
7
- jeaMatcher: /features\/jea\/(.*)/,
8
- fileTransferMatcher: /features\/fileTransfer\/(.*)/,
9
- counterMatcher: /counter\/(.*)/
4
+ powerShellTranslationMatcher: /features\/powershellApi\/(.*)/i,
5
+ cimTranslationMatcher: /features\/cim\/(.*)/i,
6
+ wdacMatcher: /features\/wdac\/(.*)/i,
7
+ jeaMatcher: /features\/jea\/(.*)/i,
8
+ fileTransferMatcher: /features\/fileTransfer\/(.*)/i,
9
+ counterMatcher: /counter\/(.*)/i,
10
+ extensionsTranslationMatcher: /features\/extensions\/(.*)/i
10
11
  };
11
12
  /**
12
13
  * Given url return a gateway v2 translation object that will work well with
@@ -34,6 +35,9 @@ export class GatewayUrlTranslator {
34
35
  if (this.translations.counterMatcher.test(url)) {
35
36
  return this.translateCounterRequest(url);
36
37
  }
38
+ if (this.translations.extensionsTranslationMatcher.test(url)) {
39
+ return this.translateExtensionsRequest(url);
40
+ }
37
41
  return null;
38
42
  }
39
43
  static translatePowerShellRequest(url) {
@@ -102,6 +106,17 @@ export class GatewayUrlTranslator {
102
106
  }
103
107
  return null;
104
108
  }
109
+ static translateExtensionsRequest(url) {
110
+ const matches = url.match(this.translations.extensionsTranslationMatcher);
111
+ if (matches) {
112
+ const restOfString = `extensions/${matches[1]}`;
113
+ return {
114
+ newUrl: restOfString,
115
+ startUrl: `services/${Net.serviceWinRest}/${Net.controllerExtensions}`
116
+ };
117
+ }
118
+ return null;
119
+ }
105
120
  }
106
121
 
107
122
  //# sourceMappingURL=gateway-url-translator.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/gateway-url-translator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAO5B,MAAM,OAAO,oBAAoB;IACrB,MAAM,CAAC,YAAY,GAAG;QAC1B,4BAA4B,EAAE,+BAA+B;QAC7D,qBAAqB,EAAE,qBAAqB;QAC5C,WAAW,EAAE,sBAAsB;QACnC,UAAU,EAAE,qBAAqB;QACjC,mBAAmB,EAAE,8BAA8B;QACnD,cAAc,EAAE,eAAe;KAClC,CAAC;IACF;;;;;;OAMG;IACI,MAAM,CAAC,SAAS,CAAC,GAAW;QAC/B,IAAI,IAAI,CAAC,YAAY,CAAC,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC1D,OAAO,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC;SAC/C;QAED,IAAI,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACnD,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;SACxC;QAED,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACxC,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;SACxC;QAED,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,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O;gBACH,MAAM,EAAE,YAAY;gBACpB,QAAQ,EAAE,YAAY,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,4BAA4B,EAAE;aACjF,CAAC;SACL;QAED,OAAO,IAAI,CAAC;IAChB,CAAC","file":"gateway-url-translator.js","sourcesContent":["import { Net } from './net';\r\n\r\nexport interface UrlTranslation {\r\n newUrl: string;\r\n startUrl: string;\r\n}\r\n\r\nexport class GatewayUrlTranslator {\r\n private static translations = {\r\n powerShellTranslationMatcher: /features\\/powershellApi\\/(.*)/,\r\n cimTranslationMatcher: /features\\/cim\\/(.*)/,\r\n wdacMatcher: /features\\/wdac\\/(.*)/,\r\n jeaMatcher: /features\\/jea\\/(.*)/,\r\n fileTransferMatcher: /features\\/fileTransfer\\/(.*)/,\r\n counterMatcher: /counter\\/(.*)/\r\n };\r\n /**\r\n * Given url return a gateway v2 translation object that will work well with\r\n * nodes/node api.\r\n *\r\n * @param url a gateway v1 url\r\n * @returns\r\n */\r\n public static translate(url: string): UrlTranslation {\r\n if (this.translations.powerShellTranslationMatcher.test(url)) {\r\n return this.translatePowerShellRequest(url);\r\n }\r\n\r\n if (this.translations.cimTranslationMatcher.test(url)) {\r\n return this.translateCimRequest(url);\r\n }\r\n\r\n if (this.translations.jeaMatcher.test(url)) {\r\n return this.translateJeaRequest(url);\r\n }\r\n\r\n if (this.translations.wdacMatcher.test(url)) {\r\n return this.translateWdacRequest(url);\r\n }\r\n\r\n if (this.translations.fileTransferMatcher.test(url)) {\r\n return this.translateFileTransferRequest(url);\r\n }\r\n\r\n if (this.translations.counterMatcher.test(url)) {\r\n return this.translateCounterRequest(url);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translatePowerShellRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.powerShellTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPowerShell}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCimRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.cimTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerCim}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateJeaRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.jeaMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerJea}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateFileTransferRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.fileTransferMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerFileTransfer}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateWdacRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.wdacMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerWdac}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCounterRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.counterMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPerformanceCounter}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/gateway-url-translator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAO5B,MAAM,OAAO,oBAAoB;IACrB,MAAM,CAAC,YAAY,GAAG;QAC1B,4BAA4B,EAAE,gCAAgC;QAC9D,qBAAq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E,CAAC;YAChD,OAAO;gBACH,MAAM,EAAE,YAAY;gBACpB,QAAQ,EAAE,YAAY,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,oBAAoB,EAAE;aACzE,CAAC;SACL;QAED,OAAO,IAAI,CAAC;IAChB,CAAC","file":"gateway-url-translator.js","sourcesContent":["import { Net } from './net';\r\n\r\nexport interface UrlTranslation {\r\n newUrl: string;\r\n startUrl: string;\r\n}\r\n\r\nexport class GatewayUrlTranslator {\r\n private static translations = {\r\n powerShellTranslationMatcher: /features\\/powershellApi\\/(.*)/i,\r\n cimTranslationMatcher: /features\\/cim\\/(.*)/i,\r\n wdacMatcher: /features\\/wdac\\/(.*)/i,\r\n jeaMatcher: /features\\/jea\\/(.*)/i,\r\n fileTransferMatcher: /features\\/fileTransfer\\/(.*)/i,\r\n counterMatcher: /counter\\/(.*)/i,\r\n extensionsTranslationMatcher: /features\\/extensions\\/(.*)/i\r\n };\r\n /**\r\n * Given url return a gateway v2 translation object that will work well with\r\n * nodes/node api.\r\n *\r\n * @param url a gateway v1 url\r\n * @returns\r\n */\r\n public static translate(url: string): UrlTranslation {\r\n if (this.translations.powerShellTranslationMatcher.test(url)) {\r\n return this.translatePowerShellRequest(url);\r\n }\r\n\r\n if (this.translations.cimTranslationMatcher.test(url)) {\r\n return this.translateCimRequest(url);\r\n }\r\n\r\n if (this.translations.jeaMatcher.test(url)) {\r\n return this.translateJeaRequest(url);\r\n }\r\n\r\n if (this.translations.wdacMatcher.test(url)) {\r\n return this.translateWdacRequest(url);\r\n }\r\n\r\n if (this.translations.fileTransferMatcher.test(url)) {\r\n return this.translateFileTransferRequest(url);\r\n }\r\n\r\n if (this.translations.counterMatcher.test(url)) {\r\n return this.translateCounterRequest(url);\r\n }\r\n\r\n if (this.translations.extensionsTranslationMatcher.test(url)) {\r\n return this.translateExtensionsRequest(url);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translatePowerShellRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.powerShellTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPowerShell}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCimRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.cimTranslationMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerCim}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateJeaRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.jeaMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerJea}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateFileTransferRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.fileTransferMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerFileTransfer}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateWdacRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.wdacMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerWdac}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateCounterRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.counterMatcher);\r\n if (matches) {\r\n const restOfString = matches[1];\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerPerformanceCounter}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static translateExtensionsRequest(url: string): UrlTranslation {\r\n const matches = url.match(this.translations.extensionsTranslationMatcher);\r\n if (matches) {\r\n const restOfString = `extensions/${matches[1]}`;\r\n return {\r\n newUrl: restOfString,\r\n startUrl: `services/${Net.serviceWinRest}/${Net.controllerExtensions}`\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
@@ -76,6 +76,12 @@ export declare class GatewayUrls {
76
76
  * 'gateway/domain' is the GWV1 url
77
77
  */
78
78
  static get adDomainRelativeUrl(): string;
79
+ /**
80
+ * Return correct adAccountsRelativeUrl url depending on the gateway version
81
+ * 'services/WinREST/activeDirectory/accounts' is the GWV2 url
82
+ * 'gateway/accounts' is the GWV1 url
83
+ */
84
+ static get adAccountsRelativeUrl(): string;
79
85
  /**
80
86
  * Get latest gateway version url
81
87
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/gateway-urls.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,WAAW;IACpB;;OAEG;IACH,OAAc,+BAA+B,SAA4B;IAEzE;;OAEG;IACH,WAAkB,OAAO,IAAI,MAAM,CAElC;IAED;;OAEG;IACH,WAAkB,cAAc,IAAI,MAAM,CAEzC;IAED;;OAEG;IACH,WAAkB,iBAAiB,IAAI,MAAM,CAE5C;IAED;;OAEG;IACH,WAAkB,cAAc,IAAI,MAAM,CAEzC;IAED;;OAEG;IACH,WAAkB,gBAAgB,IAAI,MAAM,CAE3C;IAED;;OAEG;IACH,WAAkB,aAAa,IAAI,MAAM,CAExC;IAED;;OAEG;IACH,WAAkB,UAAU,IAAI,MAAM,CAErC;IAED;;OAEG;IACH,WAAkB,UAAU,IAAI,MAAM,CAErC;IAED;;OAEG;IACH,WAAkB,iBAAiB,IAAI,MAAM,CAE5C;IAED;;OAEG;IACH,WAAkB,iBAAiB,IAAI,MAAM,CAE5C;IAED;;OAEG;IACH,WAAkB,2BAA2B,IAAI,MAAM,CAEtD;IAED;;OAEG;IACH,WAAkB,eAAe,8EAEhC;IAED;;OAEG;IACH,WAAkB,qBAAqB,0FAEtC;IAEF;;QAEI;IACH,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;IACH,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;IACH,WAAkB,YAAY,IAAI,MAAM,CAEvC;IAED;;;;OAIG;IACH,WAAkB,mBAAmB,IAAI,MAAM,CAE9C;IAED;;OAEG;IACH,OAAc,cAAc,SAA2B;CAC1D","file":"gateway-urls.d.ts","sourcesContent":["import { EnvironmentModule } from '../manifest/environment-modules';\r\n\r\n/**\r\n * Translated gateway v1 and v2 strings as appropriate\r\n */\r\nexport class GatewayUrls {\r\n /**\r\n *Setting connectivity url\r\n */\r\n public static settingsConnectivityRelativeUrl = '/settings/connectivity';\r\n\r\n /**\r\n * Return correct aadUser url depending on the gateway version\r\n */\r\n public static get aadUser(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/user' : 'gateway/aad/user';\r\n }\r\n\r\n /**\r\n * Return correct aadApplication url depending on the gateway version\r\n */\r\n public static get aadApplication(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/application' : 'gateway/aad/application';\r\n }\r\n\r\n /**\r\n * Return correct aadRegisterStatus url depending on the gateway version\r\n */\r\n public static get aadRegisterStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/registerStatus' : 'gateway/aad/registerStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadTokenStatus url depending on the gateway version\r\n */\r\n public static get aadTokenStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/tokenStatus' : 'gateway/aad/tokenStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadDeviceCodeUrl url depending on the gateway version\r\n */\r\n public static get aadDeviceCodeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/deviceCode' : 'gateway/aad/CloudName/{0}/deviceCode';\r\n }\r\n\r\n /**\r\n * Return correct getTenantsUrl url depending on the gateway version\r\n */\r\n public static get getTenantsUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/tenants' : 'gateway/aad/CloudName/{0}/tenants';\r\n }\r\n\r\n /**\r\n * Return correct aadSignOut url depending on the gateway version\r\n */\r\n public static get aadSignOut(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/signOut' : 'gateway/aad/signOut';\r\n }\r\n\r\n /**\r\n * Return correct aadAppInfo url depending on the gateway version\r\n */\r\n public static get aadAppInfo(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/appInfo' : 'gateway/aad/appInfo';\r\n }\r\n\r\n /**\r\n * Return correct disableAadAppAuth url depending on the gateway version\r\n */\r\n public static get disableAadAppAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/disableAadAuth' : 'gateway/aad/disableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct enableAadAuth url depending on the gateway version\r\n */\r\n public static get enableAadAuthAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/enableAadAuth' : 'gateway/aad/enableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct securityGroupActionTemplate url depending on the gateway version\r\n */\r\n public static get securityGroupActionTemplate(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/{0}/{1}/type/{2}' : 'gateway/access/{0}/{1}/type/{2}';\r\n }\r\n\r\n /**\r\n * Return correct aadAppWithParam url depending on the gateway version\r\n */\r\n public static get aadAppWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/application' : 'gateway/aad/cloudName/{0}/application';\r\n }\r\n\r\n /**\r\n * Return correct aadAzureAppsWithParam url depending on the gateway version\r\n */\r\n public static get aadAzureAppsWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/azureApplications' : 'gateway/aad/cloudName/{0}/azureApplications';\r\n }\r\n\r\n /**\r\n * Return correct accessCheck url url depending on the gateway version\r\n */\r\n public static get accessCheck(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/check' : 'gateway/access/check';\r\n }\r\n\r\n /**\r\n * Return correct accessUser url depending on the gateway version\r\n */\r\n public static get accessUsers(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/users' : 'gateway/access/users';\r\n }\r\n\r\n /**\r\n * Return correct accessAdmin url depending on the gateway version\r\n */\r\n public static get accessAdmins(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/admins' : 'gateway/access/admins';\r\n }\r\n\r\n /**\r\n * Return correct adDomainRelativeUrl url depending on the gateway version\r\n * 'services/WinREST/activeDirectory/domain' is the GWV2 url\r\n * 'gateway/domain' is the GWV1 url\r\n */\r\n public static get adDomainRelativeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/domain' : 'gateway/domain';\r\n }\r\n\r\n /**\r\n * Get latest gateway version url\r\n */\r\n public static gatewayVersion = 'gateway/latestVersion';\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/gateway-urls.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,WAAW;IACpB;;OAEG;IACH,OAAc,+BAA+B,SAA4B;IAEzE;;OAEG;IACH,WAAkB,OAAO,IAAI,MAAM,CAElC;IAED;;OAEG;IACH,WAAkB,cAAc,IAAI,MAAM,CAEzC;IAED;;OAEG;IACH,WAAkB,iBAAiB,IAAI,MAAM,CAE5C;IAED;;OAEG;IACH,WAAkB,cAAc,IAAI,MAAM,CAEzC;IAED;;OAEG;IACH,WAAkB,gBAAgB,IAAI,MAAM,CAE3C;IAED;;OAEG;IACH,WAAkB,aAAa,IAAI,MAAM,CAExC;IAED;;OAEG;IACH,WAAkB,UAAU,IAAI,MAAM,CAErC;IAED;;OAEG;IACH,WAAkB,UAAU,IAAI,MAAM,CAErC;IAED;;OAEG;IACH,WAAkB,iBAAiB,IAAI,MAAM,CAE5C;IAED;;OAEG;IACH,WAAkB,iBAAiB,IAAI,MAAM,CAE5C;IAED;;OAEG;IACH,WAAkB,2BAA2B,IAAI,MAAM,CAEtD;IAED;;OAEG;IACH,WAAkB,eAAe,8EAEhC;IAED;;OAEG;IACH,WAAkB,qBAAqB,0FAEtC;IAEF;;QAEI;IACH,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;IACH,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;IACH,WAAkB,YAAY,IAAI,MAAM,CAEvC;IAED;;;;OAIG;IACH,WAAkB,mBAAmB,IAAI,MAAM,CAE9C;IAED;;;;OAIG;IACH,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED;;OAEG;IACH,OAAc,cAAc,SAA2B;CAC1D","file":"gateway-urls.d.ts","sourcesContent":["import { EnvironmentModule } from '../manifest/environment-modules';\r\n\r\n/**\r\n * Translated gateway v1 and v2 strings as appropriate\r\n */\r\nexport class GatewayUrls {\r\n /**\r\n *Setting connectivity url\r\n */\r\n public static settingsConnectivityRelativeUrl = '/settings/connectivity';\r\n\r\n /**\r\n * Return correct aadUser url depending on the gateway version\r\n */\r\n public static get aadUser(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/user' : 'gateway/aad/user';\r\n }\r\n\r\n /**\r\n * Return correct aadApplication url depending on the gateway version\r\n */\r\n public static get aadApplication(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/application' : 'gateway/aad/application';\r\n }\r\n\r\n /**\r\n * Return correct aadRegisterStatus url depending on the gateway version\r\n */\r\n public static get aadRegisterStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/registerStatus' : 'gateway/aad/registerStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadTokenStatus url depending on the gateway version\r\n */\r\n public static get aadTokenStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/tokenStatus' : 'gateway/aad/tokenStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadDeviceCodeUrl url depending on the gateway version\r\n */\r\n public static get aadDeviceCodeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/deviceCode' : 'gateway/aad/CloudName/{0}/deviceCode';\r\n }\r\n\r\n /**\r\n * Return correct getTenantsUrl url depending on the gateway version\r\n */\r\n public static get getTenantsUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/tenants' : 'gateway/aad/CloudName/{0}/tenants';\r\n }\r\n\r\n /**\r\n * Return correct aadSignOut url depending on the gateway version\r\n */\r\n public static get aadSignOut(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/signOut' : 'gateway/aad/signOut';\r\n }\r\n\r\n /**\r\n * Return correct aadAppInfo url depending on the gateway version\r\n */\r\n public static get aadAppInfo(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/appInfo' : 'gateway/aad/appInfo';\r\n }\r\n\r\n /**\r\n * Return correct disableAadAppAuth url depending on the gateway version\r\n */\r\n public static get disableAadAppAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/disableAadAuth' : 'gateway/aad/disableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct enableAadAuth url depending on the gateway version\r\n */\r\n public static get enableAadAuthAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/enableAadAuth' : 'gateway/aad/enableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct securityGroupActionTemplate url depending on the gateway version\r\n */\r\n public static get securityGroupActionTemplate(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/{0}/{1}/type/{2}' : 'gateway/access/{0}/{1}/type/{2}';\r\n }\r\n\r\n /**\r\n * Return correct aadAppWithParam url depending on the gateway version\r\n */\r\n public static get aadAppWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/application' : 'gateway/aad/cloudName/{0}/application';\r\n }\r\n\r\n /**\r\n * Return correct aadAzureAppsWithParam url depending on the gateway version\r\n */\r\n public static get aadAzureAppsWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/azureApplications' : 'gateway/aad/cloudName/{0}/azureApplications';\r\n }\r\n\r\n /**\r\n * Return correct accessCheck url url depending on the gateway version\r\n */\r\n public static get accessCheck(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/check' : 'gateway/access/check';\r\n }\r\n\r\n /**\r\n * Return correct accessUser url depending on the gateway version\r\n */\r\n public static get accessUsers(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/users' : 'gateway/access/users';\r\n }\r\n\r\n /**\r\n * Return correct accessAdmin url depending on the gateway version\r\n */\r\n public static get accessAdmins(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/admins' : 'gateway/access/admins';\r\n }\r\n\r\n /**\r\n * Return correct adDomainRelativeUrl url depending on the gateway version\r\n * 'services/WinREST/activeDirectory/domain' is the GWV2 url\r\n * 'gateway/domain' is the GWV1 url\r\n */\r\n public static get adDomainRelativeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/domain' : 'gateway/domain';\r\n }\r\n\r\n /**\r\n * Return correct adAccountsRelativeUrl url depending on the gateway version\r\n * 'services/WinREST/activeDirectory/accounts' is the GWV2 url\r\n * 'gateway/accounts' is the GWV1 url\r\n */\r\n public static get adAccountsRelativeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/accounts' : 'gateway/accounts';\r\n }\r\n\r\n /**\r\n * Get latest gateway version url\r\n */\r\n public static gatewayVersion = 'gateway/latestVersion';\r\n}\r\n"]}
@@ -111,6 +111,14 @@ export class GatewayUrls {
111
111
  static get adDomainRelativeUrl() {
112
112
  return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/domain' : 'gateway/domain';
113
113
  }
114
+ /**
115
+ * Return correct adAccountsRelativeUrl url depending on the gateway version
116
+ * 'services/WinREST/activeDirectory/accounts' is the GWV2 url
117
+ * 'gateway/accounts' is the GWV1 url
118
+ */
119
+ static get adAccountsRelativeUrl() {
120
+ return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/accounts' : 'gateway/accounts';
121
+ }
114
122
  /**
115
123
  * Get latest gateway version url
116
124
  */
@@ -1 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I,MAAM,KAAK,mBAAmB;QACjC,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAC1G,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,cAAc,GAAG,uBAAuB,CAAC","file":"gateway-urls.js","sourcesContent":["import { EnvironmentModule } from '../manifest/environment-modules';\r\n\r\n/**\r\n * Translated gateway v1 and v2 strings as appropriate\r\n */\r\nexport class GatewayUrls {\r\n /**\r\n *Setting connectivity url\r\n */\r\n public static settingsConnectivityRelativeUrl = '/settings/connectivity';\r\n\r\n /**\r\n * Return correct aadUser url depending on the gateway version\r\n */\r\n public static get aadUser(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/user' : 'gateway/aad/user';\r\n }\r\n\r\n /**\r\n * Return correct aadApplication url depending on the gateway version\r\n */\r\n public static get aadApplication(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/application' : 'gateway/aad/application';\r\n }\r\n\r\n /**\r\n * Return correct aadRegisterStatus url depending on the gateway version\r\n */\r\n public static get aadRegisterStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/registerStatus' : 'gateway/aad/registerStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadTokenStatus url depending on the gateway version\r\n */\r\n public static get aadTokenStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/tokenStatus' : 'gateway/aad/tokenStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadDeviceCodeUrl url depending on the gateway version\r\n */\r\n public static get aadDeviceCodeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/deviceCode' : 'gateway/aad/CloudName/{0}/deviceCode';\r\n }\r\n\r\n /**\r\n * Return correct getTenantsUrl url depending on the gateway version\r\n */\r\n public static get getTenantsUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/tenants' : 'gateway/aad/CloudName/{0}/tenants';\r\n }\r\n\r\n /**\r\n * Return correct aadSignOut url depending on the gateway version\r\n */\r\n public static get aadSignOut(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/signOut' : 'gateway/aad/signOut';\r\n }\r\n\r\n /**\r\n * Return correct aadAppInfo url depending on the gateway version\r\n */\r\n public static get aadAppInfo(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/appInfo' : 'gateway/aad/appInfo';\r\n }\r\n\r\n /**\r\n * Return correct disableAadAppAuth url depending on the gateway version\r\n */\r\n public static get disableAadAppAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/disableAadAuth' : 'gateway/aad/disableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct enableAadAuth url depending on the gateway version\r\n */\r\n public static get enableAadAuthAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/enableAadAuth' : 'gateway/aad/enableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct securityGroupActionTemplate url depending on the gateway version\r\n */\r\n public static get securityGroupActionTemplate(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/{0}/{1}/type/{2}' : 'gateway/access/{0}/{1}/type/{2}';\r\n }\r\n\r\n /**\r\n * Return correct aadAppWithParam url depending on the gateway version\r\n */\r\n public static get aadAppWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/application' : 'gateway/aad/cloudName/{0}/application';\r\n }\r\n\r\n /**\r\n * Return correct aadAzureAppsWithParam url depending on the gateway version\r\n */\r\n public static get aadAzureAppsWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/azureApplications' : 'gateway/aad/cloudName/{0}/azureApplications';\r\n }\r\n\r\n /**\r\n * Return correct accessCheck url url depending on the gateway version\r\n */\r\n public static get accessCheck(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/check' : 'gateway/access/check';\r\n }\r\n\r\n /**\r\n * Return correct accessUser url depending on the gateway version\r\n */\r\n public static get accessUsers(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/users' : 'gateway/access/users';\r\n }\r\n\r\n /**\r\n * Return correct accessAdmin url depending on the gateway version\r\n */\r\n public static get accessAdmins(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/admins' : 'gateway/access/admins';\r\n }\r\n\r\n /**\r\n * Return correct adDomainRelativeUrl url depending on the gateway version\r\n * 'services/WinREST/activeDirectory/domain' is the GWV2 url\r\n * 'gateway/domain' is the GWV1 url\r\n */\r\n public static get adDomainRelativeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/domain' : 'gateway/domain';\r\n }\r\n\r\n /**\r\n * Get latest gateway version url\r\n */\r\n public static gatewayVersion = 'gateway/latestVersion';\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/gateway-urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE;;GAEG;AACH,MAAM,OAAO,WAAW;IACpB;;OAEG;IACI,MAAM,CAAC,+BAA+B,GAAG,wBAAwB,CAAC;IAEzE;;OAEG;IACI,MAAM,KAAK,OAAO;QACrB,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAC7E,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,cAAc;QAC5B,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,yBAAyB,CAAC;IAC3F,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,iBAAiB;QAC/B,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,4BAA4B,CAAC;IACjG,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,cAAc;QAC5B,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,yBAAyB,CAAC;IAC3F,CAAC;IAED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6CAA6C,CAAC;IACnI,CAAC;IAEF;;QAEI;IACI,MAAM,KAAK,WAAW;QACzB,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,sBAAsB,CAAC;IACrF,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,WAAW;QACzB,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,sBAAsB,CAAC;IACrF,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,YAAY;QAC1B,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,uBAAuB,CAAC;IACvF,CAAC;IAED;;;;OAIG;IACI,MAAM,KAAK,mBAAmB;QACjC,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAC1G,CAAC;IAED;;;;OAIG;IACI,MAAM,KAAK,qBAAqB;QACnC,OAAO,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAC9G,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,cAAc,GAAG,uBAAuB,CAAC","file":"gateway-urls.js","sourcesContent":["import { EnvironmentModule } from '../manifest/environment-modules';\r\n\r\n/**\r\n * Translated gateway v1 and v2 strings as appropriate\r\n */\r\nexport class GatewayUrls {\r\n /**\r\n *Setting connectivity url\r\n */\r\n public static settingsConnectivityRelativeUrl = '/settings/connectivity';\r\n\r\n /**\r\n * Return correct aadUser url depending on the gateway version\r\n */\r\n public static get aadUser(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/user' : 'gateway/aad/user';\r\n }\r\n\r\n /**\r\n * Return correct aadApplication url depending on the gateway version\r\n */\r\n public static get aadApplication(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/application' : 'gateway/aad/application';\r\n }\r\n\r\n /**\r\n * Return correct aadRegisterStatus url depending on the gateway version\r\n */\r\n public static get aadRegisterStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/registerStatus' : 'gateway/aad/registerStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadTokenStatus url depending on the gateway version\r\n */\r\n public static get aadTokenStatus(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/tokenStatus' : 'gateway/aad/tokenStatus';\r\n }\r\n\r\n /**\r\n * Return correct aadDeviceCodeUrl url depending on the gateway version\r\n */\r\n public static get aadDeviceCodeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/deviceCode' : 'gateway/aad/CloudName/{0}/deviceCode';\r\n }\r\n\r\n /**\r\n * Return correct getTenantsUrl url depending on the gateway version\r\n */\r\n public static get getTenantsUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/CloudName/{0}/tenants' : 'gateway/aad/CloudName/{0}/tenants';\r\n }\r\n\r\n /**\r\n * Return correct aadSignOut url depending on the gateway version\r\n */\r\n public static get aadSignOut(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/signOut' : 'gateway/aad/signOut';\r\n }\r\n\r\n /**\r\n * Return correct aadAppInfo url depending on the gateway version\r\n */\r\n public static get aadAppInfo(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/appInfo' : 'gateway/aad/appInfo';\r\n }\r\n\r\n /**\r\n * Return correct disableAadAppAuth url depending on the gateway version\r\n */\r\n public static get disableAadAppAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/disableAadAuth' : 'gateway/aad/disableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct enableAadAuth url depending on the gateway version\r\n */\r\n public static get enableAadAuthAuth(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/enableAadAuth' : 'gateway/aad/enableAadAuth';\r\n }\r\n\r\n /**\r\n * Return correct securityGroupActionTemplate url depending on the gateway version\r\n */\r\n public static get securityGroupActionTemplate(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/{0}/{1}/type/{2}' : 'gateway/access/{0}/{1}/type/{2}';\r\n }\r\n\r\n /**\r\n * Return correct aadAppWithParam url depending on the gateway version\r\n */\r\n public static get aadAppWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/application' : 'gateway/aad/cloudName/{0}/application';\r\n }\r\n\r\n /**\r\n * Return correct aadAzureAppsWithParam url depending on the gateway version\r\n */\r\n public static get aadAzureAppsWithParam() {\r\n return EnvironmentModule.isGatewayV200 ? 'aad/cloudName/{0}/azureApplications' : 'gateway/aad/cloudName/{0}/azureApplications';\r\n }\r\n\r\n /**\r\n * Return correct accessCheck url url depending on the gateway version\r\n */\r\n public static get accessCheck(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/check' : 'gateway/access/check';\r\n }\r\n\r\n /**\r\n * Return correct accessUser url depending on the gateway version\r\n */\r\n public static get accessUsers(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/users' : 'gateway/access/users';\r\n }\r\n\r\n /**\r\n * Return correct accessAdmin url depending on the gateway version\r\n */\r\n public static get accessAdmins(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'access/admins' : 'gateway/access/admins';\r\n }\r\n\r\n /**\r\n * Return correct adDomainRelativeUrl url depending on the gateway version\r\n * 'services/WinREST/activeDirectory/domain' is the GWV2 url\r\n * 'gateway/domain' is the GWV1 url\r\n */\r\n public static get adDomainRelativeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/domain' : 'gateway/domain';\r\n }\r\n\r\n /**\r\n * Return correct adAccountsRelativeUrl url depending on the gateway version\r\n * 'services/WinREST/activeDirectory/accounts' is the GWV2 url\r\n * 'gateway/accounts' is the GWV1 url\r\n */\r\n public static get adAccountsRelativeUrl(): string {\r\n return EnvironmentModule.isGatewayV200 ? 'services/WinREST/activeDirectory/accounts' : 'gateway/accounts';\r\n }\r\n\r\n /**\r\n * Get latest gateway version url\r\n */\r\n public static gatewayVersion = 'gateway/latestVersion';\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/data/node-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAM,MAAM,MAAM,CAAC;AAKtC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAIzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAE7D;;GAEG;AACH,oBAAY,aAAa;IACrB;;OAEG;IACH,MAAM,IAAA;IAEN;;OAEG;IACH,QAAQ,IAAA;IAER;;OAEG;IACH,MAAM,IAAA;IAEN;;OAEG;IACH,KAAK,IAAA;CACR;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IAErD;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAE3C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,GAAG,CAAC;IAE3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE;QAChB;;WAEG;QACH,SAAS,EAAE,aAAa,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,GAAG,CAAC;KACpB,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc,EAAE,kBAAkB;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,QAAQ,EAAE,MAAM,GAAG,MAAM;IAetG;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IA2DzB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAalB;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;CA4B3B","file":"node-connection.d.ts","sourcesContent":["import { Observable, of } from 'rxjs';\r\nimport { map, mergeMap } from 'rxjs/operators';\r\nimport { SmeWebTelemetry } from '../diagnostics/sme-web-telemetry';\r\nimport { Strings } from '../generated/strings';\r\nimport { EnvironmentModule } from '../manifest/environment-modules';\r\nimport { AuthorizationManager, AuthorizationToken } from '../security/authorization-manager';\r\nimport { GatewayConnection, GatewayRequest } from './gateway-connection';\r\nimport { GatewayUrlTranslator } from './gateway-url-translator';\r\nimport { headerConstants } from './http-constants';\r\nimport { Net } from './net';\r\nimport { PowerShellCommandWithoutState } from './powershell';\r\n\r\n/**\r\n * Node Cim output type.\r\n */\r\nexport enum NodeCimOutput {\r\n /**\r\n * Single instance.\r\n */\r\n Single,\r\n\r\n /**\r\n * Multiple instances.\r\n */\r\n Multiple,\r\n\r\n /**\r\n * Invoke result.\r\n */\r\n Result,\r\n\r\n /**\r\n * WQL query result.\r\n */\r\n Query\r\n}\r\n\r\n/**\r\n * Node Request options that we use to extend the GatewayRequest interface\r\n */\r\nexport interface NodeRequestOptions {\r\n /**\r\n * Indicates that no auth failure handling should take place, however, any auth headers for this node will still be added.\r\n */\r\n noAuth?: boolean;\r\n\r\n /**\r\n * Provides an alternative token to use for just this request\r\n */\r\n authToken?: AuthorizationToken;\r\n\r\n /**\r\n * Authentication mechanism.\r\n */\r\n authenticationMechanism?: 'Credssp' | 'NotSpecified';\r\n\r\n /**\r\n * Indicates if command should run in local runspace instead of remote runspace.\r\n */\r\n useInProcRunspace?: boolean;\r\n\r\n /**\r\n * Indicates that audit logging for this request should be made. Default is false.\r\n */\r\n logAudit?: boolean;\r\n\r\n /**\r\n * Indicates that telemetry logging for this request should be made. Default is false.\r\n * SmeWebTelemetry will not be sent for polling PS events.\r\n */\r\n logTelemetry?: boolean;\r\n\r\n /**\r\n * Indicates targeting to specific PowerShell endpoint.\r\n * The endpoint data is inserted to the endpoint header.\r\n */\r\n powerShellEndpoint?: string;\r\n\r\n /**\r\n * The PowerShell command resource on JEA PowerShell endpoint.\r\n * The command object is used for auto fallback time on a CIM query.\r\n * (Only CIM query uses this property)\r\n */\r\n powerShell?: PowerShellCommandWithoutState;\r\n\r\n /**\r\n * The parameters for instance query powershell alternative.\r\n * (Only CIM query uses this property)\r\n */\r\n powerShellParameters?: any;\r\n\r\n /**\r\n * The PowerShell context to replace CIM call.\r\n * (Only CIM query uses this property)\r\n */\r\n powerShellContext?: {\r\n /**\r\n * CIM output data type.\r\n */\r\n cimOutput: NodeCimOutput;\r\n\r\n /**\r\n * CIM input parameters.\r\n */\r\n parameters?: any;\r\n };\r\n}\r\n\r\n/**\r\n * Extension of GatewayRequest interface for calling the Gateway Node API\r\n */\r\nexport interface NodeRequest extends GatewayRequest, NodeRequestOptions {\r\n}\r\n\r\n/**\r\n * Service request interface for gateway version 2.\r\n */\r\nexport interface ServiceRequest {\r\n /**\r\n * The service name such as \"WinRest\", \"WinStream\", \"LinuxBase\" and so on.\r\n */\r\n serviceName: string;\r\n\r\n /**\r\n * The controller name such as \"PowerShell\", \"Cim\", \"Ssh\" and so on.\r\n */\r\n controllerName: string;\r\n\r\n /**\r\n * The node name.\r\n */\r\n nodeName: string;\r\n}\r\n\r\n/**\r\n * The Node Connection class for creating requests and calling the Gateway's Node API\r\n */\r\nexport class NodeConnection {\r\n /**\r\n * Initializes a new instance of the GatewayService class.\r\n *\r\n * @param gateway the gateway Connection\r\n * @param authorizationManager the authorization manager.\r\n */\r\n constructor(private gateway: GatewayConnection, private authorizationManager: AuthorizationManager) { }\r\n\r\n /**\r\n * Makes a POST call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param remained the remained Url after 'nodes/<nodeName>'.\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public post(serviceRequest: ServiceRequest, remained: string, body?: any, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a POST call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public post(nodeName: string, relativeUrl: string, body?: any, request?: NodeRequest): Observable<any>;\r\n public post(nodeOrService: string | ServiceRequest, remained: string, body?: any, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.post(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a GET call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public get(serviceRequest: ServiceRequest, relativeUrl: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a GET call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n */\r\n public get(nodeName: string, relativeUrl: string, request?: NodeRequest): Observable<any>;\r\n public get(nodeOrService: string | ServiceRequest, remained: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.get(relativeUrl, request);\r\n }\r\n\r\n /**\r\n * Makes a PUT call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public put(serviceRequest: ServiceRequest, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a PUT call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public put(nodeName: string, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n public put(nodeOrService: string | ServiceRequest, remained: string, body?: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.put(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a PATCH call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public patch(serviceRequest: ServiceRequest, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a PATCH call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public patch(nodeName: string, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n public patch(nodeOrService: string | ServiceRequest, remained: string, body?: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.patch(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public delete(serviceRequest: ServiceRequest, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a DELETE call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public delete(nodeName: string, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n public delete(nodeOrService: string | ServiceRequest, remained: string, body?: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.delete(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway node api without waiting for the response.\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public deleteQuick(serviceRequest: ServiceRequest, relativeUrl: string, request?: NodeRequest): void;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a DELETE call to the gateway node api without waiting for the response.\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n */\r\n public deleteQuick(nodeName: string, relativeUrl: string, request?: NodeRequest): void;\r\n public deleteQuick(nodeOrService: string | ServiceRequest, remained: string, request?: NodeRequest): void {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request.headers = request.headers || {};\r\n if (!request.authToken) {\r\n // if we don't have an authToken, then make sure we are not waiting on one.\r\n this.authorizationManager.addAuthorizationRequestHeader(request, nodeName);\r\n } else {\r\n this.authorizationManager.addAuthorizationRequestHeader(request, nodeName, request.authToken);\r\n }\r\n\r\n const endpoint = this.authorizationManager.getJeaEndpoint(nodeName);\r\n if (request.powerShellEndpoint) {\r\n // Override JEA fallback if endpoint is explicitly set for debugging purposes\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = request.powerShellEndpoint;\r\n } else if (endpoint) {\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = endpoint;\r\n }\r\n\r\n if (request.authenticationMechanism === 'Credssp') {\r\n (<any>request).headers[headerConstants.AUTHENTICATION_MECHANISM] = request.authenticationMechanism;\r\n }\r\n\r\n return this.gateway.deleteQuick(relativeUrl, request.headers);\r\n }\r\n\r\n /**\r\n * Persists the JEA powershell endpoint context\r\n * @param nodeName The node name\r\n * @param endpoint The powershell endpoint\r\n */\r\n public saveJeaContext(nodeName: string, endpoint: string) {\r\n this.authorizationManager.saveJeaContext(nodeName, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the JEA powershell endpoint, if it exists\r\n * @param nodeName The node name\r\n */\r\n public getJeaEndpoint(nodeName: string) {\r\n return this.authorizationManager.getJeaEndpoint(nodeName);\r\n }\r\n\r\n /**\r\n * Creates service node API for Gateway V2.\r\n *\r\n * @param serviceName the name of service.\r\n * @param apiName the name of api.\r\n * @param nodeName the name of node.\r\n * @param remained the remained URL after it including option parameters.\r\n * @returns URL string.\r\n */\r\n public getServiceUrl(serviceName: string, apiName: string, nodeName: string, remained: string): string {\r\n // 1) if null or empty, it's empty.\r\n // 2) if start with \"?\", remains as is.\r\n // 3) if not started with \"/\", add \"/\".\r\n remained = remained ?? '';\r\n if (remained.length > 0 && !remained.startsWith('/')) {\r\n if (!remained.startsWith('?')) {\r\n remained = `/${remained}`;\r\n }\r\n }\r\n\r\n // for example, \"/api/services/WinREST/PowerShell/nodes/computer-abc/invoke\"\r\n return `/Services/${serviceName}/${apiName}/nodes/${nodeName}${remained}`;\r\n }\r\n\r\n /**\r\n * Adds default parameters to a NodeRequest\r\n *\r\n * @param method the http method to use\r\n * @param relativeUrl the relative Url after \"/api/\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object to extend.\r\n */\r\n private createNodeRequest(request: NodeRequest, nodeName: string): GatewayRequest {\r\n // if we did not specify no auth, and we are not using a custom token...\r\n request = MsftSme.deepAssign({}, request);\r\n if (!request.noAuth && !request.authToken) {\r\n // ...then add node specific authorization handlers\r\n request.retryHandlers = (request.retryHandlers || []).concat([{\r\n canHandle: (code, error) => this.authorizationManager.canHandleAjaxFailure(code, error),\r\n handle: (code, originalRequest, error) =>\r\n this.authorizationManager.handleAjaxFailure(code, originalRequest, error, nodeName)\r\n }]);\r\n }\r\n\r\n const oldBeforeCall = request.beforeCall;\r\n\r\n // Add before call handler to wait for any pending node authorization\r\n request.beforeCall = pendingRequest => {\r\n let observable: Observable<void> = null;\r\n if (!request.authToken) {\r\n // if we dont have an authToken, then make sure we are not waiting on one.\r\n observable = this.authorizationManager.authAwaiter\r\n .pipe(map(() =>\r\n this.authorizationManager.addAuthorizationRequestHeader(pendingRequest, nodeName)));\r\n } else {\r\n observable = of(\r\n this.authorizationManager.addAuthorizationRequestHeader(pendingRequest, nodeName, request.authToken)\r\n );\r\n }\r\n\r\n if (oldBeforeCall) {\r\n return oldBeforeCall(request).pipe(mergeMap(() => observable));\r\n }\r\n\r\n return observable;\r\n };\r\n\r\n request.headers = request.headers || {};\r\n if (request.logAudit === true || request.logAudit === false) {\r\n (<any>request).headers[headerConstants.LOG_AUDIT] = request.logAudit ? 'true' : 'false';\r\n }\r\n\r\n if (request.logTelemetry === true || request.logTelemetry === false) {\r\n (<any>request).headers[headerConstants.LOG_TELEMETRY] = request.logTelemetry ? 'true' : 'false';\r\n }\r\n\r\n const endpoint = this.authorizationManager.getJeaEndpoint(nodeName);\r\n if (request.powerShellEndpoint) {\r\n // Override JEA fallback if endpoint is explicitly set for debugging purposes\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = request.powerShellEndpoint;\r\n } else if (endpoint) {\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = endpoint;\r\n }\r\n\r\n if (request.authenticationMechanism === 'Credssp') {\r\n (<any>request).headers[headerConstants.AUTHENTICATION_MECHANISM] = request.authenticationMechanism;\r\n }\r\n\r\n return request;\r\n }\r\n\r\n /**\r\n * Get node name and node url.\r\n * @param nodeOrService The node name or service request object.\r\n * @param remained The remained url.\r\n * @returns node name and node url.\r\n */\r\n private getNodeUrl(nodeOrService: string | ServiceRequest, remained: string): { nodeName: string, relativeUrl: string } {\r\n if (typeof nodeOrService === 'string') {\r\n const nodeName = <string>nodeOrService;\r\n return { nodeName, relativeUrl: this.getNodeMappedUrl(nodeName, remained) };\r\n }\r\n\r\n const service = <ServiceRequest>nodeOrService;\r\n return {\r\n nodeName: service.nodeName,\r\n relativeUrl: this.getServiceUrl(service.serviceName, service.controllerName, service.nodeName, remained)\r\n };\r\n }\r\n\r\n /**\r\n * Creates a Node url\r\n *\r\n * @param nodeName the name of the node to make a call against\r\n * @param relativeUrl the relative Url after \"/nodes/<nodeName>/\"\r\n */\r\n private getNodeMappedUrl(nodeName: string, relativeUrl: string): string {\r\n if (EnvironmentModule.isGatewayV200) {\r\n const translation = GatewayUrlTranslator.translate(relativeUrl);\r\n if (translation) {\r\n return `${translation.startUrl}/nodes/${nodeName}/${translation.newUrl}`;\r\n }\r\n\r\n SmeWebTelemetry.traceAction(null, {\r\n content: {\r\n message: 'Could not get translation for URL: {0}'.format(relativeUrl),\r\n action: 'TranslateUrlToGateWayV2'\r\n }\r\n },\r\n { type: 'error' });\r\n\r\n throw new Error(MsftSme.getStrings<Strings>().MsftSmeShell.Core.TranslateGatewayUrls.Url.Not.expected.ErrorMessage\r\n .format(relativeUrl)\r\n );\r\n }\r\n\r\n // create node url from current url\r\n if (!relativeUrl.startsWith('/')) {\r\n relativeUrl = `/${relativeUrl}`;\r\n }\r\n\r\n relativeUrl = Net.updateApiVersion20190201(relativeUrl);\r\n return `/nodes/${nodeName}${relativeUrl}`;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/data/node-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAM,MAAM,MAAM,CAAC;AAKtC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAIzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAE7D;;GAEG;AACH,oBAAY,aAAa;IACrB;;OAEG;IACH,MAAM,IAAA;IAEN;;OAEG;IACH,QAAQ,IAAA;IAER;;OAEG;IACH,MAAM,IAAA;IAEN;;OAEG;IACH,KAAK,IAAA;CACR;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IAErD;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAE3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,WAAW,GAAG,IAAI;IA0BtF;;;;OAIG;IACI,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAIxD;;;OAGG;IACI,cAAc,CAAC,QAAQ,EAAE,MAAM;IAItC;;;;;;;;OAQG;IACI,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAetG;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IA2DzB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAalB;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;CA0B3B","file":"node-connection.d.ts","sourcesContent":["import { Observable, of } from 'rxjs';\r\nimport { map, mergeMap } from 'rxjs/operators';\r\nimport { SmeWebTelemetry } from '../diagnostics/sme-web-telemetry';\r\nimport { Strings } from '../generated/strings';\r\nimport { EnvironmentModule } from '../manifest/environment-modules';\r\nimport { AuthorizationManager, AuthorizationToken } from '../security/authorization-manager';\r\nimport { GatewayConnection, GatewayRequest } from './gateway-connection';\r\nimport { GatewayUrlTranslator } from './gateway-url-translator';\r\nimport { headerConstants } from './http-constants';\r\nimport { Net } from './net';\r\nimport { PowerShellCommandWithoutState } from './powershell';\r\n\r\n/**\r\n * Node Cim output type.\r\n */\r\nexport enum NodeCimOutput {\r\n /**\r\n * Single instance.\r\n */\r\n Single,\r\n\r\n /**\r\n * Multiple instances.\r\n */\r\n Multiple,\r\n\r\n /**\r\n * Invoke result.\r\n */\r\n Result,\r\n\r\n /**\r\n * WQL query result.\r\n */\r\n Query\r\n}\r\n\r\n/**\r\n * Node Request options that we use to extend the GatewayRequest interface\r\n */\r\nexport interface NodeRequestOptions {\r\n /**\r\n * Indicates that no auth failure handling should take place, however, any auth headers for this node will still be added.\r\n */\r\n noAuth?: boolean;\r\n\r\n /**\r\n * Provides an alternative token to use for just this request\r\n */\r\n authToken?: AuthorizationToken;\r\n\r\n /**\r\n * Authentication mechanism.\r\n */\r\n authenticationMechanism?: 'Credssp' | 'NotSpecified';\r\n\r\n /**\r\n * Indicates if command should run in local runspace instead of remote runspace.\r\n */\r\n useInProcRunspace?: boolean;\r\n\r\n /**\r\n * Indicates that audit logging for this request should be made. Default is false.\r\n */\r\n logAudit?: boolean;\r\n\r\n /**\r\n * Indicates that telemetry logging for this request should be made. Default is false.\r\n * SmeWebTelemetry will not be sent for polling PS events.\r\n */\r\n logTelemetry?: boolean;\r\n\r\n /**\r\n * Indicates targeting to specific PowerShell endpoint.\r\n * The endpoint data is inserted to the endpoint header.\r\n */\r\n powerShellEndpoint?: string;\r\n\r\n /**\r\n * The PowerShell command resource on JEA PowerShell endpoint.\r\n * The command object is used for auto fallback time on a CIM query.\r\n * (Only CIM query uses this property)\r\n */\r\n powerShell?: PowerShellCommandWithoutState;\r\n\r\n /**\r\n * The parameters for instance query powershell alternative.\r\n * (Only CIM query uses this property)\r\n */\r\n powerShellParameters?: any;\r\n\r\n /**\r\n * The PowerShell context to replace CIM call.\r\n * (Only CIM query uses this property)\r\n */\r\n powerShellContext?: {\r\n /**\r\n * CIM output data type.\r\n */\r\n cimOutput: NodeCimOutput;\r\n\r\n /**\r\n * CIM input parameters.\r\n */\r\n parameters?: any;\r\n };\r\n}\r\n\r\n/**\r\n * Extension of GatewayRequest interface for calling the Gateway Node API\r\n */\r\nexport interface NodeRequest extends GatewayRequest, NodeRequestOptions {\r\n}\r\n\r\n/**\r\n * Service request interface for gateway version 2.\r\n */\r\nexport interface ServiceRequest {\r\n /**\r\n * The service name such as \"WinRest\", \"WinStream\", \"LinuxBase\" and so on.\r\n */\r\n serviceName: string;\r\n\r\n /**\r\n * The controller name such as \"PowerShell\", \"Cim\", \"Ssh\" and so on.\r\n */\r\n controllerName: string;\r\n\r\n /**\r\n * The node name.\r\n */\r\n nodeName: string;\r\n}\r\n\r\n/**\r\n * The Node Connection class for creating requests and calling the Gateway's Node API\r\n */\r\nexport class NodeConnection {\r\n /**\r\n * Initializes a new instance of the GatewayService class.\r\n *\r\n * @param gateway the gateway Connection\r\n * @param authorizationManager the authorization manager.\r\n */\r\n constructor(private gateway: GatewayConnection, private authorizationManager: AuthorizationManager) { }\r\n\r\n /**\r\n * Makes a POST call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param remained the remained Url after 'nodes/<nodeName>'.\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public post(serviceRequest: ServiceRequest, remained: string, body?: any, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a POST call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public post(nodeName: string, relativeUrl: string, body?: any, request?: NodeRequest): Observable<any>;\r\n public post(nodeOrService: string | ServiceRequest, remained: string, body?: any, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.post(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a GET call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public get(serviceRequest: ServiceRequest, relativeUrl: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a GET call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n */\r\n public get(nodeName: string, relativeUrl: string, request?: NodeRequest): Observable<any>;\r\n public get(nodeOrService: string | ServiceRequest, remained: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.get(relativeUrl, request);\r\n }\r\n\r\n /**\r\n * Makes a PUT call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public put(serviceRequest: ServiceRequest, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a PUT call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public put(nodeName: string, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n public put(nodeOrService: string | ServiceRequest, remained: string, body?: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.put(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a PATCH call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public patch(serviceRequest: ServiceRequest, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a PATCH call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public patch(nodeName: string, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n public patch(nodeOrService: string | ServiceRequest, remained: string, body?: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.patch(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway node api\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public delete(serviceRequest: ServiceRequest, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a DELETE call to the gateway node api\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object.\r\n */\r\n public delete(nodeName: string, relativeUrl: string, body?: string, request?: NodeRequest): Observable<any>;\r\n public delete(nodeOrService: string | ServiceRequest, remained: string, body?: string, request?: NodeRequest): Observable<any> {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request = this.createNodeRequest(request || <NodeRequest>{}, nodeName);\r\n return this.gateway.delete(relativeUrl, body, request);\r\n }\r\n\r\n /**\r\n * Makes a DELETE call to the gateway node api without waiting for the response.\r\n *\r\n * @param serviceRequest the object of service request.\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n * @remarks this API is for gateway version 2. It doesn't work on gateway version 1.\r\n */\r\n public deleteQuick(serviceRequest: ServiceRequest, relativeUrl: string, request?: NodeRequest): void;\r\n /**\r\n * @deprecated This API is for version 1 gateway server, use new API for version 2 gateway.\r\n * Makes a DELETE call to the gateway node api without waiting for the response.\r\n *\r\n * @param nodeName the name of the node to call the API for\r\n * @param relativeUrl the relative Url after \"/api/nodes/<nodeName>\"\r\n * @param request the node request object.\r\n */\r\n public deleteQuick(nodeName: string, relativeUrl: string, request?: NodeRequest): void;\r\n public deleteQuick(nodeOrService: string | ServiceRequest, remained: string, request?: NodeRequest): void {\r\n const { nodeName, relativeUrl } = this.getNodeUrl(nodeOrService, remained);\r\n request.headers = request.headers || {};\r\n if (!request.authToken) {\r\n // if we don't have an authToken, then make sure we are not waiting on one.\r\n this.authorizationManager.addAuthorizationRequestHeader(request, nodeName);\r\n } else {\r\n this.authorizationManager.addAuthorizationRequestHeader(request, nodeName, request.authToken);\r\n }\r\n\r\n const endpoint = this.authorizationManager.getJeaEndpoint(nodeName);\r\n if (request.powerShellEndpoint) {\r\n // Override JEA fallback if endpoint is explicitly set for debugging purposes\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = request.powerShellEndpoint;\r\n } else if (endpoint) {\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = endpoint;\r\n }\r\n\r\n if (request.authenticationMechanism === 'Credssp') {\r\n (<any>request).headers[headerConstants.AUTHENTICATION_MECHANISM] = request.authenticationMechanism;\r\n }\r\n\r\n return this.gateway.deleteQuick(relativeUrl, request.headers);\r\n }\r\n\r\n /**\r\n * Persists the JEA powershell endpoint context\r\n * @param nodeName The node name\r\n * @param endpoint The powershell endpoint\r\n */\r\n public saveJeaContext(nodeName: string, endpoint: string) {\r\n this.authorizationManager.saveJeaContext(nodeName, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the JEA powershell endpoint, if it exists\r\n * @param nodeName The node name\r\n */\r\n public getJeaEndpoint(nodeName: string) {\r\n return this.authorizationManager.getJeaEndpoint(nodeName);\r\n }\r\n\r\n /**\r\n * Creates service node API for Gateway V2.\r\n *\r\n * @param serviceName the name of service.\r\n * @param apiName the name of api.\r\n * @param nodeName the name of node.\r\n * @param remained the remained URL after it including option parameters.\r\n * @returns URL string.\r\n */\r\n public getServiceUrl(serviceName: string, apiName: string, nodeName: string, remained: string): string {\r\n // 1) if null or empty, it's empty.\r\n // 2) if start with \"?\", remains as is.\r\n // 3) if not started with \"/\", add \"/\".\r\n remained = remained ?? '';\r\n if (remained.length > 0 && !remained.startsWith('/')) {\r\n if (!remained.startsWith('?')) {\r\n remained = `/${remained}`;\r\n }\r\n }\r\n\r\n // for example, \"/api/services/WinREST/PowerShell/nodes/computer-abc/invoke\"\r\n return `/Services/${serviceName}/${apiName}/nodes/${nodeName}${remained}`;\r\n }\r\n\r\n /**\r\n * Adds default parameters to a NodeRequest\r\n *\r\n * @param method the http method to use\r\n * @param relativeUrl the relative Url after \"/api/\"\r\n * @param body the body string JSON.stringfy'ed\r\n * @param request the node request object to extend.\r\n */\r\n private createNodeRequest(request: NodeRequest, nodeName: string): GatewayRequest {\r\n // if we did not specify no auth, and we are not using a custom token...\r\n request = MsftSme.deepAssign({}, request);\r\n if (!request.noAuth && !request.authToken) {\r\n // ...then add node specific authorization handlers\r\n request.retryHandlers = (request.retryHandlers || []).concat([{\r\n canHandle: (code, error) => this.authorizationManager.canHandleAjaxFailure(code, error),\r\n handle: (code, originalRequest, error) =>\r\n this.authorizationManager.handleAjaxFailure(code, originalRequest, error, nodeName)\r\n }]);\r\n }\r\n\r\n const oldBeforeCall = request.beforeCall;\r\n\r\n // Add before call handler to wait for any pending node authorization\r\n request.beforeCall = pendingRequest => {\r\n let observable: Observable<void> = null;\r\n if (!request.authToken) {\r\n // if we dont have an authToken, then make sure we are not waiting on one.\r\n observable = this.authorizationManager.authAwaiter\r\n .pipe(map(() =>\r\n this.authorizationManager.addAuthorizationRequestHeader(pendingRequest, nodeName)));\r\n } else {\r\n observable = of(\r\n this.authorizationManager.addAuthorizationRequestHeader(pendingRequest, nodeName, request.authToken)\r\n );\r\n }\r\n\r\n if (oldBeforeCall) {\r\n return oldBeforeCall(request).pipe(mergeMap(() => observable));\r\n }\r\n\r\n return observable;\r\n };\r\n\r\n request.headers = request.headers || {};\r\n if (request.logAudit === true || request.logAudit === false) {\r\n (<any>request).headers[headerConstants.LOG_AUDIT] = request.logAudit ? 'true' : 'false';\r\n }\r\n\r\n if (request.logTelemetry === true || request.logTelemetry === false) {\r\n (<any>request).headers[headerConstants.LOG_TELEMETRY] = request.logTelemetry ? 'true' : 'false';\r\n }\r\n\r\n const endpoint = this.authorizationManager.getJeaEndpoint(nodeName);\r\n if (request.powerShellEndpoint) {\r\n // Override JEA fallback if endpoint is explicitly set for debugging purposes\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = request.powerShellEndpoint;\r\n } else if (endpoint) {\r\n (<any>request).headers[headerConstants.POWERSHELL_ENDPOINT] = endpoint;\r\n }\r\n\r\n if (request.authenticationMechanism === 'Credssp') {\r\n (<any>request).headers[headerConstants.AUTHENTICATION_MECHANISM] = request.authenticationMechanism;\r\n }\r\n\r\n return request;\r\n }\r\n\r\n /**\r\n * Get node name and node url.\r\n * @param nodeOrService The node name or service request object.\r\n * @param remained The remained url.\r\n * @returns node name and node url.\r\n */\r\n private getNodeUrl(nodeOrService: string | ServiceRequest, remained: string): { nodeName: string, relativeUrl: string } {\r\n if (typeof nodeOrService === 'string') {\r\n const nodeName = <string>nodeOrService;\r\n return { nodeName, relativeUrl: this.getNodeMappedUrl(nodeName, remained) };\r\n }\r\n\r\n const service = <ServiceRequest>nodeOrService;\r\n return {\r\n nodeName: service.nodeName,\r\n relativeUrl: this.getServiceUrl(service.serviceName, service.controllerName, service.nodeName, remained)\r\n };\r\n }\r\n\r\n /**\r\n * Creates a Node url\r\n *\r\n * @param nodeName the name of the node to make a call against\r\n * @param relativeUrl the relative Url after \"/nodes/<nodeName>/\"\r\n */\r\n private getNodeMappedUrl(nodeName: string, relativeUrl: string): string {\r\n if (EnvironmentModule.isGatewayV200) {\r\n const translation = GatewayUrlTranslator.translate(relativeUrl);\r\n if (translation) {\r\n return `${translation.startUrl}/nodes/${nodeName}/${translation.newUrl}`;\r\n }\r\n\r\n SmeWebTelemetry.traceAction(\r\n null,\r\n {\r\n content: {\r\n message: 'Could not get translation for URL: {0}'.format(relativeUrl),\r\n action: 'TranslateUrlToGateWayV2'\r\n }\r\n },\r\n { type: 'error' });\r\n }\r\n\r\n // create node url from current url\r\n if (!relativeUrl.startsWith('/')) {\r\n relativeUrl = `/${relativeUrl}`;\r\n }\r\n\r\n relativeUrl = Net.updateApiVersion20190201(relativeUrl);\r\n return `/nodes/${nodeName}${relativeUrl}`;\r\n }\r\n}\r\n"]}
@@ -218,8 +218,6 @@ export class NodeConnection {
218
218
  action: 'TranslateUrlToGateWayV2'
219
219
  }
220
220
  }, { type: 'error' });
221
- throw new Error(MsftSme.getStrings().MsftSmeShell.Core.TranslateGatewayUrls.Url.Not.expected.ErrorMessage
222
- .format(relativeUrl));
223
221
  }
224
222
  // create node url from current url
225
223
  if (!relativeUrl.startsWith('/')) {