@veloceapps/api 11.0.0-5 → 11.0.0-50

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