@pisell/pisellos 2.2.123 → 2.2.124

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.
@@ -206,7 +206,9 @@ declare class Server {
206
206
  */
207
207
  private shouldUseLocalBookingQuery;
208
208
  /**
209
- * 日历 SSE 精简 with:只拉日历渲染必需的关联字段
209
+ * 日历 SSE 精简 with:由调用方显式声明 compact_fields 决定
210
+ * - compact_fields === true → 精简字段(周/月视图)
211
+ * - 其余(false / 未传)→ ['all'](日视图/表格/平面图合并)
210
212
  */
211
213
  private resolveBookingSalesWith;
212
214
  /**
@@ -214,6 +216,11 @@ declare class Server {
214
216
  * business_code / payment_status 不直接用于渲染,但 matchOrder 过滤依赖
215
217
  */
216
218
  private resolveBookingSalesSelect;
219
+ /**
220
+ * 日历(compact_fields)场景下要直接在 SSE 层排除的订单类型:
221
+ * 这些类型不会出现在日历上,拉取它们只会浪费带宽并增加前端过滤成本。
222
+ */
223
+ private readonly BOOKING_SALES_COMPACT_EXCLUDE_TYPES;
217
224
  private normalizeBookingRemoteQueryPayload;
218
225
  /**
219
226
  * 远端预约查询内存缓存开关:默认 false,仅显式 true 才启用。
@@ -325,6 +325,11 @@ var Server = /*#__PURE__*/function () {
325
325
  return _ref11.apply(this, arguments);
326
326
  };
327
327
  }());
328
+ /**
329
+ * 日历(compact_fields)场景下要直接在 SSE 层排除的订单类型:
330
+ * 这些类型不会出现在日历上,拉取它们只会浪费带宽并增加前端过滤成本。
331
+ */
332
+ _defineProperty(this, "BOOKING_SALES_COMPACT_EXCLUDE_TYPES", ['virtual', 'shipping', 'delivery', 'pickup']);
328
333
  /**
329
334
  * 处理预约列表查询
330
335
  * 今天:注册订阅者 + 本地数据筛选;非今天:清理订阅者 + 走真实 API
@@ -1647,12 +1652,19 @@ var Server = /*#__PURE__*/function () {
1647
1652
  }
1648
1653
 
1649
1654
  /**
1650
- * 日历 SSE 精简 with:只拉日历渲染必需的关联字段
1655
+ * 日历 SSE 精简 with:由调用方显式声明 compact_fields 决定
1656
+ * - compact_fields === true → 精简字段(周/月视图)
1657
+ * - 其余(false / 未传)→ ['all'](日视图/表格/平面图合并)
1651
1658
  */
1652
1659
  }, {
1653
1660
  key: "resolveBookingSalesWith",
1654
- value: function resolveBookingSalesWith(_queryPayload) {
1655
- return ['bookings:booking_id,start_date,start_time,end_date,end_time,holder,metadata,parent_id,item_type', 'customer:id,display_name,phone', 'products'];
1661
+ value: function resolveBookingSalesWith(queryPayload) {
1662
+ if ((queryPayload === null || queryPayload === void 0 ? void 0 : queryPayload.compact_fields) === true) {
1663
+ return ['bookings:booking_id,start_date,start_time,end_date,end_time,holder,metadata,parent_id,item_type', 'customer:id,display_name,phone', 'products'
1664
+ // 'resources'
1665
+ ];
1666
+ }
1667
+ return ['all'];
1656
1668
  }
1657
1669
 
1658
1670
  /**
@@ -1667,11 +1679,18 @@ var Server = /*#__PURE__*/function () {
1667
1679
  }, {
1668
1680
  key: "normalizeBookingRemoteQueryPayload",
1669
1681
  value: function normalizeBookingRemoteQueryPayload(data, withFields) {
1670
- return _objectSpread(_objectSpread({}, data), {}, {
1682
+ var isFullWith = withFields.length === 1 && withFields[0] === 'all';
1683
+ var isCompact = (data === null || data === void 0 ? void 0 : data.compact_fields) === true;
1684
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, data), {}, {
1671
1685
  form_record_ids: undefined,
1672
1686
  enable_remote_memory_cache: undefined,
1673
- with: withFields,
1674
- select: this.resolveBookingSalesSelect(),
1687
+ compact_fields: undefined,
1688
+ with: withFields
1689
+ }, isFullWith ? {} : {
1690
+ select: this.resolveBookingSalesSelect()
1691
+ }), isCompact ? {
1692
+ exclude_types: this.BOOKING_SALES_COMPACT_EXCLUDE_TYPES
1693
+ } : {}), {}, {
1675
1694
  chunk_size: 50
1676
1695
  });
1677
1696
  }
@@ -206,7 +206,9 @@ declare class Server {
206
206
  */
207
207
  private shouldUseLocalBookingQuery;
208
208
  /**
209
- * 日历 SSE 精简 with:只拉日历渲染必需的关联字段
209
+ * 日历 SSE 精简 with:由调用方显式声明 compact_fields 决定
210
+ * - compact_fields === true → 精简字段(周/月视图)
211
+ * - 其余(false / 未传)→ ['all'](日视图/表格/平面图合并)
210
212
  */
211
213
  private resolveBookingSalesWith;
212
214
  /**
@@ -214,6 +216,11 @@ declare class Server {
214
216
  * business_code / payment_status 不直接用于渲染,但 matchOrder 过滤依赖
215
217
  */
216
218
  private resolveBookingSalesSelect;
219
+ /**
220
+ * 日历(compact_fields)场景下要直接在 SSE 层排除的订单类型:
221
+ * 这些类型不会出现在日历上,拉取它们只会浪费带宽并增加前端过滤成本。
222
+ */
223
+ private readonly BOOKING_SALES_COMPACT_EXCLUDE_TYPES;
217
224
  private normalizeBookingRemoteQueryPayload;
218
225
  /**
219
226
  * 远端预约查询内存缓存开关:默认 false,仅显式 true 才启用。
@@ -225,6 +225,16 @@ var Server = class {
225
225
  }
226
226
  return { code: 200, message: "ok", status: true };
227
227
  };
228
+ /**
229
+ * 日历(compact_fields)场景下要直接在 SSE 层排除的订单类型:
230
+ * 这些类型不会出现在日历上,拉取它们只会浪费带宽并增加前端过滤成本。
231
+ */
232
+ this.BOOKING_SALES_COMPACT_EXCLUDE_TYPES = [
233
+ "virtual",
234
+ "shipping",
235
+ "delivery",
236
+ "pickup"
237
+ ];
228
238
  /**
229
239
  * 处理预约列表查询
230
240
  * 今天:注册订阅者 + 本地数据筛选;非今天:清理订阅者 + 走真实 API
@@ -1022,14 +1032,20 @@ var Server = class {
1022
1032
  return !this.isRangeBothNotToday(range[0], range[1]);
1023
1033
  }
1024
1034
  /**
1025
- * 日历 SSE 精简 with:只拉日历渲染必需的关联字段
1035
+ * 日历 SSE 精简 with:由调用方显式声明 compact_fields 决定
1036
+ * - compact_fields === true → 精简字段(周/月视图)
1037
+ * - 其余(false / 未传)→ ['all'](日视图/表格/平面图合并)
1026
1038
  */
1027
- resolveBookingSalesWith(_queryPayload) {
1028
- return [
1029
- "bookings:booking_id,start_date,start_time,end_date,end_time,holder,metadata,parent_id,item_type",
1030
- "customer:id,display_name,phone",
1031
- "products"
1032
- ];
1039
+ resolveBookingSalesWith(queryPayload) {
1040
+ if ((queryPayload == null ? void 0 : queryPayload.compact_fields) === true) {
1041
+ return [
1042
+ "bookings:booking_id,start_date,start_time,end_date,end_time,holder,metadata,parent_id,item_type",
1043
+ "customer:id,display_name,phone",
1044
+ "products"
1045
+ // 'resources'
1046
+ ];
1047
+ }
1048
+ return ["all"];
1033
1049
  }
1034
1050
  /**
1035
1051
  * 日历 SSE 精简 select:渲染 + filterBookingsFromOrders 所需的主表字段
@@ -1039,12 +1055,16 @@ var Server = class {
1039
1055
  return "status,payment_status,business_code,phone,customer_name,schedule_date,created_at,metadata";
1040
1056
  }
1041
1057
  normalizeBookingRemoteQueryPayload(data, withFields) {
1058
+ const isFullWith = withFields.length === 1 && withFields[0] === "all";
1059
+ const isCompact = (data == null ? void 0 : data.compact_fields) === true;
1042
1060
  return {
1043
1061
  ...data,
1044
1062
  form_record_ids: void 0,
1045
1063
  enable_remote_memory_cache: void 0,
1064
+ compact_fields: void 0,
1046
1065
  with: withFields,
1047
- select: this.resolveBookingSalesSelect(),
1066
+ ...isFullWith ? {} : { select: this.resolveBookingSalesSelect() },
1067
+ ...isCompact ? { exclude_types: this.BOOKING_SALES_COMPACT_EXCLUDE_TYPES } : {},
1048
1068
  chunk_size: 50
1049
1069
  };
1050
1070
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.123",
4
+ "version": "2.2.124",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",