@veloceapps/api 11.0.0-28 → 11.0.0-29

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 (88) hide show
  1. package/esm2020/src/index.mjs +1 -10
  2. package/esm2020/src/lib/api.module.mjs +1 -28
  3. package/esm2020/v2/api-v2.module.mjs +36 -20
  4. package/esm2020/v2/services/cache-api.service.mjs +22 -0
  5. package/esm2020/v2/services/configuration-processors-api.service.mjs +2 -2
  6. package/esm2020/v2/services/configuration-settings-api.service.mjs +89 -0
  7. package/esm2020/v2/services/context-definition-admin-api.service.mjs +65 -0
  8. package/esm2020/v2/services/endpoints-admin-api.service.mjs +79 -0
  9. package/esm2020/v2/services/flows-api.service.mjs +29 -0
  10. package/esm2020/v2/services/function-groups-admin-api.service.mjs +62 -0
  11. package/esm2020/v2/services/functions-admin-api.service.mjs +97 -0
  12. package/esm2020/v2/services/index.mjs +18 -10
  13. package/esm2020/v2/services/orchestrations-admin-api.service.mjs +87 -0
  14. package/esm2020/v2/services/orchestrations-api.service.mjs +23 -0
  15. package/esm2020/v2/services/pcm-api.service.mjs +29 -0
  16. package/esm2020/v2/services/picklists-admin-api.service.mjs +41 -0
  17. package/esm2020/v2/services/products-admin-api.service.mjs +90 -0
  18. package/esm2020/v2/services/sales-transactions-api.service.mjs +2 -2
  19. package/esm2020/v2/services/salesforce-api.service.mjs +83 -0
  20. package/esm2020/v2/services/scripts-admin-api.service.mjs +10 -2
  21. package/esm2020/v2/services/shopping-cart-settings-api.service.mjs +28 -0
  22. package/esm2020/v2/services/ui-definitions-admin-api.service.mjs +68 -0
  23. package/esm2020/v2/services/ui-templates-admin-api.service.mjs +286 -0
  24. package/esm2020/v2/services/veloce-objects-api.service.mjs +90 -0
  25. package/esm2020/v2/types/dto/configuration-settings-dto.types.mjs +22 -0
  26. package/esm2020/v2/types/index.mjs +2 -1
  27. package/esm2020/v2/types/pcm.types.mjs +2 -0
  28. package/esm2020/v2/types/search-request.types.mjs +2 -0
  29. package/fesm2015/veloceapps-api-v2.mjs +647 -189
  30. package/fesm2015/veloceapps-api-v2.mjs.map +1 -1
  31. package/fesm2015/veloceapps-api.mjs +16 -585
  32. package/fesm2015/veloceapps-api.mjs.map +1 -1
  33. package/fesm2020/veloceapps-api-v2.mjs +706 -192
  34. package/fesm2020/veloceapps-api-v2.mjs.map +1 -1
  35. package/fesm2020/veloceapps-api.mjs +16 -641
  36. package/fesm2020/veloceapps-api.mjs.map +1 -1
  37. package/package.json +1 -1
  38. package/src/index.d.ts +0 -9
  39. package/v2/services/cache-api.service.d.ts +11 -0
  40. package/{src/lib → v2}/services/configuration-settings-api.service.d.ts +1 -2
  41. package/v2/services/{context-definition-api.service.d.ts → context-definition-admin-api.service.d.ts} +3 -3
  42. package/{src/lib/services/endpoints-api.service.d.ts → v2/services/endpoints-admin-api.service.d.ts} +3 -4
  43. package/v2/services/function-groups-admin-api.service.d.ts +18 -0
  44. package/v2/services/functions-admin-api.service.d.ts +22 -0
  45. package/v2/services/index.d.ts +17 -9
  46. package/v2/services/orchestrations-admin-api.service.d.ts +21 -0
  47. package/v2/services/orchestrations-api.service.d.ts +12 -0
  48. package/{src/lib/services/picklists-api.service.d.ts → v2/services/picklists-admin-api.service.d.ts} +3 -3
  49. package/v2/services/products-admin-api.service.d.ts +21 -0
  50. package/v2/services/scripts-admin-api.service.d.ts +2 -1
  51. package/v2/services/{ui-definitions-api.service.d.ts → ui-definitions-admin-api.service.d.ts} +3 -3
  52. package/v2/services/{ui-templates-api.service.d.ts → ui-templates-admin-api.service.d.ts} +3 -3
  53. package/{src/lib → v2}/services/veloce-objects-api.service.d.ts +3 -3
  54. package/v2/types/index.d.ts +1 -0
  55. package/v2/types/search-request.types.d.ts +8 -0
  56. package/esm2020/src/lib/services/configuration-settings-api.service.mjs +0 -96
  57. package/esm2020/src/lib/services/endpoints-api.service.mjs +0 -80
  58. package/esm2020/src/lib/services/flows-api.service.mjs +0 -29
  59. package/esm2020/src/lib/services/pcm-api.service.mjs +0 -29
  60. package/esm2020/src/lib/services/picklists-api.service.mjs +0 -41
  61. package/esm2020/src/lib/services/product-api.service.mjs +0 -153
  62. package/esm2020/src/lib/services/salesforce-api.service.mjs +0 -83
  63. package/esm2020/src/lib/services/shopping-cart-settings-api.service.mjs +0 -28
  64. package/esm2020/src/lib/services/veloce-objects-api.service.mjs +0 -90
  65. package/esm2020/src/lib/types/dto/configuration-settings-dto.types.mjs +0 -22
  66. package/esm2020/src/lib/types/pcm.types.mjs +0 -2
  67. package/esm2020/v2/services/context-definition-api.service.mjs +0 -65
  68. package/esm2020/v2/services/procedures-admin-api.service.mjs +0 -82
  69. package/esm2020/v2/services/procedures-api.service.mjs +0 -44
  70. package/esm2020/v2/services/rule-groups-admin-api.service.mjs +0 -62
  71. package/esm2020/v2/services/rules-admin-api.service.mjs +0 -95
  72. package/esm2020/v2/services/rules-api.service.mjs +0 -36
  73. package/esm2020/v2/services/scripts-api.service.mjs +0 -23
  74. package/esm2020/v2/services/ui-definitions-api.service.mjs +0 -68
  75. package/esm2020/v2/services/ui-templates-api.service.mjs +0 -286
  76. package/src/lib/services/product-api.service.d.ts +0 -31
  77. package/v2/services/procedures-admin-api.service.d.ts +0 -23
  78. package/v2/services/procedures-api.service.d.ts +0 -15
  79. package/v2/services/rule-groups-admin-api.service.d.ts +0 -18
  80. package/v2/services/rules-admin-api.service.d.ts +0 -22
  81. package/v2/services/rules-api.service.d.ts +0 -11
  82. package/v2/services/scripts-api.service.d.ts +0 -11
  83. /package/{src/lib → v2}/services/flows-api.service.d.ts +0 -0
  84. /package/{src/lib → v2}/services/pcm-api.service.d.ts +0 -0
  85. /package/{src/lib → v2}/services/salesforce-api.service.d.ts +0 -0
  86. /package/{src/lib → v2}/services/shopping-cart-settings-api.service.d.ts +0 -0
  87. /package/{src/lib → v2}/types/dto/configuration-settings-dto.types.d.ts +0 -0
  88. /package/{src/lib → v2}/types/pcm.types.d.ts +0 -0
@@ -1,16 +1,32 @@
1
- import { HttpParams, HttpClientModule } from '@angular/common/http';
1
+ import { HttpErrorResponse, HttpParams, HttpClientModule } from '@angular/common/http';
2
2
  import * as i0 from '@angular/core';
3
3
  import { Injectable, NgModule } from '@angular/core';
4
4
  import * as i1 from '@veloceapps/core';
5
- import { Expression, RuleGroupTypes, parseJsonStringAsObject, BaseHttpService, XrayService } from '@veloceapps/core';
6
- import { of, map as map$1, noop, catchError as catchError$1, forkJoin, switchMap } from 'rxjs';
7
- import { catchError, map } from 'rxjs/operators';
5
+ import { Expression, RuleGroupTypes, parseJsonSafely, parseJsonStringAsObject, BaseHttpService, XrayService } from '@veloceapps/core';
6
+ import { of, map as map$1, tap, noop, catchError as catchError$1, forkJoin, switchMap } from 'rxjs';
7
+ import { map, catchError } from 'rxjs/operators';
8
+ import * as i2 from 'primeng/api';
8
9
  import { __rest } from 'tslib';
9
10
 
11
+ class CacheApiService {
12
+ constructor(httpService) {
13
+ this.httpService = httpService;
14
+ this.SERVICE_URL = '/services/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
+
10
26
  class ConfigurationProcessorsApiService {
11
27
  constructor(baseHttpService) {
12
28
  this.baseHttpService = baseHttpService;
13
- this.serviceUrl = '/v2/configuration/processors/owners';
29
+ this.serviceUrl = '/services/v2/configuration/processors/owners';
14
30
  this.fetchConfigurationProcessors$ = (ownerId) => {
15
31
  return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
16
32
  };
@@ -42,10 +58,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
42
58
  type: Injectable
43
59
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
44
60
 
45
- class ContextDefinitionApiService {
61
+ class ConfigurationSettingsDTO {
62
+ static fromDTO(dto, key) {
63
+ return {
64
+ id: dto === null || dto === void 0 ? void 0 : dto.id,
65
+ key: (dto === null || dto === void 0 ? void 0 : dto.key) || key || '',
66
+ value: dto === null || dto === void 0 ? void 0 : dto.value,
67
+ };
68
+ }
69
+ static toDTO(data) {
70
+ return {
71
+ id: data.id,
72
+ key: data.key,
73
+ value: data.value,
74
+ };
75
+ }
76
+ constructor(id, key, value) {
77
+ this.id = id;
78
+ this.key = key;
79
+ this.value = value;
80
+ }
81
+ }
82
+
83
+ class ConfigurationSettingsApiService {
84
+ constructor(httpService, messageService) {
85
+ this.httpService = httpService;
86
+ this.messageService = messageService;
87
+ this.SERVICE_URL = '/services/v2/settings';
88
+ }
89
+ fetchSettings(options) {
90
+ return this.httpService
91
+ .api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'get' }, options))
92
+ .pipe(map((settings) => settings.map(setting => ConfigurationSettingsDTO.fromDTO(setting))));
93
+ }
94
+ fetchSetting(settingsKey, options) {
95
+ return this.httpService
96
+ .api(Object.assign(Object.assign({ url: `${this.SERVICE_URL}/byKey/${settingsKey}`, method: 'get' }, options), { skipErrorHandler: true }))
97
+ .pipe(map((setting) => ConfigurationSettingsDTO.fromDTO(setting, settingsKey)), catchError(err => {
98
+ if (err instanceof HttpErrorResponse && err.status === 404) {
99
+ if (!(options === null || options === void 0 ? void 0 : options.skipErrorHandler)) {
100
+ this.messageService.add({
101
+ severity: 'error',
102
+ summary: `Configuration Setting "${settingsKey}" is not found`,
103
+ sticky: true,
104
+ });
105
+ }
106
+ return of(null);
107
+ }
108
+ throw err;
109
+ }));
110
+ }
111
+ createSetting(setting, options) {
112
+ const request = ConfigurationSettingsDTO.toDTO(setting);
113
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}`, method: 'post', body: Object.assign({}, request) }, options));
114
+ }
115
+ updateSetting(setting, options) {
116
+ const request = ConfigurationSettingsDTO.toDTO(setting);
117
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'put', body: Object.assign({}, request) }, options));
118
+ }
119
+ removeSetting(setting, options) {
120
+ const request = ConfigurationSettingsDTO.toDTO(setting);
121
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${request.id}`, method: 'delete' }, options));
122
+ }
123
+ restoreSetting(settingId, options) {
124
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${settingId}/restore`, method: 'patch' }, options));
125
+ }
126
+ }
127
+ 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 });
128
+ ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
130
+ type: Injectable
131
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i2.MessageService }]; } });
132
+
133
+ class ContextDefinitionAdminApiService {
46
134
  constructor(baseHttpService) {
47
135
  this.baseHttpService = baseHttpService;
48
- this.serviceUrl = '/v2/context-definition';
136
+ this.serviceUrl = '/admin/v2/context-definition';
49
137
  }
50
138
  fetchContextDefinitions$() {
51
139
  return this.baseHttpService.api({ url: `${this.serviceUrl}`, skipErrorHandler: true }).pipe(catchError(() => {
@@ -98,152 +186,139 @@ class ContextDefinitionApiService {
98
186
  });
99
187
  }
100
188
  }
101
- ContextDefinitionApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
102
- ContextDefinitionApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionApiService });
103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionApiService, decorators: [{
189
+ ContextDefinitionAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
190
+ ContextDefinitionAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService });
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextDefinitionAdminApiService, decorators: [{
104
192
  type: Injectable
105
193
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
106
194
 
107
- class ProceduresAdminApiService {
195
+ class EndpointsAdminApiService {
108
196
  constructor(baseHttpService) {
109
197
  this.baseHttpService = baseHttpService;
110
- this.SERVICE_URL = '/v2/admin/procedures';
111
- this.fetchProcedures$ = () => {
112
- return this.searchProcedures$(new Expression(), 0, 100);
113
- };
114
- this.searchProcedures$ = (expression, skip, count) => {
115
- let params = new HttpParams();
116
- params = params.set('skip', '' + skip);
117
- params = params.set('count', '' + count);
118
- return this.baseHttpService.api({
119
- method: 'post',
120
- url: `${this.SERVICE_URL}/search`,
121
- params,
122
- body: expression,
123
- });
124
- };
125
- this.createProcedure$ = (newProcedure) => {
126
- return this.baseHttpService.api({
127
- url: `${this.SERVICE_URL}`,
128
- method: 'post',
129
- body: newProcedure,
130
- });
131
- };
132
- this.updateProcedure$ = (procedure) => {
133
- return this.baseHttpService.api({
134
- url: `${this.SERVICE_URL}/${procedure.id}`,
135
- method: 'put',
136
- body: procedure,
137
- });
138
- };
139
- this.duplicateProcedure$ = (body) => {
140
- return this.baseHttpService
141
- .api({
142
- url: `${this.SERVICE_URL}/${body.id}/clone`,
143
- method: 'post',
144
- body,
145
- })
146
- .pipe(map$1(response => response.clonedRecordId));
147
- };
148
- this.removeProcedure$ = (id) => {
149
- return this.baseHttpService.api({
150
- url: `${this.SERVICE_URL}/${id}`,
151
- method: 'delete',
152
- });
153
- };
154
- this.restoreProcedure$ = (id) => {
155
- return this.baseHttpService.api({
156
- url: `${this.SERVICE_URL}/${id}/restore`,
157
- method: 'patch',
158
- });
159
- };
198
+ this.serviceUrl = '/admin/v2/api-endpoints';
199
+ }
200
+ fetchEndpoints$() {
201
+ return this.searchEndpoints$(new Expression(), 0, -1);
160
202
  }
161
- fetchProcedure$(id) {
203
+ searchEndpoints$(expression, skip, count) {
204
+ let params = new HttpParams();
205
+ params = params.set('skip', '' + skip);
206
+ params = params.set('count', '' + count);
162
207
  return this.baseHttpService.api({
163
- url: `${this.SERVICE_URL}/${id}`,
164
- method: 'get',
208
+ method: 'post',
209
+ url: `${this.serviceUrl}/search`,
210
+ params,
211
+ body: expression,
165
212
  });
166
213
  }
167
- /**
168
- * @deprecated
169
- */
170
- fetchDefaultPricingSteps$() {
214
+ removeEndpoint$(id) {
171
215
  return this.baseHttpService.api({
172
- url: `/admin/procedures/pricing-steps`,
173
- method: 'get',
216
+ url: `${this.serviceUrl}/${id}`,
217
+ method: 'delete',
174
218
  });
175
219
  }
176
- }
177
- ProceduresAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
178
- ProceduresAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresAdminApiService });
179
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresAdminApiService, decorators: [{
180
- type: Injectable
181
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
182
-
183
- class ProceduresApiService {
184
- constructor(baseHttpService) {
185
- this.baseHttpService = baseHttpService;
186
- this.SERVICE_URL = '/v2/procedures';
220
+ restoreEndpoint$(id) {
221
+ return this.baseHttpService.api({
222
+ url: `${this.serviceUrl}/${id}/restore`,
223
+ method: 'patch',
224
+ });
187
225
  }
188
- apply$(request, options) {
189
- return this.baseHttpService.api(Object.assign({ url: `${this.SERVICE_URL}/apply`, method: 'post', body: request }, options));
226
+ fetchEndpoint$(id) {
227
+ return this.baseHttpService.api({
228
+ url: `${this.serviceUrl}/${id}`,
229
+ method: 'get',
230
+ });
190
231
  }
191
- execute$(body) {
232
+ createEndpoint$(body) {
192
233
  return this.baseHttpService.api({
193
- url: `${this.SERVICE_URL}/execute`,
234
+ url: `${this.serviceUrl}`,
194
235
  method: 'post',
195
236
  body,
196
237
  });
197
238
  }
198
- catalogExecute$(body) {
239
+ updateEndpoint$(body) {
199
240
  return this.baseHttpService.api({
200
- url: `${this.SERVICE_URL}/catalog/execute`,
201
- method: 'post',
241
+ url: `${this.serviceUrl}/${body.id}`,
242
+ method: 'put',
202
243
  body,
203
244
  });
204
245
  }
205
- rlmExecute$(body) {
246
+ duplicateEndpoint$(cloneRequest) {
206
247
  return this.baseHttpService.api({
207
- url: `${this.SERVICE_URL}/rlm/execute`,
248
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
249
+ method: 'post',
250
+ body: cloneRequest,
251
+ });
252
+ }
253
+ executeEndpoint$(body) {
254
+ return this.baseHttpService.api({
255
+ url: `${this.serviceUrl}/execute`,
208
256
  method: 'post',
209
257
  body,
258
+ responseType: 'text',
259
+ skipErrorHandler: true,
210
260
  });
211
261
  }
212
262
  }
213
- ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
214
- ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService });
215
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, decorators: [{
263
+ EndpointsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
264
+ EndpointsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService });
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsAdminApiService, decorators: [{
216
266
  type: Injectable
217
267
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
218
268
 
219
- class RuleGroupsAdminApiService {
269
+ class FlowsApiService {
270
+ constructor(configurationSettingsApiService) {
271
+ this.configurationSettingsApiService = configurationSettingsApiService;
272
+ this.flowsKey = 'flows';
273
+ }
274
+ getFlow(id) {
275
+ return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
276
+ if (!flow) {
277
+ throw new Error(`Flow with flowId=${id} is not defined`);
278
+ }
279
+ return flow;
280
+ }));
281
+ }
282
+ fetchFlows() {
283
+ return this.configurationSettingsApiService
284
+ .fetchSetting(this.flowsKey)
285
+ .pipe(map((setting) => ((setting === null || setting === void 0 ? void 0 : setting.value) ? JSON.parse(setting.value) : [])));
286
+ }
287
+ }
288
+ FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
289
+ FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
291
+ type: Injectable
292
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
293
+
294
+ class FunctionGroupsAdminApiService {
220
295
  constructor(baseHttpService) {
221
296
  this.baseHttpService = baseHttpService;
222
- this.serviceUrl = '/v2/admin/rule-groups';
223
- this.fetchRuleGroups$ = () => {
224
- return this.searchRuleGroups$(new Expression(), 0, 100);
297
+ this.serviceUrl = '/admin/v2/functions/groups';
298
+ this.fetchAll$ = () => {
299
+ return this.search$(new Expression(), 0, 100);
225
300
  };
226
- this.searchRuleGroups$ = (expression, skip, count) => {
301
+ this.search$ = (expression, skip, count) => {
227
302
  let params = new HttpParams();
228
303
  params = params.set('skip', '' + skip);
229
304
  params = params.set('count', '' + count);
230
305
  return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
231
306
  };
232
- this.createRuleGroup$ = (ruleGroup) => {
307
+ this.create$ = (ruleGroup) => {
233
308
  return this.baseHttpService.api({
234
309
  url: `${this.serviceUrl}`,
235
310
  method: 'post',
236
311
  body: ruleGroup,
237
312
  });
238
313
  };
239
- this.updateRuleGroup$ = (ruleGroup) => {
314
+ this.update$ = (ruleGroup) => {
240
315
  return this.baseHttpService.api({
241
316
  url: `${this.serviceUrl}/${ruleGroup.id}`,
242
317
  method: 'post',
243
318
  body: ruleGroup,
244
319
  });
245
320
  };
246
- this.duplicateRuleGroup$ = (body) => {
321
+ this.duplicate$ = (body) => {
247
322
  return this.baseHttpService
248
323
  .api({
249
324
  url: `${this.serviceUrl}/${body.id}/clone`,
@@ -252,13 +327,13 @@ class RuleGroupsAdminApiService {
252
327
  })
253
328
  .pipe(map$1(response => response.clonedRecordId));
254
329
  };
255
- this.removeRuleGroup$ = (id) => {
330
+ this.remove$ = (id) => {
256
331
  return this.baseHttpService.api({
257
332
  url: `${this.serviceUrl}/${id}`,
258
333
  method: 'delete',
259
334
  });
260
335
  };
261
- this.restoreRuleGroup$ = (id) => {
336
+ this.restore$ = (id) => {
262
337
  return this.baseHttpService.api({
263
338
  url: `${this.serviceUrl}/${id}/restore`,
264
339
  method: 'patch',
@@ -266,20 +341,20 @@ class RuleGroupsAdminApiService {
266
341
  };
267
342
  }
268
343
  }
269
- RuleGroupsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
270
- RuleGroupsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsAdminApiService });
271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsAdminApiService, decorators: [{
344
+ FunctionGroupsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
345
+ FunctionGroupsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService });
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionGroupsAdminApiService, decorators: [{
272
347
  type: Injectable
273
348
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
274
349
 
275
- class RulesAdminApiService {
350
+ class FunctionsAdminApiService {
276
351
  constructor(baseHttpService) {
277
352
  this.baseHttpService = baseHttpService;
278
- this.serviceUrl = '/v2/admin/rules';
279
- this.fetchRules$ = () => {
280
- return this.searchRules$(new Expression(), 0, 100);
353
+ this.serviceUrl = '/admin/v2/functions/rules';
354
+ this.fetchAll$ = () => {
355
+ return this.search$(new Expression(), 0, 100);
281
356
  };
282
- this.searchRules$ = (expression, skip, count) => {
357
+ this.search$ = (expression, skip, count) => {
283
358
  let params = new HttpParams();
284
359
  if (typeof skip === 'number') {
285
360
  params = params.set('skip', '' + skip);
@@ -289,21 +364,21 @@ class RulesAdminApiService {
289
364
  }
290
365
  return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
291
366
  };
292
- this.createRule$ = (rule) => {
367
+ this.create$ = (rule) => {
293
368
  return this.baseHttpService.api({
294
369
  url: `${this.serviceUrl}`,
295
370
  method: 'post',
296
371
  body: rule,
297
372
  });
298
373
  };
299
- this.updateRule$ = (rule) => {
374
+ this.update$ = (rule) => {
300
375
  return this.baseHttpService.api({
301
376
  url: `${this.serviceUrl}/${rule.id}`,
302
377
  method: 'put',
303
378
  body: rule,
304
379
  });
305
380
  };
306
- this.duplicateRule$ = (body) => {
381
+ this.duplicate$ = (body) => {
307
382
  return this.baseHttpService
308
383
  .api({
309
384
  url: `${this.serviceUrl}/${body.id}/clone`,
@@ -312,20 +387,20 @@ class RulesAdminApiService {
312
387
  })
313
388
  .pipe(map$1(response => response.clonedRecordId));
314
389
  };
315
- this.removeRule$ = (id) => {
390
+ this.remove$ = (id) => {
316
391
  return this.baseHttpService.api({
317
392
  url: `${this.serviceUrl}/${id}`,
318
393
  method: 'delete',
319
394
  });
320
395
  };
321
- this.restoreRule$ = (id) => {
396
+ this.restore$ = (id) => {
322
397
  return this.baseHttpService.api({
323
398
  url: `${this.serviceUrl}/${id}/restore`,
324
399
  method: 'patch',
325
400
  });
326
401
  };
327
402
  }
328
- fetchRule$(id) {
403
+ fetch$(id) {
329
404
  return this.baseHttpService.api({
330
405
  url: `${this.serviceUrl}/${id}`,
331
406
  method: 'get',
@@ -346,57 +421,328 @@ class RulesAdminApiService {
346
421
  });
347
422
  }
348
423
  getExecuteRuleUrl(ruleGroupType) {
349
- if (ruleGroupType === RuleGroupTypes.eligibility) {
350
- return '/v2/rules/eligibility/execute';
424
+ switch (ruleGroupType) {
425
+ case RuleGroupTypes.eligibility:
426
+ return `${this.serviceUrl}/eligibility/execute`;
427
+ case RuleGroupTypes.rlmContextBased:
428
+ case RuleGroupTypes.generalContextBased:
429
+ return `${this.serviceUrl}/execute`;
430
+ default:
431
+ return `${this.serviceUrl}/legacy/execute`;
351
432
  }
352
- if (ruleGroupType === RuleGroupTypes.rlmContextBased || ruleGroupType === RuleGroupTypes.generalContextBased) {
353
- return '/v2/rules/rlm/execute';
354
- }
355
- return '/v2/rules/execute';
356
433
  }
357
434
  }
358
- RulesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
359
- RulesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesAdminApiService });
360
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesAdminApiService, decorators: [{
435
+ FunctionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
436
+ FunctionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService });
437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FunctionsAdminApiService, decorators: [{
361
438
  type: Injectable
362
439
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
363
440
 
364
- class RulesApiService {
441
+ class OrchestrationsAdminApiService {
365
442
  constructor(baseHttpService) {
366
443
  this.baseHttpService = baseHttpService;
367
- this.serviceUrl = '/v2/rules';
444
+ this.SERVICE_URL = '/admin/v2/orchestrations';
445
+ this.fetchAll$ = () => {
446
+ return this.search$(new Expression(), 0, 100);
447
+ };
448
+ this.search$ = (expression, skip, count) => {
449
+ let params = new HttpParams();
450
+ params = params.set('skip', '' + skip);
451
+ params = params.set('count', '' + count);
452
+ return this.baseHttpService.api({
453
+ method: 'post',
454
+ url: `${this.SERVICE_URL}/search`,
455
+ params,
456
+ body: expression,
457
+ });
458
+ };
459
+ this.create$ = (newProcedure) => {
460
+ return this.baseHttpService.api({
461
+ url: `${this.SERVICE_URL}`,
462
+ method: 'post',
463
+ body: newProcedure,
464
+ });
465
+ };
466
+ this.update$ = (procedure) => {
467
+ return this.baseHttpService.api({
468
+ url: `${this.SERVICE_URL}/${procedure.id}`,
469
+ method: 'put',
470
+ body: procedure,
471
+ });
472
+ };
473
+ this.duplicate$ = (body) => {
474
+ return this.baseHttpService
475
+ .api({
476
+ url: `${this.SERVICE_URL}/${body.id}/clone`,
477
+ method: 'post',
478
+ body,
479
+ })
480
+ .pipe(map$1(response => response.clonedRecordId));
481
+ };
482
+ this.remove$ = (id) => {
483
+ return this.baseHttpService.api({
484
+ url: `${this.SERVICE_URL}/${id}`,
485
+ method: 'delete',
486
+ });
487
+ };
488
+ this.restore$ = (id) => {
489
+ return this.baseHttpService.api({
490
+ url: `${this.SERVICE_URL}/${id}/restore`,
491
+ method: 'patch',
492
+ });
493
+ };
494
+ }
495
+ fetch$(id) {
496
+ return this.baseHttpService.api({
497
+ url: `${this.SERVICE_URL}/${id}`,
498
+ method: 'get',
499
+ });
368
500
  }
369
501
  execute$(body) {
370
- const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
371
502
  return this.baseHttpService.api({
372
- url,
503
+ url: `${this.SERVICE_URL}/execute`,
373
504
  method: 'post',
374
505
  body,
375
506
  });
376
507
  }
377
- getExecuteRuleUrl(ruleGroupType) {
378
- if (ruleGroupType === RuleGroupTypes.eligibility) {
379
- return `${this.serviceUrl}/eligibility/execute`;
380
- }
381
- if (ruleGroupType === RuleGroupTypes.catalog) {
382
- return `${this.serviceUrl}/catalog/execute`;
383
- }
384
- if (ruleGroupType === RuleGroupTypes.rlmContextBased) {
385
- return `${this.serviceUrl}/rlm/execute`;
508
+ catalogExecute$(body) {
509
+ return this.baseHttpService.api({
510
+ url: `${this.SERVICE_URL}/catalog/execute`,
511
+ method: 'post',
512
+ body,
513
+ });
514
+ }
515
+ }
516
+ OrchestrationsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
517
+ OrchestrationsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService });
518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsAdminApiService, decorators: [{
519
+ type: Injectable
520
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
521
+
522
+ class OrchestrationsApiService {
523
+ constructor(baseHttpService) {
524
+ this.baseHttpService = baseHttpService;
525
+ this.SERVICE_URL = '/services/v2/orchestrations';
526
+ }
527
+ apply$(request, options) {
528
+ return this.baseHttpService.api(Object.assign({ url: `${this.SERVICE_URL}/apply`, method: 'post', body: request }, options));
529
+ }
530
+ }
531
+ OrchestrationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
532
+ OrchestrationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService });
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrchestrationsApiService, decorators: [{
534
+ type: Injectable
535
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
536
+
537
+ class SalesforceApiService {
538
+ constructor(httpService) {
539
+ this.httpService = httpService;
540
+ this.SERVICE_URL = '/services/v2/proxy';
541
+ }
542
+ query(searchRequest, objectName, options) {
543
+ 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));
544
+ }
545
+ queryObjects(search, options) {
546
+ let params = new HttpParams();
547
+ if (search) {
548
+ params = params.append('search', search);
386
549
  }
387
- return `${this.serviceUrl}/execute`;
550
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/query`, params }, options));
551
+ }
552
+ search(req, options) {
553
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest/search`, params: { q: req.searchString } }, options));
554
+ }
555
+ describeObject(objectName, options) {
556
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
557
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
558
+ }
559
+ describeField(objectName, fieldName, options) {
560
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
561
+ return this.httpService.api(Object.assign({ url: methodUrl }, options));
562
+ }
563
+ describe2(objectName, fields, options) {
564
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
565
+ return this.httpService.api(Object.assign({ method: 'post', url: methodUrl, body: fields }, options));
566
+ }
567
+ apexGetRequest(path, params, options) {
568
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
569
+ const httpParams = new HttpParams({ fromString: params.toString() });
570
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams }, options));
571
+ }
572
+ apexPostRequest(path, body, options) {
573
+ return this.httpService.api(Object.assign({ method: 'post', body, url: `${this.SERVICE_URL}/apex${path}` }, options));
574
+ }
575
+ restGetRequest(path, params, options) {
576
+ const httpParams = new HttpParams({ fromString: params.toString() });
577
+ return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/rest${path}`, params: httpParams }, options));
578
+ }
579
+ getGlobalPicklists() {
580
+ return this.httpService.api({
581
+ method: 'get',
582
+ url: `${this.SERVICE_URL}/globalvalueset`,
583
+ });
584
+ }
585
+ getGlobalPicklistValues(id) {
586
+ return this.httpService.api({
587
+ method: 'get',
588
+ url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
589
+ });
590
+ }
591
+ }
592
+ SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
593
+ SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
594
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
595
+ type: Injectable
596
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
597
+
598
+ class PCMApiService {
599
+ constructor(sfApiService) {
600
+ this.sfApiService = sfApiService;
601
+ }
602
+ fetchPCMByProductId(productId) {
603
+ return this.sfApiService.restGetRequest(`/connect/pcm/products/${productId}`, new HttpParams()).pipe(tap(response => {
604
+ if (response.status.code !== '200') {
605
+ throw new Error(response.status.message);
606
+ }
607
+ }), map$1(response => {
608
+ const pcm = response.products[0];
609
+ if (!pcm) {
610
+ throw new Error('PCM product is not found');
611
+ }
612
+ return pcm;
613
+ }));
614
+ }
615
+ }
616
+ PCMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, deps: [{ token: SalesforceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
617
+ PCMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService });
618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, decorators: [{
619
+ type: Injectable
620
+ }], ctorParameters: function () { return [{ type: SalesforceApiService }]; } });
621
+
622
+ class PicklistsAdminApiService {
623
+ constructor(baseHttpService) {
624
+ this.baseHttpService = baseHttpService;
625
+ this.serviceUrl = '/admin/v2/picklists';
626
+ this.fetchAllPicklists$ = () => this.baseHttpService.api({ url: `${this.serviceUrl}` });
627
+ this.fetchPicklist$ = (code) => this.baseHttpService.api({ url: `${this.serviceUrl}/${code}` });
628
+ this.createPicklist$ = (picklist) => {
629
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}`, body: picklist });
630
+ };
631
+ this.updatePicklist$ = (picklist) => {
632
+ return this.baseHttpService.api({
633
+ method: 'put',
634
+ url: `${this.serviceUrl}/${picklist.id}`,
635
+ body: picklist,
636
+ });
637
+ };
638
+ this.removePicklist$ = (id) => this.baseHttpService.api({ method: 'delete', url: `${this.serviceUrl}/${id}` });
639
+ this.restorePicklist$ = (id) => {
640
+ return this.baseHttpService.api({
641
+ url: `${this.serviceUrl}/${id}/restore`,
642
+ method: 'patch',
643
+ });
644
+ };
645
+ this.addPicklistValue$ = (picklist, value) => {
646
+ const data = Object.assign(Object.assign({}, picklist), { values: [...picklist.values, value] });
647
+ return this.baseHttpService.api({ method: 'put', url: `${this.serviceUrl}/${picklist.id}`, body: data });
648
+ };
649
+ }
650
+ }
651
+ PicklistsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
652
+ PicklistsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService });
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsAdminApiService, decorators: [{
654
+ type: Injectable
655
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
656
+
657
+ class ProductsAdminApiService {
658
+ constructor(baseHttpService) {
659
+ this.baseHttpService = baseHttpService;
660
+ this.serviceUrl = '/admin/v2/products';
661
+ this.fetchProducts$ = (payload) => {
662
+ let params = new HttpParams();
663
+ params = params.append('count', payload.count);
664
+ params = params.append('skip', payload.skip);
665
+ if (payload.name) {
666
+ params = params.append('name', payload.name);
667
+ }
668
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
669
+ };
670
+ this.searchProducts$ = (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({
675
+ method: 'post',
676
+ url: `${this.serviceUrl}/search`,
677
+ params: params,
678
+ body: expression,
679
+ });
680
+ };
681
+ this.fetchProduct$ = (id) => this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
682
+ this.createNewProduct$ = (productData) => {
683
+ return this.baseHttpService.api({
684
+ url: `${this.serviceUrl}`,
685
+ method: 'post',
686
+ body: productData,
687
+ });
688
+ };
689
+ this.updateProduct$ = (body) => {
690
+ return this.baseHttpService.api({
691
+ url: `${this.serviceUrl}/${body.id}`,
692
+ method: 'put',
693
+ body,
694
+ });
695
+ };
696
+ this.removeProduct$ = (id) => {
697
+ return this.baseHttpService.api({
698
+ url: `${this.serviceUrl}/${id}`,
699
+ method: 'delete',
700
+ });
701
+ };
702
+ this.restoreProduct$ = (id) => {
703
+ return this.baseHttpService.api({
704
+ url: `${this.serviceUrl}/${id}/restore`,
705
+ method: 'patch',
706
+ });
707
+ };
708
+ }
709
+ attachImage$(productId, file) {
710
+ const data = new FormData();
711
+ data.append('image', file);
712
+ return this.baseHttpService.upload({
713
+ method: 'post',
714
+ url: `${this.serviceUrl}/${productId}/image`,
715
+ body: data,
716
+ });
717
+ }
718
+ removeImage$(productId) {
719
+ return this.baseHttpService.api({
720
+ method: 'delete',
721
+ url: `${this.serviceUrl}/${productId}/image`,
722
+ });
723
+ }
724
+ fetchImage$(productId) {
725
+ return this.baseHttpService.api({
726
+ url: this.getImageUrl(productId),
727
+ method: 'get',
728
+ responseType: 'blob',
729
+ errorHandler: noop,
730
+ });
731
+ }
732
+ getImageUrl(productId) {
733
+ return `${this.serviceUrl}/${productId}/image`;
388
734
  }
389
735
  }
390
- RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
391
- RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService });
392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, decorators: [{
736
+ ProductsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
737
+ ProductsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService });
738
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductsAdminApiService, decorators: [{
393
739
  type: Injectable
394
740
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
395
741
 
396
742
  class SalesTransactionApiService {
397
743
  constructor(httpService) {
398
744
  this.httpService = httpService;
399
- this.SERVICE_URL = '/v2/transactions';
745
+ this.SERVICE_URL = '/services/v2/transactions';
400
746
  }
401
747
  /**
402
748
  * This endpoint doesn't include orders and assets
@@ -439,7 +785,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
439
785
  class ScriptsAdminApiService {
440
786
  constructor(baseHttpService) {
441
787
  this.baseHttpService = baseHttpService;
442
- this.serviceUrl = '/v2/admin/scripts';
788
+ this.serviceUrl = '/admin/v2/functions/scripts';
443
789
  this.fetchScripts$ = () => {
444
790
  return this.baseHttpService.api({ url: `${this.serviceUrl}` });
445
791
  };
@@ -498,18 +844,6 @@ class ScriptsAdminApiService {
498
844
  method: 'patch',
499
845
  });
500
846
  };
501
- }
502
- }
503
- ScriptsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
504
- ScriptsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService });
505
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, decorators: [{
506
- type: Injectable
507
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
508
-
509
- class ScriptsApiService {
510
- constructor(baseHttpService) {
511
- this.baseHttpService = baseHttpService;
512
- this.serviceUrl = '/v2/scripts';
513
847
  this.execute$ = (body) => {
514
848
  return this.baseHttpService.api({
515
849
  url: `${this.serviceUrl}/execute`,
@@ -520,12 +854,35 @@ class ScriptsApiService {
520
854
  };
521
855
  }
522
856
  }
523
- ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
524
- ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService });
525
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, decorators: [{
857
+ ScriptsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
858
+ ScriptsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService });
859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsAdminApiService, decorators: [{
526
860
  type: Injectable
527
861
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
528
862
 
863
+ class ShoppingCartSettingsApiService {
864
+ constructor(configurationSettingsApiService) {
865
+ this.configurationSettingsApiService = configurationSettingsApiService;
866
+ this.shoppingCartSettingsKey = 'shopping-cart';
867
+ }
868
+ getSetting(id) {
869
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map(settings => settings.find(setting => setting.id == id)));
870
+ }
871
+ fetchSettings() {
872
+ return this.configurationSettingsApiService.fetchSetting(this.shoppingCartSettingsKey, { skipErrorHandler: true });
873
+ }
874
+ getSettingsMap() {
875
+ return this.fetchSettings().pipe(map((settings) => parseJsonSafely(settings === null || settings === void 0 ? void 0 : settings.value, [])), map((settings) => settings.reduce((acc, setting) => {
876
+ return Object.assign(Object.assign({}, acc), { [setting.id]: setting.properties });
877
+ }, {})));
878
+ }
879
+ }
880
+ ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
881
+ ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
882
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
883
+ type: Injectable
884
+ }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
885
+
529
886
  function uiDefinitionFromDTO(container) {
530
887
  const { sourceBlob } = container, rest = __rest(container, ["sourceBlob"]);
531
888
  return Object.assign(Object.assign({}, rest), { source: parseJsonStringAsObject(sourceBlob) });
@@ -539,10 +896,10 @@ function newUiDefinitionToDTO(container) {
539
896
  return Object.assign(Object.assign({}, rest), { sourceBlob: JSON.stringify(source) });
540
897
  }
541
898
 
542
- class UIDefinitionsApiService {
899
+ class UIDefinitionsAdminApiService {
543
900
  constructor(baseHttpService) {
544
901
  this.baseHttpService = baseHttpService;
545
- this.serviceUrl = '/v2/uidefinitions';
902
+ this.serviceUrl = '/admin/v2/uidefinitions';
546
903
  }
547
904
  fetchAll$(params) {
548
905
  let httpParams = new HttpParams();
@@ -595,9 +952,9 @@ class UIDefinitionsApiService {
595
952
  });
596
953
  }
597
954
  }
598
- UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
599
- UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService });
600
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
955
+ UIDefinitionsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
956
+ UIDefinitionsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService });
957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsAdminApiService, decorators: [{
601
958
  type: Injectable
602
959
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
603
960
 
@@ -614,10 +971,10 @@ const fromUIComponentStoryDTO = (dto, attachments) => {
614
971
  };
615
972
  };
616
973
 
617
- class UITemplatesApiService {
974
+ class UITemplatesAdminApiService {
618
975
  constructor(baseHttpService) {
619
976
  this.baseHttpService = baseHttpService;
620
- this.serviceUrl = '/v2/uitemplates';
977
+ this.serviceUrl = '/admin/v2/uitemplates';
621
978
  this.fetchTemplates$ = (name) => {
622
979
  let params = new HttpParams();
623
980
  if (name) {
@@ -888,9 +1245,94 @@ class UITemplatesApiService {
888
1245
  });
889
1246
  }
890
1247
  }
891
- UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
892
- UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService });
893
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, decorators: [{
1248
+ UITemplatesAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1249
+ UITemplatesAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService });
1250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesAdminApiService, decorators: [{
1251
+ type: Injectable
1252
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1253
+
1254
+ class VeloceObjectsAdminApiService {
1255
+ constructor(baseHttpService) {
1256
+ this.baseHttpService = baseHttpService;
1257
+ this.serviceUrl = '/admin/v2/veloceobjects';
1258
+ this.updateCategory$ = (category) => {
1259
+ return this.baseHttpService.api({
1260
+ method: 'put',
1261
+ url: `${this.serviceUrl}/categories/${category.id}`,
1262
+ body: category,
1263
+ });
1264
+ };
1265
+ this.deleteCategory$ = (id) => {
1266
+ return this.baseHttpService.api({
1267
+ method: 'delete',
1268
+ url: `${this.serviceUrl}/categories/${id}`,
1269
+ });
1270
+ };
1271
+ this.searchObjects$ = (searchParams, expression) => {
1272
+ const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
1273
+ return this.baseHttpService.api({
1274
+ method: 'post',
1275
+ url: `${this.serviceUrl}/search`,
1276
+ params,
1277
+ body: expression || {},
1278
+ });
1279
+ };
1280
+ this.deleteObject$ = (id) => {
1281
+ return this.baseHttpService.api({
1282
+ method: 'delete',
1283
+ url: `${this.serviceUrl}/${id}`,
1284
+ });
1285
+ };
1286
+ this.duplicateObject$ = (body) => {
1287
+ return this.baseHttpService
1288
+ .api({
1289
+ method: 'post',
1290
+ url: `${this.serviceUrl}/${body.id}/clone`,
1291
+ body,
1292
+ })
1293
+ .pipe(map(response => response.clonedRecordId));
1294
+ };
1295
+ this.restoreObject$ = (id) => {
1296
+ return this.baseHttpService.api({
1297
+ method: 'patch',
1298
+ url: `${this.serviceUrl}/${id}/restore`,
1299
+ });
1300
+ };
1301
+ }
1302
+ fetchCategories$() {
1303
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
1304
+ }
1305
+ createCategory$(category) {
1306
+ return this.baseHttpService.api({
1307
+ method: 'post',
1308
+ url: `${this.serviceUrl}/categories`,
1309
+ body: category,
1310
+ });
1311
+ }
1312
+ fetchObjects$() {
1313
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
1314
+ }
1315
+ fetchObject$(id) {
1316
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1317
+ }
1318
+ createObject$(object) {
1319
+ return this.baseHttpService.api({
1320
+ method: 'post',
1321
+ url: `${this.serviceUrl}`,
1322
+ body: object,
1323
+ });
1324
+ }
1325
+ updateObject$(object) {
1326
+ return this.baseHttpService.api({
1327
+ method: 'put',
1328
+ url: `${this.serviceUrl}/${object.id}`,
1329
+ body: object,
1330
+ });
1331
+ }
1332
+ }
1333
+ VeloceObjectsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1334
+ VeloceObjectsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService });
1335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsAdminApiService, decorators: [{
894
1336
  type: Injectable
895
1337
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
896
1338
 
@@ -900,18 +1342,26 @@ ApiV2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15
900
1342
  ApiV2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, imports: [HttpClientModule] });
901
1343
  ApiV2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, providers: [
902
1344
  BaseHttpService,
1345
+ CacheApiService,
903
1346
  ConfigurationProcessorsApiService,
904
- ContextDefinitionApiService,
905
- ProceduresAdminApiService,
906
- ProceduresApiService,
907
- RuleGroupsAdminApiService,
908
- RulesAdminApiService,
909
- RulesApiService,
1347
+ ConfigurationSettingsApiService,
1348
+ ContextDefinitionAdminApiService,
1349
+ EndpointsAdminApiService,
1350
+ FlowsApiService,
1351
+ FunctionGroupsAdminApiService,
1352
+ OrchestrationsAdminApiService,
1353
+ OrchestrationsApiService,
1354
+ PCMApiService,
1355
+ PicklistsAdminApiService,
1356
+ ProductsAdminApiService,
1357
+ FunctionsAdminApiService,
1358
+ SalesforceApiService,
910
1359
  SalesTransactionApiService,
1360
+ ShoppingCartSettingsApiService,
911
1361
  ScriptsAdminApiService,
912
- ScriptsApiService,
913
- UIDefinitionsApiService,
914
- UITemplatesApiService,
1362
+ UIDefinitionsAdminApiService,
1363
+ UITemplatesAdminApiService,
1364
+ VeloceObjectsAdminApiService,
915
1365
  XrayService,
916
1366
  ], imports: [HttpClientModule] });
917
1367
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiV2Module, decorators: [{
@@ -920,18 +1370,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
920
1370
  imports: [HttpClientModule],
921
1371
  providers: [
922
1372
  BaseHttpService,
1373
+ CacheApiService,
923
1374
  ConfigurationProcessorsApiService,
924
- ContextDefinitionApiService,
925
- ProceduresAdminApiService,
926
- ProceduresApiService,
927
- RuleGroupsAdminApiService,
928
- RulesAdminApiService,
929
- RulesApiService,
1375
+ ConfigurationSettingsApiService,
1376
+ ContextDefinitionAdminApiService,
1377
+ EndpointsAdminApiService,
1378
+ FlowsApiService,
1379
+ FunctionGroupsAdminApiService,
1380
+ OrchestrationsAdminApiService,
1381
+ OrchestrationsApiService,
1382
+ PCMApiService,
1383
+ PicklistsAdminApiService,
1384
+ ProductsAdminApiService,
1385
+ FunctionsAdminApiService,
1386
+ SalesforceApiService,
930
1387
  SalesTransactionApiService,
1388
+ ShoppingCartSettingsApiService,
931
1389
  ScriptsAdminApiService,
932
- ScriptsApiService,
933
- UIDefinitionsApiService,
934
- UITemplatesApiService,
1390
+ UIDefinitionsAdminApiService,
1391
+ UITemplatesAdminApiService,
1392
+ VeloceObjectsAdminApiService,
935
1393
  XrayService,
936
1394
  ],
937
1395
  }]
@@ -941,5 +1399,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
941
1399
  * Generated bundle index. Do not edit.
942
1400
  */
943
1401
 
944
- export { ApiV2Module, ConfigurationProcessorsApiService, ContextDefinitionApiService, ProceduresAdminApiService, ProceduresApiService, RuleGroupsAdminApiService, RulesAdminApiService, RulesApiService, SalesTransactionApiService, ScriptsAdminApiService, ScriptsApiService, UIDefinitionsApiService, UITemplatesApiService };
1402
+ export { ApiV2Module, CacheApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextDefinitionAdminApiService, EndpointsAdminApiService, FlowsApiService, FunctionGroupsAdminApiService, FunctionsAdminApiService, OrchestrationsAdminApiService, OrchestrationsApiService, PCMApiService, PicklistsAdminApiService, ProductsAdminApiService, SalesTransactionApiService, SalesforceApiService, ScriptsAdminApiService, ShoppingCartSettingsApiService, UIDefinitionsAdminApiService, UITemplatesAdminApiService, VeloceObjectsAdminApiService };
945
1403
  //# sourceMappingURL=veloceapps-api-v2.mjs.map