lemmy-js-client 0.17.2-rc.11 → 0.17.2-rc.13

Sign up to get free protection for your applications and to get access to all the features.
package/dist/http.d.ts CHANGED
@@ -5,9 +5,9 @@ import { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
5
5
  import { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
6
6
  import { BanFromCommunity } from "./types/BanFromCommunity";
7
7
  import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
8
- import { BannedPersonsResponse } from "./types/BannedPersonsResponse";
9
8
  import { BanPerson } from "./types/BanPerson";
10
9
  import { BanPersonResponse } from "./types/BanPersonResponse";
10
+ import { BannedPersonsResponse } from "./types/BannedPersonsResponse";
11
11
  import { BlockCommunity } from "./types/BlockCommunity";
12
12
  import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
13
13
  import { BlockPerson } from "./types/BlockPerson";
@@ -42,12 +42,14 @@ import { EditSite } from "./types/EditSite";
42
42
  import { FeaturePost } from "./types/FeaturePost";
43
43
  import { FollowCommunity } from "./types/FollowCommunity";
44
44
  import { GetBannedPersons } from "./types/GetBannedPersons";
45
+ import { GetCaptcha } from "./types/GetCaptcha";
45
46
  import { GetCaptchaResponse } from "./types/GetCaptchaResponse";
46
47
  import { GetComment } from "./types/GetComment";
47
48
  import { GetComments } from "./types/GetComments";
48
49
  import { GetCommentsResponse } from "./types/GetCommentsResponse";
49
50
  import { GetCommunity } from "./types/GetCommunity";
50
51
  import { GetCommunityResponse } from "./types/GetCommunityResponse";
52
+ import { GetFederatedInstances } from "./types/GetFederatedInstances";
51
53
  import { GetModlog } from "./types/GetModlog";
52
54
  import { GetModlogResponse } from "./types/GetModlogResponse";
53
55
  import { GetPersonDetails } from "./types/GetPersonDetails";
@@ -90,7 +92,6 @@ import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
90
92
  import { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
91
93
  import { MarkPostAsRead } from "./types/MarkPostAsRead";
92
94
  import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
93
- import { UploadImage, UploadImageResponse } from "./types/others";
94
95
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
95
96
  import { PasswordReset } from "./types/PasswordReset";
96
97
  import { PersonMentionResponse } from "./types/PersonMentionResponse";
@@ -122,6 +123,7 @@ import { SearchResponse } from "./types/SearchResponse";
122
123
  import { SiteResponse } from "./types/SiteResponse";
123
124
  import { TransferCommunity } from "./types/TransferCommunity";
124
125
  import { VerifyEmail } from "./types/VerifyEmail";
126
+ import { UploadImage, UploadImageResponse } from "./types/others";
125
127
  /**
126
128
  * Helps build lemmy HTTP requests.
127
129
  */
@@ -514,7 +516,7 @@ export declare class LemmyHttp {
514
516
  *
515
517
  * `HTTP.GET /user/get_captcha`
516
518
  */
517
- getCaptcha(): Promise<GetCaptchaResponse>;
519
+ getCaptcha(form: GetCaptcha): Promise<GetCaptchaResponse>;
518
520
  /**
519
521
  * Delete your account.
520
522
  *
@@ -635,6 +637,12 @@ export declare class LemmyHttp {
635
637
  * `HTTP.Post /custom_emoji/delete`
636
638
  */
637
639
  deleteCustomEmoji(form: DeleteCustomEmoji): Promise<unknown>;
640
+ /**
641
+ * Fetch federated instances.
642
+ *
643
+ * `HTTP.Get /federated_instances`
644
+ */
645
+ getFederatedInstances(form: GetFederatedInstances): Promise<unknown>;
638
646
  /**
639
647
  * Upload an image to the server.
640
648
  */
package/dist/http.js CHANGED
@@ -578,8 +578,8 @@ var LemmyHttp = /** @class */ (function () {
578
578
  *
579
579
  * `HTTP.GET /user/get_captcha`
580
580
  */
581
- LemmyHttp.prototype.getCaptcha = function () {
582
- return this.wrapper(HttpType.Get, "/user/get_captcha", {});
581
+ LemmyHttp.prototype.getCaptcha = function (form) {
582
+ return this.wrapper(HttpType.Get, "/user/get_captcha", form);
583
583
  };
584
584
  /**
585
585
  * Delete your account.
@@ -753,6 +753,18 @@ var LemmyHttp = /** @class */ (function () {
753
753
  });
754
754
  });
755
755
  };
756
+ /**
757
+ * Fetch federated instances.
758
+ *
759
+ * `HTTP.Get /federated_instances`
760
+ */
761
+ LemmyHttp.prototype.getFederatedInstances = function (form) {
762
+ return __awaiter(this, void 0, void 0, function () {
763
+ return __generator(this, function (_a) {
764
+ return [2 /*return*/, this.wrapper(HttpType.Get, "/federated_instances", form)];
765
+ });
766
+ });
767
+ };
756
768
  /**
757
769
  * Upload an image to the server.
758
770
  */
@@ -1 +1,3 @@
1
- export type GetCaptcha = null;
1
+ export interface GetCaptcha {
2
+ auth?: string;
3
+ }
@@ -1 +1,3 @@
1
- export type GetFederatedInstances = null;
1
+ export interface GetFederatedInstances {
2
+ auth?: string;
3
+ }
@@ -89,7 +89,8 @@ export declare enum UserOperation {
89
89
  VerifyEmail = 82,
90
90
  CreateCustomEmoji = 83,
91
91
  EditCustomEmoji = 84,
92
- DeleteCustomEmoji = 85
92
+ DeleteCustomEmoji = 85,
93
+ GetFederatedInstances = 86
93
94
  }
94
95
  export interface UploadImage {
95
96
  image: File | Buffer;
@@ -93,4 +93,5 @@ var UserOperation;
93
93
  UserOperation[UserOperation["CreateCustomEmoji"] = 83] = "CreateCustomEmoji";
94
94
  UserOperation[UserOperation["EditCustomEmoji"] = 84] = "EditCustomEmoji";
95
95
  UserOperation[UserOperation["DeleteCustomEmoji"] = 85] = "DeleteCustomEmoji";
96
+ UserOperation[UserOperation["GetFederatedInstances"] = 86] = "GetFederatedInstances";
96
97
  })(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
@@ -33,9 +33,11 @@ import { EditSite } from "./types/EditSite";
33
33
  import { FeaturePost } from "./types/FeaturePost";
34
34
  import { FollowCommunity } from "./types/FollowCommunity";
35
35
  import { GetBannedPersons } from "./types/GetBannedPersons";
36
+ import { GetCaptcha } from "./types/GetCaptcha";
36
37
  import { GetComment } from "./types/GetComment";
37
38
  import { GetComments } from "./types/GetComments";
38
39
  import { GetCommunity } from "./types/GetCommunity";
40
+ import { GetFederatedInstances } from "./types/GetFederatedInstances";
39
41
  import { GetModlog } from "./types/GetModlog";
40
42
  import { GetPersonDetails } from "./types/GetPersonDetails";
41
43
  import { GetPersonMentions } from "./types/GetPersonMentions";
@@ -124,7 +126,7 @@ export declare class LemmyWebsocket {
124
126
  /**
125
127
  * Fetch a Captcha.
126
128
  */
127
- getCaptcha(): string;
129
+ getCaptcha(form: GetCaptcha): string;
128
130
  /**
129
131
  * Create a new community.
130
132
  */
@@ -445,6 +447,10 @@ export declare class LemmyWebsocket {
445
447
  * Delete a custom emoji
446
448
  */
447
449
  deleteCustomEmoji(form: DeleteCustomEmoji): string;
450
+ /**
451
+ * Fetch federated instances.
452
+ */
453
+ getFederatedInstances(form: GetFederatedInstances): string;
448
454
  }
449
455
  export declare function wsUserOp(msg: any): UserOperation;
450
456
  /**
package/dist/websocket.js CHANGED
@@ -53,8 +53,8 @@ var LemmyWebsocket = /** @class */ (function () {
53
53
  /**
54
54
  * Fetch a Captcha.
55
55
  */
56
- LemmyWebsocket.prototype.getCaptcha = function () {
57
- return wrapper(others_1.UserOperation.GetCaptcha, {});
56
+ LemmyWebsocket.prototype.getCaptcha = function (form) {
57
+ return wrapper(others_1.UserOperation.GetCaptcha, form);
58
58
  };
59
59
  /**
60
60
  * Create a new community.
@@ -536,6 +536,12 @@ var LemmyWebsocket = /** @class */ (function () {
536
536
  LemmyWebsocket.prototype.deleteCustomEmoji = function (form) {
537
537
  return wrapper(others_1.UserOperation.DeleteCustomEmoji, form);
538
538
  };
539
+ /**
540
+ * Fetch federated instances.
541
+ */
542
+ LemmyWebsocket.prototype.getFederatedInstances = function (form) {
543
+ return wrapper(others_1.UserOperation.GetFederatedInstances, form);
544
+ };
539
545
  return LemmyWebsocket;
540
546
  }());
541
547
  exports.LemmyWebsocket = LemmyWebsocket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
- "version": "0.17.2-rc.11",
3
+ "version": "0.17.2-rc.13",
4
4
  "description": "A javascript / typescript client for Lemmy",
5
5
  "repository": "https://github.com/LemmyNet/lemmy-js-client",
6
6
  "license": "AGPL-3.0",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "build": "tsc",
15
- "docs": "typedoc src/index.ts --sourcefile-url-prefix 'https://github.com/LemmyNet/lemmy-js-client/tree/main/src/'",
15
+ "docs": "typedoc src/index.ts",
16
16
  "lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check src",
17
17
  "prepare": "yarn run build && husky install"
18
18
  },
@@ -30,21 +30,20 @@
30
30
  "form-data": "^4.0.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/node": "^18.6.2",
34
- "@typescript-eslint/eslint-plugin": "^5.31.0",
35
- "@typescript-eslint/parser": "^5.31.0",
36
- "eslint": "^8.20.0",
33
+ "@types/node": "^20.1.2",
34
+ "@typescript-eslint/eslint-plugin": "^5.59.5",
35
+ "@typescript-eslint/parser": "^5.59.5",
36
+ "eslint": "^8.40.0",
37
37
  "eslint-plugin-prettier": "^4.2.1",
38
- "husky": "^8.0.1",
39
- "lint-staged": "^13.0.3",
40
- "prettier": "^2.7.1",
38
+ "husky": "^8.0.3",
39
+ "lint-staged": "^13.2.2",
40
+ "prettier": "^2.8.8",
41
41
  "prettier-plugin-import-sort": "^0.0.7",
42
- "prettier-plugin-organize-imports": "^3.0.0",
43
- "prettier-plugin-packagejson": "^2.2.18",
44
- "sortpack": "^2.3.0",
45
- "typedoc": "^0.21.6",
46
- "typedoc-plugin-sourcefile-url": "^1.0.6",
47
- "typescript": "^4.7.4"
42
+ "prettier-plugin-organize-imports": "^3.2.2",
43
+ "prettier-plugin-packagejson": "^2.4.3",
44
+ "sortpack": "^2.3.4",
45
+ "typedoc": "^0.24.7",
46
+ "typescript": "^5.0.4"
48
47
  },
49
48
  "importSort": {
50
49
  ".js, .jsx, .ts, .tsx": {