@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
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "0.0.
|
|
47
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.0.53",
|
|
47
|
+
"User-Agent": "@51eat/sdk/0.0.53",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BusinessClient } from "./api/resources/business/client/Client.js";
|
|
2
2
|
import { BusinessMessagingClient } from "./api/resources/businessMessaging/client/Client.js";
|
|
3
3
|
import { BusinessProductsClient } from "./api/resources/businessProducts/client/Client.js";
|
|
4
|
+
import { BusinessShippingClient } from "./api/resources/businessShipping/client/Client.js";
|
|
4
5
|
import { CustomerClient } from "./api/resources/customer/client/Client.js";
|
|
5
6
|
import { CustomerEventsClient } from "./api/resources/customerEvents/client/Client.js";
|
|
6
7
|
import { CustomerMessagingClient } from "./api/resources/customerMessaging/client/Client.js";
|
|
@@ -19,6 +20,7 @@ export declare class FiveOneEatClient {
|
|
|
19
20
|
protected readonly _options: NormalizedClientOptionsWithAuth<FiveOneEatClient.Options>;
|
|
20
21
|
protected _businessMessaging: BusinessMessagingClient | undefined;
|
|
21
22
|
protected _businessProducts: BusinessProductsClient | undefined;
|
|
23
|
+
protected _businessShipping: BusinessShippingClient | undefined;
|
|
22
24
|
protected _customerEvents: CustomerEventsClient | undefined;
|
|
23
25
|
protected _customerMessaging: CustomerMessagingClient | undefined;
|
|
24
26
|
protected _customerMyAccount: CustomerMyAccountClient | undefined;
|
|
@@ -29,6 +31,7 @@ export declare class FiveOneEatClient {
|
|
|
29
31
|
constructor(options?: FiveOneEatClient.Options);
|
|
30
32
|
get businessMessaging(): BusinessMessagingClient;
|
|
31
33
|
get businessProducts(): BusinessProductsClient;
|
|
34
|
+
get businessShipping(): BusinessShippingClient;
|
|
32
35
|
get customerEvents(): CustomerEventsClient;
|
|
33
36
|
get customerMessaging(): CustomerMessagingClient;
|
|
34
37
|
get customerMyAccount(): CustomerMyAccountClient;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -47,12 +47,13 @@ exports.FiveOneEatClient = void 0;
|
|
|
47
47
|
const Client_js_1 = require("./api/resources/business/client/Client.js");
|
|
48
48
|
const Client_js_2 = require("./api/resources/businessMessaging/client/Client.js");
|
|
49
49
|
const Client_js_3 = require("./api/resources/businessProducts/client/Client.js");
|
|
50
|
-
const Client_js_4 = require("./api/resources/
|
|
51
|
-
const Client_js_5 = require("./api/resources/
|
|
52
|
-
const Client_js_6 = require("./api/resources/
|
|
53
|
-
const Client_js_7 = require("./api/resources/
|
|
54
|
-
const Client_js_8 = require("./api/resources/
|
|
55
|
-
const Client_js_9 = require("./api/resources/
|
|
50
|
+
const Client_js_4 = require("./api/resources/businessShipping/client/Client.js");
|
|
51
|
+
const Client_js_5 = require("./api/resources/customer/client/Client.js");
|
|
52
|
+
const Client_js_6 = require("./api/resources/customerEvents/client/Client.js");
|
|
53
|
+
const Client_js_7 = require("./api/resources/customerMessaging/client/Client.js");
|
|
54
|
+
const Client_js_8 = require("./api/resources/customerMyAccount/client/Client.js");
|
|
55
|
+
const Client_js_9 = require("./api/resources/recordClick/client/Client.js");
|
|
56
|
+
const Client_js_10 = require("./api/resources/serveAd/client/Client.js");
|
|
56
57
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
57
58
|
const core = __importStar(require("./core/index.js"));
|
|
58
59
|
class FiveOneEatClient {
|
|
@@ -67,29 +68,33 @@ class FiveOneEatClient {
|
|
|
67
68
|
var _a;
|
|
68
69
|
return ((_a = this._businessProducts) !== null && _a !== void 0 ? _a : (this._businessProducts = new Client_js_3.BusinessProductsClient(this._options)));
|
|
69
70
|
}
|
|
71
|
+
get businessShipping() {
|
|
72
|
+
var _a;
|
|
73
|
+
return ((_a = this._businessShipping) !== null && _a !== void 0 ? _a : (this._businessShipping = new Client_js_4.BusinessShippingClient(this._options)));
|
|
74
|
+
}
|
|
70
75
|
get customerEvents() {
|
|
71
76
|
var _a;
|
|
72
|
-
return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new
|
|
77
|
+
return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new Client_js_6.CustomerEventsClient(this._options)));
|
|
73
78
|
}
|
|
74
79
|
get customerMessaging() {
|
|
75
80
|
var _a;
|
|
76
|
-
return ((_a = this._customerMessaging) !== null && _a !== void 0 ? _a : (this._customerMessaging = new
|
|
81
|
+
return ((_a = this._customerMessaging) !== null && _a !== void 0 ? _a : (this._customerMessaging = new Client_js_7.CustomerMessagingClient(this._options)));
|
|
77
82
|
}
|
|
78
83
|
get customerMyAccount() {
|
|
79
84
|
var _a;
|
|
80
|
-
return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new
|
|
85
|
+
return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new Client_js_8.CustomerMyAccountClient(this._options)));
|
|
81
86
|
}
|
|
82
87
|
get customer() {
|
|
83
88
|
var _a;
|
|
84
|
-
return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new
|
|
89
|
+
return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new Client_js_5.CustomerClient(this._options)));
|
|
85
90
|
}
|
|
86
91
|
get recordClick() {
|
|
87
92
|
var _a;
|
|
88
|
-
return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new
|
|
93
|
+
return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new Client_js_9.RecordClickClient(this._options)));
|
|
89
94
|
}
|
|
90
95
|
get serveAd() {
|
|
91
96
|
var _a;
|
|
92
|
-
return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new
|
|
97
|
+
return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new Client_js_10.ServeAdClient(this._options)));
|
|
93
98
|
}
|
|
94
99
|
get business() {
|
|
95
100
|
var _a;
|
|
@@ -106,4 +106,37 @@ export declare class ProductOrdersClient {
|
|
|
106
106
|
*/
|
|
107
107
|
refund(request: FiveOneEat.business.RefundOrderRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.RefundProductOrdersResponse>;
|
|
108
108
|
private __refund;
|
|
109
|
+
/**
|
|
110
|
+
* @param {FiveOneEat.business.GetLabelRatesProductOrdersRequest} request
|
|
111
|
+
* @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
112
|
+
*
|
|
113
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
114
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
115
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
116
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* await client.business.productOrders.getLabelRates({
|
|
120
|
+
* productOrder: "productOrder"
|
|
121
|
+
* })
|
|
122
|
+
*/
|
|
123
|
+
getLabelRates(request: FiveOneEat.business.GetLabelRatesProductOrdersRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<string>;
|
|
124
|
+
private __getLabelRates;
|
|
125
|
+
/**
|
|
126
|
+
* @param {FiveOneEat.business.PurchaseLabelRequest} request
|
|
127
|
+
* @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
|
+
*
|
|
129
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
130
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
131
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
132
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* await client.business.productOrders.purchaseLabel({
|
|
136
|
+
* productOrder: "productOrder",
|
|
137
|
+
* provider_rate_id: "provider_rate_id"
|
|
138
|
+
* })
|
|
139
|
+
*/
|
|
140
|
+
purchaseLabel(request: FiveOneEat.business.PurchaseLabelRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.PurchaseLabelProductOrdersResponse>;
|
|
141
|
+
private __purchaseLabel;
|
|
109
142
|
}
|
|
@@ -425,5 +425,128 @@ class ProductOrdersClient {
|
|
|
425
425
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/product-orders/{productOrder}/refund");
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* @param {FiveOneEat.business.GetLabelRatesProductOrdersRequest} request
|
|
430
|
+
* @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
431
|
+
*
|
|
432
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
433
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
434
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
435
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* await client.business.productOrders.getLabelRates({
|
|
439
|
+
* productOrder: "productOrder"
|
|
440
|
+
* })
|
|
441
|
+
*/
|
|
442
|
+
getLabelRates(request, requestOptions) {
|
|
443
|
+
return core.HttpResponsePromise.fromPromise(this.__getLabelRates(request, requestOptions));
|
|
444
|
+
}
|
|
445
|
+
__getLabelRates(request, requestOptions) {
|
|
446
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
447
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
448
|
+
const { productOrder } = request;
|
|
449
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
450
|
+
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);
|
|
451
|
+
const _response = yield core.fetcher({
|
|
452
|
+
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/product-orders/${core.url.encodePathParam(productOrder)}/label-rates`),
|
|
453
|
+
method: "GET",
|
|
454
|
+
headers: _headers,
|
|
455
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
456
|
+
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,
|
|
457
|
+
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,
|
|
458
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
459
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
460
|
+
logging: this._options.logging,
|
|
461
|
+
});
|
|
462
|
+
if (_response.ok) {
|
|
463
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
464
|
+
}
|
|
465
|
+
if (_response.error.reason === "status-code") {
|
|
466
|
+
switch (_response.error.statusCode) {
|
|
467
|
+
case 401:
|
|
468
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
469
|
+
case 403:
|
|
470
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
471
|
+
case 404:
|
|
472
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
473
|
+
case 422:
|
|
474
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
475
|
+
default:
|
|
476
|
+
throw new errors.FiveOneEatError({
|
|
477
|
+
statusCode: _response.error.statusCode,
|
|
478
|
+
body: _response.error.body,
|
|
479
|
+
rawResponse: _response.rawResponse,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/product-orders/{productOrder}/label-rates");
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* @param {FiveOneEat.business.PurchaseLabelRequest} request
|
|
488
|
+
* @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
489
|
+
*
|
|
490
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
491
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
492
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
493
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* await client.business.productOrders.purchaseLabel({
|
|
497
|
+
* productOrder: "productOrder",
|
|
498
|
+
* provider_rate_id: "provider_rate_id"
|
|
499
|
+
* })
|
|
500
|
+
*/
|
|
501
|
+
purchaseLabel(request, requestOptions) {
|
|
502
|
+
return core.HttpResponsePromise.fromPromise(this.__purchaseLabel(request, requestOptions));
|
|
503
|
+
}
|
|
504
|
+
__purchaseLabel(request, requestOptions) {
|
|
505
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
506
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
507
|
+
const { productOrder } = request, _body = __rest(request, ["productOrder"]);
|
|
508
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
509
|
+
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);
|
|
510
|
+
const _response = yield core.fetcher({
|
|
511
|
+
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/product-orders/${core.url.encodePathParam(productOrder)}/purchase-label`),
|
|
512
|
+
method: "POST",
|
|
513
|
+
headers: _headers,
|
|
514
|
+
contentType: "application/json",
|
|
515
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
516
|
+
requestType: "json",
|
|
517
|
+
body: _body,
|
|
518
|
+
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,
|
|
519
|
+
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,
|
|
520
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
521
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
522
|
+
logging: this._options.logging,
|
|
523
|
+
});
|
|
524
|
+
if (_response.ok) {
|
|
525
|
+
return {
|
|
526
|
+
data: _response.body,
|
|
527
|
+
rawResponse: _response.rawResponse,
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
if (_response.error.reason === "status-code") {
|
|
531
|
+
switch (_response.error.statusCode) {
|
|
532
|
+
case 401:
|
|
533
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
534
|
+
case 403:
|
|
535
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
536
|
+
case 404:
|
|
537
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
538
|
+
case 422:
|
|
539
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
540
|
+
default:
|
|
541
|
+
throw new errors.FiveOneEatError({
|
|
542
|
+
statusCode: _response.error.statusCode,
|
|
543
|
+
body: _response.error.body,
|
|
544
|
+
rawResponse: _response.rawResponse,
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/product-orders/{productOrder}/purchase-label");
|
|
549
|
+
});
|
|
550
|
+
}
|
|
428
551
|
}
|
|
429
552
|
exports.ProductOrdersClient = ProductOrdersClient;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { FulfillProductOrdersRequest } from "./FulfillProductOrdersRequest.js";
|
|
2
|
+
export type { GetLabelRatesProductOrdersRequest } from "./GetLabelRatesProductOrdersRequest.js";
|
|
2
3
|
export type { GetProductOrdersRequest } from "./GetProductOrdersRequest.js";
|
|
3
4
|
export type { MarkPickedUpProductOrdersRequest } from "./MarkPickedUpProductOrdersRequest.js";
|
|
5
|
+
export type { PurchaseLabelRequest } from "./PurchaseLabelRequest.js";
|
|
4
6
|
export type { RefundOrderRequest } from "./RefundOrderRequest.js";
|
|
5
7
|
export type { StoreTrackingRequest } from "./StoreTrackingRequest.js";
|
|
@@ -3,4 +3,5 @@ export * from "./FulfillProductOrdersResponse.js";
|
|
|
3
3
|
export * from "./GetProductOrdersResponse.js";
|
|
4
4
|
export * from "./ListProductOrdersResponse.js";
|
|
5
5
|
export * from "./MarkPickedUpProductOrdersResponse.js";
|
|
6
|
+
export * from "./PurchaseLabelProductOrdersResponse.js";
|
|
6
7
|
export * from "./RefundProductOrdersResponse.js";
|
|
@@ -19,4 +19,5 @@ __exportStar(require("./FulfillProductOrdersResponse.js"), exports);
|
|
|
19
19
|
__exportStar(require("./GetProductOrdersResponse.js"), exports);
|
|
20
20
|
__exportStar(require("./ListProductOrdersResponse.js"), exports);
|
|
21
21
|
__exportStar(require("./MarkPickedUpProductOrdersResponse.js"), exports);
|
|
22
|
+
__exportStar(require("./PurchaseLabelProductOrdersResponse.js"), exports);
|
|
22
23
|
__exportStar(require("./RefundProductOrdersResponse.js"), exports);
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as FiveOneEat from "../../../index.js";
|
|
5
|
+
export declare namespace BusinessShippingClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class BusinessShippingClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessShippingClient.Options>;
|
|
12
|
+
constructor(options?: BusinessShippingClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
|
+
*
|
|
16
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* await client.businessShipping.getBusinessShippingAccount()
|
|
20
|
+
*/
|
|
21
|
+
getBusinessShippingAccount(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetBusinessShippingAccountResponse>;
|
|
22
|
+
private __getBusinessShippingAccount;
|
|
23
|
+
/**
|
|
24
|
+
* Use the returned client_secret with the Stripe mobile SDK to collect
|
|
25
|
+
* a payment method for label billing. Pass the resulting pm_* ID to
|
|
26
|
+
* POST /shipping/account.
|
|
27
|
+
*
|
|
28
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await client.businessShipping.getBusinessShippingSetupIntent()
|
|
34
|
+
*/
|
|
35
|
+
getBusinessShippingSetupIntent(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetBusinessShippingSetupIntentResponse>;
|
|
36
|
+
private __getBusinessShippingSetupIntent;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a Stripe Customer for label billing, attaches the provided
|
|
39
|
+
* payment method, and upserts the ShippingAccount record.
|
|
40
|
+
*
|
|
41
|
+
* @param {FiveOneEat.SetupShippingAccountRequest} request
|
|
42
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
45
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
46
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* await client.businessShipping.setupBusinessShippingAccount({
|
|
50
|
+
* payment_method_id: "payment_method_id"
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
setupBusinessShippingAccount(request: FiveOneEat.SetupShippingAccountRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<string>;
|
|
54
|
+
private __setupBusinessShippingAccount;
|
|
55
|
+
/**
|
|
56
|
+
* @param {FiveOneEat.UpdateShippingAccountRequest} request
|
|
57
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
60
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
61
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await client.businessShipping.updateBusinessShippingAccount()
|
|
65
|
+
*/
|
|
66
|
+
updateBusinessShippingAccount(request?: FiveOneEat.UpdateShippingAccountRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.UpdateBusinessShippingAccountResponse>;
|
|
67
|
+
private __updateBusinessShippingAccount;
|
|
68
|
+
/**
|
|
69
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
72
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.businessShipping.deleteBusinessShippingAccount()
|
|
76
|
+
*/
|
|
77
|
+
deleteBusinessShippingAccount(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
78
|
+
private __deleteBusinessShippingAccount;
|
|
79
|
+
/**
|
|
80
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
|
+
*
|
|
82
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* await client.businessShipping.listBusinessShippingRates()
|
|
86
|
+
*/
|
|
87
|
+
listBusinessShippingRates(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.ListBusinessShippingRatesResponse>;
|
|
88
|
+
private __listBusinessShippingRates;
|
|
89
|
+
/**
|
|
90
|
+
* @param {FiveOneEat.StoreShippingRateRequest} request
|
|
91
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
92
|
+
*
|
|
93
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
94
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
95
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* await client.businessShipping.createBusinessShippingRate({
|
|
99
|
+
* name: "name",
|
|
100
|
+
* rate_type: "flat"
|
|
101
|
+
* })
|
|
102
|
+
*/
|
|
103
|
+
createBusinessShippingRate(request: FiveOneEat.StoreShippingRateRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CreateBusinessShippingRateResponse>;
|
|
104
|
+
private __createBusinessShippingRate;
|
|
105
|
+
/**
|
|
106
|
+
* @param {FiveOneEat.UpdateShippingRateRequest} request
|
|
107
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
110
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
111
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
112
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* await client.businessShipping.updateBusinessShippingRate({
|
|
116
|
+
* shippingRate: "shippingRate",
|
|
117
|
+
* name: "name",
|
|
118
|
+
* rate_type: "flat"
|
|
119
|
+
* })
|
|
120
|
+
*/
|
|
121
|
+
updateBusinessShippingRate(request: FiveOneEat.UpdateShippingRateRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.UpdateBusinessShippingRateResponse>;
|
|
122
|
+
private __updateBusinessShippingRate;
|
|
123
|
+
/**
|
|
124
|
+
* @param {FiveOneEat.DeleteBusinessShippingRateRequest} request
|
|
125
|
+
* @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
126
|
+
*
|
|
127
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
128
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
129
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* await client.businessShipping.deleteBusinessShippingRate({
|
|
133
|
+
* shippingRate: "shippingRate"
|
|
134
|
+
* })
|
|
135
|
+
*/
|
|
136
|
+
deleteBusinessShippingRate(request: FiveOneEat.DeleteBusinessShippingRateRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
137
|
+
private __deleteBusinessShippingRate;
|
|
138
|
+
}
|