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