@veloceapps/sdk 3.0.10 → 3.0.12
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 +45 -19
- package/bundles/veloce-sdk-cms.umd.js.map +1 -1
- package/bundles/veloce-sdk.umd.js +63 -27
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/cms/modules/configuration/services/configuration.service.d.ts +3 -1
- package/cms/modules/flow-configuration/services/flow-configuration.service.d.ts +2 -4
- package/esm2015/cms/modules/configuration/services/configuration.service.js +7 -1
- package/esm2015/cms/modules/flow-configuration/services/flow-configuration.service.js +17 -19
- package/esm2015/cms/modules/flow-configuration/services/flow-update.service.js +15 -2
- package/esm2015/src/components/header/cart-overlay/cart-overlay.component.js +31 -26
- package/esm2015/src/components/header/header.component.js +34 -3
- package/esm2015/src/components/header/header.types.js +1 -1
- package/fesm2015/veloce-sdk-cms.js +37 -20
- package/fesm2015/veloce-sdk-cms.js.map +1 -1
- package/fesm2015/veloce-sdk.js +63 -27
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/components/header/cart-overlay/cart-overlay.component.d.ts +11 -9
- package/src/components/header/header.component.d.ts +3 -2
- package/src/components/header/header.types.d.ts +9 -0
|
@@ -1240,6 +1240,20 @@
|
|
|
1240
1240
|
ConfigurationService.prototype.getRuntimeContext = function () {
|
|
1241
1241
|
return this.runtimeService.runtimeContext;
|
|
1242
1242
|
};
|
|
1243
|
+
Object.defineProperty(ConfigurationService.prototype, "contextSnapshot", {
|
|
1244
|
+
get: function () {
|
|
1245
|
+
return this.contextService.resolve();
|
|
1246
|
+
},
|
|
1247
|
+
enumerable: false,
|
|
1248
|
+
configurable: true
|
|
1249
|
+
});
|
|
1250
|
+
Object.defineProperty(ConfigurationService.prototype, "context$", {
|
|
1251
|
+
get: function () {
|
|
1252
|
+
return this.contextService.resolve$();
|
|
1253
|
+
},
|
|
1254
|
+
enumerable: false,
|
|
1255
|
+
configurable: true
|
|
1256
|
+
});
|
|
1243
1257
|
Object.defineProperty(ConfigurationService.prototype, "charges$", {
|
|
1244
1258
|
get: function () {
|
|
1245
1259
|
return this.charges.asObservable();
|
|
@@ -1795,7 +1809,20 @@
|
|
|
1795
1809
|
}
|
|
1796
1810
|
};
|
|
1797
1811
|
FlowUpdateService.prototype.delete = function (lineItems, id) {
|
|
1798
|
-
var
|
|
1812
|
+
var idsToRemove = [id];
|
|
1813
|
+
var topLevelLineItem = lineItems.find(function (li) { return li.id === id; });
|
|
1814
|
+
if (topLevelLineItem) {
|
|
1815
|
+
// find term-related line items (which are only top level)
|
|
1816
|
+
// expired term line items won't be deleted
|
|
1817
|
+
var foundTermLineItem_1 = topLevelLineItem;
|
|
1818
|
+
while (foundTermLineItem_1) {
|
|
1819
|
+
foundTermLineItem_1 = lineItems.find(function (li) { return foundTermLineItem_1 && li.rampInstanceId === foundTermLineItem_1.id; });
|
|
1820
|
+
if (foundTermLineItem_1) {
|
|
1821
|
+
idsToRemove.push(foundTermLineItem_1.id);
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
var filtered = lineItems.filter(function (lineItem) { return !idsToRemove.includes(lineItem.id); });
|
|
1799
1826
|
return filtered.map(function (lineItem) { return new LineItemWorker(lineItem).remove(id).li; });
|
|
1800
1827
|
};
|
|
1801
1828
|
FlowUpdateService.prototype.updateQty = function (rootLineItem, params) {
|
|
@@ -1900,30 +1927,24 @@
|
|
|
1900
1927
|
if (context) {
|
|
1901
1928
|
_this.contextService.update({ properties: context.properties });
|
|
1902
1929
|
}
|
|
1903
|
-
}),
|
|
1930
|
+
}), this.handleError());
|
|
1904
1931
|
};
|
|
1905
1932
|
FlowConfigurationService.prototype.calculate = function (currentState) {
|
|
1906
1933
|
this.calculate$(currentState).subscribe();
|
|
1907
1934
|
};
|
|
1908
1935
|
FlowConfigurationService.prototype.update$ = function (params) {
|
|
1909
1936
|
var _this = this;
|
|
1910
|
-
return rxjs.of([]).pipe(rxjs.map(function () { return _this.lineItems.value.map(function (li) { return _this.updateService.update(li, params); }); }),
|
|
1937
|
+
return rxjs.of([]).pipe(rxjs.map(function () { return _this.lineItems.value.map(function (li) { return _this.updateService.update(li, params); }); }), this.handleError(), rxjs.switchMap(function (currentState) { return _this.calculate$(currentState); }));
|
|
1911
1938
|
};
|
|
1912
1939
|
FlowConfigurationService.prototype.update = function (params) {
|
|
1913
1940
|
this.update$(params).subscribe();
|
|
1914
1941
|
};
|
|
1915
|
-
FlowConfigurationService.prototype.delete$ = function (
|
|
1942
|
+
FlowConfigurationService.prototype.delete$ = function (ids) {
|
|
1916
1943
|
var _this = this;
|
|
1917
|
-
return rxjs.of([]).pipe(rxjs.map(function () { return _this.updateService.delete(
|
|
1944
|
+
return rxjs.of([]).pipe(rxjs.map(function () { return ids.reduce(function (result, id) { return _this.updateService.delete(result, id); }, _this.lineItems.value); }), this.handleError(), rxjs.switchMap(function (currentState) { return _this.calculate$(currentState); }));
|
|
1918
1945
|
};
|
|
1919
|
-
FlowConfigurationService.prototype.
|
|
1920
|
-
|
|
1921
|
-
};
|
|
1922
|
-
FlowConfigurationService.prototype.delete = function (id) {
|
|
1923
|
-
this.delete$(id).subscribe();
|
|
1924
|
-
};
|
|
1925
|
-
FlowConfigurationService.prototype.deleteAll = function () {
|
|
1926
|
-
this.deleteAll$().subscribe();
|
|
1946
|
+
FlowConfigurationService.prototype.delete = function (ids) {
|
|
1947
|
+
this.delete$(ids).subscribe();
|
|
1927
1948
|
};
|
|
1928
1949
|
FlowConfigurationService.prototype.get = function () {
|
|
1929
1950
|
return this.lineItems.asObservable().pipe(rxjs.shareReplay());
|
|
@@ -1959,12 +1980,17 @@
|
|
|
1959
1980
|
enumerable: false,
|
|
1960
1981
|
configurable: true
|
|
1961
1982
|
});
|
|
1962
|
-
FlowConfigurationService.prototype.handleError = function (
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1983
|
+
FlowConfigurationService.prototype.handleError = function () {
|
|
1984
|
+
var _this = this;
|
|
1985
|
+
return function (source$) {
|
|
1986
|
+
return source$.pipe(rxjs.catchError(function (error) {
|
|
1987
|
+
console.error(error);
|
|
1988
|
+
_this.messageService.add({ severity: 'error', summary: error });
|
|
1989
|
+
// bounce back if configuration call has failed
|
|
1990
|
+
_this.lineItems.next(_this.lineItems.value.slice());
|
|
1991
|
+
return rxjs.throwError(function () { return error; });
|
|
1992
|
+
}));
|
|
1993
|
+
};
|
|
1968
1994
|
};
|
|
1969
1995
|
return FlowConfigurationService;
|
|
1970
1996
|
}());
|