@pisell/pisellos 2.2.80 → 2.2.82

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,4 +1,4 @@
1
- import { Plugin, PluginOptions, Module, ModuleOptions, PisellCore, PisellOSOptions, BusinessContext, ModuleContextConfig, ServerOptions, InitializeServerOptions } from '../types';
1
+ import { Plugin, PluginOptions, Module, ModuleOptions, PisellCore, PisellOSOptions, BusinessContext, ModuleContextConfig, InitializeServerOptions } from '../types';
2
2
  import { EffectsManager } from '../effects';
3
3
  /**
4
4
  * pisell OS 核心实现
@@ -11,7 +11,7 @@ declare class PisellOSCore implements PisellCore {
11
11
  private debug;
12
12
  context: BusinessContext;
13
13
  server: any;
14
- serverOptions?: ServerOptions;
14
+ private serverOptions?;
15
15
  constructor(options?: PisellOSOptions);
16
16
  private initialize;
17
17
  /**
@@ -22,9 +22,6 @@ export declare class ProductList extends BaseModule implements Module {
22
22
  schedule_datetime?: string;
23
23
  with_count?: string[];
24
24
  with_schedule?: number;
25
- }, options?: {
26
- callback?: (result: any) => void;
27
- subscriberId?: string;
28
25
  }): Promise<any>;
29
26
  loadProductsPrice({ ids, customer_id, schedule_date, channel, }: {
30
27
  ids?: number[];
@@ -84,7 +84,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
84
84
  }, {
85
85
  key: "loadProducts",
86
86
  value: function () {
87
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref, options) {
87
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
88
88
  var _this$otherParams;
89
89
  var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, _ref$menu_list_ids, menu_list_ids, paramsCustomerId, _ref$with_count, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, userPlugin, customer_id, _userPlugin$get, productsData, sortedList;
90
90
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -134,9 +134,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
134
134
  with_schedule: with_schedule,
135
135
  schedule_datetime: schedule_datetime
136
136
  }, {
137
- osServer: true,
138
- callback: options === null || options === void 0 ? void 0 : options.callback,
139
- subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId
137
+ osServer: true
140
138
  });
141
139
  case 6:
142
140
  productsData = _context3.sent;
@@ -157,7 +155,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
157
155
  }
158
156
  }, _callee3, this);
159
157
  }));
160
- function loadProducts(_x5, _x6) {
158
+ function loadProducts(_x5) {
161
159
  return _loadProducts.apply(this, arguments);
162
160
  }
163
161
  return loadProducts;
@@ -189,7 +187,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
189
187
  }
190
188
  }, _callee4, this);
191
189
  }));
192
- function loadProductsPrice(_x7) {
190
+ function loadProductsPrice(_x6) {
193
191
  return _loadProductsPrice.apply(this, arguments);
194
192
  }
195
193
  return loadProductsPrice;
@@ -237,7 +235,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
237
235
  }
238
236
  }, _callee6, this);
239
237
  }));
240
- function getProduct(_x8) {
238
+ function getProduct(_x7) {
241
239
  return _getProduct.apply(this, arguments);
242
240
  }
243
241
  return getProduct;
@@ -275,7 +273,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
275
273
  }
276
274
  }, _callee7, this);
277
275
  }));
278
- function addProduct(_x9) {
276
+ function addProduct(_x8) {
279
277
  return _addProduct.apply(this, arguments);
280
278
  }
281
279
  return addProduct;
@@ -294,7 +292,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
294
292
  }
295
293
  }, _callee8, this);
296
294
  }));
297
- function selectProducts(_x10) {
295
+ function selectProducts(_x9) {
298
296
  return _selectProducts.apply(this, arguments);
299
297
  }
300
298
  return selectProducts;
@@ -69,8 +69,6 @@ export interface RequestOptions {
69
69
  customToast?: () => void;
70
70
  cache?: CacheProps;
71
71
  osServer?: boolean;
72
- callback?: (res: any) => void;
73
- subscriberId?: string;
74
72
  }
75
73
  /**
76
74
  * 响应接口
@@ -18,7 +18,6 @@ declare class Server {
18
18
  quotation?: QuotationModule;
19
19
  schedule?: ScheduleModuleEx;
20
20
  router: Router;
21
- private productQuerySubscribers;
22
21
  private moduleRegistry;
23
22
  constructor(core: PisellCore);
24
23
  /**
@@ -86,12 +85,6 @@ declare class Server {
86
85
  * 获取所有已注册的模块列表
87
86
  */
88
87
  getRegisteredModules(): string[];
89
- /**
90
- * 后台静默刷新商品数据
91
- * 重新拉取全量 SSE 接口,更新本地数据后触发 onProductsSyncCompleted
92
- * 不影响当前界面展示,适用于切回前台、定时刷新等场景
93
- */
94
- refreshProductsInBackground(): Promise<void>;
95
88
  /**
96
89
  * 清空所有server模块的IndexedDB缓存
97
90
  * @returns Promise<void>
@@ -139,28 +132,10 @@ declare class Server {
139
132
  */
140
133
  private registerServerRoutes;
141
134
  /**
142
- * 根据 subscriberId 移除商品查询订阅者
143
- */
144
- removeProductQuerySubscriber(subscriberId?: string): void;
145
- /**
146
- * 处理商品查询请求
147
- * 存储订阅者信息,便于数据变更时推送最新结果
135
+ * 处理商品查询请求(编排 Products、Menu、Schedule 模块)
136
+ * 这是一个业务编排方法,协调多个模块完成复杂的业务需求
148
137
  */
149
138
  private handleProductQuery;
150
- /**
151
- * 取消商品查询订阅(HTTP 路由入口)
152
- */
153
- private handleUnsubscribeProductQuery;
154
- /**
155
- * 商品查询的核心计算逻辑(编排 Products、Menu、Schedule 模块)
156
- * 供 handleProductQuery 首次返回及 pubsub 变更推送复用
157
- */
158
- private computeProductQueryResult;
159
- /**
160
- * 数据变更后,遍历所有订阅者重新计算查询结果并通过 callback 推送
161
- * 由 ProductsModule 的 onProductsSyncCompleted 事件触发
162
- */
163
- private recomputeAndNotifyProductQuery;
164
139
  /**
165
140
  * 根据餐牌配置过滤商品
166
141
  * @param products 所有商品列表