@pisell/pisellos 2.2.206 → 2.2.207
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// 导出评估器
|
|
2
|
+
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
+
|
|
4
|
+
// 导出适配器
|
|
5
|
+
export { PromotionAdapter } from "./adapter";
|
|
6
|
+
export { default } from "./adapter";
|
|
7
|
+
|
|
8
|
+
// 导出策略配置示例常量
|
|
9
|
+
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY } from "./examples";
|
package/dist/server/index.js
CHANGED
|
@@ -3479,12 +3479,12 @@ var Server = /*#__PURE__*/function () {
|
|
|
3479
3479
|
}, {
|
|
3480
3480
|
key: "getAppData",
|
|
3481
3481
|
value: function getAppData(key) {
|
|
3482
|
-
var _this$
|
|
3483
|
-
var getData = (_this$
|
|
3482
|
+
var _this$core$getPlugin, _this$core$getPlugin$, _this$app9, _this$app9$getData, _this$app10, _this$app10$getStore, _this$app10$getStore$, _this$app10$getStore$2, _this$app11, _this$app11$getStore, _this$app11$getStore$, _this$app11$getStore$2, _this$app12, _this$app12$getStore, _this$app12$getStore$, _this$app12$getStore$2;
|
|
3483
|
+
var getData = (_this$core$getPlugin = this.core.getPlugin('app')) === null || _this$core$getPlugin === void 0 || (_this$core$getPlugin$ = _this$core$getPlugin.getData) === null || _this$core$getPlugin$ === void 0 ? void 0 : _this$core$getPlugin$.call(_this$core$getPlugin);
|
|
3484
3484
|
if (typeof getData === 'function') return getData(key);
|
|
3485
|
-
var directValue = (_this$
|
|
3485
|
+
var directValue = (_this$app9 = this.app) === null || _this$app9 === void 0 || (_this$app9$getData = _this$app9.getData) === null || _this$app9$getData === void 0 ? void 0 : _this$app9$getData.call(_this$app9, key);
|
|
3486
3486
|
if (directValue !== undefined) return directValue;
|
|
3487
|
-
var coreData = ((_this$
|
|
3487
|
+
var coreData = ((_this$app10 = this.app) === null || _this$app10 === void 0 || (_this$app10 = _this$app10.models) === null || _this$app10 === void 0 || (_this$app10$getStore = _this$app10.getStore) === null || _this$app10$getStore === void 0 || (_this$app10$getStore$ = (_this$app10$getStore$2 = _this$app10$getStore.call(_this$app10)).getDataByModel) === null || _this$app10$getStore$ === void 0 ? void 0 : _this$app10$getStore$.call(_this$app10$getStore$2, 'core', 'core')) || ((_this$app11 = this.app) === null || _this$app11 === void 0 || (_this$app11 = _this$app11.data) === null || _this$app11 === void 0 || (_this$app11 = _this$app11.store) === null || _this$app11 === void 0 || (_this$app11$getStore = _this$app11.getStore) === null || _this$app11$getStore === void 0 || (_this$app11$getStore$ = (_this$app11$getStore$2 = _this$app11$getStore.call(_this$app11)).getDataByModel) === null || _this$app11$getStore$ === void 0 ? void 0 : _this$app11$getStore$.call(_this$app11$getStore$2, 'core', 'core')) || ((_this$app12 = this.app) === null || _this$app12 === void 0 || (_this$app12 = _this$app12.data) === null || _this$app12 === void 0 || (_this$app12 = _this$app12.store) === null || _this$app12 === void 0 || (_this$app12$getStore = _this$app12.getStore) === null || _this$app12$getStore === void 0 || (_this$app12$getStore$ = (_this$app12$getStore$2 = _this$app12$getStore.call(_this$app12)).getDataByModel) === null || _this$app12$getStore$ === void 0 || (_this$app12$getStore$ = _this$app12$getStore$.call(_this$app12$getStore$2, 'core')) === null || _this$app12$getStore$ === void 0 ? void 0 : _this$app12$getStore$.core);
|
|
3488
3488
|
return coreData === null || coreData === void 0 ? void 0 : coreData[key];
|
|
3489
3489
|
}
|
|
3490
3490
|
}, {
|
|
@@ -3492,6 +3492,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
3492
3492
|
value: function getSmallTicketShopInfo() {
|
|
3493
3493
|
var _shopInfo$is_price_in;
|
|
3494
3494
|
var shopInfo = this.getAppData('shop_info') || {};
|
|
3495
|
+
debugger;
|
|
3495
3496
|
return _objectSpread(_objectSpread({}, shopInfo), {}, {
|
|
3496
3497
|
currency_symbol: shopInfo.currency_symbol || this.getAppData('shop_symbol') || this.getAppData('currency_symbol'),
|
|
3497
3498
|
currency_code: shopInfo.currency_code || this.getAppData('shop_currency_code') || this.getAppData('currency_code'),
|
|
@@ -4251,7 +4252,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
4251
4252
|
key: "handleUpdateLocalOrdersBatch",
|
|
4252
4253
|
value: (function () {
|
|
4253
4254
|
var _handleUpdateLocalOrdersBatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(orderIds) {
|
|
4254
|
-
var _this$
|
|
4255
|
+
var _this$app13;
|
|
4255
4256
|
var existedBefore, _iterator12, _step12, id, fetched, message, fetchedMap, _iterator13, _step13, order, oid, freshOrders, succeedIds, failed, _iterator14, _step14, _id, fresh, _message2, overwritten, inserted;
|
|
4256
4257
|
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
4257
4258
|
while (1) switch (_context47.prev = _context47.next) {
|
|
@@ -4272,7 +4273,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
4272
4273
|
data: null
|
|
4273
4274
|
});
|
|
4274
4275
|
case 4:
|
|
4275
|
-
if ((_this$
|
|
4276
|
+
if ((_this$app13 = this.app) !== null && _this$app13 !== void 0 && _this$app13.request) {
|
|
4276
4277
|
_context47.next = 7;
|
|
4277
4278
|
break;
|
|
4278
4279
|
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
-
var promotion_exports = {};
|
|
31
|
-
__export(promotion_exports, {
|
|
32
|
-
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
-
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
34
|
-
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
35
|
-
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
36
|
-
default: () => import_adapter2.default
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(promotion_exports);
|
|
39
|
-
var import_evaluator = require("./evaluator");
|
|
40
|
-
var import_adapter = require("./adapter");
|
|
41
|
-
var import_adapter2 = __toESM(require("./adapter"));
|
|
42
|
-
var import_examples = require("./examples");
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
BUY_X_GET_Y_FREE_STRATEGY,
|
|
46
|
-
PromotionAdapter,
|
|
47
|
-
PromotionEvaluator,
|
|
48
|
-
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
49
|
-
});
|
package/lib/server/index.js
CHANGED
|
@@ -2170,7 +2170,7 @@ var Server = class {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
getAppData(key) {
|
|
2172
2172
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2173
|
-
const getData = (_b = (_a = this.app) == null ? void 0 : _a.getData) == null ? void 0 : _b.call(_a);
|
|
2173
|
+
const getData = (_b = (_a = this.core.getPlugin("app")) == null ? void 0 : _a.getData) == null ? void 0 : _b.call(_a);
|
|
2174
2174
|
if (typeof getData === "function")
|
|
2175
2175
|
return getData(key);
|
|
2176
2176
|
const directValue = (_d = (_c = this.app) == null ? void 0 : _c.getData) == null ? void 0 : _d.call(_c, key);
|
|
@@ -2181,6 +2181,7 @@ var Server = class {
|
|
|
2181
2181
|
}
|
|
2182
2182
|
getSmallTicketShopInfo() {
|
|
2183
2183
|
const shopInfo = this.getAppData("shop_info") || {};
|
|
2184
|
+
debugger;
|
|
2184
2185
|
return {
|
|
2185
2186
|
...shopInfo,
|
|
2186
2187
|
currency_symbol: shopInfo.currency_symbol || this.getAppData("shop_symbol") || this.getAppData("currency_symbol"),
|