@foru-ms/sdk 2.1.14 → 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 (104) 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/tags/client/Client.d.ts +37 -0
  25. package/dist/cjs/api/resources/tags/client/Client.js +126 -0
  26. package/dist/cjs/api/resources/tags/client/requests/CreateSubscriberTagsRequest.d.ts +12 -0
  27. package/dist/cjs/api/resources/tags/client/requests/CreateSubscriberTagsRequest.js +3 -0
  28. package/dist/cjs/api/resources/tags/client/requests/UnsubscribeTagsRequest.d.ts +10 -0
  29. package/dist/cjs/api/resources/tags/client/requests/UnsubscribeTagsRequest.js +3 -0
  30. package/dist/cjs/api/resources/tags/client/requests/index.d.ts +2 -0
  31. package/dist/cjs/api/resources/tags/types/UnsubscribeTagsResponse.d.ts +8 -0
  32. package/dist/cjs/api/resources/tags/types/UnsubscribeTagsResponse.js +3 -0
  33. package/dist/cjs/api/resources/tags/types/index.d.ts +1 -0
  34. package/dist/cjs/api/resources/tags/types/index.js +1 -0
  35. package/dist/cjs/api/resources/threads/client/Client.d.ts +18 -0
  36. package/dist/cjs/api/resources/threads/client/Client.js +60 -0
  37. package/dist/cjs/api/resources/threads/client/requests/UnsubscribeThreadsRequest.d.ts +10 -0
  38. package/dist/cjs/api/resources/threads/client/requests/UnsubscribeThreadsRequest.js +3 -0
  39. package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
  40. package/dist/cjs/api/resources/threads/types/UnsubscribeThreadsResponse.d.ts +8 -0
  41. package/dist/cjs/api/resources/threads/types/UnsubscribeThreadsResponse.js +3 -0
  42. package/dist/cjs/api/resources/threads/types/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/threads/types/index.js +1 -0
  44. package/dist/cjs/api/types/PollVotesResponse.d.ts +12 -0
  45. package/dist/cjs/api/types/PollVotesResponse.js +3 -0
  46. package/dist/cjs/api/types/TagSubscriberCreate.d.ts +4 -0
  47. package/dist/cjs/api/types/TagSubscriberCreate.js +3 -0
  48. package/dist/cjs/api/types/index.d.ts +2 -0
  49. package/dist/cjs/api/types/index.js +2 -0
  50. package/dist/cjs/version.d.ts +1 -1
  51. package/dist/cjs/version.js +1 -1
  52. package/dist/esm/BaseClient.mjs +2 -2
  53. package/dist/esm/Client.d.mts +3 -0
  54. package/dist/esm/Client.mjs +5 -0
  55. package/dist/esm/api/resources/index.d.mts +3 -0
  56. package/dist/esm/api/resources/index.mjs +3 -0
  57. package/dist/esm/api/resources/pollVotes/client/Client.d.mts +68 -0
  58. package/dist/esm/api/resources/pollVotes/client/Client.mjs +219 -0
  59. package/dist/esm/api/resources/pollVotes/client/index.d.mts +1 -0
  60. package/dist/esm/api/resources/pollVotes/client/index.mjs +1 -0
  61. package/dist/esm/api/resources/pollVotes/client/requests/CreatevotePollVotesRequest.d.mts +15 -0
  62. package/dist/esm/api/resources/pollVotes/client/requests/CreatevotePollVotesRequest.mjs +2 -0
  63. package/dist/esm/api/resources/pollVotes/client/requests/DeleteOwnvotePollVotesRequest.d.mts +10 -0
  64. package/dist/esm/api/resources/pollVotes/client/requests/DeleteOwnvotePollVotesRequest.mjs +2 -0
  65. package/dist/esm/api/resources/pollVotes/client/requests/DeletevotePollVotesRequest.d.mts +13 -0
  66. package/dist/esm/api/resources/pollVotes/client/requests/DeletevotePollVotesRequest.mjs +2 -0
  67. package/dist/esm/api/resources/pollVotes/client/requests/index.d.mts +3 -0
  68. package/dist/esm/api/resources/pollVotes/client/requests/index.mjs +1 -0
  69. package/dist/esm/api/resources/pollVotes/index.d.mts +2 -0
  70. package/dist/esm/api/resources/pollVotes/index.mjs +2 -0
  71. package/dist/esm/api/resources/pollVotes/types/DeleteOwnvotePollVotesResponse.d.mts +8 -0
  72. package/dist/esm/api/resources/pollVotes/types/DeleteOwnvotePollVotesResponse.mjs +2 -0
  73. package/dist/esm/api/resources/pollVotes/types/index.d.mts +1 -0
  74. package/dist/esm/api/resources/pollVotes/types/index.mjs +1 -0
  75. package/dist/esm/api/resources/tags/client/Client.d.mts +37 -0
  76. package/dist/esm/api/resources/tags/client/Client.mjs +126 -0
  77. package/dist/esm/api/resources/tags/client/requests/CreateSubscriberTagsRequest.d.mts +12 -0
  78. package/dist/esm/api/resources/tags/client/requests/CreateSubscriberTagsRequest.mjs +2 -0
  79. package/dist/esm/api/resources/tags/client/requests/UnsubscribeTagsRequest.d.mts +10 -0
  80. package/dist/esm/api/resources/tags/client/requests/UnsubscribeTagsRequest.mjs +2 -0
  81. package/dist/esm/api/resources/tags/client/requests/index.d.mts +2 -0
  82. package/dist/esm/api/resources/tags/types/UnsubscribeTagsResponse.d.mts +8 -0
  83. package/dist/esm/api/resources/tags/types/UnsubscribeTagsResponse.mjs +2 -0
  84. package/dist/esm/api/resources/tags/types/index.d.mts +1 -0
  85. package/dist/esm/api/resources/tags/types/index.mjs +1 -0
  86. package/dist/esm/api/resources/threads/client/Client.d.mts +18 -0
  87. package/dist/esm/api/resources/threads/client/Client.mjs +60 -0
  88. package/dist/esm/api/resources/threads/client/requests/UnsubscribeThreadsRequest.d.mts +10 -0
  89. package/dist/esm/api/resources/threads/client/requests/UnsubscribeThreadsRequest.mjs +2 -0
  90. package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
  91. package/dist/esm/api/resources/threads/types/UnsubscribeThreadsResponse.d.mts +8 -0
  92. package/dist/esm/api/resources/threads/types/UnsubscribeThreadsResponse.mjs +2 -0
  93. package/dist/esm/api/resources/threads/types/index.d.mts +1 -0
  94. package/dist/esm/api/resources/threads/types/index.mjs +1 -0
  95. package/dist/esm/api/types/PollVotesResponse.d.mts +12 -0
  96. package/dist/esm/api/types/PollVotesResponse.mjs +2 -0
  97. package/dist/esm/api/types/TagSubscriberCreate.d.mts +4 -0
  98. package/dist/esm/api/types/TagSubscriberCreate.mjs +2 -0
  99. package/dist/esm/api/types/index.d.mts +2 -0
  100. package/dist/esm/api/types/index.mjs +2 -0
  101. package/dist/esm/version.d.mts +1 -1
  102. package/dist/esm/version.mjs +1 -1
  103. package/package.json +1 -1
  104. package/reference.md +379 -0
@@ -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.
@@ -456,6 +456,132 @@ class TagsClient {
456
456
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/tags/{id}/subscribers");
457
457
  });
458
458
  }
459
+ /**
460
+ * Create a Subscriber in Tag.
461
+ *
462
+ * @param {Forum.CreateSubscriberTagsRequest} request
463
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
464
+ *
465
+ * @throws {@link Forum.BadRequestError}
466
+ * @throws {@link Forum.UnauthorizedError}
467
+ * @throws {@link Forum.NotFoundError}
468
+ * @throws {@link Forum.TooManyRequestsError}
469
+ * @throws {@link Forum.InternalServerError}
470
+ *
471
+ * @example
472
+ * await client.tags.createSubscriber({
473
+ * id: "id"
474
+ * })
475
+ */
476
+ createSubscriber(request, requestOptions) {
477
+ return core.HttpResponsePromise.fromPromise(this.__createSubscriber(request, requestOptions));
478
+ }
479
+ __createSubscriber(request, requestOptions) {
480
+ return __awaiter(this, void 0, void 0, function* () {
481
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
482
+ const { id } = request, _body = __rest(request, ["id"]);
483
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
484
+ 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);
485
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
486
+ 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`),
487
+ method: "POST",
488
+ headers: _headers,
489
+ contentType: "application/json",
490
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
491
+ requestType: "json",
492
+ body: _body,
493
+ 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,
494
+ 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,
495
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
496
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
497
+ logging: this._options.logging,
498
+ });
499
+ if (_response.ok) {
500
+ return { data: _response.body, rawResponse: _response.rawResponse };
501
+ }
502
+ if (_response.error.reason === "status-code") {
503
+ switch (_response.error.statusCode) {
504
+ case 400:
505
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
506
+ case 401:
507
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
508
+ case 404:
509
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
510
+ case 429:
511
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
512
+ case 500:
513
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
514
+ default:
515
+ throw new errors.ForumError({
516
+ statusCode: _response.error.statusCode,
517
+ body: _response.error.body,
518
+ rawResponse: _response.rawResponse,
519
+ });
520
+ }
521
+ }
522
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/tags/{id}/subscribers");
523
+ });
524
+ }
525
+ /**
526
+ * Unsubscribe from this tag. Removes the authenticated user's subscription. No subId needed.
527
+ *
528
+ * @param {Forum.UnsubscribeTagsRequest} request
529
+ * @param {TagsClient.RequestOptions} requestOptions - Request-specific configuration.
530
+ *
531
+ * @throws {@link Forum.UnauthorizedError}
532
+ * @throws {@link Forum.NotFoundError}
533
+ * @throws {@link Forum.TooManyRequestsError}
534
+ * @throws {@link Forum.InternalServerError}
535
+ *
536
+ * @example
537
+ * await client.tags.unsubscribe({
538
+ * id: "id"
539
+ * })
540
+ */
541
+ unsubscribe(request, requestOptions) {
542
+ return core.HttpResponsePromise.fromPromise(this.__unsubscribe(request, requestOptions));
543
+ }
544
+ __unsubscribe(request, requestOptions) {
545
+ return __awaiter(this, void 0, void 0, function* () {
546
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
547
+ const { id } = request;
548
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
549
+ 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);
550
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
551
+ 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`),
552
+ method: "DELETE",
553
+ headers: _headers,
554
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
555
+ 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,
556
+ 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,
557
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
558
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
559
+ logging: this._options.logging,
560
+ });
561
+ if (_response.ok) {
562
+ return { data: _response.body, rawResponse: _response.rawResponse };
563
+ }
564
+ if (_response.error.reason === "status-code") {
565
+ switch (_response.error.statusCode) {
566
+ case 401:
567
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
568
+ case 404:
569
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
570
+ case 429:
571
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
572
+ case 500:
573
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
574
+ default:
575
+ throw new errors.ForumError({
576
+ statusCode: _response.error.statusCode,
577
+ body: _response.error.body,
578
+ rawResponse: _response.rawResponse,
579
+ });
580
+ }
581
+ }
582
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/tags/{id}/subscribers");
583
+ });
584
+ }
459
585
  /**
460
586
  * @param {Forum.RetrieveSubscriberTagsRequest} request
461
587
  * @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,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 UnsubscribeTagsRequest {
8
+ /** Tag ID to unsubscribe from */
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 });
@@ -1,3 +1,4 @@
1
+ export type { CreateSubscriberTagsRequest } from "./CreateSubscriberTagsRequest.js";
1
2
  export type { CreateTagsRequest } from "./CreateTagsRequest.js";
2
3
  export type { DeleteSubscriberTagsRequest } from "./DeleteSubscriberTagsRequest.js";
3
4
  export type { DeleteTagsRequest } from "./DeleteTagsRequest.js";
@@ -5,4 +6,5 @@ export type { ListSubscribersTagsRequest } from "./ListSubscribersTagsRequest.js
5
6
  export type { ListTagsRequest } from "./ListTagsRequest.js";
6
7
  export type { RetrieveSubscriberTagsRequest } from "./RetrieveSubscriberTagsRequest.js";
7
8
  export type { RetrieveTagsRequest } from "./RetrieveTagsRequest.js";
9
+ export type { UnsubscribeTagsRequest } from "./UnsubscribeTagsRequest.js";
8
10
  export type { UpdateTagsRequest } from "./UpdateTagsRequest.js";
@@ -0,0 +1,8 @@
1
+ export interface UnsubscribeTagsResponse {
2
+ data: UnsubscribeTagsResponse.Data;
3
+ }
4
+ export declare namespace UnsubscribeTagsResponse {
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 });
@@ -1,2 +1,3 @@
1
1
  export * from "./RetrieveSubscriberTagsResponse.js";
2
+ export * from "./UnsubscribeTagsResponse.js";
2
3
  export * from "./UpdateTagsResponse.js";
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./RetrieveSubscriberTagsResponse.js"), exports);
18
+ __exportStar(require("./UnsubscribeTagsResponse.js"), exports);
18
19
  __exportStar(require("./UpdateTagsResponse.js"), exports);
@@ -249,6 +249,24 @@ export declare class ThreadsClient {
249
249
  */
250
250
  listSubscribers(request: Forum.ListSubscribersThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.ThreadSubscriberListResponse>;
251
251
  private __listSubscribers;
252
+ /**
253
+ * Unsubscribe from this thread. Removes the authenticated user's subscription. No subId needed.
254
+ *
255
+ * @param {Forum.UnsubscribeThreadsRequest} request
256
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
257
+ *
258
+ * @throws {@link Forum.UnauthorizedError}
259
+ * @throws {@link Forum.NotFoundError}
260
+ * @throws {@link Forum.TooManyRequestsError}
261
+ * @throws {@link Forum.InternalServerError}
262
+ *
263
+ * @example
264
+ * await client.threads.unsubscribe({
265
+ * id: "id"
266
+ * })
267
+ */
268
+ unsubscribe(request: Forum.UnsubscribeThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<Forum.UnsubscribeThreadsResponse>;
269
+ private __unsubscribe;
252
270
  /**
253
271
  * @param {Forum.RetrieveSubscriberThreadsRequest} request
254
272
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -899,6 +899,66 @@ class ThreadsClient {
899
899
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/threads/{id}/subscribers");
900
900
  });
901
901
  }
902
+ /**
903
+ * Unsubscribe from this thread. Removes the authenticated user's subscription. No subId needed.
904
+ *
905
+ * @param {Forum.UnsubscribeThreadsRequest} request
906
+ * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
907
+ *
908
+ * @throws {@link Forum.UnauthorizedError}
909
+ * @throws {@link Forum.NotFoundError}
910
+ * @throws {@link Forum.TooManyRequestsError}
911
+ * @throws {@link Forum.InternalServerError}
912
+ *
913
+ * @example
914
+ * await client.threads.unsubscribe({
915
+ * id: "id"
916
+ * })
917
+ */
918
+ unsubscribe(request, requestOptions) {
919
+ return core.HttpResponsePromise.fromPromise(this.__unsubscribe(request, requestOptions));
920
+ }
921
+ __unsubscribe(request, requestOptions) {
922
+ return __awaiter(this, void 0, void 0, function* () {
923
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
924
+ const { id } = request;
925
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
926
+ 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);
927
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
928
+ 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)}/subscribers`),
929
+ method: "DELETE",
930
+ headers: _headers,
931
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
932
+ 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,
933
+ 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,
934
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
935
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
936
+ logging: this._options.logging,
937
+ });
938
+ if (_response.ok) {
939
+ return { data: _response.body, rawResponse: _response.rawResponse };
940
+ }
941
+ if (_response.error.reason === "status-code") {
942
+ switch (_response.error.statusCode) {
943
+ case 401:
944
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
945
+ case 404:
946
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
947
+ case 429:
948
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
949
+ case 500:
950
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
951
+ default:
952
+ throw new errors.ForumError({
953
+ statusCode: _response.error.statusCode,
954
+ body: _response.error.body,
955
+ rawResponse: _response.rawResponse,
956
+ });
957
+ }
958
+ }
959
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/threads/{id}/subscribers");
960
+ });
961
+ }
902
962
  /**
903
963
  * @param {Forum.RetrieveSubscriberThreadsRequest} request
904
964
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface UnsubscribeThreadsRequest {
8
+ /** Thread ID to unsubscribe from */
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 });
@@ -14,5 +14,6 @@ export type { RetrievePostThreadsRequest } from "./RetrievePostThreadsRequest.js
14
14
  export type { RetrieveReactionThreadsRequest } from "./RetrieveReactionThreadsRequest.js";
15
15
  export type { RetrieveSubscriberThreadsRequest } from "./RetrieveSubscriberThreadsRequest.js";
16
16
  export type { RetrieveThreadsRequest } from "./RetrieveThreadsRequest.js";
17
+ export type { UnsubscribeThreadsRequest } from "./UnsubscribeThreadsRequest.js";
17
18
  export type { UpdatePollThreadsRequest } from "./UpdatePollThreadsRequest.js";
18
19
  export type { UpdateThreadsRequest } from "./UpdateThreadsRequest.js";
@@ -0,0 +1,8 @@
1
+ export interface UnsubscribeThreadsResponse {
2
+ data: UnsubscribeThreadsResponse.Data;
3
+ }
4
+ export declare namespace UnsubscribeThreadsResponse {
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 });
@@ -6,4 +6,5 @@ export * from "./ListThreadsRequestSort.js";
6
6
  export * from "./RetrievePostThreadsResponse.js";
7
7
  export * from "./RetrieveReactionThreadsResponse.js";
8
8
  export * from "./RetrieveSubscriberThreadsResponse.js";
9
+ export * from "./UnsubscribeThreadsResponse.js";
9
10
  export * from "./UpdateThreadsResponse.js";
@@ -22,4 +22,5 @@ __exportStar(require("./ListThreadsRequestSort.js"), exports);
22
22
  __exportStar(require("./RetrievePostThreadsResponse.js"), exports);
23
23
  __exportStar(require("./RetrieveReactionThreadsResponse.js"), exports);
24
24
  __exportStar(require("./RetrieveSubscriberThreadsResponse.js"), exports);
25
+ __exportStar(require("./UnsubscribeThreadsResponse.js"), exports);
25
26
  __exportStar(require("./UpdateThreadsResponse.js"), exports);
@@ -0,0 +1,12 @@
1
+ export interface PollVotesResponse {
2
+ data: PollVotesResponse.Data;
3
+ }
4
+ export declare namespace PollVotesResponse {
5
+ interface Data {
6
+ id: string;
7
+ pollId: string;
8
+ optionId: string;
9
+ userId: string;
10
+ createdAt: string;
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface TagSubscriberCreate {
2
+ /** Optional custom data */
3
+ extendedData?: Record<string, unknown>;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -24,6 +24,7 @@ export * from "./NotificationListResponse.js";
24
24
  export * from "./NotificationResponse.js";
25
25
  export * from "./NotificationUpdate.js";
26
26
  export * from "./OwnershipInfo.js";
27
+ export * from "./PollVotesResponse.js";
27
28
  export * from "./Post.js";
28
29
  export * from "./PostCreate.js";
29
30
  export * from "./PostList.js";
@@ -78,6 +79,7 @@ export * from "./TagList.js";
78
79
  export * from "./TagListResponse.js";
79
80
  export * from "./TagResponse.js";
80
81
  export * from "./TagSubscriber.js";
82
+ export * from "./TagSubscriberCreate.js";
81
83
  export * from "./TagSubscriberListResponse.js";
82
84
  export * from "./TagSubscriberResponse.js";
83
85
  export * from "./TagUpdate.js";
@@ -40,6 +40,7 @@ __exportStar(require("./NotificationListResponse.js"), exports);
40
40
  __exportStar(require("./NotificationResponse.js"), exports);
41
41
  __exportStar(require("./NotificationUpdate.js"), exports);
42
42
  __exportStar(require("./OwnershipInfo.js"), exports);
43
+ __exportStar(require("./PollVotesResponse.js"), exports);
43
44
  __exportStar(require("./Post.js"), exports);
44
45
  __exportStar(require("./PostCreate.js"), exports);
45
46
  __exportStar(require("./PostList.js"), exports);
@@ -94,6 +95,7 @@ __exportStar(require("./TagList.js"), exports);
94
95
  __exportStar(require("./TagListResponse.js"), exports);
95
96
  __exportStar(require("./TagResponse.js"), exports);
96
97
  __exportStar(require("./TagSubscriber.js"), exports);
98
+ __exportStar(require("./TagSubscriberCreate.js"), exports);
97
99
  __exportStar(require("./TagSubscriberListResponse.js"), exports);
98
100
  __exportStar(require("./TagSubscriberResponse.js"), exports);
99
101
  __exportStar(require("./TagUpdate.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.14";
1
+ export declare const SDK_VERSION = "2.1.15";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.1.14";
4
+ exports.SDK_VERSION = "2.1.15";
@@ -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.14",
10
- "User-Agent": "@foru-ms/sdk/2.1.14",
9
+ "X-Fern-SDK-Version": "2.1.15",
10
+ "User-Agent": "@foru-ms/sdk/2.1.15",
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);
@@ -1,6 +1,7 @@
1
1
  import { AuthClient } from "./api/resources/auth/client/Client.mjs";
2
2
  import { IntegrationsClient } from "./api/resources/integrations/client/Client.mjs";
3
3
  import { NotificationsClient } from "./api/resources/notifications/client/Client.mjs";
4
+ import { PollVotesClient } from "./api/resources/pollVotes/client/Client.mjs";
4
5
  import { PostsClient } from "./api/resources/posts/client/Client.mjs";
5
6
  import { PrivateMessagesClient } from "./api/resources/privateMessages/client/Client.mjs";
6
7
  import { ProvisioningClient } from "./api/resources/provisioning/client/Client.mjs";
@@ -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;
@@ -2,6 +2,7 @@
2
2
  import { AuthClient } from "./api/resources/auth/client/Client.mjs";
3
3
  import { IntegrationsClient } from "./api/resources/integrations/client/Client.mjs";
4
4
  import { NotificationsClient } from "./api/resources/notifications/client/Client.mjs";
5
+ import { PollVotesClient } from "./api/resources/pollVotes/client/Client.mjs";
5
6
  import { PostsClient } from "./api/resources/posts/client/Client.mjs";
6
7
  import { PrivateMessagesClient } from "./api/resources/privateMessages/client/Client.mjs";
7
8
  import { ProvisioningClient } from "./api/resources/provisioning/client/Client.mjs";
@@ -34,6 +35,10 @@ export class ForumClient {
34
35
  var _a;
35
36
  return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new ThreadsClient(this._options)));
36
37
  }
38
+ get pollVotes() {
39
+ var _a;
40
+ return ((_a = this._pollVotes) !== null && _a !== void 0 ? _a : (this._pollVotes = new PollVotesClient(this._options)));
41
+ }
37
42
  get posts() {
38
43
  var _a;
39
44
  return ((_a = this._posts) !== null && _a !== void 0 ? _a : (this._posts = new PostsClient(this._options)));
@@ -6,6 +6,9 @@ export * from "./integrations/types/index.mjs";
6
6
  export * from "./notifications/client/requests/index.mjs";
7
7
  export * as notifications from "./notifications/index.mjs";
8
8
  export * from "./notifications/types/index.mjs";
9
+ export * from "./pollVotes/client/requests/index.mjs";
10
+ export * as pollVotes from "./pollVotes/index.mjs";
11
+ export * from "./pollVotes/types/index.mjs";
9
12
  export * from "./posts/client/requests/index.mjs";
10
13
  export * as posts from "./posts/index.mjs";
11
14
  export * from "./posts/types/index.mjs";
@@ -6,6 +6,9 @@ export * from "./integrations/types/index.mjs";
6
6
  export * from "./notifications/client/requests/index.mjs";
7
7
  export * as notifications from "./notifications/index.mjs";
8
8
  export * from "./notifications/types/index.mjs";
9
+ export * from "./pollVotes/client/requests/index.mjs";
10
+ export * as pollVotes from "./pollVotes/index.mjs";
11
+ export * from "./pollVotes/types/index.mjs";
9
12
  export * from "./posts/client/requests/index.mjs";
10
13
  export * as posts from "./posts/index.mjs";
11
14
  export * from "./posts/types/index.mjs";
@@ -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
+ }