@veloceapps/api 8.0.0-8 → 8.0.0-81

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 (61) hide show
  1. package/esm2020/index.mjs +7 -2
  2. package/esm2020/lib/api.module.mjs +23 -8
  3. package/esm2020/lib/services/account-api.service.mjs +3 -3
  4. package/esm2020/lib/services/auth.service.mjs +22 -0
  5. package/esm2020/lib/services/catalog-admin-api.service.mjs +3 -3
  6. package/esm2020/lib/services/catalog-api.service.mjs +3 -3
  7. package/esm2020/lib/services/configuration-api.service.mjs +27 -13
  8. package/esm2020/lib/services/configuration-settings-api.service.mjs +3 -3
  9. package/esm2020/lib/services/context-api.service.mjs +3 -3
  10. package/esm2020/lib/services/contracted-price-api.service.mjs +45 -0
  11. package/esm2020/lib/services/delta-api.service.mjs +3 -3
  12. package/esm2020/lib/services/document-attachment-api.service.mjs +3 -3
  13. package/esm2020/lib/services/document-templates-api.service.mjs +5 -5
  14. package/esm2020/lib/services/endpoints-api.service.mjs +3 -3
  15. package/esm2020/lib/services/flows-api.service.mjs +3 -3
  16. package/esm2020/lib/services/guided-sellings-admin-api.service.mjs +3 -3
  17. package/esm2020/lib/services/guided-sellings-api.service.mjs +3 -3
  18. package/esm2020/lib/services/offers-api.service.mjs +3 -3
  19. package/esm2020/lib/services/org-info-api.service.mjs +3 -3
  20. package/esm2020/lib/services/picklists-api.service.mjs +3 -3
  21. package/esm2020/lib/services/portals-api.service.mjs +76 -0
  22. package/esm2020/lib/services/price-api.service.mjs +3 -3
  23. package/esm2020/lib/services/procedures-api.service.mjs +3 -3
  24. package/esm2020/lib/services/product-api.service.mjs +3 -3
  25. package/esm2020/lib/services/product-model-api.service.mjs +3 -3
  26. package/esm2020/lib/services/promotions-api.service.mjs +68 -0
  27. package/esm2020/lib/services/quote-api.service.mjs +3 -3
  28. package/esm2020/lib/services/ramp-api.service.mjs +3 -3
  29. package/esm2020/lib/services/rebate-program-api.service.mjs +68 -0
  30. package/esm2020/lib/services/rebate-type-api.service.mjs +68 -0
  31. package/esm2020/lib/services/rule-groups-api.service.mjs +3 -3
  32. package/esm2020/lib/services/rules-api.service.mjs +20 -7
  33. package/esm2020/lib/services/salesforce-api.service.mjs +6 -4
  34. package/esm2020/lib/services/scripts-api.service.mjs +3 -3
  35. package/esm2020/lib/services/shopping-cart-settings-api.service.mjs +3 -3
  36. package/esm2020/lib/services/stateful-configuration-api.mjs +3 -3
  37. package/esm2020/lib/services/ui-definitions-api.service.mjs +3 -3
  38. package/esm2020/lib/services/ui-templates-api.service.mjs +3 -3
  39. package/esm2020/lib/services/veloce-objects-api.service.mjs +14 -4
  40. package/esm2020/lib/types/auth.types.mjs +2 -0
  41. package/esm2020/lib/types/index.mjs +2 -1
  42. package/fesm2015/veloceapps-api.mjs +471 -154
  43. package/fesm2015/veloceapps-api.mjs.map +1 -1
  44. package/fesm2020/veloceapps-api.mjs +476 -153
  45. package/fesm2020/veloceapps-api.mjs.map +1 -1
  46. package/index.d.ts +6 -1
  47. package/lib/services/auth.service.d.ts +11 -0
  48. package/lib/services/configuration-api.service.d.ts +5 -0
  49. package/lib/services/contracted-price-api.service.d.ts +16 -0
  50. package/lib/services/portals-api.service.d.ts +20 -0
  51. package/lib/services/promotions-api.service.d.ts +19 -0
  52. package/lib/services/rebate-program-api.service.d.ts +19 -0
  53. package/lib/services/rebate-type-api.service.d.ts +19 -0
  54. package/lib/services/rules-api.service.d.ts +2 -1
  55. package/lib/services/salesforce-api.service.d.ts +1 -1
  56. package/lib/services/veloce-objects-api.service.d.ts +2 -1
  57. package/lib/types/auth.types.d.ts +4 -0
  58. package/lib/types/index.d.ts +1 -0
  59. package/package.json +1 -1
  60. package/esm2020/lib/services/rebate-api.service.mjs +0 -49
  61. package/lib/services/rebate-api.service.d.ts +0 -15
@@ -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, 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';
@@ -82,12 +82,30 @@ class AccountApiService {
82
82
  });
83
83
  }
84
84
  }
85
- AccountApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AccountApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
86
- AccountApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AccountApiService });
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AccountApiService, decorators: [{
85
+ AccountApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
86
+ AccountApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService });
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService, decorators: [{
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;
@@ -269,9 +287,9 @@ class CatalogAdminApiService {
269
287
  }
270
288
  }
271
289
  CatalogAdminApiService.MAX_RESULTS = 60;
272
- CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
273
- CatalogAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogAdminApiService });
274
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogAdminApiService, decorators: [{
290
+ CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
291
+ CatalogAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService });
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, decorators: [{
275
293
  type: Injectable
276
294
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
277
295
 
@@ -355,9 +373,9 @@ class CatalogApiService {
355
373
  });
356
374
  }
357
375
  }
358
- CatalogApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
359
- CatalogApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogApiService });
360
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogApiService, decorators: [{
376
+ CatalogApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
377
+ CatalogApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService });
378
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, decorators: [{
361
379
  type: Injectable
362
380
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
363
381
 
@@ -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
  }
@@ -416,7 +448,7 @@ class ConfigurationApiService {
416
448
  const portDomains = { ...lineItem.portDomains };
417
449
  for (const port of type?.ports ?? []) {
418
450
  const portDomain = portDomains[port.name];
419
- if (portDomain?.properties?.['domainComputation'] === 'false') {
451
+ if (portDomain?.properties?.['domainComputation'] === ('None')) {
420
452
  portDomain.domainTypes = port.domainTypes;
421
453
  }
422
454
  }
@@ -427,9 +459,9 @@ class ConfigurationApiService {
427
459
  };
428
460
  }
429
461
  }
430
- ConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
431
- ConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationApiService });
432
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationApiService, decorators: [{
462
+ ConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
463
+ ConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService });
464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, decorators: [{
433
465
  type: Injectable
434
466
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
435
467
 
@@ -537,9 +569,9 @@ class ConfigurationSettingsApiService {
537
569
  });
538
570
  }
539
571
  }
540
- ConfigurationSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationSettingsApiService, deps: [{ token: i1.BaseHttpService }, { token: i2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
541
- ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationSettingsApiService });
542
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
572
+ 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 });
573
+ ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
543
575
  type: Injectable
544
576
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i2.MessageService }]; } });
545
577
 
@@ -559,9 +591,50 @@ class ContextApiService {
559
591
  });
560
592
  }
561
593
  }
562
- ContextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
563
- ContextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextApiService });
564
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ContextApiService, decorators: [{
594
+ ContextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
595
+ ContextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService });
596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService, decorators: [{
597
+ type: Injectable
598
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
599
+
600
+ class ContractedPriceApiService {
601
+ constructor(baseHttpService) {
602
+ this.baseHttpService = baseHttpService;
603
+ this.serviceUrl = '/admin/contracted-price';
604
+ this.fetchContractedPrices$ = () => {
605
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
606
+ };
607
+ this.fetchContractedPrice$ = (id) => {
608
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
609
+ };
610
+ this.createContractedPrice$ = (data) => {
611
+ return this.baseHttpService.api({
612
+ url: `${this.serviceUrl}`,
613
+ method: 'put',
614
+ body: data,
615
+ });
616
+ };
617
+ this.updateContractedPrice$ = (data) => {
618
+ return this.baseHttpService.api({
619
+ url: `${this.serviceUrl}/${data.id}`,
620
+ method: 'put',
621
+ body: data,
622
+ });
623
+ };
624
+ this.searchContractedPrices$ = (searchParams, expression) => {
625
+ const params = new HttpParams({ fromObject: { ...searchParams } });
626
+ return this.baseHttpService.api({
627
+ method: 'post',
628
+ url: `${this.serviceUrl}/search`,
629
+ params,
630
+ body: expression || {},
631
+ });
632
+ };
633
+ }
634
+ }
635
+ ContractedPriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
636
+ ContractedPriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService });
637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, decorators: [{
565
638
  type: Injectable
566
639
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
567
640
 
@@ -579,9 +652,9 @@ class DeltaApiService {
579
652
  });
580
653
  }
581
654
  }
582
- DeltaApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DeltaApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
583
- DeltaApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DeltaApiService });
584
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DeltaApiService, decorators: [{
655
+ DeltaApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
656
+ DeltaApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService });
657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, decorators: [{
585
658
  type: Injectable
586
659
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
587
660
 
@@ -641,9 +714,9 @@ class DocumentAttachmentApiService {
641
714
  });
642
715
  }
643
716
  }
644
- DocumentAttachmentApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocumentAttachmentApiService, deps: [{ token: i1.BaseHttpService }, { token: i1.FileDownloadService }], target: i0.ɵɵFactoryTarget.Injectable });
645
- DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocumentAttachmentApiService });
646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
717
+ DocumentAttachmentApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, deps: [{ token: i1.BaseHttpService }, { token: i1.FileDownloadService }], target: i0.ɵɵFactoryTarget.Injectable });
718
+ DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService });
719
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
647
720
  type: Injectable
648
721
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
649
722
 
@@ -698,6 +771,8 @@ class SalesforceApiService {
698
771
  return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
699
772
  }
700
773
  apexGetRequest(path, params, options) {
774
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
775
+ // const httpParams = new HttpParams({ fromString: params.toString() });
701
776
  return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params, ...options });
702
777
  }
703
778
  apexPostRequest(path, body, options) {
@@ -721,9 +796,9 @@ class SalesforceApiService {
721
796
  });
722
797
  }
723
798
  }
724
- SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
725
- SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SalesforceApiService });
726
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SalesforceApiService, decorators: [{
799
+ SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
800
+ SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
801
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
727
802
  type: Injectable
728
803
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
729
804
 
@@ -989,7 +1064,7 @@ class DocumentTemplatesApiService {
989
1064
  const patternLimit = /(\s*limit\s\d*)/i;
990
1065
  let limit = 1;
991
1066
  if (statement && patternLimit.test(statement)) {
992
- const limitStr = statement?.match(patternLimit)?.[1].trim().substring(5).trim();
1067
+ const limitStr = statement?.match(patternLimit)?.[1]?.trim().substring(5).trim();
993
1068
  if (limitStr) {
994
1069
  limit = Number.parseInt(limitStr, 10);
995
1070
  }
@@ -1007,11 +1082,11 @@ class DocumentTemplatesApiService {
1007
1082
  return this.salesforceApiService.query(searchRequest, objectName).pipe(this.mapSfQueryResult(limit), map(value => ({ [resultObjectName]: value })));
1008
1083
  }
1009
1084
  }
1010
- DocumentTemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocumentTemplatesApiService, deps: [{ token: i1.BaseHttpService }, { token: SalesforceApiService }, { token: i1.FileDownloadService }, { token: DocumentAttachmentApiService }, { token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1011
- DocumentTemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocumentTemplatesApiService });
1012
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocumentTemplatesApiService, decorators: [{
1085
+ 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 });
1086
+ DocumentTemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService });
1087
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService, decorators: [{
1013
1088
  type: Injectable
1014
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: SalesforceApiService }, { type: i1.FileDownloadService }, { type: DocumentAttachmentApiService }, { type: i4.HttpClient }]; } });
1089
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: SalesforceApiService }, { type: i1.FileDownloadService }, { type: DocumentAttachmentApiService }, { type: i1$1.HttpClient }]; } });
1015
1090
 
1016
1091
  class EndpointsApiService {
1017
1092
  constructor(baseHttpService) {
@@ -1082,9 +1157,9 @@ class EndpointsApiService {
1082
1157
  });
1083
1158
  }
1084
1159
  }
1085
- EndpointsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EndpointsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1086
- EndpointsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EndpointsApiService });
1087
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EndpointsApiService, decorators: [{
1160
+ EndpointsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1161
+ EndpointsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService });
1162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, decorators: [{
1088
1163
  type: Injectable
1089
1164
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1090
1165
 
@@ -1102,9 +1177,9 @@ class FlowsApiService {
1102
1177
  .pipe(map((flow) => (flow?.value ? JSON.parse(flow.value) : [])));
1103
1178
  }
1104
1179
  }
1105
- FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1106
- FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowsApiService });
1107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FlowsApiService, decorators: [{
1180
+ FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1181
+ FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
1182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
1108
1183
  type: Injectable
1109
1184
  }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
1110
1185
 
@@ -1163,9 +1238,9 @@ class GuidedSellingsAdminApiService {
1163
1238
  }
1164
1239
  }
1165
1240
  GuidedSellingsAdminApiService.MAX_RESULTS = 60;
1166
- GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1167
- GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingsAdminApiService });
1168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
1241
+ GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1242
+ GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService });
1243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
1169
1244
  type: Injectable
1170
1245
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1171
1246
 
@@ -1195,9 +1270,9 @@ class GuidedSellingApiService {
1195
1270
  });
1196
1271
  }
1197
1272
  }
1198
- GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1199
- GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingApiService });
1200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingApiService, decorators: [{
1273
+ GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1274
+ GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService });
1275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, decorators: [{
1201
1276
  type: Injectable
1202
1277
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1203
1278
 
@@ -1266,9 +1341,9 @@ class OffersApiService {
1266
1341
  }
1267
1342
  }
1268
1343
  OffersApiService.MAX_RESULTS = 60;
1269
- OffersApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: OffersApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1270
- OffersApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: OffersApiService });
1271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: OffersApiService, decorators: [{
1344
+ OffersApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1345
+ OffersApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService });
1346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService, decorators: [{
1272
1347
  type: Injectable
1273
1348
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1274
1349
 
@@ -1282,11 +1357,11 @@ class OrgInfoApiService {
1282
1357
  return this.http.get(`${this.hostUrl}/org-info/${organizationId}`);
1283
1358
  }
1284
1359
  }
1285
- OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1286
- OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: OrgInfoApiService });
1287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: OrgInfoApiService, decorators: [{
1360
+ 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 });
1361
+ OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
1362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
1288
1363
  type: Injectable
1289
- }], ctorParameters: function () { return [{ type: i4.HttpClient }]; } });
1364
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
1290
1365
 
1291
1366
  class PicklistsApiService {
1292
1367
  constructor(baseHttpService) {
@@ -1320,9 +1395,9 @@ class PicklistsApiService {
1320
1395
  };
1321
1396
  }
1322
1397
  }
1323
- PicklistsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PicklistsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1324
- PicklistsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PicklistsApiService });
1325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PicklistsApiService, decorators: [{
1398
+ PicklistsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1399
+ PicklistsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService });
1400
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, decorators: [{
1326
1401
  type: Injectable
1327
1402
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1328
1403
 
@@ -1380,9 +1455,9 @@ class PriceApiService {
1380
1455
  });
1381
1456
  }
1382
1457
  }
1383
- PriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1384
- PriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PriceApiService });
1385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PriceApiService, decorators: [{
1458
+ PriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1459
+ PriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService });
1460
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, decorators: [{
1386
1461
  type: Injectable
1387
1462
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1388
1463
 
@@ -1474,9 +1549,9 @@ class ProceduresApiService {
1474
1549
  });
1475
1550
  }
1476
1551
  }
1477
- ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1478
- ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProceduresApiService });
1479
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProceduresApiService, decorators: [{
1552
+ ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1553
+ ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService });
1554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, decorators: [{
1480
1555
  type: Injectable
1481
1556
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1482
1557
 
@@ -1622,9 +1697,9 @@ class ProductApiService {
1622
1697
  return `${this.serviceUrl}/${productId}/image`;
1623
1698
  }
1624
1699
  }
1625
- ProductApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1626
- ProductApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductApiService });
1627
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductApiService, decorators: [{
1700
+ ProductApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1701
+ ProductApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService });
1702
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, decorators: [{
1628
1703
  type: Injectable
1629
1704
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1630
1705
 
@@ -1853,9 +1928,72 @@ class ProductModelApiService {
1853
1928
  }
1854
1929
  }
1855
1930
  ProductModelApiService.MAX_RESULTS = 200;
1856
- ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1857
- ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductModelApiService });
1858
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductModelApiService, decorators: [{
1931
+ ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1932
+ ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService });
1933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, decorators: [{
1934
+ type: Injectable
1935
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1936
+
1937
+ class PromotionsApiService {
1938
+ constructor(baseHttpService) {
1939
+ this.baseHttpService = baseHttpService;
1940
+ this.serviceUrl = '/admin/promotion';
1941
+ this.fetchAll$ = () => {
1942
+ return this.baseHttpService.api({ url: this.serviceUrl });
1943
+ };
1944
+ this.fetchOne$ = (id) => {
1945
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
1946
+ };
1947
+ this.remove$ = (id) => {
1948
+ return this.baseHttpService.api({
1949
+ url: `${this.serviceUrl}/${id}`,
1950
+ method: 'delete',
1951
+ });
1952
+ };
1953
+ this.restore$ = (id) => {
1954
+ return this.baseHttpService.api({
1955
+ method: 'patch',
1956
+ url: `${this.serviceUrl}/${id}/restore`,
1957
+ });
1958
+ };
1959
+ this.duplicate$ = (body) => {
1960
+ return this.baseHttpService
1961
+ .api({
1962
+ url: `${this.serviceUrl}/${body.id}/clone`,
1963
+ method: 'post',
1964
+ body,
1965
+ })
1966
+ .pipe(map$1(response => response.clonedRecordId));
1967
+ };
1968
+ }
1969
+ search$(expression, skip, count) {
1970
+ let params = new HttpParams();
1971
+ if (typeof skip === 'number') {
1972
+ params = params.set('skip', '' + skip);
1973
+ }
1974
+ if (typeof count === 'number') {
1975
+ params = params.set('count', '' + count);
1976
+ }
1977
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
1978
+ }
1979
+ create$(body) {
1980
+ return this.baseHttpService.api({
1981
+ url: `${this.serviceUrl}`,
1982
+ method: 'post',
1983
+ body,
1984
+ });
1985
+ }
1986
+ update$(body) {
1987
+ return this.baseHttpService.api({
1988
+ url: `${this.serviceUrl}/${body.id}`,
1989
+ method: 'put',
1990
+ body,
1991
+ });
1992
+ }
1993
+ }
1994
+ PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1995
+ PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
1996
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
1859
1997
  type: Injectable
1860
1998
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1861
1999
 
@@ -1901,9 +2039,9 @@ class QuoteApiService {
1901
2039
  });
1902
2040
  }
1903
2041
  }
1904
- QuoteApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: QuoteApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1905
- QuoteApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: QuoteApiService });
1906
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: QuoteApiService, decorators: [{
2042
+ QuoteApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2043
+ QuoteApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService });
2044
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService, decorators: [{
1907
2045
  type: Injectable
1908
2046
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1909
2047
 
@@ -1929,9 +2067,135 @@ class RampApiService {
1929
2067
  });
1930
2068
  }
1931
2069
  }
1932
- RampApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RampApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1933
- RampApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RampApiService });
1934
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RampApiService, decorators: [{
2070
+ RampApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2071
+ RampApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService });
2072
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, decorators: [{
2073
+ type: Injectable
2074
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2075
+
2076
+ class RebateProgramApiService {
2077
+ constructor(baseHttpService) {
2078
+ this.baseHttpService = baseHttpService;
2079
+ this.serviceUrl = '/admin/rebate-program';
2080
+ this.fetchAll$ = () => {
2081
+ return this.baseHttpService.api({ url: this.serviceUrl });
2082
+ };
2083
+ this.fetchOne$ = (id) => {
2084
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2085
+ };
2086
+ this.remove$ = (id) => {
2087
+ return this.baseHttpService.api({
2088
+ url: `${this.serviceUrl}/${id}`,
2089
+ method: 'delete',
2090
+ });
2091
+ };
2092
+ this.restore$ = (id) => {
2093
+ return this.baseHttpService.api({
2094
+ method: 'patch',
2095
+ url: `${this.serviceUrl}/${id}/restore`,
2096
+ });
2097
+ };
2098
+ this.duplicate$ = (body) => {
2099
+ return this.baseHttpService
2100
+ .api({
2101
+ url: `${this.serviceUrl}/${body.id}/clone`,
2102
+ method: 'post',
2103
+ body,
2104
+ })
2105
+ .pipe(map$1(response => response.clonedRecordId));
2106
+ };
2107
+ }
2108
+ search$(expression, skip, count) {
2109
+ let params = new HttpParams();
2110
+ if (typeof skip === 'number') {
2111
+ params = params.set('skip', '' + skip);
2112
+ }
2113
+ if (typeof count === 'number') {
2114
+ params = params.set('count', '' + count);
2115
+ }
2116
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2117
+ }
2118
+ create$(body) {
2119
+ return this.baseHttpService.api({
2120
+ url: `${this.serviceUrl}`,
2121
+ method: 'post',
2122
+ body,
2123
+ });
2124
+ }
2125
+ update$(body) {
2126
+ return this.baseHttpService.api({
2127
+ url: `${this.serviceUrl}/${body.id}`,
2128
+ method: 'put',
2129
+ body,
2130
+ });
2131
+ }
2132
+ }
2133
+ RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2134
+ RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
2135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
2136
+ type: Injectable
2137
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2138
+
2139
+ class RebateTypeApiService {
2140
+ constructor(baseHttpService) {
2141
+ this.baseHttpService = baseHttpService;
2142
+ this.serviceUrl = '/admin/rebate-type';
2143
+ this.fetchAll$ = () => {
2144
+ return this.baseHttpService.api({ url: this.serviceUrl });
2145
+ };
2146
+ this.fetchOne$ = (id) => {
2147
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2148
+ };
2149
+ this.remove$ = (id) => {
2150
+ return this.baseHttpService.api({
2151
+ url: `${this.serviceUrl}/${id}`,
2152
+ method: 'delete',
2153
+ });
2154
+ };
2155
+ this.restore$ = (id) => {
2156
+ return this.baseHttpService.api({
2157
+ method: 'patch',
2158
+ url: `${this.serviceUrl}/${id}/restore`,
2159
+ });
2160
+ };
2161
+ this.duplicate$ = (body) => {
2162
+ return this.baseHttpService
2163
+ .api({
2164
+ url: `${this.serviceUrl}/${body.id}/clone`,
2165
+ method: 'post',
2166
+ body,
2167
+ })
2168
+ .pipe(map$1(response => response.clonedRecordId));
2169
+ };
2170
+ }
2171
+ search$(expression, skip, count) {
2172
+ let params = new HttpParams();
2173
+ if (typeof skip === 'number') {
2174
+ params = params.set('skip', '' + skip);
2175
+ }
2176
+ if (typeof count === 'number') {
2177
+ params = params.set('count', '' + count);
2178
+ }
2179
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2180
+ }
2181
+ create$(body) {
2182
+ return this.baseHttpService.api({
2183
+ url: `${this.serviceUrl}`,
2184
+ method: 'post',
2185
+ body,
2186
+ });
2187
+ }
2188
+ update$(body) {
2189
+ return this.baseHttpService.api({
2190
+ url: `${this.serviceUrl}/${body.id}`,
2191
+ method: 'put',
2192
+ body,
2193
+ });
2194
+ }
2195
+ }
2196
+ RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2197
+ RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
2198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
1935
2199
  type: Injectable
1936
2200
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1937
2201
 
@@ -1985,9 +2249,9 @@ class RuleGroupsApiService {
1985
2249
  };
1986
2250
  }
1987
2251
  }
1988
- RuleGroupsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuleGroupsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1989
- RuleGroupsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuleGroupsApiService });
1990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RuleGroupsApiService, decorators: [{
2252
+ RuleGroupsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2253
+ RuleGroupsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService });
2254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService, decorators: [{
1991
2255
  type: Injectable
1992
2256
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1993
2257
 
@@ -2000,8 +2264,12 @@ class RulesApiService {
2000
2264
  };
2001
2265
  this.searchRules$ = (expression, skip, count) => {
2002
2266
  let params = new HttpParams();
2003
- params = params.set('skip', '' + skip);
2004
- params = params.set('count', '' + count);
2267
+ if (typeof skip === 'number') {
2268
+ params = params.set('skip', '' + skip);
2269
+ }
2270
+ if (typeof count === 'number') {
2271
+ params = params.set('count', '' + count);
2272
+ }
2005
2273
  return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2006
2274
  };
2007
2275
  this.createRule$ = (rule) => {
@@ -2053,17 +2321,26 @@ class RulesApiService {
2053
2321
  });
2054
2322
  }
2055
2323
  execute$(body) {
2056
- const url = body.rule.ruleGroupType === RuleGroupTypes.eligibility ? '/rules/eligibility/execute' : '/rules/execute';
2324
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
2057
2325
  return this.baseHttpService.api({
2058
2326
  url,
2059
2327
  method: 'post',
2060
2328
  body,
2061
2329
  });
2062
2330
  }
2331
+ getExecuteRuleUrl(ruleGroupType) {
2332
+ if (ruleGroupType === RuleGroupTypes.eligibility) {
2333
+ return '/rules/eligibility/execute';
2334
+ }
2335
+ if (ruleGroupType === RuleGroupTypes.catalog) {
2336
+ return '/rules/catalog/execute';
2337
+ }
2338
+ return '/rules/execute';
2339
+ }
2063
2340
  }
2064
- RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2065
- RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RulesApiService });
2066
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RulesApiService, decorators: [{
2341
+ RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2342
+ RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService });
2343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, decorators: [{
2067
2344
  type: Injectable
2068
2345
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2069
2346
 
@@ -2137,9 +2414,9 @@ class ScriptsApiService {
2137
2414
  };
2138
2415
  }
2139
2416
  }
2140
- ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2141
- ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ScriptsApiService });
2142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ScriptsApiService, decorators: [{
2417
+ ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2418
+ ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService });
2419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, decorators: [{
2143
2420
  type: Injectable
2144
2421
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2145
2422
 
@@ -2160,9 +2437,9 @@ class ShoppingCartSettingsApiService {
2160
2437
  }, {})));
2161
2438
  }
2162
2439
  }
2163
- ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2164
- ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartSettingsApiService });
2165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
2440
+ ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2441
+ ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
2442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
2166
2443
  type: Injectable
2167
2444
  }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
2168
2445
 
@@ -2208,9 +2485,9 @@ class StatefulConfigurationApiService {
2208
2485
  });
2209
2486
  }
2210
2487
  }
2211
- StatefulConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: StatefulConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2212
- StatefulConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: StatefulConfigurationApiService });
2213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: StatefulConfigurationApiService, decorators: [{
2488
+ StatefulConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2489
+ StatefulConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService });
2490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService, decorators: [{
2214
2491
  type: Injectable
2215
2492
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2216
2493
 
@@ -2277,9 +2554,9 @@ class UIDefinitionsApiService {
2277
2554
  return `/models/${modelId}/uidefinitions`;
2278
2555
  }
2279
2556
  }
2280
- UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2281
- UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService });
2282
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
2557
+ UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2558
+ UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService });
2559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
2283
2560
  type: Injectable
2284
2561
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2285
2562
 
@@ -2565,9 +2842,9 @@ class UITemplatesApiService {
2565
2842
  });
2566
2843
  }
2567
2844
  }
2568
- UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2569
- UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UITemplatesApiService });
2570
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UITemplatesApiService, decorators: [{
2845
+ UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2846
+ UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService });
2847
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, decorators: [{
2571
2848
  type: Injectable
2572
2849
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2573
2850
 
@@ -2603,6 +2880,15 @@ class VeloceObjectsApiService {
2603
2880
  url: `${this.serviceUrl}/${id}`,
2604
2881
  });
2605
2882
  };
2883
+ this.duplicateObject$ = (body) => {
2884
+ return this.baseHttpService
2885
+ .api({
2886
+ method: 'post',
2887
+ url: `${this.serviceUrl}/${body.id}/clone`,
2888
+ body,
2889
+ })
2890
+ .pipe(map(response => response.clonedRecordId));
2891
+ };
2606
2892
  this.restoreObject$ = (id) => {
2607
2893
  return this.baseHttpService.api({
2608
2894
  method: 'patch',
@@ -2641,62 +2927,89 @@ class VeloceObjectsApiService {
2641
2927
  });
2642
2928
  }
2643
2929
  }
2644
- VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2645
- VeloceObjectsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService });
2646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService, decorators: [{
2930
+ VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2931
+ VeloceObjectsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService });
2932
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, decorators: [{
2647
2933
  type: Injectable
2648
2934
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2649
2935
 
2650
- const rebatePrograms = [
2651
- // todo remove when api ready DM-1150
2652
- {
2653
- id: '1',
2654
- name: 'First Rebate Program',
2655
- eligibleAccounts: 'a188B000000M1zoQAC',
2656
- active: false,
2657
- endDate: '2023-12-31',
2658
- startDate: '2023-01-01',
2659
- payoutFrequency: 'UOM_MILE',
2660
- },
2661
- ];
2662
- class RebateApiService {
2936
+ class PortalsApiService {
2663
2937
  constructor(baseHttpService) {
2664
2938
  this.baseHttpService = baseHttpService;
2665
- this.serviceUrl = '/admin/rebates';
2666
- }
2667
- fetchPrograms$() {
2668
- //return of([]);
2669
- return of([...rebatePrograms]);
2670
- //return this.baseHttpService.api<RebateProgram[]>({ url: `${this.serviceUrl}` });
2671
- }
2672
- removeProgram$(id) {
2673
- return of(null);
2674
- }
2675
- fetchProgram$(id) {
2676
- return of({ ...rebatePrograms[0], id });
2677
- // return this.baseHttpService.api({
2678
- // url: `${this.serviceUrl}/${id}`,
2679
- // method: 'get',
2680
- // });
2939
+ this.serviceUrl = '/admin/portal';
2940
+ this.getPortals$ = (skip = 1, name = '') => {
2941
+ let params = new HttpParams();
2942
+ params = params.append('count', (PortalsApiService.MAX_RESULTS * skip).toString());
2943
+ params = params.append('skip', '0');
2944
+ params = params.append('name', name);
2945
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
2946
+ };
2947
+ this.searchPortals$ = (skip = 0, expression) => {
2948
+ let params = new HttpParams();
2949
+ params = params.set('skip', '' + skip);
2950
+ params = params.set('count', '' + PortalsApiService.MAX_RESULTS);
2951
+ return this.baseHttpService.api({
2952
+ method: 'post',
2953
+ url: `${this.serviceUrl}/search`,
2954
+ params,
2955
+ body: expression || {},
2956
+ });
2957
+ };
2958
+ this.removePortal$ = (id) => {
2959
+ return this.baseHttpService.api({
2960
+ url: `${this.serviceUrl}/${id}`,
2961
+ method: 'delete',
2962
+ });
2963
+ };
2964
+ this.restore$ = (id) => {
2965
+ return this.baseHttpService.api({
2966
+ method: 'patch',
2967
+ url: `${this.serviceUrl}/${id}/restore`,
2968
+ });
2969
+ };
2970
+ this.duplicatePortal$ = (cloneRequest) => {
2971
+ return this.baseHttpService.api({
2972
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
2973
+ method: 'post',
2974
+ body: cloneRequest,
2975
+ });
2976
+ };
2977
+ this.getPortal$ = (id) => {
2978
+ return this.baseHttpService.api({
2979
+ url: `${this.serviceUrl}/${id}`,
2980
+ });
2981
+ };
2681
2982
  }
2682
- createProgram$(data) {
2683
- return of({ ...rebatePrograms[0], id: Math.random() + '' });
2983
+ createNewPortal$(body) {
2984
+ return this.baseHttpService.api({
2985
+ url: `${this.serviceUrl}`,
2986
+ method: 'post',
2987
+ body,
2988
+ });
2684
2989
  }
2685
- updateProgram$(data) {
2686
- return of({ ...data });
2990
+ updatePortal$(portal, settings) {
2991
+ return this.baseHttpService.api({
2992
+ url: `${this.serviceUrl}/${portal.id}`,
2993
+ method: 'put',
2994
+ body: {
2995
+ ...portal,
2996
+ settings: JSON.stringify(settings),
2997
+ },
2998
+ });
2687
2999
  }
2688
3000
  }
2689
- RebateApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RebateApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2690
- RebateApiServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RebateApiService });
2691
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RebateApiService, decorators: [{
3001
+ PortalsApiService.MAX_RESULTS = 60;
3002
+ PortalsApiServicefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
3003
+ PortalsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService });
3004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, decorators: [{
2692
3005
  type: Injectable
2693
3006
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2694
3007
 
2695
3008
  class ApiModule {
2696
3009
  }
2697
- ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2698
- ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, imports: [HttpClientModule] });
2699
- ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, providers: [
3010
+ ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3011
+ ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, imports: [HttpClientModule] });
3012
+ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, providers: [
2700
3013
  BaseHttpService,
2701
3014
  XrayService,
2702
3015
  ConfigurationApiService,
@@ -2730,9 +3043,14 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
2730
3043
  UIDefinitionsApiService,
2731
3044
  VeloceObjectsApiService,
2732
3045
  StatefulConfigurationApiService,
2733
- RebateApiService,
3046
+ RebateProgramApiService,
3047
+ RebateTypeApiService,
3048
+ PromotionsApiService,
3049
+ VeloceAuthService,
3050
+ ContractedPriceApiService,
3051
+ PortalsApiService,
2734
3052
  ], imports: [HttpClientModule] });
2735
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, decorators: [{
3053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, decorators: [{
2736
3054
  type: NgModule,
2737
3055
  args: [{
2738
3056
  imports: [HttpClientModule],
@@ -2770,7 +3088,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2770
3088
  UIDefinitionsApiService,
2771
3089
  VeloceObjectsApiService,
2772
3090
  StatefulConfigurationApiService,
2773
- RebateApiService,
3091
+ RebateProgramApiService,
3092
+ RebateTypeApiService,
3093
+ PromotionsApiService,
3094
+ VeloceAuthService,
3095
+ ContractedPriceApiService,
3096
+ PortalsApiService,
2774
3097
  ],
2775
3098
  }]
2776
3099
  }] });
@@ -2779,5 +3102,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2779
3102
  * Generated bundle index. Do not edit.
2780
3103
  */
2781
3104
 
2782
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, QuoteApiService, RampApiService, RebateApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceObjectsApiService };
3105
+ export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, PromotionsApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceAuthService, VeloceObjectsApiService };
2783
3106
  //# sourceMappingURL=veloceapps-api.mjs.map