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