@vcd/sdk 15.0.4 → 15.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/client/index.d.ts +1 -0
- package/client/client/types.d.ts +9 -0
- package/client/client/vcd.api.client.d.ts +1 -1
- package/client/client/vcd.http.client.d.ts +6 -4
- package/core/plugin.module.d.ts +6 -0
- package/esm2020/client/client/index.mjs +2 -1
- package/esm2020/client/client/types.mjs +13 -0
- package/esm2020/client/client/vcd.api.client.mjs +12 -12
- package/esm2020/client/client/vcd.http.client.mjs +16 -7
- package/esm2020/core/plugin.module.mjs +6 -1
- package/esm2020/main.mjs +2 -2
- package/fesm2015/vcd-sdk.mjs +158 -131
- package/fesm2015/vcd-sdk.mjs.map +1 -1
- package/fesm2020/vcd-sdk.mjs +156 -131
- package/fesm2020/vcd-sdk.mjs.map +1 -1
- package/main.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
2
|
+
import { Inject, Injectable, Optional } from '@angular/core';
|
|
3
|
+
import { VCD_HTTP_INTERCEPTORS } from "../../core";
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
import * as i1 from "@angular/common/http";
|
|
5
6
|
import * as i2 from "./logging.interceptor";
|
|
@@ -28,25 +29,33 @@ export class VcdHttpClient extends HttpClient {
|
|
|
28
29
|
/**
|
|
29
30
|
* Create an HttpClient with the logging and header interceptors in the chain.
|
|
30
31
|
* @param httpBackend backend (likely injected from HttpClientModule)
|
|
31
|
-
* @param hateoasHeaderInterceptor the hateoas header interceptor
|
|
32
32
|
* @param loggingInterceptor the logging interceptor
|
|
33
33
|
* @param requestHeadersInterceptor the request header interceptor
|
|
34
|
+
* @param responseNormalizationInterceptor
|
|
35
|
+
* @param customInterceptors
|
|
34
36
|
*/
|
|
35
|
-
constructor(httpBackend, loggingInterceptor, requestHeadersInterceptor, responseNormalizationInterceptor) {
|
|
37
|
+
constructor(httpBackend, loggingInterceptor, requestHeadersInterceptor, responseNormalizationInterceptor, customInterceptors) {
|
|
36
38
|
const interceptors = [
|
|
37
39
|
loggingInterceptor,
|
|
38
40
|
requestHeadersInterceptor,
|
|
39
|
-
responseNormalizationInterceptor
|
|
41
|
+
responseNormalizationInterceptor,
|
|
42
|
+
...(customInterceptors ?? []),
|
|
40
43
|
];
|
|
41
44
|
const chain = interceptors.reduceRight((next, interceptor) => new VcdHttpInterceptorHandler(next, interceptor), httpBackend);
|
|
42
45
|
super(chain);
|
|
46
|
+
this.customInterceptors = customInterceptors;
|
|
43
47
|
this.loggingInterceptor = loggingInterceptor;
|
|
44
48
|
this.requestHeadersInterceptor = requestHeadersInterceptor;
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
|
-
VcdHttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient, deps: [{ token: i1.HttpBackend }, { token: i2.LoggingInterceptor }, { token: i3.RequestHeadersInterceptor }, { token: i4.ResponseNormalizationInterceptor }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
51
|
+
VcdHttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient, deps: [{ token: i1.HttpBackend }, { token: i2.LoggingInterceptor }, { token: i3.RequestHeadersInterceptor }, { token: i4.ResponseNormalizationInterceptor }, { token: VCD_HTTP_INTERCEPTORS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
48
52
|
VcdHttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient });
|
|
49
53
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient, decorators: [{
|
|
50
54
|
type: Injectable
|
|
51
|
-
}], ctorParameters: function () { return [{ type: i1.HttpBackend }, { type: i2.LoggingInterceptor }, { type: i3.RequestHeadersInterceptor }, { type: i4.ResponseNormalizationInterceptor }
|
|
52
|
-
|
|
55
|
+
}], ctorParameters: function () { return [{ type: i1.HttpBackend }, { type: i2.LoggingInterceptor }, { type: i3.RequestHeadersInterceptor }, { type: i4.ResponseNormalizationInterceptor }, { type: undefined, decorators: [{
|
|
56
|
+
type: Optional
|
|
57
|
+
}, {
|
|
58
|
+
type: Inject,
|
|
59
|
+
args: [VCD_HTTP_INTERCEPTORS]
|
|
60
|
+
}] }]; } });
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmNkLmh0dHAuY2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmNkL3Nkay9zcmMvY2xpZW50L2NsaWVudC92Y2QuaHR0cC5jbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFjLFVBQVUsRUFBdUQsTUFBTSxzQkFBc0IsQ0FBQztBQUNuSCxPQUFPLEVBQUMsTUFBTSxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFLM0QsT0FBTyxFQUFDLHFCQUFxQixFQUFDLE1BQU0sWUFBWSxDQUFDOzs7Ozs7QUFFakQ7O0dBRUc7QUFDSCxNQUFNLHlCQUF5QjtJQUMzQixZQUFvQixJQUFpQixFQUFVLFdBQTRCO1FBQXZELFNBQUksR0FBSixJQUFJLENBQWE7UUFBVSxnQkFBVyxHQUFYLFdBQVcsQ0FBaUI7SUFBRyxDQUFDO0lBRS9FLE1BQU0sQ0FBQyxHQUFxQjtRQUN4QixPQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsU0FBUyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7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bnRlcmNlcHRvcnMgPz8gW10pLFxuICAgICAgICBdO1xuICAgICAgICBjb25zdCBjaGFpbiA9IGludGVyY2VwdG9ycy5yZWR1Y2VSaWdodChcbiAgICAgICAgICAgIChuZXh0LCBpbnRlcmNlcHRvcikgPT4gbmV3IFZjZEh0dHBJbnRlcmNlcHRvckhhbmRsZXIobmV4dCwgaW50ZXJjZXB0b3IpLFxuICAgICAgICAgICAgaHR0cEJhY2tlbmRcbiAgICAgICAgKTtcbiAgICAgICAgc3VwZXIoY2hhaW4pO1xuICAgICAgICB0aGlzLmxvZ2dpbmdJbnRlcmNlcHRvciA9IGxvZ2dpbmdJbnRlcmNlcHRvcjtcbiAgICAgICAgdGhpcy5yZXF1ZXN0SGVhZGVyc0ludGVyY2VwdG9yID0gcmVxdWVzdEhlYWRlcnNJbnRlcmNlcHRvcjtcbiAgICB9XG59XG4iXX0=
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExtensionNavRegistrationAction } from '../common';
|
|
2
|
+
import { InjectionToken } from "@angular/core";
|
|
2
3
|
export class PluginModule {
|
|
3
4
|
constructor(appStore) {
|
|
4
5
|
this.appStore = appStore;
|
|
@@ -15,4 +16,8 @@ export class PluginModule {
|
|
|
15
16
|
*/
|
|
16
17
|
export class VcdSdkConfig {
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Use this token for injecting custom HttpInterceptor implementations inside the HttpClient
|
|
21
|
+
*/
|
|
22
|
+
export const VCD_HTTP_INTERCEPTORS = new InjectionToken("VCD_HTTP_INTERCEPTORS");
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2luLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3ZjZC9zZGsvc3JjL2NvcmUvcGx1Z2luLm1vZHVsZS50cyJdLCJuYW1lcyI6W10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HRlbnNpb25OYXZSZWdpc3RyYXRpb24pOiB2b2lkIHtcbiAgICAgICAgdGhpcy5hcHBTdG9yZS5kaXNwYXRjaChuZXcgRXh0ZW5zaW9uTmF2UmVnaXN0cmF0aW9uQWN0aW9uKGV4dGVuc2lvbikpO1xuICAgIH1cbn1cblxuLyoqXG4gKiBDb25maWcgb2JqZWN0IHRoYXQgaXMgcGFzc2VkIG9uIFZjZFNka01vZHVsZSBpbml0XG4gKiB1c2luZyAuZm9yUm9vdCgpIG1ldGhvZC4gSXQgY2FuIGJlIHVzZWQgdG8gc3RvcmVcbiAqIGNvbmZpZ3V0cmF0aW9uIHByb3BlcnRpZXMgdGhhdCBhcmUgbGF0ZXIgdXNlZCBieSB0aGUgU2VydmljZXNcbiAqIHByb3ZpZGVkLlxuICovXG5leHBvcnQgY2xhc3MgVmNkU2RrQ29uZmlnIHtcbiAgICBhcGlWZXJzaW9uOiBzdHJpbmc7XG59XG5cbi8qKlxuICogVXNlIHRoaXMgdG9rZW4gZm9yIGluamVjdGluZyBjdXN0b20gSHR0cEludGVyY2VwdG9yIGltcGxlbWVudGF0aW9ucyBpbnNpZGUgdGhlIEh0dHBDbGllbnRcbiAqL1xuZXhwb3J0IGNvbnN0IFZDRF9IVFRQX0lOVEVSQ0VQVE9SUyA9IG5ldyBJbmplY3Rpb25Ub2tlbjxIdHRwSW50ZXJjZXB0b3JbXT4oXCJWQ0RfSFRUUF9JTlRFUkNFUFRPUlNcIilcbiJdfQ==
|
package/esm2020/main.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { HttpClientModule } from '@angular/common/http';
|
|
|
2
2
|
import { NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import * as client from './client';
|
|
5
|
-
import { VcdSdkConfig } from "./core
|
|
5
|
+
import { VcdSdkConfig } from "./core";
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Extensions should import this module.
|
|
@@ -42,4 +42,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
42
42
|
exports: [],
|
|
43
43
|
}]
|
|
44
44
|
}] });
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3ZjZC9zZGsvc3JjL21haW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDeEQsT0FBTyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDOUQsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sS0FBSyxNQUFNLE1BQU0sVUFBVSxDQUFDO0FBQ25DLE9BQU8sRUFBQyxZQUFZLEVBQUMsTUFBTSxRQUFRLENBQUM7O0FBQ3BDOzs7R0FHRztBQVNILE1BQU0sT0FBTyxZQUFZO0lBQ3ZCLE1BQU0sQ0FBQyxPQUFPLENBQUMsTUFBcUI7UUFDbEMsT0FBTztZQUNMLFFBQVEsRUFBRSxZQUFZO1lBQ3RCLFNBQVMsRUFBRTtnQkFDVCxNQUFNLENBQUMseUJBQXlCO2dCQUNoQyxNQUFNLENBQUMsa0JBQWtCO2dCQUN6QixNQUFNLENBQUMsZ0NBQWdDO2dCQUN2QyxNQUFNLENBQUMsYUFBYTtnQkFDcEIsTUFBTSxDQUFDLFlBQVk7Z0JBQ25CO29CQUNFLE9BQU8sRUFBRSxZQUFZO29CQUNyQixRQUFRLEVBQUUsTUFBTSxJQUFJLEVBQUU7aUJBQ3ZCO2FBQ0Y7U0FDRixDQUFDO0lBQ0osQ0FBQzs7eUdBaEJVLFl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mV0dXJuIHtcbiAgICAgIG5nTW9kdWxlOiBWY2RTZGtNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgY2xpZW50LlJlcXVlc3RIZWFkZXJzSW50ZXJjZXB0b3IsXG4gICAgICAgIGNsaWVudC5Mb2dnaW5nSW50ZXJjZXB0b3IsXG4gICAgICAgIGNsaWVudC5SZXNwb25zZU5vcm1hbGl6YXRpb25JbnRlcmNlcHRvcixcbiAgICAgICAgY2xpZW50LlZjZEh0dHBDbGllbnQsXG4gICAgICAgIGNsaWVudC5WY2RBcGlDbGllbnQsXG4gICAgICAgIHtcbiAgICAgICAgICBwcm92aWRlOiBWY2RTZGtDb25maWcsXG4gICAgICAgICAgdXNlVmFsdWU6IGNvbmZpZyB8fCB7fVxuICAgICAgICB9LFxuICAgICAgXVxuICAgIH07XG4gIH1cbn1cbiJdfQ==
|
package/fesm2015/vcd-sdk.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common/http';
|
|
2
2
|
import { HttpResponse, HttpClient, HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Optional,
|
|
4
|
+
import { Injectable, InjectionToken, Optional, Inject, NgModule } from '@angular/core';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
6
|
import { tap, finalize, map, catchError, switchMap, retry, flatMap, skipWhile, share, concatMap, filter, withLatestFrom } from 'rxjs/operators';
|
|
7
7
|
import { Observable, throwError, BehaviorSubject, of, ReplaySubject, merge } from 'rxjs';
|
|
@@ -322,6 +322,111 @@ class ApiResult {
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
+
/**
|
|
326
|
+
* This is the currently supported - albeit very minimal - public SDK.
|
|
327
|
+
*/
|
|
328
|
+
// Bind straight into the hooks provided by the container.
|
|
329
|
+
if (!window.System || !window.System.registry || !window.System.registry.get) {
|
|
330
|
+
throw new Error('SystemJS registry not found');
|
|
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');
|
|
335
|
+
}
|
|
336
|
+
if (!containerHooks$1) {
|
|
337
|
+
throw new Error('VCD UI container hooks not present in SystemJS registry');
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Wire in as a string. Gives the root URL for API access (for example, the load balancer URL
|
|
341
|
+
* or the single-cell URL).
|
|
342
|
+
*/
|
|
343
|
+
const API_ROOT_URL$1 = containerHooks$1.API_ROOT_URL;
|
|
344
|
+
/**
|
|
345
|
+
* Wire in as a string. Gives the root URL for the legacy Flex application.
|
|
346
|
+
*/
|
|
347
|
+
const FLEX_APP_URL$1 = containerHooks$1.API_ROOT_URL;
|
|
348
|
+
/**
|
|
349
|
+
* Wire in as a string. Gives the current scope of the VCD-UI. As of current, this will be
|
|
350
|
+
* either 'tenant' for the tenant portal, or 'service-provider' for the service-provider portal.
|
|
351
|
+
*/
|
|
352
|
+
const SESSION_SCOPE$1 = containerHooks$1.SESSION_SCOPE;
|
|
353
|
+
/**
|
|
354
|
+
* Wire in as a string. Gives the unique name (not the display name) of the current tenant
|
|
355
|
+
* organization that the VCD-UI is being used for.
|
|
356
|
+
*/
|
|
357
|
+
const SESSION_ORGANIZATION$1 = containerHooks$1.SESSION_ORGANIZATION;
|
|
358
|
+
/**
|
|
359
|
+
* Wire in as a string. Gives the UUID identifier of the current tenant
|
|
360
|
+
* organization that the VCD-UI is being used for.
|
|
361
|
+
*/
|
|
362
|
+
const SESSION_ORG_ID$1 = containerHooks$1.SESSION_ORG_ID ? containerHooks$1.SESSION_ORG_ID : '';
|
|
363
|
+
/**
|
|
364
|
+
* Wire in as a string. Gives the full root path for module assets (e.g. images, scripts, text files)
|
|
365
|
+
*
|
|
366
|
+
* ATTENTION!
|
|
367
|
+
* Add || new InjectionToken to workaround the Angular security mechanics which prevent use of injection tokens
|
|
368
|
+
* which potentially are not defiend. The same fix can be applied for the rest tokens if needed.
|
|
369
|
+
*/
|
|
370
|
+
const EXTENSION_ASSET_URL$1 = containerHooks$1.EXTENSION_ASSET_URL || new InjectionToken('EXTENSION_ASSET_URL');
|
|
371
|
+
/**
|
|
372
|
+
* Wire in as a string. Gives the Angular 2 route that the module is registered under.
|
|
373
|
+
*/
|
|
374
|
+
const EXTENSION_ROUTE$1 = containerHooks$1.EXTENSION_ROUTE;
|
|
375
|
+
/**
|
|
376
|
+
* Wire in as a boolean. True if running under the SDK, false if running in production.
|
|
377
|
+
*/
|
|
378
|
+
const SDK_MODE$1 = containerHooks$1.SDK_MODE;
|
|
379
|
+
const ExtensionNavRegistrationAction = containerHooks$1.ExtensionNavRegistrationAction;
|
|
380
|
+
const AuthTokenHolderService$1 = containerHooks$1.AuthTokenHolderService;
|
|
381
|
+
/**
|
|
382
|
+
* Every component referenced by an entity action extension point must inherit from this.
|
|
383
|
+
*/
|
|
384
|
+
// tslint:disable-next-line:class-name
|
|
385
|
+
class _EntityActionExtensionComponent {
|
|
386
|
+
}
|
|
387
|
+
const EntityActionExtensionComponent = containerHooks$1.EntityActionExtensionComponent;
|
|
388
|
+
// tslint:disable-next-line:class-name
|
|
389
|
+
class _WizardExtensionComponent {
|
|
390
|
+
}
|
|
391
|
+
const WizardExtensionComponent = containerHooks$1.WizardExtensionComponent;
|
|
392
|
+
// tslint:disable-next-line:class-name
|
|
393
|
+
class _WizardExtensionWithValidationComponent extends _WizardExtensionComponent {
|
|
394
|
+
}
|
|
395
|
+
// tslint:disable-next-line:max-line-length
|
|
396
|
+
const WizardExtensionWithValidationComponent = containerHooks$1.WizardExtensionWithValidationComponent;
|
|
397
|
+
/**
|
|
398
|
+
* Every component-based Extension Point that is renderd in Cloud Director UI Entity Details
|
|
399
|
+
* must extend that class to obtain context about the Entity.
|
|
400
|
+
*
|
|
401
|
+
* See comments of the methods of the abstract class for more information.
|
|
402
|
+
*/
|
|
403
|
+
// tslint:disable-next-line:class-name
|
|
404
|
+
class _WizardExtensionWithContextComponent extends _WizardExtensionComponent {
|
|
405
|
+
}
|
|
406
|
+
// tslint:disable-next-line:max-line-length
|
|
407
|
+
const WizardExtensionWithContextComponent = containerHooks$1.WizardExtensionWithContextComponent;
|
|
408
|
+
|
|
409
|
+
class PluginModule {
|
|
410
|
+
constructor(appStore) {
|
|
411
|
+
this.appStore = appStore;
|
|
412
|
+
}
|
|
413
|
+
registerExtension(extension) {
|
|
414
|
+
this.appStore.dispatch(new ExtensionNavRegistrationAction(extension));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Config object that is passed on VcdSdkModule init
|
|
419
|
+
* using .forRoot() method. It can be used to store
|
|
420
|
+
* configutration properties that are later used by the Services
|
|
421
|
+
* provided.
|
|
422
|
+
*/
|
|
423
|
+
class VcdSdkConfig {
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Use this token for injecting custom HttpInterceptor implementations inside the HttpClient
|
|
427
|
+
*/
|
|
428
|
+
const VCD_HTTP_INTERCEPTORS = new InjectionToken("VCD_HTTP_INTERCEPTORS");
|
|
429
|
+
|
|
325
430
|
// tslint:disable:variable-name
|
|
326
431
|
class LoggingInterceptor {
|
|
327
432
|
set enabled(enabled) {
|
|
@@ -538,27 +643,37 @@ class VcdHttpClient extends HttpClient {
|
|
|
538
643
|
/**
|
|
539
644
|
* Create an HttpClient with the logging and header interceptors in the chain.
|
|
540
645
|
* @param httpBackend backend (likely injected from HttpClientModule)
|
|
541
|
-
* @param hateoasHeaderInterceptor the hateoas header interceptor
|
|
542
646
|
* @param loggingInterceptor the logging interceptor
|
|
543
647
|
* @param requestHeadersInterceptor the request header interceptor
|
|
648
|
+
* @param responseNormalizationInterceptor
|
|
649
|
+
* @param customInterceptors
|
|
544
650
|
*/
|
|
545
|
-
constructor(httpBackend, loggingInterceptor, requestHeadersInterceptor, responseNormalizationInterceptor) {
|
|
651
|
+
constructor(httpBackend, loggingInterceptor, requestHeadersInterceptor, responseNormalizationInterceptor, customInterceptors) {
|
|
546
652
|
const interceptors = [
|
|
547
653
|
loggingInterceptor,
|
|
548
654
|
requestHeadersInterceptor,
|
|
549
|
-
responseNormalizationInterceptor
|
|
655
|
+
responseNormalizationInterceptor,
|
|
656
|
+
...(customInterceptors !== null && customInterceptors !== void 0 ? customInterceptors : []),
|
|
550
657
|
];
|
|
551
658
|
const chain = interceptors.reduceRight((next, interceptor) => new VcdHttpInterceptorHandler(next, interceptor), httpBackend);
|
|
552
659
|
super(chain);
|
|
660
|
+
this.customInterceptors = customInterceptors;
|
|
553
661
|
this.loggingInterceptor = loggingInterceptor;
|
|
554
662
|
this.requestHeadersInterceptor = requestHeadersInterceptor;
|
|
555
663
|
}
|
|
556
664
|
}
|
|
557
|
-
VcdHttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient, deps: [{ token: i1.HttpBackend }, { token: LoggingInterceptor }, { token: RequestHeadersInterceptor }, { token: ResponseNormalizationInterceptor }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
665
|
+
VcdHttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient, deps: [{ token: i1.HttpBackend }, { token: LoggingInterceptor }, { token: RequestHeadersInterceptor }, { token: ResponseNormalizationInterceptor }, { token: VCD_HTTP_INTERCEPTORS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
558
666
|
VcdHttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient });
|
|
559
667
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: VcdHttpClient, decorators: [{
|
|
560
668
|
type: Injectable
|
|
561
|
-
}], ctorParameters: function () {
|
|
669
|
+
}], ctorParameters: function () {
|
|
670
|
+
return [{ type: i1.HttpBackend }, { type: LoggingInterceptor }, { type: RequestHeadersInterceptor }, { type: ResponseNormalizationInterceptor }, { type: undefined, decorators: [{
|
|
671
|
+
type: Optional
|
|
672
|
+
}, {
|
|
673
|
+
type: Inject,
|
|
674
|
+
args: [VCD_HTTP_INTERCEPTORS]
|
|
675
|
+
}] }];
|
|
676
|
+
} });
|
|
562
677
|
|
|
563
678
|
/**
|
|
564
679
|
* This is the currently supported - albeit very minimal - public SDK.
|
|
@@ -567,37 +682,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
567
682
|
if (!window.System || !window.System.registry || !window.System.registry.get) {
|
|
568
683
|
throw new Error('SystemJS registry not found');
|
|
569
684
|
}
|
|
570
|
-
let containerHooks
|
|
571
|
-
if (!containerHooks
|
|
572
|
-
containerHooks
|
|
685
|
+
let containerHooks = window.System.registry.get('@vcd/common');
|
|
686
|
+
if (!containerHooks) {
|
|
687
|
+
containerHooks = window.System.registry.get('@vcd-ui/common');
|
|
573
688
|
}
|
|
574
|
-
if (!containerHooks
|
|
689
|
+
if (!containerHooks) {
|
|
575
690
|
throw new Error('VCD UI container hooks not present in SystemJS registry');
|
|
576
691
|
}
|
|
577
692
|
/**
|
|
578
693
|
* Wire in as a string. Gives the root URL for API access (for example, the load balancer URL
|
|
579
694
|
* or the single-cell URL).
|
|
580
695
|
*/
|
|
581
|
-
const API_ROOT_URL
|
|
696
|
+
const API_ROOT_URL = containerHooks.API_ROOT_URL;
|
|
582
697
|
/**
|
|
583
698
|
* Wire in as a string. Gives the root URL for the legacy Flex application.
|
|
584
699
|
*/
|
|
585
|
-
const FLEX_APP_URL
|
|
700
|
+
const FLEX_APP_URL = containerHooks.API_ROOT_URL;
|
|
586
701
|
/**
|
|
587
702
|
* Wire in as a string. Gives the current scope of the VCD-UI. As of current, this will be
|
|
588
703
|
* either 'tenant' for the tenant portal, or 'service-provider' for the service-provider portal.
|
|
589
704
|
*/
|
|
590
|
-
const SESSION_SCOPE
|
|
705
|
+
const SESSION_SCOPE = containerHooks.SESSION_SCOPE;
|
|
591
706
|
/**
|
|
592
707
|
* Wire in as a string. Gives the unique name (not the display name) of the current tenant
|
|
593
708
|
* organization that the VCD-UI is being used for.
|
|
594
709
|
*/
|
|
595
|
-
const SESSION_ORGANIZATION
|
|
710
|
+
const SESSION_ORGANIZATION = containerHooks.SESSION_ORGANIZATION;
|
|
596
711
|
/**
|
|
597
712
|
* Wire in as a string. Gives the UUID identifier of the current tenant
|
|
598
713
|
* organization that the VCD-UI is being used for.
|
|
599
714
|
*/
|
|
600
|
-
const SESSION_ORG_ID
|
|
715
|
+
const SESSION_ORG_ID = containerHooks.SESSION_ORG_ID ? containerHooks.SESSION_ORG_ID : '';
|
|
601
716
|
/**
|
|
602
717
|
* Wire in as a string. Gives the full root path for module assets (e.g. images, scripts, text files)
|
|
603
718
|
*
|
|
@@ -605,16 +720,16 @@ const SESSION_ORG_ID$1 = containerHooks$1.SESSION_ORG_ID ? containerHooks$1.SESS
|
|
|
605
720
|
* Add || new InjectionToken to workaround the Angular security mechanics which prevent use of injection tokens
|
|
606
721
|
* which potentially are not defiend. The same fix can be applied for the rest tokens if needed.
|
|
607
722
|
*/
|
|
608
|
-
const EXTENSION_ASSET_URL
|
|
723
|
+
const EXTENSION_ASSET_URL = containerHooks.EXTENSION_ASSET_URL || new InjectionToken('EXTENSION_ASSET_URL');
|
|
609
724
|
/**
|
|
610
725
|
* Wire in as a string. Gives the Angular 2 route that the module is registered under.
|
|
611
726
|
*/
|
|
612
|
-
const EXTENSION_ROUTE
|
|
727
|
+
const EXTENSION_ROUTE = containerHooks.EXTENSION_ROUTE;
|
|
613
728
|
/**
|
|
614
729
|
* Wire in as a boolean. True if running under the SDK, false if running in production.
|
|
615
730
|
*/
|
|
616
|
-
const SDK_MODE
|
|
617
|
-
const AuthTokenHolderService
|
|
731
|
+
const SDK_MODE = containerHooks.SDK_MODE;
|
|
732
|
+
const AuthTokenHolderService = containerHooks.AuthTokenHolderService;
|
|
618
733
|
|
|
619
734
|
/**
|
|
620
735
|
* Default chunk size is 50MiB. This is equal to the chunk size the VCD UI uses for library uploads.
|
|
@@ -779,106 +894,18 @@ class VcdTransferClient {
|
|
|
779
894
|
}
|
|
780
895
|
}
|
|
781
896
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
throw new Error('SystemJS registry not found');
|
|
788
|
-
}
|
|
789
|
-
let containerHooks = window.System.registry.get('@vcd/common');
|
|
790
|
-
if (!containerHooks) {
|
|
791
|
-
containerHooks = window.System.registry.get('@vcd-ui/common');
|
|
792
|
-
}
|
|
793
|
-
if (!containerHooks) {
|
|
794
|
-
throw new Error('VCD UI container hooks not present in SystemJS registry');
|
|
795
|
-
}
|
|
796
|
-
/**
|
|
797
|
-
* Wire in as a string. Gives the root URL for API access (for example, the load balancer URL
|
|
798
|
-
* or the single-cell URL).
|
|
799
|
-
*/
|
|
800
|
-
const API_ROOT_URL = containerHooks.API_ROOT_URL;
|
|
801
|
-
/**
|
|
802
|
-
* Wire in as a string. Gives the root URL for the legacy Flex application.
|
|
803
|
-
*/
|
|
804
|
-
const FLEX_APP_URL = containerHooks.API_ROOT_URL;
|
|
805
|
-
/**
|
|
806
|
-
* Wire in as a string. Gives the current scope of the VCD-UI. As of current, this will be
|
|
807
|
-
* either 'tenant' for the tenant portal, or 'service-provider' for the service-provider portal.
|
|
808
|
-
*/
|
|
809
|
-
const SESSION_SCOPE = containerHooks.SESSION_SCOPE;
|
|
810
|
-
/**
|
|
811
|
-
* Wire in as a string. Gives the unique name (not the display name) of the current tenant
|
|
812
|
-
* organization that the VCD-UI is being used for.
|
|
813
|
-
*/
|
|
814
|
-
const SESSION_ORGANIZATION = containerHooks.SESSION_ORGANIZATION;
|
|
815
|
-
/**
|
|
816
|
-
* Wire in as a string. Gives the UUID identifier of the current tenant
|
|
817
|
-
* organization that the VCD-UI is being used for.
|
|
818
|
-
*/
|
|
819
|
-
const SESSION_ORG_ID = containerHooks.SESSION_ORG_ID ? containerHooks.SESSION_ORG_ID : '';
|
|
820
|
-
/**
|
|
821
|
-
* Wire in as a string. Gives the full root path for module assets (e.g. images, scripts, text files)
|
|
822
|
-
*
|
|
823
|
-
* ATTENTION!
|
|
824
|
-
* Add || new InjectionToken to workaround the Angular security mechanics which prevent use of injection tokens
|
|
825
|
-
* which potentially are not defiend. The same fix can be applied for the rest tokens if needed.
|
|
826
|
-
*/
|
|
827
|
-
const EXTENSION_ASSET_URL = containerHooks.EXTENSION_ASSET_URL || new InjectionToken('EXTENSION_ASSET_URL');
|
|
828
|
-
/**
|
|
829
|
-
* Wire in as a string. Gives the Angular 2 route that the module is registered under.
|
|
830
|
-
*/
|
|
831
|
-
const EXTENSION_ROUTE = containerHooks.EXTENSION_ROUTE;
|
|
832
|
-
/**
|
|
833
|
-
* Wire in as a boolean. True if running under the SDK, false if running in production.
|
|
834
|
-
*/
|
|
835
|
-
const SDK_MODE = containerHooks.SDK_MODE;
|
|
836
|
-
const ExtensionNavRegistrationAction = containerHooks.ExtensionNavRegistrationAction;
|
|
837
|
-
const AuthTokenHolderService = containerHooks.AuthTokenHolderService;
|
|
838
|
-
/**
|
|
839
|
-
* Every component referenced by an entity action extension point must inherit from this.
|
|
840
|
-
*/
|
|
841
|
-
// tslint:disable-next-line:class-name
|
|
842
|
-
class _EntityActionExtensionComponent {
|
|
843
|
-
}
|
|
844
|
-
const EntityActionExtensionComponent = containerHooks.EntityActionExtensionComponent;
|
|
845
|
-
// tslint:disable-next-line:class-name
|
|
846
|
-
class _WizardExtensionComponent {
|
|
847
|
-
}
|
|
848
|
-
const WizardExtensionComponent = containerHooks.WizardExtensionComponent;
|
|
849
|
-
// tslint:disable-next-line:class-name
|
|
850
|
-
class _WizardExtensionWithValidationComponent extends _WizardExtensionComponent {
|
|
851
|
-
}
|
|
852
|
-
// tslint:disable-next-line:max-line-length
|
|
853
|
-
const WizardExtensionWithValidationComponent = containerHooks.WizardExtensionWithValidationComponent;
|
|
854
|
-
/**
|
|
855
|
-
* Every component-based Extension Point that is renderd in Cloud Director UI Entity Details
|
|
856
|
-
* must extend that class to obtain context about the Entity.
|
|
857
|
-
*
|
|
858
|
-
* See comments of the methods of the abstract class for more information.
|
|
859
|
-
*/
|
|
860
|
-
// tslint:disable-next-line:class-name
|
|
861
|
-
class _WizardExtensionWithContextComponent extends _WizardExtensionComponent {
|
|
862
|
-
}
|
|
863
|
-
// tslint:disable-next-line:max-line-length
|
|
864
|
-
const WizardExtensionWithContextComponent = containerHooks.WizardExtensionWithContextComponent;
|
|
865
|
-
|
|
866
|
-
class PluginModule {
|
|
867
|
-
constructor(appStore) {
|
|
868
|
-
this.appStore = appStore;
|
|
869
|
-
}
|
|
870
|
-
registerExtension(extension) {
|
|
871
|
-
this.appStore.dispatch(new ExtensionNavRegistrationAction(extension));
|
|
897
|
+
class ClientError extends Error {
|
|
898
|
+
constructor(message, type) {
|
|
899
|
+
super(message);
|
|
900
|
+
this.message = message;
|
|
901
|
+
this.type = type;
|
|
872
902
|
}
|
|
873
903
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
*/
|
|
880
|
-
class VcdSdkConfig {
|
|
881
|
-
}
|
|
904
|
+
var ClientErrorType;
|
|
905
|
+
(function (ClientErrorType) {
|
|
906
|
+
ClientErrorType["HateoasLinkMissing"] = "HateoasLinkMissing";
|
|
907
|
+
ClientErrorType["TaskLinkMissing"] = "TaskLinkMissing";
|
|
908
|
+
})(ClientErrorType || (ClientErrorType = {}));
|
|
882
909
|
|
|
883
910
|
const TRANSFER_LINK_REL = 'upload:default';
|
|
884
911
|
const HATEOAS_HEADER = 'Link';
|
|
@@ -998,7 +1025,7 @@ class VcdApiClient {
|
|
|
998
1025
|
* In this case the old API (/api/session) should not be used at all.
|
|
999
1026
|
*/
|
|
1000
1027
|
this._isCloudApiLogin = false;
|
|
1001
|
-
this._baseUrl = this.injector.get(API_ROOT_URL
|
|
1028
|
+
this._baseUrl = this.injector.get(API_ROOT_URL);
|
|
1002
1029
|
let negotiatedVersion;
|
|
1003
1030
|
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.apiVersion) {
|
|
1004
1031
|
negotiatedVersion = of(this.config.apiVersion).pipe(map((version) => {
|
|
@@ -1010,7 +1037,7 @@ class VcdApiClient {
|
|
|
1010
1037
|
negotiatedVersion = this.http.get(`${this._baseUrl}/api/versions`).pipe(map(versions => this.negotiateVersion(versions)), tap(version => this.setVersion(version)));
|
|
1011
1038
|
}
|
|
1012
1039
|
this._negotiateVersion = negotiatedVersion.pipe(share({ connector: () => new ReplaySubject(1), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }));
|
|
1013
|
-
const tokenHolder = this.injector.get(AuthTokenHolderService
|
|
1040
|
+
const tokenHolder = this.injector.get(AuthTokenHolderService, { token: '' });
|
|
1014
1041
|
const token = tokenHolder.jwt ? `Bearer ${tokenHolder.jwt}` : tokenHolder.token;
|
|
1015
1042
|
this._getSession = this.setAuthentication(token)
|
|
1016
1043
|
.pipe(share({ connector: () => new ReplaySubject(1), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }));
|
|
@@ -1090,10 +1117,10 @@ class VcdApiClient {
|
|
|
1090
1117
|
this.http.requestHeadersInterceptor.authentication = authentication;
|
|
1091
1118
|
return this.http.get(`${this._baseUrl}/api/session`).pipe(tap(session => {
|
|
1092
1119
|
// automatically set actAs for provider in tenant scope
|
|
1093
|
-
if (session.org === 'System' && this.injector.get(SESSION_SCOPE
|
|
1120
|
+
if (session.org === 'System' && this.injector.get(SESSION_SCOPE) === 'tenant') {
|
|
1094
1121
|
// Automatic actAs only works in versions >=9.5
|
|
1095
1122
|
try {
|
|
1096
|
-
this.actAs({ id: this.injector.get(SESSION_ORG_ID
|
|
1123
|
+
this.actAs({ id: this.injector.get(SESSION_ORG_ID) });
|
|
1097
1124
|
}
|
|
1098
1125
|
catch (e) {
|
|
1099
1126
|
console.warn('No SESSION_ORG_ID set in container. Automatic actAs is disabled.');
|
|
@@ -1202,10 +1229,10 @@ class VcdApiClient {
|
|
|
1202
1229
|
// Clear previous actAs
|
|
1203
1230
|
this.actAs(null);
|
|
1204
1231
|
// automatically set actAs for provider in tenant scope
|
|
1205
|
-
if (session.org && session.org.name === 'System' && this.injector.get(SESSION_SCOPE
|
|
1232
|
+
if (session.org && session.org.name === 'System' && this.injector.get(SESSION_SCOPE) === 'tenant') {
|
|
1206
1233
|
// Automatic actAs only works in versions >=9.5
|
|
1207
1234
|
try {
|
|
1208
|
-
this.actAs({ id: this.injector.get(SESSION_ORG_ID
|
|
1235
|
+
this.actAs({ id: this.injector.get(SESSION_ORG_ID) });
|
|
1209
1236
|
}
|
|
1210
1237
|
catch (e) {
|
|
1211
1238
|
console.warn('No SESSION_ORG_ID set in container. Automatic actAs is disabled.');
|
|
@@ -1267,7 +1294,7 @@ class VcdApiClient {
|
|
|
1267
1294
|
const link = [...headerLinks, ...links]
|
|
1268
1295
|
.find((l) => l.rel === transferRel);
|
|
1269
1296
|
if (!link) {
|
|
1270
|
-
throw new
|
|
1297
|
+
throw new ClientError(`Response from ${endpoint} did not contain a transfer link`, ClientErrorType.HateoasLinkMissing);
|
|
1271
1298
|
}
|
|
1272
1299
|
return link.href;
|
|
1273
1300
|
}));
|
|
@@ -1296,7 +1323,7 @@ class VcdApiClient {
|
|
|
1296
1323
|
const task = Object.assign(new TaskType(), response.body);
|
|
1297
1324
|
return of(task);
|
|
1298
1325
|
}
|
|
1299
|
-
return throwError(() => new
|
|
1326
|
+
return throwError(() => new ClientError(`An asynchronous request was made to [${httpVerb} ${response.url}], but no task was returned. The operation may still have been successful.`, ClientErrorType.TaskLinkMissing));
|
|
1300
1327
|
}
|
|
1301
1328
|
getEntity(entityRefOrUrn) {
|
|
1302
1329
|
const entityResolver = typeof entityRefOrUrn === 'string' ?
|
|
@@ -1313,7 +1340,7 @@ class VcdApiClient {
|
|
|
1313
1340
|
removeItem(item, options) {
|
|
1314
1341
|
const link = this.findLink(item, 'remove', null);
|
|
1315
1342
|
if (!link) {
|
|
1316
|
-
return throwError(() => new
|
|
1343
|
+
return throwError(() => new ClientError(`No 'remove' link for specified resource.`, ClientErrorType.HateoasLinkMissing));
|
|
1317
1344
|
}
|
|
1318
1345
|
return this.validateRequestContext().pipe(concatMap(() => this.http.delete(link.href, Object.assign({}, options))));
|
|
1319
1346
|
}
|
|
@@ -1323,7 +1350,7 @@ class VcdApiClient {
|
|
|
1323
1350
|
firstPage(result, multisite, options) {
|
|
1324
1351
|
const link = this.findLink(result, 'firstPage', result.type);
|
|
1325
1352
|
if (!link) {
|
|
1326
|
-
return throwError(() => new
|
|
1353
|
+
return throwError(() => new ClientError(`No 'firstPage' link for specified query.`, ClientErrorType.HateoasLinkMissing));
|
|
1327
1354
|
}
|
|
1328
1355
|
return this.getQueryPage(link.href, multisite, options);
|
|
1329
1356
|
}
|
|
@@ -1333,7 +1360,7 @@ class VcdApiClient {
|
|
|
1333
1360
|
previousPage(result, multisite, options) {
|
|
1334
1361
|
const link = this.findLink(result, 'previousPage', result.type);
|
|
1335
1362
|
if (!link) {
|
|
1336
|
-
return throwError(() => new
|
|
1363
|
+
return throwError(() => new ClientError(`No 'previousPage' link for specified query.`, ClientErrorType.HateoasLinkMissing));
|
|
1337
1364
|
}
|
|
1338
1365
|
return this.getQueryPage(link.href, multisite, options);
|
|
1339
1366
|
}
|
|
@@ -1343,7 +1370,7 @@ class VcdApiClient {
|
|
|
1343
1370
|
nextPage(result, multisite, options) {
|
|
1344
1371
|
const link = this.findLink(result, 'nextPage', result.type);
|
|
1345
1372
|
if (!link) {
|
|
1346
|
-
return throwError(() => new
|
|
1373
|
+
return throwError(() => new ClientError(`No 'nextPage' link for specified query.`, ClientErrorType.HateoasLinkMissing));
|
|
1347
1374
|
}
|
|
1348
1375
|
return this.getQueryPage(link.href, multisite, options);
|
|
1349
1376
|
}
|
|
@@ -1353,7 +1380,7 @@ class VcdApiClient {
|
|
|
1353
1380
|
lastPage(result, multisite, options) {
|
|
1354
1381
|
const link = this.findLink(result, 'lastPage', result.type);
|
|
1355
1382
|
if (!link) {
|
|
1356
|
-
return throwError(() => new
|
|
1383
|
+
return throwError(() => new ClientError(`No 'lastPage' link for specified query.`, ClientErrorType.HateoasLinkMissing));
|
|
1357
1384
|
}
|
|
1358
1385
|
return this.getQueryPage(link.href, multisite, options);
|
|
1359
1386
|
}
|
|
@@ -1520,5 +1547,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
1520
1547
|
* Generated bundle index. Do not edit.
|
|
1521
1548
|
*/
|
|
1522
1549
|
|
|
1523
|
-
export { API_ROOT_URL, ApiResult, ApiResultService, AuthTokenHolderService, 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, VcdApiClient, VcdHttpClient, VcdSdkConfig, VcdSdkModule, VcdTransferClient, WizardExtensionComponent, WizardExtensionWithContextComponent, WizardExtensionWithValidationComponent, _EntityActionExtensionComponent, _WizardExtensionComponent, _WizardExtensionWithContextComponent, _WizardExtensionWithValidationComponent, parseHeaderHateoasLinks };
|
|
1550
|
+
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 };
|
|
1524
1551
|
//# sourceMappingURL=vcd-sdk.mjs.map
|