@pisell/pisellos 2.2.118 → 2.2.119
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/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/server/modules/resource/index.js +15 -13
- package/dist/solution/Sales/index.js +2 -2
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/server/modules/resource/index.js +1 -1
- package/lib/solution/Sales/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,9 +0,0 @@
|
|
|
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";
|
|
@@ -106,8 +106,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
106
106
|
this.logger = app.logger;
|
|
107
107
|
}
|
|
108
108
|
this.initResourceDataSource();
|
|
109
|
-
|
|
110
|
-
case 8:
|
|
109
|
+
case 7:
|
|
111
110
|
case "end":
|
|
112
111
|
return _context.stop();
|
|
113
112
|
}
|
|
@@ -150,38 +149,41 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
150
149
|
while (1) switch (_context2.prev = _context2.next) {
|
|
151
150
|
case 0:
|
|
152
151
|
_context2.next = 2;
|
|
153
|
-
return this.
|
|
152
|
+
return this.setupResourceSync();
|
|
154
153
|
case 2:
|
|
154
|
+
_context2.next = 4;
|
|
155
|
+
return this.loadResourcesFromSQLite();
|
|
156
|
+
case 4:
|
|
155
157
|
cachedResources = _context2.sent;
|
|
156
158
|
if (!(cachedResources.length > 0)) {
|
|
157
|
-
_context2.next =
|
|
159
|
+
_context2.next = 12;
|
|
158
160
|
break;
|
|
159
161
|
}
|
|
160
162
|
this.store.list = cloneDeep(cachedResources).map(function (item) {
|
|
161
163
|
return _this3.normalizeResource(item);
|
|
162
164
|
});
|
|
163
165
|
this.syncResourcesMap();
|
|
164
|
-
_context2.next =
|
|
166
|
+
_context2.next = 10;
|
|
165
167
|
return this.safeEmit(ResourceHooks.onResourcesChanged, this.store.list);
|
|
166
|
-
case 8:
|
|
167
|
-
_context2.next = 18;
|
|
168
|
-
break;
|
|
169
168
|
case 10:
|
|
170
|
-
_context2.next =
|
|
171
|
-
|
|
169
|
+
_context2.next = 20;
|
|
170
|
+
break;
|
|
172
171
|
case 12:
|
|
172
|
+
_context2.next = 14;
|
|
173
|
+
return this.loadResourcesByServer();
|
|
174
|
+
case 14:
|
|
173
175
|
resources = _context2.sent;
|
|
174
176
|
if (!(resources.length > 0)) {
|
|
175
|
-
_context2.next =
|
|
177
|
+
_context2.next = 20;
|
|
176
178
|
break;
|
|
177
179
|
}
|
|
178
180
|
this.store.list = cloneDeep(resources).map(function (item) {
|
|
179
181
|
return _this3.normalizeResource(item);
|
|
180
182
|
});
|
|
181
183
|
this.syncResourcesMap();
|
|
182
|
-
_context2.next =
|
|
184
|
+
_context2.next = 20;
|
|
183
185
|
return this.safeEmit(ResourceHooks.onResourcesChanged, this.store.list);
|
|
184
|
-
case
|
|
186
|
+
case 20:
|
|
185
187
|
case "end":
|
|
186
188
|
return _context2.stop();
|
|
187
189
|
}
|
|
@@ -598,9 +598,9 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
598
598
|
title: 'getResourceBookingList',
|
|
599
599
|
metadata: {
|
|
600
600
|
currentTime: currentTime,
|
|
601
|
-
bookingList: bookingList,
|
|
601
|
+
bookingList: bookingList === null || bookingList === void 0 ? void 0 : bookingList.length,
|
|
602
602
|
deviceTime: deviceTime,
|
|
603
|
-
list: list
|
|
603
|
+
list: list === null || list === void 0 ? void 0 : list.length
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
606
|
return _context3.abrupt("return", list);
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
});
|
|
@@ -68,7 +68,6 @@ var ResourceModule = class extends import_BaseModule.BaseModule {
|
|
|
68
68
|
this.logger = app.logger;
|
|
69
69
|
}
|
|
70
70
|
this.initResourceDataSource();
|
|
71
|
-
this.setupResourceSync();
|
|
72
71
|
}
|
|
73
72
|
logInfo(title, metadata) {
|
|
74
73
|
if (this.logger) {
|
|
@@ -89,6 +88,7 @@ var ResourceModule = class extends import_BaseModule.BaseModule {
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
async preload() {
|
|
91
|
+
await this.setupResourceSync();
|
|
92
92
|
const cachedResources = await this.loadResourcesFromSQLite();
|
|
93
93
|
if (cachedResources.length > 0) {
|
|
94
94
|
this.store.list = (0, import_lodash_es.cloneDeep)(cachedResources).map((item) => this.normalizeResource(item));
|
|
@@ -444,9 +444,9 @@ var SalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
444
444
|
title: "getResourceBookingList",
|
|
445
445
|
metadata: {
|
|
446
446
|
currentTime,
|
|
447
|
-
bookingList,
|
|
447
|
+
bookingList: bookingList == null ? void 0 : bookingList.length,
|
|
448
448
|
deviceTime,
|
|
449
|
-
list
|
|
449
|
+
list: list == null ? void 0 : list.length
|
|
450
450
|
}
|
|
451
451
|
});
|
|
452
452
|
return list;
|