@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
@@ -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.13",
47
- "User-Agent": "@foru-ms/sdk/2.1.13",
46
+ "X-Fern-SDK-Version": "2.1.15",
47
+ "User-Agent": "@foru-ms/sdk/2.1.15",
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);
@@ -1,6 +1,7 @@
1
1
  import { AuthClient } from "./api/resources/auth/client/Client.js";
2
2
  import { IntegrationsClient } from "./api/resources/integrations/client/Client.js";
3
3
  import { NotificationsClient } from "./api/resources/notifications/client/Client.js";
4
+ import { PollVotesClient } from "./api/resources/pollVotes/client/Client.js";
4
5
  import { PostsClient } from "./api/resources/posts/client/Client.js";
5
6
  import { PrivateMessagesClient } from "./api/resources/privateMessages/client/Client.js";
6
7
  import { ProvisioningClient } from "./api/resources/provisioning/client/Client.js";
@@ -25,6 +26,7 @@ export declare class ForumClient {
25
26
  protected _search: SearchClient | undefined;
26
27
  protected _tags: TagsClient | undefined;
27
28
  protected _threads: ThreadsClient | undefined;
29
+ protected _pollVotes: PollVotesClient | undefined;
28
30
  protected _posts: PostsClient | undefined;
29
31
  protected _privateMessages: PrivateMessagesClient | undefined;
30
32
  protected _users: UsersClient | undefined;
@@ -40,6 +42,7 @@ export declare class ForumClient {
40
42
  get search(): SearchClient;
41
43
  get tags(): TagsClient;
42
44
  get threads(): ThreadsClient;
45
+ get pollVotes(): PollVotesClient;
43
46
  get posts(): PostsClient;
44
47
  get privateMessages(): PrivateMessagesClient;
45
48
  get users(): UsersClient;
@@ -5,17 +5,18 @@ exports.ForumClient = void 0;
5
5
  const Client_js_1 = require("./api/resources/auth/client/Client.js");
6
6
  const Client_js_2 = require("./api/resources/integrations/client/Client.js");
7
7
  const Client_js_3 = require("./api/resources/notifications/client/Client.js");
8
- const Client_js_4 = require("./api/resources/posts/client/Client.js");
9
- const Client_js_5 = require("./api/resources/privateMessages/client/Client.js");
10
- const Client_js_6 = require("./api/resources/provisioning/client/Client.js");
11
- const Client_js_7 = require("./api/resources/reports/client/Client.js");
12
- const Client_js_8 = require("./api/resources/roles/client/Client.js");
13
- const Client_js_9 = require("./api/resources/search/client/Client.js");
14
- const Client_js_10 = require("./api/resources/ssOs/client/Client.js");
15
- const Client_js_11 = require("./api/resources/tags/client/Client.js");
16
- const Client_js_12 = require("./api/resources/threads/client/Client.js");
17
- const Client_js_13 = require("./api/resources/users/client/Client.js");
18
- const Client_js_14 = require("./api/resources/webhooks/client/Client.js");
8
+ const Client_js_4 = require("./api/resources/pollVotes/client/Client.js");
9
+ const Client_js_5 = require("./api/resources/posts/client/Client.js");
10
+ const Client_js_6 = require("./api/resources/privateMessages/client/Client.js");
11
+ const Client_js_7 = require("./api/resources/provisioning/client/Client.js");
12
+ const Client_js_8 = require("./api/resources/reports/client/Client.js");
13
+ const Client_js_9 = require("./api/resources/roles/client/Client.js");
14
+ const Client_js_10 = require("./api/resources/search/client/Client.js");
15
+ const Client_js_11 = require("./api/resources/ssOs/client/Client.js");
16
+ const Client_js_12 = require("./api/resources/tags/client/Client.js");
17
+ const Client_js_13 = require("./api/resources/threads/client/Client.js");
18
+ const Client_js_14 = require("./api/resources/users/client/Client.js");
19
+ const Client_js_15 = require("./api/resources/webhooks/client/Client.js");
19
20
  const BaseClient_js_1 = require("./BaseClient.js");
20
21
  class ForumClient {
21
22
  constructor(options = {}) {
@@ -27,35 +28,39 @@ class ForumClient {
27
28
  }
28
29
  get search() {
29
30
  var _a;
30
- return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_js_9.SearchClient(this._options)));
31
+ return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new Client_js_10.SearchClient(this._options)));
31
32
  }
32
33
  get tags() {
33
34
  var _a;
34
- return ((_a = this._tags) !== null && _a !== void 0 ? _a : (this._tags = new Client_js_11.TagsClient(this._options)));
35
+ return ((_a = this._tags) !== null && _a !== void 0 ? _a : (this._tags = new Client_js_12.TagsClient(this._options)));
35
36
  }
36
37
  get threads() {
37
38
  var _a;
38
- return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_12.ThreadsClient(this._options)));
39
+ return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_13.ThreadsClient(this._options)));
40
+ }
41
+ get pollVotes() {
42
+ var _a;
43
+ return ((_a = this._pollVotes) !== null && _a !== void 0 ? _a : (this._pollVotes = new Client_js_4.PollVotesClient(this._options)));
39
44
  }
40
45
  get posts() {
41
46
  var _a;
42
- return ((_a = this._posts) !== null && _a !== void 0 ? _a : (this._posts = new Client_js_4.PostsClient(this._options)));
47
+ return ((_a = this._posts) !== null && _a !== void 0 ? _a : (this._posts = new Client_js_5.PostsClient(this._options)));
43
48
  }
44
49
  get privateMessages() {
45
50
  var _a;
46
- return ((_a = this._privateMessages) !== null && _a !== void 0 ? _a : (this._privateMessages = new Client_js_5.PrivateMessagesClient(this._options)));
51
+ return ((_a = this._privateMessages) !== null && _a !== void 0 ? _a : (this._privateMessages = new Client_js_6.PrivateMessagesClient(this._options)));
47
52
  }
48
53
  get users() {
49
54
  var _a;
50
- return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_13.UsersClient(this._options)));
55
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_14.UsersClient(this._options)));
51
56
  }
52
57
  get roles() {
53
58
  var _a;
54
- return ((_a = this._roles) !== null && _a !== void 0 ? _a : (this._roles = new Client_js_8.RolesClient(this._options)));
59
+ return ((_a = this._roles) !== null && _a !== void 0 ? _a : (this._roles = new Client_js_9.RolesClient(this._options)));
55
60
  }
56
61
  get reports() {
57
62
  var _a;
58
- return ((_a = this._reports) !== null && _a !== void 0 ? _a : (this._reports = new Client_js_7.ReportsClient(this._options)));
63
+ return ((_a = this._reports) !== null && _a !== void 0 ? _a : (this._reports = new Client_js_8.ReportsClient(this._options)));
59
64
  }
60
65
  get notifications() {
61
66
  var _a;
@@ -63,7 +68,7 @@ class ForumClient {
63
68
  }
64
69
  get webhooks() {
65
70
  var _a;
66
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_14.WebhooksClient(this._options)));
71
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_15.WebhooksClient(this._options)));
67
72
  }
68
73
  get integrations() {
69
74
  var _a;
@@ -71,11 +76,11 @@ class ForumClient {
71
76
  }
72
77
  get ssOs() {
73
78
  var _a;
74
- return ((_a = this._ssOs) !== null && _a !== void 0 ? _a : (this._ssOs = new Client_js_10.SsOsClient(this._options)));
79
+ return ((_a = this._ssOs) !== null && _a !== void 0 ? _a : (this._ssOs = new Client_js_11.SsOsClient(this._options)));
75
80
  }
76
81
  get provisioning() {
77
82
  var _a;
78
- return ((_a = this._provisioning) !== null && _a !== void 0 ? _a : (this._provisioning = new Client_js_6.ProvisioningClient(this._options)));
83
+ return ((_a = this._provisioning) !== null && _a !== void 0 ? _a : (this._provisioning = new Client_js_7.ProvisioningClient(this._options)));
79
84
  }
80
85
  }
81
86
  exports.ForumClient = ForumClient;
@@ -6,6 +6,9 @@ export * from "./integrations/types/index.js";
6
6
  export * from "./notifications/client/requests/index.js";
7
7
  export * as notifications from "./notifications/index.js";
8
8
  export * from "./notifications/types/index.js";
9
+ export * from "./pollVotes/client/requests/index.js";
10
+ export * as pollVotes from "./pollVotes/index.js";
11
+ export * from "./pollVotes/types/index.js";
9
12
  export * from "./posts/client/requests/index.js";
10
13
  export * as posts from "./posts/index.js";
11
14
  export * from "./posts/types/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.webhooks = exports.users = exports.threads = exports.tags = exports.ssOs = exports.search = exports.roles = exports.reports = exports.provisioning = exports.privateMessages = exports.posts = exports.notifications = exports.integrations = exports.auth = void 0;
39
+ exports.webhooks = exports.users = exports.threads = exports.tags = exports.ssOs = exports.search = exports.roles = exports.reports = exports.provisioning = exports.privateMessages = exports.posts = exports.pollVotes = exports.notifications = exports.integrations = exports.auth = void 0;
40
40
  __exportStar(require("./auth/client/requests/index.js"), exports);
41
41
  exports.auth = __importStar(require("./auth/index.js"));
42
42
  __exportStar(require("./integrations/client/requests/index.js"), exports);
@@ -45,6 +45,9 @@ __exportStar(require("./integrations/types/index.js"), exports);
45
45
  __exportStar(require("./notifications/client/requests/index.js"), exports);
46
46
  exports.notifications = __importStar(require("./notifications/index.js"));
47
47
  __exportStar(require("./notifications/types/index.js"), exports);
48
+ __exportStar(require("./pollVotes/client/requests/index.js"), exports);
49
+ exports.pollVotes = __importStar(require("./pollVotes/index.js"));
50
+ __exportStar(require("./pollVotes/types/index.js"), exports);
48
51
  __exportStar(require("./posts/client/requests/index.js"), exports);
49
52
  exports.posts = __importStar(require("./posts/index.js"));
50
53
  __exportStar(require("./posts/types/index.js"), exports);
@@ -0,0 +1,68 @@
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 Forum from "../../../index.js";
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,256 @@
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.PollVotesClient = 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 Forum = __importStar(require("../../../index.js"));
65
+ class PollVotesClient {
66
+ constructor(options = {}) {
67
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
+ }
69
+ /**
70
+ * Create a vote in the Thread's Poll.
71
+ *
72
+ * @param {Forum.CreatevotePollVotesRequest} request
73
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Forum.BadRequestError}
76
+ * @throws {@link Forum.UnauthorizedError}
77
+ * @throws {@link Forum.NotFoundError}
78
+ * @throws {@link Forum.TooManyRequestsError}
79
+ * @throws {@link Forum.InternalServerError}
80
+ *
81
+ * @example
82
+ * await client.pollVotes.createvote({
83
+ * id: "id",
84
+ * optionId: "optionId"
85
+ * })
86
+ */
87
+ createvote(request, requestOptions) {
88
+ return core.HttpResponsePromise.fromPromise(this.__createvote(request, requestOptions));
89
+ }
90
+ __createvote(request, requestOptions) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
93
+ const { id } = request, _body = __rest(request, ["id"]);
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 ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
97
+ 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`),
98
+ method: "POST",
99
+ headers: _headers,
100
+ contentType: "application/json",
101
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
102
+ requestType: "json",
103
+ body: _body,
104
+ 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,
105
+ 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,
106
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
107
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
108
+ logging: this._options.logging,
109
+ });
110
+ if (_response.ok) {
111
+ return { data: _response.body, rawResponse: _response.rawResponse };
112
+ }
113
+ if (_response.error.reason === "status-code") {
114
+ switch (_response.error.statusCode) {
115
+ case 400:
116
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
117
+ case 401:
118
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
119
+ case 404:
120
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
121
+ case 429:
122
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
123
+ case 500:
124
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
125
+ default:
126
+ throw new errors.ForumError({
127
+ statusCode: _response.error.statusCode,
128
+ body: _response.error.body,
129
+ rawResponse: _response.rawResponse,
130
+ });
131
+ }
132
+ }
133
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/threads/{id}/poll/votes");
134
+ });
135
+ }
136
+ /**
137
+ * Removes the authenticated user's vote. No ID needed.
138
+ *
139
+ * @param {Forum.DeleteOwnvotePollVotesRequest} request
140
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
141
+ *
142
+ * @throws {@link Forum.UnauthorizedError}
143
+ * @throws {@link Forum.NotFoundError}
144
+ * @throws {@link Forum.TooManyRequestsError}
145
+ * @throws {@link Forum.InternalServerError}
146
+ *
147
+ * @example
148
+ * await client.pollVotes.deleteOwnvote({
149
+ * id: "id"
150
+ * })
151
+ */
152
+ deleteOwnvote(request, requestOptions) {
153
+ return core.HttpResponsePromise.fromPromise(this.__deleteOwnvote(request, requestOptions));
154
+ }
155
+ __deleteOwnvote(request, requestOptions) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
158
+ const { id } = request;
159
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
160
+ 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);
161
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
162
+ 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`),
163
+ method: "DELETE",
164
+ headers: _headers,
165
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
166
+ 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,
167
+ 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,
168
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
170
+ logging: this._options.logging,
171
+ });
172
+ if (_response.ok) {
173
+ return { data: _response.body, rawResponse: _response.rawResponse };
174
+ }
175
+ if (_response.error.reason === "status-code") {
176
+ switch (_response.error.statusCode) {
177
+ case 401:
178
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
179
+ case 404:
180
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
181
+ case 429:
182
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
183
+ case 500:
184
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
185
+ default:
186
+ throw new errors.ForumError({
187
+ statusCode: _response.error.statusCode,
188
+ body: _response.error.body,
189
+ rawResponse: _response.rawResponse,
190
+ });
191
+ }
192
+ }
193
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/threads/{id}/poll/votes");
194
+ });
195
+ }
196
+ /**
197
+ * @param {Forum.DeletevotePollVotesRequest} request
198
+ * @param {PollVotesClient.RequestOptions} requestOptions - Request-specific configuration.
199
+ *
200
+ * @throws {@link Forum.UnauthorizedError}
201
+ * @throws {@link Forum.NotFoundError}
202
+ * @throws {@link Forum.TooManyRequestsError}
203
+ * @throws {@link Forum.InternalServerError}
204
+ *
205
+ * @example
206
+ * await client.pollVotes.deletevote({
207
+ * id: "id",
208
+ * nestedId: "nestedId"
209
+ * })
210
+ */
211
+ deletevote(request, requestOptions) {
212
+ return core.HttpResponsePromise.fromPromise(this.__deletevote(request, requestOptions));
213
+ }
214
+ __deletevote(request, requestOptions) {
215
+ return __awaiter(this, void 0, void 0, function* () {
216
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
217
+ const { id, nestedId } = request;
218
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
219
+ 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);
220
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
221
+ 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)}`),
222
+ method: "DELETE",
223
+ headers: _headers,
224
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
225
+ 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,
226
+ 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,
227
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
228
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
229
+ logging: this._options.logging,
230
+ });
231
+ if (_response.ok) {
232
+ return { data: _response.body, rawResponse: _response.rawResponse };
233
+ }
234
+ if (_response.error.reason === "status-code") {
235
+ switch (_response.error.statusCode) {
236
+ case 401:
237
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
238
+ case 404:
239
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
240
+ case 429:
241
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
242
+ case 500:
243
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
244
+ default:
245
+ throw new errors.ForumError({
246
+ statusCode: _response.error.statusCode,
247
+ body: _response.error.body,
248
+ rawResponse: _response.rawResponse,
249
+ });
250
+ }
251
+ }
252
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/threads/{id}/poll/votes/{nestedId}");
253
+ });
254
+ }
255
+ }
256
+ exports.PollVotesClient = PollVotesClient;
@@ -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,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,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,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface DeleteOwnvotePollVotesRequest {
8
+ /** Thread ID */
9
+ id: string;
10
+ }
@@ -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
+ /**
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,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,3 @@
1
+ export type { CreatevotePollVotesRequest } from "./CreatevotePollVotesRequest.js";
2
+ export type { DeleteOwnvotePollVotesRequest } from "./DeleteOwnvotePollVotesRequest.js";
3
+ export type { DeletevotePollVotesRequest } from "./DeletevotePollVotesRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,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,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 @@
1
+ export * from "./DeleteOwnvotePollVotesResponse.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("./DeleteOwnvotePollVotesResponse.js"), exports);