@51eat/sdk 0.0.19 → 0.0.20
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 +2 -2
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/business/client/Client.js +14 -4
- package/dist/cjs/api/resources/business/resources/gallery/client/Client.d.ts +86 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/Client.js +364 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.d.ts +21 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.d.ts +11 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.d.ts +11 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/gallery/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/gallery/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/gallery/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/gallery/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/DeleteGalleryResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/DeleteGalleryResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ListGalleryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ListGalleryResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ReorderGalleryResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ReorderGalleryResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UpdateGalleryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UpdateGalleryResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UploadGalleryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UploadGalleryResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/index.js +21 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/index.js +5 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.js +21 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/exports.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/exports.js +22 -0
- package/dist/cjs/api/resources/business/resources/messaging/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/Client.d.ts +45 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/Client.js +182 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/index.d.ts +6 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/index.js +45 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/Client.d.ts +81 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/Client.js +312 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.d.ts +22 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.js +12 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/index.js +18 -0
- package/dist/cjs/api/types/BusinessConversation.d.ts +20 -0
- package/dist/cjs/api/types/BusinessConversation.js +3 -0
- package/dist/cjs/api/types/BusinessMessage.d.ts +20 -0
- package/dist/cjs/api/types/BusinessMessage.js +3 -0
- package/dist/cjs/api/types/BusinessPhoto.d.ts +9 -0
- package/dist/cjs/api/types/BusinessPhoto.js +3 -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/api/resources/business/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/business/client/Client.mjs +10 -0
- package/dist/esm/api/resources/business/resources/gallery/client/Client.d.mts +86 -0
- package/dist/esm/api/resources/business/resources/gallery/client/Client.mjs +327 -0
- package/dist/esm/api/resources/business/resources/gallery/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/gallery/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.d.mts +21 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.d.mts +11 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.d.mts +11 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/gallery/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/gallery/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/gallery/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/gallery/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/DeleteGalleryResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/gallery/types/DeleteGalleryResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ListGalleryResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ListGalleryResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ReorderGalleryResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ReorderGalleryResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UpdateGalleryResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UpdateGalleryResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UploadGalleryResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UploadGalleryResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/index.d.mts +5 -0
- package/dist/esm/api/resources/business/resources/gallery/types/index.mjs +5 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/index.mjs +4 -0
- package/dist/esm/api/resources/business/resources/messaging/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/business/resources/messaging/client/Client.mjs +17 -0
- package/dist/esm/api/resources/business/resources/messaging/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/exports.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/messaging/exports.mjs +4 -0
- package/dist/esm/api/resources/business/resources/messaging/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/Client.d.mts +45 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/Client.mjs +145 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/index.d.mts +6 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/index.mjs +6 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/Client.d.mts +81 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/Client.mjs +275 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.d.mts +22 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.mjs +9 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/index.mjs +2 -0
- package/dist/esm/api/types/BusinessConversation.d.mts +20 -0
- package/dist/esm/api/types/BusinessConversation.mjs +2 -0
- package/dist/esm/api/types/BusinessMessage.d.mts +20 -0
- package/dist/esm/api/types/BusinessMessage.mjs +2 -0
- package/dist/esm/api/types/BusinessPhoto.d.mts +9 -0
- package/dist/esm/api/types/BusinessPhoto.mjs +2 -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 +45 -1
- package/reference.md +643 -0
package/README.md
CHANGED
|
@@ -109,8 +109,8 @@ import * as fs from "fs";
|
|
|
109
109
|
import { FiveOneEatClient } from "@51eat/sdk";
|
|
110
110
|
|
|
111
111
|
const client = new FiveOneEatClient({ token: "YOUR_TOKEN" });
|
|
112
|
-
await client.business.
|
|
113
|
-
|
|
112
|
+
await client.business.gallery.upload({
|
|
113
|
+
photo: fs.createReadStream("/path/to/your/file")
|
|
114
114
|
});
|
|
115
115
|
```
|
|
116
116
|
The client accepts a variety of types for file upload parameters:
|
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.20",
|
|
47
|
+
"User-Agent": "@51eat/sdk/0.0.20",
|
|
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);
|
|
@@ -2,7 +2,9 @@ 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 { GalleryClient } from "../resources/gallery/client/Client.js";
|
|
5
6
|
import { MenusClient } from "../resources/menus/client/Client.js";
|
|
7
|
+
import { MessagingClient } from "../resources/messaging/client/Client.js";
|
|
6
8
|
import { ProfileClient } from "../resources/profile/client/Client.js";
|
|
7
9
|
export declare namespace BusinessClient {
|
|
8
10
|
type Options = BaseClientOptions;
|
|
@@ -11,11 +13,15 @@ export declare class BusinessClient {
|
|
|
11
13
|
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessClient.Options>;
|
|
12
14
|
protected _auth: AuthClient | undefined;
|
|
13
15
|
protected _bulletins: BulletinsClient | undefined;
|
|
16
|
+
protected _gallery: GalleryClient | undefined;
|
|
14
17
|
protected _menus: MenusClient | undefined;
|
|
15
18
|
protected _profile: ProfileClient | undefined;
|
|
19
|
+
protected _messaging: MessagingClient | undefined;
|
|
16
20
|
constructor(options?: BusinessClient.Options);
|
|
17
21
|
get auth(): AuthClient;
|
|
18
22
|
get bulletins(): BulletinsClient;
|
|
23
|
+
get gallery(): GalleryClient;
|
|
19
24
|
get menus(): MenusClient;
|
|
20
25
|
get profile(): ProfileClient;
|
|
26
|
+
get messaging(): MessagingClient;
|
|
21
27
|
}
|
|
@@ -5,8 +5,10 @@ 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/
|
|
8
|
+
const Client_js_3 = require("../resources/gallery/client/Client.js");
|
|
9
|
+
const Client_js_4 = require("../resources/menus/client/Client.js");
|
|
10
|
+
const Client_js_5 = require("../resources/messaging/client/Client.js");
|
|
11
|
+
const Client_js_6 = require("../resources/profile/client/Client.js");
|
|
10
12
|
class BusinessClient {
|
|
11
13
|
constructor(options = {}) {
|
|
12
14
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
@@ -19,13 +21,21 @@ class BusinessClient {
|
|
|
19
21
|
var _a;
|
|
20
22
|
return ((_a = this._bulletins) !== null && _a !== void 0 ? _a : (this._bulletins = new Client_js_2.BulletinsClient(this._options)));
|
|
21
23
|
}
|
|
24
|
+
get gallery() {
|
|
25
|
+
var _a;
|
|
26
|
+
return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new Client_js_3.GalleryClient(this._options)));
|
|
27
|
+
}
|
|
22
28
|
get menus() {
|
|
23
29
|
var _a;
|
|
24
|
-
return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new
|
|
30
|
+
return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new Client_js_4.MenusClient(this._options)));
|
|
25
31
|
}
|
|
26
32
|
get profile() {
|
|
27
33
|
var _a;
|
|
28
|
-
return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new
|
|
34
|
+
return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new Client_js_6.ProfileClient(this._options)));
|
|
35
|
+
}
|
|
36
|
+
get messaging() {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new Client_js_5.MessagingClient(this._options)));
|
|
29
39
|
}
|
|
30
40
|
}
|
|
31
41
|
exports.BusinessClient = BusinessClient;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import * as FiveOneEat from "../../../../../index.js";
|
|
5
|
+
export declare namespace GalleryClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class GalleryClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<GalleryClient.Options>;
|
|
12
|
+
constructor(options?: GalleryClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
|
+
*
|
|
16
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* await client.business.gallery.list()
|
|
20
|
+
*/
|
|
21
|
+
list(requestOptions?: GalleryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListGalleryResponse>;
|
|
22
|
+
private __list;
|
|
23
|
+
/**
|
|
24
|
+
* @param {FiveOneEat.business.StoreGalleryPhotoRequest} request
|
|
25
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
|
+
*
|
|
27
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
28
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* import { createReadStream } from "fs";
|
|
32
|
+
* await client.business.gallery.upload({
|
|
33
|
+
* photo: fs.createReadStream("/path/to/your/file")
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
upload(request: FiveOneEat.business.StoreGalleryPhotoRequest, requestOptions?: GalleryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.UploadGalleryResponse>;
|
|
37
|
+
private __upload;
|
|
38
|
+
/**
|
|
39
|
+
* @param {FiveOneEat.business.ReorderGalleryRequest} request
|
|
40
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
|
+
*
|
|
42
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
43
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.business.gallery.reorder({
|
|
47
|
+
* photos: [{
|
|
48
|
+
* id: "id",
|
|
49
|
+
* sort_order: 1
|
|
50
|
+
* }]
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
reorder(request: FiveOneEat.business.ReorderGalleryRequest, requestOptions?: GalleryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ReorderGalleryResponse>;
|
|
54
|
+
private __reorder;
|
|
55
|
+
/**
|
|
56
|
+
* @param {FiveOneEat.business.UpdateGalleryPhotoRequest} request
|
|
57
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
60
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
61
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
62
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.business.gallery.update({
|
|
66
|
+
* photo: "photo"
|
|
67
|
+
* })
|
|
68
|
+
*/
|
|
69
|
+
update(request: FiveOneEat.business.UpdateGalleryPhotoRequest, requestOptions?: GalleryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.UpdateGalleryResponse>;
|
|
70
|
+
private __update;
|
|
71
|
+
/**
|
|
72
|
+
* @param {FiveOneEat.business.DeleteGalleryRequest} request
|
|
73
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
76
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
77
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.business.gallery.delete({
|
|
81
|
+
* photo: "photo"
|
|
82
|
+
* })
|
|
83
|
+
*/
|
|
84
|
+
delete(request: FiveOneEat.business.DeleteGalleryRequest, requestOptions?: GalleryClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.DeleteGalleryResponse>;
|
|
85
|
+
private __delete;
|
|
86
|
+
}
|
|
@@ -0,0 +1,364 @@
|
|
|
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.GalleryClient = 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 GalleryClient {
|
|
66
|
+
constructor(options = {}) {
|
|
67
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.business.gallery.list()
|
|
76
|
+
*/
|
|
77
|
+
list(requestOptions) {
|
|
78
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
79
|
+
}
|
|
80
|
+
__list(requestOptions) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
83
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
84
|
+
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);
|
|
85
|
+
const _response = yield core.fetcher({
|
|
86
|
+
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/gallery"),
|
|
87
|
+
method: "GET",
|
|
88
|
+
headers: _headers,
|
|
89
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
90
|
+
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,
|
|
91
|
+
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,
|
|
92
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
93
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
94
|
+
logging: this._options.logging,
|
|
95
|
+
});
|
|
96
|
+
if (_response.ok) {
|
|
97
|
+
return {
|
|
98
|
+
data: _response.body,
|
|
99
|
+
rawResponse: _response.rawResponse,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (_response.error.reason === "status-code") {
|
|
103
|
+
switch (_response.error.statusCode) {
|
|
104
|
+
case 401:
|
|
105
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
106
|
+
default:
|
|
107
|
+
throw new errors.FiveOneEatError({
|
|
108
|
+
statusCode: _response.error.statusCode,
|
|
109
|
+
body: _response.error.body,
|
|
110
|
+
rawResponse: _response.rawResponse,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/gallery");
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @param {FiveOneEat.business.StoreGalleryPhotoRequest} request
|
|
119
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
|
+
*
|
|
121
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
122
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* import { createReadStream } from "fs";
|
|
126
|
+
* await client.business.gallery.upload({
|
|
127
|
+
* photo: fs.createReadStream("/path/to/your/file")
|
|
128
|
+
* })
|
|
129
|
+
*/
|
|
130
|
+
upload(request, requestOptions) {
|
|
131
|
+
return core.HttpResponsePromise.fromPromise(this.__upload(request, requestOptions));
|
|
132
|
+
}
|
|
133
|
+
__upload(request, requestOptions) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
136
|
+
const _body = yield core.newFormData();
|
|
137
|
+
yield _body.appendFile("photo", request.photo);
|
|
138
|
+
if (request.alt_text != null) {
|
|
139
|
+
_body.append("alt_text", request.alt_text);
|
|
140
|
+
}
|
|
141
|
+
const _maybeEncodedRequest = yield _body.getRequest();
|
|
142
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
143
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
144
|
+
const _response = yield core.fetcher({
|
|
145
|
+
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/gallery"),
|
|
146
|
+
method: "POST",
|
|
147
|
+
headers: _headers,
|
|
148
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
149
|
+
requestType: "file",
|
|
150
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
151
|
+
body: _maybeEncodedRequest.body,
|
|
152
|
+
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,
|
|
153
|
+
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,
|
|
154
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
155
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
156
|
+
logging: this._options.logging,
|
|
157
|
+
});
|
|
158
|
+
if (_response.ok) {
|
|
159
|
+
return {
|
|
160
|
+
data: _response.body,
|
|
161
|
+
rawResponse: _response.rawResponse,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (_response.error.reason === "status-code") {
|
|
165
|
+
switch (_response.error.statusCode) {
|
|
166
|
+
case 401:
|
|
167
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
168
|
+
case 422:
|
|
169
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
170
|
+
default:
|
|
171
|
+
throw new errors.FiveOneEatError({
|
|
172
|
+
statusCode: _response.error.statusCode,
|
|
173
|
+
body: _response.error.body,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/gallery");
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @param {FiveOneEat.business.ReorderGalleryRequest} request
|
|
183
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
184
|
+
*
|
|
185
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
186
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* await client.business.gallery.reorder({
|
|
190
|
+
* photos: [{
|
|
191
|
+
* id: "id",
|
|
192
|
+
* sort_order: 1
|
|
193
|
+
* }]
|
|
194
|
+
* })
|
|
195
|
+
*/
|
|
196
|
+
reorder(request, requestOptions) {
|
|
197
|
+
return core.HttpResponsePromise.fromPromise(this.__reorder(request, requestOptions));
|
|
198
|
+
}
|
|
199
|
+
__reorder(request, requestOptions) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
202
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
203
|
+
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);
|
|
204
|
+
const _response = yield core.fetcher({
|
|
205
|
+
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/gallery/reorder"),
|
|
206
|
+
method: "PUT",
|
|
207
|
+
headers: _headers,
|
|
208
|
+
contentType: "application/json",
|
|
209
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
210
|
+
requestType: "json",
|
|
211
|
+
body: request,
|
|
212
|
+
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,
|
|
213
|
+
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,
|
|
214
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
215
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
216
|
+
logging: this._options.logging,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return {
|
|
220
|
+
data: _response.body,
|
|
221
|
+
rawResponse: _response.rawResponse,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (_response.error.reason === "status-code") {
|
|
225
|
+
switch (_response.error.statusCode) {
|
|
226
|
+
case 401:
|
|
227
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
228
|
+
case 422:
|
|
229
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
230
|
+
default:
|
|
231
|
+
throw new errors.FiveOneEatError({
|
|
232
|
+
statusCode: _response.error.statusCode,
|
|
233
|
+
body: _response.error.body,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/gallery/reorder");
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* @param {FiveOneEat.business.UpdateGalleryPhotoRequest} request
|
|
243
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
244
|
+
*
|
|
245
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
246
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
247
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
248
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* await client.business.gallery.update({
|
|
252
|
+
* photo: "photo"
|
|
253
|
+
* })
|
|
254
|
+
*/
|
|
255
|
+
update(request, requestOptions) {
|
|
256
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
257
|
+
}
|
|
258
|
+
__update(request, requestOptions) {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
261
|
+
const { photo } = request, _body = __rest(request, ["photo"]);
|
|
262
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
263
|
+
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);
|
|
264
|
+
const _response = yield core.fetcher({
|
|
265
|
+
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/gallery/${core.url.encodePathParam(photo)}`),
|
|
266
|
+
method: "PUT",
|
|
267
|
+
headers: _headers,
|
|
268
|
+
contentType: "application/json",
|
|
269
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
270
|
+
requestType: "json",
|
|
271
|
+
body: _body,
|
|
272
|
+
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,
|
|
273
|
+
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,
|
|
274
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
275
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
276
|
+
logging: this._options.logging,
|
|
277
|
+
});
|
|
278
|
+
if (_response.ok) {
|
|
279
|
+
return {
|
|
280
|
+
data: _response.body,
|
|
281
|
+
rawResponse: _response.rawResponse,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
if (_response.error.reason === "status-code") {
|
|
285
|
+
switch (_response.error.statusCode) {
|
|
286
|
+
case 401:
|
|
287
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
288
|
+
case 403:
|
|
289
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
290
|
+
case 404:
|
|
291
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
292
|
+
case 422:
|
|
293
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
294
|
+
default:
|
|
295
|
+
throw new errors.FiveOneEatError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.body,
|
|
298
|
+
rawResponse: _response.rawResponse,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/gallery/{photo}");
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* @param {FiveOneEat.business.DeleteGalleryRequest} request
|
|
307
|
+
* @param {GalleryClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
308
|
+
*
|
|
309
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
310
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
311
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* await client.business.gallery.delete({
|
|
315
|
+
* photo: "photo"
|
|
316
|
+
* })
|
|
317
|
+
*/
|
|
318
|
+
delete(request, requestOptions) {
|
|
319
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
320
|
+
}
|
|
321
|
+
__delete(request, requestOptions) {
|
|
322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
324
|
+
const { photo } = request;
|
|
325
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
326
|
+
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);
|
|
327
|
+
const _response = yield core.fetcher({
|
|
328
|
+
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/gallery/${core.url.encodePathParam(photo)}`),
|
|
329
|
+
method: "DELETE",
|
|
330
|
+
headers: _headers,
|
|
331
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
332
|
+
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,
|
|
333
|
+
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,
|
|
334
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
335
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
336
|
+
logging: this._options.logging,
|
|
337
|
+
});
|
|
338
|
+
if (_response.ok) {
|
|
339
|
+
return {
|
|
340
|
+
data: _response.body,
|
|
341
|
+
rawResponse: _response.rawResponse,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
if (_response.error.reason === "status-code") {
|
|
345
|
+
switch (_response.error.statusCode) {
|
|
346
|
+
case 401:
|
|
347
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
348
|
+
case 403:
|
|
349
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
350
|
+
case 404:
|
|
351
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
352
|
+
default:
|
|
353
|
+
throw new errors.FiveOneEatError({
|
|
354
|
+
statusCode: _response.error.statusCode,
|
|
355
|
+
body: _response.error.body,
|
|
356
|
+
rawResponse: _response.rawResponse,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/gallery/{photo}");
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
exports.GalleryClient = GalleryClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
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);
|
package/dist/cjs/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* photos: [{
|
|
5
|
+
* id: "id",
|
|
6
|
+
* sort_order: 1
|
|
7
|
+
* }]
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface ReorderGalleryRequest {
|
|
11
|
+
photos: ReorderGalleryRequest.Photos.Item[];
|
|
12
|
+
}
|
|
13
|
+
export declare namespace ReorderGalleryRequest {
|
|
14
|
+
type Photos = Photos.Item[];
|
|
15
|
+
namespace Photos {
|
|
16
|
+
interface Item {
|
|
17
|
+
id: string;
|
|
18
|
+
sort_order: number;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as core from "../../../../../../../core/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* photo: fs.createReadStream("/path/to/your/file")
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface StoreGalleryPhotoRequest {
|
|
9
|
+
photo: core.file.Uploadable;
|
|
10
|
+
alt_text?: string | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { DeleteGalleryRequest } from "./DeleteGalleryRequest.js";
|
|
2
|
+
export type { ReorderGalleryRequest } from "./ReorderGalleryRequest.js";
|
|
3
|
+
export type { StoreGalleryPhotoRequest } from "./StoreGalleryPhotoRequest.js";
|
|
4
|
+
export type { UpdateGalleryPhotoRequest } from "./UpdateGalleryPhotoRequest.js";
|