@veloceapps/api 8.0.0-18 → 8.0.0-181

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 (51) hide show
  1. package/esm2020/index.mjs +10 -4
  2. package/esm2020/lib/api.module.mjs +22 -4
  3. package/esm2020/lib/services/auth.service.mjs +22 -0
  4. package/esm2020/lib/services/configuration-api.service.mjs +45 -12
  5. package/esm2020/lib/services/configuration-processors-api.service.mjs +38 -0
  6. package/esm2020/lib/services/contracted-price-api.service.mjs +45 -0
  7. package/esm2020/lib/services/document-templates-api.service.mjs +6 -4
  8. package/esm2020/lib/services/flow-state-api.mjs +142 -0
  9. package/esm2020/lib/services/flows-api.service.mjs +9 -5
  10. package/esm2020/lib/services/portals-api.service.mjs +76 -0
  11. package/esm2020/lib/services/procedures-api.service.mjs +7 -1
  12. package/esm2020/lib/services/quote-api.service.mjs +1 -1
  13. package/esm2020/lib/services/rebate-program-api.service.mjs +1 -1
  14. package/esm2020/lib/services/rules-api.service.mjs +11 -2
  15. package/esm2020/lib/services/salesforce-api.service.mjs +4 -2
  16. package/esm2020/lib/services/sandbox-manager-api.service.mjs +67 -0
  17. package/esm2020/lib/services/scripts-api.service.mjs +6 -3
  18. package/esm2020/lib/services/stateful-configuration-api.mjs +1 -1
  19. package/esm2020/lib/services/ui-templates-api.service.mjs +6 -1
  20. package/esm2020/lib/services/veloce-objects-api.service.mjs +11 -1
  21. package/esm2020/lib/types/auth.types.mjs +2 -0
  22. package/esm2020/lib/types/index.mjs +3 -1
  23. package/esm2020/lib/types/quote.types.mjs +2 -0
  24. package/esm2020/lib/types/stateful-configuration.types.mjs +1 -1
  25. package/fesm2015/veloceapps-api.mjs +673 -229
  26. package/fesm2015/veloceapps-api.mjs.map +1 -1
  27. package/fesm2020/veloceapps-api.mjs +674 -222
  28. package/fesm2020/veloceapps-api.mjs.map +1 -1
  29. package/index.d.ts +9 -3
  30. package/lib/services/auth.service.d.ts +11 -0
  31. package/lib/services/configuration-api.service.d.ts +5 -0
  32. package/lib/services/configuration-processors-api.service.d.ts +14 -0
  33. package/lib/services/contracted-price-api.service.d.ts +16 -0
  34. package/lib/services/flow-state-api.d.ts +84 -0
  35. package/lib/services/flows-api.service.d.ts +1 -1
  36. package/lib/services/portals-api.service.d.ts +20 -0
  37. package/lib/services/procedures-api.service.d.ts +1 -0
  38. package/lib/services/quote-api.service.d.ts +3 -6
  39. package/lib/services/rebate-program-api.service.d.ts +1 -1
  40. package/lib/services/rules-api.service.d.ts +1 -0
  41. package/lib/services/salesforce-api.service.d.ts +1 -1
  42. package/lib/services/sandbox-manager-api.service.d.ts +22 -0
  43. package/lib/services/scripts-api.service.d.ts +1 -1
  44. package/lib/services/stateful-configuration-api.d.ts +2 -2
  45. package/lib/services/ui-templates-api.service.d.ts +1 -0
  46. package/lib/services/veloce-objects-api.service.d.ts +2 -1
  47. package/lib/types/auth.types.d.ts +4 -0
  48. package/lib/types/index.d.ts +2 -0
  49. package/lib/types/quote.types.d.ts +8 -0
  50. package/lib/types/stateful-configuration.types.d.ts +1 -1
  51. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import * as i4 from '@angular/common/http';
2
- import { HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
1
+ import * as i1$1 from '@angular/common/http';
2
+ import { HttpParams, HttpHeaders, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Injectable, NgModule } from '@angular/core';
5
5
  import * as i1 from '@veloceapps/core';
6
- import { uiDefinitionFromDTO, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
6
+ import { uiDefinitionFromDTO, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, toLatestFlow, isDefined, Operator, ModelTranslatorUtils, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
7
7
  import { noop, throwError, of, zip, forkJoin, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
8
8
  import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
9
9
  import * as i2 from 'primeng/api';
@@ -88,6 +88,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
88
88
  type: Injectable
89
89
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
90
90
 
91
+ class VeloceAuthService {
92
+ constructor(http) {
93
+ this.http = http;
94
+ }
95
+ auth$(instanceUrl, accessToken) {
96
+ const headers = new HttpHeaders({
97
+ 'Content-Type': 'application/json',
98
+ Authorization: `Bearer ${accessToken}`,
99
+ });
100
+ return this.http.get(`${instanceUrl}/services/apexrest/VELOCPQ/veloce-auth`, { headers });
101
+ }
102
+ }
103
+ VeloceAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
104
+ VeloceAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService });
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService, decorators: [{
106
+ type: Injectable
107
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
108
+
91
109
  class CatalogAdminApiService {
92
110
  constructor(baseHttpService) {
93
111
  this.baseHttpService = baseHttpService;
@@ -386,6 +404,26 @@ class ConfigurationApiService {
386
404
  }
387
405
  }));
388
406
  }
407
+ customConfigurePrice({ url, configurationRequest, runtimeModel, }) {
408
+ return this.httpService
409
+ .api({
410
+ method: 'post',
411
+ url,
412
+ body: configurationRequest,
413
+ errorHandler: e => throwError(e),
414
+ })
415
+ .pipe(map(configurePrice => {
416
+ if (runtimeModel) {
417
+ return {
418
+ ...configurePrice,
419
+ lineItem: this.updatePortDomains(configurePrice.lineItem, runtimeModel),
420
+ };
421
+ }
422
+ else {
423
+ return configurePrice;
424
+ }
425
+ }));
426
+ }
389
427
  getRuntimeDataByProductId(productId, offeringId) {
390
428
  return this.httpService
391
429
  .api({
@@ -395,13 +433,7 @@ class ConfigurationApiService {
395
433
  .pipe(map(runtimeData => {
396
434
  return {
397
435
  ...runtimeData,
398
- uiDefinitions: runtimeData.uiDefinitions.map(dto => {
399
- const uiDefinitionContainer = uiDefinitionFromDTO(dto);
400
- if (isLegacyUIDefinition(uiDefinitionContainer.source)) {
401
- ModelTranslatorUtils.toLocalUIDefinition(uiDefinitionContainer.source);
402
- }
403
- return uiDefinitionContainer;
404
- }),
436
+ uiDefinitions: runtimeData.uiDefinitions.map(dto => uiDefinitionFromDTO(dto)),
405
437
  };
406
438
  }));
407
439
  }
@@ -414,10 +446,29 @@ class ConfigurationApiService {
414
446
  updatePortDomains(lineItem, runtimeModel) {
415
447
  const type = runtimeModel.components.get(lineItem.type);
416
448
  const portDomains = { ...lineItem.portDomains };
449
+ // loop through ports to look for 'None' type domain computations
417
450
  for (const port of type?.ports ?? []) {
418
- const portDomain = portDomains[port.name];
419
- if (portDomain?.properties?.['domainComputation'] === 'false') {
420
- portDomain.domainTypes = port.domainTypes;
451
+ const { name: portName, type: typeName, min, max, domainTypes, properties } = port;
452
+ const portDomain = portDomains[portName];
453
+ if (portDomain) {
454
+ // there's a 'None' type domain computation
455
+ if (portDomain.properties?.['domainComputation'] === ('None')) {
456
+ portDomain.domainTypes = domainTypes;
457
+ }
458
+ }
459
+ else {
460
+ // there's no port domain so consider that as 'None' type domain computation
461
+ portDomains[portName] = {
462
+ name: portName,
463
+ type: typeName,
464
+ minCard: Number(min),
465
+ maxCard: Number(max),
466
+ domainTypes: domainTypes,
467
+ properties: {
468
+ ...properties,
469
+ domainComputation: 'None',
470
+ },
471
+ };
421
472
  }
422
473
  }
423
474
  return {
@@ -433,6 +484,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
433
484
  type: Injectable
434
485
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
435
486
 
487
+ class ConfigurationProcessorsApiService {
488
+ constructor(baseHttpService) {
489
+ this.baseHttpService = baseHttpService;
490
+ this.serviceUrl = '/configuration/processors/owners';
491
+ this.fetchConfigurationProcessors$ = (ownerId) => {
492
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
493
+ };
494
+ this.createConfigurationProcessors$ = (configurationProcessor) => {
495
+ return this.baseHttpService.api({
496
+ method: 'post',
497
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}`,
498
+ body: configurationProcessor,
499
+ });
500
+ };
501
+ this.updateConfigurationProcessors$ = (configurationProcessor) => {
502
+ return this.baseHttpService.api({
503
+ method: 'put',
504
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
505
+ body: configurationProcessor,
506
+ });
507
+ };
508
+ this.deleteConfigurationProcessors$ = (configurationProcessor) => {
509
+ return this.baseHttpService.api({
510
+ method: 'delete',
511
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
512
+ });
513
+ };
514
+ }
515
+ }
516
+ ConfigurationProcessorsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
517
+ ConfigurationProcessorsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService });
518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, decorators: [{
519
+ type: Injectable
520
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
521
+
436
522
  class ConfigurationSettingsDTO {
437
523
  static fromDTO(dto, key) {
438
524
  return {
@@ -565,6 +651,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
565
651
  type: Injectable
566
652
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
567
653
 
654
+ class ContractedPriceApiService {
655
+ constructor(baseHttpService) {
656
+ this.baseHttpService = baseHttpService;
657
+ this.serviceUrl = '/admin/contracted-price';
658
+ this.fetchContractedPrices$ = () => {
659
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
660
+ };
661
+ this.fetchContractedPrice$ = (id) => {
662
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
663
+ };
664
+ this.createContractedPrice$ = (data) => {
665
+ return this.baseHttpService.api({
666
+ url: `${this.serviceUrl}`,
667
+ method: 'put',
668
+ body: data,
669
+ });
670
+ };
671
+ this.updateContractedPrice$ = (data) => {
672
+ return this.baseHttpService.api({
673
+ url: `${this.serviceUrl}/${data.id}`,
674
+ method: 'put',
675
+ body: data,
676
+ });
677
+ };
678
+ this.searchContractedPrices$ = (searchParams, expression) => {
679
+ const params = new HttpParams({ fromObject: { ...searchParams } });
680
+ return this.baseHttpService.api({
681
+ method: 'post',
682
+ url: `${this.serviceUrl}/search`,
683
+ params,
684
+ body: expression || {},
685
+ });
686
+ };
687
+ }
688
+ }
689
+ ContractedPriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
690
+ ContractedPriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService });
691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, decorators: [{
692
+ type: Injectable
693
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
694
+
568
695
  class DeltaApiService {
569
696
  constructor(httpService) {
570
697
  this.httpService = httpService;
@@ -698,7 +825,9 @@ class SalesforceApiService {
698
825
  return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
699
826
  }
700
827
  apexGetRequest(path, params, options) {
701
- return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params, ...options });
828
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
829
+ const httpParams = new HttpParams({ fromString: params.toString() });
830
+ return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams, ...options });
702
831
  }
703
832
  apexPostRequest(path, body, options) {
704
833
  return this.httpService.api({
@@ -736,7 +865,7 @@ class DocumentTemplatesApiService {
736
865
  this.http = http;
737
866
  this.DOCGEN_TAG = 'docgen';
738
867
  this.SERVICE_URL = '/templates';
739
- this.DOC_GEN_URL_FALLBACK = 'https://dev-dp1.velocpq.com/docgen';
868
+ this.DOC_GEN_URL_FALLBACK = `${window.VELO_API}/docgen`;
740
869
  this.mapSfQueryResult = (limit) => map((records) => {
741
870
  if (!records.length) {
742
871
  return { _result: 'No Records Found' };
@@ -880,7 +1009,9 @@ class DocumentTemplatesApiService {
880
1009
  return zip(this.getTemplateFile(template.id), documentData$, this.resolveAttachments$(template)).pipe(switchMap(([templateFile, data, attachments]) => {
881
1010
  const document = DocxTemplater.generate(templateFile, data);
882
1011
  const properties = object?.context?.properties ?? object?.properties ?? {};
883
- const documentName = properties['Name'] || template.name;
1012
+ const documentName = template.properties?.find(({ name }) => name === 'documentName')?.value ||
1013
+ properties['Name'] ||
1014
+ template.name;
884
1015
  const documentFormat = params.documentFormat ?? template.properties?.find(p => p.name === 'documentFormat')?.value;
885
1016
  if (documentFormat === 'DOCX') {
886
1017
  this.fileDownloadService.processDownload(document, documentName);
@@ -989,7 +1120,7 @@ class DocumentTemplatesApiService {
989
1120
  const patternLimit = /(\s*limit\s\d*)/i;
990
1121
  let limit = 1;
991
1122
  if (statement && patternLimit.test(statement)) {
992
- const limitStr = statement?.match(patternLimit)?.[1].trim().substring(5).trim();
1123
+ const limitStr = statement?.match(patternLimit)?.[1]?.trim().substring(5).trim();
993
1124
  if (limitStr) {
994
1125
  limit = Number.parseInt(limitStr, 10);
995
1126
  }
@@ -1007,11 +1138,11 @@ class DocumentTemplatesApiService {
1007
1138
  return this.salesforceApiService.query(searchRequest, objectName).pipe(this.mapSfQueryResult(limit), map(value => ({ [resultObjectName]: value })));
1008
1139
  }
1009
1140
  }
1010
- DocumentTemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService, deps: [{ token: i1.BaseHttpService }, { token: SalesforceApiService }, { token: i1.FileDownloadService }, { token: DocumentAttachmentApiService }, { token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1141
+ DocumentTemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService, deps: [{ token: i1.BaseHttpService }, { token: SalesforceApiService }, { token: i1.FileDownloadService }, { token: DocumentAttachmentApiService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1011
1142
  DocumentTemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService });
1012
1143
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService, decorators: [{
1013
1144
  type: Injectable
1014
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: SalesforceApiService }, { type: i1.FileDownloadService }, { type: DocumentAttachmentApiService }, { type: i4.HttpClient }]; } });
1145
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: SalesforceApiService }, { type: i1.FileDownloadService }, { type: DocumentAttachmentApiService }, { type: i1$1.HttpClient }]; } });
1015
1146
 
1016
1147
  class EndpointsApiService {
1017
1148
  constructor(baseHttpService) {
@@ -1088,18 +1219,160 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1088
1219
  type: Injectable
1089
1220
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1090
1221
 
1222
+ class FlowStateApiService {
1223
+ constructor(httpService) {
1224
+ this.httpService = httpService;
1225
+ this.SERVICE_URL = '/configuration/states';
1226
+ }
1227
+ /**
1228
+ * Initialize flow state
1229
+ * @param request Request
1230
+ * @returns Flow initialization response, which contains session ID and result of selectors
1231
+ */
1232
+ init(request) {
1233
+ return this.httpService.api({
1234
+ method: 'post',
1235
+ url: `${this.SERVICE_URL}/quote/start`,
1236
+ body: request,
1237
+ });
1238
+ }
1239
+ /**
1240
+ * Get existing state by ID
1241
+ * @param id ID
1242
+ * @returns Flow State
1243
+ */
1244
+ get(id) {
1245
+ return this.httpService.api({
1246
+ url: `${this.SERVICE_URL}/${id}`,
1247
+ });
1248
+ }
1249
+ /**
1250
+ * Execute actions/selectors
1251
+ * @param id State ID
1252
+ * @param request Request
1253
+ * @returns Execute result
1254
+ */
1255
+ execute(id, request) {
1256
+ return this.httpService.api({
1257
+ method: 'post',
1258
+ url: `${this.SERVICE_URL}/quote/${id}/execute`,
1259
+ body: request,
1260
+ });
1261
+ }
1262
+ /**
1263
+ * Save Quote in the state
1264
+ * @param id State ID
1265
+ */
1266
+ save(id) {
1267
+ return this.httpService.api({
1268
+ method: 'post',
1269
+ url: `${this.SERVICE_URL}/quote/${id}/save`,
1270
+ });
1271
+ }
1272
+ /**
1273
+ * Submit Quote in the state
1274
+ * @param id State ID
1275
+ */
1276
+ submit(id) {
1277
+ return this.httpService.api({
1278
+ method: 'post',
1279
+ url: `${this.SERVICE_URL}/quote/${id}/submit`,
1280
+ });
1281
+ }
1282
+ /**
1283
+ * Close Flow state
1284
+ * @param id State ID
1285
+ */
1286
+ cancel(id) {
1287
+ return this.httpService.api({
1288
+ method: 'post',
1289
+ url: `${this.SERVICE_URL}/quote/${id}/cancel`,
1290
+ });
1291
+ }
1292
+ /**
1293
+ * Initialize stateful configuration
1294
+ * @param stateId string
1295
+ * @param request Request
1296
+ * @returns Flow initialization response, which contains session ID and result of selectors
1297
+ */
1298
+ newConfiguration(stateId, request) {
1299
+ return this.httpService.api({
1300
+ method: 'post',
1301
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/new`,
1302
+ body: request,
1303
+ });
1304
+ }
1305
+ /**
1306
+ * Start stateful configuration
1307
+ * @param stateId string
1308
+ * @param request Request
1309
+ * @returns Flow initialization response, which contains session ID and result of selectors
1310
+ */
1311
+ startConfiguration(stateId, request) {
1312
+ return this.httpService.api({
1313
+ method: 'post',
1314
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/start`,
1315
+ body: request,
1316
+ });
1317
+ }
1318
+ /**
1319
+ * Execute stateful configuration
1320
+ * @param stateId string
1321
+ * @param configurationId string
1322
+ * @param request Request
1323
+ * @returns Flow initialization response, which contains session ID and result of selectors
1324
+ */
1325
+ executeConfiguration(stateId, configurationId, request) {
1326
+ return this.httpService.api({
1327
+ method: 'post',
1328
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/execute`,
1329
+ body: request,
1330
+ });
1331
+ }
1332
+ /**
1333
+ * Save stateful configuration
1334
+ * @param stateId string
1335
+ * @param configurationId string
1336
+ */
1337
+ saveConfiguration(stateId, configurationId) {
1338
+ return this.httpService.api({
1339
+ method: 'post',
1340
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/save`,
1341
+ });
1342
+ }
1343
+ /**
1344
+ * Cancel stateful configuration
1345
+ * @param stateId string
1346
+ * @param configurationId string
1347
+ */
1348
+ cancelConfiguration(stateId, configurationId) {
1349
+ return this.httpService.api({
1350
+ method: 'post',
1351
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/cancel`,
1352
+ });
1353
+ }
1354
+ }
1355
+ FlowStateApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1356
+ FlowStateApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService });
1357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService, decorators: [{
1358
+ type: Injectable
1359
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1360
+
1091
1361
  class FlowsApiService {
1092
1362
  constructor(configurationSettingsApiService) {
1093
1363
  this.configurationSettingsApiService = configurationSettingsApiService;
1094
1364
  this.flowsKey = 'flows';
1095
1365
  }
1096
1366
  getFlow(id) {
1097
- return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)));
1367
+ return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
1368
+ if (!flow) {
1369
+ throw new Error(`Flow with flowId=${id} is not defined`);
1370
+ }
1371
+ return flow;
1372
+ }));
1098
1373
  }
1099
1374
  fetchFlows() {
1100
- return this.configurationSettingsApiService
1101
- .fetchSetting(this.flowsKey)
1102
- .pipe(map((flow) => (flow?.value ? JSON.parse(flow.value) : [])));
1375
+ return this.configurationSettingsApiService.fetchSetting(this.flowsKey).pipe(map((setting) => (setting?.value ? JSON.parse(setting.value) : [])), map(anyFlows => anyFlows.map(toLatestFlow).filter(isDefined)));
1103
1376
  }
1104
1377
  }
1105
1378
  FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1282,11 +1555,11 @@ class OrgInfoApiService {
1282
1555
  return this.http.get(`${this.hostUrl}/org-info/${organizationId}`);
1283
1556
  }
1284
1557
  }
1285
- OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1558
+ OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1286
1559
  OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
1287
1560
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
1288
1561
  type: Injectable
1289
- }], ctorParameters: function () { return [{ type: i4.HttpClient }]; } });
1562
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
1290
1563
 
1291
1564
  class PicklistsApiService {
1292
1565
  constructor(baseHttpService) {
@@ -1326,6 +1599,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1326
1599
  type: Injectable
1327
1600
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1328
1601
 
1602
+ class PortalsApiService {
1603
+ constructor(baseHttpService) {
1604
+ this.baseHttpService = baseHttpService;
1605
+ this.serviceUrl = '/admin/portal';
1606
+ this.getPortals$ = (skip = 1, name = '') => {
1607
+ let params = new HttpParams();
1608
+ params = params.append('count', (PortalsApiService.MAX_RESULTS * skip).toString());
1609
+ params = params.append('skip', '0');
1610
+ params = params.append('name', name);
1611
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1612
+ };
1613
+ this.searchPortals$ = (skip = 0, expression) => {
1614
+ let params = new HttpParams();
1615
+ params = params.set('skip', '' + skip);
1616
+ params = params.set('count', '' + PortalsApiService.MAX_RESULTS);
1617
+ return this.baseHttpService.api({
1618
+ method: 'post',
1619
+ url: `${this.serviceUrl}/search`,
1620
+ params,
1621
+ body: expression || {},
1622
+ });
1623
+ };
1624
+ this.removePortal$ = (id) => {
1625
+ return this.baseHttpService.api({
1626
+ url: `${this.serviceUrl}/${id}`,
1627
+ method: 'delete',
1628
+ });
1629
+ };
1630
+ this.restore$ = (id) => {
1631
+ return this.baseHttpService.api({
1632
+ method: 'patch',
1633
+ url: `${this.serviceUrl}/${id}/restore`,
1634
+ });
1635
+ };
1636
+ this.duplicatePortal$ = (cloneRequest) => {
1637
+ return this.baseHttpService.api({
1638
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
1639
+ method: 'post',
1640
+ body: cloneRequest,
1641
+ });
1642
+ };
1643
+ this.getPortal$ = (id) => {
1644
+ return this.baseHttpService.api({
1645
+ url: `${this.serviceUrl}/${id}`,
1646
+ });
1647
+ };
1648
+ }
1649
+ createNewPortal$(body) {
1650
+ return this.baseHttpService.api({
1651
+ url: `${this.serviceUrl}`,
1652
+ method: 'post',
1653
+ body,
1654
+ });
1655
+ }
1656
+ updatePortal$(portal, settings) {
1657
+ return this.baseHttpService.api({
1658
+ url: `${this.serviceUrl}/${portal.id}`,
1659
+ method: 'put',
1660
+ body: {
1661
+ ...portal,
1662
+ settings: JSON.stringify(settings),
1663
+ },
1664
+ });
1665
+ }
1666
+ }
1667
+ PortalsApiService.MAX_RESULTS = 60;
1668
+ PortalsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1669
+ PortalsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService });
1670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, decorators: [{
1671
+ type: Injectable
1672
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1673
+
1329
1674
  class PriceApiService {
1330
1675
  constructor(httpService) {
1331
1676
  this.httpService = httpService;
@@ -1473,6 +1818,12 @@ class ProceduresApiService {
1473
1818
  body,
1474
1819
  });
1475
1820
  }
1821
+ fetchDefaultPricingSteps$() {
1822
+ return this.baseHttpService.api({
1823
+ url: `${this.ADMIN_SERVICE_URL}/pricing-steps`,
1824
+ method: 'get',
1825
+ });
1826
+ }
1476
1827
  }
1477
1828
  ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1478
1829
  ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService });
@@ -1859,26 +2210,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1859
2210
  type: Injectable
1860
2211
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1861
2212
 
1862
- class QuoteApiService {
1863
- constructor(httpService) {
1864
- this.httpService = httpService;
1865
- this.SERVICE_URL = '/quotes';
1866
- }
1867
- // request quoteId | accountId | opportunityId | orderId
1868
- getQuoteDraft(objectId, params, errorHandler) {
1869
- return this.httpService.api({
1870
- method: 'get',
1871
- url: `${this.SERVICE_URL}/${objectId}`,
1872
- params,
1873
- errorHandler,
1874
- });
1875
- }
1876
- upsertQuote(request, options) {
1877
- return this.httpService.api({
1878
- method: 'post',
1879
- url: `${this.SERVICE_URL}`,
1880
- body: request,
1881
- ...options,
2213
+ class PromotionsApiService {
2214
+ constructor(baseHttpService) {
2215
+ this.baseHttpService = baseHttpService;
2216
+ this.serviceUrl = '/admin/promotion';
2217
+ this.fetchAll$ = () => {
2218
+ return this.baseHttpService.api({ url: this.serviceUrl });
2219
+ };
2220
+ this.fetchOne$ = (id) => {
2221
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2222
+ };
2223
+ this.remove$ = (id) => {
2224
+ return this.baseHttpService.api({
2225
+ url: `${this.serviceUrl}/${id}`,
2226
+ method: 'delete',
2227
+ });
2228
+ };
2229
+ this.restore$ = (id) => {
2230
+ return this.baseHttpService.api({
2231
+ method: 'patch',
2232
+ url: `${this.serviceUrl}/${id}/restore`,
2233
+ });
2234
+ };
2235
+ this.duplicate$ = (body) => {
2236
+ return this.baseHttpService
2237
+ .api({
2238
+ url: `${this.serviceUrl}/${body.id}/clone`,
2239
+ method: 'post',
2240
+ body,
2241
+ })
2242
+ .pipe(map$1(response => response.clonedRecordId));
2243
+ };
2244
+ }
2245
+ search$(expression, skip, count) {
2246
+ let params = new HttpParams();
2247
+ if (typeof skip === 'number') {
2248
+ params = params.set('skip', '' + skip);
2249
+ }
2250
+ if (typeof count === 'number') {
2251
+ params = params.set('count', '' + count);
2252
+ }
2253
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2254
+ }
2255
+ create$(body) {
2256
+ return this.baseHttpService.api({
2257
+ url: `${this.serviceUrl}`,
2258
+ method: 'post',
2259
+ body,
2260
+ });
2261
+ }
2262
+ update$(body) {
2263
+ return this.baseHttpService.api({
2264
+ url: `${this.serviceUrl}/${body.id}`,
2265
+ method: 'put',
2266
+ body,
2267
+ });
2268
+ }
2269
+ }
2270
+ PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2271
+ PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
2272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
2273
+ type: Injectable
2274
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2275
+
2276
+ class QuoteApiService {
2277
+ constructor(httpService) {
2278
+ this.httpService = httpService;
2279
+ this.SERVICE_URL = '/quotes';
2280
+ }
2281
+ // request quoteId | accountId | opportunityId | orderId
2282
+ getQuoteDraft(objectId, params, errorHandler) {
2283
+ return this.httpService.api({
2284
+ method: 'get',
2285
+ url: `${this.SERVICE_URL}/${objectId}`,
2286
+ params,
2287
+ errorHandler,
2288
+ });
2289
+ }
2290
+ upsertQuote(request, options) {
2291
+ return this.httpService.api({
2292
+ method: 'post',
2293
+ url: `${this.SERVICE_URL}`,
2294
+ body: request,
2295
+ ...options,
1882
2296
  });
1883
2297
  }
1884
2298
  submitQuote(request, options) {
@@ -1935,6 +2349,132 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1935
2349
  type: Injectable
1936
2350
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1937
2351
 
2352
+ class RebateProgramApiService {
2353
+ constructor(baseHttpService) {
2354
+ this.baseHttpService = baseHttpService;
2355
+ this.serviceUrl = '/admin/rebate-program';
2356
+ this.fetchAll$ = () => {
2357
+ return this.baseHttpService.api({ url: this.serviceUrl });
2358
+ };
2359
+ this.fetchOne$ = (id) => {
2360
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2361
+ };
2362
+ this.remove$ = (id) => {
2363
+ return this.baseHttpService.api({
2364
+ url: `${this.serviceUrl}/${id}`,
2365
+ method: 'delete',
2366
+ });
2367
+ };
2368
+ this.restore$ = (id) => {
2369
+ return this.baseHttpService.api({
2370
+ method: 'patch',
2371
+ url: `${this.serviceUrl}/${id}/restore`,
2372
+ });
2373
+ };
2374
+ this.duplicate$ = (body) => {
2375
+ return this.baseHttpService
2376
+ .api({
2377
+ url: `${this.serviceUrl}/${body.id}/clone`,
2378
+ method: 'post',
2379
+ body,
2380
+ })
2381
+ .pipe(map$1(response => response.clonedRecordId));
2382
+ };
2383
+ }
2384
+ search$(expression, skip, count) {
2385
+ let params = new HttpParams();
2386
+ if (typeof skip === 'number') {
2387
+ params = params.set('skip', '' + skip);
2388
+ }
2389
+ if (typeof count === 'number') {
2390
+ params = params.set('count', '' + count);
2391
+ }
2392
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2393
+ }
2394
+ create$(body) {
2395
+ return this.baseHttpService.api({
2396
+ url: `${this.serviceUrl}`,
2397
+ method: 'post',
2398
+ body,
2399
+ });
2400
+ }
2401
+ update$(body) {
2402
+ return this.baseHttpService.api({
2403
+ url: `${this.serviceUrl}/${body.id}`,
2404
+ method: 'put',
2405
+ body,
2406
+ });
2407
+ }
2408
+ }
2409
+ RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2410
+ RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
2411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
2412
+ type: Injectable
2413
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2414
+
2415
+ class RebateTypeApiService {
2416
+ constructor(baseHttpService) {
2417
+ this.baseHttpService = baseHttpService;
2418
+ this.serviceUrl = '/admin/rebate-type';
2419
+ this.fetchAll$ = () => {
2420
+ return this.baseHttpService.api({ url: this.serviceUrl });
2421
+ };
2422
+ this.fetchOne$ = (id) => {
2423
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2424
+ };
2425
+ this.remove$ = (id) => {
2426
+ return this.baseHttpService.api({
2427
+ url: `${this.serviceUrl}/${id}`,
2428
+ method: 'delete',
2429
+ });
2430
+ };
2431
+ this.restore$ = (id) => {
2432
+ return this.baseHttpService.api({
2433
+ method: 'patch',
2434
+ url: `${this.serviceUrl}/${id}/restore`,
2435
+ });
2436
+ };
2437
+ this.duplicate$ = (body) => {
2438
+ return this.baseHttpService
2439
+ .api({
2440
+ url: `${this.serviceUrl}/${body.id}/clone`,
2441
+ method: 'post',
2442
+ body,
2443
+ })
2444
+ .pipe(map$1(response => response.clonedRecordId));
2445
+ };
2446
+ }
2447
+ search$(expression, skip, count) {
2448
+ let params = new HttpParams();
2449
+ if (typeof skip === 'number') {
2450
+ params = params.set('skip', '' + skip);
2451
+ }
2452
+ if (typeof count === 'number') {
2453
+ params = params.set('count', '' + count);
2454
+ }
2455
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2456
+ }
2457
+ create$(body) {
2458
+ return this.baseHttpService.api({
2459
+ url: `${this.serviceUrl}`,
2460
+ method: 'post',
2461
+ body,
2462
+ });
2463
+ }
2464
+ update$(body) {
2465
+ return this.baseHttpService.api({
2466
+ url: `${this.serviceUrl}/${body.id}`,
2467
+ method: 'put',
2468
+ body,
2469
+ });
2470
+ }
2471
+ }
2472
+ RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2473
+ RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
2474
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
2475
+ type: Injectable
2476
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2477
+
1938
2478
  class RuleGroupsApiService {
1939
2479
  constructor(baseHttpService) {
1940
2480
  this.baseHttpService = baseHttpService;
@@ -2057,13 +2597,22 @@ class RulesApiService {
2057
2597
  });
2058
2598
  }
2059
2599
  execute$(body) {
2060
- const url = body.rule.ruleGroupType === RuleGroupTypes.eligibility ? '/rules/eligibility/execute' : '/rules/execute';
2600
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
2061
2601
  return this.baseHttpService.api({
2062
2602
  url,
2063
2603
  method: 'post',
2064
2604
  body,
2065
2605
  });
2066
2606
  }
2607
+ getExecuteRuleUrl(ruleGroupType) {
2608
+ if (ruleGroupType === RuleGroupTypes.eligibility) {
2609
+ return '/rules/eligibility/execute';
2610
+ }
2611
+ if (ruleGroupType === RuleGroupTypes.catalog) {
2612
+ return '/rules/catalog/execute';
2613
+ }
2614
+ return '/rules/execute';
2615
+ }
2067
2616
  }
2068
2617
  RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2069
2618
  RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService });
@@ -2113,11 +2662,13 @@ class ScriptsApiService {
2113
2662
  });
2114
2663
  };
2115
2664
  this.cloneScript$ = (cloneRequest) => {
2116
- return this.baseHttpService.api({
2665
+ return this.baseHttpService
2666
+ .api({
2117
2667
  url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
2118
2668
  method: 'post',
2119
2669
  body: cloneRequest,
2120
- });
2670
+ })
2671
+ .pipe(map(response => response.clonedRecordId));
2121
2672
  };
2122
2673
  this.removeScript$ = (id) => {
2123
2674
  return this.baseHttpService.api({
@@ -2519,6 +3070,11 @@ class UITemplatesApiService {
2519
3070
  this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
2520
3071
  ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
2521
3072
  };
3073
+ this.fetchComponentsAttachments$ = (templateId) => {
3074
+ return this.fetchComponents$(templateId).pipe(switchMap$1(components => {
3075
+ return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
3076
+ }));
3077
+ };
2522
3078
  this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
2523
3079
  return this.baseHttpService
2524
3080
  .api({
@@ -2607,6 +3163,15 @@ class VeloceObjectsApiService {
2607
3163
  url: `${this.serviceUrl}/${id}`,
2608
3164
  });
2609
3165
  };
3166
+ this.duplicateObject$ = (body) => {
3167
+ return this.baseHttpService
3168
+ .api({
3169
+ method: 'post',
3170
+ url: `${this.serviceUrl}/${body.id}/clone`,
3171
+ body,
3172
+ })
3173
+ .pipe(map(response => response.clonedRecordId));
3174
+ };
2610
3175
  this.restoreObject$ = (id) => {
2611
3176
  return this.baseHttpService.api({
2612
3177
  method: 'patch',
@@ -2651,194 +3216,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2651
3216
  type: Injectable
2652
3217
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2653
3218
 
2654
- class RebateProgramApiService {
2655
- constructor(baseHttpService) {
2656
- this.baseHttpService = baseHttpService;
2657
- this.serviceUrl = '/admin/rebate-program';
2658
- this.fetchAll$ = () => {
2659
- return this.baseHttpService.api({ url: this.serviceUrl });
2660
- };
2661
- this.fetchOne$ = (id) => {
2662
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2663
- };
2664
- this.remove$ = (id) => {
2665
- return this.baseHttpService.api({
2666
- url: `${this.serviceUrl}/${id}`,
2667
- method: 'delete',
2668
- });
2669
- };
2670
- this.restore$ = (id) => {
2671
- return this.baseHttpService.api({
2672
- method: 'patch',
2673
- url: `${this.serviceUrl}/${id}/restore`,
2674
- });
2675
- };
2676
- this.duplicate$ = (body) => {
2677
- return this.baseHttpService
2678
- .api({
2679
- url: `${this.serviceUrl}/${body.id}/clone`,
2680
- method: 'post',
2681
- body,
2682
- })
2683
- .pipe(map$1(response => response.clonedRecordId));
2684
- };
2685
- }
2686
- search$(expression, skip, count) {
2687
- let params = new HttpParams();
2688
- if (typeof skip === 'number') {
2689
- params = params.set('skip', '' + skip);
2690
- }
2691
- if (typeof count === 'number') {
2692
- params = params.set('count', '' + count);
2693
- }
2694
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2695
- }
2696
- create$(body) {
2697
- return this.baseHttpService.api({
2698
- url: `${this.serviceUrl}`,
2699
- method: 'post',
2700
- body,
3219
+ class SandboxManagerApiService {
3220
+ constructor(http) {
3221
+ this.http = http;
3222
+ this.TOKEN_HEADER = `signed_request=${encodeURIComponent(window.SANDBOX_TOKEN ?? '')}` ?? '';
3223
+ this.SANDBOX_URL_FALLBACK = 'https://sandbox-manager.velocecpq.com';
3224
+ this.hostUrl = `${window.VELO_SANDBOX_API ?? this.SANDBOX_URL_FALLBACK}/clients`;
3225
+ }
3226
+ getSalesforceOrganizations$() {
3227
+ return this.http.get(`${this.hostUrl}/${window.VELO_CLIENT}/orgs`, {
3228
+ headers: {
3229
+ 'Veloce-Token': this.TOKEN_HEADER,
3230
+ },
2701
3231
  });
2702
3232
  }
2703
- update$(body) {
2704
- return this.baseHttpService.api({
2705
- url: `${this.serviceUrl}/${body.id}`,
2706
- method: 'put',
2707
- body,
3233
+ getAvailableSalesforceOrganizationSizes$() {
3234
+ return this.http.get(`${this.hostUrl}/${window.VELO_CLIENT}/available-sizes`, {
3235
+ headers: {
3236
+ 'Veloce-Token': this.TOKEN_HEADER,
3237
+ },
2708
3238
  });
2709
3239
  }
2710
- }
2711
- RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2712
- RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
2713
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
2714
- type: Injectable
2715
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2716
-
2717
- class RebateTypeApiService {
2718
- constructor(baseHttpService) {
2719
- this.baseHttpService = baseHttpService;
2720
- this.serviceUrl = '/admin/rebate-type';
2721
- this.fetchAll$ = () => {
2722
- return this.baseHttpService.api({ url: this.serviceUrl });
2723
- };
2724
- this.fetchOne$ = (id) => {
2725
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2726
- };
2727
- this.remove$ = (id) => {
2728
- return this.baseHttpService.api({
2729
- url: `${this.serviceUrl}/${id}`,
2730
- method: 'delete',
2731
- });
2732
- };
2733
- this.restore$ = (id) => {
2734
- return this.baseHttpService.api({
2735
- method: 'patch',
2736
- url: `${this.serviceUrl}/${id}/restore`,
2737
- });
2738
- };
2739
- this.duplicate$ = (body) => {
2740
- return this.baseHttpService
2741
- .api({
2742
- url: `${this.serviceUrl}/${body.id}/clone`,
2743
- method: 'post',
2744
- body,
2745
- })
2746
- .pipe(map$1(response => response.clonedRecordId));
2747
- };
2748
- }
2749
- search$(expression, skip, count) {
2750
- let params = new HttpParams();
2751
- if (typeof skip === 'number') {
2752
- params = params.set('skip', '' + skip);
2753
- }
2754
- if (typeof count === 'number') {
2755
- params = params.set('count', '' + count);
2756
- }
2757
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2758
- }
2759
- create$(body) {
2760
- return this.baseHttpService.api({
2761
- url: `${this.serviceUrl}`,
2762
- method: 'post',
2763
- body,
3240
+ createSalesforceOrganization$(payload) {
3241
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs`, payload, {
3242
+ headers: {
3243
+ 'Veloce-Token': this.TOKEN_HEADER,
3244
+ },
2764
3245
  });
2765
3246
  }
2766
- update$(body) {
2767
- return this.baseHttpService.api({
2768
- url: `${this.serviceUrl}/${body.id}`,
2769
- method: 'put',
2770
- body,
3247
+ updateSalesforceOrganization$(payload) {
3248
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}`, payload, {
3249
+ headers: {
3250
+ 'Veloce-Token': this.TOKEN_HEADER,
3251
+ },
2771
3252
  });
2772
3253
  }
2773
- }
2774
- RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2775
- RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
2776
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
2777
- type: Injectable
2778
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2779
-
2780
- class PromotionsApiService {
2781
- constructor(baseHttpService) {
2782
- this.baseHttpService = baseHttpService;
2783
- this.serviceUrl = '/admin/promotion';
2784
- this.fetchAll$ = () => {
2785
- return this.baseHttpService.api({ url: this.serviceUrl });
2786
- };
2787
- this.fetchOne$ = (id) => {
2788
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2789
- };
2790
- this.remove$ = (id) => {
2791
- return this.baseHttpService.api({
2792
- url: `${this.serviceUrl}/${id}`,
2793
- method: 'delete',
2794
- });
2795
- };
2796
- this.restore$ = (id) => {
2797
- return this.baseHttpService.api({
2798
- method: 'patch',
2799
- url: `${this.serviceUrl}/${id}/restore`,
2800
- });
2801
- };
2802
- this.duplicate$ = (body) => {
2803
- return this.baseHttpService
2804
- .api({
2805
- url: `${this.serviceUrl}/${body.id}/clone`,
2806
- method: 'post',
2807
- body,
2808
- })
2809
- .pipe(map$1(response => response.clonedRecordId));
2810
- };
2811
- }
2812
- search$(expression, skip, count) {
2813
- let params = new HttpParams();
2814
- if (typeof skip === 'number') {
2815
- params = params.set('skip', '' + skip);
2816
- }
2817
- if (typeof count === 'number') {
2818
- params = params.set('count', '' + count);
2819
- }
2820
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
3254
+ deleteSalesforceOrganization$(payload) {
3255
+ return this.http.delete(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}`, {
3256
+ headers: {
3257
+ 'Veloce-Token': this.TOKEN_HEADER,
3258
+ },
3259
+ });
2821
3260
  }
2822
- create$(body) {
2823
- return this.baseHttpService.api({
2824
- url: `${this.serviceUrl}`,
2825
- method: 'post',
2826
- body,
3261
+ activateSalesforceOrganization$(payload) {
3262
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}/activate`, {}, {
3263
+ headers: {
3264
+ 'Veloce-Token': this.TOKEN_HEADER,
3265
+ },
2827
3266
  });
2828
3267
  }
2829
- update$(body) {
2830
- return this.baseHttpService.api({
2831
- url: `${this.serviceUrl}/${body.id}`,
2832
- method: 'put',
2833
- body,
3268
+ deactivateSalesforceOrganization$(payload) {
3269
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}/deactivate`, {}, {
3270
+ headers: {
3271
+ 'Veloce-Token': this.TOKEN_HEADER,
3272
+ },
2834
3273
  });
2835
3274
  }
2836
3275
  }
2837
- PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2838
- PromotionsApiServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
2839
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
3276
+ SandboxManagerApiService.MAX_RESULTS = 60;
3277
+ SandboxManagerApiServicefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3278
+ SandboxManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService });
3279
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, decorators: [{
2840
3280
  type: Injectable
2841
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
3281
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
2842
3282
 
2843
3283
  class ApiModule {
2844
3284
  }
@@ -2881,6 +3321,12 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
2881
3321
  RebateProgramApiService,
2882
3322
  RebateTypeApiService,
2883
3323
  PromotionsApiService,
3324
+ VeloceAuthService,
3325
+ ContractedPriceApiService,
3326
+ PortalsApiService,
3327
+ ConfigurationProcessorsApiService,
3328
+ FlowStateApiService,
3329
+ SandboxManagerApiService,
2884
3330
  ], imports: [HttpClientModule] });
2885
3331
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, decorators: [{
2886
3332
  type: NgModule,
@@ -2923,6 +3369,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2923
3369
  RebateProgramApiService,
2924
3370
  RebateTypeApiService,
2925
3371
  PromotionsApiService,
3372
+ VeloceAuthService,
3373
+ ContractedPriceApiService,
3374
+ PortalsApiService,
3375
+ ConfigurationProcessorsApiService,
3376
+ FlowStateApiService,
3377
+ SandboxManagerApiService,
2926
3378
  ],
2927
3379
  }]
2928
3380
  }] });
@@ -2931,5 +3383,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2931
3383
  * Generated bundle index. Do not edit.
2932
3384
  */
2933
3385
 
2934
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, PromotionsApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceObjectsApiService };
3386
+ export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, PromotionsApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, SandboxManagerApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceAuthService, VeloceObjectsApiService };
2935
3387
  //# sourceMappingURL=veloceapps-api.mjs.map