@51eat/sdk 0.0.28 → 0.0.29
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/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/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/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/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/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -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/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/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/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/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/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +120 -1
- /package/dist/cjs/api/resources/{customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.js → business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.js} +0 -0
- /package/dist/esm/api/resources/{customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.mjs → business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.mjs} +0 -0
|
@@ -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 {
|
|
@@ -21,6 +21,9 @@ export * from "./BardSetNode.js";
|
|
|
21
21
|
export * from "./BardSetValues.js";
|
|
22
22
|
export * from "./BardTextNode.js";
|
|
23
23
|
export * from "./BusinessBulletin.js";
|
|
24
|
+
export * from "./BusinessBulletinComment.js";
|
|
25
|
+
export * from "./BusinessBulletinCommentReply.js";
|
|
26
|
+
export * from "./BusinessBulletinCommentResponse.js";
|
|
24
27
|
export * from "./BusinessCategory.js";
|
|
25
28
|
export * from "./BusinessCertification.js";
|
|
26
29
|
export * from "./BusinessConversation.js";
|
|
@@ -50,6 +53,7 @@ export * from "./ConflictErrorBody.js";
|
|
|
50
53
|
export * from "./Conversation.js";
|
|
51
54
|
export * from "./Cuisine.js";
|
|
52
55
|
export * from "./CustomerBulletin.js";
|
|
56
|
+
export * from "./CustomerBulletinCommentReply.js";
|
|
53
57
|
export * from "./CustomerBulletinResponse.js";
|
|
54
58
|
export * from "./CustomerBusinessProfile.js";
|
|
55
59
|
export * from "./CustomerComment.js";
|
|
@@ -37,6 +37,9 @@ __exportStar(require("./BardSetNode.js"), exports);
|
|
|
37
37
|
__exportStar(require("./BardSetValues.js"), exports);
|
|
38
38
|
__exportStar(require("./BardTextNode.js"), exports);
|
|
39
39
|
__exportStar(require("./BusinessBulletin.js"), exports);
|
|
40
|
+
__exportStar(require("./BusinessBulletinComment.js"), exports);
|
|
41
|
+
__exportStar(require("./BusinessBulletinCommentReply.js"), exports);
|
|
42
|
+
__exportStar(require("./BusinessBulletinCommentResponse.js"), exports);
|
|
40
43
|
__exportStar(require("./BusinessCategory.js"), exports);
|
|
41
44
|
__exportStar(require("./BusinessCertification.js"), exports);
|
|
42
45
|
__exportStar(require("./BusinessConversation.js"), exports);
|
|
@@ -66,6 +69,7 @@ __exportStar(require("./ConflictErrorBody.js"), exports);
|
|
|
66
69
|
__exportStar(require("./Conversation.js"), exports);
|
|
67
70
|
__exportStar(require("./Cuisine.js"), exports);
|
|
68
71
|
__exportStar(require("./CustomerBulletin.js"), exports);
|
|
72
|
+
__exportStar(require("./CustomerBulletinCommentReply.js"), exports);
|
|
69
73
|
__exportStar(require("./CustomerBulletinResponse.js"), exports);
|
|
70
74
|
__exportStar(require("./CustomerBusinessProfile.js"), exports);
|
|
71
75
|
__exportStar(require("./CustomerComment.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.29";
|
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.29",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.29",
|
|
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);
|
|
@@ -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";
|
package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -31,7 +31,7 @@ export declare class CommentsClient {
|
|
|
31
31
|
/**
|
|
32
32
|
* Post a comment on a business bulletin. Requires authentication.
|
|
33
33
|
*
|
|
34
|
-
* @param {FiveOneEat.customer.businesses.bulletins.
|
|
34
|
+
* @param {FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest} request
|
|
35
35
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -45,6 +45,6 @@ export declare class CommentsClient {
|
|
|
45
45
|
* body: "body"
|
|
46
46
|
* })
|
|
47
47
|
*/
|
|
48
|
-
create(request: FiveOneEat.customer.businesses.bulletins.
|
|
48
|
+
create(request: FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest, requestOptions?: CommentsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.businesses.bulletins.CreateCommentsResponse>;
|
|
49
49
|
private __create;
|
|
50
50
|
}
|
|
@@ -103,7 +103,7 @@ export class CommentsClient {
|
|
|
103
103
|
/**
|
|
104
104
|
* Post a comment on a business bulletin. Requires authentication.
|
|
105
105
|
*
|
|
106
|
-
* @param {FiveOneEat.customer.businesses.bulletins.
|
|
106
|
+
* @param {FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest} request
|
|
107
107
|
* @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
108
|
*
|
|
109
109
|
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* body: "body"
|
|
7
7
|
* }
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest {
|
|
10
10
|
/** The business handle */
|
|
11
11
|
handle: string;
|
|
12
12
|
/** The bulletin ID */
|
|
13
13
|
bulletin: string;
|
|
14
14
|
body: string;
|
|
15
|
+
parent_id?: string | null;
|
|
15
16
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
+
export type { AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest } from "./AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.mjs";
|
|
1
2
|
export type { ListCommentsRequest } from "./ListCommentsRequest.mjs";
|
|
2
|
-
export type { StoreBulletinCommentRequest } from "./StoreBulletinCommentRequest.mjs";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as FiveOneEat from "../index.mjs";
|
|
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.mjs";
|
|
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 {
|