sa2kit 1.6.113 → 1.6.114

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.
Files changed (63) hide show
  1. package/dist/{index-CdtT3qtg.d.ts → index-CL4cXTf2.d.ts} +9 -92
  2. package/dist/{index-BQVl--uZ.d.mts → index-D78lqnFG.d.mts} +1 -1
  3. package/dist/{index-DGuqvsv-.d.ts → index-Dw9P_FAX.d.ts} +1 -1
  4. package/dist/{index-CcKFeVut.d.mts → index-DyTrbHIH.d.mts} +9 -92
  5. package/dist/{index-C0YVsYpz.d.ts → index-Sy5rj_Et.d.ts} +2 -2
  6. package/dist/{index-DPd4bnYA.d.mts → index-anBAKrnN.d.mts} +2 -2
  7. package/dist/index.d.mts +3 -3
  8. package/dist/index.d.ts +3 -3
  9. package/dist/index.js +53 -70
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +53 -70
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/showmasterpiece/core.js +41 -50
  14. package/dist/showmasterpiece/core.js.map +1 -1
  15. package/dist/showmasterpiece/core.mjs +41 -50
  16. package/dist/showmasterpiece/core.mjs.map +1 -1
  17. package/dist/showmasterpiece/db.js +2 -2
  18. package/dist/showmasterpiece/db.js.map +1 -1
  19. package/dist/showmasterpiece/db.mjs +2 -2
  20. package/dist/showmasterpiece/db.mjs.map +1 -1
  21. package/dist/showmasterpiece/index.js +40 -45
  22. package/dist/showmasterpiece/index.js.map +1 -1
  23. package/dist/showmasterpiece/index.mjs +40 -45
  24. package/dist/showmasterpiece/index.mjs.map +1 -1
  25. package/dist/showmasterpiece/logic/index.js +41 -50
  26. package/dist/showmasterpiece/logic/index.js.map +1 -1
  27. package/dist/showmasterpiece/logic/index.mjs +41 -50
  28. package/dist/showmasterpiece/logic/index.mjs.map +1 -1
  29. package/dist/showmasterpiece/server/index.js +2 -2
  30. package/dist/showmasterpiece/server/index.js.map +1 -1
  31. package/dist/showmasterpiece/server/index.mjs +2 -2
  32. package/dist/showmasterpiece/server/index.mjs.map +1 -1
  33. package/dist/showmasterpiece/service/client-business/index.d.mts +1 -1
  34. package/dist/showmasterpiece/service/client-business/index.d.ts +1 -1
  35. package/dist/showmasterpiece/service/client-business/index.js +45 -62
  36. package/dist/showmasterpiece/service/client-business/index.js.map +1 -1
  37. package/dist/showmasterpiece/service/client-business/index.mjs +45 -62
  38. package/dist/showmasterpiece/service/client-business/index.mjs.map +1 -1
  39. package/dist/showmasterpiece/service/index.d.mts +2 -2
  40. package/dist/showmasterpiece/service/index.d.ts +2 -2
  41. package/dist/showmasterpiece/service/index.js +45 -62
  42. package/dist/showmasterpiece/service/index.js.map +1 -1
  43. package/dist/showmasterpiece/service/index.mjs +45 -62
  44. package/dist/showmasterpiece/service/index.mjs.map +1 -1
  45. package/dist/showmasterpiece/service/web/index.d.mts +2 -2
  46. package/dist/showmasterpiece/service/web/index.d.ts +2 -2
  47. package/dist/showmasterpiece/service/web/index.js +45 -62
  48. package/dist/showmasterpiece/service/web/index.js.map +1 -1
  49. package/dist/showmasterpiece/service/web/index.mjs +45 -62
  50. package/dist/showmasterpiece/service/web/index.mjs.map +1 -1
  51. package/dist/showmasterpiece/ui/miniapp/index.js +5 -5
  52. package/dist/showmasterpiece/ui/miniapp/index.js.map +1 -1
  53. package/dist/showmasterpiece/ui/miniapp/index.mjs +5 -5
  54. package/dist/showmasterpiece/ui/miniapp/index.mjs.map +1 -1
  55. package/dist/showmasterpiece/ui/web/index.js +40 -45
  56. package/dist/showmasterpiece/ui/web/index.js.map +1 -1
  57. package/dist/showmasterpiece/ui/web/index.mjs +40 -45
  58. package/dist/showmasterpiece/ui/web/index.mjs.map +1 -1
  59. package/dist/showmasterpiece/web/index.js +40 -45
  60. package/dist/showmasterpiece/web/index.js.map +1 -1
  61. package/dist/showmasterpiece/web/index.mjs +40 -45
  62. package/dist/showmasterpiece/web/index.mjs.map +1 -1
  63. package/package.json +1 -1
@@ -1517,46 +1517,46 @@ function useCart(userId) {
1517
1517
  }
1518
1518
 
1519
1519
  // src/business/showmasterpiece/service/client-business/bookingService.ts
1520
+ function appendBookingCredentials(path, credentials) {
1521
+ if (!credentials?.qqNumber?.trim() || !credentials?.phoneNumber?.trim()) {
1522
+ return path;
1523
+ }
1524
+ const params = new URLSearchParams({
1525
+ qqNumber: credentials.qqNumber.trim(),
1526
+ phoneNumber: credentials.phoneNumber.trim()
1527
+ });
1528
+ return `${path}?${params.toString()}`;
1529
+ }
1530
+ function bookingCredentialsBody(credentials) {
1531
+ if (!credentials?.qqNumber?.trim() || !credentials?.phoneNumber?.trim()) {
1532
+ return void 0;
1533
+ }
1534
+ return JSON.stringify({
1535
+ qqNumber: credentials.qqNumber.trim(),
1536
+ phoneNumber: credentials.phoneNumber.trim()
1537
+ });
1538
+ }
1539
+ async function parseErrorMessage(response, fallback) {
1540
+ const data = await response.json().catch(() => ({}));
1541
+ if (typeof data?.error === "string" && data.error) return data.error;
1542
+ if (typeof data?.message === "string" && data.message) return data.message;
1543
+ return fallback;
1544
+ }
1520
1545
  var BookingService = class {
1521
- /**
1522
- * 创建新预订
1523
- *
1524
- * @param data 预订数据
1525
- * @returns 创建的预订信息
1526
- */
1527
1546
  static async createBooking(data) {
1528
1547
  return createBooking(data);
1529
1548
  }
1530
- /**
1531
- * 获取预订列表
1532
- *
1533
- * @param params 查询参数
1534
- * @returns 预订列表和分页信息
1535
- */
1536
1549
  static async getBookings(params = {}) {
1537
1550
  return getBookings(params);
1538
1551
  }
1539
- /**
1540
- * 获取单个预订详情
1541
- *
1542
- * @param id 预订ID
1543
- * @returns 预订详情
1544
- */
1545
- static async getBooking(id) {
1546
- const response = await fetch(`${this.BASE_URL}/${id}`);
1552
+ static async getBooking(id, credentials) {
1553
+ const url = appendBookingCredentials(`${this.BASE_URL}/${id}`, credentials);
1554
+ const response = await fetch(url);
1547
1555
  if (!response.ok) {
1548
- const error = await response.json().catch(() => ({ message: "\u83B7\u53D6\u9884\u8BA2\u8BE6\u60C5\u5931\u8D25" }));
1549
- throw new Error(error.message || "\u83B7\u53D6\u9884\u8BA2\u8BE6\u60C5\u5931\u8D25");
1556
+ throw new Error(await parseErrorMessage(response, "\u83B7\u53D6\u9884\u8BA2\u8BE6\u60C5\u5931\u8D25"));
1550
1557
  }
1551
1558
  return response.json();
1552
1559
  }
1553
- /**
1554
- * 更新预订状态
1555
- *
1556
- * @param id 预订ID
1557
- * @param data 更新数据
1558
- * @returns 更新后的预订信息
1559
- */
1560
1560
  static async updateBooking(id, data) {
1561
1561
  const response = await fetch(`${this.BASE_URL}/${id}`, {
1562
1562
  method: "PUT",
@@ -1566,41 +1566,32 @@ var BookingService = class {
1566
1566
  body: JSON.stringify(data)
1567
1567
  });
1568
1568
  if (!response.ok) {
1569
- const error = await response.json().catch(() => ({ message: "\u66F4\u65B0\u9884\u8BA2\u5931\u8D25" }));
1570
- throw new Error(error.message || "\u66F4\u65B0\u9884\u8BA2\u5931\u8D25");
1569
+ throw new Error(await parseErrorMessage(response, "\u66F4\u65B0\u9884\u8BA2\u5931\u8D25"));
1571
1570
  }
1572
1571
  return response.json();
1573
1572
  }
1574
1573
  /**
1575
- * 删除预订
1576
- *
1577
- * @param id 预订ID
1574
+ * 删除预订(须携带与下单一致的 QQ + 手机号,与 profile-v1 API 约定一致)
1578
1575
  */
1579
- static async deleteBooking(id) {
1580
- const response = await fetch(`${this.BASE_URL}/${id}`, {
1581
- method: "DELETE"
1576
+ static async deleteBooking(id, credentials) {
1577
+ const url = appendBookingCredentials(`${this.BASE_URL}/${id}`, credentials);
1578
+ const body = bookingCredentialsBody(credentials);
1579
+ const response = await fetch(url, {
1580
+ method: "DELETE",
1581
+ headers: body ? { "Content-Type": "application/json" } : void 0,
1582
+ body
1582
1583
  });
1583
1584
  if (!response.ok) {
1584
- const error = await response.json().catch(() => ({ message: "\u5220\u9664\u9884\u8BA2\u5931\u8D25" }));
1585
- throw new Error(error.message || "\u5220\u9664\u9884\u8BA2\u5931\u8D25");
1585
+ throw new Error(await parseErrorMessage(response, "\u5220\u9664\u9884\u8BA2\u5931\u8D25"));
1586
1586
  }
1587
1587
  }
1588
- /**
1589
- * 获取可预订的画集列表
1590
- *
1591
- * @returns 画集简略信息列表
1592
- */
1593
1588
  static async getBookableCollections() {
1594
1589
  return getBookableCollections();
1595
1590
  }
1596
1591
  };
1597
1592
  BookingService.BASE_URL = "/api/showmasterpiece/bookings";
1598
- var createBooking2 = (data) => {
1599
- return BookingService.createBooking(data);
1600
- };
1601
- var getBookableCollections2 = () => {
1602
- return BookingService.getBookableCollections();
1603
- };
1593
+ var createBooking2 = (data) => BookingService.createBooking(data);
1594
+ var getBookableCollections2 = () => BookingService.getBookableCollections();
1604
1595
 
1605
1596
  // src/business/showmasterpiece/logic/hooks/useBooking.ts
1606
1597
  function useBooking(_props = {}) {