@veloceapps/api 11.0.0-7 → 11.0.0-70

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