@elasticpath/js-sdk 24.3.0 → 24.3.2
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/README.md +1 -1
- package/dist/index.cjs.js +44 -36
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +44 -36
- package/dist/index.js +44 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<img src="https://www.elasticpath.com/themes/custom/bootstrap_sass/logo.svg" alt="" width="400" />
|
|
2
2
|
|
|
3
|
-
# Elastic Path Commerce Cloud JavaScript SDK
|
|
3
|
+
# Elastic Path Commerce Cloud JavaScript SDK
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@elasticpath/js-sdk)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
package/dist/index.cjs.js
CHANGED
|
@@ -530,7 +530,7 @@ if (!globalThis.fetch) {
|
|
|
530
530
|
globalThis.Response = fetch$1.Response;
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
var version = "24.3.
|
|
533
|
+
var version = "24.3.2";
|
|
534
534
|
|
|
535
535
|
var LocalStorageFactory = /*#__PURE__*/function () {
|
|
536
536
|
function LocalStorageFactory() {
|
|
@@ -704,6 +704,49 @@ var DEFAULT_CREDENTIALS_KEY = 'epCredentials';
|
|
|
704
704
|
var DEFAULT_CART_KEY = 'epcart';
|
|
705
705
|
var DEFAULT_CURRENCY_KEY = 'epcurrency';
|
|
706
706
|
|
|
707
|
+
function formatFilterString(type, filter) {
|
|
708
|
+
var filterStringArray = Object.keys(filter).map(function (key) {
|
|
709
|
+
var value = filter[key];
|
|
710
|
+
var queryString = "".concat(key, ",").concat(value);
|
|
711
|
+
if (Array.isArray(value)) {
|
|
712
|
+
queryString = "".concat(key, ",").concat(value.join(','));
|
|
713
|
+
} else if (_typeof(value) === 'object' && value !== null) {
|
|
714
|
+
queryString = Object.keys(value).map(function (attr) {
|
|
715
|
+
return "".concat(key, ".").concat(attr, ",").concat(value[attr]);
|
|
716
|
+
}).join(':');
|
|
717
|
+
}
|
|
718
|
+
return "".concat(type, "(").concat(queryString, ")");
|
|
719
|
+
});
|
|
720
|
+
return filterStringArray.join(':');
|
|
721
|
+
}
|
|
722
|
+
function formatQueryString(key, value) {
|
|
723
|
+
if (key === 'limit' || key === 'offset') {
|
|
724
|
+
return "page".concat(value);
|
|
725
|
+
}
|
|
726
|
+
if (key === 'filter') {
|
|
727
|
+
var filterValues = [];
|
|
728
|
+
|
|
729
|
+
// Handle 'or' conditions if they exist
|
|
730
|
+
if (value.or && Array.isArray(value.or)) {
|
|
731
|
+
var orQueries = value.or.map(function (filterGroup) {
|
|
732
|
+
return Object.keys(filterGroup).map(function (filterType) {
|
|
733
|
+
return formatFilterString(filterType, filterGroup[filterType]);
|
|
734
|
+
}).join(':');
|
|
735
|
+
});
|
|
736
|
+
filterValues.push("(".concat(orQueries.join('|'), ")"));
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// Handle other filter types
|
|
740
|
+
Object.keys(value).forEach(function (filter) {
|
|
741
|
+
if (filter !== 'or') {
|
|
742
|
+
filterValues.push(formatFilterString(filter, value[filter]));
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
return "".concat(key, "=").concat(filterValues.join(':'));
|
|
746
|
+
}
|
|
747
|
+
return "".concat(key, "=").concat(value);
|
|
748
|
+
}
|
|
749
|
+
|
|
707
750
|
function buildRelationshipData(type, ids) {
|
|
708
751
|
var typeModifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : inflected.underscore;
|
|
709
752
|
var data = [];
|
|
@@ -773,41 +816,6 @@ function parseJSON(response) {
|
|
|
773
816
|
});
|
|
774
817
|
});
|
|
775
818
|
}
|
|
776
|
-
function formatFilterString(type, filter) {
|
|
777
|
-
var filterStringArray = Object.keys(filter).map(function (key) {
|
|
778
|
-
var value = filter[key];
|
|
779
|
-
var queryString = "".concat(key, ",").concat(value);
|
|
780
|
-
if (Array.isArray(value)) {
|
|
781
|
-
queryString = "".concat(key, ",").concat(value.join(','));
|
|
782
|
-
} else if (_typeof(value) === 'object' && value !== null) {
|
|
783
|
-
queryString = Object.keys(value).map(function (attr) {
|
|
784
|
-
return "".concat(key, ".").concat(attr, ",").concat(value[attr]);
|
|
785
|
-
}).join(':');
|
|
786
|
-
}
|
|
787
|
-
return "".concat(type, "(").concat(queryString, ")");
|
|
788
|
-
});
|
|
789
|
-
return filterStringArray.join(':');
|
|
790
|
-
}
|
|
791
|
-
function formatQueryString(key, value) {
|
|
792
|
-
if (key === 'limit' || key === 'offset') {
|
|
793
|
-
return "page".concat(value);
|
|
794
|
-
}
|
|
795
|
-
if (key === 'filter') {
|
|
796
|
-
if (value.or && Array.isArray(value.or)) {
|
|
797
|
-
var orQueries = value.or.map(function (filterGroup) {
|
|
798
|
-
return Object.keys(filterGroup).map(function (filterType) {
|
|
799
|
-
return formatFilterString(filterType, filterGroup[filterType]);
|
|
800
|
-
}).join(':');
|
|
801
|
-
});
|
|
802
|
-
return "".concat(key, "=(").concat(orQueries.join('|'), ")");
|
|
803
|
-
}
|
|
804
|
-
var filterValues = Object.keys(value).map(function (filter) {
|
|
805
|
-
return formatFilterString(filter, value[filter]);
|
|
806
|
-
});
|
|
807
|
-
return "".concat(key, "=").concat(filterValues.join(':'));
|
|
808
|
-
}
|
|
809
|
-
return "".concat(key, "=").concat(value);
|
|
810
|
-
}
|
|
811
819
|
function buildQueryParams(_ref) {
|
|
812
820
|
var includes = _ref.includes,
|
|
813
821
|
sort = _ref.sort,
|
package/dist/index.d.ts
CHANGED
|
@@ -6221,7 +6221,7 @@ interface Account extends AccountBase, Identifiable {
|
|
|
6221
6221
|
interface AccountBase {
|
|
6222
6222
|
type: string
|
|
6223
6223
|
name: string
|
|
6224
|
-
legal_name
|
|
6224
|
+
legal_name?: string
|
|
6225
6225
|
registration_id?: string
|
|
6226
6226
|
parent_id?: string
|
|
6227
6227
|
external_ref?: string
|
package/dist/index.esm.js
CHANGED
|
@@ -519,7 +519,7 @@ if (!globalThis.fetch) {
|
|
|
519
519
|
globalThis.Response = Response;
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
-
var version = "24.3.
|
|
522
|
+
var version = "24.3.2";
|
|
523
523
|
|
|
524
524
|
var LocalStorageFactory = /*#__PURE__*/function () {
|
|
525
525
|
function LocalStorageFactory() {
|
|
@@ -693,6 +693,49 @@ var DEFAULT_CREDENTIALS_KEY = 'epCredentials';
|
|
|
693
693
|
var DEFAULT_CART_KEY = 'epcart';
|
|
694
694
|
var DEFAULT_CURRENCY_KEY = 'epcurrency';
|
|
695
695
|
|
|
696
|
+
function formatFilterString(type, filter) {
|
|
697
|
+
var filterStringArray = Object.keys(filter).map(function (key) {
|
|
698
|
+
var value = filter[key];
|
|
699
|
+
var queryString = "".concat(key, ",").concat(value);
|
|
700
|
+
if (Array.isArray(value)) {
|
|
701
|
+
queryString = "".concat(key, ",").concat(value.join(','));
|
|
702
|
+
} else if (_typeof(value) === 'object' && value !== null) {
|
|
703
|
+
queryString = Object.keys(value).map(function (attr) {
|
|
704
|
+
return "".concat(key, ".").concat(attr, ",").concat(value[attr]);
|
|
705
|
+
}).join(':');
|
|
706
|
+
}
|
|
707
|
+
return "".concat(type, "(").concat(queryString, ")");
|
|
708
|
+
});
|
|
709
|
+
return filterStringArray.join(':');
|
|
710
|
+
}
|
|
711
|
+
function formatQueryString(key, value) {
|
|
712
|
+
if (key === 'limit' || key === 'offset') {
|
|
713
|
+
return "page".concat(value);
|
|
714
|
+
}
|
|
715
|
+
if (key === 'filter') {
|
|
716
|
+
var filterValues = [];
|
|
717
|
+
|
|
718
|
+
// Handle 'or' conditions if they exist
|
|
719
|
+
if (value.or && Array.isArray(value.or)) {
|
|
720
|
+
var orQueries = value.or.map(function (filterGroup) {
|
|
721
|
+
return Object.keys(filterGroup).map(function (filterType) {
|
|
722
|
+
return formatFilterString(filterType, filterGroup[filterType]);
|
|
723
|
+
}).join(':');
|
|
724
|
+
});
|
|
725
|
+
filterValues.push("(".concat(orQueries.join('|'), ")"));
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// Handle other filter types
|
|
729
|
+
Object.keys(value).forEach(function (filter) {
|
|
730
|
+
if (filter !== 'or') {
|
|
731
|
+
filterValues.push(formatFilterString(filter, value[filter]));
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
return "".concat(key, "=").concat(filterValues.join(':'));
|
|
735
|
+
}
|
|
736
|
+
return "".concat(key, "=").concat(value);
|
|
737
|
+
}
|
|
738
|
+
|
|
696
739
|
function buildRelationshipData(type, ids) {
|
|
697
740
|
var typeModifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : underscore;
|
|
698
741
|
var data = [];
|
|
@@ -762,41 +805,6 @@ function parseJSON(response) {
|
|
|
762
805
|
});
|
|
763
806
|
});
|
|
764
807
|
}
|
|
765
|
-
function formatFilterString(type, filter) {
|
|
766
|
-
var filterStringArray = Object.keys(filter).map(function (key) {
|
|
767
|
-
var value = filter[key];
|
|
768
|
-
var queryString = "".concat(key, ",").concat(value);
|
|
769
|
-
if (Array.isArray(value)) {
|
|
770
|
-
queryString = "".concat(key, ",").concat(value.join(','));
|
|
771
|
-
} else if (_typeof(value) === 'object' && value !== null) {
|
|
772
|
-
queryString = Object.keys(value).map(function (attr) {
|
|
773
|
-
return "".concat(key, ".").concat(attr, ",").concat(value[attr]);
|
|
774
|
-
}).join(':');
|
|
775
|
-
}
|
|
776
|
-
return "".concat(type, "(").concat(queryString, ")");
|
|
777
|
-
});
|
|
778
|
-
return filterStringArray.join(':');
|
|
779
|
-
}
|
|
780
|
-
function formatQueryString(key, value) {
|
|
781
|
-
if (key === 'limit' || key === 'offset') {
|
|
782
|
-
return "page".concat(value);
|
|
783
|
-
}
|
|
784
|
-
if (key === 'filter') {
|
|
785
|
-
if (value.or && Array.isArray(value.or)) {
|
|
786
|
-
var orQueries = value.or.map(function (filterGroup) {
|
|
787
|
-
return Object.keys(filterGroup).map(function (filterType) {
|
|
788
|
-
return formatFilterString(filterType, filterGroup[filterType]);
|
|
789
|
-
}).join(':');
|
|
790
|
-
});
|
|
791
|
-
return "".concat(key, "=(").concat(orQueries.join('|'), ")");
|
|
792
|
-
}
|
|
793
|
-
var filterValues = Object.keys(value).map(function (filter) {
|
|
794
|
-
return formatFilterString(filter, value[filter]);
|
|
795
|
-
});
|
|
796
|
-
return "".concat(key, "=").concat(filterValues.join(':'));
|
|
797
|
-
}
|
|
798
|
-
return "".concat(key, "=").concat(value);
|
|
799
|
-
}
|
|
800
808
|
function buildQueryParams(_ref) {
|
|
801
809
|
var includes = _ref.includes,
|
|
802
810
|
sort = _ref.sort,
|
package/dist/index.js
CHANGED
|
@@ -1085,7 +1085,7 @@
|
|
|
1085
1085
|
globalThis.Response = browserPonyfill.exports.Response;
|
|
1086
1086
|
}
|
|
1087
1087
|
|
|
1088
|
-
var version = "24.3.
|
|
1088
|
+
var version = "24.3.2";
|
|
1089
1089
|
|
|
1090
1090
|
var LocalStorageFactory = /*#__PURE__*/function () {
|
|
1091
1091
|
function LocalStorageFactory() {
|
|
@@ -1861,6 +1861,49 @@
|
|
|
1861
1861
|
var DEFAULT_CART_KEY = 'epcart';
|
|
1862
1862
|
var DEFAULT_CURRENCY_KEY = 'epcurrency';
|
|
1863
1863
|
|
|
1864
|
+
function formatFilterString(type, filter) {
|
|
1865
|
+
var filterStringArray = Object.keys(filter).map(function (key) {
|
|
1866
|
+
var value = filter[key];
|
|
1867
|
+
var queryString = "".concat(key, ",").concat(value);
|
|
1868
|
+
if (Array.isArray(value)) {
|
|
1869
|
+
queryString = "".concat(key, ",").concat(value.join(','));
|
|
1870
|
+
} else if (_typeof(value) === 'object' && value !== null) {
|
|
1871
|
+
queryString = Object.keys(value).map(function (attr) {
|
|
1872
|
+
return "".concat(key, ".").concat(attr, ",").concat(value[attr]);
|
|
1873
|
+
}).join(':');
|
|
1874
|
+
}
|
|
1875
|
+
return "".concat(type, "(").concat(queryString, ")");
|
|
1876
|
+
});
|
|
1877
|
+
return filterStringArray.join(':');
|
|
1878
|
+
}
|
|
1879
|
+
function formatQueryString(key, value) {
|
|
1880
|
+
if (key === 'limit' || key === 'offset') {
|
|
1881
|
+
return "page".concat(value);
|
|
1882
|
+
}
|
|
1883
|
+
if (key === 'filter') {
|
|
1884
|
+
var filterValues = [];
|
|
1885
|
+
|
|
1886
|
+
// Handle 'or' conditions if they exist
|
|
1887
|
+
if (value.or && Array.isArray(value.or)) {
|
|
1888
|
+
var orQueries = value.or.map(function (filterGroup) {
|
|
1889
|
+
return Object.keys(filterGroup).map(function (filterType) {
|
|
1890
|
+
return formatFilterString(filterType, filterGroup[filterType]);
|
|
1891
|
+
}).join(':');
|
|
1892
|
+
});
|
|
1893
|
+
filterValues.push("(".concat(orQueries.join('|'), ")"));
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
// Handle other filter types
|
|
1897
|
+
Object.keys(value).forEach(function (filter) {
|
|
1898
|
+
if (filter !== 'or') {
|
|
1899
|
+
filterValues.push(formatFilterString(filter, value[filter]));
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
return "".concat(key, "=").concat(filterValues.join(':'));
|
|
1903
|
+
}
|
|
1904
|
+
return "".concat(key, "=").concat(value);
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1864
1907
|
function buildRelationshipData(type, ids) {
|
|
1865
1908
|
var typeModifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : underscore;
|
|
1866
1909
|
var data = [];
|
|
@@ -1930,41 +1973,6 @@
|
|
|
1930
1973
|
});
|
|
1931
1974
|
});
|
|
1932
1975
|
}
|
|
1933
|
-
function formatFilterString(type, filter) {
|
|
1934
|
-
var filterStringArray = Object.keys(filter).map(function (key) {
|
|
1935
|
-
var value = filter[key];
|
|
1936
|
-
var queryString = "".concat(key, ",").concat(value);
|
|
1937
|
-
if (Array.isArray(value)) {
|
|
1938
|
-
queryString = "".concat(key, ",").concat(value.join(','));
|
|
1939
|
-
} else if (_typeof(value) === 'object' && value !== null) {
|
|
1940
|
-
queryString = Object.keys(value).map(function (attr) {
|
|
1941
|
-
return "".concat(key, ".").concat(attr, ",").concat(value[attr]);
|
|
1942
|
-
}).join(':');
|
|
1943
|
-
}
|
|
1944
|
-
return "".concat(type, "(").concat(queryString, ")");
|
|
1945
|
-
});
|
|
1946
|
-
return filterStringArray.join(':');
|
|
1947
|
-
}
|
|
1948
|
-
function formatQueryString(key, value) {
|
|
1949
|
-
if (key === 'limit' || key === 'offset') {
|
|
1950
|
-
return "page".concat(value);
|
|
1951
|
-
}
|
|
1952
|
-
if (key === 'filter') {
|
|
1953
|
-
if (value.or && Array.isArray(value.or)) {
|
|
1954
|
-
var orQueries = value.or.map(function (filterGroup) {
|
|
1955
|
-
return Object.keys(filterGroup).map(function (filterType) {
|
|
1956
|
-
return formatFilterString(filterType, filterGroup[filterType]);
|
|
1957
|
-
}).join(':');
|
|
1958
|
-
});
|
|
1959
|
-
return "".concat(key, "=(").concat(orQueries.join('|'), ")");
|
|
1960
|
-
}
|
|
1961
|
-
var filterValues = Object.keys(value).map(function (filter) {
|
|
1962
|
-
return formatFilterString(filter, value[filter]);
|
|
1963
|
-
});
|
|
1964
|
-
return "".concat(key, "=").concat(filterValues.join(':'));
|
|
1965
|
-
}
|
|
1966
|
-
return "".concat(key, "=").concat(value);
|
|
1967
|
-
}
|
|
1968
1976
|
function buildQueryParams(_ref) {
|
|
1969
1977
|
var includes = _ref.includes,
|
|
1970
1978
|
sort = _ref.sort,
|
package/package.json
CHANGED