@51eat/sdk 0.0.52 → 0.0.53

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 (104) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +17 -12
  4. package/dist/cjs/api/resources/businessShipping/client/Client.d.ts +138 -0
  5. package/dist/cjs/api/resources/businessShipping/client/Client.js +566 -0
  6. package/dist/cjs/api/resources/businessShipping/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/businessShipping/client/index.js +17 -0
  8. package/dist/cjs/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.d.ts +10 -0
  9. package/dist/cjs/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.js +3 -0
  10. package/dist/cjs/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.d.ts +12 -0
  11. package/dist/cjs/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.js +3 -0
  12. package/dist/cjs/api/resources/businessShipping/client/requests/StoreShippingRateRequest.d.ts +23 -0
  13. package/dist/cjs/api/resources/businessShipping/client/requests/StoreShippingRateRequest.js +11 -0
  14. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.d.ts +9 -0
  15. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.js +3 -0
  16. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.d.ts +26 -0
  17. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.js +11 -0
  18. package/dist/cjs/api/resources/businessShipping/client/requests/index.d.ts +5 -0
  19. package/dist/cjs/api/resources/businessShipping/client/requests/index.js +7 -0
  20. package/dist/cjs/api/resources/businessShipping/exports.d.ts +2 -0
  21. package/dist/cjs/api/resources/businessShipping/exports.js +21 -0
  22. package/dist/cjs/api/resources/businessShipping/index.d.ts +2 -0
  23. package/dist/cjs/api/resources/businessShipping/index.js +18 -0
  24. package/dist/cjs/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.d.ts +4 -0
  25. package/dist/cjs/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.js +3 -0
  26. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.d.ts +6 -0
  27. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.js +3 -0
  28. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.d.ts +3 -0
  29. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.js +3 -0
  30. package/dist/cjs/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.d.ts +4 -0
  31. package/dist/cjs/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.js +3 -0
  32. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.d.ts +4 -0
  33. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.js +3 -0
  34. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.d.ts +4 -0
  35. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.js +3 -0
  36. package/dist/cjs/api/resources/businessShipping/types/index.d.ts +6 -0
  37. package/dist/cjs/api/resources/businessShipping/types/index.js +22 -0
  38. package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +8 -8
  39. package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +8 -8
  40. package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.d.ts +2 -3
  41. package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.ts +7 -2
  42. package/dist/cjs/api/resources/index.d.ts +3 -0
  43. package/dist/cjs/api/resources/index.js +4 -1
  44. package/dist/cjs/api/types/ShippingAccountResource.d.ts +10 -0
  45. package/dist/cjs/api/types/ShippingAccountResource.js +3 -0
  46. package/dist/cjs/api/types/ShippingRateResource.d.ts +12 -0
  47. package/dist/cjs/api/types/ShippingRateResource.js +3 -0
  48. package/dist/cjs/api/types/index.d.ts +2 -0
  49. package/dist/cjs/api/types/index.js +2 -0
  50. package/dist/cjs/version.d.ts +1 -1
  51. package/dist/cjs/version.js +1 -1
  52. package/dist/esm/BaseClient.mjs +2 -2
  53. package/dist/esm/Client.d.mts +3 -0
  54. package/dist/esm/Client.mjs +5 -0
  55. package/dist/esm/api/resources/businessShipping/client/Client.d.mts +138 -0
  56. package/dist/esm/api/resources/businessShipping/client/Client.mjs +529 -0
  57. package/dist/esm/api/resources/businessShipping/client/index.d.mts +1 -0
  58. package/dist/esm/api/resources/businessShipping/client/index.mjs +1 -0
  59. package/dist/esm/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.d.mts +10 -0
  60. package/dist/esm/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.mjs +2 -0
  61. package/dist/esm/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.d.mts +12 -0
  62. package/dist/esm/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.mjs +2 -0
  63. package/dist/esm/api/resources/businessShipping/client/requests/StoreShippingRateRequest.d.mts +23 -0
  64. package/dist/esm/api/resources/businessShipping/client/requests/StoreShippingRateRequest.mjs +8 -0
  65. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.d.mts +9 -0
  66. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.mjs +2 -0
  67. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.d.mts +26 -0
  68. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.mjs +8 -0
  69. package/dist/esm/api/resources/businessShipping/client/requests/index.d.mts +5 -0
  70. package/dist/esm/api/resources/businessShipping/client/requests/index.mjs +2 -0
  71. package/dist/esm/api/resources/businessShipping/exports.d.mts +2 -0
  72. package/dist/esm/api/resources/businessShipping/exports.mjs +3 -0
  73. package/dist/esm/api/resources/businessShipping/index.d.mts +2 -0
  74. package/dist/esm/api/resources/businessShipping/index.mjs +2 -0
  75. package/dist/esm/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.d.mts +4 -0
  76. package/dist/esm/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.mjs +2 -0
  77. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.d.mts +6 -0
  78. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.mjs +2 -0
  79. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.d.mts +3 -0
  80. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.mjs +2 -0
  81. package/dist/esm/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.d.mts +4 -0
  82. package/dist/esm/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.mjs +2 -0
  83. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.d.mts +4 -0
  84. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.mjs +2 -0
  85. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.d.mts +4 -0
  86. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.mjs +2 -0
  87. package/dist/esm/api/resources/businessShipping/types/index.d.mts +6 -0
  88. package/dist/esm/api/resources/businessShipping/types/index.mjs +6 -0
  89. package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +8 -8
  90. package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +8 -8
  91. package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.d.mts +2 -3
  92. package/dist/esm/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.mts +7 -2
  93. package/dist/esm/api/resources/index.d.mts +3 -0
  94. package/dist/esm/api/resources/index.mjs +3 -0
  95. package/dist/esm/api/types/ShippingAccountResource.d.mts +10 -0
  96. package/dist/esm/api/types/ShippingAccountResource.mjs +2 -0
  97. package/dist/esm/api/types/ShippingRateResource.d.mts +12 -0
  98. package/dist/esm/api/types/ShippingRateResource.mjs +2 -0
  99. package/dist/esm/api/types/index.d.mts +2 -0
  100. package/dist/esm/api/types/index.mjs +2 -0
  101. package/dist/esm/version.d.mts +1 -1
  102. package/dist/esm/version.mjs +1 -1
  103. package/package.json +12 -1
  104. package/reference.md +460 -8
@@ -0,0 +1,566 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.BusinessShippingClient = void 0;
58
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
59
+ const headers_js_1 = require("../../../../core/headers.js");
60
+ const core = __importStar(require("../../../../core/index.js"));
61
+ const environments = __importStar(require("../../../../environments.js"));
62
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
63
+ const errors = __importStar(require("../../../../errors/index.js"));
64
+ const FiveOneEat = __importStar(require("../../../index.js"));
65
+ class BusinessShippingClient {
66
+ constructor(options = {}) {
67
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
+ }
69
+ /**
70
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
71
+ *
72
+ * @throws {@link FiveOneEat.UnauthorizedError}
73
+ *
74
+ * @example
75
+ * await client.businessShipping.getBusinessShippingAccount()
76
+ */
77
+ getBusinessShippingAccount(requestOptions) {
78
+ return core.HttpResponsePromise.fromPromise(this.__getBusinessShippingAccount(requestOptions));
79
+ }
80
+ __getBusinessShippingAccount(requestOptions) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
83
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
84
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
85
+ const _response = yield core.fetcher({
86
+ 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, "business/shipping"),
87
+ method: "GET",
88
+ headers: _headers,
89
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
90
+ 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,
91
+ 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,
92
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
93
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
94
+ logging: this._options.logging,
95
+ });
96
+ if (_response.ok) {
97
+ return {
98
+ data: _response.body,
99
+ rawResponse: _response.rawResponse,
100
+ };
101
+ }
102
+ if (_response.error.reason === "status-code") {
103
+ switch (_response.error.statusCode) {
104
+ case 401:
105
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
106
+ default:
107
+ throw new errors.FiveOneEatError({
108
+ statusCode: _response.error.statusCode,
109
+ body: _response.error.body,
110
+ rawResponse: _response.rawResponse,
111
+ });
112
+ }
113
+ }
114
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/shipping");
115
+ });
116
+ }
117
+ /**
118
+ * Use the returned client_secret with the Stripe mobile SDK to collect
119
+ * a payment method for label billing. Pass the resulting pm_* ID to
120
+ * POST /shipping/account.
121
+ *
122
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
123
+ *
124
+ * @throws {@link FiveOneEat.UnauthorizedError}
125
+ *
126
+ * @example
127
+ * await client.businessShipping.getBusinessShippingSetupIntent()
128
+ */
129
+ getBusinessShippingSetupIntent(requestOptions) {
130
+ return core.HttpResponsePromise.fromPromise(this.__getBusinessShippingSetupIntent(requestOptions));
131
+ }
132
+ __getBusinessShippingSetupIntent(requestOptions) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
135
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
136
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
137
+ 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, "business/shipping/setup-intent"),
139
+ method: "GET",
140
+ headers: _headers,
141
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
142
+ 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
+ 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
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
145
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
146
+ logging: this._options.logging,
147
+ });
148
+ if (_response.ok) {
149
+ return {
150
+ data: _response.body,
151
+ rawResponse: _response.rawResponse,
152
+ };
153
+ }
154
+ if (_response.error.reason === "status-code") {
155
+ switch (_response.error.statusCode) {
156
+ case 401:
157
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
158
+ default:
159
+ throw new errors.FiveOneEatError({
160
+ statusCode: _response.error.statusCode,
161
+ body: _response.error.body,
162
+ rawResponse: _response.rawResponse,
163
+ });
164
+ }
165
+ }
166
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/shipping/setup-intent");
167
+ });
168
+ }
169
+ /**
170
+ * Creates a Stripe Customer for label billing, attaches the provided
171
+ * payment method, and upserts the ShippingAccount record.
172
+ *
173
+ * @param {FiveOneEat.SetupShippingAccountRequest} request
174
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
175
+ *
176
+ * @throws {@link FiveOneEat.UnauthorizedError}
177
+ * @throws {@link FiveOneEat.ForbiddenError}
178
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
179
+ *
180
+ * @example
181
+ * await client.businessShipping.setupBusinessShippingAccount({
182
+ * payment_method_id: "payment_method_id"
183
+ * })
184
+ */
185
+ setupBusinessShippingAccount(request, requestOptions) {
186
+ return core.HttpResponsePromise.fromPromise(this.__setupBusinessShippingAccount(request, requestOptions));
187
+ }
188
+ __setupBusinessShippingAccount(request, requestOptions) {
189
+ return __awaiter(this, void 0, void 0, function* () {
190
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
191
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
192
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
193
+ const _response = yield core.fetcher({
194
+ 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, "business/shipping/account"),
195
+ method: "POST",
196
+ headers: _headers,
197
+ contentType: "application/json",
198
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
199
+ requestType: "json",
200
+ body: request,
201
+ 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,
202
+ 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,
203
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
204
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
205
+ logging: this._options.logging,
206
+ });
207
+ if (_response.ok) {
208
+ return { data: _response.body, rawResponse: _response.rawResponse };
209
+ }
210
+ if (_response.error.reason === "status-code") {
211
+ switch (_response.error.statusCode) {
212
+ case 401:
213
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
214
+ case 403:
215
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
216
+ case 422:
217
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
218
+ default:
219
+ throw new errors.FiveOneEatError({
220
+ statusCode: _response.error.statusCode,
221
+ body: _response.error.body,
222
+ rawResponse: _response.rawResponse,
223
+ });
224
+ }
225
+ }
226
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/shipping/account");
227
+ });
228
+ }
229
+ /**
230
+ * @param {FiveOneEat.UpdateShippingAccountRequest} request
231
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
232
+ *
233
+ * @throws {@link FiveOneEat.UnauthorizedError}
234
+ * @throws {@link FiveOneEat.ForbiddenError}
235
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
236
+ *
237
+ * @example
238
+ * await client.businessShipping.updateBusinessShippingAccount()
239
+ */
240
+ updateBusinessShippingAccount(request = {}, requestOptions) {
241
+ return core.HttpResponsePromise.fromPromise(this.__updateBusinessShippingAccount(request, requestOptions));
242
+ }
243
+ __updateBusinessShippingAccount() {
244
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
245
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
246
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
247
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
248
+ const _response = yield core.fetcher({
249
+ 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, "business/shipping/account"),
250
+ method: "PUT",
251
+ headers: _headers,
252
+ contentType: "application/json",
253
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
254
+ requestType: "json",
255
+ body: request,
256
+ 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,
257
+ 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,
258
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
259
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
260
+ logging: this._options.logging,
261
+ });
262
+ if (_response.ok) {
263
+ return {
264
+ data: _response.body,
265
+ rawResponse: _response.rawResponse,
266
+ };
267
+ }
268
+ if (_response.error.reason === "status-code") {
269
+ switch (_response.error.statusCode) {
270
+ case 401:
271
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
272
+ case 403:
273
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
274
+ case 422:
275
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
276
+ default:
277
+ throw new errors.FiveOneEatError({
278
+ statusCode: _response.error.statusCode,
279
+ body: _response.error.body,
280
+ rawResponse: _response.rawResponse,
281
+ });
282
+ }
283
+ }
284
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/shipping/account");
285
+ });
286
+ }
287
+ /**
288
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
289
+ *
290
+ * @throws {@link FiveOneEat.UnauthorizedError}
291
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
292
+ *
293
+ * @example
294
+ * await client.businessShipping.deleteBusinessShippingAccount()
295
+ */
296
+ deleteBusinessShippingAccount(requestOptions) {
297
+ return core.HttpResponsePromise.fromPromise(this.__deleteBusinessShippingAccount(requestOptions));
298
+ }
299
+ __deleteBusinessShippingAccount(requestOptions) {
300
+ return __awaiter(this, void 0, void 0, function* () {
301
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
302
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
303
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
304
+ const _response = yield core.fetcher({
305
+ 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, "business/shipping/account"),
306
+ method: "DELETE",
307
+ headers: _headers,
308
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
309
+ 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,
310
+ 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,
311
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
312
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
313
+ logging: this._options.logging,
314
+ });
315
+ if (_response.ok) {
316
+ return { data: undefined, rawResponse: _response.rawResponse };
317
+ }
318
+ if (_response.error.reason === "status-code") {
319
+ switch (_response.error.statusCode) {
320
+ case 401:
321
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
322
+ case 422:
323
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
324
+ default:
325
+ throw new errors.FiveOneEatError({
326
+ statusCode: _response.error.statusCode,
327
+ body: _response.error.body,
328
+ rawResponse: _response.rawResponse,
329
+ });
330
+ }
331
+ }
332
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/shipping/account");
333
+ });
334
+ }
335
+ /**
336
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
337
+ *
338
+ * @throws {@link FiveOneEat.UnauthorizedError}
339
+ *
340
+ * @example
341
+ * await client.businessShipping.listBusinessShippingRates()
342
+ */
343
+ listBusinessShippingRates(requestOptions) {
344
+ return core.HttpResponsePromise.fromPromise(this.__listBusinessShippingRates(requestOptions));
345
+ }
346
+ __listBusinessShippingRates(requestOptions) {
347
+ return __awaiter(this, void 0, void 0, function* () {
348
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
349
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
350
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
351
+ const _response = yield core.fetcher({
352
+ 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, "business/shipping/rates"),
353
+ method: "GET",
354
+ headers: _headers,
355
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
356
+ 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,
357
+ 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,
358
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
359
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
360
+ logging: this._options.logging,
361
+ });
362
+ if (_response.ok) {
363
+ return {
364
+ data: _response.body,
365
+ rawResponse: _response.rawResponse,
366
+ };
367
+ }
368
+ if (_response.error.reason === "status-code") {
369
+ switch (_response.error.statusCode) {
370
+ case 401:
371
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
372
+ default:
373
+ throw new errors.FiveOneEatError({
374
+ statusCode: _response.error.statusCode,
375
+ body: _response.error.body,
376
+ rawResponse: _response.rawResponse,
377
+ });
378
+ }
379
+ }
380
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/shipping/rates");
381
+ });
382
+ }
383
+ /**
384
+ * @param {FiveOneEat.StoreShippingRateRequest} request
385
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
386
+ *
387
+ * @throws {@link FiveOneEat.UnauthorizedError}
388
+ * @throws {@link FiveOneEat.ForbiddenError}
389
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
390
+ *
391
+ * @example
392
+ * await client.businessShipping.createBusinessShippingRate({
393
+ * name: "name",
394
+ * rate_type: "flat"
395
+ * })
396
+ */
397
+ createBusinessShippingRate(request, requestOptions) {
398
+ return core.HttpResponsePromise.fromPromise(this.__createBusinessShippingRate(request, requestOptions));
399
+ }
400
+ __createBusinessShippingRate(request, requestOptions) {
401
+ return __awaiter(this, void 0, void 0, function* () {
402
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
403
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
404
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
405
+ const _response = yield core.fetcher({
406
+ 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, "business/shipping/rates"),
407
+ method: "POST",
408
+ headers: _headers,
409
+ contentType: "application/json",
410
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
411
+ requestType: "json",
412
+ body: request,
413
+ 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,
414
+ 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,
415
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
416
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
417
+ logging: this._options.logging,
418
+ });
419
+ if (_response.ok) {
420
+ return {
421
+ data: _response.body,
422
+ rawResponse: _response.rawResponse,
423
+ };
424
+ }
425
+ if (_response.error.reason === "status-code") {
426
+ switch (_response.error.statusCode) {
427
+ case 401:
428
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
429
+ case 403:
430
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
431
+ case 422:
432
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
433
+ default:
434
+ throw new errors.FiveOneEatError({
435
+ statusCode: _response.error.statusCode,
436
+ body: _response.error.body,
437
+ rawResponse: _response.rawResponse,
438
+ });
439
+ }
440
+ }
441
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/shipping/rates");
442
+ });
443
+ }
444
+ /**
445
+ * @param {FiveOneEat.UpdateShippingRateRequest} request
446
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
447
+ *
448
+ * @throws {@link FiveOneEat.UnauthorizedError}
449
+ * @throws {@link FiveOneEat.ForbiddenError}
450
+ * @throws {@link FiveOneEat.NotFoundError}
451
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
452
+ *
453
+ * @example
454
+ * await client.businessShipping.updateBusinessShippingRate({
455
+ * shippingRate: "shippingRate",
456
+ * name: "name",
457
+ * rate_type: "flat"
458
+ * })
459
+ */
460
+ updateBusinessShippingRate(request, requestOptions) {
461
+ return core.HttpResponsePromise.fromPromise(this.__updateBusinessShippingRate(request, requestOptions));
462
+ }
463
+ __updateBusinessShippingRate(request, requestOptions) {
464
+ return __awaiter(this, void 0, void 0, function* () {
465
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
466
+ const { shippingRate } = request, _body = __rest(request, ["shippingRate"]);
467
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
468
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
469
+ const _response = yield core.fetcher({
470
+ 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, `business/shipping/rates/${core.url.encodePathParam(shippingRate)}`),
471
+ method: "PUT",
472
+ headers: _headers,
473
+ contentType: "application/json",
474
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
475
+ requestType: "json",
476
+ body: _body,
477
+ 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,
478
+ 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,
479
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
480
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
481
+ logging: this._options.logging,
482
+ });
483
+ if (_response.ok) {
484
+ return {
485
+ data: _response.body,
486
+ rawResponse: _response.rawResponse,
487
+ };
488
+ }
489
+ if (_response.error.reason === "status-code") {
490
+ switch (_response.error.statusCode) {
491
+ case 401:
492
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
493
+ case 403:
494
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
495
+ case 404:
496
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
497
+ case 422:
498
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
499
+ default:
500
+ throw new errors.FiveOneEatError({
501
+ statusCode: _response.error.statusCode,
502
+ body: _response.error.body,
503
+ rawResponse: _response.rawResponse,
504
+ });
505
+ }
506
+ }
507
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/shipping/rates/{shippingRate}");
508
+ });
509
+ }
510
+ /**
511
+ * @param {FiveOneEat.DeleteBusinessShippingRateRequest} request
512
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
513
+ *
514
+ * @throws {@link FiveOneEat.UnauthorizedError}
515
+ * @throws {@link FiveOneEat.ForbiddenError}
516
+ * @throws {@link FiveOneEat.NotFoundError}
517
+ *
518
+ * @example
519
+ * await client.businessShipping.deleteBusinessShippingRate({
520
+ * shippingRate: "shippingRate"
521
+ * })
522
+ */
523
+ deleteBusinessShippingRate(request, requestOptions) {
524
+ return core.HttpResponsePromise.fromPromise(this.__deleteBusinessShippingRate(request, requestOptions));
525
+ }
526
+ __deleteBusinessShippingRate(request, requestOptions) {
527
+ return __awaiter(this, void 0, void 0, function* () {
528
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
529
+ const { shippingRate } = request;
530
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
531
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
532
+ const _response = yield core.fetcher({
533
+ 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, `business/shipping/rates/${core.url.encodePathParam(shippingRate)}`),
534
+ method: "DELETE",
535
+ headers: _headers,
536
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
537
+ 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,
538
+ 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,
539
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
540
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
541
+ logging: this._options.logging,
542
+ });
543
+ if (_response.ok) {
544
+ return { data: undefined, rawResponse: _response.rawResponse };
545
+ }
546
+ if (_response.error.reason === "status-code") {
547
+ switch (_response.error.statusCode) {
548
+ case 401:
549
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
550
+ case 403:
551
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
552
+ case 404:
553
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
554
+ default:
555
+ throw new errors.FiveOneEatError({
556
+ statusCode: _response.error.statusCode,
557
+ body: _response.error.body,
558
+ rawResponse: _response.rawResponse,
559
+ });
560
+ }
561
+ }
562
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/shipping/rates/{shippingRate}");
563
+ });
564
+ }
565
+ }
566
+ exports.BusinessShippingClient = BusinessShippingClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
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("./requests/index.js"), exports);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * shippingRate: "shippingRate"
5
+ * }
6
+ */
7
+ export interface DeleteBusinessShippingRateRequest {
8
+ /** The shipping rate ID */
9
+ shippingRate: string;
10
+ }
@@ -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
+ /**
2
+ * @example
3
+ * {
4
+ * payment_method_id: "payment_method_id"
5
+ * }
6
+ */
7
+ export interface SetupShippingAccountRequest {
8
+ payment_method_id: string;
9
+ ship_from_name?: string | null;
10
+ ship_from_phone?: string | null;
11
+ live_rates_enabled?: boolean;
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 });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * name: "name",
5
+ * rate_type: "flat"
6
+ * }
7
+ */
8
+ export interface StoreShippingRateRequest {
9
+ name: string;
10
+ rate_type: StoreShippingRateRequest.RateType;
11
+ flat_rate?: number | null;
12
+ free_shipping_threshold?: number | null;
13
+ estimated_days_min?: number | null;
14
+ estimated_days_max?: number | null;
15
+ is_active?: boolean;
16
+ }
17
+ export declare namespace StoreShippingRateRequest {
18
+ const RateType: {
19
+ readonly Flat: "flat";
20
+ readonly Free: "free";
21
+ };
22
+ type RateType = (typeof RateType)[keyof typeof RateType];
23
+ }