@veloceapps/sdk 11.0.0-82 → 11.0.0-84
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.
- package/cms/vendor-map.d.ts +2 -1
- package/core/modules/configuration/index.d.ts +1 -0
- package/core/modules/configuration/services/configuration.service.d.ts +4 -6
- package/core/modules/configuration/services/guided-selling.service.d.ts +13 -0
- package/core/services/flow-state-configuration.service.d.ts +8 -1
- package/esm2020/cms/vendor-map.mjs +3 -2
- package/esm2020/core/modules/configuration/configuration.module.mjs +4 -1
- package/esm2020/core/modules/configuration/index.mjs +2 -1
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +3 -3
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +29 -32
- package/esm2020/core/modules/configuration/services/guided-selling.service.mjs +47 -0
- package/esm2020/core/modules/configuration/services/test-mode-configuration.service.mjs +2 -2
- package/esm2020/core/services/flow-state-configuration.service.mjs +48 -6
- package/esm2020/core/services/flow-state.service.mjs +2 -2
- package/esm2020/src/services/flow-dialog.service.mjs +3 -24
- package/fesm2015/veloceapps-sdk-cms.mjs +2 -1
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +101 -40
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +2 -23
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +2 -1
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +179 -103
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +2 -23
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/services/flow-dialog.service.d.ts +1 -4
@@ -364,6 +364,18 @@ function extractMetadata(uiDefinition) {
|
|
364
364
|
}
|
365
365
|
|
366
366
|
class ConfigurationService {
|
367
|
+
constructor(flowInfoService, messageService, configurationRuntimeService, salesTransactionService, orchestrationsApiService) {
|
368
|
+
this.flowInfoService = flowInfoService;
|
369
|
+
this.messageService = messageService;
|
370
|
+
this.configurationRuntimeService = configurationRuntimeService;
|
371
|
+
this.salesTransactionService = salesTransactionService;
|
372
|
+
this.orchestrationsApiService = orchestrationsApiService;
|
373
|
+
this.hasUnsavedChanges = false;
|
374
|
+
this.configurationStateSubj$ = new BehaviorSubject(null);
|
375
|
+
this.previousConfigurationStateSubj$ = new BehaviorSubject(null);
|
376
|
+
this.isLoadingSubj$ = new BehaviorSubject(false);
|
377
|
+
this.isLoading$ = this.isLoadingSubj$.asObservable();
|
378
|
+
}
|
367
379
|
get state$() {
|
368
380
|
return this.configurationStateSubj$.asObservable().pipe(filter$1(isDefined));
|
369
381
|
}
|
@@ -379,18 +391,6 @@ class ConfigurationService {
|
|
379
391
|
get root() {
|
380
392
|
return this.configurationStateSubj$.getValue()?.salesTransaction.salesTransactionItems[0] ?? null;
|
381
393
|
}
|
382
|
-
constructor(flowInfoService, messageService, configurationRuntimeService, salesTransactionService, orchestrationsApiService) {
|
383
|
-
this.flowInfoService = flowInfoService;
|
384
|
-
this.messageService = messageService;
|
385
|
-
this.configurationRuntimeService = configurationRuntimeService;
|
386
|
-
this.salesTransactionService = salesTransactionService;
|
387
|
-
this.orchestrationsApiService = orchestrationsApiService;
|
388
|
-
this.hasUnsavedChanges = false;
|
389
|
-
this.configurationStateSubj$ = new BehaviorSubject(null);
|
390
|
-
this.previousConfigurationStateSubj$ = new BehaviorSubject(null);
|
391
|
-
this.isLoadingSubj$ = new BehaviorSubject(false);
|
392
|
-
this.isLoading$ = this.isLoadingSubj$.asObservable();
|
393
|
-
}
|
394
394
|
reset() {
|
395
395
|
this.hasUnsavedChanges = false;
|
396
396
|
this.configurationStateSubj$.next(null);
|
@@ -419,7 +419,7 @@ class ConfigurationService {
|
|
419
419
|
salesTransactionItems: transactionItem ? [transactionItem] : [],
|
420
420
|
},
|
421
421
|
};
|
422
|
-
return (isRootGenerated ? this.
|
422
|
+
return (isRootGenerated ? this.configure$(configurationState) : of(configurationState)).pipe(tap$1(configurationState => {
|
423
423
|
this.configurationStateSubj$.next(configurationState);
|
424
424
|
this.previousConfigurationStateSubj$.next(configurationState);
|
425
425
|
}), map$1(noop));
|
@@ -440,7 +440,7 @@ class ConfigurationService {
|
|
440
440
|
salesTransactionItems: [newRoot],
|
441
441
|
},
|
442
442
|
};
|
443
|
-
return this.
|
443
|
+
return this.configure$(newTransactionContext).pipe(catchError(error => {
|
444
444
|
console.error(error);
|
445
445
|
if (!this.configurationRuntimeService.uiDefinitionProps.suppressToastMessages) {
|
446
446
|
this.messageService.add({ severity: 'error', summary: error });
|
@@ -455,34 +455,31 @@ class ConfigurationService {
|
|
455
455
|
patch(transactionItem) {
|
456
456
|
this.patch$(transactionItem).subscribe();
|
457
457
|
}
|
458
|
-
|
459
|
-
const request = {
|
460
|
-
transactionContext,
|
461
|
-
flowId: this.flowInfoService.flow.id,
|
462
|
-
};
|
458
|
+
configure$(transactionContext) {
|
463
459
|
this.isLoadingSubj$.next(true);
|
464
|
-
return this.
|
460
|
+
return this.justConfigureRequest$(transactionContext).pipe(tap$1(result => {
|
465
461
|
this.configurationStateSubj$.next(result);
|
466
462
|
this.previousConfigurationStateSubj$.next(cloneDeep(result));
|
467
|
-
}), catchError(
|
463
|
+
}), catchError(e => {
|
468
464
|
const resetState = this.previousConfigurationStateSubj$.getValue();
|
469
465
|
if (resetState) {
|
470
466
|
this.previousConfigurationStateSubj$.next(cloneDeep(resetState));
|
471
467
|
this.configurationStateSubj$.next(resetState);
|
472
468
|
}
|
469
|
+
return throwError(() => e);
|
470
|
+
}), finalize(() => this.isLoadingSubj$.next(false)));
|
471
|
+
}
|
472
|
+
justConfigureRequest$(transactionContext) {
|
473
|
+
const request = {
|
474
|
+
transactionContext,
|
475
|
+
flowId: this.flowInfoService.flow.id,
|
476
|
+
};
|
477
|
+
return this.orchestrationsApiService.apply$(request).pipe(catchError(error => throwError(() => {
|
473
478
|
if (error.error) {
|
474
479
|
return extractErrorDetails(error.error).join('. ');
|
475
480
|
}
|
476
481
|
return error.message || JSON.stringify(error);
|
477
|
-
}))
|
478
|
-
}
|
479
|
-
configureExternal$(props) {
|
480
|
-
// TODO: implement
|
481
|
-
throw new Error('Not implemented');
|
482
|
-
}
|
483
|
-
configureGuidedSelling$(data) {
|
484
|
-
// TODO: implement
|
485
|
-
throw new Error('Not implemented');
|
482
|
+
})));
|
486
483
|
}
|
487
484
|
getPCMModel() {
|
488
485
|
const pcmModel = this.configurationRuntimeService.pcmModel;
|
@@ -498,70 +495,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
498
495
|
type: Injectable
|
499
496
|
}], ctorParameters: function () { return [{ type: FlowInfoService }, { type: i2.MessageService }, { type: ConfigurationRuntimeService }, { type: SalesTransactionService }, { type: i1.OrchestrationsApiService }]; } });
|
500
497
|
|
501
|
-
class TestModeConfigurationService {
|
502
|
-
constructor(flowInfoService, configurationService, configurationRuntimeService, salesTransactionService, runtimeSettingsService) {
|
503
|
-
this.flowInfoService = flowInfoService;
|
504
|
-
this.configurationService = configurationService;
|
505
|
-
this.configurationRuntimeService = configurationRuntimeService;
|
506
|
-
this.salesTransactionService = salesTransactionService;
|
507
|
-
this.runtimeSettingsService = runtimeSettingsService;
|
508
|
-
this.isInitialized = false;
|
509
|
-
}
|
510
|
-
initTestMode$(uiDefinitionContainer, options) {
|
511
|
-
this.configurationRuntimeService.uiDefinitionContainer = uiDefinitionContainer;
|
512
|
-
if (this.checkInitialized(uiDefinitionContainer)) {
|
513
|
-
this.configurationRuntimeService.pcmModel = this.pcmModel;
|
514
|
-
return of(undefined);
|
515
|
-
}
|
516
|
-
this.configurationService.reset();
|
517
|
-
const { productId, quoteId, flowId } = uiDefinitionContainer.source.properties ?? {};
|
518
|
-
if (!productId) {
|
519
|
-
return throwError(() => 'Unable to start the Configuration Preview: Product is missing.');
|
520
|
-
}
|
521
|
-
if (!quoteId) {
|
522
|
-
return throwError(() => `Unable to start the Configuration Preview: Quote is missing.`);
|
523
|
-
}
|
524
|
-
if (!flowId) {
|
525
|
-
return throwError(() => `Unable to start the Configuration Preview: Flow is missing.`);
|
526
|
-
}
|
527
|
-
return this.runtimeSettingsService.create().pipe(switchMap(() => this.flowInfoService.init$(flowId, { productId, headerId: quoteId })), switchMap(() => this.configurationRuntimeService.init$({ productId })), tap(pcmModel => (this.pcmModel = pcmModel)), switchMap(() => {
|
528
|
-
if (options?.customizationMode) {
|
529
|
-
return of(undefined);
|
530
|
-
}
|
531
|
-
return this.initConfiguration$(quoteId);
|
532
|
-
}), tap(() => (this.isInitialized = true)), map(noop));
|
533
|
-
}
|
534
|
-
initConfiguration$(quoteId) {
|
535
|
-
this.salesTransactionService.setState(this.getTestTransactionContext(quoteId));
|
536
|
-
return this.configurationService.init$().pipe(switchMap(() => this.configurationService.state
|
537
|
-
? this.configurationService.configureRequest$(this.configurationService.state)
|
538
|
-
: of(undefined)), map(noop));
|
539
|
-
}
|
540
|
-
getTestTransactionContext(quoteId) {
|
541
|
-
const testTransaction = {
|
542
|
-
id: quoteId,
|
543
|
-
businessObjectType: 'Quote',
|
544
|
-
salesTransactionItems: [],
|
545
|
-
};
|
546
|
-
return {
|
547
|
-
salesTransaction: testTransaction,
|
548
|
-
transactionId: quoteId,
|
549
|
-
businessObjectType: 'Quote',
|
550
|
-
childNodes: {},
|
551
|
-
id: UUID.UUID(),
|
552
|
-
tagAttributes: {},
|
553
|
-
};
|
554
|
-
}
|
555
|
-
checkInitialized(uiDefinitionContainer) {
|
556
|
-
return this.isInitialized && !!uiDefinitionContainer.source.properties?.persistTestState;
|
557
|
-
}
|
558
|
-
}
|
559
|
-
TestModeConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TestModeConfigurationService, deps: [{ token: FlowInfoService }, { token: ConfigurationService }, { token: ConfigurationRuntimeService }, { token: SalesTransactionService }, { token: RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
560
|
-
TestModeConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TestModeConfigurationService });
|
561
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TestModeConfigurationService, decorators: [{
|
562
|
-
type: Injectable
|
563
|
-
}], ctorParameters: function () { return [{ type: FlowInfoService }, { type: ConfigurationService }, { type: ConfigurationRuntimeService }, { type: SalesTransactionService }, { type: RuntimeSettingsService }]; } });
|
564
|
-
|
565
498
|
class SalesTransactionService {
|
566
499
|
get isInitialized$() {
|
567
500
|
return this.isInitializedSubj$.asObservable();
|
@@ -693,6 +626,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
693
626
|
type: Injectable
|
694
627
|
}], ctorParameters: function () { return [{ type: i1.OrchestrationsApiService }, { type: SalesTransactionService }, { type: FlowInfoService }]; } });
|
695
628
|
|
629
|
+
class TestModeConfigurationService {
|
630
|
+
constructor(flowInfoService, configurationService, configurationRuntimeService, salesTransactionService, runtimeSettingsService) {
|
631
|
+
this.flowInfoService = flowInfoService;
|
632
|
+
this.configurationService = configurationService;
|
633
|
+
this.configurationRuntimeService = configurationRuntimeService;
|
634
|
+
this.salesTransactionService = salesTransactionService;
|
635
|
+
this.runtimeSettingsService = runtimeSettingsService;
|
636
|
+
this.isInitialized = false;
|
637
|
+
}
|
638
|
+
initTestMode$(uiDefinitionContainer, options) {
|
639
|
+
this.configurationRuntimeService.uiDefinitionContainer = uiDefinitionContainer;
|
640
|
+
if (this.checkInitialized(uiDefinitionContainer)) {
|
641
|
+
this.configurationRuntimeService.pcmModel = this.pcmModel;
|
642
|
+
return of(undefined);
|
643
|
+
}
|
644
|
+
this.configurationService.reset();
|
645
|
+
const { productId, quoteId, flowId } = uiDefinitionContainer.source.properties ?? {};
|
646
|
+
if (!productId) {
|
647
|
+
return throwError(() => 'Unable to start the Configuration Preview: Product is missing.');
|
648
|
+
}
|
649
|
+
if (!quoteId) {
|
650
|
+
return throwError(() => `Unable to start the Configuration Preview: Quote is missing.`);
|
651
|
+
}
|
652
|
+
if (!flowId) {
|
653
|
+
return throwError(() => `Unable to start the Configuration Preview: Flow is missing.`);
|
654
|
+
}
|
655
|
+
return this.runtimeSettingsService.create().pipe(switchMap(() => this.flowInfoService.init$(flowId, { productId, headerId: quoteId })), switchMap(() => this.configurationRuntimeService.init$({ productId })), tap(pcmModel => (this.pcmModel = pcmModel)), switchMap(() => {
|
656
|
+
if (options?.customizationMode) {
|
657
|
+
return of(undefined);
|
658
|
+
}
|
659
|
+
return this.initConfiguration$(quoteId);
|
660
|
+
}), tap(() => (this.isInitialized = true)), map(noop));
|
661
|
+
}
|
662
|
+
initConfiguration$(quoteId) {
|
663
|
+
this.salesTransactionService.setState(this.getTestTransactionContext(quoteId));
|
664
|
+
return this.configurationService.init$().pipe(switchMap(() => this.configurationService.state
|
665
|
+
? this.configurationService.configure$(this.configurationService.state)
|
666
|
+
: of(undefined)), map(noop));
|
667
|
+
}
|
668
|
+
getTestTransactionContext(quoteId) {
|
669
|
+
const testTransaction = {
|
670
|
+
id: quoteId,
|
671
|
+
businessObjectType: 'Quote',
|
672
|
+
salesTransactionItems: [],
|
673
|
+
};
|
674
|
+
return {
|
675
|
+
salesTransaction: testTransaction,
|
676
|
+
transactionId: quoteId,
|
677
|
+
businessObjectType: 'Quote',
|
678
|
+
childNodes: {},
|
679
|
+
id: UUID.UUID(),
|
680
|
+
tagAttributes: {},
|
681
|
+
};
|
682
|
+
}
|
683
|
+
checkInitialized(uiDefinitionContainer) {
|
684
|
+
return this.isInitialized && !!uiDefinitionContainer.source.properties?.persistTestState;
|
685
|
+
}
|
686
|
+
}
|
687
|
+
TestModeConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TestModeConfigurationService, deps: [{ token: FlowInfoService }, { token: ConfigurationService }, { token: ConfigurationRuntimeService }, { token: SalesTransactionService }, { token: RuntimeSettingsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
688
|
+
TestModeConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TestModeConfigurationService });
|
689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TestModeConfigurationService, decorators: [{
|
690
|
+
type: Injectable
|
691
|
+
}], ctorParameters: function () { return [{ type: FlowInfoService }, { type: ConfigurationService }, { type: ConfigurationRuntimeService }, { type: SalesTransactionService }, { type: RuntimeSettingsService }]; } });
|
692
|
+
|
693
|
+
class GuidedSellingService {
|
694
|
+
constructor(orchestrationsApiService) {
|
695
|
+
this.orchestrationsApiService = orchestrationsApiService;
|
696
|
+
}
|
697
|
+
configureGuidedSelling$(data) {
|
698
|
+
return this.orchestrationsApiService.apply$({
|
699
|
+
transactionContext: this.getTransactionContext(data.attributesMap),
|
700
|
+
orchestrationName: data.orchestrationName,
|
701
|
+
});
|
702
|
+
}
|
703
|
+
getTransactionContext(guidedSellingAttributes) {
|
704
|
+
const testTransaction = {
|
705
|
+
id: UUID.UUID(),
|
706
|
+
businessObjectType: 'Quote',
|
707
|
+
salesTransactionItems: [],
|
708
|
+
tagAttributes: {},
|
709
|
+
};
|
710
|
+
return {
|
711
|
+
salesTransaction: testTransaction,
|
712
|
+
transactionId: UUID.UUID(),
|
713
|
+
businessObjectType: 'Quote',
|
714
|
+
childNodes: {
|
715
|
+
GuidedSelling: [
|
716
|
+
{
|
717
|
+
id: UUID.UUID(),
|
718
|
+
tagAttributes: {},
|
719
|
+
childNodes: {},
|
720
|
+
properties: { guidedSellingAttributes },
|
721
|
+
},
|
722
|
+
],
|
723
|
+
},
|
724
|
+
id: UUID.UUID(),
|
725
|
+
tagAttributes: {},
|
726
|
+
};
|
727
|
+
}
|
728
|
+
}
|
729
|
+
GuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService, deps: [{ token: i1.OrchestrationsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
730
|
+
GuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService });
|
731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService, decorators: [{
|
732
|
+
type: Injectable
|
733
|
+
}], ctorParameters: function () { return [{ type: i1.OrchestrationsApiService }]; } });
|
734
|
+
|
696
735
|
class FlowStateService {
|
697
736
|
constructor(flowConfiguration, flowInfoService, flowStateApiService, processorsApiService, salesTransactionApiService, salesTransactionService, toastService, customizationService) {
|
698
737
|
this.flowConfiguration = flowConfiguration;
|
@@ -839,7 +878,7 @@ class FlowStateService {
|
|
839
878
|
transactionContext: state,
|
840
879
|
flowId: this.flowInfoService.flow.id,
|
841
880
|
};
|
842
|
-
return this.salesTransactionApiService.
|
881
|
+
return this.salesTransactionApiService.save(request).pipe(map(id => ({ id })));
|
843
882
|
}
|
844
883
|
}
|
845
884
|
return of({ id: '' });
|
@@ -1093,9 +1132,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1093
1132
|
}] }]; } });
|
1094
1133
|
|
1095
1134
|
class FlowStateConfigurationService {
|
1096
|
-
constructor(flowInfoService, flowStateService) {
|
1135
|
+
constructor(flowInfoService, flowStateService, configurationService, salesTransactionService, flowConfigurationService) {
|
1097
1136
|
this.flowInfoService = flowInfoService;
|
1098
1137
|
this.flowStateService = flowStateService;
|
1138
|
+
this.configurationService = configurationService;
|
1139
|
+
this.salesTransactionService = salesTransactionService;
|
1140
|
+
this.flowConfigurationService = flowConfigurationService;
|
1099
1141
|
}
|
1100
1142
|
addToCart$(props) {
|
1101
1143
|
let request$;
|
@@ -1111,17 +1153,49 @@ class FlowStateConfigurationService {
|
|
1111
1153
|
}
|
1112
1154
|
}
|
1113
1155
|
else {
|
1114
|
-
|
1115
|
-
request$ = of();
|
1156
|
+
request$ = this.configureExternal$(props);
|
1116
1157
|
}
|
1117
1158
|
return request$.pipe(switchMap(() => this.flowStateService.executeRequest$({}, true)), map(noop));
|
1118
1159
|
}
|
1160
|
+
configureExternal$(props) {
|
1161
|
+
const { state } = this.salesTransactionService;
|
1162
|
+
if (!state) {
|
1163
|
+
return of();
|
1164
|
+
}
|
1165
|
+
const stateToConfigure = {
|
1166
|
+
...state,
|
1167
|
+
salesTransaction: {
|
1168
|
+
...state.salesTransaction,
|
1169
|
+
salesTransactionItems: [
|
1170
|
+
{
|
1171
|
+
...generateTransactionItem(props.productId),
|
1172
|
+
qty: props.qty ?? 1,
|
1173
|
+
tagAttributes: props.attributesMap ?? {},
|
1174
|
+
},
|
1175
|
+
],
|
1176
|
+
},
|
1177
|
+
};
|
1178
|
+
return this.configurationService.justConfigureRequest$(stateToConfigure).pipe(switchMap(configurationResult => {
|
1179
|
+
const state = this.salesTransactionService.state;
|
1180
|
+
const addedProduct = configurationResult.salesTransaction.salesTransactionItems[0];
|
1181
|
+
if (!state || !addedProduct) {
|
1182
|
+
return of();
|
1183
|
+
}
|
1184
|
+
return this.flowConfigurationService.calculate$({
|
1185
|
+
...state,
|
1186
|
+
salesTransaction: {
|
1187
|
+
...state.salesTransaction,
|
1188
|
+
salesTransactionItems: [...state.salesTransaction.salesTransactionItems, addedProduct],
|
1189
|
+
},
|
1190
|
+
});
|
1191
|
+
}));
|
1192
|
+
}
|
1119
1193
|
}
|
1120
|
-
FlowStateConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateConfigurationService, deps: [{ token: FlowInfoService }, { token: FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1194
|
+
FlowStateConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateConfigurationService, deps: [{ token: FlowInfoService }, { token: FlowStateService }, { token: ConfigurationService }, { token: SalesTransactionService }, { token: FlowConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1121
1195
|
FlowStateConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateConfigurationService });
|
1122
1196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateConfigurationService, decorators: [{
|
1123
1197
|
type: Injectable
|
1124
|
-
}], ctorParameters: function () { return [{ type: FlowInfoService }, { type: FlowStateService }]; } });
|
1198
|
+
}], ctorParameters: function () { return [{ type: FlowInfoService }, { type: FlowStateService }, { type: ConfigurationService }, { type: SalesTransactionService }, { type: FlowConfigurationService }]; } });
|
1125
1199
|
|
1126
1200
|
class IntegrationState {
|
1127
1201
|
constructor() {
|
@@ -1335,7 +1409,7 @@ class ConfigurationStateService {
|
|
1335
1409
|
transactionContext: state,
|
1336
1410
|
flowId: this.flowInfoService.flow.id,
|
1337
1411
|
};
|
1338
|
-
return this.salesTransactionApiService.
|
1412
|
+
return this.salesTransactionApiService.save(request).pipe(map(id => ({ id })));
|
1339
1413
|
}
|
1340
1414
|
const transactionContext = this.salesTransactionService.state;
|
1341
1415
|
const configurationRoot = this.configurationService.root;
|
@@ -1455,7 +1529,7 @@ class ConfigurationStateService {
|
|
1455
1529
|
request.actions.forEach(action => {
|
1456
1530
|
state = this.executeActionScript(state, action) ?? state;
|
1457
1531
|
});
|
1458
|
-
return this.configurationService.
|
1532
|
+
return this.configurationService.configure$(state);
|
1459
1533
|
}), map(() => {
|
1460
1534
|
// Run selectors and apply them to the state
|
1461
1535
|
const configurationState = this.configurationService.state;
|
@@ -1569,6 +1643,7 @@ ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
|
|
1569
1643
|
ConfigurationStateService,
|
1570
1644
|
ConfigurationRuntimeService,
|
1571
1645
|
TestModeConfigurationService,
|
1646
|
+
GuidedSellingService,
|
1572
1647
|
], imports: [ConfirmationDialogModule, ApiModule] });
|
1573
1648
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, decorators: [{
|
1574
1649
|
type: NgModule,
|
@@ -1579,6 +1654,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1579
1654
|
ConfigurationStateService,
|
1580
1655
|
ConfigurationRuntimeService,
|
1581
1656
|
TestModeConfigurationService,
|
1657
|
+
GuidedSellingService,
|
1582
1658
|
],
|
1583
1659
|
}]
|
1584
1660
|
}] });
|
@@ -1817,5 +1893,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1817
1893
|
* Generated bundle index. Do not edit.
|
1818
1894
|
*/
|
1819
1895
|
|
1820
|
-
export { ActionCodePipe, CalendarDirective, CatalogProductsService, ConfigurationRuntimeService, ConfigurationService, ConfigurationStateService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FLOW_CUSTOMIZATION, FORMATTING_SETTINGS_TOKEN, FlowConfigurationService, FlowInfoService, FlowStateConfigurationService, FlowStateService, IntegrationState, NumberPipe, PricePipe, ProductImagesService, RuntimeSettingsService, SalesTransactionService, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, TestModeConfigurationService, TransactionItemWorker, UI_DEFINITION_VERSION, extractMetadata, filterSuccessfulExecute, findTransactionItem, findTransactionItemWithComparator, generateTransactionItem, insertTransactionItem, removeTransactionItem, replaceTransactionItem };
|
1896
|
+
export { ActionCodePipe, CalendarDirective, CatalogProductsService, ConfigurationRuntimeService, ConfigurationService, ConfigurationStateService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FLOW_CUSTOMIZATION, FORMATTING_SETTINGS_TOKEN, FlowConfigurationService, FlowInfoService, FlowStateConfigurationService, FlowStateService, GuidedSellingService, IntegrationState, NumberPipe, PricePipe, ProductImagesService, RuntimeSettingsService, SalesTransactionService, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, TestModeConfigurationService, TransactionItemWorker, UI_DEFINITION_VERSION, extractMetadata, filterSuccessfulExecute, findTransactionItem, findTransactionItemWithComparator, generateTransactionItem, insertTransactionItem, removeTransactionItem, replaceTransactionItem };
|
1821
1897
|
//# sourceMappingURL=veloceapps-sdk-core.mjs.map
|