@51eat/sdk 0.0.78 → 1.0.0
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/README.md +15 -13
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +0 -3
- package/dist/cjs/Client.js +2 -7
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +13 -0
- package/dist/cjs/api/resources/customer/resources/businesses/types/GetPickupTimeslotsBusinessesResponse.d.ts +2 -5
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +13 -4
- package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +13 -4
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.ts +6 -4
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.d.ts → UpdateCartItemRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/shop/client/requests/GetProductShopRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/shop/client/requests/ListCategoriesShopRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/shop/client/requests/ListProductsShopRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.d.ts +71 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/Client.js +243 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/requests/AddCartItemStandsRequest.d.ts +16 -0
- package/dist/{esm/api/resources/customerStands/client/requests/CustomerGetStandCartRequest.d.mts → cjs/api/resources/customer/resources/stands/client/requests/ClearCartStandsRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/{customerStands/client/requests/CustomerGetStandCartRequest.d.ts → customer/resources/stands/client/requests/GetCartStandsRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/customer/resources/stands/client/requests/NearbyStandsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customer/resources/stands/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/AddCartItemStandsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/GetCartStandsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/GetCartStandsResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/NearbyStandsResponse.d.ts +10 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/NearbyStandsResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/customer/resources/stands/types/index.js +3 -0
- package/dist/cjs/api/resources/index.d.ts +0 -3
- package/dist/cjs/api/resources/index.js +1 -4
- package/dist/cjs/api/types/AddCartItemRequest.d.ts +9 -0
- package/dist/cjs/api/types/AddCartItemRequest.js +3 -0
- package/dist/cjs/api/types/BusinessEvent.d.ts +1 -0
- package/dist/cjs/api/types/CartResource.d.ts +5 -0
- package/dist/cjs/api/types/ExploreResponse.d.ts +1 -0
- package/dist/cjs/api/types/ExploreStand.d.ts +18 -0
- package/dist/cjs/api/types/ExploreStand.js +3 -0
- package/dist/cjs/api/types/NearbyStand.d.ts +19 -0
- package/dist/cjs/api/types/NearbyStand.js +3 -0
- package/dist/cjs/api/types/OrderResource.d.ts +9 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -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 +0 -3
- package/dist/esm/Client.mjs +0 -5
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +13 -0
- package/dist/esm/api/resources/customer/resources/businesses/types/GetPickupTimeslotsBusinessesResponse.d.mts +2 -5
- package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +13 -4
- package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +13 -4
- package/dist/esm/api/resources/customer/resources/cart/client/requests/AddItemCartRequest.d.mts +6 -4
- package/dist/esm/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.d.mts → UpdateCartItemRequest.d.mts} +1 -1
- package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/shop/client/requests/GetProductShopRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/shop/client/requests/ListCategoriesShopRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/shop/client/requests/ListProductsShopRequest.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/stands/client/Client.d.mts +71 -0
- package/dist/esm/api/resources/customer/resources/stands/client/Client.mjs +243 -0
- package/dist/esm/api/resources/customer/resources/stands/client/requests/AddCartItemStandsRequest.d.mts +16 -0
- package/dist/esm/api/resources/{customerStands/client/requests/CustomerClearStandCartRequest.d.mts → customer/resources/stands/client/requests/ClearCartStandsRequest.d.mts} +1 -1
- package/dist/{cjs/api/resources/customerStands/client/requests/CustomerClearStandCartRequest.d.ts → esm/api/resources/customer/resources/stands/client/requests/GetCartStandsRequest.d.mts} +1 -1
- package/dist/esm/api/resources/customer/resources/stands/client/requests/NearbyStandsRequest.d.mts +13 -0
- package/dist/esm/api/resources/customer/resources/stands/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/stands/types/AddCartItemStandsResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/stands/types/GetCartStandsResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/stands/types/GetCartStandsResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/stands/types/NearbyStandsResponse.d.mts +10 -0
- package/dist/esm/api/resources/customer/resources/stands/types/NearbyStandsResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/stands/types/index.d.mts +3 -0
- package/dist/esm/api/resources/customer/resources/stands/types/index.mjs +3 -0
- package/dist/esm/api/resources/index.d.mts +0 -3
- package/dist/esm/api/resources/index.mjs +0 -3
- package/dist/esm/api/types/AddCartItemRequest.d.mts +9 -0
- package/dist/esm/api/types/AddCartItemRequest.mjs +2 -0
- package/dist/esm/api/types/BusinessEvent.d.mts +1 -0
- package/dist/esm/api/types/CartResource.d.mts +5 -0
- package/dist/esm/api/types/ExploreResponse.d.mts +1 -0
- package/dist/esm/api/types/ExploreStand.d.mts +18 -0
- package/dist/esm/api/types/ExploreStand.mjs +2 -0
- package/dist/esm/api/types/NearbyStand.d.mts +19 -0
- package/dist/esm/api/types/NearbyStand.mjs +2 -0
- package/dist/esm/api/types/OrderResource.d.mts +9 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -13
- package/reference.md +310 -159
- package/dist/cjs/api/resources/customerStands/client/Client.d.ts +0 -58
- package/dist/cjs/api/resources/customerStands/client/Client.js +0 -240
- package/dist/cjs/api/resources/customerStands/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/customerStands/client/index.js +0 -17
- package/dist/cjs/api/resources/customerStands/client/requests/CustomerAddStandCartItemRequest.d.ts +0 -14
- package/dist/cjs/api/resources/customerStands/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/customerStands/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/customerStands/exports.d.ts +0 -2
- package/dist/cjs/api/resources/customerStands/exports.js +0 -21
- package/dist/cjs/api/resources/customerStands/index.d.ts +0 -2
- package/dist/cjs/api/resources/customerStands/index.js +0 -18
- package/dist/cjs/api/resources/customerStands/types/CustomerAddStandCartItemResponse.d.ts +0 -4
- package/dist/cjs/api/resources/customerStands/types/CustomerGetStandCartResponse.d.ts +0 -4
- package/dist/cjs/api/resources/customerStands/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/customerStands/types/index.js +0 -18
- package/dist/esm/api/resources/customerStands/client/Client.d.mts +0 -58
- package/dist/esm/api/resources/customerStands/client/Client.mjs +0 -203
- package/dist/esm/api/resources/customerStands/client/index.d.mts +0 -1
- package/dist/esm/api/resources/customerStands/client/index.mjs +0 -1
- package/dist/esm/api/resources/customerStands/client/requests/CustomerAddStandCartItemRequest.d.mts +0 -14
- package/dist/esm/api/resources/customerStands/client/requests/index.d.mts +0 -3
- package/dist/esm/api/resources/customerStands/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/customerStands/exports.d.mts +0 -2
- package/dist/esm/api/resources/customerStands/exports.mjs +0 -3
- package/dist/esm/api/resources/customerStands/index.d.mts +0 -2
- package/dist/esm/api/resources/customerStands/index.mjs +0 -2
- package/dist/esm/api/resources/customerStands/types/CustomerAddStandCartItemResponse.d.mts +0 -4
- package/dist/esm/api/resources/customerStands/types/CustomerGetStandCartResponse.d.mts +0 -4
- package/dist/esm/api/resources/customerStands/types/index.d.mts +0 -2
- package/dist/esm/api/resources/customerStands/types/index.mjs +0 -2
- /package/dist/cjs/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.js → UpdateCartItemRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerAddStandCartItemRequest.js → customer/resources/stands/client/requests/AddCartItemStandsRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerClearStandCartRequest.js → customer/resources/stands/client/requests/ClearCartStandsRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customerStands/client/requests/CustomerGetStandCartRequest.js → customer/resources/stands/client/requests/GetCartStandsRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customerStands/types/CustomerAddStandCartItemResponse.js → customer/resources/stands/client/requests/NearbyStandsRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customerStands/types/CustomerGetStandCartResponse.js → customer/resources/stands/types/AddCartItemStandsResponse.js} +0 -0
- /package/dist/esm/api/resources/customer/resources/cart/client/requests/{UpdateItemCartRequest.mjs → UpdateCartItemRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customerStands/client/requests/CustomerAddStandCartItemRequest.mjs → customer/resources/stands/client/requests/AddCartItemStandsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customerStands/client/requests/CustomerClearStandCartRequest.mjs → customer/resources/stands/client/requests/ClearCartStandsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customerStands/client/requests/CustomerGetStandCartRequest.mjs → customer/resources/stands/client/requests/GetCartStandsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customerStands/types/CustomerAddStandCartItemResponse.mjs → customer/resources/stands/client/requests/NearbyStandsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customerStands/types/CustomerGetStandCartResponse.mjs → customer/resources/stands/types/AddCartItemStandsResponse.mjs} +0 -0
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
-
var t = {};
|
|
47
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
-
t[p] = s[p];
|
|
49
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
-
t[p[i]] = s[p[i]];
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
};
|
|
56
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.CustomerStandsClient = void 0;
|
|
58
|
-
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
59
|
-
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
-
const environments = __importStar(require("../../../../environments.js"));
|
|
62
|
-
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
63
|
-
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
|
-
const FiveOneEat = __importStar(require("../../../index.js"));
|
|
65
|
-
class CustomerStandsClient {
|
|
66
|
-
constructor(options = {}) {
|
|
67
|
-
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @param {FiveOneEat.CustomerGetStandCartRequest} request
|
|
71
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
-
*
|
|
73
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
74
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* await client.customerStands.customerGetStandCart({
|
|
78
|
-
* stand: "stand"
|
|
79
|
-
* })
|
|
80
|
-
*/
|
|
81
|
-
customerGetStandCart(request, requestOptions) {
|
|
82
|
-
return core.HttpResponsePromise.fromPromise(this.__customerGetStandCart(request, requestOptions));
|
|
83
|
-
}
|
|
84
|
-
__customerGetStandCart(request, requestOptions) {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
|
-
const { stand } = request;
|
|
88
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
89
|
-
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);
|
|
90
|
-
const _response = yield core.fetcher({
|
|
91
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/stands/${core.url.encodePathParam(stand)}/cart`),
|
|
92
|
-
method: "GET",
|
|
93
|
-
headers: _headers,
|
|
94
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
95
|
-
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,
|
|
96
|
-
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,
|
|
97
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
98
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
99
|
-
logging: this._options.logging,
|
|
100
|
-
});
|
|
101
|
-
if (_response.ok) {
|
|
102
|
-
return {
|
|
103
|
-
data: _response.body,
|
|
104
|
-
rawResponse: _response.rawResponse,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
if (_response.error.reason === "status-code") {
|
|
108
|
-
switch (_response.error.statusCode) {
|
|
109
|
-
case 401:
|
|
110
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
111
|
-
case 404:
|
|
112
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
113
|
-
default:
|
|
114
|
-
throw new errors.FiveOneEatError({
|
|
115
|
-
statusCode: _response.error.statusCode,
|
|
116
|
-
body: _response.error.body,
|
|
117
|
-
rawResponse: _response.rawResponse,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/stands/{stand}/cart");
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* @param {FiveOneEat.CustomerAddStandCartItemRequest} request
|
|
126
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
127
|
-
*
|
|
128
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
129
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
130
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* await client.customerStands.customerAddStandCartItem({
|
|
134
|
-
* stand: "stand",
|
|
135
|
-
* variant_id: "variant_id",
|
|
136
|
-
* quantity: 1
|
|
137
|
-
* })
|
|
138
|
-
*/
|
|
139
|
-
customerAddStandCartItem(request, requestOptions) {
|
|
140
|
-
return core.HttpResponsePromise.fromPromise(this.__customerAddStandCartItem(request, requestOptions));
|
|
141
|
-
}
|
|
142
|
-
__customerAddStandCartItem(request, requestOptions) {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
145
|
-
const { stand } = request, _body = __rest(request, ["stand"]);
|
|
146
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
147
|
-
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);
|
|
148
|
-
const _response = yield core.fetcher({
|
|
149
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/stands/${core.url.encodePathParam(stand)}/cart`),
|
|
150
|
-
method: "POST",
|
|
151
|
-
headers: _headers,
|
|
152
|
-
contentType: "application/json",
|
|
153
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
154
|
-
requestType: "json",
|
|
155
|
-
body: _body,
|
|
156
|
-
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,
|
|
157
|
-
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,
|
|
158
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
159
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
160
|
-
logging: this._options.logging,
|
|
161
|
-
});
|
|
162
|
-
if (_response.ok) {
|
|
163
|
-
return {
|
|
164
|
-
data: _response.body,
|
|
165
|
-
rawResponse: _response.rawResponse,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
if (_response.error.reason === "status-code") {
|
|
169
|
-
switch (_response.error.statusCode) {
|
|
170
|
-
case 401:
|
|
171
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
172
|
-
case 404:
|
|
173
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
174
|
-
case 422:
|
|
175
|
-
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
176
|
-
default:
|
|
177
|
-
throw new errors.FiveOneEatError({
|
|
178
|
-
statusCode: _response.error.statusCode,
|
|
179
|
-
body: _response.error.body,
|
|
180
|
-
rawResponse: _response.rawResponse,
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart");
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* @param {FiveOneEat.CustomerClearStandCartRequest} request
|
|
189
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
190
|
-
*
|
|
191
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
192
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* await client.customerStands.customerClearStandCart({
|
|
196
|
-
* stand: "stand"
|
|
197
|
-
* })
|
|
198
|
-
*/
|
|
199
|
-
customerClearStandCart(request, requestOptions) {
|
|
200
|
-
return core.HttpResponsePromise.fromPromise(this.__customerClearStandCart(request, requestOptions));
|
|
201
|
-
}
|
|
202
|
-
__customerClearStandCart(request, requestOptions) {
|
|
203
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
205
|
-
const { stand } = request;
|
|
206
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
207
|
-
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);
|
|
208
|
-
const _response = yield core.fetcher({
|
|
209
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/stands/${core.url.encodePathParam(stand)}/cart`),
|
|
210
|
-
method: "DELETE",
|
|
211
|
-
headers: _headers,
|
|
212
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
213
|
-
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,
|
|
214
|
-
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,
|
|
215
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
216
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
217
|
-
logging: this._options.logging,
|
|
218
|
-
});
|
|
219
|
-
if (_response.ok) {
|
|
220
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
221
|
-
}
|
|
222
|
-
if (_response.error.reason === "status-code") {
|
|
223
|
-
switch (_response.error.statusCode) {
|
|
224
|
-
case 401:
|
|
225
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
226
|
-
case 404:
|
|
227
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
228
|
-
default:
|
|
229
|
-
throw new errors.FiveOneEatError({
|
|
230
|
-
statusCode: _response.error.statusCode,
|
|
231
|
-
body: _response.error.body,
|
|
232
|
-
rawResponse: _response.rawResponse,
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/customer/stands/{stand}/cart");
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
exports.CustomerStandsClient = CustomerStandsClient;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.js";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -1,21 +0,0 @@
|
|
|
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.CustomerStandsClient = void 0;
|
|
19
|
-
var Client_js_1 = require("./client/Client.js");
|
|
20
|
-
Object.defineProperty(exports, "CustomerStandsClient", { enumerable: true, get: function () { return Client_js_1.CustomerStandsClient; } });
|
|
21
|
-
__exportStar(require("./client/index.js"), exports);
|
|
@@ -1,18 +0,0 @@
|
|
|
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);
|
|
@@ -1,18 +0,0 @@
|
|
|
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("./CustomerAddStandCartItemResponse.js"), exports);
|
|
18
|
-
__exportStar(require("./CustomerGetStandCartResponse.js"), exports);
|
|
@@ -1,58 +0,0 @@
|
|
|
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 CustomerStandsClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class CustomerStandsClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<CustomerStandsClient.Options>;
|
|
12
|
-
constructor(options?: CustomerStandsClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* @param {FiveOneEat.CustomerGetStandCartRequest} request
|
|
15
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
|
-
*
|
|
17
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
18
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* await client.customerStands.customerGetStandCart({
|
|
22
|
-
* stand: "stand"
|
|
23
|
-
* })
|
|
24
|
-
*/
|
|
25
|
-
customerGetStandCart(request: FiveOneEat.CustomerGetStandCartRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CustomerGetStandCartResponse>;
|
|
26
|
-
private __customerGetStandCart;
|
|
27
|
-
/**
|
|
28
|
-
* @param {FiveOneEat.CustomerAddStandCartItemRequest} request
|
|
29
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
-
*
|
|
31
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
32
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
33
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* await client.customerStands.customerAddStandCartItem({
|
|
37
|
-
* stand: "stand",
|
|
38
|
-
* variant_id: "variant_id",
|
|
39
|
-
* quantity: 1
|
|
40
|
-
* })
|
|
41
|
-
*/
|
|
42
|
-
customerAddStandCartItem(request: FiveOneEat.CustomerAddStandCartItemRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CustomerAddStandCartItemResponse>;
|
|
43
|
-
private __customerAddStandCartItem;
|
|
44
|
-
/**
|
|
45
|
-
* @param {FiveOneEat.CustomerClearStandCartRequest} request
|
|
46
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
-
*
|
|
48
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
49
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* await client.customerStands.customerClearStandCart({
|
|
53
|
-
* stand: "stand"
|
|
54
|
-
* })
|
|
55
|
-
*/
|
|
56
|
-
customerClearStandCart(request: FiveOneEat.CustomerClearStandCartRequest, requestOptions?: CustomerStandsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
57
|
-
private __customerClearStandCart;
|
|
58
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
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
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
|
-
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
|
-
import * as core from "../../../../core/index.mjs";
|
|
25
|
-
import * as environments from "../../../../environments.mjs";
|
|
26
|
-
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
-
import * as errors from "../../../../errors/index.mjs";
|
|
28
|
-
import * as FiveOneEat from "../../../index.mjs";
|
|
29
|
-
export class CustomerStandsClient {
|
|
30
|
-
constructor(options = {}) {
|
|
31
|
-
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @param {FiveOneEat.CustomerGetStandCartRequest} request
|
|
35
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
-
*
|
|
37
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
38
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* await client.customerStands.customerGetStandCart({
|
|
42
|
-
* stand: "stand"
|
|
43
|
-
* })
|
|
44
|
-
*/
|
|
45
|
-
customerGetStandCart(request, requestOptions) {
|
|
46
|
-
return core.HttpResponsePromise.fromPromise(this.__customerGetStandCart(request, requestOptions));
|
|
47
|
-
}
|
|
48
|
-
__customerGetStandCart(request, requestOptions) {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
51
|
-
const { stand } = request;
|
|
52
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
53
|
-
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);
|
|
54
|
-
const _response = yield core.fetcher({
|
|
55
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/stands/${core.url.encodePathParam(stand)}/cart`),
|
|
56
|
-
method: "GET",
|
|
57
|
-
headers: _headers,
|
|
58
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
59
|
-
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,
|
|
60
|
-
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,
|
|
61
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
62
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
63
|
-
logging: this._options.logging,
|
|
64
|
-
});
|
|
65
|
-
if (_response.ok) {
|
|
66
|
-
return {
|
|
67
|
-
data: _response.body,
|
|
68
|
-
rawResponse: _response.rawResponse,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
if (_response.error.reason === "status-code") {
|
|
72
|
-
switch (_response.error.statusCode) {
|
|
73
|
-
case 401:
|
|
74
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
75
|
-
case 404:
|
|
76
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
77
|
-
default:
|
|
78
|
-
throw new errors.FiveOneEatError({
|
|
79
|
-
statusCode: _response.error.statusCode,
|
|
80
|
-
body: _response.error.body,
|
|
81
|
-
rawResponse: _response.rawResponse,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/stands/{stand}/cart");
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* @param {FiveOneEat.CustomerAddStandCartItemRequest} request
|
|
90
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
|
-
*
|
|
92
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
93
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
94
|
-
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* await client.customerStands.customerAddStandCartItem({
|
|
98
|
-
* stand: "stand",
|
|
99
|
-
* variant_id: "variant_id",
|
|
100
|
-
* quantity: 1
|
|
101
|
-
* })
|
|
102
|
-
*/
|
|
103
|
-
customerAddStandCartItem(request, requestOptions) {
|
|
104
|
-
return core.HttpResponsePromise.fromPromise(this.__customerAddStandCartItem(request, requestOptions));
|
|
105
|
-
}
|
|
106
|
-
__customerAddStandCartItem(request, requestOptions) {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
109
|
-
const { stand } = request, _body = __rest(request, ["stand"]);
|
|
110
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
111
|
-
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);
|
|
112
|
-
const _response = yield core.fetcher({
|
|
113
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `customer/stands/${core.url.encodePathParam(stand)}/cart`),
|
|
114
|
-
method: "POST",
|
|
115
|
-
headers: _headers,
|
|
116
|
-
contentType: "application/json",
|
|
117
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
118
|
-
requestType: "json",
|
|
119
|
-
body: _body,
|
|
120
|
-
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,
|
|
121
|
-
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,
|
|
122
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
123
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
124
|
-
logging: this._options.logging,
|
|
125
|
-
});
|
|
126
|
-
if (_response.ok) {
|
|
127
|
-
return {
|
|
128
|
-
data: _response.body,
|
|
129
|
-
rawResponse: _response.rawResponse,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (_response.error.reason === "status-code") {
|
|
133
|
-
switch (_response.error.statusCode) {
|
|
134
|
-
case 401:
|
|
135
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
136
|
-
case 404:
|
|
137
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
138
|
-
case 422:
|
|
139
|
-
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
140
|
-
default:
|
|
141
|
-
throw new errors.FiveOneEatError({
|
|
142
|
-
statusCode: _response.error.statusCode,
|
|
143
|
-
body: _response.error.body,
|
|
144
|
-
rawResponse: _response.rawResponse,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/stands/{stand}/cart");
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* @param {FiveOneEat.CustomerClearStandCartRequest} request
|
|
153
|
-
* @param {CustomerStandsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
154
|
-
*
|
|
155
|
-
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
156
|
-
* @throws {@link FiveOneEat.NotFoundError}
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* await client.customerStands.customerClearStandCart({
|
|
160
|
-
* stand: "stand"
|
|
161
|
-
* })
|
|
162
|
-
*/
|
|
163
|
-
customerClearStandCart(request, requestOptions) {
|
|
164
|
-
return core.HttpResponsePromise.fromPromise(this.__customerClearStandCart(request, requestOptions));
|
|
165
|
-
}
|
|
166
|
-
__customerClearStandCart(request, requestOptions) {
|
|
167
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
169
|
-
const { stand } = request;
|
|
170
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
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);
|
|
172
|
-
const _response = yield core.fetcher({
|
|
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, `customer/stands/${core.url.encodePathParam(stand)}/cart`),
|
|
174
|
-
method: "DELETE",
|
|
175
|
-
headers: _headers,
|
|
176
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
177
|
-
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,
|
|
178
|
-
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,
|
|
179
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
180
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
181
|
-
logging: this._options.logging,
|
|
182
|
-
});
|
|
183
|
-
if (_response.ok) {
|
|
184
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
185
|
-
}
|
|
186
|
-
if (_response.error.reason === "status-code") {
|
|
187
|
-
switch (_response.error.statusCode) {
|
|
188
|
-
case 401:
|
|
189
|
-
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
190
|
-
case 404:
|
|
191
|
-
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
192
|
-
default:
|
|
193
|
-
throw new errors.FiveOneEatError({
|
|
194
|
-
statusCode: _response.error.statusCode,
|
|
195
|
-
body: _response.error.body,
|
|
196
|
-
rawResponse: _response.rawResponse,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/customer/stands/{stand}/cart");
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.mjs";
|