@veloceapps/api 12.0.0-13 → 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 (145) hide show
  1. package/{fesm2020 → fesm2022}/veloceapps-api-v2.mjs +124 -124
  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 -81
  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/endpoint.types.mjs +0 -2
  65. package/esm2020/v2/types/event-logs.types.mjs +0 -2
  66. package/esm2020/v2/types/function.types.mjs +0 -2
  67. package/esm2020/v2/types/index.mjs +0 -9
  68. package/esm2020/v2/types/pcm.types.mjs +0 -2
  69. package/esm2020/v2/types/procedure.types.mjs +0 -2
  70. package/esm2020/v2/types/sales-transaction.types.mjs +0 -2
  71. package/esm2020/v2/types/search-request.types.mjs +0 -2
  72. package/esm2020/v2/utils/ui-definition.utils.mjs +0 -23
  73. package/esm2020/v2/utils/ui-template.utils.mjs +0 -13
  74. package/esm2020/v2/veloceapps-api-v2.mjs +0 -5
  75. package/esm2020/veloceapps-api.mjs +0 -5
  76. package/fesm2015/veloceapps-api-v2.mjs +0 -1727
  77. package/fesm2015/veloceapps-api-v2.mjs.map +0 -1
  78. package/fesm2015/veloceapps-api.mjs +0 -853
  79. package/fesm2015/veloceapps-api.mjs.map +0 -1
  80. package/fesm2020/veloceapps-api-v2.mjs.map +0 -1
  81. package/fesm2020/veloceapps-api.mjs.map +0 -1
  82. package/src/index.d.ts +0 -15
  83. package/src/lib/api.module.d.ts +0 -8
  84. package/src/lib/services/account-api.service.d.ts +0 -23
  85. package/src/lib/services/auth.service.d.ts +0 -11
  86. package/src/lib/services/contracted-price-api.service.d.ts +0 -16
  87. package/src/lib/services/flow-state-api.d.ts +0 -84
  88. package/src/lib/services/offers-api.service.d.ts +0 -19
  89. package/src/lib/services/org-info-api.service.d.ts +0 -19
  90. package/src/lib/services/portals-api.service.d.ts +0 -20
  91. package/src/lib/services/promotions-api.service.d.ts +0 -19
  92. package/src/lib/services/rebate-program-api.service.d.ts +0 -19
  93. package/src/lib/services/rebate-type-api.service.d.ts +0 -19
  94. package/src/lib/services/sandbox-manager-api.service.d.ts +0 -24
  95. package/src/lib/services/stateful-configuration-api.d.ts +0 -30
  96. package/src/lib/types/auth.types.d.ts +0 -4
  97. package/src/lib/types/clone-request.types.d.ts +0 -5
  98. package/src/lib/types/delta-request.types.d.ts +0 -5
  99. package/src/lib/types/dto/offers-dto.types.d.ts +0 -9
  100. package/src/lib/types/index.d.ts +0 -5
  101. package/src/lib/types/org-info.types.d.ts +0 -43
  102. package/src/lib/types/search-request.types.d.ts +0 -8
  103. package/src/lib/types/stateful-configuration.types.d.ts +0 -10
  104. package/src/lib/utils/canvas.utils.d.ts +0 -18
  105. package/src/lib/utils/index.d.ts +0 -1
  106. package/v2/api-v2.module.d.ts +0 -7
  107. package/v2/services/cache-api.service.d.ts +0 -11
  108. package/v2/services/catalog-admin-api.service.d.ts +0 -39
  109. package/v2/services/catalog-api.service.d.ts +0 -20
  110. package/v2/services/configuration-processors-api.service.d.ts +0 -14
  111. package/v2/services/configuration-settings-api.service.d.ts +0 -18
  112. package/v2/services/context-definition-admin-api.service.d.ts +0 -16
  113. package/v2/services/document-attachment-api.service.d.ts +0 -17
  114. package/v2/services/endpoints-admin-api.service.d.ts +0 -20
  115. package/v2/services/flows-api.service.d.ts +0 -13
  116. package/v2/services/functions-admin-api.service.d.ts +0 -25
  117. package/v2/services/guided-sellings-admin-api.service.d.ts +0 -20
  118. package/v2/services/guided-sellings-api.service.d.ts +0 -13
  119. package/v2/services/index.d.ts +0 -23
  120. package/v2/services/orchestrations-admin-api.service.d.ts +0 -21
  121. package/v2/services/orchestrations-api.service.d.ts +0 -12
  122. package/v2/services/pcm-api.service.d.ts +0 -12
  123. package/v2/services/picklists-admin-api.service.d.ts +0 -17
  124. package/v2/services/products-admin-api.service.d.ts +0 -21
  125. package/v2/services/sales-transactions-api.service.d.ts +0 -26
  126. package/v2/services/salesforce-api.service.d.ts +0 -26
  127. package/v2/services/shopping-cart-settings-api.service.d.ts +0 -14
  128. package/v2/services/ui-definitions-admin-api.service.d.ts +0 -18
  129. package/v2/services/ui-templates-admin-api.service.d.ts +0 -50
  130. package/v2/services/veloce-objects-api.service.d.ts +0 -23
  131. package/v2/types/attachment.types.d.ts +0 -4
  132. package/v2/types/clone-request.types.d.ts +0 -5
  133. package/v2/types/dto/configuration-settings-dto.types.d.ts +0 -9
  134. package/v2/types/dto/ui-definition-dto.types.d.ts +0 -7
  135. package/v2/types/dto/ui-template-dto.types.d.ts +0 -6
  136. package/v2/types/endpoint.types.d.ts +0 -15
  137. package/v2/types/event-logs.types.d.ts +0 -9
  138. package/v2/types/function.types.d.ts +0 -17
  139. package/v2/types/index.d.ts +0 -8
  140. package/v2/types/pcm.types.d.ts +0 -10
  141. package/v2/types/procedure.types.d.ts +0 -73
  142. package/v2/types/sales-transaction.types.d.ts +0 -13
  143. package/v2/types/search-request.types.d.ts +0 -8
  144. package/v2/utils/ui-definition.utils.d.ts +0 -5
  145. package/v2/utils/ui-template.utils.d.ts +0 -3
@@ -1,1727 +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
602
- .api({
603
- url: `${this.serviceUrl}/execute`,
604
- method: 'post',
605
- body,
606
- skipErrorHandler: true,
607
- })
608
- .pipe(map$1(result => result || {}));
609
- }
610
- }
611
- EndpointsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
612
- EndpointsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService });
613
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, decorators: [{
614
- type: Injectable
615
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
616
-
617
- class FlowsApiService {
618
- constructor(configurationSettingsApiService) {
619
- this.configurationSettingsApiService = configurationSettingsApiService;
620
- this.flowsKey = 'flows';
621
- }
622
- getFlow(id) {
623
- return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
624
- if (!flow) {
625
- throw new Error(`Flow with flowId=${id} is not defined`);
626
- }
627
- return flow;
628
- }));
629
- }
630
- fetchFlows() {
631
- return this.configurationSettingsApiService
632
- .fetchSetting(this.flowsKey)
633
- .pipe(map((setting) => ((setting === null || setting === void 0 ? void 0 : setting.value) ? JSON.parse(setting.value) : [])));
634
- }
635
- }
636
- FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
637
- FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
638
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
639
- type: Injectable
640
- }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
641
-
642
- class FunctionsAdminApiService {
643
- constructor(baseHttpService) {
644
- this.baseHttpService = baseHttpService;
645
- this.serviceUrl = '/admin/v2/functions';
646
- this.fetchAll$ = () => {
647
- return this.search$(new Expression(), 0, 100);
648
- };
649
- this.search$ = (expression, skip, count) => {
650
- let params = new HttpParams();
651
- if (typeof skip === 'number') {
652
- params = params.set('skip', '' + skip);
653
- }
654
- if (typeof count === 'number') {
655
- params = params.set('count', '' + count);
656
- }
657
- return this.baseHttpService.api({
658
- method: 'post',
659
- url: `${this.serviceUrl}/rules/search`,
660
- params,
661
- body: expression,
662
- });
663
- };
664
- this.create$ = (rule) => {
665
- return this.baseHttpService.api({
666
- url: `${this.serviceUrl}/rules`,
667
- method: 'post',
668
- body: rule,
669
- });
670
- };
671
- this.update$ = (rule) => {
672
- return this.baseHttpService.api({
673
- url: `${this.serviceUrl}/rules/${rule.id}`,
674
- method: 'put',
675
- body: rule,
676
- });
677
- };
678
- this.duplicate$ = (body) => {
679
- return this.baseHttpService
680
- .api({
681
- url: `${this.serviceUrl}/rules/${body.id}/clone`,
682
- method: 'post',
683
- body,
684
- })
685
- .pipe(map$1(response => response.clonedRecordId));
686
- };
687
- this.remove$ = (id) => {
688
- return this.baseHttpService.api({
689
- url: `${this.serviceUrl}/rules/${id}`,
690
- method: 'delete',
691
- });
692
- };
693
- this.restore$ = (id) => {
694
- return this.baseHttpService.api({
695
- url: `${this.serviceUrl}/rules/${id}/restore`,
696
- method: 'patch',
697
- });
698
- };
699
- }
700
- fetch$(id) {
701
- return this.baseHttpService.api({
702
- url: `${this.serviceUrl}/rules/${id}`,
703
- method: 'get',
704
- });
705
- }
706
- fetchHeaderFields$() {
707
- return this.baseHttpService.api({
708
- url: `${this.serviceUrl}/rules/describe/Header`,
709
- method: 'get',
710
- });
711
- }
712
- execute$(body) {
713
- const url = `${this.serviceUrl}/rules/execute`;
714
- return this.baseHttpService.api({
715
- url,
716
- method: 'post',
717
- body,
718
- });
719
- }
720
- executeExtractFunction$(body) {
721
- return this.baseHttpService.api({
722
- url: `${this.serviceUrl}/extract`,
723
- method: 'post',
724
- body,
725
- });
726
- }
727
- fetchFunctionDatasets$() {
728
- return this.baseHttpService.api({
729
- url: `${this.serviceUrl}/datasets`,
730
- method: 'get',
731
- });
732
- }
733
- fetchFunctionTags$() {
734
- return this.baseHttpService.api({
735
- url: `${this.serviceUrl}/tags`,
736
- method: 'get',
737
- });
738
- }
739
- fetchObjectParentIdFields$(objectName) {
740
- return this.baseHttpService.api({
741
- url: `${this.serviceUrl}/parent-id-fields/${objectName}`,
742
- method: 'get',
743
- });
744
- }
745
- }
746
- FunctionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
747
- FunctionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService });
748
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, decorators: [{
749
- type: Injectable
750
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
751
-
752
- class GuidedSellingsAdminApiService {
753
- constructor(baseHttpService) {
754
- this.baseHttpService = baseHttpService;
755
- this.serviceUrl = '/admin/v2/guided-selling';
756
- this.fetchGuidedSellings$ = (searchParams) => {
757
- return this.searchGuidedSellings$(searchParams);
758
- };
759
- this.searchGuidedSellings$ = (searchParams, expression) => {
760
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
761
- return this.baseHttpService.api({
762
- method: 'post',
763
- url: `${this.serviceUrl}/search`,
764
- params,
765
- body: expression || {},
766
- });
767
- };
768
- this.fetchGuidedSelling$ = (id) => {
769
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
770
- };
771
- this.createNewGuidedSelling$ = (guidedSelling) => {
772
- return this.baseHttpService.api({
773
- url: `${this.serviceUrl}`,
774
- method: 'post',
775
- body: guidedSelling,
776
- });
777
- };
778
- this.duplicateGuidedSelling$ = (cloneRequest) => {
779
- return this.baseHttpService.api({
780
- url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
781
- method: 'post',
782
- body: cloneRequest,
783
- });
784
- };
785
- this.updateGuidedSelling$ = (data) => {
786
- return this.baseHttpService.api({
787
- url: `${this.serviceUrl}/${data.id}`,
788
- method: 'put',
789
- body: data,
790
- });
791
- };
792
- this.removeGuidedSelling$ = (id) => {
793
- return this.baseHttpService.api({
794
- url: `${this.serviceUrl}/${id}`,
795
- method: 'delete',
796
- });
797
- };
798
- this.restoreGuidedSelling$ = (id) => {
799
- return this.baseHttpService.api({
800
- url: `${this.serviceUrl}/${id}/restore`,
801
- method: 'patch',
802
- });
803
- };
804
- }
805
- }
806
- GuidedSellingsAdminApiService.MAX_RESULTS = 60;
807
- GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
808
- GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService });
809
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
810
- type: Injectable
811
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
812
-
813
- class GuidedSellingApiService {
814
- constructor(http) {
815
- this.http = http;
816
- this.serviceUrl = '/v2/guided-selling';
817
- }
818
- searchByName$(name, searchParams) {
819
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
820
- const expression = new Expression(undefined, [{ key: 'name', operator: Operator.EQ, value: name }]);
821
- return this.http.api({
822
- method: 'post',
823
- url: `${this.serviceUrl}/search`,
824
- params,
825
- body: expression || {},
826
- });
827
- }
828
- searchById$(id, searchParams) {
829
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
830
- const expression = new Expression(undefined, [{ key: 'id', operator: Operator.EQ, value: id }]);
831
- return this.http.api({
832
- method: 'post',
833
- url: `${this.serviceUrl}/search`,
834
- params,
835
- body: expression || {},
836
- });
837
- }
838
- }
839
- GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
840
- GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService });
841
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, decorators: [{
842
- type: Injectable
843
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
844
-
845
- class OrchestrationsAdminApiService {
846
- constructor(baseHttpService) {
847
- this.baseHttpService = baseHttpService;
848
- this.SERVICE_URL = '/admin/v2/orchestrations';
849
- this.fetchAll$ = () => {
850
- return this.search$(new Expression(), 0, 100);
851
- };
852
- this.search$ = (expression, skip, count) => {
853
- let params = new HttpParams();
854
- params = params.set('skip', '' + skip);
855
- params = params.set('count', '' + count);
856
- return this.baseHttpService.api({
857
- method: 'post',
858
- url: `${this.SERVICE_URL}/search`,
859
- params,
860
- body: expression,
861
- });
862
- };
863
- this.create$ = (newProcedure) => {
864
- return this.baseHttpService.api({
865
- url: `${this.SERVICE_URL}`,
866
- method: 'post',
867
- body: newProcedure,
868
- });
869
- };
870
- this.update$ = (procedure) => {
871
- return this.baseHttpService.api({
872
- url: `${this.SERVICE_URL}/${procedure.id}`,
873
- method: 'put',
874
- body: procedure,
875
- });
876
- };
877
- this.duplicate$ = (body) => {
878
- return this.baseHttpService
879
- .api({
880
- url: `${this.SERVICE_URL}/${body.id}/clone`,
881
- method: 'post',
882
- body,
883
- })
884
- .pipe(map$1(response => response.clonedRecordId));
885
- };
886
- this.remove$ = (id) => {
887
- return this.baseHttpService.api({
888
- url: `${this.SERVICE_URL}/${id}`,
889
- method: 'delete',
890
- });
891
- };
892
- this.restore$ = (id) => {
893
- return this.baseHttpService.api({
894
- url: `${this.SERVICE_URL}/${id}/restore`,
895
- method: 'patch',
896
- });
897
- };
898
- }
899
- fetch$(id) {
900
- return this.baseHttpService.api({
901
- url: `${this.SERVICE_URL}/${id}`,
902
- method: 'get',
903
- });
904
- }
905
- execute$(body) {
906
- return this.baseHttpService.api({
907
- url: `${this.SERVICE_URL}/execute`,
908
- method: 'post',
909
- body,
910
- });
911
- }
912
- catalogExecute$(body) {
913
- return this.baseHttpService.api({
914
- url: `${this.SERVICE_URL}/catalog/execute`,
915
- method: 'post',
916
- body,
917
- });
918
- }
919
- }
920
- OrchestrationsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
921
- OrchestrationsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService });
922
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, decorators: [{
923
- type: Injectable
924
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
925
-
926
- class OrchestrationsApiService {
927
- constructor(baseHttpService) {
928
- this.baseHttpService = baseHttpService;
929
- this.SERVICE_URL = '/v2/orchestrations';
930
- }
931
- apply$(request, options) {
932
- return this.baseHttpService.api(Object.assign({ url: `${this.SERVICE_URL}/apply`, method: 'post', body: request }, options));
933
- }
934
- }
935
- OrchestrationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
936
- OrchestrationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService });
937
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, decorators: [{
938
- type: Injectable
939
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
940
-
941
- class SalesforceApiService {
942
- constructor(httpService) {
943
- this.httpService = httpService;
944
- this.SERVICE_URL = '/v2/proxy';
945
- }
946
- query(searchRequest, objectName, options) {
947
- 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));
948
- }
949
- queryObjects(search, options) {
950
- let params = new HttpParams();
951
- if (search) {
952
- params = params.append('search', search);
953
- }
954
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/query`, params }, options));
955
- }
956
- search(req, options) {
957
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest/search`, params: { q: req.searchString } }, options));
958
- }
959
- describeObject(objectName, options) {
960
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
961
- return this.httpService.api(Object.assign({ url: methodUrl }, options));
962
- }
963
- describeField(objectName, fieldName, options) {
964
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
965
- return this.httpService.api(Object.assign({ url: methodUrl }, options));
966
- }
967
- describe2(objectName, fields, options) {
968
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
969
- return this.httpService.api(Object.assign({ method: 'post', url: methodUrl, body: fields }, options));
970
- }
971
- apexGetRequest(path, params, options) {
972
- // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
973
- const httpParams = new HttpParams({ fromString: params.toString() });
974
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams }, options));
975
- }
976
- apexPostRequest(path, body, options) {
977
- return this.httpService.api(Object.assign({ method: 'post', body, url: `${this.SERVICE_URL}/apex${path}` }, options));
978
- }
979
- restGetRequest(path, params, options) {
980
- const httpParams = new HttpParams({ fromString: params.toString() });
981
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest${path}`, params: httpParams }, options));
982
- }
983
- getGlobalPicklists() {
984
- return this.httpService.api({
985
- method: 'get',
986
- url: `${this.SERVICE_URL}/globalvalueset`,
987
- });
988
- }
989
- getGlobalPicklistValues(id) {
990
- return this.httpService.api({
991
- method: 'get',
992
- url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
993
- });
994
- }
995
- }
996
- SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
997
- SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
998
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
999
- type: Injectable
1000
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1001
-
1002
- class PCMApiService {
1003
- constructor(sfApiService) {
1004
- this.sfApiService = sfApiService;
1005
- }
1006
- fetchPCMByProductId(productId) {
1007
- return this.sfApiService.restGetRequest(`/connect/pcm/products/${productId}`, new HttpParams()).pipe(tap$1(response => {
1008
- if (response.status.code !== '200') {
1009
- throw new Error(response.status.message);
1010
- }
1011
- }), map$1(response => {
1012
- const pcm = response.products[0];
1013
- if (!pcm) {
1014
- throw new Error('PCM product is not found');
1015
- }
1016
- this.fixUrls(pcm);
1017
- return pcm;
1018
- }));
1019
- }
1020
- fixUrls(product) {
1021
- if (product.displayUrl) {
1022
- product.displayUrl = product.displayUrl.replaceAll('&', '&');
1023
- }
1024
- product.productComponentGroups.forEach(group => {
1025
- group.components.forEach(component => this.fixUrls(component));
1026
- });
1027
- }
1028
- }
1029
- PCMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, deps: [{ token: SalesforceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1030
- PCMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService });
1031
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, decorators: [{
1032
- type: Injectable
1033
- }], ctorParameters: function () { return [{ type: SalesforceApiService }]; } });
1034
-
1035
- class PicklistsAdminApiService {
1036
- constructor(baseHttpService) {
1037
- this.baseHttpService = baseHttpService;
1038
- this.serviceUrl = '/admin/v2/picklists';
1039
- this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}` });
1040
- this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/${code}` });
1041
- this.createPicklist$ = (picklist) => {
1042
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}`, body: picklist });
1043
- };
1044
- this.updatePicklist$ = (picklist) => {
1045
- return this.baseHttpService.api({
1046
- method: 'put',
1047
- url: `${this.serviceUrl}/${picklist.id}`,
1048
- body: picklist,
1049
- });
1050
- };
1051
- this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/${id}` });
1052
- this.restorePicklist$ = (id) => {
1053
- return this.baseHttpService.api({
1054
- url: `${this.serviceUrl}/${id}/restore`,
1055
- method: 'patch',
1056
- });
1057
- };
1058
- this.addPicklistValue$ = (picklist, value) => {
1059
- const data = Object.assign(Object.assign({}, picklist), { values: [...picklist.values, value] });
1060
- return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/${picklist.id}`, body: data });
1061
- };
1062
- }
1063
- }
1064
- PicklistsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1065
- PicklistsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService });
1066
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, decorators: [{
1067
- type: Injectable
1068
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1069
-
1070
- class ProductsAdminApiService {
1071
- constructor(baseHttpService) {
1072
- this.baseHttpService = baseHttpService;
1073
- this.serviceUrl = '/admin/v2/products';
1074
- this.fetchProducts$ = (payload) => {
1075
- let params = new HttpParams();
1076
- params = params.append('count', payload.count);
1077
- params = params.append('skip', payload.skip);
1078
- if (payload.name) {
1079
- params = params.append('name', payload.name);
1080
- }
1081
- return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1082
- };
1083
- this.searchProducts$ = (expression, skip, count) => {
1084
- let params = new HttpParams();
1085
- params = params.set('skip', '' + skip);
1086
- params = params.set('count', '' + count);
1087
- return this.baseHttpService.api({
1088
- method: 'post',
1089
- url: `${this.serviceUrl}/search`,
1090
- params: params,
1091
- body: expression,
1092
- });
1093
- };
1094
- this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1095
- this.createNewProduct$ = (productData) => {
1096
- return this.baseHttpService.api({
1097
- url: `${this.serviceUrl}`,
1098
- method: 'post',
1099
- body: productData,
1100
- });
1101
- };
1102
- this.updateProduct$ = (body) => {
1103
- return this.baseHttpService.api({
1104
- url: `${this.serviceUrl}/${body.id}`,
1105
- method: 'put',
1106
- body,
1107
- });
1108
- };
1109
- this.removeProduct$ = (id) => {
1110
- return this.baseHttpService.api({
1111
- url: `${this.serviceUrl}/${id}`,
1112
- method: 'delete',
1113
- });
1114
- };
1115
- this.restoreProduct$ = (id) => {
1116
- return this.baseHttpService.api({
1117
- url: `${this.serviceUrl}/${id}/restore`,
1118
- method: 'patch',
1119
- });
1120
- };
1121
- }
1122
- attachImage$(productId, file) {
1123
- const data = new FormData();
1124
- data.append('image', file);
1125
- return this.baseHttpService.upload({
1126
- method: 'post',
1127
- url: `${this.serviceUrl}/${productId}/image`,
1128
- body: data,
1129
- });
1130
- }
1131
- removeImage$(productId) {
1132
- return this.baseHttpService.api({
1133
- method: 'delete',
1134
- url: `${this.serviceUrl}/${productId}/image`,
1135
- });
1136
- }
1137
- fetchImage$(productId) {
1138
- return this.baseHttpService.api({
1139
- url: this.getImageUrl(productId),
1140
- method: 'get',
1141
- responseType: 'blob',
1142
- errorHandler: noop,
1143
- });
1144
- }
1145
- getImageUrl(productId) {
1146
- return `${this.serviceUrl}/${productId}/image`;
1147
- }
1148
- }
1149
- ProductsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1150
- ProductsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService });
1151
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, decorators: [{
1152
- type: Injectable
1153
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1154
-
1155
- class SalesTransactionApiService {
1156
- constructor(httpService) {
1157
- this.httpService = httpService;
1158
- this.SERVICE_URL = '/v2/transactions';
1159
- }
1160
- /**
1161
- * This endpoint doesn't include orders and assets
1162
- * @param objectId SF record ID (quoteId | accountId | opportunityId | orderId etc)
1163
- * @param params Query params
1164
- * @param options Request options
1165
- */
1166
- getState(objectId, params, options) {
1167
- return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}/${objectId}`, params: params }, options));
1168
- }
1169
- /**
1170
- * This endpoint doesn't include orders and assets
1171
- * @param headerId SF record ID (quoteId | accountId | opportunityId | orderId etc)
1172
- * @param params Query params
1173
- * @param options Request options
1174
- */
1175
- query(headerId, params, options) {
1176
- return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}/query/${headerId}`, params: params }, options));
1177
- }
1178
- save(request, options) {
1179
- return this.httpService.api(Object.assign(Object.assign({ method: 'post', url: `${this.SERVICE_URL}/save/${request.transactionContext.salesTransaction.id}`, body: request }, options), { responseType: 'text' }));
1180
- }
1181
- }
1182
- SalesTransactionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1183
- SalesTransactionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService });
1184
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, decorators: [{
1185
- type: Injectable
1186
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1187
-
1188
- class ShoppingCartSettingsApiService {
1189
- constructor(configurationSettingsApiService) {
1190
- this.configurationSettingsApiService = configurationSettingsApiService;
1191
- this.shoppingCartSettingsKey = 'shopping-cart';
1192
- }
1193
- getSetting(id) {
1194
- return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map(settings => settings.find(setting => setting.id == id)));
1195
- }
1196
- fetchSettings() {
1197
- return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
1198
- }
1199
- getSettingsMap() {
1200
- return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map((settings) => settings.reduce((acc, setting) => {
1201
- return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
1202
- }, {})));
1203
- }
1204
- }
1205
- ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1206
- ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
1207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
1208
- type: Injectable
1209
- }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
1210
-
1211
- function uiDefinitionFromDTO(container) {
1212
- const { sourceBlob } = container, rest = __rest(container, ["sourceBlob"]);
1213
- return Object.assign(Object.assign({}, rest), { source: parseJsonStringAsObject(sourceBlob) });
1214
- }
1215
- function uiDefinitionToDTO(container) {
1216
- const { source } = container, rest = __rest(container, ["source"]);
1217
- return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
1218
- }
1219
- function newUiDefinitionToDTO(container) {
1220
- const { source } = container, rest = __rest(container, ["source"]);
1221
- return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
1222
- }
1223
-
1224
- class UIDefinitionsAdminApiService {
1225
- constructor(baseHttpService) {
1226
- this.baseHttpService = baseHttpService;
1227
- this.serviceUrl = '/admin/v2/uidefinitions';
1228
- }
1229
- fetchAll$(params, options) {
1230
- let httpParams = new HttpParams();
1231
- if ((params === null || params === void 0 ? void 0 : params.productId) != null) {
1232
- httpParams = httpParams.set('productId', params.productId);
1233
- }
1234
- if (params === null || params === void 0 ? void 0 : params.defaultUIDefinitionId) {
1235
- httpParams = httpParams.set('defaultUIDefinitionId', params.defaultUIDefinitionId);
1236
- }
1237
- return this.baseHttpService
1238
- .api(Object.assign({ method: 'get', url: this.serviceUrl, params: httpParams }, options))
1239
- .pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
1240
- }
1241
- fetch$(id, options) {
1242
- return this.baseHttpService
1243
- .api(Object.assign({ method: 'get', url: `${this.serviceUrl}/${id}` }, options))
1244
- .pipe(map$1(container => uiDefinitionFromDTO(Object.assign(Object.assign({}, container), { id }))));
1245
- }
1246
- create$(uiDefinitionContainer) {
1247
- const dto = newUiDefinitionToDTO(uiDefinitionContainer);
1248
- return this.baseHttpService
1249
- .api({
1250
- method: 'post',
1251
- url: this.serviceUrl,
1252
- body: dto,
1253
- })
1254
- .pipe(map$1(container => uiDefinitionFromDTO(container)));
1255
- }
1256
- update$(uiDefinitionContainer) {
1257
- const dto = uiDefinitionToDTO(uiDefinitionContainer);
1258
- return this.baseHttpService
1259
- .api({
1260
- method: 'put',
1261
- url: `${this.serviceUrl}/${uiDefinitionContainer.id}`,
1262
- body: dto,
1263
- })
1264
- .pipe(map$1(container => uiDefinitionFromDTO(container)));
1265
- }
1266
- delete$(id) {
1267
- return this.baseHttpService.api({
1268
- method: 'delete',
1269
- url: `${this.serviceUrl}/${id}`,
1270
- });
1271
- }
1272
- }
1273
- UIDefinitionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1274
- UIDefinitionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService });
1275
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, decorators: [{
1276
- type: Injectable
1277
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1278
-
1279
- const fromUIComponentStoryDTO = (dto, attachments) => {
1280
- return {
1281
- id: dto.id,
1282
- name: dto.name,
1283
- uiComponentId: dto.uiComponentId,
1284
- description: dto.description,
1285
- section: attachments.json,
1286
- template: attachments.html,
1287
- script: attachments.js,
1288
- styles: attachments.css,
1289
- };
1290
- };
1291
-
1292
- class UITemplatesAdminApiService {
1293
- constructor(baseHttpService) {
1294
- this.baseHttpService = baseHttpService;
1295
- this.serviceUrl = '/admin/v2/uitemplates';
1296
- this.fetchTemplates$ = (name) => {
1297
- let params = new HttpParams();
1298
- if (name) {
1299
- params = params.append('name', name);
1300
- }
1301
- return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1302
- };
1303
- this.createTemplate$ = (template) => {
1304
- return this.baseHttpService.api({
1305
- method: 'post',
1306
- url: `${this.serviceUrl}`,
1307
- body: template,
1308
- });
1309
- };
1310
- this.updateTemplate$ = (template) => {
1311
- return this.baseHttpService.api({
1312
- method: 'put',
1313
- url: `${this.serviceUrl}/${template.id}`,
1314
- body: template,
1315
- });
1316
- };
1317
- this.duplicateTemplate$ = (template, cloneRequest) => {
1318
- return this.baseHttpService
1319
- .api({
1320
- url: `${this.serviceUrl}/${template.id}/clone`,
1321
- method: 'post',
1322
- body: cloneRequest,
1323
- })
1324
- .pipe(map$1(response => response.clonedRecordId));
1325
- };
1326
- this.removeTemplate$ = (id) => {
1327
- return this.baseHttpService.api({
1328
- method: 'delete',
1329
- url: `${this.serviceUrl}/${id}`,
1330
- });
1331
- };
1332
- this.restoreTemplate$ = (id) => {
1333
- return this.baseHttpService.api({
1334
- method: 'patch',
1335
- url: `${this.serviceUrl}/${id}`,
1336
- });
1337
- };
1338
- this.searchTemplates$ = (data) => {
1339
- return this.baseHttpService.api({
1340
- method: 'post',
1341
- url: `${this.serviceUrl}/search`,
1342
- params: data.params,
1343
- body: data.expression,
1344
- });
1345
- };
1346
- this.fetchComponents$ = (templateId, name) => {
1347
- let params = new HttpParams();
1348
- if (name) {
1349
- params = params.append('name', name);
1350
- }
1351
- return this.baseHttpService.api({
1352
- url: `${this.serviceUrl}/${templateId}/components`,
1353
- params,
1354
- });
1355
- };
1356
- this.fetchComponent$ = (templateId, componentId) => {
1357
- return this.baseHttpService.api({
1358
- url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1359
- });
1360
- };
1361
- this.createComponent$ = (component) => {
1362
- return this.baseHttpService.api({
1363
- method: 'post',
1364
- url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
1365
- body: component,
1366
- });
1367
- };
1368
- this.updateComponent$ = (component) => {
1369
- return this.baseHttpService.api({
1370
- method: 'put',
1371
- url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
1372
- body: component,
1373
- });
1374
- };
1375
- this.duplicateComponent$ = (component, cloneRequest) => {
1376
- return this.baseHttpService
1377
- .api({
1378
- url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
1379
- method: 'post',
1380
- body: cloneRequest,
1381
- })
1382
- .pipe(map$1(response => response.clonedRecordId));
1383
- };
1384
- this.removeComponent$ = (templateId, componentId) => {
1385
- return this.baseHttpService.api({
1386
- method: 'delete',
1387
- url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1388
- });
1389
- };
1390
- this.restoreComponent$ = (templateId, componentId) => {
1391
- return this.baseHttpService.api({
1392
- method: 'patch',
1393
- url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1394
- });
1395
- };
1396
- this.searchComponents$ = (templateId, data) => {
1397
- return this.baseHttpService.api({
1398
- method: 'post',
1399
- url: `${this.serviceUrl}/${templateId}/components/search`,
1400
- params: data.params,
1401
- body: data.expression,
1402
- });
1403
- };
1404
- this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
1405
- return this.baseHttpService
1406
- .api({
1407
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
1408
- responseType: 'text',
1409
- errorHandler: noop,
1410
- })
1411
- .pipe(catchError$1(() => of('')));
1412
- };
1413
- this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
1414
- return forkJoin([
1415
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
1416
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
1417
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
1418
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
1419
- ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
1420
- };
1421
- this.fetchStories$ = (templateId, componentId, name) => {
1422
- let params = new HttpParams();
1423
- if (name) {
1424
- params = params.append('name', name);
1425
- }
1426
- return this.baseHttpService
1427
- .api({
1428
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
1429
- params,
1430
- })
1431
- .pipe(switchMap(dtos => {
1432
- if (!dtos.length) {
1433
- return of([]);
1434
- }
1435
- return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1436
- }));
1437
- };
1438
- this.fetchStory$ = (templateId, componentId, storyId) => {
1439
- return this.baseHttpService
1440
- .api({
1441
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1442
- })
1443
- .pipe(switchMap(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1444
- };
1445
- this.createComponentStory$ = (templateId, story) => {
1446
- return this.baseHttpService.api({
1447
- method: 'post',
1448
- url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
1449
- body: story,
1450
- });
1451
- };
1452
- this.updateComponentStory$ = (templateId, story) => {
1453
- const { script, template, styles, section } = story, rest = __rest(story, ["script", "template", "styles", "section"]);
1454
- return this.baseHttpService
1455
- .api({
1456
- method: 'put',
1457
- url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
1458
- body: rest,
1459
- })
1460
- .pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
1461
- };
1462
- this.duplicateComponentStory$ = (story, cloneRequest) => {
1463
- return this.baseHttpService
1464
- .api({
1465
- url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
1466
- method: 'post',
1467
- body: cloneRequest,
1468
- })
1469
- .pipe(map$1(response => response.clonedRecordId));
1470
- };
1471
- this.deleteComponentStory$ = (templateId, componentId, storyId) => {
1472
- return this.baseHttpService.api({
1473
- method: 'delete',
1474
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1475
- });
1476
- };
1477
- this.restoreComponentStory$ = (templateId, componentId, storyId) => {
1478
- return this.baseHttpService.api({
1479
- method: 'patch',
1480
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1481
- });
1482
- };
1483
- this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
1484
- const formData = new FormData();
1485
- if (attachments.html != null) {
1486
- formData.append('html', new Blob([attachments.html]), 'story-template.html');
1487
- }
1488
- if (attachments.css != null) {
1489
- formData.append('css', new Blob([attachments.css]), 'story-styles.css');
1490
- }
1491
- if (attachments.js != null) {
1492
- formData.append('js', new Blob([attachments.js]), 'story-script.js');
1493
- }
1494
- if (attachments.json != null) {
1495
- formData.append('json', new Blob([attachments.json]), 'story-section.json');
1496
- }
1497
- return this.baseHttpService.upload({
1498
- method: 'post',
1499
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
1500
- body: formData,
1501
- });
1502
- };
1503
- this.fetchComponentAttachments$ = (templateId, component) => {
1504
- return forkJoin([
1505
- this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
1506
- this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
1507
- this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
1508
- this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
1509
- ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
1510
- };
1511
- this.fetchComponentsAttachments$ = (templateId) => {
1512
- return this.fetchComponents$(templateId).pipe(switchMap(components => {
1513
- return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
1514
- }));
1515
- };
1516
- this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
1517
- return this.baseHttpService
1518
- .api({
1519
- method: 'get',
1520
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
1521
- responseType: 'text',
1522
- errorHandler: noop,
1523
- })
1524
- .pipe(catchError$1(() => of('')));
1525
- };
1526
- this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
1527
- const formData = new FormData();
1528
- if (attachments.html != null) {
1529
- formData.append('html', new Blob([attachments.html]), 'template.html');
1530
- }
1531
- if (attachments.css != null) {
1532
- formData.append('css', new Blob([attachments.css]), 'styles.css');
1533
- }
1534
- if (attachments.js != null) {
1535
- formData.append('js', new Blob([attachments.js]), 'script.js');
1536
- }
1537
- if (attachments.json != null) {
1538
- formData.append('json', new Blob([attachments.json]), 'section.json');
1539
- }
1540
- return this.baseHttpService.upload({
1541
- method: 'post',
1542
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
1543
- body: formData,
1544
- });
1545
- };
1546
- }
1547
- getTemplateThumbnailUrl(templateId) {
1548
- return `${this.serviceUrl}/${templateId}/thumbnail/file`;
1549
- }
1550
- attachTemplateThumbnail$(templateId, file) {
1551
- const data = new FormData();
1552
- data.append('thumb', file);
1553
- return this.baseHttpService.upload({
1554
- method: 'post',
1555
- url: `${this.serviceUrl}/${templateId}/thumbnail`,
1556
- body: data,
1557
- });
1558
- }
1559
- removeTemplateThumbnail$(templateId) {
1560
- return this.baseHttpService.api({
1561
- method: 'delete',
1562
- url: `${this.serviceUrl}/${templateId}/thumbnail`,
1563
- });
1564
- }
1565
- }
1566
- UITemplatesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1567
- UITemplatesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService });
1568
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, decorators: [{
1569
- type: Injectable
1570
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1571
-
1572
- class VeloceObjectsAdminApiService {
1573
- constructor(baseHttpService) {
1574
- this.baseHttpService = baseHttpService;
1575
- this.serviceUrl = '/admin/v2/veloceobjects';
1576
- this.updateCategory$ = (category) => {
1577
- return this.baseHttpService.api({
1578
- method: 'put',
1579
- url: `${this.serviceUrl}/categories/${category.id}`,
1580
- body: category,
1581
- });
1582
- };
1583
- this.deleteCategory$ = (id) => {
1584
- return this.baseHttpService.api({
1585
- method: 'delete',
1586
- url: `${this.serviceUrl}/categories/${id}`,
1587
- });
1588
- };
1589
- this.searchObjects$ = (searchParams, expression) => {
1590
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
1591
- return this.baseHttpService.api({
1592
- method: 'post',
1593
- url: `${this.serviceUrl}/search`,
1594
- params,
1595
- body: expression || {},
1596
- });
1597
- };
1598
- this.deleteObject$ = (id) => {
1599
- return this.baseHttpService.api({
1600
- method: 'delete',
1601
- url: `${this.serviceUrl}/${id}`,
1602
- });
1603
- };
1604
- this.duplicateObject$ = (body) => {
1605
- return this.baseHttpService
1606
- .api({
1607
- method: 'post',
1608
- url: `${this.serviceUrl}/${body.id}/clone`,
1609
- body,
1610
- })
1611
- .pipe(map(response => response.clonedRecordId));
1612
- };
1613
- this.restoreObject$ = (id) => {
1614
- return this.baseHttpService.api({
1615
- method: 'patch',
1616
- url: `${this.serviceUrl}/${id}/restore`,
1617
- });
1618
- };
1619
- }
1620
- fetchCategories$() {
1621
- return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
1622
- }
1623
- createCategory$(category) {
1624
- return this.baseHttpService.api({
1625
- method: 'post',
1626
- url: `${this.serviceUrl}/categories`,
1627
- body: category,
1628
- });
1629
- }
1630
- fetchObjects$() {
1631
- return this.baseHttpService.api({ url: `${this.serviceUrl}` });
1632
- }
1633
- fetchObject$(id) {
1634
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1635
- }
1636
- createObject$(object) {
1637
- return this.baseHttpService.api({
1638
- method: 'post',
1639
- url: `${this.serviceUrl}`,
1640
- body: object,
1641
- });
1642
- }
1643
- updateObject$(object) {
1644
- return this.baseHttpService.api({
1645
- method: 'put',
1646
- url: `${this.serviceUrl}/${object.id}`,
1647
- body: object,
1648
- });
1649
- }
1650
- }
1651
- VeloceObjectsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1652
- VeloceObjectsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService });
1653
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, decorators: [{
1654
- type: Injectable
1655
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1656
-
1657
- class ApiV2Module {
1658
- }
1659
- ApiV2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1660
- ApiV2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, imports: [HttpClientModule] });
1661
- ApiV2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, providers: [
1662
- BaseHttpService,
1663
- CacheApiService,
1664
- CatalogAdminApiService,
1665
- CatalogApiService,
1666
- ConfigurationProcessorsApiService,
1667
- ConfigurationSettingsApiService,
1668
- ContextDefinitionAdminApiService,
1669
- DocumentAttachmentApiService,
1670
- EndpointsAdminApiService,
1671
- FlowsApiService,
1672
- OrchestrationsAdminApiService,
1673
- OrchestrationsApiService,
1674
- PCMApiService,
1675
- PicklistsAdminApiService,
1676
- ProductsAdminApiService,
1677
- FunctionsAdminApiService,
1678
- GuidedSellingsAdminApiService,
1679
- GuidedSellingApiService,
1680
- SalesforceApiService,
1681
- SalesTransactionApiService,
1682
- ShoppingCartSettingsApiService,
1683
- UIDefinitionsAdminApiService,
1684
- UITemplatesAdminApiService,
1685
- VeloceObjectsAdminApiService,
1686
- XrayService,
1687
- ], imports: [HttpClientModule] });
1688
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, decorators: [{
1689
- type: NgModule,
1690
- args: [{
1691
- imports: [HttpClientModule],
1692
- providers: [
1693
- BaseHttpService,
1694
- CacheApiService,
1695
- CatalogAdminApiService,
1696
- CatalogApiService,
1697
- ConfigurationProcessorsApiService,
1698
- ConfigurationSettingsApiService,
1699
- ContextDefinitionAdminApiService,
1700
- DocumentAttachmentApiService,
1701
- EndpointsAdminApiService,
1702
- FlowsApiService,
1703
- OrchestrationsAdminApiService,
1704
- OrchestrationsApiService,
1705
- PCMApiService,
1706
- PicklistsAdminApiService,
1707
- ProductsAdminApiService,
1708
- FunctionsAdminApiService,
1709
- GuidedSellingsAdminApiService,
1710
- GuidedSellingApiService,
1711
- SalesforceApiService,
1712
- SalesTransactionApiService,
1713
- ShoppingCartSettingsApiService,
1714
- UIDefinitionsAdminApiService,
1715
- UITemplatesAdminApiService,
1716
- VeloceObjectsAdminApiService,
1717
- XrayService,
1718
- ],
1719
- }]
1720
- }] });
1721
-
1722
- /**
1723
- * Generated bundle index. Do not edit.
1724
- */
1725
-
1726
- 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 };
1727
- //# sourceMappingURL=veloceapps-api-v2.mjs.map