@veloceapps/api 11.0.0-4 → 11.0.0-41

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 +16 -0
  3. package/esm2020/src/lib/api.module.mjs +60 -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/contracted-price-api.service.mjs +45 -0
  7. package/esm2020/src/lib/services/flow-state-api.mjs +142 -0
  8. package/esm2020/src/lib/services/offers-api.service.mjs +76 -0
  9. package/esm2020/src/lib/services/org-info-api.service.mjs +54 -0
  10. package/esm2020/src/lib/services/portals-api.service.mjs +76 -0
  11. package/esm2020/src/lib/services/promotions-api.service.mjs +68 -0
  12. package/esm2020/src/lib/services/rebate-program-api.service.mjs +68 -0
  13. package/esm2020/src/lib/services/rebate-type-api.service.mjs +68 -0
  14. package/esm2020/src/lib/services/sandbox-manager-api.service.mjs +94 -0
  15. package/esm2020/src/lib/services/stateful-configuration-api.mjs +51 -0
  16. package/esm2020/src/lib/types/auth.types.mjs +2 -0
  17. package/esm2020/src/lib/types/clone-request.types.mjs +2 -0
  18. package/esm2020/src/lib/types/delta-request.types.mjs +2 -0
  19. package/esm2020/src/lib/types/dto/offers-dto.types.mjs +2 -0
  20. package/esm2020/src/lib/types/index.mjs +6 -0
  21. package/esm2020/src/lib/types/org-info.types.mjs +2 -0
  22. package/esm2020/src/lib/types/search-request.types.mjs +2 -0
  23. package/esm2020/src/lib/types/stateful-configuration.types.mjs +2 -0
  24. package/esm2020/src/lib/utils/canvas.utils.mjs +33 -0
  25. package/esm2020/src/lib/utils/index.mjs +2 -0
  26. package/esm2020/v2/api-v2.module.mjs +74 -0
  27. package/esm2020/v2/index.mjs +4 -0
  28. package/esm2020/v2/services/cache-api.service.mjs +22 -0
  29. package/esm2020/v2/services/catalog-admin-api.service.mjs +192 -0
  30. package/esm2020/v2/services/catalog-api.service.mjs +90 -0
  31. package/esm2020/v2/services/configuration-processors-api.service.mjs +38 -0
  32. package/esm2020/v2/services/configuration-settings-api.service.mjs +89 -0
  33. package/esm2020/v2/services/context-definition-admin-api.service.mjs +67 -0
  34. package/esm2020/v2/services/document-attachment-api.service.mjs +66 -0
  35. package/esm2020/v2/services/endpoints-admin-api.service.mjs +79 -0
  36. package/esm2020/v2/services/flows-api.service.mjs +29 -0
  37. package/esm2020/v2/services/function-groups-admin-api.service.mjs +62 -0
  38. package/esm2020/v2/services/functions-admin-api.service.mjs +97 -0
  39. package/esm2020/v2/services/guided-sellings-admin-api.service.mjs +65 -0
  40. package/esm2020/v2/services/guided-sellings-api.service.mjs +37 -0
  41. package/esm2020/v2/services/index.mjs +26 -0
  42. package/esm2020/v2/services/orchestrations-admin-api.service.mjs +87 -0
  43. package/esm2020/v2/services/orchestrations-api.service.mjs +23 -0
  44. package/esm2020/v2/services/pcm-api.service.mjs +29 -0
  45. package/esm2020/v2/services/picklists-admin-api.service.mjs +41 -0
  46. package/esm2020/v2/services/products-admin-api.service.mjs +90 -0
  47. package/esm2020/v2/services/sales-transactions-api.service.mjs +52 -0
  48. package/esm2020/v2/services/salesforce-api.service.mjs +83 -0
  49. package/esm2020/v2/services/scripts-admin-api.service.mjs +83 -0
  50. package/esm2020/v2/services/shopping-cart-settings-api.service.mjs +28 -0
  51. package/esm2020/v2/services/ui-definitions-admin-api.service.mjs +68 -0
  52. package/esm2020/v2/services/ui-templates-admin-api.service.mjs +286 -0
  53. package/esm2020/v2/services/veloce-objects-api.service.mjs +90 -0
  54. package/esm2020/v2/types/attachment.types.mjs +2 -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 +6 -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 +1843 -0
  69. package/fesm2015/veloceapps-api-v2.mjs.map +1 -0
  70. package/fesm2015/veloceapps-api.mjs +497 -2781
  71. package/fesm2015/veloceapps-api.mjs.map +1 -1
  72. package/fesm2020/veloceapps-api-v2.mjs +1915 -0
  73. package/fesm2020/veloceapps-api-v2.mjs.map +1 -0
  74. package/fesm2020/veloceapps-api.mjs +512 -2894
  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 +15 -0
  79. package/{lib → src/lib}/api.module.d.ts +2 -1
  80. package/{lib → src/lib}/types/index.d.ts +0 -2
  81. package/{lib → src/lib}/types/stateful-configuration.types.d.ts +1 -2
  82. package/src/lib/utils/index.d.ts +1 -0
  83. package/v2/api-v2.module.d.ts +7 -0
  84. package/v2/index.d.ts +3 -0
  85. package/v2/services/cache-api.service.d.ts +11 -0
  86. package/{lib → v2}/services/catalog-api.service.d.ts +5 -5
  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 → v2}/services/document-attachment-api.service.d.ts +1 -1
  90. package/{lib/services/endpoints-api.service.d.ts → v2/services/endpoints-admin-api.service.d.ts} +3 -4
  91. package/v2/services/function-groups-admin-api.service.d.ts +18 -0
  92. package/v2/services/functions-admin-api.service.d.ts +22 -0
  93. package/v2/services/index.d.ts +25 -0
  94. package/v2/services/orchestrations-admin-api.service.d.ts +21 -0
  95. package/v2/services/orchestrations-api.service.d.ts +12 -0
  96. package/v2/services/pcm-api.service.d.ts +11 -0
  97. package/{lib/services/picklists-api.service.d.ts → v2/services/picklists-admin-api.service.d.ts} +3 -3
  98. package/v2/services/products-admin-api.service.d.ts +21 -0
  99. package/v2/services/sales-transactions-api.service.d.ts +20 -0
  100. package/{lib → v2}/services/salesforce-api.service.d.ts +1 -0
  101. package/{lib/services/scripts-api.service.d.ts → v2/services/scripts-admin-api.service.d.ts} +3 -3
  102. package/v2/services/ui-definitions-admin-api.service.d.ts +18 -0
  103. package/{lib/services/ui-templates-api.service.d.ts → v2/services/ui-templates-admin-api.service.d.ts} +3 -3
  104. package/{lib → v2}/services/veloce-objects-api.service.d.ts +3 -3
  105. package/v2/types/clone-request.types.d.ts +5 -0
  106. package/v2/types/dto/ui-definition-dto.types.d.ts +7 -0
  107. package/v2/types/index.d.ts +5 -0
  108. package/v2/types/pcm.types.d.ts +10 -0
  109. package/v2/types/procedure.types.d.ts +10 -0
  110. package/v2/types/sales-transaction.types.d.ts +14 -0
  111. package/v2/types/search-request.types.d.ts +8 -0
  112. package/v2/utils/ui-definition.utils.d.ts +5 -0
  113. package/esm2020/lib/api.module.mjs +0 -146
  114. package/esm2020/lib/services/account-api.service.mjs +0 -87
  115. package/esm2020/lib/services/auth.service.mjs +0 -22
  116. package/esm2020/lib/services/catalog-admin-api.service.mjs +0 -192
  117. package/esm2020/lib/services/catalog-api.service.mjs +0 -90
  118. package/esm2020/lib/services/configuration-api.service.mjs +0 -109
  119. package/esm2020/lib/services/configuration-processors-api.service.mjs +0 -38
  120. package/esm2020/lib/services/configuration-settings-api.service.mjs +0 -96
  121. package/esm2020/lib/services/context-api.service.mjs +0 -26
  122. package/esm2020/lib/services/contracted-price-api.service.mjs +0 -45
  123. package/esm2020/lib/services/delta-api.service.mjs +0 -23
  124. package/esm2020/lib/services/document-attachment-api.service.mjs +0 -66
  125. package/esm2020/lib/services/endpoints-api.service.mjs +0 -80
  126. package/esm2020/lib/services/flow-state-api.mjs +0 -142
  127. package/esm2020/lib/services/flows-api.service.mjs +0 -29
  128. package/esm2020/lib/services/guided-sellings-admin-api.service.mjs +0 -65
  129. package/esm2020/lib/services/guided-sellings-api.service.mjs +0 -37
  130. package/esm2020/lib/services/offers-api.service.mjs +0 -76
  131. package/esm2020/lib/services/org-info-api.service.mjs +0 -54
  132. package/esm2020/lib/services/picklists-api.service.mjs +0 -41
  133. package/esm2020/lib/services/portals-api.service.mjs +0 -76
  134. package/esm2020/lib/services/price-api.service.mjs +0 -63
  135. package/esm2020/lib/services/procedures-api.service.mjs +0 -113
  136. package/esm2020/lib/services/product-api.service.mjs +0 -153
  137. package/esm2020/lib/services/product-model-api.service.mjs +0 -223
  138. package/esm2020/lib/services/promotions-api.service.mjs +0 -68
  139. package/esm2020/lib/services/quote-api.service.mjs +0 -56
  140. package/esm2020/lib/services/ramp-api.service.mjs +0 -31
  141. package/esm2020/lib/services/rebate-program-api.service.mjs +0 -68
  142. package/esm2020/lib/services/rebate-type-api.service.mjs +0 -68
  143. package/esm2020/lib/services/rlm-api.service.mjs +0 -64
  144. package/esm2020/lib/services/rlm-quote-api.service.mjs +0 -27
  145. package/esm2020/lib/services/rule-groups-api.service.mjs +0 -62
  146. package/esm2020/lib/services/rules-api.service.mjs +0 -98
  147. package/esm2020/lib/services/salesforce-api.service.mjs +0 -79
  148. package/esm2020/lib/services/sandbox-manager-api.service.mjs +0 -94
  149. package/esm2020/lib/services/scripts-api.service.mjs +0 -83
  150. package/esm2020/lib/services/shopping-cart-settings-api.service.mjs +0 -28
  151. package/esm2020/lib/services/stateful-configuration-api.mjs +0 -51
  152. package/esm2020/lib/services/ui-definitions-api.service.mjs +0 -76
  153. package/esm2020/lib/services/ui-templates-api.service.mjs +0 -286
  154. package/esm2020/lib/services/veloce-objects-api.service.mjs +0 -90
  155. package/esm2020/lib/types/attachment.types.mjs +0 -2
  156. package/esm2020/lib/types/auth.types.mjs +0 -2
  157. package/esm2020/lib/types/clone-request.types.mjs +0 -2
  158. package/esm2020/lib/types/delta-request.types.mjs +0 -2
  159. package/esm2020/lib/types/dto/configuration-settings-dto.types.mjs +0 -22
  160. package/esm2020/lib/types/dto/offers-dto.types.mjs +0 -2
  161. package/esm2020/lib/types/dto/ui-template-dto.types.mjs +0 -2
  162. package/esm2020/lib/types/index.mjs +0 -8
  163. package/esm2020/lib/types/org-info.types.mjs +0 -2
  164. package/esm2020/lib/types/price.types.mjs +0 -2
  165. package/esm2020/lib/types/quote.types.mjs +0 -2
  166. package/esm2020/lib/types/ramp-request.types.mjs +0 -2
  167. package/esm2020/lib/types/search-request.types.mjs +0 -2
  168. package/esm2020/lib/types/stateful-configuration.types.mjs +0 -2
  169. package/esm2020/lib/utils/canvas.utils.mjs +0 -33
  170. package/esm2020/lib/utils/index.mjs +0 -3
  171. package/esm2020/lib/utils/ui-template.utils.mjs +0 -13
  172. package/lib/services/configuration-api.service.d.ts +0 -23
  173. package/lib/services/context-api.service.d.ts +0 -11
  174. package/lib/services/delta-api.service.d.ts +0 -12
  175. package/lib/services/price-api.service.d.ts +0 -16
  176. package/lib/services/procedures-api.service.d.ts +0 -30
  177. package/lib/services/product-api.service.d.ts +0 -31
  178. package/lib/services/product-model-api.service.d.ts +0 -29
  179. package/lib/services/quote-api.service.d.ts +0 -22
  180. package/lib/services/ramp-api.service.d.ts +0 -13
  181. package/lib/services/rlm-quote-api.service.d.ts +0 -11
  182. package/lib/services/rule-groups-api.service.d.ts +0 -18
  183. package/lib/services/rules-api.service.d.ts +0 -22
  184. package/lib/services/ui-definitions-api.service.d.ts +0 -15
  185. package/lib/types/price.types.d.ts +0 -5
  186. package/lib/types/quote.types.d.ts +0 -8
  187. package/lib/types/ramp-request.types.d.ts +0 -13
  188. package/lib/utils/index.d.ts +0 -2
  189. /package/{lib → src/lib}/services/account-api.service.d.ts +0 -0
  190. /package/{lib → src/lib}/services/auth.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/flow-state-api.d.ts +0 -0
  193. /package/{lib → src/lib}/services/offers-api.service.d.ts +0 -0
  194. /package/{lib → src/lib}/services/org-info-api.service.d.ts +0 -0
  195. /package/{lib → src/lib}/services/portals-api.service.d.ts +0 -0
  196. /package/{lib → src/lib}/services/promotions-api.service.d.ts +0 -0
  197. /package/{lib → src/lib}/services/rebate-program-api.service.d.ts +0 -0
  198. /package/{lib → src/lib}/services/rebate-type-api.service.d.ts +0 -0
  199. /package/{lib → src/lib}/services/sandbox-manager-api.service.d.ts +0 -0
  200. /package/{lib → src/lib}/services/stateful-configuration-api.d.ts +0 -0
  201. /package/{lib → src/lib}/types/auth.types.d.ts +0 -0
  202. /package/{lib → src/lib}/types/clone-request.types.d.ts +0 -0
  203. /package/{lib → src/lib}/types/delta-request.types.d.ts +0 -0
  204. /package/{lib → src/lib}/types/dto/offers-dto.types.d.ts +0 -0
  205. /package/{lib → src/lib}/types/org-info.types.d.ts +0 -0
  206. /package/{lib → src/lib}/types/search-request.types.d.ts +0 -0
  207. /package/{lib → src/lib}/utils/canvas.utils.d.ts +0 -0
  208. /package/{lib → v2}/services/catalog-admin-api.service.d.ts +0 -0
  209. /package/{lib → v2}/services/configuration-processors-api.service.d.ts +0 -0
  210. /package/{lib → v2}/services/flows-api.service.d.ts +0 -0
  211. /package/{lib → v2}/services/guided-sellings-admin-api.service.d.ts +0 -0
  212. /package/{lib → v2}/services/guided-sellings-api.service.d.ts +0 -0
  213. /package/{lib → v2}/services/shopping-cart-settings-api.service.d.ts +0 -0
  214. /package/{lib → v2}/types/attachment.types.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,1843 @@
1
+ import { HttpParams, HttpErrorResponse, 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, Operator, parseJsonSafely, parseJsonStringAsObject, BaseHttpService, XrayService } from '@veloceapps/core';
6
+ import { noop, of, map as map$1, tap as tap$1, catchError as catchError$1, forkJoin, switchMap } from 'rxjs';
7
+ import { map, catchError, tap } 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 CatalogAdminApiService {
27
+ constructor(baseHttpService) {
28
+ this.baseHttpService = baseHttpService;
29
+ this.serviceUrl = '/v2/catalogs';
30
+ this.fetchCatalogs$ = (searchParams) => {
31
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
32
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
33
+ };
34
+ this.searchCatalogs$ = (searchParams, expression) => {
35
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
36
+ return this.baseHttpService.api({
37
+ method: 'post',
38
+ url: `${this.serviceUrl}/search`,
39
+ params,
40
+ body: expression || {},
41
+ });
42
+ };
43
+ this.fetchCategories$ = (catalogId) => {
44
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories` });
45
+ };
46
+ this.searchProducts$ = (catalogId, categoryId) => {
47
+ return this.baseHttpService.api({
48
+ method: 'post',
49
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
50
+ body: {},
51
+ });
52
+ };
53
+ this.fetchAttributes$ = (catalogId, categoryId) => {
54
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes` });
55
+ };
56
+ this.createNewCatalog$ = (catalogData) => {
57
+ return this.baseHttpService.api({
58
+ url: `${this.serviceUrl}`,
59
+ method: 'post',
60
+ body: catalogData,
61
+ });
62
+ };
63
+ this.duplicateCatalog$ = (cloneRequest) => {
64
+ return this.baseHttpService.api({
65
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
66
+ method: 'post',
67
+ body: cloneRequest,
68
+ });
69
+ };
70
+ this.updateCatalog$ = (data) => {
71
+ return this.baseHttpService.api({
72
+ url: `${this.serviceUrl}/${data.id}`,
73
+ method: 'put',
74
+ body: data,
75
+ });
76
+ };
77
+ this.removeCatalog$ = (id) => {
78
+ return this.baseHttpService.api({
79
+ url: `${this.serviceUrl}/${id}`,
80
+ method: 'delete',
81
+ });
82
+ };
83
+ this.restoreCatalog$ = (id) => {
84
+ return this.baseHttpService.api({
85
+ url: `${this.serviceUrl}/${id}/restore`,
86
+ method: 'patch',
87
+ });
88
+ };
89
+ this.createNewCategory$ = (categoryData) => {
90
+ return this.baseHttpService.api({
91
+ url: `${this.serviceUrl}/${categoryData.catalogId}/categories`,
92
+ method: 'post',
93
+ body: categoryData,
94
+ });
95
+ };
96
+ this.updateCategory$ = (category) => {
97
+ return this.baseHttpService.api({
98
+ url: `${this.serviceUrl}/${category.catalogId}/categories/${category.id}`,
99
+ method: 'put',
100
+ body: category,
101
+ });
102
+ };
103
+ this.duplicateCategory$ = (catalogId, cloneRequest) => {
104
+ return this.baseHttpService.api({
105
+ url: `${this.serviceUrl}/${catalogId}/categories/${cloneRequest.id}/clone`,
106
+ method: 'post',
107
+ body: cloneRequest,
108
+ });
109
+ };
110
+ this.removeCategory$ = (id, catalogId) => {
111
+ return this.baseHttpService.api({
112
+ url: `${this.serviceUrl}/${catalogId}/categories/${id}`,
113
+ method: 'delete',
114
+ });
115
+ };
116
+ this.restoreCategory$ = (id, catalogId) => {
117
+ return this.baseHttpService.api({
118
+ url: `${this.serviceUrl}/${catalogId}/categories/${id}/restore`,
119
+ method: 'patch',
120
+ });
121
+ };
122
+ this.removeAttribute$ = ({ catalogId, categoryId, data, }) => {
123
+ return this.baseHttpService.api({
124
+ method: 'delete',
125
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
126
+ body: data,
127
+ });
128
+ };
129
+ this.restoreAttribute$ = ({ catalogId, categoryId, data, }) => {
130
+ return this.baseHttpService.api({
131
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}/restore`,
132
+ method: 'patch',
133
+ });
134
+ };
135
+ this.createNewAttribute$ = ({ catalogId, categoryId, data, }) => {
136
+ return this.baseHttpService.api({
137
+ method: 'post',
138
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes`,
139
+ body: data,
140
+ });
141
+ };
142
+ this.updateAttribute$ = ({ catalogId, categoryId, data, }) => {
143
+ return this.baseHttpService.api({
144
+ method: 'put',
145
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/attributes/${data.id}`,
146
+ body: data,
147
+ });
148
+ };
149
+ this.searchProductCandidates$ = (catalogId, categoryId, expression, searchParams) => {
150
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
151
+ return this.baseHttpService.api({
152
+ method: 'post',
153
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/candidates/search`,
154
+ params,
155
+ body: expression,
156
+ });
157
+ };
158
+ this.addProduct$ = (product, catalogId, categoryId) => {
159
+ return this.baseHttpService.api({
160
+ method: 'post',
161
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
162
+ body: product,
163
+ });
164
+ };
165
+ this.updateProduct$ = (product, catalogId, categoryId) => {
166
+ return this.baseHttpService.api({
167
+ method: 'put',
168
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/${product.id}`,
169
+ body: product,
170
+ });
171
+ };
172
+ this.removeProduct$ = ({ catalogId, categoryId, data, }) => {
173
+ return this.baseHttpService.api({
174
+ method: 'delete',
175
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/${data.id}`,
176
+ });
177
+ };
178
+ }
179
+ attachImage$(catalogId, categoryId, file) {
180
+ const data = new FormData();
181
+ data.append('image', file);
182
+ return this.baseHttpService.upload({
183
+ method: 'post',
184
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
185
+ body: data,
186
+ });
187
+ }
188
+ removeImage$(catalogId, categoryId) {
189
+ return this.baseHttpService.api({
190
+ method: 'delete',
191
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
192
+ });
193
+ }
194
+ fetchImage$(catalogId, categoryId) {
195
+ return this.baseHttpService.api({
196
+ url: this.getImageUrl(catalogId, categoryId),
197
+ method: 'get',
198
+ responseType: 'blob',
199
+ errorHandler: noop,
200
+ });
201
+ }
202
+ getImageUrl(catalogId, categoryId) {
203
+ return `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`;
204
+ }
205
+ }
206
+ CatalogAdminApiService.MAX_RESULTS = 60;
207
+ CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
208
+ CatalogAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService });
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, decorators: [{
210
+ type: Injectable
211
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
212
+
213
+ class CatalogApiService {
214
+ constructor(service) {
215
+ this.service = service;
216
+ this.serviceUrl = '/v2/product-catalogs';
217
+ }
218
+ fetchCatalogs$() {
219
+ return this.service.api({
220
+ method: 'get',
221
+ url: `${this.serviceUrl}`,
222
+ });
223
+ }
224
+ searchCatalogs$(searchParams, expression) {
225
+ const params = new HttpParams({ fromObject: searchParams });
226
+ return this.service.api({
227
+ method: 'post',
228
+ url: `${this.serviceUrl}/search`,
229
+ params,
230
+ body: expression,
231
+ });
232
+ }
233
+ getCatalog$(id) {
234
+ return this.service.api({
235
+ method: 'get',
236
+ url: `${this.serviceUrl}/${id}`,
237
+ });
238
+ }
239
+ fetchCategories$(catalogId) {
240
+ return this.service.api({
241
+ method: 'get',
242
+ url: `${this.serviceUrl}/${catalogId}/categories`,
243
+ });
244
+ }
245
+ fetchCatalogProducts$(catalogId, searchParams, context) {
246
+ const params = new HttpParams({ fromObject: searchParams });
247
+ return this.service.api({
248
+ method: 'post',
249
+ url: `${this.serviceUrl}/${catalogId}/products`,
250
+ params,
251
+ body: context,
252
+ });
253
+ }
254
+ fetchCategoryProducts$(catalogId, categoryId, searchParams, context) {
255
+ const params = new HttpParams({ fromObject: searchParams });
256
+ return this.service.api({
257
+ method: 'post',
258
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products`,
259
+ params,
260
+ body: context,
261
+ });
262
+ }
263
+ searchCategoryProducts$(catalogId, categoryId, searchParams, searchRequest, context) {
264
+ const params = new HttpParams({ fromObject: searchParams });
265
+ return this.service.api({
266
+ method: 'post',
267
+ url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/products/search`,
268
+ params,
269
+ body: {
270
+ configurationContext: context,
271
+ request: searchRequest,
272
+ },
273
+ });
274
+ }
275
+ fetchEligibleProducts$(searchParams, context) {
276
+ const params = new HttpParams({ fromObject: searchParams });
277
+ return this.service.api({
278
+ method: 'post',
279
+ url: `${this.serviceUrl}/products`,
280
+ params: params,
281
+ body: context,
282
+ });
283
+ }
284
+ fetchProducts$(searchParams) {
285
+ const params = new HttpParams({ fromObject: searchParams });
286
+ return this.service.api({
287
+ method: 'get',
288
+ url: `${this.serviceUrl}/products`,
289
+ params: params,
290
+ });
291
+ }
292
+ }
293
+ CatalogApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
294
+ CatalogApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService });
295
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, decorators: [{
296
+ type: Injectable
297
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
298
+
299
+ class ConfigurationProcessorsApiService {
300
+ constructor(baseHttpService) {
301
+ this.baseHttpService = baseHttpService;
302
+ this.serviceUrl = '/v2/configuration/processors/owners';
303
+ this.fetchConfigurationProcessors$ = (ownerId) => {
304
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
305
+ };
306
+ this.createConfigurationProcessors$ = (configurationProcessor) => {
307
+ return this.baseHttpService.api({
308
+ method: 'post',
309
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}`,
310
+ body: configurationProcessor,
311
+ });
312
+ };
313
+ this.updateConfigurationProcessors$ = (configurationProcessor) => {
314
+ return this.baseHttpService.api({
315
+ method: 'put',
316
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
317
+ body: configurationProcessor,
318
+ });
319
+ };
320
+ this.deleteConfigurationProcessors$ = (configurationProcessor) => {
321
+ return this.baseHttpService.api({
322
+ method: 'delete',
323
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
324
+ });
325
+ };
326
+ }
327
+ }
328
+ ConfigurationProcessorsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
329
+ ConfigurationProcessorsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService });
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, decorators: [{
331
+ type: Injectable
332
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
333
+
334
+ class ConfigurationSettingsDTO {
335
+ static fromDTO(dto, key) {
336
+ return {
337
+ id: dto === null || dto === void 0 ? void 0 : dto.id,
338
+ key: (dto === null || dto === void 0 ? void 0 : dto.key) || key || '',
339
+ value: dto === null || dto === void 0 ? void 0 : dto.value,
340
+ };
341
+ }
342
+ static toDTO(data) {
343
+ return {
344
+ id: data.id,
345
+ key: data.key,
346
+ value: data.value,
347
+ };
348
+ }
349
+ constructor(id, key, value) {
350
+ this.id = id;
351
+ this.key = key;
352
+ this.value = value;
353
+ }
354
+ }
355
+
356
+ class ConfigurationSettingsApiService {
357
+ constructor(httpService, messageService) {
358
+ this.httpService = httpService;
359
+ this.messageService = messageService;
360
+ this.SERVICE_URL = '/v2/settings';
361
+ }
362
+ fetchSettings(options) {
363
+ return this.httpService
364
+ .api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'get' }, options))
365
+ .pipe(map((settings) => settings.map(setting => ConfigurationSettingsDTO.fromDTO(setting))));
366
+ }
367
+ fetchSetting(settingsKey, options) {
368
+ return this.httpService
369
+ .api(Object.assign(Object.assign({ url: `${this.SERVICE_URL}/byKey/${settingsKey}`, method: 'get' }, options), { skipErrorHandler: true }))
370
+ .pipe(map((setting) => ConfigurationSettingsDTO.fromDTO(setting, settingsKey)), catchError(err => {
371
+ if (err instanceof HttpErrorResponse && err.status === 404) {
372
+ if (!(options === null || options === void 0 ? void 0 : options.skipErrorHandler)) {
373
+ this.messageService.add({
374
+ severity: 'error',
375
+ summary: `Configuration Setting "${settingsKey}" is not found`,
376
+ sticky: true,
377
+ });
378
+ }
379
+ return of(null);
380
+ }
381
+ throw err;
382
+ }));
383
+ }
384
+ createSetting(setting, options) {
385
+ const request = ConfigurationSettingsDTO.toDTO(setting);
386
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'post', body: Object.assign({}, request) }, options));
387
+ }
388
+ updateSetting(setting, options) {
389
+ const request = ConfigurationSettingsDTO.toDTO(setting);
390
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'put', body: Object.assign({}, request) }, options));
391
+ }
392
+ removeSetting(setting, options) {
393
+ const request = ConfigurationSettingsDTO.toDTO(setting);
394
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'delete' }, options));
395
+ }
396
+ restoreSetting(settingId, options) {
397
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${settingId}/restore`, method: 'patch' }, options));
398
+ }
399
+ }
400
+ 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 });
401
+ ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
403
+ type: Injectable
404
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i2.MessageService }]; } });
405
+
406
+ class ContextDefinitionAdminApiService {
407
+ constructor(baseHttpService) {
408
+ this.baseHttpService = baseHttpService;
409
+ this.serviceUrl = '/admin/v2/context-definition';
410
+ }
411
+ fetchContextDefinitions$() {
412
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, skipErrorHandler: true }).pipe(catchError(() => {
413
+ return of([]);
414
+ }));
415
+ }
416
+ fetchContextMappings$(id) {
417
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}/mappings` });
418
+ }
419
+ fetchContextDefinitionStructure$(id) {
420
+ return this.baseHttpService
421
+ .api({
422
+ url: `${this.serviceUrl}/${id}/structure/details`,
423
+ skipErrorHandler: true,
424
+ })
425
+ .pipe(catchError(() => {
426
+ return of([]);
427
+ }), map(objects => {
428
+ return objects.map(object => {
429
+ var _a, _b, _c;
430
+ const tag = (_b = (_a = object.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
431
+ const objectAttributes = object.attributes || [];
432
+ return {
433
+ id: object.id,
434
+ title: tag || object.title,
435
+ parentNodeId: object.parentNodeId,
436
+ nodeTags: ((_c = object.tags) !== null && _c !== void 0 ? _c : []).map(nodeTag => nodeTag.title),
437
+ attributes: objectAttributes.reduce((result, attribute) => {
438
+ var _a, _b;
439
+ const tag = (_b = (_a = attribute.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
440
+ if (tag) {
441
+ result.push({
442
+ title: tag,
443
+ fieldType: attribute.fieldType,
444
+ dataType: attribute.dataType,
445
+ });
446
+ }
447
+ return result;
448
+ }, []),
449
+ };
450
+ });
451
+ }));
452
+ }
453
+ fetchRlmProcedures(contextDefinitionId) {
454
+ const params = {};
455
+ if (contextDefinitionId) {
456
+ params['contextDefinitionId'] = contextDefinitionId;
457
+ }
458
+ return this.baseHttpService.api({
459
+ url: `${this.serviceUrl}/procedures`,
460
+ params,
461
+ });
462
+ }
463
+ }
464
+ ContextDefinitionAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
465
+ ContextDefinitionAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService });
466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, decorators: [{
467
+ type: Injectable
468
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
469
+
470
+ class DocumentAttachmentApiService {
471
+ constructor(httpService, fileDownloadService) {
472
+ this.httpService = httpService;
473
+ this.fileDownloadService = fileDownloadService;
474
+ this.SERVICE_URL = '/v2/attachments';
475
+ }
476
+ getAttachments(searchRequest) {
477
+ return this.httpService.api({
478
+ url: `${this.SERVICE_URL}/search`,
479
+ method: 'post',
480
+ body: searchRequest,
481
+ });
482
+ }
483
+ createAttachment(attachment, file, reportProgress) {
484
+ const formData = new FormData();
485
+ if (file) {
486
+ formData.append('file', file, file.name);
487
+ }
488
+ formData.append('attachment', new Blob([JSON.stringify(attachment)], {
489
+ type: 'application/json',
490
+ }));
491
+ return this.httpService.upload({
492
+ url: `${this.SERVICE_URL}`,
493
+ body: formData,
494
+ method: 'post',
495
+ observe: reportProgress ? 'events' : undefined,
496
+ reportProgress,
497
+ });
498
+ }
499
+ updateAttachment(id, attachment) {
500
+ return this.httpService.api({
501
+ url: `${this.SERVICE_URL}/${id}`,
502
+ body: attachment,
503
+ method: 'put',
504
+ });
505
+ }
506
+ getAttachmentFile(id, isPreventDownload) {
507
+ return this.httpService
508
+ .api({
509
+ url: `${this.SERVICE_URL}/${id}/file`,
510
+ responseType: isPreventDownload ? 'arraybuffer' : 'blob',
511
+ observe: isPreventDownload ? 'body' : 'response',
512
+ })
513
+ .pipe(tap(response => {
514
+ if (!isPreventDownload) {
515
+ this.fileDownloadService.processDownload(response);
516
+ }
517
+ }), map(response => (isPreventDownload ? new Blob([response.body || response]) : response.body || response)));
518
+ }
519
+ removeAttachment(id) {
520
+ return this.httpService.api({
521
+ url: `${this.SERVICE_URL}/${id}`,
522
+ method: 'delete',
523
+ });
524
+ }
525
+ }
526
+ DocumentAttachmentApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, deps: [{ token: i1.BaseHttpService }, { token: i1.FileDownloadService }], target: i0.ɵɵFactoryTarget.Injectable });
527
+ DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService });
528
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
529
+ type: Injectable
530
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
531
+
532
+ class EndpointsAdminApiService {
533
+ constructor(baseHttpService) {
534
+ this.baseHttpService = baseHttpService;
535
+ this.serviceUrl = '/admin/v2/api-endpoints';
536
+ }
537
+ fetchEndpoints$() {
538
+ return this.searchEndpoints$(new Expression(), 0, -1);
539
+ }
540
+ searchEndpoints$(expression, skip, count) {
541
+ let params = new HttpParams();
542
+ params = params.set('skip', '' + skip);
543
+ params = params.set('count', '' + count);
544
+ return this.baseHttpService.api({
545
+ method: 'post',
546
+ url: `${this.serviceUrl}/search`,
547
+ params,
548
+ body: expression,
549
+ });
550
+ }
551
+ removeEndpoint$(id) {
552
+ return this.baseHttpService.api({
553
+ url: `${this.serviceUrl}/${id}`,
554
+ method: 'delete',
555
+ });
556
+ }
557
+ restoreEndpoint$(id) {
558
+ return this.baseHttpService.api({
559
+ url: `${this.serviceUrl}/${id}/restore`,
560
+ method: 'patch',
561
+ });
562
+ }
563
+ fetchEndpoint$(id) {
564
+ return this.baseHttpService.api({
565
+ url: `${this.serviceUrl}/${id}`,
566
+ method: 'get',
567
+ });
568
+ }
569
+ createEndpoint$(body) {
570
+ return this.baseHttpService.api({
571
+ url: `${this.serviceUrl}`,
572
+ method: 'post',
573
+ body,
574
+ });
575
+ }
576
+ updateEndpoint$(body) {
577
+ return this.baseHttpService.api({
578
+ url: `${this.serviceUrl}/${body.id}`,
579
+ method: 'put',
580
+ body,
581
+ });
582
+ }
583
+ duplicateEndpoint$(cloneRequest) {
584
+ return this.baseHttpService.api({
585
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
586
+ method: 'post',
587
+ body: cloneRequest,
588
+ });
589
+ }
590
+ executeEndpoint$(body) {
591
+ return this.baseHttpService.api({
592
+ url: `${this.serviceUrl}/execute`,
593
+ method: 'post',
594
+ body,
595
+ responseType: 'text',
596
+ skipErrorHandler: true,
597
+ });
598
+ }
599
+ }
600
+ EndpointsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
601
+ EndpointsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService });
602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, decorators: [{
603
+ type: Injectable
604
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
605
+
606
+ class FlowsApiService {
607
+ constructor(configurationSettingsApiService) {
608
+ this.configurationSettingsApiService = configurationSettingsApiService;
609
+ this.flowsKey = 'flows';
610
+ }
611
+ getFlow(id) {
612
+ return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
613
+ if (!flow) {
614
+ throw new Error(`Flow with flowId=${id} is not defined`);
615
+ }
616
+ return flow;
617
+ }));
618
+ }
619
+ fetchFlows() {
620
+ return this.configurationSettingsApiService
621
+ .fetchSetting(this.flowsKey)
622
+ .pipe(map((setting) => ((setting === null || setting === void 0 ? void 0 : setting.value) ? JSON.parse(setting.value) : [])));
623
+ }
624
+ }
625
+ FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
626
+ FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
627
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
628
+ type: Injectable
629
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
630
+
631
+ class FunctionGroupsAdminApiService {
632
+ constructor(baseHttpService) {
633
+ this.baseHttpService = baseHttpService;
634
+ this.serviceUrl = '/admin/v2/functions/groups';
635
+ this.fetchAll$ = () => {
636
+ return this.search$(new Expression(), 0, 100);
637
+ };
638
+ this.search$ = (expression, skip, count) => {
639
+ let params = new HttpParams();
640
+ params = params.set('skip', '' + skip);
641
+ params = params.set('count', '' + count);
642
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
643
+ };
644
+ this.create$ = (ruleGroup) => {
645
+ return this.baseHttpService.api({
646
+ url: `${this.serviceUrl}`,
647
+ method: 'post',
648
+ body: ruleGroup,
649
+ });
650
+ };
651
+ this.update$ = (ruleGroup) => {
652
+ return this.baseHttpService.api({
653
+ url: `${this.serviceUrl}/${ruleGroup.id}`,
654
+ method: 'post',
655
+ body: ruleGroup,
656
+ });
657
+ };
658
+ this.duplicate$ = (body) => {
659
+ return this.baseHttpService
660
+ .api({
661
+ url: `${this.serviceUrl}/${body.id}/clone`,
662
+ method: 'post',
663
+ body,
664
+ })
665
+ .pipe(map$1(response => response.clonedRecordId));
666
+ };
667
+ this.remove$ = (id) => {
668
+ return this.baseHttpService.api({
669
+ url: `${this.serviceUrl}/${id}`,
670
+ method: 'delete',
671
+ });
672
+ };
673
+ this.restore$ = (id) => {
674
+ return this.baseHttpService.api({
675
+ url: `${this.serviceUrl}/${id}/restore`,
676
+ method: 'patch',
677
+ });
678
+ };
679
+ }
680
+ }
681
+ FunctionGroupsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
682
+ FunctionGroupsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService });
683
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, decorators: [{
684
+ type: Injectable
685
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
686
+
687
+ class FunctionsAdminApiService {
688
+ constructor(baseHttpService) {
689
+ this.baseHttpService = baseHttpService;
690
+ this.serviceUrl = '/admin/v2/functions/rules';
691
+ this.fetchAll$ = () => {
692
+ return this.search$(new Expression(), 0, 100);
693
+ };
694
+ this.search$ = (expression, skip, count) => {
695
+ let params = new HttpParams();
696
+ if (typeof skip === 'number') {
697
+ params = params.set('skip', '' + skip);
698
+ }
699
+ if (typeof count === 'number') {
700
+ params = params.set('count', '' + count);
701
+ }
702
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
703
+ };
704
+ this.create$ = (rule) => {
705
+ return this.baseHttpService.api({
706
+ url: `${this.serviceUrl}`,
707
+ method: 'post',
708
+ body: rule,
709
+ });
710
+ };
711
+ this.update$ = (rule) => {
712
+ return this.baseHttpService.api({
713
+ url: `${this.serviceUrl}/${rule.id}`,
714
+ method: 'put',
715
+ body: rule,
716
+ });
717
+ };
718
+ this.duplicate$ = (body) => {
719
+ return this.baseHttpService
720
+ .api({
721
+ url: `${this.serviceUrl}/${body.id}/clone`,
722
+ method: 'post',
723
+ body,
724
+ })
725
+ .pipe(map$1(response => response.clonedRecordId));
726
+ };
727
+ this.remove$ = (id) => {
728
+ return this.baseHttpService.api({
729
+ url: `${this.serviceUrl}/${id}`,
730
+ method: 'delete',
731
+ });
732
+ };
733
+ this.restore$ = (id) => {
734
+ return this.baseHttpService.api({
735
+ url: `${this.serviceUrl}/${id}/restore`,
736
+ method: 'patch',
737
+ });
738
+ };
739
+ }
740
+ fetch$(id) {
741
+ return this.baseHttpService.api({
742
+ url: `${this.serviceUrl}/${id}`,
743
+ method: 'get',
744
+ });
745
+ }
746
+ fetchHeaderFields$() {
747
+ return this.baseHttpService.api({
748
+ url: `${this.serviceUrl}/describe/Header`,
749
+ method: 'get',
750
+ });
751
+ }
752
+ execute$(body) {
753
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
754
+ return this.baseHttpService.api({
755
+ url,
756
+ method: 'post',
757
+ body,
758
+ });
759
+ }
760
+ getExecuteRuleUrl(ruleGroupType) {
761
+ switch (ruleGroupType) {
762
+ case RuleGroupTypes.eligibility:
763
+ return `${this.serviceUrl}/eligibility/execute`;
764
+ case RuleGroupTypes.rlmContextBased:
765
+ case RuleGroupTypes.generalContextBased:
766
+ return `${this.serviceUrl}/execute`;
767
+ default:
768
+ return `${this.serviceUrl}/legacy/execute`;
769
+ }
770
+ }
771
+ }
772
+ FunctionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
773
+ FunctionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService });
774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, decorators: [{
775
+ type: Injectable
776
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
777
+
778
+ class GuidedSellingsAdminApiService {
779
+ constructor(baseHttpService) {
780
+ this.baseHttpService = baseHttpService;
781
+ this.serviceUrl = '/admin/v2/guided-selling';
782
+ this.fetchGuidedSellings$ = (searchParams) => {
783
+ return this.searchGuidedSellings$(searchParams);
784
+ };
785
+ this.searchGuidedSellings$ = (searchParams, expression) => {
786
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
787
+ return this.baseHttpService.api({
788
+ method: 'post',
789
+ url: `${this.serviceUrl}/search`,
790
+ params,
791
+ body: expression || {},
792
+ });
793
+ };
794
+ this.fetchGuidedSelling$ = (id) => {
795
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
796
+ };
797
+ this.createNewGuidedSelling$ = (guidedSelling) => {
798
+ return this.baseHttpService.api({
799
+ url: `${this.serviceUrl}`,
800
+ method: 'post',
801
+ body: guidedSelling,
802
+ });
803
+ };
804
+ this.duplicateGuidedSelling$ = (cloneRequest) => {
805
+ return this.baseHttpService.api({
806
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
807
+ method: 'post',
808
+ body: cloneRequest,
809
+ });
810
+ };
811
+ this.updateGuidedSelling$ = (data) => {
812
+ return this.baseHttpService.api({
813
+ url: `${this.serviceUrl}/${data.id}`,
814
+ method: 'put',
815
+ body: data,
816
+ });
817
+ };
818
+ this.removeGuidedSelling$ = (id) => {
819
+ return this.baseHttpService.api({
820
+ url: `${this.serviceUrl}/${id}`,
821
+ method: 'delete',
822
+ });
823
+ };
824
+ this.restoreGuidedSelling$ = (id) => {
825
+ return this.baseHttpService.api({
826
+ url: `${this.serviceUrl}/${id}/restore`,
827
+ method: 'patch',
828
+ });
829
+ };
830
+ }
831
+ }
832
+ GuidedSellingsAdminApiService.MAX_RESULTS = 60;
833
+ GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
834
+ GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService });
835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
836
+ type: Injectable
837
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
838
+
839
+ class GuidedSellingApiService {
840
+ constructor(http) {
841
+ this.http = http;
842
+ this.serviceUrl = '/v2/guided-selling';
843
+ }
844
+ searchByName$(name, searchParams) {
845
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
846
+ const expression = new Expression(undefined, [{ key: 'name', operator: Operator.EQ, value: name }]);
847
+ return this.http.api({
848
+ method: 'post',
849
+ url: `${this.serviceUrl}/search`,
850
+ params,
851
+ body: expression || {},
852
+ });
853
+ }
854
+ searchById$(id, searchParams) {
855
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
856
+ const expression = new Expression(undefined, [{ key: 'id', operator: Operator.EQ, value: id }]);
857
+ return this.http.api({
858
+ method: 'post',
859
+ url: `${this.serviceUrl}/search`,
860
+ params,
861
+ body: expression || {},
862
+ });
863
+ }
864
+ }
865
+ GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
866
+ GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService });
867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, decorators: [{
868
+ type: Injectable
869
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
870
+
871
+ class OrchestrationsAdminApiService {
872
+ constructor(baseHttpService) {
873
+ this.baseHttpService = baseHttpService;
874
+ this.SERVICE_URL = '/admin/v2/orchestrations';
875
+ this.fetchAll$ = () => {
876
+ return this.search$(new Expression(), 0, 100);
877
+ };
878
+ this.search$ = (expression, skip, count) => {
879
+ let params = new HttpParams();
880
+ params = params.set('skip', '' + skip);
881
+ params = params.set('count', '' + count);
882
+ return this.baseHttpService.api({
883
+ method: 'post',
884
+ url: `${this.SERVICE_URL}/search`,
885
+ params,
886
+ body: expression,
887
+ });
888
+ };
889
+ this.create$ = (newProcedure) => {
890
+ return this.baseHttpService.api({
891
+ url: `${this.SERVICE_URL}`,
892
+ method: 'post',
893
+ body: newProcedure,
894
+ });
895
+ };
896
+ this.update$ = (procedure) => {
897
+ return this.baseHttpService.api({
898
+ url: `${this.SERVICE_URL}/${procedure.id}`,
899
+ method: 'put',
900
+ body: procedure,
901
+ });
902
+ };
903
+ this.duplicate$ = (body) => {
904
+ return this.baseHttpService
905
+ .api({
906
+ url: `${this.SERVICE_URL}/${body.id}/clone`,
907
+ method: 'post',
908
+ body,
909
+ })
910
+ .pipe(map$1(response => response.clonedRecordId));
911
+ };
912
+ this.remove$ = (id) => {
913
+ return this.baseHttpService.api({
914
+ url: `${this.SERVICE_URL}/${id}`,
915
+ method: 'delete',
916
+ });
917
+ };
918
+ this.restore$ = (id) => {
919
+ return this.baseHttpService.api({
920
+ url: `${this.SERVICE_URL}/${id}/restore`,
921
+ method: 'patch',
922
+ });
923
+ };
924
+ }
925
+ fetch$(id) {
926
+ return this.baseHttpService.api({
927
+ url: `${this.SERVICE_URL}/${id}`,
928
+ method: 'get',
929
+ });
930
+ }
931
+ execute$(body) {
932
+ return this.baseHttpService.api({
933
+ url: `${this.SERVICE_URL}/execute`,
934
+ method: 'post',
935
+ body,
936
+ });
937
+ }
938
+ catalogExecute$(body) {
939
+ return this.baseHttpService.api({
940
+ url: `${this.SERVICE_URL}/catalog/execute`,
941
+ method: 'post',
942
+ body,
943
+ });
944
+ }
945
+ }
946
+ OrchestrationsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
947
+ OrchestrationsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService });
948
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, decorators: [{
949
+ type: Injectable
950
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
951
+
952
+ class OrchestrationsApiService {
953
+ constructor(baseHttpService) {
954
+ this.baseHttpService = baseHttpService;
955
+ this.SERVICE_URL = '/v2/orchestrations';
956
+ }
957
+ apply$(request, options) {
958
+ return this.baseHttpService.api(Object.assign({ url: `${this.SERVICE_URL}/apply`, method: 'post', body: request }, options));
959
+ }
960
+ }
961
+ OrchestrationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
962
+ OrchestrationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService });
963
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, decorators: [{
964
+ type: Injectable
965
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
966
+
967
+ class SalesforceApiService {
968
+ constructor(httpService) {
969
+ this.httpService = httpService;
970
+ this.SERVICE_URL = '/v2/proxy';
971
+ }
972
+ query(searchRequest, objectName, options) {
973
+ 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));
974
+ }
975
+ queryObjects(search, options) {
976
+ let params = new HttpParams();
977
+ if (search) {
978
+ params = params.append('search', search);
979
+ }
980
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/query`, params }, options));
981
+ }
982
+ search(req, options) {
983
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest/search`, params: { q: req.searchString } }, options));
984
+ }
985
+ describeObject(objectName, options) {
986
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
987
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
988
+ }
989
+ describeField(objectName, fieldName, options) {
990
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
991
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
992
+ }
993
+ describe2(objectName, fields, options) {
994
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
995
+ return this.httpService.api(Object.assign({ method: 'post', url: methodUrl, body: fields }, options));
996
+ }
997
+ apexGetRequest(path, params, options) {
998
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
999
+ const httpParams = new HttpParams({ fromString: params.toString() });
1000
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams }, options));
1001
+ }
1002
+ apexPostRequest(path, body, options) {
1003
+ return this.httpService.api(Object.assign({ method: 'post', body, url: `${this.SERVICE_URL}/apex${path}` }, options));
1004
+ }
1005
+ restGetRequest(path, params, options) {
1006
+ const httpParams = new HttpParams({ fromString: params.toString() });
1007
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest${path}`, params: httpParams }, options));
1008
+ }
1009
+ getGlobalPicklists() {
1010
+ return this.httpService.api({
1011
+ method: 'get',
1012
+ url: `${this.SERVICE_URL}/globalvalueset`,
1013
+ });
1014
+ }
1015
+ getGlobalPicklistValues(id) {
1016
+ return this.httpService.api({
1017
+ method: 'get',
1018
+ url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
1019
+ });
1020
+ }
1021
+ }
1022
+ SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1023
+ SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
1024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
1025
+ type: Injectable
1026
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1027
+
1028
+ class PCMApiService {
1029
+ constructor(sfApiService) {
1030
+ this.sfApiService = sfApiService;
1031
+ }
1032
+ fetchPCMByProductId(productId) {
1033
+ return this.sfApiService.restGetRequest(`/connect/pcm/products/${productId}`, new HttpParams()).pipe(tap$1(response => {
1034
+ if (response.status.code !== '200') {
1035
+ throw new Error(response.status.message);
1036
+ }
1037
+ }), map$1(response => {
1038
+ const pcm = response.products[0];
1039
+ if (!pcm) {
1040
+ throw new Error('PCM product is not found');
1041
+ }
1042
+ return pcm;
1043
+ }));
1044
+ }
1045
+ }
1046
+ PCMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, deps: [{ token: SalesforceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1047
+ PCMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService });
1048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, decorators: [{
1049
+ type: Injectable
1050
+ }], ctorParameters: function () { return [{ type: SalesforceApiService }]; } });
1051
+
1052
+ class PicklistsAdminApiService {
1053
+ constructor(baseHttpService) {
1054
+ this.baseHttpService = baseHttpService;
1055
+ this.serviceUrl = '/admin/v2/picklists';
1056
+ this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}` });
1057
+ this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/${code}` });
1058
+ this.createPicklist$ = (picklist) => {
1059
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}`, body: picklist });
1060
+ };
1061
+ this.updatePicklist$ = (picklist) => {
1062
+ return this.baseHttpService.api({
1063
+ method: 'put',
1064
+ url: `${this.serviceUrl}/${picklist.id}`,
1065
+ body: picklist,
1066
+ });
1067
+ };
1068
+ this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/${id}` });
1069
+ this.restorePicklist$ = (id) => {
1070
+ return this.baseHttpService.api({
1071
+ url: `${this.serviceUrl}/${id}/restore`,
1072
+ method: 'patch',
1073
+ });
1074
+ };
1075
+ this.addPicklistValue$ = (picklist, value) => {
1076
+ const data = Object.assign(Object.assign({}, picklist), { values: [...picklist.values, value] });
1077
+ return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/${picklist.id}`, body: data });
1078
+ };
1079
+ }
1080
+ }
1081
+ PicklistsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1082
+ PicklistsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService });
1083
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, decorators: [{
1084
+ type: Injectable
1085
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1086
+
1087
+ class ProductsAdminApiService {
1088
+ constructor(baseHttpService) {
1089
+ this.baseHttpService = baseHttpService;
1090
+ this.serviceUrl = '/admin/v2/products';
1091
+ this.fetchProducts$ = (payload) => {
1092
+ let params = new HttpParams();
1093
+ params = params.append('count', payload.count);
1094
+ params = params.append('skip', payload.skip);
1095
+ if (payload.name) {
1096
+ params = params.append('name', payload.name);
1097
+ }
1098
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1099
+ };
1100
+ this.searchProducts$ = (expression, skip, count) => {
1101
+ let params = new HttpParams();
1102
+ params = params.set('skip', '' + skip);
1103
+ params = params.set('count', '' + count);
1104
+ return this.baseHttpService.api({
1105
+ method: 'post',
1106
+ url: `${this.serviceUrl}/search`,
1107
+ params: params,
1108
+ body: expression,
1109
+ });
1110
+ };
1111
+ this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1112
+ this.createNewProduct$ = (productData) => {
1113
+ return this.baseHttpService.api({
1114
+ url: `${this.serviceUrl}`,
1115
+ method: 'post',
1116
+ body: productData,
1117
+ });
1118
+ };
1119
+ this.updateProduct$ = (body) => {
1120
+ return this.baseHttpService.api({
1121
+ url: `${this.serviceUrl}/${body.id}`,
1122
+ method: 'put',
1123
+ body,
1124
+ });
1125
+ };
1126
+ this.removeProduct$ = (id) => {
1127
+ return this.baseHttpService.api({
1128
+ url: `${this.serviceUrl}/${id}`,
1129
+ method: 'delete',
1130
+ });
1131
+ };
1132
+ this.restoreProduct$ = (id) => {
1133
+ return this.baseHttpService.api({
1134
+ url: `${this.serviceUrl}/${id}/restore`,
1135
+ method: 'patch',
1136
+ });
1137
+ };
1138
+ }
1139
+ attachImage$(productId, file) {
1140
+ const data = new FormData();
1141
+ data.append('image', file);
1142
+ return this.baseHttpService.upload({
1143
+ method: 'post',
1144
+ url: `${this.serviceUrl}/${productId}/image`,
1145
+ body: data,
1146
+ });
1147
+ }
1148
+ removeImage$(productId) {
1149
+ return this.baseHttpService.api({
1150
+ method: 'delete',
1151
+ url: `${this.serviceUrl}/${productId}/image`,
1152
+ });
1153
+ }
1154
+ fetchImage$(productId) {
1155
+ return this.baseHttpService.api({
1156
+ url: this.getImageUrl(productId),
1157
+ method: 'get',
1158
+ responseType: 'blob',
1159
+ errorHandler: noop,
1160
+ });
1161
+ }
1162
+ getImageUrl(productId) {
1163
+ return `${this.serviceUrl}/${productId}/image`;
1164
+ }
1165
+ }
1166
+ ProductsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1167
+ ProductsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService });
1168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, decorators: [{
1169
+ type: Injectable
1170
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1171
+
1172
+ class SalesTransactionApiService {
1173
+ constructor(httpService) {
1174
+ this.httpService = httpService;
1175
+ this.SERVICE_URL = '/v2/transactions';
1176
+ }
1177
+ /**
1178
+ * This endpoint doesn't include orders and assets
1179
+ * @param objectId SF record ID (quoteId | accountId | opportunityId | orderId etc)
1180
+ * @param params Query params
1181
+ * @param options Request options
1182
+ */
1183
+ getState(objectId, params, options) {
1184
+ return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}/${objectId}`, params: params }, options));
1185
+ }
1186
+ upsert(request, options) {
1187
+ return of({
1188
+ id: 'ID',
1189
+ });
1190
+ // return this.httpService.api({
1191
+ // method: 'post',
1192
+ // url: `${this.SERVICE_URL}`,
1193
+ // body: request,
1194
+ // ...options,
1195
+ // });
1196
+ }
1197
+ submit(request, options) {
1198
+ return of({
1199
+ id: 'ID',
1200
+ });
1201
+ // return this.httpService.api({
1202
+ // method: 'post',
1203
+ // url: `${this.SERVICE_URL}`,
1204
+ // body: request,
1205
+ // ...options,
1206
+ // });
1207
+ }
1208
+ }
1209
+ SalesTransactionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1210
+ SalesTransactionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService });
1211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, decorators: [{
1212
+ type: Injectable
1213
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1214
+
1215
+ class ScriptsAdminApiService {
1216
+ constructor(baseHttpService) {
1217
+ this.baseHttpService = baseHttpService;
1218
+ this.serviceUrl = '/admin/v2/functions/scripts';
1219
+ this.fetchScripts$ = () => {
1220
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
1221
+ };
1222
+ this.searchScripts$ = (expression, skip, count) => {
1223
+ let params = new HttpParams();
1224
+ if (typeof skip === 'number') {
1225
+ params = params.set('skip', '' + skip);
1226
+ }
1227
+ if (typeof count === 'number') {
1228
+ params = params.set('count', '' + count);
1229
+ }
1230
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
1231
+ };
1232
+ this.fetchScript$ = (id) => {
1233
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1234
+ };
1235
+ this.createScript$ = (script) => {
1236
+ return this.baseHttpService.api({
1237
+ url: `${this.serviceUrl}`,
1238
+ method: 'post',
1239
+ body: script,
1240
+ });
1241
+ };
1242
+ this.updateScriptMeta$ = (script) => {
1243
+ return this.baseHttpService.api({
1244
+ url: `${this.serviceUrl}/${script.id}`,
1245
+ method: 'put',
1246
+ body: script,
1247
+ });
1248
+ };
1249
+ this.updateScriptDetails$ = (script) => {
1250
+ return this.baseHttpService.api({
1251
+ url: `${this.serviceUrl}/${script.id}`,
1252
+ method: 'put',
1253
+ body: script,
1254
+ });
1255
+ };
1256
+ this.cloneScript$ = (cloneRequest) => {
1257
+ return this.baseHttpService
1258
+ .api({
1259
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
1260
+ method: 'post',
1261
+ body: cloneRequest,
1262
+ })
1263
+ .pipe(map(response => response.clonedRecordId));
1264
+ };
1265
+ this.removeScript$ = (id) => {
1266
+ return this.baseHttpService.api({
1267
+ url: `${this.serviceUrl}/${id}`,
1268
+ method: 'delete',
1269
+ });
1270
+ };
1271
+ this.restoreScript$ = (id) => {
1272
+ return this.baseHttpService.api({
1273
+ url: `${this.serviceUrl}/${id}/restore`,
1274
+ method: 'patch',
1275
+ });
1276
+ };
1277
+ this.execute$ = (body) => {
1278
+ return this.baseHttpService.api({
1279
+ url: `${this.serviceUrl}/execute`,
1280
+ method: 'post',
1281
+ body,
1282
+ errorHandler: () => null,
1283
+ });
1284
+ };
1285
+ }
1286
+ }
1287
+ ScriptsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1288
+ ScriptsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService });
1289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, decorators: [{
1290
+ type: Injectable
1291
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1292
+
1293
+ class ShoppingCartSettingsApiService {
1294
+ constructor(configurationSettingsApiService) {
1295
+ this.configurationSettingsApiService = configurationSettingsApiService;
1296
+ this.shoppingCartSettingsKey = 'shopping-cart';
1297
+ }
1298
+ getSetting(id) {
1299
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map(settings => settings.find(setting => setting.id == id)));
1300
+ }
1301
+ fetchSettings() {
1302
+ return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
1303
+ }
1304
+ getSettingsMap() {
1305
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map((settings) => settings.reduce((acc, setting) => {
1306
+ return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
1307
+ }, {})));
1308
+ }
1309
+ }
1310
+ ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1311
+ ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
1312
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
1313
+ type: Injectable
1314
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
1315
+
1316
+ function uiDefinitionFromDTO(container) {
1317
+ const { sourceBlob } = container, rest = __rest(container, ["sourceBlob"]);
1318
+ return Object.assign(Object.assign({}, rest), { source: parseJsonStringAsObject(sourceBlob) });
1319
+ }
1320
+ function uiDefinitionToDTO(container) {
1321
+ const { source } = container, rest = __rest(container, ["source"]);
1322
+ return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
1323
+ }
1324
+ function newUiDefinitionToDTO(container) {
1325
+ const { source } = container, rest = __rest(container, ["source"]);
1326
+ return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
1327
+ }
1328
+
1329
+ class UIDefinitionsAdminApiService {
1330
+ constructor(baseHttpService) {
1331
+ this.baseHttpService = baseHttpService;
1332
+ this.serviceUrl = '/admin/v2/uidefinitions';
1333
+ }
1334
+ fetchAll$(params) {
1335
+ let httpParams = new HttpParams();
1336
+ if ((params === null || params === void 0 ? void 0 : params.productId) != null) {
1337
+ httpParams = httpParams.set('productId', params.productId);
1338
+ }
1339
+ if ((params === null || params === void 0 ? void 0 : params.defaultUIDefinitionId) != null) {
1340
+ httpParams = httpParams.set('defaultUIDefinitionId', params.defaultUIDefinitionId);
1341
+ }
1342
+ return this.baseHttpService
1343
+ .api({
1344
+ method: 'get',
1345
+ url: this.serviceUrl,
1346
+ params: httpParams,
1347
+ })
1348
+ .pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
1349
+ }
1350
+ fetch$(id) {
1351
+ return this.baseHttpService
1352
+ .api({
1353
+ method: 'get',
1354
+ url: `${this.serviceUrl}/${id}`,
1355
+ })
1356
+ .pipe(map$1(container => uiDefinitionFromDTO(Object.assign(Object.assign({}, container), { id }))));
1357
+ }
1358
+ create$(uiDefinitionContainer) {
1359
+ const dto = newUiDefinitionToDTO(uiDefinitionContainer);
1360
+ return this.baseHttpService
1361
+ .api({
1362
+ method: 'post',
1363
+ url: this.serviceUrl,
1364
+ body: dto,
1365
+ })
1366
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
1367
+ }
1368
+ update$(uiDefinitionContainer) {
1369
+ const dto = uiDefinitionToDTO(uiDefinitionContainer);
1370
+ return this.baseHttpService
1371
+ .api({
1372
+ method: 'put',
1373
+ url: `${this.serviceUrl}/${uiDefinitionContainer.id}`,
1374
+ body: dto,
1375
+ })
1376
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
1377
+ }
1378
+ delete$(id) {
1379
+ return this.baseHttpService.api({
1380
+ method: 'delete',
1381
+ url: `${this.serviceUrl}/${id}`,
1382
+ });
1383
+ }
1384
+ }
1385
+ UIDefinitionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1386
+ UIDefinitionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService });
1387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, decorators: [{
1388
+ type: Injectable
1389
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1390
+
1391
+ const fromUIComponentStoryDTO = (dto, attachments) => {
1392
+ return {
1393
+ id: dto.id,
1394
+ name: dto.name,
1395
+ uiComponentId: dto.uiComponentId,
1396
+ description: dto.description,
1397
+ section: attachments.json,
1398
+ template: attachments.html,
1399
+ script: attachments.js,
1400
+ styles: attachments.css,
1401
+ };
1402
+ };
1403
+
1404
+ class UITemplatesAdminApiService {
1405
+ constructor(baseHttpService) {
1406
+ this.baseHttpService = baseHttpService;
1407
+ this.serviceUrl = '/admin/v2/uitemplates';
1408
+ this.fetchTemplates$ = (name) => {
1409
+ let params = new HttpParams();
1410
+ if (name) {
1411
+ params = params.append('name', name);
1412
+ }
1413
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1414
+ };
1415
+ this.createTemplate$ = (template) => {
1416
+ return this.baseHttpService.api({
1417
+ method: 'post',
1418
+ url: `${this.serviceUrl}`,
1419
+ body: template,
1420
+ });
1421
+ };
1422
+ this.updateTemplate$ = (template) => {
1423
+ return this.baseHttpService.api({
1424
+ method: 'put',
1425
+ url: `${this.serviceUrl}/${template.id}`,
1426
+ body: template,
1427
+ });
1428
+ };
1429
+ this.duplicateTemplate$ = (template, cloneRequest) => {
1430
+ return this.baseHttpService
1431
+ .api({
1432
+ url: `${this.serviceUrl}/${template.id}/clone`,
1433
+ method: 'post',
1434
+ body: cloneRequest,
1435
+ })
1436
+ .pipe(map$1(response => response.clonedRecordId));
1437
+ };
1438
+ this.removeTemplate$ = (id) => {
1439
+ return this.baseHttpService.api({
1440
+ method: 'delete',
1441
+ url: `${this.serviceUrl}/${id}`,
1442
+ });
1443
+ };
1444
+ this.restoreTemplate$ = (id) => {
1445
+ return this.baseHttpService.api({
1446
+ method: 'patch',
1447
+ url: `${this.serviceUrl}/${id}`,
1448
+ });
1449
+ };
1450
+ this.searchTemplates$ = (data) => {
1451
+ return this.baseHttpService.api({
1452
+ method: 'post',
1453
+ url: `${this.serviceUrl}/search`,
1454
+ params: data.params,
1455
+ body: data.expression,
1456
+ });
1457
+ };
1458
+ this.fetchComponents$ = (templateId, name) => {
1459
+ let params = new HttpParams();
1460
+ if (name) {
1461
+ params = params.append('name', name);
1462
+ }
1463
+ return this.baseHttpService.api({
1464
+ url: `${this.serviceUrl}/${templateId}/components`,
1465
+ params,
1466
+ });
1467
+ };
1468
+ this.fetchComponent$ = (templateId, componentId) => {
1469
+ return this.baseHttpService.api({
1470
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1471
+ });
1472
+ };
1473
+ this.createComponent$ = (component) => {
1474
+ return this.baseHttpService.api({
1475
+ method: 'post',
1476
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
1477
+ body: component,
1478
+ });
1479
+ };
1480
+ this.updateComponent$ = (component) => {
1481
+ return this.baseHttpService.api({
1482
+ method: 'put',
1483
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
1484
+ body: component,
1485
+ });
1486
+ };
1487
+ this.duplicateComponent$ = (component, cloneRequest) => {
1488
+ return this.baseHttpService
1489
+ .api({
1490
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
1491
+ method: 'post',
1492
+ body: cloneRequest,
1493
+ })
1494
+ .pipe(map$1(response => response.clonedRecordId));
1495
+ };
1496
+ this.removeComponent$ = (templateId, componentId) => {
1497
+ return this.baseHttpService.api({
1498
+ method: 'delete',
1499
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1500
+ });
1501
+ };
1502
+ this.restoreComponent$ = (templateId, componentId) => {
1503
+ return this.baseHttpService.api({
1504
+ method: 'patch',
1505
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1506
+ });
1507
+ };
1508
+ this.searchComponents$ = (templateId, data) => {
1509
+ return this.baseHttpService.api({
1510
+ method: 'post',
1511
+ url: `${this.serviceUrl}/${templateId}/components/search`,
1512
+ params: data.params,
1513
+ body: data.expression,
1514
+ });
1515
+ };
1516
+ this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
1517
+ return this.baseHttpService
1518
+ .api({
1519
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
1520
+ responseType: 'text',
1521
+ errorHandler: noop,
1522
+ })
1523
+ .pipe(catchError$1(() => of('')));
1524
+ };
1525
+ this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
1526
+ return forkJoin([
1527
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
1528
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
1529
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
1530
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
1531
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
1532
+ };
1533
+ this.fetchStories$ = (templateId, componentId, name) => {
1534
+ let params = new HttpParams();
1535
+ if (name) {
1536
+ params = params.append('name', name);
1537
+ }
1538
+ return this.baseHttpService
1539
+ .api({
1540
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
1541
+ params,
1542
+ })
1543
+ .pipe(switchMap(dtos => {
1544
+ if (!dtos.length) {
1545
+ return of([]);
1546
+ }
1547
+ return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1548
+ }));
1549
+ };
1550
+ this.fetchStory$ = (templateId, componentId, storyId) => {
1551
+ return this.baseHttpService
1552
+ .api({
1553
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1554
+ })
1555
+ .pipe(switchMap(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1556
+ };
1557
+ this.createComponentStory$ = (templateId, story) => {
1558
+ return this.baseHttpService.api({
1559
+ method: 'post',
1560
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
1561
+ body: story,
1562
+ });
1563
+ };
1564
+ this.updateComponentStory$ = (templateId, story) => {
1565
+ const { script, template, styles, section } = story, rest = __rest(story, ["script", "template", "styles", "section"]);
1566
+ return this.baseHttpService
1567
+ .api({
1568
+ method: 'put',
1569
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
1570
+ body: rest,
1571
+ })
1572
+ .pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
1573
+ };
1574
+ this.duplicateComponentStory$ = (story, cloneRequest) => {
1575
+ return this.baseHttpService
1576
+ .api({
1577
+ url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
1578
+ method: 'post',
1579
+ body: cloneRequest,
1580
+ })
1581
+ .pipe(map$1(response => response.clonedRecordId));
1582
+ };
1583
+ this.deleteComponentStory$ = (templateId, componentId, storyId) => {
1584
+ return this.baseHttpService.api({
1585
+ method: 'delete',
1586
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1587
+ });
1588
+ };
1589
+ this.restoreComponentStory$ = (templateId, componentId, storyId) => {
1590
+ return this.baseHttpService.api({
1591
+ method: 'patch',
1592
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1593
+ });
1594
+ };
1595
+ this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
1596
+ const formData = new FormData();
1597
+ if (attachments.html != null) {
1598
+ formData.append('html', new Blob([attachments.html]), 'story-template.html');
1599
+ }
1600
+ if (attachments.css != null) {
1601
+ formData.append('css', new Blob([attachments.css]), 'story-styles.css');
1602
+ }
1603
+ if (attachments.js != null) {
1604
+ formData.append('js', new Blob([attachments.js]), 'story-script.js');
1605
+ }
1606
+ if (attachments.json != null) {
1607
+ formData.append('json', new Blob([attachments.json]), 'story-section.json');
1608
+ }
1609
+ return this.baseHttpService.upload({
1610
+ method: 'post',
1611
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
1612
+ body: formData,
1613
+ });
1614
+ };
1615
+ this.fetchComponentAttachments$ = (templateId, component) => {
1616
+ return forkJoin([
1617
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
1618
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
1619
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
1620
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
1621
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
1622
+ };
1623
+ this.fetchComponentsAttachments$ = (templateId) => {
1624
+ return this.fetchComponents$(templateId).pipe(switchMap(components => {
1625
+ return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
1626
+ }));
1627
+ };
1628
+ this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
1629
+ return this.baseHttpService
1630
+ .api({
1631
+ method: 'get',
1632
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
1633
+ responseType: 'text',
1634
+ errorHandler: noop,
1635
+ })
1636
+ .pipe(catchError$1(() => of('')));
1637
+ };
1638
+ this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
1639
+ const formData = new FormData();
1640
+ if (attachments.html != null) {
1641
+ formData.append('html', new Blob([attachments.html]), 'template.html');
1642
+ }
1643
+ if (attachments.css != null) {
1644
+ formData.append('css', new Blob([attachments.css]), 'styles.css');
1645
+ }
1646
+ if (attachments.js != null) {
1647
+ formData.append('js', new Blob([attachments.js]), 'script.js');
1648
+ }
1649
+ if (attachments.json != null) {
1650
+ formData.append('json', new Blob([attachments.json]), 'section.json');
1651
+ }
1652
+ return this.baseHttpService.upload({
1653
+ method: 'post',
1654
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
1655
+ body: formData,
1656
+ });
1657
+ };
1658
+ }
1659
+ getTemplateThumbnailUrl(templateId) {
1660
+ return `${this.serviceUrl}/${templateId}/thumbnail/file`;
1661
+ }
1662
+ attachTemplateThumbnail$(templateId, file) {
1663
+ const data = new FormData();
1664
+ data.append('thumb', file);
1665
+ return this.baseHttpService.upload({
1666
+ method: 'post',
1667
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
1668
+ body: data,
1669
+ });
1670
+ }
1671
+ removeTemplateThumbnail$(templateId) {
1672
+ return this.baseHttpService.api({
1673
+ method: 'delete',
1674
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
1675
+ });
1676
+ }
1677
+ }
1678
+ UITemplatesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1679
+ UITemplatesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService });
1680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, decorators: [{
1681
+ type: Injectable
1682
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1683
+
1684
+ class VeloceObjectsAdminApiService {
1685
+ constructor(baseHttpService) {
1686
+ this.baseHttpService = baseHttpService;
1687
+ this.serviceUrl = '/admin/v2/veloceobjects';
1688
+ this.updateCategory$ = (category) => {
1689
+ return this.baseHttpService.api({
1690
+ method: 'put',
1691
+ url: `${this.serviceUrl}/categories/${category.id}`,
1692
+ body: category,
1693
+ });
1694
+ };
1695
+ this.deleteCategory$ = (id) => {
1696
+ return this.baseHttpService.api({
1697
+ method: 'delete',
1698
+ url: `${this.serviceUrl}/categories/${id}`,
1699
+ });
1700
+ };
1701
+ this.searchObjects$ = (searchParams, expression) => {
1702
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
1703
+ return this.baseHttpService.api({
1704
+ method: 'post',
1705
+ url: `${this.serviceUrl}/search`,
1706
+ params,
1707
+ body: expression || {},
1708
+ });
1709
+ };
1710
+ this.deleteObject$ = (id) => {
1711
+ return this.baseHttpService.api({
1712
+ method: 'delete',
1713
+ url: `${this.serviceUrl}/${id}`,
1714
+ });
1715
+ };
1716
+ this.duplicateObject$ = (body) => {
1717
+ return this.baseHttpService
1718
+ .api({
1719
+ method: 'post',
1720
+ url: `${this.serviceUrl}/${body.id}/clone`,
1721
+ body,
1722
+ })
1723
+ .pipe(map(response => response.clonedRecordId));
1724
+ };
1725
+ this.restoreObject$ = (id) => {
1726
+ return this.baseHttpService.api({
1727
+ method: 'patch',
1728
+ url: `${this.serviceUrl}/${id}/restore`,
1729
+ });
1730
+ };
1731
+ }
1732
+ fetchCategories$() {
1733
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
1734
+ }
1735
+ createCategory$(category) {
1736
+ return this.baseHttpService.api({
1737
+ method: 'post',
1738
+ url: `${this.serviceUrl}/categories`,
1739
+ body: category,
1740
+ });
1741
+ }
1742
+ fetchObjects$() {
1743
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
1744
+ }
1745
+ fetchObject$(id) {
1746
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1747
+ }
1748
+ createObject$(object) {
1749
+ return this.baseHttpService.api({
1750
+ method: 'post',
1751
+ url: `${this.serviceUrl}`,
1752
+ body: object,
1753
+ });
1754
+ }
1755
+ updateObject$(object) {
1756
+ return this.baseHttpService.api({
1757
+ method: 'put',
1758
+ url: `${this.serviceUrl}/${object.id}`,
1759
+ body: object,
1760
+ });
1761
+ }
1762
+ }
1763
+ VeloceObjectsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1764
+ VeloceObjectsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService });
1765
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, decorators: [{
1766
+ type: Injectable
1767
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1768
+
1769
+ class ApiV2Module {
1770
+ }
1771
+ ApiV2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1772
+ ApiV2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, imports: [HttpClientModule] });
1773
+ ApiV2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, providers: [
1774
+ BaseHttpService,
1775
+ CacheApiService,
1776
+ CatalogAdminApiService,
1777
+ CatalogApiService,
1778
+ ConfigurationProcessorsApiService,
1779
+ ConfigurationSettingsApiService,
1780
+ ContextDefinitionAdminApiService,
1781
+ DocumentAttachmentApiService,
1782
+ EndpointsAdminApiService,
1783
+ FlowsApiService,
1784
+ FunctionGroupsAdminApiService,
1785
+ OrchestrationsAdminApiService,
1786
+ OrchestrationsApiService,
1787
+ PCMApiService,
1788
+ PicklistsAdminApiService,
1789
+ ProductsAdminApiService,
1790
+ FunctionsAdminApiService,
1791
+ GuidedSellingsAdminApiService,
1792
+ GuidedSellingApiService,
1793
+ SalesforceApiService,
1794
+ SalesTransactionApiService,
1795
+ ShoppingCartSettingsApiService,
1796
+ ScriptsAdminApiService,
1797
+ UIDefinitionsAdminApiService,
1798
+ UITemplatesAdminApiService,
1799
+ VeloceObjectsAdminApiService,
1800
+ XrayService,
1801
+ ], imports: [HttpClientModule] });
1802
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, decorators: [{
1803
+ type: NgModule,
1804
+ args: [{
1805
+ imports: [HttpClientModule],
1806
+ providers: [
1807
+ BaseHttpService,
1808
+ CacheApiService,
1809
+ CatalogAdminApiService,
1810
+ CatalogApiService,
1811
+ ConfigurationProcessorsApiService,
1812
+ ConfigurationSettingsApiService,
1813
+ ContextDefinitionAdminApiService,
1814
+ DocumentAttachmentApiService,
1815
+ EndpointsAdminApiService,
1816
+ FlowsApiService,
1817
+ FunctionGroupsAdminApiService,
1818
+ OrchestrationsAdminApiService,
1819
+ OrchestrationsApiService,
1820
+ PCMApiService,
1821
+ PicklistsAdminApiService,
1822
+ ProductsAdminApiService,
1823
+ FunctionsAdminApiService,
1824
+ GuidedSellingsAdminApiService,
1825
+ GuidedSellingApiService,
1826
+ SalesforceApiService,
1827
+ SalesTransactionApiService,
1828
+ ShoppingCartSettingsApiService,
1829
+ ScriptsAdminApiService,
1830
+ UIDefinitionsAdminApiService,
1831
+ UITemplatesAdminApiService,
1832
+ VeloceObjectsAdminApiService,
1833
+ XrayService,
1834
+ ],
1835
+ }]
1836
+ }] });
1837
+
1838
+ /**
1839
+ * Generated bundle index. Do not edit.
1840
+ */
1841
+
1842
+ export { ApiV2Module, CacheApiService, CatalogAdminApiService, CatalogApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextDefinitionAdminApiService, DocumentAttachmentApiService, EndpointsAdminApiService, FlowsApiService, FunctionGroupsAdminApiService, FunctionsAdminApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OrchestrationsAdminApiService, OrchestrationsApiService, PCMApiService, PicklistsAdminApiService, ProductsAdminApiService, SalesTransactionApiService, SalesforceApiService, ScriptsAdminApiService, ShoppingCartSettingsApiService, UIDefinitionsAdminApiService, UITemplatesAdminApiService, VeloceObjectsAdminApiService };
1843
+ //# sourceMappingURL=veloceapps-api-v2.mjs.map