@foru-ms/sdk 2.0.5 → 2.0.7
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 +1 -1
- package/dist/cjs/Client.js +1 -1
- package/dist/cjs/api/resources/auth/client/Client.d.ts +13 -1
- package/dist/cjs/api/resources/auth/client/Client.js +29 -5
- package/dist/cjs/api/resources/auth/types/GetAuthMeResponse.d.ts +7 -2
- package/dist/cjs/api/resources/auth/types/PostAuthForgotPasswordResponse.d.ts +7 -2
- package/dist/cjs/api/resources/auth/types/PostAuthLoginResponse.d.ts +20 -1
- package/dist/cjs/api/resources/auth/types/PostAuthRegisterResponse.d.ts +20 -1
- package/dist/cjs/api/resources/auth/types/PostAuthResetPasswordResponse.d.ts +6 -1
- package/dist/cjs/api/resources/integrations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/integrations/client/Client.js +1 -1
- package/dist/cjs/api/resources/integrations/types/GetIntegrationsResponse.d.ts +35 -32
- package/dist/cjs/api/resources/integrations/types/GetIntegrationsResponse.js +15 -12
- package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/client/Client.js +1 -1
- package/dist/cjs/api/resources/notifications/types/GetNotificationsResponse.d.ts +35 -32
- package/dist/cjs/api/resources/posts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/posts/client/Client.js +1 -1
- package/dist/cjs/api/resources/posts/types/GetPostsResponse.d.ts +28 -25
- package/dist/cjs/api/resources/privateMessages/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/privateMessages/client/Client.js +1 -1
- package/dist/cjs/api/resources/privateMessages/types/GetPrivateMessagesResponse.d.ts +31 -28
- package/dist/cjs/api/resources/reports/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/reports/client/Client.js +1 -1
- package/dist/cjs/api/resources/reports/types/GetReportsResponse.d.ts +33 -30
- package/dist/cjs/api/resources/roles/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/roles/client/Client.js +1 -1
- package/dist/cjs/api/resources/roles/types/GetRolesResponse.d.ts +27 -24
- package/dist/cjs/api/resources/ssOs/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/ssOs/client/Client.js +1 -1
- package/dist/cjs/api/resources/ssOs/types/GetSsoResponse.d.ts +32 -29
- package/dist/cjs/api/resources/ssOs/types/GetSsoResponse.js +12 -9
- package/dist/cjs/api/resources/tags/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tags/client/Client.js +1 -1
- package/dist/cjs/api/resources/tags/types/GetTagsResponse.d.ts +27 -24
- package/dist/cjs/api/resources/threads/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/threads/client/Client.js +1 -1
- package/dist/cjs/api/resources/threads/types/GetThreadsResponse.d.ts +55 -52
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/users/client/Client.js +1 -1
- package/dist/cjs/api/resources/users/types/GetUsersResponse.d.ts +46 -43
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +1 -1
- package/dist/cjs/api/resources/webhooks/types/GetWebhooksResponse.d.ts +29 -26
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +1 -1
- 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 +1 -1
- package/dist/esm/Client.mjs +1 -1
- package/dist/esm/api/resources/auth/client/Client.d.mts +13 -1
- package/dist/esm/api/resources/auth/client/Client.mjs +29 -5
- package/dist/esm/api/resources/auth/types/GetAuthMeResponse.d.mts +7 -2
- package/dist/esm/api/resources/auth/types/PostAuthForgotPasswordResponse.d.mts +7 -2
- package/dist/esm/api/resources/auth/types/PostAuthLoginResponse.d.mts +20 -1
- package/dist/esm/api/resources/auth/types/PostAuthRegisterResponse.d.mts +20 -1
- package/dist/esm/api/resources/auth/types/PostAuthResetPasswordResponse.d.mts +6 -1
- package/dist/esm/api/resources/integrations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/integrations/client/Client.mjs +1 -1
- package/dist/esm/api/resources/integrations/types/GetIntegrationsResponse.d.mts +35 -32
- package/dist/esm/api/resources/integrations/types/GetIntegrationsResponse.mjs +15 -12
- package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/notifications/client/Client.mjs +1 -1
- package/dist/esm/api/resources/notifications/types/GetNotificationsResponse.d.mts +35 -32
- package/dist/esm/api/resources/posts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/posts/client/Client.mjs +1 -1
- package/dist/esm/api/resources/posts/types/GetPostsResponse.d.mts +28 -25
- package/dist/esm/api/resources/privateMessages/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/privateMessages/client/Client.mjs +1 -1
- package/dist/esm/api/resources/privateMessages/types/GetPrivateMessagesResponse.d.mts +31 -28
- package/dist/esm/api/resources/reports/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/reports/client/Client.mjs +1 -1
- package/dist/esm/api/resources/reports/types/GetReportsResponse.d.mts +33 -30
- package/dist/esm/api/resources/roles/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/roles/client/Client.mjs +1 -1
- package/dist/esm/api/resources/roles/types/GetRolesResponse.d.mts +27 -24
- package/dist/esm/api/resources/ssOs/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/ssOs/client/Client.mjs +1 -1
- package/dist/esm/api/resources/ssOs/types/GetSsoResponse.d.mts +32 -29
- package/dist/esm/api/resources/ssOs/types/GetSsoResponse.mjs +12 -9
- package/dist/esm/api/resources/tags/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tags/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tags/types/GetTagsResponse.d.mts +27 -24
- package/dist/esm/api/resources/threads/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/threads/client/Client.mjs +1 -1
- package/dist/esm/api/resources/threads/types/GetThreadsResponse.d.mts +55 -52
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/users/client/Client.mjs +1 -1
- package/dist/esm/api/resources/users/types/GetUsersResponse.d.mts +46 -43
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +1 -1
- package/dist/esm/api/resources/webhooks/types/GetWebhooksResponse.d.mts +29 -26
- package/dist/esm/auth/HeaderAuthProvider.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -4
- package/reference.md +56 -0
|
@@ -1,52 +1,55 @@
|
|
|
1
1
|
export interface GetUsersResponse {
|
|
2
|
-
data: GetUsersResponse.Data
|
|
3
|
-
meta: GetUsersResponse.Meta;
|
|
2
|
+
data: GetUsersResponse.Data;
|
|
4
3
|
}
|
|
5
4
|
export declare namespace GetUsersResponse {
|
|
6
|
-
|
|
5
|
+
interface Data {
|
|
6
|
+
items: Data.Items.Item[];
|
|
7
|
+
/** Cursor for next page */
|
|
8
|
+
nextCursor?: string;
|
|
9
|
+
/** Total count of items */
|
|
10
|
+
count: number;
|
|
11
|
+
}
|
|
7
12
|
namespace Data {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
namespace
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
13
|
+
type Items = Items.Item[];
|
|
14
|
+
namespace Items {
|
|
15
|
+
interface Item {
|
|
16
|
+
id: string;
|
|
17
|
+
username: string;
|
|
18
|
+
/** Display name */
|
|
19
|
+
displayName: string | null;
|
|
20
|
+
/** User bio */
|
|
21
|
+
bio: string | null;
|
|
22
|
+
/** Forum signature */
|
|
23
|
+
signature: string | null;
|
|
24
|
+
/** User website URL */
|
|
25
|
+
url: string | null;
|
|
26
|
+
/** Total posts by user */
|
|
27
|
+
postsCount?: number;
|
|
28
|
+
/** Total threads by user */
|
|
29
|
+
threadsCount?: number;
|
|
30
|
+
/** Online status */
|
|
31
|
+
isOnline: boolean | null;
|
|
32
|
+
/** Last activity timestamp */
|
|
33
|
+
lastSeenAt: string | null;
|
|
34
|
+
/** User roles */
|
|
35
|
+
roles?: Item.Roles.Item[];
|
|
36
|
+
/** Custom user data */
|
|
37
|
+
extendedData: Record<string, unknown> | null;
|
|
38
|
+
/** Account creation timestamp */
|
|
39
|
+
createdAt: string;
|
|
40
|
+
/** Profile last update timestamp */
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
}
|
|
43
|
+
namespace Item {
|
|
44
|
+
type Roles = Roles.Item[];
|
|
45
|
+
namespace Roles {
|
|
46
|
+
interface Item {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
slug: string | null;
|
|
50
|
+
}
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
|
-
interface Meta {
|
|
48
|
-
total: number;
|
|
49
|
-
page: number;
|
|
50
|
-
limit: number;
|
|
51
|
-
}
|
|
52
55
|
}
|
|
@@ -9,7 +9,7 @@ export declare namespace WebhooksClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class WebhooksClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: WebhooksClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetWebhooksRequest} request
|
|
15
15
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -52,7 +52,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
52
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
53
|
const Forum = __importStar(require("../../../index.js"));
|
|
54
54
|
class WebhooksClient {
|
|
55
|
-
constructor(options
|
|
55
|
+
constructor(options) {
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
export interface GetWebhooksResponse {
|
|
2
|
-
data: GetWebhooksResponse.Data
|
|
3
|
-
meta: GetWebhooksResponse.Meta;
|
|
2
|
+
data: GetWebhooksResponse.Data;
|
|
4
3
|
}
|
|
5
4
|
export declare namespace GetWebhooksResponse {
|
|
6
|
-
|
|
5
|
+
interface Data {
|
|
6
|
+
items: Data.Items.Item[];
|
|
7
|
+
/** Cursor for next page */
|
|
8
|
+
nextCursor?: string;
|
|
9
|
+
/** Total count of items */
|
|
10
|
+
count: number;
|
|
11
|
+
}
|
|
7
12
|
namespace Data {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
type Items = Items.Item[];
|
|
14
|
+
namespace Items {
|
|
15
|
+
interface Item {
|
|
16
|
+
id: string;
|
|
17
|
+
/** Webhook name */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Webhook endpoint URL */
|
|
20
|
+
url: string;
|
|
21
|
+
/** Event types to trigger on */
|
|
22
|
+
events: string[];
|
|
23
|
+
/** Whether webhook is active */
|
|
24
|
+
active: boolean;
|
|
25
|
+
/** Last trigger timestamp */
|
|
26
|
+
lastTriggered: string | null;
|
|
27
|
+
/** Consecutive failure count */
|
|
28
|
+
failureCount: number;
|
|
29
|
+
/** Webhook creation timestamp */
|
|
30
|
+
createdAt: string;
|
|
31
|
+
/** Webhook last update timestamp */
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
35
|
}
|
|
28
|
-
interface Meta {
|
|
29
|
-
total: number;
|
|
30
|
-
page: number;
|
|
31
|
-
limit: number;
|
|
32
|
-
}
|
|
33
36
|
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.7";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@foru-ms/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "2.0.
|
|
10
|
-
"User-Agent": "@foru-ms/sdk/2.0.
|
|
9
|
+
"X-Fern-SDK-Version": "2.0.7",
|
|
10
|
+
"User-Agent": "@foru-ms/sdk/2.0.7",
|
|
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);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class ForumClient {
|
|
|
31
31
|
protected _webhooks: WebhooksClient | undefined;
|
|
32
32
|
protected _integrations: IntegrationsClient | undefined;
|
|
33
33
|
protected _ssOs: SsOsClient | undefined;
|
|
34
|
-
constructor(options
|
|
34
|
+
constructor(options: ForumClient.Options);
|
|
35
35
|
get auth(): AuthClient;
|
|
36
36
|
get tags(): TagsClient;
|
|
37
37
|
get threads(): ThreadsClient;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { UsersClient } from "./api/resources/users/client/Client.mjs";
|
|
|
13
13
|
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
14
14
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
15
15
|
export class ForumClient {
|
|
16
|
-
constructor(options
|
|
16
|
+
constructor(options) {
|
|
17
17
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
18
18
|
}
|
|
19
19
|
get auth() {
|
|
@@ -9,12 +9,15 @@ export declare namespace AuthClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class AuthClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: AuthClient.Options);
|
|
13
13
|
/**
|
|
14
|
+
* Register a new user in your forum instance. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
15
|
+
*
|
|
14
16
|
* @param {Forum.PostAuthRegisterRequest} request
|
|
15
17
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
18
|
*
|
|
17
19
|
* @throws {@link Forum.BadRequestError}
|
|
20
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
18
21
|
* @throws {@link Forum.PaymentRequiredError}
|
|
19
22
|
* @throws {@link Forum.TooManyRequestsError}
|
|
20
23
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -29,10 +32,13 @@ export declare class AuthClient {
|
|
|
29
32
|
register(request: Forum.PostAuthRegisterRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Forum.PostAuthRegisterResponse>;
|
|
30
33
|
private __register;
|
|
31
34
|
/**
|
|
35
|
+
* Authenticate an existing user. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
36
|
+
*
|
|
32
37
|
* @param {Forum.PostAuthLoginRequest} request
|
|
33
38
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
39
|
*
|
|
35
40
|
* @throws {@link Forum.BadRequestError}
|
|
41
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
36
42
|
* @throws {@link Forum.PaymentRequiredError}
|
|
37
43
|
* @throws {@link Forum.TooManyRequestsError}
|
|
38
44
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -59,10 +65,13 @@ export declare class AuthClient {
|
|
|
59
65
|
getCurrentUser(requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Forum.GetAuthMeResponse>;
|
|
60
66
|
private __getCurrentUser;
|
|
61
67
|
/**
|
|
68
|
+
* Request a password reset email. Requires API key for instance identification.
|
|
69
|
+
*
|
|
62
70
|
* @param {Forum.PostAuthForgotPasswordRequest} request
|
|
63
71
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
72
|
*
|
|
65
73
|
* @throws {@link Forum.BadRequestError}
|
|
74
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
66
75
|
* @throws {@link Forum.PaymentRequiredError}
|
|
67
76
|
* @throws {@link Forum.TooManyRequestsError}
|
|
68
77
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -75,10 +84,13 @@ export declare class AuthClient {
|
|
|
75
84
|
requestPasswordReset(request: Forum.PostAuthForgotPasswordRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Forum.PostAuthForgotPasswordResponse>;
|
|
76
85
|
private __requestPasswordReset;
|
|
77
86
|
/**
|
|
87
|
+
* Reset password using a reset token. Requires API key for instance identification.
|
|
88
|
+
*
|
|
78
89
|
* @param {Forum.PostAuthResetPasswordRequest} request
|
|
79
90
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
91
|
*
|
|
81
92
|
* @throws {@link Forum.BadRequestError}
|
|
93
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
82
94
|
* @throws {@link Forum.PaymentRequiredError}
|
|
83
95
|
* @throws {@link Forum.TooManyRequestsError}
|
|
84
96
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -16,14 +16,17 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as Forum from "../../../index.mjs";
|
|
18
18
|
export class AuthClient {
|
|
19
|
-
constructor(options
|
|
19
|
+
constructor(options) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
+
* Register a new user in your forum instance. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
24
|
+
*
|
|
23
25
|
* @param {Forum.PostAuthRegisterRequest} request
|
|
24
26
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
27
|
*
|
|
26
28
|
* @throws {@link Forum.BadRequestError}
|
|
29
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
27
30
|
* @throws {@link Forum.PaymentRequiredError}
|
|
28
31
|
* @throws {@link Forum.TooManyRequestsError}
|
|
29
32
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -41,7 +44,8 @@ export class AuthClient {
|
|
|
41
44
|
__register(request, requestOptions) {
|
|
42
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
46
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
44
|
-
const
|
|
47
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
48
|
+
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);
|
|
45
49
|
const _response = yield core.fetcher({
|
|
46
50
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ForumEnvironment.Production, "auth/register"),
|
|
47
51
|
method: "POST",
|
|
@@ -63,6 +67,8 @@ export class AuthClient {
|
|
|
63
67
|
switch (_response.error.statusCode) {
|
|
64
68
|
case 400:
|
|
65
69
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
70
|
+
case 401:
|
|
71
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
66
72
|
case 402:
|
|
67
73
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
68
74
|
case 429:
|
|
@@ -81,10 +87,13 @@ export class AuthClient {
|
|
|
81
87
|
});
|
|
82
88
|
}
|
|
83
89
|
/**
|
|
90
|
+
* Authenticate an existing user. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
91
|
+
*
|
|
84
92
|
* @param {Forum.PostAuthLoginRequest} request
|
|
85
93
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
94
|
*
|
|
87
95
|
* @throws {@link Forum.BadRequestError}
|
|
96
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
88
97
|
* @throws {@link Forum.PaymentRequiredError}
|
|
89
98
|
* @throws {@link Forum.TooManyRequestsError}
|
|
90
99
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -101,7 +110,8 @@ export class AuthClient {
|
|
|
101
110
|
__login(request, requestOptions) {
|
|
102
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
112
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
104
|
-
const
|
|
113
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
114
|
+
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);
|
|
105
115
|
const _response = yield core.fetcher({
|
|
106
116
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ForumEnvironment.Production, "auth/login"),
|
|
107
117
|
method: "POST",
|
|
@@ -123,6 +133,8 @@ export class AuthClient {
|
|
|
123
133
|
switch (_response.error.statusCode) {
|
|
124
134
|
case 400:
|
|
125
135
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
136
|
+
case 401:
|
|
137
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
126
138
|
case 402:
|
|
127
139
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
128
140
|
case 429:
|
|
@@ -195,10 +207,13 @@ export class AuthClient {
|
|
|
195
207
|
});
|
|
196
208
|
}
|
|
197
209
|
/**
|
|
210
|
+
* Request a password reset email. Requires API key for instance identification.
|
|
211
|
+
*
|
|
198
212
|
* @param {Forum.PostAuthForgotPasswordRequest} request
|
|
199
213
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
200
214
|
*
|
|
201
215
|
* @throws {@link Forum.BadRequestError}
|
|
216
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
202
217
|
* @throws {@link Forum.PaymentRequiredError}
|
|
203
218
|
* @throws {@link Forum.TooManyRequestsError}
|
|
204
219
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -214,7 +229,8 @@ export class AuthClient {
|
|
|
214
229
|
__requestPasswordReset(request, requestOptions) {
|
|
215
230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
216
231
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
217
|
-
const
|
|
232
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
233
|
+
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);
|
|
218
234
|
const _response = yield core.fetcher({
|
|
219
235
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ForumEnvironment.Production, "auth/forgot-password"),
|
|
220
236
|
method: "POST",
|
|
@@ -236,6 +252,8 @@ export class AuthClient {
|
|
|
236
252
|
switch (_response.error.statusCode) {
|
|
237
253
|
case 400:
|
|
238
254
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
255
|
+
case 401:
|
|
256
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
239
257
|
case 402:
|
|
240
258
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
241
259
|
case 429:
|
|
@@ -254,10 +272,13 @@ export class AuthClient {
|
|
|
254
272
|
});
|
|
255
273
|
}
|
|
256
274
|
/**
|
|
275
|
+
* Reset password using a reset token. Requires API key for instance identification.
|
|
276
|
+
*
|
|
257
277
|
* @param {Forum.PostAuthResetPasswordRequest} request
|
|
258
278
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
259
279
|
*
|
|
260
280
|
* @throws {@link Forum.BadRequestError}
|
|
281
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
261
282
|
* @throws {@link Forum.PaymentRequiredError}
|
|
262
283
|
* @throws {@link Forum.TooManyRequestsError}
|
|
263
284
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -273,7 +294,8 @@ export class AuthClient {
|
|
|
273
294
|
__resetPassword(request, requestOptions) {
|
|
274
295
|
return __awaiter(this, void 0, void 0, function* () {
|
|
275
296
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
276
|
-
const
|
|
297
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
298
|
+
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);
|
|
277
299
|
const _response = yield core.fetcher({
|
|
278
300
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ForumEnvironment.Production, "auth/reset-password"),
|
|
279
301
|
method: "POST",
|
|
@@ -295,6 +317,8 @@ export class AuthClient {
|
|
|
295
317
|
switch (_response.error.statusCode) {
|
|
296
318
|
case 400:
|
|
297
319
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
320
|
+
case 401:
|
|
321
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
298
322
|
case 402:
|
|
299
323
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
300
324
|
case 429:
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export interface PostAuthForgotPasswordResponse {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
data: PostAuthForgotPasswordResponse.Data;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace PostAuthForgotPasswordResponse {
|
|
5
|
+
interface Data {
|
|
6
|
+
message: string;
|
|
7
|
+
resetToken?: string;
|
|
8
|
+
}
|
|
4
9
|
}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
export interface PostAuthLoginResponse {
|
|
2
|
-
|
|
2
|
+
data: PostAuthLoginResponse.Data;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace PostAuthLoginResponse {
|
|
5
|
+
interface Data {
|
|
6
|
+
/** JWT token for authenticated requests */
|
|
7
|
+
token: string;
|
|
8
|
+
/** Authenticated user profile */
|
|
9
|
+
user: Data.User;
|
|
10
|
+
}
|
|
11
|
+
namespace Data {
|
|
12
|
+
/**
|
|
13
|
+
* Authenticated user profile
|
|
14
|
+
*/
|
|
15
|
+
interface User {
|
|
16
|
+
id: string;
|
|
17
|
+
username: string;
|
|
18
|
+
email?: string;
|
|
19
|
+
displayName: string | null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
3
22
|
}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
export interface PostAuthRegisterResponse {
|
|
2
|
-
|
|
2
|
+
data: PostAuthRegisterResponse.Data;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace PostAuthRegisterResponse {
|
|
5
|
+
interface Data {
|
|
6
|
+
/** JWT token for authenticated requests */
|
|
7
|
+
token: string;
|
|
8
|
+
/** Registered user profile */
|
|
9
|
+
user: Data.User;
|
|
10
|
+
}
|
|
11
|
+
namespace Data {
|
|
12
|
+
/**
|
|
13
|
+
* Registered user profile
|
|
14
|
+
*/
|
|
15
|
+
interface User {
|
|
16
|
+
id: string;
|
|
17
|
+
username: string;
|
|
18
|
+
email?: string;
|
|
19
|
+
displayName: string | null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
3
22
|
}
|
|
@@ -9,7 +9,7 @@ export declare namespace IntegrationsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class IntegrationsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<IntegrationsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: IntegrationsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetIntegrationsRequest} request
|
|
15
15
|
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -27,7 +27,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
|
|
|
27
27
|
import * as errors from "../../../../errors/index.mjs";
|
|
28
28
|
import * as Forum from "../../../index.mjs";
|
|
29
29
|
export class IntegrationsClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
export interface GetIntegrationsResponse {
|
|
2
|
-
data: GetIntegrationsResponse.Data
|
|
3
|
-
meta: GetIntegrationsResponse.Meta;
|
|
2
|
+
data: GetIntegrationsResponse.Data;
|
|
4
3
|
}
|
|
5
4
|
export declare namespace GetIntegrationsResponse {
|
|
6
|
-
|
|
5
|
+
interface Data {
|
|
6
|
+
items: Data.Items.Item[];
|
|
7
|
+
/** Cursor for next page */
|
|
8
|
+
nextCursor?: string;
|
|
9
|
+
/** Total count of items */
|
|
10
|
+
count: number;
|
|
11
|
+
}
|
|
7
12
|
namespace Data {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
type Items = Items.Item[];
|
|
14
|
+
namespace Items {
|
|
15
|
+
interface Item {
|
|
16
|
+
id: string;
|
|
17
|
+
/** Integration type */
|
|
18
|
+
type: Item.Type;
|
|
19
|
+
/** Integration name */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Whether integration is active */
|
|
22
|
+
active: boolean;
|
|
23
|
+
/** Integration creation timestamp */
|
|
24
|
+
createdAt: string;
|
|
25
|
+
/** Integration last update timestamp */
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
namespace Item {
|
|
29
|
+
/** Integration type */
|
|
30
|
+
const Type: {
|
|
31
|
+
readonly Slack: "SLACK";
|
|
32
|
+
readonly Discord: "DISCORD";
|
|
33
|
+
readonly Salesforce: "SALESFORCE";
|
|
34
|
+
readonly Hubspot: "HUBSPOT";
|
|
35
|
+
readonly Okta: "OKTA";
|
|
36
|
+
readonly Auth0: "AUTH0";
|
|
37
|
+
};
|
|
38
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
|
-
interface Meta {
|
|
35
|
-
total: number;
|
|
36
|
-
page: number;
|
|
37
|
-
limit: number;
|
|
38
|
-
}
|
|
39
42
|
}
|
|
@@ -3,17 +3,20 @@ export var GetIntegrationsResponse;
|
|
|
3
3
|
(function (GetIntegrationsResponse) {
|
|
4
4
|
let Data;
|
|
5
5
|
(function (Data) {
|
|
6
|
-
let
|
|
7
|
-
(function (
|
|
8
|
-
|
|
9
|
-
Item
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
let Items;
|
|
7
|
+
(function (Items) {
|
|
8
|
+
let Item;
|
|
9
|
+
(function (Item) {
|
|
10
|
+
/** Integration type */
|
|
11
|
+
Item.Type = {
|
|
12
|
+
Slack: "SLACK",
|
|
13
|
+
Discord: "DISCORD",
|
|
14
|
+
Salesforce: "SALESFORCE",
|
|
15
|
+
Hubspot: "HUBSPOT",
|
|
16
|
+
Okta: "OKTA",
|
|
17
|
+
Auth0: "AUTH0",
|
|
18
|
+
};
|
|
19
|
+
})(Item = Items.Item || (Items.Item = {}));
|
|
20
|
+
})(Items = Data.Items || (Data.Items = {}));
|
|
18
21
|
})(Data = GetIntegrationsResponse.Data || (GetIntegrationsResponse.Data = {}));
|
|
19
22
|
})(GetIntegrationsResponse || (GetIntegrationsResponse = {}));
|