@anker-in/ui 0.1.2 → 0.1.4

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.
@@ -1657,11 +1657,39 @@ var DemoRoomApiClient = class {
1657
1657
  });
1658
1658
  }
1659
1659
  /**
1660
- * 根据 token 获取预约信息
1661
- * @param token 预约 token
1660
+ * 根据 token 获取预约详情(支持多语言)
1661
+ * @param token 预约凭证 (cancel_token)
1662
+ * @param locale 语言偏好(可选,也可以通过 Accept-Language Header)
1662
1663
  */
1663
- async getBooking(token) {
1664
- return this.request(`/api/v1/store/bookings/${token}`);
1664
+ async getBooking(token, locale) {
1665
+ const headers = {};
1666
+ if (locale) {
1667
+ headers["Accept-Language"] = locale;
1668
+ }
1669
+ const response = await this.request(
1670
+ `/api/v1/store/bookings/${token}`,
1671
+ { headers }
1672
+ );
1673
+ return response.booking;
1674
+ }
1675
+ /**
1676
+ * 取消预约(支持多语言邮件通知)
1677
+ * @param token 预约凭证 (cancel_token)
1678
+ * @param locale 语言偏好(可选,用于邮件通知)
1679
+ */
1680
+ async cancelBooking(token, locale) {
1681
+ const headers = {};
1682
+ if (locale) {
1683
+ headers["Accept-Language"] = locale;
1684
+ }
1685
+ const response = await this.request(
1686
+ `/api/v1/store/bookings/${token}/cancel`,
1687
+ {
1688
+ method: "POST",
1689
+ headers
1690
+ }
1691
+ );
1692
+ return response.booking;
1665
1693
  }
1666
1694
  };
1667
1695
  function createDemoRoomApi(config) {