@foru-ms/sdk 2.1.13 → 2.1.15

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 (112) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +27 -22
  4. package/dist/cjs/api/resources/index.d.ts +3 -0
  5. package/dist/cjs/api/resources/index.js +4 -1
  6. package/dist/cjs/api/resources/pollVotes/client/Client.d.ts +68 -0
  7. package/dist/cjs/api/resources/pollVotes/client/Client.js +256 -0
  8. package/dist/cjs/api/resources/pollVotes/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/pollVotes/client/index.js +17 -0
  10. package/dist/cjs/api/resources/pollVotes/client/requests/CreatevotePollVotesRequest.d.ts +15 -0
  11. package/dist/cjs/api/resources/pollVotes/client/requests/CreatevotePollVotesRequest.js +3 -0
  12. package/dist/cjs/api/resources/pollVotes/client/requests/DeleteOwnvotePollVotesRequest.d.ts +10 -0
  13. package/dist/cjs/api/resources/pollVotes/client/requests/DeleteOwnvotePollVotesRequest.js +3 -0
  14. package/dist/cjs/api/resources/pollVotes/client/requests/DeletevotePollVotesRequest.d.ts +13 -0
  15. package/dist/cjs/api/resources/pollVotes/client/requests/DeletevotePollVotesRequest.js +3 -0
  16. package/dist/cjs/api/resources/pollVotes/client/requests/index.d.ts +3 -0
  17. package/dist/cjs/api/resources/pollVotes/client/requests/index.js +2 -0
  18. package/dist/cjs/api/resources/pollVotes/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/pollVotes/index.js +18 -0
  20. package/dist/cjs/api/resources/pollVotes/types/DeleteOwnvotePollVotesResponse.d.ts +8 -0
  21. package/dist/cjs/api/resources/pollVotes/types/DeleteOwnvotePollVotesResponse.js +3 -0
  22. package/dist/cjs/api/resources/pollVotes/types/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/pollVotes/types/index.js +17 -0
  24. package/dist/cjs/api/resources/posts/client/Client.js +4 -2
  25. package/dist/cjs/api/resources/posts/client/requests/ListPostsPostsRequest.d.ts +2 -0
  26. package/dist/cjs/api/resources/posts/client/requests/ListPostsRequest.d.ts +2 -0
  27. package/dist/cjs/api/resources/tags/client/Client.d.ts +37 -0
  28. package/dist/cjs/api/resources/tags/client/Client.js +126 -0
  29. package/dist/cjs/api/resources/tags/client/requests/CreateSubscriberTagsRequest.d.ts +12 -0
  30. package/dist/cjs/api/resources/tags/client/requests/CreateSubscriberTagsRequest.js +3 -0
  31. package/dist/cjs/api/resources/tags/client/requests/UnsubscribeTagsRequest.d.ts +10 -0
  32. package/dist/cjs/api/resources/tags/client/requests/UnsubscribeTagsRequest.js +3 -0
  33. package/dist/cjs/api/resources/tags/client/requests/index.d.ts +2 -0
  34. package/dist/cjs/api/resources/tags/types/UnsubscribeTagsResponse.d.ts +8 -0
  35. package/dist/cjs/api/resources/tags/types/UnsubscribeTagsResponse.js +3 -0
  36. package/dist/cjs/api/resources/tags/types/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/tags/types/index.js +1 -0
  38. package/dist/cjs/api/resources/threads/client/Client.d.ts +18 -0
  39. package/dist/cjs/api/resources/threads/client/Client.js +60 -0
  40. package/dist/cjs/api/resources/threads/client/requests/UnsubscribeThreadsRequest.d.ts +10 -0
  41. package/dist/cjs/api/resources/threads/client/requests/UnsubscribeThreadsRequest.js +3 -0
  42. package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/threads/types/UnsubscribeThreadsResponse.d.ts +8 -0
  44. package/dist/cjs/api/resources/threads/types/UnsubscribeThreadsResponse.js +3 -0
  45. package/dist/cjs/api/resources/threads/types/index.d.ts +1 -0
  46. package/dist/cjs/api/resources/threads/types/index.js +1 -0
  47. package/dist/cjs/api/types/PollVotesResponse.d.ts +12 -0
  48. package/dist/cjs/api/types/PollVotesResponse.js +3 -0
  49. package/dist/cjs/api/types/PostList.d.ts +2 -0
  50. package/dist/cjs/api/types/TagSubscriberCreate.d.ts +4 -0
  51. package/dist/cjs/api/types/TagSubscriberCreate.js +3 -0
  52. package/dist/cjs/api/types/index.d.ts +2 -0
  53. package/dist/cjs/api/types/index.js +2 -0
  54. package/dist/cjs/version.d.ts +1 -1
  55. package/dist/cjs/version.js +1 -1
  56. package/dist/esm/BaseClient.mjs +2 -2
  57. package/dist/esm/Client.d.mts +3 -0
  58. package/dist/esm/Client.mjs +5 -0
  59. package/dist/esm/api/resources/index.d.mts +3 -0
  60. package/dist/esm/api/resources/index.mjs +3 -0
  61. package/dist/esm/api/resources/pollVotes/client/Client.d.mts +68 -0
  62. package/dist/esm/api/resources/pollVotes/client/Client.mjs +219 -0
  63. package/dist/esm/api/resources/pollVotes/client/index.d.mts +1 -0
  64. package/dist/esm/api/resources/pollVotes/client/index.mjs +1 -0
  65. package/dist/esm/api/resources/pollVotes/client/requests/CreatevotePollVotesRequest.d.mts +15 -0
  66. package/dist/esm/api/resources/pollVotes/client/requests/CreatevotePollVotesRequest.mjs +2 -0
  67. package/dist/esm/api/resources/pollVotes/client/requests/DeleteOwnvotePollVotesRequest.d.mts +10 -0
  68. package/dist/esm/api/resources/pollVotes/client/requests/DeleteOwnvotePollVotesRequest.mjs +2 -0
  69. package/dist/esm/api/resources/pollVotes/client/requests/DeletevotePollVotesRequest.d.mts +13 -0
  70. package/dist/esm/api/resources/pollVotes/client/requests/DeletevotePollVotesRequest.mjs +2 -0
  71. package/dist/esm/api/resources/pollVotes/client/requests/index.d.mts +3 -0
  72. package/dist/esm/api/resources/pollVotes/client/requests/index.mjs +1 -0
  73. package/dist/esm/api/resources/pollVotes/index.d.mts +2 -0
  74. package/dist/esm/api/resources/pollVotes/index.mjs +2 -0
  75. package/dist/esm/api/resources/pollVotes/types/DeleteOwnvotePollVotesResponse.d.mts +8 -0
  76. package/dist/esm/api/resources/pollVotes/types/DeleteOwnvotePollVotesResponse.mjs +2 -0
  77. package/dist/esm/api/resources/pollVotes/types/index.d.mts +1 -0
  78. package/dist/esm/api/resources/pollVotes/types/index.mjs +1 -0
  79. package/dist/esm/api/resources/posts/client/Client.mjs +4 -2
  80. package/dist/esm/api/resources/posts/client/requests/ListPostsPostsRequest.d.mts +2 -0
  81. package/dist/esm/api/resources/posts/client/requests/ListPostsRequest.d.mts +2 -0
  82. package/dist/esm/api/resources/tags/client/Client.d.mts +37 -0
  83. package/dist/esm/api/resources/tags/client/Client.mjs +126 -0
  84. package/dist/esm/api/resources/tags/client/requests/CreateSubscriberTagsRequest.d.mts +12 -0
  85. package/dist/esm/api/resources/tags/client/requests/CreateSubscriberTagsRequest.mjs +2 -0
  86. package/dist/esm/api/resources/tags/client/requests/UnsubscribeTagsRequest.d.mts +10 -0
  87. package/dist/esm/api/resources/tags/client/requests/UnsubscribeTagsRequest.mjs +2 -0
  88. package/dist/esm/api/resources/tags/client/requests/index.d.mts +2 -0
  89. package/dist/esm/api/resources/tags/types/UnsubscribeTagsResponse.d.mts +8 -0
  90. package/dist/esm/api/resources/tags/types/UnsubscribeTagsResponse.mjs +2 -0
  91. package/dist/esm/api/resources/tags/types/index.d.mts +1 -0
  92. package/dist/esm/api/resources/tags/types/index.mjs +1 -0
  93. package/dist/esm/api/resources/threads/client/Client.d.mts +18 -0
  94. package/dist/esm/api/resources/threads/client/Client.mjs +60 -0
  95. package/dist/esm/api/resources/threads/client/requests/UnsubscribeThreadsRequest.d.mts +10 -0
  96. package/dist/esm/api/resources/threads/client/requests/UnsubscribeThreadsRequest.mjs +2 -0
  97. package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
  98. package/dist/esm/api/resources/threads/types/UnsubscribeThreadsResponse.d.mts +8 -0
  99. package/dist/esm/api/resources/threads/types/UnsubscribeThreadsResponse.mjs +2 -0
  100. package/dist/esm/api/resources/threads/types/index.d.mts +1 -0
  101. package/dist/esm/api/resources/threads/types/index.mjs +1 -0
  102. package/dist/esm/api/types/PollVotesResponse.d.mts +12 -0
  103. package/dist/esm/api/types/PollVotesResponse.mjs +2 -0
  104. package/dist/esm/api/types/PostList.d.mts +2 -0
  105. package/dist/esm/api/types/TagSubscriberCreate.d.mts +4 -0
  106. package/dist/esm/api/types/TagSubscriberCreate.mjs +2 -0
  107. package/dist/esm/api/types/index.d.mts +2 -0
  108. package/dist/esm/api/types/index.mjs +2 -0
  109. package/dist/esm/version.d.mts +1 -1
  110. package/dist/esm/version.mjs +1 -1
  111. package/package.json +1 -1
  112. package/reference.md +379 -0
@@ -0,0 +1,68 @@
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 Forum from "../../../index.mjs";
5
+ export declare namespace PollVotesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class PollVotesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<PollVotesClient.Options>;
12
+ constructor(options?: PollVotesClient.Options);
13
+ /**
14
+ * Create a vote in the Thread's Poll.
15
+ *
16
+ * @param {Forum.CreatevotePollVotesRequest} request
17
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Forum.BadRequestError}
20
+ * @throws {@link Forum.UnauthorizedError}
21
+ * @throws {@link Forum.NotFoundError}
22
+ * @throws {@link Forum.TooManyRequestsError}
23
+ * @throws {@link Forum.InternalServerError}
24
+ *
25
+ * @example
26
+ * await client.pollVotes.createvote({
27
+ * id: "id",
28
+ * optionId: "optionId"
29
+ * })
30
+ */
31
+ createvote(request: Forum.CreatevotePollVotesRequest, requestOptions?: PollVotesClient.RequestOptions): core.HttpResponsePromise<Forum.PollVotesResponse>;
32
+ private __createvote;
33
+ /**
34
+ * Removes the authenticated user's vote. No ID needed.
35
+ *
36
+ * @param {Forum.DeleteOwnvotePollVotesRequest} request
37
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Forum.UnauthorizedError}
40
+ * @throws {@link Forum.NotFoundError}
41
+ * @throws {@link Forum.TooManyRequestsError}
42
+ * @throws {@link Forum.InternalServerError}
43
+ *
44
+ * @example
45
+ * await client.pollVotes.deleteOwnvote({
46
+ * id: "id"
47
+ * })
48
+ */
49
+ deleteOwnvote(request: Forum.DeleteOwnvotePollVotesRequest, requestOptions?: PollVotesClient.RequestOptions): core.HttpResponsePromise<Forum.DeleteOwnvotePollVotesResponse>;
50
+ private __deleteOwnvote;
51
+ /**
52
+ * @param {Forum.DeletevotePollVotesRequest} request
53
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link Forum.UnauthorizedError}
56
+ * @throws {@link Forum.NotFoundError}
57
+ * @throws {@link Forum.TooManyRequestsError}
58
+ * @throws {@link Forum.InternalServerError}
59
+ *
60
+ * @example
61
+ * await client.pollVotes.deletevote({
62
+ * id: "id",
63
+ * nestedId: "nestedId"
64
+ * })
65
+ */
66
+ deletevote(request: Forum.DeletevotePollVotesRequest, requestOptions?: PollVotesClient.RequestOptions): core.HttpResponsePromise<Forum.SuccessResponse>;
67
+ private __deletevote;
68
+ }
@@ -0,0 +1,219 @@
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 Forum from "../../../index.mjs";
29
+ export class PollVotesClient {
30
+ constructor(options = {}) {
31
+ this._options = normalizeClientOptionsWithAuth(options);
32
+ }
33
+ /**
34
+ * Create a vote in the Thread's Poll.
35
+ *
36
+ * @param {Forum.CreatevotePollVotesRequest} request
37
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Forum.BadRequestError}
40
+ * @throws {@link Forum.UnauthorizedError}
41
+ * @throws {@link Forum.NotFoundError}
42
+ * @throws {@link Forum.TooManyRequestsError}
43
+ * @throws {@link Forum.InternalServerError}
44
+ *
45
+ * @example
46
+ * await client.pollVotes.createvote({
47
+ * id: "id",
48
+ * optionId: "optionId"
49
+ * })
50
+ */
51
+ createvote(request, requestOptions) {
52
+ return core.HttpResponsePromise.fromPromise(this.__createvote(request, requestOptions));
53
+ }
54
+ __createvote(request, requestOptions) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
57
+ const { id } = request, _body = __rest(request, ["id"]);
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 ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
61
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `threads/${core.url.encodePathParam(id)}/poll/votes`),
62
+ method: "POST",
63
+ headers: _headers,
64
+ contentType: "application/json",
65
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
66
+ requestType: "json",
67
+ body: _body,
68
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
69
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
70
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
71
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
72
+ logging: this._options.logging,
73
+ });
74
+ if (_response.ok) {
75
+ return { data: _response.body, rawResponse: _response.rawResponse };
76
+ }
77
+ if (_response.error.reason === "status-code") {
78
+ switch (_response.error.statusCode) {
79
+ case 400:
80
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
81
+ case 401:
82
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
83
+ case 404:
84
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
85
+ case 429:
86
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
87
+ case 500:
88
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
89
+ default:
90
+ throw new errors.ForumError({
91
+ statusCode: _response.error.statusCode,
92
+ body: _response.error.body,
93
+ rawResponse: _response.rawResponse,
94
+ });
95
+ }
96
+ }
97
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/threads/{id}/poll/votes");
98
+ });
99
+ }
100
+ /**
101
+ * Removes the authenticated user's vote. No ID needed.
102
+ *
103
+ * @param {Forum.DeleteOwnvotePollVotesRequest} request
104
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
105
+ *
106
+ * @throws {@link Forum.UnauthorizedError}
107
+ * @throws {@link Forum.NotFoundError}
108
+ * @throws {@link Forum.TooManyRequestsError}
109
+ * @throws {@link Forum.InternalServerError}
110
+ *
111
+ * @example
112
+ * await client.pollVotes.deleteOwnvote({
113
+ * id: "id"
114
+ * })
115
+ */
116
+ deleteOwnvote(request, requestOptions) {
117
+ return core.HttpResponsePromise.fromPromise(this.__deleteOwnvote(request, requestOptions));
118
+ }
119
+ __deleteOwnvote(request, requestOptions) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
122
+ const { id } = request;
123
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
124
+ 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);
125
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
126
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `threads/${core.url.encodePathParam(id)}/poll/votes`),
127
+ method: "DELETE",
128
+ headers: _headers,
129
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
130
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
131
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
132
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
133
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
134
+ logging: this._options.logging,
135
+ });
136
+ if (_response.ok) {
137
+ return { data: _response.body, rawResponse: _response.rawResponse };
138
+ }
139
+ if (_response.error.reason === "status-code") {
140
+ switch (_response.error.statusCode) {
141
+ case 401:
142
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
143
+ case 404:
144
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
145
+ case 429:
146
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
147
+ case 500:
148
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
149
+ default:
150
+ throw new errors.ForumError({
151
+ statusCode: _response.error.statusCode,
152
+ body: _response.error.body,
153
+ rawResponse: _response.rawResponse,
154
+ });
155
+ }
156
+ }
157
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/threads/{id}/poll/votes");
158
+ });
159
+ }
160
+ /**
161
+ * @param {Forum.DeletevotePollVotesRequest} request
162
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
163
+ *
164
+ * @throws {@link Forum.UnauthorizedError}
165
+ * @throws {@link Forum.NotFoundError}
166
+ * @throws {@link Forum.TooManyRequestsError}
167
+ * @throws {@link Forum.InternalServerError}
168
+ *
169
+ * @example
170
+ * await client.pollVotes.deletevote({
171
+ * id: "id",
172
+ * nestedId: "nestedId"
173
+ * })
174
+ */
175
+ deletevote(request, requestOptions) {
176
+ return core.HttpResponsePromise.fromPromise(this.__deletevote(request, requestOptions));
177
+ }
178
+ __deletevote(request, requestOptions) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
181
+ const { id, nestedId } = request;
182
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
183
+ 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);
184
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
185
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `threads/${core.url.encodePathParam(id)}/poll/votes/${core.url.encodePathParam(nestedId)}`),
186
+ method: "DELETE",
187
+ headers: _headers,
188
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
189
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
190
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
191
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
192
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
193
+ logging: this._options.logging,
194
+ });
195
+ if (_response.ok) {
196
+ return { data: _response.body, rawResponse: _response.rawResponse };
197
+ }
198
+ if (_response.error.reason === "status-code") {
199
+ switch (_response.error.statusCode) {
200
+ case 401:
201
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
202
+ case 404:
203
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
204
+ case 429:
205
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
206
+ case 500:
207
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
208
+ default:
209
+ throw new errors.ForumError({
210
+ statusCode: _response.error.statusCode,
211
+ body: _response.error.body,
212
+ rawResponse: _response.rawResponse,
213
+ });
214
+ }
215
+ }
216
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/threads/{id}/poll/votes/{nestedId}");
217
+ });
218
+ }
219
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id",
5
+ * optionId: "optionId"
6
+ * }
7
+ */
8
+ export interface CreatevotePollVotesRequest {
9
+ /** Thread ID */
10
+ id: string;
11
+ /** ID of the poll option to vote for */
12
+ optionId: string;
13
+ /** Custom extended data */
14
+ extendedData?: Record<string, unknown>;
15
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface DeleteOwnvotePollVotesRequest {
8
+ /** Thread ID */
9
+ id: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id",
5
+ * nestedId: "nestedId"
6
+ * }
7
+ */
8
+ export interface DeletevotePollVotesRequest {
9
+ /** Thread ID */
10
+ id: string;
11
+ /** vote ID */
12
+ nestedId: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { CreatevotePollVotesRequest } from "./CreatevotePollVotesRequest.mjs";
2
+ export type { DeleteOwnvotePollVotesRequest } from "./DeleteOwnvotePollVotesRequest.mjs";
3
+ export type { DeletevotePollVotesRequest } from "./DeletevotePollVotesRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,8 @@
1
+ export interface DeleteOwnvotePollVotesResponse {
2
+ data: DeleteOwnvotePollVotesResponse.Data;
3
+ }
4
+ export declare namespace DeleteOwnvotePollVotesResponse {
5
+ interface Data {
6
+ success: boolean;
7
+ }
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./DeleteOwnvotePollVotesResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./DeleteOwnvotePollVotesResponse.mjs";
@@ -53,10 +53,11 @@ export class PostsClient {
53
53
  __list() {
54
54
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
55
55
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
56
- const { limit, cursor, userId, sort, search, type: type_ } = request;
56
+ const { limit, cursor, threadId, userId, sort, search, type: type_ } = request;
57
57
  const _queryParams = {
58
58
  limit,
59
59
  cursor,
60
+ threadId,
60
61
  userId,
61
62
  sort: sort != null ? sort : undefined,
62
63
  search,
@@ -632,10 +633,11 @@ export class PostsClient {
632
633
  __listPosts(request, requestOptions) {
633
634
  return __awaiter(this, void 0, void 0, function* () {
634
635
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
635
- const { id, limit, cursor, userId, sort, search, type: type_ } = request;
636
+ const { id, limit, cursor, threadId, userId, sort, search, type: type_ } = request;
636
637
  const _queryParams = {
637
638
  limit,
638
639
  cursor,
640
+ threadId,
639
641
  userId,
640
642
  sort: sort != null ? sort : undefined,
641
643
  search,
@@ -12,6 +12,8 @@ export interface ListPostsPostsRequest {
12
12
  limit?: number;
13
13
  /** Cursor for pagination */
14
14
  cursor?: string;
15
+ /** Filter posts by thread ID */
16
+ threadId?: string;
15
17
  /** Filter posts by author ID */
16
18
  userId?: string;
17
19
  /** Sort posts by creation time */
@@ -8,6 +8,8 @@ export interface ListPostsRequest {
8
8
  limit?: number;
9
9
  /** Cursor for pagination */
10
10
  cursor?: string;
11
+ /** Filter posts by thread ID */
12
+ threadId?: string;
11
13
  /** Filter posts by author ID */
12
14
  userId?: string;
13
15
  /** Sort posts by creation time */
@@ -124,6 +124,43 @@ export declare class TagsClient {
124
124
  */
125
125
  listSubscribers(request: Forum.ListSubscribersTagsRequest, requestOptions?: TagsClient.RequestOptions): core.HttpResponsePromise<Forum.TagSubscriberListResponse>;
126
126
  private __listSubscribers;
127
+ /**
128
+ * Create a Subscriber in Tag.
129
+ *
130
+ * @param {Forum.CreateSubscriberTagsRequest} request
131
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @throws {@link Forum.BadRequestError}
134
+ * @throws {@link Forum.UnauthorizedError}
135
+ * @throws {@link Forum.NotFoundError}
136
+ * @throws {@link Forum.TooManyRequestsError}
137
+ * @throws {@link Forum.InternalServerError}
138
+ *
139
+ * @example
140
+ * await client.tags.createSubscriber({
141
+ * id: "id"
142
+ * })
143
+ */
144
+ createSubscriber(request: Forum.CreateSubscriberTagsRequest, requestOptions?: TagsClient.RequestOptions): core.HttpResponsePromise<Forum.TagSubscriberResponse>;
145
+ private __createSubscriber;
146
+ /**
147
+ * Unsubscribe from this tag. Removes the authenticated user's subscription. No subId needed.
148
+ *
149
+ * @param {Forum.UnsubscribeTagsRequest} request
150
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
151
+ *
152
+ * @throws {@link Forum.UnauthorizedError}
153
+ * @throws {@link Forum.NotFoundError}
154
+ * @throws {@link Forum.TooManyRequestsError}
155
+ * @throws {@link Forum.InternalServerError}
156
+ *
157
+ * @example
158
+ * await client.tags.unsubscribe({
159
+ * id: "id"
160
+ * })
161
+ */
162
+ unsubscribe(request: Forum.UnsubscribeTagsRequest, requestOptions?: TagsClient.RequestOptions): core.HttpResponsePromise<Forum.UnsubscribeTagsResponse>;
163
+ private __unsubscribe;
127
164
  /**
128
165
  * @param {Forum.RetrieveSubscriberTagsRequest} request
129
166
  * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -420,6 +420,132 @@ export class TagsClient {
420
420
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/tags/{id}/subscribers");
421
421
  });
422
422
  }
423
+ /**
424
+ * Create a Subscriber in Tag.
425
+ *
426
+ * @param {Forum.CreateSubscriberTagsRequest} request
427
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
428
+ *
429
+ * @throws {@link Forum.BadRequestError}
430
+ * @throws {@link Forum.UnauthorizedError}
431
+ * @throws {@link Forum.NotFoundError}
432
+ * @throws {@link Forum.TooManyRequestsError}
433
+ * @throws {@link Forum.InternalServerError}
434
+ *
435
+ * @example
436
+ * await client.tags.createSubscriber({
437
+ * id: "id"
438
+ * })
439
+ */
440
+ createSubscriber(request, requestOptions) {
441
+ return core.HttpResponsePromise.fromPromise(this.__createSubscriber(request, requestOptions));
442
+ }
443
+ __createSubscriber(request, requestOptions) {
444
+ return __awaiter(this, void 0, void 0, function* () {
445
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
446
+ const { id } = request, _body = __rest(request, ["id"]);
447
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
448
+ 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);
449
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
450
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `tags/${core.url.encodePathParam(id)}/subscribers`),
451
+ method: "POST",
452
+ headers: _headers,
453
+ contentType: "application/json",
454
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
455
+ requestType: "json",
456
+ body: _body,
457
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
458
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
459
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
460
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
461
+ logging: this._options.logging,
462
+ });
463
+ if (_response.ok) {
464
+ return { data: _response.body, rawResponse: _response.rawResponse };
465
+ }
466
+ if (_response.error.reason === "status-code") {
467
+ switch (_response.error.statusCode) {
468
+ case 400:
469
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
470
+ case 401:
471
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
472
+ case 404:
473
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
474
+ case 429:
475
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
476
+ case 500:
477
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
478
+ default:
479
+ throw new errors.ForumError({
480
+ statusCode: _response.error.statusCode,
481
+ body: _response.error.body,
482
+ rawResponse: _response.rawResponse,
483
+ });
484
+ }
485
+ }
486
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/tags/{id}/subscribers");
487
+ });
488
+ }
489
+ /**
490
+ * Unsubscribe from this tag. Removes the authenticated user's subscription. No subId needed.
491
+ *
492
+ * @param {Forum.UnsubscribeTagsRequest} request
493
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
494
+ *
495
+ * @throws {@link Forum.UnauthorizedError}
496
+ * @throws {@link Forum.NotFoundError}
497
+ * @throws {@link Forum.TooManyRequestsError}
498
+ * @throws {@link Forum.InternalServerError}
499
+ *
500
+ * @example
501
+ * await client.tags.unsubscribe({
502
+ * id: "id"
503
+ * })
504
+ */
505
+ unsubscribe(request, requestOptions) {
506
+ return core.HttpResponsePromise.fromPromise(this.__unsubscribe(request, requestOptions));
507
+ }
508
+ __unsubscribe(request, requestOptions) {
509
+ return __awaiter(this, void 0, void 0, function* () {
510
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
511
+ const { id } = request;
512
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
513
+ 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);
514
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
515
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `tags/${core.url.encodePathParam(id)}/subscribers`),
516
+ method: "DELETE",
517
+ headers: _headers,
518
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
519
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
520
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
521
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
522
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
523
+ logging: this._options.logging,
524
+ });
525
+ if (_response.ok) {
526
+ return { data: _response.body, rawResponse: _response.rawResponse };
527
+ }
528
+ if (_response.error.reason === "status-code") {
529
+ switch (_response.error.statusCode) {
530
+ case 401:
531
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
532
+ case 404:
533
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
534
+ case 429:
535
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
536
+ case 500:
537
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
538
+ default:
539
+ throw new errors.ForumError({
540
+ statusCode: _response.error.statusCode,
541
+ body: _response.error.body,
542
+ rawResponse: _response.rawResponse,
543
+ });
544
+ }
545
+ }
546
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/tags/{id}/subscribers");
547
+ });
548
+ }
423
549
  /**
424
550
  * @param {Forum.RetrieveSubscriberTagsRequest} request
425
551
  * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface CreateSubscriberTagsRequest {
8
+ /** Tag ID */
9
+ id: string;
10
+ /** Optional custom data */
11
+ extendedData?: Record<string, unknown>;
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface UnsubscribeTagsRequest {
8
+ /** Tag ID to unsubscribe from */
9
+ id: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};