@veloceapps/api 11.0.0-12 → 11.0.0-120

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 (133) hide show
  1. package/esm2020/src/index.mjs +1 -19
  2. package/esm2020/src/lib/api.module.mjs +1 -55
  3. package/esm2020/src/lib/types/index.mjs +1 -3
  4. package/esm2020/src/lib/types/stateful-configuration.types.mjs +1 -1
  5. package/esm2020/v2/api-v2.module.mjs +44 -22
  6. package/esm2020/v2/services/cache-api.service.mjs +22 -0
  7. package/esm2020/v2/services/catalog-admin-api.service.mjs +192 -0
  8. package/esm2020/v2/services/catalog-api.service.mjs +90 -0
  9. package/esm2020/v2/services/configuration-settings-api.service.mjs +89 -0
  10. package/esm2020/v2/services/context-definition-admin-api.service.mjs +73 -0
  11. package/esm2020/v2/services/document-attachment-api.service.mjs +66 -0
  12. package/esm2020/v2/services/endpoints-admin-api.service.mjs +79 -0
  13. package/esm2020/v2/services/flows-api.service.mjs +29 -0
  14. package/esm2020/v2/services/functions-admin-api.service.mjs +116 -0
  15. package/esm2020/v2/services/guided-sellings-admin-api.service.mjs +65 -0
  16. package/esm2020/v2/services/guided-sellings-api.service.mjs +37 -0
  17. package/esm2020/v2/services/index.mjs +22 -11
  18. package/esm2020/v2/services/orchestrations-admin-api.service.mjs +87 -0
  19. package/esm2020/v2/services/orchestrations-api.service.mjs +23 -0
  20. package/esm2020/v2/services/pcm-api.service.mjs +38 -0
  21. package/esm2020/v2/services/picklists-admin-api.service.mjs +41 -0
  22. package/esm2020/v2/services/products-admin-api.service.mjs +90 -0
  23. package/esm2020/v2/services/sales-transactions-api.service.mjs +20 -36
  24. package/esm2020/v2/services/salesforce-api.service.mjs +83 -0
  25. package/esm2020/v2/services/shopping-cart-settings-api.service.mjs +28 -0
  26. package/esm2020/v2/services/ui-definitions-admin-api.service.mjs +70 -0
  27. package/esm2020/v2/services/ui-templates-admin-api.service.mjs +286 -0
  28. package/esm2020/v2/services/veloce-objects-api.service.mjs +90 -0
  29. package/esm2020/v2/types/attachment.types.mjs +2 -0
  30. package/esm2020/v2/types/dto/configuration-settings-dto.types.mjs +22 -0
  31. package/esm2020/v2/types/dto/ui-definition-dto.types.mjs +2 -0
  32. package/esm2020/v2/types/function.types.mjs +2 -0
  33. package/esm2020/v2/types/index.mjs +4 -1
  34. package/esm2020/v2/types/pcm.types.mjs +2 -0
  35. package/esm2020/v2/types/procedure.types.mjs +1 -1
  36. package/esm2020/v2/types/sales-transaction.types.mjs +1 -1
  37. package/esm2020/v2/types/search-request.types.mjs +2 -0
  38. package/esm2020/v2/utils/ui-definition.utils.mjs +23 -0
  39. package/fesm2015/veloceapps-api-v2.mjs +1127 -411
  40. package/fesm2015/veloceapps-api-v2.mjs.map +1 -1
  41. package/fesm2015/veloceapps-api.mjs +68 -1476
  42. package/fesm2015/veloceapps-api.mjs.map +1 -1
  43. package/fesm2020/veloceapps-api-v2.mjs +1255 -460
  44. package/fesm2020/veloceapps-api-v2.mjs.map +1 -1
  45. package/fesm2020/veloceapps-api.mjs +107 -1593
  46. package/fesm2020/veloceapps-api.mjs.map +1 -1
  47. package/package.json +1 -1
  48. package/src/index.d.ts +0 -18
  49. package/src/lib/types/index.d.ts +0 -2
  50. package/src/lib/types/stateful-configuration.types.d.ts +1 -2
  51. package/v2/services/cache-api.service.d.ts +11 -0
  52. package/{src/lib → v2}/services/catalog-admin-api.service.d.ts +2 -2
  53. package/{src/lib → v2}/services/catalog-api.service.d.ts +5 -5
  54. package/{src/lib → v2}/services/configuration-settings-api.service.d.ts +1 -2
  55. package/v2/services/{context-definition-api.service.d.ts → context-definition-admin-api.service.d.ts} +5 -4
  56. package/{src/lib → v2}/services/document-attachment-api.service.d.ts +1 -1
  57. package/{src/lib/services/endpoints-api.service.d.ts → v2/services/endpoints-admin-api.service.d.ts} +3 -4
  58. package/v2/services/functions-admin-api.service.d.ts +25 -0
  59. package/v2/services/index.d.ts +21 -10
  60. package/v2/services/orchestrations-admin-api.service.d.ts +21 -0
  61. package/v2/services/orchestrations-api.service.d.ts +12 -0
  62. package/v2/services/pcm-api.service.d.ts +12 -0
  63. package/{src/lib/services/picklists-api.service.d.ts → v2/services/picklists-admin-api.service.d.ts} +3 -3
  64. package/v2/services/products-admin-api.service.d.ts +21 -0
  65. package/v2/services/sales-transactions-api.service.d.ts +11 -5
  66. package/{src/lib → v2}/services/salesforce-api.service.d.ts +1 -0
  67. package/v2/services/ui-definitions-admin-api.service.d.ts +18 -0
  68. package/v2/services/{ui-templates-api.service.d.ts → ui-templates-admin-api.service.d.ts} +3 -3
  69. package/{src/lib → v2}/services/veloce-objects-api.service.d.ts +3 -3
  70. package/v2/types/dto/ui-definition-dto.types.d.ts +7 -0
  71. package/v2/types/function.types.d.ts +14 -0
  72. package/v2/types/index.d.ts +3 -0
  73. package/v2/types/pcm.types.d.ts +10 -0
  74. package/v2/types/procedure.types.d.ts +58 -7
  75. package/v2/types/sales-transaction.types.d.ts +6 -3
  76. package/v2/types/search-request.types.d.ts +8 -0
  77. package/v2/utils/ui-definition.utils.d.ts +5 -0
  78. package/esm2020/src/lib/services/catalog-admin-api.service.mjs +0 -192
  79. package/esm2020/src/lib/services/catalog-api.service.mjs +0 -90
  80. package/esm2020/src/lib/services/configuration-api.service.mjs +0 -122
  81. package/esm2020/src/lib/services/configuration-settings-api.service.mjs +0 -96
  82. package/esm2020/src/lib/services/delta-api.service.mjs +0 -23
  83. package/esm2020/src/lib/services/document-attachment-api.service.mjs +0 -66
  84. package/esm2020/src/lib/services/endpoints-api.service.mjs +0 -80
  85. package/esm2020/src/lib/services/flows-api.service.mjs +0 -29
  86. package/esm2020/src/lib/services/guided-sellings-admin-api.service.mjs +0 -65
  87. package/esm2020/src/lib/services/guided-sellings-api.service.mjs +0 -37
  88. package/esm2020/src/lib/services/picklists-api.service.mjs +0 -41
  89. package/esm2020/src/lib/services/price-api.service.mjs +0 -63
  90. package/esm2020/src/lib/services/product-api.service.mjs +0 -153
  91. package/esm2020/src/lib/services/product-model-api.service.mjs +0 -223
  92. package/esm2020/src/lib/services/ramp-api.service.mjs +0 -31
  93. package/esm2020/src/lib/services/salesforce-api.service.mjs +0 -79
  94. package/esm2020/src/lib/services/shopping-cart-settings-api.service.mjs +0 -28
  95. package/esm2020/src/lib/services/veloce-objects-api.service.mjs +0 -90
  96. package/esm2020/src/lib/types/attachment.types.mjs +0 -2
  97. package/esm2020/src/lib/types/dto/configuration-settings-dto.types.mjs +0 -22
  98. package/esm2020/src/lib/types/price.types.mjs +0 -2
  99. package/esm2020/src/lib/types/quote.types.mjs +0 -2
  100. package/esm2020/src/lib/types/ramp-request.types.mjs +0 -2
  101. package/esm2020/v2/services/context-definition-api.service.mjs +0 -62
  102. package/esm2020/v2/services/procedures-admin-api.service.mjs +0 -82
  103. package/esm2020/v2/services/procedures-api.service.mjs +0 -44
  104. package/esm2020/v2/services/rule-groups-admin-api.service.mjs +0 -62
  105. package/esm2020/v2/services/rules-admin-api.service.mjs +0 -98
  106. package/esm2020/v2/services/rules-api.service.mjs +0 -36
  107. package/esm2020/v2/services/scripts-admin-api.service.mjs +0 -75
  108. package/esm2020/v2/services/scripts-api.service.mjs +0 -23
  109. package/esm2020/v2/services/ui-definitions-api.service.mjs +0 -132
  110. package/esm2020/v2/services/ui-templates-api.service.mjs +0 -286
  111. package/src/lib/services/configuration-api.service.d.ts +0 -23
  112. package/src/lib/services/delta-api.service.d.ts +0 -12
  113. package/src/lib/services/price-api.service.d.ts +0 -16
  114. package/src/lib/services/product-api.service.d.ts +0 -31
  115. package/src/lib/services/product-model-api.service.d.ts +0 -29
  116. package/src/lib/services/ramp-api.service.d.ts +0 -13
  117. package/src/lib/types/price.types.d.ts +0 -5
  118. package/src/lib/types/quote.types.d.ts +0 -8
  119. package/src/lib/types/ramp-request.types.d.ts +0 -13
  120. package/v2/services/procedures-admin-api.service.d.ts +0 -23
  121. package/v2/services/procedures-api.service.d.ts +0 -15
  122. package/v2/services/rule-groups-admin-api.service.d.ts +0 -18
  123. package/v2/services/rules-admin-api.service.d.ts +0 -22
  124. package/v2/services/rules-api.service.d.ts +0 -11
  125. package/v2/services/scripts-admin-api.service.d.ts +0 -20
  126. package/v2/services/scripts-api.service.d.ts +0 -11
  127. package/v2/services/ui-definitions-api.service.d.ts +0 -24
  128. /package/{src/lib → v2}/services/flows-api.service.d.ts +0 -0
  129. /package/{src/lib → v2}/services/guided-sellings-admin-api.service.d.ts +0 -0
  130. /package/{src/lib → v2}/services/guided-sellings-api.service.d.ts +0 -0
  131. /package/{src/lib → v2}/services/shopping-cart-settings-api.service.d.ts +0 -0
  132. /package/{src/lib → v2}/types/attachment.types.d.ts +0 -0
  133. /package/{src/lib → v2}/types/dto/configuration-settings-dto.types.d.ts +0 -0
@@ -1,14 +1,13 @@
1
1
  import * as i1$1 from '@angular/common/http';
2
- import { HttpParams, HttpHeaders, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
2
+ import { HttpParams, HttpHeaders, HttpClientModule } from '@angular/common/http';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Injectable, NgModule } from '@angular/core';
5
5
  import { ApiV2Module } from '@veloceapps/api/v2';
6
6
  import * as i1 from '@veloceapps/core';
7
- import { uiDefinitionFromDTO, DomainComputation, Expression, Operator, isApexError, isCanvasError, ModelTranslatorUtils, EntityUtil, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
8
- import { noop, throwError, switchMap, of, map as map$1, from, catchError as catchError$1 } from 'rxjs';
9
- import { map, catchError, tap } from 'rxjs/operators';
10
- import * as i1$2 from 'primeng/api';
7
+ import { isApexError, isCanvasError, BaseHttpService, XrayService } from '@veloceapps/core';
8
+ import { map, from, catchError, of } from 'rxjs';
11
9
  import { isArray } from 'lodash';
10
+ import * as i1$2 from 'primeng/api';
12
11
 
13
12
  class AccountApiService {
14
13
  constructor(httpService) {
@@ -77,458 +76,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
77
76
  type: Injectable
78
77
  }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
79
78
 
80
- class CatalogAdminApiService {
81
- constructor(baseHttpService) {
82
- this.baseHttpService = baseHttpService;
83
- this.serviceUrl = '/catalogs';
84
- this.fetchCatalogs$ = (searchParams) => {
85
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
86
- return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
87
- };
88
- this.searchCatalogs$ = (searchParams, expression) => {
89
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
90
- return this.baseHttpService.api({
91
- method: 'post',
92
- url: `${this.serviceUrl}/search`,
93
- params,
94
- body: expression || {},
95
- });
96
- };
97
- this.fetchCategories$ = (catalogId) => {
98
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories` });
99
- };
100
- this.searchProducts$ = (catalogId, categoryId) => {
101
- return this.baseHttpService.api({
102
- method: 'post',
103
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
104
- body: {},
105
- });
106
- };
107
- this.fetchAttributes$ = (catalogId, categoryId) => {
108
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes` });
109
- };
110
- this.createNewCatalog$ = (catalogData) => {
111
- return this.baseHttpService.api({
112
- url: `${this.serviceUrl}`,
113
- method: 'post',
114
- body: catalogData,
115
- });
116
- };
117
- this.duplicateCatalog$ = (cloneRequest) => {
118
- return this.baseHttpService.api({
119
- url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
120
- method: 'post',
121
- body: cloneRequest,
122
- });
123
- };
124
- this.updateCatalog$ = (data) => {
125
- return this.baseHttpService.api({
126
- url: `${this.serviceUrl}/${data.id}`,
127
- method: 'put',
128
- body: data,
129
- });
130
- };
131
- this.removeCatalog$ = (id) => {
132
- return this.baseHttpService.api({
133
- url: `${this.serviceUrl}/${id}`,
134
- method: 'delete',
135
- });
136
- };
137
- this.restoreCatalog$ = (id) => {
138
- return this.baseHttpService.api({
139
- url: `${this.serviceUrl}/${id}/restore`,
140
- method: 'patch',
141
- });
142
- };
143
- this.createNewCategory$ = (categoryData) => {
144
- return this.baseHttpService.api({
145
- url: `${this.serviceUrl}/${categoryData.catalogId}/categories`,
146
- method: 'post',
147
- body: categoryData,
148
- });
149
- };
150
- this.updateCategory$ = (category) => {
151
- return this.baseHttpService.api({
152
- url: `${this.serviceUrl}/${category.catalogId}/categories/${category.id}`,
153
- method: 'put',
154
- body: category,
155
- });
156
- };
157
- this.duplicateCategory$ = (catalogId, cloneRequest) => {
158
- return this.baseHttpService.api({
159
- url: `${this.serviceUrl}/${catalogId}/categories/${cloneRequest.id}/clone`,
160
- method: 'post',
161
- body: cloneRequest,
162
- });
163
- };
164
- this.removeCategory$ = (id, catalogId) => {
165
- return this.baseHttpService.api({
166
- url: `${this.serviceUrl}/${catalogId}/categories/${id}`,
167
- method: 'delete',
168
- });
169
- };
170
- this.restoreCategory$ = (id, catalogId) => {
171
- return this.baseHttpService.api({
172
- url: `${this.serviceUrl}/${catalogId}/categories/${id}/restore`,
173
- method: 'patch',
174
- });
175
- };
176
- this.removeAttribute$ = ({ catalogId, categoryId, data, }) => {
177
- return this.baseHttpService.api({
178
- method: 'delete',
179
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
180
- body: data,
181
- });
182
- };
183
- this.restoreAttribute$ = ({ catalogId, categoryId, data, }) => {
184
- return this.baseHttpService.api({
185
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}/restore`,
186
- method: 'patch',
187
- });
188
- };
189
- this.createNewAttribute$ = ({ catalogId, categoryId, data, }) => {
190
- return this.baseHttpService.api({
191
- method: 'post',
192
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes`,
193
- body: data,
194
- });
195
- };
196
- this.updateAttribute$ = ({ catalogId, categoryId, data, }) => {
197
- return this.baseHttpService.api({
198
- method: 'put',
199
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
200
- body: data,
201
- });
202
- };
203
- this.searchProductCandidates$ = (catalogId, categoryId, expression, searchParams) => {
204
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
205
- return this.baseHttpService.api({
206
- method: 'post',
207
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/candidates/search`,
208
- params,
209
- body: expression,
210
- });
211
- };
212
- this.addProduct$ = (product, catalogId, categoryId) => {
213
- return this.baseHttpService.api({
214
- method: 'post',
215
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
216
- body: product,
217
- });
218
- };
219
- this.updateProduct$ = (product, catalogId, categoryId) => {
220
- return this.baseHttpService.api({
221
- method: 'put',
222
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/${product.id}`,
223
- body: product,
224
- });
225
- };
226
- this.removeProduct$ = ({ catalogId, categoryId, data, }) => {
227
- return this.baseHttpService.api({
228
- method: 'delete',
229
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/${data.id}`,
230
- });
231
- };
232
- }
233
- attachImage$(catalogId, categoryId, file) {
234
- const data = new FormData();
235
- data.append('image', file);
236
- return this.baseHttpService.upload({
237
- method: 'post',
238
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
239
- body: data,
240
- });
241
- }
242
- removeImage$(catalogId, categoryId) {
243
- return this.baseHttpService.api({
244
- method: 'delete',
245
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
246
- });
247
- }
248
- fetchImage$(catalogId, categoryId) {
249
- return this.baseHttpService.api({
250
- url: this.getImageUrl(catalogId, categoryId),
251
- method: 'get',
252
- responseType: 'blob',
253
- errorHandler: noop,
254
- });
255
- }
256
- getImageUrl(catalogId, categoryId) {
257
- return `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`;
258
- }
259
- }
260
- CatalogAdminApiService.MAX_RESULTS = 60;
261
- CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
262
- CatalogAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService });
263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, decorators: [{
264
- type: Injectable
265
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
266
-
267
- class CatalogApiService {
268
- constructor(service) {
269
- this.service = service;
270
- this.serviceUrl = '/product-catalogs';
271
- }
272
- fetchCatalogs$() {
273
- return this.service.api({
274
- method: 'get',
275
- url: `${this.serviceUrl}`,
276
- });
277
- }
278
- searchCatalogs$(searchParams, expression) {
279
- const params = new HttpParams({ fromObject: searchParams });
280
- return this.service.api({
281
- method: 'post',
282
- url: `${this.serviceUrl}/search`,
283
- params,
284
- body: expression,
285
- });
286
- }
287
- getCatalog$(id) {
288
- return this.service.api({
289
- method: 'get',
290
- url: `${this.serviceUrl}/${id}`,
291
- });
292
- }
293
- fetchCategories$(catalogId) {
294
- return this.service.api({
295
- method: 'get',
296
- url: `${this.serviceUrl}/${catalogId}/categories`,
297
- });
298
- }
299
- fetchCatalogProducts$(catalogId, searchParams, context) {
300
- const params = new HttpParams({ fromObject: searchParams });
301
- return this.service.api({
302
- method: 'post',
303
- url: `${this.serviceUrl}/${catalogId}/products`,
304
- params,
305
- body: context,
306
- });
307
- }
308
- fetchCategoryProducts$(catalogId, categoryId, searchParams, context) {
309
- const params = new HttpParams({ fromObject: searchParams });
310
- return this.service.api({
311
- method: 'post',
312
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
313
- params,
314
- body: context,
315
- });
316
- }
317
- searchCategoryProducts$(catalogId, categoryId, searchParams, searchRequest, context) {
318
- const params = new HttpParams({ fromObject: searchParams });
319
- return this.service.api({
320
- method: 'post',
321
- url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
322
- params,
323
- body: {
324
- configurationContext: context,
325
- request: searchRequest,
326
- },
327
- });
328
- }
329
- fetchEligibleProducts$(searchParams, context) {
330
- const params = new HttpParams({ fromObject: searchParams });
331
- return this.service.api({
332
- method: 'post',
333
- url: `${this.serviceUrl}/products`,
334
- params: params,
335
- body: context,
336
- });
337
- }
338
- fetchProducts$(searchParams) {
339
- const params = new HttpParams({ fromObject: searchParams });
340
- return this.service.api({
341
- method: 'get',
342
- url: `${this.serviceUrl}/products`,
343
- params: params,
344
- });
345
- }
346
- }
347
- CatalogApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
348
- CatalogApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService });
349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, decorators: [{
350
- type: Injectable
351
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
352
-
353
- class ConfigurationApiService {
354
- constructor(httpService) {
355
- this.httpService = httpService;
356
- this.SERVICE_URL = '/configuration';
357
- }
358
- configureLineItem({ configurationRequest, runtimeModel, pricingEnabled, }) {
359
- return this.httpService
360
- .api({
361
- method: 'post',
362
- url: `${this.SERVICE_URL}${pricingEnabled ? '/price' : ''}`,
363
- body: configurationRequest,
364
- errorHandler: e => throwError(e),
365
- })
366
- .pipe(map(configurePrice => {
367
- if (runtimeModel) {
368
- return Object.assign(Object.assign({}, configurePrice), { lineItem: this.updateDomains(configurePrice.lineItem, runtimeModel) });
369
- }
370
- else {
371
- return configurePrice;
372
- }
373
- }));
374
- }
375
- customConfigurePrice({ url, configurationRequest, runtimeModel, }) {
376
- return this.httpService
377
- .api({
378
- method: 'post',
379
- url,
380
- body: configurationRequest,
381
- errorHandler: e => throwError(e),
382
- })
383
- .pipe(map(configurePrice => {
384
- if (runtimeModel) {
385
- return Object.assign(Object.assign({}, configurePrice), { lineItem: this.updateDomains(configurePrice.lineItem, runtimeModel) });
386
- }
387
- else {
388
- return configurePrice;
389
- }
390
- }));
391
- }
392
- getRuntimeDataByProductId(productId, offeringId, defaultUIDefinitionId, requiredUIDefinitionId) {
393
- return this.httpService
394
- .api({
395
- method: 'get',
396
- url: `${this.SERVICE_URL}/${productId}/model` + ((offeringId && `/${offeringId}`) || ''),
397
- })
398
- .pipe(switchMap(runtimeData => {
399
- if (requiredUIDefinitionId) {
400
- return this.httpService.api({ method: 'get', url: `/uidefinitions/${requiredUIDefinitionId}` }).pipe(map(uiDefinition => {
401
- return Object.assign(Object.assign({}, runtimeData), { uiDefinitions: [uiDefinition] });
402
- }));
403
- }
404
- const params = { productId };
405
- if (defaultUIDefinitionId) {
406
- params['defaultUIDefinitionId'] = defaultUIDefinitionId;
407
- }
408
- return this.httpService.api({ method: 'get', url: `/uidefinitions`, params }).pipe(map(uiDefinitions => {
409
- return Object.assign(Object.assign({}, runtimeData), { uiDefinitions });
410
- }));
411
- }), map(runtimeData => {
412
- return Object.assign(Object.assign({}, runtimeData), { uiDefinitions: runtimeData.uiDefinitions.map(dto => uiDefinitionFromDTO(dto)) });
413
- }));
414
- }
415
- getRuntimeDataByModelId(modelId) {
416
- return this.httpService.api({
417
- method: 'get',
418
- url: `${this.SERVICE_URL}/${modelId}/model-test`,
419
- });
420
- }
421
- updateDomains(lineItem, runtimeModel) {
422
- var _a, _b, _c;
423
- const component = runtimeModel.components.get(lineItem.type);
424
- const portDomains = Object.assign({}, lineItem.portDomains);
425
- // loop through ports to look for 'None' type domain computations
426
- for (const port of (_a = component === null || component === void 0 ? void 0 : component.ports) !== null && _a !== void 0 ? _a : []) {
427
- const portDomain = portDomains[port.name];
428
- if (((_b = portDomain === null || portDomain === void 0 ? void 0 : portDomain.properties) === null || _b === void 0 ? void 0 : _b['domainComputation']) === DomainComputation.NONE) {
429
- portDomain.domainTypes = port.domainTypes;
430
- }
431
- }
432
- const type = runtimeModel.types.find(({ name }) => {
433
- return lineItem.type === name;
434
- });
435
- const attributeDomains = lineItem.attributeDomains;
436
- if (type) {
437
- const initialDomains = lineItem.attributeDomains;
438
- type.attributes.forEach(attribute => {
439
- if (Object.prototype.hasOwnProperty.call(initialDomains, attribute.name)) {
440
- return;
441
- }
442
- if (attribute.attributeDomain) {
443
- attributeDomains[attribute.name] = attribute.attributeDomain;
444
- }
445
- });
446
- }
447
- return Object.assign(Object.assign({}, lineItem), { lineItems: (_c = lineItem.lineItems) === null || _c === void 0 ? void 0 : _c.map(i => this.updateDomains(i, runtimeModel)), attributeDomains,
448
- portDomains });
449
- }
450
- }
451
- ConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
452
- ConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService });
453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, decorators: [{
454
- type: Injectable
455
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
456
-
457
- class ConfigurationSettingsDTO {
458
- static fromDTO(dto, key) {
459
- return {
460
- id: dto === null || dto === void 0 ? void 0 : dto.id,
461
- key: (dto === null || dto === void 0 ? void 0 : dto.key) || key || '',
462
- value: dto === null || dto === void 0 ? void 0 : dto.value,
463
- };
464
- }
465
- static toDTO(data) {
466
- return {
467
- id: data.id,
468
- key: data.key,
469
- value: data.value,
470
- };
471
- }
472
- constructor(id, key, value) {
473
- this.id = id;
474
- this.key = key;
475
- this.value = value;
476
- }
477
- }
478
-
479
- class ConfigurationSettingsApiService {
480
- constructor(httpService, messageService) {
481
- this.httpService = httpService;
482
- this.messageService = messageService;
483
- this.SERVICE_URL = '/configuration-settings';
484
- }
485
- fetchSettings(options) {
486
- return this.httpService
487
- .api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'get' }, options))
488
- .pipe(map((settings) => settings.map(setting => ConfigurationSettingsDTO.fromDTO(setting))));
489
- }
490
- fetchSetting(settingsKey, options) {
491
- return this.httpService
492
- .api(Object.assign(Object.assign({ url: `${this.SERVICE_URL}/byKey/${settingsKey}`, method: 'get' }, options), { skipErrorHandler: true }))
493
- .pipe(map((setting) => ConfigurationSettingsDTO.fromDTO(setting, settingsKey)), catchError(err => {
494
- if (err instanceof HttpErrorResponse && err.status === 404) {
495
- if (!(options === null || options === void 0 ? void 0 : options.skipErrorHandler)) {
496
- this.messageService.add({
497
- severity: 'error',
498
- summary: `Configuration Setting "${settingsKey}" is not found`,
499
- sticky: true,
500
- });
501
- }
502
- return of(null);
503
- }
504
- throw err;
505
- }));
506
- }
507
- createSetting(setting, options) {
508
- const request = ConfigurationSettingsDTO.toDTO(setting);
509
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'post', body: Object.assign({}, request) }, options));
510
- }
511
- updateSetting(setting, options) {
512
- const request = ConfigurationSettingsDTO.toDTO(setting);
513
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'put', body: Object.assign({}, request) }, options));
514
- }
515
- removeSetting(setting, options) {
516
- const request = ConfigurationSettingsDTO.toDTO(setting);
517
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'delete' }, options));
518
- }
519
- restoreSetting(settingId, options) {
520
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${settingId}/restore`, method: 'patch' }, options));
521
- }
522
- clear(name, options) {
523
- return this.httpService.api(Object.assign({ method: 'get', url: '/cache/evict/' + name }, options));
524
- }
525
- }
526
- ConfigurationSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, deps: [{ token: i1.BaseHttpService }, { token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
527
- ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
528
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
529
- type: Injectable
530
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1$2.MessageService }]; } });
531
-
532
79
  class ContractedPriceApiService {
533
80
  constructor(baseHttpService) {
534
81
  this.baseHttpService = baseHttpService;
@@ -570,163 +117,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
570
117
  type: Injectable
571
118
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
572
119
 
573
- class DeltaApiService {
574
- constructor(httpService) {
575
- this.httpService = httpService;
576
- this.SERVICE_URL = '/delta';
577
- }
578
- calculate$(request) {
579
- return this.httpService.api({
580
- method: 'post',
581
- url: `${this.SERVICE_URL}/calculate`,
582
- body: request,
583
- skipErrorHandler: true,
584
- });
585
- }
586
- }
587
- DeltaApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
588
- DeltaApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService });
589
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, decorators: [{
590
- type: Injectable
591
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
592
-
593
- class DocumentAttachmentApiService {
594
- constructor(httpService, fileDownloadService) {
595
- this.httpService = httpService;
596
- this.fileDownloadService = fileDownloadService;
597
- this.SERVICE_URL = '/attachments';
598
- }
599
- getAttachments(searchRequest) {
600
- return this.httpService.api({
601
- url: `${this.SERVICE_URL}/search`,
602
- method: 'post',
603
- body: searchRequest,
604
- });
605
- }
606
- createAttachment(attachment, file, reportProgress) {
607
- const formData = new FormData();
608
- if (file) {
609
- formData.append('file', file, file.name);
610
- }
611
- formData.append('attachment', new Blob([JSON.stringify(attachment)], {
612
- type: 'application/json',
613
- }));
614
- return this.httpService.upload({
615
- url: `${this.SERVICE_URL}`,
616
- body: formData,
617
- method: 'post',
618
- observe: reportProgress ? 'events' : undefined,
619
- reportProgress,
620
- });
621
- }
622
- updateAttachment(id, attachment) {
623
- return this.httpService.api({
624
- url: `${this.SERVICE_URL}/${id}`,
625
- body: attachment,
626
- method: 'put',
627
- });
628
- }
629
- getAttachmentFile(id, isPreventDownload) {
630
- return this.httpService
631
- .api({
632
- url: `${this.SERVICE_URL}/${id}/file`,
633
- responseType: isPreventDownload ? 'arraybuffer' : 'blob',
634
- observe: isPreventDownload ? 'body' : 'response',
635
- })
636
- .pipe(tap(response => {
637
- if (!isPreventDownload) {
638
- this.fileDownloadService.processDownload(response);
639
- }
640
- }), map(response => (isPreventDownload ? new Blob([response.body || response]) : response.body || response)));
641
- }
642
- removeAttachment(id) {
643
- return this.httpService.api({
644
- url: `${this.SERVICE_URL}/${id}`,
645
- method: 'delete',
646
- });
647
- }
648
- }
649
- 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 });
650
- DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService });
651
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
652
- type: Injectable
653
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
654
-
655
- class EndpointsApiService {
656
- constructor(baseHttpService) {
657
- this.baseHttpService = baseHttpService;
658
- this.adminServiceUrl = '/admin/api-endpoints';
659
- this.serviceUrl = '/api-endpoints';
660
- }
661
- fetchEndpoints$() {
662
- return this.searchEndpoints$(new Expression(), 0, -1);
663
- }
664
- searchEndpoints$(expression, skip, count) {
665
- let params = new HttpParams();
666
- params = params.set('skip', '' + skip);
667
- params = params.set('count', '' + count);
668
- return this.baseHttpService.api({
669
- method: 'post',
670
- url: `${this.adminServiceUrl}/search`,
671
- params,
672
- body: expression,
673
- });
674
- }
675
- removeEndpoint$(id) {
676
- return this.baseHttpService.api({
677
- url: `${this.adminServiceUrl}/${id}`,
678
- method: 'delete',
679
- });
680
- }
681
- restoreEndpoint$(id) {
682
- return this.baseHttpService.api({
683
- url: `${this.adminServiceUrl}/${id}/restore`,
684
- method: 'patch',
685
- });
686
- }
687
- fetchEndpoint$(id) {
688
- return this.baseHttpService.api({
689
- url: `${this.adminServiceUrl}/${id}`,
690
- method: 'get',
691
- });
692
- }
693
- createEndpoint$(body) {
694
- return this.baseHttpService.api({
695
- url: `${this.adminServiceUrl}`,
696
- method: 'post',
697
- body,
698
- });
699
- }
700
- updateEndpoint$(body) {
701
- return this.baseHttpService.api({
702
- url: `${this.adminServiceUrl}/${body.id}`,
703
- method: 'put',
704
- body,
705
- });
706
- }
707
- duplicateEndpoint$(cloneRequest) {
708
- return this.baseHttpService.api({
709
- url: `${this.adminServiceUrl}/${cloneRequest.id}/clone`,
710
- method: 'post',
711
- body: cloneRequest,
712
- });
713
- }
714
- executeEndpoint$(body) {
715
- return this.baseHttpService.api({
716
- url: `${this.serviceUrl}/execute`,
717
- method: 'post',
718
- body,
719
- responseType: 'text',
720
- skipErrorHandler: true,
721
- });
722
- }
723
- }
724
- EndpointsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
725
- EndpointsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService });
726
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, decorators: [{
727
- type: Injectable
728
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
729
-
730
120
  class FlowStateApiService {
731
121
  constructor(httpService) {
732
122
  this.httpService = httpService;
@@ -866,124 +256,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
866
256
  type: Injectable
867
257
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
868
258
 
869
- class FlowsApiService {
870
- constructor(configurationSettingsApiService) {
871
- this.configurationSettingsApiService = configurationSettingsApiService;
872
- this.flowsKey = 'flows';
873
- }
874
- getFlow(id) {
875
- return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
876
- if (!flow) {
877
- throw new Error(`Flow with flowId=${id} is not defined`);
878
- }
879
- return flow;
880
- }));
881
- }
882
- fetchFlows() {
883
- return this.configurationSettingsApiService
884
- .fetchSetting(this.flowsKey)
885
- .pipe(map((setting) => ((setting === null || setting === void 0 ? void 0 : setting.value) ? JSON.parse(setting.value) : [])));
886
- }
887
- }
888
- FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
889
- FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
890
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
891
- type: Injectable
892
- }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
893
-
894
- class GuidedSellingsAdminApiService {
895
- constructor(baseHttpService) {
896
- this.baseHttpService = baseHttpService;
897
- this.serviceUrl = '/admin/guided-selling';
898
- this.fetchGuidedSellings$ = (searchParams) => {
899
- return this.searchGuidedSellings$(searchParams);
900
- };
901
- this.searchGuidedSellings$ = (searchParams, expression) => {
902
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
903
- return this.baseHttpService.api({
904
- method: 'post',
905
- url: `${this.serviceUrl}/search`,
906
- params,
907
- body: expression || {},
908
- });
909
- };
910
- this.fetchGuidedSelling$ = (id) => {
911
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
912
- };
913
- this.createNewGuidedSelling$ = (guidedSelling) => {
914
- return this.baseHttpService.api({
915
- url: `${this.serviceUrl}`,
916
- method: 'post',
917
- body: guidedSelling,
918
- });
919
- };
920
- this.duplicateGuidedSelling$ = (cloneRequest) => {
921
- return this.baseHttpService.api({
922
- url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
923
- method: 'post',
924
- body: cloneRequest,
925
- });
926
- };
927
- this.updateGuidedSelling$ = (data) => {
928
- return this.baseHttpService.api({
929
- url: `${this.serviceUrl}/${data.id}`,
930
- method: 'put',
931
- body: data,
932
- });
933
- };
934
- this.removeGuidedSelling$ = (id) => {
935
- return this.baseHttpService.api({
936
- url: `${this.serviceUrl}/${id}`,
937
- method: 'delete',
938
- });
939
- };
940
- this.restoreGuidedSelling$ = (id) => {
941
- return this.baseHttpService.api({
942
- url: `${this.serviceUrl}/${id}/restore`,
943
- method: 'patch',
944
- });
945
- };
946
- }
947
- }
948
- GuidedSellingsAdminApiService.MAX_RESULTS = 60;
949
- GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
950
- GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService });
951
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
952
- type: Injectable
953
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
954
-
955
- class GuidedSellingApiService {
956
- constructor(http) {
957
- this.http = http;
958
- this.serviceUrl = '/guided-selling';
959
- }
960
- searchByName$(name, searchParams) {
961
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
962
- const expression = new Expression(undefined, [{ key: 'name', operator: Operator.EQ, value: name }]);
963
- return this.http.api({
964
- method: 'post',
965
- url: `${this.serviceUrl}/search`,
966
- params,
967
- body: expression || {},
968
- });
969
- }
970
- searchById$(id, searchParams) {
971
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
972
- const expression = new Expression(undefined, [{ key: 'id', operator: Operator.EQ, value: id }]);
973
- return this.http.api({
974
- method: 'post',
975
- url: `${this.serviceUrl}/search`,
976
- params,
977
- body: expression || {},
978
- });
979
- }
980
- }
981
- GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
982
- GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService });
983
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, decorators: [{
984
- type: Injectable
985
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
986
-
987
259
  class OffersApiService {
988
260
  constructor(baseHttpService) {
989
261
  this.baseHttpService = baseHttpService;
@@ -1035,7 +307,7 @@ class OffersApiService {
1035
307
  .api({
1036
308
  url: `${this.serviceUrl}/${id}/products`,
1037
309
  })
1038
- .pipe(map$1(response => response.products));
310
+ .pipe(map(response => response.products));
1039
311
  }
1040
312
  upsertOfferProducts$(id, products) {
1041
313
  const request = { products };
@@ -1045,7 +317,7 @@ class OffersApiService {
1045
317
  method: 'put',
1046
318
  body: request,
1047
319
  })
1048
- .pipe(map$1(response => response.products));
320
+ .pipe(map(response => response.products));
1049
321
  }
1050
322
  }
1051
323
  OffersApiService.MAX_RESULTS = 60;
@@ -1101,7 +373,7 @@ class OrgInfoApiService {
1101
373
  getOrgInfo$() {
1102
374
  try {
1103
375
  return window.doCanvasCall && window.ORGANIZATION_ID
1104
- ? from(window.doCanvasCall(`org-info/${window.ORGANIZATION_ID}`, null)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
376
+ ? from(window.doCanvasCall(`org-info/${window.ORGANIZATION_ID}`, null)).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1105
377
  : of(undefined);
1106
378
  }
1107
379
  catch (_a) {
@@ -1109,559 +381,98 @@ class OrgInfoApiService {
1109
381
  }
1110
382
  }
1111
383
  getAvailableVersionsInfo$() {
1112
- try {
1113
- return window.doCanvasCall && window.ORGANIZATION_ID
1114
- ? from(window.doCanvasCall('versions/available', 'include_all=true')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1115
- : of(undefined);
1116
- }
1117
- catch (_a) {
1118
- return of(undefined);
1119
- }
1120
- }
1121
- upgradeVersion$(targetVersion) {
1122
- try {
1123
- return window.doCanvasCall && window.ORGANIZATION_ID
1124
- ? from(window.doCanvasCall('versions/upgrade', `target_version=${targetVersion}`)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1125
- : of(undefined);
1126
- }
1127
- catch (_a) {
1128
- return of(undefined);
1129
- }
1130
- }
1131
- }
1132
- OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
1133
- OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
1134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
1135
- type: Injectable
1136
- }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
1137
-
1138
- class PicklistsApiService {
1139
- constructor(baseHttpService) {
1140
- this.baseHttpService = baseHttpService;
1141
- this.serviceUrl = '/admin';
1142
- this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}/picklists` });
1143
- this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/picklists/${code}` });
1144
- this.createPicklist$ = (picklist) => {
1145
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/picklists`, body: picklist });
1146
- };
1147
- this.updatePicklist$ = (picklist) => {
1148
- return this.baseHttpService.api({
1149
- method: 'put',
1150
- url: `${this.serviceUrl}/picklists/${picklist.id}`,
1151
- body: picklist,
1152
- });
1153
- };
1154
- this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/picklists/${id}` });
1155
- this.restorePicklist$ = (id) => {
1156
- return this.baseHttpService.api({
1157
- url: `${this.serviceUrl}/picklists/${id}/restore`,
1158
- method: 'patch',
1159
- });
1160
- };
1161
- this.addPicklistValue$ = (picklist, value) => {
1162
- const data = Object.assign(Object.assign({}, picklist), { values: [...picklist.values, value] });
1163
- return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/picklists/${picklist.id}`, body: data });
1164
- };
1165
- }
1166
- }
1167
- PicklistsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1168
- PicklistsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService });
1169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, decorators: [{
1170
- type: Injectable
1171
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1172
-
1173
- class PortalsApiService {
1174
- constructor(baseHttpService) {
1175
- this.baseHttpService = baseHttpService;
1176
- this.serviceUrl = '/admin/portal';
1177
- this.getPortals$ = (skip = 1, name = '') => {
1178
- let params = new HttpParams();
1179
- params = params.append('count', (PortalsApiService.MAX_RESULTS * skip).toString());
1180
- params = params.append('skip', '0');
1181
- params = params.append('name', name);
1182
- return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1183
- };
1184
- this.searchPortals$ = (skip = 0, expression) => {
1185
- let params = new HttpParams();
1186
- params = params.set('skip', '' + skip);
1187
- params = params.set('count', '' + PortalsApiService.MAX_RESULTS);
1188
- return this.baseHttpService.api({
1189
- method: 'post',
1190
- url: `${this.serviceUrl}/search`,
1191
- params,
1192
- body: expression || {},
1193
- });
1194
- };
1195
- this.removePortal$ = (id) => {
1196
- return this.baseHttpService.api({
1197
- url: `${this.serviceUrl}/${id}`,
1198
- method: 'delete',
1199
- });
1200
- };
1201
- this.restore$ = (id) => {
1202
- return this.baseHttpService.api({
1203
- method: 'patch',
1204
- url: `${this.serviceUrl}/${id}/restore`,
1205
- });
1206
- };
1207
- this.duplicatePortal$ = (cloneRequest) => {
1208
- return this.baseHttpService.api({
1209
- url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
1210
- method: 'post',
1211
- body: cloneRequest,
1212
- });
1213
- };
1214
- this.getPortal$ = (id) => {
1215
- return this.baseHttpService.api({
1216
- url: `${this.serviceUrl}/${id}`,
1217
- });
1218
- };
1219
- }
1220
- createNewPortal$(body) {
1221
- return this.baseHttpService.api({
1222
- url: `${this.serviceUrl}`,
1223
- method: 'post',
1224
- body,
1225
- });
1226
- }
1227
- updatePortal$(portal, settings) {
1228
- return this.baseHttpService.api({
1229
- url: `${this.serviceUrl}/${portal.id}`,
1230
- method: 'put',
1231
- body: Object.assign(Object.assign({}, portal), { settings: JSON.stringify(settings) }),
1232
- });
1233
- }
1234
- }
1235
- PortalsApiService.MAX_RESULTS = 60;
1236
- PortalsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1237
- PortalsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService });
1238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, decorators: [{
1239
- type: Injectable
1240
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1241
-
1242
- class PriceApiService {
1243
- constructor(httpService) {
1244
- this.httpService = httpService;
1245
- this.SERVICE_URL = '/price';
1246
- }
1247
- calculate(request) {
1248
- return this.httpService.api({
1249
- method: 'post',
1250
- url: `${this.SERVICE_URL}/calculate`,
1251
- body: request,
1252
- skipErrorHandler: true,
1253
- });
1254
- }
1255
- getPriceLists() {
1256
- return this.httpService.api({
1257
- method: 'get',
1258
- url: '/price-lists',
1259
- });
1260
- }
1261
- getPriceList(id) {
1262
- return this.httpService.api({
1263
- method: 'get',
1264
- url: `/price-lists/${id}`,
1265
- });
1266
- }
1267
- getSellingTermByEndDate(planId, offeringId, startDate, endDate, frequencyUnit, frequencyDuration) {
1268
- return this.httpService.api({
1269
- method: 'post',
1270
- url: `${this.SERVICE_URL}/selling-term-by-end-date`,
1271
- body: {
1272
- planId: planId,
1273
- offeringId: offeringId,
1274
- startDate: startDate,
1275
- endDate: endDate,
1276
- frequencyUnit: frequencyUnit,
1277
- frequencyDuration: frequencyDuration,
1278
- },
1279
- });
384
+ try {
385
+ return window.doCanvasCall && window.ORGANIZATION_ID
386
+ ? from(window.doCanvasCall('versions/available', 'include_all=true')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
387
+ : of(undefined);
388
+ }
389
+ catch (_a) {
390
+ return of(undefined);
391
+ }
1280
392
  }
1281
- getSellingTermByTerm(planId, offeringId, startDate, term, frequencyUnit, frequencyDuration) {
1282
- return this.httpService.api({
1283
- method: 'post',
1284
- url: `${this.SERVICE_URL}/selling-term-by-term`,
1285
- body: {
1286
- planId: planId,
1287
- offeringId: offeringId,
1288
- startDate: startDate,
1289
- term: term,
1290
- frequencyUnit: frequencyUnit,
1291
- frequencyDuration: frequencyDuration,
1292
- },
1293
- });
393
+ upgradeVersion$(targetVersion) {
394
+ try {
395
+ return window.doCanvasCall && window.ORGANIZATION_ID
396
+ ? from(window.doCanvasCall('versions/upgrade', `target_version=${targetVersion}`)).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
397
+ : of(undefined);
398
+ }
399
+ catch (_a) {
400
+ return of(undefined);
401
+ }
1294
402
  }
1295
403
  }
1296
- PriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1297
- PriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService });
1298
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, decorators: [{
404
+ OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
405
+ OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
1299
407
  type: Injectable
1300
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
408
+ }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
1301
409
 
1302
- class ProductApiService {
410
+ class PortalsApiService {
1303
411
  constructor(baseHttpService) {
1304
412
  this.baseHttpService = baseHttpService;
1305
- this.serviceUrl = '/products';
1306
- this.fetchProducts$ = (payload) => {
413
+ this.serviceUrl = '/admin/portal';
414
+ this.getPortals$ = (skip = 1, name = '') => {
1307
415
  let params = new HttpParams();
1308
- params = params.append('count', payload.count);
1309
- params = params.append('skip', payload.skip);
1310
- if (payload.name) {
1311
- params = params.append('name', payload.name);
1312
- }
416
+ params = params.append('count', (PortalsApiService.MAX_RESULTS * skip).toString());
417
+ params = params.append('skip', '0');
418
+ params = params.append('name', name);
1313
419
  return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1314
420
  };
1315
- this.searchProducts$ = (expression, skip, count) => {
421
+ this.searchPortals$ = (skip = 0, expression) => {
1316
422
  let params = new HttpParams();
1317
423
  params = params.set('skip', '' + skip);
1318
- params = params.set('count', '' + count);
424
+ params = params.set('count', '' + PortalsApiService.MAX_RESULTS);
1319
425
  return this.baseHttpService.api({
1320
426
  method: 'post',
1321
427
  url: `${this.serviceUrl}/search`,
1322
- params: params,
1323
- body: expression,
1324
- });
1325
- };
1326
- this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1327
- this.fetchAttributes$ = () => {
1328
- return this.baseHttpService.api({ url: `${this.serviceUrl}/attributes/definition` });
1329
- };
1330
- this.searchAttributes$ = (expression, skip, count) => {
1331
- let params = new HttpParams();
1332
- params = params.set('skip', '' + skip);
1333
- params = params.set('count', '' + count);
1334
- return this.baseHttpService.api({
1335
- method: 'post',
1336
- url: `${this.serviceUrl}/attributes/definition/search`,
1337
- params: params,
1338
- body: expression,
1339
- });
1340
- };
1341
- this.fetchAttributesByModel = (modelId) => {
1342
- return this.baseHttpService.api({ url: `${this.serviceUrl}/attributes/definition/forModel/${modelId}` });
1343
- };
1344
- this.createNewProduct$ = (productData) => {
1345
- return this.baseHttpService.api({
1346
- url: `${this.serviceUrl}`,
1347
- method: 'post',
1348
- body: productData,
1349
- });
1350
- };
1351
- this.updateProduct$ = (body) => {
1352
- return this.baseHttpService.api({
1353
- url: `${this.serviceUrl}/${body.id}`,
1354
- method: 'put',
1355
- body,
428
+ params,
429
+ body: expression || {},
1356
430
  });
1357
431
  };
1358
- this.removeProduct$ = (id) => {
432
+ this.removePortal$ = (id) => {
1359
433
  return this.baseHttpService.api({
1360
434
  url: `${this.serviceUrl}/${id}`,
1361
435
  method: 'delete',
1362
436
  });
1363
437
  };
1364
- this.restoreProduct$ = (id) => {
438
+ this.restore$ = (id) => {
1365
439
  return this.baseHttpService.api({
1366
- url: `${this.serviceUrl}/${id}/restore`,
1367
440
  method: 'patch',
441
+ url: `${this.serviceUrl}/${id}/restore`,
1368
442
  });
1369
443
  };
1370
- this.createProductAttribute$ = (attributeData) => {
1371
- return this.baseHttpService.api({
1372
- url: `${this.serviceUrl}/attributes`,
1373
- method: 'post',
1374
- body: attributeData,
1375
- });
1376
- };
1377
- this.updateProductAttribute$ = (attributeData) => {
1378
- return this.baseHttpService.api({
1379
- url: `${this.serviceUrl}/attributes/${attributeData.id}`,
1380
- method: 'put',
1381
- body: attributeData,
1382
- });
1383
- };
1384
- this.removeProductAttribute$ = (id) => {
1385
- return this.baseHttpService.api({
1386
- url: `${this.serviceUrl}/attributes/${id}`,
1387
- method: 'delete',
1388
- });
1389
- };
1390
- this.createNewAttribute$ = (attributeData) => {
444
+ this.duplicatePortal$ = (cloneRequest) => {
1391
445
  return this.baseHttpService.api({
1392
- url: `${this.serviceUrl}/attributes/definition`,
446
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
1393
447
  method: 'post',
1394
- body: attributeData,
1395
- });
1396
- };
1397
- this.updateAttribute$ = (body) => {
1398
- return this.baseHttpService.api({
1399
- url: `${this.serviceUrl}/attributes/definition/${body.id}`,
1400
- method: 'put',
1401
- body,
1402
- });
1403
- };
1404
- this.removeAttribute$ = (id) => {
1405
- return this.baseHttpService.api({
1406
- url: `${this.serviceUrl}/attributes/definition/${id}`,
1407
- method: 'delete',
448
+ body: cloneRequest,
1408
449
  });
1409
450
  };
1410
- this.restoreAttribute$ = (id) => {
451
+ this.getPortal$ = (id) => {
1411
452
  return this.baseHttpService.api({
1412
- url: `${this.serviceUrl}/attributes/definition/${id}/restore`,
1413
- method: 'patch',
453
+ url: `${this.serviceUrl}/${id}`,
1414
454
  });
1415
455
  };
1416
456
  }
1417
- attachImage$(productId, file) {
1418
- const data = new FormData();
1419
- data.append('image', file);
1420
- return this.baseHttpService.upload({
1421
- method: 'post',
1422
- url: `${this.serviceUrl}/${productId}/image`,
1423
- body: data,
1424
- });
1425
- }
1426
- removeImage$(productId) {
1427
- return this.baseHttpService.api({
1428
- method: 'delete',
1429
- url: `${this.serviceUrl}/${productId}/image`,
1430
- });
1431
- }
1432
- fetchImage$(productId) {
457
+ createNewPortal$(body) {
1433
458
  return this.baseHttpService.api({
1434
- url: this.getImageUrl(productId),
1435
- method: 'get',
1436
- responseType: 'blob',
1437
- errorHandler: noop,
1438
- });
1439
- }
1440
- getImageUrl(productId) {
1441
- return `${this.serviceUrl}/${productId}/image`;
1442
- }
1443
- }
1444
- ProductApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1445
- ProductApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService });
1446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, decorators: [{
1447
- type: Injectable
1448
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1449
-
1450
- class ProductModelApiService {
1451
- constructor(httpService) {
1452
- this.httpService = httpService;
1453
- this.SERVICE_URL = '/models';
1454
- }
1455
- addModel(model) {
1456
- return this.httpService
1457
- .api({
1458
- method: 'post',
1459
- url: this.SERVICE_URL,
1460
- body: model,
1461
- errorHandler: this.httpService.handleValidationError,
1462
- })
1463
- .pipe(map(result => {
1464
- if (result.successful) {
1465
- return result;
1466
- }
1467
- else {
1468
- throw new Error(result.message);
1469
- }
1470
- }));
1471
- }
1472
- releaseModel(model) {
1473
- return this.httpService
1474
- .api({
1475
- method: 'put',
1476
- url: `${this.SERVICE_URL}/${model.id}/release`,
1477
- body: model,
1478
- errorHandler: this.httpService.handleValidationError,
1479
- })
1480
- .pipe(map(result => {
1481
- if (result.successful) {
1482
- return '';
1483
- }
1484
- else {
1485
- throw new Error(result.message);
1486
- }
1487
- }));
1488
- }
1489
- removeModel(modelId, successFn, failureFn) {
1490
- const observable = this.httpService
1491
- .api({
1492
- method: 'delete',
1493
- url: `${this.SERVICE_URL}/${modelId}`,
1494
- errorHandler: this.httpService.handleValidationError,
1495
- })
1496
- .pipe(map(result => {
1497
- if (result.successful) {
1498
- return '';
1499
- }
1500
- else {
1501
- throw new Error(result.message);
1502
- }
1503
- }));
1504
- observable.subscribe(() => {
1505
- successFn && successFn.apply();
1506
- }, () => {
1507
- failureFn && failureFn.apply();
1508
- });
1509
- }
1510
- getModelVersions(modelId, count = 100, skip = 0) {
1511
- return this.httpService.api({
1512
- method: 'post',
1513
- url: `${this.SERVICE_URL}/${modelId}/versions`,
1514
- body: {
1515
- skipCount: skip,
1516
- count: count,
1517
- },
1518
- });
1519
- }
1520
- getModel(id, version) {
1521
- let url = `${this.SERVICE_URL}/${id}`;
1522
- if (version) {
1523
- url += `/versions/${version}`;
1524
- }
1525
- return this.httpService.api({ url });
1526
- }
1527
- getModels(skipCount, searchText) {
1528
- return this.httpService.api({
459
+ url: `${this.serviceUrl}`,
1529
460
  method: 'post',
1530
- url: `${this.SERVICE_URL}/search`,
1531
- body: {
1532
- nameRegex: searchText,
1533
- skipCount: skipCount.toString(),
1534
- count: ProductModelApiService.MAX_RESULTS,
1535
- },
1536
- });
1537
- }
1538
- getLinkedModels(id, version) {
1539
- let url = `${this.SERVICE_URL}/${id}`;
1540
- if (version) {
1541
- url += `/versions/${version}`;
1542
- }
1543
- url += '/linked';
1544
- return this.httpService.api({ url }).pipe(map((linkedModels) => {
1545
- if (linkedModels) {
1546
- linkedModels.forEach(model => ModelTranslatorUtils.toLocalModel(model));
1547
- }
1548
- return linkedModels;
1549
- }));
1550
- }
1551
- getPML(modelId, version) {
1552
- let url = `${this.SERVICE_URL}/${modelId}/pml/${version}`;
1553
- if (version) {
1554
- url += `/versions/${version}`;
1555
- }
1556
- return this.httpService.api({
1557
- url,
1558
- responseType: 'text',
1559
- });
1560
- }
1561
- savePML(modelId, pml, comment) {
1562
- return this.httpService
1563
- .api({
1564
- method: 'put',
1565
- url: `${this.SERVICE_URL}/${modelId}/pml`,
1566
- body: {
1567
- id: modelId,
1568
- pml: pml,
1569
- comment: comment,
1570
- },
1571
- })
1572
- .pipe(map(result => {
1573
- if (result.successful) {
1574
- return '';
1575
- }
1576
- else {
1577
- throw new Error(result.message);
1578
- }
1579
- }), catchError(this.httpService.handleValidationError));
1580
- }
1581
- generateProducts(modelId) {
1582
- return this.httpService.api({
1583
- url: `${this.SERVICE_URL}/${modelId}/generate-products`,
461
+ body,
1584
462
  });
1585
463
  }
1586
- saveModel(productModel, comment) {
1587
- const model = EntityUtil.clone(productModel);
1588
- model.comment = comment;
1589
- ModelTranslatorUtils.toServerModel(model);
1590
- return this.httpService
1591
- .api({
464
+ updatePortal$(portal, settings) {
465
+ return this.baseHttpService.api({
466
+ url: `${this.serviceUrl}/${portal.id}`,
1592
467
  method: 'put',
1593
- url: `${this.SERVICE_URL}/${model.id}`,
1594
- body: model,
1595
- })
1596
- .pipe(map(result => {
1597
- if (result.successful) {
1598
- return '';
1599
- }
1600
- else {
1601
- throw new Error(result.message);
1602
- }
1603
- }), catchError(this.httpService.handleValidationError));
1604
- }
1605
- validateModel(productModel) {
1606
- return this.httpService
1607
- .api({
1608
- method: 'post',
1609
- url: `${this.SERVICE_URL}/validate`,
1610
- body: productModel,
1611
- errorHandler: this.httpService.handleValidationError,
1612
- })
1613
- .pipe(map(result => {
1614
- if (result.successful) {
1615
- return '';
1616
- }
1617
- else {
1618
- throw new Error(result.message);
1619
- }
1620
- }));
1621
- }
1622
- renameModel(productModel, name) {
1623
- const model = EntityUtil.clone(productModel);
1624
- model.name = name;
1625
- ModelTranslatorUtils.toServerModel(model);
1626
- return this.httpService
1627
- .api({
1628
- method: 'patch',
1629
- url: `${this.SERVICE_URL}/${model.id}`,
1630
- body: model,
1631
- })
1632
- .pipe(catchError(this.httpService.handleValidationError));
1633
- }
1634
- uploadPmlFile(file, modelId) {
1635
- const formData = new FormData();
1636
- formData.append('file', file, file.name);
1637
- return this.httpService.upload({
1638
- url: `${this.SERVICE_URL}/${modelId}/pml/upload`,
1639
- body: formData,
1640
- });
1641
- }
1642
- runPml(modelId, pml, rootType, configurationMode) {
1643
- return this.httpService.api({
1644
- method: 'post',
1645
- url: `${this.SERVICE_URL}/${modelId}/pml/run`,
1646
- body: {
1647
- pml,
1648
- rootType,
1649
- configurationMode,
1650
- },
1651
- responseType: 'text',
1652
- });
1653
- }
1654
- evictAllCache() {
1655
- return this.httpService.api({
1656
- method: 'get',
1657
- url: '/cache/evict/environment-variables',
468
+ body: Object.assign(Object.assign({}, portal), { settings: JSON.stringify(settings) }),
1658
469
  });
1659
470
  }
1660
471
  }
1661
- ProductModelApiService.MAX_RESULTS = 200;
1662
- ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1663
- ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService });
1664
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, decorators: [{
472
+ PortalsApiService.MAX_RESULTS = 60;
473
+ PortalsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
474
+ PortalsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService });
475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, decorators: [{
1665
476
  type: Injectable
1666
477
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1667
478
 
@@ -1694,7 +505,7 @@ class PromotionsApiService {
1694
505
  method: 'post',
1695
506
  body,
1696
507
  })
1697
- .pipe(map$1(response => response.clonedRecordId));
508
+ .pipe(map(response => response.clonedRecordId));
1698
509
  };
1699
510
  }
1700
511
  search$(expression, skip, count) {
@@ -1728,24 +539,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1728
539
  type: Injectable
1729
540
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1730
541
 
1731
- class RampApiService {
1732
- constructor(httpService) {
1733
- this.httpService = httpService;
1734
- this.SERVICE_URL = '/ramp';
1735
- }
1736
- next(request, options) {
1737
- return this.httpService.api(Object.assign({ method: 'post', url: `${this.SERVICE_URL}/next`, body: request }, options));
1738
- }
1739
- renew(request, options) {
1740
- return this.httpService.api(Object.assign({ method: 'post', url: `${this.SERVICE_URL}/renew`, body: request }, options));
1741
- }
1742
- }
1743
- RampApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1744
- RampApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService });
1745
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, decorators: [{
1746
- type: Injectable
1747
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1748
-
1749
542
  class RebateProgramApiService {
1750
543
  constructor(baseHttpService) {
1751
544
  this.baseHttpService = baseHttpService;
@@ -1775,7 +568,7 @@ class RebateProgramApiService {
1775
568
  method: 'post',
1776
569
  body,
1777
570
  })
1778
- .pipe(map$1(response => response.clonedRecordId));
571
+ .pipe(map(response => response.clonedRecordId));
1779
572
  };
1780
573
  }
1781
574
  search$(expression, skip, count) {
@@ -1838,7 +631,7 @@ class RebateTypeApiService {
1838
631
  method: 'post',
1839
632
  body,
1840
633
  })
1841
- .pipe(map$1(response => response.clonedRecordId));
634
+ .pipe(map(response => response.clonedRecordId));
1842
635
  };
1843
636
  }
1844
637
  search$(expression, skip, count) {
@@ -1872,63 +665,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1872
665
  type: Injectable
1873
666
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1874
667
 
1875
- class SalesforceApiService {
1876
- constructor(httpService) {
1877
- this.httpService = httpService;
1878
- this.SERVICE_URL = '/proxy';
1879
- }
1880
- query(searchRequest, objectName, options) {
1881
- 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));
1882
- }
1883
- queryObjects(search, options) {
1884
- let params = new HttpParams();
1885
- if (search) {
1886
- params = params.append('search', search);
1887
- }
1888
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/query`, params }, options));
1889
- }
1890
- search(req, options) {
1891
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest/search`, params: { q: req.searchString } }, options));
1892
- }
1893
- describeObject(objectName, options) {
1894
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1895
- return this.httpService.api(Object.assign({ url: methodUrl }, options));
1896
- }
1897
- describeField(objectName, fieldName, options) {
1898
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
1899
- return this.httpService.api(Object.assign({ url: methodUrl }, options));
1900
- }
1901
- describe2(objectName, fields, options) {
1902
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1903
- return this.httpService.api(Object.assign({ method: 'post', url: methodUrl, body: fields }, options));
1904
- }
1905
- apexGetRequest(path, params, options) {
1906
- // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
1907
- const httpParams = new HttpParams({ fromString: params.toString() });
1908
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams }, options));
1909
- }
1910
- apexPostRequest(path, body, options) {
1911
- return this.httpService.api(Object.assign({ method: 'post', body, url: `${this.SERVICE_URL}/apex${path}` }, options));
1912
- }
1913
- getGlobalPicklists() {
1914
- return this.httpService.api({
1915
- method: 'get',
1916
- url: `${this.SERVICE_URL}/globalvalueset`,
1917
- });
1918
- }
1919
- getGlobalPicklistValues(id) {
1920
- return this.httpService.api({
1921
- method: 'get',
1922
- url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
1923
- });
1924
- }
1925
- }
1926
- SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1927
- SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
1928
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
1929
- type: Injectable
1930
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1931
-
1932
668
  class SandboxManagerApiService {
1933
669
  constructor(messageService) {
1934
670
  this.messageService = messageService;
@@ -1944,7 +680,7 @@ class SandboxManagerApiService {
1944
680
  getSalesforceOrganizations$() {
1945
681
  try {
1946
682
  return window.doSandboxCall
1947
- ? from(window.doSandboxCall('orgs', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, [], this.publishErrorMessage)), catchError$1(() => of([])))
683
+ ? from(window.doSandboxCall('orgs', '', 'GET')).pipe(map(response => handleCanvasResponse(response, [], this.publishErrorMessage)), catchError(() => of([])))
1948
684
  : of([]);
1949
685
  }
1950
686
  catch (_a) {
@@ -1954,7 +690,7 @@ class SandboxManagerApiService {
1954
690
  getAvailableSalesforceOrganizationSizes$() {
1955
691
  try {
1956
692
  return window.doSandboxCall
1957
- ? from(window.doSandboxCall('available-sizes', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, {}, this.publishErrorMessage)), catchError$1(() => of({})))
693
+ ? from(window.doSandboxCall('available-sizes', '', 'GET')).pipe(map(response => handleCanvasResponse(response, {}, this.publishErrorMessage)), catchError(() => of({})))
1958
694
  : of({});
1959
695
  }
1960
696
  catch (_a) {
@@ -1964,7 +700,7 @@ class SandboxManagerApiService {
1964
700
  createSalesforceOrganization$(payload) {
1965
701
  try {
1966
702
  return window.doSandboxCall
1967
- ? from(window.doSandboxCall('orgs', JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
703
+ ? from(window.doSandboxCall('orgs', JSON.stringify(payload), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1968
704
  : of(undefined);
1969
705
  }
1970
706
  catch (err) {
@@ -1974,7 +710,7 @@ class SandboxManagerApiService {
1974
710
  updateSalesforceOrganization$(payload) {
1975
711
  try {
1976
712
  return window.doSandboxCall
1977
- ? from(window.doSandboxCall(`orgs/${payload.orgId}`, JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
713
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}`, JSON.stringify(payload), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1978
714
  : of(undefined);
1979
715
  }
1980
716
  catch (_a) {
@@ -1984,7 +720,7 @@ class SandboxManagerApiService {
1984
720
  deleteSalesforceOrganization$(payload) {
1985
721
  try {
1986
722
  return window.doSandboxCall
1987
- ? from(window.doSandboxCall(`orgs/${payload.orgId}`, '', 'DELETE')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
723
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}`, '', 'DELETE')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1988
724
  : of(undefined);
1989
725
  }
1990
726
  catch (_a) {
@@ -1994,7 +730,7 @@ class SandboxManagerApiService {
1994
730
  activateSalesforceOrganization$(payload) {
1995
731
  try {
1996
732
  return window.doSandboxCall
1997
- ? from(window.doSandboxCall(`orgs/${payload.orgId}/activate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
733
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}/activate`, JSON.stringify({}), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1998
734
  : of(undefined);
1999
735
  }
2000
736
  catch (_a) {
@@ -2004,7 +740,7 @@ class SandboxManagerApiService {
2004
740
  deactivateSalesforceOrganization$(payload) {
2005
741
  try {
2006
742
  return window.doSandboxCall
2007
- ? from(window.doSandboxCall(`orgs/${payload.orgId}/deactivate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
743
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}/deactivate`, JSON.stringify({}), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
2008
744
  : of(undefined);
2009
745
  }
2010
746
  catch (_a) {
@@ -2018,29 +754,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2018
754
  type: Injectable
2019
755
  }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
2020
756
 
2021
- class ShoppingCartSettingsApiService {
2022
- constructor(configurationSettingsApiService) {
2023
- this.configurationSettingsApiService = configurationSettingsApiService;
2024
- this.shoppingCartSettingsKey = 'shopping-cart';
2025
- }
2026
- getSetting(id) {
2027
- return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map(settings => settings.find(setting => setting.id == id)));
2028
- }
2029
- fetchSettings() {
2030
- return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
2031
- }
2032
- getSettingsMap() {
2033
- return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map((settings) => settings.reduce((acc, setting) => {
2034
- return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
2035
- }, {})));
2036
- }
2037
- }
2038
- ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2039
- ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
2040
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
2041
- type: Injectable
2042
- }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
2043
-
2044
757
  class StatefulConfigurationApiService {
2045
758
  constructor(httpService) {
2046
759
  this.httpService = httpService;
@@ -2089,91 +802,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2089
802
  type: Injectable
2090
803
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2091
804
 
2092
- class VeloceObjectsApiService {
2093
- constructor(baseHttpService) {
2094
- this.baseHttpService = baseHttpService;
2095
- this.serviceUrl = '/veloceobjects';
2096
- this.updateCategory$ = (category) => {
2097
- return this.baseHttpService.api({
2098
- method: 'put',
2099
- url: `${this.serviceUrl}/categories/${category.id}`,
2100
- body: category,
2101
- });
2102
- };
2103
- this.deleteCategory$ = (id) => {
2104
- return this.baseHttpService.api({
2105
- method: 'delete',
2106
- url: `${this.serviceUrl}/categories/${id}`,
2107
- });
2108
- };
2109
- this.searchObjects$ = (searchParams, expression) => {
2110
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
2111
- return this.baseHttpService.api({
2112
- method: 'post',
2113
- url: `${this.serviceUrl}/search`,
2114
- params,
2115
- body: expression || {},
2116
- });
2117
- };
2118
- this.deleteObject$ = (id) => {
2119
- return this.baseHttpService.api({
2120
- method: 'delete',
2121
- url: `${this.serviceUrl}/${id}`,
2122
- });
2123
- };
2124
- this.duplicateObject$ = (body) => {
2125
- return this.baseHttpService
2126
- .api({
2127
- method: 'post',
2128
- url: `${this.serviceUrl}/${body.id}/clone`,
2129
- body,
2130
- })
2131
- .pipe(map(response => response.clonedRecordId));
2132
- };
2133
- this.restoreObject$ = (id) => {
2134
- return this.baseHttpService.api({
2135
- method: 'patch',
2136
- url: `${this.serviceUrl}/${id}/restore`,
2137
- });
2138
- };
2139
- }
2140
- fetchCategories$() {
2141
- return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
2142
- }
2143
- createCategory$(category) {
2144
- return this.baseHttpService.api({
2145
- method: 'post',
2146
- url: `${this.serviceUrl}/categories`,
2147
- body: category,
2148
- });
2149
- }
2150
- fetchObjects$() {
2151
- return this.baseHttpService.api({ url: `${this.serviceUrl}` });
2152
- }
2153
- fetchObject$(id) {
2154
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2155
- }
2156
- createObject$(object) {
2157
- return this.baseHttpService.api({
2158
- method: 'post',
2159
- url: `${this.serviceUrl}`,
2160
- body: object,
2161
- });
2162
- }
2163
- updateObject$(object) {
2164
- return this.baseHttpService.api({
2165
- method: 'put',
2166
- url: `${this.serviceUrl}/${object.id}`,
2167
- body: object,
2168
- });
2169
- }
2170
- }
2171
- VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2172
- VeloceObjectsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService });
2173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, decorators: [{
2174
- type: Injectable
2175
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2176
-
2177
805
  class ApiModule {
2178
806
  }
2179
807
  ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -2181,27 +809,9 @@ ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
2181
809
  ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, providers: [
2182
810
  BaseHttpService,
2183
811
  XrayService,
2184
- ConfigurationApiService,
2185
- ConfigurationSettingsApiService,
2186
- DocumentAttachmentApiService,
2187
- PriceApiService,
2188
- ProductModelApiService,
2189
- RampApiService,
2190
- SalesforceApiService,
2191
- FlowsApiService,
2192
- GuidedSellingsAdminApiService,
2193
- ShoppingCartSettingsApiService,
2194
- ProductApiService,
2195
- CatalogAdminApiService,
2196
- GuidedSellingApiService,
2197
- CatalogApiService,
2198
- DeltaApiService,
2199
812
  AccountApiService,
2200
- PicklistsApiService,
2201
- EndpointsApiService,
2202
813
  OrgInfoApiService,
2203
814
  OffersApiService,
2204
- VeloceObjectsApiService,
2205
815
  StatefulConfigurationApiService,
2206
816
  RebateProgramApiService,
2207
817
  RebateTypeApiService,
@@ -2219,27 +829,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2219
829
  providers: [
2220
830
  BaseHttpService,
2221
831
  XrayService,
2222
- ConfigurationApiService,
2223
- ConfigurationSettingsApiService,
2224
- DocumentAttachmentApiService,
2225
- PriceApiService,
2226
- ProductModelApiService,
2227
- RampApiService,
2228
- SalesforceApiService,
2229
- FlowsApiService,
2230
- GuidedSellingsAdminApiService,
2231
- ShoppingCartSettingsApiService,
2232
- ProductApiService,
2233
- CatalogAdminApiService,
2234
- GuidedSellingApiService,
2235
- CatalogApiService,
2236
- DeltaApiService,
2237
832
  AccountApiService,
2238
- PicklistsApiService,
2239
- EndpointsApiService,
2240
833
  OrgInfoApiService,
2241
834
  OffersApiService,
2242
- VeloceObjectsApiService,
2243
835
  StatefulConfigurationApiService,
2244
836
  RebateProgramApiService,
2245
837
  RebateTypeApiService,
@@ -2257,5 +849,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2257
849
  * Generated bundle index. Do not edit.
2258
850
  */
2259
851
 
2260
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProductApiService, ProductModelApiService, PromotionsApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, SalesforceApiService, SandboxManagerApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, VeloceAuthService, VeloceObjectsApiService, handleCanvasResponse };
852
+ export { AccountApiService, ApiModule, ContractedPriceApiService, FlowStateApiService, OffersApiService, OrgInfoApiService, PortalsApiService, PromotionsApiService, RebateProgramApiService, RebateTypeApiService, SandboxManagerApiService, StatefulConfigurationApiService, VeloceAuthService, handleCanvasResponse };
2261
853
  //# sourceMappingURL=veloceapps-api.mjs.map