@veloceapps/api 11.0.0-11 → 11.0.0-13

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 (211) hide show
  1. package/esm2020/index.mjs +2 -45
  2. package/esm2020/src/index.mjs +34 -0
  3. package/esm2020/src/lib/api.module.mjs +114 -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/configuration-api.service.mjs +122 -0
  9. package/esm2020/src/lib/services/configuration-settings-api.service.mjs +96 -0
  10. package/esm2020/src/lib/services/contracted-price-api.service.mjs +45 -0
  11. package/esm2020/src/lib/services/delta-api.service.mjs +23 -0
  12. package/esm2020/src/lib/services/document-attachment-api.service.mjs +66 -0
  13. package/esm2020/src/lib/services/endpoints-api.service.mjs +80 -0
  14. package/esm2020/src/lib/services/flow-state-api.mjs +142 -0
  15. package/esm2020/src/lib/services/flows-api.service.mjs +29 -0
  16. package/esm2020/src/lib/services/guided-sellings-admin-api.service.mjs +65 -0
  17. package/esm2020/src/lib/services/guided-sellings-api.service.mjs +37 -0
  18. package/esm2020/src/lib/services/offers-api.service.mjs +76 -0
  19. package/esm2020/src/lib/services/org-info-api.service.mjs +54 -0
  20. package/esm2020/src/lib/services/picklists-api.service.mjs +41 -0
  21. package/esm2020/src/lib/services/portals-api.service.mjs +76 -0
  22. package/esm2020/src/lib/services/price-api.service.mjs +63 -0
  23. package/esm2020/src/lib/services/product-api.service.mjs +153 -0
  24. package/esm2020/src/lib/services/product-model-api.service.mjs +223 -0
  25. package/esm2020/src/lib/services/promotions-api.service.mjs +68 -0
  26. package/esm2020/src/lib/services/ramp-api.service.mjs +31 -0
  27. package/esm2020/src/lib/services/rebate-program-api.service.mjs +68 -0
  28. package/esm2020/src/lib/services/rebate-type-api.service.mjs +68 -0
  29. package/esm2020/src/lib/services/salesforce-api.service.mjs +79 -0
  30. package/esm2020/src/lib/services/sandbox-manager-api.service.mjs +94 -0
  31. package/esm2020/src/lib/services/shopping-cart-settings-api.service.mjs +28 -0
  32. package/esm2020/src/lib/services/stateful-configuration-api.mjs +51 -0
  33. package/esm2020/src/lib/services/veloce-objects-api.service.mjs +90 -0
  34. package/esm2020/src/lib/types/attachment.types.mjs +2 -0
  35. package/esm2020/src/lib/types/auth.types.mjs +2 -0
  36. package/esm2020/src/lib/types/clone-request.types.mjs +2 -0
  37. package/esm2020/src/lib/types/delta-request.types.mjs +2 -0
  38. package/esm2020/src/lib/types/dto/configuration-settings-dto.types.mjs +22 -0
  39. package/esm2020/src/lib/types/dto/offers-dto.types.mjs +2 -0
  40. package/esm2020/src/lib/types/index.mjs +8 -0
  41. package/esm2020/src/lib/types/org-info.types.mjs +2 -0
  42. package/esm2020/src/lib/types/price.types.mjs +2 -0
  43. package/esm2020/src/lib/types/quote.types.mjs +2 -0
  44. package/esm2020/src/lib/types/ramp-request.types.mjs +2 -0
  45. package/esm2020/src/lib/types/search-request.types.mjs +2 -0
  46. package/esm2020/src/lib/types/stateful-configuration.types.mjs +2 -0
  47. package/esm2020/src/lib/utils/canvas.utils.mjs +33 -0
  48. package/esm2020/src/lib/utils/index.mjs +2 -0
  49. package/esm2020/v2/api-v2.module.mjs +48 -0
  50. package/esm2020/v2/index.mjs +4 -0
  51. package/esm2020/v2/services/configuration-processors-api.service.mjs +38 -0
  52. package/esm2020/v2/services/context-definition-api.service.mjs +62 -0
  53. package/esm2020/v2/services/index.mjs +13 -0
  54. package/esm2020/v2/services/procedures-admin-api.service.mjs +82 -0
  55. package/esm2020/v2/services/procedures-api.service.mjs +44 -0
  56. package/esm2020/v2/services/rule-groups-admin-api.service.mjs +62 -0
  57. package/esm2020/v2/services/rules-admin-api.service.mjs +98 -0
  58. package/esm2020/v2/services/rules-api.service.mjs +36 -0
  59. package/esm2020/v2/services/sales-transactions-api.service.mjs +68 -0
  60. package/esm2020/v2/services/scripts-admin-api.service.mjs +75 -0
  61. package/esm2020/v2/services/scripts-api.service.mjs +23 -0
  62. package/esm2020/v2/services/ui-definitions-api.service.mjs +132 -0
  63. package/esm2020/{lib → v2}/services/ui-templates-api.service.mjs +2 -2
  64. package/esm2020/v2/types/clone-request.types.mjs +2 -0
  65. package/esm2020/v2/types/dto/ui-template-dto.types.mjs +2 -0
  66. package/esm2020/v2/types/index.mjs +4 -0
  67. package/esm2020/v2/types/procedure.types.mjs +2 -0
  68. package/esm2020/v2/types/sales-transaction.types.mjs +2 -0
  69. package/esm2020/v2/utils/ui-template.utils.mjs +13 -0
  70. package/esm2020/v2/veloceapps-api-v2.mjs +5 -0
  71. package/esm2020/veloceapps-api.mjs +1 -1
  72. package/fesm2015/veloceapps-api-v2.mjs +1005 -0
  73. package/fesm2015/veloceapps-api-v2.mjs.map +1 -0
  74. package/fesm2015/veloceapps-api.mjs +8 -939
  75. package/fesm2015/veloceapps-api.mjs.map +1 -1
  76. package/fesm2020/veloceapps-api-v2.mjs +1019 -0
  77. package/fesm2020/veloceapps-api-v2.mjs.map +1 -0
  78. package/fesm2020/veloceapps-api.mjs +78 -1033
  79. package/fesm2020/veloceapps-api.mjs.map +1 -1
  80. package/index.d.ts +1 -44
  81. package/package.json +9 -1
  82. package/src/index.d.ts +33 -0
  83. package/{lib → src/lib}/api.module.d.ts +2 -1
  84. package/src/lib/utils/index.d.ts +1 -0
  85. package/v2/api-v2.module.d.ts +7 -0
  86. package/v2/index.d.ts +3 -0
  87. package/{lib/services/rlm-api.service.d.ts → v2/services/context-definition-api.service.d.ts} +3 -3
  88. package/v2/services/index.d.ts +12 -0
  89. package/{lib/services/procedures-api.service.d.ts → v2/services/procedures-admin-api.service.d.ts} +6 -13
  90. package/v2/services/procedures-api.service.d.ts +15 -0
  91. package/{lib/services/rule-groups-api.service.d.ts → v2/services/rule-groups-admin-api.service.d.ts} +3 -3
  92. package/{lib/services/rules-api.service.d.ts → v2/services/rules-admin-api.service.d.ts} +4 -4
  93. package/v2/services/rules-api.service.d.ts +11 -0
  94. package/v2/services/sales-transactions-api.service.d.ts +20 -0
  95. package/{lib/services/scripts-api.service.d.ts → v2/services/scripts-admin-api.service.d.ts} +4 -5
  96. package/v2/services/scripts-api.service.d.ts +11 -0
  97. package/{lib → v2}/services/ui-definitions-api.service.d.ts +5 -2
  98. package/v2/types/clone-request.types.d.ts +5 -0
  99. package/v2/types/index.d.ts +3 -0
  100. package/v2/types/procedure.types.d.ts +10 -0
  101. package/v2/types/sales-transaction.types.d.ts +10 -0
  102. package/esm2020/lib/api.module.mjs +0 -146
  103. package/esm2020/lib/services/account-api.service.mjs +0 -87
  104. package/esm2020/lib/services/auth.service.mjs +0 -22
  105. package/esm2020/lib/services/catalog-admin-api.service.mjs +0 -192
  106. package/esm2020/lib/services/catalog-api.service.mjs +0 -90
  107. package/esm2020/lib/services/configuration-api.service.mjs +0 -122
  108. package/esm2020/lib/services/configuration-processors-api.service.mjs +0 -38
  109. package/esm2020/lib/services/configuration-settings-api.service.mjs +0 -96
  110. package/esm2020/lib/services/context-api.service.mjs +0 -26
  111. package/esm2020/lib/services/contracted-price-api.service.mjs +0 -45
  112. package/esm2020/lib/services/delta-api.service.mjs +0 -23
  113. package/esm2020/lib/services/document-attachment-api.service.mjs +0 -66
  114. package/esm2020/lib/services/endpoints-api.service.mjs +0 -80
  115. package/esm2020/lib/services/flow-state-api.mjs +0 -142
  116. package/esm2020/lib/services/flows-api.service.mjs +0 -29
  117. package/esm2020/lib/services/guided-sellings-admin-api.service.mjs +0 -65
  118. package/esm2020/lib/services/guided-sellings-api.service.mjs +0 -37
  119. package/esm2020/lib/services/offers-api.service.mjs +0 -76
  120. package/esm2020/lib/services/org-info-api.service.mjs +0 -54
  121. package/esm2020/lib/services/picklists-api.service.mjs +0 -41
  122. package/esm2020/lib/services/portals-api.service.mjs +0 -76
  123. package/esm2020/lib/services/price-api.service.mjs +0 -63
  124. package/esm2020/lib/services/procedures-api.service.mjs +0 -113
  125. package/esm2020/lib/services/product-api.service.mjs +0 -153
  126. package/esm2020/lib/services/product-model-api.service.mjs +0 -223
  127. package/esm2020/lib/services/promotions-api.service.mjs +0 -68
  128. package/esm2020/lib/services/quote-api.service.mjs +0 -56
  129. package/esm2020/lib/services/ramp-api.service.mjs +0 -31
  130. package/esm2020/lib/services/rebate-program-api.service.mjs +0 -68
  131. package/esm2020/lib/services/rebate-type-api.service.mjs +0 -68
  132. package/esm2020/lib/services/rlm-api.service.mjs +0 -64
  133. package/esm2020/lib/services/rlm-quote-api.service.mjs +0 -27
  134. package/esm2020/lib/services/rule-groups-api.service.mjs +0 -62
  135. package/esm2020/lib/services/rules-api.service.mjs +0 -98
  136. package/esm2020/lib/services/salesforce-api.service.mjs +0 -79
  137. package/esm2020/lib/services/sandbox-manager-api.service.mjs +0 -94
  138. package/esm2020/lib/services/scripts-api.service.mjs +0 -83
  139. package/esm2020/lib/services/shopping-cart-settings-api.service.mjs +0 -28
  140. package/esm2020/lib/services/stateful-configuration-api.mjs +0 -51
  141. package/esm2020/lib/services/ui-definitions-api.service.mjs +0 -122
  142. package/esm2020/lib/services/veloce-objects-api.service.mjs +0 -90
  143. package/esm2020/lib/types/attachment.types.mjs +0 -2
  144. package/esm2020/lib/types/auth.types.mjs +0 -2
  145. package/esm2020/lib/types/clone-request.types.mjs +0 -2
  146. package/esm2020/lib/types/delta-request.types.mjs +0 -2
  147. package/esm2020/lib/types/dto/configuration-settings-dto.types.mjs +0 -22
  148. package/esm2020/lib/types/dto/offers-dto.types.mjs +0 -2
  149. package/esm2020/lib/types/dto/ui-template-dto.types.mjs +0 -2
  150. package/esm2020/lib/types/index.mjs +0 -8
  151. package/esm2020/lib/types/org-info.types.mjs +0 -2
  152. package/esm2020/lib/types/price.types.mjs +0 -2
  153. package/esm2020/lib/types/quote.types.mjs +0 -2
  154. package/esm2020/lib/types/ramp-request.types.mjs +0 -2
  155. package/esm2020/lib/types/search-request.types.mjs +0 -2
  156. package/esm2020/lib/types/stateful-configuration.types.mjs +0 -2
  157. package/esm2020/lib/utils/canvas.utils.mjs +0 -33
  158. package/esm2020/lib/utils/index.mjs +0 -3
  159. package/esm2020/lib/utils/ui-template.utils.mjs +0 -13
  160. package/lib/services/context-api.service.d.ts +0 -11
  161. package/lib/services/quote-api.service.d.ts +0 -22
  162. package/lib/services/rlm-quote-api.service.d.ts +0 -11
  163. package/lib/utils/index.d.ts +0 -2
  164. /package/{lib → src/lib}/services/account-api.service.d.ts +0 -0
  165. /package/{lib → src/lib}/services/auth.service.d.ts +0 -0
  166. /package/{lib → src/lib}/services/catalog-admin-api.service.d.ts +0 -0
  167. /package/{lib → src/lib}/services/catalog-api.service.d.ts +0 -0
  168. /package/{lib → src/lib}/services/configuration-api.service.d.ts +0 -0
  169. /package/{lib → src/lib}/services/configuration-settings-api.service.d.ts +0 -0
  170. /package/{lib → src/lib}/services/contracted-price-api.service.d.ts +0 -0
  171. /package/{lib → src/lib}/services/delta-api.service.d.ts +0 -0
  172. /package/{lib → src/lib}/services/document-attachment-api.service.d.ts +0 -0
  173. /package/{lib → src/lib}/services/endpoints-api.service.d.ts +0 -0
  174. /package/{lib → src/lib}/services/flow-state-api.d.ts +0 -0
  175. /package/{lib → src/lib}/services/flows-api.service.d.ts +0 -0
  176. /package/{lib → src/lib}/services/guided-sellings-admin-api.service.d.ts +0 -0
  177. /package/{lib → src/lib}/services/guided-sellings-api.service.d.ts +0 -0
  178. /package/{lib → src/lib}/services/offers-api.service.d.ts +0 -0
  179. /package/{lib → src/lib}/services/org-info-api.service.d.ts +0 -0
  180. /package/{lib → src/lib}/services/picklists-api.service.d.ts +0 -0
  181. /package/{lib → src/lib}/services/portals-api.service.d.ts +0 -0
  182. /package/{lib → src/lib}/services/price-api.service.d.ts +0 -0
  183. /package/{lib → src/lib}/services/product-api.service.d.ts +0 -0
  184. /package/{lib → src/lib}/services/product-model-api.service.d.ts +0 -0
  185. /package/{lib → src/lib}/services/promotions-api.service.d.ts +0 -0
  186. /package/{lib → src/lib}/services/ramp-api.service.d.ts +0 -0
  187. /package/{lib → src/lib}/services/rebate-program-api.service.d.ts +0 -0
  188. /package/{lib → src/lib}/services/rebate-type-api.service.d.ts +0 -0
  189. /package/{lib → src/lib}/services/salesforce-api.service.d.ts +0 -0
  190. /package/{lib → src/lib}/services/sandbox-manager-api.service.d.ts +0 -0
  191. /package/{lib → src/lib}/services/shopping-cart-settings-api.service.d.ts +0 -0
  192. /package/{lib → src/lib}/services/stateful-configuration-api.d.ts +0 -0
  193. /package/{lib → src/lib}/services/veloce-objects-api.service.d.ts +0 -0
  194. /package/{lib → src/lib}/types/attachment.types.d.ts +0 -0
  195. /package/{lib → src/lib}/types/auth.types.d.ts +0 -0
  196. /package/{lib → src/lib}/types/clone-request.types.d.ts +0 -0
  197. /package/{lib → src/lib}/types/delta-request.types.d.ts +0 -0
  198. /package/{lib → src/lib}/types/dto/configuration-settings-dto.types.d.ts +0 -0
  199. /package/{lib → src/lib}/types/dto/offers-dto.types.d.ts +0 -0
  200. /package/{lib → src/lib}/types/index.d.ts +0 -0
  201. /package/{lib → src/lib}/types/org-info.types.d.ts +0 -0
  202. /package/{lib → src/lib}/types/price.types.d.ts +0 -0
  203. /package/{lib → src/lib}/types/quote.types.d.ts +0 -0
  204. /package/{lib → src/lib}/types/ramp-request.types.d.ts +0 -0
  205. /package/{lib → src/lib}/types/search-request.types.d.ts +0 -0
  206. /package/{lib → src/lib}/types/stateful-configuration.types.d.ts +0 -0
  207. /package/{lib → src/lib}/utils/canvas.utils.d.ts +0 -0
  208. /package/{lib → v2}/services/configuration-processors-api.service.d.ts +0 -0
  209. /package/{lib → v2}/services/ui-templates-api.service.d.ts +0 -0
  210. /package/{lib → v2}/types/dto/ui-template-dto.types.d.ts +0 -0
  211. /package/{lib → v2}/utils/ui-template.utils.d.ts +0 -0
@@ -0,0 +1,1005 @@
1
+ import { HttpParams, HttpClientModule } from '@angular/common/http';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable, NgModule } from '@angular/core';
4
+ import * as i1 from '@veloceapps/core';
5
+ import { Expression, RuleGroupTypes, uiDefinitionFromDTO, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
6
+ import { of, map as map$1, noop, catchError as catchError$1, forkJoin, switchMap } from 'rxjs';
7
+ import { catchError, map } from 'rxjs/operators';
8
+ import { omit } from 'lodash';
9
+ import { __rest } from 'tslib';
10
+
11
+ class ConfigurationProcessorsApiService {
12
+ constructor(baseHttpService) {
13
+ this.baseHttpService = baseHttpService;
14
+ this.serviceUrl = '/v2/configuration/processors/owners';
15
+ this.fetchConfigurationProcessors$ = (ownerId) => {
16
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
17
+ };
18
+ this.createConfigurationProcessors$ = (configurationProcessor) => {
19
+ return this.baseHttpService.api({
20
+ method: 'post',
21
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}`,
22
+ body: configurationProcessor,
23
+ });
24
+ };
25
+ this.updateConfigurationProcessors$ = (configurationProcessor) => {
26
+ return this.baseHttpService.api({
27
+ method: 'put',
28
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
29
+ body: configurationProcessor,
30
+ });
31
+ };
32
+ this.deleteConfigurationProcessors$ = (configurationProcessor) => {
33
+ return this.baseHttpService.api({
34
+ method: 'delete',
35
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
36
+ });
37
+ };
38
+ }
39
+ }
40
+ ConfigurationProcessorsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
41
+ ConfigurationProcessorsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService });
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, decorators: [{
43
+ type: Injectable
44
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
45
+
46
+ class ContextDefinitionApiService {
47
+ constructor(baseHttpService) {
48
+ this.baseHttpService = baseHttpService;
49
+ this.serviceUrl = '/v2/context-definition';
50
+ }
51
+ fetchContextDefinitions$() {
52
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, skipErrorHandler: true }).pipe(catchError(() => {
53
+ return of([]);
54
+ }));
55
+ }
56
+ fetchContextMappings$(id) {
57
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}/mappings` });
58
+ }
59
+ fetchContextDefinitionStructure$(id) {
60
+ return this.baseHttpService
61
+ .api({
62
+ url: `${this.serviceUrl}/${id}/structure/details`,
63
+ skipErrorHandler: true,
64
+ })
65
+ .pipe(catchError(() => {
66
+ return of([]);
67
+ }), map(objects => {
68
+ return objects.map(object => {
69
+ var _a, _b;
70
+ const tag = (_b = (_a = object.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
71
+ const objectAttributes = object.attributes || [];
72
+ return {
73
+ id: object.id,
74
+ title: tag || object.title,
75
+ attributes: objectAttributes.map(attribute => {
76
+ var _a, _b;
77
+ const tag = (_b = (_a = attribute.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
78
+ return {
79
+ title: tag || attribute.title,
80
+ fieldType: attribute.fieldType,
81
+ dataType: attribute.dataType,
82
+ };
83
+ }),
84
+ };
85
+ });
86
+ }));
87
+ }
88
+ fetchRlmProcedures(contextDefinitionId) {
89
+ const params = {};
90
+ if (contextDefinitionId) {
91
+ params['contextDefinitionId'] = contextDefinitionId;
92
+ }
93
+ return this.baseHttpService.api({
94
+ url: `${this.serviceUrl}/procedures`,
95
+ params,
96
+ });
97
+ }
98
+ }
99
+ ContextDefinitionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
100
+ ContextDefinitionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionApiService });
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionApiService, decorators: [{
102
+ type: Injectable
103
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
104
+
105
+ class ProceduresAdminApiService {
106
+ constructor(baseHttpService) {
107
+ this.baseHttpService = baseHttpService;
108
+ this.SERVICE_URL = '/v2/admin/procedures';
109
+ this.fetchProcedures$ = () => {
110
+ return this.searchProcedures$(new Expression(), 0, 100);
111
+ };
112
+ this.searchProcedures$ = (expression, skip, count) => {
113
+ let params = new HttpParams();
114
+ params = params.set('skip', '' + skip);
115
+ params = params.set('count', '' + count);
116
+ return this.baseHttpService.api({
117
+ method: 'post',
118
+ url: `${this.SERVICE_URL}/search`,
119
+ params,
120
+ body: expression,
121
+ });
122
+ };
123
+ this.createProcedure$ = (newProcedure) => {
124
+ return this.baseHttpService.api({
125
+ url: `${this.SERVICE_URL}`,
126
+ method: 'post',
127
+ body: newProcedure,
128
+ });
129
+ };
130
+ this.updateProcedure$ = (procedure) => {
131
+ return this.baseHttpService.api({
132
+ url: `${this.SERVICE_URL}/${procedure.id}`,
133
+ method: 'put',
134
+ body: procedure,
135
+ });
136
+ };
137
+ this.duplicateProcedure$ = (body) => {
138
+ return this.baseHttpService
139
+ .api({
140
+ url: `${this.SERVICE_URL}/${body.id}/clone`,
141
+ method: 'post',
142
+ body,
143
+ })
144
+ .pipe(map$1(response => response.clonedRecordId));
145
+ };
146
+ this.removeProcedure$ = (id) => {
147
+ return this.baseHttpService.api({
148
+ url: `${this.SERVICE_URL}/${id}`,
149
+ method: 'delete',
150
+ });
151
+ };
152
+ this.restoreProcedure$ = (id) => {
153
+ return this.baseHttpService.api({
154
+ url: `${this.SERVICE_URL}/${id}/restore`,
155
+ method: 'patch',
156
+ });
157
+ };
158
+ }
159
+ fetchProcedure$(id) {
160
+ return this.baseHttpService.api({
161
+ url: `${this.SERVICE_URL}/${id}`,
162
+ method: 'get',
163
+ });
164
+ }
165
+ /**
166
+ * @deprecated
167
+ */
168
+ fetchDefaultPricingSteps$() {
169
+ return this.baseHttpService.api({
170
+ url: `/admin/procedures/pricing-steps`,
171
+ method: 'get',
172
+ });
173
+ }
174
+ }
175
+ ProceduresAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
176
+ ProceduresAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresAdminApiService });
177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresAdminApiService, decorators: [{
178
+ type: Injectable
179
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
180
+
181
+ class ProceduresApiService {
182
+ constructor(baseHttpService) {
183
+ this.baseHttpService = baseHttpService;
184
+ this.SERVICE_URL = '/v2/procedures';
185
+ }
186
+ apply$(request, options) {
187
+ return this.baseHttpService.api(Object.assign({ url: `${this.SERVICE_URL}/apply`, method: 'post', body: request }, options));
188
+ }
189
+ execute$(body) {
190
+ return this.baseHttpService.api({
191
+ url: `${this.SERVICE_URL}/execute`,
192
+ method: 'post',
193
+ body,
194
+ });
195
+ }
196
+ catalogExecute$(body) {
197
+ return this.baseHttpService.api({
198
+ url: `${this.SERVICE_URL}/catalog/execute`,
199
+ method: 'post',
200
+ body,
201
+ });
202
+ }
203
+ rlmExecute$(body) {
204
+ return this.baseHttpService.api({
205
+ url: `${this.SERVICE_URL}/rlm/execute`,
206
+ method: 'post',
207
+ body,
208
+ });
209
+ }
210
+ }
211
+ ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
212
+ ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService });
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, decorators: [{
214
+ type: Injectable
215
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
216
+
217
+ class RuleGroupsAdminApiService {
218
+ constructor(baseHttpService) {
219
+ this.baseHttpService = baseHttpService;
220
+ this.serviceUrl = '/v2/admin/rule-groups';
221
+ this.fetchRuleGroups$ = () => {
222
+ return this.searchRuleGroups$(new Expression(), 0, 100);
223
+ };
224
+ this.searchRuleGroups$ = (expression, skip, count) => {
225
+ let params = new HttpParams();
226
+ params = params.set('skip', '' + skip);
227
+ params = params.set('count', '' + count);
228
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
229
+ };
230
+ this.createRuleGroup$ = (ruleGroup) => {
231
+ return this.baseHttpService.api({
232
+ url: `${this.serviceUrl}`,
233
+ method: 'post',
234
+ body: ruleGroup,
235
+ });
236
+ };
237
+ this.updateRuleGroup$ = (ruleGroup) => {
238
+ return this.baseHttpService.api({
239
+ url: `${this.serviceUrl}/${ruleGroup.id}`,
240
+ method: 'post',
241
+ body: ruleGroup,
242
+ });
243
+ };
244
+ this.duplicateRuleGroup$ = (body) => {
245
+ return this.baseHttpService
246
+ .api({
247
+ url: `${this.serviceUrl}/${body.id}/clone`,
248
+ method: 'post',
249
+ body,
250
+ })
251
+ .pipe(map$1(response => response.clonedRecordId));
252
+ };
253
+ this.removeRuleGroup$ = (id) => {
254
+ return this.baseHttpService.api({
255
+ url: `${this.serviceUrl}/${id}`,
256
+ method: 'delete',
257
+ });
258
+ };
259
+ this.restoreRuleGroup$ = (id) => {
260
+ return this.baseHttpService.api({
261
+ url: `${this.serviceUrl}/${id}/restore`,
262
+ method: 'patch',
263
+ });
264
+ };
265
+ }
266
+ }
267
+ RuleGroupsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
268
+ RuleGroupsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsAdminApiService });
269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsAdminApiService, decorators: [{
270
+ type: Injectable
271
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
272
+
273
+ class RulesAdminApiService {
274
+ constructor(baseHttpService) {
275
+ this.baseHttpService = baseHttpService;
276
+ this.serviceUrl = '/v2/admin/rules';
277
+ this.fetchRules$ = () => {
278
+ return this.searchRules$(new Expression(), 0, 100);
279
+ };
280
+ this.searchRules$ = (expression, skip, count) => {
281
+ let params = new HttpParams();
282
+ if (typeof skip === 'number') {
283
+ params = params.set('skip', '' + skip);
284
+ }
285
+ if (typeof count === 'number') {
286
+ params = params.set('count', '' + count);
287
+ }
288
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
289
+ };
290
+ this.createRule$ = (rule) => {
291
+ return this.baseHttpService.api({
292
+ url: `${this.serviceUrl}`,
293
+ method: 'post',
294
+ body: rule,
295
+ });
296
+ };
297
+ this.updateRule$ = (rule) => {
298
+ return this.baseHttpService.api({
299
+ url: `${this.serviceUrl}/${rule.id}`,
300
+ method: 'put',
301
+ body: rule,
302
+ });
303
+ };
304
+ this.duplicateRule$ = (body) => {
305
+ return this.baseHttpService
306
+ .api({
307
+ url: `${this.serviceUrl}/${body.id}/clone`,
308
+ method: 'post',
309
+ body,
310
+ })
311
+ .pipe(map$1(response => response.clonedRecordId));
312
+ };
313
+ this.removeRule$ = (id) => {
314
+ return this.baseHttpService.api({
315
+ url: `${this.serviceUrl}/${id}`,
316
+ method: 'delete',
317
+ });
318
+ };
319
+ this.restoreRule$ = (id) => {
320
+ return this.baseHttpService.api({
321
+ url: `${this.serviceUrl}/${id}/restore`,
322
+ method: 'patch',
323
+ });
324
+ };
325
+ }
326
+ fetchRule$(id) {
327
+ return this.baseHttpService.api({
328
+ url: `${this.serviceUrl}/${id}`,
329
+ method: 'get',
330
+ });
331
+ }
332
+ fetchHeaderFields$() {
333
+ return this.baseHttpService.api({
334
+ url: `${this.serviceUrl}/describe/Header`,
335
+ method: 'get',
336
+ });
337
+ }
338
+ execute$(body) {
339
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
340
+ return this.baseHttpService.api({
341
+ url,
342
+ method: 'post',
343
+ body,
344
+ });
345
+ }
346
+ getExecuteRuleUrl(ruleGroupType) {
347
+ if (ruleGroupType === RuleGroupTypes.eligibility) {
348
+ return '/rules/eligibility/execute';
349
+ }
350
+ if (ruleGroupType === RuleGroupTypes.catalog) {
351
+ return '/rules/catalog/execute';
352
+ }
353
+ if (ruleGroupType === RuleGroupTypes.rlmContextBased) {
354
+ return '/rules/rlm/execute';
355
+ }
356
+ return '/rules/execute';
357
+ }
358
+ }
359
+ RulesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
360
+ RulesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesAdminApiService });
361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesAdminApiService, decorators: [{
362
+ type: Injectable
363
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
364
+
365
+ class RulesApiService {
366
+ constructor(baseHttpService) {
367
+ this.baseHttpService = baseHttpService;
368
+ this.serviceUrl = '/v2/rules';
369
+ }
370
+ execute$(body) {
371
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
372
+ return this.baseHttpService.api({
373
+ url,
374
+ method: 'post',
375
+ body,
376
+ });
377
+ }
378
+ getExecuteRuleUrl(ruleGroupType) {
379
+ if (ruleGroupType === RuleGroupTypes.eligibility) {
380
+ return `${this.serviceUrl}/eligibility/execute`;
381
+ }
382
+ if (ruleGroupType === RuleGroupTypes.catalog) {
383
+ return `${this.serviceUrl}/catalog/execute`;
384
+ }
385
+ if (ruleGroupType === RuleGroupTypes.rlmContextBased) {
386
+ return `${this.serviceUrl}/rlm/execute`;
387
+ }
388
+ return `${this.serviceUrl}/execute`;
389
+ }
390
+ }
391
+ RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
392
+ RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService });
393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, decorators: [{
394
+ type: Injectable
395
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
396
+
397
+ class SalesTransactionApiService {
398
+ constructor(httpService) {
399
+ this.httpService = httpService;
400
+ this.SERVICE_URL = '/v2/transactions';
401
+ }
402
+ /**
403
+ * This endpoint doesn't include orders and assets
404
+ * @param objectId SF record ID (quoteId | accountId | opportunityId | orderId etc)
405
+ * @param params Query params
406
+ * @param options Request options
407
+ */
408
+ getState(objectId, params, options) {
409
+ // return of({
410
+ // id: 'ID',
411
+ // salesTransactionName: 'Sales Transaction Name',
412
+ // account: 'Acc ID',
413
+ // quoteAccount: 'Acc ID',
414
+ // pricebook: 'Pricebook ID',
415
+ // status: 'Draft',
416
+ // totalAmount: 0,
417
+ // subtotal: 0,
418
+ // activatedDate: '2025-01-25',
419
+ // effectiveDate: '2025-01-25',
420
+ // startDate: '2025-01-25',
421
+ // tags: {},
422
+ // salesTransactionItems: [],
423
+ // assets: [],
424
+ // } satisfies SalesTransaction);
425
+ return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}/${objectId}`, params: params }, options));
426
+ }
427
+ upsert(request, options) {
428
+ return of({
429
+ id: 'ID',
430
+ });
431
+ // return this.httpService.api({
432
+ // method: 'post',
433
+ // url: `${this.SERVICE_URL}`,
434
+ // body: request,
435
+ // ...options,
436
+ // });
437
+ }
438
+ submit(request, options) {
439
+ return of({
440
+ id: 'ID',
441
+ });
442
+ // return this.httpService.api({
443
+ // method: 'post',
444
+ // url: `${this.SERVICE_URL}`,
445
+ // body: request,
446
+ // ...options,
447
+ // });
448
+ }
449
+ }
450
+ SalesTransactionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
451
+ SalesTransactionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService });
452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, decorators: [{
453
+ type: Injectable
454
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
455
+
456
+ class ScriptsAdminApiService {
457
+ constructor(baseHttpService) {
458
+ this.baseHttpService = baseHttpService;
459
+ this.serviceUrl = '/v2/admin/scripts';
460
+ this.fetchScripts$ = () => {
461
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
462
+ };
463
+ this.searchScripts$ = (expression, skip, count) => {
464
+ let params = new HttpParams();
465
+ if (typeof skip === 'number') {
466
+ params = params.set('skip', '' + skip);
467
+ }
468
+ if (typeof count === 'number') {
469
+ params = params.set('count', '' + count);
470
+ }
471
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
472
+ };
473
+ this.fetchScript$ = (id) => {
474
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
475
+ };
476
+ this.createScript$ = (script) => {
477
+ return this.baseHttpService.api({
478
+ url: `${this.serviceUrl}`,
479
+ method: 'post',
480
+ body: script,
481
+ });
482
+ };
483
+ this.updateScriptMeta$ = (script) => {
484
+ return this.baseHttpService.api({
485
+ url: `${this.serviceUrl}/${script.id}`,
486
+ method: 'put',
487
+ body: script,
488
+ });
489
+ };
490
+ this.updateScriptDetails$ = (script) => {
491
+ return this.baseHttpService.api({
492
+ url: `${this.serviceUrl}/${script.id}`,
493
+ method: 'put',
494
+ body: script,
495
+ });
496
+ };
497
+ this.cloneScript$ = (cloneRequest) => {
498
+ return this.baseHttpService
499
+ .api({
500
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
501
+ method: 'post',
502
+ body: cloneRequest,
503
+ })
504
+ .pipe(map(response => response.clonedRecordId));
505
+ };
506
+ this.removeScript$ = (id) => {
507
+ return this.baseHttpService.api({
508
+ url: `${this.serviceUrl}/${id}`,
509
+ method: 'delete',
510
+ });
511
+ };
512
+ this.restoreScript$ = (id) => {
513
+ return this.baseHttpService.api({
514
+ url: `${this.serviceUrl}/${id}/restore`,
515
+ method: 'patch',
516
+ });
517
+ };
518
+ }
519
+ }
520
+ ScriptsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
521
+ ScriptsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService });
522
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, decorators: [{
523
+ type: Injectable
524
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
525
+
526
+ class ScriptsApiService {
527
+ constructor(baseHttpService) {
528
+ this.baseHttpService = baseHttpService;
529
+ this.serviceUrl = '/v2/scripts';
530
+ this.execute$ = (body) => {
531
+ return this.baseHttpService.api({
532
+ url: `${this.serviceUrl}/execute`,
533
+ method: 'post',
534
+ body,
535
+ errorHandler: () => null,
536
+ });
537
+ };
538
+ }
539
+ }
540
+ ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
541
+ ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService });
542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, decorators: [{
543
+ type: Injectable
544
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
545
+
546
+ class UIDefinitionsApiService {
547
+ constructor(baseHttpService) {
548
+ this.baseHttpService = baseHttpService;
549
+ this.serviceUrl = '/v2/uidefinitions';
550
+ }
551
+ fetch$(modelId, version) {
552
+ const serviceUrl = this.getServiceUrl(modelId);
553
+ let params = new HttpParams();
554
+ if (version != null) {
555
+ params = params.set('modelVersion', version);
556
+ }
557
+ return this.baseHttpService
558
+ .api({
559
+ method: 'get',
560
+ url: serviceUrl,
561
+ params: params,
562
+ })
563
+ .pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
564
+ }
565
+ create$(modelId, uiDefinitionContainer) {
566
+ var _a, _b;
567
+ const serviceUrl = this.getServiceUrl(modelId);
568
+ const dto = Object.assign(Object.assign({}, omit(uiDefinitionContainer, 'source')), { name: uiDefinitionContainer.source.name, modelId: uiDefinitionContainer.source.modelId, templateName: (_a = uiDefinitionContainer.source.uiTemplateData) === null || _a === void 0 ? void 0 : _a.TEMPLATE_NAME, rootType: (_b = uiDefinitionContainer.source.uiTemplateData) === null || _b === void 0 ? void 0 : _b.ROOT_TYPE, defaultFlag: uiDefinitionContainer.source.primary, sourceBlob: JSON.stringify(uiDefinitionContainer.source) });
569
+ return this.baseHttpService
570
+ .api({
571
+ method: 'post',
572
+ url: serviceUrl,
573
+ body: dto,
574
+ })
575
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
576
+ }
577
+ get$(modelId, uiDefinitionId) {
578
+ const serviceUrl = this.getServiceUrl(modelId);
579
+ return this.baseHttpService
580
+ .api({
581
+ method: 'get',
582
+ url: `${serviceUrl}/${uiDefinitionId}`,
583
+ })
584
+ .pipe(map$1(container => uiDefinitionFromDTO(Object.assign(Object.assign({}, container), { id: uiDefinitionId }))));
585
+ }
586
+ update$(uiDefinitionContainer) {
587
+ const serviceUrl = this.getServiceUrl(uiDefinitionContainer.modelId);
588
+ const dto = uiDefinitionToDTO(uiDefinitionContainer);
589
+ return this.baseHttpService
590
+ .api({
591
+ method: 'put',
592
+ url: `${serviceUrl}/${uiDefinitionContainer.id}`,
593
+ body: dto,
594
+ })
595
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
596
+ }
597
+ delete$(uiDefinitionContainer) {
598
+ const serviceUrl = this.getServiceUrl(uiDefinitionContainer.modelId);
599
+ return this.baseHttpService.api({
600
+ method: 'delete',
601
+ url: `${serviceUrl}/${uiDefinitionContainer.id}`,
602
+ });
603
+ }
604
+ getServiceUrl(modelId) {
605
+ return `/models/${modelId}/uidefinitions`;
606
+ }
607
+ fetchUIDefinitions$(params) {
608
+ let httpParams = new HttpParams();
609
+ if ((params === null || params === void 0 ? void 0 : params.productId) != null) {
610
+ httpParams = httpParams.set('productId', params.productId);
611
+ }
612
+ if ((params === null || params === void 0 ? void 0 : params.defaultUIDefinitionId) != null) {
613
+ httpParams = httpParams.set('defaultUIDefinitionId', params.defaultUIDefinitionId);
614
+ }
615
+ return this.baseHttpService
616
+ .api({
617
+ method: 'get',
618
+ url: this.serviceUrl,
619
+ params: httpParams,
620
+ })
621
+ .pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
622
+ }
623
+ fetchUIDefinition$(id) {
624
+ return this.baseHttpService
625
+ .api({
626
+ method: 'get',
627
+ url: `${this.serviceUrl}/${id}`,
628
+ })
629
+ .pipe(map$1(container => uiDefinitionFromDTO(Object.assign(Object.assign({}, container), { id }))), map$1(uiDefinition => {
630
+ const result = uiDefinition;
631
+ if (!uiDefinition.modelId && uiDefinition.source.modelId) {
632
+ result['modelId'] = uiDefinition.source.modelId;
633
+ }
634
+ return result;
635
+ }));
636
+ }
637
+ createUIDefinition$(body) {
638
+ return this.baseHttpService.api({
639
+ method: 'post',
640
+ url: this.serviceUrl,
641
+ body,
642
+ });
643
+ }
644
+ updateUIDefinition$(uiDefinition) {
645
+ return this.baseHttpService.api({
646
+ method: 'put',
647
+ url: `${this.serviceUrl}/${uiDefinition.id}`,
648
+ body: uiDefinition,
649
+ });
650
+ }
651
+ deleteUIDefinition$(id) {
652
+ return this.baseHttpService.api({
653
+ method: 'delete',
654
+ url: `${this.serviceUrl}/${id}`,
655
+ });
656
+ }
657
+ }
658
+ UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
659
+ UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService });
660
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
661
+ type: Injectable
662
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
663
+
664
+ const fromUIComponentStoryDTO = (dto, attachments) => {
665
+ return {
666
+ id: dto.id,
667
+ name: dto.name,
668
+ uiComponentId: dto.uiComponentId,
669
+ description: dto.description,
670
+ section: attachments.json,
671
+ template: attachments.html,
672
+ script: attachments.js,
673
+ styles: attachments.css,
674
+ };
675
+ };
676
+
677
+ class UITemplatesApiService {
678
+ constructor(baseHttpService) {
679
+ this.baseHttpService = baseHttpService;
680
+ this.serviceUrl = '/v2/uitemplates';
681
+ this.fetchTemplates$ = (name) => {
682
+ let params = new HttpParams();
683
+ if (name) {
684
+ params = params.append('name', name);
685
+ }
686
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
687
+ };
688
+ this.createTemplate$ = (template) => {
689
+ return this.baseHttpService.api({
690
+ method: 'post',
691
+ url: `${this.serviceUrl}`,
692
+ body: template,
693
+ });
694
+ };
695
+ this.updateTemplate$ = (template) => {
696
+ return this.baseHttpService.api({
697
+ method: 'put',
698
+ url: `${this.serviceUrl}/${template.id}`,
699
+ body: template,
700
+ });
701
+ };
702
+ this.duplicateTemplate$ = (template, cloneRequest) => {
703
+ return this.baseHttpService
704
+ .api({
705
+ url: `${this.serviceUrl}/${template.id}/clone`,
706
+ method: 'post',
707
+ body: cloneRequest,
708
+ })
709
+ .pipe(map$1(response => response.clonedRecordId));
710
+ };
711
+ this.removeTemplate$ = (id) => {
712
+ return this.baseHttpService.api({
713
+ method: 'delete',
714
+ url: `${this.serviceUrl}/${id}`,
715
+ });
716
+ };
717
+ this.restoreTemplate$ = (id) => {
718
+ return this.baseHttpService.api({
719
+ method: 'patch',
720
+ url: `${this.serviceUrl}/${id}`,
721
+ });
722
+ };
723
+ this.searchTemplates$ = (data) => {
724
+ return this.baseHttpService.api({
725
+ method: 'post',
726
+ url: `${this.serviceUrl}/search`,
727
+ params: data.params,
728
+ body: data.expression,
729
+ });
730
+ };
731
+ this.fetchComponents$ = (templateId, name) => {
732
+ let params = new HttpParams();
733
+ if (name) {
734
+ params = params.append('name', name);
735
+ }
736
+ return this.baseHttpService.api({
737
+ url: `${this.serviceUrl}/${templateId}/components`,
738
+ params,
739
+ });
740
+ };
741
+ this.fetchComponent$ = (templateId, componentId) => {
742
+ return this.baseHttpService.api({
743
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
744
+ });
745
+ };
746
+ this.createComponent$ = (component) => {
747
+ return this.baseHttpService.api({
748
+ method: 'post',
749
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
750
+ body: component,
751
+ });
752
+ };
753
+ this.updateComponent$ = (component) => {
754
+ return this.baseHttpService.api({
755
+ method: 'put',
756
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
757
+ body: component,
758
+ });
759
+ };
760
+ this.duplicateComponent$ = (component, cloneRequest) => {
761
+ return this.baseHttpService
762
+ .api({
763
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
764
+ method: 'post',
765
+ body: cloneRequest,
766
+ })
767
+ .pipe(map$1(response => response.clonedRecordId));
768
+ };
769
+ this.removeComponent$ = (templateId, componentId) => {
770
+ return this.baseHttpService.api({
771
+ method: 'delete',
772
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
773
+ });
774
+ };
775
+ this.restoreComponent$ = (templateId, componentId) => {
776
+ return this.baseHttpService.api({
777
+ method: 'patch',
778
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
779
+ });
780
+ };
781
+ this.searchComponents$ = (templateId, data) => {
782
+ return this.baseHttpService.api({
783
+ method: 'post',
784
+ url: `${this.serviceUrl}/${templateId}/components/search`,
785
+ params: data.params,
786
+ body: data.expression,
787
+ });
788
+ };
789
+ this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
790
+ return this.baseHttpService
791
+ .api({
792
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
793
+ responseType: 'text',
794
+ errorHandler: noop,
795
+ })
796
+ .pipe(catchError$1(() => of('')));
797
+ };
798
+ this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
799
+ return forkJoin([
800
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
801
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
802
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
803
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
804
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
805
+ };
806
+ this.fetchStories$ = (templateId, componentId, name) => {
807
+ let params = new HttpParams();
808
+ if (name) {
809
+ params = params.append('name', name);
810
+ }
811
+ return this.baseHttpService
812
+ .api({
813
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
814
+ params,
815
+ })
816
+ .pipe(switchMap(dtos => {
817
+ if (!dtos.length) {
818
+ return of([]);
819
+ }
820
+ return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
821
+ }));
822
+ };
823
+ this.fetchStory$ = (templateId, componentId, storyId) => {
824
+ return this.baseHttpService
825
+ .api({
826
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
827
+ })
828
+ .pipe(switchMap(dto => this.convertToComponentStory$(templateId, componentId, dto)));
829
+ };
830
+ this.createComponentStory$ = (templateId, story) => {
831
+ return this.baseHttpService.api({
832
+ method: 'post',
833
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
834
+ body: story,
835
+ });
836
+ };
837
+ this.updateComponentStory$ = (templateId, story) => {
838
+ const { script, template, styles, section } = story, rest = __rest(story, ["script", "template", "styles", "section"]);
839
+ return this.baseHttpService
840
+ .api({
841
+ method: 'put',
842
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
843
+ body: rest,
844
+ })
845
+ .pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
846
+ };
847
+ this.duplicateComponentStory$ = (story, cloneRequest) => {
848
+ return this.baseHttpService
849
+ .api({
850
+ url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
851
+ method: 'post',
852
+ body: cloneRequest,
853
+ })
854
+ .pipe(map$1(response => response.clonedRecordId));
855
+ };
856
+ this.deleteComponentStory$ = (templateId, componentId, storyId) => {
857
+ return this.baseHttpService.api({
858
+ method: 'delete',
859
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
860
+ });
861
+ };
862
+ this.restoreComponentStory$ = (templateId, componentId, storyId) => {
863
+ return this.baseHttpService.api({
864
+ method: 'patch',
865
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
866
+ });
867
+ };
868
+ this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
869
+ const formData = new FormData();
870
+ if (attachments.html != null) {
871
+ formData.append('html', new Blob([attachments.html]), 'story-template.html');
872
+ }
873
+ if (attachments.css != null) {
874
+ formData.append('css', new Blob([attachments.css]), 'story-styles.css');
875
+ }
876
+ if (attachments.js != null) {
877
+ formData.append('js', new Blob([attachments.js]), 'story-script.js');
878
+ }
879
+ if (attachments.json != null) {
880
+ formData.append('json', new Blob([attachments.json]), 'story-section.json');
881
+ }
882
+ return this.baseHttpService.upload({
883
+ method: 'post',
884
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
885
+ body: formData,
886
+ });
887
+ };
888
+ this.fetchComponentAttachments$ = (templateId, component) => {
889
+ return forkJoin([
890
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
891
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
892
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
893
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
894
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
895
+ };
896
+ this.fetchComponentsAttachments$ = (templateId) => {
897
+ return this.fetchComponents$(templateId).pipe(switchMap(components => {
898
+ return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
899
+ }));
900
+ };
901
+ this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
902
+ return this.baseHttpService
903
+ .api({
904
+ method: 'get',
905
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
906
+ responseType: 'text',
907
+ errorHandler: noop,
908
+ })
909
+ .pipe(catchError$1(() => of('')));
910
+ };
911
+ this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
912
+ const formData = new FormData();
913
+ if (attachments.html != null) {
914
+ formData.append('html', new Blob([attachments.html]), 'template.html');
915
+ }
916
+ if (attachments.css != null) {
917
+ formData.append('css', new Blob([attachments.css]), 'styles.css');
918
+ }
919
+ if (attachments.js != null) {
920
+ formData.append('js', new Blob([attachments.js]), 'script.js');
921
+ }
922
+ if (attachments.json != null) {
923
+ formData.append('json', new Blob([attachments.json]), 'section.json');
924
+ }
925
+ return this.baseHttpService.upload({
926
+ method: 'post',
927
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
928
+ body: formData,
929
+ });
930
+ };
931
+ }
932
+ getTemplateThumbnailUrl(templateId) {
933
+ return `${this.serviceUrl}/${templateId}/thumbnail/file`;
934
+ }
935
+ attachTemplateThumbnail$(templateId, file) {
936
+ const data = new FormData();
937
+ data.append('thumb', file);
938
+ return this.baseHttpService.upload({
939
+ method: 'post',
940
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
941
+ body: data,
942
+ });
943
+ }
944
+ removeTemplateThumbnail$(templateId) {
945
+ return this.baseHttpService.api({
946
+ method: 'delete',
947
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
948
+ });
949
+ }
950
+ }
951
+ UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
952
+ UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService });
953
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, decorators: [{
954
+ type: Injectable
955
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
956
+
957
+ class ApiV2Module {
958
+ }
959
+ ApiV2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
960
+ ApiV2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, imports: [HttpClientModule] });
961
+ ApiV2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, providers: [
962
+ BaseHttpService,
963
+ ConfigurationProcessorsApiService,
964
+ ContextDefinitionApiService,
965
+ ProceduresAdminApiService,
966
+ ProceduresApiService,
967
+ RuleGroupsAdminApiService,
968
+ RulesAdminApiService,
969
+ RulesApiService,
970
+ SalesTransactionApiService,
971
+ ScriptsAdminApiService,
972
+ ScriptsApiService,
973
+ UIDefinitionsApiService,
974
+ UITemplatesApiService,
975
+ XrayService,
976
+ ], imports: [HttpClientModule] });
977
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, decorators: [{
978
+ type: NgModule,
979
+ args: [{
980
+ imports: [HttpClientModule],
981
+ providers: [
982
+ BaseHttpService,
983
+ ConfigurationProcessorsApiService,
984
+ ContextDefinitionApiService,
985
+ ProceduresAdminApiService,
986
+ ProceduresApiService,
987
+ RuleGroupsAdminApiService,
988
+ RulesAdminApiService,
989
+ RulesApiService,
990
+ SalesTransactionApiService,
991
+ ScriptsAdminApiService,
992
+ ScriptsApiService,
993
+ UIDefinitionsApiService,
994
+ UITemplatesApiService,
995
+ XrayService,
996
+ ],
997
+ }]
998
+ }] });
999
+
1000
+ /**
1001
+ * Generated bundle index. Do not edit.
1002
+ */
1003
+
1004
+ export { ApiV2Module, ConfigurationProcessorsApiService, ContextDefinitionApiService, ProceduresAdminApiService, ProceduresApiService, RuleGroupsAdminApiService, RulesAdminApiService, RulesApiService, SalesTransactionApiService, ScriptsAdminApiService, ScriptsApiService, UIDefinitionsApiService, UITemplatesApiService };
1005
+ //# sourceMappingURL=veloceapps-api-v2.mjs.map