@foru-ms/sdk 2.1.16 → 2.1.18
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/threads/client/Client.d.ts +18 -0
- package/dist/cjs/api/resources/threads/client/Client.js +65 -0
- package/dist/cjs/api/resources/threads/client/requests/ListPollVotesThreadsRequest.d.ts +16 -0
- package/dist/cjs/api/resources/threads/client/requests/ListPollVotesThreadsRequest.js +3 -0
- package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/threads/types/UpdateThreadsResponse.d.ts +2 -0
- package/dist/cjs/api/types/PollVotesListResponse.d.ts +22 -0
- package/dist/cjs/api/types/PollVotesListResponse.js +3 -0
- package/dist/cjs/api/types/ThreadListResponse.d.ts +2 -0
- package/dist/cjs/api/types/ThreadPoll.d.ts +7 -0
- package/dist/cjs/api/types/ThreadPollListResponse.d.ts +7 -0
- package/dist/cjs/api/types/ThreadPollResponse.d.ts +7 -0
- package/dist/cjs/api/types/ThreadResponse.d.ts +2 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -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/threads/client/Client.d.mts +18 -0
- package/dist/esm/api/resources/threads/client/Client.mjs +65 -0
- package/dist/esm/api/resources/threads/client/requests/ListPollVotesThreadsRequest.d.mts +16 -0
- package/dist/esm/api/resources/threads/client/requests/ListPollVotesThreadsRequest.mjs +2 -0
- package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/threads/types/UpdateThreadsResponse.d.mts +2 -0
- package/dist/esm/api/types/PollVotesListResponse.d.mts +22 -0
- package/dist/esm/api/types/PollVotesListResponse.mjs +2 -0
- package/dist/esm/api/types/ThreadListResponse.d.mts +2 -0
- package/dist/esm/api/types/ThreadPoll.d.mts +7 -0
- package/dist/esm/api/types/ThreadPollListResponse.d.mts +7 -0
- package/dist/esm/api/types/ThreadPollResponse.d.mts +7 -0
- package/dist/esm/api/types/ThreadResponse.d.mts +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +65 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@foru-ms/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "2.1.
|
|
47
|
-
"User-Agent": "@foru-ms/sdk/2.1.
|
|
46
|
+
"X-Fern-SDK-Version": "2.1.18",
|
|
47
|
+
"User-Agent": "@foru-ms/sdk/2.1.18",
|
|
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);
|
|
@@ -355,6 +355,24 @@ export declare class ThreadsClient {
|
|
|
355
355
|
*/
|
|
356
356
|
updatePoll(request: Forum.UpdatePollThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.ThreadPollResponse>;
|
|
357
357
|
private __updatePoll;
|
|
358
|
+
/**
|
|
359
|
+
* List all votes in the Thread's Poll.
|
|
360
|
+
*
|
|
361
|
+
* @param {Forum.ListPollVotesThreadsRequest} request
|
|
362
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
363
|
+
*
|
|
364
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
365
|
+
* @throws {@link Forum.NotFoundError}
|
|
366
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
367
|
+
* @throws {@link Forum.InternalServerError}
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* await client.threads.listPollVotes({
|
|
371
|
+
* id: "id"
|
|
372
|
+
* })
|
|
373
|
+
*/
|
|
374
|
+
listPollVotes(request: Forum.ListPollVotesThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.PollVotesListResponse>;
|
|
375
|
+
private __listPollVotes;
|
|
358
376
|
/**
|
|
359
377
|
* Create a Vote in the Thread's Poll.
|
|
360
378
|
*
|
|
@@ -1270,6 +1270,71 @@ class ThreadsClient {
|
|
|
1270
1270
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/threads/{id}/poll");
|
|
1271
1271
|
});
|
|
1272
1272
|
}
|
|
1273
|
+
/**
|
|
1274
|
+
* List all votes in the Thread's Poll.
|
|
1275
|
+
*
|
|
1276
|
+
* @param {Forum.ListPollVotesThreadsRequest} request
|
|
1277
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1278
|
+
*
|
|
1279
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
1280
|
+
* @throws {@link Forum.NotFoundError}
|
|
1281
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
1282
|
+
* @throws {@link Forum.InternalServerError}
|
|
1283
|
+
*
|
|
1284
|
+
* @example
|
|
1285
|
+
* await client.threads.listPollVotes({
|
|
1286
|
+
* id: "id"
|
|
1287
|
+
* })
|
|
1288
|
+
*/
|
|
1289
|
+
listPollVotes(request, requestOptions) {
|
|
1290
|
+
return core.HttpResponsePromise.fromPromise(this.__listPollVotes(request, requestOptions));
|
|
1291
|
+
}
|
|
1292
|
+
__listPollVotes(request, requestOptions) {
|
|
1293
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1294
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1295
|
+
const { id, limit, cursor, optionId } = request;
|
|
1296
|
+
const _queryParams = {
|
|
1297
|
+
limit,
|
|
1298
|
+
cursor,
|
|
1299
|
+
optionId,
|
|
1300
|
+
};
|
|
1301
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1302
|
+
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);
|
|
1303
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
1304
|
+
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`),
|
|
1305
|
+
method: "GET",
|
|
1306
|
+
headers: _headers,
|
|
1307
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1308
|
+
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,
|
|
1309
|
+
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,
|
|
1310
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1311
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
1312
|
+
logging: this._options.logging,
|
|
1313
|
+
});
|
|
1314
|
+
if (_response.ok) {
|
|
1315
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1316
|
+
}
|
|
1317
|
+
if (_response.error.reason === "status-code") {
|
|
1318
|
+
switch (_response.error.statusCode) {
|
|
1319
|
+
case 401:
|
|
1320
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1321
|
+
case 404:
|
|
1322
|
+
throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1323
|
+
case 429:
|
|
1324
|
+
throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
1325
|
+
case 500:
|
|
1326
|
+
throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1327
|
+
default:
|
|
1328
|
+
throw new errors.ForumError({
|
|
1329
|
+
statusCode: _response.error.statusCode,
|
|
1330
|
+
body: _response.error.body,
|
|
1331
|
+
rawResponse: _response.rawResponse,
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/threads/{id}/poll/votes");
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1273
1338
|
/**
|
|
1274
1339
|
* Create a Vote in the Thread's Poll.
|
|
1275
1340
|
*
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "id"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface ListPollVotesThreadsRequest {
|
|
8
|
+
/** Thread ID */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Items per page (max 75) */
|
|
11
|
+
limit?: number;
|
|
12
|
+
/** Cursor for pagination */
|
|
13
|
+
cursor?: string;
|
|
14
|
+
/** Filter by option ID */
|
|
15
|
+
optionId?: string;
|
|
16
|
+
}
|
|
@@ -8,6 +8,7 @@ export type { DeletePostThreadsRequest } from "./DeletePostThreadsRequest.js";
|
|
|
8
8
|
export type { DeleteReactionThreadsRequest } from "./DeleteReactionThreadsRequest.js";
|
|
9
9
|
export type { DeleteSubscriberThreadsRequest } from "./DeleteSubscriberThreadsRequest.js";
|
|
10
10
|
export type { DeleteThreadsRequest } from "./DeleteThreadsRequest.js";
|
|
11
|
+
export type { ListPollVotesThreadsRequest } from "./ListPollVotesThreadsRequest.js";
|
|
11
12
|
export type { ListPostsThreadsRequest } from "./ListPostsThreadsRequest.js";
|
|
12
13
|
export type { ListReactionsThreadsRequest } from "./ListReactionsThreadsRequest.js";
|
|
13
14
|
export type { ListSubscribersThreadsRequest } from "./ListSubscribersThreadsRequest.js";
|
|
@@ -63,6 +63,8 @@ export declare namespace UpdateThreadsResponse {
|
|
|
63
63
|
expiresAt: string | null;
|
|
64
64
|
totalVotes: number;
|
|
65
65
|
options: Poll.Options.Item[];
|
|
66
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
67
|
+
userVote: string | null;
|
|
66
68
|
createdAt: string;
|
|
67
69
|
updatedAt: string;
|
|
68
70
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PollVotesListResponse {
|
|
2
|
+
data: PollVotesListResponse.Data;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace PollVotesListResponse {
|
|
5
|
+
interface Data {
|
|
6
|
+
items: Data.Items.Item[];
|
|
7
|
+
nextCursor?: string;
|
|
8
|
+
count: number;
|
|
9
|
+
}
|
|
10
|
+
namespace Data {
|
|
11
|
+
type Items = Items.Item[];
|
|
12
|
+
namespace Items {
|
|
13
|
+
interface Item {
|
|
14
|
+
id: string;
|
|
15
|
+
pollId: string;
|
|
16
|
+
optionId: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -73,6 +73,8 @@ export declare namespace ThreadListResponse {
|
|
|
73
73
|
expiresAt: string | null;
|
|
74
74
|
totalVotes: number;
|
|
75
75
|
options: Poll.Options.Item[];
|
|
76
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
77
|
+
userVote: string | null;
|
|
76
78
|
createdAt: string;
|
|
77
79
|
updatedAt: string;
|
|
78
80
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
export interface ThreadPoll {
|
|
2
2
|
id: string;
|
|
3
3
|
title: string;
|
|
4
|
+
closed: boolean | null;
|
|
5
|
+
closedAt: string | null;
|
|
6
|
+
expiresAt: string | null;
|
|
7
|
+
totalVotes: number;
|
|
4
8
|
options: ThreadPoll.Options.Item[];
|
|
9
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
10
|
+
userVote: string | null;
|
|
5
11
|
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
6
13
|
}
|
|
7
14
|
export declare namespace ThreadPoll {
|
|
8
15
|
type Options = Options.Item[];
|
|
@@ -13,8 +13,15 @@ export declare namespace ThreadPollListResponse {
|
|
|
13
13
|
interface Item {
|
|
14
14
|
id: string;
|
|
15
15
|
title: string;
|
|
16
|
+
closed: boolean | null;
|
|
17
|
+
closedAt: string | null;
|
|
18
|
+
expiresAt: string | null;
|
|
19
|
+
totalVotes: number;
|
|
16
20
|
options: Item.Options.Item[];
|
|
21
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
22
|
+
userVote: string | null;
|
|
17
23
|
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
18
25
|
}
|
|
19
26
|
namespace Item {
|
|
20
27
|
type Options = Options.Item[];
|
|
@@ -5,8 +5,15 @@ export declare namespace ThreadPollResponse {
|
|
|
5
5
|
interface Data {
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
|
+
closed: boolean | null;
|
|
9
|
+
closedAt: string | null;
|
|
10
|
+
expiresAt: string | null;
|
|
11
|
+
totalVotes: number;
|
|
8
12
|
options: Data.Options.Item[];
|
|
13
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
14
|
+
userVote: string | null;
|
|
9
15
|
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
10
17
|
}
|
|
11
18
|
namespace Data {
|
|
12
19
|
type Options = Options.Item[];
|
|
@@ -63,6 +63,8 @@ export declare namespace ThreadResponse {
|
|
|
63
63
|
expiresAt: string | null;
|
|
64
64
|
totalVotes: number;
|
|
65
65
|
options: Poll.Options.Item[];
|
|
66
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
67
|
+
userVote: string | null;
|
|
66
68
|
createdAt: string;
|
|
67
69
|
updatedAt: string;
|
|
68
70
|
}
|
|
@@ -25,6 +25,7 @@ export * from "./NotificationResponse.js";
|
|
|
25
25
|
export * from "./NotificationUpdate.js";
|
|
26
26
|
export * from "./OwnershipInfo.js";
|
|
27
27
|
export * from "./PollVoteResponse.js";
|
|
28
|
+
export * from "./PollVotesListResponse.js";
|
|
28
29
|
export * from "./Post.js";
|
|
29
30
|
export * from "./PostCreate.js";
|
|
30
31
|
export * from "./PostList.js";
|
|
@@ -41,6 +41,7 @@ __exportStar(require("./NotificationResponse.js"), exports);
|
|
|
41
41
|
__exportStar(require("./NotificationUpdate.js"), exports);
|
|
42
42
|
__exportStar(require("./OwnershipInfo.js"), exports);
|
|
43
43
|
__exportStar(require("./PollVoteResponse.js"), exports);
|
|
44
|
+
__exportStar(require("./PollVotesListResponse.js"), exports);
|
|
44
45
|
__exportStar(require("./Post.js"), exports);
|
|
45
46
|
__exportStar(require("./PostCreate.js"), exports);
|
|
46
47
|
__exportStar(require("./PostList.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.18";
|
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": "@foru-ms/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "2.1.
|
|
10
|
-
"User-Agent": "@foru-ms/sdk/2.1.
|
|
9
|
+
"X-Fern-SDK-Version": "2.1.18",
|
|
10
|
+
"User-Agent": "@foru-ms/sdk/2.1.18",
|
|
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);
|
|
@@ -355,6 +355,24 @@ export declare class ThreadsClient {
|
|
|
355
355
|
*/
|
|
356
356
|
updatePoll(request: Forum.UpdatePollThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.ThreadPollResponse>;
|
|
357
357
|
private __updatePoll;
|
|
358
|
+
/**
|
|
359
|
+
* List all votes in the Thread's Poll.
|
|
360
|
+
*
|
|
361
|
+
* @param {Forum.ListPollVotesThreadsRequest} request
|
|
362
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
363
|
+
*
|
|
364
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
365
|
+
* @throws {@link Forum.NotFoundError}
|
|
366
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
367
|
+
* @throws {@link Forum.InternalServerError}
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* await client.threads.listPollVotes({
|
|
371
|
+
* id: "id"
|
|
372
|
+
* })
|
|
373
|
+
*/
|
|
374
|
+
listPollVotes(request: Forum.ListPollVotesThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.PollVotesListResponse>;
|
|
375
|
+
private __listPollVotes;
|
|
358
376
|
/**
|
|
359
377
|
* Create a Vote in the Thread's Poll.
|
|
360
378
|
*
|
|
@@ -1234,6 +1234,71 @@ export class ThreadsClient {
|
|
|
1234
1234
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/threads/{id}/poll");
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
|
+
/**
|
|
1238
|
+
* List all votes in the Thread's Poll.
|
|
1239
|
+
*
|
|
1240
|
+
* @param {Forum.ListPollVotesThreadsRequest} request
|
|
1241
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1242
|
+
*
|
|
1243
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
1244
|
+
* @throws {@link Forum.NotFoundError}
|
|
1245
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
1246
|
+
* @throws {@link Forum.InternalServerError}
|
|
1247
|
+
*
|
|
1248
|
+
* @example
|
|
1249
|
+
* await client.threads.listPollVotes({
|
|
1250
|
+
* id: "id"
|
|
1251
|
+
* })
|
|
1252
|
+
*/
|
|
1253
|
+
listPollVotes(request, requestOptions) {
|
|
1254
|
+
return core.HttpResponsePromise.fromPromise(this.__listPollVotes(request, requestOptions));
|
|
1255
|
+
}
|
|
1256
|
+
__listPollVotes(request, requestOptions) {
|
|
1257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1258
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1259
|
+
const { id, limit, cursor, optionId } = request;
|
|
1260
|
+
const _queryParams = {
|
|
1261
|
+
limit,
|
|
1262
|
+
cursor,
|
|
1263
|
+
optionId,
|
|
1264
|
+
};
|
|
1265
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1266
|
+
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);
|
|
1267
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
1268
|
+
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`),
|
|
1269
|
+
method: "GET",
|
|
1270
|
+
headers: _headers,
|
|
1271
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1272
|
+
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,
|
|
1273
|
+
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,
|
|
1274
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1275
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
1276
|
+
logging: this._options.logging,
|
|
1277
|
+
});
|
|
1278
|
+
if (_response.ok) {
|
|
1279
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1280
|
+
}
|
|
1281
|
+
if (_response.error.reason === "status-code") {
|
|
1282
|
+
switch (_response.error.statusCode) {
|
|
1283
|
+
case 401:
|
|
1284
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
1285
|
+
case 404:
|
|
1286
|
+
throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1287
|
+
case 429:
|
|
1288
|
+
throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
1289
|
+
case 500:
|
|
1290
|
+
throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1291
|
+
default:
|
|
1292
|
+
throw new errors.ForumError({
|
|
1293
|
+
statusCode: _response.error.statusCode,
|
|
1294
|
+
body: _response.error.body,
|
|
1295
|
+
rawResponse: _response.rawResponse,
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/threads/{id}/poll/votes");
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1237
1302
|
/**
|
|
1238
1303
|
* Create a Vote in the Thread's Poll.
|
|
1239
1304
|
*
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "id"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface ListPollVotesThreadsRequest {
|
|
8
|
+
/** Thread ID */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Items per page (max 75) */
|
|
11
|
+
limit?: number;
|
|
12
|
+
/** Cursor for pagination */
|
|
13
|
+
cursor?: string;
|
|
14
|
+
/** Filter by option ID */
|
|
15
|
+
optionId?: string;
|
|
16
|
+
}
|
|
@@ -8,6 +8,7 @@ export type { DeletePostThreadsRequest } from "./DeletePostThreadsRequest.mjs";
|
|
|
8
8
|
export type { DeleteReactionThreadsRequest } from "./DeleteReactionThreadsRequest.mjs";
|
|
9
9
|
export type { DeleteSubscriberThreadsRequest } from "./DeleteSubscriberThreadsRequest.mjs";
|
|
10
10
|
export type { DeleteThreadsRequest } from "./DeleteThreadsRequest.mjs";
|
|
11
|
+
export type { ListPollVotesThreadsRequest } from "./ListPollVotesThreadsRequest.mjs";
|
|
11
12
|
export type { ListPostsThreadsRequest } from "./ListPostsThreadsRequest.mjs";
|
|
12
13
|
export type { ListReactionsThreadsRequest } from "./ListReactionsThreadsRequest.mjs";
|
|
13
14
|
export type { ListSubscribersThreadsRequest } from "./ListSubscribersThreadsRequest.mjs";
|
|
@@ -63,6 +63,8 @@ export declare namespace UpdateThreadsResponse {
|
|
|
63
63
|
expiresAt: string | null;
|
|
64
64
|
totalVotes: number;
|
|
65
65
|
options: Poll.Options.Item[];
|
|
66
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
67
|
+
userVote: string | null;
|
|
66
68
|
createdAt: string;
|
|
67
69
|
updatedAt: string;
|
|
68
70
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PollVotesListResponse {
|
|
2
|
+
data: PollVotesListResponse.Data;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace PollVotesListResponse {
|
|
5
|
+
interface Data {
|
|
6
|
+
items: Data.Items.Item[];
|
|
7
|
+
nextCursor?: string;
|
|
8
|
+
count: number;
|
|
9
|
+
}
|
|
10
|
+
namespace Data {
|
|
11
|
+
type Items = Items.Item[];
|
|
12
|
+
namespace Items {
|
|
13
|
+
interface Item {
|
|
14
|
+
id: string;
|
|
15
|
+
pollId: string;
|
|
16
|
+
optionId: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -73,6 +73,8 @@ export declare namespace ThreadListResponse {
|
|
|
73
73
|
expiresAt: string | null;
|
|
74
74
|
totalVotes: number;
|
|
75
75
|
options: Poll.Options.Item[];
|
|
76
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
77
|
+
userVote: string | null;
|
|
76
78
|
createdAt: string;
|
|
77
79
|
updatedAt: string;
|
|
78
80
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
export interface ThreadPoll {
|
|
2
2
|
id: string;
|
|
3
3
|
title: string;
|
|
4
|
+
closed: boolean | null;
|
|
5
|
+
closedAt: string | null;
|
|
6
|
+
expiresAt: string | null;
|
|
7
|
+
totalVotes: number;
|
|
4
8
|
options: ThreadPoll.Options.Item[];
|
|
9
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
10
|
+
userVote: string | null;
|
|
5
11
|
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
6
13
|
}
|
|
7
14
|
export declare namespace ThreadPoll {
|
|
8
15
|
type Options = Options.Item[];
|
|
@@ -13,8 +13,15 @@ export declare namespace ThreadPollListResponse {
|
|
|
13
13
|
interface Item {
|
|
14
14
|
id: string;
|
|
15
15
|
title: string;
|
|
16
|
+
closed: boolean | null;
|
|
17
|
+
closedAt: string | null;
|
|
18
|
+
expiresAt: string | null;
|
|
19
|
+
totalVotes: number;
|
|
16
20
|
options: Item.Options.Item[];
|
|
21
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
22
|
+
userVote: string | null;
|
|
17
23
|
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
18
25
|
}
|
|
19
26
|
namespace Item {
|
|
20
27
|
type Options = Options.Item[];
|
|
@@ -5,8 +5,15 @@ export declare namespace ThreadPollResponse {
|
|
|
5
5
|
interface Data {
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
|
+
closed: boolean | null;
|
|
9
|
+
closedAt: string | null;
|
|
10
|
+
expiresAt: string | null;
|
|
11
|
+
totalVotes: number;
|
|
8
12
|
options: Data.Options.Item[];
|
|
13
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
14
|
+
userVote: string | null;
|
|
9
15
|
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
10
17
|
}
|
|
11
18
|
namespace Data {
|
|
12
19
|
type Options = Options.Item[];
|
|
@@ -63,6 +63,8 @@ export declare namespace ThreadResponse {
|
|
|
63
63
|
expiresAt: string | null;
|
|
64
64
|
totalVotes: number;
|
|
65
65
|
options: Poll.Options.Item[];
|
|
66
|
+
/** The option ID that the current user voted for, or null if they haven't voted */
|
|
67
|
+
userVote: string | null;
|
|
66
68
|
createdAt: string;
|
|
67
69
|
updatedAt: string;
|
|
68
70
|
}
|
|
@@ -25,6 +25,7 @@ export * from "./NotificationResponse.mjs";
|
|
|
25
25
|
export * from "./NotificationUpdate.mjs";
|
|
26
26
|
export * from "./OwnershipInfo.mjs";
|
|
27
27
|
export * from "./PollVoteResponse.mjs";
|
|
28
|
+
export * from "./PollVotesListResponse.mjs";
|
|
28
29
|
export * from "./Post.mjs";
|
|
29
30
|
export * from "./PostCreate.mjs";
|
|
30
31
|
export * from "./PostList.mjs";
|
|
@@ -25,6 +25,7 @@ export * from "./NotificationResponse.mjs";
|
|
|
25
25
|
export * from "./NotificationUpdate.mjs";
|
|
26
26
|
export * from "./OwnershipInfo.mjs";
|
|
27
27
|
export * from "./PollVoteResponse.mjs";
|
|
28
|
+
export * from "./PollVotesListResponse.mjs";
|
|
28
29
|
export * from "./Post.mjs";
|
|
29
30
|
export * from "./PostCreate.mjs";
|
|
30
31
|
export * from "./PostList.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.18";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.1.
|
|
1
|
+
export const SDK_VERSION = "2.1.18";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2085,6 +2085,71 @@ await client.threads.updatePoll({
|
|
|
2085
2085
|
</dl>
|
|
2086
2086
|
|
|
2087
2087
|
|
|
2088
|
+
</dd>
|
|
2089
|
+
</dl>
|
|
2090
|
+
</details>
|
|
2091
|
+
|
|
2092
|
+
<details><summary><code>client.threads.<a href="/src/api/resources/threads/client/Client.ts">listPollVotes</a>({ ...params }) -> Forum.PollVotesListResponse</code></summary>
|
|
2093
|
+
<dl>
|
|
2094
|
+
<dd>
|
|
2095
|
+
|
|
2096
|
+
#### 📝 Description
|
|
2097
|
+
|
|
2098
|
+
<dl>
|
|
2099
|
+
<dd>
|
|
2100
|
+
|
|
2101
|
+
<dl>
|
|
2102
|
+
<dd>
|
|
2103
|
+
|
|
2104
|
+
List all votes in the Thread's Poll.
|
|
2105
|
+
</dd>
|
|
2106
|
+
</dl>
|
|
2107
|
+
</dd>
|
|
2108
|
+
</dl>
|
|
2109
|
+
|
|
2110
|
+
#### 🔌 Usage
|
|
2111
|
+
|
|
2112
|
+
<dl>
|
|
2113
|
+
<dd>
|
|
2114
|
+
|
|
2115
|
+
<dl>
|
|
2116
|
+
<dd>
|
|
2117
|
+
|
|
2118
|
+
```typescript
|
|
2119
|
+
await client.threads.listPollVotes({
|
|
2120
|
+
id: "id"
|
|
2121
|
+
});
|
|
2122
|
+
|
|
2123
|
+
```
|
|
2124
|
+
</dd>
|
|
2125
|
+
</dl>
|
|
2126
|
+
</dd>
|
|
2127
|
+
</dl>
|
|
2128
|
+
|
|
2129
|
+
#### ⚙️ Parameters
|
|
2130
|
+
|
|
2131
|
+
<dl>
|
|
2132
|
+
<dd>
|
|
2133
|
+
|
|
2134
|
+
<dl>
|
|
2135
|
+
<dd>
|
|
2136
|
+
|
|
2137
|
+
**request:** `Forum.ListPollVotesThreadsRequest`
|
|
2138
|
+
|
|
2139
|
+
</dd>
|
|
2140
|
+
</dl>
|
|
2141
|
+
|
|
2142
|
+
<dl>
|
|
2143
|
+
<dd>
|
|
2144
|
+
|
|
2145
|
+
**requestOptions:** `ThreadsClient.RequestOptions`
|
|
2146
|
+
|
|
2147
|
+
</dd>
|
|
2148
|
+
</dl>
|
|
2149
|
+
</dd>
|
|
2150
|
+
</dl>
|
|
2151
|
+
|
|
2152
|
+
|
|
2088
2153
|
</dd>
|
|
2089
2154
|
</dl>
|
|
2090
2155
|
</details>
|