@veloceapps/api 11.0.0-9 → 11.0.0-90
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/esm2020/index.mjs +2 -45
- package/esm2020/src/index.mjs +16 -0
- package/esm2020/src/lib/api.module.mjs +60 -0
- package/esm2020/src/lib/services/account-api.service.mjs +87 -0
- package/esm2020/src/lib/services/auth.service.mjs +22 -0
- package/esm2020/src/lib/services/contracted-price-api.service.mjs +45 -0
- package/esm2020/src/lib/services/flow-state-api.mjs +142 -0
- package/esm2020/src/lib/services/offers-api.service.mjs +76 -0
- package/esm2020/src/lib/services/org-info-api.service.mjs +54 -0
- package/esm2020/src/lib/services/portals-api.service.mjs +76 -0
- package/esm2020/src/lib/services/promotions-api.service.mjs +68 -0
- package/esm2020/src/lib/services/rebate-program-api.service.mjs +68 -0
- package/esm2020/src/lib/services/rebate-type-api.service.mjs +68 -0
- package/esm2020/src/lib/services/sandbox-manager-api.service.mjs +94 -0
- package/esm2020/src/lib/services/stateful-configuration-api.mjs +51 -0
- package/esm2020/src/lib/types/auth.types.mjs +2 -0
- package/esm2020/src/lib/types/clone-request.types.mjs +2 -0
- package/esm2020/src/lib/types/delta-request.types.mjs +2 -0
- package/esm2020/src/lib/types/dto/offers-dto.types.mjs +2 -0
- package/esm2020/src/lib/types/index.mjs +6 -0
- package/esm2020/src/lib/types/org-info.types.mjs +2 -0
- package/esm2020/src/lib/types/search-request.types.mjs +2 -0
- package/esm2020/src/lib/types/stateful-configuration.types.mjs +2 -0
- package/esm2020/src/lib/utils/canvas.utils.mjs +33 -0
- package/esm2020/src/lib/utils/index.mjs +2 -0
- package/esm2020/v2/api-v2.module.mjs +70 -0
- package/esm2020/v2/index.mjs +4 -0
- package/esm2020/v2/services/cache-api.service.mjs +22 -0
- package/esm2020/v2/services/catalog-admin-api.service.mjs +192 -0
- package/esm2020/v2/services/catalog-api.service.mjs +90 -0
- package/esm2020/v2/services/configuration-processors-api.service.mjs +38 -0
- package/esm2020/v2/services/configuration-settings-api.service.mjs +89 -0
- package/esm2020/v2/services/context-definition-admin-api.service.mjs +70 -0
- package/esm2020/v2/services/document-attachment-api.service.mjs +66 -0
- package/esm2020/v2/services/endpoints-admin-api.service.mjs +79 -0
- package/esm2020/v2/services/flows-api.service.mjs +29 -0
- package/esm2020/v2/services/functions-admin-api.service.mjs +116 -0
- package/esm2020/v2/services/guided-sellings-admin-api.service.mjs +65 -0
- package/esm2020/v2/services/guided-sellings-api.service.mjs +37 -0
- package/esm2020/v2/services/index.mjs +24 -0
- package/esm2020/v2/services/orchestrations-admin-api.service.mjs +87 -0
- package/esm2020/v2/services/orchestrations-api.service.mjs +23 -0
- package/esm2020/v2/services/pcm-api.service.mjs +38 -0
- package/esm2020/v2/services/picklists-admin-api.service.mjs +41 -0
- package/esm2020/v2/services/products-admin-api.service.mjs +90 -0
- package/esm2020/v2/services/sales-transactions-api.service.mjs +52 -0
- package/esm2020/v2/services/salesforce-api.service.mjs +83 -0
- package/esm2020/v2/services/shopping-cart-settings-api.service.mjs +28 -0
- package/esm2020/v2/services/ui-definitions-admin-api.service.mjs +68 -0
- package/esm2020/v2/services/ui-templates-admin-api.service.mjs +286 -0
- package/esm2020/v2/services/veloce-objects-api.service.mjs +90 -0
- package/esm2020/v2/types/attachment.types.mjs +2 -0
- package/esm2020/v2/types/clone-request.types.mjs +2 -0
- package/esm2020/v2/types/dto/configuration-settings-dto.types.mjs +22 -0
- package/esm2020/v2/types/dto/ui-definition-dto.types.mjs +2 -0
- package/esm2020/v2/types/dto/ui-template-dto.types.mjs +2 -0
- package/esm2020/v2/types/function.types.mjs +2 -0
- package/esm2020/v2/types/index.mjs +7 -0
- package/esm2020/v2/types/pcm.types.mjs +2 -0
- package/esm2020/v2/types/procedure.types.mjs +2 -0
- package/esm2020/v2/types/sales-transaction.types.mjs +2 -0
- package/esm2020/v2/types/search-request.types.mjs +2 -0
- package/esm2020/v2/utils/ui-definition.utils.mjs +23 -0
- package/esm2020/v2/utils/ui-template.utils.mjs +13 -0
- package/esm2020/v2/veloceapps-api-v2.mjs +5 -0
- package/esm2020/veloceapps-api.mjs +1 -1
- package/fesm2015/veloceapps-api-v2.mjs +1726 -0
- package/fesm2015/veloceapps-api-v2.mjs.map +1 -0
- package/fesm2015/veloceapps-api.mjs +553 -2892
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api-v2.mjs +1809 -0
- package/fesm2020/veloceapps-api-v2.mjs.map +1 -0
- package/fesm2020/veloceapps-api.mjs +552 -2993
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/index.d.ts +1 -44
- package/package.json +9 -1
- package/src/index.d.ts +15 -0
- package/{lib → src/lib}/api.module.d.ts +2 -1
- package/{lib → src/lib}/types/index.d.ts +0 -2
- package/{lib → src/lib}/types/stateful-configuration.types.d.ts +1 -2
- package/src/lib/utils/index.d.ts +1 -0
- package/v2/api-v2.module.d.ts +7 -0
- package/v2/index.d.ts +3 -0
- package/v2/services/cache-api.service.d.ts +11 -0
- package/{lib → v2}/services/catalog-admin-api.service.d.ts +2 -2
- package/{lib → v2}/services/catalog-api.service.d.ts +5 -5
- package/{lib → v2}/services/configuration-settings-api.service.d.ts +1 -2
- package/{lib/services/rlm-api.service.d.ts → v2/services/context-definition-admin-api.service.d.ts} +5 -4
- package/{lib → v2}/services/document-attachment-api.service.d.ts +1 -1
- package/{lib/services/endpoints-api.service.d.ts → v2/services/endpoints-admin-api.service.d.ts} +3 -4
- package/v2/services/functions-admin-api.service.d.ts +25 -0
- package/v2/services/index.d.ts +23 -0
- package/v2/services/orchestrations-admin-api.service.d.ts +21 -0
- package/v2/services/orchestrations-api.service.d.ts +12 -0
- package/v2/services/pcm-api.service.d.ts +12 -0
- package/{lib/services/picklists-api.service.d.ts → v2/services/picklists-admin-api.service.d.ts} +3 -3
- package/v2/services/products-admin-api.service.d.ts +21 -0
- package/v2/services/sales-transactions-api.service.d.ts +26 -0
- package/{lib → v2}/services/salesforce-api.service.d.ts +1 -0
- package/v2/services/ui-definitions-admin-api.service.d.ts +18 -0
- package/{lib/services/ui-templates-api.service.d.ts → v2/services/ui-templates-admin-api.service.d.ts} +3 -3
- package/{lib → v2}/services/veloce-objects-api.service.d.ts +3 -3
- package/v2/types/clone-request.types.d.ts +5 -0
- package/v2/types/dto/ui-definition-dto.types.d.ts +7 -0
- package/v2/types/function.types.d.ts +13 -0
- package/v2/types/index.d.ts +6 -0
- package/v2/types/pcm.types.d.ts +10 -0
- package/v2/types/procedure.types.d.ts +61 -0
- package/v2/types/sales-transaction.types.d.ts +13 -0
- package/v2/types/search-request.types.d.ts +8 -0
- package/v2/utils/ui-definition.utils.d.ts +5 -0
- package/esm2020/lib/api.module.mjs +0 -146
- package/esm2020/lib/services/account-api.service.mjs +0 -87
- package/esm2020/lib/services/auth.service.mjs +0 -22
- package/esm2020/lib/services/catalog-admin-api.service.mjs +0 -192
- package/esm2020/lib/services/catalog-api.service.mjs +0 -90
- package/esm2020/lib/services/configuration-api.service.mjs +0 -122
- package/esm2020/lib/services/configuration-processors-api.service.mjs +0 -38
- package/esm2020/lib/services/configuration-settings-api.service.mjs +0 -96
- package/esm2020/lib/services/context-api.service.mjs +0 -26
- package/esm2020/lib/services/contracted-price-api.service.mjs +0 -45
- package/esm2020/lib/services/delta-api.service.mjs +0 -23
- package/esm2020/lib/services/document-attachment-api.service.mjs +0 -66
- package/esm2020/lib/services/endpoints-api.service.mjs +0 -80
- package/esm2020/lib/services/flow-state-api.mjs +0 -142
- package/esm2020/lib/services/flows-api.service.mjs +0 -29
- package/esm2020/lib/services/guided-sellings-admin-api.service.mjs +0 -65
- package/esm2020/lib/services/guided-sellings-api.service.mjs +0 -37
- package/esm2020/lib/services/offers-api.service.mjs +0 -76
- package/esm2020/lib/services/org-info-api.service.mjs +0 -54
- package/esm2020/lib/services/picklists-api.service.mjs +0 -41
- package/esm2020/lib/services/portals-api.service.mjs +0 -76
- package/esm2020/lib/services/price-api.service.mjs +0 -63
- package/esm2020/lib/services/procedures-api.service.mjs +0 -113
- package/esm2020/lib/services/product-api.service.mjs +0 -153
- package/esm2020/lib/services/product-model-api.service.mjs +0 -223
- package/esm2020/lib/services/promotions-api.service.mjs +0 -68
- package/esm2020/lib/services/quote-api.service.mjs +0 -56
- package/esm2020/lib/services/ramp-api.service.mjs +0 -31
- package/esm2020/lib/services/rebate-program-api.service.mjs +0 -68
- package/esm2020/lib/services/rebate-type-api.service.mjs +0 -68
- package/esm2020/lib/services/rlm-api.service.mjs +0 -64
- package/esm2020/lib/services/rlm-quote-api.service.mjs +0 -27
- package/esm2020/lib/services/rule-groups-api.service.mjs +0 -62
- package/esm2020/lib/services/rules-api.service.mjs +0 -98
- package/esm2020/lib/services/salesforce-api.service.mjs +0 -79
- package/esm2020/lib/services/sandbox-manager-api.service.mjs +0 -94
- package/esm2020/lib/services/scripts-api.service.mjs +0 -83
- package/esm2020/lib/services/shopping-cart-settings-api.service.mjs +0 -28
- package/esm2020/lib/services/stateful-configuration-api.mjs +0 -51
- package/esm2020/lib/services/ui-definitions-api.service.mjs +0 -122
- package/esm2020/lib/services/ui-templates-api.service.mjs +0 -286
- package/esm2020/lib/services/veloce-objects-api.service.mjs +0 -90
- package/esm2020/lib/types/attachment.types.mjs +0 -2
- package/esm2020/lib/types/auth.types.mjs +0 -2
- package/esm2020/lib/types/clone-request.types.mjs +0 -2
- package/esm2020/lib/types/delta-request.types.mjs +0 -2
- package/esm2020/lib/types/dto/configuration-settings-dto.types.mjs +0 -22
- package/esm2020/lib/types/dto/offers-dto.types.mjs +0 -2
- package/esm2020/lib/types/dto/ui-template-dto.types.mjs +0 -2
- package/esm2020/lib/types/index.mjs +0 -8
- package/esm2020/lib/types/org-info.types.mjs +0 -2
- package/esm2020/lib/types/price.types.mjs +0 -2
- package/esm2020/lib/types/quote.types.mjs +0 -2
- package/esm2020/lib/types/ramp-request.types.mjs +0 -2
- package/esm2020/lib/types/search-request.types.mjs +0 -2
- package/esm2020/lib/types/stateful-configuration.types.mjs +0 -2
- package/esm2020/lib/utils/canvas.utils.mjs +0 -33
- package/esm2020/lib/utils/index.mjs +0 -3
- package/esm2020/lib/utils/ui-template.utils.mjs +0 -13
- package/lib/services/configuration-api.service.d.ts +0 -23
- package/lib/services/context-api.service.d.ts +0 -11
- package/lib/services/delta-api.service.d.ts +0 -12
- package/lib/services/price-api.service.d.ts +0 -16
- package/lib/services/procedures-api.service.d.ts +0 -30
- package/lib/services/product-api.service.d.ts +0 -31
- package/lib/services/product-model-api.service.d.ts +0 -29
- package/lib/services/quote-api.service.d.ts +0 -22
- package/lib/services/ramp-api.service.d.ts +0 -13
- package/lib/services/rlm-quote-api.service.d.ts +0 -11
- package/lib/services/rule-groups-api.service.d.ts +0 -18
- package/lib/services/rules-api.service.d.ts +0 -22
- package/lib/services/scripts-api.service.d.ts +0 -21
- package/lib/services/ui-definitions-api.service.d.ts +0 -21
- package/lib/types/price.types.d.ts +0 -5
- package/lib/types/quote.types.d.ts +0 -8
- package/lib/types/ramp-request.types.d.ts +0 -13
- package/lib/utils/index.d.ts +0 -2
- /package/{lib → src/lib}/services/account-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/auth.service.d.ts +0 -0
- /package/{lib → src/lib}/services/contracted-price-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/flow-state-api.d.ts +0 -0
- /package/{lib → src/lib}/services/offers-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/org-info-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/portals-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/promotions-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/rebate-program-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/rebate-type-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/sandbox-manager-api.service.d.ts +0 -0
- /package/{lib → src/lib}/services/stateful-configuration-api.d.ts +0 -0
- /package/{lib → src/lib}/types/auth.types.d.ts +0 -0
- /package/{lib → src/lib}/types/clone-request.types.d.ts +0 -0
- /package/{lib → src/lib}/types/delta-request.types.d.ts +0 -0
- /package/{lib → src/lib}/types/dto/offers-dto.types.d.ts +0 -0
- /package/{lib → src/lib}/types/org-info.types.d.ts +0 -0
- /package/{lib → src/lib}/types/search-request.types.d.ts +0 -0
- /package/{lib → src/lib}/utils/canvas.utils.d.ts +0 -0
- /package/{lib → v2}/services/configuration-processors-api.service.d.ts +0 -0
- /package/{lib → v2}/services/flows-api.service.d.ts +0 -0
- /package/{lib → v2}/services/guided-sellings-admin-api.service.d.ts +0 -0
- /package/{lib → v2}/services/guided-sellings-api.service.d.ts +0 -0
- /package/{lib → v2}/services/shopping-cart-settings-api.service.d.ts +0 -0
- /package/{lib → v2}/types/attachment.types.d.ts +0 -0
- /package/{lib → v2}/types/dto/configuration-settings-dto.types.d.ts +0 -0
- /package/{lib → v2}/types/dto/ui-template-dto.types.d.ts +0 -0
- /package/{lib → v2}/utils/ui-template.utils.d.ts +0 -0
@@ -0,0 +1,1809 @@
|
|
1
|
+
import { HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
|
2
|
+
import * as i0 from '@angular/core';
|
3
|
+
import { Injectable, NgModule } from '@angular/core';
|
4
|
+
import * as i1 from '@veloceapps/core';
|
5
|
+
import { Expression, Operator, parseJsonSafely, parseJsonStringAsObject, BaseHttpService, XrayService } from '@veloceapps/core';
|
6
|
+
import { noop, of, map as map$1, tap as tap$1, catchError as catchError$1, forkJoin, switchMap } from 'rxjs';
|
7
|
+
import { map, catchError, tap } from 'rxjs/operators';
|
8
|
+
import * as i2 from 'primeng/api';
|
9
|
+
|
10
|
+
class CacheApiService {
|
11
|
+
constructor(httpService) {
|
12
|
+
this.httpService = httpService;
|
13
|
+
this.SERVICE_URL = '/v2/cache/evict';
|
14
|
+
}
|
15
|
+
clear$(name, options) {
|
16
|
+
return this.httpService.api({
|
17
|
+
method: 'get',
|
18
|
+
url: `${this.SERVICE_URL}/` + name,
|
19
|
+
...options,
|
20
|
+
});
|
21
|
+
}
|
22
|
+
}
|
23
|
+
CacheApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CacheApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
24
|
+
CacheApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CacheApiService });
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CacheApiService, decorators: [{
|
26
|
+
type: Injectable
|
27
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
28
|
+
|
29
|
+
class CatalogAdminApiService {
|
30
|
+
constructor(baseHttpService) {
|
31
|
+
this.baseHttpService = baseHttpService;
|
32
|
+
this.serviceUrl = '/v2/catalogs';
|
33
|
+
this.fetchCatalogs$ = (searchParams) => {
|
34
|
+
const params = new HttpParams({ fromObject: { ...searchParams } });
|
35
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
|
36
|
+
};
|
37
|
+
this.searchCatalogs$ = (searchParams, expression) => {
|
38
|
+
const params = new HttpParams({ fromObject: { ...searchParams } });
|
39
|
+
return this.baseHttpService.api({
|
40
|
+
method: 'post',
|
41
|
+
url: `${this.serviceUrl}/search`,
|
42
|
+
params,
|
43
|
+
body: expression || {},
|
44
|
+
});
|
45
|
+
};
|
46
|
+
this.fetchCategories$ = (catalogId) => {
|
47
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories` });
|
48
|
+
};
|
49
|
+
this.searchProducts$ = (catalogId, categoryId) => {
|
50
|
+
return this.baseHttpService.api({
|
51
|
+
method: 'post',
|
52
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
|
53
|
+
body: {},
|
54
|
+
});
|
55
|
+
};
|
56
|
+
this.fetchAttributes$ = (catalogId, categoryId) => {
|
57
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes` });
|
58
|
+
};
|
59
|
+
this.createNewCatalog$ = (catalogData) => {
|
60
|
+
return this.baseHttpService.api({
|
61
|
+
url: `${this.serviceUrl}`,
|
62
|
+
method: 'post',
|
63
|
+
body: catalogData,
|
64
|
+
});
|
65
|
+
};
|
66
|
+
this.duplicateCatalog$ = (cloneRequest) => {
|
67
|
+
return this.baseHttpService.api({
|
68
|
+
url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
|
69
|
+
method: 'post',
|
70
|
+
body: cloneRequest,
|
71
|
+
});
|
72
|
+
};
|
73
|
+
this.updateCatalog$ = (data) => {
|
74
|
+
return this.baseHttpService.api({
|
75
|
+
url: `${this.serviceUrl}/${data.id}`,
|
76
|
+
method: 'put',
|
77
|
+
body: data,
|
78
|
+
});
|
79
|
+
};
|
80
|
+
this.removeCatalog$ = (id) => {
|
81
|
+
return this.baseHttpService.api({
|
82
|
+
url: `${this.serviceUrl}/${id}`,
|
83
|
+
method: 'delete',
|
84
|
+
});
|
85
|
+
};
|
86
|
+
this.restoreCatalog$ = (id) => {
|
87
|
+
return this.baseHttpService.api({
|
88
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
89
|
+
method: 'patch',
|
90
|
+
});
|
91
|
+
};
|
92
|
+
this.createNewCategory$ = (categoryData) => {
|
93
|
+
return this.baseHttpService.api({
|
94
|
+
url: `${this.serviceUrl}/${categoryData.catalogId}/categories`,
|
95
|
+
method: 'post',
|
96
|
+
body: categoryData,
|
97
|
+
});
|
98
|
+
};
|
99
|
+
this.updateCategory$ = (category) => {
|
100
|
+
return this.baseHttpService.api({
|
101
|
+
url: `${this.serviceUrl}/${category.catalogId}/categories/${category.id}`,
|
102
|
+
method: 'put',
|
103
|
+
body: category,
|
104
|
+
});
|
105
|
+
};
|
106
|
+
this.duplicateCategory$ = (catalogId, cloneRequest) => {
|
107
|
+
return this.baseHttpService.api({
|
108
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${cloneRequest.id}/clone`,
|
109
|
+
method: 'post',
|
110
|
+
body: cloneRequest,
|
111
|
+
});
|
112
|
+
};
|
113
|
+
this.removeCategory$ = (id, catalogId) => {
|
114
|
+
return this.baseHttpService.api({
|
115
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${id}`,
|
116
|
+
method: 'delete',
|
117
|
+
});
|
118
|
+
};
|
119
|
+
this.restoreCategory$ = (id, catalogId) => {
|
120
|
+
return this.baseHttpService.api({
|
121
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${id}/restore`,
|
122
|
+
method: 'patch',
|
123
|
+
});
|
124
|
+
};
|
125
|
+
this.removeAttribute$ = ({ catalogId, categoryId, data, }) => {
|
126
|
+
return this.baseHttpService.api({
|
127
|
+
method: 'delete',
|
128
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
|
129
|
+
body: data,
|
130
|
+
});
|
131
|
+
};
|
132
|
+
this.restoreAttribute$ = ({ catalogId, categoryId, data, }) => {
|
133
|
+
return this.baseHttpService.api({
|
134
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}/restore`,
|
135
|
+
method: 'patch',
|
136
|
+
});
|
137
|
+
};
|
138
|
+
this.createNewAttribute$ = ({ catalogId, categoryId, data, }) => {
|
139
|
+
return this.baseHttpService.api({
|
140
|
+
method: 'post',
|
141
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes`,
|
142
|
+
body: data,
|
143
|
+
});
|
144
|
+
};
|
145
|
+
this.updateAttribute$ = ({ catalogId, categoryId, data, }) => {
|
146
|
+
return this.baseHttpService.api({
|
147
|
+
method: 'put',
|
148
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
|
149
|
+
body: data,
|
150
|
+
});
|
151
|
+
};
|
152
|
+
this.searchProductCandidates$ = (catalogId, categoryId, expression, searchParams) => {
|
153
|
+
const params = new HttpParams({ fromObject: { ...searchParams } });
|
154
|
+
return this.baseHttpService.api({
|
155
|
+
method: 'post',
|
156
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/candidates/search`,
|
157
|
+
params,
|
158
|
+
body: expression,
|
159
|
+
});
|
160
|
+
};
|
161
|
+
this.addProduct$ = (product, catalogId, categoryId) => {
|
162
|
+
return this.baseHttpService.api({
|
163
|
+
method: 'post',
|
164
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
|
165
|
+
body: product,
|
166
|
+
});
|
167
|
+
};
|
168
|
+
this.updateProduct$ = (product, catalogId, categoryId) => {
|
169
|
+
return this.baseHttpService.api({
|
170
|
+
method: 'put',
|
171
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/${product.id}`,
|
172
|
+
body: product,
|
173
|
+
});
|
174
|
+
};
|
175
|
+
this.removeProduct$ = ({ catalogId, categoryId, data, }) => {
|
176
|
+
return this.baseHttpService.api({
|
177
|
+
method: 'delete',
|
178
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/${data.id}`,
|
179
|
+
});
|
180
|
+
};
|
181
|
+
}
|
182
|
+
attachImage$(catalogId, categoryId, file) {
|
183
|
+
const data = new FormData();
|
184
|
+
data.append('image', file);
|
185
|
+
return this.baseHttpService.upload({
|
186
|
+
method: 'post',
|
187
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
|
188
|
+
body: data,
|
189
|
+
});
|
190
|
+
}
|
191
|
+
removeImage$(catalogId, categoryId) {
|
192
|
+
return this.baseHttpService.api({
|
193
|
+
method: 'delete',
|
194
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
|
195
|
+
});
|
196
|
+
}
|
197
|
+
fetchImage$(catalogId, categoryId) {
|
198
|
+
return this.baseHttpService.api({
|
199
|
+
url: this.getImageUrl(catalogId, categoryId),
|
200
|
+
method: 'get',
|
201
|
+
responseType: 'blob',
|
202
|
+
errorHandler: noop,
|
203
|
+
});
|
204
|
+
}
|
205
|
+
getImageUrl(catalogId, categoryId) {
|
206
|
+
return `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`;
|
207
|
+
}
|
208
|
+
}
|
209
|
+
CatalogAdminApiService.MAX_RESULTS = 60;
|
210
|
+
CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
211
|
+
CatalogAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService });
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, decorators: [{
|
213
|
+
type: Injectable
|
214
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
215
|
+
|
216
|
+
class CatalogApiService {
|
217
|
+
constructor(service) {
|
218
|
+
this.service = service;
|
219
|
+
this.serviceUrl = '/v2/product-catalogs';
|
220
|
+
}
|
221
|
+
fetchCatalogs$() {
|
222
|
+
return this.service.api({
|
223
|
+
method: 'get',
|
224
|
+
url: `${this.serviceUrl}`,
|
225
|
+
});
|
226
|
+
}
|
227
|
+
searchCatalogs$(searchParams, expression) {
|
228
|
+
const params = new HttpParams({ fromObject: searchParams });
|
229
|
+
return this.service.api({
|
230
|
+
method: 'post',
|
231
|
+
url: `${this.serviceUrl}/search`,
|
232
|
+
params,
|
233
|
+
body: expression,
|
234
|
+
});
|
235
|
+
}
|
236
|
+
getCatalog$(id) {
|
237
|
+
return this.service.api({
|
238
|
+
method: 'get',
|
239
|
+
url: `${this.serviceUrl}/${id}`,
|
240
|
+
});
|
241
|
+
}
|
242
|
+
fetchCategories$(catalogId) {
|
243
|
+
return this.service.api({
|
244
|
+
method: 'get',
|
245
|
+
url: `${this.serviceUrl}/${catalogId}/categories`,
|
246
|
+
});
|
247
|
+
}
|
248
|
+
fetchCatalogProducts$(catalogId, searchParams, context) {
|
249
|
+
const params = new HttpParams({ fromObject: searchParams });
|
250
|
+
return this.service.api({
|
251
|
+
method: 'post',
|
252
|
+
url: `${this.serviceUrl}/${catalogId}/products`,
|
253
|
+
params,
|
254
|
+
body: context,
|
255
|
+
});
|
256
|
+
}
|
257
|
+
fetchCategoryProducts$(catalogId, categoryId, searchParams, context) {
|
258
|
+
const params = new HttpParams({ fromObject: searchParams });
|
259
|
+
return this.service.api({
|
260
|
+
method: 'post',
|
261
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
|
262
|
+
params,
|
263
|
+
body: context,
|
264
|
+
});
|
265
|
+
}
|
266
|
+
searchCategoryProducts$(catalogId, categoryId, searchParams, searchRequest, context) {
|
267
|
+
const params = new HttpParams({ fromObject: searchParams });
|
268
|
+
return this.service.api({
|
269
|
+
method: 'post',
|
270
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
|
271
|
+
params,
|
272
|
+
body: {
|
273
|
+
configurationContext: context,
|
274
|
+
request: searchRequest,
|
275
|
+
},
|
276
|
+
});
|
277
|
+
}
|
278
|
+
fetchEligibleProducts$(searchParams, context) {
|
279
|
+
const params = new HttpParams({ fromObject: searchParams });
|
280
|
+
return this.service.api({
|
281
|
+
method: 'post',
|
282
|
+
url: `${this.serviceUrl}/products`,
|
283
|
+
params: params,
|
284
|
+
body: context,
|
285
|
+
});
|
286
|
+
}
|
287
|
+
fetchProducts$(searchParams) {
|
288
|
+
const params = new HttpParams({ fromObject: searchParams });
|
289
|
+
return this.service.api({
|
290
|
+
method: 'get',
|
291
|
+
url: `${this.serviceUrl}/products`,
|
292
|
+
params: params,
|
293
|
+
});
|
294
|
+
}
|
295
|
+
}
|
296
|
+
CatalogApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
297
|
+
CatalogApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService });
|
298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, decorators: [{
|
299
|
+
type: Injectable
|
300
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
301
|
+
|
302
|
+
class ConfigurationProcessorsApiService {
|
303
|
+
constructor(baseHttpService) {
|
304
|
+
this.baseHttpService = baseHttpService;
|
305
|
+
this.serviceUrl = '/v2/configuration/processors/owners';
|
306
|
+
this.fetchConfigurationProcessors$ = (ownerId) => {
|
307
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
|
308
|
+
};
|
309
|
+
this.createConfigurationProcessors$ = (configurationProcessor) => {
|
310
|
+
return this.baseHttpService.api({
|
311
|
+
method: 'post',
|
312
|
+
url: `${this.serviceUrl}/${configurationProcessor.ownerId}`,
|
313
|
+
body: configurationProcessor,
|
314
|
+
});
|
315
|
+
};
|
316
|
+
this.updateConfigurationProcessors$ = (configurationProcessor) => {
|
317
|
+
return this.baseHttpService.api({
|
318
|
+
method: 'put',
|
319
|
+
url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
|
320
|
+
body: configurationProcessor,
|
321
|
+
});
|
322
|
+
};
|
323
|
+
this.deleteConfigurationProcessors$ = (configurationProcessor) => {
|
324
|
+
return this.baseHttpService.api({
|
325
|
+
method: 'delete',
|
326
|
+
url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
|
327
|
+
});
|
328
|
+
};
|
329
|
+
}
|
330
|
+
}
|
331
|
+
ConfigurationProcessorsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
332
|
+
ConfigurationProcessorsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService });
|
333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, decorators: [{
|
334
|
+
type: Injectable
|
335
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
336
|
+
|
337
|
+
class ConfigurationSettingsDTO {
|
338
|
+
static fromDTO(dto, key) {
|
339
|
+
return {
|
340
|
+
id: dto?.id,
|
341
|
+
key: dto?.key || key || '',
|
342
|
+
value: dto?.value,
|
343
|
+
};
|
344
|
+
}
|
345
|
+
static toDTO(data) {
|
346
|
+
return {
|
347
|
+
id: data.id,
|
348
|
+
key: data.key,
|
349
|
+
value: data.value,
|
350
|
+
};
|
351
|
+
}
|
352
|
+
constructor(id, key, value) {
|
353
|
+
this.id = id;
|
354
|
+
this.key = key;
|
355
|
+
this.value = value;
|
356
|
+
}
|
357
|
+
}
|
358
|
+
|
359
|
+
class ConfigurationSettingsApiService {
|
360
|
+
constructor(httpService, messageService) {
|
361
|
+
this.httpService = httpService;
|
362
|
+
this.messageService = messageService;
|
363
|
+
this.SERVICE_URL = '/v2/settings';
|
364
|
+
}
|
365
|
+
fetchSettings(options) {
|
366
|
+
return this.httpService
|
367
|
+
.api({
|
368
|
+
url: `${this.SERVICE_URL}`,
|
369
|
+
method: 'get',
|
370
|
+
...options,
|
371
|
+
})
|
372
|
+
.pipe(map((settings) => settings.map(setting => ConfigurationSettingsDTO.fromDTO(setting))));
|
373
|
+
}
|
374
|
+
fetchSetting(settingsKey, options) {
|
375
|
+
return this.httpService
|
376
|
+
.api({
|
377
|
+
url: `${this.SERVICE_URL}/byKey/${settingsKey}`,
|
378
|
+
method: 'get',
|
379
|
+
...options,
|
380
|
+
skipErrorHandler: true,
|
381
|
+
})
|
382
|
+
.pipe(map((setting) => ConfigurationSettingsDTO.fromDTO(setting, settingsKey)), catchError(err => {
|
383
|
+
if (err instanceof HttpErrorResponse && err.status === 404) {
|
384
|
+
if (!options?.skipErrorHandler) {
|
385
|
+
this.messageService.add({
|
386
|
+
severity: 'error',
|
387
|
+
summary: `Configuration Setting "${settingsKey}" is not found`,
|
388
|
+
sticky: true,
|
389
|
+
});
|
390
|
+
}
|
391
|
+
return of(null);
|
392
|
+
}
|
393
|
+
throw err;
|
394
|
+
}));
|
395
|
+
}
|
396
|
+
createSetting(setting, options) {
|
397
|
+
const request = ConfigurationSettingsDTO.toDTO(setting);
|
398
|
+
return this.httpService.api({
|
399
|
+
url: `${this.SERVICE_URL}`,
|
400
|
+
method: 'post',
|
401
|
+
body: {
|
402
|
+
...request,
|
403
|
+
},
|
404
|
+
...options,
|
405
|
+
});
|
406
|
+
}
|
407
|
+
updateSetting(setting, options) {
|
408
|
+
const request = ConfigurationSettingsDTO.toDTO(setting);
|
409
|
+
return this.httpService.api({
|
410
|
+
url: `${this.SERVICE_URL}/${request.id}`,
|
411
|
+
method: 'put',
|
412
|
+
body: {
|
413
|
+
...request,
|
414
|
+
},
|
415
|
+
...options,
|
416
|
+
});
|
417
|
+
}
|
418
|
+
removeSetting(setting, options) {
|
419
|
+
const request = ConfigurationSettingsDTO.toDTO(setting);
|
420
|
+
return this.httpService.api({
|
421
|
+
url: `${this.SERVICE_URL}/${request.id}`,
|
422
|
+
method: 'delete',
|
423
|
+
...options,
|
424
|
+
});
|
425
|
+
}
|
426
|
+
restoreSetting(settingId, options) {
|
427
|
+
return this.httpService.api({
|
428
|
+
url: `${this.SERVICE_URL}/${settingId}/restore`,
|
429
|
+
method: 'patch',
|
430
|
+
...options,
|
431
|
+
});
|
432
|
+
}
|
433
|
+
}
|
434
|
+
ConfigurationSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, deps: [{ token: i1.BaseHttpService }, { token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
435
|
+
ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
|
436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
|
437
|
+
type: Injectable
|
438
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i2.MessageService }]; } });
|
439
|
+
|
440
|
+
class ContextDefinitionAdminApiService {
|
441
|
+
constructor(baseHttpService) {
|
442
|
+
this.baseHttpService = baseHttpService;
|
443
|
+
this.serviceUrl = '/admin/v2/context-definition';
|
444
|
+
}
|
445
|
+
fetchContextDefinitions$() {
|
446
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}`, skipErrorHandler: true }).pipe(catchError(() => {
|
447
|
+
return of([]);
|
448
|
+
}));
|
449
|
+
}
|
450
|
+
fetchContextMappings$(id) {
|
451
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}/mappings` });
|
452
|
+
}
|
453
|
+
fetchContextMappingsDetails$(id) {
|
454
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}/mappings/details` });
|
455
|
+
}
|
456
|
+
fetchContextDefinitionStructure$(id) {
|
457
|
+
return this.baseHttpService
|
458
|
+
.api({
|
459
|
+
url: `${this.serviceUrl}/${id}/structure/details`,
|
460
|
+
skipErrorHandler: true,
|
461
|
+
})
|
462
|
+
.pipe(catchError(() => {
|
463
|
+
return of([]);
|
464
|
+
}), map(objects => {
|
465
|
+
return objects.map(object => {
|
466
|
+
const tag = object.tags?.[0]?.title;
|
467
|
+
const objectAttributes = object.attributes || [];
|
468
|
+
return {
|
469
|
+
id: object.id,
|
470
|
+
title: tag || object.title,
|
471
|
+
parentNodeId: object.parentNodeId,
|
472
|
+
nodeTags: (object.tags ?? []).map(nodeTag => nodeTag.title),
|
473
|
+
attributes: objectAttributes.reduce((result, attribute) => {
|
474
|
+
const tag = attribute.tags?.[0]?.title;
|
475
|
+
if (tag) {
|
476
|
+
result.push({
|
477
|
+
title: tag,
|
478
|
+
fieldType: attribute.fieldType,
|
479
|
+
dataType: attribute.dataType,
|
480
|
+
});
|
481
|
+
}
|
482
|
+
return result;
|
483
|
+
}, []),
|
484
|
+
};
|
485
|
+
});
|
486
|
+
}));
|
487
|
+
}
|
488
|
+
fetchRlmProcedures(contextDefinitionId) {
|
489
|
+
const params = {};
|
490
|
+
if (contextDefinitionId) {
|
491
|
+
params['contextDefinitionId'] = contextDefinitionId;
|
492
|
+
}
|
493
|
+
return this.baseHttpService.api({
|
494
|
+
url: `${this.serviceUrl}/procedures`,
|
495
|
+
params,
|
496
|
+
});
|
497
|
+
}
|
498
|
+
}
|
499
|
+
ContextDefinitionAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
500
|
+
ContextDefinitionAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService });
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, decorators: [{
|
502
|
+
type: Injectable
|
503
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
504
|
+
|
505
|
+
class DocumentAttachmentApiService {
|
506
|
+
constructor(httpService, fileDownloadService) {
|
507
|
+
this.httpService = httpService;
|
508
|
+
this.fileDownloadService = fileDownloadService;
|
509
|
+
this.SERVICE_URL = '/v2/attachments';
|
510
|
+
}
|
511
|
+
getAttachments(searchRequest) {
|
512
|
+
return this.httpService.api({
|
513
|
+
url: `${this.SERVICE_URL}/search`,
|
514
|
+
method: 'post',
|
515
|
+
body: searchRequest,
|
516
|
+
});
|
517
|
+
}
|
518
|
+
createAttachment(attachment, file, reportProgress) {
|
519
|
+
const formData = new FormData();
|
520
|
+
if (file) {
|
521
|
+
formData.append('file', file, file.name);
|
522
|
+
}
|
523
|
+
formData.append('attachment', new Blob([JSON.stringify(attachment)], {
|
524
|
+
type: 'application/json',
|
525
|
+
}));
|
526
|
+
return this.httpService.upload({
|
527
|
+
url: `${this.SERVICE_URL}`,
|
528
|
+
body: formData,
|
529
|
+
method: 'post',
|
530
|
+
observe: reportProgress ? 'events' : undefined,
|
531
|
+
reportProgress,
|
532
|
+
});
|
533
|
+
}
|
534
|
+
updateAttachment(id, attachment) {
|
535
|
+
return this.httpService.api({
|
536
|
+
url: `${this.SERVICE_URL}/${id}`,
|
537
|
+
body: attachment,
|
538
|
+
method: 'put',
|
539
|
+
});
|
540
|
+
}
|
541
|
+
getAttachmentFile(id, isPreventDownload) {
|
542
|
+
return this.httpService
|
543
|
+
.api({
|
544
|
+
url: `${this.SERVICE_URL}/${id}/file`,
|
545
|
+
responseType: isPreventDownload ? 'arraybuffer' : 'blob',
|
546
|
+
observe: isPreventDownload ? 'body' : 'response',
|
547
|
+
})
|
548
|
+
.pipe(tap(response => {
|
549
|
+
if (!isPreventDownload) {
|
550
|
+
this.fileDownloadService.processDownload(response);
|
551
|
+
}
|
552
|
+
}), map(response => (isPreventDownload ? new Blob([response.body || response]) : response.body || response)));
|
553
|
+
}
|
554
|
+
removeAttachment(id) {
|
555
|
+
return this.httpService.api({
|
556
|
+
url: `${this.SERVICE_URL}/${id}`,
|
557
|
+
method: 'delete',
|
558
|
+
});
|
559
|
+
}
|
560
|
+
}
|
561
|
+
DocumentAttachmentApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, deps: [{ token: i1.BaseHttpService }, { token: i1.FileDownloadService }], target: i0.ɵɵFactoryTarget.Injectable });
|
562
|
+
DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService });
|
563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
|
564
|
+
type: Injectable
|
565
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
|
566
|
+
|
567
|
+
class EndpointsAdminApiService {
|
568
|
+
constructor(baseHttpService) {
|
569
|
+
this.baseHttpService = baseHttpService;
|
570
|
+
this.serviceUrl = '/admin/v2/api-endpoints';
|
571
|
+
}
|
572
|
+
fetchEndpoints$() {
|
573
|
+
return this.searchEndpoints$(new Expression(), 0, -1);
|
574
|
+
}
|
575
|
+
searchEndpoints$(expression, skip, count) {
|
576
|
+
let params = new HttpParams();
|
577
|
+
params = params.set('skip', '' + skip);
|
578
|
+
params = params.set('count', '' + count);
|
579
|
+
return this.baseHttpService.api({
|
580
|
+
method: 'post',
|
581
|
+
url: `${this.serviceUrl}/search`,
|
582
|
+
params,
|
583
|
+
body: expression,
|
584
|
+
});
|
585
|
+
}
|
586
|
+
removeEndpoint$(id) {
|
587
|
+
return this.baseHttpService.api({
|
588
|
+
url: `${this.serviceUrl}/${id}`,
|
589
|
+
method: 'delete',
|
590
|
+
});
|
591
|
+
}
|
592
|
+
restoreEndpoint$(id) {
|
593
|
+
return this.baseHttpService.api({
|
594
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
595
|
+
method: 'patch',
|
596
|
+
});
|
597
|
+
}
|
598
|
+
fetchEndpoint$(id) {
|
599
|
+
return this.baseHttpService.api({
|
600
|
+
url: `${this.serviceUrl}/${id}`,
|
601
|
+
method: 'get',
|
602
|
+
});
|
603
|
+
}
|
604
|
+
createEndpoint$(body) {
|
605
|
+
return this.baseHttpService.api({
|
606
|
+
url: `${this.serviceUrl}`,
|
607
|
+
method: 'post',
|
608
|
+
body,
|
609
|
+
});
|
610
|
+
}
|
611
|
+
updateEndpoint$(body) {
|
612
|
+
return this.baseHttpService.api({
|
613
|
+
url: `${this.serviceUrl}/${body.id}`,
|
614
|
+
method: 'put',
|
615
|
+
body,
|
616
|
+
});
|
617
|
+
}
|
618
|
+
duplicateEndpoint$(cloneRequest) {
|
619
|
+
return this.baseHttpService.api({
|
620
|
+
url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
|
621
|
+
method: 'post',
|
622
|
+
body: cloneRequest,
|
623
|
+
});
|
624
|
+
}
|
625
|
+
executeEndpoint$(body) {
|
626
|
+
return this.baseHttpService.api({
|
627
|
+
url: `${this.serviceUrl}/execute`,
|
628
|
+
method: 'post',
|
629
|
+
body,
|
630
|
+
responseType: 'text',
|
631
|
+
skipErrorHandler: true,
|
632
|
+
});
|
633
|
+
}
|
634
|
+
}
|
635
|
+
EndpointsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
636
|
+
EndpointsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService });
|
637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, decorators: [{
|
638
|
+
type: Injectable
|
639
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
640
|
+
|
641
|
+
class FlowsApiService {
|
642
|
+
constructor(configurationSettingsApiService) {
|
643
|
+
this.configurationSettingsApiService = configurationSettingsApiService;
|
644
|
+
this.flowsKey = 'flows';
|
645
|
+
}
|
646
|
+
getFlow(id) {
|
647
|
+
return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
|
648
|
+
if (!flow) {
|
649
|
+
throw new Error(`Flow with flowId=${id} is not defined`);
|
650
|
+
}
|
651
|
+
return flow;
|
652
|
+
}));
|
653
|
+
}
|
654
|
+
fetchFlows() {
|
655
|
+
return this.configurationSettingsApiService
|
656
|
+
.fetchSetting(this.flowsKey)
|
657
|
+
.pipe(map((setting) => (setting?.value ? JSON.parse(setting.value) : [])));
|
658
|
+
}
|
659
|
+
}
|
660
|
+
FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
661
|
+
FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
|
662
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
|
663
|
+
type: Injectable
|
664
|
+
}], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
|
665
|
+
|
666
|
+
class FunctionsAdminApiService {
|
667
|
+
constructor(baseHttpService) {
|
668
|
+
this.baseHttpService = baseHttpService;
|
669
|
+
this.serviceUrl = '/admin/v2/functions';
|
670
|
+
this.fetchAll$ = () => {
|
671
|
+
return this.search$(new Expression(), 0, 100);
|
672
|
+
};
|
673
|
+
this.search$ = (expression, skip, count) => {
|
674
|
+
let params = new HttpParams();
|
675
|
+
if (typeof skip === 'number') {
|
676
|
+
params = params.set('skip', '' + skip);
|
677
|
+
}
|
678
|
+
if (typeof count === 'number') {
|
679
|
+
params = params.set('count', '' + count);
|
680
|
+
}
|
681
|
+
return this.baseHttpService.api({
|
682
|
+
method: 'post',
|
683
|
+
url: `${this.serviceUrl}/rules/search`,
|
684
|
+
params,
|
685
|
+
body: expression,
|
686
|
+
});
|
687
|
+
};
|
688
|
+
this.create$ = (rule) => {
|
689
|
+
return this.baseHttpService.api({
|
690
|
+
url: `${this.serviceUrl}/rules`,
|
691
|
+
method: 'post',
|
692
|
+
body: rule,
|
693
|
+
});
|
694
|
+
};
|
695
|
+
this.update$ = (rule) => {
|
696
|
+
return this.baseHttpService.api({
|
697
|
+
url: `${this.serviceUrl}/rules/${rule.id}`,
|
698
|
+
method: 'put',
|
699
|
+
body: rule,
|
700
|
+
});
|
701
|
+
};
|
702
|
+
this.duplicate$ = (body) => {
|
703
|
+
return this.baseHttpService
|
704
|
+
.api({
|
705
|
+
url: `${this.serviceUrl}/rules/${body.id}/clone`,
|
706
|
+
method: 'post',
|
707
|
+
body,
|
708
|
+
})
|
709
|
+
.pipe(map$1(response => response.clonedRecordId));
|
710
|
+
};
|
711
|
+
this.remove$ = (id) => {
|
712
|
+
return this.baseHttpService.api({
|
713
|
+
url: `${this.serviceUrl}/rules/${id}`,
|
714
|
+
method: 'delete',
|
715
|
+
});
|
716
|
+
};
|
717
|
+
this.restore$ = (id) => {
|
718
|
+
return this.baseHttpService.api({
|
719
|
+
url: `${this.serviceUrl}/rules/${id}/restore`,
|
720
|
+
method: 'patch',
|
721
|
+
});
|
722
|
+
};
|
723
|
+
}
|
724
|
+
fetch$(id) {
|
725
|
+
return this.baseHttpService.api({
|
726
|
+
url: `${this.serviceUrl}/rules/${id}`,
|
727
|
+
method: 'get',
|
728
|
+
});
|
729
|
+
}
|
730
|
+
fetchHeaderFields$() {
|
731
|
+
return this.baseHttpService.api({
|
732
|
+
url: `${this.serviceUrl}/rules/describe/Header`,
|
733
|
+
method: 'get',
|
734
|
+
});
|
735
|
+
}
|
736
|
+
execute$(body) {
|
737
|
+
const url = `${this.serviceUrl}/rules/execute`;
|
738
|
+
return this.baseHttpService.api({
|
739
|
+
url,
|
740
|
+
method: 'post',
|
741
|
+
body,
|
742
|
+
});
|
743
|
+
}
|
744
|
+
executeExtractFunction$(body) {
|
745
|
+
return this.baseHttpService.api({
|
746
|
+
url: `${this.serviceUrl}/extract`,
|
747
|
+
method: 'post',
|
748
|
+
body,
|
749
|
+
});
|
750
|
+
}
|
751
|
+
fetchFunctionDatasets$() {
|
752
|
+
return this.baseHttpService.api({
|
753
|
+
url: `${this.serviceUrl}/datasets`,
|
754
|
+
method: 'get',
|
755
|
+
});
|
756
|
+
}
|
757
|
+
fetchFunctionTags$() {
|
758
|
+
return this.baseHttpService.api({
|
759
|
+
url: `${this.serviceUrl}/tags`,
|
760
|
+
method: 'get',
|
761
|
+
});
|
762
|
+
}
|
763
|
+
fetchObjectParentIdFields$(objectName) {
|
764
|
+
return this.baseHttpService.api({
|
765
|
+
url: `${this.serviceUrl}/parent-id-fields/${objectName}`,
|
766
|
+
method: 'get',
|
767
|
+
});
|
768
|
+
}
|
769
|
+
}
|
770
|
+
FunctionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
771
|
+
FunctionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService });
|
772
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, decorators: [{
|
773
|
+
type: Injectable
|
774
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
775
|
+
|
776
|
+
class GuidedSellingsAdminApiService {
|
777
|
+
constructor(baseHttpService) {
|
778
|
+
this.baseHttpService = baseHttpService;
|
779
|
+
this.serviceUrl = '/admin/v2/guided-selling';
|
780
|
+
this.fetchGuidedSellings$ = (searchParams) => {
|
781
|
+
return this.searchGuidedSellings$(searchParams);
|
782
|
+
};
|
783
|
+
this.searchGuidedSellings$ = (searchParams, expression) => {
|
784
|
+
const params = new HttpParams({ fromObject: { ...searchParams } });
|
785
|
+
return this.baseHttpService.api({
|
786
|
+
method: 'post',
|
787
|
+
url: `${this.serviceUrl}/search`,
|
788
|
+
params,
|
789
|
+
body: expression || {},
|
790
|
+
});
|
791
|
+
};
|
792
|
+
this.fetchGuidedSelling$ = (id) => {
|
793
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
|
794
|
+
};
|
795
|
+
this.createNewGuidedSelling$ = (guidedSelling) => {
|
796
|
+
return this.baseHttpService.api({
|
797
|
+
url: `${this.serviceUrl}`,
|
798
|
+
method: 'post',
|
799
|
+
body: guidedSelling,
|
800
|
+
});
|
801
|
+
};
|
802
|
+
this.duplicateGuidedSelling$ = (cloneRequest) => {
|
803
|
+
return this.baseHttpService.api({
|
804
|
+
url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
|
805
|
+
method: 'post',
|
806
|
+
body: cloneRequest,
|
807
|
+
});
|
808
|
+
};
|
809
|
+
this.updateGuidedSelling$ = (data) => {
|
810
|
+
return this.baseHttpService.api({
|
811
|
+
url: `${this.serviceUrl}/${data.id}`,
|
812
|
+
method: 'put',
|
813
|
+
body: data,
|
814
|
+
});
|
815
|
+
};
|
816
|
+
this.removeGuidedSelling$ = (id) => {
|
817
|
+
return this.baseHttpService.api({
|
818
|
+
url: `${this.serviceUrl}/${id}`,
|
819
|
+
method: 'delete',
|
820
|
+
});
|
821
|
+
};
|
822
|
+
this.restoreGuidedSelling$ = (id) => {
|
823
|
+
return this.baseHttpService.api({
|
824
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
825
|
+
method: 'patch',
|
826
|
+
});
|
827
|
+
};
|
828
|
+
}
|
829
|
+
}
|
830
|
+
GuidedSellingsAdminApiService.MAX_RESULTS = 60;
|
831
|
+
GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
832
|
+
GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService });
|
833
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
|
834
|
+
type: Injectable
|
835
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
836
|
+
|
837
|
+
class GuidedSellingApiService {
|
838
|
+
constructor(http) {
|
839
|
+
this.http = http;
|
840
|
+
this.serviceUrl = '/v2/guided-selling';
|
841
|
+
}
|
842
|
+
searchByName$(name, searchParams) {
|
843
|
+
const params = new HttpParams({ fromObject: { ...searchParams } });
|
844
|
+
const expression = new Expression(undefined, [{ key: 'name', operator: Operator.EQ, value: name }]);
|
845
|
+
return this.http.api({
|
846
|
+
method: 'post',
|
847
|
+
url: `${this.serviceUrl}/search`,
|
848
|
+
params,
|
849
|
+
body: expression || {},
|
850
|
+
});
|
851
|
+
}
|
852
|
+
searchById$(id, searchParams) {
|
853
|
+
const params = new HttpParams({ fromObject: { ...searchParams } });
|
854
|
+
const expression = new Expression(undefined, [{ key: 'id', operator: Operator.EQ, value: id }]);
|
855
|
+
return this.http.api({
|
856
|
+
method: 'post',
|
857
|
+
url: `${this.serviceUrl}/search`,
|
858
|
+
params,
|
859
|
+
body: expression || {},
|
860
|
+
});
|
861
|
+
}
|
862
|
+
}
|
863
|
+
GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
864
|
+
GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService });
|
865
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, decorators: [{
|
866
|
+
type: Injectable
|
867
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
868
|
+
|
869
|
+
class OrchestrationsAdminApiService {
|
870
|
+
constructor(baseHttpService) {
|
871
|
+
this.baseHttpService = baseHttpService;
|
872
|
+
this.SERVICE_URL = '/admin/v2/orchestrations';
|
873
|
+
this.fetchAll$ = () => {
|
874
|
+
return this.search$(new Expression(), 0, 100);
|
875
|
+
};
|
876
|
+
this.search$ = (expression, skip, count) => {
|
877
|
+
let params = new HttpParams();
|
878
|
+
params = params.set('skip', '' + skip);
|
879
|
+
params = params.set('count', '' + count);
|
880
|
+
return this.baseHttpService.api({
|
881
|
+
method: 'post',
|
882
|
+
url: `${this.SERVICE_URL}/search`,
|
883
|
+
params,
|
884
|
+
body: expression,
|
885
|
+
});
|
886
|
+
};
|
887
|
+
this.create$ = (newProcedure) => {
|
888
|
+
return this.baseHttpService.api({
|
889
|
+
url: `${this.SERVICE_URL}`,
|
890
|
+
method: 'post',
|
891
|
+
body: newProcedure,
|
892
|
+
});
|
893
|
+
};
|
894
|
+
this.update$ = (procedure) => {
|
895
|
+
return this.baseHttpService.api({
|
896
|
+
url: `${this.SERVICE_URL}/${procedure.id}`,
|
897
|
+
method: 'put',
|
898
|
+
body: procedure,
|
899
|
+
});
|
900
|
+
};
|
901
|
+
this.duplicate$ = (body) => {
|
902
|
+
return this.baseHttpService
|
903
|
+
.api({
|
904
|
+
url: `${this.SERVICE_URL}/${body.id}/clone`,
|
905
|
+
method: 'post',
|
906
|
+
body,
|
907
|
+
})
|
908
|
+
.pipe(map$1(response => response.clonedRecordId));
|
909
|
+
};
|
910
|
+
this.remove$ = (id) => {
|
911
|
+
return this.baseHttpService.api({
|
912
|
+
url: `${this.SERVICE_URL}/${id}`,
|
913
|
+
method: 'delete',
|
914
|
+
});
|
915
|
+
};
|
916
|
+
this.restore$ = (id) => {
|
917
|
+
return this.baseHttpService.api({
|
918
|
+
url: `${this.SERVICE_URL}/${id}/restore`,
|
919
|
+
method: 'patch',
|
920
|
+
});
|
921
|
+
};
|
922
|
+
}
|
923
|
+
fetch$(id) {
|
924
|
+
return this.baseHttpService.api({
|
925
|
+
url: `${this.SERVICE_URL}/${id}`,
|
926
|
+
method: 'get',
|
927
|
+
});
|
928
|
+
}
|
929
|
+
execute$(body) {
|
930
|
+
return this.baseHttpService.api({
|
931
|
+
url: `${this.SERVICE_URL}/execute`,
|
932
|
+
method: 'post',
|
933
|
+
body,
|
934
|
+
});
|
935
|
+
}
|
936
|
+
catalogExecute$(body) {
|
937
|
+
return this.baseHttpService.api({
|
938
|
+
url: `${this.SERVICE_URL}/catalog/execute`,
|
939
|
+
method: 'post',
|
940
|
+
body,
|
941
|
+
});
|
942
|
+
}
|
943
|
+
}
|
944
|
+
OrchestrationsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
945
|
+
OrchestrationsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService });
|
946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, decorators: [{
|
947
|
+
type: Injectable
|
948
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
949
|
+
|
950
|
+
class OrchestrationsApiService {
|
951
|
+
constructor(baseHttpService) {
|
952
|
+
this.baseHttpService = baseHttpService;
|
953
|
+
this.SERVICE_URL = '/v2/orchestrations';
|
954
|
+
}
|
955
|
+
apply$(request, options) {
|
956
|
+
return this.baseHttpService.api({
|
957
|
+
url: `${this.SERVICE_URL}/apply`,
|
958
|
+
method: 'post',
|
959
|
+
body: request,
|
960
|
+
...options,
|
961
|
+
});
|
962
|
+
}
|
963
|
+
}
|
964
|
+
OrchestrationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
965
|
+
OrchestrationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService });
|
966
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, decorators: [{
|
967
|
+
type: Injectable
|
968
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
969
|
+
|
970
|
+
class SalesforceApiService {
|
971
|
+
constructor(httpService) {
|
972
|
+
this.httpService = httpService;
|
973
|
+
this.SERVICE_URL = '/v2/proxy';
|
974
|
+
}
|
975
|
+
query(searchRequest, objectName, options) {
|
976
|
+
return this.httpService.api({
|
977
|
+
method: 'post',
|
978
|
+
body: { ...searchRequest, count: searchRequest.count || 100 },
|
979
|
+
url: `${this.SERVICE_URL}/query/${objectName}`,
|
980
|
+
...options,
|
981
|
+
});
|
982
|
+
}
|
983
|
+
queryObjects(search, options) {
|
984
|
+
let params = new HttpParams();
|
985
|
+
if (search) {
|
986
|
+
params = params.append('search', search);
|
987
|
+
}
|
988
|
+
return this.httpService.api({
|
989
|
+
url: `${this.SERVICE_URL}/query`,
|
990
|
+
params,
|
991
|
+
...options,
|
992
|
+
});
|
993
|
+
}
|
994
|
+
search(req, options) {
|
995
|
+
return this.httpService.api({
|
996
|
+
url: `${this.SERVICE_URL}/rest/search`,
|
997
|
+
params: { q: req.searchString },
|
998
|
+
...options,
|
999
|
+
});
|
1000
|
+
}
|
1001
|
+
describeObject(objectName, options) {
|
1002
|
+
const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
|
1003
|
+
return this.httpService.api({ url: methodUrl, ...options });
|
1004
|
+
}
|
1005
|
+
describeField(objectName, fieldName, options) {
|
1006
|
+
const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
|
1007
|
+
return this.httpService.api({ url: methodUrl, ...options });
|
1008
|
+
}
|
1009
|
+
describe2(objectName, fields, options) {
|
1010
|
+
const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
|
1011
|
+
return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
|
1012
|
+
}
|
1013
|
+
apexGetRequest(path, params, options) {
|
1014
|
+
// this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
|
1015
|
+
const httpParams = new HttpParams({ fromString: params.toString() });
|
1016
|
+
return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams, ...options });
|
1017
|
+
}
|
1018
|
+
apexPostRequest(path, body, options) {
|
1019
|
+
return this.httpService.api({
|
1020
|
+
method: 'post',
|
1021
|
+
body,
|
1022
|
+
url: `${this.SERVICE_URL}/apex${path}`,
|
1023
|
+
...options,
|
1024
|
+
});
|
1025
|
+
}
|
1026
|
+
restGetRequest(path, params, options) {
|
1027
|
+
const httpParams = new HttpParams({ fromString: params.toString() });
|
1028
|
+
return this.httpService.api({ url: `${this.SERVICE_URL}/rest${path}`, params: httpParams, ...options });
|
1029
|
+
}
|
1030
|
+
getGlobalPicklists() {
|
1031
|
+
return this.httpService.api({
|
1032
|
+
method: 'get',
|
1033
|
+
url: `${this.SERVICE_URL}/globalvalueset`,
|
1034
|
+
});
|
1035
|
+
}
|
1036
|
+
getGlobalPicklistValues(id) {
|
1037
|
+
return this.httpService.api({
|
1038
|
+
method: 'get',
|
1039
|
+
url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
|
1040
|
+
});
|
1041
|
+
}
|
1042
|
+
}
|
1043
|
+
SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1044
|
+
SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
|
1045
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
|
1046
|
+
type: Injectable
|
1047
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1048
|
+
|
1049
|
+
class PCMApiService {
|
1050
|
+
constructor(sfApiService) {
|
1051
|
+
this.sfApiService = sfApiService;
|
1052
|
+
}
|
1053
|
+
fetchPCMByProductId(productId) {
|
1054
|
+
return this.sfApiService.restGetRequest(`/connect/pcm/products/${productId}`, new HttpParams()).pipe(tap$1(response => {
|
1055
|
+
if (response.status.code !== '200') {
|
1056
|
+
throw new Error(response.status.message);
|
1057
|
+
}
|
1058
|
+
}), map$1(response => {
|
1059
|
+
const pcm = response.products[0];
|
1060
|
+
if (!pcm) {
|
1061
|
+
throw new Error('PCM product is not found');
|
1062
|
+
}
|
1063
|
+
this.fixUrls(pcm);
|
1064
|
+
return pcm;
|
1065
|
+
}));
|
1066
|
+
}
|
1067
|
+
fixUrls(product) {
|
1068
|
+
if (product.displayUrl) {
|
1069
|
+
product.displayUrl = product.displayUrl.replaceAll('&', '&');
|
1070
|
+
}
|
1071
|
+
product.productComponentGroups.forEach(group => {
|
1072
|
+
group.components.forEach(component => this.fixUrls(component));
|
1073
|
+
});
|
1074
|
+
}
|
1075
|
+
}
|
1076
|
+
PCMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, deps: [{ token: SalesforceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1077
|
+
PCMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService });
|
1078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, decorators: [{
|
1079
|
+
type: Injectable
|
1080
|
+
}], ctorParameters: function () { return [{ type: SalesforceApiService }]; } });
|
1081
|
+
|
1082
|
+
class PicklistsAdminApiService {
|
1083
|
+
constructor(baseHttpService) {
|
1084
|
+
this.baseHttpService = baseHttpService;
|
1085
|
+
this.serviceUrl = '/admin/v2/picklists';
|
1086
|
+
this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}` });
|
1087
|
+
this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/${code}` });
|
1088
|
+
this.createPicklist$ = (picklist) => {
|
1089
|
+
return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}`, body: picklist });
|
1090
|
+
};
|
1091
|
+
this.updatePicklist$ = (picklist) => {
|
1092
|
+
return this.baseHttpService.api({
|
1093
|
+
method: 'put',
|
1094
|
+
url: `${this.serviceUrl}/${picklist.id}`,
|
1095
|
+
body: picklist,
|
1096
|
+
});
|
1097
|
+
};
|
1098
|
+
this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/${id}` });
|
1099
|
+
this.restorePicklist$ = (id) => {
|
1100
|
+
return this.baseHttpService.api({
|
1101
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
1102
|
+
method: 'patch',
|
1103
|
+
});
|
1104
|
+
};
|
1105
|
+
this.addPicklistValue$ = (picklist, value) => {
|
1106
|
+
const data = {
|
1107
|
+
...picklist,
|
1108
|
+
values: [...picklist.values, value],
|
1109
|
+
};
|
1110
|
+
return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/${picklist.id}`, body: data });
|
1111
|
+
};
|
1112
|
+
}
|
1113
|
+
}
|
1114
|
+
PicklistsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1115
|
+
PicklistsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService });
|
1116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, decorators: [{
|
1117
|
+
type: Injectable
|
1118
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1119
|
+
|
1120
|
+
class ProductsAdminApiService {
|
1121
|
+
constructor(baseHttpService) {
|
1122
|
+
this.baseHttpService = baseHttpService;
|
1123
|
+
this.serviceUrl = '/admin/v2/products';
|
1124
|
+
this.fetchProducts$ = (payload) => {
|
1125
|
+
let params = new HttpParams();
|
1126
|
+
params = params.append('count', payload.count);
|
1127
|
+
params = params.append('skip', payload.skip);
|
1128
|
+
if (payload.name) {
|
1129
|
+
params = params.append('name', payload.name);
|
1130
|
+
}
|
1131
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
|
1132
|
+
};
|
1133
|
+
this.searchProducts$ = (expression, skip, count) => {
|
1134
|
+
let params = new HttpParams();
|
1135
|
+
params = params.set('skip', '' + skip);
|
1136
|
+
params = params.set('count', '' + count);
|
1137
|
+
return this.baseHttpService.api({
|
1138
|
+
method: 'post',
|
1139
|
+
url: `${this.serviceUrl}/search`,
|
1140
|
+
params: params,
|
1141
|
+
body: expression,
|
1142
|
+
});
|
1143
|
+
};
|
1144
|
+
this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
|
1145
|
+
this.createNewProduct$ = (productData) => {
|
1146
|
+
return this.baseHttpService.api({
|
1147
|
+
url: `${this.serviceUrl}`,
|
1148
|
+
method: 'post',
|
1149
|
+
body: productData,
|
1150
|
+
});
|
1151
|
+
};
|
1152
|
+
this.updateProduct$ = (body) => {
|
1153
|
+
return this.baseHttpService.api({
|
1154
|
+
url: `${this.serviceUrl}/${body.id}`,
|
1155
|
+
method: 'put',
|
1156
|
+
body,
|
1157
|
+
});
|
1158
|
+
};
|
1159
|
+
this.removeProduct$ = (id) => {
|
1160
|
+
return this.baseHttpService.api({
|
1161
|
+
url: `${this.serviceUrl}/${id}`,
|
1162
|
+
method: 'delete',
|
1163
|
+
});
|
1164
|
+
};
|
1165
|
+
this.restoreProduct$ = (id) => {
|
1166
|
+
return this.baseHttpService.api({
|
1167
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
1168
|
+
method: 'patch',
|
1169
|
+
});
|
1170
|
+
};
|
1171
|
+
}
|
1172
|
+
attachImage$(productId, file) {
|
1173
|
+
const data = new FormData();
|
1174
|
+
data.append('image', file);
|
1175
|
+
return this.baseHttpService.upload({
|
1176
|
+
method: 'post',
|
1177
|
+
url: `${this.serviceUrl}/${productId}/image`,
|
1178
|
+
body: data,
|
1179
|
+
});
|
1180
|
+
}
|
1181
|
+
removeImage$(productId) {
|
1182
|
+
return this.baseHttpService.api({
|
1183
|
+
method: 'delete',
|
1184
|
+
url: `${this.serviceUrl}/${productId}/image`,
|
1185
|
+
});
|
1186
|
+
}
|
1187
|
+
fetchImage$(productId) {
|
1188
|
+
return this.baseHttpService.api({
|
1189
|
+
url: this.getImageUrl(productId),
|
1190
|
+
method: 'get',
|
1191
|
+
responseType: 'blob',
|
1192
|
+
errorHandler: noop,
|
1193
|
+
});
|
1194
|
+
}
|
1195
|
+
getImageUrl(productId) {
|
1196
|
+
return `${this.serviceUrl}/${productId}/image`;
|
1197
|
+
}
|
1198
|
+
}
|
1199
|
+
ProductsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1200
|
+
ProductsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService });
|
1201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, decorators: [{
|
1202
|
+
type: Injectable
|
1203
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1204
|
+
|
1205
|
+
class SalesTransactionApiService {
|
1206
|
+
constructor(httpService) {
|
1207
|
+
this.httpService = httpService;
|
1208
|
+
this.SERVICE_URL = '/v2/transactions';
|
1209
|
+
}
|
1210
|
+
/**
|
1211
|
+
* This endpoint doesn't include orders and assets
|
1212
|
+
* @param objectId SF record ID (quoteId | accountId | opportunityId | orderId etc)
|
1213
|
+
* @param params Query params
|
1214
|
+
* @param options Request options
|
1215
|
+
*/
|
1216
|
+
getState(objectId, params, options) {
|
1217
|
+
return this.httpService.api({
|
1218
|
+
method: 'get',
|
1219
|
+
url: `${this.SERVICE_URL}/${objectId}`,
|
1220
|
+
params: params,
|
1221
|
+
...options,
|
1222
|
+
});
|
1223
|
+
}
|
1224
|
+
/**
|
1225
|
+
* This endpoint doesn't include orders and assets
|
1226
|
+
* @param headerId SF record ID (quoteId | accountId | opportunityId | orderId etc)
|
1227
|
+
* @param params Query params
|
1228
|
+
* @param options Request options
|
1229
|
+
*/
|
1230
|
+
query(headerId, params, options) {
|
1231
|
+
return this.httpService.api({
|
1232
|
+
method: 'get',
|
1233
|
+
url: `${this.SERVICE_URL}/query/${headerId}`,
|
1234
|
+
params: params,
|
1235
|
+
...options,
|
1236
|
+
});
|
1237
|
+
}
|
1238
|
+
save(request, options) {
|
1239
|
+
return this.httpService.api({
|
1240
|
+
method: 'post',
|
1241
|
+
url: `${this.SERVICE_URL}/save/${request.transactionContext.salesTransaction.id}`,
|
1242
|
+
body: request,
|
1243
|
+
...options,
|
1244
|
+
responseType: 'text',
|
1245
|
+
});
|
1246
|
+
}
|
1247
|
+
}
|
1248
|
+
SalesTransactionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1249
|
+
SalesTransactionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService });
|
1250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, decorators: [{
|
1251
|
+
type: Injectable
|
1252
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1253
|
+
|
1254
|
+
class ShoppingCartSettingsApiService {
|
1255
|
+
constructor(configurationSettingsApiService) {
|
1256
|
+
this.configurationSettingsApiService = configurationSettingsApiService;
|
1257
|
+
this.shoppingCartSettingsKey = 'shopping-cart';
|
1258
|
+
}
|
1259
|
+
getSetting(id) {
|
1260
|
+
return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings?.value, [])), map(settings => settings.find(setting => setting.id == id)));
|
1261
|
+
}
|
1262
|
+
fetchSettings() {
|
1263
|
+
return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
|
1264
|
+
}
|
1265
|
+
getSettingsMap() {
|
1266
|
+
return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings?.value, [])), map((settings) => settings.reduce((acc, setting) => {
|
1267
|
+
return { ...acc, [setting.id]: setting.properties };
|
1268
|
+
}, {})));
|
1269
|
+
}
|
1270
|
+
}
|
1271
|
+
ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1272
|
+
ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
|
1273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
|
1274
|
+
type: Injectable
|
1275
|
+
}], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
|
1276
|
+
|
1277
|
+
function uiDefinitionFromDTO(container) {
|
1278
|
+
const { sourceBlob, ...rest } = container;
|
1279
|
+
return {
|
1280
|
+
...rest,
|
1281
|
+
source: parseJsonStringAsObject(sourceBlob),
|
1282
|
+
};
|
1283
|
+
}
|
1284
|
+
function uiDefinitionToDTO(container) {
|
1285
|
+
const { source, ...rest } = container;
|
1286
|
+
return {
|
1287
|
+
...rest,
|
1288
|
+
sourceBlob: JSON.stringify(source),
|
1289
|
+
};
|
1290
|
+
}
|
1291
|
+
function newUiDefinitionToDTO(container) {
|
1292
|
+
const { source, ...rest } = container;
|
1293
|
+
return {
|
1294
|
+
...rest,
|
1295
|
+
sourceBlob: JSON.stringify(source),
|
1296
|
+
};
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
class UIDefinitionsAdminApiService {
|
1300
|
+
constructor(baseHttpService) {
|
1301
|
+
this.baseHttpService = baseHttpService;
|
1302
|
+
this.serviceUrl = '/admin/v2/uidefinitions';
|
1303
|
+
}
|
1304
|
+
fetchAll$(params) {
|
1305
|
+
let httpParams = new HttpParams();
|
1306
|
+
if (params?.productId != null) {
|
1307
|
+
httpParams = httpParams.set('productId', params.productId);
|
1308
|
+
}
|
1309
|
+
if (params?.defaultUIDefinitionId != null) {
|
1310
|
+
httpParams = httpParams.set('defaultUIDefinitionId', params.defaultUIDefinitionId);
|
1311
|
+
}
|
1312
|
+
return this.baseHttpService
|
1313
|
+
.api({
|
1314
|
+
method: 'get',
|
1315
|
+
url: this.serviceUrl,
|
1316
|
+
params: httpParams,
|
1317
|
+
})
|
1318
|
+
.pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
|
1319
|
+
}
|
1320
|
+
fetch$(id) {
|
1321
|
+
return this.baseHttpService
|
1322
|
+
.api({
|
1323
|
+
method: 'get',
|
1324
|
+
url: `${this.serviceUrl}/${id}`,
|
1325
|
+
})
|
1326
|
+
.pipe(map$1(container => uiDefinitionFromDTO({ ...container, id })));
|
1327
|
+
}
|
1328
|
+
create$(uiDefinitionContainer) {
|
1329
|
+
const dto = newUiDefinitionToDTO(uiDefinitionContainer);
|
1330
|
+
return this.baseHttpService
|
1331
|
+
.api({
|
1332
|
+
method: 'post',
|
1333
|
+
url: this.serviceUrl,
|
1334
|
+
body: dto,
|
1335
|
+
})
|
1336
|
+
.pipe(map$1(container => uiDefinitionFromDTO(container)));
|
1337
|
+
}
|
1338
|
+
update$(uiDefinitionContainer) {
|
1339
|
+
const dto = uiDefinitionToDTO(uiDefinitionContainer);
|
1340
|
+
return this.baseHttpService
|
1341
|
+
.api({
|
1342
|
+
method: 'put',
|
1343
|
+
url: `${this.serviceUrl}/${uiDefinitionContainer.id}`,
|
1344
|
+
body: dto,
|
1345
|
+
})
|
1346
|
+
.pipe(map$1(container => uiDefinitionFromDTO(container)));
|
1347
|
+
}
|
1348
|
+
delete$(id) {
|
1349
|
+
return this.baseHttpService.api({
|
1350
|
+
method: 'delete',
|
1351
|
+
url: `${this.serviceUrl}/${id}`,
|
1352
|
+
});
|
1353
|
+
}
|
1354
|
+
}
|
1355
|
+
UIDefinitionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1356
|
+
UIDefinitionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService });
|
1357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, decorators: [{
|
1358
|
+
type: Injectable
|
1359
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1360
|
+
|
1361
|
+
const fromUIComponentStoryDTO = (dto, attachments) => {
|
1362
|
+
return {
|
1363
|
+
id: dto.id,
|
1364
|
+
name: dto.name,
|
1365
|
+
uiComponentId: dto.uiComponentId,
|
1366
|
+
description: dto.description,
|
1367
|
+
section: attachments.json,
|
1368
|
+
template: attachments.html,
|
1369
|
+
script: attachments.js,
|
1370
|
+
styles: attachments.css,
|
1371
|
+
};
|
1372
|
+
};
|
1373
|
+
|
1374
|
+
class UITemplatesAdminApiService {
|
1375
|
+
constructor(baseHttpService) {
|
1376
|
+
this.baseHttpService = baseHttpService;
|
1377
|
+
this.serviceUrl = '/admin/v2/uitemplates';
|
1378
|
+
this.fetchTemplates$ = (name) => {
|
1379
|
+
let params = new HttpParams();
|
1380
|
+
if (name) {
|
1381
|
+
params = params.append('name', name);
|
1382
|
+
}
|
1383
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
|
1384
|
+
};
|
1385
|
+
this.createTemplate$ = (template) => {
|
1386
|
+
return this.baseHttpService.api({
|
1387
|
+
method: 'post',
|
1388
|
+
url: `${this.serviceUrl}`,
|
1389
|
+
body: template,
|
1390
|
+
});
|
1391
|
+
};
|
1392
|
+
this.updateTemplate$ = (template) => {
|
1393
|
+
return this.baseHttpService.api({
|
1394
|
+
method: 'put',
|
1395
|
+
url: `${this.serviceUrl}/${template.id}`,
|
1396
|
+
body: template,
|
1397
|
+
});
|
1398
|
+
};
|
1399
|
+
this.duplicateTemplate$ = (template, cloneRequest) => {
|
1400
|
+
return this.baseHttpService
|
1401
|
+
.api({
|
1402
|
+
url: `${this.serviceUrl}/${template.id}/clone`,
|
1403
|
+
method: 'post',
|
1404
|
+
body: cloneRequest,
|
1405
|
+
})
|
1406
|
+
.pipe(map$1(response => response.clonedRecordId));
|
1407
|
+
};
|
1408
|
+
this.removeTemplate$ = (id) => {
|
1409
|
+
return this.baseHttpService.api({
|
1410
|
+
method: 'delete',
|
1411
|
+
url: `${this.serviceUrl}/${id}`,
|
1412
|
+
});
|
1413
|
+
};
|
1414
|
+
this.restoreTemplate$ = (id) => {
|
1415
|
+
return this.baseHttpService.api({
|
1416
|
+
method: 'patch',
|
1417
|
+
url: `${this.serviceUrl}/${id}`,
|
1418
|
+
});
|
1419
|
+
};
|
1420
|
+
this.searchTemplates$ = (data) => {
|
1421
|
+
return this.baseHttpService.api({
|
1422
|
+
method: 'post',
|
1423
|
+
url: `${this.serviceUrl}/search`,
|
1424
|
+
params: data.params,
|
1425
|
+
body: data.expression,
|
1426
|
+
});
|
1427
|
+
};
|
1428
|
+
this.fetchComponents$ = (templateId, name) => {
|
1429
|
+
let params = new HttpParams();
|
1430
|
+
if (name) {
|
1431
|
+
params = params.append('name', name);
|
1432
|
+
}
|
1433
|
+
return this.baseHttpService.api({
|
1434
|
+
url: `${this.serviceUrl}/${templateId}/components`,
|
1435
|
+
params,
|
1436
|
+
});
|
1437
|
+
};
|
1438
|
+
this.fetchComponent$ = (templateId, componentId) => {
|
1439
|
+
return this.baseHttpService.api({
|
1440
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
|
1441
|
+
});
|
1442
|
+
};
|
1443
|
+
this.createComponent$ = (component) => {
|
1444
|
+
return this.baseHttpService.api({
|
1445
|
+
method: 'post',
|
1446
|
+
url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
|
1447
|
+
body: component,
|
1448
|
+
});
|
1449
|
+
};
|
1450
|
+
this.updateComponent$ = (component) => {
|
1451
|
+
return this.baseHttpService.api({
|
1452
|
+
method: 'put',
|
1453
|
+
url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
|
1454
|
+
body: component,
|
1455
|
+
});
|
1456
|
+
};
|
1457
|
+
this.duplicateComponent$ = (component, cloneRequest) => {
|
1458
|
+
return this.baseHttpService
|
1459
|
+
.api({
|
1460
|
+
url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
|
1461
|
+
method: 'post',
|
1462
|
+
body: cloneRequest,
|
1463
|
+
})
|
1464
|
+
.pipe(map$1(response => response.clonedRecordId));
|
1465
|
+
};
|
1466
|
+
this.removeComponent$ = (templateId, componentId) => {
|
1467
|
+
return this.baseHttpService.api({
|
1468
|
+
method: 'delete',
|
1469
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
|
1470
|
+
});
|
1471
|
+
};
|
1472
|
+
this.restoreComponent$ = (templateId, componentId) => {
|
1473
|
+
return this.baseHttpService.api({
|
1474
|
+
method: 'patch',
|
1475
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
|
1476
|
+
});
|
1477
|
+
};
|
1478
|
+
this.searchComponents$ = (templateId, data) => {
|
1479
|
+
return this.baseHttpService.api({
|
1480
|
+
method: 'post',
|
1481
|
+
url: `${this.serviceUrl}/${templateId}/components/search`,
|
1482
|
+
params: data.params,
|
1483
|
+
body: data.expression,
|
1484
|
+
});
|
1485
|
+
};
|
1486
|
+
this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
|
1487
|
+
return this.baseHttpService
|
1488
|
+
.api({
|
1489
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
|
1490
|
+
responseType: 'text',
|
1491
|
+
errorHandler: noop,
|
1492
|
+
})
|
1493
|
+
.pipe(catchError$1(() => of('')));
|
1494
|
+
};
|
1495
|
+
this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
|
1496
|
+
return forkJoin([
|
1497
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
|
1498
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
|
1499
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
|
1500
|
+
this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
|
1501
|
+
]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
|
1502
|
+
};
|
1503
|
+
this.fetchStories$ = (templateId, componentId, name) => {
|
1504
|
+
let params = new HttpParams();
|
1505
|
+
if (name) {
|
1506
|
+
params = params.append('name', name);
|
1507
|
+
}
|
1508
|
+
return this.baseHttpService
|
1509
|
+
.api({
|
1510
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
|
1511
|
+
params,
|
1512
|
+
})
|
1513
|
+
.pipe(switchMap(dtos => {
|
1514
|
+
if (!dtos.length) {
|
1515
|
+
return of([]);
|
1516
|
+
}
|
1517
|
+
return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
|
1518
|
+
}));
|
1519
|
+
};
|
1520
|
+
this.fetchStory$ = (templateId, componentId, storyId) => {
|
1521
|
+
return this.baseHttpService
|
1522
|
+
.api({
|
1523
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
|
1524
|
+
})
|
1525
|
+
.pipe(switchMap(dto => this.convertToComponentStory$(templateId, componentId, dto)));
|
1526
|
+
};
|
1527
|
+
this.createComponentStory$ = (templateId, story) => {
|
1528
|
+
return this.baseHttpService.api({
|
1529
|
+
method: 'post',
|
1530
|
+
url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
|
1531
|
+
body: story,
|
1532
|
+
});
|
1533
|
+
};
|
1534
|
+
this.updateComponentStory$ = (templateId, story) => {
|
1535
|
+
const { script, template, styles, section, ...rest } = story;
|
1536
|
+
return this.baseHttpService
|
1537
|
+
.api({
|
1538
|
+
method: 'put',
|
1539
|
+
url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
|
1540
|
+
body: rest,
|
1541
|
+
})
|
1542
|
+
.pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
|
1543
|
+
};
|
1544
|
+
this.duplicateComponentStory$ = (story, cloneRequest) => {
|
1545
|
+
return this.baseHttpService
|
1546
|
+
.api({
|
1547
|
+
url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
|
1548
|
+
method: 'post',
|
1549
|
+
body: cloneRequest,
|
1550
|
+
})
|
1551
|
+
.pipe(map$1(response => response.clonedRecordId));
|
1552
|
+
};
|
1553
|
+
this.deleteComponentStory$ = (templateId, componentId, storyId) => {
|
1554
|
+
return this.baseHttpService.api({
|
1555
|
+
method: 'delete',
|
1556
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
|
1557
|
+
});
|
1558
|
+
};
|
1559
|
+
this.restoreComponentStory$ = (templateId, componentId, storyId) => {
|
1560
|
+
return this.baseHttpService.api({
|
1561
|
+
method: 'patch',
|
1562
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
|
1563
|
+
});
|
1564
|
+
};
|
1565
|
+
this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
|
1566
|
+
const formData = new FormData();
|
1567
|
+
if (attachments.html != null) {
|
1568
|
+
formData.append('html', new Blob([attachments.html]), 'story-template.html');
|
1569
|
+
}
|
1570
|
+
if (attachments.css != null) {
|
1571
|
+
formData.append('css', new Blob([attachments.css]), 'story-styles.css');
|
1572
|
+
}
|
1573
|
+
if (attachments.js != null) {
|
1574
|
+
formData.append('js', new Blob([attachments.js]), 'story-script.js');
|
1575
|
+
}
|
1576
|
+
if (attachments.json != null) {
|
1577
|
+
formData.append('json', new Blob([attachments.json]), 'story-section.json');
|
1578
|
+
}
|
1579
|
+
return this.baseHttpService.upload({
|
1580
|
+
method: 'post',
|
1581
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
|
1582
|
+
body: formData,
|
1583
|
+
});
|
1584
|
+
};
|
1585
|
+
this.fetchComponentAttachments$ = (templateId, component) => {
|
1586
|
+
return forkJoin([
|
1587
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
|
1588
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
|
1589
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
|
1590
|
+
this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
|
1591
|
+
]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
|
1592
|
+
};
|
1593
|
+
this.fetchComponentsAttachments$ = (templateId) => {
|
1594
|
+
return this.fetchComponents$(templateId).pipe(switchMap(components => {
|
1595
|
+
return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
|
1596
|
+
}));
|
1597
|
+
};
|
1598
|
+
this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
|
1599
|
+
return this.baseHttpService
|
1600
|
+
.api({
|
1601
|
+
method: 'get',
|
1602
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
|
1603
|
+
responseType: 'text',
|
1604
|
+
errorHandler: noop,
|
1605
|
+
})
|
1606
|
+
.pipe(catchError$1(() => of('')));
|
1607
|
+
};
|
1608
|
+
this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
|
1609
|
+
const formData = new FormData();
|
1610
|
+
if (attachments.html != null) {
|
1611
|
+
formData.append('html', new Blob([attachments.html]), 'template.html');
|
1612
|
+
}
|
1613
|
+
if (attachments.css != null) {
|
1614
|
+
formData.append('css', new Blob([attachments.css]), 'styles.css');
|
1615
|
+
}
|
1616
|
+
if (attachments.js != null) {
|
1617
|
+
formData.append('js', new Blob([attachments.js]), 'script.js');
|
1618
|
+
}
|
1619
|
+
if (attachments.json != null) {
|
1620
|
+
formData.append('json', new Blob([attachments.json]), 'section.json');
|
1621
|
+
}
|
1622
|
+
return this.baseHttpService.upload({
|
1623
|
+
method: 'post',
|
1624
|
+
url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
|
1625
|
+
body: formData,
|
1626
|
+
});
|
1627
|
+
};
|
1628
|
+
}
|
1629
|
+
getTemplateThumbnailUrl(templateId) {
|
1630
|
+
return `${this.serviceUrl}/${templateId}/thumbnail/file`;
|
1631
|
+
}
|
1632
|
+
attachTemplateThumbnail$(templateId, file) {
|
1633
|
+
const data = new FormData();
|
1634
|
+
data.append('thumb', file);
|
1635
|
+
return this.baseHttpService.upload({
|
1636
|
+
method: 'post',
|
1637
|
+
url: `${this.serviceUrl}/${templateId}/thumbnail`,
|
1638
|
+
body: data,
|
1639
|
+
});
|
1640
|
+
}
|
1641
|
+
removeTemplateThumbnail$(templateId) {
|
1642
|
+
return this.baseHttpService.api({
|
1643
|
+
method: 'delete',
|
1644
|
+
url: `${this.serviceUrl}/${templateId}/thumbnail`,
|
1645
|
+
});
|
1646
|
+
}
|
1647
|
+
}
|
1648
|
+
UITemplatesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1649
|
+
UITemplatesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService });
|
1650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, decorators: [{
|
1651
|
+
type: Injectable
|
1652
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1653
|
+
|
1654
|
+
class VeloceObjectsAdminApiService {
|
1655
|
+
constructor(baseHttpService) {
|
1656
|
+
this.baseHttpService = baseHttpService;
|
1657
|
+
this.serviceUrl = '/admin/v2/veloceobjects';
|
1658
|
+
this.updateCategory$ = (category) => {
|
1659
|
+
return this.baseHttpService.api({
|
1660
|
+
method: 'put',
|
1661
|
+
url: `${this.serviceUrl}/categories/${category.id}`,
|
1662
|
+
body: category,
|
1663
|
+
});
|
1664
|
+
};
|
1665
|
+
this.deleteCategory$ = (id) => {
|
1666
|
+
return this.baseHttpService.api({
|
1667
|
+
method: 'delete',
|
1668
|
+
url: `${this.serviceUrl}/categories/${id}`,
|
1669
|
+
});
|
1670
|
+
};
|
1671
|
+
this.searchObjects$ = (searchParams, expression) => {
|
1672
|
+
const params = new HttpParams({ fromObject: { ...searchParams } });
|
1673
|
+
return this.baseHttpService.api({
|
1674
|
+
method: 'post',
|
1675
|
+
url: `${this.serviceUrl}/search`,
|
1676
|
+
params,
|
1677
|
+
body: expression || {},
|
1678
|
+
});
|
1679
|
+
};
|
1680
|
+
this.deleteObject$ = (id) => {
|
1681
|
+
return this.baseHttpService.api({
|
1682
|
+
method: 'delete',
|
1683
|
+
url: `${this.serviceUrl}/${id}`,
|
1684
|
+
});
|
1685
|
+
};
|
1686
|
+
this.duplicateObject$ = (body) => {
|
1687
|
+
return this.baseHttpService
|
1688
|
+
.api({
|
1689
|
+
method: 'post',
|
1690
|
+
url: `${this.serviceUrl}/${body.id}/clone`,
|
1691
|
+
body,
|
1692
|
+
})
|
1693
|
+
.pipe(map(response => response.clonedRecordId));
|
1694
|
+
};
|
1695
|
+
this.restoreObject$ = (id) => {
|
1696
|
+
return this.baseHttpService.api({
|
1697
|
+
method: 'patch',
|
1698
|
+
url: `${this.serviceUrl}/${id}/restore`,
|
1699
|
+
});
|
1700
|
+
};
|
1701
|
+
}
|
1702
|
+
fetchCategories$() {
|
1703
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
|
1704
|
+
}
|
1705
|
+
createCategory$(category) {
|
1706
|
+
return this.baseHttpService.api({
|
1707
|
+
method: 'post',
|
1708
|
+
url: `${this.serviceUrl}/categories`,
|
1709
|
+
body: category,
|
1710
|
+
});
|
1711
|
+
}
|
1712
|
+
fetchObjects$() {
|
1713
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}` });
|
1714
|
+
}
|
1715
|
+
fetchObject$(id) {
|
1716
|
+
return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
|
1717
|
+
}
|
1718
|
+
createObject$(object) {
|
1719
|
+
return this.baseHttpService.api({
|
1720
|
+
method: 'post',
|
1721
|
+
url: `${this.serviceUrl}`,
|
1722
|
+
body: object,
|
1723
|
+
});
|
1724
|
+
}
|
1725
|
+
updateObject$(object) {
|
1726
|
+
return this.baseHttpService.api({
|
1727
|
+
method: 'put',
|
1728
|
+
url: `${this.serviceUrl}/${object.id}`,
|
1729
|
+
body: object,
|
1730
|
+
});
|
1731
|
+
}
|
1732
|
+
}
|
1733
|
+
VeloceObjectsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1734
|
+
VeloceObjectsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService });
|
1735
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, decorators: [{
|
1736
|
+
type: Injectable
|
1737
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1738
|
+
|
1739
|
+
class ApiV2Module {
|
1740
|
+
}
|
1741
|
+
ApiV2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1742
|
+
ApiV2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, imports: [HttpClientModule] });
|
1743
|
+
ApiV2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, providers: [
|
1744
|
+
BaseHttpService,
|
1745
|
+
CacheApiService,
|
1746
|
+
CatalogAdminApiService,
|
1747
|
+
CatalogApiService,
|
1748
|
+
ConfigurationProcessorsApiService,
|
1749
|
+
ConfigurationSettingsApiService,
|
1750
|
+
ContextDefinitionAdminApiService,
|
1751
|
+
DocumentAttachmentApiService,
|
1752
|
+
EndpointsAdminApiService,
|
1753
|
+
FlowsApiService,
|
1754
|
+
OrchestrationsAdminApiService,
|
1755
|
+
OrchestrationsApiService,
|
1756
|
+
PCMApiService,
|
1757
|
+
PicklistsAdminApiService,
|
1758
|
+
ProductsAdminApiService,
|
1759
|
+
FunctionsAdminApiService,
|
1760
|
+
GuidedSellingsAdminApiService,
|
1761
|
+
GuidedSellingApiService,
|
1762
|
+
SalesforceApiService,
|
1763
|
+
SalesTransactionApiService,
|
1764
|
+
ShoppingCartSettingsApiService,
|
1765
|
+
UIDefinitionsAdminApiService,
|
1766
|
+
UITemplatesAdminApiService,
|
1767
|
+
VeloceObjectsAdminApiService,
|
1768
|
+
XrayService,
|
1769
|
+
], imports: [HttpClientModule] });
|
1770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, decorators: [{
|
1771
|
+
type: NgModule,
|
1772
|
+
args: [{
|
1773
|
+
imports: [HttpClientModule],
|
1774
|
+
providers: [
|
1775
|
+
BaseHttpService,
|
1776
|
+
CacheApiService,
|
1777
|
+
CatalogAdminApiService,
|
1778
|
+
CatalogApiService,
|
1779
|
+
ConfigurationProcessorsApiService,
|
1780
|
+
ConfigurationSettingsApiService,
|
1781
|
+
ContextDefinitionAdminApiService,
|
1782
|
+
DocumentAttachmentApiService,
|
1783
|
+
EndpointsAdminApiService,
|
1784
|
+
FlowsApiService,
|
1785
|
+
OrchestrationsAdminApiService,
|
1786
|
+
OrchestrationsApiService,
|
1787
|
+
PCMApiService,
|
1788
|
+
PicklistsAdminApiService,
|
1789
|
+
ProductsAdminApiService,
|
1790
|
+
FunctionsAdminApiService,
|
1791
|
+
GuidedSellingsAdminApiService,
|
1792
|
+
GuidedSellingApiService,
|
1793
|
+
SalesforceApiService,
|
1794
|
+
SalesTransactionApiService,
|
1795
|
+
ShoppingCartSettingsApiService,
|
1796
|
+
UIDefinitionsAdminApiService,
|
1797
|
+
UITemplatesAdminApiService,
|
1798
|
+
VeloceObjectsAdminApiService,
|
1799
|
+
XrayService,
|
1800
|
+
],
|
1801
|
+
}]
|
1802
|
+
}] });
|
1803
|
+
|
1804
|
+
/**
|
1805
|
+
* Generated bundle index. Do not edit.
|
1806
|
+
*/
|
1807
|
+
|
1808
|
+
export { ApiV2Module, CacheApiService, CatalogAdminApiService, CatalogApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextDefinitionAdminApiService, DocumentAttachmentApiService, EndpointsAdminApiService, FlowsApiService, FunctionsAdminApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OrchestrationsAdminApiService, OrchestrationsApiService, PCMApiService, PicklistsAdminApiService, ProductsAdminApiService, SalesTransactionApiService, SalesforceApiService, ShoppingCartSettingsApiService, UIDefinitionsAdminApiService, UITemplatesAdminApiService, VeloceObjectsAdminApiService };
|
1809
|
+
//# sourceMappingURL=veloceapps-api-v2.mjs.map
|