@51eat/sdk 0.0.51 → 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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +17 -12
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +33 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +123 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/productOrders/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/productOrders/types/index.js +1 -0
- package/dist/cjs/api/resources/businessShipping/client/Client.d.ts +138 -0
- package/dist/cjs/api/resources/businessShipping/client/Client.js +566 -0
- package/dist/cjs/api/resources/businessShipping/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/businessShipping/client/index.js +17 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.d.ts +10 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.js +3 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.d.ts +12 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.js +3 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/StoreShippingRateRequest.d.ts +23 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/StoreShippingRateRequest.js +11 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.d.ts +9 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.js +3 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.d.ts +26 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.js +11 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/businessShipping/client/requests/index.js +7 -0
- package/dist/cjs/api/resources/businessShipping/exports.d.ts +2 -0
- package/dist/cjs/api/resources/businessShipping/exports.js +21 -0
- package/dist/cjs/api/resources/businessShipping/index.d.ts +2 -0
- package/dist/cjs/api/resources/businessShipping/index.js +18 -0
- package/dist/cjs/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.d.ts +4 -0
- package/dist/cjs/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.js +3 -0
- package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.d.ts +6 -0
- package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.js +3 -0
- package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.d.ts +3 -0
- package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.js +3 -0
- package/dist/cjs/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.js +3 -0
- package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.d.ts +4 -0
- package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.js +3 -0
- package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.d.ts +4 -0
- package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.js +3 -0
- package/dist/cjs/api/resources/businessShipping/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/businessShipping/types/index.js +22 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +44 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +131 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.d.ts +28 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.ts +11 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/index.js +1 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/types/ShippingAccountResource.d.ts +10 -0
- package/dist/cjs/api/types/ShippingAccountResource.js +3 -0
- package/dist/cjs/api/types/ShippingRateResource.d.ts +12 -0
- package/dist/cjs/api/types/ShippingRateResource.js +3 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +33 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +123 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/productOrders/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/productOrders/types/index.mjs +1 -0
- package/dist/esm/api/resources/businessShipping/client/Client.d.mts +138 -0
- package/dist/esm/api/resources/businessShipping/client/Client.mjs +529 -0
- package/dist/esm/api/resources/businessShipping/client/index.d.mts +1 -0
- package/dist/esm/api/resources/businessShipping/client/index.mjs +1 -0
- package/dist/esm/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.d.mts +10 -0
- package/dist/esm/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.d.mts +12 -0
- package/dist/esm/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/client/requests/StoreShippingRateRequest.d.mts +23 -0
- package/dist/esm/api/resources/businessShipping/client/requests/StoreShippingRateRequest.mjs +8 -0
- package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.d.mts +9 -0
- package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.d.mts +26 -0
- package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.mjs +8 -0
- package/dist/esm/api/resources/businessShipping/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/businessShipping/client/requests/index.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/exports.d.mts +2 -0
- package/dist/esm/api/resources/businessShipping/exports.mjs +3 -0
- package/dist/esm/api/resources/businessShipping/index.d.mts +2 -0
- package/dist/esm/api/resources/businessShipping/index.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.d.mts +4 -0
- package/dist/esm/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.d.mts +6 -0
- package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.d.mts +3 -0
- package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.d.mts +4 -0
- package/dist/esm/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.d.mts +4 -0
- package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.d.mts +4 -0
- package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.mjs +2 -0
- package/dist/esm/api/resources/businessShipping/types/index.d.mts +6 -0
- package/dist/esm/api/resources/businessShipping/types/index.mjs +6 -0
- package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +44 -0
- package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +131 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.d.mts +28 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.d.mts +12 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.mts +11 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/index.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/cart/types/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/types/ShippingAccountResource.d.mts +10 -0
- package/dist/esm/api/types/ShippingAccountResource.mjs +2 -0
- package/dist/esm/api/types/ShippingRateResource.d.mts +12 -0
- package/dist/esm/api/types/ShippingRateResource.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +696 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.StoreShippingRateRequest = void 0;
|
|
5
|
+
var StoreShippingRateRequest;
|
|
6
|
+
(function (StoreShippingRateRequest) {
|
|
7
|
+
StoreShippingRateRequest.RateType = {
|
|
8
|
+
Flat: "flat",
|
|
9
|
+
Free: "free",
|
|
10
|
+
};
|
|
11
|
+
})(StoreShippingRateRequest || (exports.StoreShippingRateRequest = StoreShippingRateRequest = {}));
|
package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* shippingRate: "shippingRate",
|
|
5
|
+
* name: "name",
|
|
6
|
+
* rate_type: "flat"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface UpdateShippingRateRequest {
|
|
10
|
+
/** The shipping rate ID */
|
|
11
|
+
shippingRate: string;
|
|
12
|
+
name: string;
|
|
13
|
+
rate_type: UpdateShippingRateRequest.RateType;
|
|
14
|
+
flat_rate?: number | null;
|
|
15
|
+
free_shipping_threshold?: number | null;
|
|
16
|
+
estimated_days_min?: number | null;
|
|
17
|
+
estimated_days_max?: number | null;
|
|
18
|
+
is_active?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace UpdateShippingRateRequest {
|
|
21
|
+
const RateType: {
|
|
22
|
+
readonly Flat: "flat";
|
|
23
|
+
readonly Free: "free";
|
|
24
|
+
};
|
|
25
|
+
type RateType = (typeof RateType)[keyof typeof RateType];
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.UpdateShippingRateRequest = void 0;
|
|
5
|
+
var UpdateShippingRateRequest;
|
|
6
|
+
(function (UpdateShippingRateRequest) {
|
|
7
|
+
UpdateShippingRateRequest.RateType = {
|
|
8
|
+
Flat: "flat",
|
|
9
|
+
Free: "free",
|
|
10
|
+
};
|
|
11
|
+
})(UpdateShippingRateRequest || (exports.UpdateShippingRateRequest = UpdateShippingRateRequest = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { DeleteBusinessShippingRateRequest } from "./DeleteBusinessShippingRateRequest.js";
|
|
2
|
+
export type { SetupShippingAccountRequest } from "./SetupShippingAccountRequest.js";
|
|
3
|
+
export { StoreShippingRateRequest } from "./StoreShippingRateRequest.js";
|
|
4
|
+
export type { UpdateShippingAccountRequest } from "./UpdateShippingAccountRequest.js";
|
|
5
|
+
export { UpdateShippingRateRequest } from "./UpdateShippingRateRequest.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateShippingRateRequest = exports.StoreShippingRateRequest = void 0;
|
|
4
|
+
var StoreShippingRateRequest_js_1 = require("./StoreShippingRateRequest.js");
|
|
5
|
+
Object.defineProperty(exports, "StoreShippingRateRequest", { enumerable: true, get: function () { return StoreShippingRateRequest_js_1.StoreShippingRateRequest; } });
|
|
6
|
+
var UpdateShippingRateRequest_js_1 = require("./UpdateShippingRateRequest.js");
|
|
7
|
+
Object.defineProperty(exports, "UpdateShippingRateRequest", { enumerable: true, get: function () { return UpdateShippingRateRequest_js_1.UpdateShippingRateRequest; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.BusinessShippingClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "BusinessShippingClient", { enumerable: true, get: function () { return Client_js_1.BusinessShippingClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./CreateBusinessShippingRateResponse.js";
|
|
2
|
+
export * from "./GetBusinessShippingAccountResponse.js";
|
|
3
|
+
export * from "./GetBusinessShippingSetupIntentResponse.js";
|
|
4
|
+
export * from "./ListBusinessShippingRatesResponse.js";
|
|
5
|
+
export * from "./UpdateBusinessShippingAccountResponse.js";
|
|
6
|
+
export * from "./UpdateBusinessShippingRateResponse.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./CreateBusinessShippingRateResponse.js"), exports);
|
|
18
|
+
__exportStar(require("./GetBusinessShippingAccountResponse.js"), exports);
|
|
19
|
+
__exportStar(require("./GetBusinessShippingSetupIntentResponse.js"), exports);
|
|
20
|
+
__exportStar(require("./ListBusinessShippingRatesResponse.js"), exports);
|
|
21
|
+
__exportStar(require("./UpdateBusinessShippingAccountResponse.js"), exports);
|
|
22
|
+
__exportStar(require("./UpdateBusinessShippingRateResponse.js"), exports);
|
|
@@ -132,4 +132,48 @@ export declare class CartClient {
|
|
|
132
132
|
*/
|
|
133
133
|
removeItem(request: FiveOneEat.customer.RemoveItemCartRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.RemoveItemCartResponse>;
|
|
134
134
|
private __removeItem;
|
|
135
|
+
/**
|
|
136
|
+
* Returns flat/free rates and live carrier rates (if enabled) for the given address.
|
|
137
|
+
* Free-shipping thresholds are applied automatically — qualifying rates show as $0.
|
|
138
|
+
* Cache live rates for 10 minutes per address/cart combination.
|
|
139
|
+
* Pass `shipping_rate_id` for flat/free options, or `provider_rate_id` for live rates.
|
|
140
|
+
*
|
|
141
|
+
* @param {FiveOneEat.customer.GetShippingOptionsRequest} request
|
|
142
|
+
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
143
|
+
*
|
|
144
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
145
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* await client.customer.cart.getShippingOptions({
|
|
149
|
+
* business: "katzs-deli",
|
|
150
|
+
* shipping_address: {
|
|
151
|
+
* line1: "line1",
|
|
152
|
+
* city: "city",
|
|
153
|
+
* state: "state",
|
|
154
|
+
* postal_code: "postal_code"
|
|
155
|
+
* }
|
|
156
|
+
* })
|
|
157
|
+
*/
|
|
158
|
+
getShippingOptions(request: FiveOneEat.customer.GetShippingOptionsRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<unknown[]>;
|
|
159
|
+
private __getShippingOptions;
|
|
160
|
+
/**
|
|
161
|
+
* Pass either `shipping_rate_id` (for flat/free rates) or `provider_rate_id`
|
|
162
|
+
* (for live carrier rates). Never both. Amounts are resolved server-side —
|
|
163
|
+
* the client never submits a price.
|
|
164
|
+
*
|
|
165
|
+
* @param {FiveOneEat.customer.SelectShippingOptionRequest} request
|
|
166
|
+
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
167
|
+
*
|
|
168
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
169
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
170
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* await client.customer.cart.selectShippingOption({
|
|
174
|
+
* business: "katzs-deli"
|
|
175
|
+
* })
|
|
176
|
+
*/
|
|
177
|
+
selectShippingOption(request: FiveOneEat.customer.SelectShippingOptionRequest, requestOptions?: CartClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.SelectShippingOptionCartResponse>;
|
|
178
|
+
private __selectShippingOption;
|
|
135
179
|
}
|
|
@@ -486,5 +486,136 @@ class CartClient {
|
|
|
486
486
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/cart/items/{cartItem}");
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
+
/**
|
|
490
|
+
* Returns flat/free rates and live carrier rates (if enabled) for the given address.
|
|
491
|
+
* Free-shipping thresholds are applied automatically — qualifying rates show as $0.
|
|
492
|
+
* Cache live rates for 10 minutes per address/cart combination.
|
|
493
|
+
* Pass `shipping_rate_id` for flat/free options, or `provider_rate_id` for live rates.
|
|
494
|
+
*
|
|
495
|
+
* @param {FiveOneEat.customer.GetShippingOptionsRequest} request
|
|
496
|
+
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
497
|
+
*
|
|
498
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
499
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* await client.customer.cart.getShippingOptions({
|
|
503
|
+
* business: "katzs-deli",
|
|
504
|
+
* shipping_address: {
|
|
505
|
+
* line1: "line1",
|
|
506
|
+
* city: "city",
|
|
507
|
+
* state: "state",
|
|
508
|
+
* postal_code: "postal_code"
|
|
509
|
+
* }
|
|
510
|
+
* })
|
|
511
|
+
*/
|
|
512
|
+
getShippingOptions(request, requestOptions) {
|
|
513
|
+
return core.HttpResponsePromise.fromPromise(this.__getShippingOptions(request, requestOptions));
|
|
514
|
+
}
|
|
515
|
+
__getShippingOptions(request, requestOptions) {
|
|
516
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
517
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
518
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
519
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
520
|
+
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);
|
|
521
|
+
const _response = yield core.fetcher({
|
|
522
|
+
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)}/cart/shipping-options`),
|
|
523
|
+
method: "POST",
|
|
524
|
+
headers: _headers,
|
|
525
|
+
contentType: "application/json",
|
|
526
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
527
|
+
requestType: "json",
|
|
528
|
+
body: _body,
|
|
529
|
+
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,
|
|
530
|
+
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,
|
|
531
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
532
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
533
|
+
logging: this._options.logging,
|
|
534
|
+
});
|
|
535
|
+
if (_response.ok) {
|
|
536
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
537
|
+
}
|
|
538
|
+
if (_response.error.reason === "status-code") {
|
|
539
|
+
switch (_response.error.statusCode) {
|
|
540
|
+
case 401:
|
|
541
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
542
|
+
case 422:
|
|
543
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
544
|
+
default:
|
|
545
|
+
throw new errors.FiveOneEatError({
|
|
546
|
+
statusCode: _response.error.statusCode,
|
|
547
|
+
body: _response.error.body,
|
|
548
|
+
rawResponse: _response.rawResponse,
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart/shipping-options");
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Pass either `shipping_rate_id` (for flat/free rates) or `provider_rate_id`
|
|
557
|
+
* (for live carrier rates). Never both. Amounts are resolved server-side —
|
|
558
|
+
* the client never submits a price.
|
|
559
|
+
*
|
|
560
|
+
* @param {FiveOneEat.customer.SelectShippingOptionRequest} request
|
|
561
|
+
* @param {CartClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
562
|
+
*
|
|
563
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
564
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
565
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
566
|
+
*
|
|
567
|
+
* @example
|
|
568
|
+
* await client.customer.cart.selectShippingOption({
|
|
569
|
+
* business: "katzs-deli"
|
|
570
|
+
* })
|
|
571
|
+
*/
|
|
572
|
+
selectShippingOption(request, requestOptions) {
|
|
573
|
+
return core.HttpResponsePromise.fromPromise(this.__selectShippingOption(request, requestOptions));
|
|
574
|
+
}
|
|
575
|
+
__selectShippingOption(request, requestOptions) {
|
|
576
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
577
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
578
|
+
const { business } = request, _body = __rest(request, ["business"]);
|
|
579
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
580
|
+
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);
|
|
581
|
+
const _response = yield core.fetcher({
|
|
582
|
+
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)}/cart/shipping-option`),
|
|
583
|
+
method: "POST",
|
|
584
|
+
headers: _headers,
|
|
585
|
+
contentType: "application/json",
|
|
586
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
587
|
+
requestType: "json",
|
|
588
|
+
body: _body,
|
|
589
|
+
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,
|
|
590
|
+
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,
|
|
591
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
592
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
593
|
+
logging: this._options.logging,
|
|
594
|
+
});
|
|
595
|
+
if (_response.ok) {
|
|
596
|
+
return {
|
|
597
|
+
data: _response.body,
|
|
598
|
+
rawResponse: _response.rawResponse,
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
if (_response.error.reason === "status-code") {
|
|
602
|
+
switch (_response.error.statusCode) {
|
|
603
|
+
case 401:
|
|
604
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
605
|
+
case 404:
|
|
606
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
607
|
+
case 422:
|
|
608
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
609
|
+
default:
|
|
610
|
+
throw new errors.FiveOneEatError({
|
|
611
|
+
statusCode: _response.error.statusCode,
|
|
612
|
+
body: _response.error.body,
|
|
613
|
+
rawResponse: _response.rawResponse,
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/businesses/{business}/cart/shipping-option");
|
|
618
|
+
});
|
|
619
|
+
}
|
|
489
620
|
}
|
|
490
621
|
exports.CartClient = CartClient;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* business: "katzs-deli",
|
|
5
|
+
* shipping_address: {
|
|
6
|
+
* line1: "line1",
|
|
7
|
+
* city: "city",
|
|
8
|
+
* state: "state",
|
|
9
|
+
* postal_code: "postal_code"
|
|
10
|
+
* }
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export interface GetShippingOptionsRequest {
|
|
14
|
+
/** The business handle */
|
|
15
|
+
business: string;
|
|
16
|
+
shipping_address: GetShippingOptionsRequest.ShippingAddress;
|
|
17
|
+
}
|
|
18
|
+
export declare namespace GetShippingOptionsRequest {
|
|
19
|
+
interface ShippingAddress {
|
|
20
|
+
name?: (string | null) | undefined;
|
|
21
|
+
line1: string;
|
|
22
|
+
line2?: (string | null) | undefined;
|
|
23
|
+
city: string;
|
|
24
|
+
state: string;
|
|
25
|
+
postal_code: string;
|
|
26
|
+
country?: (string | null) | undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -3,5 +3,7 @@ export { CheckoutRequest } from "./CheckoutRequest.js";
|
|
|
3
3
|
export type { ClearCartRequest } from "./ClearCartRequest.js";
|
|
4
4
|
export { CreatePaymentIntentRequest } from "./CreatePaymentIntentRequest.js";
|
|
5
5
|
export type { GetCartRequest } from "./GetCartRequest.js";
|
|
6
|
+
export type { GetShippingOptionsRequest } from "./GetShippingOptionsRequest.js";
|
|
6
7
|
export type { RemoveItemCartRequest } from "./RemoveItemCartRequest.js";
|
|
8
|
+
export type { SelectShippingOptionRequest } from "./SelectShippingOptionRequest.js";
|
|
7
9
|
export type { UpdateCartItemRequest } from "./UpdateCartItemRequest.js";
|
package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type SelectShippingOptionCartResponse = {
|
|
2
|
+
shipping_amount: string;
|
|
3
|
+
shipping_amount_cents: number;
|
|
4
|
+
shipping_method: string;
|
|
5
|
+
total_amount: string;
|
|
6
|
+
} | {
|
|
7
|
+
shipping_amount: string;
|
|
8
|
+
shipping_amount_cents: number;
|
|
9
|
+
shipping_method: string;
|
|
10
|
+
total_amount: string;
|
|
11
|
+
};
|
|
@@ -4,4 +4,5 @@ export * from "./ClearCartResponse.js";
|
|
|
4
4
|
export * from "./CreatePaymentIntentCartResponse.js";
|
|
5
5
|
export * from "./GetCartResponse.js";
|
|
6
6
|
export * from "./RemoveItemCartResponse.js";
|
|
7
|
+
export * from "./SelectShippingOptionCartResponse.js";
|
|
7
8
|
export * from "./UpdateItemCartResponse.js";
|
|
@@ -20,4 +20,5 @@ __exportStar(require("./ClearCartResponse.js"), exports);
|
|
|
20
20
|
__exportStar(require("./CreatePaymentIntentCartResponse.js"), exports);
|
|
21
21
|
__exportStar(require("./GetCartResponse.js"), exports);
|
|
22
22
|
__exportStar(require("./RemoveItemCartResponse.js"), exports);
|
|
23
|
+
__exportStar(require("./SelectShippingOptionCartResponse.js"), exports);
|
|
23
24
|
__exportStar(require("./UpdateItemCartResponse.js"), exports);
|
|
@@ -5,6 +5,9 @@ export * from "./businessMessaging/types/index.js";
|
|
|
5
5
|
export * from "./businessProducts/client/requests/index.js";
|
|
6
6
|
export * as businessProducts from "./businessProducts/index.js";
|
|
7
7
|
export * from "./businessProducts/types/index.js";
|
|
8
|
+
export * from "./businessShipping/client/requests/index.js";
|
|
9
|
+
export * as businessShipping from "./businessShipping/index.js";
|
|
10
|
+
export * from "./businessShipping/types/index.js";
|
|
8
11
|
export * from "./customer/client/requests/index.js";
|
|
9
12
|
export * as customer from "./customer/index.js";
|
|
10
13
|
export * from "./customer/types/index.js";
|
|
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.serveAd = exports.recordClick = exports.customerMyAccount = exports.customerMessaging = exports.customerEvents = exports.customer = exports.businessProducts = exports.businessMessaging = exports.business = void 0;
|
|
39
|
+
exports.serveAd = exports.recordClick = exports.customerMyAccount = exports.customerMessaging = exports.customerEvents = exports.customer = exports.businessShipping = exports.businessProducts = exports.businessMessaging = exports.business = void 0;
|
|
40
40
|
exports.business = __importStar(require("./business/index.js"));
|
|
41
41
|
__exportStar(require("./businessMessaging/client/requests/index.js"), exports);
|
|
42
42
|
exports.businessMessaging = __importStar(require("./businessMessaging/index.js"));
|
|
@@ -44,6 +44,9 @@ __exportStar(require("./businessMessaging/types/index.js"), exports);
|
|
|
44
44
|
__exportStar(require("./businessProducts/client/requests/index.js"), exports);
|
|
45
45
|
exports.businessProducts = __importStar(require("./businessProducts/index.js"));
|
|
46
46
|
__exportStar(require("./businessProducts/types/index.js"), exports);
|
|
47
|
+
__exportStar(require("./businessShipping/client/requests/index.js"), exports);
|
|
48
|
+
exports.businessShipping = __importStar(require("./businessShipping/index.js"));
|
|
49
|
+
__exportStar(require("./businessShipping/types/index.js"), exports);
|
|
47
50
|
__exportStar(require("./customer/client/requests/index.js"), exports);
|
|
48
51
|
exports.customer = __importStar(require("./customer/index.js"));
|
|
49
52
|
__exportStar(require("./customer/types/index.js"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ShippingAccountResource {
|
|
2
|
+
id: string;
|
|
3
|
+
ship_from_name: string;
|
|
4
|
+
ship_from_phone: string | null;
|
|
5
|
+
is_active: boolean;
|
|
6
|
+
live_rates_enabled: boolean;
|
|
7
|
+
card?: string | undefined;
|
|
8
|
+
created_at: string | null;
|
|
9
|
+
updated_at: string | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ShippingRateResource {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
rate_type: string;
|
|
5
|
+
flat_rate: number | null;
|
|
6
|
+
free_shipping_threshold: number | null;
|
|
7
|
+
estimated_days_min: string;
|
|
8
|
+
estimated_days_max: string;
|
|
9
|
+
is_active: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
}
|
|
@@ -132,6 +132,8 @@ export * from "./RsvpItem.js";
|
|
|
132
132
|
export * from "./RsvpResponse.js";
|
|
133
133
|
export * from "./SearchResults.js";
|
|
134
134
|
export * from "./ServiceUnavailableErrorBody.js";
|
|
135
|
+
export * from "./ShippingAccountResource.js";
|
|
136
|
+
export * from "./ShippingRateResource.js";
|
|
135
137
|
export * from "./StoreAddressRequest.js";
|
|
136
138
|
export * from "./StoreProductImageRequest.js";
|
|
137
139
|
export * from "./Ticket.js";
|
|
@@ -148,6 +148,8 @@ __exportStar(require("./RsvpItem.js"), exports);
|
|
|
148
148
|
__exportStar(require("./RsvpResponse.js"), exports);
|
|
149
149
|
__exportStar(require("./SearchResults.js"), exports);
|
|
150
150
|
__exportStar(require("./ServiceUnavailableErrorBody.js"), exports);
|
|
151
|
+
__exportStar(require("./ShippingAccountResource.js"), exports);
|
|
152
|
+
__exportStar(require("./ShippingRateResource.js"), exports);
|
|
151
153
|
__exportStar(require("./StoreAddressRequest.js"), exports);
|
|
152
154
|
__exportStar(require("./StoreProductImageRequest.js"), exports);
|
|
153
155
|
__exportStar(require("./Ticket.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.53";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.53",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.53",
|
|
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);
|