@pisell/pisellos 2.2.289 → 2.2.290

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, ITEM_REWARD_STRATEGY } from "./examples";
@@ -512,7 +512,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
512
512
  generateIdempotencyToken(): string;
513
513
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
514
514
  createOrder(params: CommitOrderParams['query']): {
515
- type: "appointment_booking" | "virtual";
515
+ type: "virtual" | "appointment_booking";
516
516
  platform: string;
517
517
  sales_channel: string;
518
518
  order_sales_channel: string;
@@ -5358,29 +5358,33 @@ var Server = /*#__PURE__*/function () {
5358
5358
  if (!Array.isArray(bookings)) return '';
5359
5359
  var values = [];
5360
5360
  var seen = new Set();
5361
- var visitResource = function visitResource(resource) {
5362
- var identifier = _this13.getCheckoutResourceIdentifier(resource);
5361
+ var visitResource = function visitResource(resource, fallbackName) {
5362
+ var identifier = _this13.getCheckoutResourceIdentifier(resource, fallbackName);
5363
5363
  if (identifier && !seen.has(identifier)) {
5364
5364
  seen.add(identifier);
5365
5365
  values.push(identifier);
5366
5366
  }
5367
5367
  if (Array.isArray(resource === null || resource === void 0 ? void 0 : resource.children)) {
5368
- resource.children.forEach(visitResource);
5368
+ resource.children.forEach(function (child) {
5369
+ return visitResource(child);
5370
+ });
5369
5371
  }
5370
5372
  };
5371
5373
  bookings.forEach(function (booking) {
5372
5374
  if (Array.isArray(booking === null || booking === void 0 ? void 0 : booking.resources)) {
5373
- booking.resources.forEach(visitResource);
5375
+ booking.resources.forEach(function (resource, index) {
5376
+ visitResource(resource, index === 0 ? booking === null || booking === void 0 ? void 0 : booking.relation_form_name : undefined);
5377
+ });
5374
5378
  }
5375
5379
  });
5376
5380
  return values.join(',');
5377
5381
  }
5378
5382
  }, {
5379
5383
  key: "getCheckoutResourceIdentifier",
5380
- value: function getCheckoutResourceIdentifier(resource) {
5384
+ value: function getCheckoutResourceIdentifier(resource, fallbackName) {
5381
5385
  var _resource$metadata, _resource$metadata2;
5382
5386
  if (!resource || _typeof(resource) !== 'object') return '';
5383
- var candidates = [resource.main_field, resource.name, resource.title, (_resource$metadata = resource.metadata) === null || _resource$metadata === void 0 ? void 0 : _resource$metadata.resource_name, (_resource$metadata2 = resource.metadata) === null || _resource$metadata2 === void 0 ? void 0 : _resource$metadata2.name, resource.relation_id, resource.id];
5387
+ var candidates = [resource.main_field, resource.name, resource.title, (_resource$metadata = resource.metadata) === null || _resource$metadata === void 0 ? void 0 : _resource$metadata.resource_name, (_resource$metadata2 = resource.metadata) === null || _resource$metadata2 === void 0 ? void 0 : _resource$metadata2.name, fallbackName, resource.relation_id, resource.id];
5384
5388
  for (var _i2 = 0, _candidates = candidates; _i2 < _candidates.length; _i2++) {
5385
5389
  var candidate = _candidates[_i2];
5386
5390
  var value = this.stringifyCheckoutResourceIdentifier(candidate);
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
329
+ weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -334,7 +334,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
334
334
  * 获取当前的客户搜索条件
335
335
  * @returns 当前搜索条件
336
336
  */
337
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
337
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
338
338
  /**
339
339
  * 获取客户列表状态(包含滚动加载相关状态)
340
340
  * @returns 客户状态
@@ -512,7 +512,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
512
512
  generateIdempotencyToken(): string;
513
513
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
514
514
  createOrder(params: CommitOrderParams['query']): {
515
- type: "appointment_booking" | "virtual";
515
+ type: "virtual" | "appointment_booking";
516
516
  platform: string;
517
517
  sales_channel: string;
518
518
  order_sales_channel: string;
@@ -3383,26 +3383,28 @@ class Server {
3383
3383
  if (!Array.isArray(bookings)) return '';
3384
3384
  const values = [];
3385
3385
  const seen = new Set();
3386
- const visitResource = resource => {
3387
- const identifier = this.getCheckoutResourceIdentifier(resource);
3386
+ const visitResource = (resource, fallbackName) => {
3387
+ const identifier = this.getCheckoutResourceIdentifier(resource, fallbackName);
3388
3388
  if (identifier && !seen.has(identifier)) {
3389
3389
  seen.add(identifier);
3390
3390
  values.push(identifier);
3391
3391
  }
3392
3392
  if (Array.isArray(resource?.children)) {
3393
- resource.children.forEach(visitResource);
3393
+ resource.children.forEach(child => visitResource(child));
3394
3394
  }
3395
3395
  };
3396
3396
  bookings.forEach(booking => {
3397
3397
  if (Array.isArray(booking?.resources)) {
3398
- booking.resources.forEach(visitResource);
3398
+ booking.resources.forEach((resource, index) => {
3399
+ visitResource(resource, index === 0 ? booking?.relation_form_name : undefined);
3400
+ });
3399
3401
  }
3400
3402
  });
3401
3403
  return values.join(',');
3402
3404
  }
3403
- getCheckoutResourceIdentifier(resource) {
3405
+ getCheckoutResourceIdentifier(resource, fallbackName) {
3404
3406
  if (!resource || typeof resource !== 'object') return '';
3405
- const candidates = [resource.main_field, resource.name, resource.title, resource.metadata?.resource_name, resource.metadata?.name, resource.relation_id, resource.id];
3407
+ const candidates = [resource.main_field, resource.name, resource.title, resource.metadata?.resource_name, resource.metadata?.name, fallbackName, resource.relation_id, resource.id];
3406
3408
  for (const candidate of candidates) {
3407
3409
  const value = this.stringifyCheckoutResourceIdentifier(candidate);
3408
3410
  if (value) return value;
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
329
+ weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -334,7 +334,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
334
334
  * 获取当前的客户搜索条件
335
335
  * @returns 当前搜索条件
336
336
  */
337
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
337
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
338
338
  /**
339
339
  * 获取客户列表状态(包含滚动加载相关状态)
340
340
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.289",
4
+ "version": "2.2.290",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",