@veloceapps/api 11.0.0-3 → 11.0.0-31

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 (217) hide show
  1. package/esm2020/index.mjs +2 -45
  2. package/esm2020/src/index.mjs +21 -0
  3. package/esm2020/src/lib/api.module.mjs +75 -0
  4. package/esm2020/src/lib/services/account-api.service.mjs +87 -0
  5. package/esm2020/src/lib/services/auth.service.mjs +22 -0
  6. package/esm2020/src/lib/services/catalog-admin-api.service.mjs +192 -0
  7. package/esm2020/src/lib/services/catalog-api.service.mjs +90 -0
  8. package/esm2020/src/lib/services/contracted-price-api.service.mjs +45 -0
  9. package/esm2020/src/lib/services/document-attachment-api.service.mjs +66 -0
  10. package/esm2020/src/lib/services/flow-state-api.mjs +142 -0
  11. package/esm2020/src/lib/services/guided-sellings-admin-api.service.mjs +65 -0
  12. package/esm2020/src/lib/services/guided-sellings-api.service.mjs +37 -0
  13. package/esm2020/src/lib/services/offers-api.service.mjs +76 -0
  14. package/esm2020/src/lib/services/org-info-api.service.mjs +54 -0
  15. package/esm2020/src/lib/services/portals-api.service.mjs +76 -0
  16. package/esm2020/src/lib/services/promotions-api.service.mjs +68 -0
  17. package/esm2020/src/lib/services/rebate-program-api.service.mjs +68 -0
  18. package/esm2020/src/lib/services/rebate-type-api.service.mjs +68 -0
  19. package/esm2020/src/lib/services/sandbox-manager-api.service.mjs +94 -0
  20. package/esm2020/src/lib/services/stateful-configuration-api.mjs +51 -0
  21. package/esm2020/src/lib/types/attachment.types.mjs +2 -0
  22. package/esm2020/src/lib/types/auth.types.mjs +2 -0
  23. package/esm2020/src/lib/types/clone-request.types.mjs +2 -0
  24. package/esm2020/src/lib/types/delta-request.types.mjs +2 -0
  25. package/esm2020/src/lib/types/dto/offers-dto.types.mjs +2 -0
  26. package/esm2020/src/lib/types/index.mjs +6 -0
  27. package/esm2020/src/lib/types/org-info.types.mjs +2 -0
  28. package/esm2020/src/lib/types/search-request.types.mjs +2 -0
  29. package/esm2020/src/lib/types/stateful-configuration.types.mjs +2 -0
  30. package/esm2020/src/lib/utils/canvas.utils.mjs +33 -0
  31. package/esm2020/src/lib/utils/index.mjs +2 -0
  32. package/esm2020/v2/api-v2.module.mjs +64 -0
  33. package/esm2020/v2/index.mjs +4 -0
  34. package/esm2020/v2/services/cache-api.service.mjs +22 -0
  35. package/esm2020/v2/services/configuration-processors-api.service.mjs +38 -0
  36. package/esm2020/v2/services/configuration-settings-api.service.mjs +89 -0
  37. package/esm2020/v2/services/context-definition-admin-api.service.mjs +65 -0
  38. package/esm2020/v2/services/endpoints-admin-api.service.mjs +79 -0
  39. package/esm2020/v2/services/flows-api.service.mjs +29 -0
  40. package/esm2020/v2/services/function-groups-admin-api.service.mjs +62 -0
  41. package/esm2020/v2/services/functions-admin-api.service.mjs +97 -0
  42. package/esm2020/v2/services/index.mjs +21 -0
  43. package/esm2020/v2/services/orchestrations-admin-api.service.mjs +87 -0
  44. package/esm2020/v2/services/orchestrations-api.service.mjs +23 -0
  45. package/esm2020/v2/services/pcm-api.service.mjs +29 -0
  46. package/esm2020/v2/services/picklists-admin-api.service.mjs +41 -0
  47. package/esm2020/v2/services/products-admin-api.service.mjs +90 -0
  48. package/esm2020/v2/services/sales-transactions-api.service.mjs +52 -0
  49. package/esm2020/v2/services/salesforce-api.service.mjs +83 -0
  50. package/esm2020/v2/services/scripts-admin-api.service.mjs +83 -0
  51. package/esm2020/v2/services/shopping-cart-settings-api.service.mjs +28 -0
  52. package/esm2020/v2/services/ui-definitions-admin-api.service.mjs +68 -0
  53. package/esm2020/v2/services/ui-templates-admin-api.service.mjs +286 -0
  54. package/esm2020/v2/services/veloce-objects-api.service.mjs +90 -0
  55. package/esm2020/v2/types/clone-request.types.mjs +2 -0
  56. package/esm2020/v2/types/dto/configuration-settings-dto.types.mjs +22 -0
  57. package/esm2020/v2/types/dto/ui-definition-dto.types.mjs +2 -0
  58. package/esm2020/v2/types/dto/ui-template-dto.types.mjs +2 -0
  59. package/esm2020/v2/types/index.mjs +5 -0
  60. package/esm2020/v2/types/pcm.types.mjs +2 -0
  61. package/esm2020/v2/types/procedure.types.mjs +2 -0
  62. package/esm2020/v2/types/sales-transaction.types.mjs +2 -0
  63. package/esm2020/v2/types/search-request.types.mjs +2 -0
  64. package/esm2020/v2/utils/ui-definition.utils.mjs +23 -0
  65. package/esm2020/v2/utils/ui-template.utils.mjs +13 -0
  66. package/esm2020/v2/veloceapps-api-v2.mjs +5 -0
  67. package/esm2020/veloceapps-api.mjs +1 -1
  68. package/fesm2015/veloceapps-api-v2.mjs +1403 -0
  69. package/fesm2015/veloceapps-api-v2.mjs.map +1 -0
  70. package/fesm2015/veloceapps-api.mjs +114 -1959
  71. package/fesm2015/veloceapps-api.mjs.map +1 -1
  72. package/fesm2020/veloceapps-api-v2.mjs +1475 -0
  73. package/fesm2020/veloceapps-api-v2.mjs.map +1 -0
  74. package/fesm2020/veloceapps-api.mjs +179 -2122
  75. package/fesm2020/veloceapps-api.mjs.map +1 -1
  76. package/index.d.ts +1 -44
  77. package/package.json +9 -1
  78. package/src/index.d.ts +20 -0
  79. package/{lib → src/lib}/api.module.d.ts +2 -1
  80. package/{lib → src/lib}/services/catalog-api.service.d.ts +5 -5
  81. package/{lib → src/lib}/types/index.d.ts +0 -2
  82. package/{lib → src/lib}/types/stateful-configuration.types.d.ts +1 -2
  83. package/src/lib/utils/index.d.ts +1 -0
  84. package/v2/api-v2.module.d.ts +7 -0
  85. package/v2/index.d.ts +3 -0
  86. package/v2/services/cache-api.service.d.ts +11 -0
  87. package/{lib → v2}/services/configuration-settings-api.service.d.ts +1 -2
  88. package/{lib/services/rlm-api.service.d.ts → v2/services/context-definition-admin-api.service.d.ts} +3 -3
  89. package/{lib/services/endpoints-api.service.d.ts → v2/services/endpoints-admin-api.service.d.ts} +3 -4
  90. package/v2/services/function-groups-admin-api.service.d.ts +18 -0
  91. package/v2/services/functions-admin-api.service.d.ts +22 -0
  92. package/v2/services/index.d.ts +20 -0
  93. package/v2/services/orchestrations-admin-api.service.d.ts +21 -0
  94. package/v2/services/orchestrations-api.service.d.ts +12 -0
  95. package/v2/services/pcm-api.service.d.ts +11 -0
  96. package/{lib/services/picklists-api.service.d.ts → v2/services/picklists-admin-api.service.d.ts} +3 -3
  97. package/v2/services/products-admin-api.service.d.ts +21 -0
  98. package/v2/services/sales-transactions-api.service.d.ts +20 -0
  99. package/{lib → v2}/services/salesforce-api.service.d.ts +1 -0
  100. package/{lib/services/scripts-api.service.d.ts → v2/services/scripts-admin-api.service.d.ts} +3 -3
  101. package/v2/services/ui-definitions-admin-api.service.d.ts +18 -0
  102. package/{lib/services/ui-templates-api.service.d.ts → v2/services/ui-templates-admin-api.service.d.ts} +3 -3
  103. package/{lib → v2}/services/veloce-objects-api.service.d.ts +3 -3
  104. package/v2/types/clone-request.types.d.ts +5 -0
  105. package/v2/types/dto/ui-definition-dto.types.d.ts +7 -0
  106. package/v2/types/index.d.ts +4 -0
  107. package/v2/types/pcm.types.d.ts +10 -0
  108. package/v2/types/procedure.types.d.ts +10 -0
  109. package/v2/types/sales-transaction.types.d.ts +14 -0
  110. package/v2/types/search-request.types.d.ts +8 -0
  111. package/v2/utils/ui-definition.utils.d.ts +5 -0
  112. package/esm2020/lib/api.module.mjs +0 -146
  113. package/esm2020/lib/services/account-api.service.mjs +0 -87
  114. package/esm2020/lib/services/auth.service.mjs +0 -22
  115. package/esm2020/lib/services/catalog-admin-api.service.mjs +0 -192
  116. package/esm2020/lib/services/catalog-api.service.mjs +0 -90
  117. package/esm2020/lib/services/configuration-api.service.mjs +0 -109
  118. package/esm2020/lib/services/configuration-processors-api.service.mjs +0 -38
  119. package/esm2020/lib/services/configuration-settings-api.service.mjs +0 -96
  120. package/esm2020/lib/services/context-api.service.mjs +0 -26
  121. package/esm2020/lib/services/contracted-price-api.service.mjs +0 -45
  122. package/esm2020/lib/services/delta-api.service.mjs +0 -23
  123. package/esm2020/lib/services/document-attachment-api.service.mjs +0 -66
  124. package/esm2020/lib/services/endpoints-api.service.mjs +0 -80
  125. package/esm2020/lib/services/flow-state-api.mjs +0 -142
  126. package/esm2020/lib/services/flows-api.service.mjs +0 -29
  127. package/esm2020/lib/services/guided-sellings-admin-api.service.mjs +0 -65
  128. package/esm2020/lib/services/guided-sellings-api.service.mjs +0 -37
  129. package/esm2020/lib/services/offers-api.service.mjs +0 -76
  130. package/esm2020/lib/services/org-info-api.service.mjs +0 -54
  131. package/esm2020/lib/services/picklists-api.service.mjs +0 -41
  132. package/esm2020/lib/services/portals-api.service.mjs +0 -76
  133. package/esm2020/lib/services/price-api.service.mjs +0 -63
  134. package/esm2020/lib/services/procedures-api.service.mjs +0 -113
  135. package/esm2020/lib/services/product-api.service.mjs +0 -153
  136. package/esm2020/lib/services/product-model-api.service.mjs +0 -223
  137. package/esm2020/lib/services/promotions-api.service.mjs +0 -68
  138. package/esm2020/lib/services/quote-api.service.mjs +0 -56
  139. package/esm2020/lib/services/ramp-api.service.mjs +0 -31
  140. package/esm2020/lib/services/rebate-program-api.service.mjs +0 -68
  141. package/esm2020/lib/services/rebate-type-api.service.mjs +0 -68
  142. package/esm2020/lib/services/rlm-api.service.mjs +0 -64
  143. package/esm2020/lib/services/rlm-quote-api.service.mjs +0 -27
  144. package/esm2020/lib/services/rule-groups-api.service.mjs +0 -62
  145. package/esm2020/lib/services/rules-api.service.mjs +0 -98
  146. package/esm2020/lib/services/salesforce-api.service.mjs +0 -79
  147. package/esm2020/lib/services/sandbox-manager-api.service.mjs +0 -94
  148. package/esm2020/lib/services/scripts-api.service.mjs +0 -83
  149. package/esm2020/lib/services/shopping-cart-settings-api.service.mjs +0 -28
  150. package/esm2020/lib/services/stateful-configuration-api.mjs +0 -51
  151. package/esm2020/lib/services/ui-definitions-api.service.mjs +0 -76
  152. package/esm2020/lib/services/ui-templates-api.service.mjs +0 -286
  153. package/esm2020/lib/services/veloce-objects-api.service.mjs +0 -90
  154. package/esm2020/lib/types/attachment.types.mjs +0 -2
  155. package/esm2020/lib/types/auth.types.mjs +0 -2
  156. package/esm2020/lib/types/clone-request.types.mjs +0 -2
  157. package/esm2020/lib/types/delta-request.types.mjs +0 -2
  158. package/esm2020/lib/types/dto/configuration-settings-dto.types.mjs +0 -22
  159. package/esm2020/lib/types/dto/offers-dto.types.mjs +0 -2
  160. package/esm2020/lib/types/dto/ui-template-dto.types.mjs +0 -2
  161. package/esm2020/lib/types/index.mjs +0 -8
  162. package/esm2020/lib/types/org-info.types.mjs +0 -2
  163. package/esm2020/lib/types/price.types.mjs +0 -2
  164. package/esm2020/lib/types/quote.types.mjs +0 -2
  165. package/esm2020/lib/types/ramp-request.types.mjs +0 -2
  166. package/esm2020/lib/types/search-request.types.mjs +0 -2
  167. package/esm2020/lib/types/stateful-configuration.types.mjs +0 -2
  168. package/esm2020/lib/utils/canvas.utils.mjs +0 -33
  169. package/esm2020/lib/utils/index.mjs +0 -3
  170. package/esm2020/lib/utils/ui-template.utils.mjs +0 -13
  171. package/lib/services/configuration-api.service.d.ts +0 -23
  172. package/lib/services/context-api.service.d.ts +0 -11
  173. package/lib/services/delta-api.service.d.ts +0 -12
  174. package/lib/services/price-api.service.d.ts +0 -16
  175. package/lib/services/procedures-api.service.d.ts +0 -30
  176. package/lib/services/product-api.service.d.ts +0 -31
  177. package/lib/services/product-model-api.service.d.ts +0 -29
  178. package/lib/services/quote-api.service.d.ts +0 -22
  179. package/lib/services/ramp-api.service.d.ts +0 -13
  180. package/lib/services/rlm-quote-api.service.d.ts +0 -11
  181. package/lib/services/rule-groups-api.service.d.ts +0 -18
  182. package/lib/services/rules-api.service.d.ts +0 -22
  183. package/lib/services/ui-definitions-api.service.d.ts +0 -15
  184. package/lib/types/price.types.d.ts +0 -5
  185. package/lib/types/quote.types.d.ts +0 -8
  186. package/lib/types/ramp-request.types.d.ts +0 -13
  187. package/lib/utils/index.d.ts +0 -2
  188. /package/{lib → src/lib}/services/account-api.service.d.ts +0 -0
  189. /package/{lib → src/lib}/services/auth.service.d.ts +0 -0
  190. /package/{lib → src/lib}/services/catalog-admin-api.service.d.ts +0 -0
  191. /package/{lib → src/lib}/services/contracted-price-api.service.d.ts +0 -0
  192. /package/{lib → src/lib}/services/document-attachment-api.service.d.ts +0 -0
  193. /package/{lib → src/lib}/services/flow-state-api.d.ts +0 -0
  194. /package/{lib → src/lib}/services/guided-sellings-admin-api.service.d.ts +0 -0
  195. /package/{lib → src/lib}/services/guided-sellings-api.service.d.ts +0 -0
  196. /package/{lib → src/lib}/services/offers-api.service.d.ts +0 -0
  197. /package/{lib → src/lib}/services/org-info-api.service.d.ts +0 -0
  198. /package/{lib → src/lib}/services/portals-api.service.d.ts +0 -0
  199. /package/{lib → src/lib}/services/promotions-api.service.d.ts +0 -0
  200. /package/{lib → src/lib}/services/rebate-program-api.service.d.ts +0 -0
  201. /package/{lib → src/lib}/services/rebate-type-api.service.d.ts +0 -0
  202. /package/{lib → src/lib}/services/sandbox-manager-api.service.d.ts +0 -0
  203. /package/{lib → src/lib}/services/stateful-configuration-api.d.ts +0 -0
  204. /package/{lib → src/lib}/types/attachment.types.d.ts +0 -0
  205. /package/{lib → src/lib}/types/auth.types.d.ts +0 -0
  206. /package/{lib → src/lib}/types/clone-request.types.d.ts +0 -0
  207. /package/{lib → src/lib}/types/delta-request.types.d.ts +0 -0
  208. /package/{lib → src/lib}/types/dto/offers-dto.types.d.ts +0 -0
  209. /package/{lib → src/lib}/types/org-info.types.d.ts +0 -0
  210. /package/{lib → src/lib}/types/search-request.types.d.ts +0 -0
  211. /package/{lib → src/lib}/utils/canvas.utils.d.ts +0 -0
  212. /package/{lib → v2}/services/configuration-processors-api.service.d.ts +0 -0
  213. /package/{lib → v2}/services/flows-api.service.d.ts +0 -0
  214. /package/{lib → v2}/services/shopping-cart-settings-api.service.d.ts +0 -0
  215. /package/{lib → v2}/types/dto/configuration-settings-dto.types.d.ts +0 -0
  216. /package/{lib → v2}/types/dto/ui-template-dto.types.d.ts +0 -0
  217. /package/{lib → v2}/utils/ui-template.utils.d.ts +0 -0
@@ -1,13 +1,14 @@
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
+ import { ApiV2Module } from '@veloceapps/api/v2';
5
6
  import * as i1 from '@veloceapps/core';
6
- import { uiDefinitionFromDTO, DomainComputation, ConfigurationContextMode, Expression, Operator, isApexError, isCanvasError, ModelTranslatorUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
7
- import { noop, throwError, of, map as map$1, from, catchError as catchError$1, forkJoin, switchMap } from 'rxjs';
8
- import { map, catchError, tap } from 'rxjs/operators';
7
+ import { Expression, Operator, isApexError, isCanvasError, BaseHttpService, XrayService } from '@veloceapps/core';
8
+ import { noop, map as map$1, from, catchError, of } from 'rxjs';
9
+ import { tap, map } from 'rxjs/operators';
10
+ import { isArray } from 'lodash';
9
11
  import * as i1$2 from 'primeng/api';
10
- import { isArray, omit } from 'lodash';
11
12
 
12
13
  class AccountApiService {
13
14
  constructor(httpService) {
@@ -383,276 +384,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
383
384
  type: Injectable
384
385
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
385
386
 
386
- class ConfigurationApiService {
387
- constructor(httpService) {
388
- this.httpService = httpService;
389
- this.SERVICE_URL = '/configuration';
390
- }
391
- configureLineItem({ configurationRequest, runtimeModel, pricingEnabled, }) {
392
- return this.httpService
393
- .api({
394
- method: 'post',
395
- url: `${this.SERVICE_URL}${pricingEnabled ? '/price' : ''}`,
396
- body: configurationRequest,
397
- errorHandler: e => throwError(e),
398
- })
399
- .pipe(map(configurePrice => {
400
- if (runtimeModel) {
401
- return {
402
- ...configurePrice,
403
- lineItem: this.updateDomains(configurePrice.lineItem, runtimeModel),
404
- };
405
- }
406
- else {
407
- return configurePrice;
408
- }
409
- }));
410
- }
411
- customConfigurePrice({ url, configurationRequest, runtimeModel, }) {
412
- return this.httpService
413
- .api({
414
- method: 'post',
415
- url,
416
- body: configurationRequest,
417
- errorHandler: e => throwError(e),
418
- })
419
- .pipe(map(configurePrice => {
420
- if (runtimeModel) {
421
- return {
422
- ...configurePrice,
423
- lineItem: this.updateDomains(configurePrice.lineItem, runtimeModel),
424
- };
425
- }
426
- else {
427
- return configurePrice;
428
- }
429
- }));
430
- }
431
- getRuntimeDataByProductId(productId, offeringId) {
432
- return this.httpService
433
- .api({
434
- method: 'get',
435
- url: `${this.SERVICE_URL}/${productId}/model` + ((offeringId && `/${offeringId}`) || ''),
436
- })
437
- .pipe(map(runtimeData => {
438
- return {
439
- ...runtimeData,
440
- uiDefinitions: runtimeData.uiDefinitions.map(dto => uiDefinitionFromDTO(dto)),
441
- };
442
- }));
443
- }
444
- getRuntimeDataByModelId(modelId) {
445
- return this.httpService.api({
446
- method: 'get',
447
- url: `${this.SERVICE_URL}/${modelId}/model-test`,
448
- });
449
- }
450
- updateDomains(lineItem, runtimeModel) {
451
- const component = runtimeModel.components.get(lineItem.type);
452
- const portDomains = { ...lineItem.portDomains };
453
- // loop through ports to look for 'None' type domain computations
454
- for (const port of component?.ports ?? []) {
455
- const portDomain = portDomains[port.name];
456
- if (portDomain?.properties?.['domainComputation'] === DomainComputation.NONE) {
457
- portDomain.domainTypes = port.domainTypes;
458
- }
459
- }
460
- const type = runtimeModel.types.find(({ name }) => {
461
- return lineItem.type === name;
462
- });
463
- const attributeDomains = lineItem.attributeDomains;
464
- if (type) {
465
- const initialDomains = lineItem.attributeDomains;
466
- type.attributes.forEach(attribute => {
467
- if (Object.prototype.hasOwnProperty.call(initialDomains, attribute.name)) {
468
- return;
469
- }
470
- if (attribute.attributeDomain) {
471
- attributeDomains[attribute.name] = attribute.attributeDomain;
472
- }
473
- });
474
- }
475
- return {
476
- ...lineItem,
477
- lineItems: lineItem.lineItems?.map(i => this.updateDomains(i, runtimeModel)),
478
- attributeDomains,
479
- portDomains,
480
- };
481
- }
482
- }
483
- ConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
484
- ConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService });
485
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, decorators: [{
486
- type: Injectable
487
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
488
-
489
- class ConfigurationProcessorsApiService {
490
- constructor(baseHttpService) {
491
- this.baseHttpService = baseHttpService;
492
- this.serviceUrl = '/configuration/processors/owners';
493
- this.fetchConfigurationProcessors$ = (ownerId) => {
494
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
495
- };
496
- this.createConfigurationProcessors$ = (configurationProcessor) => {
497
- return this.baseHttpService.api({
498
- method: 'post',
499
- url: `${this.serviceUrl}/${configurationProcessor.ownerId}`,
500
- body: configurationProcessor,
501
- });
502
- };
503
- this.updateConfigurationProcessors$ = (configurationProcessor) => {
504
- return this.baseHttpService.api({
505
- method: 'put',
506
- url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
507
- body: configurationProcessor,
508
- });
509
- };
510
- this.deleteConfigurationProcessors$ = (configurationProcessor) => {
511
- return this.baseHttpService.api({
512
- method: 'delete',
513
- url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
514
- });
515
- };
516
- }
517
- }
518
- ConfigurationProcessorsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
519
- ConfigurationProcessorsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService });
520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, decorators: [{
521
- type: Injectable
522
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
523
-
524
- class ConfigurationSettingsDTO {
525
- static fromDTO(dto, key) {
526
- return {
527
- id: dto?.id,
528
- key: dto?.key || key || '',
529
- value: dto?.value,
530
- };
531
- }
532
- static toDTO(data) {
533
- return {
534
- id: data.id,
535
- key: data.key,
536
- value: data.value,
537
- };
538
- }
539
- constructor(id, key, value) {
540
- this.id = id;
541
- this.key = key;
542
- this.value = value;
543
- }
544
- }
545
-
546
- class ConfigurationSettingsApiService {
547
- constructor(httpService, messageService) {
548
- this.httpService = httpService;
549
- this.messageService = messageService;
550
- this.SERVICE_URL = '/configuration-settings';
551
- }
552
- fetchSettings(options) {
553
- return this.httpService
554
- .api({
555
- url: `${this.SERVICE_URL}`,
556
- method: 'get',
557
- ...options,
558
- })
559
- .pipe(map((settings) => settings.map(setting => ConfigurationSettingsDTO.fromDTO(setting))));
560
- }
561
- fetchSetting(settingsKey, options) {
562
- return this.httpService
563
- .api({
564
- url: `${this.SERVICE_URL}/byKey/${settingsKey}`,
565
- method: 'get',
566
- ...options,
567
- skipErrorHandler: true,
568
- })
569
- .pipe(map((setting) => ConfigurationSettingsDTO.fromDTO(setting, settingsKey)), catchError(err => {
570
- if (err instanceof HttpErrorResponse && err.status === 404) {
571
- if (!options?.skipErrorHandler) {
572
- this.messageService.add({
573
- severity: 'error',
574
- summary: `Configuration Setting "${settingsKey}" is not found`,
575
- sticky: true,
576
- });
577
- }
578
- return of(null);
579
- }
580
- throw err;
581
- }));
582
- }
583
- createSetting(setting, options) {
584
- const request = ConfigurationSettingsDTO.toDTO(setting);
585
- return this.httpService.api({
586
- url: `${this.SERVICE_URL}`,
587
- method: 'post',
588
- body: {
589
- ...request,
590
- },
591
- ...options,
592
- });
593
- }
594
- updateSetting(setting, options) {
595
- const request = ConfigurationSettingsDTO.toDTO(setting);
596
- return this.httpService.api({
597
- url: `${this.SERVICE_URL}/${request.id}`,
598
- method: 'put',
599
- body: {
600
- ...request,
601
- },
602
- ...options,
603
- });
604
- }
605
- removeSetting(setting, options) {
606
- const request = ConfigurationSettingsDTO.toDTO(setting);
607
- return this.httpService.api({
608
- url: `${this.SERVICE_URL}/${request.id}`,
609
- method: 'delete',
610
- ...options,
611
- });
612
- }
613
- restoreSetting(settingId, options) {
614
- return this.httpService.api({
615
- url: `${this.SERVICE_URL}/${settingId}/restore`,
616
- method: 'patch',
617
- ...options,
618
- });
619
- }
620
- clear(name, options) {
621
- return this.httpService.api({
622
- method: 'get',
623
- url: '/cache/evict/' + name,
624
- ...options,
625
- });
626
- }
627
- }
628
- 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 });
629
- ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
631
- type: Injectable
632
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1$2.MessageService }]; } });
633
-
634
- class ContextApiService {
635
- constructor(httpService) {
636
- this.httpService = httpService;
637
- this.SERVICE_URL = '/context';
638
- }
639
- getContext(headerId, mode) {
640
- return this.httpService.api({
641
- method: 'post',
642
- body: {
643
- headerId: headerId,
644
- contextMode: ConfigurationContextMode[mode],
645
- },
646
- url: `${this.SERVICE_URL}`,
647
- });
648
- }
649
- }
650
- ContextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
651
- ContextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService });
652
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService, decorators: [{
653
- type: Injectable
654
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
655
-
656
387
  class ContractedPriceApiService {
657
388
  constructor(baseHttpService) {
658
389
  this.baseHttpService = baseHttpService;
@@ -694,26 +425,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
694
425
  type: Injectable
695
426
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
696
427
 
697
- class DeltaApiService {
698
- constructor(httpService) {
699
- this.httpService = httpService;
700
- this.SERVICE_URL = '/delta';
701
- }
702
- calculate$(request) {
703
- return this.httpService.api({
704
- method: 'post',
705
- url: `${this.SERVICE_URL}/calculate`,
706
- body: request,
707
- skipErrorHandler: true,
708
- });
709
- }
710
- }
711
- DeltaApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
712
- DeltaApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService });
713
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, decorators: [{
714
- type: Injectable
715
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
716
-
717
428
  class DocumentAttachmentApiService {
718
429
  constructor(httpService, fileDownloadService) {
719
430
  this.httpService = httpService;
@@ -776,81 +487,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
776
487
  type: Injectable
777
488
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
778
489
 
779
- class EndpointsApiService {
780
- constructor(baseHttpService) {
781
- this.baseHttpService = baseHttpService;
782
- this.adminServiceUrl = '/admin/api-endpoints';
783
- this.serviceUrl = '/api-endpoints';
784
- }
785
- fetchEndpoints$() {
786
- return this.searchEndpoints$(new Expression(), 0, -1);
787
- }
788
- searchEndpoints$(expression, skip, count) {
789
- let params = new HttpParams();
790
- params = params.set('skip', '' + skip);
791
- params = params.set('count', '' + count);
792
- return this.baseHttpService.api({
793
- method: 'post',
794
- url: `${this.adminServiceUrl}/search`,
795
- params,
796
- body: expression,
797
- });
798
- }
799
- removeEndpoint$(id) {
800
- return this.baseHttpService.api({
801
- url: `${this.adminServiceUrl}/${id}`,
802
- method: 'delete',
803
- });
804
- }
805
- restoreEndpoint$(id) {
806
- return this.baseHttpService.api({
807
- url: `${this.adminServiceUrl}/${id}/restore`,
808
- method: 'patch',
809
- });
810
- }
811
- fetchEndpoint$(id) {
812
- return this.baseHttpService.api({
813
- url: `${this.adminServiceUrl}/${id}`,
814
- method: 'get',
815
- });
816
- }
817
- createEndpoint$(body) {
818
- return this.baseHttpService.api({
819
- url: `${this.adminServiceUrl}`,
820
- method: 'post',
821
- body,
822
- });
823
- }
824
- updateEndpoint$(body) {
825
- return this.baseHttpService.api({
826
- url: `${this.adminServiceUrl}/${body.id}`,
827
- method: 'put',
828
- body,
829
- });
830
- }
831
- duplicateEndpoint$(cloneRequest) {
832
- return this.baseHttpService.api({
833
- url: `${this.adminServiceUrl}/${cloneRequest.id}/clone`,
834
- method: 'post',
835
- body: cloneRequest,
836
- });
837
- }
838
- executeEndpoint$(body) {
839
- return this.baseHttpService.api({
840
- url: `${this.serviceUrl}/execute`,
841
- method: 'post',
842
- body,
843
- responseType: 'text',
844
- skipErrorHandler: true,
845
- });
846
- }
847
- }
848
- EndpointsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
849
- EndpointsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService });
850
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, decorators: [{
851
- type: Injectable
852
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
853
-
854
490
  class FlowStateApiService {
855
491
  constructor(httpService) {
856
492
  this.httpService = httpService;
@@ -990,31 +626,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
990
626
  type: Injectable
991
627
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
992
628
 
993
- class FlowsApiService {
994
- constructor(configurationSettingsApiService) {
995
- this.configurationSettingsApiService = configurationSettingsApiService;
996
- this.flowsKey = 'flows';
997
- }
998
- getFlow(id) {
999
- return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
1000
- if (!flow) {
1001
- throw new Error(`Flow with flowId=${id} is not defined`);
1002
- }
1003
- return flow;
1004
- }));
1005
- }
1006
- fetchFlows() {
1007
- return this.configurationSettingsApiService
1008
- .fetchSetting(this.flowsKey)
1009
- .pipe(map((setting) => (setting?.value ? JSON.parse(setting.value) : [])));
1010
- }
1011
- }
1012
- FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1013
- FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
1014
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
1015
- type: Injectable
1016
- }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
1017
-
1018
629
  class GuidedSellingsAdminApiService {
1019
630
  constructor(baseHttpService) {
1020
631
  this.baseHttpService = baseHttpService;
@@ -1225,7 +836,7 @@ class OrgInfoApiService {
1225
836
  getOrgInfo$() {
1226
837
  try {
1227
838
  return window.doCanvasCall && window.ORGANIZATION_ID
1228
- ? from(window.doCanvasCall(`org-info/${window.ORGANIZATION_ID}`, null)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
839
+ ? from(window.doCanvasCall(`org-info/${window.ORGANIZATION_ID}`, null)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1229
840
  : of(undefined);
1230
841
  }
1231
842
  catch {
@@ -1235,7 +846,7 @@ class OrgInfoApiService {
1235
846
  getAvailableVersionsInfo$() {
1236
847
  try {
1237
848
  return window.doCanvasCall && window.ORGANIZATION_ID
1238
- ? from(window.doCanvasCall('versions/available', 'include_all=true')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
849
+ ? from(window.doCanvasCall('versions/available', 'include_all=true')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1239
850
  : of(undefined);
1240
851
  }
1241
852
  catch {
@@ -1245,7 +856,7 @@ class OrgInfoApiService {
1245
856
  upgradeVersion$(targetVersion) {
1246
857
  try {
1247
858
  return window.doCanvasCall && window.ORGANIZATION_ID
1248
- ? from(window.doCanvasCall('versions/upgrade', `target_version=${targetVersion}`)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
859
+ ? from(window.doCanvasCall('versions/upgrade', `target_version=${targetVersion}`)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1249
860
  : of(undefined);
1250
861
  }
1251
862
  catch {
@@ -1259,44 +870,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1259
870
  type: Injectable
1260
871
  }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
1261
872
 
1262
- class PicklistsApiService {
1263
- constructor(baseHttpService) {
1264
- this.baseHttpService = baseHttpService;
1265
- this.serviceUrl = '/admin';
1266
- this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}/picklists` });
1267
- this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/picklists/${code}` });
1268
- this.createPicklist$ = (picklist) => {
1269
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/picklists`, body: picklist });
1270
- };
1271
- this.updatePicklist$ = (picklist) => {
1272
- return this.baseHttpService.api({
1273
- method: 'put',
1274
- url: `${this.serviceUrl}/picklists/${picklist.id}`,
1275
- body: picklist,
1276
- });
1277
- };
1278
- this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/picklists/${id}` });
1279
- this.restorePicklist$ = (id) => {
1280
- return this.baseHttpService.api({
1281
- url: `${this.serviceUrl}/picklists/${id}/restore`,
1282
- method: 'patch',
1283
- });
1284
- };
1285
- this.addPicklistValue$ = (picklist, value) => {
1286
- const data = {
1287
- ...picklist,
1288
- values: [...picklist.values, value],
1289
- };
1290
- return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/picklists/${picklist.id}`, body: data });
1291
- };
1292
- }
1293
- }
1294
- PicklistsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1295
- PicklistsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService });
1296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, decorators: [{
1297
- type: Injectable
1298
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1299
-
1300
873
  class PortalsApiService {
1301
874
  constructor(baseHttpService) {
1302
875
  this.baseHttpService = baseHttpService;
@@ -1369,1151 +942,231 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1369
942
  type: Injectable
1370
943
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1371
944
 
1372
- class PriceApiService {
1373
- constructor(httpService) {
1374
- this.httpService = httpService;
1375
- this.SERVICE_URL = '/price';
1376
- }
1377
- calculate(request) {
1378
- return this.httpService.api({
1379
- method: 'post',
1380
- url: `${this.SERVICE_URL}/calculate`,
1381
- body: request,
1382
- skipErrorHandler: true,
1383
- });
1384
- }
1385
- getPriceLists() {
1386
- return this.httpService.api({
1387
- method: 'get',
1388
- url: '/price-lists',
1389
- });
1390
- }
1391
- getPriceList(id) {
1392
- return this.httpService.api({
1393
- method: 'get',
1394
- url: `/price-lists/${id}`,
1395
- });
1396
- }
1397
- getSellingTermByEndDate(planId, offeringId, startDate, endDate, frequencyUnit, frequencyDuration) {
1398
- return this.httpService.api({
1399
- method: 'post',
1400
- url: `${this.SERVICE_URL}/selling-term-by-end-date`,
1401
- body: {
1402
- planId: planId,
1403
- offeringId: offeringId,
1404
- startDate: startDate,
1405
- endDate: endDate,
1406
- frequencyUnit: frequencyUnit,
1407
- frequencyDuration: frequencyDuration,
1408
- },
1409
- });
1410
- }
1411
- getSellingTermByTerm(planId, offeringId, startDate, term, frequencyUnit, frequencyDuration) {
1412
- return this.httpService.api({
1413
- method: 'post',
1414
- url: `${this.SERVICE_URL}/selling-term-by-term`,
1415
- body: {
1416
- planId: planId,
1417
- offeringId: offeringId,
1418
- startDate: startDate,
1419
- term: term,
1420
- frequencyUnit: frequencyUnit,
1421
- frequencyDuration: frequencyDuration,
1422
- },
1423
- });
1424
- }
1425
- }
1426
- PriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1427
- PriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService });
1428
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, decorators: [{
1429
- type: Injectable
1430
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1431
-
1432
- class ProceduresApiService {
945
+ class PromotionsApiService {
1433
946
  constructor(baseHttpService) {
1434
947
  this.baseHttpService = baseHttpService;
1435
- this.ADMIN_SERVICE_URL = '/admin/procedures';
1436
- this.SERVICE_URL = '/procedures';
1437
- this.fetchProcedures$ = () => {
1438
- return this.searchProcedures$(new Expression(), 0, 100);
948
+ this.serviceUrl = '/admin/promotion';
949
+ this.fetchAll$ = () => {
950
+ return this.baseHttpService.api({ url: this.serviceUrl });
1439
951
  };
1440
- this.searchProcedures$ = (expression, skip, count) => {
1441
- let params = new HttpParams();
1442
- params = params.set('skip', '' + skip);
1443
- params = params.set('count', '' + count);
1444
- return this.baseHttpService.api({
1445
- method: 'post',
1446
- url: `${this.ADMIN_SERVICE_URL}/search`,
1447
- params,
1448
- body: expression,
1449
- });
952
+ this.fetchOne$ = (id) => {
953
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1450
954
  };
1451
- this.createProcedure$ = (newProcedure) => {
955
+ this.remove$ = (id) => {
1452
956
  return this.baseHttpService.api({
1453
- url: `${this.ADMIN_SERVICE_URL}`,
1454
- method: 'post',
1455
- body: newProcedure,
957
+ url: `${this.serviceUrl}/${id}`,
958
+ method: 'delete',
1456
959
  });
1457
960
  };
1458
- this.updateProcedure$ = (procedure) => {
961
+ this.restore$ = (id) => {
1459
962
  return this.baseHttpService.api({
1460
- url: `${this.ADMIN_SERVICE_URL}/${procedure.id}`,
1461
- method: 'put',
1462
- body: procedure,
963
+ method: 'patch',
964
+ url: `${this.serviceUrl}/${id}/restore`,
1463
965
  });
1464
966
  };
1465
- this.duplicateProcedure$ = (body) => {
967
+ this.duplicate$ = (body) => {
1466
968
  return this.baseHttpService
1467
969
  .api({
1468
- url: `${this.ADMIN_SERVICE_URL}/${body.id}/clone`,
970
+ url: `${this.serviceUrl}/${body.id}/clone`,
1469
971
  method: 'post',
1470
972
  body,
1471
973
  })
1472
- .pipe(map(response => response.clonedRecordId));
1473
- };
1474
- this.removeProcedure$ = (id) => {
1475
- return this.baseHttpService.api({
1476
- url: `${this.ADMIN_SERVICE_URL}/${id}`,
1477
- method: 'delete',
1478
- });
1479
- };
1480
- this.restoreProcedure$ = (id) => {
1481
- return this.baseHttpService.api({
1482
- url: `${this.ADMIN_SERVICE_URL}/${id}/restore`,
1483
- method: 'patch',
1484
- });
974
+ .pipe(map$1(response => response.clonedRecordId));
1485
975
  };
1486
976
  }
1487
- fetchProcedure$(id) {
1488
- return this.baseHttpService.api({
1489
- url: `${this.ADMIN_SERVICE_URL}/${id}`,
1490
- method: 'get',
1491
- });
1492
- }
1493
- execute$(body) {
1494
- return this.baseHttpService.api({
1495
- url: `${this.SERVICE_URL}/execute`,
1496
- method: 'post',
1497
- body,
1498
- });
1499
- }
1500
- catalogExecute$(body) {
1501
- return this.baseHttpService.api({
1502
- url: `${this.SERVICE_URL}/catalog/execute`,
1503
- method: 'post',
1504
- body,
1505
- });
977
+ search$(expression, skip, count) {
978
+ let params = new HttpParams();
979
+ if (typeof skip === 'number') {
980
+ params = params.set('skip', '' + skip);
981
+ }
982
+ if (typeof count === 'number') {
983
+ params = params.set('count', '' + count);
984
+ }
985
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
1506
986
  }
1507
- rlmExecute$(body) {
987
+ create$(body) {
1508
988
  return this.baseHttpService.api({
1509
- url: `${this.SERVICE_URL}/rlm/execute`,
989
+ url: `${this.serviceUrl}`,
1510
990
  method: 'post',
1511
991
  body,
1512
992
  });
1513
993
  }
1514
- /**
1515
- * Run active procedure against QuoteDraft
1516
- * @param body
1517
- * @returns
1518
- */
1519
- apply$(body) {
994
+ update$(body) {
1520
995
  return this.baseHttpService.api({
1521
- url: `${this.SERVICE_URL}/apply`,
1522
- method: 'post',
996
+ url: `${this.serviceUrl}/${body.id}`,
997
+ method: 'put',
1523
998
  body,
1524
999
  });
1525
1000
  }
1526
- fetchDefaultPricingSteps$() {
1527
- return this.baseHttpService.api({
1528
- url: `${this.ADMIN_SERVICE_URL}/pricing-steps`,
1529
- method: 'get',
1530
- });
1531
- }
1532
1001
  }
1533
- ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1534
- ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService });
1535
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, decorators: [{
1002
+ PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1003
+ PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
1004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
1536
1005
  type: Injectable
1537
1006
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1538
1007
 
1539
- class ProductApiService {
1008
+ class RebateProgramApiService {
1540
1009
  constructor(baseHttpService) {
1541
1010
  this.baseHttpService = baseHttpService;
1542
- this.serviceUrl = '/products';
1543
- this.fetchProducts$ = (payload) => {
1544
- let params = new HttpParams();
1545
- params = params.append('count', payload.count);
1546
- params = params.append('skip', payload.skip);
1547
- if (payload.name) {
1548
- params = params.append('name', payload.name);
1549
- }
1550
- return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1551
- };
1552
- this.searchProducts$ = (expression, skip, count) => {
1553
- let params = new HttpParams();
1554
- params = params.set('skip', '' + skip);
1555
- params = params.set('count', '' + count);
1556
- return this.baseHttpService.api({
1557
- method: 'post',
1558
- url: `${this.serviceUrl}/search`,
1559
- params: params,
1560
- body: expression,
1561
- });
1562
- };
1563
- this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1564
- this.fetchAttributes$ = () => {
1565
- return this.baseHttpService.api({ url: `${this.serviceUrl}/attributes/definition` });
1566
- };
1567
- this.searchAttributes$ = (expression, skip, count) => {
1568
- let params = new HttpParams();
1569
- params = params.set('skip', '' + skip);
1570
- params = params.set('count', '' + count);
1571
- return this.baseHttpService.api({
1572
- method: 'post',
1573
- url: `${this.serviceUrl}/attributes/definition/search`,
1574
- params: params,
1575
- body: expression,
1576
- });
1577
- };
1578
- this.fetchAttributesByModel = (modelId) => {
1579
- return this.baseHttpService.api({ url: `${this.serviceUrl}/attributes/definition/forModel/${modelId}` });
1580
- };
1581
- this.createNewProduct$ = (productData) => {
1582
- return this.baseHttpService.api({
1583
- url: `${this.serviceUrl}`,
1584
- method: 'post',
1585
- body: productData,
1586
- });
1011
+ this.serviceUrl = '/admin/rebate-program';
1012
+ this.fetchAll$ = () => {
1013
+ return this.baseHttpService.api({ url: this.serviceUrl });
1587
1014
  };
1588
- this.updateProduct$ = (body) => {
1589
- return this.baseHttpService.api({
1590
- url: `${this.serviceUrl}/${body.id}`,
1591
- method: 'put',
1592
- body,
1593
- });
1015
+ this.fetchOne$ = (id) => {
1016
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1594
1017
  };
1595
- this.removeProduct$ = (id) => {
1018
+ this.remove$ = (id) => {
1596
1019
  return this.baseHttpService.api({
1597
1020
  url: `${this.serviceUrl}/${id}`,
1598
1021
  method: 'delete',
1599
1022
  });
1600
1023
  };
1601
- this.restoreProduct$ = (id) => {
1024
+ this.restore$ = (id) => {
1602
1025
  return this.baseHttpService.api({
1603
- url: `${this.serviceUrl}/${id}/restore`,
1604
1026
  method: 'patch',
1027
+ url: `${this.serviceUrl}/${id}/restore`,
1605
1028
  });
1606
1029
  };
1607
- this.createProductAttribute$ = (attributeData) => {
1608
- return this.baseHttpService.api({
1609
- url: `${this.serviceUrl}/attributes`,
1030
+ this.duplicate$ = (body) => {
1031
+ return this.baseHttpService
1032
+ .api({
1033
+ url: `${this.serviceUrl}/${body.id}/clone`,
1610
1034
  method: 'post',
1611
- body: attributeData,
1612
- });
1613
- };
1614
- this.updateProductAttribute$ = (attributeData) => {
1615
- return this.baseHttpService.api({
1616
- url: `${this.serviceUrl}/attributes/${attributeData.id}`,
1617
- method: 'put',
1618
- body: attributeData,
1619
- });
1620
- };
1621
- this.removeProductAttribute$ = (id) => {
1622
- return this.baseHttpService.api({
1623
- url: `${this.serviceUrl}/attributes/${id}`,
1624
- method: 'delete',
1625
- });
1035
+ body,
1036
+ })
1037
+ .pipe(map$1(response => response.clonedRecordId));
1626
1038
  };
1627
- this.createNewAttribute$ = (attributeData) => {
1628
- return this.baseHttpService.api({
1629
- url: `${this.serviceUrl}/attributes/definition`,
1630
- method: 'post',
1631
- body: attributeData,
1632
- });
1039
+ }
1040
+ search$(expression, skip, count) {
1041
+ let params = new HttpParams();
1042
+ if (typeof skip === 'number') {
1043
+ params = params.set('skip', '' + skip);
1044
+ }
1045
+ if (typeof count === 'number') {
1046
+ params = params.set('count', '' + count);
1047
+ }
1048
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
1049
+ }
1050
+ create$(body) {
1051
+ return this.baseHttpService.api({
1052
+ url: `${this.serviceUrl}`,
1053
+ method: 'post',
1054
+ body,
1055
+ });
1056
+ }
1057
+ update$(body) {
1058
+ return this.baseHttpService.api({
1059
+ url: `${this.serviceUrl}/${body.id}`,
1060
+ method: 'put',
1061
+ body,
1062
+ });
1063
+ }
1064
+ }
1065
+ RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1066
+ RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
1067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
1068
+ type: Injectable
1069
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1070
+
1071
+ class RebateTypeApiService {
1072
+ constructor(baseHttpService) {
1073
+ this.baseHttpService = baseHttpService;
1074
+ this.serviceUrl = '/admin/rebate-type';
1075
+ this.fetchAll$ = () => {
1076
+ return this.baseHttpService.api({ url: this.serviceUrl });
1633
1077
  };
1634
- this.updateAttribute$ = (body) => {
1635
- return this.baseHttpService.api({
1636
- url: `${this.serviceUrl}/attributes/definition/${body.id}`,
1637
- method: 'put',
1638
- body,
1639
- });
1078
+ this.fetchOne$ = (id) => {
1079
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1640
1080
  };
1641
- this.removeAttribute$ = (id) => {
1081
+ this.remove$ = (id) => {
1642
1082
  return this.baseHttpService.api({
1643
- url: `${this.serviceUrl}/attributes/definition/${id}`,
1083
+ url: `${this.serviceUrl}/${id}`,
1644
1084
  method: 'delete',
1645
1085
  });
1646
1086
  };
1647
- this.restoreAttribute$ = (id) => {
1087
+ this.restore$ = (id) => {
1648
1088
  return this.baseHttpService.api({
1649
- url: `${this.serviceUrl}/attributes/definition/${id}/restore`,
1650
1089
  method: 'patch',
1090
+ url: `${this.serviceUrl}/${id}/restore`,
1651
1091
  });
1652
1092
  };
1093
+ this.duplicate$ = (body) => {
1094
+ return this.baseHttpService
1095
+ .api({
1096
+ url: `${this.serviceUrl}/${body.id}/clone`,
1097
+ method: 'post',
1098
+ body,
1099
+ })
1100
+ .pipe(map$1(response => response.clonedRecordId));
1101
+ };
1653
1102
  }
1654
- attachImage$(productId, file) {
1655
- const data = new FormData();
1656
- data.append('image', file);
1657
- return this.baseHttpService.upload({
1658
- method: 'post',
1659
- url: `${this.serviceUrl}/${productId}/image`,
1660
- body: data,
1661
- });
1103
+ search$(expression, skip, count) {
1104
+ let params = new HttpParams();
1105
+ if (typeof skip === 'number') {
1106
+ params = params.set('skip', '' + skip);
1107
+ }
1108
+ if (typeof count === 'number') {
1109
+ params = params.set('count', '' + count);
1110
+ }
1111
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
1662
1112
  }
1663
- removeImage$(productId) {
1113
+ create$(body) {
1664
1114
  return this.baseHttpService.api({
1665
- method: 'delete',
1666
- url: `${this.serviceUrl}/${productId}/image`,
1115
+ url: `${this.serviceUrl}`,
1116
+ method: 'post',
1117
+ body,
1667
1118
  });
1668
1119
  }
1669
- fetchImage$(productId) {
1120
+ update$(body) {
1670
1121
  return this.baseHttpService.api({
1671
- url: this.getImageUrl(productId),
1672
- method: 'get',
1673
- responseType: 'blob',
1674
- errorHandler: noop,
1122
+ url: `${this.serviceUrl}/${body.id}`,
1123
+ method: 'put',
1124
+ body,
1675
1125
  });
1676
1126
  }
1677
- getImageUrl(productId) {
1678
- return `${this.serviceUrl}/${productId}/image`;
1679
- }
1680
1127
  }
1681
- ProductApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1682
- ProductApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService });
1683
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, decorators: [{
1128
+ RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1129
+ RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
1130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
1684
1131
  type: Injectable
1685
1132
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1686
1133
 
1687
- class ProductModelApiService {
1688
- constructor(httpService) {
1689
- this.httpService = httpService;
1690
- this.SERVICE_URL = '/models';
1134
+ class SandboxManagerApiService {
1135
+ constructor(messageService) {
1136
+ this.messageService = messageService;
1137
+ /**
1138
+ * Shows an error message using the message service.
1139
+ *
1140
+ * @param {string} message - the error message to be published.
1141
+ */
1142
+ this.publishErrorMessage = (message) => {
1143
+ this.messageService.add({ severity: 'error', summary: message, sticky: true });
1144
+ };
1691
1145
  }
1692
- addModel(model) {
1693
- return this.httpService
1694
- .api({
1695
- method: 'post',
1696
- url: this.SERVICE_URL,
1697
- body: model,
1698
- errorHandler: this.httpService.handleValidationError,
1699
- })
1700
- .pipe(map(result => {
1701
- if (result.successful) {
1702
- return result;
1703
- }
1704
- else {
1705
- throw new Error(result.message);
1706
- }
1707
- }));
1146
+ getSalesforceOrganizations$() {
1147
+ try {
1148
+ return window.doSandboxCall
1149
+ ? from(window.doSandboxCall('orgs', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, [], this.publishErrorMessage)), catchError(() => of([])))
1150
+ : of([]);
1151
+ }
1152
+ catch {
1153
+ return of([]);
1154
+ }
1708
1155
  }
1709
- releaseModel(model) {
1710
- return this.httpService
1711
- .api({
1712
- method: 'put',
1713
- url: `${this.SERVICE_URL}/${model.id}/release`,
1714
- body: model,
1715
- errorHandler: this.httpService.handleValidationError,
1716
- })
1717
- .pipe(map(result => {
1718
- if (result.successful) {
1719
- return '';
1720
- }
1721
- else {
1722
- throw new Error(result.message);
1723
- }
1724
- }));
1725
- }
1726
- removeModel(modelId, successFn, failureFn) {
1727
- const observable = this.httpService
1728
- .api({
1729
- method: 'delete',
1730
- url: `${this.SERVICE_URL}/${modelId}`,
1731
- errorHandler: this.httpService.handleValidationError,
1732
- })
1733
- .pipe(map(result => {
1734
- if (result.successful) {
1735
- return '';
1736
- }
1737
- else {
1738
- throw new Error(result.message);
1739
- }
1740
- }));
1741
- observable.subscribe(() => {
1742
- successFn && successFn.apply();
1743
- }, () => {
1744
- failureFn && failureFn.apply();
1745
- });
1746
- }
1747
- getModelVersions(modelId, count = 100, skip = 0) {
1748
- return this.httpService.api({
1749
- method: 'post',
1750
- url: `${this.SERVICE_URL}/${modelId}/versions`,
1751
- body: {
1752
- skipCount: skip,
1753
- count: count,
1754
- },
1755
- });
1756
- }
1757
- getModel(id, version) {
1758
- let url = `${this.SERVICE_URL}/${id}`;
1759
- if (version) {
1760
- url += `/versions/${version}`;
1761
- }
1762
- return this.httpService.api({ url });
1763
- }
1764
- getModels(skipCount, searchText) {
1765
- return this.httpService.api({
1766
- method: 'post',
1767
- url: `${this.SERVICE_URL}/search`,
1768
- body: {
1769
- nameRegex: searchText,
1770
- skipCount: skipCount.toString(),
1771
- count: ProductModelApiService.MAX_RESULTS,
1772
- },
1773
- });
1774
- }
1775
- getLinkedModels(id, version) {
1776
- let url = `${this.SERVICE_URL}/${id}`;
1777
- if (version) {
1778
- url += `/versions/${version}`;
1779
- }
1780
- url += '/linked';
1781
- return this.httpService.api({ url }).pipe(map((linkedModels) => {
1782
- if (linkedModels) {
1783
- linkedModels.forEach(model => ModelTranslatorUtils.toLocalModel(model));
1784
- }
1785
- return linkedModels;
1786
- }));
1787
- }
1788
- getPML(modelId, version) {
1789
- let url = `${this.SERVICE_URL}/${modelId}/pml/${version}`;
1790
- if (version) {
1791
- url += `/versions/${version}`;
1792
- }
1793
- return this.httpService.api({
1794
- url,
1795
- responseType: 'text',
1796
- });
1797
- }
1798
- savePML(modelId, pml, comment) {
1799
- return this.httpService
1800
- .api({
1801
- method: 'put',
1802
- url: `${this.SERVICE_URL}/${modelId}/pml`,
1803
- body: {
1804
- id: modelId,
1805
- pml: pml,
1806
- comment: comment,
1807
- },
1808
- })
1809
- .pipe(map(result => {
1810
- if (result.successful) {
1811
- return '';
1812
- }
1813
- else {
1814
- throw new Error(result.message);
1815
- }
1816
- }), catchError(this.httpService.handleValidationError));
1817
- }
1818
- generateProducts(modelId) {
1819
- return this.httpService.api({
1820
- url: `${this.SERVICE_URL}/${modelId}/generate-products`,
1821
- });
1822
- }
1823
- saveModel(productModel, comment) {
1824
- const model = EntityUtil.clone(productModel);
1825
- model.comment = comment;
1826
- ModelTranslatorUtils.toServerModel(model);
1827
- return this.httpService
1828
- .api({
1829
- method: 'put',
1830
- url: `${this.SERVICE_URL}/${model.id}`,
1831
- body: model,
1832
- })
1833
- .pipe(map(result => {
1834
- if (result.successful) {
1835
- return '';
1836
- }
1837
- else {
1838
- throw new Error(result.message);
1839
- }
1840
- }), catchError(this.httpService.handleValidationError));
1841
- }
1842
- validateModel(productModel) {
1843
- return this.httpService
1844
- .api({
1845
- method: 'post',
1846
- url: `${this.SERVICE_URL}/validate`,
1847
- body: productModel,
1848
- errorHandler: this.httpService.handleValidationError,
1849
- })
1850
- .pipe(map(result => {
1851
- if (result.successful) {
1852
- return '';
1853
- }
1854
- else {
1855
- throw new Error(result.message);
1856
- }
1857
- }));
1858
- }
1859
- renameModel(productModel, name) {
1860
- const model = EntityUtil.clone(productModel);
1861
- model.name = name;
1862
- ModelTranslatorUtils.toServerModel(model);
1863
- return this.httpService
1864
- .api({
1865
- method: 'patch',
1866
- url: `${this.SERVICE_URL}/${model.id}`,
1867
- body: model,
1868
- })
1869
- .pipe(catchError(this.httpService.handleValidationError));
1870
- }
1871
- uploadPmlFile(file, modelId) {
1872
- const formData = new FormData();
1873
- formData.append('file', file, file.name);
1874
- return this.httpService.upload({
1875
- url: `${this.SERVICE_URL}/${modelId}/pml/upload`,
1876
- body: formData,
1877
- });
1878
- }
1879
- runPml(modelId, pml, rootType, configurationMode) {
1880
- return this.httpService.api({
1881
- method: 'post',
1882
- url: `${this.SERVICE_URL}/${modelId}/pml/run`,
1883
- body: {
1884
- pml,
1885
- rootType,
1886
- configurationMode,
1887
- },
1888
- responseType: 'text',
1889
- });
1890
- }
1891
- evictAllCache() {
1892
- return this.httpService.api({
1893
- method: 'get',
1894
- url: '/cache/evict/environment-variables',
1895
- });
1896
- }
1897
- }
1898
- ProductModelApiService.MAX_RESULTS = 200;
1899
- ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1900
- ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService });
1901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, decorators: [{
1902
- type: Injectable
1903
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1904
-
1905
- class PromotionsApiService {
1906
- constructor(baseHttpService) {
1907
- this.baseHttpService = baseHttpService;
1908
- this.serviceUrl = '/admin/promotion';
1909
- this.fetchAll$ = () => {
1910
- return this.baseHttpService.api({ url: this.serviceUrl });
1911
- };
1912
- this.fetchOne$ = (id) => {
1913
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1914
- };
1915
- this.remove$ = (id) => {
1916
- return this.baseHttpService.api({
1917
- url: `${this.serviceUrl}/${id}`,
1918
- method: 'delete',
1919
- });
1920
- };
1921
- this.restore$ = (id) => {
1922
- return this.baseHttpService.api({
1923
- method: 'patch',
1924
- url: `${this.serviceUrl}/${id}/restore`,
1925
- });
1926
- };
1927
- this.duplicate$ = (body) => {
1928
- return this.baseHttpService
1929
- .api({
1930
- url: `${this.serviceUrl}/${body.id}/clone`,
1931
- method: 'post',
1932
- body,
1933
- })
1934
- .pipe(map$1(response => response.clonedRecordId));
1935
- };
1936
- }
1937
- search$(expression, skip, count) {
1938
- let params = new HttpParams();
1939
- if (typeof skip === 'number') {
1940
- params = params.set('skip', '' + skip);
1941
- }
1942
- if (typeof count === 'number') {
1943
- params = params.set('count', '' + count);
1944
- }
1945
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
1946
- }
1947
- create$(body) {
1948
- return this.baseHttpService.api({
1949
- url: `${this.serviceUrl}`,
1950
- method: 'post',
1951
- body,
1952
- });
1953
- }
1954
- update$(body) {
1955
- return this.baseHttpService.api({
1956
- url: `${this.serviceUrl}/${body.id}`,
1957
- method: 'put',
1958
- body,
1959
- });
1960
- }
1961
- }
1962
- PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1963
- PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
1964
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
1965
- type: Injectable
1966
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1967
-
1968
- class QuoteApiService {
1969
- constructor(httpService) {
1970
- this.httpService = httpService;
1971
- this.SERVICE_URL = '/quotes';
1972
- }
1973
- /**
1974
- * This endpoint doesn't include orders and assets
1975
- * @param objectId quoteId | accountId | opportunityId | orderId
1976
- * @param params Query params
1977
- * @param options Request options
1978
- */
1979
- getQuoteState(objectId, params, options) {
1980
- return this.httpService.api({
1981
- method: 'get',
1982
- url: `/v2${this.SERVICE_URL}/${objectId}`,
1983
- params,
1984
- ...options,
1985
- });
1986
- }
1987
- upsertQuote(request, options) {
1988
- return this.httpService.api({
1989
- method: 'post',
1990
- url: `${this.SERVICE_URL}`,
1991
- body: request,
1992
- ...options,
1993
- });
1994
- }
1995
- submitQuote(request, options) {
1996
- return this.httpService.api({
1997
- method: 'post',
1998
- url: `${this.SERVICE_URL}/submit`,
1999
- body: request,
2000
- ...options,
2001
- });
2002
- }
2003
- attachDocument(id, documentName, data) {
2004
- const formData = new FormData();
2005
- const blob = new Blob([data]);
2006
- formData.append('file', blob, documentName);
2007
- return this.httpService.upload({
2008
- url: `${this.SERVICE_URL}/${id}/attach-document`,
2009
- responseType: 'arraybuffer',
2010
- method: 'post',
2011
- body: formData,
2012
- });
2013
- }
2014
- }
2015
- QuoteApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2016
- QuoteApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService });
2017
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService, decorators: [{
2018
- type: Injectable
2019
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2020
-
2021
- class RampApiService {
2022
- constructor(httpService) {
2023
- this.httpService = httpService;
2024
- this.SERVICE_URL = '/ramp';
2025
- }
2026
- next(request, options) {
2027
- return this.httpService.api({
2028
- method: 'post',
2029
- url: `${this.SERVICE_URL}/next`,
2030
- body: request,
2031
- ...options,
2032
- });
2033
- }
2034
- renew(request, options) {
2035
- return this.httpService.api({
2036
- method: 'post',
2037
- url: `${this.SERVICE_URL}/renew`,
2038
- body: request,
2039
- ...options,
2040
- });
2041
- }
2042
- }
2043
- RampApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2044
- RampApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService });
2045
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, decorators: [{
2046
- type: Injectable
2047
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2048
-
2049
- class RebateProgramApiService {
2050
- constructor(baseHttpService) {
2051
- this.baseHttpService = baseHttpService;
2052
- this.serviceUrl = '/admin/rebate-program';
2053
- this.fetchAll$ = () => {
2054
- return this.baseHttpService.api({ url: this.serviceUrl });
2055
- };
2056
- this.fetchOne$ = (id) => {
2057
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2058
- };
2059
- this.remove$ = (id) => {
2060
- return this.baseHttpService.api({
2061
- url: `${this.serviceUrl}/${id}`,
2062
- method: 'delete',
2063
- });
2064
- };
2065
- this.restore$ = (id) => {
2066
- return this.baseHttpService.api({
2067
- method: 'patch',
2068
- url: `${this.serviceUrl}/${id}/restore`,
2069
- });
2070
- };
2071
- this.duplicate$ = (body) => {
2072
- return this.baseHttpService
2073
- .api({
2074
- url: `${this.serviceUrl}/${body.id}/clone`,
2075
- method: 'post',
2076
- body,
2077
- })
2078
- .pipe(map$1(response => response.clonedRecordId));
2079
- };
2080
- }
2081
- search$(expression, skip, count) {
2082
- let params = new HttpParams();
2083
- if (typeof skip === 'number') {
2084
- params = params.set('skip', '' + skip);
2085
- }
2086
- if (typeof count === 'number') {
2087
- params = params.set('count', '' + count);
2088
- }
2089
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2090
- }
2091
- create$(body) {
2092
- return this.baseHttpService.api({
2093
- url: `${this.serviceUrl}`,
2094
- method: 'post',
2095
- body,
2096
- });
2097
- }
2098
- update$(body) {
2099
- return this.baseHttpService.api({
2100
- url: `${this.serviceUrl}/${body.id}`,
2101
- method: 'put',
2102
- body,
2103
- });
2104
- }
2105
- }
2106
- RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2107
- RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
2108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
2109
- type: Injectable
2110
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2111
-
2112
- class RebateTypeApiService {
2113
- constructor(baseHttpService) {
2114
- this.baseHttpService = baseHttpService;
2115
- this.serviceUrl = '/admin/rebate-type';
2116
- this.fetchAll$ = () => {
2117
- return this.baseHttpService.api({ url: this.serviceUrl });
2118
- };
2119
- this.fetchOne$ = (id) => {
2120
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2121
- };
2122
- this.remove$ = (id) => {
2123
- return this.baseHttpService.api({
2124
- url: `${this.serviceUrl}/${id}`,
2125
- method: 'delete',
2126
- });
2127
- };
2128
- this.restore$ = (id) => {
2129
- return this.baseHttpService.api({
2130
- method: 'patch',
2131
- url: `${this.serviceUrl}/${id}/restore`,
2132
- });
2133
- };
2134
- this.duplicate$ = (body) => {
2135
- return this.baseHttpService
2136
- .api({
2137
- url: `${this.serviceUrl}/${body.id}/clone`,
2138
- method: 'post',
2139
- body,
2140
- })
2141
- .pipe(map$1(response => response.clonedRecordId));
2142
- };
2143
- }
2144
- search$(expression, skip, count) {
2145
- let params = new HttpParams();
2146
- if (typeof skip === 'number') {
2147
- params = params.set('skip', '' + skip);
2148
- }
2149
- if (typeof count === 'number') {
2150
- params = params.set('count', '' + count);
2151
- }
2152
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2153
- }
2154
- create$(body) {
2155
- return this.baseHttpService.api({
2156
- url: `${this.serviceUrl}`,
2157
- method: 'post',
2158
- body,
2159
- });
2160
- }
2161
- update$(body) {
2162
- return this.baseHttpService.api({
2163
- url: `${this.serviceUrl}/${body.id}`,
2164
- method: 'put',
2165
- body,
2166
- });
2167
- }
2168
- }
2169
- RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2170
- RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
2171
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
2172
- type: Injectable
2173
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2174
-
2175
- class RlmApiService {
2176
- constructor(baseHttpService) {
2177
- this.baseHttpService = baseHttpService;
2178
- this.serviceUrl = '/rlm';
2179
- }
2180
- fetchContextDefinitions$() {
2181
- return this.baseHttpService
2182
- .api({ url: `${this.serviceUrl}/context`, skipErrorHandler: true })
2183
- .pipe(catchError(() => {
2184
- return of([]);
2185
- }));
2186
- }
2187
- fetchContextMappings$(id) {
2188
- return this.baseHttpService.api({ url: `${this.serviceUrl}/context/${id}/mappings` });
2189
- }
2190
- fetchContextDefinitionStructure$(id) {
2191
- return this.baseHttpService
2192
- .api({
2193
- url: `${this.serviceUrl}/context/${id}/structure/details`,
2194
- skipErrorHandler: true,
2195
- })
2196
- .pipe(catchError(() => {
2197
- return of([]);
2198
- }), map(objects => {
2199
- return objects.map(object => {
2200
- const tag = object.tags?.[0]?.title;
2201
- const objectAttributes = object.attributes || [];
2202
- return {
2203
- id: object.id,
2204
- title: tag || object.title,
2205
- attributes: objectAttributes.map(attribute => {
2206
- const tag = attribute.tags?.[0]?.title;
2207
- return {
2208
- title: tag || attribute.title,
2209
- fieldType: attribute.fieldType,
2210
- dataType: attribute.dataType,
2211
- };
2212
- }),
2213
- };
2214
- });
2215
- }));
2216
- }
2217
- fetchRlmProcedures(contextDefinitionId) {
2218
- const params = {};
2219
- if (contextDefinitionId) {
2220
- params['contextDefinitionId'] = contextDefinitionId;
2221
- }
2222
- return this.baseHttpService.api({
2223
- url: `${this.serviceUrl}/procedures`,
2224
- params,
2225
- });
2226
- }
2227
- }
2228
- RlmApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RlmApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2229
- RlmApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RlmApiService });
2230
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RlmApiService, decorators: [{
2231
- type: Injectable
2232
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2233
-
2234
- class RlmQuoteApiService {
2235
- constructor(httpService) {
2236
- this.httpService = httpService;
2237
- this.SERVICE_URL = '/quotes/rlm';
2238
- }
2239
- getQuote(mappingType, objectId, contextMappingId, options) {
2240
- const params = { mappingType };
2241
- if (contextMappingId) {
2242
- params['contextMappingId'] = contextMappingId;
2243
- }
2244
- return this.httpService.api({
2245
- method: 'get',
2246
- url: `${this.SERVICE_URL}/${objectId}`,
2247
- params,
2248
- ...options,
2249
- });
2250
- }
2251
- }
2252
- RlmQuoteApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RlmQuoteApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2253
- RlmQuoteApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RlmQuoteApiService });
2254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RlmQuoteApiService, decorators: [{
2255
- type: Injectable
2256
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2257
-
2258
- class RuleGroupsApiService {
2259
- constructor(baseHttpService) {
2260
- this.baseHttpService = baseHttpService;
2261
- this.serviceUrl = '/admin/rule-groups';
2262
- this.fetchRuleGroups$ = () => {
2263
- return this.searchRuleGroups$(new Expression(), 0, 100);
2264
- };
2265
- this.searchRuleGroups$ = (expression, skip, count) => {
2266
- let params = new HttpParams();
2267
- params = params.set('skip', '' + skip);
2268
- params = params.set('count', '' + count);
2269
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2270
- };
2271
- this.createRuleGroup$ = (ruleGroup) => {
2272
- return this.baseHttpService.api({
2273
- url: `${this.serviceUrl}`,
2274
- method: 'post',
2275
- body: ruleGroup,
2276
- });
2277
- };
2278
- this.updateRuleGroup$ = (ruleGroup) => {
2279
- return this.baseHttpService.api({
2280
- url: `${this.serviceUrl}/${ruleGroup.id}`,
2281
- method: 'post',
2282
- body: ruleGroup,
2283
- });
2284
- };
2285
- this.duplicateRuleGroup$ = (body) => {
2286
- return this.baseHttpService
2287
- .api({
2288
- url: `${this.serviceUrl}/${body.id}/clone`,
2289
- method: 'post',
2290
- body,
2291
- })
2292
- .pipe(map$1(response => response.clonedRecordId));
2293
- };
2294
- this.removeRuleGroup$ = (id) => {
2295
- return this.baseHttpService.api({
2296
- url: `${this.serviceUrl}/${id}`,
2297
- method: 'delete',
2298
- });
2299
- };
2300
- this.restoreRuleGroup$ = (id) => {
2301
- return this.baseHttpService.api({
2302
- url: `${this.serviceUrl}/${id}/restore`,
2303
- method: 'patch',
2304
- });
2305
- };
2306
- }
2307
- }
2308
- RuleGroupsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2309
- RuleGroupsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService });
2310
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService, decorators: [{
2311
- type: Injectable
2312
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2313
-
2314
- class RulesApiService {
2315
- constructor(baseHttpService) {
2316
- this.baseHttpService = baseHttpService;
2317
- this.serviceUrl = '/admin/rules';
2318
- this.fetchRules$ = () => {
2319
- return this.searchRules$(new Expression(), 0, 100);
2320
- };
2321
- this.searchRules$ = (expression, skip, count) => {
2322
- let params = new HttpParams();
2323
- if (typeof skip === 'number') {
2324
- params = params.set('skip', '' + skip);
2325
- }
2326
- if (typeof count === 'number') {
2327
- params = params.set('count', '' + count);
2328
- }
2329
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2330
- };
2331
- this.createRule$ = (rule) => {
2332
- return this.baseHttpService.api({
2333
- url: `${this.serviceUrl}`,
2334
- method: 'post',
2335
- body: rule,
2336
- });
2337
- };
2338
- this.updateRule$ = (rule) => {
2339
- return this.baseHttpService.api({
2340
- url: `${this.serviceUrl}/${rule.id}`,
2341
- method: 'put',
2342
- body: rule,
2343
- });
2344
- };
2345
- this.duplicateRule$ = (body) => {
2346
- return this.baseHttpService
2347
- .api({
2348
- url: `${this.serviceUrl}/${body.id}/clone`,
2349
- method: 'post',
2350
- body,
2351
- })
2352
- .pipe(map(response => response.clonedRecordId));
2353
- };
2354
- this.removeRule$ = (id) => {
2355
- return this.baseHttpService.api({
2356
- url: `${this.serviceUrl}/${id}`,
2357
- method: 'delete',
2358
- });
2359
- };
2360
- this.restoreRule$ = (id) => {
2361
- return this.baseHttpService.api({
2362
- url: `${this.serviceUrl}/${id}/restore`,
2363
- method: 'patch',
2364
- });
2365
- };
2366
- }
2367
- fetchRule$(id) {
2368
- return this.baseHttpService.api({
2369
- url: `${this.serviceUrl}/${id}`,
2370
- method: 'get',
2371
- });
2372
- }
2373
- fetchHeaderFields$() {
2374
- return this.baseHttpService.api({
2375
- url: `${this.serviceUrl}/describe/Header`,
2376
- method: 'get',
2377
- });
2378
- }
2379
- execute$(body) {
2380
- const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
2381
- return this.baseHttpService.api({
2382
- url,
2383
- method: 'post',
2384
- body,
2385
- });
2386
- }
2387
- getExecuteRuleUrl(ruleGroupType) {
2388
- if (ruleGroupType === RuleGroupTypes.eligibility) {
2389
- return '/rules/eligibility/execute';
2390
- }
2391
- if (ruleGroupType === RuleGroupTypes.catalog) {
2392
- return '/rules/catalog/execute';
2393
- }
2394
- if (ruleGroupType === RuleGroupTypes.rlmContextBased) {
2395
- return '/rules/rlm/execute';
2396
- }
2397
- return '/rules/execute';
2398
- }
2399
- }
2400
- RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2401
- RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService });
2402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, decorators: [{
2403
- type: Injectable
2404
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2405
-
2406
- class SalesforceApiService {
2407
- constructor(httpService) {
2408
- this.httpService = httpService;
2409
- this.SERVICE_URL = '/proxy';
2410
- }
2411
- query(searchRequest, objectName, options) {
2412
- return this.httpService.api({
2413
- method: 'post',
2414
- body: { ...searchRequest, count: searchRequest.count || 100 },
2415
- url: `${this.SERVICE_URL}/query/${objectName}`,
2416
- ...options,
2417
- });
2418
- }
2419
- queryObjects(search, options) {
2420
- let params = new HttpParams();
2421
- if (search) {
2422
- params = params.append('search', search);
2423
- }
2424
- return this.httpService.api({
2425
- url: `${this.SERVICE_URL}/query`,
2426
- params,
2427
- ...options,
2428
- });
2429
- }
2430
- search(req, options) {
2431
- return this.httpService.api({
2432
- url: `${this.SERVICE_URL}/rest/search`,
2433
- params: { q: req.searchString },
2434
- ...options,
2435
- });
2436
- }
2437
- describeObject(objectName, options) {
2438
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
2439
- return this.httpService.api({ url: methodUrl, ...options });
2440
- }
2441
- describeField(objectName, fieldName, options) {
2442
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
2443
- return this.httpService.api({ url: methodUrl, ...options });
2444
- }
2445
- describe2(objectName, fields, options) {
2446
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
2447
- return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
2448
- }
2449
- apexGetRequest(path, params, options) {
2450
- // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
2451
- const httpParams = new HttpParams({ fromString: params.toString() });
2452
- return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams, ...options });
2453
- }
2454
- apexPostRequest(path, body, options) {
2455
- return this.httpService.api({
2456
- method: 'post',
2457
- body,
2458
- url: `${this.SERVICE_URL}/apex${path}`,
2459
- ...options,
2460
- });
2461
- }
2462
- getGlobalPicklists() {
2463
- return this.httpService.api({
2464
- method: 'get',
2465
- url: `${this.SERVICE_URL}/globalvalueset`,
2466
- });
2467
- }
2468
- getGlobalPicklistValues(id) {
2469
- return this.httpService.api({
2470
- method: 'get',
2471
- url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
2472
- });
2473
- }
2474
- }
2475
- SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2476
- SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
2477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
2478
- type: Injectable
2479
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2480
-
2481
- class SandboxManagerApiService {
2482
- constructor(messageService) {
2483
- this.messageService = messageService;
2484
- /**
2485
- * Shows an error message using the message service.
2486
- *
2487
- * @param {string} message - the error message to be published.
2488
- */
2489
- this.publishErrorMessage = (message) => {
2490
- this.messageService.add({ severity: 'error', summary: message, sticky: true });
2491
- };
2492
- }
2493
- getSalesforceOrganizations$() {
2494
- try {
2495
- return window.doSandboxCall
2496
- ? from(window.doSandboxCall('orgs', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, [], this.publishErrorMessage)), catchError$1(() => of([])))
2497
- : of([]);
2498
- }
2499
- catch {
2500
- return of([]);
2501
- }
2502
- }
2503
- getAvailableSalesforceOrganizationSizes$() {
2504
- try {
2505
- return window.doSandboxCall
2506
- ? from(window.doSandboxCall('available-sizes', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, {}, this.publishErrorMessage)), catchError$1(() => of({})))
2507
- : of({});
2508
- }
2509
- catch {
2510
- return of({});
2511
- }
1156
+ getAvailableSalesforceOrganizationSizes$() {
1157
+ try {
1158
+ return window.doSandboxCall
1159
+ ? from(window.doSandboxCall('available-sizes', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, {}, this.publishErrorMessage)), catchError(() => of({})))
1160
+ : of({});
1161
+ }
1162
+ catch {
1163
+ return of({});
1164
+ }
2512
1165
  }
2513
1166
  createSalesforceOrganization$(payload) {
2514
1167
  try {
2515
1168
  return window.doSandboxCall
2516
- ? from(window.doSandboxCall('orgs', JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1169
+ ? from(window.doSandboxCall('orgs', JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
2517
1170
  : of(undefined);
2518
1171
  }
2519
1172
  catch (err) {
@@ -2523,7 +1176,7 @@ class SandboxManagerApiService {
2523
1176
  updateSalesforceOrganization$(payload) {
2524
1177
  try {
2525
1178
  return window.doSandboxCall
2526
- ? from(window.doSandboxCall(`orgs/${payload.orgId}`, JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1179
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}`, JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
2527
1180
  : of(undefined);
2528
1181
  }
2529
1182
  catch {
@@ -2533,7 +1186,7 @@ class SandboxManagerApiService {
2533
1186
  deleteSalesforceOrganization$(payload) {
2534
1187
  try {
2535
1188
  return window.doSandboxCall
2536
- ? from(window.doSandboxCall(`orgs/${payload.orgId}`, '', 'DELETE')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1189
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}`, '', 'DELETE')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
2537
1190
  : of(undefined);
2538
1191
  }
2539
1192
  catch {
@@ -2543,7 +1196,7 @@ class SandboxManagerApiService {
2543
1196
  activateSalesforceOrganization$(payload) {
2544
1197
  try {
2545
1198
  return window.doSandboxCall
2546
- ? from(window.doSandboxCall(`orgs/${payload.orgId}/activate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1199
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}/activate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
2547
1200
  : of(undefined);
2548
1201
  }
2549
1202
  catch {
@@ -2551,122 +1204,21 @@ class SandboxManagerApiService {
2551
1204
  }
2552
1205
  }
2553
1206
  deactivateSalesforceOrganization$(payload) {
2554
- try {
2555
- return window.doSandboxCall
2556
- ? from(window.doSandboxCall(`orgs/${payload.orgId}/deactivate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
2557
- : of(undefined);
2558
- }
2559
- catch {
2560
- return of(undefined);
2561
- }
2562
- }
2563
- }
2564
- SandboxManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
2565
- SandboxManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService });
2566
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, decorators: [{
2567
- type: Injectable
2568
- }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
2569
-
2570
- class ScriptsApiService {
2571
- constructor(baseHttpService) {
2572
- this.baseHttpService = baseHttpService;
2573
- this.serviceUrl = '/admin/scripts';
2574
- this.fetchScripts$ = () => {
2575
- return this.baseHttpService.api({ url: `${this.serviceUrl}` });
2576
- };
2577
- this.searchScripts$ = (expression, skip, count) => {
2578
- let params = new HttpParams();
2579
- if (typeof skip === 'number') {
2580
- params = params.set('skip', '' + skip);
2581
- }
2582
- if (typeof count === 'number') {
2583
- params = params.set('count', '' + count);
2584
- }
2585
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2586
- };
2587
- this.fetchScript$ = (id) => {
2588
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2589
- };
2590
- this.createScript$ = (script) => {
2591
- return this.baseHttpService.api({
2592
- url: `${this.serviceUrl}`,
2593
- method: 'post',
2594
- body: script,
2595
- });
2596
- };
2597
- this.updateScriptMeta$ = (script) => {
2598
- return this.baseHttpService.api({
2599
- url: `${this.serviceUrl}/${script.id}`,
2600
- method: 'put',
2601
- body: script,
2602
- });
2603
- };
2604
- this.updateScriptDetails$ = (script) => {
2605
- return this.baseHttpService.api({
2606
- url: `${this.serviceUrl}/${script.id}`,
2607
- method: 'put',
2608
- body: script,
2609
- });
2610
- };
2611
- this.cloneScript$ = (cloneRequest) => {
2612
- return this.baseHttpService
2613
- .api({
2614
- url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
2615
- method: 'post',
2616
- body: cloneRequest,
2617
- })
2618
- .pipe(map(response => response.clonedRecordId));
2619
- };
2620
- this.removeScript$ = (id) => {
2621
- return this.baseHttpService.api({
2622
- url: `${this.serviceUrl}/${id}`,
2623
- method: 'delete',
2624
- });
2625
- };
2626
- this.restoreScript$ = (id) => {
2627
- return this.baseHttpService.api({
2628
- url: `${this.serviceUrl}/${id}/restore`,
2629
- method: 'patch',
2630
- });
2631
- };
2632
- this.execute$ = (body) => {
2633
- return this.baseHttpService.api({
2634
- url: `/scripts/execute`,
2635
- method: 'post',
2636
- body,
2637
- errorHandler: () => null,
2638
- });
2639
- };
2640
- }
2641
- }
2642
- ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2643
- ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService });
2644
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, decorators: [{
2645
- type: Injectable
2646
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2647
-
2648
- class ShoppingCartSettingsApiService {
2649
- constructor(configurationSettingsApiService) {
2650
- this.configurationSettingsApiService = configurationSettingsApiService;
2651
- this.shoppingCartSettingsKey = 'shopping-cart';
2652
- }
2653
- getSetting(id) {
2654
- return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings?.value, [])), map(settings => settings.find(setting => setting.id == id)));
2655
- }
2656
- fetchSettings() {
2657
- return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
2658
- }
2659
- getSettingsMap() {
2660
- return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings?.value, [])), map((settings) => settings.reduce((acc, setting) => {
2661
- return { ...acc, [setting.id]: setting.properties };
2662
- }, {})));
1207
+ try {
1208
+ return window.doSandboxCall
1209
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}/deactivate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
1210
+ : of(undefined);
1211
+ }
1212
+ catch {
1213
+ return of(undefined);
1214
+ }
2663
1215
  }
2664
1216
  }
2665
- ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2666
- ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
2667
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
1217
+ SandboxManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
1218
+ SandboxManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService });
1219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, decorators: [{
2668
1220
  type: Injectable
2669
- }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
1221
+ }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
2670
1222
 
2671
1223
  class StatefulConfigurationApiService {
2672
1224
  constructor(httpService) {
@@ -2716,489 +1268,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2716
1268
  type: Injectable
2717
1269
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2718
1270
 
2719
- class UIDefinitionsApiService {
2720
- constructor(baseHttpService) {
2721
- this.baseHttpService = baseHttpService;
2722
- }
2723
- fetch$(modelId, version) {
2724
- const serviceUrl = this.getServiceUrl(modelId);
2725
- let params = new HttpParams();
2726
- if (version != null) {
2727
- params = params.set('modelVersion', version);
2728
- }
2729
- return this.baseHttpService
2730
- .api({
2731
- method: 'get',
2732
- url: serviceUrl,
2733
- params: params,
2734
- })
2735
- .pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
2736
- }
2737
- create$(modelId, uiDefinitionContainer) {
2738
- const serviceUrl = this.getServiceUrl(modelId);
2739
- const dto = {
2740
- ...omit(uiDefinitionContainer, 'source'),
2741
- sourceBlob: JSON.stringify(uiDefinitionContainer.source),
2742
- };
2743
- return this.baseHttpService
2744
- .api({
2745
- method: 'post',
2746
- url: serviceUrl,
2747
- body: dto,
2748
- })
2749
- .pipe(map$1(container => uiDefinitionFromDTO(container)));
2750
- }
2751
- get$(modelId, uiDefinitionId) {
2752
- const serviceUrl = this.getServiceUrl(modelId);
2753
- return this.baseHttpService
2754
- .api({
2755
- method: 'get',
2756
- url: `${serviceUrl}/${uiDefinitionId}`,
2757
- })
2758
- .pipe(map$1(container => uiDefinitionFromDTO({ ...container, id: uiDefinitionId })));
2759
- }
2760
- update$(uiDefinitionContainer) {
2761
- const serviceUrl = this.getServiceUrl(uiDefinitionContainer.modelId);
2762
- const dto = uiDefinitionToDTO(uiDefinitionContainer);
2763
- return this.baseHttpService
2764
- .api({
2765
- method: 'put',
2766
- url: `${serviceUrl}/${uiDefinitionContainer.id}`,
2767
- body: dto,
2768
- })
2769
- .pipe(map$1(container => uiDefinitionFromDTO(container)));
2770
- }
2771
- delete$(uiDefinitionContainer) {
2772
- const serviceUrl = this.getServiceUrl(uiDefinitionContainer.modelId);
2773
- return this.baseHttpService.api({
2774
- method: 'delete',
2775
- url: `${serviceUrl}/${uiDefinitionContainer.id}`,
2776
- });
2777
- }
2778
- getServiceUrl(modelId) {
2779
- return `/models/${modelId}/uidefinitions`;
2780
- }
2781
- }
2782
- UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2783
- UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService });
2784
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
2785
- type: Injectable
2786
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2787
-
2788
- const fromUIComponentStoryDTO = (dto, attachments) => {
2789
- return {
2790
- id: dto.id,
2791
- name: dto.name,
2792
- uiComponentId: dto.uiComponentId,
2793
- description: dto.description,
2794
- section: attachments.json,
2795
- template: attachments.html,
2796
- script: attachments.js,
2797
- styles: attachments.css,
2798
- };
2799
- };
2800
-
2801
- class UITemplatesApiService {
2802
- constructor(baseHttpService) {
2803
- this.baseHttpService = baseHttpService;
2804
- this.serviceUrl = '/uitemplates';
2805
- this.fetchTemplates$ = (name) => {
2806
- let params = new HttpParams();
2807
- if (name) {
2808
- params = params.append('name', name);
2809
- }
2810
- return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
2811
- };
2812
- this.createTemplate$ = (template) => {
2813
- return this.baseHttpService.api({
2814
- method: 'post',
2815
- url: `${this.serviceUrl}`,
2816
- body: template,
2817
- });
2818
- };
2819
- this.updateTemplate$ = (template) => {
2820
- return this.baseHttpService.api({
2821
- method: 'put',
2822
- url: `${this.serviceUrl}/${template.id}`,
2823
- body: template,
2824
- });
2825
- };
2826
- this.duplicateTemplate$ = (template, cloneRequest) => {
2827
- return this.baseHttpService
2828
- .api({
2829
- url: `${this.serviceUrl}/${template.id}/clone`,
2830
- method: 'post',
2831
- body: cloneRequest,
2832
- })
2833
- .pipe(map$1(response => response.clonedRecordId));
2834
- };
2835
- this.removeTemplate$ = (id) => {
2836
- return this.baseHttpService.api({
2837
- method: 'delete',
2838
- url: `${this.serviceUrl}/${id}`,
2839
- });
2840
- };
2841
- this.restoreTemplate$ = (id) => {
2842
- return this.baseHttpService.api({
2843
- method: 'patch',
2844
- url: `${this.serviceUrl}/${id}`,
2845
- });
2846
- };
2847
- this.searchTemplates$ = (data) => {
2848
- return this.baseHttpService.api({
2849
- method: 'post',
2850
- url: `${this.serviceUrl}/search`,
2851
- params: data.params,
2852
- body: data.expression,
2853
- });
2854
- };
2855
- this.fetchComponents$ = (templateId, name) => {
2856
- let params = new HttpParams();
2857
- if (name) {
2858
- params = params.append('name', name);
2859
- }
2860
- return this.baseHttpService.api({
2861
- url: `${this.serviceUrl}/${templateId}/components`,
2862
- params,
2863
- });
2864
- };
2865
- this.fetchComponent$ = (templateId, componentId) => {
2866
- return this.baseHttpService.api({
2867
- url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
2868
- });
2869
- };
2870
- this.createComponent$ = (component) => {
2871
- return this.baseHttpService.api({
2872
- method: 'post',
2873
- url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
2874
- body: component,
2875
- });
2876
- };
2877
- this.updateComponent$ = (component) => {
2878
- return this.baseHttpService.api({
2879
- method: 'put',
2880
- url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
2881
- body: component,
2882
- });
2883
- };
2884
- this.duplicateComponent$ = (component, cloneRequest) => {
2885
- return this.baseHttpService
2886
- .api({
2887
- url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
2888
- method: 'post',
2889
- body: cloneRequest,
2890
- })
2891
- .pipe(map$1(response => response.clonedRecordId));
2892
- };
2893
- this.removeComponent$ = (templateId, componentId) => {
2894
- return this.baseHttpService.api({
2895
- method: 'delete',
2896
- url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
2897
- });
2898
- };
2899
- this.restoreComponent$ = (templateId, componentId) => {
2900
- return this.baseHttpService.api({
2901
- method: 'patch',
2902
- url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
2903
- });
2904
- };
2905
- this.searchComponents$ = (templateId, data) => {
2906
- return this.baseHttpService.api({
2907
- method: 'post',
2908
- url: `${this.serviceUrl}/${templateId}/components/search`,
2909
- params: data.params,
2910
- body: data.expression,
2911
- });
2912
- };
2913
- this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
2914
- return this.baseHttpService
2915
- .api({
2916
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
2917
- responseType: 'text',
2918
- errorHandler: noop,
2919
- })
2920
- .pipe(catchError$1(() => of('')));
2921
- };
2922
- this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
2923
- return forkJoin([
2924
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
2925
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
2926
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
2927
- this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
2928
- ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
2929
- };
2930
- this.fetchStories$ = (templateId, componentId, name) => {
2931
- let params = new HttpParams();
2932
- if (name) {
2933
- params = params.append('name', name);
2934
- }
2935
- return this.baseHttpService
2936
- .api({
2937
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
2938
- params,
2939
- })
2940
- .pipe(switchMap(dtos => {
2941
- if (!dtos.length) {
2942
- return of([]);
2943
- }
2944
- return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
2945
- }));
2946
- };
2947
- this.fetchStory$ = (templateId, componentId, storyId) => {
2948
- return this.baseHttpService
2949
- .api({
2950
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
2951
- })
2952
- .pipe(switchMap(dto => this.convertToComponentStory$(templateId, componentId, dto)));
2953
- };
2954
- this.createComponentStory$ = (templateId, story) => {
2955
- return this.baseHttpService.api({
2956
- method: 'post',
2957
- url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
2958
- body: story,
2959
- });
2960
- };
2961
- this.updateComponentStory$ = (templateId, story) => {
2962
- const { script, template, styles, section, ...rest } = story;
2963
- return this.baseHttpService
2964
- .api({
2965
- method: 'put',
2966
- url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
2967
- body: rest,
2968
- })
2969
- .pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
2970
- };
2971
- this.duplicateComponentStory$ = (story, cloneRequest) => {
2972
- return this.baseHttpService
2973
- .api({
2974
- url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
2975
- method: 'post',
2976
- body: cloneRequest,
2977
- })
2978
- .pipe(map$1(response => response.clonedRecordId));
2979
- };
2980
- this.deleteComponentStory$ = (templateId, componentId, storyId) => {
2981
- return this.baseHttpService.api({
2982
- method: 'delete',
2983
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
2984
- });
2985
- };
2986
- this.restoreComponentStory$ = (templateId, componentId, storyId) => {
2987
- return this.baseHttpService.api({
2988
- method: 'patch',
2989
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
2990
- });
2991
- };
2992
- this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
2993
- const formData = new FormData();
2994
- if (attachments.html != null) {
2995
- formData.append('html', new Blob([attachments.html]), 'story-template.html');
2996
- }
2997
- if (attachments.css != null) {
2998
- formData.append('css', new Blob([attachments.css]), 'story-styles.css');
2999
- }
3000
- if (attachments.js != null) {
3001
- formData.append('js', new Blob([attachments.js]), 'story-script.js');
3002
- }
3003
- if (attachments.json != null) {
3004
- formData.append('json', new Blob([attachments.json]), 'story-section.json');
3005
- }
3006
- return this.baseHttpService.upload({
3007
- method: 'post',
3008
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
3009
- body: formData,
3010
- });
3011
- };
3012
- this.fetchComponentAttachments$ = (templateId, component) => {
3013
- return forkJoin([
3014
- this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
3015
- this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
3016
- this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
3017
- this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
3018
- ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
3019
- };
3020
- this.fetchComponentsAttachments$ = (templateId) => {
3021
- return this.fetchComponents$(templateId).pipe(switchMap(components => {
3022
- return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
3023
- }));
3024
- };
3025
- this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
3026
- return this.baseHttpService
3027
- .api({
3028
- method: 'get',
3029
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
3030
- responseType: 'text',
3031
- errorHandler: noop,
3032
- })
3033
- .pipe(catchError$1(() => of('')));
3034
- };
3035
- this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
3036
- const formData = new FormData();
3037
- if (attachments.html != null) {
3038
- formData.append('html', new Blob([attachments.html]), 'template.html');
3039
- }
3040
- if (attachments.css != null) {
3041
- formData.append('css', new Blob([attachments.css]), 'styles.css');
3042
- }
3043
- if (attachments.js != null) {
3044
- formData.append('js', new Blob([attachments.js]), 'script.js');
3045
- }
3046
- if (attachments.json != null) {
3047
- formData.append('json', new Blob([attachments.json]), 'section.json');
3048
- }
3049
- return this.baseHttpService.upload({
3050
- method: 'post',
3051
- url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
3052
- body: formData,
3053
- });
3054
- };
3055
- }
3056
- getTemplateThumbnailUrl(templateId) {
3057
- return `${this.serviceUrl}/${templateId}/thumbnail/file`;
3058
- }
3059
- attachTemplateThumbnail$(templateId, file) {
3060
- const data = new FormData();
3061
- data.append('thumb', file);
3062
- return this.baseHttpService.upload({
3063
- method: 'post',
3064
- url: `${this.serviceUrl}/${templateId}/thumbnail`,
3065
- body: data,
3066
- });
3067
- }
3068
- removeTemplateThumbnail$(templateId) {
3069
- return this.baseHttpService.api({
3070
- method: 'delete',
3071
- url: `${this.serviceUrl}/${templateId}/thumbnail`,
3072
- });
3073
- }
3074
- }
3075
- UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
3076
- UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService });
3077
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, decorators: [{
3078
- type: Injectable
3079
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
3080
-
3081
- class VeloceObjectsApiService {
3082
- constructor(baseHttpService) {
3083
- this.baseHttpService = baseHttpService;
3084
- this.serviceUrl = '/veloceobjects';
3085
- this.updateCategory$ = (category) => {
3086
- return this.baseHttpService.api({
3087
- method: 'put',
3088
- url: `${this.serviceUrl}/categories/${category.id}`,
3089
- body: category,
3090
- });
3091
- };
3092
- this.deleteCategory$ = (id) => {
3093
- return this.baseHttpService.api({
3094
- method: 'delete',
3095
- url: `${this.serviceUrl}/categories/${id}`,
3096
- });
3097
- };
3098
- this.searchObjects$ = (searchParams, expression) => {
3099
- const params = new HttpParams({ fromObject: { ...searchParams } });
3100
- return this.baseHttpService.api({
3101
- method: 'post',
3102
- url: `${this.serviceUrl}/search`,
3103
- params,
3104
- body: expression || {},
3105
- });
3106
- };
3107
- this.deleteObject$ = (id) => {
3108
- return this.baseHttpService.api({
3109
- method: 'delete',
3110
- url: `${this.serviceUrl}/${id}`,
3111
- });
3112
- };
3113
- this.duplicateObject$ = (body) => {
3114
- return this.baseHttpService
3115
- .api({
3116
- method: 'post',
3117
- url: `${this.serviceUrl}/${body.id}/clone`,
3118
- body,
3119
- })
3120
- .pipe(map(response => response.clonedRecordId));
3121
- };
3122
- this.restoreObject$ = (id) => {
3123
- return this.baseHttpService.api({
3124
- method: 'patch',
3125
- url: `${this.serviceUrl}/${id}/restore`,
3126
- });
3127
- };
3128
- }
3129
- fetchCategories$() {
3130
- return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
3131
- }
3132
- createCategory$(category) {
3133
- return this.baseHttpService.api({
3134
- method: 'post',
3135
- url: `${this.serviceUrl}/categories`,
3136
- body: category,
3137
- });
3138
- }
3139
- fetchObjects$() {
3140
- return this.baseHttpService.api({ url: `${this.serviceUrl}` });
3141
- }
3142
- fetchObject$(id) {
3143
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
3144
- }
3145
- createObject$(object) {
3146
- return this.baseHttpService.api({
3147
- method: 'post',
3148
- url: `${this.serviceUrl}`,
3149
- body: object,
3150
- });
3151
- }
3152
- updateObject$(object) {
3153
- return this.baseHttpService.api({
3154
- method: 'put',
3155
- url: `${this.serviceUrl}/${object.id}`,
3156
- body: object,
3157
- });
3158
- }
3159
- }
3160
- VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
3161
- VeloceObjectsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService });
3162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, decorators: [{
3163
- type: Injectable
3164
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
3165
-
3166
1271
  class ApiModule {
3167
1272
  }
3168
1273
  ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3169
- ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, imports: [HttpClientModule] });
1274
+ ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, imports: [HttpClientModule, ApiV2Module] });
3170
1275
  ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, providers: [
3171
1276
  BaseHttpService,
3172
1277
  XrayService,
3173
- ConfigurationApiService,
3174
- ConfigurationSettingsApiService,
3175
- ContextApiService,
3176
1278
  DocumentAttachmentApiService,
3177
- PriceApiService,
3178
- ProductModelApiService,
3179
- ProceduresApiService,
3180
- QuoteApiService,
3181
- RampApiService,
3182
- SalesforceApiService,
3183
- UITemplatesApiService,
3184
- ScriptsApiService,
3185
- RulesApiService,
3186
- RuleGroupsApiService,
3187
- FlowsApiService,
3188
1279
  GuidedSellingsAdminApiService,
3189
- ShoppingCartSettingsApiService,
3190
- ProductApiService,
3191
1280
  CatalogAdminApiService,
3192
1281
  GuidedSellingApiService,
3193
1282
  CatalogApiService,
3194
- DeltaApiService,
3195
1283
  AccountApiService,
3196
- PicklistsApiService,
3197
- EndpointsApiService,
3198
1284
  OrgInfoApiService,
3199
1285
  OffersApiService,
3200
- UIDefinitionsApiService,
3201
- VeloceObjectsApiService,
3202
1286
  StatefulConfigurationApiService,
3203
1287
  RebateProgramApiService,
3204
1288
  RebateTypeApiService,
@@ -3206,48 +1290,24 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
3206
1290
  VeloceAuthService,
3207
1291
  ContractedPriceApiService,
3208
1292
  PortalsApiService,
3209
- ConfigurationProcessorsApiService,
3210
1293
  FlowStateApiService,
3211
1294
  SandboxManagerApiService,
3212
- RlmApiService,
3213
- RlmQuoteApiService,
3214
- ], imports: [HttpClientModule] });
1295
+ ], imports: [HttpClientModule, ApiV2Module] });
3215
1296
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, decorators: [{
3216
1297
  type: NgModule,
3217
1298
  args: [{
3218
- imports: [HttpClientModule],
1299
+ imports: [HttpClientModule, ApiV2Module],
3219
1300
  providers: [
3220
1301
  BaseHttpService,
3221
1302
  XrayService,
3222
- ConfigurationApiService,
3223
- ConfigurationSettingsApiService,
3224
- ContextApiService,
3225
1303
  DocumentAttachmentApiService,
3226
- PriceApiService,
3227
- ProductModelApiService,
3228
- ProceduresApiService,
3229
- QuoteApiService,
3230
- RampApiService,
3231
- SalesforceApiService,
3232
- UITemplatesApiService,
3233
- ScriptsApiService,
3234
- RulesApiService,
3235
- RuleGroupsApiService,
3236
- FlowsApiService,
3237
1304
  GuidedSellingsAdminApiService,
3238
- ShoppingCartSettingsApiService,
3239
- ProductApiService,
3240
1305
  CatalogAdminApiService,
3241
1306
  GuidedSellingApiService,
3242
1307
  CatalogApiService,
3243
- DeltaApiService,
3244
1308
  AccountApiService,
3245
- PicklistsApiService,
3246
- EndpointsApiService,
3247
1309
  OrgInfoApiService,
3248
1310
  OffersApiService,
3249
- UIDefinitionsApiService,
3250
- VeloceObjectsApiService,
3251
1311
  StatefulConfigurationApiService,
3252
1312
  RebateProgramApiService,
3253
1313
  RebateTypeApiService,
@@ -3255,11 +1315,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3255
1315
  VeloceAuthService,
3256
1316
  ContractedPriceApiService,
3257
1317
  PortalsApiService,
3258
- ConfigurationProcessorsApiService,
3259
1318
  FlowStateApiService,
3260
1319
  SandboxManagerApiService,
3261
- RlmApiService,
3262
- RlmQuoteApiService,
3263
1320
  ],
3264
1321
  }]
3265
1322
  }] });
@@ -3268,5 +1325,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3268
1325
  * Generated bundle index. Do not edit.
3269
1326
  */
3270
1327
 
3271
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, PromotionsApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RlmApiService, RlmQuoteApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, SandboxManagerApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceAuthService, VeloceObjectsApiService, fromUIComponentStoryDTO, handleCanvasResponse };
1328
+ export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ContractedPriceApiService, DocumentAttachmentApiService, FlowStateApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PortalsApiService, PromotionsApiService, RebateProgramApiService, RebateTypeApiService, SandboxManagerApiService, StatefulConfigurationApiService, VeloceAuthService, handleCanvasResponse };
3272
1329
  //# sourceMappingURL=veloceapps-api.mjs.map