@51eat/sdk 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/business/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/client/Client.js +31 -26
- package/dist/cjs/api/resources/business/resources/allergens/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/business/resources/allergens/client/Client.js +110 -0
- package/dist/cjs/api/resources/business/resources/allergens/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/allergens/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/allergens/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/allergens/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/allergens/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/allergens/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/allergens/types/ListAllergensResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/allergens/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/allergens/types/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/bulletins/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/client/Client.js +5 -0
- package/dist/cjs/api/resources/business/resources/bulletins/exports.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/exports.js +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/index.js +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/Client.d.ts +49 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/Client.js +208 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.d.ts +13 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/bulletins/resources/index.js +42 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/index.js +6 -4
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +1 -1
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/{StoreBulletinCommentRequest.d.ts → AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.ts} +2 -1
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.js +3 -0
- package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +13 -0
- package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +51 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.js +3 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/customer/resources/discovery/types/index.js +1 -0
- package/dist/cjs/api/types/BusinessAllergen.d.ts +8 -0
- package/dist/cjs/api/types/BusinessAllergen.js +3 -0
- package/dist/cjs/api/types/BusinessBulletinComment.d.ts +15 -0
- package/dist/cjs/api/types/BusinessBulletinComment.js +3 -0
- package/dist/cjs/api/types/BusinessBulletinCommentReply.d.ts +13 -0
- package/dist/cjs/api/types/BusinessBulletinCommentReply.js +3 -0
- package/dist/cjs/api/types/BusinessBulletinCommentResponse.d.ts +5 -0
- package/dist/cjs/api/types/BusinessBulletinCommentResponse.js +3 -0
- package/dist/cjs/api/types/CustomerBulletinCommentReply.d.ts +13 -0
- package/dist/cjs/api/types/CustomerBulletinCommentReply.js +3 -0
- package/dist/cjs/api/types/CustomerComment.d.ts +3 -0
- package/dist/cjs/api/types/CustomerDiscoveryAllergen.d.ts +8 -0
- package/dist/cjs/api/types/CustomerDiscoveryAllergen.js +3 -0
- package/dist/cjs/api/types/index.d.ts +6 -0
- package/dist/cjs/api/types/index.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/business/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/allergens/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/business/resources/allergens/client/Client.mjs +73 -0
- package/dist/esm/api/resources/business/resources/allergens/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/allergens/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/allergens/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/allergens/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/allergens/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/allergens/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/allergens/types/ListAllergensResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/allergens/types/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/allergens/types/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/bulletins/client/Client.mjs +5 -0
- package/dist/esm/api/resources/business/resources/bulletins/exports.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/exports.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.d.mts +49 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.mjs +171 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.mts +12 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.d.mts +13 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/bulletins/resources/index.mjs +3 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/index.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +1 -1
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/{StoreBulletinCommentRequest.d.mts → AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.mts} +2 -1
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +13 -0
- package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +51 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.d.mts +4 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/AllergensDiscoveryResponse.mjs +2 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/index.d.mts +1 -0
- package/dist/esm/api/resources/customer/resources/discovery/types/index.mjs +1 -0
- package/dist/esm/api/types/BusinessAllergen.d.mts +8 -0
- package/dist/esm/api/types/BusinessAllergen.mjs +2 -0
- package/dist/esm/api/types/BusinessBulletinComment.d.mts +15 -0
- package/dist/esm/api/types/BusinessBulletinComment.mjs +2 -0
- package/dist/esm/api/types/BusinessBulletinCommentReply.d.mts +13 -0
- package/dist/esm/api/types/BusinessBulletinCommentReply.mjs +2 -0
- package/dist/esm/api/types/BusinessBulletinCommentResponse.d.mts +5 -0
- package/dist/esm/api/types/BusinessBulletinCommentResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerBulletinCommentReply.d.mts +13 -0
- package/dist/esm/api/types/CustomerBulletinCommentReply.mjs +2 -0
- package/dist/esm/api/types/CustomerComment.d.mts +3 -0
- package/dist/esm/api/types/CustomerDiscoveryAllergen.d.mts +8 -0
- package/dist/esm/api/types/CustomerDiscoveryAllergen.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +23 -1
- package/reference.md +233 -1
- /package/dist/cjs/api/resources/{customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.js → business/resources/allergens/types/ListAllergensResponse.js} +0 -0
- /package/dist/esm/api/resources/{customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.mjs → business/resources/allergens/types/ListAllergensResponse.mjs} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../index.js";
|
|
2
|
+
export interface BusinessBulletinComment {
|
|
3
|
+
id: string;
|
|
4
|
+
parent_id: string;
|
|
5
|
+
body: string;
|
|
6
|
+
user: BusinessBulletinComment.User;
|
|
7
|
+
created_at: string;
|
|
8
|
+
replies?: FiveOneEat.BusinessBulletinCommentReply[] | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace BusinessBulletinComment {
|
|
11
|
+
interface User {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface BusinessBulletinCommentReply {
|
|
2
|
+
id: string;
|
|
3
|
+
parent_id: string;
|
|
4
|
+
body: string;
|
|
5
|
+
user: BusinessBulletinCommentReply.User;
|
|
6
|
+
created_at: string;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace BusinessBulletinCommentReply {
|
|
9
|
+
interface User {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CustomerBulletinCommentReply {
|
|
2
|
+
id: string;
|
|
3
|
+
parent_id: string;
|
|
4
|
+
body: string;
|
|
5
|
+
user: CustomerBulletinCommentReply.User;
|
|
6
|
+
created_at: string;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace CustomerBulletinCommentReply {
|
|
9
|
+
interface User {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../index.js";
|
|
1
2
|
export interface CustomerComment {
|
|
2
3
|
id: string;
|
|
4
|
+
parent_id: string | null;
|
|
3
5
|
body: string;
|
|
4
6
|
user: CustomerComment.User;
|
|
5
7
|
created_at: string | null;
|
|
8
|
+
replies?: FiveOneEat.CustomerBulletinCommentReply[] | undefined;
|
|
6
9
|
}
|
|
7
10
|
export declare namespace CustomerComment {
|
|
8
11
|
interface User {
|
|
@@ -20,7 +20,11 @@ export * from "./BardProductSetValues.js";
|
|
|
20
20
|
export * from "./BardSetNode.js";
|
|
21
21
|
export * from "./BardSetValues.js";
|
|
22
22
|
export * from "./BardTextNode.js";
|
|
23
|
+
export * from "./BusinessAllergen.js";
|
|
23
24
|
export * from "./BusinessBulletin.js";
|
|
25
|
+
export * from "./BusinessBulletinComment.js";
|
|
26
|
+
export * from "./BusinessBulletinCommentReply.js";
|
|
27
|
+
export * from "./BusinessBulletinCommentResponse.js";
|
|
24
28
|
export * from "./BusinessCategory.js";
|
|
25
29
|
export * from "./BusinessCertification.js";
|
|
26
30
|
export * from "./BusinessConversation.js";
|
|
@@ -50,10 +54,12 @@ export * from "./ConflictErrorBody.js";
|
|
|
50
54
|
export * from "./Conversation.js";
|
|
51
55
|
export * from "./Cuisine.js";
|
|
52
56
|
export * from "./CustomerBulletin.js";
|
|
57
|
+
export * from "./CustomerBulletinCommentReply.js";
|
|
53
58
|
export * from "./CustomerBulletinResponse.js";
|
|
54
59
|
export * from "./CustomerBusinessProfile.js";
|
|
55
60
|
export * from "./CustomerComment.js";
|
|
56
61
|
export * from "./CustomerCommentResponse.js";
|
|
62
|
+
export * from "./CustomerDiscoveryAllergen.js";
|
|
57
63
|
export * from "./CustomerEvent.js";
|
|
58
64
|
export * from "./CustomerEventDetail.js";
|
|
59
65
|
export * from "./CustomerEventResponse.js";
|
|
@@ -36,7 +36,11 @@ __exportStar(require("./BardProductSetValues.js"), exports);
|
|
|
36
36
|
__exportStar(require("./BardSetNode.js"), exports);
|
|
37
37
|
__exportStar(require("./BardSetValues.js"), exports);
|
|
38
38
|
__exportStar(require("./BardTextNode.js"), exports);
|
|
39
|
+
__exportStar(require("./BusinessAllergen.js"), exports);
|
|
39
40
|
__exportStar(require("./BusinessBulletin.js"), exports);
|
|
41
|
+
__exportStar(require("./BusinessBulletinComment.js"), exports);
|
|
42
|
+
__exportStar(require("./BusinessBulletinCommentReply.js"), exports);
|
|
43
|
+
__exportStar(require("./BusinessBulletinCommentResponse.js"), exports);
|
|
40
44
|
__exportStar(require("./BusinessCategory.js"), exports);
|
|
41
45
|
__exportStar(require("./BusinessCertification.js"), exports);
|
|
42
46
|
__exportStar(require("./BusinessConversation.js"), exports);
|
|
@@ -66,10 +70,12 @@ __exportStar(require("./ConflictErrorBody.js"), exports);
|
|
|
66
70
|
__exportStar(require("./Conversation.js"), exports);
|
|
67
71
|
__exportStar(require("./Cuisine.js"), exports);
|
|
68
72
|
__exportStar(require("./CustomerBulletin.js"), exports);
|
|
73
|
+
__exportStar(require("./CustomerBulletinCommentReply.js"), exports);
|
|
69
74
|
__exportStar(require("./CustomerBulletinResponse.js"), exports);
|
|
70
75
|
__exportStar(require("./CustomerBusinessProfile.js"), exports);
|
|
71
76
|
__exportStar(require("./CustomerComment.js"), exports);
|
|
72
77
|
__exportStar(require("./CustomerCommentResponse.js"), exports);
|
|
78
|
+
__exportStar(require("./CustomerDiscoveryAllergen.js"), exports);
|
|
73
79
|
__exportStar(require("./CustomerEvent.js"), exports);
|
|
74
80
|
__exportStar(require("./CustomerEventDetail.js"), exports);
|
|
75
81
|
__exportStar(require("./CustomerEventResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.30";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@51eat/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.30",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.30",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BaseClientOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { AllergensClient } from "../resources/allergens/client/Client.mjs";
|
|
3
4
|
import { AuthClient } from "../resources/auth/client/Client.mjs";
|
|
4
5
|
import { BulletinsClient } from "../resources/bulletins/client/Client.mjs";
|
|
5
6
|
import { BusinessesClient } from "../resources/businesses/client/Client.mjs";
|
|
@@ -31,6 +32,7 @@ export declare class BusinessClient {
|
|
|
31
32
|
protected _cuisines: CuisinesClient | undefined;
|
|
32
33
|
protected _certifications: CertificationsClient | undefined;
|
|
33
34
|
protected _categories: CategoriesClient | undefined;
|
|
35
|
+
protected _allergens: AllergensClient | undefined;
|
|
34
36
|
constructor(options?: BusinessClient.Options);
|
|
35
37
|
get auth(): AuthClient;
|
|
36
38
|
get bulletins(): BulletinsClient;
|
|
@@ -45,4 +47,5 @@ export declare class BusinessClient {
|
|
|
45
47
|
get cuisines(): CuisinesClient;
|
|
46
48
|
get certifications(): CertificationsClient;
|
|
47
49
|
get categories(): CategoriesClient;
|
|
50
|
+
get allergens(): AllergensClient;
|
|
48
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import { AllergensClient } from "../resources/allergens/client/Client.mjs";
|
|
3
4
|
import { AuthClient } from "../resources/auth/client/Client.mjs";
|
|
4
5
|
import { BulletinsClient } from "../resources/bulletins/client/Client.mjs";
|
|
5
6
|
import { BusinessesClient } from "../resources/businesses/client/Client.mjs";
|
|
@@ -69,4 +70,8 @@ export class BusinessClient {
|
|
|
69
70
|
var _a;
|
|
70
71
|
return ((_a = this._categories) !== null && _a !== void 0 ? _a : (this._categories = new CategoriesClient(this._options)));
|
|
71
72
|
}
|
|
73
|
+
get allergens() {
|
|
74
|
+
var _a;
|
|
75
|
+
return ((_a = this._allergens) !== null && _a !== void 0 ? _a : (this._allergens = new AllergensClient(this._options)));
|
|
76
|
+
}
|
|
72
77
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace AllergensClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AllergensClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AllergensClient.Options>;
|
|
12
|
+
constructor(options?: AllergensClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve a list of all allergens, ordered alphabetically. Use these UUIDs
|
|
15
|
+
* in the `allergens` array when creating or updating a menu item.
|
|
16
|
+
*
|
|
17
|
+
* @param {AllergensClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.business.allergens.list()
|
|
23
|
+
*/
|
|
24
|
+
list(requestOptions?: AllergensClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListAllergensResponse>;
|
|
25
|
+
private __list;
|
|
26
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../../../index.mjs";
|
|
18
|
+
export class AllergensClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a list of all allergens, ordered alphabetically. Use these UUIDs
|
|
24
|
+
* in the `allergens` array when creating or updating a menu item.
|
|
25
|
+
*
|
|
26
|
+
* @param {AllergensClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.business.allergens.list()
|
|
32
|
+
*/
|
|
33
|
+
list(requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
35
|
+
}
|
|
36
|
+
__list(requestOptions) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
40
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
41
|
+
const _response = yield core.fetcher({
|
|
42
|
+
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/allergens"),
|
|
43
|
+
method: "GET",
|
|
44
|
+
headers: _headers,
|
|
45
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
46
|
+
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,
|
|
47
|
+
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,
|
|
48
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
49
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
50
|
+
logging: this._options.logging,
|
|
51
|
+
});
|
|
52
|
+
if (_response.ok) {
|
|
53
|
+
return {
|
|
54
|
+
data: _response.body,
|
|
55
|
+
rawResponse: _response.rawResponse,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (_response.error.reason === "status-code") {
|
|
59
|
+
switch (_response.error.statusCode) {
|
|
60
|
+
case 401:
|
|
61
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
62
|
+
default:
|
|
63
|
+
throw new errors.FiveOneEatError({
|
|
64
|
+
statusCode: _response.error.statusCode,
|
|
65
|
+
body: _response.error.body,
|
|
66
|
+
rawResponse: _response.rawResponse,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/allergens");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListAllergensResponse.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ListAllergensResponse.mjs";
|
|
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
5
|
+
import { CommentsClient } from "../resources/comments/client/Client.mjs";
|
|
5
6
|
export declare namespace BulletinsClient {
|
|
6
7
|
type Options = BaseClientOptions;
|
|
7
8
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -9,7 +10,9 @@ export declare namespace BulletinsClient {
|
|
|
9
10
|
}
|
|
10
11
|
export declare class BulletinsClient {
|
|
11
12
|
protected readonly _options: NormalizedClientOptionsWithAuth<BulletinsClient.Options>;
|
|
13
|
+
protected _comments: CommentsClient | undefined;
|
|
12
14
|
constructor(options?: BulletinsClient.Options);
|
|
15
|
+
get comments(): CommentsClient;
|
|
13
16
|
/**
|
|
14
17
|
* @param {BulletinsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
15
18
|
*
|
|
@@ -26,10 +26,15 @@ import * as environments from "../../../../../../environments.mjs";
|
|
|
26
26
|
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
27
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
28
28
|
import * as FiveOneEat from "../../../../../index.mjs";
|
|
29
|
+
import { CommentsClient } from "../resources/comments/client/Client.mjs";
|
|
29
30
|
export class BulletinsClient {
|
|
30
31
|
constructor(options = {}) {
|
|
31
32
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
33
|
}
|
|
34
|
+
get comments() {
|
|
35
|
+
var _a;
|
|
36
|
+
return ((_a = this._comments) !== null && _a !== void 0 ? _a : (this._comments = new CommentsClient(this._options)));
|
|
37
|
+
}
|
|
33
38
|
/**
|
|
34
39
|
* @param {BulletinsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
40
|
*
|
package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.d.mts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
5
|
+
export declare namespace CommentsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class CommentsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CommentsClient.Options>;
|
|
12
|
+
constructor(options?: CommentsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {FiveOneEat.business.bulletins.ListCommentsRequest} request
|
|
15
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
|
+
*
|
|
17
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
18
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
19
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
20
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* await client.business.bulletins.comments.list({
|
|
24
|
+
* bulletin: "bulletin"
|
|
25
|
+
* })
|
|
26
|
+
*/
|
|
27
|
+
list(request: FiveOneEat.business.bulletins.ListCommentsRequest, requestOptions?: CommentsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.bulletins.ListCommentsResponse>;
|
|
28
|
+
private __list;
|
|
29
|
+
/**
|
|
30
|
+
* Omit `parent_id` for a top-level comment. Set `parent_id` to a top-level
|
|
31
|
+
* comment's id to post a one-level reply (replies to replies are not allowed).
|
|
32
|
+
*
|
|
33
|
+
* @param {FiveOneEat.business.bulletins.StoreBulletinCommentRequest} request
|
|
34
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
37
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
38
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
39
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.business.bulletins.comments.create({
|
|
43
|
+
* bulletin: "bulletin",
|
|
44
|
+
* body: "body"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
create(request: FiveOneEat.business.bulletins.StoreBulletinCommentRequest, requestOptions?: CommentsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.bulletins.CreateCommentsResponse>;
|
|
48
|
+
private __create;
|
|
49
|
+
}
|
package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.mjs
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
28
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
29
|
+
export class CommentsClient {
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @param {FiveOneEat.business.bulletins.ListCommentsRequest} request
|
|
35
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
38
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
39
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
40
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.business.bulletins.comments.list({
|
|
44
|
+
* bulletin: "bulletin"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
list(request, requestOptions) {
|
|
48
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
49
|
+
}
|
|
50
|
+
__list(request, requestOptions) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53
|
+
const { bulletin, page, per_page: perPage } = request;
|
|
54
|
+
const _queryParams = {
|
|
55
|
+
page,
|
|
56
|
+
per_page: perPage,
|
|
57
|
+
};
|
|
58
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
59
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
60
|
+
const _response = yield core.fetcher({
|
|
61
|
+
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/bulletins/${core.url.encodePathParam(bulletin)}/comments`),
|
|
62
|
+
method: "GET",
|
|
63
|
+
headers: _headers,
|
|
64
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
65
|
+
queryString: core.url
|
|
66
|
+
.queryBuilder()
|
|
67
|
+
.addMany(_queryParams)
|
|
68
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
69
|
+
.build(),
|
|
70
|
+
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,
|
|
71
|
+
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,
|
|
72
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
73
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
74
|
+
logging: this._options.logging,
|
|
75
|
+
});
|
|
76
|
+
if (_response.ok) {
|
|
77
|
+
return {
|
|
78
|
+
data: _response.body,
|
|
79
|
+
rawResponse: _response.rawResponse,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (_response.error.reason === "status-code") {
|
|
83
|
+
switch (_response.error.statusCode) {
|
|
84
|
+
case 401:
|
|
85
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
86
|
+
case 403:
|
|
87
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
88
|
+
case 404:
|
|
89
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
90
|
+
case 422:
|
|
91
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
92
|
+
default:
|
|
93
|
+
throw new errors.FiveOneEatError({
|
|
94
|
+
statusCode: _response.error.statusCode,
|
|
95
|
+
body: _response.error.body,
|
|
96
|
+
rawResponse: _response.rawResponse,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/bulletins/{bulletin}/comments");
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Omit `parent_id` for a top-level comment. Set `parent_id` to a top-level
|
|
105
|
+
* comment's id to post a one-level reply (replies to replies are not allowed).
|
|
106
|
+
*
|
|
107
|
+
* @param {FiveOneEat.business.bulletins.StoreBulletinCommentRequest} request
|
|
108
|
+
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
111
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
112
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
113
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* await client.business.bulletins.comments.create({
|
|
117
|
+
* bulletin: "bulletin",
|
|
118
|
+
* body: "body"
|
|
119
|
+
* })
|
|
120
|
+
*/
|
|
121
|
+
create(request, requestOptions) {
|
|
122
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
123
|
+
}
|
|
124
|
+
__create(request, requestOptions) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
127
|
+
const { bulletin } = request, _body = __rest(request, ["bulletin"]);
|
|
128
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
129
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
130
|
+
const _response = yield core.fetcher({
|
|
131
|
+
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/bulletins/${core.url.encodePathParam(bulletin)}/comments`),
|
|
132
|
+
method: "POST",
|
|
133
|
+
headers: _headers,
|
|
134
|
+
contentType: "application/json",
|
|
135
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
136
|
+
requestType: "json",
|
|
137
|
+
body: _body,
|
|
138
|
+
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,
|
|
139
|
+
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,
|
|
140
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
141
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
142
|
+
logging: this._options.logging,
|
|
143
|
+
});
|
|
144
|
+
if (_response.ok) {
|
|
145
|
+
return {
|
|
146
|
+
data: _response.body,
|
|
147
|
+
rawResponse: _response.rawResponse,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (_response.error.reason === "status-code") {
|
|
151
|
+
switch (_response.error.statusCode) {
|
|
152
|
+
case 401:
|
|
153
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
154
|
+
case 403:
|
|
155
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
156
|
+
case 404:
|
|
157
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
158
|
+
case 422:
|
|
159
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
160
|
+
default:
|
|
161
|
+
throw new errors.FiveOneEatError({
|
|
162
|
+
statusCode: _response.error.statusCode,
|
|
163
|
+
body: _response.error.body,
|
|
164
|
+
rawResponse: _response.rawResponse,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/bulletins/{bulletin}/comments");
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|