@51eat/sdk 0.0.21 → 0.0.23
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 +16 -13
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +0 -6
- package/dist/cjs/Client.js +10 -20
- package/dist/cjs/api/resources/business/client/Client.d.ts +17 -2
- package/dist/cjs/api/resources/business/client/Client.js +34 -9
- package/dist/cjs/api/resources/business/resources/businesses/client/Client.d.ts +62 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/Client.js +260 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/businesses/exports.d.ts +2 -0
- package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/exports.js +2 -2
- package/dist/cjs/api/resources/business/resources/categories/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/{businessMessaging → business/resources/categories}/client/Client.js +23 -45
- package/dist/cjs/api/resources/business/resources/categories/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/categories/exports.d.ts +2 -0
- package/dist/cjs/api/resources/{businessPushNotifications → business/resources/categories}/exports.js +2 -2
- package/dist/cjs/api/resources/business/resources/categories/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/categories/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/Client.js +96 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/certifications/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/certifications/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/certifications/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/certifications/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/certifications/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/Client.js +96 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/cuisines/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/cuisines/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/cuisines/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/cuisines/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/cuisines/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/index.js +10 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.d.ts +24 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.js +107 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/index.js +15 -0
- package/dist/cjs/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.ts → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/requests/ChannelAuthMessagingRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/pushNotifications/client/Client.d.ts +47 -0
- package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/Client.js +22 -22
- package/dist/cjs/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.ts → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/pushNotifications/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/pushNotifications/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/pushNotifications/exports.js +21 -0
- package/dist/cjs/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.ts → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.ts} +1 -1
- package/dist/cjs/api/resources/business/resources/pushNotifications/types/RegisterPushNotificationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/pushNotifications/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/types/index.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +0 -5
- package/dist/cjs/api/resources/index.js +1 -6
- 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 -6
- package/dist/esm/Client.mjs +0 -10
- package/dist/esm/api/resources/business/client/Client.d.mts +17 -2
- package/dist/esm/api/resources/business/client/Client.mjs +27 -2
- package/dist/esm/api/resources/business/resources/businesses/client/Client.d.mts +62 -0
- package/dist/esm/api/resources/business/resources/businesses/client/Client.mjs +223 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/businesses/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/businesses/exports.d.mts +2 -0
- package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/exports.mjs +1 -1
- package/dist/esm/api/resources/business/resources/categories/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/{businessMessaging → business/resources/categories}/client/Client.mjs +21 -43
- package/dist/esm/api/resources/business/resources/categories/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/categories/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/categories/exports.d.mts +2 -0
- package/dist/esm/api/resources/{businessPushNotifications → business/resources/categories}/exports.mjs +1 -1
- package/dist/esm/api/resources/business/resources/categories/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/categories/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/certifications/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/business/resources/certifications/client/Client.mjs +59 -0
- package/dist/esm/api/resources/business/resources/certifications/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/certifications/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/certifications/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/certifications/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/certifications/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/certifications/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/Client.mjs +59 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/cuisines/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/cuisines/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/cuisines/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/index.mjs +9 -0
- package/dist/esm/api/resources/business/resources/messaging/client/Client.d.mts +24 -1
- package/dist/esm/api/resources/business/resources/messaging/client/Client.mjs +74 -0
- package/dist/esm/api/resources/business/resources/messaging/client/index.d.mts +1 -1
- package/dist/esm/api/resources/business/resources/messaging/client/index.mjs +1 -1
- package/dist/esm/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.mts → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.d.mts} +1 -1
- package/dist/esm/api/resources/business/resources/messaging/client/requests/ChannelAuthMessagingRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/client/Client.d.mts +47 -0
- package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/Client.mjs +20 -20
- package/dist/esm/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.mts → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.d.mts} +1 -1
- package/dist/esm/api/resources/business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/exports.mjs +3 -0
- package/dist/esm/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.mts → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.mts} +1 -1
- package/dist/esm/api/resources/business/resources/pushNotifications/types/RegisterPushNotificationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/pushNotifications/types/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +0 -5
- package/dist/esm/api/resources/index.mjs +0 -5
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +67 -34
- package/reference.md +564 -202
- package/dist/cjs/api/resources/businessMessaging/client/Client.d.ts +0 -32
- package/dist/cjs/api/resources/businessMessaging/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/businessMessaging/exports.d.ts +0 -2
- package/dist/cjs/api/resources/businessPushNotifications/client/Client.d.ts +0 -47
- package/dist/cjs/api/resources/businessPushNotifications/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/businessPushNotifications/exports.d.ts +0 -2
- package/dist/cjs/api/resources/businessPushNotifications/types/index.d.ts +0 -1
- package/dist/esm/api/resources/businessMessaging/client/Client.d.mts +0 -32
- package/dist/esm/api/resources/businessMessaging/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/businessMessaging/exports.d.mts +0 -2
- package/dist/esm/api/resources/businessPushNotifications/client/Client.d.mts +0 -47
- package/dist/esm/api/resources/businessPushNotifications/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/businessPushNotifications/exports.d.mts +0 -2
- package/dist/esm/api/resources/businessPushNotifications/types/index.d.mts +0 -1
- package/dist/esm/api/resources/businessPushNotifications/types/index.mjs +0 -1
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.js → business/resources/businesses/client/requests/DeleteBusinessesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.js → business/resources/businesses/client/requests/GetBusinessesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.js → business/resources/businesses/client/requests/UpdateBusinessesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessMessaging → business/resources/businesses}/index.js +0 -0
- /package/dist/{esm/api/resources/businessMessaging/client/requests/index.mjs → cjs/api/resources/business/resources/categories/client/index.d.ts} +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.js +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.js +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.mjs → business/resources/businesses/client/requests/DeleteBusinessesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.mjs → business/resources/businesses/client/requests/GetBusinessesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.mjs → business/resources/businesses/client/requests/UpdateBusinessesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessMessaging → business/resources/businesses}/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.mjs +0 -0
package/README.md
CHANGED
|
@@ -45,9 +45,12 @@ Instantiate and use the client with the following:
|
|
|
45
45
|
import { FiveOneEatClient } from "@51eat/sdk";
|
|
46
46
|
|
|
47
47
|
const client = new FiveOneEatClient({ token: "YOUR_TOKEN" });
|
|
48
|
-
await client.
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
await client.customerEvents.holdTickets({
|
|
49
|
+
eventId: "eventId",
|
|
50
|
+
tickets: [{
|
|
51
|
+
ticket_type_id: "ticket_type_id",
|
|
52
|
+
quantity: 1
|
|
53
|
+
}]
|
|
51
54
|
});
|
|
52
55
|
```
|
|
53
56
|
|
|
@@ -71,7 +74,7 @@ following namespace:
|
|
|
71
74
|
```typescript
|
|
72
75
|
import { FiveOneEat } from "@51eat/sdk";
|
|
73
76
|
|
|
74
|
-
const request: FiveOneEat.
|
|
77
|
+
const request: FiveOneEat.StoreTicketHoldRequest = {
|
|
75
78
|
...
|
|
76
79
|
};
|
|
77
80
|
```
|
|
@@ -85,7 +88,7 @@ will be thrown.
|
|
|
85
88
|
import { FiveOneEatError } from "@51eat/sdk";
|
|
86
89
|
|
|
87
90
|
try {
|
|
88
|
-
await client.
|
|
91
|
+
await client.customerEvents.holdTickets(...);
|
|
89
92
|
} catch (err) {
|
|
90
93
|
if (err instanceof FiveOneEatError) {
|
|
91
94
|
console.log(err.statusCode);
|
|
@@ -147,9 +150,9 @@ For example, `fs.ReadStream` has a `path` property which the SDK uses to retriev
|
|
|
147
150
|
This SDK supports direct imports of subpackage clients, which allows JavaScript bundlers to tree-shake and include only the imported subpackage code. This results in much smaller bundle sizes.
|
|
148
151
|
|
|
149
152
|
```typescript
|
|
150
|
-
import {
|
|
153
|
+
import { CustomerEventsClient } from '@51eat/sdk/customerEvents';
|
|
151
154
|
|
|
152
|
-
const client = new
|
|
155
|
+
const client = new CustomerEventsClient({...});
|
|
153
156
|
```
|
|
154
157
|
|
|
155
158
|
### Additional Headers
|
|
@@ -166,7 +169,7 @@ const client = new FiveOneEatClient({
|
|
|
166
169
|
}
|
|
167
170
|
});
|
|
168
171
|
|
|
169
|
-
const response = await client.
|
|
172
|
+
const response = await client.customerEvents.holdTickets(..., {
|
|
170
173
|
headers: {
|
|
171
174
|
'X-Custom-Header': 'custom value'
|
|
172
175
|
}
|
|
@@ -178,7 +181,7 @@ const response = await client.businessMessaging.businessChannelAuthAuthenticate(
|
|
|
178
181
|
If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
|
|
179
182
|
|
|
180
183
|
```typescript
|
|
181
|
-
const response = await client.
|
|
184
|
+
const response = await client.customerEvents.holdTickets(..., {
|
|
182
185
|
queryParams: {
|
|
183
186
|
'customQueryParamKey': 'custom query param value'
|
|
184
187
|
}
|
|
@@ -200,7 +203,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
200
203
|
Use the `maxRetries` request option to configure this behavior.
|
|
201
204
|
|
|
202
205
|
```typescript
|
|
203
|
-
const response = await client.
|
|
206
|
+
const response = await client.customerEvents.holdTickets(..., {
|
|
204
207
|
maxRetries: 0 // override maxRetries at the request level
|
|
205
208
|
});
|
|
206
209
|
```
|
|
@@ -210,7 +213,7 @@ const response = await client.businessMessaging.businessChannelAuthAuthenticate(
|
|
|
210
213
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
211
214
|
|
|
212
215
|
```typescript
|
|
213
|
-
const response = await client.
|
|
216
|
+
const response = await client.customerEvents.holdTickets(..., {
|
|
214
217
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
215
218
|
});
|
|
216
219
|
```
|
|
@@ -221,7 +224,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
|
|
|
221
224
|
|
|
222
225
|
```typescript
|
|
223
226
|
const controller = new AbortController();
|
|
224
|
-
const response = await client.
|
|
227
|
+
const response = await client.customerEvents.holdTickets(..., {
|
|
225
228
|
abortSignal: controller.signal
|
|
226
229
|
});
|
|
227
230
|
controller.abort(); // aborts the request
|
|
@@ -233,7 +236,7 @@ The SDK provides access to raw response data, including headers, through the `.w
|
|
|
233
236
|
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
234
237
|
|
|
235
238
|
```typescript
|
|
236
|
-
const { data, rawResponse } = await client.
|
|
239
|
+
const { data, rawResponse } = await client.customerEvents.holdTickets(...).withRawResponse();
|
|
237
240
|
|
|
238
241
|
console.log(data);
|
|
239
242
|
console.log(rawResponse.headers['X-My-Header']);
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "0.0.
|
|
47
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.0.23",
|
|
47
|
+
"User-Agent": "@51eat/sdk/0.0.23",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { BusinessClient } from "./api/resources/business/client/Client.js";
|
|
2
|
-
import { BusinessMessagingClient } from "./api/resources/businessMessaging/client/Client.js";
|
|
3
|
-
import { BusinessPushNotificationsClient } from "./api/resources/businessPushNotifications/client/Client.js";
|
|
4
2
|
import { CustomerClient } from "./api/resources/customer/client/Client.js";
|
|
5
3
|
import { CustomerEventsClient } from "./api/resources/customerEvents/client/Client.js";
|
|
6
4
|
import { CustomerMyAccountClient } from "./api/resources/customerMyAccount/client/Client.js";
|
|
@@ -16,8 +14,6 @@ export declare namespace FiveOneEatClient {
|
|
|
16
14
|
}
|
|
17
15
|
export declare class FiveOneEatClient {
|
|
18
16
|
protected readonly _options: NormalizedClientOptionsWithAuth<FiveOneEatClient.Options>;
|
|
19
|
-
protected _businessMessaging: BusinessMessagingClient | undefined;
|
|
20
|
-
protected _businessPushNotifications: BusinessPushNotificationsClient | undefined;
|
|
21
17
|
protected _customerEvents: CustomerEventsClient | undefined;
|
|
22
18
|
protected _customerMyAccount: CustomerMyAccountClient | undefined;
|
|
23
19
|
protected _customer: CustomerClient | undefined;
|
|
@@ -25,8 +21,6 @@ export declare class FiveOneEatClient {
|
|
|
25
21
|
protected _serveAd: ServeAdClient | undefined;
|
|
26
22
|
protected _business: BusinessClient | undefined;
|
|
27
23
|
constructor(options?: FiveOneEatClient.Options);
|
|
28
|
-
get businessMessaging(): BusinessMessagingClient;
|
|
29
|
-
get businessPushNotifications(): BusinessPushNotificationsClient;
|
|
30
24
|
get customerEvents(): CustomerEventsClient;
|
|
31
25
|
get customerMyAccount(): CustomerMyAccountClient;
|
|
32
26
|
get customer(): CustomerClient;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -45,46 +45,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.FiveOneEatClient = void 0;
|
|
47
47
|
const Client_js_1 = require("./api/resources/business/client/Client.js");
|
|
48
|
-
const Client_js_2 = require("./api/resources/
|
|
49
|
-
const Client_js_3 = require("./api/resources/
|
|
50
|
-
const Client_js_4 = require("./api/resources/
|
|
51
|
-
const Client_js_5 = require("./api/resources/
|
|
52
|
-
const Client_js_6 = require("./api/resources/
|
|
53
|
-
const Client_js_7 = require("./api/resources/recordClick/client/Client.js");
|
|
54
|
-
const Client_js_8 = require("./api/resources/serveAd/client/Client.js");
|
|
48
|
+
const Client_js_2 = require("./api/resources/customer/client/Client.js");
|
|
49
|
+
const Client_js_3 = require("./api/resources/customerEvents/client/Client.js");
|
|
50
|
+
const Client_js_4 = require("./api/resources/customerMyAccount/client/Client.js");
|
|
51
|
+
const Client_js_5 = require("./api/resources/recordClick/client/Client.js");
|
|
52
|
+
const Client_js_6 = require("./api/resources/serveAd/client/Client.js");
|
|
55
53
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
56
54
|
const core = __importStar(require("./core/index.js"));
|
|
57
55
|
class FiveOneEatClient {
|
|
58
56
|
constructor(options = {}) {
|
|
59
57
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
60
58
|
}
|
|
61
|
-
get businessMessaging() {
|
|
62
|
-
var _a;
|
|
63
|
-
return ((_a = this._businessMessaging) !== null && _a !== void 0 ? _a : (this._businessMessaging = new Client_js_2.BusinessMessagingClient(this._options)));
|
|
64
|
-
}
|
|
65
|
-
get businessPushNotifications() {
|
|
66
|
-
var _a;
|
|
67
|
-
return ((_a = this._businessPushNotifications) !== null && _a !== void 0 ? _a : (this._businessPushNotifications = new Client_js_3.BusinessPushNotificationsClient(this._options)));
|
|
68
|
-
}
|
|
69
59
|
get customerEvents() {
|
|
70
60
|
var _a;
|
|
71
|
-
return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new
|
|
61
|
+
return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new Client_js_3.CustomerEventsClient(this._options)));
|
|
72
62
|
}
|
|
73
63
|
get customerMyAccount() {
|
|
74
64
|
var _a;
|
|
75
|
-
return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new
|
|
65
|
+
return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new Client_js_4.CustomerMyAccountClient(this._options)));
|
|
76
66
|
}
|
|
77
67
|
get customer() {
|
|
78
68
|
var _a;
|
|
79
|
-
return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new
|
|
69
|
+
return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new Client_js_2.CustomerClient(this._options)));
|
|
80
70
|
}
|
|
81
71
|
get recordClick() {
|
|
82
72
|
var _a;
|
|
83
|
-
return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new
|
|
73
|
+
return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new Client_js_5.RecordClickClient(this._options)));
|
|
84
74
|
}
|
|
85
75
|
get serveAd() {
|
|
86
76
|
var _a;
|
|
87
|
-
return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new
|
|
77
|
+
return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new Client_js_6.ServeAdClient(this._options)));
|
|
88
78
|
}
|
|
89
79
|
get business() {
|
|
90
80
|
var _a;
|
|
@@ -2,10 +2,15 @@ import type { BaseClientOptions } from "../../../../BaseClient.js";
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
3
|
import { AuthClient } from "../resources/auth/client/Client.js";
|
|
4
4
|
import { BulletinsClient } from "../resources/bulletins/client/Client.js";
|
|
5
|
+
import { BusinessesClient } from "../resources/businesses/client/Client.js";
|
|
6
|
+
import { CategoriesClient } from "../resources/categories/client/Client.js";
|
|
7
|
+
import { CertificationsClient } from "../resources/certifications/client/Client.js";
|
|
8
|
+
import { CuisinesClient } from "../resources/cuisines/client/Client.js";
|
|
5
9
|
import { GalleryClient } from "../resources/gallery/client/Client.js";
|
|
6
10
|
import { MenusClient } from "../resources/menus/client/Client.js";
|
|
7
11
|
import { MessagingClient } from "../resources/messaging/client/Client.js";
|
|
8
12
|
import { ProfileClient } from "../resources/profile/client/Client.js";
|
|
13
|
+
import { PushNotificationsClient } from "../resources/pushNotifications/client/Client.js";
|
|
9
14
|
export declare namespace BusinessClient {
|
|
10
15
|
type Options = BaseClientOptions;
|
|
11
16
|
}
|
|
@@ -15,13 +20,23 @@ export declare class BusinessClient {
|
|
|
15
20
|
protected _bulletins: BulletinsClient | undefined;
|
|
16
21
|
protected _gallery: GalleryClient | undefined;
|
|
17
22
|
protected _menus: MenusClient | undefined;
|
|
18
|
-
protected _profile: ProfileClient | undefined;
|
|
19
23
|
protected _messaging: MessagingClient | undefined;
|
|
24
|
+
protected _profile: ProfileClient | undefined;
|
|
25
|
+
protected _pushNotifications: PushNotificationsClient | undefined;
|
|
26
|
+
protected _businesses: BusinessesClient | undefined;
|
|
27
|
+
protected _cuisines: CuisinesClient | undefined;
|
|
28
|
+
protected _certifications: CertificationsClient | undefined;
|
|
29
|
+
protected _categories: CategoriesClient | undefined;
|
|
20
30
|
constructor(options?: BusinessClient.Options);
|
|
21
31
|
get auth(): AuthClient;
|
|
22
32
|
get bulletins(): BulletinsClient;
|
|
23
33
|
get gallery(): GalleryClient;
|
|
24
34
|
get menus(): MenusClient;
|
|
25
|
-
get profile(): ProfileClient;
|
|
26
35
|
get messaging(): MessagingClient;
|
|
36
|
+
get profile(): ProfileClient;
|
|
37
|
+
get pushNotifications(): PushNotificationsClient;
|
|
38
|
+
get businesses(): BusinessesClient;
|
|
39
|
+
get cuisines(): CuisinesClient;
|
|
40
|
+
get certifications(): CertificationsClient;
|
|
41
|
+
get categories(): CategoriesClient;
|
|
27
42
|
}
|
|
@@ -5,10 +5,15 @@ exports.BusinessClient = void 0;
|
|
|
5
5
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
6
6
|
const Client_js_1 = require("../resources/auth/client/Client.js");
|
|
7
7
|
const Client_js_2 = require("../resources/bulletins/client/Client.js");
|
|
8
|
-
const Client_js_3 = require("../resources/
|
|
9
|
-
const Client_js_4 = require("../resources/
|
|
10
|
-
const Client_js_5 = require("../resources/
|
|
11
|
-
const Client_js_6 = require("../resources/
|
|
8
|
+
const Client_js_3 = require("../resources/businesses/client/Client.js");
|
|
9
|
+
const Client_js_4 = require("../resources/categories/client/Client.js");
|
|
10
|
+
const Client_js_5 = require("../resources/certifications/client/Client.js");
|
|
11
|
+
const Client_js_6 = require("../resources/cuisines/client/Client.js");
|
|
12
|
+
const Client_js_7 = require("../resources/gallery/client/Client.js");
|
|
13
|
+
const Client_js_8 = require("../resources/menus/client/Client.js");
|
|
14
|
+
const Client_js_9 = require("../resources/messaging/client/Client.js");
|
|
15
|
+
const Client_js_10 = require("../resources/profile/client/Client.js");
|
|
16
|
+
const Client_js_11 = require("../resources/pushNotifications/client/Client.js");
|
|
12
17
|
class BusinessClient {
|
|
13
18
|
constructor(options = {}) {
|
|
14
19
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
@@ -23,19 +28,39 @@ class BusinessClient {
|
|
|
23
28
|
}
|
|
24
29
|
get gallery() {
|
|
25
30
|
var _a;
|
|
26
|
-
return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new
|
|
31
|
+
return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new Client_js_7.GalleryClient(this._options)));
|
|
27
32
|
}
|
|
28
33
|
get menus() {
|
|
29
34
|
var _a;
|
|
30
|
-
return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new
|
|
35
|
+
return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new Client_js_8.MenusClient(this._options)));
|
|
36
|
+
}
|
|
37
|
+
get messaging() {
|
|
38
|
+
var _a;
|
|
39
|
+
return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new Client_js_9.MessagingClient(this._options)));
|
|
31
40
|
}
|
|
32
41
|
get profile() {
|
|
33
42
|
var _a;
|
|
34
|
-
return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new
|
|
43
|
+
return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new Client_js_10.ProfileClient(this._options)));
|
|
35
44
|
}
|
|
36
|
-
get
|
|
45
|
+
get pushNotifications() {
|
|
46
|
+
var _a;
|
|
47
|
+
return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new Client_js_11.PushNotificationsClient(this._options)));
|
|
48
|
+
}
|
|
49
|
+
get businesses() {
|
|
50
|
+
var _a;
|
|
51
|
+
return ((_a = this._businesses) !== null && _a !== void 0 ? _a : (this._businesses = new Client_js_3.BusinessesClient(this._options)));
|
|
52
|
+
}
|
|
53
|
+
get cuisines() {
|
|
54
|
+
var _a;
|
|
55
|
+
return ((_a = this._cuisines) !== null && _a !== void 0 ? _a : (this._cuisines = new Client_js_6.CuisinesClient(this._options)));
|
|
56
|
+
}
|
|
57
|
+
get certifications() {
|
|
58
|
+
var _a;
|
|
59
|
+
return ((_a = this._certifications) !== null && _a !== void 0 ? _a : (this._certifications = new Client_js_5.CertificationsClient(this._options)));
|
|
60
|
+
}
|
|
61
|
+
get categories() {
|
|
37
62
|
var _a;
|
|
38
|
-
return ((_a = this.
|
|
63
|
+
return ((_a = this._categories) !== null && _a !== void 0 ? _a : (this._categories = new Client_js_4.CategoriesClient(this._options)));
|
|
39
64
|
}
|
|
40
65
|
}
|
|
41
66
|
exports.BusinessClient = BusinessClient;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import type * as FiveOneEat from "../../../../../index.js";
|
|
5
|
+
export declare namespace BusinessesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class BusinessesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessesClient.Options>;
|
|
12
|
+
constructor(options?: BusinessesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* await client.business.businesses.list()
|
|
18
|
+
*/
|
|
19
|
+
list(requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
20
|
+
private __list;
|
|
21
|
+
/**
|
|
22
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.business.businesses.create()
|
|
26
|
+
*/
|
|
27
|
+
create(requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
28
|
+
private __create;
|
|
29
|
+
/**
|
|
30
|
+
* @param {FiveOneEat.business.GetBusinessesRequest} request
|
|
31
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.business.businesses.get({
|
|
35
|
+
* business: "business"
|
|
36
|
+
* })
|
|
37
|
+
*/
|
|
38
|
+
get(request: FiveOneEat.business.GetBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
39
|
+
private __get;
|
|
40
|
+
/**
|
|
41
|
+
* @param {FiveOneEat.business.UpdateBusinessesRequest} request
|
|
42
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await client.business.businesses.update({
|
|
46
|
+
* business: "business"
|
|
47
|
+
* })
|
|
48
|
+
*/
|
|
49
|
+
update(request: FiveOneEat.business.UpdateBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
50
|
+
private __update;
|
|
51
|
+
/**
|
|
52
|
+
* @param {FiveOneEat.business.DeleteBusinessesRequest} request
|
|
53
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.business.businesses.delete({
|
|
57
|
+
* business: "business"
|
|
58
|
+
* })
|
|
59
|
+
*/
|
|
60
|
+
delete(request: FiveOneEat.business.DeleteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
61
|
+
private __delete;
|
|
62
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.BusinessesClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
|
+
class BusinessesClient {
|
|
54
|
+
constructor(options = {}) {
|
|
55
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await client.business.businesses.list()
|
|
62
|
+
*/
|
|
63
|
+
list(requestOptions) {
|
|
64
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
65
|
+
}
|
|
66
|
+
__list(requestOptions) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
69
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
70
|
+
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);
|
|
71
|
+
const _response = yield core.fetcher({
|
|
72
|
+
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/businesses"),
|
|
73
|
+
method: "GET",
|
|
74
|
+
headers: _headers,
|
|
75
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
76
|
+
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,
|
|
77
|
+
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,
|
|
78
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
79
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
80
|
+
logging: this._options.logging,
|
|
81
|
+
});
|
|
82
|
+
if (_response.ok) {
|
|
83
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
84
|
+
}
|
|
85
|
+
if (_response.error.reason === "status-code") {
|
|
86
|
+
throw new errors.FiveOneEatError({
|
|
87
|
+
statusCode: _response.error.statusCode,
|
|
88
|
+
body: _response.error.body,
|
|
89
|
+
rawResponse: _response.rawResponse,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/businesses");
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* await client.business.businesses.create()
|
|
100
|
+
*/
|
|
101
|
+
create(requestOptions) {
|
|
102
|
+
return core.HttpResponsePromise.fromPromise(this.__create(requestOptions));
|
|
103
|
+
}
|
|
104
|
+
__create(requestOptions) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
107
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
108
|
+
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);
|
|
109
|
+
const _response = yield core.fetcher({
|
|
110
|
+
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/businesses"),
|
|
111
|
+
method: "POST",
|
|
112
|
+
headers: _headers,
|
|
113
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
114
|
+
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,
|
|
115
|
+
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,
|
|
116
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
117
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
118
|
+
logging: this._options.logging,
|
|
119
|
+
});
|
|
120
|
+
if (_response.ok) {
|
|
121
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
122
|
+
}
|
|
123
|
+
if (_response.error.reason === "status-code") {
|
|
124
|
+
throw new errors.FiveOneEatError({
|
|
125
|
+
statusCode: _response.error.statusCode,
|
|
126
|
+
body: _response.error.body,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/businesses");
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @param {FiveOneEat.business.GetBusinessesRequest} request
|
|
135
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* await client.business.businesses.get({
|
|
139
|
+
* business: "business"
|
|
140
|
+
* })
|
|
141
|
+
*/
|
|
142
|
+
get(request, requestOptions) {
|
|
143
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
144
|
+
}
|
|
145
|
+
__get(request, requestOptions) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
148
|
+
const { business } = request;
|
|
149
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
150
|
+
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);
|
|
151
|
+
const _response = yield core.fetcher({
|
|
152
|
+
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/businesses/${core.url.encodePathParam(business)}`),
|
|
153
|
+
method: "GET",
|
|
154
|
+
headers: _headers,
|
|
155
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
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 { data: undefined, rawResponse: _response.rawResponse };
|
|
164
|
+
}
|
|
165
|
+
if (_response.error.reason === "status-code") {
|
|
166
|
+
throw new errors.FiveOneEatError({
|
|
167
|
+
statusCode: _response.error.statusCode,
|
|
168
|
+
body: _response.error.body,
|
|
169
|
+
rawResponse: _response.rawResponse,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/businesses/{business}");
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* @param {FiveOneEat.business.UpdateBusinessesRequest} request
|
|
177
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* await client.business.businesses.update({
|
|
181
|
+
* business: "business"
|
|
182
|
+
* })
|
|
183
|
+
*/
|
|
184
|
+
update(request, requestOptions) {
|
|
185
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
186
|
+
}
|
|
187
|
+
__update(request, requestOptions) {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
190
|
+
const { business } = request;
|
|
191
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
192
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
193
|
+
const _response = yield core.fetcher({
|
|
194
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/businesses/${core.url.encodePathParam(business)}`),
|
|
195
|
+
method: "PUT",
|
|
196
|
+
headers: _headers,
|
|
197
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
198
|
+
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,
|
|
199
|
+
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,
|
|
200
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
201
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
202
|
+
logging: this._options.logging,
|
|
203
|
+
});
|
|
204
|
+
if (_response.ok) {
|
|
205
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
206
|
+
}
|
|
207
|
+
if (_response.error.reason === "status-code") {
|
|
208
|
+
throw new errors.FiveOneEatError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.body,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/businesses/{business}");
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @param {FiveOneEat.business.DeleteBusinessesRequest} request
|
|
219
|
+
* @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* await client.business.businesses.delete({
|
|
223
|
+
* business: "business"
|
|
224
|
+
* })
|
|
225
|
+
*/
|
|
226
|
+
delete(request, requestOptions) {
|
|
227
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
228
|
+
}
|
|
229
|
+
__delete(request, requestOptions) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
232
|
+
const { business } = request;
|
|
233
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
234
|
+
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);
|
|
235
|
+
const _response = yield core.fetcher({
|
|
236
|
+
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/businesses/${core.url.encodePathParam(business)}`),
|
|
237
|
+
method: "DELETE",
|
|
238
|
+
headers: _headers,
|
|
239
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
240
|
+
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,
|
|
241
|
+
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,
|
|
242
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
243
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
244
|
+
logging: this._options.logging,
|
|
245
|
+
});
|
|
246
|
+
if (_response.ok) {
|
|
247
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
248
|
+
}
|
|
249
|
+
if (_response.error.reason === "status-code") {
|
|
250
|
+
throw new errors.FiveOneEatError({
|
|
251
|
+
statusCode: _response.error.statusCode,
|
|
252
|
+
body: _response.error.body,
|
|
253
|
+
rawResponse: _response.rawResponse,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/businesses/{business}");
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
exports.BusinessesClient = BusinessesClient;
|