@foru-ms/sdk 2.1.11 → 2.1.13
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/api/resources/users/client/Client.d.ts +18 -0
- package/dist/cjs/api/resources/users/client/Client.js +60 -0
- package/dist/cjs/api/resources/users/client/requests/UnfollowUsersRequest.d.ts +10 -0
- package/dist/cjs/api/resources/users/client/requests/UnfollowUsersRequest.js +3 -0
- package/dist/cjs/api/resources/users/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/types/UnfollowUsersResponse.d.ts +8 -0
- package/dist/cjs/api/resources/users/types/UnfollowUsersResponse.js +3 -0
- package/dist/cjs/api/resources/users/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/types/index.js +1 -0
- 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/api/resources/users/client/Client.d.mts +18 -0
- package/dist/esm/api/resources/users/client/Client.mjs +60 -0
- package/dist/esm/api/resources/users/client/requests/UnfollowUsersRequest.d.mts +10 -0
- package/dist/esm/api/resources/users/client/requests/UnfollowUsersRequest.mjs +2 -0
- package/dist/esm/api/resources/users/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/users/types/UnfollowUsersResponse.d.mts +8 -0
- package/dist/esm/api/resources/users/types/UnfollowUsersResponse.mjs +2 -0
- package/dist/esm/api/resources/users/types/index.d.mts +1 -0
- package/dist/esm/api/resources/users/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +65 -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.1.
|
|
47
|
-
"User-Agent": "@foru-ms/sdk/2.1.
|
|
46
|
+
"X-Fern-SDK-Version": "2.1.13",
|
|
47
|
+
"User-Agent": "@foru-ms/sdk/2.1.13",
|
|
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);
|
|
@@ -143,6 +143,24 @@ export declare class UsersClient {
|
|
|
143
143
|
*/
|
|
144
144
|
createFollower(request: Forum.CreateFollowerUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserFollowerResponse>;
|
|
145
145
|
private __createFollower;
|
|
146
|
+
/**
|
|
147
|
+
* Unfollow this user. Removes the authenticated user's follow. No subId needed.
|
|
148
|
+
*
|
|
149
|
+
* @param {Forum.UnfollowUsersRequest} request
|
|
150
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
151
|
+
*
|
|
152
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
153
|
+
* @throws {@link Forum.NotFoundError}
|
|
154
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
155
|
+
* @throws {@link Forum.InternalServerError}
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* await client.users.unfollow({
|
|
159
|
+
* id: "id"
|
|
160
|
+
* })
|
|
161
|
+
*/
|
|
162
|
+
unfollow(request: Forum.UnfollowUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UnfollowUsersResponse>;
|
|
163
|
+
private __unfollow;
|
|
146
164
|
/**
|
|
147
165
|
* @param {Forum.RetrieveFollowerUsersRequest} request
|
|
148
166
|
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -523,6 +523,66 @@ class UsersClient {
|
|
|
523
523
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/users/{id}/followers");
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Unfollow this user. Removes the authenticated user's follow. No subId needed.
|
|
528
|
+
*
|
|
529
|
+
* @param {Forum.UnfollowUsersRequest} request
|
|
530
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
531
|
+
*
|
|
532
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
533
|
+
* @throws {@link Forum.NotFoundError}
|
|
534
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
535
|
+
* @throws {@link Forum.InternalServerError}
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* await client.users.unfollow({
|
|
539
|
+
* id: "id"
|
|
540
|
+
* })
|
|
541
|
+
*/
|
|
542
|
+
unfollow(request, requestOptions) {
|
|
543
|
+
return core.HttpResponsePromise.fromPromise(this.__unfollow(request, requestOptions));
|
|
544
|
+
}
|
|
545
|
+
__unfollow(request, requestOptions) {
|
|
546
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
547
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
548
|
+
const { id } = request;
|
|
549
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
550
|
+
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);
|
|
551
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
552
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `users/${core.url.encodePathParam(id)}/followers`),
|
|
553
|
+
method: "DELETE",
|
|
554
|
+
headers: _headers,
|
|
555
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
556
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
557
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
558
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
559
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
560
|
+
logging: this._options.logging,
|
|
561
|
+
});
|
|
562
|
+
if (_response.ok) {
|
|
563
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
564
|
+
}
|
|
565
|
+
if (_response.error.reason === "status-code") {
|
|
566
|
+
switch (_response.error.statusCode) {
|
|
567
|
+
case 401:
|
|
568
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
569
|
+
case 404:
|
|
570
|
+
throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
|
|
571
|
+
case 429:
|
|
572
|
+
throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
573
|
+
case 500:
|
|
574
|
+
throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
|
|
575
|
+
default:
|
|
576
|
+
throw new errors.ForumError({
|
|
577
|
+
statusCode: _response.error.statusCode,
|
|
578
|
+
body: _response.error.body,
|
|
579
|
+
rawResponse: _response.rawResponse,
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/users/{id}/followers");
|
|
584
|
+
});
|
|
585
|
+
}
|
|
526
586
|
/**
|
|
527
587
|
* @param {Forum.RetrieveFollowerUsersRequest} request
|
|
528
588
|
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -9,4 +9,5 @@ export type { ListUsersRequest } from "./ListUsersRequest.js";
|
|
|
9
9
|
export type { RetrieveFollowerUsersRequest } from "./RetrieveFollowerUsersRequest.js";
|
|
10
10
|
export type { RetrieveFollowingUsersRequest } from "./RetrieveFollowingUsersRequest.js";
|
|
11
11
|
export type { RetrieveUsersRequest } from "./RetrieveUsersRequest.js";
|
|
12
|
+
export type { UnfollowUsersRequest } from "./UnfollowUsersRequest.js";
|
|
12
13
|
export type { UpdateUsersRequest } from "./UpdateUsersRequest.js";
|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./ListUsersRequestSort.js"), exports);
|
|
18
18
|
__exportStar(require("./RetrieveFollowerUsersResponse.js"), exports);
|
|
19
19
|
__exportStar(require("./RetrieveFollowingUsersResponse.js"), exports);
|
|
20
|
+
__exportStar(require("./UnfollowUsersResponse.js"), exports);
|
|
20
21
|
__exportStar(require("./UpdateUsersResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.13";
|
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.1.
|
|
10
|
-
"User-Agent": "@foru-ms/sdk/2.1.
|
|
9
|
+
"X-Fern-SDK-Version": "2.1.13",
|
|
10
|
+
"User-Agent": "@foru-ms/sdk/2.1.13",
|
|
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);
|
|
@@ -143,6 +143,24 @@ export declare class UsersClient {
|
|
|
143
143
|
*/
|
|
144
144
|
createFollower(request: Forum.CreateFollowerUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserFollowerResponse>;
|
|
145
145
|
private __createFollower;
|
|
146
|
+
/**
|
|
147
|
+
* Unfollow this user. Removes the authenticated user's follow. No subId needed.
|
|
148
|
+
*
|
|
149
|
+
* @param {Forum.UnfollowUsersRequest} request
|
|
150
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
151
|
+
*
|
|
152
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
153
|
+
* @throws {@link Forum.NotFoundError}
|
|
154
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
155
|
+
* @throws {@link Forum.InternalServerError}
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* await client.users.unfollow({
|
|
159
|
+
* id: "id"
|
|
160
|
+
* })
|
|
161
|
+
*/
|
|
162
|
+
unfollow(request: Forum.UnfollowUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UnfollowUsersResponse>;
|
|
163
|
+
private __unfollow;
|
|
146
164
|
/**
|
|
147
165
|
* @param {Forum.RetrieveFollowerUsersRequest} request
|
|
148
166
|
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -487,6 +487,66 @@ export class UsersClient {
|
|
|
487
487
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/users/{id}/followers");
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* Unfollow this user. Removes the authenticated user's follow. No subId needed.
|
|
492
|
+
*
|
|
493
|
+
* @param {Forum.UnfollowUsersRequest} request
|
|
494
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
495
|
+
*
|
|
496
|
+
* @throws {@link Forum.UnauthorizedError}
|
|
497
|
+
* @throws {@link Forum.NotFoundError}
|
|
498
|
+
* @throws {@link Forum.TooManyRequestsError}
|
|
499
|
+
* @throws {@link Forum.InternalServerError}
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* await client.users.unfollow({
|
|
503
|
+
* id: "id"
|
|
504
|
+
* })
|
|
505
|
+
*/
|
|
506
|
+
unfollow(request, requestOptions) {
|
|
507
|
+
return core.HttpResponsePromise.fromPromise(this.__unfollow(request, requestOptions));
|
|
508
|
+
}
|
|
509
|
+
__unfollow(request, requestOptions) {
|
|
510
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
511
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
512
|
+
const { id } = request;
|
|
513
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
514
|
+
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);
|
|
515
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
516
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, `users/${core.url.encodePathParam(id)}/followers`),
|
|
517
|
+
method: "DELETE",
|
|
518
|
+
headers: _headers,
|
|
519
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
520
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
521
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
522
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
523
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
524
|
+
logging: this._options.logging,
|
|
525
|
+
});
|
|
526
|
+
if (_response.ok) {
|
|
527
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
528
|
+
}
|
|
529
|
+
if (_response.error.reason === "status-code") {
|
|
530
|
+
switch (_response.error.statusCode) {
|
|
531
|
+
case 401:
|
|
532
|
+
throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
533
|
+
case 404:
|
|
534
|
+
throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
|
|
535
|
+
case 429:
|
|
536
|
+
throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
537
|
+
case 500:
|
|
538
|
+
throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
|
|
539
|
+
default:
|
|
540
|
+
throw new errors.ForumError({
|
|
541
|
+
statusCode: _response.error.statusCode,
|
|
542
|
+
body: _response.error.body,
|
|
543
|
+
rawResponse: _response.rawResponse,
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/users/{id}/followers");
|
|
548
|
+
});
|
|
549
|
+
}
|
|
490
550
|
/**
|
|
491
551
|
* @param {Forum.RetrieveFollowerUsersRequest} request
|
|
492
552
|
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -9,4 +9,5 @@ export type { ListUsersRequest } from "./ListUsersRequest.mjs";
|
|
|
9
9
|
export type { RetrieveFollowerUsersRequest } from "./RetrieveFollowerUsersRequest.mjs";
|
|
10
10
|
export type { RetrieveFollowingUsersRequest } from "./RetrieveFollowingUsersRequest.mjs";
|
|
11
11
|
export type { RetrieveUsersRequest } from "./RetrieveUsersRequest.mjs";
|
|
12
|
+
export type { UnfollowUsersRequest } from "./UnfollowUsersRequest.mjs";
|
|
12
13
|
export type { UpdateUsersRequest } from "./UpdateUsersRequest.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.13";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.1.
|
|
1
|
+
export const SDK_VERSION = "2.1.13";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -3634,6 +3634,71 @@ await client.users.createFollower({
|
|
|
3634
3634
|
</dl>
|
|
3635
3635
|
|
|
3636
3636
|
|
|
3637
|
+
</dd>
|
|
3638
|
+
</dl>
|
|
3639
|
+
</details>
|
|
3640
|
+
|
|
3641
|
+
<details><summary><code>client.users.<a href="/src/api/resources/users/client/Client.ts">unfollow</a>({ ...params }) -> Forum.UnfollowUsersResponse</code></summary>
|
|
3642
|
+
<dl>
|
|
3643
|
+
<dd>
|
|
3644
|
+
|
|
3645
|
+
#### 📝 Description
|
|
3646
|
+
|
|
3647
|
+
<dl>
|
|
3648
|
+
<dd>
|
|
3649
|
+
|
|
3650
|
+
<dl>
|
|
3651
|
+
<dd>
|
|
3652
|
+
|
|
3653
|
+
Unfollow this user. Removes the authenticated user's follow. No subId needed.
|
|
3654
|
+
</dd>
|
|
3655
|
+
</dl>
|
|
3656
|
+
</dd>
|
|
3657
|
+
</dl>
|
|
3658
|
+
|
|
3659
|
+
#### 🔌 Usage
|
|
3660
|
+
|
|
3661
|
+
<dl>
|
|
3662
|
+
<dd>
|
|
3663
|
+
|
|
3664
|
+
<dl>
|
|
3665
|
+
<dd>
|
|
3666
|
+
|
|
3667
|
+
```typescript
|
|
3668
|
+
await client.users.unfollow({
|
|
3669
|
+
id: "id"
|
|
3670
|
+
});
|
|
3671
|
+
|
|
3672
|
+
```
|
|
3673
|
+
</dd>
|
|
3674
|
+
</dl>
|
|
3675
|
+
</dd>
|
|
3676
|
+
</dl>
|
|
3677
|
+
|
|
3678
|
+
#### ⚙️ Parameters
|
|
3679
|
+
|
|
3680
|
+
<dl>
|
|
3681
|
+
<dd>
|
|
3682
|
+
|
|
3683
|
+
<dl>
|
|
3684
|
+
<dd>
|
|
3685
|
+
|
|
3686
|
+
**request:** `Forum.UnfollowUsersRequest`
|
|
3687
|
+
|
|
3688
|
+
</dd>
|
|
3689
|
+
</dl>
|
|
3690
|
+
|
|
3691
|
+
<dl>
|
|
3692
|
+
<dd>
|
|
3693
|
+
|
|
3694
|
+
**requestOptions:** `UsersClient.RequestOptions`
|
|
3695
|
+
|
|
3696
|
+
</dd>
|
|
3697
|
+
</dl>
|
|
3698
|
+
</dd>
|
|
3699
|
+
</dl>
|
|
3700
|
+
|
|
3701
|
+
|
|
3637
3702
|
</dd>
|
|
3638
3703
|
</dl>
|
|
3639
3704
|
</details>
|