@veloceapps/sdk 11.0.0-81 → 11.0.0-83
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 +2 -3
- package/core/modules/configuration/services/guided-selling.service.d.ts +13 -0
- 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.service.mjs +13 -17
- package/esm2020/core/modules/configuration/services/guided-selling.service.mjs +47 -0
- package/esm2020/core/services/sales-transaction.service.mjs +7 -2
- package/fesm2015/veloceapps-sdk-cms.mjs +2 -1
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +63 -18
- package/fesm2015/veloceapps-sdk-core.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 +63 -18
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/package.json +1 -1
@@ -421,6 +421,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
421
421
|
type: Injectable
|
422
422
|
}], ctorParameters: function () { return [{ type: FlowInfoService }, { type: ConfigurationService }, { type: ConfigurationRuntimeService }, { type: SalesTransactionService }, { type: RuntimeSettingsService }]; } });
|
423
423
|
|
424
|
+
class GuidedSellingService {
|
425
|
+
constructor(orchestrationsApiService) {
|
426
|
+
this.orchestrationsApiService = orchestrationsApiService;
|
427
|
+
}
|
428
|
+
configureGuidedSelling$(data) {
|
429
|
+
return this.orchestrationsApiService.apply$({
|
430
|
+
transactionContext: this.getTransactionContext(data.attributesMap),
|
431
|
+
orchestrationName: data.orchestrationName,
|
432
|
+
});
|
433
|
+
}
|
434
|
+
getTransactionContext(guidedSellingAttributes) {
|
435
|
+
const testTransaction = {
|
436
|
+
id: UUID.UUID(),
|
437
|
+
businessObjectType: 'Quote',
|
438
|
+
salesTransactionItems: [],
|
439
|
+
tagAttributes: {},
|
440
|
+
};
|
441
|
+
return {
|
442
|
+
salesTransaction: testTransaction,
|
443
|
+
transactionId: UUID.UUID(),
|
444
|
+
businessObjectType: 'Quote',
|
445
|
+
childNodes: {
|
446
|
+
GuidedSelling: [
|
447
|
+
{
|
448
|
+
id: UUID.UUID(),
|
449
|
+
tagAttributes: {},
|
450
|
+
childNodes: {},
|
451
|
+
properties: { guidedSellingAttributes },
|
452
|
+
},
|
453
|
+
],
|
454
|
+
},
|
455
|
+
id: UUID.UUID(),
|
456
|
+
tagAttributes: {},
|
457
|
+
};
|
458
|
+
}
|
459
|
+
}
|
460
|
+
GuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService, deps: [{ token: i1.OrchestrationsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
461
|
+
GuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService });
|
462
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService, decorators: [{
|
463
|
+
type: Injectable
|
464
|
+
}], ctorParameters: function () { return [{ type: i1.OrchestrationsApiService }]; } });
|
465
|
+
|
424
466
|
class SalesTransactionService {
|
425
467
|
get isInitialized$() {
|
426
468
|
return this.isInitializedSubj$.asObservable();
|
@@ -455,7 +497,12 @@ class SalesTransactionService {
|
|
455
497
|
this.state$ = this.stateSubj$.asObservable().pipe(filter(isDefined));
|
456
498
|
}
|
457
499
|
init(headerId, params) {
|
458
|
-
return this.salesTransactionApiService.
|
500
|
+
return this.salesTransactionApiService.query(headerId, params).pipe(tap(res => {
|
501
|
+
if (!res.salesTransaction) {
|
502
|
+
throw new Error('SalesTransaction is not defined. Please check Query Orchestration.');
|
503
|
+
}
|
504
|
+
this.stateSubj$.next(res);
|
505
|
+
}));
|
459
506
|
}
|
460
507
|
finalizeInit() {
|
461
508
|
this.isInitializedSubj$.next(true);
|
@@ -1072,6 +1119,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1072
1119
|
}] });
|
1073
1120
|
|
1074
1121
|
class ConfigurationService {
|
1122
|
+
constructor(flowInfoService, messageService, configurationRuntimeService, salesTransactionService, orchestrationsApiService) {
|
1123
|
+
this.flowInfoService = flowInfoService;
|
1124
|
+
this.messageService = messageService;
|
1125
|
+
this.configurationRuntimeService = configurationRuntimeService;
|
1126
|
+
this.salesTransactionService = salesTransactionService;
|
1127
|
+
this.orchestrationsApiService = orchestrationsApiService;
|
1128
|
+
this.hasUnsavedChanges = false;
|
1129
|
+
this.configurationStateSubj$ = new BehaviorSubject(null);
|
1130
|
+
this.previousConfigurationStateSubj$ = new BehaviorSubject(null);
|
1131
|
+
this.isLoadingSubj$ = new BehaviorSubject(false);
|
1132
|
+
this.isLoading$ = this.isLoadingSubj$.asObservable();
|
1133
|
+
}
|
1075
1134
|
get state$() {
|
1076
1135
|
return this.configurationStateSubj$.asObservable().pipe(filter$1(isDefined));
|
1077
1136
|
}
|
@@ -1088,18 +1147,6 @@ class ConfigurationService {
|
|
1088
1147
|
var _a, _b;
|
1089
1148
|
return (_b = (_a = this.configurationStateSubj$.getValue()) === null || _a === void 0 ? void 0 : _a.salesTransaction.salesTransactionItems[0]) !== null && _b !== void 0 ? _b : null;
|
1090
1149
|
}
|
1091
|
-
constructor(flowInfoService, messageService, configurationRuntimeService, salesTransactionService, orchestrationsApiService) {
|
1092
|
-
this.flowInfoService = flowInfoService;
|
1093
|
-
this.messageService = messageService;
|
1094
|
-
this.configurationRuntimeService = configurationRuntimeService;
|
1095
|
-
this.salesTransactionService = salesTransactionService;
|
1096
|
-
this.orchestrationsApiService = orchestrationsApiService;
|
1097
|
-
this.hasUnsavedChanges = false;
|
1098
|
-
this.configurationStateSubj$ = new BehaviorSubject(null);
|
1099
|
-
this.previousConfigurationStateSubj$ = new BehaviorSubject(null);
|
1100
|
-
this.isLoadingSubj$ = new BehaviorSubject(false);
|
1101
|
-
this.isLoading$ = this.isLoadingSubj$.asObservable();
|
1102
|
-
}
|
1103
1150
|
reset() {
|
1104
1151
|
this.hasUnsavedChanges = false;
|
1105
1152
|
this.configurationStateSubj$.next(null);
|
@@ -1178,10 +1225,6 @@ class ConfigurationService {
|
|
1178
1225
|
// TODO: implement
|
1179
1226
|
throw new Error('Not implemented');
|
1180
1227
|
}
|
1181
|
-
configureGuidedSelling$(data) {
|
1182
|
-
// TODO: implement
|
1183
|
-
throw new Error('Not implemented');
|
1184
|
-
}
|
1185
1228
|
getPCMModel() {
|
1186
1229
|
const pcmModel = this.configurationRuntimeService.pcmModel;
|
1187
1230
|
if (!pcmModel) {
|
@@ -1574,6 +1617,7 @@ ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
|
|
1574
1617
|
ConfigurationStateService,
|
1575
1618
|
ConfigurationRuntimeService,
|
1576
1619
|
TestModeConfigurationService,
|
1620
|
+
GuidedSellingService,
|
1577
1621
|
], imports: [ConfirmationDialogModule, ApiModule] });
|
1578
1622
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, decorators: [{
|
1579
1623
|
type: NgModule,
|
@@ -1584,6 +1628,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1584
1628
|
ConfigurationStateService,
|
1585
1629
|
ConfigurationRuntimeService,
|
1586
1630
|
TestModeConfigurationService,
|
1631
|
+
GuidedSellingService,
|
1587
1632
|
],
|
1588
1633
|
}]
|
1589
1634
|
}] });
|
@@ -1832,5 +1877,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1832
1877
|
* Generated bundle index. Do not edit.
|
1833
1878
|
*/
|
1834
1879
|
|
1835
|
-
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 };
|
1880
|
+
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 };
|
1836
1881
|
//# sourceMappingURL=veloceapps-sdk-core.mjs.map
|