@vcd/sdk 0.13.0 → 15.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/client/api.result.service.d.ts +20 -0
- package/client/client/constants.d.ts +10 -0
- package/client/client/index.d.ts +7 -0
- package/client/client/logging.interceptor.d.ts +14 -0
- package/client/client/request.headers.interceptor.d.ts +20 -0
- package/client/client/response.normalization.interceptor.d.ts +39 -0
- package/client/client/vcd.api.client.d.ts +351 -0
- package/client/client/vcd.http.client.d.ts +32 -0
- package/client/client/vcd.transfer.client.d.ts +121 -0
- package/client/container-hooks/index.d.ts +58 -0
- package/client/index.d.ts +2 -0
- package/client/openapi.d.ts +76 -0
- package/client/query/filter.builder.d.ts +162 -0
- package/client/query/index.d.ts +2 -0
- package/client/query/query.builder.d.ts +30 -0
- package/common/container-hooks.d.ts +2 -2
- package/core/plugin.module.d.ts +10 -5
- package/esm2020/client/client/api.result.service.mjs +43 -0
- package/esm2020/client/client/constants.mjs +13 -0
- package/esm2020/client/client/index.mjs +8 -0
- package/esm2020/client/client/logging.interceptor.mjs +44 -0
- package/esm2020/client/client/request.headers.interceptor.mjs +91 -0
- package/esm2020/client/client/response.normalization.interceptor.mjs +59 -0
- package/esm2020/client/client/vcd.api.client.mjs +602 -0
- package/esm2020/client/client/vcd.http.client.mjs +52 -0
- package/esm2020/client/client/vcd.transfer.client.mjs +166 -0
- package/esm2020/client/container-hooks/index.mjs +57 -0
- package/esm2020/client/index.mjs +3 -0
- package/esm2020/client/openapi.mjs +16 -0
- package/esm2020/client/query/filter.builder.mjs +195 -0
- package/esm2020/client/query/index.mjs +3 -0
- package/esm2020/client/query/query.builder.mjs +79 -0
- package/esm2020/common/container-hooks.mjs +74 -0
- package/esm2020/common/index.mjs +2 -0
- package/esm2020/core/index.mjs +2 -0
- package/esm2020/core/plugin.module.mjs +18 -0
- package/esm2020/main.mjs +45 -0
- package/esm2020/public-api.mjs +8 -0
- package/esm2020/vcd-sdk.mjs +5 -0
- package/fesm2015/vcd-sdk.mjs +1513 -0
- package/fesm2015/vcd-sdk.mjs.map +1 -0
- package/fesm2020/vcd-sdk.mjs +1508 -0
- package/fesm2020/vcd-sdk.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/main.d.ts +11 -5
- package/package.json +30 -39
- package/public-api.d.ts +1 -1
- package/vcd-sdk-15.0.0-alpha.0.tgz +0 -0
- package/LICENSE.txt +0 -12
- package/README.md +0 -119
- package/bundles/vcd-sdk.umd.js +0 -810
- package/bundles/vcd-sdk.umd.js.map +0 -1
- package/bundles/vcd-sdk.umd.min.js +0 -16
- package/bundles/vcd-sdk.umd.min.js.map +0 -1
- package/esm2015/common/container-hooks.js +0 -219
- package/esm2015/common/index.js +0 -6
- package/esm2015/core/index.js +0 -6
- package/esm2015/core/plugin.module.js +0 -53
- package/esm2015/i18n/index.js +0 -8
- package/esm2015/i18n/translate.pipe.js +0 -92
- package/esm2015/i18n/translate.service.js +0 -229
- package/esm2015/i18n/translation.loader.js +0 -63
- package/esm2015/main.js +0 -37
- package/esm2015/public-api.js +0 -12
- package/esm2015/vcd-sdk.js +0 -10
- package/esm5/common/container-hooks.js +0 -266
- package/esm5/common/index.js +0 -6
- package/esm5/core/index.js +0 -6
- package/esm5/core/plugin.module.js +0 -64
- package/esm5/i18n/index.js +0 -8
- package/esm5/i18n/translate.pipe.js +0 -108
- package/esm5/i18n/translate.service.js +0 -280
- package/esm5/i18n/translation.loader.js +0 -68
- package/esm5/main.js +0 -41
- package/esm5/public-api.js +0 -12
- package/esm5/vcd-sdk.js +0 -10
- package/fesm2015/vcd-sdk.js +0 -511
- package/fesm2015/vcd-sdk.js.map +0 -1
- package/fesm5/vcd-sdk.js +0 -620
- package/fesm5/vcd-sdk.js.map +0 -1
- package/i18n/index.d.ts +0 -3
- package/i18n/translate.pipe.d.ts +0 -12
- package/i18n/translate.service.d.ts +0 -21
- package/i18n/translation.loader.d.ts +0 -11
- package/schematics/collection.json +0 -10
- package/schematics/ng-add/index.d.ts +0 -3
- package/schematics/ng-add/index.js +0 -101
- package/schematics/ng-add/index.ts +0 -134
- package/schematics/ng-add/schema.d.ts +0 -8
- package/schematics/ng-add/schema.json +0 -19
- package/vcd-sdk.d.ts +0 -5
- package/vcd-sdk.metadata.json +0 -1
package/bundles/vcd-sdk.umd.js
DELETED
|
@@ -1,810 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@angular/common'), require('@vcd/angular-client'), require('rxjs'), require('rxjs/operators')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@vcd/sdk', ['exports', '@angular/common/http', '@angular/core', '@angular/common', '@vcd/angular-client', 'rxjs', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = global || self, factory((global.vcd = global.vcd || {}, global.vcd.sdk = {}), global.ng.common.http, global.ng.core, global.ng.common, global.angularClient, global.rxjs, global.rxjs.operators));
|
|
5
|
-
}(this, (function (exports, http, core, common, angularClient, rxjs, operators) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
10
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
11
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
|
|
13
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
15
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
16
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
17
|
-
|
|
18
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
19
|
-
and limitations under the License.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
|
|
23
|
-
var extendStatics = function(d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
extendStatics(d, b);
|
|
32
|
-
function __() { this.constructor = d; }
|
|
33
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function __read(o, n) {
|
|
37
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
38
|
-
if (!m) return o;
|
|
39
|
-
var i = m.call(o), r, ar = [], e;
|
|
40
|
-
try {
|
|
41
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
42
|
-
}
|
|
43
|
-
catch (error) { e = { error: error }; }
|
|
44
|
-
finally {
|
|
45
|
-
try {
|
|
46
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
47
|
-
}
|
|
48
|
-
finally { if (e) throw e.error; }
|
|
49
|
-
}
|
|
50
|
-
return ar;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function __spread() {
|
|
54
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
55
|
-
ar = ar.concat(__read(arguments[i]));
|
|
56
|
-
return ar;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @fileoverview added by tsickle
|
|
61
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
62
|
-
*/
|
|
63
|
-
// Bind straight into the hooks provided by the container.
|
|
64
|
-
if (!((/** @type {?} */ (window))).System || !((/** @type {?} */ (window))).System.registry || !((/** @type {?} */ (window))).System.registry.get) {
|
|
65
|
-
throw new Error('SystemJS registry not found');
|
|
66
|
-
}
|
|
67
|
-
/** @type {?} */
|
|
68
|
-
var containerHooks = ((/** @type {?} */ (window))).System.registry.get('@vcd/common');
|
|
69
|
-
if (!containerHooks) {
|
|
70
|
-
containerHooks = ((/** @type {?} */ (window))).System.registry.get('@vcd-ui/common');
|
|
71
|
-
}
|
|
72
|
-
if (!containerHooks) {
|
|
73
|
-
throw new Error('VCD UI container hooks not present in SystemJS registry');
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Wire in as a string. Gives the root URL for API access (for example, the load balancer URL
|
|
77
|
-
* or the single-cell URL).
|
|
78
|
-
* @type {?}
|
|
79
|
-
*/
|
|
80
|
-
var API_ROOT_URL = containerHooks.API_ROOT_URL;
|
|
81
|
-
/**
|
|
82
|
-
* Wire in as a string. Gives the root URL for the legacy Flex application.
|
|
83
|
-
* @type {?}
|
|
84
|
-
*/
|
|
85
|
-
var FLEX_APP_URL = containerHooks.API_ROOT_URL;
|
|
86
|
-
/**
|
|
87
|
-
* Wire in as a string. Gives the current scope of the VCD-UI. As of current, this will be
|
|
88
|
-
* either 'tenant' for the tenant portal, or 'service-provider' for the service-provider portal.
|
|
89
|
-
* @type {?}
|
|
90
|
-
*/
|
|
91
|
-
var SESSION_SCOPE = containerHooks.SESSION_SCOPE;
|
|
92
|
-
/**
|
|
93
|
-
* Wire in as a string. Gives the unique name (not the display name) of the current tenant
|
|
94
|
-
* organization that the VCD-UI is being used for.
|
|
95
|
-
* @type {?}
|
|
96
|
-
*/
|
|
97
|
-
var SESSION_ORGANIZATION = containerHooks.SESSION_ORGANIZATION;
|
|
98
|
-
/**
|
|
99
|
-
* Wire in as a string. Gives the UUID identifier of the current tenant
|
|
100
|
-
* organization that the VCD-UI is being used for.
|
|
101
|
-
* @type {?}
|
|
102
|
-
*/
|
|
103
|
-
var SESSION_ORG_ID = containerHooks.SESSION_ORG_ID ? containerHooks.SESSION_ORG_ID : '';
|
|
104
|
-
/**
|
|
105
|
-
* Wire in as a string. Gives the full root path for module assets (e.g. images, scripts, text files)
|
|
106
|
-
*
|
|
107
|
-
* ATTENTION!
|
|
108
|
-
* Add || new InjectionToken to workaround the Angular security mechanics which prevent use of injection tokens
|
|
109
|
-
* which potentially are not defiend. The same fix can be applied for the rest tokens if needed.
|
|
110
|
-
* @type {?}
|
|
111
|
-
*/
|
|
112
|
-
var EXTENSION_ASSET_URL = containerHooks.EXTENSION_ASSET_URL || new core.InjectionToken('EXTENSION_ASSET_URL');
|
|
113
|
-
/**
|
|
114
|
-
* Wire in as a string. Gives the Angular 2 route that the module is registered under.
|
|
115
|
-
* @type {?}
|
|
116
|
-
*/
|
|
117
|
-
var EXTENSION_ROUTE = containerHooks.EXTENSION_ROUTE;
|
|
118
|
-
/**
|
|
119
|
-
* Wire in as a boolean. True if running under the SDK, false if running in production.
|
|
120
|
-
* @type {?}
|
|
121
|
-
*/
|
|
122
|
-
var SDK_MODE = containerHooks.SDK_MODE;
|
|
123
|
-
// WARNING: interface has both a type and a value, skipping emit
|
|
124
|
-
/** @type {?} */
|
|
125
|
-
var ExtensionNavRegistrationAction = containerHooks.ExtensionNavRegistrationAction;
|
|
126
|
-
// WARNING: interface has both a type and a value, skipping emit
|
|
127
|
-
/** @type {?} */
|
|
128
|
-
var AuthTokenHolderService = containerHooks.AuthTokenHolderService;
|
|
129
|
-
/**
|
|
130
|
-
* Every component referenced by an entity action extension point must inherit from this.
|
|
131
|
-
* @abstract
|
|
132
|
-
*/
|
|
133
|
-
// tslint:disable-next-line:class-name
|
|
134
|
-
var /**
|
|
135
|
-
* Every component referenced by an entity action extension point must inherit from this.
|
|
136
|
-
* @abstract
|
|
137
|
-
*/
|
|
138
|
-
// tslint:disable-next-line:class-name
|
|
139
|
-
_EntityActionExtensionComponent = /** @class */ (function () {
|
|
140
|
-
function _EntityActionExtensionComponent() {
|
|
141
|
-
}
|
|
142
|
-
return _EntityActionExtensionComponent;
|
|
143
|
-
}());
|
|
144
|
-
/** @type {?} */
|
|
145
|
-
var EntityActionExtensionComponent = containerHooks.EntityActionExtensionComponent;
|
|
146
|
-
// tslint:disable-next-line:class-name
|
|
147
|
-
/**
|
|
148
|
-
* @abstract
|
|
149
|
-
* @template P, R, E
|
|
150
|
-
*/
|
|
151
|
-
var
|
|
152
|
-
// tslint:disable-next-line:class-name
|
|
153
|
-
/**
|
|
154
|
-
* @abstract
|
|
155
|
-
* @template P, R, E
|
|
156
|
-
*/
|
|
157
|
-
_WizardExtensionComponent = /** @class */ (function () {
|
|
158
|
-
function _WizardExtensionComponent() {
|
|
159
|
-
}
|
|
160
|
-
return _WizardExtensionComponent;
|
|
161
|
-
}());
|
|
162
|
-
/** @type {?} */
|
|
163
|
-
var WizardExtensionComponent = containerHooks.WizardExtensionComponent;
|
|
164
|
-
// tslint:disable-next-line:class-name
|
|
165
|
-
/**
|
|
166
|
-
* @abstract
|
|
167
|
-
* @template P, R, E
|
|
168
|
-
*/
|
|
169
|
-
var
|
|
170
|
-
// tslint:disable-next-line:class-name
|
|
171
|
-
/**
|
|
172
|
-
* @abstract
|
|
173
|
-
* @template P, R, E
|
|
174
|
-
*/
|
|
175
|
-
_WizardExtensionWithValidationComponent = /** @class */ (function (_super) {
|
|
176
|
-
__extends(_WizardExtensionWithValidationComponent, _super);
|
|
177
|
-
function _WizardExtensionWithValidationComponent() {
|
|
178
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
179
|
-
}
|
|
180
|
-
return _WizardExtensionWithValidationComponent;
|
|
181
|
-
}(_WizardExtensionComponent));
|
|
182
|
-
// tslint:disable-next-line:max-line-length
|
|
183
|
-
/** @type {?} */
|
|
184
|
-
var WizardExtensionWithValidationComponent = containerHooks.WizardExtensionWithValidationComponent;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* @fileoverview added by tsickle
|
|
188
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
192
|
-
__proto__: null,
|
|
193
|
-
API_ROOT_URL: API_ROOT_URL,
|
|
194
|
-
FLEX_APP_URL: FLEX_APP_URL,
|
|
195
|
-
SESSION_SCOPE: SESSION_SCOPE,
|
|
196
|
-
SESSION_ORGANIZATION: SESSION_ORGANIZATION,
|
|
197
|
-
SESSION_ORG_ID: SESSION_ORG_ID,
|
|
198
|
-
EXTENSION_ASSET_URL: EXTENSION_ASSET_URL,
|
|
199
|
-
EXTENSION_ROUTE: EXTENSION_ROUTE,
|
|
200
|
-
SDK_MODE: SDK_MODE,
|
|
201
|
-
ExtensionNavRegistrationAction: ExtensionNavRegistrationAction,
|
|
202
|
-
AuthTokenHolderService: AuthTokenHolderService,
|
|
203
|
-
_EntityActionExtensionComponent: _EntityActionExtensionComponent,
|
|
204
|
-
EntityActionExtensionComponent: EntityActionExtensionComponent,
|
|
205
|
-
_WizardExtensionComponent: _WizardExtensionComponent,
|
|
206
|
-
WizardExtensionComponent: WizardExtensionComponent,
|
|
207
|
-
_WizardExtensionWithValidationComponent: _WizardExtensionWithValidationComponent,
|
|
208
|
-
WizardExtensionWithValidationComponent: WizardExtensionWithValidationComponent
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @fileoverview added by tsickle
|
|
213
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
214
|
-
*/
|
|
215
|
-
var PluginModule = /** @class */ (function () {
|
|
216
|
-
function PluginModule(appStore, translate) {
|
|
217
|
-
this.appStore = appStore;
|
|
218
|
-
if (translate) {
|
|
219
|
-
this.translate = translate;
|
|
220
|
-
this.translate.prepareTranslations(this.getSupportedLanguages(), this.getDefaultLanguage());
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* @protected
|
|
225
|
-
* @param {?} extension
|
|
226
|
-
* @return {?}
|
|
227
|
-
*/
|
|
228
|
-
PluginModule.prototype.registerExtension = /**
|
|
229
|
-
* @protected
|
|
230
|
-
* @param {?} extension
|
|
231
|
-
* @return {?}
|
|
232
|
-
*/
|
|
233
|
-
function (extension) {
|
|
234
|
-
this.appStore.dispatch(new ExtensionNavRegistrationAction(extension));
|
|
235
|
-
};
|
|
236
|
-
/**
|
|
237
|
-
* @protected
|
|
238
|
-
* @return {?}
|
|
239
|
-
*/
|
|
240
|
-
PluginModule.prototype.getDefaultLanguage = /**
|
|
241
|
-
* @protected
|
|
242
|
-
* @return {?}
|
|
243
|
-
*/
|
|
244
|
-
function () {
|
|
245
|
-
return 'en';
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* @protected
|
|
249
|
-
* @return {?}
|
|
250
|
-
*/
|
|
251
|
-
PluginModule.prototype.getSupportedLanguages = /**
|
|
252
|
-
* @protected
|
|
253
|
-
* @return {?}
|
|
254
|
-
*/
|
|
255
|
-
function () {
|
|
256
|
-
return ['en'];
|
|
257
|
-
};
|
|
258
|
-
return PluginModule;
|
|
259
|
-
}());
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @fileoverview added by tsickle
|
|
263
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
|
-
var index$1 = /*#__PURE__*/Object.freeze({
|
|
267
|
-
__proto__: null,
|
|
268
|
-
PluginModule: PluginModule
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* @fileoverview added by tsickle
|
|
273
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
274
|
-
*/
|
|
275
|
-
var TranslationLoader = /** @class */ (function () {
|
|
276
|
-
function TranslationLoader(http, assetUrl) {
|
|
277
|
-
this.http = http;
|
|
278
|
-
this.assetUrl = assetUrl;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* @param {?} language
|
|
282
|
-
* @return {?}
|
|
283
|
-
*/
|
|
284
|
-
TranslationLoader.prototype.getTranslation = /**
|
|
285
|
-
* @param {?} language
|
|
286
|
-
* @return {?}
|
|
287
|
-
*/
|
|
288
|
-
function (language) {
|
|
289
|
-
return this.http.get("" + this.assetUrl + TranslationLoader.PREFIX + language + TranslationLoader.SUFFIX);
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* @return {?}
|
|
293
|
-
*/
|
|
294
|
-
TranslationLoader.prototype.getCombinedTranslation = /**
|
|
295
|
-
* @return {?}
|
|
296
|
-
*/
|
|
297
|
-
function () {
|
|
298
|
-
return this.http.get(this.assetUrl + "/../i18n" + TranslationLoader.SUFFIX);
|
|
299
|
-
};
|
|
300
|
-
TranslationLoader.PREFIX = '/i18n/';
|
|
301
|
-
TranslationLoader.SUFFIX = '.json';
|
|
302
|
-
TranslationLoader.decorators = [
|
|
303
|
-
{ type: core.Injectable }
|
|
304
|
-
];
|
|
305
|
-
/** @nocollapse */
|
|
306
|
-
TranslationLoader.ctorParameters = function () { return [
|
|
307
|
-
{ type: http.HttpClient },
|
|
308
|
-
{ type: String, decorators: [{ type: core.Inject, args: [EXTENSION_ASSET_URL,] }] }
|
|
309
|
-
]; };
|
|
310
|
-
return TranslationLoader;
|
|
311
|
-
}());
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* @fileoverview added by tsickle
|
|
315
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
316
|
-
*/
|
|
317
|
-
var TranslateService = /** @class */ (function () {
|
|
318
|
-
function TranslateService(loader) {
|
|
319
|
-
this.loader = loader;
|
|
320
|
-
this.pending = false;
|
|
321
|
-
this.translations = {};
|
|
322
|
-
this._combinedTranslations = true;
|
|
323
|
-
this._supportedLanguages = [];
|
|
324
|
-
this._defaultLanguage = '';
|
|
325
|
-
}
|
|
326
|
-
Object.defineProperty(TranslateService.prototype, "combinedTranslations", {
|
|
327
|
-
get: /**
|
|
328
|
-
* @return {?}
|
|
329
|
-
*/
|
|
330
|
-
function () {
|
|
331
|
-
return this._combinedTranslations;
|
|
332
|
-
},
|
|
333
|
-
set: /**
|
|
334
|
-
* @param {?} _combinedTranslations
|
|
335
|
-
* @return {?}
|
|
336
|
-
*/
|
|
337
|
-
function (_combinedTranslations) {
|
|
338
|
-
this._combinedTranslations = _combinedTranslations;
|
|
339
|
-
},
|
|
340
|
-
enumerable: true,
|
|
341
|
-
configurable: true
|
|
342
|
-
});
|
|
343
|
-
Object.defineProperty(TranslateService.prototype, "supportedLanguages", {
|
|
344
|
-
get: /**
|
|
345
|
-
* @return {?}
|
|
346
|
-
*/
|
|
347
|
-
function () {
|
|
348
|
-
return this._supportedLanguages;
|
|
349
|
-
},
|
|
350
|
-
set: /**
|
|
351
|
-
* @param {?} _supportedLanguages
|
|
352
|
-
* @return {?}
|
|
353
|
-
*/
|
|
354
|
-
function (_supportedLanguages) {
|
|
355
|
-
this._supportedLanguages = _supportedLanguages;
|
|
356
|
-
},
|
|
357
|
-
enumerable: true,
|
|
358
|
-
configurable: true
|
|
359
|
-
});
|
|
360
|
-
Object.defineProperty(TranslateService.prototype, "defaultLanguage", {
|
|
361
|
-
get: /**
|
|
362
|
-
* @return {?}
|
|
363
|
-
*/
|
|
364
|
-
function () {
|
|
365
|
-
return this._defaultLanguage;
|
|
366
|
-
},
|
|
367
|
-
set: /**
|
|
368
|
-
* @param {?} _defaultLanguage
|
|
369
|
-
* @return {?}
|
|
370
|
-
*/
|
|
371
|
-
function (_defaultLanguage) {
|
|
372
|
-
this._defaultLanguage = _defaultLanguage;
|
|
373
|
-
},
|
|
374
|
-
enumerable: true,
|
|
375
|
-
configurable: true
|
|
376
|
-
});
|
|
377
|
-
/**
|
|
378
|
-
* @param {?} supportedLanguages
|
|
379
|
-
* @param {?} defaultLanguage
|
|
380
|
-
* @return {?}
|
|
381
|
-
*/
|
|
382
|
-
TranslateService.prototype.prepareTranslations = /**
|
|
383
|
-
* @param {?} supportedLanguages
|
|
384
|
-
* @param {?} defaultLanguage
|
|
385
|
-
* @return {?}
|
|
386
|
-
*/
|
|
387
|
-
function (supportedLanguages, defaultLanguage) {
|
|
388
|
-
this._supportedLanguages = supportedLanguages;
|
|
389
|
-
this._defaultLanguage = defaultLanguage;
|
|
390
|
-
this._selectedLanguage = this.getBestMatchSupportedLanguage(navigator.language);
|
|
391
|
-
this.getTranslation(this._selectedLanguage);
|
|
392
|
-
};
|
|
393
|
-
/**
|
|
394
|
-
* @private
|
|
395
|
-
* @param {?} requestedLanguage
|
|
396
|
-
* @return {?}
|
|
397
|
-
*/
|
|
398
|
-
TranslateService.prototype.getBestMatchSupportedLanguage = /**
|
|
399
|
-
* @private
|
|
400
|
-
* @param {?} requestedLanguage
|
|
401
|
-
* @return {?}
|
|
402
|
-
*/
|
|
403
|
-
function (requestedLanguage) {
|
|
404
|
-
if (this._supportedLanguages.indexOf(requestedLanguage) > -1) {
|
|
405
|
-
return requestedLanguage;
|
|
406
|
-
}
|
|
407
|
-
/** @type {?} */
|
|
408
|
-
var altLanguage = requestedLanguage.split('-')[0];
|
|
409
|
-
if (altLanguage === requestedLanguage) {
|
|
410
|
-
return this._defaultLanguage;
|
|
411
|
-
}
|
|
412
|
-
return (this._supportedLanguages.indexOf(altLanguage) > -1) ? altLanguage : this._defaultLanguage;
|
|
413
|
-
};
|
|
414
|
-
/**
|
|
415
|
-
* @param {?} language
|
|
416
|
-
* @return {?}
|
|
417
|
-
*/
|
|
418
|
-
TranslateService.prototype.getTranslation = /**
|
|
419
|
-
* @param {?} language
|
|
420
|
-
* @return {?}
|
|
421
|
-
*/
|
|
422
|
-
function (language) {
|
|
423
|
-
var _this = this;
|
|
424
|
-
this.pending = true;
|
|
425
|
-
this.translation$ = this._combinedTranslations ?
|
|
426
|
-
this.loader.getCombinedTranslation() : this.loader.getTranslation(language).pipe(operators.share());
|
|
427
|
-
this.translation$.pipe(operators.take(1)).subscribe((/**
|
|
428
|
-
* @param {?} result
|
|
429
|
-
* @return {?}
|
|
430
|
-
*/
|
|
431
|
-
function (result) {
|
|
432
|
-
_this.translations = result;
|
|
433
|
-
_this.pending = false;
|
|
434
|
-
}), (/**
|
|
435
|
-
* @param {?} error
|
|
436
|
-
* @return {?}
|
|
437
|
-
*/
|
|
438
|
-
function (error) {
|
|
439
|
-
_this.pending = false;
|
|
440
|
-
}));
|
|
441
|
-
return this.translation$;
|
|
442
|
-
};
|
|
443
|
-
/**
|
|
444
|
-
* @private
|
|
445
|
-
* @param {?} key
|
|
446
|
-
* @param {...?} args
|
|
447
|
-
* @return {?}
|
|
448
|
-
*/
|
|
449
|
-
TranslateService.prototype.getParsedResult = /**
|
|
450
|
-
* @private
|
|
451
|
-
* @param {?} key
|
|
452
|
-
* @param {...?} args
|
|
453
|
-
* @return {?}
|
|
454
|
-
*/
|
|
455
|
-
function (key) {
|
|
456
|
-
var args = [];
|
|
457
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
458
|
-
args[_i - 1] = arguments[_i];
|
|
459
|
-
}
|
|
460
|
-
/** @type {?} */
|
|
461
|
-
var result = (this._combinedTranslations && this.translations[this._selectedLanguage]) ?
|
|
462
|
-
this.translations[this._selectedLanguage][key] : this.translations[key];
|
|
463
|
-
if (Array.isArray(result)) {
|
|
464
|
-
result = result.join('');
|
|
465
|
-
}
|
|
466
|
-
return !result ? "#" + key + "#" : result.replace(/{([0-9]+)}/g, (/**
|
|
467
|
-
* @param {?} _
|
|
468
|
-
* @param {...?} n
|
|
469
|
-
* @return {?}
|
|
470
|
-
*/
|
|
471
|
-
function (_) {
|
|
472
|
-
var n = [];
|
|
473
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
474
|
-
n[_i - 1] = arguments[_i];
|
|
475
|
-
}
|
|
476
|
-
// tslint:disable-next-line: radix
|
|
477
|
-
/** @type {?} */
|
|
478
|
-
var idx = parseInt(n[0]);
|
|
479
|
-
if (args && typeof args[idx] !== 'undefined') {
|
|
480
|
-
return args[idx];
|
|
481
|
-
}
|
|
482
|
-
return '';
|
|
483
|
-
}));
|
|
484
|
-
};
|
|
485
|
-
/**
|
|
486
|
-
* @param {?} key
|
|
487
|
-
* @param {...?} args
|
|
488
|
-
* @return {?}
|
|
489
|
-
*/
|
|
490
|
-
TranslateService.prototype.get = /**
|
|
491
|
-
* @param {?} key
|
|
492
|
-
* @param {...?} args
|
|
493
|
-
* @return {?}
|
|
494
|
-
*/
|
|
495
|
-
function (key) {
|
|
496
|
-
var _this = this;
|
|
497
|
-
var args = [];
|
|
498
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
499
|
-
args[_i - 1] = arguments[_i];
|
|
500
|
-
}
|
|
501
|
-
if (!this.pending) {
|
|
502
|
-
return rxjs.of(this.getParsedResult.apply(this, __spread([key], args)));
|
|
503
|
-
}
|
|
504
|
-
// tslint:disable-next-line: deprecation
|
|
505
|
-
return rxjs.Observable.create((/**
|
|
506
|
-
* @param {?} observer
|
|
507
|
-
* @return {?}
|
|
508
|
-
*/
|
|
509
|
-
function (observer) {
|
|
510
|
-
/** @type {?} */
|
|
511
|
-
var onComplete = (/**
|
|
512
|
-
* @param {?} result
|
|
513
|
-
* @return {?}
|
|
514
|
-
*/
|
|
515
|
-
function (result) {
|
|
516
|
-
observer.next(result);
|
|
517
|
-
observer.complete();
|
|
518
|
-
});
|
|
519
|
-
/** @type {?} */
|
|
520
|
-
var onError = (/**
|
|
521
|
-
* @param {?} error
|
|
522
|
-
* @return {?}
|
|
523
|
-
*/
|
|
524
|
-
function (error) {
|
|
525
|
-
observer.error(error);
|
|
526
|
-
});
|
|
527
|
-
_this.translation$.subscribe((/**
|
|
528
|
-
* @param {?} result
|
|
529
|
-
* @return {?}
|
|
530
|
-
*/
|
|
531
|
-
function (result) {
|
|
532
|
-
result = _this.getParsedResult.apply(_this, __spread([key], args));
|
|
533
|
-
onComplete(result);
|
|
534
|
-
}), onError);
|
|
535
|
-
}));
|
|
536
|
-
};
|
|
537
|
-
TranslateService.decorators = [
|
|
538
|
-
{ type: core.Injectable }
|
|
539
|
-
];
|
|
540
|
-
/** @nocollapse */
|
|
541
|
-
TranslateService.ctorParameters = function () { return [
|
|
542
|
-
{ type: TranslationLoader }
|
|
543
|
-
]; };
|
|
544
|
-
return TranslateService;
|
|
545
|
-
}());
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* @fileoverview added by tsickle
|
|
549
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
550
|
-
*/
|
|
551
|
-
var TranslatePipe = /** @class */ (function () {
|
|
552
|
-
function TranslatePipe(translate, changeDetector) {
|
|
553
|
-
this.translate = translate;
|
|
554
|
-
this.changeDetector = changeDetector;
|
|
555
|
-
this.value = '';
|
|
556
|
-
this.lastKey = '';
|
|
557
|
-
this.lastArgs = [];
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* @param {?} key
|
|
561
|
-
* @param {...?} args
|
|
562
|
-
* @return {?}
|
|
563
|
-
*/
|
|
564
|
-
TranslatePipe.prototype.transform = /**
|
|
565
|
-
* @param {?} key
|
|
566
|
-
* @param {...?} args
|
|
567
|
-
* @return {?}
|
|
568
|
-
*/
|
|
569
|
-
function (key) {
|
|
570
|
-
var args = [];
|
|
571
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
572
|
-
args[_i - 1] = arguments[_i];
|
|
573
|
-
}
|
|
574
|
-
if (!key || key.length === 0) {
|
|
575
|
-
return key;
|
|
576
|
-
}
|
|
577
|
-
if (key === this.lastKey && args === this.lastArgs) {
|
|
578
|
-
return this.value;
|
|
579
|
-
}
|
|
580
|
-
this.lastKey = key;
|
|
581
|
-
this.lastArgs = args;
|
|
582
|
-
this.updateValue(key, args);
|
|
583
|
-
return this.value;
|
|
584
|
-
};
|
|
585
|
-
/**
|
|
586
|
-
* @private
|
|
587
|
-
* @param {?} key
|
|
588
|
-
* @param {?} args
|
|
589
|
-
* @return {?}
|
|
590
|
-
*/
|
|
591
|
-
TranslatePipe.prototype.updateValue = /**
|
|
592
|
-
* @private
|
|
593
|
-
* @param {?} key
|
|
594
|
-
* @param {?} args
|
|
595
|
-
* @return {?}
|
|
596
|
-
*/
|
|
597
|
-
function (key, args) {
|
|
598
|
-
var _a;
|
|
599
|
-
var _this = this;
|
|
600
|
-
(_a = this.translate).get.apply(_a, __spread([key], args)).subscribe((/**
|
|
601
|
-
* @param {?} result
|
|
602
|
-
* @return {?}
|
|
603
|
-
*/
|
|
604
|
-
function (result) {
|
|
605
|
-
_this.value = result;
|
|
606
|
-
_this.changeDetector.markForCheck();
|
|
607
|
-
}));
|
|
608
|
-
};
|
|
609
|
-
TranslatePipe.decorators = [
|
|
610
|
-
{ type: core.Injectable },
|
|
611
|
-
{ type: core.Pipe, args: [{
|
|
612
|
-
name: 'translate',
|
|
613
|
-
pure: false
|
|
614
|
-
},] }
|
|
615
|
-
];
|
|
616
|
-
/** @nocollapse */
|
|
617
|
-
TranslatePipe.ctorParameters = function () { return [
|
|
618
|
-
{ type: TranslateService },
|
|
619
|
-
{ type: core.ChangeDetectorRef }
|
|
620
|
-
]; };
|
|
621
|
-
return TranslatePipe;
|
|
622
|
-
}());
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* @fileoverview added by tsickle
|
|
626
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
627
|
-
*/
|
|
628
|
-
|
|
629
|
-
var index$2 = /*#__PURE__*/Object.freeze({
|
|
630
|
-
__proto__: null,
|
|
631
|
-
TranslatePipe: TranslatePipe,
|
|
632
|
-
TranslateService: TranslateService,
|
|
633
|
-
TranslationLoader: TranslationLoader
|
|
634
|
-
});
|
|
635
|
-
|
|
636
|
-
/**
|
|
637
|
-
* @fileoverview added by tsickle
|
|
638
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
639
|
-
*/
|
|
640
|
-
/**
|
|
641
|
-
* Extensions should import this module. They can then wire in SDK components as desired.
|
|
642
|
-
*/
|
|
643
|
-
var VcdSdkModule = /** @class */ (function () {
|
|
644
|
-
function VcdSdkModule() {
|
|
645
|
-
}
|
|
646
|
-
VcdSdkModule.decorators = [
|
|
647
|
-
{ type: core.NgModule, args: [{
|
|
648
|
-
imports: [
|
|
649
|
-
http.HttpClientModule,
|
|
650
|
-
common.CommonModule,
|
|
651
|
-
],
|
|
652
|
-
declarations: [TranslatePipe],
|
|
653
|
-
exports: [TranslatePipe],
|
|
654
|
-
providers: [
|
|
655
|
-
TranslateService,
|
|
656
|
-
TranslationLoader,
|
|
657
|
-
angularClient.RequestHeadersInterceptor,
|
|
658
|
-
angularClient.LoggingInterceptor,
|
|
659
|
-
angularClient.ResponseNormalizationInterceptor,
|
|
660
|
-
angularClient.VcdHttpClient,
|
|
661
|
-
angularClient.VcdApiClient,
|
|
662
|
-
]
|
|
663
|
-
},] }
|
|
664
|
-
];
|
|
665
|
-
return VcdSdkModule;
|
|
666
|
-
}());
|
|
667
|
-
|
|
668
|
-
Object.defineProperty(exports, 'ApiResult', {
|
|
669
|
-
enumerable: true,
|
|
670
|
-
get: function () {
|
|
671
|
-
return angularClient.ApiResult;
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
Object.defineProperty(exports, 'ApiResultService', {
|
|
675
|
-
enumerable: true,
|
|
676
|
-
get: function () {
|
|
677
|
-
return angularClient.ApiResultService;
|
|
678
|
-
}
|
|
679
|
-
});
|
|
680
|
-
Object.defineProperty(exports, 'Filter', {
|
|
681
|
-
enumerable: true,
|
|
682
|
-
get: function () {
|
|
683
|
-
return angularClient.Filter;
|
|
684
|
-
}
|
|
685
|
-
});
|
|
686
|
-
Object.defineProperty(exports, 'HATEOAS_HEADER', {
|
|
687
|
-
enumerable: true,
|
|
688
|
-
get: function () {
|
|
689
|
-
return angularClient.HATEOAS_HEADER;
|
|
690
|
-
}
|
|
691
|
-
});
|
|
692
|
-
Object.defineProperty(exports, 'LinkRelType', {
|
|
693
|
-
enumerable: true,
|
|
694
|
-
get: function () {
|
|
695
|
-
return angularClient.LinkRelType;
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
Object.defineProperty(exports, 'LoggingInterceptor', {
|
|
699
|
-
enumerable: true,
|
|
700
|
-
get: function () {
|
|
701
|
-
return angularClient.LoggingInterceptor;
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
Object.defineProperty(exports, 'MAX_CHUNK_RETRY_COUNT', {
|
|
705
|
-
enumerable: true,
|
|
706
|
-
get: function () {
|
|
707
|
-
return angularClient.MAX_CHUNK_RETRY_COUNT;
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
Object.defineProperty(exports, 'MAX_CHUNK_SIZE', {
|
|
711
|
-
enumerable: true,
|
|
712
|
-
get: function () {
|
|
713
|
-
return angularClient.MAX_CHUNK_SIZE;
|
|
714
|
-
}
|
|
715
|
-
});
|
|
716
|
-
Object.defineProperty(exports, 'Query', {
|
|
717
|
-
enumerable: true,
|
|
718
|
-
get: function () {
|
|
719
|
-
return angularClient.Query;
|
|
720
|
-
}
|
|
721
|
-
});
|
|
722
|
-
Object.defineProperty(exports, 'RequestHeadersInterceptor', {
|
|
723
|
-
enumerable: true,
|
|
724
|
-
get: function () {
|
|
725
|
-
return angularClient.RequestHeadersInterceptor;
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
Object.defineProperty(exports, 'ResponseNormalizationInterceptor', {
|
|
729
|
-
enumerable: true,
|
|
730
|
-
get: function () {
|
|
731
|
-
return angularClient.ResponseNormalizationInterceptor;
|
|
732
|
-
}
|
|
733
|
-
});
|
|
734
|
-
Object.defineProperty(exports, 'TRANSFER_LINK_REL', {
|
|
735
|
-
enumerable: true,
|
|
736
|
-
get: function () {
|
|
737
|
-
return angularClient.TRANSFER_LINK_REL;
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
Object.defineProperty(exports, 'TransferError', {
|
|
741
|
-
enumerable: true,
|
|
742
|
-
get: function () {
|
|
743
|
-
return angularClient.TransferError;
|
|
744
|
-
}
|
|
745
|
-
});
|
|
746
|
-
Object.defineProperty(exports, 'VcdApiClient', {
|
|
747
|
-
enumerable: true,
|
|
748
|
-
get: function () {
|
|
749
|
-
return angularClient.VcdApiClient;
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
Object.defineProperty(exports, 'VcdHttpClient', {
|
|
753
|
-
enumerable: true,
|
|
754
|
-
get: function () {
|
|
755
|
-
return angularClient.VcdHttpClient;
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
Object.defineProperty(exports, 'VcdTransferClient', {
|
|
759
|
-
enumerable: true,
|
|
760
|
-
get: function () {
|
|
761
|
-
return angularClient.VcdTransferClient;
|
|
762
|
-
}
|
|
763
|
-
});
|
|
764
|
-
Object.defineProperty(exports, 'client', {
|
|
765
|
-
enumerable: true,
|
|
766
|
-
get: function () {
|
|
767
|
-
return angularClient.client;
|
|
768
|
-
}
|
|
769
|
-
});
|
|
770
|
-
Object.defineProperty(exports, 'parseHeaderHateoasLinks', {
|
|
771
|
-
enumerable: true,
|
|
772
|
-
get: function () {
|
|
773
|
-
return angularClient.parseHeaderHateoasLinks;
|
|
774
|
-
}
|
|
775
|
-
});
|
|
776
|
-
Object.defineProperty(exports, 'query', {
|
|
777
|
-
enumerable: true,
|
|
778
|
-
get: function () {
|
|
779
|
-
return angularClient.query;
|
|
780
|
-
}
|
|
781
|
-
});
|
|
782
|
-
exports.API_ROOT_URL = API_ROOT_URL;
|
|
783
|
-
exports.AuthTokenHolderService = AuthTokenHolderService;
|
|
784
|
-
exports.EXTENSION_ASSET_URL = EXTENSION_ASSET_URL;
|
|
785
|
-
exports.EXTENSION_ROUTE = EXTENSION_ROUTE;
|
|
786
|
-
exports.EntityActionExtensionComponent = EntityActionExtensionComponent;
|
|
787
|
-
exports.ExtensionNavRegistrationAction = ExtensionNavRegistrationAction;
|
|
788
|
-
exports.FLEX_APP_URL = FLEX_APP_URL;
|
|
789
|
-
exports.PluginModule = PluginModule;
|
|
790
|
-
exports.SDK_MODE = SDK_MODE;
|
|
791
|
-
exports.SESSION_ORGANIZATION = SESSION_ORGANIZATION;
|
|
792
|
-
exports.SESSION_ORG_ID = SESSION_ORG_ID;
|
|
793
|
-
exports.SESSION_SCOPE = SESSION_SCOPE;
|
|
794
|
-
exports.VcdSdkModule = VcdSdkModule;
|
|
795
|
-
exports.WizardExtensionComponent = WizardExtensionComponent;
|
|
796
|
-
exports.WizardExtensionWithValidationComponent = WizardExtensionWithValidationComponent;
|
|
797
|
-
exports._EntityActionExtensionComponent = _EntityActionExtensionComponent;
|
|
798
|
-
exports._WizardExtensionComponent = _WizardExtensionComponent;
|
|
799
|
-
exports._WizardExtensionWithValidationComponent = _WizardExtensionWithValidationComponent;
|
|
800
|
-
exports.common = index;
|
|
801
|
-
exports.core = index$1;
|
|
802
|
-
exports.i18n = index$2;
|
|
803
|
-
exports.ɵa = TranslatePipe;
|
|
804
|
-
exports.ɵb = TranslateService;
|
|
805
|
-
exports.ɵc = TranslationLoader;
|
|
806
|
-
|
|
807
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
808
|
-
|
|
809
|
-
})));
|
|
810
|
-
//# sourceMappingURL=vcd-sdk.umd.js.map
|