@veloceapps/sdk 8.0.0-114 → 8.0.0-115
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/core/services/flow-state.service.d.ts +1 -0
- package/esm2020/core/services/flow-state.service.mjs +18 -5
- package/fesm2015/veloceapps-sdk-core.mjs +18 -4
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +17 -4
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -999,13 +999,15 @@ class FlowStateService {
|
|
|
999
999
|
.map(({ request }) => request.selectors)
|
|
1000
1000
|
.filter(isDefined)
|
|
1001
1001
|
.reduce((trunk, selectors) => ({ ...trunk, ...selectors }), {});
|
|
1002
|
+
const request = this.getDefaultExecutionRequestDTO();
|
|
1002
1003
|
return this.flowStateApiService
|
|
1003
1004
|
.init({
|
|
1004
1005
|
quoteId: this.contextService.resolve().headerId,
|
|
1005
1006
|
params: this.flowInfoService.params ?? {},
|
|
1006
1007
|
actionsOverride: processors?.filter(processor => processor.type === ConfigurationProcessorTypes.ACTION),
|
|
1007
1008
|
selectorsOverride: processors?.filter(processor => processor.type === ConfigurationProcessorTypes.SELECTOR),
|
|
1008
|
-
selectors,
|
|
1009
|
+
selectors: { ...selectors, ...request.selectors },
|
|
1010
|
+
actions: request.actions,
|
|
1009
1011
|
})
|
|
1010
1012
|
.pipe(map$1(({ stateId, selectors }) => {
|
|
1011
1013
|
this.handleSelectorsResponse(selectors);
|
|
@@ -1024,9 +1026,7 @@ class FlowStateService {
|
|
|
1024
1026
|
}
|
|
1025
1027
|
initStateless$() {
|
|
1026
1028
|
const { headerId } = this.contextService.resolve();
|
|
1027
|
-
const stateInit$ = this.quoteDraftService
|
|
1028
|
-
.init(headerId, this.flowInfoService.params ?? {})
|
|
1029
|
-
.pipe(switchMap(() => this.calculate$()));
|
|
1029
|
+
const stateInit$ = this.quoteDraftService.init(headerId, this.flowInfoService.params ?? {}).pipe(switchMap(() => this.executeRequest$(this.getDefaultExecutionRequestDTO())), switchMap(() => this.calculate$()));
|
|
1030
1030
|
return stateInit$.pipe(tap$1(() => this.quoteDraftService.finalizeInit()), map$1(noop));
|
|
1031
1031
|
}
|
|
1032
1032
|
calculate$() {
|
|
@@ -1141,6 +1141,19 @@ class FlowStateService {
|
|
|
1141
1141
|
const inputDataHash = UUID.hex(JSON.stringify(inputData) || '').slice(0, 8);
|
|
1142
1142
|
return `${scope}/${selectorName}/${inputDataHash}`;
|
|
1143
1143
|
}
|
|
1144
|
+
getDefaultExecutionRequestDTO() {
|
|
1145
|
+
const request = {
|
|
1146
|
+
actions: [],
|
|
1147
|
+
selectors: {},
|
|
1148
|
+
};
|
|
1149
|
+
const ownerId = this.getOwnerIdByScope(UITemplateType.FLOW_ENGINE);
|
|
1150
|
+
request.actions?.push({
|
|
1151
|
+
apiName: 'INITIALIZE_STATE',
|
|
1152
|
+
ownerId,
|
|
1153
|
+
inputData: {},
|
|
1154
|
+
});
|
|
1155
|
+
return request;
|
|
1156
|
+
}
|
|
1144
1157
|
}
|
|
1145
1158
|
FlowStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateService, deps: [{ token: ContextService }, { token: QuoteDraftService }, { token: FlowInfoService }, { token: FlowConfigurationService }, { token: i1.ConfigurationProcessorsApiService }, { token: i1.FlowStateApiService }, { token: i1.QuoteApiService }, { token: i6.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1146
1159
|
FlowStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateService, providedIn: 'root' });
|