@veloceapps/api 12.0.0-12 → 12.0.0-14

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