@veloceapps/api 11.0.0-8 → 11.0.0-81

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