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