@polyv/product-sdk 1.4.0-rc-20250904.1 → 1.5.0-rc-20250925.1
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/index.cjs.js +5 -5
- package/index.es.d.ts +125 -0
- package/index.es.js +302 -55
- package/index.umd.js +5 -5
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -183,10 +183,18 @@ var PolyvApiUrl = /* @__PURE__ */ (function(PolyvApiUrl2) {
|
|
|
183
183
|
PolyvApiUrl2["OpenProductPrice"] = "/live/v4/channel/product/open-price";
|
|
184
184
|
PolyvApiUrl2["HideProductPrice"] = "/live/v4/channel/product/un-open-price";
|
|
185
185
|
PolyvApiUrl2["ProductPushRule"] = "/live/v4/channel/product/push/rule";
|
|
186
|
+
PolyvApiUrl2["UpdateProductPushRule"] = "/live/v4/channel/product/push/rule/save";
|
|
186
187
|
PolyvApiUrl2["PushProduct"] = "/live/v4/channel/product/push/push";
|
|
187
188
|
PolyvApiUrl2["CancelPushProduct"] = "/live/v4/channel/product/push/cancel-push";
|
|
188
189
|
PolyvApiUrl2["BatchDeleteProduct"] = "/live/v4/channel/product/delete-batch";
|
|
189
190
|
PolyvApiUrl2["BatchShelfProduct"] = "/live/v4/channel/product/shelf-batch";
|
|
191
|
+
PolyvApiUrl2["TopProduct"] = "/live/v4/channel/product/topping";
|
|
192
|
+
PolyvApiUrl2["CancelTopProduct"] = "/live/v4/channel/product/un-topping";
|
|
193
|
+
PolyvApiUrl2["ToggleProductSoldOut"] = "/live/v4/channel/product/update-mark-as-soldout";
|
|
194
|
+
PolyvApiUrl2["GetProductEnabled"] = "/live/v4/channel/product/menu/get-enabled";
|
|
195
|
+
PolyvApiUrl2["UpdateProductEnabled"] = "/live/v4/channel/product/menu/update-enabled";
|
|
196
|
+
PolyvApiUrl2["UpdateProductSort"] = "/live/v4/channel/product/sort-rank";
|
|
197
|
+
PolyvApiUrl2["MoveProduct"] = "/live/v4/channel/product/sort-rank-by-type";
|
|
190
198
|
return PolyvApiUrl2;
|
|
191
199
|
})({});
|
|
192
200
|
var ProductPushRule = /* @__PURE__ */ (function(ProductPushRule2) {
|
|
@@ -276,6 +284,16 @@ var ProductServiceType = /* @__PURE__ */ (function(ProductServiceType2) {
|
|
|
276
284
|
ProductServiceType2["Custom"] = "custom";
|
|
277
285
|
return ProductServiceType2;
|
|
278
286
|
})({});
|
|
287
|
+
var ProductMoveOperation = /* @__PURE__ */ (function(ProductMoveOperation2) {
|
|
288
|
+
ProductMoveOperation2["MoveUp"] = "moveUp";
|
|
289
|
+
ProductMoveOperation2["MoveDown"] = "moveDown";
|
|
290
|
+
return ProductMoveOperation2;
|
|
291
|
+
})({});
|
|
292
|
+
var ProductSortType = /* @__PURE__ */ (function(ProductSortType2) {
|
|
293
|
+
ProductSortType2["Asc"] = "ASC";
|
|
294
|
+
ProductSortType2["Desc"] = "DESC";
|
|
295
|
+
return ProductSortType2;
|
|
296
|
+
})({});
|
|
279
297
|
var AuthType = /* @__PURE__ */ (function(AuthType2) {
|
|
280
298
|
AuthType2["None"] = "none";
|
|
281
299
|
AuthType2["Custom"] = "custom";
|
|
@@ -858,7 +876,8 @@ function filterInternalData(internalData) {
|
|
|
858
876
|
pushRule: internalData.productPushRule,
|
|
859
877
|
pushLogId: internalData.logId,
|
|
860
878
|
rank: internalData.rank,
|
|
861
|
-
originalData: internalData
|
|
879
|
+
originalData: internalData,
|
|
880
|
+
topping: ynToBool(internalData.toppingEnable, "N")
|
|
862
881
|
};
|
|
863
882
|
var linkData = {
|
|
864
883
|
linkType: internalData.linkType,
|
|
@@ -964,6 +983,46 @@ function _typeof$4(o) {
|
|
|
964
983
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
965
984
|
}, _typeof$4(o);
|
|
966
985
|
}
|
|
986
|
+
function _slicedToArray(r, e) {
|
|
987
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
988
|
+
}
|
|
989
|
+
function _nonIterableRest() {
|
|
990
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
991
|
+
}
|
|
992
|
+
function _unsupportedIterableToArray(r, a) {
|
|
993
|
+
if (r) {
|
|
994
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
995
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
996
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
function _arrayLikeToArray(r, a) {
|
|
1000
|
+
(null == a || a > r.length) && (a = r.length);
|
|
1001
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
1002
|
+
return n;
|
|
1003
|
+
}
|
|
1004
|
+
function _iterableToArrayLimit(r, l) {
|
|
1005
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
1006
|
+
if (null != t) {
|
|
1007
|
+
var e, n, i, u, a = [], f = true, o = false;
|
|
1008
|
+
try {
|
|
1009
|
+
if (i = (t = t.call(r)).next, 0 === l) ;
|
|
1010
|
+
else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
1011
|
+
} catch (r2) {
|
|
1012
|
+
o = true, n = r2;
|
|
1013
|
+
} finally {
|
|
1014
|
+
try {
|
|
1015
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
1016
|
+
} finally {
|
|
1017
|
+
if (o) throw n;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
return a;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
function _arrayWithHoles(r) {
|
|
1024
|
+
if (Array.isArray(r)) return r;
|
|
1025
|
+
}
|
|
967
1026
|
function ownKeys$3(e, r) {
|
|
968
1027
|
var t = Object.keys(e);
|
|
969
1028
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1132,6 +1191,8 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1132
1191
|
_defineProperty$4(this, "ProductDeliveryType", ProductDeliveryType);
|
|
1133
1192
|
_defineProperty$4(this, "ProductServiceType", ProductServiceType);
|
|
1134
1193
|
_defineProperty$4(this, "ProductPushRule", ProductPushRule);
|
|
1194
|
+
_defineProperty$4(this, "ProductMoveOperation", ProductMoveOperation);
|
|
1195
|
+
_defineProperty$4(this, "ProductSortType", ProductSortType);
|
|
1135
1196
|
_defineProperty$4(this, "eventEmitter", new EventEmitter());
|
|
1136
1197
|
_defineProperty$4(this, "__isPushingProduct", false);
|
|
1137
1198
|
_defineProperty$4(this, "__handleProductMessage", function(socketData) {
|
|
@@ -1689,7 +1750,7 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1689
1750
|
case 1:
|
|
1690
1751
|
channelInfo = _context10.v;
|
|
1691
1752
|
data = {
|
|
1692
|
-
sessionId: channelInfo.sessionId,
|
|
1753
|
+
sessionId: channelInfo.sessionId || "",
|
|
1693
1754
|
productId
|
|
1694
1755
|
};
|
|
1695
1756
|
_t = recordType;
|
|
@@ -1857,7 +1918,9 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1857
1918
|
pushingProduct: data.channelProductPushingStatusVO,
|
|
1858
1919
|
productPushRule: data.productPushRule,
|
|
1859
1920
|
productExplainEnabled: ynToBool(data.productExplainEnabled, "N"),
|
|
1860
|
-
productExplainingAutoPushAndSticky: ynToBool(data.productExplainingAutoPushAndSticky, "N")
|
|
1921
|
+
productExplainingAutoPushAndSticky: ynToBool(data.productExplainingAutoPushAndSticky, "N"),
|
|
1922
|
+
hideProductPriceEnabled: ynToBool(data.hideProductPriceEnabled, "N"),
|
|
1923
|
+
productListSortType: data.productListSortType
|
|
1861
1924
|
});
|
|
1862
1925
|
}
|
|
1863
1926
|
}, _callee15, this);
|
|
@@ -1868,20 +1931,49 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1868
1931
|
return getProductSetting;
|
|
1869
1932
|
})()
|
|
1870
1933
|
}, {
|
|
1871
|
-
key: "
|
|
1934
|
+
key: "updateProductSetting",
|
|
1872
1935
|
value: (function() {
|
|
1873
|
-
var
|
|
1936
|
+
var _updateProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee16(params) {
|
|
1937
|
+
var booleanFields, payload;
|
|
1874
1938
|
return _regenerator$3().w(function(_context16) {
|
|
1875
1939
|
while (1) switch (_context16.n) {
|
|
1876
1940
|
case 0:
|
|
1877
|
-
|
|
1941
|
+
booleanFields = ["productExplainEnabled", "productExplainingAutoPushAndSticky", "hideProductPriceEnabled"];
|
|
1942
|
+
payload = Object.entries(params).reduce(function(acc, _ref) {
|
|
1943
|
+
var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
|
|
1944
|
+
if (value === void 0) return acc;
|
|
1945
|
+
var fieldKey = key;
|
|
1946
|
+
if (booleanFields.includes(fieldKey) && typeof value === "boolean") {
|
|
1947
|
+
acc[key] = boolToYN(value);
|
|
1948
|
+
} else {
|
|
1949
|
+
acc[key] = value;
|
|
1950
|
+
}
|
|
1951
|
+
return acc;
|
|
1952
|
+
}, {});
|
|
1953
|
+
return _context16.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductPushRule, payload));
|
|
1954
|
+
}
|
|
1955
|
+
}, _callee16, this);
|
|
1956
|
+
}));
|
|
1957
|
+
function updateProductSetting(_x1) {
|
|
1958
|
+
return _updateProductSetting.apply(this, arguments);
|
|
1959
|
+
}
|
|
1960
|
+
return updateProductSetting;
|
|
1961
|
+
})()
|
|
1962
|
+
}, {
|
|
1963
|
+
key: "pushProduct",
|
|
1964
|
+
value: (function() {
|
|
1965
|
+
var _pushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee17(productId, rule) {
|
|
1966
|
+
return _regenerator$3().w(function(_context17) {
|
|
1967
|
+
while (1) switch (_context17.n) {
|
|
1968
|
+
case 0:
|
|
1969
|
+
return _context17.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.PushProduct, {
|
|
1878
1970
|
productId,
|
|
1879
1971
|
productPushRule: rule || ProductPushRule.SmallCard
|
|
1880
1972
|
}));
|
|
1881
1973
|
}
|
|
1882
|
-
},
|
|
1974
|
+
}, _callee17, this);
|
|
1883
1975
|
}));
|
|
1884
|
-
function pushProduct(
|
|
1976
|
+
function pushProduct(_x10, _x11) {
|
|
1885
1977
|
return _pushProduct.apply(this, arguments);
|
|
1886
1978
|
}
|
|
1887
1979
|
return pushProduct;
|
|
@@ -1889,17 +1981,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1889
1981
|
}, {
|
|
1890
1982
|
key: "cancelPushProduct",
|
|
1891
1983
|
value: (function() {
|
|
1892
|
-
var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1893
|
-
return _regenerator$3().w(function(
|
|
1894
|
-
while (1) switch (
|
|
1984
|
+
var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee18(productId) {
|
|
1985
|
+
return _regenerator$3().w(function(_context18) {
|
|
1986
|
+
while (1) switch (_context18.n) {
|
|
1895
1987
|
case 0:
|
|
1896
|
-
return
|
|
1988
|
+
return _context18.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelPushProduct, {
|
|
1897
1989
|
productId
|
|
1898
1990
|
}));
|
|
1899
1991
|
}
|
|
1900
|
-
},
|
|
1992
|
+
}, _callee18, this);
|
|
1901
1993
|
}));
|
|
1902
|
-
function cancelPushProduct(
|
|
1994
|
+
function cancelPushProduct(_x12) {
|
|
1903
1995
|
return _cancelPushProduct.apply(this, arguments);
|
|
1904
1996
|
}
|
|
1905
1997
|
return cancelPushProduct;
|
|
@@ -1907,17 +1999,17 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1907
1999
|
}, {
|
|
1908
2000
|
key: "batchDeleteProduct",
|
|
1909
2001
|
value: (function() {
|
|
1910
|
-
var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1911
|
-
return _regenerator$3().w(function(
|
|
1912
|
-
while (1) switch (
|
|
2002
|
+
var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee19(productIds) {
|
|
2003
|
+
return _regenerator$3().w(function(_context19) {
|
|
2004
|
+
while (1) switch (_context19.n) {
|
|
1913
2005
|
case 0:
|
|
1914
|
-
return
|
|
2006
|
+
return _context19.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchDeleteProduct, {
|
|
1915
2007
|
productIds
|
|
1916
2008
|
}));
|
|
1917
2009
|
}
|
|
1918
|
-
},
|
|
2010
|
+
}, _callee19, this);
|
|
1919
2011
|
}));
|
|
1920
|
-
function batchDeleteProduct(
|
|
2012
|
+
function batchDeleteProduct(_x13) {
|
|
1921
2013
|
return _batchDeleteProduct.apply(this, arguments);
|
|
1922
2014
|
}
|
|
1923
2015
|
return batchDeleteProduct;
|
|
@@ -1925,18 +2017,18 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1925
2017
|
}, {
|
|
1926
2018
|
key: "batchOnShelfProduct",
|
|
1927
2019
|
value: (function() {
|
|
1928
|
-
var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1929
|
-
return _regenerator$3().w(function(
|
|
1930
|
-
while (1) switch (
|
|
2020
|
+
var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee20(productIds) {
|
|
2021
|
+
return _regenerator$3().w(function(_context20) {
|
|
2022
|
+
while (1) switch (_context20.n) {
|
|
1931
2023
|
case 0:
|
|
1932
|
-
return
|
|
2024
|
+
return _context20.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
|
|
1933
2025
|
productIds,
|
|
1934
2026
|
status: ProductStatus.OnSale
|
|
1935
2027
|
}));
|
|
1936
2028
|
}
|
|
1937
|
-
},
|
|
2029
|
+
}, _callee20, this);
|
|
1938
2030
|
}));
|
|
1939
|
-
function batchOnShelfProduct(
|
|
2031
|
+
function batchOnShelfProduct(_x14) {
|
|
1940
2032
|
return _batchOnShelfProduct.apply(this, arguments);
|
|
1941
2033
|
}
|
|
1942
2034
|
return batchOnShelfProduct;
|
|
@@ -1944,77 +2036,230 @@ var Product = /* @__PURE__ */ (function() {
|
|
|
1944
2036
|
}, {
|
|
1945
2037
|
key: "batchOffShelfProduct",
|
|
1946
2038
|
value: (function() {
|
|
1947
|
-
var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
1948
|
-
return _regenerator$3().w(function(
|
|
1949
|
-
while (1) switch (
|
|
2039
|
+
var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee21(productIds) {
|
|
2040
|
+
return _regenerator$3().w(function(_context21) {
|
|
2041
|
+
while (1) switch (_context21.n) {
|
|
1950
2042
|
case 0:
|
|
1951
|
-
return
|
|
2043
|
+
return _context21.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
|
|
1952
2044
|
productIds,
|
|
1953
2045
|
status: ProductStatus.OffSale
|
|
1954
2046
|
}));
|
|
1955
2047
|
}
|
|
1956
|
-
},
|
|
2048
|
+
}, _callee21, this);
|
|
1957
2049
|
}));
|
|
1958
|
-
function batchOffShelfProduct(
|
|
2050
|
+
function batchOffShelfProduct(_x15) {
|
|
1959
2051
|
return _batchOffShelfProduct.apply(this, arguments);
|
|
1960
2052
|
}
|
|
1961
2053
|
return batchOffShelfProduct;
|
|
1962
2054
|
})()
|
|
2055
|
+
}, {
|
|
2056
|
+
key: "topProduct",
|
|
2057
|
+
value: (function() {
|
|
2058
|
+
var _topProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee22(productId) {
|
|
2059
|
+
return _regenerator$3().w(function(_context22) {
|
|
2060
|
+
while (1) switch (_context22.n) {
|
|
2061
|
+
case 0:
|
|
2062
|
+
return _context22.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.TopProduct, {
|
|
2063
|
+
productId
|
|
2064
|
+
}));
|
|
2065
|
+
}
|
|
2066
|
+
}, _callee22, this);
|
|
2067
|
+
}));
|
|
2068
|
+
function topProduct(_x16) {
|
|
2069
|
+
return _topProduct.apply(this, arguments);
|
|
2070
|
+
}
|
|
2071
|
+
return topProduct;
|
|
2072
|
+
})()
|
|
2073
|
+
}, {
|
|
2074
|
+
key: "cancelTopProduct",
|
|
2075
|
+
value: (function() {
|
|
2076
|
+
var _cancelTopProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee23(productId) {
|
|
2077
|
+
return _regenerator$3().w(function(_context23) {
|
|
2078
|
+
while (1) switch (_context23.n) {
|
|
2079
|
+
case 0:
|
|
2080
|
+
return _context23.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelTopProduct, {
|
|
2081
|
+
productId
|
|
2082
|
+
}));
|
|
2083
|
+
}
|
|
2084
|
+
}, _callee23, this);
|
|
2085
|
+
}));
|
|
2086
|
+
function cancelTopProduct(_x17) {
|
|
2087
|
+
return _cancelTopProduct.apply(this, arguments);
|
|
2088
|
+
}
|
|
2089
|
+
return cancelTopProduct;
|
|
2090
|
+
})()
|
|
2091
|
+
}, {
|
|
2092
|
+
key: "setProductSoldOut",
|
|
2093
|
+
value: (function() {
|
|
2094
|
+
var _setProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee24(productId) {
|
|
2095
|
+
return _regenerator$3().w(function(_context24) {
|
|
2096
|
+
while (1) switch (_context24.n) {
|
|
2097
|
+
case 0:
|
|
2098
|
+
return _context24.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
|
|
2099
|
+
productId,
|
|
2100
|
+
markAsSoldout: "Y"
|
|
2101
|
+
}));
|
|
2102
|
+
}
|
|
2103
|
+
}, _callee24, this);
|
|
2104
|
+
}));
|
|
2105
|
+
function setProductSoldOut(_x18) {
|
|
2106
|
+
return _setProductSoldOut.apply(this, arguments);
|
|
2107
|
+
}
|
|
2108
|
+
return setProductSoldOut;
|
|
2109
|
+
})()
|
|
2110
|
+
}, {
|
|
2111
|
+
key: "cancelProductSoldOut",
|
|
2112
|
+
value: (function() {
|
|
2113
|
+
var _cancelProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee25(productId) {
|
|
2114
|
+
return _regenerator$3().w(function(_context25) {
|
|
2115
|
+
while (1) switch (_context25.n) {
|
|
2116
|
+
case 0:
|
|
2117
|
+
return _context25.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
|
|
2118
|
+
productId,
|
|
2119
|
+
markAsSoldout: "N"
|
|
2120
|
+
}));
|
|
2121
|
+
}
|
|
2122
|
+
}, _callee25, this);
|
|
2123
|
+
}));
|
|
2124
|
+
function cancelProductSoldOut(_x19) {
|
|
2125
|
+
return _cancelProductSoldOut.apply(this, arguments);
|
|
2126
|
+
}
|
|
2127
|
+
return cancelProductSoldOut;
|
|
2128
|
+
})()
|
|
2129
|
+
}, {
|
|
2130
|
+
key: "getProductEnabled",
|
|
2131
|
+
value: (function() {
|
|
2132
|
+
var _getProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee26() {
|
|
2133
|
+
var enabled;
|
|
2134
|
+
return _regenerator$3().w(function(_context26) {
|
|
2135
|
+
while (1) switch (_context26.n) {
|
|
2136
|
+
case 0:
|
|
2137
|
+
_context26.n = 1;
|
|
2138
|
+
return this.interactionCore.polyvApi.get(PolyvApiUrl.GetProductEnabled, {});
|
|
2139
|
+
case 1:
|
|
2140
|
+
enabled = _context26.v;
|
|
2141
|
+
return _context26.a(2, ynToBool(enabled, "N"));
|
|
2142
|
+
}
|
|
2143
|
+
}, _callee26, this);
|
|
2144
|
+
}));
|
|
2145
|
+
function getProductEnabled() {
|
|
2146
|
+
return _getProductEnabled.apply(this, arguments);
|
|
2147
|
+
}
|
|
2148
|
+
return getProductEnabled;
|
|
2149
|
+
})()
|
|
2150
|
+
}, {
|
|
2151
|
+
key: "updateProductEnabled",
|
|
2152
|
+
value: (function() {
|
|
2153
|
+
var _updateProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee27(enabled) {
|
|
2154
|
+
return _regenerator$3().w(function(_context27) {
|
|
2155
|
+
while (1) switch (_context27.n) {
|
|
2156
|
+
case 0:
|
|
2157
|
+
_context27.n = 1;
|
|
2158
|
+
return this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductEnabled, {
|
|
2159
|
+
enabled: boolToYN(enabled)
|
|
2160
|
+
});
|
|
2161
|
+
case 1:
|
|
2162
|
+
return _context27.a(2);
|
|
2163
|
+
}
|
|
2164
|
+
}, _callee27, this);
|
|
2165
|
+
}));
|
|
2166
|
+
function updateProductEnabled(_x20) {
|
|
2167
|
+
return _updateProductEnabled.apply(this, arguments);
|
|
2168
|
+
}
|
|
2169
|
+
return updateProductEnabled;
|
|
2170
|
+
})()
|
|
2171
|
+
}, {
|
|
2172
|
+
key: "updateProductSort",
|
|
2173
|
+
value: (function() {
|
|
2174
|
+
var _updateProductSort = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee28(params) {
|
|
2175
|
+
return _regenerator$3().w(function(_context28) {
|
|
2176
|
+
while (1) switch (_context28.n) {
|
|
2177
|
+
case 0:
|
|
2178
|
+
return _context28.a(2, this.interactionCore.polyvApi.post(concat(PolyvApiUrl.UpdateProductSort, params), {}));
|
|
2179
|
+
}
|
|
2180
|
+
}, _callee28, this);
|
|
2181
|
+
}));
|
|
2182
|
+
function updateProductSort(_x21) {
|
|
2183
|
+
return _updateProductSort.apply(this, arguments);
|
|
2184
|
+
}
|
|
2185
|
+
return updateProductSort;
|
|
2186
|
+
})()
|
|
2187
|
+
}, {
|
|
2188
|
+
key: "moveProduct",
|
|
2189
|
+
value: (function() {
|
|
2190
|
+
var _moveProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee29(productId, operation) {
|
|
2191
|
+
var type;
|
|
2192
|
+
return _regenerator$3().w(function(_context29) {
|
|
2193
|
+
while (1) switch (_context29.n) {
|
|
2194
|
+
case 0:
|
|
2195
|
+
type = operation === ProductMoveOperation.MoveUp ? 10 : 20;
|
|
2196
|
+
return _context29.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.MoveProduct, {
|
|
2197
|
+
productId,
|
|
2198
|
+
type
|
|
2199
|
+
}));
|
|
2200
|
+
}
|
|
2201
|
+
}, _callee29, this);
|
|
2202
|
+
}));
|
|
2203
|
+
function moveProduct(_x22, _x23) {
|
|
2204
|
+
return _moveProduct.apply(this, arguments);
|
|
2205
|
+
}
|
|
2206
|
+
return moveProduct;
|
|
2207
|
+
})()
|
|
1963
2208
|
}, {
|
|
1964
2209
|
key: "getSupportToDirectBuy",
|
|
1965
2210
|
value: (function() {
|
|
1966
|
-
var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function
|
|
2211
|
+
var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee30() {
|
|
1967
2212
|
var _this$config7, _this$config7$getProd;
|
|
1968
2213
|
var userInfo, productConfig, authType, notSupportAuthTypes;
|
|
1969
|
-
return _regenerator$3().w(function(
|
|
1970
|
-
while (1) switch (
|
|
2214
|
+
return _regenerator$3().w(function(_context30) {
|
|
2215
|
+
while (1) switch (_context30.n) {
|
|
1971
2216
|
case 0:
|
|
1972
|
-
|
|
2217
|
+
_context30.n = 1;
|
|
1973
2218
|
return this.getProductPayOrderEnabled();
|
|
1974
2219
|
case 1:
|
|
1975
|
-
if (
|
|
1976
|
-
|
|
2220
|
+
if (_context30.v) {
|
|
2221
|
+
_context30.n = 2;
|
|
1977
2222
|
break;
|
|
1978
2223
|
}
|
|
1979
|
-
return
|
|
2224
|
+
return _context30.a(2, false);
|
|
1980
2225
|
case 2:
|
|
1981
|
-
|
|
2226
|
+
_context30.n = 3;
|
|
1982
2227
|
return this.interactionCore.getUserInfo();
|
|
1983
2228
|
case 3:
|
|
1984
|
-
userInfo =
|
|
2229
|
+
userInfo = _context30.v;
|
|
1985
2230
|
if (userInfo.unionId) {
|
|
1986
|
-
|
|
2231
|
+
_context30.n = 4;
|
|
1987
2232
|
break;
|
|
1988
2233
|
}
|
|
1989
|
-
return
|
|
2234
|
+
return _context30.a(2, false);
|
|
1990
2235
|
case 4:
|
|
1991
|
-
|
|
2236
|
+
_context30.n = 5;
|
|
1992
2237
|
return (_this$config7 = this.config) === null || _this$config7 === void 0 || (_this$config7$getProd = _this$config7.getProductConfig) === null || _this$config7$getProd === void 0 ? void 0 : _this$config7$getProd.call(_this$config7);
|
|
1993
2238
|
case 5:
|
|
1994
|
-
productConfig =
|
|
2239
|
+
productConfig = _context30.v;
|
|
1995
2240
|
if (productConfig !== null && productConfig !== void 0 && productConfig.directBuyEnabled) {
|
|
1996
|
-
|
|
2241
|
+
_context30.n = 6;
|
|
1997
2242
|
break;
|
|
1998
2243
|
}
|
|
1999
|
-
return
|
|
2244
|
+
return _context30.a(2, false);
|
|
2000
2245
|
case 6:
|
|
2001
2246
|
authType = userInfo.authType;
|
|
2002
2247
|
if (!(!authType || authType === AuthType.None)) {
|
|
2003
|
-
|
|
2248
|
+
_context30.n = 7;
|
|
2004
2249
|
break;
|
|
2005
2250
|
}
|
|
2006
|
-
return
|
|
2251
|
+
return _context30.a(2, true);
|
|
2007
2252
|
case 7:
|
|
2008
2253
|
notSupportAuthTypes = [AuthType.Custom, AuthType.External, AuthType.Direct, AuthType.EnterpriseWeChat];
|
|
2009
2254
|
if (!notSupportAuthTypes.includes(authType)) {
|
|
2010
|
-
|
|
2255
|
+
_context30.n = 8;
|
|
2011
2256
|
break;
|
|
2012
2257
|
}
|
|
2013
|
-
return
|
|
2258
|
+
return _context30.a(2, false);
|
|
2014
2259
|
case 8:
|
|
2015
|
-
return
|
|
2260
|
+
return _context30.a(2, true);
|
|
2016
2261
|
}
|
|
2017
|
-
},
|
|
2262
|
+
}, _callee30, this);
|
|
2018
2263
|
}));
|
|
2019
2264
|
function getSupportToDirectBuy() {
|
|
2020
2265
|
return _getSupportToDirectBuy.apply(this, arguments);
|
|
@@ -3067,8 +3312,8 @@ var Payment = /* @__PURE__ */ (function() {
|
|
|
3067
3312
|
console.log(
|
|
3068
3313
|
"%c@polyv/product-sdk",
|
|
3069
3314
|
"background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff",
|
|
3070
|
-
"[version: 1.
|
|
3071
|
-
"[buildTime: 2025-09-
|
|
3315
|
+
"[version: 1.5.0-rc-20250925.1]",
|
|
3316
|
+
"[buildTime: 2025-09-25 02:55:45]"
|
|
3072
3317
|
);
|
|
3073
3318
|
export {
|
|
3074
3319
|
Address,
|
|
@@ -3090,9 +3335,11 @@ export {
|
|
|
3090
3335
|
ProductLinkJumpWay,
|
|
3091
3336
|
ProductLinkType,
|
|
3092
3337
|
ProductMediaType,
|
|
3338
|
+
ProductMoveOperation,
|
|
3093
3339
|
ProductPriceType,
|
|
3094
3340
|
ProductPushRule,
|
|
3095
3341
|
ProductServiceType,
|
|
3342
|
+
ProductSortType,
|
|
3096
3343
|
ProductStatus,
|
|
3097
3344
|
ProductType,
|
|
3098
3345
|
RefundStatus
|