@foru-ms/sdk 2.1.10 → 2.1.12

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.
@@ -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.10",
47
- "User-Agent": "@foru-ms/sdk/2.1.10",
46
+ "X-Fern-SDK-Version": "2.1.12",
47
+ "User-Agent": "@foru-ms/sdk/2.1.12",
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);
@@ -124,6 +124,25 @@ export declare class UsersClient {
124
124
  */
125
125
  listFollowers(request: Forum.ListFollowersUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserFollowerListResponse>;
126
126
  private __listFollowers;
127
+ /**
128
+ * Create a Follower in User.
129
+ *
130
+ * @param {Forum.CreateFollowerUsersRequest} request
131
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @throws {@link Forum.BadRequestError}
134
+ * @throws {@link Forum.UnauthorizedError}
135
+ * @throws {@link Forum.NotFoundError}
136
+ * @throws {@link Forum.TooManyRequestsError}
137
+ * @throws {@link Forum.InternalServerError}
138
+ *
139
+ * @example
140
+ * await client.users.createFollower({
141
+ * id: "id"
142
+ * })
143
+ */
144
+ createFollower(request: Forum.CreateFollowerUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserFollowerResponse>;
145
+ private __createFollower;
127
146
  /**
128
147
  * @param {Forum.RetrieveFollowerUsersRequest} request
129
148
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -457,6 +457,72 @@ class UsersClient {
457
457
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/users/{id}/followers");
458
458
  });
459
459
  }
460
+ /**
461
+ * Create a Follower in User.
462
+ *
463
+ * @param {Forum.CreateFollowerUsersRequest} request
464
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
465
+ *
466
+ * @throws {@link Forum.BadRequestError}
467
+ * @throws {@link Forum.UnauthorizedError}
468
+ * @throws {@link Forum.NotFoundError}
469
+ * @throws {@link Forum.TooManyRequestsError}
470
+ * @throws {@link Forum.InternalServerError}
471
+ *
472
+ * @example
473
+ * await client.users.createFollower({
474
+ * id: "id"
475
+ * })
476
+ */
477
+ createFollower(request, requestOptions) {
478
+ return core.HttpResponsePromise.fromPromise(this.__createFollower(request, requestOptions));
479
+ }
480
+ __createFollower(request, requestOptions) {
481
+ return __awaiter(this, void 0, void 0, function* () {
482
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
483
+ const { id } = request, _body = __rest(request, ["id"]);
484
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
485
+ 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);
486
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
487
+ 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`),
488
+ method: "POST",
489
+ headers: _headers,
490
+ contentType: "application/json",
491
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
492
+ requestType: "json",
493
+ body: _body,
494
+ 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,
495
+ 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,
496
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
497
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
498
+ logging: this._options.logging,
499
+ });
500
+ if (_response.ok) {
501
+ return { data: _response.body, rawResponse: _response.rawResponse };
502
+ }
503
+ if (_response.error.reason === "status-code") {
504
+ switch (_response.error.statusCode) {
505
+ case 400:
506
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
507
+ case 401:
508
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
509
+ case 404:
510
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
511
+ case 429:
512
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
513
+ case 500:
514
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
515
+ default:
516
+ throw new errors.ForumError({
517
+ statusCode: _response.error.statusCode,
518
+ body: _response.error.body,
519
+ rawResponse: _response.rawResponse,
520
+ });
521
+ }
522
+ }
523
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/users/{id}/followers");
524
+ });
525
+ }
460
526
  /**
461
527
  * @param {Forum.RetrieveFollowerUsersRequest} request
462
528
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface CreateFollowerUsersRequest {
8
+ /** User ID */
9
+ id: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ export type { CreateFollowerUsersRequest } from "./CreateFollowerUsersRequest.js";
1
2
  export type { CreateUsersRequest } from "./CreateUsersRequest.js";
2
3
  export type { DeleteFollowerUsersRequest } from "./DeleteFollowerUsersRequest.js";
3
4
  export type { DeleteFollowingUsersRequest } from "./DeleteFollowingUsersRequest.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Follow this user (no body needed, uses authenticated user)
3
+ */
4
+ export type UserFollowerCreate = {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -106,6 +106,7 @@ export * from "./UsageStats.js";
106
106
  export * from "./User.js";
107
107
  export * from "./UserCreate.js";
108
108
  export * from "./UserFollower.js";
109
+ export * from "./UserFollowerCreate.js";
109
110
  export * from "./UserFollowerListResponse.js";
110
111
  export * from "./UserFollowerResponse.js";
111
112
  export * from "./UserFollowing.js";
@@ -122,6 +122,7 @@ __exportStar(require("./UsageStats.js"), exports);
122
122
  __exportStar(require("./User.js"), exports);
123
123
  __exportStar(require("./UserCreate.js"), exports);
124
124
  __exportStar(require("./UserFollower.js"), exports);
125
+ __exportStar(require("./UserFollowerCreate.js"), exports);
125
126
  __exportStar(require("./UserFollowerListResponse.js"), exports);
126
127
  __exportStar(require("./UserFollowerResponse.js"), exports);
127
128
  __exportStar(require("./UserFollowing.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.10";
1
+ export declare const SDK_VERSION = "2.1.12";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.1.10";
4
+ exports.SDK_VERSION = "2.1.12";
@@ -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",
10
- "User-Agent": "@foru-ms/sdk/2.1.10",
9
+ "X-Fern-SDK-Version": "2.1.12",
10
+ "User-Agent": "@foru-ms/sdk/2.1.12",
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);
@@ -124,6 +124,25 @@ export declare class UsersClient {
124
124
  */
125
125
  listFollowers(request: Forum.ListFollowersUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserFollowerListResponse>;
126
126
  private __listFollowers;
127
+ /**
128
+ * Create a Follower in User.
129
+ *
130
+ * @param {Forum.CreateFollowerUsersRequest} request
131
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @throws {@link Forum.BadRequestError}
134
+ * @throws {@link Forum.UnauthorizedError}
135
+ * @throws {@link Forum.NotFoundError}
136
+ * @throws {@link Forum.TooManyRequestsError}
137
+ * @throws {@link Forum.InternalServerError}
138
+ *
139
+ * @example
140
+ * await client.users.createFollower({
141
+ * id: "id"
142
+ * })
143
+ */
144
+ createFollower(request: Forum.CreateFollowerUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Forum.UserFollowerResponse>;
145
+ private __createFollower;
127
146
  /**
128
147
  * @param {Forum.RetrieveFollowerUsersRequest} request
129
148
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -421,6 +421,72 @@ export class UsersClient {
421
421
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/users/{id}/followers");
422
422
  });
423
423
  }
424
+ /**
425
+ * Create a Follower in User.
426
+ *
427
+ * @param {Forum.CreateFollowerUsersRequest} request
428
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
429
+ *
430
+ * @throws {@link Forum.BadRequestError}
431
+ * @throws {@link Forum.UnauthorizedError}
432
+ * @throws {@link Forum.NotFoundError}
433
+ * @throws {@link Forum.TooManyRequestsError}
434
+ * @throws {@link Forum.InternalServerError}
435
+ *
436
+ * @example
437
+ * await client.users.createFollower({
438
+ * id: "id"
439
+ * })
440
+ */
441
+ createFollower(request, requestOptions) {
442
+ return core.HttpResponsePromise.fromPromise(this.__createFollower(request, requestOptions));
443
+ }
444
+ __createFollower(request, requestOptions) {
445
+ return __awaiter(this, void 0, void 0, function* () {
446
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
447
+ const { id } = request, _body = __rest(request, ["id"]);
448
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
449
+ 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);
450
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
451
+ 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`),
452
+ method: "POST",
453
+ headers: _headers,
454
+ contentType: "application/json",
455
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
456
+ requestType: "json",
457
+ body: _body,
458
+ 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,
459
+ 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,
460
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
461
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
462
+ logging: this._options.logging,
463
+ });
464
+ if (_response.ok) {
465
+ return { data: _response.body, rawResponse: _response.rawResponse };
466
+ }
467
+ if (_response.error.reason === "status-code") {
468
+ switch (_response.error.statusCode) {
469
+ case 400:
470
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
471
+ case 401:
472
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
473
+ case 404:
474
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
475
+ case 429:
476
+ throw new Forum.TooManyRequestsError(_response.error.body, _response.rawResponse);
477
+ case 500:
478
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
479
+ default:
480
+ throw new errors.ForumError({
481
+ statusCode: _response.error.statusCode,
482
+ body: _response.error.body,
483
+ rawResponse: _response.rawResponse,
484
+ });
485
+ }
486
+ }
487
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/users/{id}/followers");
488
+ });
489
+ }
424
490
  /**
425
491
  * @param {Forum.RetrieveFollowerUsersRequest} request
426
492
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface CreateFollowerUsersRequest {
8
+ /** User ID */
9
+ id: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,3 +1,4 @@
1
+ export type { CreateFollowerUsersRequest } from "./CreateFollowerUsersRequest.mjs";
1
2
  export type { CreateUsersRequest } from "./CreateUsersRequest.mjs";
2
3
  export type { DeleteFollowerUsersRequest } from "./DeleteFollowerUsersRequest.mjs";
3
4
  export type { DeleteFollowingUsersRequest } from "./DeleteFollowingUsersRequest.mjs";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Follow this user (no body needed, uses authenticated user)
3
+ */
4
+ export type UserFollowerCreate = {};
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -106,6 +106,7 @@ export * from "./UsageStats.mjs";
106
106
  export * from "./User.mjs";
107
107
  export * from "./UserCreate.mjs";
108
108
  export * from "./UserFollower.mjs";
109
+ export * from "./UserFollowerCreate.mjs";
109
110
  export * from "./UserFollowerListResponse.mjs";
110
111
  export * from "./UserFollowerResponse.mjs";
111
112
  export * from "./UserFollowing.mjs";
@@ -106,6 +106,7 @@ export * from "./UsageStats.mjs";
106
106
  export * from "./User.mjs";
107
107
  export * from "./UserCreate.mjs";
108
108
  export * from "./UserFollower.mjs";
109
+ export * from "./UserFollowerCreate.mjs";
109
110
  export * from "./UserFollowerListResponse.mjs";
110
111
  export * from "./UserFollowerResponse.mjs";
111
112
  export * from "./UserFollowing.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.10";
1
+ export declare const SDK_VERSION = "2.1.12";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.1.10";
1
+ export const SDK_VERSION = "2.1.12";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foru-ms/sdk",
3
- "version": "2.1.10",
3
+ "version": "2.1.12",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -3569,6 +3569,71 @@ await client.users.listFollowers({
3569
3569
  </dl>
3570
3570
 
3571
3571
 
3572
+ </dd>
3573
+ </dl>
3574
+ </details>
3575
+
3576
+ <details><summary><code>client.users.<a href="/src/api/resources/users/client/Client.ts">createFollower</a>({ ...params }) -> Forum.UserFollowerResponse</code></summary>
3577
+ <dl>
3578
+ <dd>
3579
+
3580
+ #### 📝 Description
3581
+
3582
+ <dl>
3583
+ <dd>
3584
+
3585
+ <dl>
3586
+ <dd>
3587
+
3588
+ Create a Follower in User.
3589
+ </dd>
3590
+ </dl>
3591
+ </dd>
3592
+ </dl>
3593
+
3594
+ #### 🔌 Usage
3595
+
3596
+ <dl>
3597
+ <dd>
3598
+
3599
+ <dl>
3600
+ <dd>
3601
+
3602
+ ```typescript
3603
+ await client.users.createFollower({
3604
+ id: "id"
3605
+ });
3606
+
3607
+ ```
3608
+ </dd>
3609
+ </dl>
3610
+ </dd>
3611
+ </dl>
3612
+
3613
+ #### ⚙️ Parameters
3614
+
3615
+ <dl>
3616
+ <dd>
3617
+
3618
+ <dl>
3619
+ <dd>
3620
+
3621
+ **request:** `Forum.CreateFollowerUsersRequest`
3622
+
3623
+ </dd>
3624
+ </dl>
3625
+
3626
+ <dl>
3627
+ <dd>
3628
+
3629
+ **requestOptions:** `UsersClient.RequestOptions`
3630
+
3631
+ </dd>
3632
+ </dl>
3633
+ </dd>
3634
+ </dl>
3635
+
3636
+
3572
3637
  </dd>
3573
3638
  </dl>
3574
3639
  </details>