@veloceapps/api 5.0.13-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/README.md +3 -0
- package/bundles/veloceapps-api.umd.js +2597 -0
- package/bundles/veloceapps-api.umd.js.map +1 -0
- package/esm2015/index.js +27 -0
- package/esm2015/lib/api.module.js +95 -0
- package/esm2015/lib/services/account-api.service.js +50 -0
- package/esm2015/lib/services/catalog-admin-api.service.js +159 -0
- package/esm2015/lib/services/catalog-api.service.js +90 -0
- package/esm2015/lib/services/configuration-api.service.js +72 -0
- package/esm2015/lib/services/configuration-settings-api.service.js +52 -0
- package/esm2015/lib/services/context-api.service.js +26 -0
- package/esm2015/lib/services/delta-api.service.js +23 -0
- package/esm2015/lib/services/document-attachment-api.service.js +66 -0
- package/esm2015/lib/services/document-templates-api.service.js +284 -0
- package/esm2015/lib/services/endpoints-api.service.js +79 -0
- package/esm2015/lib/services/flows-api.service.js +24 -0
- package/esm2015/lib/services/org-info-api.service.js +20 -0
- package/esm2015/lib/services/picklists-api.service.js +38 -0
- package/esm2015/lib/services/price-api.service.js +63 -0
- package/esm2015/lib/services/procedures-api.service.js +93 -0
- package/esm2015/lib/services/product-api.service.js +153 -0
- package/esm2015/lib/services/product-model-api.service.js +232 -0
- package/esm2015/lib/services/quote-api.service.js +48 -0
- package/esm2015/lib/services/ramp-api.service.js +21 -0
- package/esm2015/lib/services/rule-groups-api.service.js +62 -0
- package/esm2015/lib/services/rules-api.service.js +81 -0
- package/esm2015/lib/services/salesforce-api.service.js +40 -0
- package/esm2015/lib/services/scripts-api.service.js +76 -0
- package/esm2015/lib/services/ui-templates-api.service.js +282 -0
- package/esm2015/lib/types/clone-request.types.js +2 -0
- package/esm2015/lib/types/delta-request.types.js +2 -0
- package/esm2015/lib/types/dto/configuration-settings-dto.types.js +22 -0
- package/esm2015/lib/types/dto/ui-template-dto.types.js +2 -0
- package/esm2015/lib/types/index.js +6 -0
- package/esm2015/lib/types/org-info.types.js +2 -0
- package/esm2015/lib/types/price.types.js +2 -0
- package/esm2015/lib/types/ramp-request.types.js +2 -0
- package/esm2015/lib/types/search-request.types.js +2 -0
- package/esm2015/lib/utils/ui-template.utils.js +13 -0
- package/esm2015/veloceapps-api.js +5 -0
- package/fesm2015/veloceapps-api.js +2139 -0
- package/fesm2015/veloceapps-api.js.map +1 -0
- package/index.d.ts +26 -0
- package/lib/api.module.d.ts +7 -0
- package/lib/services/account-api.service.d.ts +22 -0
- package/lib/services/catalog-admin-api.service.d.ts +34 -0
- package/lib/services/catalog-api.service.d.ts +20 -0
- package/lib/services/configuration-api.service.d.ts +18 -0
- package/lib/services/configuration-settings-api.service.d.ts +17 -0
- package/lib/services/context-api.service.d.ts +11 -0
- package/lib/services/delta-api.service.d.ts +12 -0
- package/lib/services/document-attachment-api.service.d.ts +16 -0
- package/lib/services/document-templates-api.service.d.ts +47 -0
- package/lib/services/endpoints-api.service.d.ts +21 -0
- package/lib/services/flows-api.service.d.ts +13 -0
- package/lib/services/org-info-api.service.d.ts +13 -0
- package/lib/services/picklists-api.service.d.ts +17 -0
- package/lib/services/price-api.service.d.ts +16 -0
- package/lib/services/procedures-api.service.d.ts +27 -0
- package/lib/services/product-api.service.d.ts +31 -0
- package/lib/services/product-model-api.service.d.ts +30 -0
- package/lib/services/quote-api.service.d.ts +25 -0
- package/lib/services/ramp-api.service.d.ts +13 -0
- package/lib/services/rule-groups-api.service.d.ts +18 -0
- package/lib/services/rules-api.service.d.ts +21 -0
- package/lib/services/salesforce-api.service.d.ts +17 -0
- package/lib/services/scripts-api.service.d.ts +21 -0
- package/lib/services/ui-templates-api.service.d.ts +49 -0
- package/lib/types/clone-request.types.d.ts +5 -0
- package/lib/types/delta-request.types.d.ts +5 -0
- package/lib/types/dto/configuration-settings-dto.types.d.ts +9 -0
- package/lib/types/dto/ui-template-dto.types.d.ts +6 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/org-info.types.d.ts +26 -0
- package/lib/types/price.types.d.ts +5 -0
- package/lib/types/ramp-request.types.d.ts +13 -0
- package/lib/types/search-request.types.d.ts +8 -0
- package/lib/utils/ui-template.utils.d.ts +3 -0
- package/package.json +37 -0
- package/veloceapps-api.d.ts +5 -0
@@ -0,0 +1,2139 @@
|
|
1
|
+
import * as i4 from '@angular/common/http';
|
2
|
+
import { HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { Injectable, NgModule } from '@angular/core';
|
5
|
+
import * as i1 from '@veloceapps/core';
|
6
|
+
import { ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, ProductModelsContainer, ModelUtils, EntityUtil, BaseHttpService, XrayService } from '@veloceapps/core';
|
7
|
+
import { throwError, of, zip, forkJoin, noop, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
|
8
|
+
import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
|
9
|
+
import { CurrencyPipe } from '@angular/common';
|
10
|
+
import * as _ from 'lodash';
|
11
|
+
import * as moment_ from 'moment';
|
12
|
+
import { __rest } from 'tslib';
|
13
|
+
|
14
|
+
class AccountApiService {
|
15
|
+
constructor(httpService) {
|
16
|
+
this.httpService = httpService;
|
17
|
+
this.SERVICE_URL = '/accounts';
|
18
|
+
}
|
19
|
+
getAccounts$(options) {
|
20
|
+
return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}` }, options));
|
21
|
+
}
|
22
|
+
searchAccounts$(searchParams, options) {
|
23
|
+
const params = new HttpParams({ fromObject: searchParams });
|
24
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}`, params: params }, options));
|
25
|
+
}
|
26
|
+
getAccount$(id, options) {
|
27
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${id}` }, options));
|
28
|
+
}
|
29
|
+
getAssets(accountId, options) {
|
30
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/assets` }, options));
|
31
|
+
}
|
32
|
+
getOrders(accountId, options) {
|
33
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/orders` }, options));
|
34
|
+
}
|
35
|
+
getQuotes(accountId, options) {
|
36
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/quotes` }, options));
|
37
|
+
}
|
38
|
+
getAsset(accountId, assetId, options) {
|
39
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/assets/${assetId}` }, options));
|
40
|
+
}
|
41
|
+
getOrder(accountId, orderId, options) {
|
42
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/orders/${orderId}` }, options));
|
43
|
+
}
|
44
|
+
getQuote(accountId, quoteId, options) {
|
45
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/quotes/${quoteId}` }, options));
|
46
|
+
}
|
47
|
+
quoteToOrder(accountId, quoteId, options) {
|
48
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/quotes/${quoteId}/to-order`, method: 'post', body: { id: quoteId } }, options));
|
49
|
+
}
|
50
|
+
orderToAsset(accountId, orderId, options) {
|
51
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/orders/${orderId}/to-asset`, method: 'post', body: { id: orderId } }, options));
|
52
|
+
}
|
53
|
+
}
|
54
|
+
AccountApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: AccountApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
55
|
+
AccountApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: AccountApiService });
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: AccountApiService, decorators: [{
|
57
|
+
type: Injectable
|
58
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
59
|
+
|
60
|
+
class CatalogAdminApiService {
|
61
|
+
constructor(baseHttpService) {
|
62
|
+
this.baseHttpService = baseHttpService;
|
63
|
+
this.serviceUrl = '/catalogs';
|
64
|
+
this.fetchCatalogs$ = (searchParams) => {
|
65
|
+
const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
|
66
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
|
67
|
+
};
|
68
|
+
this.searchCatalogs$ = (searchParams, expression) => {
|
69
|
+
const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
|
70
|
+
return this.baseHttpService.api({
|
71
|
+
method: 'post',
|
72
|
+
url: `${this.serviceUrl}/search`,
|
73
|
+
params,
|
74
|
+
body: expression || {},
|
75
|
+
});
|
76
|
+
};
|
77
|
+
this.fetchCategories$ = (catalogId) => {
|
78
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories` });
|
79
|
+
};
|
80
|
+
this.searchProducts$ = (catalogId, categoryId) => {
|
81
|
+
return this.baseHttpService.api({
|
82
|
+
method: 'post',
|
83
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
|
84
|
+
body: {},
|
85
|
+
});
|
86
|
+
};
|
87
|
+
this.fetchAttributes$ = (catalogId, categoryId) => {
|
88
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes` });
|
89
|
+
};
|
90
|
+
this.createNewCatalog$ = (catalogData) => {
|
91
|
+
return this.baseHttpService.api({
|
92
|
+
url: `${this.serviceUrl}`,
|
93
|
+
method: 'post',
|
94
|
+
body: catalogData,
|
95
|
+
});
|
96
|
+
};
|
97
|
+
this.duplicateCatalog$ = (cloneRequest) => {
|
98
|
+
return this.baseHttpService.api({
|
99
|
+
url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
|
100
|
+
method: 'post',
|
101
|
+
body: cloneRequest,
|
102
|
+
});
|
103
|
+
};
|
104
|
+
this.updateCatalog$ = (data) => {
|
105
|
+
return this.baseHttpService.api({
|
106
|
+
url: `${this.serviceUrl}/${data.id}`,
|
107
|
+
method: 'put',
|
108
|
+
body: data,
|
109
|
+
});
|
110
|
+
};
|
111
|
+
this.removeCatalog$ = (id) => {
|
112
|
+
return this.baseHttpService.api({
|
113
|
+
url: `${this.serviceUrl}/${id}`,
|
114
|
+
method: 'delete',
|
115
|
+
});
|
116
|
+
};
|
117
|
+
this.restoreCatalog$ = (id) => {
|
118
|
+
return this.baseHttpService.api({
|
119
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
120
|
+
method: 'patch',
|
121
|
+
});
|
122
|
+
};
|
123
|
+
this.createNewCategory$ = (categoryData) => {
|
124
|
+
return this.baseHttpService.api({
|
125
|
+
url: `${this.serviceUrl}/${categoryData.catalogId}/categories`,
|
126
|
+
method: 'post',
|
127
|
+
body: categoryData,
|
128
|
+
});
|
129
|
+
};
|
130
|
+
this.updateCategory$ = (category) => {
|
131
|
+
return this.baseHttpService.api({
|
132
|
+
url: `${this.serviceUrl}/${category.catalogId}/categories/${category.id}`,
|
133
|
+
method: 'put',
|
134
|
+
body: category,
|
135
|
+
});
|
136
|
+
};
|
137
|
+
this.duplicateCategory$ = (catalogId, cloneRequest) => {
|
138
|
+
return this.baseHttpService.api({
|
139
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${cloneRequest.id}/clone`,
|
140
|
+
method: 'post',
|
141
|
+
body: cloneRequest,
|
142
|
+
});
|
143
|
+
};
|
144
|
+
this.removeCategory$ = (id, catalogId) => {
|
145
|
+
return this.baseHttpService.api({
|
146
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${id}`,
|
147
|
+
method: 'delete',
|
148
|
+
});
|
149
|
+
};
|
150
|
+
this.restoreCategory$ = (id, catalogId) => {
|
151
|
+
return this.baseHttpService.api({
|
152
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${id}/restore`,
|
153
|
+
method: 'patch',
|
154
|
+
});
|
155
|
+
};
|
156
|
+
this.removeAttribute$ = ({ catalogId, categoryId, data, }) => {
|
157
|
+
return this.baseHttpService.api({
|
158
|
+
method: 'delete',
|
159
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
|
160
|
+
body: data,
|
161
|
+
});
|
162
|
+
};
|
163
|
+
this.restoreAttribute$ = ({ catalogId, categoryId, data, }) => {
|
164
|
+
return this.baseHttpService.api({
|
165
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}/restore`,
|
166
|
+
method: 'patch',
|
167
|
+
});
|
168
|
+
};
|
169
|
+
this.createNewAttribute$ = ({ catalogId, categoryId, data, }) => {
|
170
|
+
return this.baseHttpService.api({
|
171
|
+
method: 'post',
|
172
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes`,
|
173
|
+
body: data,
|
174
|
+
});
|
175
|
+
};
|
176
|
+
this.updateAttribute$ = ({ catalogId, categoryId, data, }) => {
|
177
|
+
return this.baseHttpService.api({
|
178
|
+
method: 'put',
|
179
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
|
180
|
+
body: data,
|
181
|
+
});
|
182
|
+
};
|
183
|
+
this.searchProductCandidates$ = (catalogId, categoryId, expression, searchParams) => {
|
184
|
+
const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
|
185
|
+
return this.baseHttpService.api({
|
186
|
+
method: 'post',
|
187
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/candidates/search`,
|
188
|
+
params,
|
189
|
+
body: expression,
|
190
|
+
});
|
191
|
+
};
|
192
|
+
this.addProduct$ = (product, catalogId, categoryId) => {
|
193
|
+
return this.baseHttpService.api({
|
194
|
+
method: 'post',
|
195
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
|
196
|
+
body: product,
|
197
|
+
});
|
198
|
+
};
|
199
|
+
this.removeProduct$ = ({ catalogId, categoryId, data, }) => {
|
200
|
+
return this.baseHttpService.api({
|
201
|
+
method: 'delete',
|
202
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/${data.id}`,
|
203
|
+
body: data,
|
204
|
+
});
|
205
|
+
};
|
206
|
+
}
|
207
|
+
}
|
208
|
+
CatalogAdminApiService.MAX_RESULTS = 60;
|
209
|
+
CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
210
|
+
CatalogAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogAdminApiService });
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogAdminApiService, decorators: [{
|
212
|
+
type: Injectable
|
213
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
214
|
+
|
215
|
+
class CatalogApiService {
|
216
|
+
constructor(service) {
|
217
|
+
this.service = service;
|
218
|
+
this.serviceUrl = '/product-catalogs';
|
219
|
+
}
|
220
|
+
fetchCatalogs$() {
|
221
|
+
return this.service.api({
|
222
|
+
method: 'get',
|
223
|
+
url: `${this.serviceUrl}`,
|
224
|
+
});
|
225
|
+
}
|
226
|
+
searchCatalogs$(searchParams, expression) {
|
227
|
+
const params = new HttpParams({ fromObject: searchParams });
|
228
|
+
return this.service.api({
|
229
|
+
method: 'post',
|
230
|
+
url: `${this.serviceUrl}/search`,
|
231
|
+
params,
|
232
|
+
body: expression,
|
233
|
+
});
|
234
|
+
}
|
235
|
+
getCatalog$(id) {
|
236
|
+
return this.service.api({
|
237
|
+
method: 'get',
|
238
|
+
url: `${this.serviceUrl}/${id}`,
|
239
|
+
});
|
240
|
+
}
|
241
|
+
fetchCategories$(catalogId) {
|
242
|
+
return this.service.api({
|
243
|
+
method: 'get',
|
244
|
+
url: `${this.serviceUrl}/${catalogId}/categories`,
|
245
|
+
});
|
246
|
+
}
|
247
|
+
fetchCatalogProducts$(catalogId, searchParams, context) {
|
248
|
+
const params = new HttpParams({ fromObject: searchParams });
|
249
|
+
return this.service.api({
|
250
|
+
method: 'post',
|
251
|
+
url: `${this.serviceUrl}/${catalogId}/products`,
|
252
|
+
params,
|
253
|
+
body: context,
|
254
|
+
});
|
255
|
+
}
|
256
|
+
fetchCategoryProducts$(catalogId, categoryId, searchParams, context) {
|
257
|
+
const params = new HttpParams({ fromObject: searchParams });
|
258
|
+
return this.service.api({
|
259
|
+
method: 'post',
|
260
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
|
261
|
+
params,
|
262
|
+
body: context,
|
263
|
+
});
|
264
|
+
}
|
265
|
+
searchCategoryProducts$(catalogId, categoryId, searchParams, searchCriteria, context) {
|
266
|
+
const params = new HttpParams({ fromObject: searchParams });
|
267
|
+
return this.service.api({
|
268
|
+
method: 'post',
|
269
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
|
270
|
+
params,
|
271
|
+
body: {
|
272
|
+
configurationContext: context,
|
273
|
+
request: { searchCriteria },
|
274
|
+
},
|
275
|
+
});
|
276
|
+
}
|
277
|
+
fetchEligibleProducts$(searchParams, context) {
|
278
|
+
const params = new HttpParams({ fromObject: searchParams });
|
279
|
+
return this.service.api({
|
280
|
+
method: 'post',
|
281
|
+
url: `${this.serviceUrl}/products`,
|
282
|
+
params: params,
|
283
|
+
body: context,
|
284
|
+
});
|
285
|
+
}
|
286
|
+
fetchProducts$(searchParams) {
|
287
|
+
const params = new HttpParams({ fromObject: searchParams });
|
288
|
+
return this.service.api({
|
289
|
+
method: 'get',
|
290
|
+
url: `${this.serviceUrl}/products`,
|
291
|
+
params: params,
|
292
|
+
});
|
293
|
+
}
|
294
|
+
}
|
295
|
+
CatalogApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
296
|
+
CatalogApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogApiService });
|
297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogApiService, decorators: [{
|
298
|
+
type: Injectable
|
299
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
300
|
+
|
301
|
+
class ConfigurationApiService {
|
302
|
+
constructor(httpService) {
|
303
|
+
this.httpService = httpService;
|
304
|
+
this.SERVICE_URL = '/configuration';
|
305
|
+
}
|
306
|
+
configureLineItem({ configurationRequest, runtimeModel, pricingEnabled, }) {
|
307
|
+
return this.httpService
|
308
|
+
.api({
|
309
|
+
method: 'post',
|
310
|
+
url: `${this.SERVICE_URL}${pricingEnabled ? '/price' : ''}`,
|
311
|
+
body: configurationRequest,
|
312
|
+
errorHandler: e => throwError(e),
|
313
|
+
})
|
314
|
+
.pipe(map(configurePrice => {
|
315
|
+
if (runtimeModel) {
|
316
|
+
return Object.assign(Object.assign({}, configurePrice), { lineItem: this.updatePortDomains(configurePrice.lineItem, runtimeModel) });
|
317
|
+
}
|
318
|
+
else {
|
319
|
+
return configurePrice;
|
320
|
+
}
|
321
|
+
}));
|
322
|
+
}
|
323
|
+
getRuntimeDataByProductId(productId, offeringId) {
|
324
|
+
return this.httpService
|
325
|
+
.api({
|
326
|
+
method: 'get',
|
327
|
+
url: `${this.SERVICE_URL}/${productId}/model` + ((offeringId && `/${offeringId}`) || ''),
|
328
|
+
})
|
329
|
+
.pipe(map(runtimeData => {
|
330
|
+
runtimeData.uiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);
|
331
|
+
runtimeData.uiDefinitions.forEach(uiDefinition => {
|
332
|
+
ModelTranslatorUtils.toLocalUIDefinition(uiDefinition);
|
333
|
+
});
|
334
|
+
return runtimeData;
|
335
|
+
}));
|
336
|
+
}
|
337
|
+
getRuntimeDataByModelId(modelId) {
|
338
|
+
return this.httpService
|
339
|
+
.api({
|
340
|
+
method: 'get',
|
341
|
+
url: `${this.SERVICE_URL}/${modelId}/model-test`,
|
342
|
+
})
|
343
|
+
.pipe(map((runtimeData) => {
|
344
|
+
runtimeData.uiDefinitions = [];
|
345
|
+
return runtimeData;
|
346
|
+
}));
|
347
|
+
}
|
348
|
+
updatePortDomains(lineItem, runtimeModel) {
|
349
|
+
var _a, _b, _c;
|
350
|
+
const type = runtimeModel.components.get(lineItem.type);
|
351
|
+
const portDomains = Object.assign({}, lineItem.portDomains);
|
352
|
+
for (const port of (_a = type === null || type === void 0 ? void 0 : type.ports) !== null && _a !== void 0 ? _a : []) {
|
353
|
+
const portDomain = portDomains[port.name];
|
354
|
+
if (((_b = portDomain === null || portDomain === void 0 ? void 0 : portDomain.properties) === null || _b === void 0 ? void 0 : _b.domainComputation) === 'false') {
|
355
|
+
portDomain.domainTypes = port.domainTypes;
|
356
|
+
}
|
357
|
+
}
|
358
|
+
return Object.assign(Object.assign({}, lineItem), { lineItems: (_c = lineItem.lineItems) === null || _c === void 0 ? void 0 : _c.map(i => this.updatePortDomains(i, runtimeModel)), portDomains });
|
359
|
+
}
|
360
|
+
}
|
361
|
+
ConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
362
|
+
ConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationApiService });
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationApiService, decorators: [{
|
364
|
+
type: Injectable
|
365
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
366
|
+
|
367
|
+
class ConfigurationSettingsDTO {
|
368
|
+
constructor(id, key, value) {
|
369
|
+
this.id = id;
|
370
|
+
this.key = key;
|
371
|
+
this.value = value;
|
372
|
+
}
|
373
|
+
static fromDTO(dto, key) {
|
374
|
+
return {
|
375
|
+
id: dto === null || dto === void 0 ? void 0 : dto.id,
|
376
|
+
key: (dto === null || dto === void 0 ? void 0 : dto.key) || key || '',
|
377
|
+
value: dto === null || dto === void 0 ? void 0 : dto.value,
|
378
|
+
};
|
379
|
+
}
|
380
|
+
static toDTO(data) {
|
381
|
+
return {
|
382
|
+
id: data.id,
|
383
|
+
key: data.key,
|
384
|
+
value: data.value,
|
385
|
+
};
|
386
|
+
}
|
387
|
+
}
|
388
|
+
|
389
|
+
class ConfigurationSettingsApiService {
|
390
|
+
constructor(httpService) {
|
391
|
+
this.httpService = httpService;
|
392
|
+
this.SERVICE_URL = '/configuration-settings';
|
393
|
+
}
|
394
|
+
fetchSettings(options) {
|
395
|
+
return this.httpService
|
396
|
+
.api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'get' }, options))
|
397
|
+
.pipe(map((settings) => settings.map(setting => ConfigurationSettingsDTO.fromDTO(setting))));
|
398
|
+
}
|
399
|
+
fetchSetting(settingsKey, options) {
|
400
|
+
return this.httpService
|
401
|
+
.api(Object.assign({ url: `${this.SERVICE_URL}/byKey/${settingsKey}`, method: 'get' }, options))
|
402
|
+
.pipe(map((setting) => ConfigurationSettingsDTO.fromDTO(setting, settingsKey)), catchError(err => {
|
403
|
+
if (err instanceof HttpErrorResponse && err.status === 404) {
|
404
|
+
return of(null);
|
405
|
+
}
|
406
|
+
throw err;
|
407
|
+
}));
|
408
|
+
}
|
409
|
+
createSetting(setting, options) {
|
410
|
+
const request = ConfigurationSettingsDTO.toDTO(setting);
|
411
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'post', body: Object.assign({}, request) }, options));
|
412
|
+
}
|
413
|
+
updateSetting(setting, options) {
|
414
|
+
const request = ConfigurationSettingsDTO.toDTO(setting);
|
415
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'put', body: Object.assign({}, request) }, options));
|
416
|
+
}
|
417
|
+
removeSetting(setting, options) {
|
418
|
+
const request = ConfigurationSettingsDTO.toDTO(setting);
|
419
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'delete' }, options));
|
420
|
+
}
|
421
|
+
restoreSetting(settingId, options) {
|
422
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${settingId}/restore`, method: 'patch' }, options));
|
423
|
+
}
|
424
|
+
clear(name, options) {
|
425
|
+
return this.httpService.api(Object.assign({ method: 'get', url: '/cache/evict/' + name }, options));
|
426
|
+
}
|
427
|
+
}
|
428
|
+
ConfigurationSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationSettingsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
429
|
+
ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationSettingsApiService });
|
430
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
|
431
|
+
type: Injectable
|
432
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
433
|
+
|
434
|
+
class ContextApiService {
|
435
|
+
constructor(httpService) {
|
436
|
+
this.httpService = httpService;
|
437
|
+
this.SERVICE_URL = '/context';
|
438
|
+
}
|
439
|
+
getContext(headerId, mode) {
|
440
|
+
return this.httpService.api({
|
441
|
+
method: 'post',
|
442
|
+
body: {
|
443
|
+
headerId: headerId,
|
444
|
+
contextMode: ConfigurationContextMode[mode],
|
445
|
+
},
|
446
|
+
url: `${this.SERVICE_URL}`,
|
447
|
+
});
|
448
|
+
}
|
449
|
+
}
|
450
|
+
ContextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
451
|
+
ContextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextApiService });
|
452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextApiService, decorators: [{
|
453
|
+
type: Injectable
|
454
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
455
|
+
|
456
|
+
class DeltaApiService {
|
457
|
+
constructor(httpService) {
|
458
|
+
this.httpService = httpService;
|
459
|
+
this.SERVICE_URL = '/delta';
|
460
|
+
}
|
461
|
+
calculate$(request) {
|
462
|
+
return this.httpService.api({
|
463
|
+
method: 'post',
|
464
|
+
url: `${this.SERVICE_URL}/calculate`,
|
465
|
+
body: request,
|
466
|
+
skipErrorHandler: true,
|
467
|
+
});
|
468
|
+
}
|
469
|
+
}
|
470
|
+
DeltaApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DeltaApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
471
|
+
DeltaApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DeltaApiService });
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DeltaApiService, decorators: [{
|
473
|
+
type: Injectable
|
474
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
475
|
+
|
476
|
+
class DocumentAttachmentApiService {
|
477
|
+
constructor(httpService, fileDownloadService) {
|
478
|
+
this.httpService = httpService;
|
479
|
+
this.fileDownloadService = fileDownloadService;
|
480
|
+
this.SERVICE_URL = '/attachments';
|
481
|
+
}
|
482
|
+
getAttachments(searchRequest) {
|
483
|
+
return this.httpService.api({
|
484
|
+
url: `${this.SERVICE_URL}/search`,
|
485
|
+
method: 'post',
|
486
|
+
body: searchRequest,
|
487
|
+
});
|
488
|
+
}
|
489
|
+
createAttachment(attachment, file, reportProgress) {
|
490
|
+
const formData = new FormData();
|
491
|
+
if (file) {
|
492
|
+
formData.append('file', file, file.name);
|
493
|
+
}
|
494
|
+
formData.append('attachment', new Blob([JSON.stringify(attachment)], {
|
495
|
+
type: 'application/json',
|
496
|
+
}));
|
497
|
+
return this.httpService.upload({
|
498
|
+
url: `${this.SERVICE_URL}`,
|
499
|
+
body: formData,
|
500
|
+
method: 'post',
|
501
|
+
observe: reportProgress ? 'events' : undefined,
|
502
|
+
reportProgress,
|
503
|
+
});
|
504
|
+
}
|
505
|
+
updateAttachment(id, attachment) {
|
506
|
+
return this.httpService.api({
|
507
|
+
url: `${this.SERVICE_URL}/${id}`,
|
508
|
+
body: attachment,
|
509
|
+
method: 'put',
|
510
|
+
});
|
511
|
+
}
|
512
|
+
getAttachmentFile(id, isPreventDownload) {
|
513
|
+
return this.httpService
|
514
|
+
.api({
|
515
|
+
url: `${this.SERVICE_URL}/${id}/file`,
|
516
|
+
responseType: isPreventDownload ? 'arraybuffer' : 'blob',
|
517
|
+
observe: isPreventDownload ? 'body' : 'response',
|
518
|
+
})
|
519
|
+
.pipe(tap(response => {
|
520
|
+
if (!isPreventDownload) {
|
521
|
+
this.fileDownloadService.processDownload(response);
|
522
|
+
}
|
523
|
+
}), map(response => (isPreventDownload ? new Blob([response.body || response]) : response.body || response)));
|
524
|
+
}
|
525
|
+
removeAttachment(id) {
|
526
|
+
return this.httpService.api({
|
527
|
+
url: `${this.SERVICE_URL}/${id}`,
|
528
|
+
method: 'delete',
|
529
|
+
});
|
530
|
+
}
|
531
|
+
}
|
532
|
+
DocumentAttachmentApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DocumentAttachmentApiService, deps: [{ token: i1.BaseHttpService }, { token: i1.FileDownloadService }], target: i0.ɵɵFactoryTarget.Injectable });
|
533
|
+
DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DocumentAttachmentApiService });
|
534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
|
535
|
+
type: Injectable
|
536
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
|
537
|
+
|
538
|
+
class SalesforceApiService {
|
539
|
+
constructor(httpService) {
|
540
|
+
this.httpService = httpService;
|
541
|
+
this.SERVICE_URL = '/proxy';
|
542
|
+
}
|
543
|
+
query(searchRequest, objectName, options) {
|
544
|
+
return this.httpService.api(Object.assign({ method: 'post', body: Object.assign(Object.assign({}, searchRequest), { count: searchRequest.count || 100 }), url: `${this.SERVICE_URL}/query/${objectName}` }, options));
|
545
|
+
}
|
546
|
+
queryObjects(search, options) {
|
547
|
+
let params = new HttpParams();
|
548
|
+
if (search) {
|
549
|
+
params = params.append('search', search);
|
550
|
+
}
|
551
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/query`, params }, options));
|
552
|
+
}
|
553
|
+
describe(objectName, fieldName, options) {
|
554
|
+
const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields` + (fieldName ? `/${fieldName}` : '');
|
555
|
+
return this.httpService.api(Object.assign({ url: methodUrl }, options));
|
556
|
+
}
|
557
|
+
describe2(objectName, fields, options) {
|
558
|
+
const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
|
559
|
+
return this.httpService.api(Object.assign({ method: 'post', url: methodUrl, body: fields }, options));
|
560
|
+
}
|
561
|
+
apexGetRequest(path, params, options) {
|
562
|
+
return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/apex${path}`, params }, options));
|
563
|
+
}
|
564
|
+
apexPostRequest(path, body, options) {
|
565
|
+
return this.httpService.api(Object.assign({ method: 'post', body, url: `${this.SERVICE_URL}/apex${path}` }, options));
|
566
|
+
}
|
567
|
+
}
|
568
|
+
SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
569
|
+
SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SalesforceApiService });
|
570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SalesforceApiService, decorators: [{
|
571
|
+
type: Injectable
|
572
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
573
|
+
|
574
|
+
const moment = moment_;
|
575
|
+
class DocumentTemplatesApiService {
|
576
|
+
constructor(service, salesforceApiService, fileDownloadService, documentAttachmentService, http) {
|
577
|
+
this.service = service;
|
578
|
+
this.salesforceApiService = salesforceApiService;
|
579
|
+
this.fileDownloadService = fileDownloadService;
|
580
|
+
this.documentAttachmentService = documentAttachmentService;
|
581
|
+
this.http = http;
|
582
|
+
this.DOCGEN_TAG = 'docgen';
|
583
|
+
this.SERVICE_URL = '/templates';
|
584
|
+
this.DOC_GEN_URL_FALLBACK = 'https://dev-dp1.velocpq.com/docgen';
|
585
|
+
this.mapSfQueryResult = (limit) => map((records) => {
|
586
|
+
if (!records.length) {
|
587
|
+
return { _result: 'No Records Found' };
|
588
|
+
}
|
589
|
+
if (limit === 1) {
|
590
|
+
return records[0];
|
591
|
+
}
|
592
|
+
return records;
|
593
|
+
});
|
594
|
+
this.mapBooleanIfAplicable = (value) => {
|
595
|
+
if (value === 'true') {
|
596
|
+
return true;
|
597
|
+
}
|
598
|
+
if (value === 'false') {
|
599
|
+
return false;
|
600
|
+
}
|
601
|
+
return value;
|
602
|
+
};
|
603
|
+
if (window.VELO_DOCGEN_API) {
|
604
|
+
this.DOC_GEN_URL = window.VELO_DOCGEN_API;
|
605
|
+
}
|
606
|
+
else {
|
607
|
+
console.log(`window.VELO_DOCGEN_API not set, will use fallback "${this.DOC_GEN_URL_FALLBACK}"`);
|
608
|
+
this.DOC_GEN_URL = this.DOC_GEN_URL_FALLBACK;
|
609
|
+
}
|
610
|
+
}
|
611
|
+
getTemplates(tag) {
|
612
|
+
return this.service.api({
|
613
|
+
url: `${this.SERVICE_URL}`,
|
614
|
+
method: 'get',
|
615
|
+
params: Object.assign({}, (tag && { tag })),
|
616
|
+
});
|
617
|
+
}
|
618
|
+
getTemplate(id) {
|
619
|
+
return this.service.api({
|
620
|
+
url: `${this.SERVICE_URL}/${id}`,
|
621
|
+
method: 'get',
|
622
|
+
});
|
623
|
+
}
|
624
|
+
upsertTemplate(template, file, reportProgress) {
|
625
|
+
const formData = new FormData();
|
626
|
+
if (file) {
|
627
|
+
formData.append('file', file, file.name);
|
628
|
+
}
|
629
|
+
formData.append('template', new Blob([JSON.stringify(template)], {
|
630
|
+
type: 'application/json',
|
631
|
+
}));
|
632
|
+
let url = `${this.SERVICE_URL}`;
|
633
|
+
if (template.id) {
|
634
|
+
url += `/${template.id}`;
|
635
|
+
}
|
636
|
+
return this.service.upload({
|
637
|
+
url,
|
638
|
+
body: formData,
|
639
|
+
method: template.id ? 'put' : 'post',
|
640
|
+
reportProgress,
|
641
|
+
});
|
642
|
+
}
|
643
|
+
removeTemplate(id) {
|
644
|
+
return this.service.api({
|
645
|
+
url: `${this.SERVICE_URL}/${id}`,
|
646
|
+
method: 'delete',
|
647
|
+
});
|
648
|
+
}
|
649
|
+
restoreTemplate(id) {
|
650
|
+
return this.service.api({
|
651
|
+
url: `${this.SERVICE_URL}/${id}/restore`,
|
652
|
+
method: 'patch',
|
653
|
+
});
|
654
|
+
}
|
655
|
+
cloneTemplate(id, propertiesToOverride = {}) {
|
656
|
+
return this.service.api({
|
657
|
+
url: `${this.SERVICE_URL}/clone/${id}`,
|
658
|
+
method: 'post',
|
659
|
+
body: {
|
660
|
+
id,
|
661
|
+
propertiesToOverride,
|
662
|
+
},
|
663
|
+
});
|
664
|
+
}
|
665
|
+
getTemplateFile(id) {
|
666
|
+
return this.service.api({
|
667
|
+
method: 'get',
|
668
|
+
url: `${this.SERVICE_URL}/${id}/file`,
|
669
|
+
responseType: 'arraybuffer',
|
670
|
+
});
|
671
|
+
}
|
672
|
+
downloadTemplateFile(id) {
|
673
|
+
return this.service
|
674
|
+
.api({
|
675
|
+
url: `${this.SERVICE_URL}/${id}/file`,
|
676
|
+
responseType: 'blob',
|
677
|
+
observe: 'response',
|
678
|
+
})
|
679
|
+
.pipe(tap(response => {
|
680
|
+
this.fileDownloadService.processDownload(response);
|
681
|
+
}), map(response => response.body || response));
|
682
|
+
}
|
683
|
+
mergeDocuments(document, attachments) {
|
684
|
+
const body = new FormData();
|
685
|
+
attachments.forEach(attachment => {
|
686
|
+
body.append('attachments', new Blob([attachment]));
|
687
|
+
});
|
688
|
+
body.append('orderform', document);
|
689
|
+
return this.http.post(`${this.DOC_GEN_URL}/documents/merge`, body, {
|
690
|
+
responseType: 'arraybuffer',
|
691
|
+
});
|
692
|
+
}
|
693
|
+
getAttachments(searchRequest) {
|
694
|
+
return this.documentAttachmentService.getAttachments(searchRequest);
|
695
|
+
}
|
696
|
+
getAttachmentFile(id) {
|
697
|
+
return this.documentAttachmentService.getAttachmentFile(id);
|
698
|
+
}
|
699
|
+
createAttachment(attachment, file, reportProgress) {
|
700
|
+
return this.documentAttachmentService.createAttachment(attachment, file, reportProgress);
|
701
|
+
}
|
702
|
+
removeAttachment(id) {
|
703
|
+
return this.documentAttachmentService.removeAttachment(id);
|
704
|
+
}
|
705
|
+
generateDocumentData(template, object, params = {}) {
|
706
|
+
var _a;
|
707
|
+
if (isLegacyDocumentTemplate(template)) {
|
708
|
+
return this.generateDocumentDataLegacy(template, object, params);
|
709
|
+
}
|
710
|
+
const templateProperties = (_a = template.properties) === null || _a === void 0 ? void 0 : _a.reduce((acc, { name, value }) => (Object.assign(Object.assign({}, acc), { [name]: this.mapBooleanIfAplicable(value) })), {});
|
711
|
+
/*
|
712
|
+
Resolve quote and template properties for now
|
713
|
+
When procedures are ready, whey will replace template scripts.
|
714
|
+
|
715
|
+
TODO: run procedure to resolve document data
|
716
|
+
*/
|
717
|
+
return of(Object.assign(Object.assign({}, (typeof object === 'object' ? object : { object })), templateProperties));
|
718
|
+
}
|
719
|
+
generateDocument(template, object, params = {}) {
|
720
|
+
const documentData$ = this.generateDocumentData(template, object, Object.assign(Object.assign({}, params), { shouldPreventDownload: true }));
|
721
|
+
return zip(this.getTemplateFile(template.id), documentData$, this.resolveAttachments$(template)).pipe(switchMap(([templateFile, data, attachments]) => {
|
722
|
+
var _a, _b, _c, _d, _e, _f;
|
723
|
+
const document = DocxTemplater.generate(templateFile, data);
|
724
|
+
const properties = (_c = (_b = (_a = object === null || object === void 0 ? void 0 : object.context) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : object === null || object === void 0 ? void 0 : object.properties) !== null && _c !== void 0 ? _c : {};
|
725
|
+
const documentName = properties.Name || template.name;
|
726
|
+
const documentFormat = (_d = params.documentFormat) !== null && _d !== void 0 ? _d : (_f = (_e = template.properties) === null || _e === void 0 ? void 0 : _e.find(p => p.name === 'documentFormat')) === null || _f === void 0 ? void 0 : _f.value;
|
727
|
+
if (documentFormat === 'DOCX') {
|
728
|
+
this.fileDownloadService.processDownload(document, documentName);
|
729
|
+
return of(document);
|
730
|
+
}
|
731
|
+
return this.mergeDocuments(document, attachments).pipe(switchMap(pdf => {
|
732
|
+
if (params.attachToQuote && QuoteDraft.isQuote(object)) {
|
733
|
+
const file = new File([pdf], `${documentName}.pdf`);
|
734
|
+
return this.documentAttachmentService
|
735
|
+
.createAttachment({
|
736
|
+
linkedEntityId: object.quoteId,
|
737
|
+
fileName: documentName,
|
738
|
+
fileExtension: 'pdf',
|
739
|
+
tags: this.DOCGEN_TAG,
|
740
|
+
}, file)
|
741
|
+
.pipe(map(() => pdf));
|
742
|
+
}
|
743
|
+
return of(pdf);
|
744
|
+
}), map(pdf => {
|
745
|
+
const blob = new Blob([pdf]);
|
746
|
+
if (!params.shouldPreventDownload) {
|
747
|
+
this.fileDownloadService.processDownload(blob, `${documentName}.pdf`);
|
748
|
+
}
|
749
|
+
return blob;
|
750
|
+
}));
|
751
|
+
}));
|
752
|
+
}
|
753
|
+
generateDocumentDataLegacy(template, object, params = {}) {
|
754
|
+
var _a, _b, _c, _d;
|
755
|
+
const shouldPreventDownload = params.shouldPreventDownload;
|
756
|
+
const allQueries = [...((_a = template === null || template === void 0 ? void 0 : template.queries) !== null && _a !== void 0 ? _a : [])];
|
757
|
+
const properties = (_d = (_c = (_b = object === null || object === void 0 ? void 0 : object.context) === null || _b === void 0 ? void 0 : _b.properties) !== null && _c !== void 0 ? _c : object === null || object === void 0 ? void 0 : object.properties) !== null && _d !== void 0 ? _d : {};
|
758
|
+
const accountId = properties === null || properties === void 0 ? void 0 : properties.AccountId;
|
759
|
+
const userId = properties === null || properties === void 0 ? void 0 : properties.UserId;
|
760
|
+
if (accountId) {
|
761
|
+
allQueries.push({
|
762
|
+
queryName: 'QuoteAccountQuery',
|
763
|
+
objectName: 'Account',
|
764
|
+
resultObjectName: 'account',
|
765
|
+
statement: `Id ='${accountId}'`,
|
766
|
+
fields: [],
|
767
|
+
});
|
768
|
+
}
|
769
|
+
if (userId) {
|
770
|
+
allQueries.push({
|
771
|
+
queryName: 'QuoteUserQuery',
|
772
|
+
objectName: 'User',
|
773
|
+
resultObjectName: 'agent',
|
774
|
+
statement: `Id ='${userId}'`,
|
775
|
+
fields: [],
|
776
|
+
});
|
777
|
+
}
|
778
|
+
const queries = allQueries.map(query => this.queryObject(query, { properties })) || [];
|
779
|
+
return forkJoin([...queries]).pipe(defaultIfEmpty([]), map(results => {
|
780
|
+
var _a, _b, _c, _d;
|
781
|
+
const queriesResult = _.chain(results)
|
782
|
+
.reduce((acc, r) => {
|
783
|
+
if (r) {
|
784
|
+
return Object.assign(Object.assign({}, acc), r);
|
785
|
+
}
|
786
|
+
return acc;
|
787
|
+
}, {})
|
788
|
+
.value();
|
789
|
+
const templateProperties = ((template === null || template === void 0 ? void 0 : template.properties) || []).reduce((trunk, { name, value }) => {
|
790
|
+
return Object.assign(Object.assign({}, trunk), { [name]: this.mapBooleanIfAplicable(value) });
|
791
|
+
}, {});
|
792
|
+
const data = Object.assign(Object.assign(Object.assign({}, (typeof object === 'object' ? object : { object })), queriesResult), templateProperties);
|
793
|
+
if (template.script && template.script.trim().length) {
|
794
|
+
const currencyFormat = ((_b = (_a = template.properties) === null || _a === void 0 ? void 0 : _a.find(({ name }) => name === 'currencyFormat')) === null || _b === void 0 ? void 0 : _b.value) || '1.2-2';
|
795
|
+
const dateFormat = ((_d = (_c = template.properties) === null || _c === void 0 ? void 0 : _c.find(({ name }) => name === 'dateFormat')) === null || _d === void 0 ? void 0 : _d.value) || 'D/MMM/YYYY';
|
796
|
+
const formatDate = (value) => {
|
797
|
+
return value ? moment(value).format(dateFormat) : value;
|
798
|
+
};
|
799
|
+
const transform = new Function(`return ${template.script}`)();
|
800
|
+
const transformedData = transform(Object.assign(Object.assign({}, data), { utils: {
|
801
|
+
lodash: _,
|
802
|
+
currency: (value) => new CurrencyPipe('en-US').transform(value, 'USD', 'symbol', currencyFormat),
|
803
|
+
date: formatDate,
|
804
|
+
}, ToDay: formatDate(Date.now()) }));
|
805
|
+
if (!shouldPreventDownload) {
|
806
|
+
const blob = new Blob([JSON.stringify(transformedData)]);
|
807
|
+
this.fileDownloadService.processDownload(blob, 'data.json');
|
808
|
+
}
|
809
|
+
return transformedData;
|
810
|
+
}
|
811
|
+
return data;
|
812
|
+
}));
|
813
|
+
}
|
814
|
+
resolveAttachments$(template) {
|
815
|
+
var _a, _b;
|
816
|
+
const attachmentIds = (_b = (_a = template.attachments) === null || _a === void 0 ? void 0 : _a.map(({ id }) => id).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
|
817
|
+
if (!attachmentIds.length) {
|
818
|
+
return of([]);
|
819
|
+
}
|
820
|
+
return forkJoin(attachmentIds.map(id => this.documentAttachmentService.getAttachmentFile(id, true)));
|
821
|
+
}
|
822
|
+
queryObject({ objectName, resultObjectName, fields, statement }, { properties }) {
|
823
|
+
var _a;
|
824
|
+
const patternLimit = /(\s*limit\s\d*)/i;
|
825
|
+
let limit = 1;
|
826
|
+
if (statement && patternLimit.test(statement)) {
|
827
|
+
const limitStr = (_a = statement === null || statement === void 0 ? void 0 : statement.match(patternLimit)) === null || _a === void 0 ? void 0 : _a[1].trim().substring(5).trim();
|
828
|
+
if (limitStr) {
|
829
|
+
limit = Number.parseInt(limitStr, 10);
|
830
|
+
}
|
831
|
+
statement = statement.replace(patternLimit, '');
|
832
|
+
}
|
833
|
+
const resolvedStatement = statement
|
834
|
+
? StringUtils.fillPlaceholders(statement, properties, /:\s*(\w[\w\d_.]+)/i)
|
835
|
+
: undefined;
|
836
|
+
const searchRequest = Object.assign({ skip: 0, count: limit, rawCondition: resolvedStatement }, ((fields === null || fields === void 0 ? void 0 : fields.length) && !!fields[0] && { fields }));
|
837
|
+
return this.salesforceApiService.query(searchRequest, objectName).pipe(this.mapSfQueryResult(limit), map(value => ({ [resultObjectName]: value })));
|
838
|
+
}
|
839
|
+
}
|
840
|
+
DocumentTemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DocumentTemplatesApiService, deps: [{ token: i1.BaseHttpService }, { token: SalesforceApiService }, { token: i1.FileDownloadService }, { token: DocumentAttachmentApiService }, { token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
841
|
+
DocumentTemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DocumentTemplatesApiService });
|
842
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DocumentTemplatesApiService, decorators: [{
|
843
|
+
type: Injectable
|
844
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: SalesforceApiService }, { type: i1.FileDownloadService }, { type: DocumentAttachmentApiService }, { type: i4.HttpClient }]; } });
|
845
|
+
|
846
|
+
class EndpointsApiService {
|
847
|
+
constructor(baseHttpService) {
|
848
|
+
this.baseHttpService = baseHttpService;
|
849
|
+
this.adminServiceUrl = '/admin/api-endpoints';
|
850
|
+
this.serviceUrl = '/api-endpoints';
|
851
|
+
}
|
852
|
+
fetchEndpoints$() {
|
853
|
+
return this.searchEndpoints$(new Expression(), 0, -1);
|
854
|
+
}
|
855
|
+
searchEndpoints$(expression, skip, count) {
|
856
|
+
let params = new HttpParams();
|
857
|
+
params = params.set('skip', '' + skip);
|
858
|
+
params = params.set('count', '' + count);
|
859
|
+
return this.baseHttpService.api({
|
860
|
+
method: 'post',
|
861
|
+
url: `${this.adminServiceUrl}/search`,
|
862
|
+
params,
|
863
|
+
body: expression,
|
864
|
+
});
|
865
|
+
}
|
866
|
+
removeEndpoint$(id) {
|
867
|
+
return this.baseHttpService.api({
|
868
|
+
url: `${this.adminServiceUrl}/${id}`,
|
869
|
+
method: 'delete',
|
870
|
+
});
|
871
|
+
}
|
872
|
+
restoreEndpoint$(id) {
|
873
|
+
return this.baseHttpService.api({
|
874
|
+
url: `${this.adminServiceUrl}/${id}/restore`,
|
875
|
+
method: 'patch',
|
876
|
+
});
|
877
|
+
}
|
878
|
+
fetchEndpoint$(id) {
|
879
|
+
return this.baseHttpService.api({
|
880
|
+
url: `${this.adminServiceUrl}/${id}`,
|
881
|
+
method: 'get',
|
882
|
+
});
|
883
|
+
}
|
884
|
+
createEndpoint$(body) {
|
885
|
+
return this.baseHttpService.api({
|
886
|
+
url: `${this.adminServiceUrl}`,
|
887
|
+
method: 'post',
|
888
|
+
body,
|
889
|
+
});
|
890
|
+
}
|
891
|
+
updateEndpoint$(body) {
|
892
|
+
return this.baseHttpService.api({
|
893
|
+
url: `${this.adminServiceUrl}/${body.id}`,
|
894
|
+
method: 'put',
|
895
|
+
body,
|
896
|
+
});
|
897
|
+
}
|
898
|
+
duplicateEndpoint$(cloneRequest) {
|
899
|
+
return this.baseHttpService.api({
|
900
|
+
url: `${this.adminServiceUrl}/${cloneRequest.id}/clone`,
|
901
|
+
method: 'post',
|
902
|
+
body: cloneRequest,
|
903
|
+
});
|
904
|
+
}
|
905
|
+
executeEndpoint$(body) {
|
906
|
+
return this.baseHttpService.api({
|
907
|
+
url: `${this.serviceUrl}/execute`,
|
908
|
+
method: 'post',
|
909
|
+
body,
|
910
|
+
responseType: 'text',
|
911
|
+
});
|
912
|
+
}
|
913
|
+
}
|
914
|
+
EndpointsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: EndpointsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
915
|
+
EndpointsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: EndpointsApiService });
|
916
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: EndpointsApiService, decorators: [{
|
917
|
+
type: Injectable
|
918
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
919
|
+
|
920
|
+
class FlowsApiService {
|
921
|
+
constructor(configurationSettingsApiService) {
|
922
|
+
this.configurationSettingsApiService = configurationSettingsApiService;
|
923
|
+
this.flowsKey = 'flows';
|
924
|
+
}
|
925
|
+
getFlow(id) {
|
926
|
+
return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)));
|
927
|
+
}
|
928
|
+
fetchFlows() {
|
929
|
+
return this.configurationSettingsApiService
|
930
|
+
.fetchSetting(this.flowsKey)
|
931
|
+
.pipe(map((flow) => ((flow === null || flow === void 0 ? void 0 : flow.value) ? JSON.parse(flow.value) : [])));
|
932
|
+
}
|
933
|
+
}
|
934
|
+
FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
935
|
+
FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowsApiService });
|
936
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowsApiService, decorators: [{
|
937
|
+
type: Injectable
|
938
|
+
}], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
|
939
|
+
|
940
|
+
class OrgInfoApiService {
|
941
|
+
constructor(http) {
|
942
|
+
var _a;
|
943
|
+
this.http = http;
|
944
|
+
this.CANVAS_URL_FALLBACK = 'https://canvas.velocpq.com';
|
945
|
+
this.hostUrl = (_a = window.VELO_CANVAS_API) !== null && _a !== void 0 ? _a : this.CANVAS_URL_FALLBACK;
|
946
|
+
}
|
947
|
+
getOrgInfo$(organizationId) {
|
948
|
+
return this.http.get(`${this.hostUrl}/org-info/${organizationId}`);
|
949
|
+
}
|
950
|
+
}
|
951
|
+
OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
952
|
+
OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OrgInfoApiService });
|
953
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: OrgInfoApiService, decorators: [{
|
954
|
+
type: Injectable
|
955
|
+
}], ctorParameters: function () { return [{ type: i4.HttpClient }]; } });
|
956
|
+
|
957
|
+
class PicklistsApiService {
|
958
|
+
constructor(baseHttpService) {
|
959
|
+
this.baseHttpService = baseHttpService;
|
960
|
+
this.serviceUrl = '/admin';
|
961
|
+
this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}/picklists` });
|
962
|
+
this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/picklists/${code}` });
|
963
|
+
this.createPicklist$ = (picklist) => {
|
964
|
+
return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/picklists`, body: picklist });
|
965
|
+
};
|
966
|
+
this.updatePicklist$ = (picklist) => {
|
967
|
+
return this.baseHttpService.api({
|
968
|
+
method: 'put',
|
969
|
+
url: `${this.serviceUrl}/picklists/${picklist.id}`,
|
970
|
+
body: picklist,
|
971
|
+
});
|
972
|
+
};
|
973
|
+
this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/picklists/${id}` });
|
974
|
+
this.restorePicklist$ = (id) => {
|
975
|
+
return this.baseHttpService.api({
|
976
|
+
url: `${this.serviceUrl}/picklists/${id}/restore`,
|
977
|
+
method: 'patch',
|
978
|
+
});
|
979
|
+
};
|
980
|
+
this.addPicklistValue$ = (picklist, value) => {
|
981
|
+
const data = Object.assign(Object.assign({}, picklist), { values: [...picklist.values, value] });
|
982
|
+
return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/picklists/${picklist.id}`, body: data });
|
983
|
+
};
|
984
|
+
}
|
985
|
+
}
|
986
|
+
PicklistsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PicklistsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
987
|
+
PicklistsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PicklistsApiService });
|
988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PicklistsApiService, decorators: [{
|
989
|
+
type: Injectable
|
990
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
991
|
+
|
992
|
+
class PriceApiService {
|
993
|
+
constructor(httpService) {
|
994
|
+
this.httpService = httpService;
|
995
|
+
this.SERVICE_URL = '/price';
|
996
|
+
}
|
997
|
+
calculate(request) {
|
998
|
+
return this.httpService.api({
|
999
|
+
method: 'post',
|
1000
|
+
url: `${this.SERVICE_URL}/calculate`,
|
1001
|
+
body: request,
|
1002
|
+
skipErrorHandler: true,
|
1003
|
+
});
|
1004
|
+
}
|
1005
|
+
getPriceLists() {
|
1006
|
+
return this.httpService.api({
|
1007
|
+
method: 'get',
|
1008
|
+
url: '/price-lists',
|
1009
|
+
});
|
1010
|
+
}
|
1011
|
+
getPriceList(id) {
|
1012
|
+
return this.httpService.api({
|
1013
|
+
method: 'get',
|
1014
|
+
url: `/price-lists/${id}`,
|
1015
|
+
});
|
1016
|
+
}
|
1017
|
+
getSellingTermByEndDate(planId, offeringId, startDate, endDate, frequencyUnit, frequencyDuration) {
|
1018
|
+
return this.httpService.api({
|
1019
|
+
method: 'post',
|
1020
|
+
url: `${this.SERVICE_URL}/selling-term-by-end-date`,
|
1021
|
+
body: {
|
1022
|
+
planId: planId,
|
1023
|
+
offeringId: offeringId,
|
1024
|
+
startDate: startDate,
|
1025
|
+
endDate: endDate,
|
1026
|
+
frequencyUnit: frequencyUnit,
|
1027
|
+
frequencyDuration: frequencyDuration,
|
1028
|
+
},
|
1029
|
+
});
|
1030
|
+
}
|
1031
|
+
getSellingTermByTerm(planId, offeringId, startDate, term, frequencyUnit, frequencyDuration) {
|
1032
|
+
return this.httpService.api({
|
1033
|
+
method: 'post',
|
1034
|
+
url: `${this.SERVICE_URL}/selling-term-by-term`,
|
1035
|
+
body: {
|
1036
|
+
planId: planId,
|
1037
|
+
offeringId: offeringId,
|
1038
|
+
startDate: startDate,
|
1039
|
+
term: term,
|
1040
|
+
frequencyUnit: frequencyUnit,
|
1041
|
+
frequencyDuration: frequencyDuration,
|
1042
|
+
},
|
1043
|
+
});
|
1044
|
+
}
|
1045
|
+
}
|
1046
|
+
PriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1047
|
+
PriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PriceApiService });
|
1048
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PriceApiService, decorators: [{
|
1049
|
+
type: Injectable
|
1050
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1051
|
+
|
1052
|
+
class ProceduresApiService {
|
1053
|
+
constructor(baseHttpService) {
|
1054
|
+
this.baseHttpService = baseHttpService;
|
1055
|
+
this.ADMIN_SERVICE_URL = '/admin/procedures';
|
1056
|
+
this.SERVICE_URL = '/procedures';
|
1057
|
+
this.fetchProcedures$ = () => {
|
1058
|
+
return this.searchProcedures$(new Expression(), 0, 100);
|
1059
|
+
};
|
1060
|
+
this.searchProcedures$ = (expression, skip, count) => {
|
1061
|
+
let params = new HttpParams();
|
1062
|
+
params = params.set('skip', '' + skip);
|
1063
|
+
params = params.set('count', '' + count);
|
1064
|
+
return this.baseHttpService.api({
|
1065
|
+
method: 'post',
|
1066
|
+
url: `${this.ADMIN_SERVICE_URL}/search`,
|
1067
|
+
params,
|
1068
|
+
body: expression,
|
1069
|
+
});
|
1070
|
+
};
|
1071
|
+
this.createProcedure$ = (newProcedure) => {
|
1072
|
+
return this.baseHttpService.api({
|
1073
|
+
url: `${this.ADMIN_SERVICE_URL}`,
|
1074
|
+
method: 'post',
|
1075
|
+
body: newProcedure,
|
1076
|
+
});
|
1077
|
+
};
|
1078
|
+
this.updateProcedure$ = (procedure) => {
|
1079
|
+
return this.baseHttpService.api({
|
1080
|
+
url: `${this.ADMIN_SERVICE_URL}/${procedure.id}`,
|
1081
|
+
method: 'put',
|
1082
|
+
body: procedure,
|
1083
|
+
});
|
1084
|
+
};
|
1085
|
+
this.duplicateProcedure$ = (body) => {
|
1086
|
+
return this.baseHttpService
|
1087
|
+
.api({
|
1088
|
+
url: `${this.ADMIN_SERVICE_URL}/${body.id}/clone`,
|
1089
|
+
method: 'post',
|
1090
|
+
body,
|
1091
|
+
})
|
1092
|
+
.pipe(map(response => response.clonedRecordId));
|
1093
|
+
};
|
1094
|
+
this.removeProcedure$ = (id) => {
|
1095
|
+
return this.baseHttpService.api({
|
1096
|
+
url: `${this.ADMIN_SERVICE_URL}/${id}`,
|
1097
|
+
method: 'delete',
|
1098
|
+
});
|
1099
|
+
};
|
1100
|
+
this.restoreProcedure$ = (id) => {
|
1101
|
+
return this.baseHttpService.api({
|
1102
|
+
url: `${this.ADMIN_SERVICE_URL}/${id}/restore`,
|
1103
|
+
method: 'patch',
|
1104
|
+
});
|
1105
|
+
};
|
1106
|
+
}
|
1107
|
+
fetchProcedure$(id) {
|
1108
|
+
return this.baseHttpService.api({
|
1109
|
+
url: `${this.ADMIN_SERVICE_URL}/${id}`,
|
1110
|
+
method: 'get',
|
1111
|
+
});
|
1112
|
+
}
|
1113
|
+
execute$(body) {
|
1114
|
+
return this.baseHttpService.api({
|
1115
|
+
url: `${this.SERVICE_URL}/execute`,
|
1116
|
+
method: 'post',
|
1117
|
+
body,
|
1118
|
+
});
|
1119
|
+
}
|
1120
|
+
/**
|
1121
|
+
* Run active procedure against QuoteDraft
|
1122
|
+
* @param body
|
1123
|
+
* @returns
|
1124
|
+
*/
|
1125
|
+
apply$(body) {
|
1126
|
+
return this.baseHttpService.api({
|
1127
|
+
url: `${this.SERVICE_URL}/apply`,
|
1128
|
+
method: 'post',
|
1129
|
+
body,
|
1130
|
+
});
|
1131
|
+
}
|
1132
|
+
}
|
1133
|
+
ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1134
|
+
ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProceduresApiService });
|
1135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProceduresApiService, decorators: [{
|
1136
|
+
type: Injectable
|
1137
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1138
|
+
|
1139
|
+
class ProductApiService {
|
1140
|
+
constructor(baseHttpService) {
|
1141
|
+
this.baseHttpService = baseHttpService;
|
1142
|
+
this.serviceUrl = '/products';
|
1143
|
+
this.fetchProducts$ = (payload) => {
|
1144
|
+
let params = new HttpParams();
|
1145
|
+
params = params.append('count', payload.count);
|
1146
|
+
params = params.append('skip', payload.skip);
|
1147
|
+
if (payload.name) {
|
1148
|
+
params = params.append('name', payload.name);
|
1149
|
+
}
|
1150
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
|
1151
|
+
};
|
1152
|
+
this.searchProducts$ = (expression, skip, count) => {
|
1153
|
+
let params = new HttpParams();
|
1154
|
+
params = params.set('skip', '' + skip);
|
1155
|
+
params = params.set('count', '' + count);
|
1156
|
+
return this.baseHttpService.api({
|
1157
|
+
method: 'post',
|
1158
|
+
url: `${this.serviceUrl}/search`,
|
1159
|
+
params: params,
|
1160
|
+
body: expression,
|
1161
|
+
});
|
1162
|
+
};
|
1163
|
+
this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
|
1164
|
+
this.fetchAttributes$ = () => {
|
1165
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/attributes/definition` });
|
1166
|
+
};
|
1167
|
+
this.searchAttributes$ = (expression, skip, count) => {
|
1168
|
+
let params = new HttpParams();
|
1169
|
+
params = params.set('skip', '' + skip);
|
1170
|
+
params = params.set('count', '' + count);
|
1171
|
+
return this.baseHttpService.api({
|
1172
|
+
method: 'post',
|
1173
|
+
url: `${this.serviceUrl}/attributes/definition/search`,
|
1174
|
+
params: params,
|
1175
|
+
body: expression,
|
1176
|
+
});
|
1177
|
+
};
|
1178
|
+
this.fetchAttributesByModel = (modelId) => {
|
1179
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/attributes/definition/forModel/${modelId}` });
|
1180
|
+
};
|
1181
|
+
this.createNewProduct$ = (productData) => {
|
1182
|
+
return this.baseHttpService.api({
|
1183
|
+
url: `${this.serviceUrl}`,
|
1184
|
+
method: 'post',
|
1185
|
+
body: productData,
|
1186
|
+
});
|
1187
|
+
};
|
1188
|
+
this.updateProduct$ = (body) => {
|
1189
|
+
return this.baseHttpService.api({
|
1190
|
+
url: `${this.serviceUrl}/${body.id}`,
|
1191
|
+
method: 'put',
|
1192
|
+
body,
|
1193
|
+
});
|
1194
|
+
};
|
1195
|
+
this.removeProduct$ = (id) => {
|
1196
|
+
return this.baseHttpService.api({
|
1197
|
+
url: `${this.serviceUrl}/${id}`,
|
1198
|
+
method: 'delete',
|
1199
|
+
});
|
1200
|
+
};
|
1201
|
+
this.restoreProduct$ = (id) => {
|
1202
|
+
return this.baseHttpService.api({
|
1203
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
1204
|
+
method: 'patch',
|
1205
|
+
});
|
1206
|
+
};
|
1207
|
+
this.createProductAttribute$ = (attributeData) => {
|
1208
|
+
return this.baseHttpService.api({
|
1209
|
+
url: `${this.serviceUrl}/attributes`,
|
1210
|
+
method: 'post',
|
1211
|
+
body: attributeData,
|
1212
|
+
});
|
1213
|
+
};
|
1214
|
+
this.updateProductAttribute$ = (attributeData) => {
|
1215
|
+
return this.baseHttpService.api({
|
1216
|
+
url: `${this.serviceUrl}/attributes/${attributeData.id}`,
|
1217
|
+
method: 'put',
|
1218
|
+
body: attributeData,
|
1219
|
+
});
|
1220
|
+
};
|
1221
|
+
this.removeProductAttribute$ = (id) => {
|
1222
|
+
return this.baseHttpService.api({
|
1223
|
+
url: `${this.serviceUrl}/attributes/${id}`,
|
1224
|
+
method: 'delete',
|
1225
|
+
});
|
1226
|
+
};
|
1227
|
+
this.createNewAttribute$ = (attributeData) => {
|
1228
|
+
return this.baseHttpService.api({
|
1229
|
+
url: `${this.serviceUrl}/attributes/definition`,
|
1230
|
+
method: 'post',
|
1231
|
+
body: attributeData,
|
1232
|
+
});
|
1233
|
+
};
|
1234
|
+
this.updateAttribute$ = (body) => {
|
1235
|
+
return this.baseHttpService.api({
|
1236
|
+
url: `${this.serviceUrl}/attributes/definition/${body.id}`,
|
1237
|
+
method: 'put',
|
1238
|
+
body,
|
1239
|
+
});
|
1240
|
+
};
|
1241
|
+
this.removeAttribute$ = (id) => {
|
1242
|
+
return this.baseHttpService.api({
|
1243
|
+
url: `${this.serviceUrl}/attributes/definition/${id}`,
|
1244
|
+
method: 'delete',
|
1245
|
+
});
|
1246
|
+
};
|
1247
|
+
this.restoreAttribute$ = (id) => {
|
1248
|
+
return this.baseHttpService.api({
|
1249
|
+
url: `${this.serviceUrl}/attributes/definition/${id}/restore`,
|
1250
|
+
method: 'patch',
|
1251
|
+
});
|
1252
|
+
};
|
1253
|
+
}
|
1254
|
+
attachImage$(productId, file) {
|
1255
|
+
const data = new FormData();
|
1256
|
+
data.append('image', file);
|
1257
|
+
return this.baseHttpService.upload({
|
1258
|
+
method: 'post',
|
1259
|
+
url: `${this.serviceUrl}/${productId}/image`,
|
1260
|
+
body: data,
|
1261
|
+
});
|
1262
|
+
}
|
1263
|
+
removeImage$(productId) {
|
1264
|
+
return this.baseHttpService.api({
|
1265
|
+
method: 'delete',
|
1266
|
+
url: `${this.serviceUrl}/${productId}/image`,
|
1267
|
+
});
|
1268
|
+
}
|
1269
|
+
fetchImage$(productId) {
|
1270
|
+
return this.baseHttpService.api({
|
1271
|
+
url: this.getImageUrl(productId),
|
1272
|
+
method: 'get',
|
1273
|
+
responseType: 'blob',
|
1274
|
+
errorHandler: noop,
|
1275
|
+
});
|
1276
|
+
}
|
1277
|
+
getImageUrl(productId) {
|
1278
|
+
return `${this.serviceUrl}/${productId}/image`;
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
ProductApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1282
|
+
ProductApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductApiService });
|
1283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductApiService, decorators: [{
|
1284
|
+
type: Injectable
|
1285
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1286
|
+
|
1287
|
+
class ProductModelApiService {
|
1288
|
+
constructor(httpService) {
|
1289
|
+
this.httpService = httpService;
|
1290
|
+
this.SERVICE_URL = '/models';
|
1291
|
+
}
|
1292
|
+
addModel(model) {
|
1293
|
+
return this.httpService
|
1294
|
+
.api({
|
1295
|
+
method: 'post',
|
1296
|
+
url: this.SERVICE_URL,
|
1297
|
+
body: model,
|
1298
|
+
errorHandler: this.httpService.handleValidationError,
|
1299
|
+
})
|
1300
|
+
.pipe(map(result => {
|
1301
|
+
if (result.successful) {
|
1302
|
+
return result;
|
1303
|
+
}
|
1304
|
+
else {
|
1305
|
+
throw new Error(result.message);
|
1306
|
+
}
|
1307
|
+
}));
|
1308
|
+
}
|
1309
|
+
releaseModel(model) {
|
1310
|
+
return this.httpService
|
1311
|
+
.api({
|
1312
|
+
method: 'put',
|
1313
|
+
url: `${this.SERVICE_URL}/${model.id}/release`,
|
1314
|
+
body: model,
|
1315
|
+
errorHandler: this.httpService.handleValidationError,
|
1316
|
+
})
|
1317
|
+
.pipe(map(result => {
|
1318
|
+
if (result.successful) {
|
1319
|
+
return '';
|
1320
|
+
}
|
1321
|
+
else {
|
1322
|
+
throw new Error(result.message);
|
1323
|
+
}
|
1324
|
+
}));
|
1325
|
+
}
|
1326
|
+
removeModel(modelId, successFn, failureFn) {
|
1327
|
+
const observable = this.httpService
|
1328
|
+
.api({
|
1329
|
+
method: 'delete',
|
1330
|
+
url: `${this.SERVICE_URL}/${modelId}`,
|
1331
|
+
errorHandler: this.httpService.handleValidationError,
|
1332
|
+
})
|
1333
|
+
.pipe(map(result => {
|
1334
|
+
if (result.successful) {
|
1335
|
+
return '';
|
1336
|
+
}
|
1337
|
+
else {
|
1338
|
+
throw new Error(result.message);
|
1339
|
+
}
|
1340
|
+
}));
|
1341
|
+
observable.subscribe(() => {
|
1342
|
+
successFn && successFn.apply();
|
1343
|
+
}, () => {
|
1344
|
+
failureFn && failureFn.apply();
|
1345
|
+
});
|
1346
|
+
}
|
1347
|
+
getModelVersions(modelId, count = 100, skip = 0) {
|
1348
|
+
return this.httpService.api({
|
1349
|
+
method: 'post',
|
1350
|
+
url: `${this.SERVICE_URL}/${modelId}/versions`,
|
1351
|
+
body: {
|
1352
|
+
skipCount: skip,
|
1353
|
+
count: count,
|
1354
|
+
},
|
1355
|
+
});
|
1356
|
+
}
|
1357
|
+
getModel(id, version) {
|
1358
|
+
let url = `${this.SERVICE_URL}/${id}`;
|
1359
|
+
if (version) {
|
1360
|
+
url += `/versions/${version}`;
|
1361
|
+
}
|
1362
|
+
return this.httpService.api({ url });
|
1363
|
+
}
|
1364
|
+
getModels(skipCount, searchText) {
|
1365
|
+
return this.httpService.api({
|
1366
|
+
method: 'post',
|
1367
|
+
url: `${this.SERVICE_URL}/search`,
|
1368
|
+
body: {
|
1369
|
+
nameRegex: searchText,
|
1370
|
+
skipCount: skipCount.toString(),
|
1371
|
+
count: ProductModelApiService.MAX_RESULTS,
|
1372
|
+
},
|
1373
|
+
});
|
1374
|
+
}
|
1375
|
+
getLinkedModels(id, version) {
|
1376
|
+
let url = `${this.SERVICE_URL}/${id}`;
|
1377
|
+
if (version) {
|
1378
|
+
url += `/versions/${version}`;
|
1379
|
+
}
|
1380
|
+
url += '/linked';
|
1381
|
+
return this.httpService.api({ url }).pipe(map((linkedModels) => {
|
1382
|
+
if (linkedModels) {
|
1383
|
+
linkedModels.forEach(model => ModelTranslatorUtils.toLocalModel(model));
|
1384
|
+
}
|
1385
|
+
return linkedModels;
|
1386
|
+
}));
|
1387
|
+
}
|
1388
|
+
load(id, version) {
|
1389
|
+
return forkJoin([this.getModel(id, version), this.getLinkedModels(id, version)]).pipe(map(([model, linkedModels]) => {
|
1390
|
+
const container = new ProductModelsContainer(model, linkedModels !== null && linkedModels !== void 0 ? linkedModels : []);
|
1391
|
+
ModelUtils.override(container.main, container.linked);
|
1392
|
+
ModelTranslatorUtils.toLocalModel(container.main, container.linked);
|
1393
|
+
return container;
|
1394
|
+
}));
|
1395
|
+
}
|
1396
|
+
getPML(modelId, version) {
|
1397
|
+
let url = `${this.SERVICE_URL}/${modelId}/pml/${version}`;
|
1398
|
+
if (version) {
|
1399
|
+
url += `/versions/${version}`;
|
1400
|
+
}
|
1401
|
+
return this.httpService.api({
|
1402
|
+
url,
|
1403
|
+
responseType: 'text',
|
1404
|
+
});
|
1405
|
+
}
|
1406
|
+
savePML(modelId, pml, comment) {
|
1407
|
+
return this.httpService
|
1408
|
+
.api({
|
1409
|
+
method: 'put',
|
1410
|
+
url: `${this.SERVICE_URL}/${modelId}/pml`,
|
1411
|
+
body: {
|
1412
|
+
id: modelId,
|
1413
|
+
pml: pml,
|
1414
|
+
comment: comment,
|
1415
|
+
},
|
1416
|
+
})
|
1417
|
+
.pipe(map(result => {
|
1418
|
+
if (result.successful) {
|
1419
|
+
return '';
|
1420
|
+
}
|
1421
|
+
else {
|
1422
|
+
throw new Error(result.message);
|
1423
|
+
}
|
1424
|
+
}), catchError(this.httpService.handleValidationError));
|
1425
|
+
}
|
1426
|
+
generateProducts(modelId) {
|
1427
|
+
return this.httpService.api({
|
1428
|
+
url: `${this.SERVICE_URL}/${modelId}/generate-products`,
|
1429
|
+
});
|
1430
|
+
}
|
1431
|
+
saveModel(productModel, comment) {
|
1432
|
+
const model = EntityUtil.clone(productModel);
|
1433
|
+
model.comment = comment;
|
1434
|
+
ModelTranslatorUtils.toServerModel(model);
|
1435
|
+
return this.httpService
|
1436
|
+
.api({
|
1437
|
+
method: 'put',
|
1438
|
+
url: `${this.SERVICE_URL}/${model.id}`,
|
1439
|
+
body: model,
|
1440
|
+
})
|
1441
|
+
.pipe(map(result => {
|
1442
|
+
if (result.successful) {
|
1443
|
+
return '';
|
1444
|
+
}
|
1445
|
+
else {
|
1446
|
+
throw new Error(result.message);
|
1447
|
+
}
|
1448
|
+
}), catchError(this.httpService.handleValidationError));
|
1449
|
+
}
|
1450
|
+
validateModel(productModel) {
|
1451
|
+
return this.httpService
|
1452
|
+
.api({
|
1453
|
+
method: 'post',
|
1454
|
+
url: `${this.SERVICE_URL}/validate`,
|
1455
|
+
body: productModel,
|
1456
|
+
errorHandler: this.httpService.handleValidationError,
|
1457
|
+
})
|
1458
|
+
.pipe(map(result => {
|
1459
|
+
if (result.successful) {
|
1460
|
+
return '';
|
1461
|
+
}
|
1462
|
+
else {
|
1463
|
+
throw new Error(result.message);
|
1464
|
+
}
|
1465
|
+
}));
|
1466
|
+
}
|
1467
|
+
renameModel(productModel, name) {
|
1468
|
+
const model = EntityUtil.clone(productModel);
|
1469
|
+
model.name = name;
|
1470
|
+
ModelTranslatorUtils.toServerModel(model);
|
1471
|
+
return this.httpService
|
1472
|
+
.api({
|
1473
|
+
method: 'patch',
|
1474
|
+
url: `${this.SERVICE_URL}/${model.id}`,
|
1475
|
+
body: model,
|
1476
|
+
})
|
1477
|
+
.pipe(catchError(this.httpService.handleValidationError));
|
1478
|
+
}
|
1479
|
+
uploadPmlFile(file, modelId) {
|
1480
|
+
const formData = new FormData();
|
1481
|
+
formData.append('file', file, file.name);
|
1482
|
+
return this.httpService.upload({
|
1483
|
+
url: `${this.SERVICE_URL}/${modelId}/pml/upload`,
|
1484
|
+
body: formData,
|
1485
|
+
});
|
1486
|
+
}
|
1487
|
+
runPml(modelId, pml, rootType, configurationMode) {
|
1488
|
+
return this.httpService.api({
|
1489
|
+
method: 'post',
|
1490
|
+
url: `${this.SERVICE_URL}/${modelId}/pml/run`,
|
1491
|
+
body: {
|
1492
|
+
pml,
|
1493
|
+
rootType,
|
1494
|
+
configurationMode,
|
1495
|
+
},
|
1496
|
+
responseType: 'text',
|
1497
|
+
});
|
1498
|
+
}
|
1499
|
+
evictAllCache() {
|
1500
|
+
return this.httpService.api({
|
1501
|
+
method: 'get',
|
1502
|
+
url: '/cache/evict/environment-variables',
|
1503
|
+
});
|
1504
|
+
}
|
1505
|
+
}
|
1506
|
+
ProductModelApiService.MAX_RESULTS = 200;
|
1507
|
+
ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1508
|
+
ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductModelApiService });
|
1509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductModelApiService, decorators: [{
|
1510
|
+
type: Injectable
|
1511
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1512
|
+
|
1513
|
+
class QuoteApiService {
|
1514
|
+
constructor(httpService) {
|
1515
|
+
this.httpService = httpService;
|
1516
|
+
this.SERVICE_URL = '/quotes';
|
1517
|
+
/**
|
1518
|
+
* @deprecated
|
1519
|
+
* Will be removed in next major release
|
1520
|
+
* Use `getQuoteDraft` instead
|
1521
|
+
*/
|
1522
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
1523
|
+
this.getQuote = this.getQuoteDraft;
|
1524
|
+
}
|
1525
|
+
// request quoteId | accountId | opportunityId | orderId
|
1526
|
+
getQuoteDraft(objectId, params, errorHandler) {
|
1527
|
+
return this.httpService.api({
|
1528
|
+
method: 'get',
|
1529
|
+
url: `${this.SERVICE_URL}/${objectId}`,
|
1530
|
+
params,
|
1531
|
+
errorHandler,
|
1532
|
+
});
|
1533
|
+
}
|
1534
|
+
upsertQuote(request, options) {
|
1535
|
+
return this.httpService.api(Object.assign({ method: 'post', url: `${this.SERVICE_URL}`, body: request }, options));
|
1536
|
+
}
|
1537
|
+
submitQuote(request, options) {
|
1538
|
+
return this.httpService.api(Object.assign({ method: 'post', url: `${this.SERVICE_URL}/submit`, body: request }, options));
|
1539
|
+
}
|
1540
|
+
attachDocument(id, documentName, data) {
|
1541
|
+
const formData = new FormData();
|
1542
|
+
const blob = new Blob([data]);
|
1543
|
+
formData.append('file', blob, documentName);
|
1544
|
+
return this.httpService.upload({
|
1545
|
+
url: `${this.SERVICE_URL}/${id}/attach-document`,
|
1546
|
+
responseType: 'arraybuffer',
|
1547
|
+
method: 'post',
|
1548
|
+
body: formData,
|
1549
|
+
});
|
1550
|
+
}
|
1551
|
+
}
|
1552
|
+
QuoteApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1553
|
+
QuoteApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteApiService });
|
1554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteApiService, decorators: [{
|
1555
|
+
type: Injectable
|
1556
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1557
|
+
|
1558
|
+
class RampApiService {
|
1559
|
+
constructor(httpService) {
|
1560
|
+
this.httpService = httpService;
|
1561
|
+
this.SERVICE_URL = '/ramp';
|
1562
|
+
}
|
1563
|
+
next(request, options) {
|
1564
|
+
return this.httpService.api(Object.assign({ method: 'post', url: `${this.SERVICE_URL}/next`, body: request }, options));
|
1565
|
+
}
|
1566
|
+
renew(request, options) {
|
1567
|
+
return this.httpService.api(Object.assign({ method: 'post', url: `${this.SERVICE_URL}/renew`, body: request }, options));
|
1568
|
+
}
|
1569
|
+
}
|
1570
|
+
RampApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RampApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1571
|
+
RampApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RampApiService });
|
1572
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RampApiService, decorators: [{
|
1573
|
+
type: Injectable
|
1574
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1575
|
+
|
1576
|
+
class RuleGroupsApiService {
|
1577
|
+
constructor(baseHttpService) {
|
1578
|
+
this.baseHttpService = baseHttpService;
|
1579
|
+
this.serviceUrl = '/admin/rule-groups';
|
1580
|
+
this.fetchRuleGroups$ = () => {
|
1581
|
+
return this.searchRuleGroups$(new Expression(), 0, 100);
|
1582
|
+
};
|
1583
|
+
this.searchRuleGroups$ = (expression, skip, count) => {
|
1584
|
+
let params = new HttpParams();
|
1585
|
+
params = params.set('skip', '' + skip);
|
1586
|
+
params = params.set('count', '' + count);
|
1587
|
+
return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
|
1588
|
+
};
|
1589
|
+
this.createRuleGroup$ = (ruleGroup) => {
|
1590
|
+
return this.baseHttpService.api({
|
1591
|
+
url: `${this.serviceUrl}`,
|
1592
|
+
method: 'post',
|
1593
|
+
body: ruleGroup,
|
1594
|
+
});
|
1595
|
+
};
|
1596
|
+
this.updateRuleGroup$ = (ruleGroup) => {
|
1597
|
+
return this.baseHttpService.api({
|
1598
|
+
url: `${this.serviceUrl}/${ruleGroup.id}`,
|
1599
|
+
method: 'post',
|
1600
|
+
body: ruleGroup,
|
1601
|
+
});
|
1602
|
+
};
|
1603
|
+
this.duplicateRuleGroup$ = (body) => {
|
1604
|
+
return this.baseHttpService
|
1605
|
+
.api({
|
1606
|
+
url: `${this.serviceUrl}/${body.id}/clone`,
|
1607
|
+
method: 'post',
|
1608
|
+
body,
|
1609
|
+
})
|
1610
|
+
.pipe(map$1(response => response.clonedRecordId));
|
1611
|
+
};
|
1612
|
+
this.removeRuleGroup$ = (id) => {
|
1613
|
+
return this.baseHttpService.api({
|
1614
|
+
url: `${this.serviceUrl}/${id}`,
|
1615
|
+
method: 'delete',
|
1616
|
+
});
|
1617
|
+
};
|
1618
|
+
this.restoreRuleGroup$ = (id) => {
|
1619
|
+
return this.baseHttpService.api({
|
1620
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
1621
|
+
method: 'patch',
|
1622
|
+
});
|
1623
|
+
};
|
1624
|
+
}
|
1625
|
+
}
|
1626
|
+
RuleGroupsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RuleGroupsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1627
|
+
RuleGroupsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RuleGroupsApiService });
|
1628
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RuleGroupsApiService, decorators: [{
|
1629
|
+
type: Injectable
|
1630
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1631
|
+
|
1632
|
+
class RulesApiService {
|
1633
|
+
constructor(baseHttpService) {
|
1634
|
+
this.baseHttpService = baseHttpService;
|
1635
|
+
this.serviceUrl = '/admin/rules';
|
1636
|
+
this.fetchRules$ = () => {
|
1637
|
+
return this.searchRules$(new Expression(), 0, 100);
|
1638
|
+
};
|
1639
|
+
this.searchRules$ = (expression, skip, count) => {
|
1640
|
+
let params = new HttpParams();
|
1641
|
+
params = params.set('skip', '' + skip);
|
1642
|
+
params = params.set('count', '' + count);
|
1643
|
+
return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
|
1644
|
+
};
|
1645
|
+
this.createRule$ = (rule) => {
|
1646
|
+
return this.baseHttpService.api({
|
1647
|
+
url: `${this.serviceUrl}`,
|
1648
|
+
method: 'post',
|
1649
|
+
body: rule,
|
1650
|
+
});
|
1651
|
+
};
|
1652
|
+
this.updateRule$ = (rule) => {
|
1653
|
+
return this.baseHttpService.api({
|
1654
|
+
url: `${this.serviceUrl}/${rule.id}`,
|
1655
|
+
method: 'put',
|
1656
|
+
body: rule,
|
1657
|
+
});
|
1658
|
+
};
|
1659
|
+
this.duplicateRule$ = (body) => {
|
1660
|
+
return this.baseHttpService
|
1661
|
+
.api({
|
1662
|
+
url: `${this.serviceUrl}/${body.id}/clone`,
|
1663
|
+
method: 'post',
|
1664
|
+
body,
|
1665
|
+
})
|
1666
|
+
.pipe(map(response => response.clonedRecordId));
|
1667
|
+
};
|
1668
|
+
this.removeRule$ = (id) => {
|
1669
|
+
return this.baseHttpService.api({
|
1670
|
+
url: `${this.serviceUrl}/${id}`,
|
1671
|
+
method: 'delete',
|
1672
|
+
});
|
1673
|
+
};
|
1674
|
+
this.restoreRule$ = (id) => {
|
1675
|
+
return this.baseHttpService.api({
|
1676
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
1677
|
+
method: 'patch',
|
1678
|
+
});
|
1679
|
+
};
|
1680
|
+
}
|
1681
|
+
fetchRule$(id) {
|
1682
|
+
return this.baseHttpService.api({
|
1683
|
+
url: `${this.serviceUrl}/${id}`,
|
1684
|
+
method: 'get',
|
1685
|
+
});
|
1686
|
+
}
|
1687
|
+
fetchHeaderFields$() {
|
1688
|
+
return this.baseHttpService.api({
|
1689
|
+
url: `${this.serviceUrl}/describe/Header`,
|
1690
|
+
method: 'get',
|
1691
|
+
});
|
1692
|
+
}
|
1693
|
+
execute$(body) {
|
1694
|
+
return this.baseHttpService.api({
|
1695
|
+
url: `/rules/execute`,
|
1696
|
+
method: 'post',
|
1697
|
+
body,
|
1698
|
+
});
|
1699
|
+
}
|
1700
|
+
}
|
1701
|
+
RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1702
|
+
RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RulesApiService });
|
1703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RulesApiService, decorators: [{
|
1704
|
+
type: Injectable
|
1705
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1706
|
+
|
1707
|
+
class ScriptsApiService {
|
1708
|
+
constructor(baseHttpService) {
|
1709
|
+
this.baseHttpService = baseHttpService;
|
1710
|
+
this.serviceUrl = '/admin/scripts';
|
1711
|
+
this.fetchScripts$ = () => {
|
1712
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}` });
|
1713
|
+
};
|
1714
|
+
this.searchScripts$ = (expression, skip, count) => {
|
1715
|
+
let params = new HttpParams();
|
1716
|
+
params = params.set('skip', '' + skip);
|
1717
|
+
params = params.set('count', '' + count);
|
1718
|
+
return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
|
1719
|
+
};
|
1720
|
+
this.fetchScript$ = (id) => {
|
1721
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
|
1722
|
+
};
|
1723
|
+
this.createScript$ = (script) => {
|
1724
|
+
return this.baseHttpService.api({
|
1725
|
+
url: `${this.serviceUrl}`,
|
1726
|
+
method: 'post',
|
1727
|
+
body: script,
|
1728
|
+
});
|
1729
|
+
};
|
1730
|
+
this.updateScriptMeta$ = (script) => {
|
1731
|
+
return this.baseHttpService.api({
|
1732
|
+
url: `${this.serviceUrl}/${script.id}`,
|
1733
|
+
method: 'put',
|
1734
|
+
body: script,
|
1735
|
+
});
|
1736
|
+
};
|
1737
|
+
this.updateScriptDetails$ = (script) => {
|
1738
|
+
return this.baseHttpService.api({
|
1739
|
+
url: `${this.serviceUrl}/${script.id}`,
|
1740
|
+
method: 'put',
|
1741
|
+
body: script,
|
1742
|
+
});
|
1743
|
+
};
|
1744
|
+
this.cloneScript$ = (cloneRequest) => {
|
1745
|
+
return this.baseHttpService.api({
|
1746
|
+
url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
|
1747
|
+
method: 'post',
|
1748
|
+
body: cloneRequest,
|
1749
|
+
});
|
1750
|
+
};
|
1751
|
+
this.removeScript$ = (id) => {
|
1752
|
+
return this.baseHttpService.api({
|
1753
|
+
url: `${this.serviceUrl}/${id}`,
|
1754
|
+
method: 'delete',
|
1755
|
+
});
|
1756
|
+
};
|
1757
|
+
this.restoreScript$ = (id) => {
|
1758
|
+
return this.baseHttpService.api({
|
1759
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
1760
|
+
method: 'patch',
|
1761
|
+
});
|
1762
|
+
};
|
1763
|
+
this.execute$ = (body) => {
|
1764
|
+
return this.baseHttpService.api({
|
1765
|
+
url: `/scripts/execute`,
|
1766
|
+
method: 'post',
|
1767
|
+
body,
|
1768
|
+
errorHandler: () => null,
|
1769
|
+
});
|
1770
|
+
};
|
1771
|
+
}
|
1772
|
+
}
|
1773
|
+
ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1774
|
+
ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ScriptsApiService });
|
1775
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ScriptsApiService, decorators: [{
|
1776
|
+
type: Injectable
|
1777
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1778
|
+
|
1779
|
+
const fromUIComponentStoryDTO = (dto, attachments) => {
|
1780
|
+
return {
|
1781
|
+
id: dto.id,
|
1782
|
+
name: dto.name,
|
1783
|
+
uiComponentId: dto.uiComponentId,
|
1784
|
+
description: dto.description,
|
1785
|
+
section: attachments.json,
|
1786
|
+
template: attachments.html,
|
1787
|
+
script: attachments.js,
|
1788
|
+
styles: attachments.css,
|
1789
|
+
};
|
1790
|
+
};
|
1791
|
+
|
1792
|
+
class UITemplatesApiService {
|
1793
|
+
constructor(baseHttpService) {
|
1794
|
+
this.baseHttpService = baseHttpService;
|
1795
|
+
this.serviceUrl = '/uitemplates';
|
1796
|
+
this.fetchTemplates$ = (name) => {
|
1797
|
+
let params = new HttpParams();
|
1798
|
+
if (name) {
|
1799
|
+
params = params.append('name', name);
|
1800
|
+
}
|
1801
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
|
1802
|
+
};
|
1803
|
+
this.createTemplate$ = (template) => {
|
1804
|
+
return this.baseHttpService.api({
|
1805
|
+
method: 'post',
|
1806
|
+
url: `${this.serviceUrl}`,
|
1807
|
+
body: template,
|
1808
|
+
});
|
1809
|
+
};
|
1810
|
+
this.updateTemplate$ = (template) => {
|
1811
|
+
return this.baseHttpService.api({
|
1812
|
+
method: 'put',
|
1813
|
+
url: `${this.serviceUrl}/${template.id}`,
|
1814
|
+
body: template,
|
1815
|
+
});
|
1816
|
+
};
|
1817
|
+
this.duplicateTemplate$ = (template, cloneRequest) => {
|
1818
|
+
return this.baseHttpService
|
1819
|
+
.api({
|
1820
|
+
url: `${this.serviceUrl}/${template.id}/clone`,
|
1821
|
+
method: 'post',
|
1822
|
+
body: cloneRequest,
|
1823
|
+
})
|
1824
|
+
.pipe(map$1(response => response.clonedRecordId));
|
1825
|
+
};
|
1826
|
+
this.removeTemplate$ = (id) => {
|
1827
|
+
return this.baseHttpService.api({
|
1828
|
+
method: 'delete',
|
1829
|
+
url: `${this.serviceUrl}/${id}`,
|
1830
|
+
});
|
1831
|
+
};
|
1832
|
+
this.restoreTemplate$ = (id) => {
|
1833
|
+
return this.baseHttpService.api({
|
1834
|
+
method: 'patch',
|
1835
|
+
url: `${this.serviceUrl}/${id}`,
|
1836
|
+
});
|
1837
|
+
};
|
1838
|
+
this.searchTemplates$ = (data) => {
|
1839
|
+
return this.baseHttpService.api({
|
1840
|
+
method: 'post',
|
1841
|
+
url: `${this.serviceUrl}/search`,
|
1842
|
+
params: data.params,
|
1843
|
+
body: data.expression,
|
1844
|
+
});
|
1845
|
+
};
|
1846
|
+
this.fetchComponents$ = (templateId, name) => {
|
1847
|
+
let params = new HttpParams();
|
1848
|
+
if (name) {
|
1849
|
+
params = params.append('name', name);
|
1850
|
+
}
|
1851
|
+
return this.baseHttpService.api({
|
1852
|
+
url: `${this.serviceUrl}/${templateId}/components`,
|
1853
|
+
params,
|
1854
|
+
});
|
1855
|
+
};
|
1856
|
+
this.fetchComponent$ = (templateId, componentId) => {
|
1857
|
+
return this.baseHttpService.api({
|
1858
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
|
1859
|
+
});
|
1860
|
+
};
|
1861
|
+
this.createComponent$ = (component) => {
|
1862
|
+
return this.baseHttpService.api({
|
1863
|
+
method: 'post',
|
1864
|
+
url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
|
1865
|
+
body: component,
|
1866
|
+
});
|
1867
|
+
};
|
1868
|
+
this.updateComponent$ = (component) => {
|
1869
|
+
return this.baseHttpService.api({
|
1870
|
+
method: 'put',
|
1871
|
+
url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
|
1872
|
+
body: component,
|
1873
|
+
});
|
1874
|
+
};
|
1875
|
+
this.duplicateComponent$ = (component, cloneRequest) => {
|
1876
|
+
return this.baseHttpService
|
1877
|
+
.api({
|
1878
|
+
url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
|
1879
|
+
method: 'post',
|
1880
|
+
body: cloneRequest,
|
1881
|
+
})
|
1882
|
+
.pipe(map$1(response => response.clonedRecordId));
|
1883
|
+
};
|
1884
|
+
this.removeComponent$ = (templateId, componentId) => {
|
1885
|
+
return this.baseHttpService.api({
|
1886
|
+
method: 'delete',
|
1887
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
|
1888
|
+
});
|
1889
|
+
};
|
1890
|
+
this.restoreComponent$ = (templateId, componentId) => {
|
1891
|
+
return this.baseHttpService.api({
|
1892
|
+
method: 'patch',
|
1893
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
|
1894
|
+
});
|
1895
|
+
};
|
1896
|
+
this.searchComponents$ = (templateId, data) => {
|
1897
|
+
return this.baseHttpService.api({
|
1898
|
+
method: 'post',
|
1899
|
+
url: `${this.serviceUrl}/${templateId}/components/search`,
|
1900
|
+
params: data.params,
|
1901
|
+
body: data.expression,
|
1902
|
+
});
|
1903
|
+
};
|
1904
|
+
this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
|
1905
|
+
return this.baseHttpService
|
1906
|
+
.api({
|
1907
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
|
1908
|
+
responseType: 'text',
|
1909
|
+
errorHandler: noop,
|
1910
|
+
})
|
1911
|
+
.pipe(catchError$1(() => of('')));
|
1912
|
+
};
|
1913
|
+
this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
|
1914
|
+
return forkJoin([
|
1915
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
|
1916
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
|
1917
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
|
1918
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
|
1919
|
+
]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
|
1920
|
+
};
|
1921
|
+
this.fetchStories$ = (templateId, componentId, name) => {
|
1922
|
+
let params = new HttpParams();
|
1923
|
+
if (name) {
|
1924
|
+
params = params.append('name', name);
|
1925
|
+
}
|
1926
|
+
return this.baseHttpService
|
1927
|
+
.api({
|
1928
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
|
1929
|
+
params,
|
1930
|
+
})
|
1931
|
+
.pipe(switchMap$1(dtos => {
|
1932
|
+
if (!dtos.length) {
|
1933
|
+
return of([]);
|
1934
|
+
}
|
1935
|
+
return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
|
1936
|
+
}));
|
1937
|
+
};
|
1938
|
+
this.fetchStory$ = (templateId, componentId, storyId) => {
|
1939
|
+
return this.baseHttpService
|
1940
|
+
.api({
|
1941
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
|
1942
|
+
})
|
1943
|
+
.pipe(switchMap$1(dto => this.convertToComponentStory$(templateId, componentId, dto)));
|
1944
|
+
};
|
1945
|
+
this.createComponentStory$ = (templateId, story) => {
|
1946
|
+
return this.baseHttpService.api({
|
1947
|
+
method: 'post',
|
1948
|
+
url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
|
1949
|
+
body: story,
|
1950
|
+
});
|
1951
|
+
};
|
1952
|
+
this.updateComponentStory$ = (templateId, story) => {
|
1953
|
+
const { script, template, styles, section } = story, rest = __rest(story, ["script", "template", "styles", "section"]);
|
1954
|
+
return this.baseHttpService
|
1955
|
+
.api({
|
1956
|
+
method: 'put',
|
1957
|
+
url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
|
1958
|
+
body: rest,
|
1959
|
+
})
|
1960
|
+
.pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
|
1961
|
+
};
|
1962
|
+
this.duplicateComponentStory$ = (story, cloneRequest) => {
|
1963
|
+
return this.baseHttpService
|
1964
|
+
.api({
|
1965
|
+
url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
|
1966
|
+
method: 'post',
|
1967
|
+
body: cloneRequest,
|
1968
|
+
})
|
1969
|
+
.pipe(map$1(response => response.clonedRecordId));
|
1970
|
+
};
|
1971
|
+
this.deleteComponentStory$ = (templateId, componentId, storyId) => {
|
1972
|
+
return this.baseHttpService.api({
|
1973
|
+
method: 'delete',
|
1974
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
|
1975
|
+
});
|
1976
|
+
};
|
1977
|
+
this.restoreComponentStory$ = (templateId, componentId, storyId) => {
|
1978
|
+
return this.baseHttpService.api({
|
1979
|
+
method: 'patch',
|
1980
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
|
1981
|
+
});
|
1982
|
+
};
|
1983
|
+
this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
|
1984
|
+
const formData = new FormData();
|
1985
|
+
if (attachments.html != null) {
|
1986
|
+
formData.append('html', new Blob([attachments.html]), 'story-template.html');
|
1987
|
+
}
|
1988
|
+
if (attachments.css != null) {
|
1989
|
+
formData.append('css', new Blob([attachments.css]), 'story-styles.css');
|
1990
|
+
}
|
1991
|
+
if (attachments.js != null) {
|
1992
|
+
formData.append('js', new Blob([attachments.js]), 'story-script.js');
|
1993
|
+
}
|
1994
|
+
if (attachments.json != null) {
|
1995
|
+
formData.append('json', new Blob([attachments.json]), 'story-section.json');
|
1996
|
+
}
|
1997
|
+
return this.baseHttpService.upload({
|
1998
|
+
method: 'post',
|
1999
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
|
2000
|
+
body: formData,
|
2001
|
+
});
|
2002
|
+
};
|
2003
|
+
this.fetchComponentAttachments$ = (templateId, component) => {
|
2004
|
+
return forkJoin([
|
2005
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
|
2006
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
|
2007
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
|
2008
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
|
2009
|
+
]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
|
2010
|
+
};
|
2011
|
+
this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
|
2012
|
+
return this.baseHttpService
|
2013
|
+
.api({
|
2014
|
+
method: 'get',
|
2015
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
|
2016
|
+
responseType: 'text',
|
2017
|
+
errorHandler: noop,
|
2018
|
+
})
|
2019
|
+
.pipe(catchError$1(() => of('')));
|
2020
|
+
};
|
2021
|
+
this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
|
2022
|
+
const formData = new FormData();
|
2023
|
+
if (attachments.html != null) {
|
2024
|
+
formData.append('html', new Blob([attachments.html]), 'template.html');
|
2025
|
+
}
|
2026
|
+
if (attachments.css != null) {
|
2027
|
+
formData.append('css', new Blob([attachments.css]), 'styles.css');
|
2028
|
+
}
|
2029
|
+
if (attachments.js != null) {
|
2030
|
+
formData.append('js', new Blob([attachments.js]), 'script.js');
|
2031
|
+
}
|
2032
|
+
if (attachments.json != null) {
|
2033
|
+
formData.append('json', new Blob([attachments.json]), 'section.json');
|
2034
|
+
}
|
2035
|
+
return this.baseHttpService.upload({
|
2036
|
+
method: 'post',
|
2037
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
|
2038
|
+
body: formData,
|
2039
|
+
});
|
2040
|
+
};
|
2041
|
+
}
|
2042
|
+
getTemplateThumbnailUrl(templateId) {
|
2043
|
+
return `${this.serviceUrl}/${templateId}/thumbnail/file`;
|
2044
|
+
}
|
2045
|
+
attachTemplateThumbnail$(templateId, file) {
|
2046
|
+
const data = new FormData();
|
2047
|
+
data.append('thumb', file);
|
2048
|
+
return this.baseHttpService.upload({
|
2049
|
+
method: 'post',
|
2050
|
+
url: `${this.serviceUrl}/${templateId}/thumbnail`,
|
2051
|
+
body: data,
|
2052
|
+
});
|
2053
|
+
}
|
2054
|
+
removeTemplateThumbnail$(templateId) {
|
2055
|
+
return this.baseHttpService.api({
|
2056
|
+
method: 'delete',
|
2057
|
+
url: `${this.serviceUrl}/${templateId}/thumbnail`,
|
2058
|
+
});
|
2059
|
+
}
|
2060
|
+
}
|
2061
|
+
UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
2062
|
+
UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UITemplatesApiService });
|
2063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: UITemplatesApiService, decorators: [{
|
2064
|
+
type: Injectable
|
2065
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
2066
|
+
|
2067
|
+
class ApiModule {
|
2068
|
+
}
|
2069
|
+
ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
2070
|
+
ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ApiModule, imports: [HttpClientModule] });
|
2071
|
+
ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ApiModule, providers: [
|
2072
|
+
BaseHttpService,
|
2073
|
+
XrayService,
|
2074
|
+
ConfigurationApiService,
|
2075
|
+
ConfigurationSettingsApiService,
|
2076
|
+
ContextApiService,
|
2077
|
+
DocumentAttachmentApiService,
|
2078
|
+
PriceApiService,
|
2079
|
+
ProductModelApiService,
|
2080
|
+
ProceduresApiService,
|
2081
|
+
QuoteApiService,
|
2082
|
+
DocumentTemplatesApiService,
|
2083
|
+
RampApiService,
|
2084
|
+
SalesforceApiService,
|
2085
|
+
UITemplatesApiService,
|
2086
|
+
ScriptsApiService,
|
2087
|
+
RulesApiService,
|
2088
|
+
RuleGroupsApiService,
|
2089
|
+
FlowsApiService,
|
2090
|
+
ProductApiService,
|
2091
|
+
CatalogAdminApiService,
|
2092
|
+
CatalogApiService,
|
2093
|
+
DeltaApiService,
|
2094
|
+
AccountApiService,
|
2095
|
+
PicklistsApiService,
|
2096
|
+
EndpointsApiService,
|
2097
|
+
OrgInfoApiService,
|
2098
|
+
], imports: [[HttpClientModule]] });
|
2099
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ApiModule, decorators: [{
|
2100
|
+
type: NgModule,
|
2101
|
+
args: [{
|
2102
|
+
imports: [HttpClientModule],
|
2103
|
+
providers: [
|
2104
|
+
BaseHttpService,
|
2105
|
+
XrayService,
|
2106
|
+
ConfigurationApiService,
|
2107
|
+
ConfigurationSettingsApiService,
|
2108
|
+
ContextApiService,
|
2109
|
+
DocumentAttachmentApiService,
|
2110
|
+
PriceApiService,
|
2111
|
+
ProductModelApiService,
|
2112
|
+
ProceduresApiService,
|
2113
|
+
QuoteApiService,
|
2114
|
+
DocumentTemplatesApiService,
|
2115
|
+
RampApiService,
|
2116
|
+
SalesforceApiService,
|
2117
|
+
UITemplatesApiService,
|
2118
|
+
ScriptsApiService,
|
2119
|
+
RulesApiService,
|
2120
|
+
RuleGroupsApiService,
|
2121
|
+
FlowsApiService,
|
2122
|
+
ProductApiService,
|
2123
|
+
CatalogAdminApiService,
|
2124
|
+
CatalogApiService,
|
2125
|
+
DeltaApiService,
|
2126
|
+
AccountApiService,
|
2127
|
+
PicklistsApiService,
|
2128
|
+
EndpointsApiService,
|
2129
|
+
OrgInfoApiService,
|
2130
|
+
],
|
2131
|
+
}]
|
2132
|
+
}] });
|
2133
|
+
|
2134
|
+
/**
|
2135
|
+
* Generated bundle index. Do not edit.
|
2136
|
+
*/
|
2137
|
+
|
2138
|
+
export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, QuoteApiService, RampApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, UITemplatesApiService };
|
2139
|
+
//# sourceMappingURL=veloceapps-api.js.map
|