@veloceapps/api 8.0.0-19 → 8.0.0-191

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 (55) hide show
  1. package/esm2020/index.mjs +10 -4
  2. package/esm2020/lib/api.module.mjs +22 -4
  3. package/esm2020/lib/services/account-api.service.mjs +8 -1
  4. package/esm2020/lib/services/auth.service.mjs +22 -0
  5. package/esm2020/lib/services/configuration-api.service.mjs +45 -12
  6. package/esm2020/lib/services/configuration-processors-api.service.mjs +38 -0
  7. package/esm2020/lib/services/contracted-price-api.service.mjs +45 -0
  8. package/esm2020/lib/services/document-templates-api.service.mjs +6 -4
  9. package/esm2020/lib/services/flow-state-api.mjs +142 -0
  10. package/esm2020/lib/services/flows-api.service.mjs +9 -5
  11. package/esm2020/lib/services/portals-api.service.mjs +76 -0
  12. package/esm2020/lib/services/procedures-api.service.mjs +7 -1
  13. package/esm2020/lib/services/quote-api.service.mjs +18 -2
  14. package/esm2020/lib/services/rebate-program-api.service.mjs +1 -1
  15. package/esm2020/lib/services/rules-api.service.mjs +11 -2
  16. package/esm2020/lib/services/salesforce-api.service.mjs +4 -2
  17. package/esm2020/lib/services/sandbox-manager-api.service.mjs +67 -0
  18. package/esm2020/lib/services/scripts-api.service.mjs +6 -3
  19. package/esm2020/lib/services/stateful-configuration-api.mjs +1 -1
  20. package/esm2020/lib/services/ui-templates-api.service.mjs +6 -1
  21. package/esm2020/lib/services/veloce-objects-api.service.mjs +11 -1
  22. package/esm2020/lib/types/auth.types.mjs +2 -0
  23. package/esm2020/lib/types/index.mjs +3 -1
  24. package/esm2020/lib/types/org-info.types.mjs +1 -1
  25. package/esm2020/lib/types/quote.types.mjs +2 -0
  26. package/esm2020/lib/types/stateful-configuration.types.mjs +1 -1
  27. package/fesm2015/veloceapps-api.mjs +687 -229
  28. package/fesm2015/veloceapps-api.mjs.map +1 -1
  29. package/fesm2020/veloceapps-api.mjs +693 -218
  30. package/fesm2020/veloceapps-api.mjs.map +1 -1
  31. package/index.d.ts +9 -3
  32. package/lib/services/account-api.service.d.ts +2 -1
  33. package/lib/services/auth.service.d.ts +11 -0
  34. package/lib/services/configuration-api.service.d.ts +5 -0
  35. package/lib/services/configuration-processors-api.service.d.ts +14 -0
  36. package/lib/services/contracted-price-api.service.d.ts +16 -0
  37. package/lib/services/flow-state-api.d.ts +84 -0
  38. package/lib/services/flows-api.service.d.ts +1 -1
  39. package/lib/services/portals-api.service.d.ts +20 -0
  40. package/lib/services/procedures-api.service.d.ts +1 -0
  41. package/lib/services/quote-api.service.d.ts +13 -6
  42. package/lib/services/rebate-program-api.service.d.ts +1 -1
  43. package/lib/services/rules-api.service.d.ts +1 -0
  44. package/lib/services/salesforce-api.service.d.ts +1 -1
  45. package/lib/services/sandbox-manager-api.service.d.ts +22 -0
  46. package/lib/services/scripts-api.service.d.ts +1 -1
  47. package/lib/services/stateful-configuration-api.d.ts +2 -2
  48. package/lib/services/ui-templates-api.service.d.ts +1 -0
  49. package/lib/services/veloce-objects-api.service.d.ts +2 -1
  50. package/lib/types/auth.types.d.ts +4 -0
  51. package/lib/types/index.d.ts +2 -0
  52. package/lib/types/org-info.types.d.ts +1 -0
  53. package/lib/types/quote.types.d.ts +8 -0
  54. package/lib/types/stateful-configuration.types.d.ts +1 -1
  55. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import * as i4 from '@angular/common/http';
2
- import { HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
1
+ import * as i1$1 from '@angular/common/http';
2
+ import { HttpParams, HttpHeaders, HttpErrorResponse, HttpClientModule } from '@angular/common/http';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Injectable, NgModule } from '@angular/core';
5
5
  import * as i1 from '@veloceapps/core';
6
- import { uiDefinitionFromDTO, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
6
+ import { uiDefinitionFromDTO, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, toLatestFlow, isDefined, Operator, ModelTranslatorUtils, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
7
7
  import { noop, throwError, of, zip, forkJoin, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
8
8
  import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
9
9
  import * as i2 from 'primeng/api';
@@ -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
  }
@@ -88,6 +95,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
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;
@@ -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 {
@@ -433,6 +491,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
433
491
  type: Injectable
434
492
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
435
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: [{
526
+ type: Injectable
527
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
528
+
436
529
  class ConfigurationSettingsDTO {
437
530
  static fromDTO(dto, key) {
438
531
  return {
@@ -565,6 +658,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
565
658
  type: Injectable
566
659
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
567
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: [{
699
+ type: Injectable
700
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
701
+
568
702
  class DeltaApiService {
569
703
  constructor(httpService) {
570
704
  this.httpService = httpService;
@@ -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({
@@ -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.9", ngImport: i0, type: DocumentTemplatesApiService, deps: [{ token: i1.BaseHttpService }, { token: SalesforceApiService }, { token: i1.FileDownloadService }, { token: DocumentAttachmentApiService }, { token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
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 });
1011
1149
  DocumentTemplatesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DocumentTemplatesApiService });
1012
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) {
@@ -1088,18 +1226,160 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1088
1226
  type: Injectable
1089
1227
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1090
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: [{
1365
+ type: Injectable
1366
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1367
+
1091
1368
  class FlowsApiService {
1092
1369
  constructor(configurationSettingsApiService) {
1093
1370
  this.configurationSettingsApiService = configurationSettingsApiService;
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
1385
  FlowsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowsApiService, deps: [{ token: ConfigurationSettingsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1282,11 +1562,11 @@ class OrgInfoApiService {
1282
1562
  return this.http.get(`${this.hostUrl}/org-info/${organizationId}`);
1283
1563
  }
1284
1564
  }
1285
- OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i4.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1565
+ OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1286
1566
  OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
1287
1567
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
1288
1568
  type: Injectable
1289
- }], ctorParameters: function () { return [{ type: i4.HttpClient }]; } });
1569
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
1290
1570
 
1291
1571
  class PicklistsApiService {
1292
1572
  constructor(baseHttpService) {
@@ -1326,6 +1606,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1326
1606
  type: Injectable
1327
1607
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1328
1608
 
1609
+ class PortalsApiService {
1610
+ constructor(baseHttpService) {
1611
+ this.baseHttpService = baseHttpService;
1612
+ this.serviceUrl = '/admin/portal';
1613
+ this.getPortals$ = (skip = 1, name = '') => {
1614
+ let params = new HttpParams();
1615
+ params = params.append('count', (PortalsApiService.MAX_RESULTS * skip).toString());
1616
+ params = params.append('skip', '0');
1617
+ params = params.append('name', name);
1618
+ return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
1619
+ };
1620
+ this.searchPortals$ = (skip = 0, expression) => {
1621
+ let params = new HttpParams();
1622
+ params = params.set('skip', '' + skip);
1623
+ params = params.set('count', '' + PortalsApiService.MAX_RESULTS);
1624
+ return this.baseHttpService.api({
1625
+ method: 'post',
1626
+ url: `${this.serviceUrl}/search`,
1627
+ params,
1628
+ body: expression || {},
1629
+ });
1630
+ };
1631
+ this.removePortal$ = (id) => {
1632
+ return this.baseHttpService.api({
1633
+ url: `${this.serviceUrl}/${id}`,
1634
+ method: 'delete',
1635
+ });
1636
+ };
1637
+ this.restore$ = (id) => {
1638
+ return this.baseHttpService.api({
1639
+ method: 'patch',
1640
+ url: `${this.serviceUrl}/${id}/restore`,
1641
+ });
1642
+ };
1643
+ this.duplicatePortal$ = (cloneRequest) => {
1644
+ return this.baseHttpService.api({
1645
+ url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
1646
+ method: 'post',
1647
+ body: cloneRequest,
1648
+ });
1649
+ };
1650
+ this.getPortal$ = (id) => {
1651
+ return this.baseHttpService.api({
1652
+ url: `${this.serviceUrl}/${id}`,
1653
+ });
1654
+ };
1655
+ }
1656
+ createNewPortal$(body) {
1657
+ return this.baseHttpService.api({
1658
+ url: `${this.serviceUrl}`,
1659
+ method: 'post',
1660
+ body,
1661
+ });
1662
+ }
1663
+ updatePortal$(portal, settings) {
1664
+ return this.baseHttpService.api({
1665
+ url: `${this.serviceUrl}/${portal.id}`,
1666
+ method: 'put',
1667
+ body: {
1668
+ ...portal,
1669
+ settings: JSON.stringify(settings),
1670
+ },
1671
+ });
1672
+ }
1673
+ }
1674
+ PortalsApiService.MAX_RESULTS = 60;
1675
+ PortalsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1676
+ PortalsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService });
1677
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, decorators: [{
1678
+ type: Injectable
1679
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1680
+
1329
1681
  class PriceApiService {
1330
1682
  constructor(httpService) {
1331
1683
  this.httpService = httpService;
@@ -1473,6 +1825,12 @@ class ProceduresApiService {
1473
1825
  body,
1474
1826
  });
1475
1827
  }
1828
+ fetchDefaultPricingSteps$() {
1829
+ return this.baseHttpService.api({
1830
+ url: `${this.ADMIN_SERVICE_URL}/pricing-steps`,
1831
+ method: 'get',
1832
+ });
1833
+ }
1476
1834
  }
1477
1835
  ProceduresApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1478
1836
  ProceduresApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProceduresApiService });
@@ -1859,22 +2217,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1859
2217
  type: Injectable
1860
2218
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1861
2219
 
1862
- class QuoteApiService {
1863
- constructor(httpService) {
1864
- this.httpService = httpService;
1865
- this.SERVICE_URL = '/quotes';
1866
- }
1867
- // request quoteId | accountId | opportunityId | orderId
1868
- getQuoteDraft(objectId, params, errorHandler) {
1869
- return this.httpService.api({
1870
- method: 'get',
1871
- url: `${this.SERVICE_URL}/${objectId}`,
1872
- params,
1873
- errorHandler,
1874
- });
1875
- }
1876
- upsertQuote(request, options) {
1877
- return this.httpService.api({
2220
+ class PromotionsApiService {
2221
+ constructor(baseHttpService) {
2222
+ this.baseHttpService = baseHttpService;
2223
+ this.serviceUrl = '/admin/promotion';
2224
+ this.fetchAll$ = () => {
2225
+ return this.baseHttpService.api({ url: this.serviceUrl });
2226
+ };
2227
+ this.fetchOne$ = (id) => {
2228
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2229
+ };
2230
+ this.remove$ = (id) => {
2231
+ return this.baseHttpService.api({
2232
+ url: `${this.serviceUrl}/${id}`,
2233
+ method: 'delete',
2234
+ });
2235
+ };
2236
+ this.restore$ = (id) => {
2237
+ return this.baseHttpService.api({
2238
+ method: 'patch',
2239
+ url: `${this.serviceUrl}/${id}/restore`,
2240
+ });
2241
+ };
2242
+ this.duplicate$ = (body) => {
2243
+ return this.baseHttpService
2244
+ .api({
2245
+ url: `${this.serviceUrl}/${body.id}/clone`,
2246
+ method: 'post',
2247
+ body,
2248
+ })
2249
+ .pipe(map$1(response => response.clonedRecordId));
2250
+ };
2251
+ }
2252
+ search$(expression, skip, count) {
2253
+ let params = new HttpParams();
2254
+ if (typeof skip === 'number') {
2255
+ params = params.set('skip', '' + skip);
2256
+ }
2257
+ if (typeof count === 'number') {
2258
+ params = params.set('count', '' + count);
2259
+ }
2260
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2261
+ }
2262
+ create$(body) {
2263
+ return this.baseHttpService.api({
2264
+ url: `${this.serviceUrl}`,
2265
+ method: 'post',
2266
+ body,
2267
+ });
2268
+ }
2269
+ update$(body) {
2270
+ return this.baseHttpService.api({
2271
+ url: `${this.serviceUrl}/${body.id}`,
2272
+ method: 'put',
2273
+ body,
2274
+ });
2275
+ }
2276
+ }
2277
+ PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2278
+ PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
2279
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
2280
+ type: Injectable
2281
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2282
+
2283
+ class QuoteApiService {
2284
+ constructor(httpService) {
2285
+ this.httpService = httpService;
2286
+ this.SERVICE_URL = '/quotes';
2287
+ }
2288
+ /**
2289
+ * @deprecated Use getQuoteState instead
2290
+ */
2291
+ getQuoteDraft(objectId, params, errorHandler) {
2292
+ return this.httpService.api({
2293
+ method: 'get',
2294
+ url: `${this.SERVICE_URL}/${objectId}`,
2295
+ params,
2296
+ errorHandler,
2297
+ });
2298
+ }
2299
+ /**
2300
+ * Comparing to deprecated `getQuoteDraft` this endpoint doesn't include orders and assets
2301
+ * @param objectId quoteId | accountId | opportunityId | orderId
2302
+ * @param params Query params
2303
+ * @param options Request options
2304
+ */
2305
+ getQuoteState(objectId, params, options) {
2306
+ return this.httpService.api({
2307
+ method: 'get',
2308
+ url: `/v2${this.SERVICE_URL}/${objectId}`,
2309
+ params,
2310
+ ...options,
2311
+ });
2312
+ }
2313
+ upsertQuote(request, options) {
2314
+ return this.httpService.api({
1878
2315
  method: 'post',
1879
2316
  url: `${this.SERVICE_URL}`,
1880
2317
  body: request,
@@ -1935,6 +2372,132 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1935
2372
  type: Injectable
1936
2373
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1937
2374
 
2375
+ class RebateProgramApiService {
2376
+ constructor(baseHttpService) {
2377
+ this.baseHttpService = baseHttpService;
2378
+ this.serviceUrl = '/admin/rebate-program';
2379
+ this.fetchAll$ = () => {
2380
+ return this.baseHttpService.api({ url: this.serviceUrl });
2381
+ };
2382
+ this.fetchOne$ = (id) => {
2383
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2384
+ };
2385
+ this.remove$ = (id) => {
2386
+ return this.baseHttpService.api({
2387
+ url: `${this.serviceUrl}/${id}`,
2388
+ method: 'delete',
2389
+ });
2390
+ };
2391
+ this.restore$ = (id) => {
2392
+ return this.baseHttpService.api({
2393
+ method: 'patch',
2394
+ url: `${this.serviceUrl}/${id}/restore`,
2395
+ });
2396
+ };
2397
+ this.duplicate$ = (body) => {
2398
+ return this.baseHttpService
2399
+ .api({
2400
+ url: `${this.serviceUrl}/${body.id}/clone`,
2401
+ method: 'post',
2402
+ body,
2403
+ })
2404
+ .pipe(map$1(response => response.clonedRecordId));
2405
+ };
2406
+ }
2407
+ search$(expression, skip, count) {
2408
+ let params = new HttpParams();
2409
+ if (typeof skip === 'number') {
2410
+ params = params.set('skip', '' + skip);
2411
+ }
2412
+ if (typeof count === 'number') {
2413
+ params = params.set('count', '' + count);
2414
+ }
2415
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2416
+ }
2417
+ create$(body) {
2418
+ return this.baseHttpService.api({
2419
+ url: `${this.serviceUrl}`,
2420
+ method: 'post',
2421
+ body,
2422
+ });
2423
+ }
2424
+ update$(body) {
2425
+ return this.baseHttpService.api({
2426
+ url: `${this.serviceUrl}/${body.id}`,
2427
+ method: 'put',
2428
+ body,
2429
+ });
2430
+ }
2431
+ }
2432
+ RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2433
+ RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
2434
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
2435
+ type: Injectable
2436
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2437
+
2438
+ class RebateTypeApiService {
2439
+ constructor(baseHttpService) {
2440
+ this.baseHttpService = baseHttpService;
2441
+ this.serviceUrl = '/admin/rebate-type';
2442
+ this.fetchAll$ = () => {
2443
+ return this.baseHttpService.api({ url: this.serviceUrl });
2444
+ };
2445
+ this.fetchOne$ = (id) => {
2446
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2447
+ };
2448
+ this.remove$ = (id) => {
2449
+ return this.baseHttpService.api({
2450
+ url: `${this.serviceUrl}/${id}`,
2451
+ method: 'delete',
2452
+ });
2453
+ };
2454
+ this.restore$ = (id) => {
2455
+ return this.baseHttpService.api({
2456
+ method: 'patch',
2457
+ url: `${this.serviceUrl}/${id}/restore`,
2458
+ });
2459
+ };
2460
+ this.duplicate$ = (body) => {
2461
+ return this.baseHttpService
2462
+ .api({
2463
+ url: `${this.serviceUrl}/${body.id}/clone`,
2464
+ method: 'post',
2465
+ body,
2466
+ })
2467
+ .pipe(map$1(response => response.clonedRecordId));
2468
+ };
2469
+ }
2470
+ search$(expression, skip, count) {
2471
+ let params = new HttpParams();
2472
+ if (typeof skip === 'number') {
2473
+ params = params.set('skip', '' + skip);
2474
+ }
2475
+ if (typeof count === 'number') {
2476
+ params = params.set('count', '' + count);
2477
+ }
2478
+ return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2479
+ }
2480
+ create$(body) {
2481
+ return this.baseHttpService.api({
2482
+ url: `${this.serviceUrl}`,
2483
+ method: 'post',
2484
+ body,
2485
+ });
2486
+ }
2487
+ update$(body) {
2488
+ return this.baseHttpService.api({
2489
+ url: `${this.serviceUrl}/${body.id}`,
2490
+ method: 'put',
2491
+ body,
2492
+ });
2493
+ }
2494
+ }
2495
+ RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2496
+ RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
2497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
2498
+ type: Injectable
2499
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2500
+
1938
2501
  class RuleGroupsApiService {
1939
2502
  constructor(baseHttpService) {
1940
2503
  this.baseHttpService = baseHttpService;
@@ -2057,13 +2620,22 @@ class RulesApiService {
2057
2620
  });
2058
2621
  }
2059
2622
  execute$(body) {
2060
- const url = body.rule.ruleGroupType === RuleGroupTypes.eligibility ? '/rules/eligibility/execute' : '/rules/execute';
2623
+ const url = this.getExecuteRuleUrl(body.rule.ruleGroupType);
2061
2624
  return this.baseHttpService.api({
2062
2625
  url,
2063
2626
  method: 'post',
2064
2627
  body,
2065
2628
  });
2066
2629
  }
2630
+ getExecuteRuleUrl(ruleGroupType) {
2631
+ if (ruleGroupType === RuleGroupTypes.eligibility) {
2632
+ return '/rules/eligibility/execute';
2633
+ }
2634
+ if (ruleGroupType === RuleGroupTypes.catalog) {
2635
+ return '/rules/catalog/execute';
2636
+ }
2637
+ return '/rules/execute';
2638
+ }
2067
2639
  }
2068
2640
  RulesApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2069
2641
  RulesApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RulesApiService });
@@ -2113,11 +2685,13 @@ class ScriptsApiService {
2113
2685
  });
2114
2686
  };
2115
2687
  this.cloneScript$ = (cloneRequest) => {
2116
- return this.baseHttpService.api({
2688
+ return this.baseHttpService
2689
+ .api({
2117
2690
  url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
2118
2691
  method: 'post',
2119
2692
  body: cloneRequest,
2120
- });
2693
+ })
2694
+ .pipe(map(response => response.clonedRecordId));
2121
2695
  };
2122
2696
  this.removeScript$ = (id) => {
2123
2697
  return this.baseHttpService.api({
@@ -2519,6 +3093,11 @@ class UITemplatesApiService {
2519
3093
  this.fetchComponentAttachmentFile$(templateId, component.id, 'json'),
2520
3094
  ]).pipe(map$1(([html, js, css, json]) => ({ html, js, css, json })));
2521
3095
  };
3096
+ this.fetchComponentsAttachments$ = (templateId) => {
3097
+ return this.fetchComponents$(templateId).pipe(switchMap$1(components => {
3098
+ return forkJoin(components.map(component => this.fetchComponentAttachments$(templateId, component)));
3099
+ }));
3100
+ };
2522
3101
  this.fetchComponentAttachmentFile$ = (templateId, componentId, attachmentType) => {
2523
3102
  return this.baseHttpService
2524
3103
  .api({
@@ -2607,6 +3186,15 @@ class VeloceObjectsApiService {
2607
3186
  url: `${this.serviceUrl}/${id}`,
2608
3187
  });
2609
3188
  };
3189
+ this.duplicateObject$ = (body) => {
3190
+ return this.baseHttpService
3191
+ .api({
3192
+ method: 'post',
3193
+ url: `${this.serviceUrl}/${body.id}/clone`,
3194
+ body,
3195
+ })
3196
+ .pipe(map(response => response.clonedRecordId));
3197
+ };
2610
3198
  this.restoreObject$ = (id) => {
2611
3199
  return this.baseHttpService.api({
2612
3200
  method: 'patch',
@@ -2651,194 +3239,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2651
3239
  type: Injectable
2652
3240
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2653
3241
 
2654
- class RebateProgramApiService {
2655
- constructor(baseHttpService) {
2656
- this.baseHttpService = baseHttpService;
2657
- this.serviceUrl = '/admin/rebate-program';
2658
- this.fetchAll$ = () => {
2659
- return this.baseHttpService.api({ url: this.serviceUrl });
2660
- };
2661
- this.fetchOne$ = (id) => {
2662
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2663
- };
2664
- this.remove$ = (id) => {
2665
- return this.baseHttpService.api({
2666
- url: `${this.serviceUrl}/${id}`,
2667
- method: 'delete',
2668
- });
2669
- };
2670
- this.restore$ = (id) => {
2671
- return this.baseHttpService.api({
2672
- method: 'patch',
2673
- url: `${this.serviceUrl}/${id}/restore`,
2674
- });
2675
- };
2676
- this.duplicate$ = (body) => {
2677
- return this.baseHttpService
2678
- .api({
2679
- url: `${this.serviceUrl}/${body.id}/clone`,
2680
- method: 'post',
2681
- body,
2682
- })
2683
- .pipe(map$1(response => response.clonedRecordId));
2684
- };
2685
- }
2686
- search$(expression, skip, count) {
2687
- let params = new HttpParams();
2688
- if (typeof skip === 'number') {
2689
- params = params.set('skip', '' + skip);
2690
- }
2691
- if (typeof count === 'number') {
2692
- params = params.set('count', '' + count);
2693
- }
2694
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2695
- }
2696
- create$(body) {
2697
- return this.baseHttpService.api({
2698
- url: `${this.serviceUrl}`,
2699
- method: 'post',
2700
- body,
3242
+ class SandboxManagerApiService {
3243
+ constructor(http) {
3244
+ this.http = http;
3245
+ this.TOKEN_HEADER = `signed_request=${encodeURIComponent(window.SANDBOX_TOKEN ?? '')}` ?? '';
3246
+ this.SANDBOX_URL_FALLBACK = 'https://sandbox-manager.velocecpq.com';
3247
+ this.hostUrl = `${window.VELO_SANDBOX_API ?? this.SANDBOX_URL_FALLBACK}/clients`;
3248
+ }
3249
+ getSalesforceOrganizations$() {
3250
+ return this.http.get(`${this.hostUrl}/${window.VELO_CLIENT}/orgs`, {
3251
+ headers: {
3252
+ 'Veloce-Token': this.TOKEN_HEADER,
3253
+ },
2701
3254
  });
2702
3255
  }
2703
- update$(body) {
2704
- return this.baseHttpService.api({
2705
- url: `${this.serviceUrl}/${body.id}`,
2706
- method: 'put',
2707
- body,
3256
+ getAvailableSalesforceOrganizationSizes$() {
3257
+ return this.http.get(`${this.hostUrl}/${window.VELO_CLIENT}/available-sizes`, {
3258
+ headers: {
3259
+ 'Veloce-Token': this.TOKEN_HEADER,
3260
+ },
2708
3261
  });
2709
3262
  }
2710
- }
2711
- RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2712
- RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
2713
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
2714
- type: Injectable
2715
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2716
-
2717
- class RebateTypeApiService {
2718
- constructor(baseHttpService) {
2719
- this.baseHttpService = baseHttpService;
2720
- this.serviceUrl = '/admin/rebate-type';
2721
- this.fetchAll$ = () => {
2722
- return this.baseHttpService.api({ url: this.serviceUrl });
2723
- };
2724
- this.fetchOne$ = (id) => {
2725
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2726
- };
2727
- this.remove$ = (id) => {
2728
- return this.baseHttpService.api({
2729
- url: `${this.serviceUrl}/${id}`,
2730
- method: 'delete',
2731
- });
2732
- };
2733
- this.restore$ = (id) => {
2734
- return this.baseHttpService.api({
2735
- method: 'patch',
2736
- url: `${this.serviceUrl}/${id}/restore`,
2737
- });
2738
- };
2739
- this.duplicate$ = (body) => {
2740
- return this.baseHttpService
2741
- .api({
2742
- url: `${this.serviceUrl}/${body.id}/clone`,
2743
- method: 'post',
2744
- body,
2745
- })
2746
- .pipe(map$1(response => response.clonedRecordId));
2747
- };
2748
- }
2749
- search$(expression, skip, count) {
2750
- let params = new HttpParams();
2751
- if (typeof skip === 'number') {
2752
- params = params.set('skip', '' + skip);
2753
- }
2754
- if (typeof count === 'number') {
2755
- params = params.set('count', '' + count);
2756
- }
2757
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
2758
- }
2759
- create$(body) {
2760
- return this.baseHttpService.api({
2761
- url: `${this.serviceUrl}`,
2762
- method: 'post',
2763
- body,
3263
+ createSalesforceOrganization$(payload) {
3264
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs`, payload, {
3265
+ headers: {
3266
+ 'Veloce-Token': this.TOKEN_HEADER,
3267
+ },
2764
3268
  });
2765
3269
  }
2766
- update$(body) {
2767
- return this.baseHttpService.api({
2768
- url: `${this.serviceUrl}/${body.id}`,
2769
- method: 'put',
2770
- body,
3270
+ updateSalesforceOrganization$(payload) {
3271
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}`, payload, {
3272
+ headers: {
3273
+ 'Veloce-Token': this.TOKEN_HEADER,
3274
+ },
2771
3275
  });
2772
3276
  }
2773
- }
2774
- RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2775
- RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
2776
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
2777
- type: Injectable
2778
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2779
-
2780
- class PromotionsApiService {
2781
- constructor(baseHttpService) {
2782
- this.baseHttpService = baseHttpService;
2783
- this.serviceUrl = '/admin/promotion';
2784
- this.fetchAll$ = () => {
2785
- return this.baseHttpService.api({ url: this.serviceUrl });
2786
- };
2787
- this.fetchOne$ = (id) => {
2788
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2789
- };
2790
- this.remove$ = (id) => {
2791
- return this.baseHttpService.api({
2792
- url: `${this.serviceUrl}/${id}`,
2793
- method: 'delete',
2794
- });
2795
- };
2796
- this.restore$ = (id) => {
2797
- return this.baseHttpService.api({
2798
- method: 'patch',
2799
- url: `${this.serviceUrl}/${id}/restore`,
2800
- });
2801
- };
2802
- this.duplicate$ = (body) => {
2803
- return this.baseHttpService
2804
- .api({
2805
- url: `${this.serviceUrl}/${body.id}/clone`,
2806
- method: 'post',
2807
- body,
2808
- })
2809
- .pipe(map$1(response => response.clonedRecordId));
2810
- };
2811
- }
2812
- search$(expression, skip, count) {
2813
- let params = new HttpParams();
2814
- if (typeof skip === 'number') {
2815
- params = params.set('skip', '' + skip);
2816
- }
2817
- if (typeof count === 'number') {
2818
- params = params.set('count', '' + count);
2819
- }
2820
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
3277
+ deleteSalesforceOrganization$(payload) {
3278
+ return this.http.delete(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}`, {
3279
+ headers: {
3280
+ 'Veloce-Token': this.TOKEN_HEADER,
3281
+ },
3282
+ });
2821
3283
  }
2822
- create$(body) {
2823
- return this.baseHttpService.api({
2824
- url: `${this.serviceUrl}`,
2825
- method: 'post',
2826
- body,
3284
+ activateSalesforceOrganization$(payload) {
3285
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}/activate`, {}, {
3286
+ headers: {
3287
+ 'Veloce-Token': this.TOKEN_HEADER,
3288
+ },
2827
3289
  });
2828
3290
  }
2829
- update$(body) {
2830
- return this.baseHttpService.api({
2831
- url: `${this.serviceUrl}/${body.id}`,
2832
- method: 'put',
2833
- body,
3291
+ deactivateSalesforceOrganization$(payload) {
3292
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}/deactivate`, {}, {
3293
+ headers: {
3294
+ 'Veloce-Token': this.TOKEN_HEADER,
3295
+ },
2834
3296
  });
2835
3297
  }
2836
3298
  }
2837
- PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2838
- PromotionsApiServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
2839
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
3299
+ SandboxManagerApiService.MAX_RESULTS = 60;
3300
+ SandboxManagerApiServicefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3301
+ SandboxManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService });
3302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, decorators: [{
2840
3303
  type: Injectable
2841
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
3304
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
2842
3305
 
2843
3306
  class ApiModule {
2844
3307
  }
@@ -2881,6 +3344,12 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
2881
3344
  RebateProgramApiService,
2882
3345
  RebateTypeApiService,
2883
3346
  PromotionsApiService,
3347
+ VeloceAuthService,
3348
+ ContractedPriceApiService,
3349
+ PortalsApiService,
3350
+ ConfigurationProcessorsApiService,
3351
+ FlowStateApiService,
3352
+ SandboxManagerApiService,
2884
3353
  ], imports: [HttpClientModule] });
2885
3354
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, decorators: [{
2886
3355
  type: NgModule,
@@ -2923,6 +3392,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2923
3392
  RebateProgramApiService,
2924
3393
  RebateTypeApiService,
2925
3394
  PromotionsApiService,
3395
+ VeloceAuthService,
3396
+ ContractedPriceApiService,
3397
+ PortalsApiService,
3398
+ ConfigurationProcessorsApiService,
3399
+ FlowStateApiService,
3400
+ SandboxManagerApiService,
2926
3401
  ],
2927
3402
  }]
2928
3403
  }] });
@@ -2931,5 +3406,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2931
3406
  * Generated bundle index. Do not edit.
2932
3407
  */
2933
3408
 
2934
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, PromotionsApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceObjectsApiService };
3409
+ export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationProcessorsApiService, ConfigurationSettingsApiService, ContextApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, PromotionsApiService, QuoteApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, SandboxManagerApiService, ScriptsApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, UIDefinitionsApiService, UITemplatesApiService, VeloceAuthService, VeloceObjectsApiService };
2935
3410
  //# sourceMappingURL=veloceapps-api.mjs.map