@foru-ms/sdk 2.1.0 → 2.1.1
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/Client.d.ts +4 -1
- package/dist/cjs/Client.js +16 -11
- package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/auth/client/Client.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/integrations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/integrations/client/Client.js +6 -9
- package/dist/cjs/api/resources/integrations/client/requests/CreateIntegrationsRequest.d.ts +2 -0
- package/dist/cjs/api/resources/integrations/client/requests/ListIntegrationsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/integrations/client/requests/UpdateIntegrationsRequest.d.ts +2 -0
- package/dist/cjs/api/resources/integrations/types/UpdateIntegrationsResponse.d.ts +2 -0
- package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/client/Client.js +7 -14
- package/dist/cjs/api/resources/notifications/client/requests/index.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/posts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/posts/client/Client.js +22 -49
- package/dist/cjs/api/resources/posts/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/posts/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/privateMessages/client/Client.d.ts +21 -1
- package/dist/cjs/api/resources/privateMessages/client/Client.js +79 -18
- package/dist/cjs/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.d.ts +16 -0
- package/dist/cjs/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/privateMessages/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.d.ts +26 -0
- package/dist/cjs/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.js +3 -0
- package/dist/cjs/api/resources/privateMessages/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/privateMessages/types/index.js +1 -0
- package/dist/cjs/api/resources/reports/client/Client.d.ts +21 -1
- package/dist/cjs/api/resources/reports/client/Client.js +88 -17
- package/dist/cjs/api/resources/reports/client/requests/UpdateReportsRequest.d.ts +16 -0
- package/dist/cjs/api/resources/reports/client/requests/UpdateReportsRequest.js +3 -0
- package/dist/cjs/api/resources/reports/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/reports/index.d.ts +1 -0
- package/dist/cjs/api/resources/reports/index.js +1 -0
- package/dist/cjs/api/resources/reports/types/UpdateReportsResponse.d.ts +28 -0
- package/dist/cjs/api/resources/reports/types/UpdateReportsResponse.js +3 -0
- package/dist/cjs/api/resources/reports/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/reports/types/index.js +17 -0
- package/dist/cjs/api/resources/roles/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/roles/client/Client.js +8 -9
- package/dist/cjs/api/resources/roles/client/requests/ListRolesRequest.d.ts +7 -2
- package/dist/cjs/api/resources/roles/types/ListRolesRequestSort.d.ts +6 -0
- package/dist/cjs/api/resources/roles/types/ListRolesRequestSort.js +9 -0
- package/dist/cjs/api/resources/roles/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/roles/types/index.js +1 -0
- package/dist/cjs/api/resources/search/client/Client.d.ts +29 -0
- package/dist/cjs/api/resources/search/client/Client.js +115 -0
- package/dist/cjs/api/resources/search/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/search/client/index.js +2 -0
- package/dist/cjs/api/resources/search/index.d.ts +2 -0
- package/dist/cjs/api/resources/search/index.js +18 -0
- package/dist/cjs/api/resources/search/types/SearchSearchResponse.d.ts +33 -0
- package/dist/cjs/api/resources/search/types/SearchSearchResponse.js +22 -0
- package/dist/cjs/api/resources/search/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/search/types/index.js +17 -0
- package/dist/cjs/api/resources/ssOs/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/ssOs/client/Client.js +6 -9
- package/dist/cjs/api/resources/ssOs/client/requests/CreateSsOsRequest.d.ts +2 -0
- package/dist/cjs/api/resources/ssOs/client/requests/ListSsOsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/ssOs/client/requests/UpdateSsOsRequest.d.ts +2 -0
- package/dist/cjs/api/resources/ssOs/types/UpdateSsOsResponse.d.ts +2 -0
- package/dist/cjs/api/resources/tags/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tags/client/Client.js +10 -18
- package/dist/cjs/api/resources/threads/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/threads/client/Client.js +26 -56
- package/dist/cjs/api/resources/threads/client/requests/CreateThreadsRequest.d.ts +6 -0
- package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/threads/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/threads/types/UpdateThreadsResponse.d.ts +5 -5
- package/dist/cjs/api/resources/users/client/Client.d.ts +20 -1
- package/dist/cjs/api/resources/users/client/Client.js +80 -28
- package/dist/cjs/api/resources/users/client/requests/CreateUsersRequest.d.ts +26 -0
- package/dist/cjs/api/resources/users/client/requests/CreateUsersRequest.js +3 -0
- package/dist/cjs/api/resources/users/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +23 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +91 -15
- package/dist/cjs/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.ts +4 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.ts +22 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhooksResponse.d.ts +26 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhooksResponse.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +1 -0
- package/dist/cjs/api/types/Integration.d.ts +2 -0
- package/dist/cjs/api/types/IntegrationCreate.d.ts +2 -0
- package/dist/cjs/api/types/IntegrationList.d.ts +6 -0
- package/dist/cjs/api/types/IntegrationList.js +3 -0
- package/dist/cjs/api/types/IntegrationListResponse.d.ts +2 -0
- package/dist/cjs/api/types/IntegrationResponse.d.ts +2 -0
- package/dist/cjs/api/types/IntegrationUpdate.d.ts +2 -0
- package/dist/cjs/api/types/MeResponse.d.ts +22 -0
- package/dist/cjs/api/types/PrivateMessageUpdate.d.ts +8 -0
- package/dist/cjs/api/types/PrivateMessageUpdate.js +3 -0
- package/dist/cjs/api/types/ReportUpdate.d.ts +8 -0
- package/dist/cjs/api/types/ReportUpdate.js +3 -0
- package/dist/cjs/api/types/RoleList.d.ts +19 -0
- package/dist/cjs/api/types/RoleList.js +13 -0
- package/dist/cjs/api/types/Search.d.ts +1 -0
- package/dist/cjs/api/types/Search.js +3 -0
- package/dist/cjs/api/types/SearchListResponse.d.ts +18 -0
- package/dist/cjs/api/types/SearchListResponse.js +3 -0
- package/dist/cjs/api/types/SearchResponse.d.ts +6 -0
- package/dist/cjs/api/types/SearchResponse.js +3 -0
- package/dist/cjs/api/types/Sso.d.ts +2 -0
- package/dist/cjs/api/types/SsoCreate.d.ts +2 -0
- package/dist/cjs/api/types/SsoList.d.ts +6 -0
- package/dist/cjs/api/types/SsoList.js +3 -0
- package/dist/cjs/api/types/SsoListResponse.d.ts +2 -0
- package/dist/cjs/api/types/SsoResponse.d.ts +2 -0
- package/dist/cjs/api/types/SsoUpdate.d.ts +2 -0
- package/dist/cjs/api/types/Thread.d.ts +5 -5
- package/dist/cjs/api/types/ThreadCreate.d.ts +6 -0
- package/dist/cjs/api/types/ThreadListResponse.d.ts +5 -5
- package/dist/cjs/api/types/ThreadResponse.d.ts +5 -5
- package/dist/cjs/api/types/UserCreate.d.ts +20 -0
- package/dist/cjs/api/types/UserCreate.js +3 -0
- package/dist/cjs/api/types/Webhook.d.ts +2 -0
- package/dist/cjs/api/types/WebhookCreate.d.ts +4 -0
- package/dist/cjs/api/types/WebhookListResponse.d.ts +2 -0
- package/dist/cjs/api/types/WebhookResponse.d.ts +2 -0
- package/dist/cjs/api/types/WebhookUpdate.d.ts +14 -0
- package/dist/cjs/api/types/WebhookUpdate.js +3 -0
- package/dist/cjs/api/types/index.d.ts +10 -0
- package/dist/cjs/api/types/index.js +10 -0
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -10
- package/dist/cjs/auth/HeaderAuthProvider.js +18 -9
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -2
- package/dist/cjs/core/headers.d.ts +2 -2
- 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/Client.d.mts +4 -1
- package/dist/esm/Client.mjs +6 -1
- package/dist/esm/api/resources/auth/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/auth/client/Client.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/integrations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/integrations/client/Client.mjs +6 -9
- package/dist/esm/api/resources/integrations/client/requests/CreateIntegrationsRequest.d.mts +2 -0
- package/dist/esm/api/resources/integrations/client/requests/ListIntegrationsRequest.d.mts +2 -2
- package/dist/esm/api/resources/integrations/client/requests/UpdateIntegrationsRequest.d.mts +2 -0
- package/dist/esm/api/resources/integrations/types/UpdateIntegrationsResponse.d.mts +2 -0
- package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/notifications/client/Client.mjs +7 -14
- package/dist/esm/api/resources/notifications/client/requests/index.d.mts +2 -2
- package/dist/esm/api/resources/notifications/client/requests/index.mjs +2 -1
- package/dist/esm/api/resources/posts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/posts/client/Client.mjs +22 -49
- package/dist/esm/api/resources/posts/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/posts/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/privateMessages/client/Client.d.mts +21 -1
- package/dist/esm/api/resources/privateMessages/client/Client.mjs +79 -18
- package/dist/esm/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.d.mts +16 -0
- package/dist/esm/api/resources/privateMessages/client/requests/UpdatePrivateMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/privateMessages/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.d.mts +26 -0
- package/dist/esm/api/resources/privateMessages/types/UpdatePrivateMessagesResponse.mjs +2 -0
- package/dist/esm/api/resources/privateMessages/types/index.d.mts +1 -0
- package/dist/esm/api/resources/privateMessages/types/index.mjs +1 -0
- package/dist/esm/api/resources/reports/client/Client.d.mts +21 -1
- package/dist/esm/api/resources/reports/client/Client.mjs +88 -17
- package/dist/esm/api/resources/reports/client/requests/UpdateReportsRequest.d.mts +16 -0
- package/dist/esm/api/resources/reports/client/requests/UpdateReportsRequest.mjs +2 -0
- package/dist/esm/api/resources/reports/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/reports/index.d.mts +1 -0
- package/dist/esm/api/resources/reports/index.mjs +1 -0
- package/dist/esm/api/resources/reports/types/UpdateReportsResponse.d.mts +28 -0
- package/dist/esm/api/resources/reports/types/UpdateReportsResponse.mjs +2 -0
- package/dist/esm/api/resources/reports/types/index.d.mts +1 -0
- package/dist/esm/api/resources/reports/types/index.mjs +1 -0
- package/dist/esm/api/resources/roles/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/roles/client/Client.mjs +8 -9
- package/dist/esm/api/resources/roles/client/requests/ListRolesRequest.d.mts +7 -2
- package/dist/esm/api/resources/roles/types/ListRolesRequestSort.d.mts +6 -0
- package/dist/esm/api/resources/roles/types/ListRolesRequestSort.mjs +6 -0
- package/dist/esm/api/resources/roles/types/index.d.mts +1 -0
- package/dist/esm/api/resources/roles/types/index.mjs +1 -0
- package/dist/esm/api/resources/search/client/Client.d.mts +29 -0
- package/dist/esm/api/resources/search/client/Client.mjs +78 -0
- package/dist/esm/api/resources/search/client/index.d.mts +1 -0
- package/dist/esm/api/resources/search/client/index.mjs +1 -0
- package/dist/esm/api/resources/search/index.d.mts +2 -0
- package/dist/esm/api/resources/search/index.mjs +2 -0
- package/dist/esm/api/resources/search/types/SearchSearchResponse.d.mts +33 -0
- package/dist/esm/api/resources/search/types/SearchSearchResponse.mjs +19 -0
- package/dist/esm/api/resources/search/types/index.d.mts +1 -0
- package/dist/esm/api/resources/search/types/index.mjs +1 -0
- package/dist/esm/api/resources/ssOs/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/ssOs/client/Client.mjs +6 -9
- package/dist/esm/api/resources/ssOs/client/requests/CreateSsOsRequest.d.mts +2 -0
- package/dist/esm/api/resources/ssOs/client/requests/ListSsOsRequest.d.mts +2 -2
- package/dist/esm/api/resources/ssOs/client/requests/UpdateSsOsRequest.d.mts +2 -0
- package/dist/esm/api/resources/ssOs/types/UpdateSsOsResponse.d.mts +2 -0
- package/dist/esm/api/resources/tags/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tags/client/Client.mjs +10 -18
- package/dist/esm/api/resources/threads/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/threads/client/Client.mjs +26 -56
- package/dist/esm/api/resources/threads/client/requests/CreateThreadsRequest.d.mts +6 -0
- package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/threads/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/threads/types/UpdateThreadsResponse.d.mts +5 -5
- package/dist/esm/api/resources/users/client/Client.d.mts +20 -1
- package/dist/esm/api/resources/users/client/Client.mjs +80 -28
- package/dist/esm/api/resources/users/client/requests/CreateUsersRequest.d.mts +26 -0
- package/dist/esm/api/resources/users/client/requests/CreateUsersRequest.mjs +2 -0
- package/dist/esm/api/resources/users/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +23 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +91 -15
- package/dist/esm/api/resources/webhooks/client/requests/CreateWebhooksRequest.d.mts +4 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.d.mts +22 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhooksResponse.d.mts +26 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhooksResponse.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +1 -0
- package/dist/esm/api/types/Integration.d.mts +2 -0
- package/dist/esm/api/types/IntegrationCreate.d.mts +2 -0
- package/dist/esm/api/types/IntegrationList.d.mts +6 -0
- package/dist/esm/api/types/IntegrationList.mjs +2 -0
- package/dist/esm/api/types/IntegrationListResponse.d.mts +2 -0
- package/dist/esm/api/types/IntegrationResponse.d.mts +2 -0
- package/dist/esm/api/types/IntegrationUpdate.d.mts +2 -0
- package/dist/esm/api/types/MeResponse.d.mts +22 -0
- package/dist/esm/api/types/PrivateMessageUpdate.d.mts +8 -0
- package/dist/esm/api/types/PrivateMessageUpdate.mjs +2 -0
- package/dist/esm/api/types/ReportUpdate.d.mts +8 -0
- package/dist/esm/api/types/ReportUpdate.mjs +2 -0
- package/dist/esm/api/types/RoleList.d.mts +19 -0
- package/dist/esm/api/types/RoleList.mjs +10 -0
- package/dist/esm/api/types/Search.d.mts +1 -0
- package/dist/esm/api/types/Search.mjs +2 -0
- package/dist/esm/api/types/SearchListResponse.d.mts +18 -0
- package/dist/esm/api/types/SearchListResponse.mjs +2 -0
- package/dist/esm/api/types/SearchResponse.d.mts +6 -0
- package/dist/esm/api/types/SearchResponse.mjs +2 -0
- package/dist/esm/api/types/Sso.d.mts +2 -0
- package/dist/esm/api/types/SsoCreate.d.mts +2 -0
- package/dist/esm/api/types/SsoList.d.mts +6 -0
- package/dist/esm/api/types/SsoList.mjs +2 -0
- package/dist/esm/api/types/SsoListResponse.d.mts +2 -0
- package/dist/esm/api/types/SsoResponse.d.mts +2 -0
- package/dist/esm/api/types/SsoUpdate.d.mts +2 -0
- package/dist/esm/api/types/Thread.d.mts +5 -5
- package/dist/esm/api/types/ThreadCreate.d.mts +6 -0
- package/dist/esm/api/types/ThreadListResponse.d.mts +5 -5
- package/dist/esm/api/types/ThreadResponse.d.mts +5 -5
- package/dist/esm/api/types/UserCreate.d.mts +20 -0
- package/dist/esm/api/types/UserCreate.mjs +2 -0
- package/dist/esm/api/types/Webhook.d.mts +2 -0
- package/dist/esm/api/types/WebhookCreate.d.mts +4 -0
- package/dist/esm/api/types/WebhookListResponse.d.mts +2 -0
- package/dist/esm/api/types/WebhookResponse.d.mts +2 -0
- package/dist/esm/api/types/WebhookUpdate.d.mts +14 -0
- package/dist/esm/api/types/WebhookUpdate.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +10 -0
- package/dist/esm/api/types/index.mjs +10 -0
- package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -10
- package/dist/esm/auth/HeaderAuthProvider.mjs +18 -9
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +1 -2
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +304 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptions } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as Forum from "../../../index.mjs";
|
|
18
|
+
/**
|
|
19
|
+
* Operations for search
|
|
20
|
+
*/
|
|
21
|
+
export class SearchClient {
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
this._options = normalizeClientOptions(options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Forum.BadRequestError}
|
|
29
|
+
* @throws {@link Forum.PaymentRequiredError}
|
|
30
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
31
|
+
* @throws {@link Forum.InternalServerError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.search.search()
|
|
35
|
+
*/
|
|
36
|
+
search(requestOptions) {
|
|
37
|
+
return core.HttpResponsePromise.fromPromise(this.__search(requestOptions));
|
|
38
|
+
}
|
|
39
|
+
__search(requestOptions) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
42
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
43
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
44
|
+
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, "search/"),
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
48
|
+
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,
|
|
49
|
+
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,
|
|
50
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
51
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
52
|
+
logging: this._options.logging,
|
|
53
|
+
});
|
|
54
|
+
if (_response.ok) {
|
|
55
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
56
|
+
}
|
|
57
|
+
if (_response.error.reason === "status-code") {
|
|
58
|
+
switch (_response.error.statusCode) {
|
|
59
|
+
case 400:
|
|
60
|
+
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
61
|
+
case 402:
|
|
62
|
+
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
63
|
+
case 429:
|
|
64
|
+
throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
65
|
+
case 500:
|
|
66
|
+
throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
|
|
67
|
+
default:
|
|
68
|
+
throw new errors.ForumError({
|
|
69
|
+
statusCode: _response.error.statusCode,
|
|
70
|
+
body: _response.error.body,
|
|
71
|
+
rawResponse: _response.rawResponse,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/search/");
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface SearchSearchResponse {
|
|
2
|
+
data?: SearchSearchResponse.Data;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace SearchSearchResponse {
|
|
5
|
+
interface Data {
|
|
6
|
+
items: Data.Items.Item[];
|
|
7
|
+
nextCursor: string | null;
|
|
8
|
+
hasMore: boolean;
|
|
9
|
+
}
|
|
10
|
+
namespace Data {
|
|
11
|
+
type Items = Items.Item[];
|
|
12
|
+
namespace Items {
|
|
13
|
+
interface Item {
|
|
14
|
+
type: Item.Type;
|
|
15
|
+
id: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
body?: string;
|
|
18
|
+
username?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
createdAt?: string;
|
|
21
|
+
}
|
|
22
|
+
namespace Item {
|
|
23
|
+
const Type: {
|
|
24
|
+
readonly Thread: "thread";
|
|
25
|
+
readonly Post: "post";
|
|
26
|
+
readonly User: "user";
|
|
27
|
+
readonly Tag: "tag";
|
|
28
|
+
};
|
|
29
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var SearchSearchResponse;
|
|
3
|
+
(function (SearchSearchResponse) {
|
|
4
|
+
let Data;
|
|
5
|
+
(function (Data) {
|
|
6
|
+
let Items;
|
|
7
|
+
(function (Items) {
|
|
8
|
+
let Item;
|
|
9
|
+
(function (Item) {
|
|
10
|
+
Item.Type = {
|
|
11
|
+
Thread: "thread",
|
|
12
|
+
Post: "post",
|
|
13
|
+
User: "user",
|
|
14
|
+
Tag: "tag",
|
|
15
|
+
};
|
|
16
|
+
})(Item = Items.Item || (Items.Item = {}));
|
|
17
|
+
})(Items = Data.Items || (Data.Items = {}));
|
|
18
|
+
})(Data = SearchSearchResponse.Data || (SearchSearchResponse.Data = {}));
|
|
19
|
+
})(SearchSearchResponse || (SearchSearchResponse = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SearchSearchResponse.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SearchSearchResponse.mjs";
|
|
@@ -12,7 +12,7 @@ export declare namespace SsOsClient {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class SsOsClient {
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<SsOsClient.Options>;
|
|
15
|
-
constructor(options
|
|
15
|
+
constructor(options?: SsOsClient.Options);
|
|
16
16
|
/**
|
|
17
17
|
* Retrieve a paginated list of ssos. Use cursor for pagination.
|
|
18
18
|
*
|
|
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
|
|
|
30
30
|
* Operations for sso
|
|
31
31
|
*/
|
|
32
32
|
export class SsOsClient {
|
|
33
|
-
constructor(options) {
|
|
33
|
+
constructor(options = {}) {
|
|
34
34
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -55,14 +55,11 @@ export class SsOsClient {
|
|
|
55
55
|
__list() {
|
|
56
56
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
57
57
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
58
|
-
const {
|
|
59
|
-
const _queryParams = {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
if (limit != null) {
|
|
64
|
-
_queryParams.limit = limit.toString();
|
|
65
|
-
}
|
|
58
|
+
const { limit, cursor } = request;
|
|
59
|
+
const _queryParams = {
|
|
60
|
+
limit,
|
|
61
|
+
cursor,
|
|
62
|
+
};
|
|
66
63
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
67
64
|
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);
|
|
68
65
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -10,6 +10,8 @@ export declare namespace UpdateSsOsResponse {
|
|
|
10
10
|
domain: string;
|
|
11
11
|
/** Whether SSO is active */
|
|
12
12
|
active: boolean;
|
|
13
|
+
/** Custom extended data */
|
|
14
|
+
extendedData: Record<string, unknown> | null;
|
|
13
15
|
/** SSO configuration creation timestamp */
|
|
14
16
|
createdAt: string;
|
|
15
17
|
/** SSO configuration last update timestamp */
|
|
@@ -12,7 +12,7 @@ export declare namespace TagsClient {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class TagsClient {
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<TagsClient.Options>;
|
|
15
|
-
constructor(options
|
|
15
|
+
constructor(options?: TagsClient.Options);
|
|
16
16
|
/**
|
|
17
17
|
* Retrieve a paginated list of tags. Use cursor for pagination.
|
|
18
18
|
*
|
|
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
|
|
|
30
30
|
* Operations for tags
|
|
31
31
|
*/
|
|
32
32
|
export class TagsClient {
|
|
33
|
-
constructor(options) {
|
|
33
|
+
constructor(options = {}) {
|
|
34
34
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -54,16 +54,11 @@ export class TagsClient {
|
|
|
54
54
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
55
55
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
56
56
|
const { limit, cursor, search } = request;
|
|
57
|
-
const _queryParams = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
_queryParams.cursor = cursor;
|
|
63
|
-
}
|
|
64
|
-
if (search != null) {
|
|
65
|
-
_queryParams.search = search;
|
|
66
|
-
}
|
|
57
|
+
const _queryParams = {
|
|
58
|
+
limit,
|
|
59
|
+
cursor,
|
|
60
|
+
search,
|
|
61
|
+
};
|
|
67
62
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
68
63
|
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);
|
|
69
64
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -384,13 +379,10 @@ export class TagsClient {
|
|
|
384
379
|
return __awaiter(this, void 0, void 0, function* () {
|
|
385
380
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
386
381
|
const { id, limit, cursor } = request;
|
|
387
|
-
const _queryParams = {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
if (cursor != null) {
|
|
392
|
-
_queryParams.cursor = cursor;
|
|
393
|
-
}
|
|
382
|
+
const _queryParams = {
|
|
383
|
+
limit,
|
|
384
|
+
cursor,
|
|
385
|
+
};
|
|
394
386
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
395
387
|
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);
|
|
396
388
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -12,7 +12,7 @@ export declare namespace ThreadsClient {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class ThreadsClient {
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
|
|
15
|
-
constructor(options
|
|
15
|
+
constructor(options?: ThreadsClient.Options);
|
|
16
16
|
/**
|
|
17
17
|
* Retrieve a paginated list of threads. Use cursor for pagination.
|
|
18
18
|
*
|
|
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
|
|
|
30
30
|
* Operations for threads
|
|
31
31
|
*/
|
|
32
32
|
export class ThreadsClient {
|
|
33
|
-
constructor(options) {
|
|
33
|
+
constructor(options = {}) {
|
|
34
34
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -54,25 +54,14 @@ export class ThreadsClient {
|
|
|
54
54
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
55
55
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
56
56
|
const { limit, cursor, search, tagId, userId, sort } = request;
|
|
57
|
-
const _queryParams = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
_queryParams.search = search;
|
|
66
|
-
}
|
|
67
|
-
if (tagId != null) {
|
|
68
|
-
_queryParams.tagId = tagId;
|
|
69
|
-
}
|
|
70
|
-
if (userId != null) {
|
|
71
|
-
_queryParams.userId = userId;
|
|
72
|
-
}
|
|
73
|
-
if (sort != null) {
|
|
74
|
-
_queryParams.sort = sort;
|
|
75
|
-
}
|
|
57
|
+
const _queryParams = {
|
|
58
|
+
limit,
|
|
59
|
+
cursor,
|
|
60
|
+
search,
|
|
61
|
+
tagId,
|
|
62
|
+
userId,
|
|
63
|
+
sort: sort != null ? sort : undefined,
|
|
64
|
+
};
|
|
76
65
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
77
66
|
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);
|
|
78
67
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -394,25 +383,14 @@ export class ThreadsClient {
|
|
|
394
383
|
return __awaiter(this, void 0, void 0, function* () {
|
|
395
384
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
396
385
|
const { id, limit, cursor, userId, sort, search, type: type_ } = request;
|
|
397
|
-
const _queryParams = {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
_queryParams.userId = userId;
|
|
406
|
-
}
|
|
407
|
-
if (sort != null) {
|
|
408
|
-
_queryParams.sort = sort;
|
|
409
|
-
}
|
|
410
|
-
if (search != null) {
|
|
411
|
-
_queryParams.search = search;
|
|
412
|
-
}
|
|
413
|
-
if (type_ != null) {
|
|
414
|
-
_queryParams.type = type_;
|
|
415
|
-
}
|
|
386
|
+
const _queryParams = {
|
|
387
|
+
limit,
|
|
388
|
+
cursor,
|
|
389
|
+
userId,
|
|
390
|
+
sort: sort != null ? sort : undefined,
|
|
391
|
+
search,
|
|
392
|
+
type: type_ != null ? type_ : undefined,
|
|
393
|
+
};
|
|
416
394
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
417
395
|
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);
|
|
418
396
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -591,16 +569,11 @@ export class ThreadsClient {
|
|
|
591
569
|
return __awaiter(this, void 0, void 0, function* () {
|
|
592
570
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
593
571
|
const { id, limit, cursor, type: type_ } = request;
|
|
594
|
-
const _queryParams = {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
_queryParams.cursor = cursor;
|
|
600
|
-
}
|
|
601
|
-
if (type_ != null) {
|
|
602
|
-
_queryParams.type = type_;
|
|
603
|
-
}
|
|
572
|
+
const _queryParams = {
|
|
573
|
+
limit,
|
|
574
|
+
cursor,
|
|
575
|
+
type: type_ != null ? type_ : undefined,
|
|
576
|
+
};
|
|
604
577
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
605
578
|
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);
|
|
606
579
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -849,13 +822,10 @@ export class ThreadsClient {
|
|
|
849
822
|
return __awaiter(this, void 0, void 0, function* () {
|
|
850
823
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
851
824
|
const { id, limit, cursor } = request;
|
|
852
|
-
const _queryParams = {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
if (cursor != null) {
|
|
857
|
-
_queryParams.cursor = cursor;
|
|
858
|
-
}
|
|
825
|
+
const _queryParams = {
|
|
826
|
+
limit,
|
|
827
|
+
cursor,
|
|
828
|
+
};
|
|
859
829
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
860
830
|
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);
|
|
861
831
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -16,6 +16,12 @@ export interface CreateThreadsRequest {
|
|
|
16
16
|
tags?: string[];
|
|
17
17
|
/** Poll data */
|
|
18
18
|
poll?: CreateThreadsRequest.Poll;
|
|
19
|
+
/** Lock thread on creation */
|
|
20
|
+
locked?: boolean;
|
|
21
|
+
/** Pin thread on creation */
|
|
22
|
+
pinned?: boolean;
|
|
23
|
+
/** Custom extended data */
|
|
24
|
+
extendedData?: Record<string, unknown>;
|
|
19
25
|
}
|
|
20
26
|
export declare namespace CreateThreadsRequest {
|
|
21
27
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { CreatePollThreadsRequest } from "./CreatePollThreadsRequest.mjs";
|
|
2
|
-
export
|
|
2
|
+
export { CreateReactionThreadsRequest } from "./CreateReactionThreadsRequest.mjs";
|
|
3
3
|
export type { CreateThreadsRequest } from "./CreateThreadsRequest.mjs";
|
|
4
4
|
export type { DeletePostThreadsRequest } from "./DeletePostThreadsRequest.mjs";
|
|
5
5
|
export type { DeleteReactionThreadsRequest } from "./DeleteReactionThreadsRequest.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { CreateReactionThreadsRequest } from "./CreateReactionThreadsRequest.mjs";
|
|
@@ -13,21 +13,21 @@ export declare namespace UpdateThreadsResponse {
|
|
|
13
13
|
tags?: string[];
|
|
14
14
|
/** Poll data */
|
|
15
15
|
poll?: Data.Poll;
|
|
16
|
-
id: string;
|
|
17
|
-
/** URL-friendly identifier */
|
|
18
|
-
slug: string | null;
|
|
19
16
|
/** Whether thread is locked */
|
|
20
17
|
locked: boolean | null;
|
|
21
18
|
/** Whether thread is pinned */
|
|
22
19
|
pinned: boolean | null;
|
|
20
|
+
/** Custom metadata */
|
|
21
|
+
extendedData: Record<string, unknown> | null;
|
|
22
|
+
id: string;
|
|
23
|
+
/** URL-friendly identifier */
|
|
24
|
+
slug: string | null;
|
|
23
25
|
/** View count */
|
|
24
26
|
views: number;
|
|
25
27
|
/** Number of posts/replies */
|
|
26
28
|
postsCount: number;
|
|
27
29
|
/** Timestamp of the last post */
|
|
28
30
|
lastPostAt: string | null;
|
|
29
|
-
/** Custom metadata */
|
|
30
|
-
extendedData: Record<string, unknown> | null;
|
|
31
31
|
createdAt: string;
|
|
32
32
|
updatedAt: string;
|
|
33
33
|
}
|
|
@@ -12,7 +12,7 @@ export declare namespace UsersClient {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class UsersClient {
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
|
|
15
|
-
constructor(options
|
|
15
|
+
constructor(options?: UsersClient.Options);
|
|
16
16
|
/**
|
|
17
17
|
* Retrieve a paginated list of users. Use cursor for pagination.
|
|
18
18
|
*
|
|
@@ -29,6 +29,25 @@ export declare class UsersClient {
|
|
|
29
29
|
*/
|
|
30
30
|
list(request?: Forum.ListUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserListResponse>;
|
|
31
31
|
private __list;
|
|
32
|
+
/**
|
|
33
|
+
* Create a new user.
|
|
34
|
+
*
|
|
35
|
+
* @param {Forum.CreateUsersRequest} request
|
|
36
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @throws {@link Forum.BadRequestError}
|
|
39
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
40
|
+
* @throws {@link Forum.PaymentRequiredError}
|
|
41
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
42
|
+
* @throws {@link Forum.InternalServerError}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await client.users.create({
|
|
46
|
+
* username: "username"
|
|
47
|
+
* })
|
|
48
|
+
*/
|
|
49
|
+
create(request: Forum.CreateUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserResponse>;
|
|
50
|
+
private __create;
|
|
32
51
|
/**
|
|
33
52
|
* Retrieve a user by ID or slug (if supported).
|
|
34
53
|
*
|
|
@@ -30,7 +30,7 @@ import * as Forum from "../../../index.mjs";
|
|
|
30
30
|
* Operations for users
|
|
31
31
|
*/
|
|
32
32
|
export class UsersClient {
|
|
33
|
-
constructor(options) {
|
|
33
|
+
constructor(options = {}) {
|
|
34
34
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -54,19 +54,12 @@ export class UsersClient {
|
|
|
54
54
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
55
55
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
56
56
|
const { limit, cursor, search, sort } = request;
|
|
57
|
-
const _queryParams = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
if (search != null) {
|
|
65
|
-
_queryParams.search = search;
|
|
66
|
-
}
|
|
67
|
-
if (sort != null) {
|
|
68
|
-
_queryParams.sort = sort;
|
|
69
|
-
}
|
|
57
|
+
const _queryParams = {
|
|
58
|
+
limit,
|
|
59
|
+
cursor,
|
|
60
|
+
search,
|
|
61
|
+
sort: sort != null ? sort : undefined,
|
|
62
|
+
};
|
|
70
63
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
71
64
|
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);
|
|
72
65
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -104,6 +97,71 @@ export class UsersClient {
|
|
|
104
97
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/users");
|
|
105
98
|
});
|
|
106
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Create a new user.
|
|
102
|
+
*
|
|
103
|
+
* @param {Forum.CreateUsersRequest} request
|
|
104
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
105
|
+
*
|
|
106
|
+
* @throws {@link Forum.BadRequestError}
|
|
107
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
108
|
+
* @throws {@link Forum.PaymentRequiredError}
|
|
109
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
110
|
+
* @throws {@link Forum.InternalServerError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.users.create({
|
|
114
|
+
* username: "username"
|
|
115
|
+
* })
|
|
116
|
+
*/
|
|
117
|
+
create(request, requestOptions) {
|
|
118
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
119
|
+
}
|
|
120
|
+
__create(request, requestOptions) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
123
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
124
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
125
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
126
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "users"),
|
|
127
|
+
method: "POST",
|
|
128
|
+
headers: _headers,
|
|
129
|
+
contentType: "application/json",
|
|
130
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
131
|
+
requestType: "json",
|
|
132
|
+
body: request,
|
|
133
|
+
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,
|
|
134
|
+
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,
|
|
135
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
136
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
137
|
+
logging: this._options.logging,
|
|
138
|
+
});
|
|
139
|
+
if (_response.ok) {
|
|
140
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
141
|
+
}
|
|
142
|
+
if (_response.error.reason === "status-code") {
|
|
143
|
+
switch (_response.error.statusCode) {
|
|
144
|
+
case 400:
|
|
145
|
+
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
146
|
+
case 401:
|
|
147
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
148
|
+
case 402:
|
|
149
|
+
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
150
|
+
case 429:
|
|
151
|
+
throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
152
|
+
case 500:
|
|
153
|
+
throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
|
|
154
|
+
default:
|
|
155
|
+
throw new errors.ForumError({
|
|
156
|
+
statusCode: _response.error.statusCode,
|
|
157
|
+
body: _response.error.body,
|
|
158
|
+
rawResponse: _response.rawResponse,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/users");
|
|
163
|
+
});
|
|
164
|
+
}
|
|
107
165
|
/**
|
|
108
166
|
* Retrieve a user by ID or slug (if supported).
|
|
109
167
|
*
|
|
@@ -322,13 +380,10 @@ export class UsersClient {
|
|
|
322
380
|
return __awaiter(this, void 0, void 0, function* () {
|
|
323
381
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
324
382
|
const { id, limit, cursor } = request;
|
|
325
|
-
const _queryParams = {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
if (cursor != null) {
|
|
330
|
-
_queryParams.cursor = cursor;
|
|
331
|
-
}
|
|
383
|
+
const _queryParams = {
|
|
384
|
+
limit,
|
|
385
|
+
cursor,
|
|
386
|
+
};
|
|
332
387
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
333
388
|
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);
|
|
334
389
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -507,13 +562,10 @@ export class UsersClient {
|
|
|
507
562
|
return __awaiter(this, void 0, void 0, function* () {
|
|
508
563
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
509
564
|
const { id, limit, cursor } = request;
|
|
510
|
-
const _queryParams = {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
if (cursor != null) {
|
|
515
|
-
_queryParams.cursor = cursor;
|
|
516
|
-
}
|
|
565
|
+
const _queryParams = {
|
|
566
|
+
limit,
|
|
567
|
+
cursor,
|
|
568
|
+
};
|
|
517
569
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
518
570
|
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);
|
|
519
571
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|