@51eat/sdk 0.0.70 → 0.0.72

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 (134) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/resources/stands/client/requests/UpdateStandRequest.d.ts +7 -0
  3. package/dist/cjs/api/resources/customer/client/Client.d.ts +0 -1
  4. package/dist/cjs/api/resources/customer/client/Client.js +1 -5
  5. package/dist/cjs/api/resources/customer/resources/ads/client/Client.d.ts +2 -4
  6. package/dist/cjs/api/resources/customer/resources/ads/client/Client.js +3 -11
  7. package/dist/cjs/api/resources/customer/resources/businesses/client/Client.d.ts +27 -34
  8. package/dist/cjs/api/resources/customer/resources/businesses/client/Client.js +83 -111
  9. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/client/Client.d.ts +0 -1
  10. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/client/Client.js +1 -5
  11. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.ts +0 -2
  12. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +2 -10
  13. package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/Client.d.ts +0 -3
  14. package/dist/cjs/api/resources/customer/resources/businesses/resources/events/client/Client.js +7 -19
  15. package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +4 -0
  16. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +2 -14
  17. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +33 -81
  18. package/dist/cjs/api/resources/customer/resources/editorials/client/Client.d.ts +3 -7
  19. package/dist/cjs/api/resources/customer/resources/editorials/client/Client.js +13 -30
  20. package/dist/cjs/api/resources/customer/resources/events/client/Client.d.ts +0 -1
  21. package/dist/cjs/api/resources/customer/resources/events/client/Client.js +1 -5
  22. package/dist/cjs/api/resources/customer/resources/explore/client/Client.d.ts +2 -3
  23. package/dist/cjs/api/resources/customer/resources/explore/client/Client.js +2 -6
  24. package/dist/cjs/api/resources/customer/resources/shop/client/Client.d.ts +2 -5
  25. package/dist/cjs/api/resources/customer/resources/shop/client/Client.js +4 -16
  26. package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +19 -9
  27. package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +64 -30
  28. package/dist/cjs/api/resources/customer/resources/stands/client/requests/CheckoutStandsRequest.d.ts +7 -1
  29. package/dist/cjs/api/resources/customer/resources/stands/client/requests/CreatePaymentIntentStandsRequest.d.ts +1 -0
  30. package/dist/cjs/api/resources/customer/resources/stands/types/CheckoutStandsResponse.d.ts +4 -0
  31. package/dist/cjs/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.ts +16 -0
  32. package/dist/cjs/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.js +10 -0
  33. package/dist/cjs/api/resources/customer/resources/stands/types/index.d.ts +2 -0
  34. package/dist/cjs/api/resources/customer/resources/stands/types/index.js +2 -0
  35. package/dist/cjs/api/resources/customerStands/client/Client.d.ts +0 -32
  36. package/dist/cjs/api/resources/customerStands/client/Client.js +0 -119
  37. package/dist/cjs/api/resources/customerStands/client/requests/index.d.ts +0 -2
  38. package/dist/cjs/api/resources/customerStands/types/index.d.ts +0 -2
  39. package/dist/cjs/api/resources/customerStands/types/index.js +0 -2
  40. package/dist/cjs/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.ts +1 -1
  41. package/dist/cjs/api/types/CartResource.d.ts +1 -1
  42. package/dist/cjs/api/types/InventoryLevelResource.d.ts +3 -3
  43. package/dist/cjs/api/types/OrderItemResource.d.ts +10 -0
  44. package/dist/cjs/api/types/OrderResource.d.ts +24 -9
  45. package/dist/cjs/api/types/PaginationResource.d.ts +4 -4
  46. package/dist/cjs/api/types/PriceListResource.d.ts +1 -1
  47. package/dist/cjs/api/types/PriceResource.d.ts +3 -3
  48. package/dist/cjs/api/types/ProductResource.d.ts +5 -6
  49. package/dist/cjs/api/types/Transaction.d.ts +6 -6
  50. package/dist/cjs/api/types/VariantResource.d.ts +3 -3
  51. package/dist/cjs/api/types/index.d.ts +1 -2
  52. package/dist/cjs/api/types/index.js +1 -2
  53. package/dist/cjs/version.d.ts +1 -1
  54. package/dist/cjs/version.js +1 -1
  55. package/dist/esm/BaseClient.mjs +2 -2
  56. package/dist/esm/api/resources/business/resources/stands/client/requests/UpdateStandRequest.d.mts +7 -0
  57. package/dist/esm/api/resources/customer/client/Client.d.mts +0 -1
  58. package/dist/esm/api/resources/customer/client/Client.mjs +1 -5
  59. package/dist/esm/api/resources/customer/resources/ads/client/Client.d.mts +2 -4
  60. package/dist/esm/api/resources/customer/resources/ads/client/Client.mjs +4 -12
  61. package/dist/esm/api/resources/customer/resources/businesses/client/Client.d.mts +27 -34
  62. package/dist/esm/api/resources/customer/resources/businesses/client/Client.mjs +83 -111
  63. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.d.mts +0 -1
  64. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/client/Client.mjs +1 -5
  65. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.mts +0 -2
  66. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +2 -10
  67. package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/Client.d.mts +0 -3
  68. package/dist/esm/api/resources/customer/resources/businesses/resources/events/client/Client.mjs +7 -19
  69. package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +4 -0
  70. package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +2 -14
  71. package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +34 -82
  72. package/dist/esm/api/resources/customer/resources/editorials/client/Client.d.mts +3 -7
  73. package/dist/esm/api/resources/customer/resources/editorials/client/Client.mjs +14 -31
  74. package/dist/esm/api/resources/customer/resources/events/client/Client.d.mts +0 -1
  75. package/dist/esm/api/resources/customer/resources/events/client/Client.mjs +1 -5
  76. package/dist/esm/api/resources/customer/resources/explore/client/Client.d.mts +2 -3
  77. package/dist/esm/api/resources/customer/resources/explore/client/Client.mjs +3 -7
  78. package/dist/esm/api/resources/customer/resources/shop/client/Client.d.mts +2 -5
  79. package/dist/esm/api/resources/customer/resources/shop/client/Client.mjs +5 -17
  80. package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +19 -9
  81. package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +64 -30
  82. package/dist/esm/api/resources/customer/resources/stands/client/requests/CheckoutStandsRequest.d.mts +7 -1
  83. package/dist/esm/api/resources/customer/resources/stands/client/requests/CreatePaymentIntentStandsRequest.d.mts +1 -0
  84. package/dist/esm/api/resources/customer/resources/stands/types/CheckoutStandsResponse.d.mts +4 -0
  85. package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.d.mts +16 -0
  86. package/dist/esm/api/resources/customer/resources/stands/types/CreatePaymentIntentStandsResponse.mjs +7 -0
  87. package/dist/esm/api/resources/customer/resources/stands/types/index.d.mts +2 -0
  88. package/dist/esm/api/resources/customer/resources/stands/types/index.mjs +2 -0
  89. package/dist/esm/api/resources/customerStands/client/Client.d.mts +0 -32
  90. package/dist/esm/api/resources/customerStands/client/Client.mjs +0 -119
  91. package/dist/esm/api/resources/customerStands/client/requests/index.d.mts +0 -2
  92. package/dist/esm/api/resources/customerStands/types/index.d.mts +0 -2
  93. package/dist/esm/api/resources/customerStands/types/index.mjs +0 -2
  94. package/dist/esm/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.mts +1 -1
  95. package/dist/esm/api/types/CartResource.d.mts +1 -1
  96. package/dist/esm/api/types/InventoryLevelResource.d.mts +3 -3
  97. package/dist/esm/api/types/OrderItemResource.d.mts +10 -0
  98. package/dist/esm/api/types/OrderResource.d.mts +24 -9
  99. package/dist/esm/api/types/PaginationResource.d.mts +4 -4
  100. package/dist/esm/api/types/PriceListResource.d.mts +1 -1
  101. package/dist/esm/api/types/PriceResource.d.mts +3 -3
  102. package/dist/esm/api/types/ProductResource.d.mts +5 -6
  103. package/dist/esm/api/types/Transaction.d.mts +6 -6
  104. package/dist/esm/api/types/VariantResource.d.mts +3 -3
  105. package/dist/esm/api/types/index.d.mts +1 -2
  106. package/dist/esm/api/types/index.mjs +1 -2
  107. package/dist/esm/version.d.mts +1 -1
  108. package/dist/esm/version.mjs +1 -1
  109. package/package.json +1 -1
  110. package/reference.md +29 -131
  111. package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandCheckoutRequest.d.ts +0 -15
  112. package/dist/cjs/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.d.ts +0 -10
  113. package/dist/cjs/api/resources/customerStands/types/CustomerStandCheckoutResponse.d.ts +0 -4
  114. package/dist/cjs/api/resources/customerStands/types/CustomerStandCheckoutResponse.js +0 -3
  115. package/dist/cjs/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.d.ts +0 -12
  116. package/dist/cjs/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.js +0 -10
  117. package/dist/cjs/api/types/ImageResource.d.ts +0 -6
  118. package/dist/cjs/api/types/ImageResource.js +0 -3
  119. package/dist/cjs/api/types/ProductCategoryResource.d.ts +0 -8
  120. package/dist/cjs/api/types/ProductCategoryResource.js +0 -3
  121. package/dist/esm/api/resources/customerStands/client/requests/CustomerStandCheckoutRequest.d.mts +0 -15
  122. package/dist/esm/api/resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.d.mts +0 -10
  123. package/dist/esm/api/resources/customerStands/types/CustomerStandCheckoutResponse.d.mts +0 -4
  124. package/dist/esm/api/resources/customerStands/types/CustomerStandCheckoutResponse.mjs +0 -2
  125. package/dist/esm/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.d.mts +0 -12
  126. package/dist/esm/api/resources/customerStands/types/CustomerStandPaymentIntentResponse.mjs +0 -7
  127. package/dist/esm/api/types/ImageResource.d.mts +0 -6
  128. package/dist/esm/api/types/ImageResource.mjs +0 -2
  129. package/dist/esm/api/types/ProductCategoryResource.d.mts +0 -8
  130. package/dist/esm/api/types/ProductCategoryResource.mjs +0 -2
  131. /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerStandCheckoutRequest.js → customer/resources/stands/types/CheckoutStandsResponse.js} +0 -0
  132. /package/dist/cjs/api/{resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.js → types/OrderItemResource.js} +0 -0
  133. /package/dist/esm/api/resources/{customerStands/client/requests/CustomerStandCheckoutRequest.mjs → customer/resources/stands/types/CheckoutStandsResponse.mjs} +0 -0
  134. /package/dist/esm/api/{resources/customerStands/client/requests/CustomerStandPaymentIntentRequest.mjs → types/OrderItemResource.mjs} +0 -0
@@ -1,27 +1,42 @@
1
+ import type * as FiveOneEat from "../index.js";
1
2
  export interface OrderResource {
2
3
  id: string;
3
4
  order_number: string;
4
5
  status: string;
5
6
  fulfillment_status: string;
6
7
  fulfillment_method: string;
7
- subtotal_cents: string;
8
- discount_cents: string;
9
- shipping_cents: string;
10
- tax_cents: string;
11
- platform_fee_cents: OrderResource.PlatformFeeCents;
12
- total_cents: string;
8
+ subtotal_cents: number;
9
+ discount_cents: number;
10
+ shipping_cents: number;
11
+ tax_cents: number;
12
+ platform_fee_cents: number;
13
+ total_cents: number;
13
14
  currency: string;
14
- shipping_address: string;
15
+ shipping_address: Record<string, unknown> | null;
15
16
  notes: string;
16
17
  fulfilled_at: string;
17
18
  refunded_at: string;
19
+ business?: OrderResource.Business | undefined;
20
+ transaction?: (OrderResource.Transaction | null) | undefined;
18
21
  tracking_number?: (string | null) | undefined;
22
+ tracking_url?: (string | null) | undefined;
19
23
  shipments: OrderResource.Shipments;
20
- items: unknown[];
24
+ items?: FiveOneEat.OrderItemResource[] | undefined;
21
25
  created_at: string;
22
26
  updated_at: string;
23
27
  }
24
28
  export declare namespace OrderResource {
25
- type PlatformFeeCents = string | number;
29
+ interface Business {
30
+ id: string;
31
+ handle: string;
32
+ name: string;
33
+ }
34
+ interface Transaction {
35
+ ulid: string;
36
+ status: string;
37
+ refunded_amount_cents: number;
38
+ payment_completed_at: string;
39
+ refunded_at: string;
40
+ }
26
41
  type Shipments = string | string[];
27
42
  }
@@ -1,6 +1,6 @@
1
1
  export interface PaginationResource {
2
- current_page: string;
3
- per_page: string;
4
- total: string;
5
- has_more: string;
2
+ current_page: number;
3
+ per_page: number;
4
+ total: number;
5
+ has_more: boolean;
6
6
  }
@@ -2,7 +2,7 @@ export interface PriceListResource {
2
2
  id: string;
3
3
  key: string;
4
4
  name: string;
5
- is_default: string;
5
+ is_default: boolean;
6
6
  created_at: string;
7
7
  updated_at: string;
8
8
  }
@@ -3,8 +3,8 @@ export interface PriceResource {
3
3
  id: string;
4
4
  price_list_id: string;
5
5
  price_list?: FiveOneEat.PriceListResource | undefined;
6
- amount_cents: string;
7
- compare_at_cents: string;
6
+ amount_cents: number;
7
+ compare_at_cents: number | null;
8
8
  currency: string;
9
- min_quantity: string;
9
+ min_quantity: number;
10
10
  }
@@ -1,17 +1,16 @@
1
- import type * as FiveOneEat from "../index.js";
2
1
  export interface ProductResource {
3
2
  id: string;
4
3
  name: string;
5
4
  slug: string;
6
5
  description: string;
7
- is_active: string;
6
+ is_active: boolean;
8
7
  published_at: string;
9
- metadata: string;
8
+ metadata: Record<string, unknown> | null;
10
9
  product_category_id: string;
11
- category?: FiveOneEat.ProductCategoryResource | undefined;
12
- images?: FiveOneEat.ImageResource[] | undefined;
10
+ category?: unknown[] | undefined;
11
+ images?: unknown[] | undefined;
13
12
  variants?: unknown[] | undefined;
14
- default_variant?: (unknown[] | null) | undefined;
13
+ default_variant?: unknown[] | undefined;
15
14
  created_at: string;
16
15
  updated_at: string;
17
16
  }
@@ -1,12 +1,12 @@
1
1
  export interface Transaction {
2
2
  ulid: string;
3
3
  status: string;
4
- subtotal: string;
5
- tax_amount: string;
6
- shipping_amount: string;
7
- platform_fee: string;
8
- total_amount: string;
9
- refunded_amount: string;
4
+ subtotal: number;
5
+ tax_amount: number;
6
+ shipping_amount: number;
7
+ platform_fee: number;
8
+ total_amount: number;
9
+ refunded_amount: number;
10
10
  customer_name: string | null;
11
11
  customer_email: string;
12
12
  stripe_payment_intent_id: string | null;
@@ -3,10 +3,10 @@ export interface VariantResource {
3
3
  id: string;
4
4
  name: string;
5
5
  sku: string;
6
- is_default: string;
7
- weight: string;
6
+ is_default: boolean;
7
+ weight: number | null;
8
8
  weight_unit: string;
9
- sort_order: string;
9
+ sort_order: number;
10
10
  prices?: FiveOneEat.PriceResource[] | undefined;
11
11
  inventory_levels?: FiveOneEat.InventoryLevelResource[] | undefined;
12
12
  created_at: string;
@@ -118,18 +118,17 @@ export * from "./ExploreTemporaryLocation.js";
118
118
  export * from "./FavoriteResponse.js";
119
119
  export * from "./ForbiddenErrorBody.js";
120
120
  export * from "./Image.js";
121
- export * from "./ImageResource.js";
122
121
  export * from "./InternalServerErrorBody.js";
123
122
  export * from "./InventoryLevelResource.js";
124
123
  export * from "./MenuItemSearchResult.js";
125
124
  export * from "./Message.js";
126
125
  export * from "./NotFoundErrorBody.js";
126
+ export * from "./OrderItemResource.js";
127
127
  export * from "./OrderResource.js";
128
128
  export * from "./PaginationResource.js";
129
129
  export * from "./PaymentMethod.js";
130
130
  export * from "./PriceListResource.js";
131
131
  export * from "./PriceResource.js";
132
- export * from "./ProductCategoryResource.js";
133
132
  export * from "./ProductResource.js";
134
133
  export * from "./ProductSearchResult.js";
135
134
  export * from "./RsvpEvent.js";
@@ -134,18 +134,17 @@ __exportStar(require("./ExploreTemporaryLocation.js"), exports);
134
134
  __exportStar(require("./FavoriteResponse.js"), exports);
135
135
  __exportStar(require("./ForbiddenErrorBody.js"), exports);
136
136
  __exportStar(require("./Image.js"), exports);
137
- __exportStar(require("./ImageResource.js"), exports);
138
137
  __exportStar(require("./InternalServerErrorBody.js"), exports);
139
138
  __exportStar(require("./InventoryLevelResource.js"), exports);
140
139
  __exportStar(require("./MenuItemSearchResult.js"), exports);
141
140
  __exportStar(require("./Message.js"), exports);
142
141
  __exportStar(require("./NotFoundErrorBody.js"), exports);
142
+ __exportStar(require("./OrderItemResource.js"), exports);
143
143
  __exportStar(require("./OrderResource.js"), exports);
144
144
  __exportStar(require("./PaginationResource.js"), exports);
145
145
  __exportStar(require("./PaymentMethod.js"), exports);
146
146
  __exportStar(require("./PriceListResource.js"), exports);
147
147
  __exportStar(require("./PriceResource.js"), exports);
148
- __exportStar(require("./ProductCategoryResource.js"), exports);
149
148
  __exportStar(require("./ProductResource.js"), exports);
150
149
  __exportStar(require("./ProductSearchResult.js"), exports);
151
150
  __exportStar(require("./RsvpEvent.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.70";
1
+ export declare const SDK_VERSION = "0.0.72";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.70";
4
+ exports.SDK_VERSION = "0.0.72";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@51eat/sdk",
9
- "X-Fern-SDK-Version": "0.0.70",
10
- "User-Agent": "@51eat/sdk/0.0.70",
9
+ "X-Fern-SDK-Version": "0.0.72",
10
+ "User-Agent": "@51eat/sdk/0.0.72",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -17,4 +17,11 @@ export interface UpdateStandRequest {
17
17
  latitude?: number | null;
18
18
  longitude?: number | null;
19
19
  is_active?: boolean | null;
20
+ /**
21
+ * `UpdateStand` passes these straight to `$stand->products()->sync()`.
22
+ * Unvalidated, any id at all was accepted — including one from another
23
+ * business's catalogue, which then appeared on this stand's public
24
+ * self-checkout. Scoped to the caller's own products.
25
+ */
26
+ product_ids?: string[];
20
27
  }
@@ -62,7 +62,6 @@ export declare class CustomerClient {
62
62
  * @param {FiveOneEat.SearchCustomerRequest} request
63
63
  * @param {CustomerClient.RequestOptions} requestOptions - Request-specific configuration.
64
64
  *
65
- * @throws {@link FiveOneEat.UnauthorizedError}
66
65
  * @throws {@link FiveOneEat.UnprocessableEntityError}
67
66
  *
68
67
  * @example
@@ -102,7 +102,6 @@ export class CustomerClient {
102
102
  * @param {FiveOneEat.SearchCustomerRequest} request
103
103
  * @param {CustomerClient.RequestOptions} requestOptions - Request-specific configuration.
104
104
  *
105
- * @throws {@link FiveOneEat.UnauthorizedError}
106
105
  * @throws {@link FiveOneEat.UnprocessableEntityError}
107
106
  *
108
107
  * @example
@@ -132,8 +131,7 @@ export class CustomerClient {
132
131
  lat: lat != null ? toJson(lat) : undefined,
133
132
  lng: lng != null ? toJson(lng) : undefined,
134
133
  };
135
- const _authRequest = yield this._options.authProvider.getAuthRequest();
136
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
134
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
137
135
  const _response = yield core.fetcher({
138
136
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "customer/search"),
139
137
  method: "GET",
@@ -155,8 +153,6 @@ export class CustomerClient {
155
153
  }
156
154
  if (_response.error.reason === "status-code") {
157
155
  switch (_response.error.statusCode) {
158
- case 401:
159
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
160
156
  case 422:
161
157
  throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
162
158
  default:
@@ -1,5 +1,5 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
- import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptions } from "../../../../../../BaseClient.mjs";
3
3
  import * as core from "../../../../../../core/index.mjs";
4
4
  import * as FiveOneEat from "../../../../../index.mjs";
5
5
  export declare namespace AdsClient {
@@ -8,7 +8,7 @@ export declare namespace AdsClient {
8
8
  }
9
9
  }
10
10
  export declare class AdsClient {
11
- protected readonly _options: NormalizedClientOptionsWithAuth<AdsClient.Options>;
11
+ protected readonly _options: NormalizedClientOptions<AdsClient.Options>;
12
12
  constructor(options?: AdsClient.Options);
13
13
  /**
14
14
  * Returns an active advertisement for the given placement, or no content if none is available.
@@ -16,7 +16,6 @@ export declare class AdsClient {
16
16
  * @param {FiveOneEat.customer.ServeAdsRequest} request
17
17
  * @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
18
18
  *
19
- * @throws {@link FiveOneEat.UnauthorizedError}
20
19
  * @throws {@link FiveOneEat.NotFoundError}
21
20
  *
22
21
  * @example
@@ -32,7 +31,6 @@ export declare class AdsClient {
32
31
  * @param {FiveOneEat.customer.RecordClickAdsRequest} request
33
32
  * @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
34
33
  *
35
- * @throws {@link FiveOneEat.UnauthorizedError}
36
34
  * @throws {@link FiveOneEat.NotFoundError}
37
35
  *
38
36
  * @example
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
11
+ import { normalizeClientOptions } from "../../../../../../BaseClient.mjs";
12
12
  import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
13
  import * as core from "../../../../../../core/index.mjs";
14
14
  import * as environments from "../../../../../../environments.mjs";
@@ -17,7 +17,7 @@ import * as errors from "../../../../../../errors/index.mjs";
17
17
  import * as FiveOneEat from "../../../../../index.mjs";
18
18
  export class AdsClient {
19
19
  constructor(options = {}) {
20
- this._options = normalizeClientOptionsWithAuth(options);
20
+ this._options = normalizeClientOptions(options);
21
21
  }
22
22
  /**
23
23
  * Returns an active advertisement for the given placement, or no content if none is available.
@@ -25,7 +25,6 @@ export class AdsClient {
25
25
  * @param {FiveOneEat.customer.ServeAdsRequest} request
26
26
  * @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
27
27
  *
28
- * @throws {@link FiveOneEat.UnauthorizedError}
29
28
  * @throws {@link FiveOneEat.NotFoundError}
30
29
  *
31
30
  * @example
@@ -40,8 +39,7 @@ export class AdsClient {
40
39
  return __awaiter(this, void 0, void 0, function* () {
41
40
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
42
41
  const { placement } = request;
43
- const _authRequest = yield this._options.authProvider.getAuthRequest();
44
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
42
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
43
  const _response = yield core.fetcher({
46
44
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/ads/${core.url.encodePathParam(placement)}`),
47
45
  method: "GET",
@@ -58,8 +56,6 @@ export class AdsClient {
58
56
  }
59
57
  if (_response.error.reason === "status-code") {
60
58
  switch (_response.error.statusCode) {
61
- case 401:
62
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
63
59
  case 404:
64
60
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
65
61
  default:
@@ -79,7 +75,6 @@ export class AdsClient {
79
75
  * @param {FiveOneEat.customer.RecordClickAdsRequest} request
80
76
  * @param {AdsClient.RequestOptions} requestOptions - Request-specific configuration.
81
77
  *
82
- * @throws {@link FiveOneEat.UnauthorizedError}
83
78
  * @throws {@link FiveOneEat.NotFoundError}
84
79
  *
85
80
  * @example
@@ -94,8 +89,7 @@ export class AdsClient {
94
89
  return __awaiter(this, void 0, void 0, function* () {
95
90
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
96
91
  const { advertisement } = request;
97
- const _authRequest = yield this._options.authProvider.getAuthRequest();
98
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
92
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
99
93
  const _response = yield core.fetcher({
100
94
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/ads/${core.url.encodePathParam(advertisement)}/click`),
101
95
  method: "POST",
@@ -112,8 +106,6 @@ export class AdsClient {
112
106
  }
113
107
  if (_response.error.reason === "status-code") {
114
108
  switch (_response.error.statusCode) {
115
- case 401:
116
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
117
109
  case 404:
118
110
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
119
111
  default:
@@ -22,8 +22,6 @@ export declare class BusinessesClient {
22
22
  * @param {FiveOneEat.customer.ProfileBusinessesRequest} request
23
23
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
24
24
  *
25
- * @throws {@link FiveOneEat.UnauthorizedError}
26
- *
27
25
  * @example
28
26
  * await client.customer.businesses.profile({
29
27
  * business: "katzs-deli"
@@ -37,7 +35,6 @@ export declare class BusinessesClient {
37
35
  * @param {FiveOneEat.customer.MenusBusinessesRequest} request
38
36
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
39
37
  *
40
- * @throws {@link FiveOneEat.UnauthorizedError}
41
38
  * @throws {@link FiveOneEat.UnprocessableEntityError}
42
39
  *
43
40
  * @example
@@ -53,7 +50,6 @@ export declare class BusinessesClient {
53
50
  * @param {FiveOneEat.customer.PhotosBusinessesRequest} request
54
51
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
55
52
  *
56
- * @throws {@link FiveOneEat.UnauthorizedError}
57
53
  * @throws {@link FiveOneEat.UnprocessableEntityError}
58
54
  *
59
55
  * @example
@@ -64,68 +60,65 @@ export declare class BusinessesClient {
64
60
  photos(request: FiveOneEat.customer.PhotosBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.PhotosBusinessesResponse>;
65
61
  private __photos;
66
62
  /**
67
- * Add a business to the authenticated user's favorites.
63
+ * Retrieve active and upcoming temporary locations for a business.
68
64
  *
69
- * @param {FiveOneEat.customer.FavoriteBusinessesRequest} request
65
+ * @param {FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest} request
70
66
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
71
67
  *
72
- * @throws {@link FiveOneEat.UnauthorizedError}
73
- * @throws {@link FiveOneEat.NotFoundError}
74
- * @throws {@link FiveOneEat.ConflictError}
75
- *
76
68
  * @example
77
- * await client.customer.businesses.favorite({
69
+ * await client.customer.businesses.listTemporaryLocations({
78
70
  * business: "katzs-deli"
79
71
  * })
80
72
  */
81
- favorite(request: FiveOneEat.customer.FavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.FavoriteBusinessesResponse>;
82
- private __favorite;
73
+ listTemporaryLocations(request: FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ListTemporaryLocationsBusinessesResponse>;
74
+ private __listTemporaryLocations;
83
75
  /**
84
- * Remove a business from the authenticated user's favorites.
76
+ * Returns available pickup timeslots for a business on a given date.
85
77
  *
86
- * @param {FiveOneEat.customer.UnfavoriteBusinessesRequest} request
78
+ * @param {FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest} request
87
79
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
88
80
  *
89
- * @throws {@link FiveOneEat.UnauthorizedError}
90
- * @throws {@link FiveOneEat.NotFoundError}
81
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
91
82
  *
92
83
  * @example
93
- * await client.customer.businesses.unfavorite({
94
- * business: "katzs-deli"
84
+ * await client.customer.businesses.getPickupTimeslots({
85
+ * handle: "katzs-deli",
86
+ * date: "2023-01-15"
95
87
  * })
96
88
  */
97
- unfavorite(request: FiveOneEat.customer.UnfavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
98
- private __unfavorite;
89
+ getPickupTimeslots(request: FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.GetPickupTimeslotsBusinessesResponse>;
90
+ private __getPickupTimeslots;
99
91
  /**
100
- * Retrieve active and upcoming temporary locations for a business.
92
+ * Add a business to the authenticated user's favorites.
101
93
  *
102
- * @param {FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest} request
94
+ * @param {FiveOneEat.customer.FavoriteBusinessesRequest} request
103
95
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
104
96
  *
105
97
  * @throws {@link FiveOneEat.UnauthorizedError}
98
+ * @throws {@link FiveOneEat.NotFoundError}
99
+ * @throws {@link FiveOneEat.ConflictError}
106
100
  *
107
101
  * @example
108
- * await client.customer.businesses.listTemporaryLocations({
102
+ * await client.customer.businesses.favorite({
109
103
  * business: "katzs-deli"
110
104
  * })
111
105
  */
112
- listTemporaryLocations(request: FiveOneEat.customer.ListTemporaryLocationsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ListTemporaryLocationsBusinessesResponse>;
113
- private __listTemporaryLocations;
106
+ favorite(request: FiveOneEat.customer.FavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.FavoriteBusinessesResponse>;
107
+ private __favorite;
114
108
  /**
115
- * Returns available pickup timeslots for a business on a given date.
109
+ * Remove a business from the authenticated user's favorites.
116
110
  *
117
- * @param {FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest} request
111
+ * @param {FiveOneEat.customer.UnfavoriteBusinessesRequest} request
118
112
  * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
119
113
  *
120
114
  * @throws {@link FiveOneEat.UnauthorizedError}
121
- * @throws {@link FiveOneEat.UnprocessableEntityError}
115
+ * @throws {@link FiveOneEat.NotFoundError}
122
116
  *
123
117
  * @example
124
- * await client.customer.businesses.getPickupTimeslots({
125
- * handle: "katzs-deli",
126
- * date: "2023-01-15"
118
+ * await client.customer.businesses.unfavorite({
119
+ * business: "katzs-deli"
127
120
  * })
128
121
  */
129
- getPickupTimeslots(request: FiveOneEat.customer.GetPickupTimeslotsBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.GetPickupTimeslotsBusinessesResponse>;
130
- private __getPickupTimeslots;
122
+ unfavorite(request: FiveOneEat.customer.UnfavoriteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
123
+ private __unfavorite;
131
124
  }