@veloceapps/api 11.0.0-5 → 11.0.0-51

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