@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
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@foru-ms/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "2.0.
|
|
47
|
-
"User-Agent": "@foru-ms/sdk/2.0.
|
|
46
|
+
"X-Fern-SDK-Version": "2.0.7",
|
|
47
|
+
"User-Agent": "@foru-ms/sdk/2.0.7",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
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/cjs/Client.js
CHANGED
|
@@ -16,7 +16,7 @@ const Client_js_11 = require("./api/resources/users/client/Client.js");
|
|
|
16
16
|
const Client_js_12 = require("./api/resources/webhooks/client/Client.js");
|
|
17
17
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
18
18
|
class ForumClient {
|
|
19
|
-
constructor(options
|
|
19
|
+
constructor(options) {
|
|
20
20
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
21
21
|
}
|
|
22
22
|
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}
|
|
@@ -52,14 +52,17 @@ 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 AuthClient {
|
|
55
|
-
constructor(options
|
|
55
|
+
constructor(options) {
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
+
* Register a new user in your forum instance. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
60
|
+
*
|
|
59
61
|
* @param {Forum.PostAuthRegisterRequest} request
|
|
60
62
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
63
|
*
|
|
62
64
|
* @throws {@link Forum.BadRequestError}
|
|
65
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
63
66
|
* @throws {@link Forum.PaymentRequiredError}
|
|
64
67
|
* @throws {@link Forum.TooManyRequestsError}
|
|
65
68
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -77,7 +80,8 @@ class AuthClient {
|
|
|
77
80
|
__register(request, requestOptions) {
|
|
78
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
82
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
80
|
-
const
|
|
83
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
84
|
+
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);
|
|
81
85
|
const _response = yield core.fetcher({
|
|
82
86
|
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"),
|
|
83
87
|
method: "POST",
|
|
@@ -99,6 +103,8 @@ class AuthClient {
|
|
|
99
103
|
switch (_response.error.statusCode) {
|
|
100
104
|
case 400:
|
|
101
105
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
106
|
+
case 401:
|
|
107
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
102
108
|
case 402:
|
|
103
109
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
104
110
|
case 429:
|
|
@@ -117,10 +123,13 @@ class AuthClient {
|
|
|
117
123
|
});
|
|
118
124
|
}
|
|
119
125
|
/**
|
|
126
|
+
* Authenticate an existing user. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
127
|
+
*
|
|
120
128
|
* @param {Forum.PostAuthLoginRequest} request
|
|
121
129
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
122
130
|
*
|
|
123
131
|
* @throws {@link Forum.BadRequestError}
|
|
132
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
124
133
|
* @throws {@link Forum.PaymentRequiredError}
|
|
125
134
|
* @throws {@link Forum.TooManyRequestsError}
|
|
126
135
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -137,7 +146,8 @@ class AuthClient {
|
|
|
137
146
|
__login(request, requestOptions) {
|
|
138
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
148
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
140
|
-
const
|
|
149
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
150
|
+
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);
|
|
141
151
|
const _response = yield core.fetcher({
|
|
142
152
|
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"),
|
|
143
153
|
method: "POST",
|
|
@@ -159,6 +169,8 @@ class AuthClient {
|
|
|
159
169
|
switch (_response.error.statusCode) {
|
|
160
170
|
case 400:
|
|
161
171
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
172
|
+
case 401:
|
|
173
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
162
174
|
case 402:
|
|
163
175
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
164
176
|
case 429:
|
|
@@ -231,10 +243,13 @@ class AuthClient {
|
|
|
231
243
|
});
|
|
232
244
|
}
|
|
233
245
|
/**
|
|
246
|
+
* Request a password reset email. Requires API key for instance identification.
|
|
247
|
+
*
|
|
234
248
|
* @param {Forum.PostAuthForgotPasswordRequest} request
|
|
235
249
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
236
250
|
*
|
|
237
251
|
* @throws {@link Forum.BadRequestError}
|
|
252
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
238
253
|
* @throws {@link Forum.PaymentRequiredError}
|
|
239
254
|
* @throws {@link Forum.TooManyRequestsError}
|
|
240
255
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -250,7 +265,8 @@ class AuthClient {
|
|
|
250
265
|
__requestPasswordReset(request, requestOptions) {
|
|
251
266
|
return __awaiter(this, void 0, void 0, function* () {
|
|
252
267
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
253
|
-
const
|
|
268
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
269
|
+
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);
|
|
254
270
|
const _response = yield core.fetcher({
|
|
255
271
|
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"),
|
|
256
272
|
method: "POST",
|
|
@@ -272,6 +288,8 @@ class AuthClient {
|
|
|
272
288
|
switch (_response.error.statusCode) {
|
|
273
289
|
case 400:
|
|
274
290
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
291
|
+
case 401:
|
|
292
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
275
293
|
case 402:
|
|
276
294
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
277
295
|
case 429:
|
|
@@ -290,10 +308,13 @@ class AuthClient {
|
|
|
290
308
|
});
|
|
291
309
|
}
|
|
292
310
|
/**
|
|
311
|
+
* Reset password using a reset token. Requires API key for instance identification.
|
|
312
|
+
*
|
|
293
313
|
* @param {Forum.PostAuthResetPasswordRequest} request
|
|
294
314
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
295
315
|
*
|
|
296
316
|
* @throws {@link Forum.BadRequestError}
|
|
317
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
297
318
|
* @throws {@link Forum.PaymentRequiredError}
|
|
298
319
|
* @throws {@link Forum.TooManyRequestsError}
|
|
299
320
|
* @throws {@link Forum.InternalServerError}
|
|
@@ -309,7 +330,8 @@ class AuthClient {
|
|
|
309
330
|
__resetPassword(request, requestOptions) {
|
|
310
331
|
return __awaiter(this, void 0, void 0, function* () {
|
|
311
332
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
312
|
-
const
|
|
333
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
334
|
+
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);
|
|
313
335
|
const _response = yield core.fetcher({
|
|
314
336
|
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"),
|
|
315
337
|
method: "POST",
|
|
@@ -331,6 +353,8 @@ class AuthClient {
|
|
|
331
353
|
switch (_response.error.statusCode) {
|
|
332
354
|
case 400:
|
|
333
355
|
throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
|
|
356
|
+
case 401:
|
|
357
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
334
358
|
case 402:
|
|
335
359
|
throw new Forum.PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
336
360
|
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.
|
|
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
63
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
64
|
const Forum = __importStar(require("../../../index.js"));
|
|
65
65
|
class IntegrationsClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -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
|
}
|
|
@@ -6,17 +6,20 @@ var GetIntegrationsResponse;
|
|
|
6
6
|
(function (GetIntegrationsResponse) {
|
|
7
7
|
let Data;
|
|
8
8
|
(function (Data) {
|
|
9
|
-
let
|
|
10
|
-
(function (
|
|
11
|
-
|
|
12
|
-
Item
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
let Items;
|
|
10
|
+
(function (Items) {
|
|
11
|
+
let Item;
|
|
12
|
+
(function (Item) {
|
|
13
|
+
/** Integration type */
|
|
14
|
+
Item.Type = {
|
|
15
|
+
Slack: "SLACK",
|
|
16
|
+
Discord: "DISCORD",
|
|
17
|
+
Salesforce: "SALESFORCE",
|
|
18
|
+
Hubspot: "HUBSPOT",
|
|
19
|
+
Okta: "OKTA",
|
|
20
|
+
Auth0: "AUTH0",
|
|
21
|
+
};
|
|
22
|
+
})(Item = Items.Item || (Items.Item = {}));
|
|
23
|
+
})(Items = Data.Items || (Data.Items = {}));
|
|
21
24
|
})(Data = GetIntegrationsResponse.Data || (GetIntegrationsResponse.Data = {}));
|
|
22
25
|
})(GetIntegrationsResponse || (exports.GetIntegrationsResponse = GetIntegrationsResponse = {}));
|
|
@@ -9,7 +9,7 @@ export declare namespace NotificationsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class NotificationsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<NotificationsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: NotificationsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetNotificationsRequest} request
|
|
15
15
|
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
63
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
64
|
const Forum = __importStar(require("../../../index.js"));
|
|
65
65
|
class NotificationsClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
export interface GetNotificationsResponse {
|
|
2
|
-
data: GetNotificationsResponse.Data
|
|
3
|
-
meta: GetNotificationsResponse.Meta;
|
|
2
|
+
data: GetNotificationsResponse.Data;
|
|
4
3
|
}
|
|
5
4
|
export declare namespace GetNotificationsResponse {
|
|
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
|
+
/** Recipient user ID */
|
|
18
|
+
userId: string;
|
|
19
|
+
/** User ID who triggered the notification */
|
|
20
|
+
notifierId: string;
|
|
21
|
+
/** Notification type */
|
|
22
|
+
type: string | null;
|
|
23
|
+
/** Notification text content */
|
|
24
|
+
description: string | null;
|
|
25
|
+
/** Notification status (read, unread, dismissed, archived) */
|
|
26
|
+
status: string | null;
|
|
27
|
+
/** Related thread ID */
|
|
28
|
+
threadId: string | null;
|
|
29
|
+
/** Related post ID */
|
|
30
|
+
postId: string | null;
|
|
31
|
+
/** Related private message ID */
|
|
32
|
+
privateMessageId: string | null;
|
|
33
|
+
/** Additional notification data */
|
|
34
|
+
extendedData: Record<string, unknown> | null;
|
|
35
|
+
/** Notification creation timestamp */
|
|
36
|
+
createdAt: string;
|
|
37
|
+
/** Notification last update timestamp */
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
|
-
interface Meta {
|
|
35
|
-
total: number;
|
|
36
|
-
page: number;
|
|
37
|
-
limit: number;
|
|
38
|
-
}
|
|
39
42
|
}
|
|
@@ -9,7 +9,7 @@ export declare namespace PostsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class PostsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<PostsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: PostsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetPostsRequest} request
|
|
15
15
|
* @param {PostsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
63
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
64
|
const Forum = __importStar(require("../../../index.js"));
|
|
65
65
|
class PostsClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
export interface GetPostsResponse {
|
|
2
|
-
data: GetPostsResponse.Data
|
|
3
|
-
meta: GetPostsResponse.Meta;
|
|
2
|
+
data: GetPostsResponse.Data;
|
|
4
3
|
}
|
|
5
4
|
export declare namespace GetPostsResponse {
|
|
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
|
-
|
|
13
|
+
type Items = Items.Item[];
|
|
14
|
+
namespace Items {
|
|
15
|
+
interface Item {
|
|
16
|
+
/** Thread ID to post in */
|
|
17
|
+
threadId: string;
|
|
18
|
+
/** Post content (Markdown supported) */
|
|
19
|
+
body: string;
|
|
20
|
+
/** Author user ID (required for API key auth, ignored for JWT auth) */
|
|
21
|
+
userId?: string;
|
|
22
|
+
/** Parent post ID for threading */
|
|
23
|
+
parentId?: string;
|
|
24
|
+
extendedData?: Record<string, unknown>;
|
|
25
|
+
id: string;
|
|
26
|
+
/** Nesting level for threaded replies */
|
|
27
|
+
depth: number | null;
|
|
28
|
+
/** Post creation timestamp */
|
|
29
|
+
createdAt: string;
|
|
30
|
+
/** Post last update timestamp */
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
}
|
|
25
33
|
}
|
|
26
34
|
}
|
|
27
|
-
interface Meta {
|
|
28
|
-
total: number;
|
|
29
|
-
page: number;
|
|
30
|
-
limit: number;
|
|
31
|
-
}
|
|
32
35
|
}
|
|
@@ -9,7 +9,7 @@ export declare namespace PrivateMessagesClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class PrivateMessagesClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<PrivateMessagesClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: PrivateMessagesClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetPrivateMessagesRequest} request
|
|
15
15
|
* @param {PrivateMessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
|
|
|
63
63
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
64
|
const Forum = __importStar(require("../../../index.js"));
|
|
65
65
|
class PrivateMessagesClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|