lemmy-js-client 0.20.0-instance-blocks.4 → 0.20.0-pkce.1

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.
Files changed (35) hide show
  1. package/dist/http.d.ts +4 -17
  2. package/dist/http.js +2 -18
  3. package/dist/index.d.ts +2 -9
  4. package/dist/types/AuthenticateWithOauth.d.ts +1 -0
  5. package/dist/types/{UserBlockInstanceParams.d.ts → BlockInstance.d.ts} +1 -1
  6. package/dist/types/BlockInstanceResponse.d.ts +3 -0
  7. package/dist/types/BlockInstanceResponse.js +3 -0
  8. package/dist/types/CommentAggregates.d.ts +2 -0
  9. package/dist/types/CreateOAuthProvider.d.ts +1 -0
  10. package/dist/types/CreateSite.d.ts +2 -0
  11. package/dist/types/EditOAuthProvider.d.ts +1 -0
  12. package/dist/types/EditSite.d.ts +8 -0
  13. package/dist/types/GetModlogResponse.d.ts +0 -4
  14. package/dist/types/LemmyErrorType.d.ts +2 -2
  15. package/dist/types/ModlogActionType.d.ts +1 -1
  16. package/dist/types/OAuthProvider.d.ts +4 -0
  17. package/dist/types/PostAggregates.d.ts +2 -0
  18. package/package.json +1 -1
  19. package/dist/types/AdminAllowInstance.d.ts +0 -10
  20. package/dist/types/AdminAllowInstanceParams.d.ts +0 -6
  21. package/dist/types/AdminAllowInstanceParams.js +0 -2
  22. package/dist/types/AdminAllowInstanceView.d.ts +0 -11
  23. package/dist/types/AdminAllowInstanceView.js +0 -2
  24. package/dist/types/AdminBlockInstance.d.ts +0 -11
  25. package/dist/types/AdminBlockInstance.js +0 -2
  26. package/dist/types/AdminBlockInstanceParams.d.ts +0 -7
  27. package/dist/types/AdminBlockInstanceParams.js +0 -2
  28. package/dist/types/AdminBlockInstanceView.d.ts +0 -11
  29. package/dist/types/AdminBlockInstanceView.js +0 -2
  30. package/dist/types/FederationBlockList.d.ts +0 -7
  31. package/dist/types/FederationBlockList.js +0 -2
  32. package/dist/types/InstanceIdOrDomain.d.ts +0 -6
  33. package/dist/types/InstanceIdOrDomain.js +0 -2
  34. package/dist/types/UserBlockInstanceParams.js +0 -2
  35. /package/dist/types/{AdminAllowInstance.js → BlockInstance.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -124,6 +124,8 @@ import { TransferCommunity } from "./types/TransferCommunity";
124
124
  import { VerifyEmail } from "./types/VerifyEmail";
125
125
  import { DeleteImage, UploadImage, UploadImageResponse } from "./other_types";
126
126
  import { HideCommunity } from "./types/HideCommunity";
127
+ import { BlockInstance } from "./types/BlockInstance";
128
+ import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
127
129
  import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
128
130
  import { UpdateTotp } from "./types/UpdateTotp";
129
131
  import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
@@ -152,9 +154,6 @@ import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPen
152
154
  import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
153
155
  import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
154
156
  import { CommunityId } from "./types/CommunityId";
155
- import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
156
- import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
157
- import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
158
157
  type RequestOptions = Pick<RequestInit, "signal">;
159
158
  /**
160
159
  * Helps build lemmy HTTP requests.
@@ -837,23 +836,11 @@ export declare class LemmyHttp {
837
836
  */
838
837
  getFederatedInstances(options?: RequestOptions): Promise<GetFederatedInstancesResponse>;
839
838
  /**
840
- * Block an instance as user.
839
+ * Block an instance.
841
840
  *
842
841
  * `HTTP.Post /site/block`
843
842
  */
844
- userBlockInstance(form: UserBlockInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
845
- /**
846
- * Globally block an instance as admin.
847
- *
848
- * `HTTP.Post /admin/block_instance`
849
- */
850
- adminBlockInstance(form: AdminBlockInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
851
- /**
852
- * Globally allow an instance as admin.
853
- *
854
- * `HTTP.Post /admin/allow_instance`
855
- */
856
- adminAllowInstance(form: AdminAllowInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
843
+ blockInstance(form: BlockInstance, options?: RequestOptions): Promise<BlockInstanceResponse>;
857
844
  /**
858
845
  * Upload an image to the server.
859
846
  */
package/dist/http.js CHANGED
@@ -943,29 +943,13 @@ class LemmyHttp {
943
943
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {}, options);
944
944
  }
945
945
  /**
946
- * Block an instance as user.
946
+ * Block an instance.
947
947
  *
948
948
  * `HTTP.Post /site/block`
949
949
  */
950
- userBlockInstance(form, options) {
950
+ blockInstance(form, options) {
951
951
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site/block", form, options);
952
952
  }
953
- /**
954
- * Globally block an instance as admin.
955
- *
956
- * `HTTP.Post /admin/block_instance`
957
- */
958
- adminBlockInstance(form, options) {
959
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/block_instance", form, options);
960
- }
961
- /**
962
- * Globally allow an instance as admin.
963
- *
964
- * `HTTP.Post /admin/allow_instance`
965
- */
966
- adminAllowInstance(form, options) {
967
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/allow_instance", form, options);
968
- }
969
953
  /**
970
954
  * Upload an image to the server.
971
955
  */
package/dist/index.d.ts CHANGED
@@ -5,12 +5,6 @@ export { AddAdmin } from "./types/AddAdmin";
5
5
  export { AddAdminResponse } from "./types/AddAdminResponse";
6
6
  export { AddModToCommunity } from "./types/AddModToCommunity";
7
7
  export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
8
- export { AdminAllowInstance } from "./types/AdminAllowInstance";
9
- export { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
10
- export { AdminAllowInstanceView } from "./types/AdminAllowInstanceView";
11
- export { AdminBlockInstance } from "./types/AdminBlockInstance";
12
- export { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
13
- export { AdminBlockInstanceView } from "./types/AdminBlockInstanceView";
14
8
  export { AdminPurgeComment } from "./types/AdminPurgeComment";
15
9
  export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView";
16
10
  export { AdminPurgeCommunity } from "./types/AdminPurgeCommunity";
@@ -29,6 +23,8 @@ export { BanPersonResponse } from "./types/BanPersonResponse";
29
23
  export { BannedPersonsResponse } from "./types/BannedPersonsResponse";
30
24
  export { BlockCommunity } from "./types/BlockCommunity";
31
25
  export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
26
+ export { BlockInstance } from "./types/BlockInstance";
27
+ export { BlockInstanceResponse } from "./types/BlockInstanceResponse";
32
28
  export { BlockPerson } from "./types/BlockPerson";
33
29
  export { BlockPersonResponse } from "./types/BlockPersonResponse";
34
30
  export { CaptchaResponse } from "./types/CaptchaResponse";
@@ -94,7 +90,6 @@ export { EditPrivateMessage } from "./types/EditPrivateMessage";
94
90
  export { EditSite } from "./types/EditSite";
95
91
  export { FeaturePost } from "./types/FeaturePost";
96
92
  export { FederatedInstances } from "./types/FederatedInstances";
97
- export { FederationBlockList } from "./types/FederationBlockList";
98
93
  export { FederationError } from "./types/FederationError";
99
94
  export { FederationMode } from "./types/FederationMode";
100
95
  export { FollowCommunity } from "./types/FollowCommunity";
@@ -135,7 +130,6 @@ export { HidePost } from "./types/HidePost";
135
130
  export { ImageDetails } from "./types/ImageDetails";
136
131
  export { Instance } from "./types/Instance";
137
132
  export { InstanceId } from "./types/InstanceId";
138
- export { InstanceIdOrDomain } from "./types/InstanceIdOrDomain";
139
133
  export { InstanceWithFederationState } from "./types/InstanceWithFederationState";
140
134
  export { Language } from "./types/Language";
141
135
  export { LanguageId } from "./types/LanguageId";
@@ -287,6 +281,5 @@ export { TransferCommunity } from "./types/TransferCommunity";
287
281
  export { UpdateTagline } from "./types/UpdateTagline";
288
282
  export { UpdateTotp } from "./types/UpdateTotp";
289
283
  export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
290
- export { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
291
284
  export { VerifyEmail } from "./types/VerifyEmail";
292
285
  export { VoteView } from "./types/VoteView";
@@ -4,6 +4,7 @@ import type { OAuthProviderId } from "./OAuthProviderId";
4
4
  */
5
5
  export type AuthenticateWithOauth = {
6
6
  code: string;
7
+ pkce_code_verifier?: string;
7
8
  oauth_provider_id: OAuthProviderId;
8
9
  redirect_uri: string;
9
10
  show_nsfw?: boolean;
@@ -2,7 +2,7 @@ import type { InstanceId } from "./InstanceId";
2
2
  /**
3
3
  * Block an instance as user
4
4
  */
5
- export type UserBlockInstanceParams = {
5
+ export type BlockInstance = {
6
6
  instance_id: InstanceId;
7
7
  block: boolean;
8
8
  };
@@ -0,0 +1,3 @@
1
+ export type BlockInstanceResponse = {
2
+ blocked: boolean;
3
+ };
@@ -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 });
@@ -12,4 +12,6 @@ export type CommentAggregates = {
12
12
  * The total number of children in this comment branch.
13
13
  */
14
14
  child_count: number;
15
+ report_count: number;
16
+ unresolved_report_count: number;
15
17
  };
@@ -13,5 +13,6 @@ export type CreateOAuthProvider = {
13
13
  scopes: string;
14
14
  auto_verify_email?: boolean;
15
15
  account_linking_enabled?: boolean;
16
+ use_pkce?: boolean;
16
17
  enabled?: boolean;
17
18
  };
@@ -46,6 +46,8 @@ export type CreateSite = {
46
46
  federation_debug?: boolean;
47
47
  captcha_enabled?: boolean;
48
48
  captcha_difficulty?: string;
49
+ allowed_instances?: Array<string>;
50
+ blocked_instances?: Array<string>;
49
51
  registration_mode?: RegistrationMode;
50
52
  oauth_registration?: boolean;
51
53
  content_warning?: string;
@@ -13,5 +13,6 @@ export type EditOAuthProvider = {
13
13
  scopes?: string;
14
14
  auto_verify_email?: boolean;
15
15
  account_linking_enabled?: boolean;
16
+ use_pkce?: boolean;
16
17
  enabled?: boolean;
17
18
  };
@@ -136,6 +136,14 @@ export type EditSite = {
136
136
  * The captcha difficulty. Can be easy, medium, or hard
137
137
  */
138
138
  captcha_difficulty?: string;
139
+ /**
140
+ * A list of allowed instances. If none are set, federation is open.
141
+ */
142
+ allowed_instances?: Array<string>;
143
+ /**
144
+ * A list of blocked instances.
145
+ */
146
+ blocked_instances?: Array<string>;
139
147
  /**
140
148
  * A list of blocked URLs
141
149
  */
@@ -1,5 +1,3 @@
1
- import type { AdminAllowInstanceView } from "./AdminAllowInstanceView";
2
- import type { AdminBlockInstanceView } from "./AdminBlockInstanceView";
3
1
  import type { AdminPurgeCommentView } from "./AdminPurgeCommentView";
4
2
  import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView";
5
3
  import type { AdminPurgePersonView } from "./AdminPurgePersonView";
@@ -34,6 +32,4 @@ export type GetModlogResponse = {
34
32
  admin_purged_posts: Array<AdminPurgePostView>;
35
33
  admin_purged_comments: Array<AdminPurgeCommentView>;
36
34
  hidden_communities: Array<ModHideCommunityView>;
37
- admin_block_instance: Array<AdminBlockInstanceView>;
38
- admin_allow_instance: Array<AdminAllowInstanceView>;
39
35
  };
@@ -130,6 +130,8 @@ export type LemmyErrorType = {
130
130
  error: "rate_limit_error";
131
131
  } | {
132
132
  error: "invalid_name";
133
+ } | {
134
+ error: "invalid_code_verifier";
133
135
  } | {
134
136
  error: "invalid_display_name";
135
137
  } | {
@@ -274,8 +276,6 @@ export type LemmyErrorType = {
274
276
  error: "post_schedule_time_must_be_in_future";
275
277
  } | {
276
278
  error: "too_many_scheduled_posts";
277
- } | {
278
- error: "cannot_combine_federation_blocklist_and_allowlist";
279
279
  } | {
280
280
  error: "federation_error";
281
281
  message: {
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A list of possible types for the various modlog actions.
3
3
  */
4
- export type ModlogActionType = "All" | "ModRemovePost" | "ModLockPost" | "ModFeaturePost" | "ModRemoveComment" | "ModRemoveCommunity" | "ModBanFromCommunity" | "ModAddCommunity" | "ModTransferCommunity" | "ModAdd" | "ModBan" | "ModHideCommunity" | "AdminPurgePerson" | "AdminPurgeCommunity" | "AdminPurgePost" | "AdminPurgeComment" | "AdminBlockInstance" | "AdminAllowInstance";
4
+ export type ModlogActionType = "All" | "ModRemovePost" | "ModLockPost" | "ModFeaturePost" | "ModRemoveComment" | "ModRemoveCommunity" | "ModBanFromCommunity" | "ModAddCommunity" | "ModTransferCommunity" | "ModAdd" | "ModBan" | "ModHideCommunity" | "AdminPurgePerson" | "AdminPurgeCommunity" | "AdminPurgePost" | "AdminPurgeComment";
@@ -56,4 +56,8 @@ export type OAuthProvider = {
56
56
  enabled: boolean;
57
57
  published: string;
58
58
  updated?: string;
59
+ /**
60
+ * switch to enable or disable PKCE
61
+ */
62
+ use_pkce: boolean;
59
63
  };
@@ -13,4 +13,6 @@ export type PostAggregates = {
13
13
  * The time of the newest comment in the post.
14
14
  */
15
15
  newest_comment_time: string;
16
+ report_count: number;
17
+ unresolved_report_count: number;
16
18
  };
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-instance-blocks.4",
4
+ "version": "0.20.0-pkce.1",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -1,10 +0,0 @@
1
- import type { InstanceId } from "./InstanceId";
2
- import type { PersonId } from "./PersonId";
3
- export type AdminAllowInstance = {
4
- id: number;
5
- instance_id: InstanceId;
6
- admin_person_id: PersonId;
7
- allowed: boolean;
8
- reason?: string;
9
- published: string;
10
- };
@@ -1,6 +0,0 @@
1
- import type { InstanceIdOrDomain } from "./InstanceIdOrDomain";
2
- export type AdminAllowInstanceParams = {
3
- instance: InstanceIdOrDomain;
4
- allow: boolean;
5
- reason?: string;
6
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- import type { AdminAllowInstance } from "./AdminAllowInstance";
2
- import type { Instance } from "./Instance";
3
- import type { Person } from "./Person";
4
- /**
5
- * When an admin purges a post.
6
- */
7
- export type AdminAllowInstanceView = {
8
- admin_block_instance: AdminAllowInstance;
9
- instance: Instance;
10
- admin?: Person;
11
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- import type { InstanceId } from "./InstanceId";
2
- import type { PersonId } from "./PersonId";
3
- export type AdminBlockInstance = {
4
- id: number;
5
- instance_id: InstanceId;
6
- admin_person_id: PersonId;
7
- blocked: boolean;
8
- reason?: string;
9
- expires?: string;
10
- published: string;
11
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import type { InstanceIdOrDomain } from "./InstanceIdOrDomain";
2
- export type AdminBlockInstanceParams = {
3
- instance: InstanceIdOrDomain;
4
- block: boolean;
5
- reason?: string;
6
- expires?: string;
7
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- import type { AdminBlockInstance } from "./AdminBlockInstance";
2
- import type { Instance } from "./Instance";
3
- import type { Person } from "./Person";
4
- /**
5
- * When an admin purges a post.
6
- */
7
- export type AdminBlockInstanceView = {
8
- admin_block_instance: AdminBlockInstance;
9
- instance: Instance;
10
- admin?: Person;
11
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import type { InstanceId } from "./InstanceId";
2
- export type FederationBlockList = {
3
- instance_id: InstanceId;
4
- published: string;
5
- updated?: string;
6
- expires?: string;
7
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import type { InstanceId } from "./InstanceId";
2
- export type InstanceIdOrDomain = {
3
- InstanceId: InstanceId;
4
- } | {
5
- Domain: string;
6
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });