@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.
Files changed (96) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/resources/bulletins/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/business/resources/bulletins/client/Client.js +5 -0
  4. package/dist/cjs/api/resources/business/resources/bulletins/exports.d.ts +1 -0
  5. package/dist/cjs/api/resources/business/resources/bulletins/exports.js +1 -0
  6. package/dist/cjs/api/resources/business/resources/bulletins/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/business/resources/bulletins/index.js +1 -0
  8. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/Client.d.ts +49 -0
  9. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/Client.js +208 -0
  10. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/index.js +17 -0
  12. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.ts +12 -0
  13. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.d.ts +13 -0
  14. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.js +3 -0
  15. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/client/requests/index.js +2 -0
  17. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/exports.d.ts +2 -0
  18. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/exports.js +21 -0
  19. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/index.d.ts +2 -0
  20. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/index.js +18 -0
  21. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.d.ts +4 -0
  22. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.js +3 -0
  23. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.d.ts +4 -0
  24. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.js +3 -0
  25. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/index.d.ts +2 -0
  26. package/dist/cjs/api/resources/business/resources/bulletins/resources/comments/types/index.js +18 -0
  27. package/dist/cjs/api/resources/business/resources/bulletins/resources/index.d.ts +3 -0
  28. package/dist/cjs/api/resources/business/resources/bulletins/resources/index.js +42 -0
  29. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.ts +2 -2
  30. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +1 -1
  31. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/{StoreBulletinCommentRequest.d.ts → AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.ts} +2 -1
  32. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.js +3 -0
  33. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.ts +1 -1
  34. package/dist/cjs/api/types/BusinessBulletinComment.d.ts +15 -0
  35. package/dist/cjs/api/types/BusinessBulletinComment.js +3 -0
  36. package/dist/cjs/api/types/BusinessBulletinCommentReply.d.ts +13 -0
  37. package/dist/cjs/api/types/BusinessBulletinCommentReply.js +3 -0
  38. package/dist/cjs/api/types/BusinessBulletinCommentResponse.d.ts +5 -0
  39. package/dist/cjs/api/types/BusinessBulletinCommentResponse.js +3 -0
  40. package/dist/cjs/api/types/CustomerBulletinCommentReply.d.ts +13 -0
  41. package/dist/cjs/api/types/CustomerBulletinCommentReply.js +3 -0
  42. package/dist/cjs/api/types/CustomerComment.d.ts +3 -0
  43. package/dist/cjs/api/types/index.d.ts +4 -0
  44. package/dist/cjs/api/types/index.js +4 -0
  45. package/dist/cjs/version.d.ts +1 -1
  46. package/dist/cjs/version.js +1 -1
  47. package/dist/esm/BaseClient.mjs +2 -2
  48. package/dist/esm/api/resources/business/resources/bulletins/client/Client.d.mts +3 -0
  49. package/dist/esm/api/resources/business/resources/bulletins/client/Client.mjs +5 -0
  50. package/dist/esm/api/resources/business/resources/bulletins/exports.d.mts +1 -0
  51. package/dist/esm/api/resources/business/resources/bulletins/exports.mjs +1 -0
  52. package/dist/esm/api/resources/business/resources/bulletins/index.d.mts +1 -0
  53. package/dist/esm/api/resources/business/resources/bulletins/index.mjs +1 -0
  54. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.d.mts +49 -0
  55. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/Client.mjs +171 -0
  56. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.d.mts +1 -0
  57. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/index.mjs +1 -0
  58. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/ListCommentsRequest.d.mts +12 -0
  59. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.d.mts +13 -0
  60. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentRequest.mjs +2 -0
  61. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/index.d.mts +2 -0
  62. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/client/requests/index.mjs +1 -0
  63. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/exports.d.mts +2 -0
  64. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/exports.mjs +3 -0
  65. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/index.d.mts +2 -0
  66. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/index.mjs +2 -0
  67. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.d.mts +4 -0
  68. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/CreateCommentsResponse.mjs +2 -0
  69. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.d.mts +4 -0
  70. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/ListCommentsResponse.mjs +2 -0
  71. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/index.d.mts +2 -0
  72. package/dist/esm/api/resources/business/resources/bulletins/resources/comments/types/index.mjs +2 -0
  73. package/dist/esm/api/resources/business/resources/bulletins/resources/index.d.mts +3 -0
  74. package/dist/esm/api/resources/business/resources/bulletins/resources/index.mjs +3 -0
  75. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.mts +2 -2
  76. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +1 -1
  77. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/{StoreBulletinCommentRequest.d.mts → AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.d.mts} +2 -1
  78. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.mjs +2 -0
  79. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.mts +1 -1
  80. package/dist/esm/api/types/BusinessBulletinComment.d.mts +15 -0
  81. package/dist/esm/api/types/BusinessBulletinComment.mjs +2 -0
  82. package/dist/esm/api/types/BusinessBulletinCommentReply.d.mts +13 -0
  83. package/dist/esm/api/types/BusinessBulletinCommentReply.mjs +2 -0
  84. package/dist/esm/api/types/BusinessBulletinCommentResponse.d.mts +5 -0
  85. package/dist/esm/api/types/BusinessBulletinCommentResponse.mjs +2 -0
  86. package/dist/esm/api/types/CustomerBulletinCommentReply.d.mts +13 -0
  87. package/dist/esm/api/types/CustomerBulletinCommentReply.mjs +2 -0
  88. package/dist/esm/api/types/CustomerComment.d.mts +3 -0
  89. package/dist/esm/api/types/index.d.mts +4 -0
  90. package/dist/esm/api/types/index.mjs +4 -0
  91. package/dist/esm/version.d.mts +1 -1
  92. package/dist/esm/version.mjs +1 -1
  93. package/package.json +12 -1
  94. package/reference.md +120 -1
  95. /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
  96. /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
@@ -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.28",
47
- "User-Agent": "@51eat/sdk/0.0.28",
46
+ "X-Fern-SDK-Version": "0.0.29",
47
+ "User-Agent": "@51eat/sdk/0.0.29",
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,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as FiveOneEat from "../../../../../index.js";
5
+ import { CommentsClient } from "../resources/comments/client/Client.js";
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
  *
@@ -62,10 +62,15 @@ const environments = __importStar(require("../../../../../../environments.js"));
62
62
  const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
63
63
  const errors = __importStar(require("../../../../../../errors/index.js"));
64
64
  const FiveOneEat = __importStar(require("../../../../../index.js"));
65
+ const Client_js_1 = require("../resources/comments/client/Client.js");
65
66
  class BulletinsClient {
66
67
  constructor(options = {}) {
67
68
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
69
  }
70
+ get comments() {
71
+ var _a;
72
+ return ((_a = this._comments) !== null && _a !== void 0 ? _a : (this._comments = new Client_js_1.CommentsClient(this._options)));
73
+ }
69
74
  /**
70
75
  * @param {BulletinsClient.RequestOptions} requestOptions - Request-specific configuration.
71
76
  *
@@ -1,2 +1,3 @@
1
1
  export { BulletinsClient } from "./client/Client.js";
2
2
  export * from "./client/index.js";
3
+ export * from "./resources/index.js";
@@ -19,3 +19,4 @@ exports.BulletinsClient = void 0;
19
19
  var Client_js_1 = require("./client/Client.js");
20
20
  Object.defineProperty(exports, "BulletinsClient", { enumerable: true, get: function () { return Client_js_1.BulletinsClient; } });
21
21
  __exportStar(require("./client/index.js"), exports);
22
+ __exportStar(require("./resources/index.js"), exports);
@@ -1,2 +1,3 @@
1
1
  export * from "./client/index.js";
2
+ export * from "./resources/index.js";
2
3
  export * from "./types/index.js";
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./resources/index.js"), exports);
18
19
  __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,49 @@
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 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
+ }
@@ -0,0 +1,208 @@
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.CommentsClient = 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 CommentsClient {
66
+ constructor(options = {}) {
67
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
+ }
69
+ /**
70
+ * @param {FiveOneEat.business.bulletins.ListCommentsRequest} request
71
+ * @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
72
+ *
73
+ * @throws {@link FiveOneEat.UnauthorizedError}
74
+ * @throws {@link FiveOneEat.ForbiddenError}
75
+ * @throws {@link FiveOneEat.NotFoundError}
76
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
77
+ *
78
+ * @example
79
+ * await client.business.bulletins.comments.list({
80
+ * bulletin: "bulletin"
81
+ * })
82
+ */
83
+ list(request, requestOptions) {
84
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
85
+ }
86
+ __list(request, requestOptions) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
89
+ const { bulletin, page, per_page: perPage } = request;
90
+ const _queryParams = {
91
+ page,
92
+ per_page: perPage,
93
+ };
94
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
95
+ 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);
96
+ const _response = yield core.fetcher({
97
+ 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`),
98
+ method: "GET",
99
+ headers: _headers,
100
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
101
+ queryString: core.url
102
+ .queryBuilder()
103
+ .addMany(_queryParams)
104
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
105
+ .build(),
106
+ 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,
107
+ 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,
108
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
109
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
110
+ logging: this._options.logging,
111
+ });
112
+ if (_response.ok) {
113
+ return {
114
+ data: _response.body,
115
+ rawResponse: _response.rawResponse,
116
+ };
117
+ }
118
+ if (_response.error.reason === "status-code") {
119
+ switch (_response.error.statusCode) {
120
+ case 401:
121
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
122
+ case 403:
123
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
124
+ case 404:
125
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
126
+ case 422:
127
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
128
+ default:
129
+ throw new errors.FiveOneEatError({
130
+ statusCode: _response.error.statusCode,
131
+ body: _response.error.body,
132
+ rawResponse: _response.rawResponse,
133
+ });
134
+ }
135
+ }
136
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/bulletins/{bulletin}/comments");
137
+ });
138
+ }
139
+ /**
140
+ * Omit `parent_id` for a top-level comment. Set `parent_id` to a top-level
141
+ * comment's id to post a one-level reply (replies to replies are not allowed).
142
+ *
143
+ * @param {FiveOneEat.business.bulletins.StoreBulletinCommentRequest} request
144
+ * @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
145
+ *
146
+ * @throws {@link FiveOneEat.UnauthorizedError}
147
+ * @throws {@link FiveOneEat.ForbiddenError}
148
+ * @throws {@link FiveOneEat.NotFoundError}
149
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
150
+ *
151
+ * @example
152
+ * await client.business.bulletins.comments.create({
153
+ * bulletin: "bulletin",
154
+ * body: "body"
155
+ * })
156
+ */
157
+ create(request, requestOptions) {
158
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
159
+ }
160
+ __create(request, requestOptions) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
163
+ const { bulletin } = request, _body = __rest(request, ["bulletin"]);
164
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
165
+ 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);
166
+ const _response = yield core.fetcher({
167
+ 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`),
168
+ method: "POST",
169
+ headers: _headers,
170
+ contentType: "application/json",
171
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
172
+ requestType: "json",
173
+ body: _body,
174
+ 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,
175
+ 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,
176
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
177
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
178
+ logging: this._options.logging,
179
+ });
180
+ if (_response.ok) {
181
+ return {
182
+ data: _response.body,
183
+ rawResponse: _response.rawResponse,
184
+ };
185
+ }
186
+ if (_response.error.reason === "status-code") {
187
+ switch (_response.error.statusCode) {
188
+ case 401:
189
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
190
+ case 403:
191
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
192
+ case 404:
193
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
194
+ case 422:
195
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
196
+ default:
197
+ throw new errors.FiveOneEatError({
198
+ statusCode: _response.error.statusCode,
199
+ body: _response.error.body,
200
+ rawResponse: _response.rawResponse,
201
+ });
202
+ }
203
+ }
204
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/bulletins/{bulletin}/comments");
205
+ });
206
+ }
207
+ }
208
+ exports.CommentsClient = CommentsClient;
@@ -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);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * bulletin: "bulletin"
5
+ * }
6
+ */
7
+ export interface ListCommentsRequest {
8
+ /** The bulletin ID */
9
+ bulletin: string;
10
+ page?: number | null;
11
+ per_page?: number | null;
12
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * bulletin: "bulletin",
5
+ * body: "body"
6
+ * }
7
+ */
8
+ export interface StoreBulletinCommentRequest {
9
+ /** The bulletin ID */
10
+ bulletin: string;
11
+ body: string;
12
+ parent_id?: string | null;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export type { ListCommentsRequest } from "./ListCommentsRequest.js";
2
+ export type { StoreBulletinCommentRequest } from "./StoreBulletinCommentRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { CommentsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CommentsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "CommentsClient", { enumerable: true, get: function () { return Client_js_1.CommentsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface CreateCommentsResponse {
3
+ data: FiveOneEat.BusinessBulletinComment;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../../../index.js";
2
+ export interface ListCommentsResponse {
3
+ data: FiveOneEat.BusinessBulletinCommentResponse;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./CreateCommentsResponse.js";
2
+ export * from "./ListCommentsResponse.js";
@@ -0,0 +1,18 @@
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("./CreateCommentsResponse.js"), exports);
18
+ __exportStar(require("./ListCommentsResponse.js"), exports);
@@ -0,0 +1,3 @@
1
+ export * from "./comments/client/requests/index.js";
2
+ export * as comments from "./comments/index.js";
3
+ export * from "./comments/types/index.js";
@@ -0,0 +1,42 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.comments = void 0;
40
+ __exportStar(require("./comments/client/requests/index.js"), exports);
41
+ exports.comments = __importStar(require("./comments/index.js"));
42
+ __exportStar(require("./comments/types/index.js"), exports);
@@ -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.StoreBulletinCommentRequest} request
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.StoreBulletinCommentRequest, requestOptions?: CommentsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.businesses.bulletins.CreateCommentsResponse>;
48
+ create(request: FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest, requestOptions?: CommentsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.businesses.bulletins.CreateCommentsResponse>;
49
49
  private __create;
50
50
  }
@@ -139,7 +139,7 @@ class CommentsClient {
139
139
  /**
140
140
  * Post a comment on a business bulletin. Requires authentication.
141
141
  *
142
- * @param {FiveOneEat.customer.businesses.bulletins.StoreBulletinCommentRequest} request
142
+ * @param {FiveOneEat.customer.businesses.bulletins.AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest} request
143
143
  * @param {CommentsClient.RequestOptions} requestOptions - Request-specific configuration.
144
144
  *
145
145
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -6,10 +6,11 @@
6
6
  * body: "body"
7
7
  * }
8
8
  */
9
- export interface StoreBulletinCommentRequest {
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
  }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,2 @@
1
+ export type { AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest } from "./AppHttpRequestsApiV1CustomerBusinessesStoreBulletinCommentRequest.js";
1
2
  export type { ListCommentsRequest } from "./ListCommentsRequest.js";
2
- export type { StoreBulletinCommentRequest } from "./StoreBulletinCommentRequest.js";
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });