@51eat/sdk 0.0.76 → 0.0.77
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/api/resources/business/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/client/Client.js +7 -2
- package/dist/cjs/api/resources/business/resources/events/client/requests/StoreEventRequest.d.ts +7 -0
- package/dist/cjs/api/resources/business/resources/events/client/requests/UpdateEventRequest.d.ts +7 -0
- package/dist/cjs/api/resources/business/resources/events/resources/ticketTypes/client/requests/StoreTicketTypeRequest.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/events/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.d.ts +7 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/index.js +3 -1
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +26 -9
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +61 -30
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/AddTrackingProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/FulfillProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/MarkPickedUpProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/PurchaseLabelProductOrdersRequest.d.ts +3 -2
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/RefundOrderRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/business/resources/products/client/Client.d.ts +4 -2
- package/dist/cjs/api/resources/business/resources/products/client/Client.js +4 -2
- package/dist/cjs/api/resources/business/resources/products/client/requests/StoreProductRequest.d.ts +3 -1
- package/dist/cjs/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.ts +3 -1
- package/dist/cjs/api/resources/business/resources/taxCodes/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/client/Client.js +111 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/types/ListTaxCodesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/taxCodes/types/index.js +17 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +98 -8
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +242 -11
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/CheckoutCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ChooseFulfillmentMethodRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ListShippingOptionsCartRequest.d.ts +10 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.js +3 -0
- package/dist/{esm/api/resources/customer/resources/cart/client/requests/GetShippingOptionsCartRequest.d.mts → cjs/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.d.ts} +6 -5
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +5 -2
- package/dist/cjs/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.d.ts +18 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.d.ts +18 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.js +10 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/cart/types/index.d.ts +4 -1
- package/dist/cjs/api/resources/customer/resources/cart/types/index.js +4 -1
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/Client.js +6 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentRequest.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.ts +7 -0
- package/dist/cjs/api/resources/customer/resources/productOrders/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/productOrders/client/Client.js +3 -0
- package/dist/cjs/api/resources/customer/resources/productOrders/client/requests/GetProductOrdersRequest.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +3 -0
- package/dist/cjs/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.ts +10 -0
- package/dist/cjs/api/types/BusinessEvent.d.ts +7 -0
- package/dist/cjs/api/types/BusinessEventTicketType.d.ts +2 -0
- package/dist/cjs/api/types/BusinessProfile.d.ts +1 -1
- package/dist/cjs/api/types/CartResource.d.ts +24 -0
- package/dist/cjs/api/types/ConflictErrorBody.d.ts +7 -1
- package/dist/cjs/api/types/ConflictErrorBody.js +4 -1
- package/dist/cjs/api/types/CustomerBusinessProfile.d.ts +1 -1
- package/dist/cjs/api/types/FulfillmentType.d.ts +6 -0
- package/dist/cjs/api/types/FulfillmentType.js +9 -0
- package/dist/cjs/api/types/ProductResource.d.ts +5 -0
- package/dist/cjs/api/types/TaxCode.d.ts +21 -0
- package/dist/cjs/api/types/TaxCode.js +15 -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/api/resources/business/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/events/client/requests/StoreEventRequest.d.mts +7 -0
- package/dist/esm/api/resources/business/resources/events/client/requests/UpdateEventRequest.d.mts +7 -0
- package/dist/esm/api/resources/business/resources/events/resources/ticketTypes/client/requests/StoreTicketTypeRequest.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/events/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.d.mts +7 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +26 -9
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +62 -31
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/AddTrackingProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/FulfillProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/MarkPickedUpProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/PurchaseLabelProductOrdersRequest.d.mts +3 -2
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/RefundOrderRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/business/resources/products/client/Client.d.mts +4 -2
- package/dist/esm/api/resources/business/resources/products/client/Client.mjs +4 -2
- package/dist/esm/api/resources/business/resources/products/client/requests/StoreProductRequest.d.mts +3 -1
- package/dist/esm/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.mts +3 -1
- package/dist/esm/api/resources/business/resources/taxCodes/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/business/resources/taxCodes/client/Client.mjs +74 -0
- package/dist/esm/api/resources/business/resources/taxCodes/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/taxCodes/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/taxCodes/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/taxCodes/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/taxCodes/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/taxCodes/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/taxCodes/types/ListTaxCodesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/taxCodes/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/taxCodes/types/index.mjs +1 -0
- package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +98 -8
- package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +242 -11
- package/dist/esm/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/CheckoutCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ChooseFulfillmentMethodRequest.d.mts +13 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ClearCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/CreatePaymentIntentCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/GetCartRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ListShippingOptionsCartRequest.d.mts +10 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.d.mts +12 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/RefreshCartPaymentRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.d.mts +12 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingRateRequest.mjs +2 -0
- package/dist/{cjs/api/resources/customer/resources/cart/client/requests/GetShippingOptionsCartRequest.d.ts → esm/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.d.mts} +6 -5
- package/dist/esm/api/resources/customer/resources/cart/client/requests/ShippingAddressRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +5 -2
- package/dist/esm/api/resources/customer/resources/cart/types/CreatePaymentIntentCartResponse.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.d.mts +18 -0
- package/dist/esm/api/resources/customer/resources/cart/types/ListShippingOptionsCartResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.d.mts +18 -0
- package/dist/esm/api/resources/customer/resources/cart/types/RefreshPaymentIntentCartResponse.mjs +7 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetFulfillmentCartResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/cart/types/SetShippingAddressCartResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/cart/types/index.d.mts +4 -1
- package/dist/esm/api/resources/customer/resources/cart/types/index.mjs +4 -1
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/Client.mjs +6 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/client/requests/CreatePaymentIntentRequest.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/CreatePaymentIntentTicketingResponse.d.mts +7 -0
- package/dist/esm/api/resources/customer/resources/productOrders/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/productOrders/client/Client.mjs +3 -0
- package/dist/esm/api/resources/customer/resources/productOrders/client/requests/GetProductOrdersRequest.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +3 -0
- package/dist/esm/api/types/AppHttpResourcesApiV1BusinessCommerceProductResource.d.mts +10 -0
- package/dist/esm/api/types/BusinessEvent.d.mts +7 -0
- package/dist/esm/api/types/BusinessEventTicketType.d.mts +2 -0
- package/dist/esm/api/types/BusinessProfile.d.mts +1 -1
- package/dist/esm/api/types/CartResource.d.mts +24 -0
- package/dist/esm/api/types/ConflictErrorBody.d.mts +7 -1
- package/dist/esm/api/types/ConflictErrorBody.mjs +4 -1
- package/dist/esm/api/types/CustomerBusinessProfile.d.mts +1 -1
- package/dist/esm/api/types/FulfillmentType.d.mts +6 -0
- package/dist/esm/api/types/FulfillmentType.mjs +6 -0
- package/dist/esm/api/types/ProductResource.d.mts +5 -0
- package/dist/esm/api/types/TaxCode.d.mts +21 -0
- package/dist/esm/api/types/TaxCode.mjs +12 -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 +377 -16
- package/dist/cjs/api/resources/business/resources/productOrders/client/requests/RefundProductOrdersRequest.d.ts +0 -11
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionCartRequest.d.ts +0 -14
- package/dist/cjs/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponse.d.ts +0 -14
- package/dist/esm/api/resources/business/resources/productOrders/client/requests/RefundProductOrdersRequest.d.mts +0 -11
- package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionCartRequest.d.mts +0 -14
- package/dist/esm/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponse.d.mts +0 -14
- /package/dist/cjs/api/resources/business/resources/productOrders/client/requests/{RefundProductOrdersRequest.js → RefundOrderRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customer/resources/cart/client/requests/GetShippingOptionsCartRequest.js → business/resources/taxCodes/types/ListTaxCodesResponse.js} +0 -0
- /package/dist/cjs/api/resources/customer/resources/cart/client/requests/{SelectShippingOptionCartRequest.js → ChooseFulfillmentMethodRequest.js} +0 -0
- /package/dist/cjs/api/resources/customer/resources/cart/{types/GetShippingOptionsCartResponse.js → client/requests/ListShippingOptionsCartRequest.js} +0 -0
- /package/dist/esm/api/resources/business/resources/productOrders/client/requests/{RefundProductOrdersRequest.mjs → RefundOrderRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customer/resources/cart/client/requests/GetShippingOptionsCartRequest.mjs → business/resources/taxCodes/types/ListTaxCodesResponse.mjs} +0 -0
- /package/dist/esm/api/resources/customer/resources/cart/client/requests/{SelectShippingOptionCartRequest.mjs → ChooseFulfillmentMethodRequest.mjs} +0 -0
- /package/dist/esm/api/resources/customer/resources/cart/{types/GetShippingOptionsCartResponse.mjs → client/requests/ListShippingOptionsCartRequest.mjs} +0 -0
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../../../core/index.mjs";
|
|
25
25
|
import * as environments from "../../../../../../environments.mjs";
|
|
26
26
|
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
@@ -95,10 +95,11 @@ export class ProductOrdersClient {
|
|
|
95
95
|
*
|
|
96
96
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
97
97
|
* @throws {@link FiveOneEat.ForbiddenError}
|
|
98
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
98
99
|
*
|
|
99
100
|
* @example
|
|
100
101
|
* await client.business.productOrders.get({
|
|
101
|
-
*
|
|
102
|
+
* order: "order"
|
|
102
103
|
* })
|
|
103
104
|
*/
|
|
104
105
|
get(request, requestOptions) {
|
|
@@ -107,11 +108,11 @@ export class ProductOrdersClient {
|
|
|
107
108
|
__get(request, requestOptions) {
|
|
108
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
110
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
110
|
-
const {
|
|
111
|
+
const { order } = request;
|
|
111
112
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
112
113
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
113
114
|
const _response = yield core.fetcher({
|
|
114
|
-
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(
|
|
115
|
+
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(order)}`),
|
|
115
116
|
method: "GET",
|
|
116
117
|
headers: _headers,
|
|
117
118
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -133,6 +134,8 @@ export class ProductOrdersClient {
|
|
|
133
134
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
134
135
|
case 403:
|
|
135
136
|
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
137
|
+
case 404:
|
|
138
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
136
139
|
default:
|
|
137
140
|
throw new errors.FiveOneEatError({
|
|
138
141
|
statusCode: _response.error.statusCode,
|
|
@@ -141,7 +144,7 @@ export class ProductOrdersClient {
|
|
|
141
144
|
});
|
|
142
145
|
}
|
|
143
146
|
}
|
|
144
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/product-orders/{
|
|
147
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/product-orders/{order}");
|
|
145
148
|
});
|
|
146
149
|
}
|
|
147
150
|
/**
|
|
@@ -150,10 +153,11 @@ export class ProductOrdersClient {
|
|
|
150
153
|
*
|
|
151
154
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
152
155
|
* @throws {@link FiveOneEat.ForbiddenError}
|
|
156
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
153
157
|
*
|
|
154
158
|
* @example
|
|
155
159
|
* await client.business.productOrders.fulfill({
|
|
156
|
-
*
|
|
160
|
+
* order: "order"
|
|
157
161
|
* })
|
|
158
162
|
*/
|
|
159
163
|
fulfill(request, requestOptions) {
|
|
@@ -162,11 +166,11 @@ export class ProductOrdersClient {
|
|
|
162
166
|
__fulfill(request, requestOptions) {
|
|
163
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
168
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
165
|
-
const {
|
|
169
|
+
const { order } = request;
|
|
166
170
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
167
171
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
168
172
|
const _response = yield core.fetcher({
|
|
169
|
-
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(
|
|
173
|
+
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(order)}/fulfill`),
|
|
170
174
|
method: "PUT",
|
|
171
175
|
headers: _headers,
|
|
172
176
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -188,6 +192,8 @@ export class ProductOrdersClient {
|
|
|
188
192
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
189
193
|
case 403:
|
|
190
194
|
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
195
|
+
case 404:
|
|
196
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
191
197
|
default:
|
|
192
198
|
throw new errors.FiveOneEatError({
|
|
193
199
|
statusCode: _response.error.statusCode,
|
|
@@ -196,7 +202,7 @@ export class ProductOrdersClient {
|
|
|
196
202
|
});
|
|
197
203
|
}
|
|
198
204
|
}
|
|
199
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/product-orders/{
|
|
205
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/product-orders/{order}/fulfill");
|
|
200
206
|
});
|
|
201
207
|
}
|
|
202
208
|
/**
|
|
@@ -205,10 +211,11 @@ export class ProductOrdersClient {
|
|
|
205
211
|
*
|
|
206
212
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
207
213
|
* @throws {@link FiveOneEat.ForbiddenError}
|
|
214
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
208
215
|
*
|
|
209
216
|
* @example
|
|
210
217
|
* await client.business.productOrders.markPickedUp({
|
|
211
|
-
*
|
|
218
|
+
* order: "order"
|
|
212
219
|
* })
|
|
213
220
|
*/
|
|
214
221
|
markPickedUp(request, requestOptions) {
|
|
@@ -217,11 +224,11 @@ export class ProductOrdersClient {
|
|
|
217
224
|
__markPickedUp(request, requestOptions) {
|
|
218
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
219
226
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
220
|
-
const {
|
|
227
|
+
const { order } = request;
|
|
221
228
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
222
229
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
223
230
|
const _response = yield core.fetcher({
|
|
224
|
-
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(
|
|
231
|
+
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(order)}/mark-picked-up`),
|
|
225
232
|
method: "PUT",
|
|
226
233
|
headers: _headers,
|
|
227
234
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -243,6 +250,8 @@ export class ProductOrdersClient {
|
|
|
243
250
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
244
251
|
case 403:
|
|
245
252
|
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
253
|
+
case 404:
|
|
254
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
246
255
|
default:
|
|
247
256
|
throw new errors.FiveOneEatError({
|
|
248
257
|
statusCode: _response.error.statusCode,
|
|
@@ -251,7 +260,7 @@ export class ProductOrdersClient {
|
|
|
251
260
|
});
|
|
252
261
|
}
|
|
253
262
|
}
|
|
254
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/product-orders/{
|
|
263
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/product-orders/{order}/mark-picked-up");
|
|
255
264
|
});
|
|
256
265
|
}
|
|
257
266
|
/**
|
|
@@ -260,11 +269,12 @@ export class ProductOrdersClient {
|
|
|
260
269
|
*
|
|
261
270
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
262
271
|
* @throws {@link FiveOneEat.ForbiddenError}
|
|
272
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
263
273
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
264
274
|
*
|
|
265
275
|
* @example
|
|
266
276
|
* await client.business.productOrders.addTracking({
|
|
267
|
-
*
|
|
277
|
+
* order: "order",
|
|
268
278
|
* carrier: "carrier",
|
|
269
279
|
* tracking_number: "tracking_number"
|
|
270
280
|
* })
|
|
@@ -275,11 +285,11 @@ export class ProductOrdersClient {
|
|
|
275
285
|
__addTracking(request, requestOptions) {
|
|
276
286
|
return __awaiter(this, void 0, void 0, function* () {
|
|
277
287
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
278
|
-
const {
|
|
288
|
+
const { order } = request, _body = __rest(request, ["order"]);
|
|
279
289
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
280
290
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
281
291
|
const _response = yield core.fetcher({
|
|
282
|
-
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(
|
|
292
|
+
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(order)}/tracking`),
|
|
283
293
|
method: "POST",
|
|
284
294
|
headers: _headers,
|
|
285
295
|
contentType: "application/json",
|
|
@@ -304,6 +314,8 @@ export class ProductOrdersClient {
|
|
|
304
314
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
305
315
|
case 403:
|
|
306
316
|
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
317
|
+
case 404:
|
|
318
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
307
319
|
case 422:
|
|
308
320
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
309
321
|
default:
|
|
@@ -314,20 +326,31 @@ export class ProductOrdersClient {
|
|
|
314
326
|
});
|
|
315
327
|
}
|
|
316
328
|
}
|
|
317
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/product-orders/{
|
|
329
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/product-orders/{order}/tracking");
|
|
318
330
|
});
|
|
319
331
|
}
|
|
320
332
|
/**
|
|
321
|
-
*
|
|
333
|
+
* Refunds `amount` (dollars) of the order, or everything still refundable
|
|
334
|
+
* when `amount` is omitted, through Stripe. Sales tax on the refunded part
|
|
335
|
+
* is reversed automatically.
|
|
336
|
+
*
|
|
337
|
+
* Send an `Idempotency-Key` header (1–255 characters, unique per refund you
|
|
338
|
+
* mean to make) to make retries safe: a repeat with the same key returns
|
|
339
|
+
* the order with the refund already made, with 200, instead of refunding
|
|
340
|
+
* again — even when nothing is left to refund. Without it, a retry after a
|
|
341
|
+
* lost response may refund twice.
|
|
342
|
+
*
|
|
343
|
+
* @param {FiveOneEat.business.RefundOrderRequest} request
|
|
322
344
|
* @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
323
345
|
*
|
|
324
346
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
325
347
|
* @throws {@link FiveOneEat.ForbiddenError}
|
|
348
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
326
349
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
327
350
|
*
|
|
328
351
|
* @example
|
|
329
352
|
* await client.business.productOrders.refund({
|
|
330
|
-
*
|
|
353
|
+
* order: "order"
|
|
331
354
|
* })
|
|
332
355
|
*/
|
|
333
356
|
refund(request, requestOptions) {
|
|
@@ -336,11 +359,11 @@ export class ProductOrdersClient {
|
|
|
336
359
|
__refund(request, requestOptions) {
|
|
337
360
|
return __awaiter(this, void 0, void 0, function* () {
|
|
338
361
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
339
|
-
const {
|
|
362
|
+
const { order, "Idempotency-Key": idempotencyKey } = request, _body = __rest(request, ["order", "Idempotency-Key"]);
|
|
340
363
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
341
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
364
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
342
365
|
const _response = yield core.fetcher({
|
|
343
|
-
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(
|
|
366
|
+
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(order)}/refund`),
|
|
344
367
|
method: "POST",
|
|
345
368
|
headers: _headers,
|
|
346
369
|
contentType: "application/json",
|
|
@@ -365,6 +388,8 @@ export class ProductOrdersClient {
|
|
|
365
388
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
366
389
|
case 403:
|
|
367
390
|
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
391
|
+
case 404:
|
|
392
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
368
393
|
case 422:
|
|
369
394
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
370
395
|
default:
|
|
@@ -375,7 +400,7 @@ export class ProductOrdersClient {
|
|
|
375
400
|
});
|
|
376
401
|
}
|
|
377
402
|
}
|
|
378
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/product-orders/{
|
|
403
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/product-orders/{order}/refund");
|
|
379
404
|
});
|
|
380
405
|
}
|
|
381
406
|
/**
|
|
@@ -384,11 +409,12 @@ export class ProductOrdersClient {
|
|
|
384
409
|
*
|
|
385
410
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
386
411
|
* @throws {@link FiveOneEat.ForbiddenError}
|
|
412
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
387
413
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
388
414
|
*
|
|
389
415
|
* @example
|
|
390
416
|
* await client.business.productOrders.getLabelRates({
|
|
391
|
-
*
|
|
417
|
+
* order: "order"
|
|
392
418
|
* })
|
|
393
419
|
*/
|
|
394
420
|
getLabelRates(request, requestOptions) {
|
|
@@ -397,11 +423,11 @@ export class ProductOrdersClient {
|
|
|
397
423
|
__getLabelRates(request, requestOptions) {
|
|
398
424
|
return __awaiter(this, void 0, void 0, function* () {
|
|
399
425
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
400
|
-
const {
|
|
426
|
+
const { order } = request;
|
|
401
427
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
402
428
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
403
429
|
const _response = yield core.fetcher({
|
|
404
|
-
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(
|
|
430
|
+
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(order)}/label-rates`),
|
|
405
431
|
method: "GET",
|
|
406
432
|
headers: _headers,
|
|
407
433
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -423,6 +449,8 @@ export class ProductOrdersClient {
|
|
|
423
449
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
424
450
|
case 403:
|
|
425
451
|
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
452
|
+
case 404:
|
|
453
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
426
454
|
case 422:
|
|
427
455
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
428
456
|
default:
|
|
@@ -433,7 +461,7 @@ export class ProductOrdersClient {
|
|
|
433
461
|
});
|
|
434
462
|
}
|
|
435
463
|
}
|
|
436
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/product-orders/{
|
|
464
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/product-orders/{order}/label-rates");
|
|
437
465
|
});
|
|
438
466
|
}
|
|
439
467
|
/**
|
|
@@ -442,11 +470,12 @@ export class ProductOrdersClient {
|
|
|
442
470
|
*
|
|
443
471
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
444
472
|
* @throws {@link FiveOneEat.ForbiddenError}
|
|
473
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
445
474
|
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
446
475
|
*
|
|
447
476
|
* @example
|
|
448
477
|
* await client.business.productOrders.purchaseLabel({
|
|
449
|
-
*
|
|
478
|
+
* order: "order",
|
|
450
479
|
* provider_rate_id: "provider_rate_id"
|
|
451
480
|
* })
|
|
452
481
|
*/
|
|
@@ -456,11 +485,11 @@ export class ProductOrdersClient {
|
|
|
456
485
|
__purchaseLabel(request, requestOptions) {
|
|
457
486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
458
487
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
459
|
-
const {
|
|
488
|
+
const { order } = request, _body = __rest(request, ["order"]);
|
|
460
489
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
461
490
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
462
491
|
const _response = yield core.fetcher({
|
|
463
|
-
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(
|
|
492
|
+
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(order)}/purchase-label`),
|
|
464
493
|
method: "POST",
|
|
465
494
|
headers: _headers,
|
|
466
495
|
contentType: "application/json",
|
|
@@ -485,6 +514,8 @@ export class ProductOrdersClient {
|
|
|
485
514
|
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
486
515
|
case 403:
|
|
487
516
|
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
517
|
+
case 404:
|
|
518
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
488
519
|
case 422:
|
|
489
520
|
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
490
521
|
default:
|
|
@@ -495,7 +526,7 @@ export class ProductOrdersClient {
|
|
|
495
526
|
});
|
|
496
527
|
}
|
|
497
528
|
}
|
|
498
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/product-orders/{
|
|
529
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/product-orders/{order}/purchase-label");
|
|
499
530
|
});
|
|
500
531
|
}
|
|
501
532
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
*
|
|
4
|
+
* order: "order",
|
|
5
5
|
* carrier: "carrier",
|
|
6
6
|
* tracking_number: "tracking_number"
|
|
7
7
|
* }
|
|
8
8
|
*/
|
|
9
9
|
export interface AddTrackingProductOrdersRequest {
|
|
10
|
-
|
|
10
|
+
/** The order ID */
|
|
11
|
+
order: string;
|
|
11
12
|
carrier: string;
|
|
12
13
|
tracking_number: string;
|
|
13
14
|
tracking_url?: string | null;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
*
|
|
4
|
+
* order: "order",
|
|
5
5
|
* provider_rate_id: "provider_rate_id"
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface PurchaseLabelProductOrdersRequest {
|
|
9
|
-
|
|
9
|
+
/** The order ID */
|
|
10
|
+
order: string;
|
|
10
11
|
provider_rate_id: string;
|
|
11
12
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* order: "order"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface RefundOrderRequest {
|
|
8
|
+
/** The order ID */
|
|
9
|
+
order: string;
|
|
10
|
+
/** Optional, 1–255 characters. A retry with the same key returns the refund already made instead of refunding again. */
|
|
11
|
+
"Idempotency-Key"?: string;
|
|
12
|
+
amount?: number | null;
|
|
13
|
+
reason?: string | null;
|
|
14
|
+
}
|
|
@@ -5,4 +5,4 @@ export type { GetProductOrdersRequest } from "./GetProductOrdersRequest.mjs";
|
|
|
5
5
|
export type { ListProductOrdersRequest } from "./ListProductOrdersRequest.mjs";
|
|
6
6
|
export type { MarkPickedUpProductOrdersRequest } from "./MarkPickedUpProductOrdersRequest.mjs";
|
|
7
7
|
export type { PurchaseLabelProductOrdersRequest } from "./PurchaseLabelProductOrdersRequest.mjs";
|
|
8
|
-
export type {
|
|
8
|
+
export type { RefundOrderRequest } from "./RefundOrderRequest.mjs";
|
|
@@ -39,7 +39,8 @@ export declare class ProductsClient {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* await client.business.products.create({
|
|
42
|
-
* name: "name"
|
|
42
|
+
* name: "name",
|
|
43
|
+
* tax_code: "tax_code"
|
|
43
44
|
* })
|
|
44
45
|
*/
|
|
45
46
|
create(request: FiveOneEat.business.StoreProductRequest, requestOptions?: ProductsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.CreateProductsResponse>;
|
|
@@ -71,7 +72,8 @@ export declare class ProductsClient {
|
|
|
71
72
|
* @example
|
|
72
73
|
* await client.business.products.update({
|
|
73
74
|
* product: "product",
|
|
74
|
-
* name: "name"
|
|
75
|
+
* name: "name",
|
|
76
|
+
* tax_code: "tax_code"
|
|
75
77
|
* })
|
|
76
78
|
*/
|
|
77
79
|
update(request: FiveOneEat.business.UpdateProductRequest, requestOptions?: ProductsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.UpdateProductsResponse>;
|
|
@@ -103,7 +103,8 @@ export class ProductsClient {
|
|
|
103
103
|
*
|
|
104
104
|
* @example
|
|
105
105
|
* await client.business.products.create({
|
|
106
|
-
* name: "name"
|
|
106
|
+
* name: "name",
|
|
107
|
+
* tax_code: "tax_code"
|
|
107
108
|
* })
|
|
108
109
|
*/
|
|
109
110
|
create(request, requestOptions) {
|
|
@@ -223,7 +224,8 @@ export class ProductsClient {
|
|
|
223
224
|
* @example
|
|
224
225
|
* await client.business.products.update({
|
|
225
226
|
* product: "product",
|
|
226
|
-
* name: "name"
|
|
227
|
+
* name: "name",
|
|
228
|
+
* tax_code: "tax_code"
|
|
227
229
|
* })
|
|
228
230
|
*/
|
|
229
231
|
update(request, requestOptions) {
|
package/dist/esm/api/resources/business/resources/products/client/requests/StoreProductRequest.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* name: "name"
|
|
4
|
+
* name: "name",
|
|
5
|
+
* tax_code: "tax_code"
|
|
5
6
|
* }
|
|
6
7
|
*/
|
|
7
8
|
export interface StoreProductRequest {
|
|
8
9
|
name: string;
|
|
9
10
|
description?: string | null;
|
|
10
11
|
is_active?: boolean;
|
|
12
|
+
tax_code: string;
|
|
11
13
|
product_category_id?: string | null;
|
|
12
14
|
metadata?: string[] | null;
|
|
13
15
|
channel_ids?: string[] | null;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
4
|
* product: "product",
|
|
5
|
-
* name: "name"
|
|
5
|
+
* name: "name",
|
|
6
|
+
* tax_code: "tax_code"
|
|
6
7
|
* }
|
|
7
8
|
*/
|
|
8
9
|
export interface UpdateProductRequest {
|
|
@@ -11,6 +12,7 @@ export interface UpdateProductRequest {
|
|
|
11
12
|
name: string;
|
|
12
13
|
description?: string | null;
|
|
13
14
|
is_active?: boolean;
|
|
15
|
+
tax_code: string;
|
|
14
16
|
product_category_id?: string | null;
|
|
15
17
|
metadata?: string[] | null;
|
|
16
18
|
channel_ids?: string[] | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace TaxCodesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class TaxCodesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<TaxCodesClient.Options>;
|
|
12
|
+
constructor(options?: TaxCodesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Stripe's full product tax code catalog. A product's `tax_code` must be
|
|
15
|
+
* one where `allowed_on_products` is true; a paid ticket type's must be
|
|
16
|
+
* one where `allowed_on_ticket_types` is true.
|
|
17
|
+
*
|
|
18
|
+
* @param {TaxCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* await client.business.taxCodes.list()
|
|
24
|
+
*/
|
|
25
|
+
list(requestOptions?: TaxCodesClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListTaxCodesResponse>;
|
|
26
|
+
private __list;
|
|
27
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../../../index.mjs";
|
|
18
|
+
export class TaxCodesClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Stripe's full product tax code catalog. A product's `tax_code` must be
|
|
24
|
+
* one where `allowed_on_products` is true; a paid ticket type's must be
|
|
25
|
+
* one where `allowed_on_ticket_types` is true.
|
|
26
|
+
*
|
|
27
|
+
* @param {TaxCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await client.business.taxCodes.list()
|
|
33
|
+
*/
|
|
34
|
+
list(requestOptions) {
|
|
35
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
36
|
+
}
|
|
37
|
+
__list(requestOptions) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
41
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
42
|
+
const _response = yield core.fetcher({
|
|
43
|
+
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/tax-codes"),
|
|
44
|
+
method: "GET",
|
|
45
|
+
headers: _headers,
|
|
46
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
47
|
+
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,
|
|
48
|
+
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,
|
|
49
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
50
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
51
|
+
logging: this._options.logging,
|
|
52
|
+
});
|
|
53
|
+
if (_response.ok) {
|
|
54
|
+
return {
|
|
55
|
+
data: _response.body,
|
|
56
|
+
rawResponse: _response.rawResponse,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (_response.error.reason === "status-code") {
|
|
60
|
+
switch (_response.error.statusCode) {
|
|
61
|
+
case 401:
|
|
62
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
63
|
+
default:
|
|
64
|
+
throw new errors.FiveOneEatError({
|
|
65
|
+
statusCode: _response.error.statusCode,
|
|
66
|
+
body: _response.error.body,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/tax-codes");
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|