@veloceapps/api 11.0.0-3 → 11.0.0-30

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
@@ -0,0 +1,1403 @@
1
+ import { HttpErrorResponse, 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, parseJsonSafely, parseJsonStringAsObject, BaseHttpService, XrayService } from '@veloceapps/core';
6
+ import { of, map as map$1, tap, noop, catchError as catchError$1, forkJoin, switchMap } from 'rxjs';
7
+ import { map, catchError } from 'rxjs/operators';
8
+ import * as i2 from 'primeng/api';
9
+ import { __rest } from 'tslib';
10
+
11
+ class CacheApiService {
12
+ constructor(httpService) {
13
+ this.httpService = httpService;
14
+ this.SERVICE_URL = '/v2/cache/evict';
15
+ }
16
+ clear$(name, options) {
17
+ return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}/` + name }, options));
18
+ }
19
+ }
20
+ CacheApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CacheApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
21
+ CacheApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CacheApiService });
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CacheApiService, decorators: [{
23
+ type: Injectable
24
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
25
+
26
+ class ConfigurationProcessorsApiService {
27
+ constructor(baseHttpService) {
28
+ this.baseHttpService = baseHttpService;
29
+ this.serviceUrl = '/v2/configuration/processors/owners';
30
+ this.fetchConfigurationProcessors$ = (ownerId) => {
31
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
32
+ };
33
+ this.createConfigurationProcessors$ = (configurationProcessor) => {
34
+ return this.baseHttpService.api({
35
+ method: 'post',
36
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}`,
37
+ body: configurationProcessor,
38
+ });
39
+ };
40
+ this.updateConfigurationProcessors$ = (configurationProcessor) => {
41
+ return this.baseHttpService.api({
42
+ method: 'put',
43
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
44
+ body: configurationProcessor,
45
+ });
46
+ };
47
+ this.deleteConfigurationProcessors$ = (configurationProcessor) => {
48
+ return this.baseHttpService.api({
49
+ method: 'delete',
50
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
51
+ });
52
+ };
53
+ }
54
+ }
55
+ ConfigurationProcessorsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
56
+ ConfigurationProcessorsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService });
57
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, decorators: [{
58
+ type: Injectable
59
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
60
+
61
+ class ConfigurationSettingsDTO {
62
+ static fromDTO(dto, key) {
63
+ return {
64
+ id: dto === null || dto === void 0 ? void 0 : dto.id,
65
+ key: (dto === null || dto === void 0 ? void 0 : dto.key) || key || '',
66
+ value: dto === null || dto === void 0 ? void 0 : dto.value,
67
+ };
68
+ }
69
+ static toDTO(data) {
70
+ return {
71
+ id: data.id,
72
+ key: data.key,
73
+ value: data.value,
74
+ };
75
+ }
76
+ constructor(id, key, value) {
77
+ this.id = id;
78
+ this.key = key;
79
+ this.value = value;
80
+ }
81
+ }
82
+
83
+ class ConfigurationSettingsApiService {
84
+ constructor(httpService, messageService) {
85
+ this.httpService = httpService;
86
+ this.messageService = messageService;
87
+ this.SERVICE_URL = '/v2/settings';
88
+ }
89
+ fetchSettings(options) {
90
+ return this.httpService
91
+ .api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'get' }, options))
92
+ .pipe(map((settings) => settings.map(setting => ConfigurationSettingsDTO.fromDTO(setting))));
93
+ }
94
+ fetchSetting(settingsKey, options) {
95
+ return this.httpService
96
+ .api(Object.assign(Object.assign({ url: `${this.SERVICE_URL}/byKey/${settingsKey}`, method: 'get' }, options), { skipErrorHandler: true }))
97
+ .pipe(map((setting) => ConfigurationSettingsDTO.fromDTO(setting, settingsKey)), catchError(err => {
98
+ if (err instanceof HttpErrorResponse && err.status === 404) {
99
+ if (!(options === null || options === void 0 ? void 0 : options.skipErrorHandler)) {
100
+ this.messageService.add({
101
+ severity: 'error',
102
+ summary: `Configuration Setting "${settingsKey}" is not found`,
103
+ sticky: true,
104
+ });
105
+ }
106
+ return of(null);
107
+ }
108
+ throw err;
109
+ }));
110
+ }
111
+ createSetting(setting, options) {
112
+ const request = ConfigurationSettingsDTO.toDTO(setting);
113
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'post', body: Object.assign({}, request) }, options));
114
+ }
115
+ updateSetting(setting, options) {
116
+ const request = ConfigurationSettingsDTO.toDTO(setting);
117
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'put', body: Object.assign({}, request) }, options));
118
+ }
119
+ removeSetting(setting, options) {
120
+ const request = ConfigurationSettingsDTO.toDTO(setting);
121
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'delete' }, options));
122
+ }
123
+ restoreSetting(settingId, options) {
124
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${settingId}/restore`, method: 'patch' }, options));
125
+ }
126
+ }
127
+ ConfigurationSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, deps: [{ token: i1.BaseHttpService }, { token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
128
+ ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
130
+ type: Injectable
131
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i2.MessageService }]; } });
132
+
133
+ class ContextDefinitionAdminApiService {
134
+ constructor(baseHttpService) {
135
+ this.baseHttpService = baseHttpService;
136
+ this.serviceUrl = '/admin/v2/context-definition';
137
+ }
138
+ fetchContextDefinitions$() {
139
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, skipErrorHandler: true }).pipe(catchError(() => {
140
+ return of([]);
141
+ }));
142
+ }
143
+ fetchContextMappings$(id) {
144
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}/mappings` });
145
+ }
146
+ fetchContextDefinitionStructure$(id) {
147
+ return this.baseHttpService
148
+ .api({
149
+ url: `${this.serviceUrl}/${id}/structure/details`,
150
+ skipErrorHandler: true,
151
+ })
152
+ .pipe(catchError(() => {
153
+ return of([]);
154
+ }), map(objects => {
155
+ return objects.map(object => {
156
+ var _a, _b;
157
+ const tag = (_b = (_a = object.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
158
+ const objectAttributes = object.attributes || [];
159
+ return {
160
+ id: object.id,
161
+ title: tag || object.title,
162
+ attributes: objectAttributes.reduce((result, attribute) => {
163
+ var _a, _b;
164
+ const tag = (_b = (_a = attribute.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
165
+ if (tag) {
166
+ result.push({
167
+ title: tag,
168
+ fieldType: attribute.fieldType,
169
+ dataType: attribute.dataType,
170
+ });
171
+ }
172
+ return result;
173
+ }, []),
174
+ };
175
+ });
176
+ }));
177
+ }
178
+ fetchRlmProcedures(contextDefinitionId) {
179
+ const params = {};
180
+ if (contextDefinitionId) {
181
+ params['contextDefinitionId'] = contextDefinitionId;
182
+ }
183
+ return this.baseHttpService.api({
184
+ url: `${this.serviceUrl}/procedures`,
185
+ params,
186
+ });
187
+ }
188
+ }
189
+ ContextDefinitionAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
190
+ ContextDefinitionAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService });
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, decorators: [{
192
+ type: Injectable
193
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
194
+
195
+ class EndpointsAdminApiService {
196
+ constructor(baseHttpService) {
197
+ this.baseHttpService = baseHttpService;
198
+ this.serviceUrl = '/admin/v2/api-endpoints';
199
+ }
200
+ fetchEndpoints$() {
201
+ return this.searchEndpoints$(new Expression(), 0, -1);
202
+ }
203
+ searchEndpoints$(expression, skip, count) {
204
+ let params = new HttpParams();
205
+ params = params.set('skip', '' + skip);
206
+ params = params.set('count', '' + count);
207
+ return this.baseHttpService.api({
208
+ method: 'post',
209
+ url: `${this.serviceUrl}/search`,
210
+ params,
211
+ body: expression,
212
+ });
213
+ }
214
+ removeEndpoint$(id) {
215
+ return this.baseHttpService.api({
216
+ url: `${this.serviceUrl}/${id}`,
217
+ method: 'delete',
218
+ });
219
+ }
220
+ restoreEndpoint$(id) {
221
+ return this.baseHttpService.api({
222
+ url: `${this.serviceUrl}/${id}/restore`,
223
+ method: 'patch',
224
+ });
225
+ }
226
+ fetchEndpoint$(id) {
227
+ return this.baseHttpService.api({
228
+ url: `${this.serviceUrl}/${id}`,
229
+ method: 'get',
230
+ });
231
+ }
232
+ createEndpoint$(body) {
233
+ return this.baseHttpService.api({
234
+ url: `${this.serviceUrl}`,
235
+ method: 'post',
236
+ body,
237
+ });
238
+ }
239
+ updateEndpoint$(body) {
240
+ return this.baseHttpService.api({
241
+ url: `${this.serviceUrl}/${body.id}`,
242
+ method: 'put',
243
+ body,
244
+ });
245
+ }
246
+ duplicateEndpoint$(cloneRequest) {
247
+ return this.baseHttpService.api({
248
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
249
+ method: 'post',
250
+ body: cloneRequest,
251
+ });
252
+ }
253
+ executeEndpoint$(body) {
254
+ return this.baseHttpService.api({
255
+ url: `${this.serviceUrl}/execute`,
256
+ method: 'post',
257
+ body,
258
+ responseType: 'text',
259
+ skipErrorHandler: true,
260
+ });
261
+ }
262
+ }
263
+ EndpointsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
264
+ EndpointsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService });
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, decorators: [{
266
+ type: Injectable
267
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
268
+
269
+ class FlowsApiService {
270
+ constructor(configurationSettingsApiService) {
271
+ this.configurationSettingsApiService = configurationSettingsApiService;
272
+ this.flowsKey = 'flows';
273
+ }
274
+ getFlow(id) {
275
+ return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
276
+ if (!flow) {
277
+ throw new Error(`Flow with flowId=${id} is not defined`);
278
+ }
279
+ return flow;
280
+ }));
281
+ }
282
+ fetchFlows() {
283
+ return this.configurationSettingsApiService
284
+ .fetchSetting(this.flowsKey)
285
+ .pipe(map((setting) => ((setting === null || setting === void 0 ? void 0 : setting.value) ? JSON.parse(setting.value) : [])));
286
+ }
287
+ }
288
+ FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
289
+ FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
291
+ type: Injectable
292
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
293
+
294
+ class FunctionGroupsAdminApiService {
295
+ constructor(baseHttpService) {
296
+ this.baseHttpService = baseHttpService;
297
+ this.serviceUrl = '/admin/v2/functions/groups';
298
+ this.fetchAll$ = () => {
299
+ return this.search$(new Expression(), 0, 100);
300
+ };
301
+ this.search$ = (expression, skip, count) => {
302
+ let params = new HttpParams();
303
+ params = params.set('skip', '' + skip);
304
+ params = params.set('count', '' + count);
305
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
306
+ };
307
+ this.create$ = (ruleGroup) => {
308
+ return this.baseHttpService.api({
309
+ url: `${this.serviceUrl}`,
310
+ method: 'post',
311
+ body: ruleGroup,
312
+ });
313
+ };
314
+ this.update$ = (ruleGroup) => {
315
+ return this.baseHttpService.api({
316
+ url: `${this.serviceUrl}/${ruleGroup.id}`,
317
+ method: 'post',
318
+ body: ruleGroup,
319
+ });
320
+ };
321
+ this.duplicate$ = (body) => {
322
+ return this.baseHttpService
323
+ .api({
324
+ url: `${this.serviceUrl}/${body.id}/clone`,
325
+ method: 'post',
326
+ body,
327
+ })
328
+ .pipe(map$1(response => response.clonedRecordId));
329
+ };
330
+ this.remove$ = (id) => {
331
+ return this.baseHttpService.api({
332
+ url: `${this.serviceUrl}/${id}`,
333
+ method: 'delete',
334
+ });
335
+ };
336
+ this.restore$ = (id) => {
337
+ return this.baseHttpService.api({
338
+ url: `${this.serviceUrl}/${id}/restore`,
339
+ method: 'patch',
340
+ });
341
+ };
342
+ }
343
+ }
344
+ FunctionGroupsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
345
+ FunctionGroupsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService });
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, decorators: [{
347
+ type: Injectable
348
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
349
+
350
+ class FunctionsAdminApiService {
351
+ constructor(baseHttpService) {
352
+ this.baseHttpService = baseHttpService;
353
+ this.serviceUrl = '/admin/v2/functions/rules';
354
+ this.fetchAll$ = () => {
355
+ return this.search$(new Expression(), 0, 100);
356
+ };
357
+ this.search$ = (expression, skip, count) => {
358
+ let params = new HttpParams();
359
+ if (typeof skip === 'number') {
360
+ params = params.set('skip', '' + skip);
361
+ }
362
+ if (typeof count === 'number') {
363
+ params = params.set('count', '' + count);
364
+ }
365
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
366
+ };
367
+ this.create$ = (rule) => {
368
+ return this.baseHttpService.api({
369
+ url: `${this.serviceUrl}`,
370
+ method: 'post',
371
+ body: rule,
372
+ });
373
+ };
374
+ this.update$ = (rule) => {
375
+ return this.baseHttpService.api({
376
+ url: `${this.serviceUrl}/${rule.id}`,
377
+ method: 'put',
378
+ body: rule,
379
+ });
380
+ };
381
+ this.duplicate$ = (body) => {
382
+ return this.baseHttpService
383
+ .api({
384
+ url: `${this.serviceUrl}/${body.id}/clone`,
385
+ method: 'post',
386
+ body,
387
+ })
388
+ .pipe(map$1(response => response.clonedRecordId));
389
+ };
390
+ this.remove$ = (id) => {
391
+ return this.baseHttpService.api({
392
+ url: `${this.serviceUrl}/${id}`,
393
+ method: 'delete',
394
+ });
395
+ };
396
+ this.restore$ = (id) => {
397
+ return this.baseHttpService.api({
398
+ url: `${this.serviceUrl}/${id}/restore`,
399
+ method: 'patch',
400
+ });
401
+ };
402
+ }
403
+ fetch$(id) {
404
+ return this.baseHttpService.api({
405
+ url: `${this.serviceUrl}/${id}`,
406
+ method: 'get',
407
+ });
408
+ }
409
+ fetchHeaderFields$() {
410
+ return this.baseHttpService.api({
411
+ url: `${this.serviceUrl}/describe/Header`,
412
+ method: 'get',
413
+ });
414
+ }
415
+ execute$(body) {
416
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
417
+ return this.baseHttpService.api({
418
+ url,
419
+ method: 'post',
420
+ body,
421
+ });
422
+ }
423
+ getExecuteRuleUrl(ruleGroupType) {
424
+ switch (ruleGroupType) {
425
+ case RuleGroupTypes.eligibility:
426
+ return `${this.serviceUrl}/eligibility/execute`;
427
+ case RuleGroupTypes.rlmContextBased:
428
+ case RuleGroupTypes.generalContextBased:
429
+ return `${this.serviceUrl}/execute`;
430
+ default:
431
+ return `${this.serviceUrl}/legacy/execute`;
432
+ }
433
+ }
434
+ }
435
+ FunctionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
436
+ FunctionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService });
437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, decorators: [{
438
+ type: Injectable
439
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
440
+
441
+ class OrchestrationsAdminApiService {
442
+ constructor(baseHttpService) {
443
+ this.baseHttpService = baseHttpService;
444
+ this.SERVICE_URL = '/admin/v2/orchestrations';
445
+ this.fetchAll$ = () => {
446
+ return this.search$(new Expression(), 0, 100);
447
+ };
448
+ this.search$ = (expression, skip, count) => {
449
+ let params = new HttpParams();
450
+ params = params.set('skip', '' + skip);
451
+ params = params.set('count', '' + count);
452
+ return this.baseHttpService.api({
453
+ method: 'post',
454
+ url: `${this.SERVICE_URL}/search`,
455
+ params,
456
+ body: expression,
457
+ });
458
+ };
459
+ this.create$ = (newProcedure) => {
460
+ return this.baseHttpService.api({
461
+ url: `${this.SERVICE_URL}`,
462
+ method: 'post',
463
+ body: newProcedure,
464
+ });
465
+ };
466
+ this.update$ = (procedure) => {
467
+ return this.baseHttpService.api({
468
+ url: `${this.SERVICE_URL}/${procedure.id}`,
469
+ method: 'put',
470
+ body: procedure,
471
+ });
472
+ };
473
+ this.duplicate$ = (body) => {
474
+ return this.baseHttpService
475
+ .api({
476
+ url: `${this.SERVICE_URL}/${body.id}/clone`,
477
+ method: 'post',
478
+ body,
479
+ })
480
+ .pipe(map$1(response => response.clonedRecordId));
481
+ };
482
+ this.remove$ = (id) => {
483
+ return this.baseHttpService.api({
484
+ url: `${this.SERVICE_URL}/${id}`,
485
+ method: 'delete',
486
+ });
487
+ };
488
+ this.restore$ = (id) => {
489
+ return this.baseHttpService.api({
490
+ url: `${this.SERVICE_URL}/${id}/restore`,
491
+ method: 'patch',
492
+ });
493
+ };
494
+ }
495
+ fetch$(id) {
496
+ return this.baseHttpService.api({
497
+ url: `${this.SERVICE_URL}/${id}`,
498
+ method: 'get',
499
+ });
500
+ }
501
+ execute$(body) {
502
+ return this.baseHttpService.api({
503
+ url: `${this.SERVICE_URL}/execute`,
504
+ method: 'post',
505
+ body,
506
+ });
507
+ }
508
+ catalogExecute$(body) {
509
+ return this.baseHttpService.api({
510
+ url: `${this.SERVICE_URL}/catalog/execute`,
511
+ method: 'post',
512
+ body,
513
+ });
514
+ }
515
+ }
516
+ OrchestrationsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
517
+ OrchestrationsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService });
518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, decorators: [{
519
+ type: Injectable
520
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
521
+
522
+ class OrchestrationsApiService {
523
+ constructor(baseHttpService) {
524
+ this.baseHttpService = baseHttpService;
525
+ this.SERVICE_URL = '/v2/orchestrations';
526
+ }
527
+ apply$(request, options) {
528
+ return this.baseHttpService.api(Object.assign({ url: `${this.SERVICE_URL}/apply`, method: 'post', body: request }, options));
529
+ }
530
+ }
531
+ OrchestrationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
532
+ OrchestrationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService });
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, decorators: [{
534
+ type: Injectable
535
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
536
+
537
+ class SalesforceApiService {
538
+ constructor(httpService) {
539
+ this.httpService = httpService;
540
+ this.SERVICE_URL = '/v2/proxy';
541
+ }
542
+ query(searchRequest, objectName, options) {
543
+ return this.httpService.api(Object.assign({ method: 'post', body: Object.assign(Object.assign({}, searchRequest), { count: searchRequest.count || 100 }), url: `${this.SERVICE_URL}/query/${objectName}` }, options));
544
+ }
545
+ queryObjects(search, options) {
546
+ let params = new HttpParams();
547
+ if (search) {
548
+ params = params.append('search', search);
549
+ }
550
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/query`, params }, options));
551
+ }
552
+ search(req, options) {
553
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest/search`, params: { q: req.searchString } }, options));
554
+ }
555
+ describeObject(objectName, options) {
556
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
557
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
558
+ }
559
+ describeField(objectName, fieldName, options) {
560
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
561
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
562
+ }
563
+ describe2(objectName, fields, options) {
564
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
565
+ return this.httpService.api(Object.assign({ method: 'post', url: methodUrl, body: fields }, options));
566
+ }
567
+ apexGetRequest(path, params, options) {
568
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
569
+ const httpParams = new HttpParams({ fromString: params.toString() });
570
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams }, options));
571
+ }
572
+ apexPostRequest(path, body, options) {
573
+ return this.httpService.api(Object.assign({ method: 'post', body, url: `${this.SERVICE_URL}/apex${path}` }, options));
574
+ }
575
+ restGetRequest(path, params, options) {
576
+ const httpParams = new HttpParams({ fromString: params.toString() });
577
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest${path}`, params: httpParams }, options));
578
+ }
579
+ getGlobalPicklists() {
580
+ return this.httpService.api({
581
+ method: 'get',
582
+ url: `${this.SERVICE_URL}/globalvalueset`,
583
+ });
584
+ }
585
+ getGlobalPicklistValues(id) {
586
+ return this.httpService.api({
587
+ method: 'get',
588
+ url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
589
+ });
590
+ }
591
+ }
592
+ SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
593
+ SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
594
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
595
+ type: Injectable
596
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
597
+
598
+ class PCMApiService {
599
+ constructor(sfApiService) {
600
+ this.sfApiService = sfApiService;
601
+ }
602
+ fetchPCMByProductId(productId) {
603
+ return this.sfApiService.restGetRequest(`/connect/pcm/products/${productId}`, new HttpParams()).pipe(tap(response => {
604
+ if (response.status.code !== '200') {
605
+ throw new Error(response.status.message);
606
+ }
607
+ }), map$1(response => {
608
+ const pcm = response.products[0];
609
+ if (!pcm) {
610
+ throw new Error('PCM product is not found');
611
+ }
612
+ return pcm;
613
+ }));
614
+ }
615
+ }
616
+ PCMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, deps: [{ token: SalesforceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
617
+ PCMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService });
618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, decorators: [{
619
+ type: Injectable
620
+ }], ctorParameters: function () { return [{ type: SalesforceApiService }]; } });
621
+
622
+ class PicklistsAdminApiService {
623
+ constructor(baseHttpService) {
624
+ this.baseHttpService = baseHttpService;
625
+ this.serviceUrl = '/admin/v2/picklists';
626
+ this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}` });
627
+ this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/${code}` });
628
+ this.createPicklist$ = (picklist) => {
629
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}`, body: picklist });
630
+ };
631
+ this.updatePicklist$ = (picklist) => {
632
+ return this.baseHttpService.api({
633
+ method: 'put',
634
+ url: `${this.serviceUrl}/${picklist.id}`,
635
+ body: picklist,
636
+ });
637
+ };
638
+ this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/${id}` });
639
+ this.restorePicklist$ = (id) => {
640
+ return this.baseHttpService.api({
641
+ url: `${this.serviceUrl}/${id}/restore`,
642
+ method: 'patch',
643
+ });
644
+ };
645
+ this.addPicklistValue$ = (picklist, value) => {
646
+ const data = Object.assign(Object.assign({}, picklist), { values: [...picklist.values, value] });
647
+ return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/${picklist.id}`, body: data });
648
+ };
649
+ }
650
+ }
651
+ PicklistsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
652
+ PicklistsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService });
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, decorators: [{
654
+ type: Injectable
655
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
656
+
657
+ class ProductsAdminApiService {
658
+ constructor(baseHttpService) {
659
+ this.baseHttpService = baseHttpService;
660
+ this.serviceUrl = '/admin/v2/products';
661
+ this.fetchProducts$ = (payload) => {
662
+ let params = new HttpParams();
663
+ params = params.append('count', payload.count);
664
+ params = params.append('skip', payload.skip);
665
+ if (payload.name) {
666
+ params = params.append('name', payload.name);
667
+ }
668
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
669
+ };
670
+ this.searchProducts$ = (expression, skip, count) => {
671
+ let params = new HttpParams();
672
+ params = params.set('skip', '' + skip);
673
+ params = params.set('count', '' + count);
674
+ return this.baseHttpService.api({
675
+ method: 'post',
676
+ url: `${this.serviceUrl}/search`,
677
+ params: params,
678
+ body: expression,
679
+ });
680
+ };
681
+ this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
682
+ this.createNewProduct$ = (productData) => {
683
+ return this.baseHttpService.api({
684
+ url: `${this.serviceUrl}`,
685
+ method: 'post',
686
+ body: productData,
687
+ });
688
+ };
689
+ this.updateProduct$ = (body) => {
690
+ return this.baseHttpService.api({
691
+ url: `${this.serviceUrl}/${body.id}`,
692
+ method: 'put',
693
+ body,
694
+ });
695
+ };
696
+ this.removeProduct$ = (id) => {
697
+ return this.baseHttpService.api({
698
+ url: `${this.serviceUrl}/${id}`,
699
+ method: 'delete',
700
+ });
701
+ };
702
+ this.restoreProduct$ = (id) => {
703
+ return this.baseHttpService.api({
704
+ url: `${this.serviceUrl}/${id}/restore`,
705
+ method: 'patch',
706
+ });
707
+ };
708
+ }
709
+ attachImage$(productId, file) {
710
+ const data = new FormData();
711
+ data.append('image', file);
712
+ return this.baseHttpService.upload({
713
+ method: 'post',
714
+ url: `${this.serviceUrl}/${productId}/image`,
715
+ body: data,
716
+ });
717
+ }
718
+ removeImage$(productId) {
719
+ return this.baseHttpService.api({
720
+ method: 'delete',
721
+ url: `${this.serviceUrl}/${productId}/image`,
722
+ });
723
+ }
724
+ fetchImage$(productId) {
725
+ return this.baseHttpService.api({
726
+ url: this.getImageUrl(productId),
727
+ method: 'get',
728
+ responseType: 'blob',
729
+ errorHandler: noop,
730
+ });
731
+ }
732
+ getImageUrl(productId) {
733
+ return `${this.serviceUrl}/${productId}/image`;
734
+ }
735
+ }
736
+ ProductsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
737
+ ProductsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService });
738
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, decorators: [{
739
+ type: Injectable
740
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
741
+
742
+ class SalesTransactionApiService {
743
+ constructor(httpService) {
744
+ this.httpService = httpService;
745
+ this.SERVICE_URL = '/v2/transactions';
746
+ }
747
+ /**
748
+ * This endpoint doesn't include orders and assets
749
+ * @param objectId SF record ID (quoteId | accountId | opportunityId | orderId etc)
750
+ * @param params Query params
751
+ * @param options Request options
752
+ */
753
+ getState(objectId, params, options) {
754
+ return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}/${objectId}`, params: params }, options));
755
+ }
756
+ upsert(request, options) {
757
+ return of({
758
+ id: 'ID',
759
+ });
760
+ // return this.httpService.api({
761
+ // method: 'post',
762
+ // url: `${this.SERVICE_URL}`,
763
+ // body: request,
764
+ // ...options,
765
+ // });
766
+ }
767
+ submit(request, options) {
768
+ return of({
769
+ id: 'ID',
770
+ });
771
+ // return this.httpService.api({
772
+ // method: 'post',
773
+ // url: `${this.SERVICE_URL}`,
774
+ // body: request,
775
+ // ...options,
776
+ // });
777
+ }
778
+ }
779
+ SalesTransactionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
780
+ SalesTransactionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService });
781
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, decorators: [{
782
+ type: Injectable
783
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
784
+
785
+ class ScriptsAdminApiService {
786
+ constructor(baseHttpService) {
787
+ this.baseHttpService = baseHttpService;
788
+ this.serviceUrl = '/admin/v2/functions/scripts';
789
+ this.fetchScripts$ = () => {
790
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
791
+ };
792
+ this.searchScripts$ = (expression, skip, count) => {
793
+ let params = new HttpParams();
794
+ if (typeof skip === 'number') {
795
+ params = params.set('skip', '' + skip);
796
+ }
797
+ if (typeof count === 'number') {
798
+ params = params.set('count', '' + count);
799
+ }
800
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
801
+ };
802
+ this.fetchScript$ = (id) => {
803
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
804
+ };
805
+ this.createScript$ = (script) => {
806
+ return this.baseHttpService.api({
807
+ url: `${this.serviceUrl}`,
808
+ method: 'post',
809
+ body: script,
810
+ });
811
+ };
812
+ this.updateScriptMeta$ = (script) => {
813
+ return this.baseHttpService.api({
814
+ url: `${this.serviceUrl}/${script.id}`,
815
+ method: 'put',
816
+ body: script,
817
+ });
818
+ };
819
+ this.updateScriptDetails$ = (script) => {
820
+ return this.baseHttpService.api({
821
+ url: `${this.serviceUrl}/${script.id}`,
822
+ method: 'put',
823
+ body: script,
824
+ });
825
+ };
826
+ this.cloneScript$ = (cloneRequest) => {
827
+ return this.baseHttpService
828
+ .api({
829
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
830
+ method: 'post',
831
+ body: cloneRequest,
832
+ })
833
+ .pipe(map(response => response.clonedRecordId));
834
+ };
835
+ this.removeScript$ = (id) => {
836
+ return this.baseHttpService.api({
837
+ url: `${this.serviceUrl}/${id}`,
838
+ method: 'delete',
839
+ });
840
+ };
841
+ this.restoreScript$ = (id) => {
842
+ return this.baseHttpService.api({
843
+ url: `${this.serviceUrl}/${id}/restore`,
844
+ method: 'patch',
845
+ });
846
+ };
847
+ this.execute$ = (body) => {
848
+ return this.baseHttpService.api({
849
+ url: `${this.serviceUrl}/execute`,
850
+ method: 'post',
851
+ body,
852
+ errorHandler: () => null,
853
+ });
854
+ };
855
+ }
856
+ }
857
+ ScriptsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
858
+ ScriptsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService });
859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, decorators: [{
860
+ type: Injectable
861
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
862
+
863
+ class ShoppingCartSettingsApiService {
864
+ constructor(configurationSettingsApiService) {
865
+ this.configurationSettingsApiService = configurationSettingsApiService;
866
+ this.shoppingCartSettingsKey = 'shopping-cart';
867
+ }
868
+ getSetting(id) {
869
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map(settings => settings.find(setting => setting.id == id)));
870
+ }
871
+ fetchSettings() {
872
+ return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
873
+ }
874
+ getSettingsMap() {
875
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map((settings) => settings.reduce((acc, setting) => {
876
+ return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
877
+ }, {})));
878
+ }
879
+ }
880
+ ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
881
+ ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
882
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
883
+ type: Injectable
884
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
885
+
886
+ function uiDefinitionFromDTO(container) {
887
+ const { sourceBlob } = container, rest = __rest(container, ["sourceBlob"]);
888
+ return Object.assign(Object.assign({}, rest), { source: parseJsonStringAsObject(sourceBlob) });
889
+ }
890
+ function uiDefinitionToDTO(container) {
891
+ const { source } = container, rest = __rest(container, ["source"]);
892
+ return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
893
+ }
894
+ function newUiDefinitionToDTO(container) {
895
+ const { source } = container, rest = __rest(container, ["source"]);
896
+ return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
897
+ }
898
+
899
+ class UIDefinitionsAdminApiService {
900
+ constructor(baseHttpService) {
901
+ this.baseHttpService = baseHttpService;
902
+ this.serviceUrl = '/admin/v2/uidefinitions';
903
+ }
904
+ fetchAll$(params) {
905
+ let httpParams = new HttpParams();
906
+ if ((params === null || params === void 0 ? void 0 : params.productId) != null) {
907
+ httpParams = httpParams.set('productId', params.productId);
908
+ }
909
+ if ((params === null || params === void 0 ? void 0 : params.defaultUIDefinitionId) != null) {
910
+ httpParams = httpParams.set('defaultUIDefinitionId', params.defaultUIDefinitionId);
911
+ }
912
+ return this.baseHttpService
913
+ .api({
914
+ method: 'get',
915
+ url: this.serviceUrl,
916
+ params: httpParams,
917
+ })
918
+ .pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
919
+ }
920
+ fetch$(id) {
921
+ return this.baseHttpService
922
+ .api({
923
+ method: 'get',
924
+ url: `${this.serviceUrl}/${id}`,
925
+ })
926
+ .pipe(map$1(container => uiDefinitionFromDTO(Object.assign(Object.assign({}, container), { id }))));
927
+ }
928
+ create$(uiDefinitionContainer) {
929
+ const dto = newUiDefinitionToDTO(uiDefinitionContainer);
930
+ return this.baseHttpService
931
+ .api({
932
+ method: 'post',
933
+ url: this.serviceUrl,
934
+ body: dto,
935
+ })
936
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
937
+ }
938
+ update$(uiDefinitionContainer) {
939
+ const dto = uiDefinitionToDTO(uiDefinitionContainer);
940
+ return this.baseHttpService
941
+ .api({
942
+ method: 'put',
943
+ url: `${this.serviceUrl}/${uiDefinitionContainer.id}`,
944
+ body: dto,
945
+ })
946
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
947
+ }
948
+ delete$(id) {
949
+ return this.baseHttpService.api({
950
+ method: 'delete',
951
+ url: `${this.serviceUrl}/${id}`,
952
+ });
953
+ }
954
+ }
955
+ UIDefinitionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
956
+ UIDefinitionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService });
957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, decorators: [{
958
+ type: Injectable
959
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
960
+
961
+ const fromUIComponentStoryDTO = (dto, attachments) => {
962
+ return {
963
+ id: dto.id,
964
+ name: dto.name,
965
+ uiComponentId: dto.uiComponentId,
966
+ description: dto.description,
967
+ section: attachments.json,
968
+ template: attachments.html,
969
+ script: attachments.js,
970
+ styles: attachments.css,
971
+ };
972
+ };
973
+
974
+ class UITemplatesAdminApiService {
975
+ constructor(baseHttpService) {
976
+ this.baseHttpService = baseHttpService;
977
+ this.serviceUrl = '/admin/v2/uitemplates';
978
+ this.fetchTemplates$ = (name) => {
979
+ let params = new HttpParams();
980
+ if (name) {
981
+ params = params.append('name', name);
982
+ }
983
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
984
+ };
985
+ this.createTemplate$ = (template) => {
986
+ return this.baseHttpService.api({
987
+ method: 'post',
988
+ url: `${this.serviceUrl}`,
989
+ body: template,
990
+ });
991
+ };
992
+ this.updateTemplate$ = (template) => {
993
+ return this.baseHttpService.api({
994
+ method: 'put',
995
+ url: `${this.serviceUrl}/${template.id}`,
996
+ body: template,
997
+ });
998
+ };
999
+ this.duplicateTemplate$ = (template, cloneRequest) => {
1000
+ return this.baseHttpService
1001
+ .api({
1002
+ url: `${this.serviceUrl}/${template.id}/clone`,
1003
+ method: 'post',
1004
+ body: cloneRequest,
1005
+ })
1006
+ .pipe(map$1(response => response.clonedRecordId));
1007
+ };
1008
+ this.removeTemplate$ = (id) => {
1009
+ return this.baseHttpService.api({
1010
+ method: 'delete',
1011
+ url: `${this.serviceUrl}/${id}`,
1012
+ });
1013
+ };
1014
+ this.restoreTemplate$ = (id) => {
1015
+ return this.baseHttpService.api({
1016
+ method: 'patch',
1017
+ url: `${this.serviceUrl}/${id}`,
1018
+ });
1019
+ };
1020
+ this.searchTemplates$ = (data) => {
1021
+ return this.baseHttpService.api({
1022
+ method: 'post',
1023
+ url: `${this.serviceUrl}/search`,
1024
+ params: data.params,
1025
+ body: data.expression,
1026
+ });
1027
+ };
1028
+ this.fetchComponents$ = (templateId, name) => {
1029
+ let params = new HttpParams();
1030
+ if (name) {
1031
+ params = params.append('name', name);
1032
+ }
1033
+ return this.baseHttpService.api({
1034
+ url: `${this.serviceUrl}/${templateId}/components`,
1035
+ params,
1036
+ });
1037
+ };
1038
+ this.fetchComponent$ = (templateId, componentId) => {
1039
+ return this.baseHttpService.api({
1040
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1041
+ });
1042
+ };
1043
+ this.createComponent$ = (component) => {
1044
+ return this.baseHttpService.api({
1045
+ method: 'post',
1046
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
1047
+ body: component,
1048
+ });
1049
+ };
1050
+ this.updateComponent$ = (component) => {
1051
+ return this.baseHttpService.api({
1052
+ method: 'put',
1053
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
1054
+ body: component,
1055
+ });
1056
+ };
1057
+ this.duplicateComponent$ = (component, cloneRequest) => {
1058
+ return this.baseHttpService
1059
+ .api({
1060
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
1061
+ method: 'post',
1062
+ body: cloneRequest,
1063
+ })
1064
+ .pipe(map$1(response => response.clonedRecordId));
1065
+ };
1066
+ this.removeComponent$ = (templateId, componentId) => {
1067
+ return this.baseHttpService.api({
1068
+ method: 'delete',
1069
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1070
+ });
1071
+ };
1072
+ this.restoreComponent$ = (templateId, componentId) => {
1073
+ return this.baseHttpService.api({
1074
+ method: 'patch',
1075
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1076
+ });
1077
+ };
1078
+ this.searchComponents$ = (templateId, data) => {
1079
+ return this.baseHttpService.api({
1080
+ method: 'post',
1081
+ url: `${this.serviceUrl}/${templateId}/components/search`,
1082
+ params: data.params,
1083
+ body: data.expression,
1084
+ });
1085
+ };
1086
+ this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
1087
+ return this.baseHttpService
1088
+ .api({
1089
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
1090
+ responseType: 'text',
1091
+ errorHandler: noop,
1092
+ })
1093
+ .pipe(catchError$1(() => of('')));
1094
+ };
1095
+ this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
1096
+ return forkJoin([
1097
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
1098
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
1099
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
1100
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
1101
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
1102
+ };
1103
+ this.fetchStories$ = (templateId, componentId, name) => {
1104
+ let params = new HttpParams();
1105
+ if (name) {
1106
+ params = params.append('name', name);
1107
+ }
1108
+ return this.baseHttpService
1109
+ .api({
1110
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
1111
+ params,
1112
+ })
1113
+ .pipe(switchMap(dtos => {
1114
+ if (!dtos.length) {
1115
+ return of([]);
1116
+ }
1117
+ return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1118
+ }));
1119
+ };
1120
+ this.fetchStory$ = (templateId, componentId, storyId) => {
1121
+ return this.baseHttpService
1122
+ .api({
1123
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1124
+ })
1125
+ .pipe(switchMap(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1126
+ };
1127
+ this.createComponentStory$ = (templateId, story) => {
1128
+ return this.baseHttpService.api({
1129
+ method: 'post',
1130
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
1131
+ body: story,
1132
+ });
1133
+ };
1134
+ this.updateComponentStory$ = (templateId, story) => {
1135
+ const { script, template, styles, section } = story, rest = __rest(story, ["script", "template", "styles", "section"]);
1136
+ return this.baseHttpService
1137
+ .api({
1138
+ method: 'put',
1139
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
1140
+ body: rest,
1141
+ })
1142
+ .pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
1143
+ };
1144
+ this.duplicateComponentStory$ = (story, cloneRequest) => {
1145
+ return this.baseHttpService
1146
+ .api({
1147
+ url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
1148
+ method: 'post',
1149
+ body: cloneRequest,
1150
+ })
1151
+ .pipe(map$1(response => response.clonedRecordId));
1152
+ };
1153
+ this.deleteComponentStory$ = (templateId, componentId, storyId) => {
1154
+ return this.baseHttpService.api({
1155
+ method: 'delete',
1156
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1157
+ });
1158
+ };
1159
+ this.restoreComponentStory$ = (templateId, componentId, storyId) => {
1160
+ return this.baseHttpService.api({
1161
+ method: 'patch',
1162
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1163
+ });
1164
+ };
1165
+ this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
1166
+ const formData = new FormData();
1167
+ if (attachments.html != null) {
1168
+ formData.append('html', new Blob([attachments.html]), 'story-template.html');
1169
+ }
1170
+ if (attachments.css != null) {
1171
+ formData.append('css', new Blob([attachments.css]), 'story-styles.css');
1172
+ }
1173
+ if (attachments.js != null) {
1174
+ formData.append('js', new Blob([attachments.js]), 'story-script.js');
1175
+ }
1176
+ if (attachments.json != null) {
1177
+ formData.append('json', new Blob([attachments.json]), 'story-section.json');
1178
+ }
1179
+ return this.baseHttpService.upload({
1180
+ method: 'post',
1181
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
1182
+ body: formData,
1183
+ });
1184
+ };
1185
+ this.fetchComponentAttachments$ = (templateId, component) => {
1186
+ return forkJoin([
1187
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
1188
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
1189
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
1190
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
1191
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
1192
+ };
1193
+ this.fetchComponentsAttachments$ = (templateId) => {
1194
+ return this.fetchComponents$(templateId).pipe(switchMap(components => {
1195
+ return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
1196
+ }));
1197
+ };
1198
+ this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
1199
+ return this.baseHttpService
1200
+ .api({
1201
+ method: 'get',
1202
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
1203
+ responseType: 'text',
1204
+ errorHandler: noop,
1205
+ })
1206
+ .pipe(catchError$1(() => of('')));
1207
+ };
1208
+ this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
1209
+ const formData = new FormData();
1210
+ if (attachments.html != null) {
1211
+ formData.append('html', new Blob([attachments.html]), 'template.html');
1212
+ }
1213
+ if (attachments.css != null) {
1214
+ formData.append('css', new Blob([attachments.css]), 'styles.css');
1215
+ }
1216
+ if (attachments.js != null) {
1217
+ formData.append('js', new Blob([attachments.js]), 'script.js');
1218
+ }
1219
+ if (attachments.json != null) {
1220
+ formData.append('json', new Blob([attachments.json]), 'section.json');
1221
+ }
1222
+ return this.baseHttpService.upload({
1223
+ method: 'post',
1224
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
1225
+ body: formData,
1226
+ });
1227
+ };
1228
+ }
1229
+ getTemplateThumbnailUrl(templateId) {
1230
+ return `${this.serviceUrl}/${templateId}/thumbnail/file`;
1231
+ }
1232
+ attachTemplateThumbnail$(templateId, file) {
1233
+ const data = new FormData();
1234
+ data.append('thumb', file);
1235
+ return this.baseHttpService.upload({
1236
+ method: 'post',
1237
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
1238
+ body: data,
1239
+ });
1240
+ }
1241
+ removeTemplateThumbnail$(templateId) {
1242
+ return this.baseHttpService.api({
1243
+ method: 'delete',
1244
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
1245
+ });
1246
+ }
1247
+ }
1248
+ UITemplatesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1249
+ UITemplatesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService });
1250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, decorators: [{
1251
+ type: Injectable
1252
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1253
+
1254
+ class VeloceObjectsAdminApiService {
1255
+ constructor(baseHttpService) {
1256
+ this.baseHttpService = baseHttpService;
1257
+ this.serviceUrl = '/admin/v2/veloceobjects';
1258
+ this.updateCategory$ = (category) => {
1259
+ return this.baseHttpService.api({
1260
+ method: 'put',
1261
+ url: `${this.serviceUrl}/categories/${category.id}`,
1262
+ body: category,
1263
+ });
1264
+ };
1265
+ this.deleteCategory$ = (id) => {
1266
+ return this.baseHttpService.api({
1267
+ method: 'delete',
1268
+ url: `${this.serviceUrl}/categories/${id}`,
1269
+ });
1270
+ };
1271
+ this.searchObjects$ = (searchParams, expression) => {
1272
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
1273
+ return this.baseHttpService.api({
1274
+ method: 'post',
1275
+ url: `${this.serviceUrl}/search`,
1276
+ params,
1277
+ body: expression || {},
1278
+ });
1279
+ };
1280
+ this.deleteObject$ = (id) => {
1281
+ return this.baseHttpService.api({
1282
+ method: 'delete',
1283
+ url: `${this.serviceUrl}/${id}`,
1284
+ });
1285
+ };
1286
+ this.duplicateObject$ = (body) => {
1287
+ return this.baseHttpService
1288
+ .api({
1289
+ method: 'post',
1290
+ url: `${this.serviceUrl}/${body.id}/clone`,
1291
+ body,
1292
+ })
1293
+ .pipe(map(response => response.clonedRecordId));
1294
+ };
1295
+ this.restoreObject$ = (id) => {
1296
+ return this.baseHttpService.api({
1297
+ method: 'patch',
1298
+ url: `${this.serviceUrl}/${id}/restore`,
1299
+ });
1300
+ };
1301
+ }
1302
+ fetchCategories$() {
1303
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
1304
+ }
1305
+ createCategory$(category) {
1306
+ return this.baseHttpService.api({
1307
+ method: 'post',
1308
+ url: `${this.serviceUrl}/categories`,
1309
+ body: category,
1310
+ });
1311
+ }
1312
+ fetchObjects$() {
1313
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
1314
+ }
1315
+ fetchObject$(id) {
1316
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1317
+ }
1318
+ createObject$(object) {
1319
+ return this.baseHttpService.api({
1320
+ method: 'post',
1321
+ url: `${this.serviceUrl}`,
1322
+ body: object,
1323
+ });
1324
+ }
1325
+ updateObject$(object) {
1326
+ return this.baseHttpService.api({
1327
+ method: 'put',
1328
+ url: `${this.serviceUrl}/${object.id}`,
1329
+ body: object,
1330
+ });
1331
+ }
1332
+ }
1333
+ VeloceObjectsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1334
+ VeloceObjectsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService });
1335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, decorators: [{
1336
+ type: Injectable
1337
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1338
+
1339
+ class ApiV2Module {
1340
+ }
1341
+ ApiV2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1342
+ ApiV2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, imports: [HttpClientModule] });
1343
+ ApiV2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, providers: [
1344
+ BaseHttpService,
1345
+ CacheApiService,
1346
+ ConfigurationProcessorsApiService,
1347
+ ConfigurationSettingsApiService,
1348
+ ContextDefinitionAdminApiService,
1349
+ EndpointsAdminApiService,
1350
+ FlowsApiService,
1351
+ FunctionGroupsAdminApiService,
1352
+ OrchestrationsAdminApiService,
1353
+ OrchestrationsApiService,
1354
+ PCMApiService,
1355
+ PicklistsAdminApiService,
1356
+ ProductsAdminApiService,
1357
+ FunctionsAdminApiService,
1358
+ SalesforceApiService,
1359
+ SalesTransactionApiService,
1360
+ ShoppingCartSettingsApiService,
1361
+ ScriptsAdminApiService,
1362
+ UIDefinitionsAdminApiService,
1363
+ UITemplatesAdminApiService,
1364
+ VeloceObjectsAdminApiService,
1365
+ XrayService,
1366
+ ], imports: [HttpClientModule] });
1367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, decorators: [{
1368
+ type: NgModule,
1369
+ args: [{
1370
+ imports: [HttpClientModule],
1371
+ providers: [
1372
+ BaseHttpService,
1373
+ CacheApiService,
1374
+ ConfigurationProcessorsApiService,
1375
+ ConfigurationSettingsApiService,
1376
+ ContextDefinitionAdminApiService,
1377
+ EndpointsAdminApiService,
1378
+ FlowsApiService,
1379
+ FunctionGroupsAdminApiService,
1380
+ OrchestrationsAdminApiService,
1381
+ OrchestrationsApiService,
1382
+ PCMApiService,
1383
+ PicklistsAdminApiService,
1384
+ ProductsAdminApiService,
1385
+ FunctionsAdminApiService,
1386
+ SalesforceApiService,
1387
+ SalesTransactionApiService,
1388
+ ShoppingCartSettingsApiService,
1389
+ ScriptsAdminApiService,
1390
+ UIDefinitionsAdminApiService,
1391
+ UITemplatesAdminApiService,
1392
+ VeloceObjectsAdminApiService,
1393
+ XrayService,
1394
+ ],
1395
+ }]
1396
+ }] });
1397
+
1398
+ /**
1399
+ * Generated bundle index. Do not edit.
1400
+ */
1401
+
1402
+ export { ApiV2Module, CacheApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextDefinitionAdminApiService, EndpointsAdminApiService, FlowsApiService, FunctionGroupsAdminApiService, FunctionsAdminApiService, OrchestrationsAdminApiService, OrchestrationsApiService, PCMApiService, PicklistsAdminApiService, ProductsAdminApiService, SalesTransactionApiService, SalesforceApiService, ScriptsAdminApiService, ShoppingCartSettingsApiService, UIDefinitionsAdminApiService, UITemplatesAdminApiService, VeloceObjectsAdminApiService };
1403
+ //# sourceMappingURL=veloceapps-api-v2.mjs.map