@veloceapps/api 11.0.0-8 → 11.0.0-80

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 (218) 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 +72 -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 +70 -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 +116 -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 +25 -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 +38 -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/shopping-cart-settings-api.service.mjs +28 -0
  50. package/esm2020/v2/services/ui-definitions-admin-api.service.mjs +68 -0
  51. package/esm2020/v2/services/ui-templates-admin-api.service.mjs +286 -0
  52. package/esm2020/v2/services/veloce-objects-api.service.mjs +90 -0
  53. package/esm2020/v2/types/attachment.types.mjs +2 -0
  54. package/esm2020/v2/types/clone-request.types.mjs +2 -0
  55. package/esm2020/v2/types/dto/configuration-settings-dto.types.mjs +22 -0
  56. package/esm2020/v2/types/dto/ui-definition-dto.types.mjs +2 -0
  57. package/esm2020/v2/types/dto/ui-template-dto.types.mjs +2 -0
  58. package/esm2020/v2/types/function.types.mjs +2 -0
  59. package/esm2020/v2/types/index.mjs +7 -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 +1794 -0
  69. package/fesm2015/veloceapps-api-v2.mjs.map +1 -0
  70. package/fesm2015/veloceapps-api.mjs +553 -2892
  71. package/fesm2015/veloceapps-api.mjs.map +1 -1
  72. package/fesm2020/veloceapps-api-v2.mjs +1866 -0
  73. package/fesm2020/veloceapps-api-v2.mjs.map +1 -0
  74. package/fesm2020/veloceapps-api.mjs +552 -2993
  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} +5 -4
  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 +25 -0
  93. package/v2/services/index.d.ts +24 -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 +12 -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/v2/services/ui-definitions-admin-api.service.d.ts +18 -0
  102. package/{lib/services/ui-templates-api.service.d.ts → v2/services/ui-templates-admin-api.service.d.ts} +3 -3
  103. package/{lib → v2}/services/veloce-objects-api.service.d.ts +3 -3
  104. package/v2/types/clone-request.types.d.ts +5 -0
  105. package/v2/types/dto/ui-definition-dto.types.d.ts +7 -0
  106. package/v2/types/function.types.d.ts +13 -0
  107. package/v2/types/index.d.ts +6 -0
  108. package/v2/types/pcm.types.d.ts +10 -0
  109. package/v2/types/procedure.types.d.ts +61 -0
  110. package/v2/types/sales-transaction.types.d.ts +10 -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 -122
  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 -122
  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/scripts-api.service.d.ts +0 -21
  185. package/lib/services/ui-definitions-api.service.d.ts +0 -21
  186. package/lib/types/price.types.d.ts +0 -5
  187. package/lib/types/quote.types.d.ts +0 -8
  188. package/lib/types/ramp-request.types.d.ts +0 -13
  189. package/lib/utils/index.d.ts +0 -2
  190. /package/{lib → src/lib}/services/account-api.service.d.ts +0 -0
  191. /package/{lib → src/lib}/services/auth.service.d.ts +0 -0
  192. /package/{lib → src/lib}/services/contracted-price-api.service.d.ts +0 -0
  193. /package/{lib → src/lib}/services/flow-state-api.d.ts +0 -0
  194. /package/{lib → src/lib}/services/offers-api.service.d.ts +0 -0
  195. /package/{lib → src/lib}/services/org-info-api.service.d.ts +0 -0
  196. /package/{lib → src/lib}/services/portals-api.service.d.ts +0 -0
  197. /package/{lib → src/lib}/services/promotions-api.service.d.ts +0 -0
  198. /package/{lib → src/lib}/services/rebate-program-api.service.d.ts +0 -0
  199. /package/{lib → src/lib}/services/rebate-type-api.service.d.ts +0 -0
  200. /package/{lib → src/lib}/services/sandbox-manager-api.service.d.ts +0 -0
  201. /package/{lib → src/lib}/services/stateful-configuration-api.d.ts +0 -0
  202. /package/{lib → src/lib}/types/auth.types.d.ts +0 -0
  203. /package/{lib → src/lib}/types/clone-request.types.d.ts +0 -0
  204. /package/{lib → src/lib}/types/delta-request.types.d.ts +0 -0
  205. /package/{lib → src/lib}/types/dto/offers-dto.types.d.ts +0 -0
  206. /package/{lib → src/lib}/types/org-info.types.d.ts +0 -0
  207. /package/{lib → src/lib}/types/search-request.types.d.ts +0 -0
  208. /package/{lib → src/lib}/utils/canvas.utils.d.ts +0 -0
  209. /package/{lib → v2}/services/catalog-admin-api.service.d.ts +0 -0
  210. /package/{lib → v2}/services/configuration-processors-api.service.d.ts +0 -0
  211. /package/{lib → v2}/services/flows-api.service.d.ts +0 -0
  212. /package/{lib → v2}/services/guided-sellings-admin-api.service.d.ts +0 -0
  213. /package/{lib → v2}/services/guided-sellings-api.service.d.ts +0 -0
  214. /package/{lib → v2}/services/shopping-cart-settings-api.service.d.ts +0 -0
  215. /package/{lib → v2}/types/attachment.types.d.ts +0 -0
  216. /package/{lib → v2}/types/dto/configuration-settings-dto.types.d.ts +0 -0
  217. /package/{lib → v2}/types/dto/ui-template-dto.types.d.ts +0 -0
  218. /package/{lib → v2}/utils/ui-template.utils.d.ts +0 -0
@@ -0,0 +1,1794 @@
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, 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
+ fetchContextMappingsDetails$(id) {
420
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}/mappings/details` });
421
+ }
422
+ fetchContextDefinitionStructure$(id) {
423
+ return this.baseHttpService
424
+ .api({
425
+ url: `${this.serviceUrl}/${id}/structure/details`,
426
+ skipErrorHandler: true,
427
+ })
428
+ .pipe(catchError(() => {
429
+ return of([]);
430
+ }), map(objects => {
431
+ return objects.map(object => {
432
+ var _a, _b, _c;
433
+ const tag = (_b = (_a = object.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
434
+ const objectAttributes = object.attributes || [];
435
+ return {
436
+ id: object.id,
437
+ title: tag || object.title,
438
+ parentNodeId: object.parentNodeId,
439
+ nodeTags: ((_c = object.tags) !== null && _c !== void 0 ? _c : []).map(nodeTag => nodeTag.title),
440
+ attributes: objectAttributes.reduce((result, attribute) => {
441
+ var _a, _b;
442
+ const tag = (_b = (_a = attribute.tags) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.title;
443
+ if (tag) {
444
+ result.push({
445
+ title: tag,
446
+ fieldType: attribute.fieldType,
447
+ dataType: attribute.dataType,
448
+ });
449
+ }
450
+ return result;
451
+ }, []),
452
+ };
453
+ });
454
+ }));
455
+ }
456
+ fetchRlmProcedures(contextDefinitionId) {
457
+ const params = {};
458
+ if (contextDefinitionId) {
459
+ params['contextDefinitionId'] = contextDefinitionId;
460
+ }
461
+ return this.baseHttpService.api({
462
+ url: `${this.serviceUrl}/procedures`,
463
+ params,
464
+ });
465
+ }
466
+ }
467
+ ContextDefinitionAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
468
+ ContextDefinitionAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService });
469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, decorators: [{
470
+ type: Injectable
471
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
472
+
473
+ class DocumentAttachmentApiService {
474
+ constructor(httpService, fileDownloadService) {
475
+ this.httpService = httpService;
476
+ this.fileDownloadService = fileDownloadService;
477
+ this.SERVICE_URL = '/v2/attachments';
478
+ }
479
+ getAttachments(searchRequest) {
480
+ return this.httpService.api({
481
+ url: `${this.SERVICE_URL}/search`,
482
+ method: 'post',
483
+ body: searchRequest,
484
+ });
485
+ }
486
+ createAttachment(attachment, file, reportProgress) {
487
+ const formData = new FormData();
488
+ if (file) {
489
+ formData.append('file', file, file.name);
490
+ }
491
+ formData.append('attachment', new Blob([JSON.stringify(attachment)], {
492
+ type: 'application/json',
493
+ }));
494
+ return this.httpService.upload({
495
+ url: `${this.SERVICE_URL}`,
496
+ body: formData,
497
+ method: 'post',
498
+ observe: reportProgress ? 'events' : undefined,
499
+ reportProgress,
500
+ });
501
+ }
502
+ updateAttachment(id, attachment) {
503
+ return this.httpService.api({
504
+ url: `${this.SERVICE_URL}/${id}`,
505
+ body: attachment,
506
+ method: 'put',
507
+ });
508
+ }
509
+ getAttachmentFile(id, isPreventDownload) {
510
+ return this.httpService
511
+ .api({
512
+ url: `${this.SERVICE_URL}/${id}/file`,
513
+ responseType: isPreventDownload ? 'arraybuffer' : 'blob',
514
+ observe: isPreventDownload ? 'body' : 'response',
515
+ })
516
+ .pipe(tap(response => {
517
+ if (!isPreventDownload) {
518
+ this.fileDownloadService.processDownload(response);
519
+ }
520
+ }), map(response => (isPreventDownload ? new Blob([response.body || response]) : response.body || response)));
521
+ }
522
+ removeAttachment(id) {
523
+ return this.httpService.api({
524
+ url: `${this.SERVICE_URL}/${id}`,
525
+ method: 'delete',
526
+ });
527
+ }
528
+ }
529
+ 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 });
530
+ DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService });
531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
532
+ type: Injectable
533
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
534
+
535
+ class EndpointsAdminApiService {
536
+ constructor(baseHttpService) {
537
+ this.baseHttpService = baseHttpService;
538
+ this.serviceUrl = '/admin/v2/api-endpoints';
539
+ }
540
+ fetchEndpoints$() {
541
+ return this.searchEndpoints$(new Expression(), 0, -1);
542
+ }
543
+ searchEndpoints$(expression, skip, count) {
544
+ let params = new HttpParams();
545
+ params = params.set('skip', '' + skip);
546
+ params = params.set('count', '' + count);
547
+ return this.baseHttpService.api({
548
+ method: 'post',
549
+ url: `${this.serviceUrl}/search`,
550
+ params,
551
+ body: expression,
552
+ });
553
+ }
554
+ removeEndpoint$(id) {
555
+ return this.baseHttpService.api({
556
+ url: `${this.serviceUrl}/${id}`,
557
+ method: 'delete',
558
+ });
559
+ }
560
+ restoreEndpoint$(id) {
561
+ return this.baseHttpService.api({
562
+ url: `${this.serviceUrl}/${id}/restore`,
563
+ method: 'patch',
564
+ });
565
+ }
566
+ fetchEndpoint$(id) {
567
+ return this.baseHttpService.api({
568
+ url: `${this.serviceUrl}/${id}`,
569
+ method: 'get',
570
+ });
571
+ }
572
+ createEndpoint$(body) {
573
+ return this.baseHttpService.api({
574
+ url: `${this.serviceUrl}`,
575
+ method: 'post',
576
+ body,
577
+ });
578
+ }
579
+ updateEndpoint$(body) {
580
+ return this.baseHttpService.api({
581
+ url: `${this.serviceUrl}/${body.id}`,
582
+ method: 'put',
583
+ body,
584
+ });
585
+ }
586
+ duplicateEndpoint$(cloneRequest) {
587
+ return this.baseHttpService.api({
588
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
589
+ method: 'post',
590
+ body: cloneRequest,
591
+ });
592
+ }
593
+ executeEndpoint$(body) {
594
+ return this.baseHttpService.api({
595
+ url: `${this.serviceUrl}/execute`,
596
+ method: 'post',
597
+ body,
598
+ responseType: 'text',
599
+ skipErrorHandler: true,
600
+ });
601
+ }
602
+ }
603
+ EndpointsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
604
+ EndpointsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService });
605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, decorators: [{
606
+ type: Injectable
607
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
608
+
609
+ class FlowsApiService {
610
+ constructor(configurationSettingsApiService) {
611
+ this.configurationSettingsApiService = configurationSettingsApiService;
612
+ this.flowsKey = 'flows';
613
+ }
614
+ getFlow(id) {
615
+ return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
616
+ if (!flow) {
617
+ throw new Error(`Flow with flowId=${id} is not defined`);
618
+ }
619
+ return flow;
620
+ }));
621
+ }
622
+ fetchFlows() {
623
+ return this.configurationSettingsApiService
624
+ .fetchSetting(this.flowsKey)
625
+ .pipe(map((setting) => ((setting === null || setting === void 0 ? void 0 : setting.value) ? JSON.parse(setting.value) : [])));
626
+ }
627
+ }
628
+ FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
629
+ FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
630
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
631
+ type: Injectable
632
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
633
+
634
+ class FunctionGroupsAdminApiService {
635
+ constructor(baseHttpService) {
636
+ this.baseHttpService = baseHttpService;
637
+ this.serviceUrl = '/admin/v2/functions/groups';
638
+ this.fetchAll$ = () => {
639
+ return this.search$(new Expression(), 0, 100);
640
+ };
641
+ this.search$ = (expression, skip, count) => {
642
+ let params = new HttpParams();
643
+ params = params.set('skip', '' + skip);
644
+ params = params.set('count', '' + count);
645
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
646
+ };
647
+ this.create$ = (ruleGroup) => {
648
+ return this.baseHttpService.api({
649
+ url: `${this.serviceUrl}`,
650
+ method: 'post',
651
+ body: ruleGroup,
652
+ });
653
+ };
654
+ this.update$ = (ruleGroup) => {
655
+ return this.baseHttpService.api({
656
+ url: `${this.serviceUrl}/${ruleGroup.id}`,
657
+ method: 'post',
658
+ body: ruleGroup,
659
+ });
660
+ };
661
+ this.duplicate$ = (body) => {
662
+ return this.baseHttpService
663
+ .api({
664
+ url: `${this.serviceUrl}/${body.id}/clone`,
665
+ method: 'post',
666
+ body,
667
+ })
668
+ .pipe(map$1(response => response.clonedRecordId));
669
+ };
670
+ this.remove$ = (id) => {
671
+ return this.baseHttpService.api({
672
+ url: `${this.serviceUrl}/${id}`,
673
+ method: 'delete',
674
+ });
675
+ };
676
+ this.restore$ = (id) => {
677
+ return this.baseHttpService.api({
678
+ url: `${this.serviceUrl}/${id}/restore`,
679
+ method: 'patch',
680
+ });
681
+ };
682
+ }
683
+ }
684
+ FunctionGroupsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
685
+ FunctionGroupsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService });
686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, decorators: [{
687
+ type: Injectable
688
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
689
+
690
+ class FunctionsAdminApiService {
691
+ constructor(baseHttpService) {
692
+ this.baseHttpService = baseHttpService;
693
+ this.serviceUrl = '/admin/v2/functions';
694
+ this.fetchAll$ = () => {
695
+ return this.search$(new Expression(), 0, 100);
696
+ };
697
+ this.search$ = (expression, skip, count) => {
698
+ let params = new HttpParams();
699
+ if (typeof skip === 'number') {
700
+ params = params.set('skip', '' + skip);
701
+ }
702
+ if (typeof count === 'number') {
703
+ params = params.set('count', '' + count);
704
+ }
705
+ return this.baseHttpService.api({
706
+ method: 'post',
707
+ url: `${this.serviceUrl}/rules/search`,
708
+ params,
709
+ body: expression,
710
+ });
711
+ };
712
+ this.create$ = (rule) => {
713
+ return this.baseHttpService.api({
714
+ url: `${this.serviceUrl}/rules`,
715
+ method: 'post',
716
+ body: rule,
717
+ });
718
+ };
719
+ this.update$ = (rule) => {
720
+ return this.baseHttpService.api({
721
+ url: `${this.serviceUrl}/rules/${rule.id}`,
722
+ method: 'put',
723
+ body: rule,
724
+ });
725
+ };
726
+ this.duplicate$ = (body) => {
727
+ return this.baseHttpService
728
+ .api({
729
+ url: `${this.serviceUrl}/rules/${body.id}/clone`,
730
+ method: 'post',
731
+ body,
732
+ })
733
+ .pipe(map$1(response => response.clonedRecordId));
734
+ };
735
+ this.remove$ = (id) => {
736
+ return this.baseHttpService.api({
737
+ url: `${this.serviceUrl}/rules/${id}`,
738
+ method: 'delete',
739
+ });
740
+ };
741
+ this.restore$ = (id) => {
742
+ return this.baseHttpService.api({
743
+ url: `${this.serviceUrl}/rules/${id}/restore`,
744
+ method: 'patch',
745
+ });
746
+ };
747
+ }
748
+ fetch$(id) {
749
+ return this.baseHttpService.api({
750
+ url: `${this.serviceUrl}/rules/${id}`,
751
+ method: 'get',
752
+ });
753
+ }
754
+ fetchHeaderFields$() {
755
+ return this.baseHttpService.api({
756
+ url: `${this.serviceUrl}/rules/describe/Header`,
757
+ method: 'get',
758
+ });
759
+ }
760
+ execute$(body) {
761
+ const url = `${this.serviceUrl}/rules/execute`;
762
+ return this.baseHttpService.api({
763
+ url,
764
+ method: 'post',
765
+ body,
766
+ });
767
+ }
768
+ executeExtractFunction$(body) {
769
+ return this.baseHttpService.api({
770
+ url: `${this.serviceUrl}/extract`,
771
+ method: 'post',
772
+ body,
773
+ });
774
+ }
775
+ fetchFunctionDatasets$() {
776
+ return this.baseHttpService.api({
777
+ url: `${this.serviceUrl}/datasets`,
778
+ method: 'get',
779
+ });
780
+ }
781
+ fetchFunctionTags$() {
782
+ return this.baseHttpService.api({
783
+ url: `${this.serviceUrl}/tags`,
784
+ method: 'get',
785
+ });
786
+ }
787
+ fetchObjectParentIdFields$(objectName) {
788
+ return this.baseHttpService.api({
789
+ url: `${this.serviceUrl}/parent-id-fields/${objectName}`,
790
+ method: 'get',
791
+ });
792
+ }
793
+ }
794
+ FunctionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
795
+ FunctionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService });
796
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, decorators: [{
797
+ type: Injectable
798
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
799
+
800
+ class GuidedSellingsAdminApiService {
801
+ constructor(baseHttpService) {
802
+ this.baseHttpService = baseHttpService;
803
+ this.serviceUrl = '/admin/v2/guided-selling';
804
+ this.fetchGuidedSellings$ = (searchParams) => {
805
+ return this.searchGuidedSellings$(searchParams);
806
+ };
807
+ this.searchGuidedSellings$ = (searchParams, expression) => {
808
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
809
+ return this.baseHttpService.api({
810
+ method: 'post',
811
+ url: `${this.serviceUrl}/search`,
812
+ params,
813
+ body: expression || {},
814
+ });
815
+ };
816
+ this.fetchGuidedSelling$ = (id) => {
817
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
818
+ };
819
+ this.createNewGuidedSelling$ = (guidedSelling) => {
820
+ return this.baseHttpService.api({
821
+ url: `${this.serviceUrl}`,
822
+ method: 'post',
823
+ body: guidedSelling,
824
+ });
825
+ };
826
+ this.duplicateGuidedSelling$ = (cloneRequest) => {
827
+ return this.baseHttpService.api({
828
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
829
+ method: 'post',
830
+ body: cloneRequest,
831
+ });
832
+ };
833
+ this.updateGuidedSelling$ = (data) => {
834
+ return this.baseHttpService.api({
835
+ url: `${this.serviceUrl}/${data.id}`,
836
+ method: 'put',
837
+ body: data,
838
+ });
839
+ };
840
+ this.removeGuidedSelling$ = (id) => {
841
+ return this.baseHttpService.api({
842
+ url: `${this.serviceUrl}/${id}`,
843
+ method: 'delete',
844
+ });
845
+ };
846
+ this.restoreGuidedSelling$ = (id) => {
847
+ return this.baseHttpService.api({
848
+ url: `${this.serviceUrl}/${id}/restore`,
849
+ method: 'patch',
850
+ });
851
+ };
852
+ }
853
+ }
854
+ GuidedSellingsAdminApiService.MAX_RESULTS = 60;
855
+ GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
856
+ GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService });
857
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
858
+ type: Injectable
859
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
860
+
861
+ class GuidedSellingApiService {
862
+ constructor(http) {
863
+ this.http = http;
864
+ this.serviceUrl = '/v2/guided-selling';
865
+ }
866
+ searchByName$(name, searchParams) {
867
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
868
+ const expression = new Expression(undefined, [{ key: 'name', operator: Operator.EQ, value: name }]);
869
+ return this.http.api({
870
+ method: 'post',
871
+ url: `${this.serviceUrl}/search`,
872
+ params,
873
+ body: expression || {},
874
+ });
875
+ }
876
+ searchById$(id, searchParams) {
877
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
878
+ const expression = new Expression(undefined, [{ key: 'id', operator: Operator.EQ, value: id }]);
879
+ return this.http.api({
880
+ method: 'post',
881
+ url: `${this.serviceUrl}/search`,
882
+ params,
883
+ body: expression || {},
884
+ });
885
+ }
886
+ }
887
+ GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
888
+ GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService });
889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, decorators: [{
890
+ type: Injectable
891
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
892
+
893
+ class OrchestrationsAdminApiService {
894
+ constructor(baseHttpService) {
895
+ this.baseHttpService = baseHttpService;
896
+ this.SERVICE_URL = '/admin/v2/orchestrations';
897
+ this.fetchAll$ = () => {
898
+ return this.search$(new Expression(), 0, 100);
899
+ };
900
+ this.search$ = (expression, skip, count) => {
901
+ let params = new HttpParams();
902
+ params = params.set('skip', '' + skip);
903
+ params = params.set('count', '' + count);
904
+ return this.baseHttpService.api({
905
+ method: 'post',
906
+ url: `${this.SERVICE_URL}/search`,
907
+ params,
908
+ body: expression,
909
+ });
910
+ };
911
+ this.create$ = (newProcedure) => {
912
+ return this.baseHttpService.api({
913
+ url: `${this.SERVICE_URL}`,
914
+ method: 'post',
915
+ body: newProcedure,
916
+ });
917
+ };
918
+ this.update$ = (procedure) => {
919
+ return this.baseHttpService.api({
920
+ url: `${this.SERVICE_URL}/${procedure.id}`,
921
+ method: 'put',
922
+ body: procedure,
923
+ });
924
+ };
925
+ this.duplicate$ = (body) => {
926
+ return this.baseHttpService
927
+ .api({
928
+ url: `${this.SERVICE_URL}/${body.id}/clone`,
929
+ method: 'post',
930
+ body,
931
+ })
932
+ .pipe(map$1(response => response.clonedRecordId));
933
+ };
934
+ this.remove$ = (id) => {
935
+ return this.baseHttpService.api({
936
+ url: `${this.SERVICE_URL}/${id}`,
937
+ method: 'delete',
938
+ });
939
+ };
940
+ this.restore$ = (id) => {
941
+ return this.baseHttpService.api({
942
+ url: `${this.SERVICE_URL}/${id}/restore`,
943
+ method: 'patch',
944
+ });
945
+ };
946
+ }
947
+ fetch$(id) {
948
+ return this.baseHttpService.api({
949
+ url: `${this.SERVICE_URL}/${id}`,
950
+ method: 'get',
951
+ });
952
+ }
953
+ execute$(body) {
954
+ return this.baseHttpService.api({
955
+ url: `${this.SERVICE_URL}/execute`,
956
+ method: 'post',
957
+ body,
958
+ });
959
+ }
960
+ catalogExecute$(body) {
961
+ return this.baseHttpService.api({
962
+ url: `${this.SERVICE_URL}/catalog/execute`,
963
+ method: 'post',
964
+ body,
965
+ });
966
+ }
967
+ }
968
+ OrchestrationsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
969
+ OrchestrationsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService });
970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, decorators: [{
971
+ type: Injectable
972
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
973
+
974
+ class OrchestrationsApiService {
975
+ constructor(baseHttpService) {
976
+ this.baseHttpService = baseHttpService;
977
+ this.SERVICE_URL = '/v2/orchestrations';
978
+ }
979
+ apply$(request, options) {
980
+ return this.baseHttpService.api(Object.assign({ url: `${this.SERVICE_URL}/apply`, method: 'post', body: request }, options));
981
+ }
982
+ }
983
+ OrchestrationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
984
+ OrchestrationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService });
985
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, decorators: [{
986
+ type: Injectable
987
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
988
+
989
+ class SalesforceApiService {
990
+ constructor(httpService) {
991
+ this.httpService = httpService;
992
+ this.SERVICE_URL = '/v2/proxy';
993
+ }
994
+ query(searchRequest, objectName, options) {
995
+ 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));
996
+ }
997
+ queryObjects(search, options) {
998
+ let params = new HttpParams();
999
+ if (search) {
1000
+ params = params.append('search', search);
1001
+ }
1002
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/query`, params }, options));
1003
+ }
1004
+ search(req, options) {
1005
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest/search`, params: { q: req.searchString } }, options));
1006
+ }
1007
+ describeObject(objectName, options) {
1008
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1009
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
1010
+ }
1011
+ describeField(objectName, fieldName, options) {
1012
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
1013
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
1014
+ }
1015
+ describe2(objectName, fields, options) {
1016
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1017
+ return this.httpService.api(Object.assign({ method: 'post', url: methodUrl, body: fields }, options));
1018
+ }
1019
+ apexGetRequest(path, params, options) {
1020
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
1021
+ const httpParams = new HttpParams({ fromString: params.toString() });
1022
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams }, options));
1023
+ }
1024
+ apexPostRequest(path, body, options) {
1025
+ return this.httpService.api(Object.assign({ method: 'post', body, url: `${this.SERVICE_URL}/apex${path}` }, options));
1026
+ }
1027
+ restGetRequest(path, params, options) {
1028
+ const httpParams = new HttpParams({ fromString: params.toString() });
1029
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest${path}`, params: httpParams }, options));
1030
+ }
1031
+ getGlobalPicklists() {
1032
+ return this.httpService.api({
1033
+ method: 'get',
1034
+ url: `${this.SERVICE_URL}/globalvalueset`,
1035
+ });
1036
+ }
1037
+ getGlobalPicklistValues(id) {
1038
+ return this.httpService.api({
1039
+ method: 'get',
1040
+ url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
1041
+ });
1042
+ }
1043
+ }
1044
+ SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1045
+ SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
1046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
1047
+ type: Injectable
1048
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1049
+
1050
+ class PCMApiService {
1051
+ constructor(sfApiService) {
1052
+ this.sfApiService = sfApiService;
1053
+ }
1054
+ fetchPCMByProductId(productId) {
1055
+ return this.sfApiService.restGetRequest(`/connect/pcm/products/${productId}`, new HttpParams()).pipe(tap$1(response => {
1056
+ if (response.status.code !== '200') {
1057
+ throw new Error(response.status.message);
1058
+ }
1059
+ }), map$1(response => {
1060
+ const pcm = response.products[0];
1061
+ if (!pcm) {
1062
+ throw new Error('PCM product is not found');
1063
+ }
1064
+ this.fixUrls(pcm);
1065
+ return pcm;
1066
+ }));
1067
+ }
1068
+ fixUrls(product) {
1069
+ if (product.displayUrl) {
1070
+ product.displayUrl = product.displayUrl.replaceAll('&', '&');
1071
+ }
1072
+ product.productComponentGroups.forEach(group => {
1073
+ group.components.forEach(component => this.fixUrls(component));
1074
+ });
1075
+ }
1076
+ }
1077
+ PCMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, deps: [{ token: SalesforceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1078
+ PCMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService });
1079
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, decorators: [{
1080
+ type: Injectable
1081
+ }], ctorParameters: function () { return [{ type: SalesforceApiService }]; } });
1082
+
1083
+ class PicklistsAdminApiService {
1084
+ constructor(baseHttpService) {
1085
+ this.baseHttpService = baseHttpService;
1086
+ this.serviceUrl = '/admin/v2/picklists';
1087
+ this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}` });
1088
+ this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/${code}` });
1089
+ this.createPicklist$ = (picklist) => {
1090
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}`, body: picklist });
1091
+ };
1092
+ this.updatePicklist$ = (picklist) => {
1093
+ return this.baseHttpService.api({
1094
+ method: 'put',
1095
+ url: `${this.serviceUrl}/${picklist.id}`,
1096
+ body: picklist,
1097
+ });
1098
+ };
1099
+ this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/${id}` });
1100
+ this.restorePicklist$ = (id) => {
1101
+ return this.baseHttpService.api({
1102
+ url: `${this.serviceUrl}/${id}/restore`,
1103
+ method: 'patch',
1104
+ });
1105
+ };
1106
+ this.addPicklistValue$ = (picklist, value) => {
1107
+ const data = Object.assign(Object.assign({}, picklist), { values: [...picklist.values, value] });
1108
+ return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/${picklist.id}`, body: data });
1109
+ };
1110
+ }
1111
+ }
1112
+ PicklistsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1113
+ PicklistsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService });
1114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, decorators: [{
1115
+ type: Injectable
1116
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1117
+
1118
+ class ProductsAdminApiService {
1119
+ constructor(baseHttpService) {
1120
+ this.baseHttpService = baseHttpService;
1121
+ this.serviceUrl = '/admin/v2/products';
1122
+ this.fetchProducts$ = (payload) => {
1123
+ let params = new HttpParams();
1124
+ params = params.append('count', payload.count);
1125
+ params = params.append('skip', payload.skip);
1126
+ if (payload.name) {
1127
+ params = params.append('name', payload.name);
1128
+ }
1129
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1130
+ };
1131
+ this.searchProducts$ = (expression, skip, count) => {
1132
+ let params = new HttpParams();
1133
+ params = params.set('skip', '' + skip);
1134
+ params = params.set('count', '' + count);
1135
+ return this.baseHttpService.api({
1136
+ method: 'post',
1137
+ url: `${this.serviceUrl}/search`,
1138
+ params: params,
1139
+ body: expression,
1140
+ });
1141
+ };
1142
+ this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1143
+ this.createNewProduct$ = (productData) => {
1144
+ return this.baseHttpService.api({
1145
+ url: `${this.serviceUrl}`,
1146
+ method: 'post',
1147
+ body: productData,
1148
+ });
1149
+ };
1150
+ this.updateProduct$ = (body) => {
1151
+ return this.baseHttpService.api({
1152
+ url: `${this.serviceUrl}/${body.id}`,
1153
+ method: 'put',
1154
+ body,
1155
+ });
1156
+ };
1157
+ this.removeProduct$ = (id) => {
1158
+ return this.baseHttpService.api({
1159
+ url: `${this.serviceUrl}/${id}`,
1160
+ method: 'delete',
1161
+ });
1162
+ };
1163
+ this.restoreProduct$ = (id) => {
1164
+ return this.baseHttpService.api({
1165
+ url: `${this.serviceUrl}/${id}/restore`,
1166
+ method: 'patch',
1167
+ });
1168
+ };
1169
+ }
1170
+ attachImage$(productId, file) {
1171
+ const data = new FormData();
1172
+ data.append('image', file);
1173
+ return this.baseHttpService.upload({
1174
+ method: 'post',
1175
+ url: `${this.serviceUrl}/${productId}/image`,
1176
+ body: data,
1177
+ });
1178
+ }
1179
+ removeImage$(productId) {
1180
+ return this.baseHttpService.api({
1181
+ method: 'delete',
1182
+ url: `${this.serviceUrl}/${productId}/image`,
1183
+ });
1184
+ }
1185
+ fetchImage$(productId) {
1186
+ return this.baseHttpService.api({
1187
+ url: this.getImageUrl(productId),
1188
+ method: 'get',
1189
+ responseType: 'blob',
1190
+ errorHandler: noop,
1191
+ });
1192
+ }
1193
+ getImageUrl(productId) {
1194
+ return `${this.serviceUrl}/${productId}/image`;
1195
+ }
1196
+ }
1197
+ ProductsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1198
+ ProductsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService });
1199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, decorators: [{
1200
+ type: Injectable
1201
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1202
+
1203
+ class SalesTransactionApiService {
1204
+ constructor(httpService) {
1205
+ this.httpService = httpService;
1206
+ this.SERVICE_URL = '/v2/transactions';
1207
+ }
1208
+ /**
1209
+ * This endpoint doesn't include orders and assets
1210
+ * @param objectId SF record ID (quoteId | accountId | opportunityId | orderId etc)
1211
+ * @param params Query params
1212
+ * @param options Request options
1213
+ */
1214
+ getState(objectId, params, options) {
1215
+ return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}/${objectId}`, params: params }, options));
1216
+ }
1217
+ upsert(request, options) {
1218
+ return of({
1219
+ id: 'ID',
1220
+ });
1221
+ // return this.httpService.api({
1222
+ // method: 'post',
1223
+ // url: `${this.SERVICE_URL}`,
1224
+ // body: request,
1225
+ // ...options,
1226
+ // });
1227
+ }
1228
+ submit(request, options) {
1229
+ return of({
1230
+ id: 'ID',
1231
+ });
1232
+ // return this.httpService.api({
1233
+ // method: 'post',
1234
+ // url: `${this.SERVICE_URL}`,
1235
+ // body: request,
1236
+ // ...options,
1237
+ // });
1238
+ }
1239
+ }
1240
+ SalesTransactionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1241
+ SalesTransactionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService });
1242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionApiService, decorators: [{
1243
+ type: Injectable
1244
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1245
+
1246
+ class ShoppingCartSettingsApiService {
1247
+ constructor(configurationSettingsApiService) {
1248
+ this.configurationSettingsApiService = configurationSettingsApiService;
1249
+ this.shoppingCartSettingsKey = 'shopping-cart';
1250
+ }
1251
+ getSetting(id) {
1252
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map(settings => settings.find(setting => setting.id == id)));
1253
+ }
1254
+ fetchSettings() {
1255
+ return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
1256
+ }
1257
+ getSettingsMap() {
1258
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map((settings) => settings.reduce((acc, setting) => {
1259
+ return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
1260
+ }, {})));
1261
+ }
1262
+ }
1263
+ ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1264
+ ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
1265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
1266
+ type: Injectable
1267
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
1268
+
1269
+ function uiDefinitionFromDTO(container) {
1270
+ const { sourceBlob } = container, rest = __rest(container, ["sourceBlob"]);
1271
+ return Object.assign(Object.assign({}, rest), { source: parseJsonStringAsObject(sourceBlob) });
1272
+ }
1273
+ function uiDefinitionToDTO(container) {
1274
+ const { source } = container, rest = __rest(container, ["source"]);
1275
+ return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
1276
+ }
1277
+ function newUiDefinitionToDTO(container) {
1278
+ const { source } = container, rest = __rest(container, ["source"]);
1279
+ return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
1280
+ }
1281
+
1282
+ class UIDefinitionsAdminApiService {
1283
+ constructor(baseHttpService) {
1284
+ this.baseHttpService = baseHttpService;
1285
+ this.serviceUrl = '/admin/v2/uidefinitions';
1286
+ }
1287
+ fetchAll$(params) {
1288
+ let httpParams = new HttpParams();
1289
+ if ((params === null || params === void 0 ? void 0 : params.productId) != null) {
1290
+ httpParams = httpParams.set('productId', params.productId);
1291
+ }
1292
+ if ((params === null || params === void 0 ? void 0 : params.defaultUIDefinitionId) != null) {
1293
+ httpParams = httpParams.set('defaultUIDefinitionId', params.defaultUIDefinitionId);
1294
+ }
1295
+ return this.baseHttpService
1296
+ .api({
1297
+ method: 'get',
1298
+ url: this.serviceUrl,
1299
+ params: httpParams,
1300
+ })
1301
+ .pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
1302
+ }
1303
+ fetch$(id) {
1304
+ return this.baseHttpService
1305
+ .api({
1306
+ method: 'get',
1307
+ url: `${this.serviceUrl}/${id}`,
1308
+ })
1309
+ .pipe(map$1(container => uiDefinitionFromDTO(Object.assign(Object.assign({}, container), { id }))));
1310
+ }
1311
+ create$(uiDefinitionContainer) {
1312
+ const dto = newUiDefinitionToDTO(uiDefinitionContainer);
1313
+ return this.baseHttpService
1314
+ .api({
1315
+ method: 'post',
1316
+ url: this.serviceUrl,
1317
+ body: dto,
1318
+ })
1319
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
1320
+ }
1321
+ update$(uiDefinitionContainer) {
1322
+ const dto = uiDefinitionToDTO(uiDefinitionContainer);
1323
+ return this.baseHttpService
1324
+ .api({
1325
+ method: 'put',
1326
+ url: `${this.serviceUrl}/${uiDefinitionContainer.id}`,
1327
+ body: dto,
1328
+ })
1329
+ .pipe(map$1(container => uiDefinitionFromDTO(container)));
1330
+ }
1331
+ delete$(id) {
1332
+ return this.baseHttpService.api({
1333
+ method: 'delete',
1334
+ url: `${this.serviceUrl}/${id}`,
1335
+ });
1336
+ }
1337
+ }
1338
+ UIDefinitionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1339
+ UIDefinitionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService });
1340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, decorators: [{
1341
+ type: Injectable
1342
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1343
+
1344
+ const fromUIComponentStoryDTO = (dto, attachments) => {
1345
+ return {
1346
+ id: dto.id,
1347
+ name: dto.name,
1348
+ uiComponentId: dto.uiComponentId,
1349
+ description: dto.description,
1350
+ section: attachments.json,
1351
+ template: attachments.html,
1352
+ script: attachments.js,
1353
+ styles: attachments.css,
1354
+ };
1355
+ };
1356
+
1357
+ class UITemplatesAdminApiService {
1358
+ constructor(baseHttpService) {
1359
+ this.baseHttpService = baseHttpService;
1360
+ this.serviceUrl = '/admin/v2/uitemplates';
1361
+ this.fetchTemplates$ = (name) => {
1362
+ let params = new HttpParams();
1363
+ if (name) {
1364
+ params = params.append('name', name);
1365
+ }
1366
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1367
+ };
1368
+ this.createTemplate$ = (template) => {
1369
+ return this.baseHttpService.api({
1370
+ method: 'post',
1371
+ url: `${this.serviceUrl}`,
1372
+ body: template,
1373
+ });
1374
+ };
1375
+ this.updateTemplate$ = (template) => {
1376
+ return this.baseHttpService.api({
1377
+ method: 'put',
1378
+ url: `${this.serviceUrl}/${template.id}`,
1379
+ body: template,
1380
+ });
1381
+ };
1382
+ this.duplicateTemplate$ = (template, cloneRequest) => {
1383
+ return this.baseHttpService
1384
+ .api({
1385
+ url: `${this.serviceUrl}/${template.id}/clone`,
1386
+ method: 'post',
1387
+ body: cloneRequest,
1388
+ })
1389
+ .pipe(map$1(response => response.clonedRecordId));
1390
+ };
1391
+ this.removeTemplate$ = (id) => {
1392
+ return this.baseHttpService.api({
1393
+ method: 'delete',
1394
+ url: `${this.serviceUrl}/${id}`,
1395
+ });
1396
+ };
1397
+ this.restoreTemplate$ = (id) => {
1398
+ return this.baseHttpService.api({
1399
+ method: 'patch',
1400
+ url: `${this.serviceUrl}/${id}`,
1401
+ });
1402
+ };
1403
+ this.searchTemplates$ = (data) => {
1404
+ return this.baseHttpService.api({
1405
+ method: 'post',
1406
+ url: `${this.serviceUrl}/search`,
1407
+ params: data.params,
1408
+ body: data.expression,
1409
+ });
1410
+ };
1411
+ this.fetchComponents$ = (templateId, name) => {
1412
+ let params = new HttpParams();
1413
+ if (name) {
1414
+ params = params.append('name', name);
1415
+ }
1416
+ return this.baseHttpService.api({
1417
+ url: `${this.serviceUrl}/${templateId}/components`,
1418
+ params,
1419
+ });
1420
+ };
1421
+ this.fetchComponent$ = (templateId, componentId) => {
1422
+ return this.baseHttpService.api({
1423
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1424
+ });
1425
+ };
1426
+ this.createComponent$ = (component) => {
1427
+ return this.baseHttpService.api({
1428
+ method: 'post',
1429
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components`,
1430
+ body: component,
1431
+ });
1432
+ };
1433
+ this.updateComponent$ = (component) => {
1434
+ return this.baseHttpService.api({
1435
+ method: 'put',
1436
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}`,
1437
+ body: component,
1438
+ });
1439
+ };
1440
+ this.duplicateComponent$ = (component, cloneRequest) => {
1441
+ return this.baseHttpService
1442
+ .api({
1443
+ url: `${this.serviceUrl}/${component.uiTemplateId}/components/${component.id}/clone`,
1444
+ method: 'post',
1445
+ body: cloneRequest,
1446
+ })
1447
+ .pipe(map$1(response => response.clonedRecordId));
1448
+ };
1449
+ this.removeComponent$ = (templateId, componentId) => {
1450
+ return this.baseHttpService.api({
1451
+ method: 'delete',
1452
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1453
+ });
1454
+ };
1455
+ this.restoreComponent$ = (templateId, componentId) => {
1456
+ return this.baseHttpService.api({
1457
+ method: 'patch',
1458
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}`,
1459
+ });
1460
+ };
1461
+ this.searchComponents$ = (templateId, data) => {
1462
+ return this.baseHttpService.api({
1463
+ method: 'post',
1464
+ url: `${this.serviceUrl}/${templateId}/components/search`,
1465
+ params: data.params,
1466
+ body: data.expression,
1467
+ });
1468
+ };
1469
+ this.fetchStoryAttachment = (templateId, componentId, storyId, type) => {
1470
+ return this.baseHttpService
1471
+ .api({
1472
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments/${type}/file`,
1473
+ responseType: 'text',
1474
+ errorHandler: noop,
1475
+ })
1476
+ .pipe(catchError$1(() => of('')));
1477
+ };
1478
+ this.convertToComponentStory$ = (templateId, componentId, storyDto) => {
1479
+ return forkJoin([
1480
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'html'),
1481
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'js'),
1482
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'css'),
1483
+ this.fetchStoryAttachment(templateId, componentId, storyDto.id, 'json'),
1484
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })), map$1(attachments => fromUIComponentStoryDTO(storyDto, attachments)));
1485
+ };
1486
+ this.fetchStories$ = (templateId, componentId, name) => {
1487
+ let params = new HttpParams();
1488
+ if (name) {
1489
+ params = params.append('name', name);
1490
+ }
1491
+ return this.baseHttpService
1492
+ .api({
1493
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories`,
1494
+ params,
1495
+ })
1496
+ .pipe(switchMap(dtos => {
1497
+ if (!dtos.length) {
1498
+ return of([]);
1499
+ }
1500
+ return forkJoin(dtos.map(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1501
+ }));
1502
+ };
1503
+ this.fetchStory$ = (templateId, componentId, storyId) => {
1504
+ return this.baseHttpService
1505
+ .api({
1506
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1507
+ })
1508
+ .pipe(switchMap(dto => this.convertToComponentStory$(templateId, componentId, dto)));
1509
+ };
1510
+ this.createComponentStory$ = (templateId, story) => {
1511
+ return this.baseHttpService.api({
1512
+ method: 'post',
1513
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories`,
1514
+ body: story,
1515
+ });
1516
+ };
1517
+ this.updateComponentStory$ = (templateId, story) => {
1518
+ const { script, template, styles, section } = story, rest = __rest(story, ["script", "template", "styles", "section"]);
1519
+ return this.baseHttpService
1520
+ .api({
1521
+ method: 'put',
1522
+ url: `${this.serviceUrl}/${templateId}/components/${story.uiComponentId}/stories/${story.id}`,
1523
+ body: rest,
1524
+ })
1525
+ .pipe(map$1(dto => fromUIComponentStoryDTO(dto, { html: template, js: script, css: styles, json: section })));
1526
+ };
1527
+ this.duplicateComponentStory$ = (story, cloneRequest) => {
1528
+ return this.baseHttpService
1529
+ .api({
1530
+ url: `${this.serviceUrl}/${story.template}/components/${story.uiComponentId}/stories/${story.id}/clone`,
1531
+ method: 'post',
1532
+ body: cloneRequest,
1533
+ })
1534
+ .pipe(map$1(response => response.clonedRecordId));
1535
+ };
1536
+ this.deleteComponentStory$ = (templateId, componentId, storyId) => {
1537
+ return this.baseHttpService.api({
1538
+ method: 'delete',
1539
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1540
+ });
1541
+ };
1542
+ this.restoreComponentStory$ = (templateId, componentId, storyId) => {
1543
+ return this.baseHttpService.api({
1544
+ method: 'patch',
1545
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}`,
1546
+ });
1547
+ };
1548
+ this.uploadStoryAttachments$ = (templateId, componentId, storyId, attachments) => {
1549
+ const formData = new FormData();
1550
+ if (attachments.html != null) {
1551
+ formData.append('html', new Blob([attachments.html]), 'story-template.html');
1552
+ }
1553
+ if (attachments.css != null) {
1554
+ formData.append('css', new Blob([attachments.css]), 'story-styles.css');
1555
+ }
1556
+ if (attachments.js != null) {
1557
+ formData.append('js', new Blob([attachments.js]), 'story-script.js');
1558
+ }
1559
+ if (attachments.json != null) {
1560
+ formData.append('json', new Blob([attachments.json]), 'story-section.json');
1561
+ }
1562
+ return this.baseHttpService.upload({
1563
+ method: 'post',
1564
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/stories/${storyId}/attachments`,
1565
+ body: formData,
1566
+ });
1567
+ };
1568
+ this.fetchComponentAttachments$ = (templateId, component) => {
1569
+ return forkJoin([
1570
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'html'),
1571
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'js'),
1572
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'css'),
1573
+ this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
1574
+ ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
1575
+ };
1576
+ this.fetchComponentsAttachments$ = (templateId) => {
1577
+ return this.fetchComponents$(templateId).pipe(switchMap(components => {
1578
+ return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
1579
+ }));
1580
+ };
1581
+ this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
1582
+ return this.baseHttpService
1583
+ .api({
1584
+ method: 'get',
1585
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments/${attachmentType}/file`,
1586
+ responseType: 'text',
1587
+ errorHandler: noop,
1588
+ })
1589
+ .pipe(catchError$1(() => of('')));
1590
+ };
1591
+ this.uploadComponentAttachments$ = (templateId, componentId, attachments) => {
1592
+ const formData = new FormData();
1593
+ if (attachments.html != null) {
1594
+ formData.append('html', new Blob([attachments.html]), 'template.html');
1595
+ }
1596
+ if (attachments.css != null) {
1597
+ formData.append('css', new Blob([attachments.css]), 'styles.css');
1598
+ }
1599
+ if (attachments.js != null) {
1600
+ formData.append('js', new Blob([attachments.js]), 'script.js');
1601
+ }
1602
+ if (attachments.json != null) {
1603
+ formData.append('json', new Blob([attachments.json]), 'section.json');
1604
+ }
1605
+ return this.baseHttpService.upload({
1606
+ method: 'post',
1607
+ url: `${this.serviceUrl}/${templateId}/components/${componentId}/attachments`,
1608
+ body: formData,
1609
+ });
1610
+ };
1611
+ }
1612
+ getTemplateThumbnailUrl(templateId) {
1613
+ return `${this.serviceUrl}/${templateId}/thumbnail/file`;
1614
+ }
1615
+ attachTemplateThumbnail$(templateId, file) {
1616
+ const data = new FormData();
1617
+ data.append('thumb', file);
1618
+ return this.baseHttpService.upload({
1619
+ method: 'post',
1620
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
1621
+ body: data,
1622
+ });
1623
+ }
1624
+ removeTemplateThumbnail$(templateId) {
1625
+ return this.baseHttpService.api({
1626
+ method: 'delete',
1627
+ url: `${this.serviceUrl}/${templateId}/thumbnail`,
1628
+ });
1629
+ }
1630
+ }
1631
+ UITemplatesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1632
+ UITemplatesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService });
1633
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, decorators: [{
1634
+ type: Injectable
1635
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1636
+
1637
+ class VeloceObjectsAdminApiService {
1638
+ constructor(baseHttpService) {
1639
+ this.baseHttpService = baseHttpService;
1640
+ this.serviceUrl = '/admin/v2/veloceobjects';
1641
+ this.updateCategory$ = (category) => {
1642
+ return this.baseHttpService.api({
1643
+ method: 'put',
1644
+ url: `${this.serviceUrl}/categories/${category.id}`,
1645
+ body: category,
1646
+ });
1647
+ };
1648
+ this.deleteCategory$ = (id) => {
1649
+ return this.baseHttpService.api({
1650
+ method: 'delete',
1651
+ url: `${this.serviceUrl}/categories/${id}`,
1652
+ });
1653
+ };
1654
+ this.searchObjects$ = (searchParams, expression) => {
1655
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
1656
+ return this.baseHttpService.api({
1657
+ method: 'post',
1658
+ url: `${this.serviceUrl}/search`,
1659
+ params,
1660
+ body: expression || {},
1661
+ });
1662
+ };
1663
+ this.deleteObject$ = (id) => {
1664
+ return this.baseHttpService.api({
1665
+ method: 'delete',
1666
+ url: `${this.serviceUrl}/${id}`,
1667
+ });
1668
+ };
1669
+ this.duplicateObject$ = (body) => {
1670
+ return this.baseHttpService
1671
+ .api({
1672
+ method: 'post',
1673
+ url: `${this.serviceUrl}/${body.id}/clone`,
1674
+ body,
1675
+ })
1676
+ .pipe(map(response => response.clonedRecordId));
1677
+ };
1678
+ this.restoreObject$ = (id) => {
1679
+ return this.baseHttpService.api({
1680
+ method: 'patch',
1681
+ url: `${this.serviceUrl}/${id}/restore`,
1682
+ });
1683
+ };
1684
+ }
1685
+ fetchCategories$() {
1686
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
1687
+ }
1688
+ createCategory$(category) {
1689
+ return this.baseHttpService.api({
1690
+ method: 'post',
1691
+ url: `${this.serviceUrl}/categories`,
1692
+ body: category,
1693
+ });
1694
+ }
1695
+ fetchObjects$() {
1696
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
1697
+ }
1698
+ fetchObject$(id) {
1699
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1700
+ }
1701
+ createObject$(object) {
1702
+ return this.baseHttpService.api({
1703
+ method: 'post',
1704
+ url: `${this.serviceUrl}`,
1705
+ body: object,
1706
+ });
1707
+ }
1708
+ updateObject$(object) {
1709
+ return this.baseHttpService.api({
1710
+ method: 'put',
1711
+ url: `${this.serviceUrl}/${object.id}`,
1712
+ body: object,
1713
+ });
1714
+ }
1715
+ }
1716
+ VeloceObjectsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1717
+ VeloceObjectsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService });
1718
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, decorators: [{
1719
+ type: Injectable
1720
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1721
+
1722
+ class ApiV2Module {
1723
+ }
1724
+ ApiV2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1725
+ ApiV2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, imports: [HttpClientModule] });
1726
+ ApiV2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, providers: [
1727
+ BaseHttpService,
1728
+ CacheApiService,
1729
+ CatalogAdminApiService,
1730
+ CatalogApiService,
1731
+ ConfigurationProcessorsApiService,
1732
+ ConfigurationSettingsApiService,
1733
+ ContextDefinitionAdminApiService,
1734
+ DocumentAttachmentApiService,
1735
+ EndpointsAdminApiService,
1736
+ FlowsApiService,
1737
+ FunctionGroupsAdminApiService,
1738
+ OrchestrationsAdminApiService,
1739
+ OrchestrationsApiService,
1740
+ PCMApiService,
1741
+ PicklistsAdminApiService,
1742
+ ProductsAdminApiService,
1743
+ FunctionsAdminApiService,
1744
+ GuidedSellingsAdminApiService,
1745
+ GuidedSellingApiService,
1746
+ SalesforceApiService,
1747
+ SalesTransactionApiService,
1748
+ ShoppingCartSettingsApiService,
1749
+ UIDefinitionsAdminApiService,
1750
+ UITemplatesAdminApiService,
1751
+ VeloceObjectsAdminApiService,
1752
+ XrayService,
1753
+ ], imports: [HttpClientModule] });
1754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, decorators: [{
1755
+ type: NgModule,
1756
+ args: [{
1757
+ imports: [HttpClientModule],
1758
+ providers: [
1759
+ BaseHttpService,
1760
+ CacheApiService,
1761
+ CatalogAdminApiService,
1762
+ CatalogApiService,
1763
+ ConfigurationProcessorsApiService,
1764
+ ConfigurationSettingsApiService,
1765
+ ContextDefinitionAdminApiService,
1766
+ DocumentAttachmentApiService,
1767
+ EndpointsAdminApiService,
1768
+ FlowsApiService,
1769
+ FunctionGroupsAdminApiService,
1770
+ OrchestrationsAdminApiService,
1771
+ OrchestrationsApiService,
1772
+ PCMApiService,
1773
+ PicklistsAdminApiService,
1774
+ ProductsAdminApiService,
1775
+ FunctionsAdminApiService,
1776
+ GuidedSellingsAdminApiService,
1777
+ GuidedSellingApiService,
1778
+ SalesforceApiService,
1779
+ SalesTransactionApiService,
1780
+ ShoppingCartSettingsApiService,
1781
+ UIDefinitionsAdminApiService,
1782
+ UITemplatesAdminApiService,
1783
+ VeloceObjectsAdminApiService,
1784
+ XrayService,
1785
+ ],
1786
+ }]
1787
+ }] });
1788
+
1789
+ /**
1790
+ * Generated bundle index. Do not edit.
1791
+ */
1792
+
1793
+ export { ApiV2Module, CacheApiService, CatalogAdminApiService, CatalogApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextDefinitionAdminApiService, DocumentAttachmentApiService, EndpointsAdminApiService, FlowsApiService, FunctionGroupsAdminApiService, FunctionsAdminApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OrchestrationsAdminApiService, OrchestrationsApiService, PCMApiService, PicklistsAdminApiService, ProductsAdminApiService, SalesTransactionApiService, SalesforceApiService, ShoppingCartSettingsApiService, UIDefinitionsAdminApiService, UITemplatesAdminApiService, VeloceObjectsAdminApiService };
1794
+ //# sourceMappingURL=veloceapps-api-v2.mjs.map