@vcd/sdk 15.0.5 → 15.0.7

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.
@@ -329,37 +329,37 @@ class ApiResult {
329
329
  if (!window.System || !window.System.registry || !window.System.registry.get) {
330
330
  throw new Error('SystemJS registry not found');
331
331
  }
332
- let containerHooks$1 = window.System.registry.get('@vcd/common');
333
- if (!containerHooks$1) {
334
- containerHooks$1 = window.System.registry.get('@vcd-ui/common');
332
+ let containerHooks = window.System.registry.get('@vcd/common');
333
+ if (!containerHooks) {
334
+ containerHooks = window.System.registry.get('@vcd-ui/common');
335
335
  }
336
- if (!containerHooks$1) {
336
+ if (!containerHooks) {
337
337
  throw new Error('VCD UI container hooks not present in SystemJS registry');
338
338
  }
339
339
  /**
340
340
  * Wire in as a string. Gives the root URL for API access (for example, the load balancer URL
341
341
  * or the single-cell URL).
342
342
  */
343
- const API_ROOT_URL$1 = containerHooks$1.API_ROOT_URL;
343
+ const API_ROOT_URL = containerHooks.API_ROOT_URL;
344
344
  /**
345
345
  * Wire in as a string. Gives the root URL for the legacy Flex application.
346
346
  */
347
- const FLEX_APP_URL$1 = containerHooks$1.API_ROOT_URL;
347
+ const FLEX_APP_URL = containerHooks.API_ROOT_URL;
348
348
  /**
349
349
  * Wire in as a string. Gives the current scope of the VCD-UI. As of current, this will be
350
350
  * either 'tenant' for the tenant portal, or 'service-provider' for the service-provider portal.
351
351
  */
352
- const SESSION_SCOPE$1 = containerHooks$1.SESSION_SCOPE;
352
+ const SESSION_SCOPE = containerHooks.SESSION_SCOPE;
353
353
  /**
354
354
  * Wire in as a string. Gives the unique name (not the display name) of the current tenant
355
355
  * organization that the VCD-UI is being used for.
356
356
  */
357
- const SESSION_ORGANIZATION$1 = containerHooks$1.SESSION_ORGANIZATION;
357
+ const SESSION_ORGANIZATION = containerHooks.SESSION_ORGANIZATION;
358
358
  /**
359
359
  * Wire in as a string. Gives the UUID identifier of the current tenant
360
360
  * organization that the VCD-UI is being used for.
361
361
  */
362
- const SESSION_ORG_ID$1 = containerHooks$1.SESSION_ORG_ID ? containerHooks$1.SESSION_ORG_ID : '';
362
+ const SESSION_ORG_ID = containerHooks.SESSION_ORG_ID ? containerHooks.SESSION_ORG_ID : '';
363
363
  /**
364
364
  * Wire in as a string. Gives the full root path for module assets (e.g. images, scripts, text files)
365
365
  *
@@ -367,33 +367,33 @@ const SESSION_ORG_ID$1 = containerHooks$1.SESSION_ORG_ID ? containerHooks$1.SESS
367
367
  * Add || new InjectionToken to workaround the Angular security mechanics which prevent use of injection tokens
368
368
  * which potentially are not defiend. The same fix can be applied for the rest tokens if needed.
369
369
  */
370
- const EXTENSION_ASSET_URL$1 = containerHooks$1.EXTENSION_ASSET_URL || new InjectionToken('EXTENSION_ASSET_URL');
370
+ const EXTENSION_ASSET_URL = containerHooks.EXTENSION_ASSET_URL || new InjectionToken('EXTENSION_ASSET_URL');
371
371
  /**
372
372
  * Wire in as a string. Gives the Angular 2 route that the module is registered under.
373
373
  */
374
- const EXTENSION_ROUTE$1 = containerHooks$1.EXTENSION_ROUTE;
374
+ const EXTENSION_ROUTE = containerHooks.EXTENSION_ROUTE;
375
375
  /**
376
376
  * Wire in as a boolean. True if running under the SDK, false if running in production.
377
377
  */
378
- const SDK_MODE$1 = containerHooks$1.SDK_MODE;
379
- const ExtensionNavRegistrationAction = containerHooks$1.ExtensionNavRegistrationAction;
380
- const AuthTokenHolderService$1 = containerHooks$1.AuthTokenHolderService;
378
+ const SDK_MODE = containerHooks.SDK_MODE;
379
+ const ExtensionNavRegistrationAction = containerHooks.ExtensionNavRegistrationAction;
380
+ const AuthTokenHolderService = containerHooks.AuthTokenHolderService;
381
381
  /**
382
382
  * Every component referenced by an entity action extension point must inherit from this.
383
383
  */
384
384
  // tslint:disable-next-line:class-name
385
385
  class _EntityActionExtensionComponent {
386
386
  }
387
- const EntityActionExtensionComponent = containerHooks$1.EntityActionExtensionComponent;
387
+ const EntityActionExtensionComponent = containerHooks.EntityActionExtensionComponent;
388
388
  // tslint:disable-next-line:class-name
389
389
  class _WizardExtensionComponent {
390
390
  }
391
- const WizardExtensionComponent = containerHooks$1.WizardExtensionComponent;
391
+ const WizardExtensionComponent = containerHooks.WizardExtensionComponent;
392
392
  // tslint:disable-next-line:class-name
393
393
  class _WizardExtensionWithValidationComponent extends _WizardExtensionComponent {
394
394
  }
395
395
  // tslint:disable-next-line:max-line-length
396
- const WizardExtensionWithValidationComponent = containerHooks$1.WizardExtensionWithValidationComponent;
396
+ const WizardExtensionWithValidationComponent = containerHooks.WizardExtensionWithValidationComponent;
397
397
  /**
398
398
  * Every component-based Extension Point that is renderd in Cloud Director UI Entity Details
399
399
  * must extend that class to obtain context about the Entity.
@@ -404,7 +404,7 @@ const WizardExtensionWithValidationComponent = containerHooks$1.WizardExtensionW
404
404
  class _WizardExtensionWithContextComponent extends _WizardExtensionComponent {
405
405
  }
406
406
  // tslint:disable-next-line:max-line-length
407
- const WizardExtensionWithContextComponent = containerHooks$1.WizardExtensionWithContextComponent;
407
+ const WizardExtensionWithContextComponent = containerHooks.WizardExtensionWithContextComponent;
408
408
 
409
409
  class PluginModule {
410
410
  constructor(appStore) {
@@ -491,6 +491,9 @@ class RequestHeadersInterceptor {
491
491
  set actAs(_actAs) {
492
492
  this._actAs = _actAs;
493
493
  }
494
+ set actAsOrgName(_actAsOrgName) {
495
+ this._actAsOrgName = _actAsOrgName;
496
+ }
494
497
  get version() {
495
498
  return this._version;
496
499
  }
@@ -519,6 +522,12 @@ class RequestHeadersInterceptor {
519
522
  if (!headers.has('X-VMWARE-VCLOUD-TENANT-CONTEXT') && this._actAs) {
520
523
  headers = headers.set('X-VMWARE-VCLOUD-TENANT-CONTEXT', this._actAs);
521
524
  }
525
+ /**
526
+ * Covers the case where the User set the ActAs token himself
527
+ */
528
+ if (!headers.has('X-VMWARE-VCLOUD-AUTH-CONTEXT') && this._actAsOrgName) {
529
+ headers = headers.set('X-VMWARE-VCLOUD-AUTH-CONTEXT', this._actAsOrgName);
530
+ }
522
531
  const customReq = req.clone({
523
532
  headers
524
533
  });
@@ -671,62 +680,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
671
680
  args: [VCD_HTTP_INTERCEPTORS]
672
681
  }] }]; } });
673
682
 
674
- /**
675
- * This is the currently supported - albeit very minimal - public SDK.
676
- */
677
- // Bind straight into the hooks provided by the container.
678
- if (!window.System || !window.System.registry || !window.System.registry.get) {
679
- throw new Error('SystemJS registry not found');
680
- }
681
- let containerHooks = window.System.registry.get('@vcd/common');
682
- if (!containerHooks) {
683
- containerHooks = window.System.registry.get('@vcd-ui/common');
684
- }
685
- if (!containerHooks) {
686
- throw new Error('VCD UI container hooks not present in SystemJS registry');
687
- }
688
- /**
689
- * Wire in as a string. Gives the root URL for API access (for example, the load balancer URL
690
- * or the single-cell URL).
691
- */
692
- const API_ROOT_URL = containerHooks.API_ROOT_URL;
693
- /**
694
- * Wire in as a string. Gives the root URL for the legacy Flex application.
695
- */
696
- const FLEX_APP_URL = containerHooks.API_ROOT_URL;
697
- /**
698
- * Wire in as a string. Gives the current scope of the VCD-UI. As of current, this will be
699
- * either 'tenant' for the tenant portal, or 'service-provider' for the service-provider portal.
700
- */
701
- const SESSION_SCOPE = containerHooks.SESSION_SCOPE;
702
- /**
703
- * Wire in as a string. Gives the unique name (not the display name) of the current tenant
704
- * organization that the VCD-UI is being used for.
705
- */
706
- const SESSION_ORGANIZATION = containerHooks.SESSION_ORGANIZATION;
707
- /**
708
- * Wire in as a string. Gives the UUID identifier of the current tenant
709
- * organization that the VCD-UI is being used for.
710
- */
711
- const SESSION_ORG_ID = containerHooks.SESSION_ORG_ID ? containerHooks.SESSION_ORG_ID : '';
712
- /**
713
- * Wire in as a string. Gives the full root path for module assets (e.g. images, scripts, text files)
714
- *
715
- * ATTENTION!
716
- * Add || new InjectionToken to workaround the Angular security mechanics which prevent use of injection tokens
717
- * which potentially are not defiend. The same fix can be applied for the rest tokens if needed.
718
- */
719
- const EXTENSION_ASSET_URL = containerHooks.EXTENSION_ASSET_URL || new InjectionToken('EXTENSION_ASSET_URL');
720
- /**
721
- * Wire in as a string. Gives the Angular 2 route that the module is registered under.
722
- */
723
- const EXTENSION_ROUTE = containerHooks.EXTENSION_ROUTE;
724
- /**
725
- * Wire in as a boolean. True if running under the SDK, false if running in production.
726
- */
727
- const SDK_MODE = containerHooks.SDK_MODE;
728
- const AuthTokenHolderService = containerHooks.AuthTokenHolderService;
729
-
730
683
  /**
731
684
  * Default chunk size is 50MiB. This is equal to the chunk size the VCD UI uses for library uploads.
732
685
  */
@@ -1091,6 +1044,7 @@ class VcdApiClient {
1091
1044
  */
1092
1045
  actAs(actAs = null) {
1093
1046
  this.http.requestHeadersInterceptor.actAs = !actAs ? null : actAs.id;
1047
+ this.http.requestHeadersInterceptor.actAsOrgName = !actAs ? null : actAs.name;
1094
1048
  return this;
1095
1049
  }
1096
1050
  /**
@@ -1540,5 +1494,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
1540
1494
  * Generated bundle index. Do not edit.
1541
1495
  */
1542
1496
 
1543
- export { API_ROOT_URL$1 as API_ROOT_URL, ApiResult, ApiResultService, AuthTokenHolderService$1 as AuthTokenHolderService, ClientError, ClientErrorType, EXTENSION_ASSET_URL$1 as EXTENSION_ASSET_URL, EXTENSION_ROUTE$1 as EXTENSION_ROUTE, EntityActionExtensionComponent, ExtensionNavRegistrationAction, FLEX_APP_URL$1 as FLEX_APP_URL, Filter, HATEOAS_HEADER, LinkRelType, LoggingInterceptor, MAX_CHUNK_RETRY_COUNT, MAX_CHUNK_SIZE, PluginModule, Query, RequestHeadersInterceptor, ResponseNormalizationInterceptor, SDK_MODE$1 as SDK_MODE, SESSION_ORGANIZATION$1 as SESSION_ORGANIZATION, SESSION_ORG_ID$1 as SESSION_ORG_ID, SESSION_SCOPE$1 as SESSION_SCOPE, TRANSFER_LINK_REL, TransferError, VCD_HTTP_INTERCEPTORS, VcdApiClient, VcdHttpClient, VcdSdkConfig, VcdSdkModule, VcdTransferClient, WizardExtensionComponent, WizardExtensionWithContextComponent, WizardExtensionWithValidationComponent, _EntityActionExtensionComponent, _WizardExtensionComponent, _WizardExtensionWithContextComponent, _WizardExtensionWithValidationComponent, parseHeaderHateoasLinks };
1497
+ export { API_ROOT_URL, ApiResult, ApiResultService, AuthTokenHolderService, ClientError, ClientErrorType, EXTENSION_ASSET_URL, EXTENSION_ROUTE, EntityActionExtensionComponent, ExtensionNavRegistrationAction, FLEX_APP_URL, Filter, HATEOAS_HEADER, LinkRelType, LoggingInterceptor, MAX_CHUNK_RETRY_COUNT, MAX_CHUNK_SIZE, PluginModule, Query, RequestHeadersInterceptor, ResponseNormalizationInterceptor, SDK_MODE, SESSION_ORGANIZATION, SESSION_ORG_ID, SESSION_SCOPE, TRANSFER_LINK_REL, TransferError, VCD_HTTP_INTERCEPTORS, VcdApiClient, VcdHttpClient, VcdSdkConfig, VcdSdkModule, VcdTransferClient, WizardExtensionComponent, WizardExtensionWithContextComponent, WizardExtensionWithValidationComponent, _EntityActionExtensionComponent, _WizardExtensionComponent, _WizardExtensionWithContextComponent, _WizardExtensionWithValidationComponent, parseHeaderHateoasLinks };
1544
1498
  //# sourceMappingURL=vcd-sdk.mjs.map