lemmy-js-client 0.20.0-alpha.1 → 0.20.0-alpha.2

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/http.d.ts CHANGED
@@ -134,6 +134,7 @@ import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
134
134
  import { HidePost } from "./types/HidePost";
135
135
  import { ListMedia } from "./types/ListMedia";
136
136
  import { ListMediaResponse } from "./types/ListMediaResponse";
137
+ import { GetRegistrationApplication } from "./types/GetRegistrationApplication";
137
138
  /**
138
139
  * Helps build lemmy HTTP requests.
139
140
  */
@@ -697,6 +698,12 @@ export declare class LemmyHttp {
697
698
  * `HTTP.PUT /admin/registration_application/approve`
698
699
  */
699
700
  approveRegistrationApplication(form: ApproveRegistrationApplication): Promise<RegistrationApplicationResponse>;
701
+ /**
702
+ * Get the application a user submitted when they first registered their account
703
+ *
704
+ * `HTTP.GET /admin/registration_application`
705
+ */
706
+ getRegistrationApplication(form: GetRegistrationApplication): Promise<RegistrationApplicationResponse>;
700
707
  /**
701
708
  * Purge / Delete a person from the database.
702
709
  *
package/dist/http.js CHANGED
@@ -780,6 +780,14 @@ class LemmyHttp {
780
780
  approveRegistrationApplication(form) {
781
781
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/admin/registration_application/approve", form);
782
782
  }
783
+ /**
784
+ * Get the application a user submitted when they first registered their account
785
+ *
786
+ * `HTTP.GET /admin/registration_application`
787
+ */
788
+ getRegistrationApplication(form) {
789
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application", form);
790
+ }
783
791
  /**
784
792
  * Purge / Delete a person from the database.
785
793
  *
@@ -923,7 +931,7 @@ _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHtt
923
931
  try {
924
932
  json = yield response.json();
925
933
  }
926
- catch (error) {
934
+ catch (_b) {
927
935
  throw new Error(response.statusText);
928
936
  }
929
937
  if (!response.ok) {
package/dist/index.d.ts CHANGED
@@ -100,6 +100,7 @@ export { GetPostResponse } from "./types/GetPostResponse";
100
100
  export { GetPosts } from "./types/GetPosts";
101
101
  export { GetPostsResponse } from "./types/GetPostsResponse";
102
102
  export { GetPrivateMessages } from "./types/GetPrivateMessages";
103
+ export { GetRegistrationApplication } from "./types/GetRegistrationApplication";
103
104
  export { GetReplies } from "./types/GetReplies";
104
105
  export { GetRepliesResponse } from "./types/GetRepliesResponse";
105
106
  export { GetReportCount } from "./types/GetReportCount";
@@ -111,6 +112,7 @@ export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
111
112
  export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
112
113
  export { HideCommunity } from "./types/HideCommunity";
113
114
  export { HidePost } from "./types/HidePost";
115
+ export { ImageDetails } from "./types/ImageDetails";
114
116
  export { Instance } from "./types/Instance";
115
117
  export { InstanceBlockView } from "./types/InstanceBlockView";
116
118
  export { InstanceId } from "./types/InstanceId";
@@ -185,7 +187,6 @@ export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
185
187
  export { PasswordReset } from "./types/PasswordReset";
186
188
  export { Person } from "./types/Person";
187
189
  export { PersonAggregates } from "./types/PersonAggregates";
188
- export { PersonBlockId } from "./types/PersonBlockId";
189
190
  export { PersonBlockView } from "./types/PersonBlockView";
190
191
  export { PersonId } from "./types/PersonId";
191
192
  export { PersonMention } from "./types/PersonMention";
@@ -220,6 +221,7 @@ export { PurgePost } from "./types/PurgePost";
220
221
  export { ReadableFederationState } from "./types/ReadableFederationState";
221
222
  export { Register } from "./types/Register";
222
223
  export { RegistrationApplication } from "./types/RegistrationApplication";
224
+ export { RegistrationApplicationId } from "./types/RegistrationApplicationId";
223
225
  export { RegistrationApplicationResponse } from "./types/RegistrationApplicationResponse";
224
226
  export { RegistrationApplicationView } from "./types/RegistrationApplicationView";
225
227
  export { RegistrationMode } from "./types/RegistrationMode";
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export declare const VERSION = "v3";
3
2
  export interface UploadImage {
4
3
  image: File | Buffer;
@@ -1,5 +1,6 @@
1
+ import type { RegistrationApplicationId } from "./RegistrationApplicationId";
1
2
  export interface ApproveRegistrationApplication {
2
- id: number;
3
+ id: RegistrationApplicationId;
3
4
  approve: boolean;
4
5
  deny_reason?: string;
5
6
  }
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,5 +13,7 @@ export interface GetPosts {
13
13
  liked_only?: boolean;
14
14
  disliked_only?: boolean;
15
15
  show_hidden?: boolean;
16
+ show_read?: boolean;
17
+ show_nsfw?: boolean;
16
18
  page_cursor?: PaginationCursor;
17
19
  }
@@ -0,0 +1,4 @@
1
+ import type { PersonId } from "./PersonId";
2
+ export interface GetRegistrationApplication {
3
+ person_id: PersonId;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface ImageDetails {
2
+ link: string;
3
+ width: number;
4
+ height: number;
5
+ content_type: string;
6
+ }
@@ -56,6 +56,10 @@ export type LemmyErrorType = {
56
56
  error: "not_top_mod";
57
57
  } | {
58
58
  error: "not_logged_in";
59
+ } | {
60
+ error: "not_higher_mod";
61
+ } | {
62
+ error: "not_higher_admin";
59
63
  } | {
60
64
  error: "site_ban";
61
65
  } | {
@@ -333,4 +337,6 @@ export type LemmyErrorType = {
333
337
  } | {
334
338
  error: "unknown";
335
339
  message: string;
340
+ } | {
341
+ error: "cant_delete_site";
336
342
  };
@@ -1,4 +1,5 @@
1
1
  import type { Community } from "./Community";
2
+ import type { ImageDetails } from "./ImageDetails";
2
3
  import type { Person } from "./Person";
3
4
  import type { Post } from "./Post";
4
5
  import type { PostAggregates } from "./PostAggregates";
@@ -7,6 +8,7 @@ export interface PostView {
7
8
  post: Post;
8
9
  creator: Person;
9
10
  community: Community;
11
+ image_details?: ImageDetails;
10
12
  creator_banned_from_community: boolean;
11
13
  banned_from_community: boolean;
12
14
  creator_is_moderator: boolean;
@@ -1,7 +1,8 @@
1
1
  import type { LocalUserId } from "./LocalUserId";
2
2
  import type { PersonId } from "./PersonId";
3
+ import type { RegistrationApplicationId } from "./RegistrationApplicationId";
3
4
  export interface RegistrationApplication {
4
- id: number;
5
+ id: RegistrationApplicationId;
5
6
  local_user_id: LocalUserId;
6
7
  answer: string;
7
8
  admin_id?: PersonId;
@@ -0,0 +1 @@
1
+ export type RegistrationApplicationId = number;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
3
  "description": "A javascript / typescript client for Lemmy",
4
- "version": "0.20.0-alpha.1",
4
+ "version": "0.20.0-alpha.2",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -19,23 +19,23 @@
19
19
  "url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
20
20
  },
21
21
  "devDependencies": {
22
- "@types/node": "^20.11.19",
23
- "@typescript-eslint/eslint-plugin": "^7.0.1",
24
- "@typescript-eslint/parser": "^7.0.1",
25
- "eslint": "^9.0.0",
26
- "eslint-plugin-prettier": "^5.1.3",
27
- "husky": "^9.0.11",
28
- "lint-staged": "^15.2.2",
29
- "prettier": "^3.2.5",
22
+ "@types/node": "^22.1.0",
23
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
24
+ "@typescript-eslint/parser": "^8.0.0",
25
+ "eslint": "^9.8.0",
26
+ "eslint-plugin-prettier": "^5.2.1",
27
+ "husky": "^9.1.4",
28
+ "lint-staged": "^15.2.7",
29
+ "prettier": "^3.3.3",
30
30
  "prettier-plugin-import-sort": "^0.0.7",
31
- "prettier-plugin-organize-imports": "^3.2.4",
32
- "prettier-plugin-packagejson": "^2.4.11",
31
+ "prettier-plugin-organize-imports": "^4.0.0",
32
+ "prettier-plugin-packagejson": "^2.5.1",
33
33
  "sortpack": "^2.4.0",
34
- "typedoc": "^0.25.8",
35
- "typescript": "^5.3.3",
36
- "typescript-eslint": "^7.9.0"
34
+ "typedoc": "^0.26.5",
35
+ "typescript": "^5.5.4",
36
+ "typescript-eslint": "^8.0.0"
37
37
  },
38
- "packageManager": "pnpm@9.1.4",
38
+ "packageManager": "pnpm@9.9.0",
39
39
  "types": "./dist/index.d.ts",
40
40
  "lint-staged": {
41
41
  "*.{ts,tsx,js}": [
@@ -1 +0,0 @@
1
- export type PersonBlockId = number;