@51eat/sdk 0.0.46 → 0.0.48

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 (132) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentRequest.d.ts +1 -0
  3. package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +1 -0
  4. package/dist/cjs/api/resources/customer/resources/me/client/Client.d.ts +6 -0
  5. package/dist/cjs/api/resources/customer/resources/me/client/Client.js +14 -4
  6. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/Client.d.ts +89 -0
  7. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/Client.js +304 -0
  8. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/index.js +17 -0
  10. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/requests/DeleteAddressesRequest.d.ts +10 -0
  11. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/requests/DeleteAddressesRequest.js +3 -0
  12. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/requests/UpdateAddressesRequest.d.ts +19 -0
  13. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/requests/UpdateAddressesRequest.js +3 -0
  14. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/requests/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/exports.d.ts +2 -0
  17. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/exports.js +21 -0
  18. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/index.js +18 -0
  20. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/CreateAddressesResponse.d.ts +4 -0
  21. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/CreateAddressesResponse.js +3 -0
  22. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/ListAddressesResponse.d.ts +4 -0
  23. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/ListAddressesResponse.js +3 -0
  24. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/UpdateAddressesResponse.d.ts +4 -0
  25. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/UpdateAddressesResponse.js +3 -0
  26. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/index.d.ts +3 -0
  27. package/dist/cjs/api/resources/customer/resources/me/resources/addresses/types/index.js +19 -0
  28. package/dist/cjs/api/resources/customer/resources/me/resources/index.d.ts +6 -0
  29. package/dist/cjs/api/resources/customer/resources/me/resources/index.js +7 -1
  30. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/Client.d.ts +88 -0
  31. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/Client.js +329 -0
  32. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/index.js +17 -0
  34. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/DeletePaymentMethodsRequest.d.ts +9 -0
  35. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/DeletePaymentMethodsRequest.js +3 -0
  36. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/SetDefaultPaymentMethodsRequest.d.ts +9 -0
  37. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/SetDefaultPaymentMethodsRequest.js +3 -0
  38. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/StorePaymentMethodRequest.d.ts +10 -0
  39. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/StorePaymentMethodRequest.js +3 -0
  40. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/index.d.ts +3 -0
  41. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/client/requests/index.js +2 -0
  42. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/exports.d.ts +2 -0
  43. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/exports.js +21 -0
  44. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/index.d.ts +2 -0
  45. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/index.js +18 -0
  46. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/AddPaymentMethodsResponse.d.ts +4 -0
  47. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/AddPaymentMethodsResponse.js +3 -0
  48. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/SetDefaultPaymentMethodsResponse.d.ts +4 -0
  49. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/SetDefaultPaymentMethodsResponse.js +3 -0
  50. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/SetupIntentPaymentMethodsResponse.d.ts +3 -0
  51. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/SetupIntentPaymentMethodsResponse.js +3 -0
  52. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/index.d.ts +3 -0
  53. package/dist/cjs/api/resources/customer/resources/me/resources/paymentMethods/types/index.js +19 -0
  54. package/dist/cjs/api/types/Address.d.ts +15 -0
  55. package/dist/cjs/api/types/Address.js +3 -0
  56. package/dist/cjs/api/types/AddressCollection.d.ts +4 -0
  57. package/dist/cjs/api/types/AddressCollection.js +3 -0
  58. package/dist/cjs/api/types/PaymentMethod.d.ts +8 -0
  59. package/dist/cjs/api/types/PaymentMethod.js +3 -0
  60. package/dist/cjs/api/types/StoreAddressRequest.d.ts +12 -0
  61. package/dist/cjs/api/types/StoreAddressRequest.js +3 -0
  62. package/dist/cjs/api/types/index.d.ts +4 -0
  63. package/dist/cjs/api/types/index.js +4 -0
  64. package/dist/cjs/version.d.ts +1 -1
  65. package/dist/cjs/version.js +1 -1
  66. package/dist/esm/BaseClient.mjs +2 -2
  67. package/dist/esm/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentRequest.d.mts +1 -0
  68. package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +1 -0
  69. package/dist/esm/api/resources/customer/resources/me/client/Client.d.mts +6 -0
  70. package/dist/esm/api/resources/customer/resources/me/client/Client.mjs +10 -0
  71. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/Client.d.mts +89 -0
  72. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/Client.mjs +267 -0
  73. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/index.d.mts +1 -0
  74. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/index.mjs +1 -0
  75. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/requests/DeleteAddressesRequest.d.mts +10 -0
  76. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/requests/DeleteAddressesRequest.mjs +2 -0
  77. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/requests/UpdateAddressesRequest.d.mts +19 -0
  78. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/requests/UpdateAddressesRequest.mjs +2 -0
  79. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/requests/index.d.mts +2 -0
  80. package/dist/esm/api/resources/customer/resources/me/resources/addresses/client/requests/index.mjs +1 -0
  81. package/dist/esm/api/resources/customer/resources/me/resources/addresses/exports.d.mts +2 -0
  82. package/dist/esm/api/resources/customer/resources/me/resources/addresses/exports.mjs +3 -0
  83. package/dist/esm/api/resources/customer/resources/me/resources/addresses/index.d.mts +2 -0
  84. package/dist/esm/api/resources/customer/resources/me/resources/addresses/index.mjs +2 -0
  85. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/CreateAddressesResponse.d.mts +4 -0
  86. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/CreateAddressesResponse.mjs +2 -0
  87. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/ListAddressesResponse.d.mts +4 -0
  88. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/ListAddressesResponse.mjs +2 -0
  89. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/UpdateAddressesResponse.d.mts +4 -0
  90. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/UpdateAddressesResponse.mjs +2 -0
  91. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/index.d.mts +3 -0
  92. package/dist/esm/api/resources/customer/resources/me/resources/addresses/types/index.mjs +3 -0
  93. package/dist/esm/api/resources/customer/resources/me/resources/index.d.mts +6 -0
  94. package/dist/esm/api/resources/customer/resources/me/resources/index.mjs +6 -0
  95. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/Client.d.mts +88 -0
  96. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/Client.mjs +292 -0
  97. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/index.d.mts +1 -0
  98. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/index.mjs +1 -0
  99. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/DeletePaymentMethodsRequest.d.mts +9 -0
  100. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/DeletePaymentMethodsRequest.mjs +2 -0
  101. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/SetDefaultPaymentMethodsRequest.d.mts +9 -0
  102. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/SetDefaultPaymentMethodsRequest.mjs +2 -0
  103. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/StorePaymentMethodRequest.d.mts +10 -0
  104. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/StorePaymentMethodRequest.mjs +2 -0
  105. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/index.d.mts +3 -0
  106. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/client/requests/index.mjs +1 -0
  107. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/exports.d.mts +2 -0
  108. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/exports.mjs +3 -0
  109. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/index.d.mts +2 -0
  110. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/index.mjs +2 -0
  111. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/AddPaymentMethodsResponse.d.mts +4 -0
  112. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/AddPaymentMethodsResponse.mjs +2 -0
  113. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/SetDefaultPaymentMethodsResponse.d.mts +4 -0
  114. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/SetDefaultPaymentMethodsResponse.mjs +2 -0
  115. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/SetupIntentPaymentMethodsResponse.d.mts +3 -0
  116. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/SetupIntentPaymentMethodsResponse.mjs +2 -0
  117. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/index.d.mts +3 -0
  118. package/dist/esm/api/resources/customer/resources/me/resources/paymentMethods/types/index.mjs +3 -0
  119. package/dist/esm/api/types/Address.d.mts +15 -0
  120. package/dist/esm/api/types/Address.mjs +2 -0
  121. package/dist/esm/api/types/AddressCollection.d.mts +4 -0
  122. package/dist/esm/api/types/AddressCollection.mjs +2 -0
  123. package/dist/esm/api/types/PaymentMethod.d.mts +8 -0
  124. package/dist/esm/api/types/PaymentMethod.mjs +2 -0
  125. package/dist/esm/api/types/StoreAddressRequest.d.mts +12 -0
  126. package/dist/esm/api/types/StoreAddressRequest.mjs +2 -0
  127. package/dist/esm/api/types/index.d.mts +4 -0
  128. package/dist/esm/api/types/index.mjs +4 -0
  129. package/dist/esm/version.d.mts +1 -1
  130. package/dist/esm/version.mjs +1 -1
  131. package/package.json +23 -1
  132. package/reference.md +573 -0
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AddPaymentMethodsResponse.js"), exports);
18
+ __exportStar(require("./SetDefaultPaymentMethodsResponse.js"), exports);
19
+ __exportStar(require("./SetupIntentPaymentMethodsResponse.js"), exports);
@@ -0,0 +1,15 @@
1
+ export interface Address {
2
+ id: number;
3
+ label: string | null;
4
+ line1: string;
5
+ line2: string | null;
6
+ city: string;
7
+ state: string;
8
+ postal_code: string;
9
+ country: string;
10
+ latitude: number | null;
11
+ longitude: number | null;
12
+ is_default: boolean;
13
+ created_at: string | null;
14
+ updated_at: string | null;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../index.js";
2
+ export interface AddressCollection {
3
+ addresses: FiveOneEat.Address[];
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface PaymentMethod {
2
+ id: string;
3
+ brand: string;
4
+ last4: string;
5
+ exp_month: number;
6
+ exp_year: number;
7
+ is_default: boolean;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export interface StoreAddressRequest {
2
+ label?: (string | null) | undefined;
3
+ line1: string;
4
+ line2?: (string | null) | undefined;
5
+ city: string;
6
+ state: string;
7
+ postal_code: string;
8
+ country: string;
9
+ latitude?: (number | null) | undefined;
10
+ longitude?: (number | null) | undefined;
11
+ is_default?: boolean | undefined;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,6 @@
1
1
  export * from "./Ad.js";
2
+ export * from "./Address.js";
3
+ export * from "./AddressCollection.js";
2
4
  export * from "./Allergen.js";
3
5
  export * from "./BardBlockquoteNode.js";
4
6
  export * from "./BardBody.js";
@@ -122,6 +124,7 @@ export * from "./MenuItemSearchResult.js";
122
124
  export * from "./Message.js";
123
125
  export * from "./NotFoundErrorBody.js";
124
126
  export * from "./PaginationResource.js";
127
+ export * from "./PaymentMethod.js";
125
128
  export * from "./ProductSearchResult.js";
126
129
  export * from "./ReorderProductImagesRequest.js";
127
130
  export * from "./RsvpEvent.js";
@@ -129,6 +132,7 @@ export * from "./RsvpItem.js";
129
132
  export * from "./RsvpResponse.js";
130
133
  export * from "./SearchResults.js";
131
134
  export * from "./ServiceUnavailableErrorBody.js";
135
+ export * from "./StoreAddressRequest.js";
132
136
  export * from "./StoreProductImageRequest.js";
133
137
  export * from "./Ticket.js";
134
138
  export * from "./TicketOrder.js";
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Ad.js"), exports);
18
+ __exportStar(require("./Address.js"), exports);
19
+ __exportStar(require("./AddressCollection.js"), exports);
18
20
  __exportStar(require("./Allergen.js"), exports);
19
21
  __exportStar(require("./BardBlockquoteNode.js"), exports);
20
22
  __exportStar(require("./BardBody.js"), exports);
@@ -138,6 +140,7 @@ __exportStar(require("./MenuItemSearchResult.js"), exports);
138
140
  __exportStar(require("./Message.js"), exports);
139
141
  __exportStar(require("./NotFoundErrorBody.js"), exports);
140
142
  __exportStar(require("./PaginationResource.js"), exports);
143
+ __exportStar(require("./PaymentMethod.js"), exports);
141
144
  __exportStar(require("./ProductSearchResult.js"), exports);
142
145
  __exportStar(require("./ReorderProductImagesRequest.js"), exports);
143
146
  __exportStar(require("./RsvpEvent.js"), exports);
@@ -145,6 +148,7 @@ __exportStar(require("./RsvpItem.js"), exports);
145
148
  __exportStar(require("./RsvpResponse.js"), exports);
146
149
  __exportStar(require("./SearchResults.js"), exports);
147
150
  __exportStar(require("./ServiceUnavailableErrorBody.js"), exports);
151
+ __exportStar(require("./StoreAddressRequest.js"), exports);
148
152
  __exportStar(require("./StoreProductImageRequest.js"), exports);
149
153
  __exportStar(require("./Ticket.js"), exports);
150
154
  __exportStar(require("./TicketOrder.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.46";
1
+ export declare const SDK_VERSION = "0.0.48";
@@ -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.46";
4
+ exports.SDK_VERSION = "0.0.48";
@@ -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.46",
10
- "User-Agent": "@51eat/sdk/0.0.46",
9
+ "X-Fern-SDK-Version": "0.0.48",
10
+ "User-Agent": "@51eat/sdk/0.0.48",
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,6 +17,7 @@ export interface CreatePaymentIntentRequest {
17
17
  fulfillment_method?: CreatePaymentIntentRequest.FulfillmentMethod | null;
18
18
  pickup_date?: CreatePaymentIntentRequest.PickupDate | null;
19
19
  pickup_time?: string | null;
20
+ payment_method_id?: string | null;
20
21
  billing_address: CreatePaymentIntentRequest.BillingAddress;
21
22
  shipping_address?: CreatePaymentIntentRequest.ShippingAddress;
22
23
  }
@@ -1,4 +1,5 @@
1
1
  export interface CreatePaymentIntentCartResponse {
2
+ status: string;
2
3
  client_secret: string;
3
4
  payment_intent_id: string;
4
5
  subtotal: string;
@@ -2,6 +2,8 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
3
  import * as core from "../../../../../../core/index.mjs";
4
4
  import * as FiveOneEat from "../../../../../index.mjs";
5
+ import { AddressesClient } from "../resources/addresses/client/Client.mjs";
6
+ import { PaymentMethodsClient } from "../resources/paymentMethods/client/Client.mjs";
5
7
  import { TicketOrdersClient } from "../resources/ticketOrders/client/Client.mjs";
6
8
  import { TicketsClient } from "../resources/tickets/client/Client.mjs";
7
9
  export declare namespace MeClient {
@@ -13,9 +15,13 @@ export declare class MeClient {
13
15
  protected readonly _options: NormalizedClientOptionsWithAuth<MeClient.Options>;
14
16
  protected _tickets: TicketsClient | undefined;
15
17
  protected _ticketOrders: TicketOrdersClient | undefined;
18
+ protected _addresses: AddressesClient | undefined;
19
+ protected _paymentMethods: PaymentMethodsClient | undefined;
16
20
  constructor(options?: MeClient.Options);
17
21
  get tickets(): TicketsClient;
18
22
  get ticketOrders(): TicketOrdersClient;
23
+ get addresses(): AddressesClient;
24
+ get paymentMethods(): PaymentMethodsClient;
19
25
  /**
20
26
  * Retrieve the authenticated user's favorited businesses with pagination.
21
27
  *
@@ -15,6 +15,8 @@ import * as environments from "../../../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
16
  import * as errors from "../../../../../../errors/index.mjs";
17
17
  import * as FiveOneEat from "../../../../../index.mjs";
18
+ import { AddressesClient } from "../resources/addresses/client/Client.mjs";
19
+ import { PaymentMethodsClient } from "../resources/paymentMethods/client/Client.mjs";
18
20
  import { TicketOrdersClient } from "../resources/ticketOrders/client/Client.mjs";
19
21
  import { TicketsClient } from "../resources/tickets/client/Client.mjs";
20
22
  export class MeClient {
@@ -29,6 +31,14 @@ export class MeClient {
29
31
  var _a;
30
32
  return ((_a = this._ticketOrders) !== null && _a !== void 0 ? _a : (this._ticketOrders = new TicketOrdersClient(this._options)));
31
33
  }
34
+ get addresses() {
35
+ var _a;
36
+ return ((_a = this._addresses) !== null && _a !== void 0 ? _a : (this._addresses = new AddressesClient(this._options)));
37
+ }
38
+ get paymentMethods() {
39
+ var _a;
40
+ return ((_a = this._paymentMethods) !== null && _a !== void 0 ? _a : (this._paymentMethods = new PaymentMethodsClient(this._options)));
41
+ }
32
42
  /**
33
43
  * Retrieve the authenticated user's favorited businesses with pagination.
34
44
  *
@@ -0,0 +1,89 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../../../core/index.mjs";
4
+ import * as FiveOneEat from "../../../../../../../index.mjs";
5
+ export declare namespace AddressesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class AddressesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<AddressesClient.Options>;
12
+ constructor(options?: AddressesClient.Options);
13
+ /**
14
+ * Retrieve all saved addresses for the authenticated user.
15
+ *
16
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @throws {@link FiveOneEat.UnauthorizedError}
19
+ *
20
+ * @example
21
+ * await client.customer.me.addresses.list()
22
+ */
23
+ list(requestOptions?: AddressesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.me.ListAddressesResponse>;
24
+ private __list;
25
+ /**
26
+ * Save a new address to the authenticated user's account. If this is the first address,
27
+ * or if `is_default` is true, it will be set as the default (clearing any existing default).
28
+ *
29
+ * @param {FiveOneEat.StoreAddressRequest} request
30
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
31
+ *
32
+ * @throws {@link FiveOneEat.UnauthorizedError}
33
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
34
+ *
35
+ * @example
36
+ * await client.customer.me.addresses.create({
37
+ * line1: "line1",
38
+ * city: "city",
39
+ * state: "state",
40
+ * postal_code: "postal_code",
41
+ * country: "country"
42
+ * })
43
+ */
44
+ create(request: FiveOneEat.StoreAddressRequest, requestOptions?: AddressesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.me.CreateAddressesResponse>;
45
+ private __create;
46
+ /**
47
+ * Delete a saved address. If the deleted address was the default,
48
+ * the most recently created remaining address is promoted to default.
49
+ *
50
+ * @param {FiveOneEat.customer.me.DeleteAddressesRequest} request
51
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
52
+ *
53
+ * @throws {@link FiveOneEat.UnauthorizedError}
54
+ * @throws {@link FiveOneEat.ForbiddenError}
55
+ * @throws {@link FiveOneEat.NotFoundError}
56
+ *
57
+ * @example
58
+ * await client.customer.me.addresses.delete({
59
+ * address: 1
60
+ * })
61
+ */
62
+ delete(request: FiveOneEat.customer.me.DeleteAddressesRequest, requestOptions?: AddressesClient.RequestOptions): core.HttpResponsePromise<void>;
63
+ private __delete;
64
+ /**
65
+ * Update a saved address. If `is_default` is true, the previous default address will be cleared.
66
+ *
67
+ * @param {FiveOneEat.customer.me.UpdateAddressesRequest} request
68
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
69
+ *
70
+ * @throws {@link FiveOneEat.UnauthorizedError}
71
+ * @throws {@link FiveOneEat.ForbiddenError}
72
+ * @throws {@link FiveOneEat.NotFoundError}
73
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
74
+ *
75
+ * @example
76
+ * await client.customer.me.addresses.update({
77
+ * address: 1,
78
+ * body: {
79
+ * line1: "line1",
80
+ * city: "city",
81
+ * state: "state",
82
+ * postal_code: "postal_code",
83
+ * country: "country"
84
+ * }
85
+ * })
86
+ */
87
+ update(request: FiveOneEat.customer.me.UpdateAddressesRequest, requestOptions?: AddressesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.me.UpdateAddressesResponse>;
88
+ private __update;
89
+ }
@@ -0,0 +1,267 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../../../core/index.mjs";
14
+ import * as environments from "../../../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../../../errors/index.mjs";
17
+ import * as FiveOneEat from "../../../../../../../index.mjs";
18
+ export class AddressesClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Retrieve all saved addresses for the authenticated user.
24
+ *
25
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link FiveOneEat.UnauthorizedError}
28
+ *
29
+ * @example
30
+ * await client.customer.me.addresses.list()
31
+ */
32
+ list(requestOptions) {
33
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
34
+ }
35
+ __list(requestOptions) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
38
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
39
+ 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);
40
+ const _response = yield core.fetcher({
41
+ 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/addresses"),
42
+ method: "GET",
43
+ headers: _headers,
44
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
45
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
46
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
47
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
49
+ logging: this._options.logging,
50
+ });
51
+ if (_response.ok) {
52
+ return {
53
+ data: _response.body,
54
+ rawResponse: _response.rawResponse,
55
+ };
56
+ }
57
+ if (_response.error.reason === "status-code") {
58
+ switch (_response.error.statusCode) {
59
+ case 401:
60
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
61
+ default:
62
+ throw new errors.FiveOneEatError({
63
+ statusCode: _response.error.statusCode,
64
+ body: _response.error.body,
65
+ rawResponse: _response.rawResponse,
66
+ });
67
+ }
68
+ }
69
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/addresses");
70
+ });
71
+ }
72
+ /**
73
+ * Save a new address to the authenticated user's account. If this is the first address,
74
+ * or if `is_default` is true, it will be set as the default (clearing any existing default).
75
+ *
76
+ * @param {FiveOneEat.StoreAddressRequest} request
77
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
78
+ *
79
+ * @throws {@link FiveOneEat.UnauthorizedError}
80
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
81
+ *
82
+ * @example
83
+ * await client.customer.me.addresses.create({
84
+ * line1: "line1",
85
+ * city: "city",
86
+ * state: "state",
87
+ * postal_code: "postal_code",
88
+ * country: "country"
89
+ * })
90
+ */
91
+ create(request, requestOptions) {
92
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
93
+ }
94
+ __create(request, requestOptions) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
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);
99
+ const _response = yield core.fetcher({
100
+ 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/addresses"),
101
+ method: "POST",
102
+ headers: _headers,
103
+ contentType: "application/json",
104
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
105
+ requestType: "json",
106
+ body: request,
107
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
108
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
109
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
110
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
111
+ logging: this._options.logging,
112
+ });
113
+ if (_response.ok) {
114
+ return {
115
+ data: _response.body,
116
+ rawResponse: _response.rawResponse,
117
+ };
118
+ }
119
+ if (_response.error.reason === "status-code") {
120
+ switch (_response.error.statusCode) {
121
+ case 401:
122
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
123
+ case 422:
124
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
125
+ default:
126
+ throw new errors.FiveOneEatError({
127
+ statusCode: _response.error.statusCode,
128
+ body: _response.error.body,
129
+ rawResponse: _response.rawResponse,
130
+ });
131
+ }
132
+ }
133
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/addresses");
134
+ });
135
+ }
136
+ /**
137
+ * Delete a saved address. If the deleted address was the default,
138
+ * the most recently created remaining address is promoted to default.
139
+ *
140
+ * @param {FiveOneEat.customer.me.DeleteAddressesRequest} request
141
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @throws {@link FiveOneEat.UnauthorizedError}
144
+ * @throws {@link FiveOneEat.ForbiddenError}
145
+ * @throws {@link FiveOneEat.NotFoundError}
146
+ *
147
+ * @example
148
+ * await client.customer.me.addresses.delete({
149
+ * address: 1
150
+ * })
151
+ */
152
+ delete(request, requestOptions) {
153
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
154
+ }
155
+ __delete(request, requestOptions) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
158
+ const { address } = request;
159
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
160
+ 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);
161
+ const _response = yield core.fetcher({
162
+ 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/addresses/${core.url.encodePathParam(address)}`),
163
+ method: "DELETE",
164
+ headers: _headers,
165
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
166
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
167
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
168
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
170
+ logging: this._options.logging,
171
+ });
172
+ if (_response.ok) {
173
+ return { data: undefined, rawResponse: _response.rawResponse };
174
+ }
175
+ if (_response.error.reason === "status-code") {
176
+ switch (_response.error.statusCode) {
177
+ case 401:
178
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
179
+ case 403:
180
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
181
+ case 404:
182
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
183
+ default:
184
+ throw new errors.FiveOneEatError({
185
+ statusCode: _response.error.statusCode,
186
+ body: _response.error.body,
187
+ rawResponse: _response.rawResponse,
188
+ });
189
+ }
190
+ }
191
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/addresses/{address}");
192
+ });
193
+ }
194
+ /**
195
+ * Update a saved address. If `is_default` is true, the previous default address will be cleared.
196
+ *
197
+ * @param {FiveOneEat.customer.me.UpdateAddressesRequest} request
198
+ * @param {AddressesClient.RequestOptions} requestOptions - Request-specific configuration.
199
+ *
200
+ * @throws {@link FiveOneEat.UnauthorizedError}
201
+ * @throws {@link FiveOneEat.ForbiddenError}
202
+ * @throws {@link FiveOneEat.NotFoundError}
203
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
204
+ *
205
+ * @example
206
+ * await client.customer.me.addresses.update({
207
+ * address: 1,
208
+ * body: {
209
+ * line1: "line1",
210
+ * city: "city",
211
+ * state: "state",
212
+ * postal_code: "postal_code",
213
+ * country: "country"
214
+ * }
215
+ * })
216
+ */
217
+ update(request, requestOptions) {
218
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
219
+ }
220
+ __update(request, requestOptions) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
223
+ const { address, body: _body } = request;
224
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
225
+ 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);
226
+ const _response = yield core.fetcher({
227
+ 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/addresses/${core.url.encodePathParam(address)}`),
228
+ method: "PATCH",
229
+ headers: _headers,
230
+ contentType: "application/json",
231
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
232
+ requestType: "json",
233
+ body: _body,
234
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
235
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
236
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
237
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
238
+ logging: this._options.logging,
239
+ });
240
+ if (_response.ok) {
241
+ return {
242
+ data: _response.body,
243
+ rawResponse: _response.rawResponse,
244
+ };
245
+ }
246
+ if (_response.error.reason === "status-code") {
247
+ switch (_response.error.statusCode) {
248
+ case 401:
249
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
250
+ case 403:
251
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
252
+ case 404:
253
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
254
+ case 422:
255
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
256
+ default:
257
+ throw new errors.FiveOneEatError({
258
+ statusCode: _response.error.statusCode,
259
+ body: _response.error.body,
260
+ rawResponse: _response.rawResponse,
261
+ });
262
+ }
263
+ }
264
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/customer/addresses/{address}");
265
+ });
266
+ }
267
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * address: 1
5
+ * }
6
+ */
7
+ export interface DeleteAddressesRequest {
8
+ /** The address ID */
9
+ address: number;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,19 @@
1
+ import type * as FiveOneEat from "../../../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * address: 1,
6
+ * body: {
7
+ * line1: "line1",
8
+ * city: "city",
9
+ * state: "state",
10
+ * postal_code: "postal_code",
11
+ * country: "country"
12
+ * }
13
+ * }
14
+ */
15
+ export interface UpdateAddressesRequest {
16
+ /** The address ID */
17
+ address: number;
18
+ body: FiveOneEat.StoreAddressRequest;
19
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { DeleteAddressesRequest } from "./DeleteAddressesRequest.mjs";
2
+ export type { UpdateAddressesRequest } from "./UpdateAddressesRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { AddressesClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { AddressesClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";