@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
@@ -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,13 +17,12 @@ import * as errors from "../../../../../../errors/index.mjs";
17
17
  import * as FiveOneEat from "../../../../../index.mjs";
18
18
  export class ShopClient {
19
19
  constructor(options = {}) {
20
- this._options = normalizeClientOptionsWithAuth(options);
20
+ this._options = normalizeClientOptions(options);
21
21
  }
22
22
  /**
23
23
  * @param {FiveOneEat.customer.ListProductsShopRequest} request
24
24
  * @param {ShopClient.RequestOptions} requestOptions - Request-specific configuration.
25
25
  *
26
- * @throws {@link FiveOneEat.UnauthorizedError}
27
26
  * @throws {@link FiveOneEat.NotFoundError}
28
27
  *
29
28
  * @example
@@ -41,8 +40,7 @@ export class ShopClient {
41
40
  const _queryParams = {
42
41
  category,
43
42
  };
44
- const _authRequest = yield this._options.authProvider.getAuthRequest();
45
- 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);
43
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
46
44
  const _response = yield core.fetcher({
47
45
  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/businesses/${core.url.encodePathParam(business)}/shop`),
48
46
  method: "GET",
@@ -67,8 +65,6 @@ export class ShopClient {
67
65
  }
68
66
  if (_response.error.reason === "status-code") {
69
67
  switch (_response.error.statusCode) {
70
- case 401:
71
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
72
68
  case 404:
73
69
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
74
70
  default:
@@ -86,7 +82,6 @@ export class ShopClient {
86
82
  * @param {FiveOneEat.customer.GetProductShopRequest} request
87
83
  * @param {ShopClient.RequestOptions} requestOptions - Request-specific configuration.
88
84
  *
89
- * @throws {@link FiveOneEat.UnauthorizedError}
90
85
  * @throws {@link FiveOneEat.NotFoundError}
91
86
  *
92
87
  * @example
@@ -102,8 +97,7 @@ export class ShopClient {
102
97
  return __awaiter(this, void 0, void 0, function* () {
103
98
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
104
99
  const { business, product } = request;
105
- const _authRequest = yield this._options.authProvider.getAuthRequest();
106
- 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);
100
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
107
101
  const _response = yield core.fetcher({
108
102
  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/businesses/${core.url.encodePathParam(business)}/shop/products/${core.url.encodePathParam(product)}`),
109
103
  method: "GET",
@@ -123,8 +117,6 @@ export class ShopClient {
123
117
  }
124
118
  if (_response.error.reason === "status-code") {
125
119
  switch (_response.error.statusCode) {
126
- case 401:
127
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
128
120
  case 404:
129
121
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
130
122
  default:
@@ -142,7 +134,6 @@ export class ShopClient {
142
134
  * @param {FiveOneEat.customer.ListCategoriesShopRequest} request
143
135
  * @param {ShopClient.RequestOptions} requestOptions - Request-specific configuration.
144
136
  *
145
- * @throws {@link FiveOneEat.UnauthorizedError}
146
137
  * @throws {@link FiveOneEat.NotFoundError}
147
138
  *
148
139
  * @example
@@ -157,8 +148,7 @@ export class ShopClient {
157
148
  return __awaiter(this, void 0, void 0, function* () {
158
149
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
159
150
  const { business } = request;
160
- const _authRequest = yield this._options.authProvider.getAuthRequest();
161
- 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);
151
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
162
152
  const _response = yield core.fetcher({
163
153
  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/businesses/${core.url.encodePathParam(business)}/shop/categories`),
164
154
  method: "GET",
@@ -178,8 +168,6 @@ export class ShopClient {
178
168
  }
179
169
  if (_response.error.reason === "status-code") {
180
170
  switch (_response.error.statusCode) {
181
- case 401:
182
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
183
171
  case 404:
184
172
  throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
185
173
  default:
@@ -27,25 +27,35 @@ export declare class StandsClient {
27
27
  scan(request: FiveOneEat.customer.ScanStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ScanStandsResponse>;
28
28
  private __scan;
29
29
  /**
30
- * @param {FiveOneEat.customer.CheckoutStandsRequest} request
30
+ * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
31
31
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
32
32
  *
33
+ * @throws {@link FiveOneEat.UnauthorizedError}
34
+ * @throws {@link FiveOneEat.NotFoundError}
35
+ *
33
36
  * @example
34
- * await client.customer.stands.checkout({
37
+ * await client.customer.stands.createPaymentIntent({
35
38
  * stand: "stand"
36
39
  * })
37
40
  */
38
- checkout(request: FiveOneEat.customer.CheckoutStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<void>;
39
- private __checkout;
41
+ createPaymentIntent(request: FiveOneEat.customer.CreatePaymentIntentStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CreatePaymentIntentStandsResponse>;
42
+ private __createPaymentIntent;
40
43
  /**
41
- * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
44
+ * @param {FiveOneEat.customer.CheckoutStandsRequest} request
42
45
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
43
46
  *
47
+ * @throws {@link FiveOneEat.UnauthorizedError}
48
+ * @throws {@link FiveOneEat.NotFoundError}
49
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
50
+ *
44
51
  * @example
45
- * await client.customer.stands.createPaymentIntent({
46
- * stand: "stand"
52
+ * await client.customer.stands.checkout({
53
+ * stand: "stand",
54
+ * body: {
55
+ * payment_intent_id: "payment_intent_id"
56
+ * }
47
57
  * })
48
58
  */
49
- createPaymentIntent(request: FiveOneEat.customer.CreatePaymentIntentStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<void>;
50
- private __createPaymentIntent;
59
+ checkout(request: FiveOneEat.customer.CheckoutStandsRequest, requestOptions?: StandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.CheckoutStandsResponse>;
60
+ private __checkout;
51
61
  }
@@ -40,8 +40,7 @@ export class StandsClient {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
41
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
42
42
  const { stand } = 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);
43
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
44
  const _response = yield core.fetcher({
46
45
  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, `stand/${core.url.encodePathParam(stand)}`),
47
46
  method: "GET",
@@ -75,25 +74,28 @@ export class StandsClient {
75
74
  });
76
75
  }
77
76
  /**
78
- * @param {FiveOneEat.customer.CheckoutStandsRequest} request
77
+ * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
79
78
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
80
79
  *
80
+ * @throws {@link FiveOneEat.UnauthorizedError}
81
+ * @throws {@link FiveOneEat.NotFoundError}
82
+ *
81
83
  * @example
82
- * await client.customer.stands.checkout({
84
+ * await client.customer.stands.createPaymentIntent({
83
85
  * stand: "stand"
84
86
  * })
85
87
  */
86
- checkout(request, requestOptions) {
87
- return core.HttpResponsePromise.fromPromise(this.__checkout(request, requestOptions));
88
+ createPaymentIntent(request, requestOptions) {
89
+ return core.HttpResponsePromise.fromPromise(this.__createPaymentIntent(request, requestOptions));
88
90
  }
89
- __checkout(request, requestOptions) {
91
+ __createPaymentIntent(request, requestOptions) {
90
92
  return __awaiter(this, void 0, void 0, function* () {
91
93
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
92
94
  const { stand } = request;
93
95
  const _authRequest = yield this._options.authProvider.getAuthRequest();
94
96
  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);
95
97
  const _response = yield core.fetcher({
96
- 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/stands/${core.url.encodePathParam(stand)}/checkout`),
98
+ 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/stands/${core.url.encodePathParam(stand)}/cart/payment-intent`),
97
99
  method: "POST",
98
100
  headers: _headers,
99
101
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -104,41 +106,61 @@ export class StandsClient {
104
106
  logging: this._options.logging,
105
107
  });
106
108
  if (_response.ok) {
107
- return { data: undefined, rawResponse: _response.rawResponse };
109
+ return {
110
+ data: _response.body,
111
+ rawResponse: _response.rawResponse,
112
+ };
108
113
  }
109
114
  if (_response.error.reason === "status-code") {
110
- throw new errors.FiveOneEatError({
111
- statusCode: _response.error.statusCode,
112
- body: _response.error.body,
113
- rawResponse: _response.rawResponse,
114
- });
115
+ switch (_response.error.statusCode) {
116
+ case 401:
117
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
118
+ case 404:
119
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
120
+ default:
121
+ throw new errors.FiveOneEatError({
122
+ statusCode: _response.error.statusCode,
123
+ body: _response.error.body,
124
+ rawResponse: _response.rawResponse,
125
+ });
126
+ }
115
127
  }
116
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/checkout");
128
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/payment-intent");
117
129
  });
118
130
  }
119
131
  /**
120
- * @param {FiveOneEat.customer.CreatePaymentIntentStandsRequest} request
132
+ * @param {FiveOneEat.customer.CheckoutStandsRequest} request
121
133
  * @param {StandsClient.RequestOptions} requestOptions - Request-specific configuration.
122
134
  *
135
+ * @throws {@link FiveOneEat.UnauthorizedError}
136
+ * @throws {@link FiveOneEat.NotFoundError}
137
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
138
+ *
123
139
  * @example
124
- * await client.customer.stands.createPaymentIntent({
125
- * stand: "stand"
140
+ * await client.customer.stands.checkout({
141
+ * stand: "stand",
142
+ * body: {
143
+ * payment_intent_id: "payment_intent_id"
144
+ * }
126
145
  * })
127
146
  */
128
- createPaymentIntent(request, requestOptions) {
129
- return core.HttpResponsePromise.fromPromise(this.__createPaymentIntent(request, requestOptions));
147
+ checkout(request, requestOptions) {
148
+ return core.HttpResponsePromise.fromPromise(this.__checkout(request, requestOptions));
130
149
  }
131
- __createPaymentIntent(request, requestOptions) {
150
+ __checkout(request, requestOptions) {
132
151
  return __awaiter(this, void 0, void 0, function* () {
133
152
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
134
- const { stand } = request;
153
+ const { stand, body: _body } = request;
135
154
  const _authRequest = yield this._options.authProvider.getAuthRequest();
136
155
  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);
137
156
  const _response = yield core.fetcher({
138
- 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/stands/${core.url.encodePathParam(stand)}/payment-intent`),
157
+ 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/stands/${core.url.encodePathParam(stand)}/cart/checkout`),
139
158
  method: "POST",
140
159
  headers: _headers,
160
+ contentType: "application/json",
141
161
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
162
+ requestType: "json",
163
+ body: _body,
142
164
  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,
143
165
  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,
144
166
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -146,16 +168,28 @@ export class StandsClient {
146
168
  logging: this._options.logging,
147
169
  });
148
170
  if (_response.ok) {
149
- return { data: undefined, rawResponse: _response.rawResponse };
171
+ return {
172
+ data: _response.body,
173
+ rawResponse: _response.rawResponse,
174
+ };
150
175
  }
151
176
  if (_response.error.reason === "status-code") {
152
- throw new errors.FiveOneEatError({
153
- statusCode: _response.error.statusCode,
154
- body: _response.error.body,
155
- rawResponse: _response.rawResponse,
156
- });
177
+ switch (_response.error.statusCode) {
178
+ case 401:
179
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
180
+ case 404:
181
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
182
+ case 422:
183
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
184
+ default:
185
+ throw new errors.FiveOneEatError({
186
+ statusCode: _response.error.statusCode,
187
+ body: _response.error.body,
188
+ rawResponse: _response.rawResponse,
189
+ });
190
+ }
157
191
  }
158
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/payment-intent");
192
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/checkout");
159
193
  });
160
194
  }
161
195
  }
@@ -1,9 +1,15 @@
1
+ import type * as FiveOneEat from "../../../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
4
- * stand: "stand"
5
+ * stand: "stand",
6
+ * body: {
7
+ * payment_intent_id: "payment_intent_id"
8
+ * }
5
9
  * }
6
10
  */
7
11
  export interface CheckoutStandsRequest {
12
+ /** The stand ID */
8
13
  stand: string;
14
+ body: FiveOneEat.CheckoutRequest;
9
15
  }
@@ -5,5 +5,6 @@
5
5
  * }
6
6
  */
7
7
  export interface CreatePaymentIntentStandsRequest {
8
+ /** The stand ID */
8
9
  stand: string;
9
10
  }
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.mjs";
2
+ export interface CheckoutStandsResponse {
3
+ data: FiveOneEat.OrderResource;
4
+ }
@@ -0,0 +1,16 @@
1
+ export interface CreatePaymentIntentStandsResponse {
2
+ client_secret: string;
3
+ payment_intent_id: string;
4
+ subtotal: number;
5
+ tax_amount: number;
6
+ platform_fee: number;
7
+ total_amount: number;
8
+ amount: number;
9
+ currency: CreatePaymentIntentStandsResponse.Currency;
10
+ }
11
+ export declare namespace CreatePaymentIntentStandsResponse {
12
+ const Currency: {
13
+ readonly Usd: "usd";
14
+ };
15
+ type Currency = (typeof Currency)[keyof typeof Currency];
16
+ }
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var CreatePaymentIntentStandsResponse;
3
+ (function (CreatePaymentIntentStandsResponse) {
4
+ CreatePaymentIntentStandsResponse.Currency = {
5
+ Usd: "usd",
6
+ };
7
+ })(CreatePaymentIntentStandsResponse || (CreatePaymentIntentStandsResponse = {}));
@@ -1 +1,3 @@
1
+ export * from "./CheckoutStandsResponse.mjs";
2
+ export * from "./CreatePaymentIntentStandsResponse.mjs";
1
3
  export * from "./ScanStandsResponse.mjs";
@@ -1 +1,3 @@
1
+ export * from "./CheckoutStandsResponse.mjs";
2
+ export * from "./CreatePaymentIntentStandsResponse.mjs";
1
3
  export * from "./ScanStandsResponse.mjs";
@@ -55,36 +55,4 @@ export declare class CustomerStandsClient {
55
55
  */
56
56
  customerClearStandCart(request: FiveOneEat.CustomerClearStandCartRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<void>;
57
57
  private __customerClearStandCart;
58
- /**
59
- * @param {FiveOneEat.CustomerStandPaymentIntentRequest} request
60
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
61
- *
62
- * @throws {@link FiveOneEat.UnauthorizedError}
63
- * @throws {@link FiveOneEat.NotFoundError}
64
- *
65
- * @example
66
- * await client.customerStands.customerStandPaymentIntent({
67
- * stand: "stand"
68
- * })
69
- */
70
- customerStandPaymentIntent(request: FiveOneEat.CustomerStandPaymentIntentRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CustomerStandPaymentIntentResponse>;
71
- private __customerStandPaymentIntent;
72
- /**
73
- * @param {FiveOneEat.CustomerStandCheckoutRequest} request
74
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
75
- *
76
- * @throws {@link FiveOneEat.UnauthorizedError}
77
- * @throws {@link FiveOneEat.NotFoundError}
78
- * @throws {@link FiveOneEat.UnprocessableEntityError}
79
- *
80
- * @example
81
- * await client.customerStands.customerStandCheckout({
82
- * stand: "stand",
83
- * body: {
84
- * payment_intent_id: "payment_intent_id"
85
- * }
86
- * })
87
- */
88
- customerStandCheckout(request: FiveOneEat.CustomerStandCheckoutRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CustomerStandCheckoutResponse>;
89
- private __customerStandCheckout;
90
58
  }
@@ -200,123 +200,4 @@ export class CustomerStandsClient {
200
200
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/stands/{stand}/cart");
201
201
  });
202
202
  }
203
- /**
204
- * @param {FiveOneEat.CustomerStandPaymentIntentRequest} request
205
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
206
- *
207
- * @throws {@link FiveOneEat.UnauthorizedError}
208
- * @throws {@link FiveOneEat.NotFoundError}
209
- *
210
- * @example
211
- * await client.customerStands.customerStandPaymentIntent({
212
- * stand: "stand"
213
- * })
214
- */
215
- customerStandPaymentIntent(request, requestOptions) {
216
- return core.HttpResponsePromise.fromPromise(this.__customerStandPaymentIntent(request, requestOptions));
217
- }
218
- __customerStandPaymentIntent(request, requestOptions) {
219
- return __awaiter(this, void 0, void 0, function* () {
220
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
221
- const { stand } = request;
222
- const _authRequest = yield this._options.authProvider.getAuthRequest();
223
- 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);
224
- const _response = yield core.fetcher({
225
- 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/stands/${core.url.encodePathParam(stand)}/cart/payment-intent`),
226
- method: "POST",
227
- headers: _headers,
228
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
229
- 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,
230
- 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,
231
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
232
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
233
- logging: this._options.logging,
234
- });
235
- if (_response.ok) {
236
- return {
237
- data: _response.body,
238
- rawResponse: _response.rawResponse,
239
- };
240
- }
241
- if (_response.error.reason === "status-code") {
242
- switch (_response.error.statusCode) {
243
- case 401:
244
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
245
- case 404:
246
- throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
247
- default:
248
- throw new errors.FiveOneEatError({
249
- statusCode: _response.error.statusCode,
250
- body: _response.error.body,
251
- rawResponse: _response.rawResponse,
252
- });
253
- }
254
- }
255
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/payment-intent");
256
- });
257
- }
258
- /**
259
- * @param {FiveOneEat.CustomerStandCheckoutRequest} request
260
- * @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
261
- *
262
- * @throws {@link FiveOneEat.UnauthorizedError}
263
- * @throws {@link FiveOneEat.NotFoundError}
264
- * @throws {@link FiveOneEat.UnprocessableEntityError}
265
- *
266
- * @example
267
- * await client.customerStands.customerStandCheckout({
268
- * stand: "stand",
269
- * body: {
270
- * payment_intent_id: "payment_intent_id"
271
- * }
272
- * })
273
- */
274
- customerStandCheckout(request, requestOptions) {
275
- return core.HttpResponsePromise.fromPromise(this.__customerStandCheckout(request, requestOptions));
276
- }
277
- __customerStandCheckout(request, requestOptions) {
278
- return __awaiter(this, void 0, void 0, function* () {
279
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
280
- const { stand, body: _body } = request;
281
- const _authRequest = yield this._options.authProvider.getAuthRequest();
282
- 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);
283
- const _response = yield core.fetcher({
284
- 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/stands/${core.url.encodePathParam(stand)}/cart/checkout`),
285
- method: "POST",
286
- headers: _headers,
287
- contentType: "application/json",
288
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
289
- requestType: "json",
290
- body: _body,
291
- 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,
292
- 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,
293
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
294
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
295
- logging: this._options.logging,
296
- });
297
- if (_response.ok) {
298
- return {
299
- data: _response.body,
300
- rawResponse: _response.rawResponse,
301
- };
302
- }
303
- if (_response.error.reason === "status-code") {
304
- switch (_response.error.statusCode) {
305
- case 401:
306
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
307
- case 404:
308
- throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
309
- case 422:
310
- throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
311
- default:
312
- throw new errors.FiveOneEatError({
313
- statusCode: _response.error.statusCode,
314
- body: _response.error.body,
315
- rawResponse: _response.rawResponse,
316
- });
317
- }
318
- }
319
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart/checkout");
320
- });
321
- }
322
203
  }
@@ -1,5 +1,3 @@
1
1
  export type { CustomerAddStandCartItemRequest } from "./CustomerAddStandCartItemRequest.mjs";
2
2
  export type { CustomerClearStandCartRequest } from "./CustomerClearStandCartRequest.mjs";
3
3
  export type { CustomerGetStandCartRequest } from "./CustomerGetStandCartRequest.mjs";
4
- export type { CustomerStandCheckoutRequest } from "./CustomerStandCheckoutRequest.mjs";
5
- export type { CustomerStandPaymentIntentRequest } from "./CustomerStandPaymentIntentRequest.mjs";
@@ -1,4 +1,2 @@
1
1
  export * from "./CustomerAddStandCartItemResponse.mjs";
2
2
  export * from "./CustomerGetStandCartResponse.mjs";
3
- export * from "./CustomerStandCheckoutResponse.mjs";
4
- export * from "./CustomerStandPaymentIntentResponse.mjs";
@@ -1,4 +1,2 @@
1
1
  export * from "./CustomerAddStandCartItemResponse.mjs";
2
2
  export * from "./CustomerGetStandCartResponse.mjs";
3
- export * from "./CustomerStandCheckoutResponse.mjs";
4
- export * from "./CustomerStandPaymentIntentResponse.mjs";
@@ -4,7 +4,7 @@ export interface AppHttpResourcesApiV1BusinessCommerceProductResource {
4
4
  name: string;
5
5
  slug: string;
6
6
  description: string;
7
- is_active: string;
7
+ is_active: boolean;
8
8
  published_at: string;
9
9
  variants?: FiveOneEat.VariantResource[] | undefined;
10
10
  default_variant?: FiveOneEat.VariantResource | undefined;
@@ -2,7 +2,7 @@ export interface CartResource {
2
2
  id: string;
3
3
  items: CartResource.Items.Item[];
4
4
  subtotal_cents: number;
5
- subtotal: string;
5
+ subtotal: number;
6
6
  item_count: number;
7
7
  }
8
8
  export declare namespace CartResource {
@@ -1,7 +1,7 @@
1
1
  export interface InventoryLevelResource {
2
2
  id: string;
3
3
  sales_channel_id: string;
4
- quantity: string;
5
- tracks_inventory: string;
6
- allows_holds: string;
4
+ quantity: number;
5
+ tracks_inventory: boolean;
6
+ allows_holds: boolean;
7
7
  }
@@ -0,0 +1,10 @@
1
+ export interface OrderItemResource {
2
+ id: string;
3
+ variant_id: string;
4
+ product_name?: (string | null) | undefined;
5
+ variant_name?: string | undefined;
6
+ sku?: string | undefined;
7
+ quantity: number;
8
+ unit_price_cents: number;
9
+ total_cents: number;
10
+ }