@veloceapps/sdk 2.0.2 → 2.0.4
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/bundles/veloce-sdk-cms.umd.js +28 -8
- package/bundles/veloce-sdk-cms.umd.js.map +1 -1
- package/bundles/veloce-sdk-runtime.umd.js +0 -29
- package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
- package/cms/modules/configuration/services/configuration.service.d.ts +5 -1
- package/esm2015/cms/launcher.module.js +4 -3
- package/esm2015/cms/modules/configuration/services/configuration.service.js +12 -5
- package/esm2015/cms/plugins/script.plugin.js +6 -1
- package/esm2015/cms/utils/element.utils.js +4 -3
- package/esm2015/runtime/execution/runtime-execution.module.js +1 -4
- package/esm2015/runtime/runtime.module.js +1 -4
- package/esm2015/runtime/services/index.js +1 -2
- package/esm2015/runtime/types/index.js +1 -2
- package/fesm2015/veloce-sdk-cms.js +21 -9
- package/fesm2015/veloce-sdk-cms.js.map +1 -1
- package/fesm2015/veloce-sdk-runtime.js +1 -25
- package/fesm2015/veloce-sdk-runtime.js.map +1 -1
- package/package.json +2 -2
- package/runtime/services/index.d.ts +0 -1
- package/runtime/types/index.d.ts +0 -1
- package/esm2015/runtime/services/flow.service.js +0 -24
- package/esm2015/runtime/types/flow.types.js +0 -2
- package/runtime/services/flow.service.d.ts +0 -14
- package/runtime/types/flow.types.d.ts +0 -5
|
@@ -571,6 +571,7 @@
|
|
|
571
571
|
this.states = {};
|
|
572
572
|
this.uiDefinitionProperties = {};
|
|
573
573
|
this.lineItem = new rxjs.BehaviorSubject(undefined);
|
|
574
|
+
this.charges = new rxjs.BehaviorSubject({});
|
|
574
575
|
}
|
|
575
576
|
ConfigurationService.prototype.init = function (modelId, uiDefinitionProperties) {
|
|
576
577
|
var _this = this;
|
|
@@ -609,8 +610,7 @@
|
|
|
609
610
|
.subscribe();
|
|
610
611
|
};
|
|
611
612
|
ConfigurationService.prototype.get = function () {
|
|
612
|
-
|
|
613
|
-
return (_a = this.lineItem) === null || _a === void 0 ? void 0 : _a.asObservable().pipe(rxjs.shareReplay());
|
|
613
|
+
return this.lineItem.asObservable().pipe(rxjs.shareReplay());
|
|
614
614
|
};
|
|
615
615
|
ConfigurationService.prototype.getSnapshot = function () {
|
|
616
616
|
return this.lineItem.value ? Object.assign({}, this.lineItem.value) : undefined;
|
|
@@ -621,6 +621,20 @@
|
|
|
621
621
|
ConfigurationService.prototype.getRuntimeContext = function () {
|
|
622
622
|
return this.runtimeContext;
|
|
623
623
|
};
|
|
624
|
+
Object.defineProperty(ConfigurationService.prototype, "charges$", {
|
|
625
|
+
get: function () {
|
|
626
|
+
return this.charges.asObservable();
|
|
627
|
+
},
|
|
628
|
+
enumerable: false,
|
|
629
|
+
configurable: true
|
|
630
|
+
});
|
|
631
|
+
Object.defineProperty(ConfigurationService.prototype, "chargesSnapshot", {
|
|
632
|
+
get: function () {
|
|
633
|
+
return this.charges.value;
|
|
634
|
+
},
|
|
635
|
+
enumerable: false,
|
|
636
|
+
configurable: true
|
|
637
|
+
});
|
|
624
638
|
ConfigurationService.prototype.configure = function () {
|
|
625
639
|
var _this = this;
|
|
626
640
|
var _a, _b;
|
|
@@ -635,17 +649,18 @@
|
|
|
635
649
|
var request$;
|
|
636
650
|
if (this.uiDefinitionProperties.pricingEnabled) {
|
|
637
651
|
request$ = this.configurationApiService.configureAndPriceLineItem(configurationRequest, this.runtimeModel).pipe(rxjsOperators.map(function (_d) {
|
|
638
|
-
var lineItem = _d.lineItem, context = _d.context;
|
|
652
|
+
var lineItem = _d.lineItem, context = _d.context, charges = _d.charges;
|
|
639
653
|
if (context) {
|
|
640
654
|
_this.contextService.update({ properties: context.properties });
|
|
641
655
|
}
|
|
656
|
+
_this.charges.next(charges !== null && charges !== void 0 ? charges : {});
|
|
642
657
|
return lineItem;
|
|
643
658
|
}));
|
|
644
659
|
}
|
|
645
660
|
else {
|
|
646
661
|
request$ = this.configurationApiService.configureLineItem(configurationRequest, runtimeModel);
|
|
647
662
|
}
|
|
648
|
-
return request$.pipe(rxjsOperators.tap(function (lineItem) {
|
|
663
|
+
return request$.pipe(rxjsOperators.tap(function (lineItem) { return lineItem && _this.lineItem.next(lineItem); }), rxjsOperators.catchError(function (error) { return rxjs.throwError(function () { var _a; return new Error(((_a = error.error) === null || _a === void 0 ? void 0 : _a.message) || error.message || JSON.stringify(error)); }); }));
|
|
649
664
|
};
|
|
650
665
|
ConfigurationService.prototype.createRequest = function (lineItem) {
|
|
651
666
|
var _a, _b, _c;
|
|
@@ -846,7 +861,7 @@
|
|
|
846
861
|
}] });
|
|
847
862
|
|
|
848
863
|
var EXPORTED_CLASS_REGEX = /export class (\S+)/;
|
|
849
|
-
var METADATA_DECORATOR_REGEX = /@ElementDefinition\(([
|
|
864
|
+
var METADATA_DECORATOR_REGEX = /@ElementDefinition\(([\s\S]+)\)(\n|.)*export class/g;
|
|
850
865
|
var elementToMetadata = function (el, parentPath) {
|
|
851
866
|
var _a;
|
|
852
867
|
var script = el.script && window.atob(el.script);
|
|
@@ -866,6 +881,7 @@
|
|
|
866
881
|
type: metadata.type,
|
|
867
882
|
model: metadata.model,
|
|
868
883
|
module: metadata.module,
|
|
884
|
+
reference: metadata.reference,
|
|
869
885
|
inputs: metadata.inputs,
|
|
870
886
|
outputs: metadata.outputs,
|
|
871
887
|
children: metadata.children.map(function (_b) {
|
|
@@ -874,7 +890,7 @@
|
|
|
874
890
|
}),
|
|
875
891
|
};
|
|
876
892
|
var script = metadata.script &&
|
|
877
|
-
window.btoa(metadata.script.replace(EXPORTED_CLASS_REGEX, "@ElementDefinition(" + JSON.stringify(elMetadata) + ") export class Script
|
|
893
|
+
window.btoa(metadata.script.replace(EXPORTED_CLASS_REGEX, "@ElementDefinition(" + JSON.stringify(elMetadata) + ") export class Script"));
|
|
878
894
|
var template = metadata.template && window.btoa(metadata.template);
|
|
879
895
|
var styles = metadata.styles && window.btoa(metadata.styles);
|
|
880
896
|
return {
|
|
@@ -1236,6 +1252,10 @@
|
|
|
1236
1252
|
|
|
1237
1253
|
var vendorMap = {
|
|
1238
1254
|
'@veloce/sdk/cms': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, vlCmsModules), vlCmsUtils), vlCmsLineItemTypes), vlInjectionTokens), { TemplatesService: TemplatesService }),
|
|
1255
|
+
'@veloce/api': {
|
|
1256
|
+
SalesforceApiService: i1.SalesforceApiService,
|
|
1257
|
+
QuoteApiService: i1.QuoteApiService
|
|
1258
|
+
},
|
|
1239
1259
|
'@angular/core': i0__namespace,
|
|
1240
1260
|
'@angular/forms': angularForms__namespace,
|
|
1241
1261
|
rxjs: rxjs__namespace,
|
|
@@ -1794,12 +1814,12 @@
|
|
|
1794
1814
|
}());
|
|
1795
1815
|
LauncherModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1796
1816
|
LauncherModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, imports: [i6.CommonModule, core.CoreModule, ConfigurationModule] });
|
|
1797
|
-
LauncherModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, providers: [LauncherService, DynamicModuleService], imports: [[i6.CommonModule, core.CoreModule, ConfigurationModule]] });
|
|
1817
|
+
LauncherModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, providers: [LauncherService, DynamicModuleService, i1.SalesforceApiService, i1.QuoteApiService], imports: [[i6.CommonModule, core.CoreModule, ConfigurationModule]] });
|
|
1798
1818
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, decorators: [{
|
|
1799
1819
|
type: i0.NgModule,
|
|
1800
1820
|
args: [{
|
|
1801
1821
|
imports: [i6.CommonModule, core.CoreModule, ConfigurationModule],
|
|
1802
|
-
providers: [LauncherService, DynamicModuleService],
|
|
1822
|
+
providers: [LauncherService, DynamicModuleService, i1.SalesforceApiService, i1.QuoteApiService],
|
|
1803
1823
|
}]
|
|
1804
1824
|
}] });
|
|
1805
1825
|
|