@foru-ms/sdk 2.0.5 → 2.0.6
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/integrations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/integrations/client/Client.js +1 -1
- 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/posts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/posts/client/Client.js +1 -1
- 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/reports/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/reports/client/Client.js +1 -1
- 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/ssOs/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/ssOs/client/Client.js +1 -1
- 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/threads/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/threads/client/Client.js +1 -1
- 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/webhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +1 -1
- 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/integrations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/integrations/client/Client.mjs +1 -1
- 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/posts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/posts/client/Client.mjs +1 -1
- 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/reports/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/reports/client/Client.mjs +1 -1
- 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/ssOs/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/ssOs/client/Client.mjs +1 -1
- 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/threads/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/threads/client/Client.mjs +1 -1
- 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/webhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +1 -1
- 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 +1 -1
- 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.6",
|
|
47
|
+
"User-Agent": "@foru-ms/sdk/2.0.6",
|
|
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:
|
|
@@ -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
|
/**
|
|
@@ -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
|
/**
|
|
@@ -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
|
/**
|
|
@@ -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
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace ReportsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ReportsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ReportsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: ReportsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetReportsRequest} request
|
|
15
15
|
* @param {ReportsClient.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 ReportsClient {
|
|
55
|
-
constructor(options
|
|
55
|
+
constructor(options) {
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace RolesClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class RolesClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<RolesClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: RolesClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetRolesRequest} request
|
|
15
15
|
* @param {RolesClient.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 RolesClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace SsOsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class SsOsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<SsOsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: SsOsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetSsoRequest} request
|
|
15
15
|
* @param {SsOsClient.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 SsOsClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace TagsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class TagsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<TagsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: TagsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetTagsRequest} request
|
|
15
15
|
* @param {TagsClient.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 TagsClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace ThreadsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ThreadsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: ThreadsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetThreadsRequest} request
|
|
15
15
|
* @param {ThreadsClient.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 ThreadsClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace UsersClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class UsersClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: UsersClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetUsersRequest} request
|
|
15
15
|
* @param {UsersClient.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 UsersClient {
|
|
66
|
-
constructor(options
|
|
66
|
+
constructor(options) {
|
|
67
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -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
|
/**
|
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.6";
|
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.6",
|
|
10
|
+
"User-Agent": "@foru-ms/sdk/2.0.6",
|
|
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:
|
|
@@ -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
|
/**
|
|
@@ -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.
|
|
@@ -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 NotificationsClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -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.
|
|
@@ -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 PostsClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -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.
|
|
@@ -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 PrivateMessagesClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace ReportsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ReportsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ReportsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: ReportsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetReportsRequest} request
|
|
15
15
|
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -16,7 +16,7 @@ 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 ReportsClient {
|
|
19
|
-
constructor(options
|
|
19
|
+
constructor(options) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace RolesClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class RolesClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<RolesClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: RolesClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetRolesRequest} request
|
|
15
15
|
* @param {RolesClient.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 RolesClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace SsOsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class SsOsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<SsOsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: SsOsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetSsoRequest} request
|
|
15
15
|
* @param {SsOsClient.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 SsOsClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace TagsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class TagsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<TagsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: TagsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetTagsRequest} request
|
|
15
15
|
* @param {TagsClient.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 TagsClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace ThreadsClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ThreadsClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: ThreadsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetThreadsRequest} request
|
|
15
15
|
* @param {ThreadsClient.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 ThreadsClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -9,7 +9,7 @@ export declare namespace UsersClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class UsersClient {
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
|
|
12
|
-
constructor(options
|
|
12
|
+
constructor(options: UsersClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {Forum.GetUsersRequest} request
|
|
15
15
|
* @param {UsersClient.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 UsersClient {
|
|
30
|
-
constructor(options
|
|
30
|
+
constructor(options) {
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -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.
|
|
@@ -16,7 +16,7 @@ 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 WebhooksClient {
|
|
19
|
-
constructor(options
|
|
19
|
+
constructor(options) {
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.6";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.0.
|
|
1
|
+
export const SDK_VERSION = "2.0.6";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
<dl>
|
|
5
5
|
<dd>
|
|
6
6
|
|
|
7
|
+
#### 📝 Description
|
|
8
|
+
|
|
9
|
+
<dl>
|
|
10
|
+
<dd>
|
|
11
|
+
|
|
12
|
+
<dl>
|
|
13
|
+
<dd>
|
|
14
|
+
|
|
15
|
+
Register a new user in your forum instance. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
16
|
+
</dd>
|
|
17
|
+
</dl>
|
|
18
|
+
</dd>
|
|
19
|
+
</dl>
|
|
20
|
+
|
|
7
21
|
#### 🔌 Usage
|
|
8
22
|
|
|
9
23
|
<dl>
|
|
@@ -57,6 +71,20 @@ await client.auth.register({
|
|
|
57
71
|
<dl>
|
|
58
72
|
<dd>
|
|
59
73
|
|
|
74
|
+
#### 📝 Description
|
|
75
|
+
|
|
76
|
+
<dl>
|
|
77
|
+
<dd>
|
|
78
|
+
|
|
79
|
+
<dl>
|
|
80
|
+
<dd>
|
|
81
|
+
|
|
82
|
+
Authenticate an existing user. Requires API key for instance identification. Returns a JWT token for subsequent authenticated requests.
|
|
83
|
+
</dd>
|
|
84
|
+
</dl>
|
|
85
|
+
</dd>
|
|
86
|
+
</dl>
|
|
87
|
+
|
|
60
88
|
#### 🔌 Usage
|
|
61
89
|
|
|
62
90
|
<dl>
|
|
@@ -150,6 +178,20 @@ await client.auth.getCurrentUser();
|
|
|
150
178
|
<dl>
|
|
151
179
|
<dd>
|
|
152
180
|
|
|
181
|
+
#### 📝 Description
|
|
182
|
+
|
|
183
|
+
<dl>
|
|
184
|
+
<dd>
|
|
185
|
+
|
|
186
|
+
<dl>
|
|
187
|
+
<dd>
|
|
188
|
+
|
|
189
|
+
Request a password reset email. Requires API key for instance identification.
|
|
190
|
+
</dd>
|
|
191
|
+
</dl>
|
|
192
|
+
</dd>
|
|
193
|
+
</dl>
|
|
194
|
+
|
|
153
195
|
#### 🔌 Usage
|
|
154
196
|
|
|
155
197
|
<dl>
|
|
@@ -201,6 +243,20 @@ await client.auth.requestPasswordReset({
|
|
|
201
243
|
<dl>
|
|
202
244
|
<dd>
|
|
203
245
|
|
|
246
|
+
#### 📝 Description
|
|
247
|
+
|
|
248
|
+
<dl>
|
|
249
|
+
<dd>
|
|
250
|
+
|
|
251
|
+
<dl>
|
|
252
|
+
<dd>
|
|
253
|
+
|
|
254
|
+
Reset password using a reset token. Requires API key for instance identification.
|
|
255
|
+
</dd>
|
|
256
|
+
</dl>
|
|
257
|
+
</dd>
|
|
258
|
+
</dl>
|
|
259
|
+
|
|
204
260
|
#### 🔌 Usage
|
|
205
261
|
|
|
206
262
|
<dl>
|