@pisell/pisellos 2.2.118 → 2.2.120

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.
@@ -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";
@@ -23,7 +23,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
23
23
  */
24
24
  private logError;
25
25
  createOrder(params: CommitOrderParams['query']): {
26
- type: "appointment_booking" | "virtual";
26
+ type: "virtual" | "appointment_booking";
27
27
  platform: string;
28
28
  sales_channel: string;
29
29
  order_sales_channel: string;
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -106,8 +106,7 @@ export var ResourceModule = /*#__PURE__*/function (_BaseModule) {
106
106
  this.logger = app.logger;
107
107
  }
108
108
  this.initResourceDataSource();
109
- this.setupResourceSync();
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.loadResourcesFromSQLite();
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 = 10;
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 = 8;
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 = 12;
171
- return this.loadResourcesByServer();
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 = 18;
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 = 18;
184
+ _context2.next = 20;
183
185
  return this.safeEmit(ResourceHooks.onResourcesChanged, this.store.list);
184
- case 18:
186
+ case 20:
185
187
  case "end":
186
188
  return _context2.stop();
187
189
  }
@@ -136,7 +136,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
136
136
  * 获取当前的客户搜索条件
137
137
  * @returns 当前搜索条件
138
138
  */
139
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
139
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
140
140
  /**
141
141
  * 获取客户列表状态(包含滚动加载相关状态)
142
142
  * @returns 客户状态
@@ -124,7 +124,7 @@ export var searchProduct = /*#__PURE__*/function () {
124
124
  skip: 1,
125
125
  num: 20,
126
126
  status: 'published',
127
- with: ['variantGroup'],
127
+ with: ['variantGroup.variantItem', 'optionGroup.optionItem'],
128
128
  with_count: ['bundleGroup', 'optionGroup'],
129
129
  exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item']
130
130
  };
@@ -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);
@@ -23,7 +23,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
23
23
  */
24
24
  private logError;
25
25
  createOrder(params: CommitOrderParams['query']): {
26
- type: "appointment_booking" | "virtual";
26
+ type: "virtual" | "appointment_booking";
27
27
  platform: string;
28
28
  sales_channel: string;
29
29
  order_sales_channel: string;
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -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));
@@ -136,7 +136,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
136
136
  * 获取当前的客户搜索条件
137
137
  * @returns 当前搜索条件
138
138
  */
139
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
139
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
140
140
  /**
141
141
  * 获取客户列表状态(包含滚动加载相关状态)
142
142
  * @returns 客户状态
@@ -88,7 +88,7 @@ var searchProduct = async (request, code) => {
88
88
  skip: 1,
89
89
  num: 20,
90
90
  status: "published",
91
- with: ["variantGroup"],
91
+ with: ["variantGroup.variantItem", "optionGroup.optionItem"],
92
92
  with_count: ["bundleGroup", "optionGroup"],
93
93
  exclude_extension_type: [
94
94
  "product_party",
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.118",
4
+ "version": "2.2.120",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",