@veloceapps/api 11.0.0-7 → 11.0.0-71

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