@veloceapps/api 8.0.0-2 → 8.0.0-200

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 (81) hide show
  1. package/esm2020/index.mjs +10 -1
  2. package/esm2020/lib/api.module.mjs +32 -5
  3. package/esm2020/lib/services/account-api.service.mjs +11 -4
  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 +48 -15
  8. package/esm2020/lib/services/configuration-processors-api.service.mjs +38 -0
  9. package/esm2020/lib/services/configuration-settings-api.service.mjs +3 -3
  10. package/esm2020/lib/services/context-api.service.mjs +3 -3
  11. package/esm2020/lib/services/contracted-price-api.service.mjs +45 -0
  12. package/esm2020/lib/services/delta-api.service.mjs +3 -3
  13. package/esm2020/lib/services/document-attachment-api.service.mjs +3 -3
  14. package/esm2020/lib/services/document-templates-api.service.mjs +9 -7
  15. package/esm2020/lib/services/endpoints-api.service.mjs +3 -3
  16. package/esm2020/lib/services/flow-state-api.mjs +142 -0
  17. package/esm2020/lib/services/flows-api.service.mjs +12 -8
  18. package/esm2020/lib/services/guided-sellings-admin-api.service.mjs +3 -3
  19. package/esm2020/lib/services/guided-sellings-api.service.mjs +3 -3
  20. package/esm2020/lib/services/offers-api.service.mjs +3 -3
  21. package/esm2020/lib/services/org-info-api.service.mjs +47 -12
  22. package/esm2020/lib/services/picklists-api.service.mjs +3 -3
  23. package/esm2020/lib/services/portals-api.service.mjs +76 -0
  24. package/esm2020/lib/services/price-api.service.mjs +3 -3
  25. package/esm2020/lib/services/procedures-api.service.mjs +10 -4
  26. package/esm2020/lib/services/product-api.service.mjs +3 -3
  27. package/esm2020/lib/services/product-model-api.service.mjs +3 -3
  28. package/esm2020/lib/services/promotions-api.service.mjs +68 -0
  29. package/esm2020/lib/services/quote-api.service.mjs +21 -5
  30. package/esm2020/lib/services/ramp-api.service.mjs +3 -3
  31. package/esm2020/lib/services/rebate-program-api.service.mjs +68 -0
  32. package/esm2020/lib/services/rebate-type-api.service.mjs +68 -0
  33. package/esm2020/lib/services/rule-groups-api.service.mjs +3 -3
  34. package/esm2020/lib/services/rules-api.service.mjs +20 -7
  35. package/esm2020/lib/services/salesforce-api.service.mjs +7 -5
  36. package/esm2020/lib/services/sandbox-manager-api.service.mjs +94 -0
  37. package/esm2020/lib/services/scripts-api.service.mjs +15 -8
  38. package/esm2020/lib/services/shopping-cart-settings-api.service.mjs +3 -3
  39. package/esm2020/lib/services/stateful-configuration-api.mjs +4 -4
  40. package/esm2020/lib/services/ui-definitions-api.service.mjs +3 -3
  41. package/esm2020/lib/services/ui-templates-api.service.mjs +9 -4
  42. package/esm2020/lib/services/veloce-objects-api.service.mjs +14 -4
  43. package/esm2020/lib/types/auth.types.mjs +2 -0
  44. package/esm2020/lib/types/index.mjs +3 -1
  45. package/esm2020/lib/types/org-info.types.mjs +1 -1
  46. package/esm2020/lib/types/quote.types.mjs +2 -0
  47. package/esm2020/lib/types/stateful-configuration.types.mjs +1 -1
  48. package/esm2020/lib/utils/canvas.utils.mjs +33 -0
  49. package/fesm2015/veloceapps-api.mjs +891 -143
  50. package/fesm2015/veloceapps-api.mjs.map +1 -1
  51. package/fesm2020/veloceapps-api.mjs +906 -139
  52. package/fesm2020/veloceapps-api.mjs.map +1 -1
  53. package/index.d.ts +9 -0
  54. package/lib/services/account-api.service.d.ts +2 -1
  55. package/lib/services/auth.service.d.ts +11 -0
  56. package/lib/services/configuration-api.service.d.ts +5 -0
  57. package/lib/services/configuration-processors-api.service.d.ts +14 -0
  58. package/lib/services/contracted-price-api.service.d.ts +16 -0
  59. package/lib/services/flow-state-api.d.ts +84 -0
  60. package/lib/services/flows-api.service.d.ts +1 -1
  61. package/lib/services/org-info-api.service.d.ts +13 -7
  62. package/lib/services/portals-api.service.d.ts +20 -0
  63. package/lib/services/procedures-api.service.d.ts +1 -0
  64. package/lib/services/promotions-api.service.d.ts +19 -0
  65. package/lib/services/quote-api.service.d.ts +13 -6
  66. package/lib/services/rebate-program-api.service.d.ts +19 -0
  67. package/lib/services/rebate-type-api.service.d.ts +19 -0
  68. package/lib/services/rules-api.service.d.ts +2 -1
  69. package/lib/services/salesforce-api.service.d.ts +1 -1
  70. package/lib/services/sandbox-manager-api.service.d.ts +24 -0
  71. package/lib/services/scripts-api.service.d.ts +2 -2
  72. package/lib/services/stateful-configuration-api.d.ts +2 -2
  73. package/lib/services/ui-templates-api.service.d.ts +1 -0
  74. package/lib/services/veloce-objects-api.service.d.ts +2 -1
  75. package/lib/types/auth.types.d.ts +4 -0
  76. package/lib/types/index.d.ts +2 -0
  77. package/lib/types/org-info.types.d.ts +19 -0
  78. package/lib/types/quote.types.d.ts +8 -0
  79. package/lib/types/stateful-configuration.types.d.ts +1 -1
  80. package/lib/utils/canvas.utils.d.ts +18 -0
  81. package/package.json +1 -1
@@ -1,15 +1,15 @@
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';
7
- import { noop, throwError, of, zip, forkJoin, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
6
+ import { uiDefinitionFromDTO, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, toLatestFlow, isDefined, Operator, isApexError, isCanvasError, ModelTranslatorUtils, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
7
+ import { noop, throwError, of, zip, forkJoin, map as map$1, from, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
8
8
  import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
9
- import * as i2 from 'primeng/api';
9
+ import * as i1$2 from 'primeng/api';
10
10
  import { CurrencyPipe } from '@angular/common';
11
11
  import * as _ from 'lodash';
12
- import { omit } from 'lodash';
12
+ import { isArray, omit } from 'lodash';
13
13
  import moment from 'moment';
14
14
 
15
15
  class AccountApiService {
@@ -38,6 +38,13 @@ class AccountApiService {
38
38
  ...options,
39
39
  });
40
40
  }
41
+ getAssetsState(accountId, options) {
42
+ return this.httpService.api({
43
+ method: 'get',
44
+ url: `/v2${this.SERVICE_URL}/${accountId}/assets`,
45
+ ...options,
46
+ });
47
+ }
41
48
  getAssets(accountId, options) {
42
49
  return this.httpService.api({ url: `${this.SERVICE_URL}/${accountId}/assets`, ...options });
43
50
  }
@@ -82,12 +89,30 @@ class AccountApiService {
82
89
  });
83
90
  }
84
91
  }
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: [{
92
+ AccountApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
93
+ AccountApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService });
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService, decorators: [{
88
95
  type: Injectable
89
96
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
90
97
 
98
+ class VeloceAuthService {
99
+ constructor(http) {
100
+ this.http = http;
101
+ }
102
+ auth$(instanceUrl, accessToken) {
103
+ const headers = new HttpHeaders({
104
+ 'Content-Type': 'application/json',
105
+ Authorization: `Bearer ${accessToken}`,
106
+ });
107
+ return this.http.get(`${instanceUrl}/services/apexrest/VELOCPQ/veloce-auth`, { headers });
108
+ }
109
+ }
110
+ 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 });
111
+ VeloceAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService });
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService, decorators: [{
113
+ type: Injectable
114
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
115
+
91
116
  class CatalogAdminApiService {
92
117
  constructor(baseHttpService) {
93
118
  this.baseHttpService = baseHttpService;
@@ -269,9 +294,9 @@ class CatalogAdminApiService {
269
294
  }
270
295
  }
271
296
  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: [{
297
+ CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
298
+ CatalogAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService });
299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogAdminApiService, decorators: [{
275
300
  type: Injectable
276
301
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
277
302
 
@@ -355,9 +380,9 @@ class CatalogApiService {
355
380
  });
356
381
  }
357
382
  }
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: [{
383
+ CatalogApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
384
+ CatalogApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService });
385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogApiService, decorators: [{
361
386
  type: Injectable
362
387
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
363
388
 
@@ -386,6 +411,26 @@ class ConfigurationApiService {
386
411
  }
387
412
  }));
388
413
  }
414
+ customConfigurePrice({ url, configurationRequest, runtimeModel, }) {
415
+ return this.httpService
416
+ .api({
417
+ method: 'post',
418
+ url,
419
+ body: configurationRequest,
420
+ errorHandler: e => throwError(e),
421
+ })
422
+ .pipe(map(configurePrice => {
423
+ if (runtimeModel) {
424
+ return {
425
+ ...configurePrice,
426
+ lineItem: this.updatePortDomains(configurePrice.lineItem, runtimeModel),
427
+ };
428
+ }
429
+ else {
430
+ return configurePrice;
431
+ }
432
+ }));
433
+ }
389
434
  getRuntimeDataByProductId(productId, offeringId) {
390
435
  return this.httpService
391
436
  .api({
@@ -395,13 +440,7 @@ class ConfigurationApiService {
395
440
  .pipe(map(runtimeData => {
396
441
  return {
397
442
  ...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
- }),
443
+ uiDefinitions: runtimeData.uiDefinitions.map(dto => uiDefinitionFromDTO(dto)),
405
444
  };
406
445
  }));
407
446
  }
@@ -414,10 +453,29 @@ class ConfigurationApiService {
414
453
  updatePortDomains(lineItem, runtimeModel) {
415
454
  const type = runtimeModel.components.get(lineItem.type);
416
455
  const portDomains = { ...lineItem.portDomains };
456
+ // loop through ports to look for 'None' type domain computations
417
457
  for (const port of type?.ports ?? []) {
418
- const portDomain = portDomains[port.name];
419
- if (portDomain?.properties?.['domainComputation'] === 'false') {
420
- portDomain.domainTypes = port.domainTypes;
458
+ const { name: portName, type: typeName, min, max, domainTypes, properties } = port;
459
+ const portDomain = portDomains[portName];
460
+ if (portDomain) {
461
+ // there's a 'None' type domain computation
462
+ if (portDomain.properties?.['domainComputation'] === ('None')) {
463
+ portDomain.domainTypes = domainTypes;
464
+ }
465
+ }
466
+ else {
467
+ // there's no port domain so consider that as 'None' type domain computation
468
+ portDomains[portName] = {
469
+ name: portName,
470
+ type: typeName,
471
+ minCard: Number(min),
472
+ maxCard: Number(max),
473
+ domainTypes: domainTypes,
474
+ properties: {
475
+ ...properties,
476
+ domainComputation: 'None',
477
+ },
478
+ };
421
479
  }
422
480
  }
423
481
  return {
@@ -427,9 +485,44 @@ class ConfigurationApiService {
427
485
  };
428
486
  }
429
487
  }
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: [{
488
+ ConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
489
+ ConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService });
490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationApiService, decorators: [{
491
+ type: Injectable
492
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
493
+
494
+ class ConfigurationProcessorsApiService {
495
+ constructor(baseHttpService) {
496
+ this.baseHttpService = baseHttpService;
497
+ this.serviceUrl = '/configuration/processors/owners';
498
+ this.fetchConfigurationProcessors$ = (ownerId) => {
499
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${ownerId}` });
500
+ };
501
+ this.createConfigurationProcessors$ = (configurationProcessor) => {
502
+ return this.baseHttpService.api({
503
+ method: 'post',
504
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}`,
505
+ body: configurationProcessor,
506
+ });
507
+ };
508
+ this.updateConfigurationProcessors$ = (configurationProcessor) => {
509
+ return this.baseHttpService.api({
510
+ method: 'put',
511
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
512
+ body: configurationProcessor,
513
+ });
514
+ };
515
+ this.deleteConfigurationProcessors$ = (configurationProcessor) => {
516
+ return this.baseHttpService.api({
517
+ method: 'delete',
518
+ url: `${this.serviceUrl}/${configurationProcessor.ownerId}/${configurationProcessor.id}`,
519
+ });
520
+ };
521
+ }
522
+ }
523
+ ConfigurationProcessorsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
524
+ ConfigurationProcessorsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService });
525
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationProcessorsApiService, decorators: [{
433
526
  type: Injectable
434
527
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
435
528
 
@@ -537,11 +630,11 @@ class ConfigurationSettingsApiService {
537
630
  });
538
631
  }
539
632
  }
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: [{
633
+ ConfigurationSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, deps: [{ token: i1.BaseHttpService }, { token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
634
+ ConfigurationSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService });
635
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationSettingsApiService, decorators: [{
543
636
  type: Injectable
544
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i2.MessageService }]; } });
637
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1$2.MessageService }]; } });
545
638
 
546
639
  class ContextApiService {
547
640
  constructor(httpService) {
@@ -559,9 +652,50 @@ class ContextApiService {
559
652
  });
560
653
  }
561
654
  }
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: [{
655
+ ContextApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
656
+ ContextApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService });
657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContextApiService, decorators: [{
658
+ type: Injectable
659
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
660
+
661
+ class ContractedPriceApiService {
662
+ constructor(baseHttpService) {
663
+ this.baseHttpService = baseHttpService;
664
+ this.serviceUrl = '/admin/contracted-price';
665
+ this.fetchContractedPrices$ = () => {
666
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
667
+ };
668
+ this.fetchContractedPrice$ = (id) => {
669
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
670
+ };
671
+ this.createContractedPrice$ = (data) => {
672
+ return this.baseHttpService.api({
673
+ url: `${this.serviceUrl}`,
674
+ method: 'put',
675
+ body: data,
676
+ });
677
+ };
678
+ this.updateContractedPrice$ = (data) => {
679
+ return this.baseHttpService.api({
680
+ url: `${this.serviceUrl}/${data.id}`,
681
+ method: 'put',
682
+ body: data,
683
+ });
684
+ };
685
+ this.searchContractedPrices$ = (searchParams, expression) => {
686
+ const params = new HttpParams({ fromObject: { ...searchParams } });
687
+ return this.baseHttpService.api({
688
+ method: 'post',
689
+ url: `${this.serviceUrl}/search`,
690
+ params,
691
+ body: expression || {},
692
+ });
693
+ };
694
+ }
695
+ }
696
+ ContractedPriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
697
+ ContractedPriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService });
698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, decorators: [{
565
699
  type: Injectable
566
700
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
567
701
 
@@ -579,9 +713,9 @@ class DeltaApiService {
579
713
  });
580
714
  }
581
715
  }
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: [{
716
+ DeltaApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
717
+ DeltaApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService });
718
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DeltaApiService, decorators: [{
585
719
  type: Injectable
586
720
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
587
721
 
@@ -641,9 +775,9 @@ class DocumentAttachmentApiService {
641
775
  });
642
776
  }
643
777
  }
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: [{
778
+ 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 });
779
+ DocumentAttachmentApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService });
780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentAttachmentApiService, decorators: [{
647
781
  type: Injectable
648
782
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: i1.FileDownloadService }]; } });
649
783
 
@@ -698,7 +832,9 @@ class SalesforceApiService {
698
832
  return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
699
833
  }
700
834
  apexGetRequest(path, params, options) {
701
- return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params, ...options });
835
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
836
+ const httpParams = new HttpParams({ fromString: params.toString() });
837
+ return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams, ...options });
702
838
  }
703
839
  apexPostRequest(path, body, options) {
704
840
  return this.httpService.api({
@@ -721,9 +857,9 @@ class SalesforceApiService {
721
857
  });
722
858
  }
723
859
  }
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: [{
860
+ SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
861
+ SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
862
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
727
863
  type: Injectable
728
864
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
729
865
 
@@ -736,7 +872,7 @@ class DocumentTemplatesApiService {
736
872
  this.http = http;
737
873
  this.DOCGEN_TAG = 'docgen';
738
874
  this.SERVICE_URL = '/templates';
739
- this.DOC_GEN_URL_FALLBACK = 'https://dev-dp1.velocpq.com/docgen';
875
+ this.DOC_GEN_URL_FALLBACK = `${window.VELO_API}/docgen`;
740
876
  this.mapSfQueryResult = (limit) => map((records) => {
741
877
  if (!records.length) {
742
878
  return { _result: 'No Records Found' };
@@ -880,7 +1016,9 @@ class DocumentTemplatesApiService {
880
1016
  return zip(this.getTemplateFile(template.id), documentData$, this.resolveAttachments$(template)).pipe(switchMap(([templateFile, data, attachments]) => {
881
1017
  const document = DocxTemplater.generate(templateFile, data);
882
1018
  const properties = object?.context?.properties ?? object?.properties ?? {};
883
- const documentName = properties['Name'] || template.name;
1019
+ const documentName = template.properties?.find(({ name }) => name === 'documentName')?.value ||
1020
+ properties['Name'] ||
1021
+ template.name;
884
1022
  const documentFormat = params.documentFormat ?? template.properties?.find(p => p.name === 'documentFormat')?.value;
885
1023
  if (documentFormat === 'DOCX') {
886
1024
  this.fileDownloadService.processDownload(document, documentName);
@@ -989,7 +1127,7 @@ class DocumentTemplatesApiService {
989
1127
  const patternLimit = /(\s*limit\s\d*)/i;
990
1128
  let limit = 1;
991
1129
  if (statement && patternLimit.test(statement)) {
992
- const limitStr = statement?.match(patternLimit)?.[1].trim().substring(5).trim();
1130
+ const limitStr = statement?.match(patternLimit)?.[1]?.trim().substring(5).trim();
993
1131
  if (limitStr) {
994
1132
  limit = Number.parseInt(limitStr, 10);
995
1133
  }
@@ -1007,11 +1145,11 @@ class DocumentTemplatesApiService {
1007
1145
  return this.salesforceApiService.query(searchRequest, objectName).pipe(this.mapSfQueryResult(limit), map(value => ({ [resultObjectName]: value })));
1008
1146
  }
1009
1147
  }
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: [{
1148
+ 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 });
1149
+ DocumentTemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService });
1150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService, decorators: [{
1013
1151
  type: Injectable
1014
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: SalesforceApiService }, { type: i1.FileDownloadService }, { type: DocumentAttachmentApiService }, { type: i4.HttpClient }]; } });
1152
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }, { type: SalesforceApiService }, { type: i1.FileDownloadService }, { type: DocumentAttachmentApiService }, { type: i1$1.HttpClient }]; } });
1015
1153
 
1016
1154
  class EndpointsApiService {
1017
1155
  constructor(baseHttpService) {
@@ -1082,9 +1220,148 @@ class EndpointsApiService {
1082
1220
  });
1083
1221
  }
1084
1222
  }
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: [{
1223
+ EndpointsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1224
+ EndpointsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService });
1225
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EndpointsApiService, decorators: [{
1226
+ type: Injectable
1227
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1228
+
1229
+ class FlowStateApiService {
1230
+ constructor(httpService) {
1231
+ this.httpService = httpService;
1232
+ this.SERVICE_URL = '/configuration/states';
1233
+ }
1234
+ /**
1235
+ * Initialize flow state
1236
+ * @param request Request
1237
+ * @returns Flow initialization response, which contains session ID and result of selectors
1238
+ */
1239
+ init(request) {
1240
+ return this.httpService.api({
1241
+ method: 'post',
1242
+ url: `${this.SERVICE_URL}/quote/start`,
1243
+ body: request,
1244
+ });
1245
+ }
1246
+ /**
1247
+ * Get existing state by ID
1248
+ * @param id ID
1249
+ * @returns Flow State
1250
+ */
1251
+ get(id) {
1252
+ return this.httpService.api({
1253
+ url: `${this.SERVICE_URL}/${id}`,
1254
+ });
1255
+ }
1256
+ /**
1257
+ * Execute actions/selectors
1258
+ * @param id State ID
1259
+ * @param request Request
1260
+ * @returns Execute result
1261
+ */
1262
+ execute(id, request) {
1263
+ return this.httpService.api({
1264
+ method: 'post',
1265
+ url: `${this.SERVICE_URL}/quote/${id}/execute`,
1266
+ body: request,
1267
+ });
1268
+ }
1269
+ /**
1270
+ * Save Quote in the state
1271
+ * @param id State ID
1272
+ */
1273
+ save(id) {
1274
+ return this.httpService.api({
1275
+ method: 'post',
1276
+ url: `${this.SERVICE_URL}/quote/${id}/save`,
1277
+ });
1278
+ }
1279
+ /**
1280
+ * Submit Quote in the state
1281
+ * @param id State ID
1282
+ */
1283
+ submit(id) {
1284
+ return this.httpService.api({
1285
+ method: 'post',
1286
+ url: `${this.SERVICE_URL}/quote/${id}/submit`,
1287
+ });
1288
+ }
1289
+ /**
1290
+ * Close Flow state
1291
+ * @param id State ID
1292
+ */
1293
+ cancel(id) {
1294
+ return this.httpService.api({
1295
+ method: 'post',
1296
+ url: `${this.SERVICE_URL}/quote/${id}/cancel`,
1297
+ });
1298
+ }
1299
+ /**
1300
+ * Initialize stateful configuration
1301
+ * @param stateId string
1302
+ * @param request Request
1303
+ * @returns Flow initialization response, which contains session ID and result of selectors
1304
+ */
1305
+ newConfiguration(stateId, request) {
1306
+ return this.httpService.api({
1307
+ method: 'post',
1308
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/new`,
1309
+ body: request,
1310
+ });
1311
+ }
1312
+ /**
1313
+ * Start stateful configuration
1314
+ * @param stateId string
1315
+ * @param request Request
1316
+ * @returns Flow initialization response, which contains session ID and result of selectors
1317
+ */
1318
+ startConfiguration(stateId, request) {
1319
+ return this.httpService.api({
1320
+ method: 'post',
1321
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/start`,
1322
+ body: request,
1323
+ });
1324
+ }
1325
+ /**
1326
+ * Execute stateful configuration
1327
+ * @param stateId string
1328
+ * @param configurationId string
1329
+ * @param request Request
1330
+ * @returns Flow initialization response, which contains session ID and result of selectors
1331
+ */
1332
+ executeConfiguration(stateId, configurationId, request) {
1333
+ return this.httpService.api({
1334
+ method: 'post',
1335
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/execute`,
1336
+ body: request,
1337
+ });
1338
+ }
1339
+ /**
1340
+ * Save stateful configuration
1341
+ * @param stateId string
1342
+ * @param configurationId string
1343
+ */
1344
+ saveConfiguration(stateId, configurationId) {
1345
+ return this.httpService.api({
1346
+ method: 'post',
1347
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/save`,
1348
+ });
1349
+ }
1350
+ /**
1351
+ * Cancel stateful configuration
1352
+ * @param stateId string
1353
+ * @param configurationId string
1354
+ */
1355
+ cancelConfiguration(stateId, configurationId) {
1356
+ return this.httpService.api({
1357
+ method: 'post',
1358
+ url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/cancel`,
1359
+ });
1360
+ }
1361
+ }
1362
+ FlowStateApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1363
+ FlowStateApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService });
1364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService, decorators: [{
1088
1365
  type: Injectable
1089
1366
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1090
1367
 
@@ -1094,17 +1371,20 @@ class FlowsApiService {
1094
1371
  this.flowsKey = 'flows';
1095
1372
  }
1096
1373
  getFlow(id) {
1097
- return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)));
1374
+ return this.fetchFlows().pipe(map(flows => flows.find(flow => flow.id == id)), map(flow => {
1375
+ if (!flow) {
1376
+ throw new Error(`Flow with flowId=${id} is not defined`);
1377
+ }
1378
+ return flow;
1379
+ }));
1098
1380
  }
1099
1381
  fetchFlows() {
1100
- return this.configurationSettingsApiService
1101
- .fetchSetting(this.flowsKey)
1102
- .pipe(map((flow) => (flow?.value ? JSON.parse(flow.value) : [])));
1382
+ return this.configurationSettingsApiService.fetchSetting(this.flowsKey).pipe(map((setting) => (setting?.value ? JSON.parse(setting.value) : [])), map(anyFlows => anyFlows.map(toLatestFlow).filter(isDefined)));
1103
1383
  }
1104
1384
  }
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: [{
1385
+ FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1386
+ FlowsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService });
1387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, decorators: [{
1108
1388
  type: Injectable
1109
1389
  }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
1110
1390
 
@@ -1163,9 +1443,9 @@ class GuidedSellingsAdminApiService {
1163
1443
  }
1164
1444
  }
1165
1445
  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: [{
1446
+ GuidedSellingsAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1447
+ GuidedSellingsAdminApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService });
1448
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingsAdminApiService, decorators: [{
1169
1449
  type: Injectable
1170
1450
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1171
1451
 
@@ -1195,9 +1475,9 @@ class GuidedSellingApiService {
1195
1475
  });
1196
1476
  }
1197
1477
  }
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: [{
1478
+ GuidedSellingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1479
+ GuidedSellingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService });
1480
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingApiService, decorators: [{
1201
1481
  type: Injectable
1202
1482
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1203
1483
 
@@ -1266,27 +1546,91 @@ class OffersApiService {
1266
1546
  }
1267
1547
  }
1268
1548
  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: [{
1549
+ OffersApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1550
+ OffersApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService });
1551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService, decorators: [{
1272
1552
  type: Injectable
1273
1553
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1274
1554
 
1555
+ /**
1556
+ * Parses the response from Canvas and checks for errors.
1557
+ * - If an error is found, publishes an error message and returns the failover value.
1558
+ * - If no error is found, returns the parsed response.
1559
+ *
1560
+ * Note! The API call first goes to APEX before reaching the Canvas, so errors can originate from either APEX or Canvas.
1561
+ *
1562
+ * @param {string} response - The JSON string response from the Canvas call.
1563
+ * @param {T} failover - The value to return in case of error.
1564
+ * @returns {T | K} The parsed response or the failover value.
1565
+ *
1566
+ * @template T The expected type of the parsed response.
1567
+ * @template K The type of the failover value.
1568
+ *
1569
+ * @remarks If there's an Apex error, the response data can be an array.
1570
+ * In such cases, the function extracts the first element of the array.
1571
+ */
1572
+ const handleCanvasResponse = (response, failover, errorPublisher) => {
1573
+ const parsed = JSON.parse(response);
1574
+ const errorCandidate = isArray(parsed) ? parsed[0] : parsed;
1575
+ if (isApexError(errorCandidate)) {
1576
+ errorPublisher(errorCandidate.message);
1577
+ return failover;
1578
+ }
1579
+ if (isCanvasError(errorCandidate)) {
1580
+ errorPublisher(errorCandidate.error);
1581
+ return failover;
1582
+ }
1583
+ return parsed;
1584
+ };
1585
+
1275
1586
  class OrgInfoApiService {
1276
- constructor(http) {
1277
- this.http = http;
1278
- this.CANVAS_URL_FALLBACK = 'https://canvas.velocpq.com';
1279
- this.hostUrl = window.VELO_CANVAS_API ?? this.CANVAS_URL_FALLBACK;
1587
+ constructor(messageService) {
1588
+ this.messageService = messageService;
1589
+ /**
1590
+ * Shows an error message using the message service.
1591
+ *
1592
+ * @param {string} message - the error message to be published.
1593
+ */
1594
+ this.publishErrorMessage = (message) => {
1595
+ this.messageService.add({ severity: 'error', summary: message, sticky: true });
1596
+ };
1597
+ }
1598
+ getOrgInfo$() {
1599
+ try {
1600
+ return window.doCanvasCall && window.ORGANIZATION_ID
1601
+ ? from(window.doCanvasCall(`org-info/${window.ORGANIZATION_ID}`, null)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1602
+ : of(undefined);
1603
+ }
1604
+ catch {
1605
+ return of(undefined);
1606
+ }
1280
1607
  }
1281
- getOrgInfo$(organizationId) {
1282
- return this.http.get(`${this.hostUrl}/org-info/${organizationId}`);
1608
+ getAvailableVersionsInfo$() {
1609
+ try {
1610
+ return window.doCanvasCall && window.ORGANIZATION_ID
1611
+ ? from(window.doCanvasCall('versions/available', 'include_all=true')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1612
+ : of(undefined);
1613
+ }
1614
+ catch {
1615
+ return of(undefined);
1616
+ }
1617
+ }
1618
+ upgradeVersion$(targetVersion) {
1619
+ try {
1620
+ return window.doCanvasCall && window.ORGANIZATION_ID
1621
+ ? from(window.doCanvasCall('versions/upgrade', `target_version=${targetVersion}`)).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
1622
+ : of(undefined);
1623
+ }
1624
+ catch {
1625
+ return of(undefined);
1626
+ }
1283
1627
  }
1284
1628
  }
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: [{
1629
+ OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
1630
+ OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
1631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
1288
1632
  type: Injectable
1289
- }], ctorParameters: function () { return [{ type: i4.HttpClient }]; } });
1633
+ }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
1290
1634
 
1291
1635
  class PicklistsApiService {
1292
1636
  constructor(baseHttpService) {
@@ -1320,9 +1664,81 @@ class PicklistsApiService {
1320
1664
  };
1321
1665
  }
1322
1666
  }
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: [{
1667
+ PicklistsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1668
+ PicklistsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService });
1669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PicklistsApiService, decorators: [{
1670
+ type: Injectable
1671
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1672
+
1673
+ class PortalsApiService {
1674
+ constructor(baseHttpService) {
1675
+ this.baseHttpService = baseHttpService;
1676
+ this.serviceUrl = '/admin/portal';
1677
+ this.getPortals$ = (skip = 1, name = '') => {
1678
+ let params = new HttpParams();
1679
+ params = params.append('count', (PortalsApiService.MAX_RESULTS * skip).toString());
1680
+ params = params.append('skip', '0');
1681
+ params = params.append('name', name);
1682
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1683
+ };
1684
+ this.searchPortals$ = (skip = 0, expression) => {
1685
+ let params = new HttpParams();
1686
+ params = params.set('skip', '' + skip);
1687
+ params = params.set('count', '' + PortalsApiService.MAX_RESULTS);
1688
+ return this.baseHttpService.api({
1689
+ method: 'post',
1690
+ url: `${this.serviceUrl}/search`,
1691
+ params,
1692
+ body: expression || {},
1693
+ });
1694
+ };
1695
+ this.removePortal$ = (id) => {
1696
+ return this.baseHttpService.api({
1697
+ url: `${this.serviceUrl}/${id}`,
1698
+ method: 'delete',
1699
+ });
1700
+ };
1701
+ this.restore$ = (id) => {
1702
+ return this.baseHttpService.api({
1703
+ method: 'patch',
1704
+ url: `${this.serviceUrl}/${id}/restore`,
1705
+ });
1706
+ };
1707
+ this.duplicatePortal$ = (cloneRequest) => {
1708
+ return this.baseHttpService.api({
1709
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
1710
+ method: 'post',
1711
+ body: cloneRequest,
1712
+ });
1713
+ };
1714
+ this.getPortal$ = (id) => {
1715
+ return this.baseHttpService.api({
1716
+ url: `${this.serviceUrl}/${id}`,
1717
+ });
1718
+ };
1719
+ }
1720
+ createNewPortal$(body) {
1721
+ return this.baseHttpService.api({
1722
+ url: `${this.serviceUrl}`,
1723
+ method: 'post',
1724
+ body,
1725
+ });
1726
+ }
1727
+ updatePortal$(portal, settings) {
1728
+ return this.baseHttpService.api({
1729
+ url: `${this.serviceUrl}/${portal.id}`,
1730
+ method: 'put',
1731
+ body: {
1732
+ ...portal,
1733
+ settings: JSON.stringify(settings),
1734
+ },
1735
+ });
1736
+ }
1737
+ }
1738
+ PortalsApiService.MAX_RESULTS = 60;
1739
+ PortalsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1740
+ PortalsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService });
1741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, decorators: [{
1326
1742
  type: Injectable
1327
1743
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1328
1744
 
@@ -1380,9 +1796,9 @@ class PriceApiService {
1380
1796
  });
1381
1797
  }
1382
1798
  }
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: [{
1799
+ PriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1800
+ PriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService });
1801
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PriceApiService, decorators: [{
1386
1802
  type: Injectable
1387
1803
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1388
1804
 
@@ -1473,10 +1889,16 @@ class ProceduresApiService {
1473
1889
  body,
1474
1890
  });
1475
1891
  }
1892
+ fetchDefaultPricingSteps$() {
1893
+ return this.baseHttpService.api({
1894
+ url: `${this.ADMIN_SERVICE_URL}/pricing-steps`,
1895
+ method: 'get',
1896
+ });
1897
+ }
1476
1898
  }
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: [{
1899
+ ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1900
+ ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService });
1901
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, decorators: [{
1480
1902
  type: Injectable
1481
1903
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1482
1904
 
@@ -1622,9 +2044,9 @@ class ProductApiService {
1622
2044
  return `${this.serviceUrl}/${productId}/image`;
1623
2045
  }
1624
2046
  }
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: [{
2047
+ ProductApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2048
+ ProductApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService });
2049
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductApiService, decorators: [{
1628
2050
  type: Injectable
1629
2051
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1630
2052
 
@@ -1853,9 +2275,72 @@ class ProductModelApiService {
1853
2275
  }
1854
2276
  }
1855
2277
  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: [{
2278
+ ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2279
+ ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService });
2280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, decorators: [{
2281
+ type: Injectable
2282
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2283
+
2284
+ class PromotionsApiService {
2285
+ constructor(baseHttpService) {
2286
+ this.baseHttpService = baseHttpService;
2287
+ this.serviceUrl = '/admin/promotion';
2288
+ this.fetchAll$ = () => {
2289
+ return this.baseHttpService.api({ url: this.serviceUrl });
2290
+ };
2291
+ this.fetchOne$ = (id) => {
2292
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2293
+ };
2294
+ this.remove$ = (id) => {
2295
+ return this.baseHttpService.api({
2296
+ url: `${this.serviceUrl}/${id}`,
2297
+ method: 'delete',
2298
+ });
2299
+ };
2300
+ this.restore$ = (id) => {
2301
+ return this.baseHttpService.api({
2302
+ method: 'patch',
2303
+ url: `${this.serviceUrl}/${id}/restore`,
2304
+ });
2305
+ };
2306
+ this.duplicate$ = (body) => {
2307
+ return this.baseHttpService
2308
+ .api({
2309
+ url: `${this.serviceUrl}/${body.id}/clone`,
2310
+ method: 'post',
2311
+ body,
2312
+ })
2313
+ .pipe(map$1(response => response.clonedRecordId));
2314
+ };
2315
+ }
2316
+ search$(expression, skip, count) {
2317
+ let params = new HttpParams();
2318
+ if (typeof skip === 'number') {
2319
+ params = params.set('skip', '' + skip);
2320
+ }
2321
+ if (typeof count === 'number') {
2322
+ params = params.set('count', '' + count);
2323
+ }
2324
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2325
+ }
2326
+ create$(body) {
2327
+ return this.baseHttpService.api({
2328
+ url: `${this.serviceUrl}`,
2329
+ method: 'post',
2330
+ body,
2331
+ });
2332
+ }
2333
+ update$(body) {
2334
+ return this.baseHttpService.api({
2335
+ url: `${this.serviceUrl}/${body.id}`,
2336
+ method: 'put',
2337
+ body,
2338
+ });
2339
+ }
2340
+ }
2341
+ PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2342
+ PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
2343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
1859
2344
  type: Injectable
1860
2345
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1861
2346
 
@@ -1864,7 +2349,9 @@ class QuoteApiService {
1864
2349
  this.httpService = httpService;
1865
2350
  this.SERVICE_URL = '/quotes';
1866
2351
  }
1867
- // request quoteId | accountId | opportunityId | orderId
2352
+ /**
2353
+ * @deprecated Use getQuoteState instead
2354
+ */
1868
2355
  getQuoteDraft(objectId, params, errorHandler) {
1869
2356
  return this.httpService.api({
1870
2357
  method: 'get',
@@ -1873,6 +2360,20 @@ class QuoteApiService {
1873
2360
  errorHandler,
1874
2361
  });
1875
2362
  }
2363
+ /**
2364
+ * Comparing to deprecated `getQuoteDraft` this endpoint doesn't include orders and assets
2365
+ * @param objectId quoteId | accountId | opportunityId | orderId
2366
+ * @param params Query params
2367
+ * @param options Request options
2368
+ */
2369
+ getQuoteState(objectId, params, options) {
2370
+ return this.httpService.api({
2371
+ method: 'get',
2372
+ url: `/v2${this.SERVICE_URL}/${objectId}`,
2373
+ params,
2374
+ ...options,
2375
+ });
2376
+ }
1876
2377
  upsertQuote(request, options) {
1877
2378
  return this.httpService.api({
1878
2379
  method: 'post',
@@ -1901,9 +2402,9 @@ class QuoteApiService {
1901
2402
  });
1902
2403
  }
1903
2404
  }
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: [{
2405
+ QuoteApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2406
+ QuoteApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService });
2407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteApiService, decorators: [{
1907
2408
  type: Injectable
1908
2409
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1909
2410
 
@@ -1929,9 +2430,135 @@ class RampApiService {
1929
2430
  });
1930
2431
  }
1931
2432
  }
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: [{
2433
+ RampApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2434
+ RampApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService });
2435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RampApiService, decorators: [{
2436
+ type: Injectable
2437
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2438
+
2439
+ class RebateProgramApiService {
2440
+ constructor(baseHttpService) {
2441
+ this.baseHttpService = baseHttpService;
2442
+ this.serviceUrl = '/admin/rebate-program';
2443
+ this.fetchAll$ = () => {
2444
+ return this.baseHttpService.api({ url: this.serviceUrl });
2445
+ };
2446
+ this.fetchOne$ = (id) => {
2447
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2448
+ };
2449
+ this.remove$ = (id) => {
2450
+ return this.baseHttpService.api({
2451
+ url: `${this.serviceUrl}/${id}`,
2452
+ method: 'delete',
2453
+ });
2454
+ };
2455
+ this.restore$ = (id) => {
2456
+ return this.baseHttpService.api({
2457
+ method: 'patch',
2458
+ url: `${this.serviceUrl}/${id}/restore`,
2459
+ });
2460
+ };
2461
+ this.duplicate$ = (body) => {
2462
+ return this.baseHttpService
2463
+ .api({
2464
+ url: `${this.serviceUrl}/${body.id}/clone`,
2465
+ method: 'post',
2466
+ body,
2467
+ })
2468
+ .pipe(map$1(response => response.clonedRecordId));
2469
+ };
2470
+ }
2471
+ search$(expression, skip, count) {
2472
+ let params = new HttpParams();
2473
+ if (typeof skip === 'number') {
2474
+ params = params.set('skip', '' + skip);
2475
+ }
2476
+ if (typeof count === 'number') {
2477
+ params = params.set('count', '' + count);
2478
+ }
2479
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2480
+ }
2481
+ create$(body) {
2482
+ return this.baseHttpService.api({
2483
+ url: `${this.serviceUrl}`,
2484
+ method: 'post',
2485
+ body,
2486
+ });
2487
+ }
2488
+ update$(body) {
2489
+ return this.baseHttpService.api({
2490
+ url: `${this.serviceUrl}/${body.id}`,
2491
+ method: 'put',
2492
+ body,
2493
+ });
2494
+ }
2495
+ }
2496
+ RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2497
+ RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
2498
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
2499
+ type: Injectable
2500
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2501
+
2502
+ class RebateTypeApiService {
2503
+ constructor(baseHttpService) {
2504
+ this.baseHttpService = baseHttpService;
2505
+ this.serviceUrl = '/admin/rebate-type';
2506
+ this.fetchAll$ = () => {
2507
+ return this.baseHttpService.api({ url: this.serviceUrl });
2508
+ };
2509
+ this.fetchOne$ = (id) => {
2510
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2511
+ };
2512
+ this.remove$ = (id) => {
2513
+ return this.baseHttpService.api({
2514
+ url: `${this.serviceUrl}/${id}`,
2515
+ method: 'delete',
2516
+ });
2517
+ };
2518
+ this.restore$ = (id) => {
2519
+ return this.baseHttpService.api({
2520
+ method: 'patch',
2521
+ url: `${this.serviceUrl}/${id}/restore`,
2522
+ });
2523
+ };
2524
+ this.duplicate$ = (body) => {
2525
+ return this.baseHttpService
2526
+ .api({
2527
+ url: `${this.serviceUrl}/${body.id}/clone`,
2528
+ method: 'post',
2529
+ body,
2530
+ })
2531
+ .pipe(map$1(response => response.clonedRecordId));
2532
+ };
2533
+ }
2534
+ search$(expression, skip, count) {
2535
+ let params = new HttpParams();
2536
+ if (typeof skip === 'number') {
2537
+ params = params.set('skip', '' + skip);
2538
+ }
2539
+ if (typeof count === 'number') {
2540
+ params = params.set('count', '' + count);
2541
+ }
2542
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2543
+ }
2544
+ create$(body) {
2545
+ return this.baseHttpService.api({
2546
+ url: `${this.serviceUrl}`,
2547
+ method: 'post',
2548
+ body,
2549
+ });
2550
+ }
2551
+ update$(body) {
2552
+ return this.baseHttpService.api({
2553
+ url: `${this.serviceUrl}/${body.id}`,
2554
+ method: 'put',
2555
+ body,
2556
+ });
2557
+ }
2558
+ }
2559
+ RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2560
+ RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
2561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
1935
2562
  type: Injectable
1936
2563
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1937
2564
 
@@ -1985,9 +2612,9 @@ class RuleGroupsApiService {
1985
2612
  };
1986
2613
  }
1987
2614
  }
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: [{
2615
+ RuleGroupsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2616
+ RuleGroupsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService });
2617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RuleGroupsApiService, decorators: [{
1991
2618
  type: Injectable
1992
2619
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1993
2620
 
@@ -2000,8 +2627,12 @@ class RulesApiService {
2000
2627
  };
2001
2628
  this.searchRules$ = (expression, skip, count) => {
2002
2629
  let params = new HttpParams();
2003
- params = params.set('skip', '' + skip);
2004
- params = params.set('count', '' + count);
2630
+ if (typeof skip === 'number') {
2631
+ params = params.set('skip', '' + skip);
2632
+ }
2633
+ if (typeof count === 'number') {
2634
+ params = params.set('count', '' + count);
2635
+ }
2005
2636
  return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2006
2637
  };
2007
2638
  this.createRule$ = (rule) => {
@@ -2053,17 +2684,26 @@ class RulesApiService {
2053
2684
  });
2054
2685
  }
2055
2686
  execute$(body) {
2056
- const url = body.rule.ruleGroupType === RuleGroupTypes.eligibility ? '/rules/eligibility/execute' : '/rules/execute';
2687
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
2057
2688
  return this.baseHttpService.api({
2058
2689
  url,
2059
2690
  method: 'post',
2060
2691
  body,
2061
2692
  });
2062
2693
  }
2694
+ getExecuteRuleUrl(ruleGroupType) {
2695
+ if (ruleGroupType === RuleGroupTypes.eligibility) {
2696
+ return '/rules/eligibility/execute';
2697
+ }
2698
+ if (ruleGroupType === RuleGroupTypes.catalog) {
2699
+ return '/rules/catalog/execute';
2700
+ }
2701
+ return '/rules/execute';
2702
+ }
2063
2703
  }
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: [{
2704
+ RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2705
+ RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService });
2706
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, decorators: [{
2067
2707
  type: Injectable
2068
2708
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2069
2709
 
@@ -2076,8 +2716,12 @@ class ScriptsApiService {
2076
2716
  };
2077
2717
  this.searchScripts$ = (expression, skip, count) => {
2078
2718
  let params = new HttpParams();
2079
- params = params.set('skip', '' + skip);
2080
- params = params.set('count', '' + count);
2719
+ if (typeof skip === 'number') {
2720
+ params = params.set('skip', '' + skip);
2721
+ }
2722
+ if (typeof count === 'number') {
2723
+ params = params.set('count', '' + count);
2724
+ }
2081
2725
  return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2082
2726
  };
2083
2727
  this.fetchScript$ = (id) => {
@@ -2105,11 +2749,13 @@ class ScriptsApiService {
2105
2749
  });
2106
2750
  };
2107
2751
  this.cloneScript$ = (cloneRequest) => {
2108
- return this.baseHttpService.api({
2752
+ return this.baseHttpService
2753
+ .api({
2109
2754
  url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
2110
2755
  method: 'post',
2111
2756
  body: cloneRequest,
2112
- });
2757
+ })
2758
+ .pipe(map(response => response.clonedRecordId));
2113
2759
  };
2114
2760
  this.removeScript$ = (id) => {
2115
2761
  return this.baseHttpService.api({
@@ -2133,9 +2779,9 @@ class ScriptsApiService {
2133
2779
  };
2134
2780
  }
2135
2781
  }
2136
- ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2137
- ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ScriptsApiService });
2138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ScriptsApiService, decorators: [{
2782
+ ScriptsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2783
+ ScriptsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService });
2784
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ScriptsApiService, decorators: [{
2139
2785
  type: Injectable
2140
2786
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2141
2787
 
@@ -2156,9 +2802,9 @@ class ShoppingCartSettingsApiService {
2156
2802
  }, {})));
2157
2803
  }
2158
2804
  }
2159
- ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2160
- ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartSettingsApiService });
2161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
2805
+ ShoppingCartSettingsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2806
+ ShoppingCartSettingsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService });
2807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartSettingsApiService, decorators: [{
2162
2808
  type: Injectable
2163
2809
  }], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
2164
2810
 
@@ -2204,9 +2850,9 @@ class StatefulConfigurationApiService {
2204
2850
  });
2205
2851
  }
2206
2852
  }
2207
- StatefulConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: StatefulConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2208
- StatefulConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: StatefulConfigurationApiService });
2209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: StatefulConfigurationApiService, decorators: [{
2853
+ StatefulConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2854
+ StatefulConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService });
2855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService, decorators: [{
2210
2856
  type: Injectable
2211
2857
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2212
2858
 
@@ -2273,9 +2919,9 @@ class UIDefinitionsApiService {
2273
2919
  return `/models/${modelId}/uidefinitions`;
2274
2920
  }
2275
2921
  }
2276
- UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2277
- UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService });
2278
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
2922
+ UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2923
+ UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService });
2924
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
2279
2925
  type: Injectable
2280
2926
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2281
2927
 
@@ -2511,6 +3157,11 @@ class UITemplatesApiService {
2511
3157
  this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
2512
3158
  ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
2513
3159
  };
3160
+ this.fetchComponentsAttachments$ = (templateId) => {
3161
+ return this.fetchComponents$(templateId).pipe(switchMap$1(components => {
3162
+ return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
3163
+ }));
3164
+ };
2514
3165
  this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
2515
3166
  return this.baseHttpService
2516
3167
  .api({
@@ -2561,9 +3212,9 @@ class UITemplatesApiService {
2561
3212
  });
2562
3213
  }
2563
3214
  }
2564
- UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2565
- UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UITemplatesApiService });
2566
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UITemplatesApiService, decorators: [{
3215
+ UITemplatesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
3216
+ UITemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService });
3217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: UITemplatesApiService, decorators: [{
2567
3218
  type: Injectable
2568
3219
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2569
3220
 
@@ -2599,6 +3250,15 @@ class VeloceObjectsApiService {
2599
3250
  url: `${this.serviceUrl}/${id}`,
2600
3251
  });
2601
3252
  };
3253
+ this.duplicateObject$ = (body) => {
3254
+ return this.baseHttpService
3255
+ .api({
3256
+ method: 'post',
3257
+ url: `${this.serviceUrl}/${body.id}/clone`,
3258
+ body,
3259
+ })
3260
+ .pipe(map(response => response.clonedRecordId));
3261
+ };
2602
3262
  this.restoreObject$ = (id) => {
2603
3263
  return this.baseHttpService.api({
2604
3264
  method: 'patch',
@@ -2637,17 +3297,106 @@ class VeloceObjectsApiService {
2637
3297
  });
2638
3298
  }
2639
3299
  }
2640
- VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2641
- VeloceObjectsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService });
2642
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService, decorators: [{
3300
+ VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
3301
+ VeloceObjectsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService });
3302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceObjectsApiService, decorators: [{
2643
3303
  type: Injectable
2644
3304
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2645
3305
 
3306
+ class SandboxManagerApiService {
3307
+ constructor(messageService) {
3308
+ this.messageService = messageService;
3309
+ /**
3310
+ * Shows an error message using the message service.
3311
+ *
3312
+ * @param {string} message - the error message to be published.
3313
+ */
3314
+ this.publishErrorMessage = (message) => {
3315
+ this.messageService.add({ severity: 'error', summary: message, sticky: true });
3316
+ };
3317
+ }
3318
+ getSalesforceOrganizations$() {
3319
+ try {
3320
+ return window.doSandboxCall
3321
+ ? from(window.doSandboxCall('orgs', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, [], this.publishErrorMessage)), catchError$1(() => of([])))
3322
+ : of([]);
3323
+ }
3324
+ catch {
3325
+ return of([]);
3326
+ }
3327
+ }
3328
+ getAvailableSalesforceOrganizationSizes$() {
3329
+ try {
3330
+ return window.doSandboxCall
3331
+ ? from(window.doSandboxCall('available-sizes', '', 'GET')).pipe(map$1(response => handleCanvasResponse(response, {}, this.publishErrorMessage)), catchError$1(() => of({})))
3332
+ : of({});
3333
+ }
3334
+ catch {
3335
+ return of({});
3336
+ }
3337
+ }
3338
+ createSalesforceOrganization$(payload) {
3339
+ try {
3340
+ return window.doSandboxCall
3341
+ ? from(window.doSandboxCall('orgs', JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
3342
+ : of(undefined);
3343
+ }
3344
+ catch (err) {
3345
+ return of(undefined);
3346
+ }
3347
+ }
3348
+ updateSalesforceOrganization$(payload) {
3349
+ try {
3350
+ return window.doSandboxCall
3351
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}`, JSON.stringify(payload), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
3352
+ : of(undefined);
3353
+ }
3354
+ catch {
3355
+ return of(undefined);
3356
+ }
3357
+ }
3358
+ deleteSalesforceOrganization$(payload) {
3359
+ try {
3360
+ return window.doSandboxCall
3361
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}`, '', 'DELETE')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
3362
+ : of(undefined);
3363
+ }
3364
+ catch {
3365
+ return of(undefined);
3366
+ }
3367
+ }
3368
+ activateSalesforceOrganization$(payload) {
3369
+ try {
3370
+ return window.doSandboxCall
3371
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}/activate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
3372
+ : of(undefined);
3373
+ }
3374
+ catch {
3375
+ return of(undefined);
3376
+ }
3377
+ }
3378
+ deactivateSalesforceOrganization$(payload) {
3379
+ try {
3380
+ return window.doSandboxCall
3381
+ ? from(window.doSandboxCall(`orgs/${payload.orgId}/deactivate`, JSON.stringify({}), 'POST')).pipe(map$1(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError$1(() => of(undefined)))
3382
+ : of(undefined);
3383
+ }
3384
+ catch {
3385
+ return of(undefined);
3386
+ }
3387
+ }
3388
+ }
3389
+ SandboxManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
3390
+ SandboxManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService });
3391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, decorators: [{
3392
+ type: Injectable
3393
+ }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
3394
+
2646
3395
  class ApiModule {
2647
3396
  }
2648
- ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2649
- ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, imports: [HttpClientModule] });
2650
- ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, providers: [
3397
+ ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3398
+ ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, imports: [HttpClientModule] });
3399
+ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, providers: [
2651
3400
  BaseHttpService,
2652
3401
  XrayService,
2653
3402
  ConfigurationApiService,
@@ -2681,8 +3430,17 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
2681
3430
  UIDefinitionsApiService,
2682
3431
  VeloceObjectsApiService,
2683
3432
  StatefulConfigurationApiService,
3433
+ RebateProgramApiService,
3434
+ RebateTypeApiService,
3435
+ PromotionsApiService,
3436
+ VeloceAuthService,
3437
+ ContractedPriceApiService,
3438
+ PortalsApiService,
3439
+ ConfigurationProcessorsApiService,
3440
+ FlowStateApiService,
3441
+ SandboxManagerApiService,
2684
3442
  ], imports: [HttpClientModule] });
2685
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, decorators: [{
3443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, decorators: [{
2686
3444
  type: NgModule,
2687
3445
  args: [{
2688
3446
  imports: [HttpClientModule],
@@ -2720,6 +3478,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2720
3478
  UIDefinitionsApiService,
2721
3479
  VeloceObjectsApiService,
2722
3480
  StatefulConfigurationApiService,
3481
+ RebateProgramApiService,
3482
+ RebateTypeApiService,
3483
+ PromotionsApiService,
3484
+ VeloceAuthService,
3485
+ ContractedPriceApiService,
3486
+ PortalsApiService,
3487
+ ConfigurationProcessorsApiService,
3488
+ FlowStateApiService,
3489
+ SandboxManagerApiService,
2723
3490
  ],
2724
3491
  }]
2725
3492
  }] });
@@ -2728,5 +3495,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2728
3495
  * Generated bundle index. Do not edit.
2729
3496
  */
2730
3497
 
2731
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, QuoteApiService, RampApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceObjectsApiService };
3498
+ 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 };
2732
3499
  //# sourceMappingURL=veloceapps-api.mjs.map