lemmy-js-client 1.0.0-api-updates-3.1 → 1.0.0-api-updates-4.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.
package/dist/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Controller } from "@tsoa/runtime";
2
- import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetModlogI, GetMultiCommunityI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListNotificationsI, ListMediaI, ListMultiCommunitiesI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
2
+ import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetModlogI, GetMultiCommunityI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListNotificationsI, ListMediaI, ListMultiCommunitiesI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage, GetFederatedInstancesI } from "./other_types";
3
3
  import { AddAdmin } from "./types/AddAdmin";
4
4
  import { AddAdminResponse } from "./types/AddAdminResponse";
5
5
  import { AddModToCommunity } from "./types/AddModToCommunity";
@@ -670,7 +670,7 @@ export declare class LemmyHttp extends Controller {
670
670
  /**
671
671
  * @summary Fetch federated instances.
672
672
  */
673
- getFederatedInstances(options?: RequestOptions): Promise<GetFederatedInstancesResponse>;
673
+ getFederatedInstances(form: GetFederatedInstancesI, options?: RequestOptions): Promise<GetFederatedInstancesResponse>;
674
674
  /**
675
675
  * @summary List user reports.
676
676
  */
package/dist/http.js CHANGED
@@ -805,8 +805,8 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
805
805
  /**
806
806
  * @summary Fetch federated instances.
807
807
  */
808
- async getFederatedInstances(options) {
809
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {}, options);
808
+ async getFederatedInstances(form, options) {
809
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", form, options);
810
810
  }
811
811
  /**
812
812
  * @summary List user reports.
@@ -1889,7 +1889,8 @@ __decorate([
1889
1889
  __decorate([
1890
1890
  (0, runtime_1.Get)("/federated_instances"),
1891
1891
  (0, runtime_1.Tags)("Miscellaneous"),
1892
- __param(0, (0, runtime_1.Inject)())
1892
+ __param(0, (0, runtime_1.Queries)()),
1893
+ __param(1, (0, runtime_1.Inject)())
1893
1894
  ], LemmyHttp.prototype, "getFederatedInstances", null);
1894
1895
  __decorate([
1895
1896
  (0, runtime_1.Security)("bearerAuth"),
package/dist/index.d.ts CHANGED
@@ -117,9 +117,11 @@ export { EditPrivateMessage } from "./types/EditPrivateMessage";
117
117
  export { EditSite } from "./types/EditSite";
118
118
  export { ExportDataResponse } from "./types/ExportDataResponse";
119
119
  export { FeaturePost } from "./types/FeaturePost";
120
- export { FederatedInstances } from "./types/FederatedInstances";
120
+ export { FederatedInstanceView } from "./types/FederatedInstanceView";
121
+ export { FederationAllowList } from "./types/FederationAllowList";
121
122
  export { FederationBlockList } from "./types/FederationBlockList";
122
123
  export { FederationMode } from "./types/FederationMode";
124
+ export { FederationQueueState } from "./types/FederationQueueState";
123
125
  export { FollowCommunity } from "./types/FollowCommunity";
124
126
  export { FollowMultiCommunity } from "./types/FollowMultiCommunity";
125
127
  export { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
@@ -131,6 +133,8 @@ export { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
131
133
  export { GetCommunity } from "./types/GetCommunity";
132
134
  export { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPendingFollowsCountResponse";
133
135
  export { GetCommunityResponse } from "./types/GetCommunityResponse";
136
+ export { GetFederatedInstances } from "./types/GetFederatedInstances";
137
+ export { GetFederatedInstancesKind } from "./types/GetFederatedInstancesKind";
134
138
  export { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse";
135
139
  export { GetModlog } from "./types/GetModlog";
136
140
  export { GetModlogResponse } from "./types/GetModlogResponse";
@@ -31,6 +31,7 @@ import { ListReports } from "./types/ListReports";
31
31
  import { ListTaglines } from "./types/ListTaglines";
32
32
  import { ResolveObject } from "./types/ResolveObject";
33
33
  import { Search } from "./types/Search";
34
+ import { GetFederatedInstances } from "./types/GetFederatedInstances";
34
35
  export declare const VERSION = "v4";
35
36
  export interface UploadImage {
36
37
  image: File | Buffer;
@@ -101,3 +102,5 @@ export interface ListMultiCommunitiesI extends ListMultiCommunities {
101
102
  }
102
103
  export interface GetMultiCommunityI extends GetMultiCommunity {
103
104
  }
105
+ export interface GetFederatedInstancesI extends GetFederatedInstances {
106
+ }
@@ -16,4 +16,8 @@ export type AuthenticateWithOauth = {
16
16
  */
17
17
  answer?: string;
18
18
  pkce_code_verifier?: string;
19
+ /**
20
+ * If this is true the login is valid forever, otherwise it expires after one week.
21
+ */
22
+ stay_logged_in?: boolean;
19
23
  };
@@ -6,4 +6,8 @@ export type ChangePassword = {
6
6
  new_password: SensitiveString;
7
7
  new_password_verify: SensitiveString;
8
8
  old_password: SensitiveString;
9
+ /**
10
+ * If this is true the login is valid forever, otherwise it expires after one week.
11
+ */
12
+ stay_logged_in?: boolean;
9
13
  };
@@ -4,5 +4,8 @@ import type { CommentId } from "./CommentId";
4
4
  */
5
5
  export type CreateCommentLike = {
6
6
  comment_id: CommentId;
7
+ /**
8
+ * True means Upvote, False means Downvote, and None means remove vote.
9
+ */
7
10
  is_upvote?: boolean;
8
11
  };
@@ -4,5 +4,8 @@ import type { PostId } from "./PostId";
4
4
  */
5
5
  export type CreatePostLike = {
6
6
  post_id: PostId;
7
+ /**
8
+ * True means Upvote, False means Downvote, and None means remove vote.
9
+ */
7
10
  is_upvote?: boolean;
8
11
  };
@@ -0,0 +1,12 @@
1
+ import type { FederationAllowList } from "./FederationAllowList";
2
+ import type { FederationBlockList } from "./FederationBlockList";
3
+ import type { FederationQueueState } from "./FederationQueueState";
4
+ import type { Instance } from "./Instance";
5
+ import type { Site } from "./Site";
6
+ export type FederatedInstanceView = {
7
+ instance: Instance;
8
+ site?: Site;
9
+ queue_state?: FederationQueueState;
10
+ blocked?: FederationBlockList;
11
+ allowed?: FederationAllowList;
12
+ };
@@ -0,0 +1,4 @@
1
+ export type FederationAllowList = {
2
+ published_at: string;
3
+ updated_at?: string;
4
+ };
@@ -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 });
@@ -1,6 +1,4 @@
1
- import type { InstanceId } from "./InstanceId";
2
1
  export type FederationBlockList = {
3
- instance_id: InstanceId;
4
2
  published_at: string;
5
3
  updated_at?: string;
6
4
  expires_at?: string;
@@ -1,2 +1,3 @@
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.
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import type { ActivityId } from "./ActivityId";
2
+ import type { InstanceId } from "./InstanceId";
3
+ export type FederationQueueState = {
4
+ instance_id: InstanceId;
5
+ /**
6
+ * the last successfully sent activity id
7
+ */
8
+ last_successful_id?: ActivityId;
9
+ last_successful_published_time_at?: string;
10
+ /**
11
+ * how many failed attempts have been made to send the next activity
12
+ */
13
+ fail_count: number;
14
+ /**
15
+ * timestamp of the last retry attempt (when the last failing activity was resent)
16
+ */
17
+ last_retry_at?: string;
18
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { GetFederatedInstancesKind } from "./GetFederatedInstancesKind";
2
+ import type { PaginationCursor } from "./PaginationCursor";
3
+ export type GetFederatedInstances = {
4
+ domain_filter?: string;
5
+ kind: GetFederatedInstancesKind;
6
+ page_cursor?: PaginationCursor;
7
+ page_back?: boolean;
8
+ limit?: number;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type GetFederatedInstancesKind = "all" | "linked" | "allowed" | "blocked";
@@ -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 });
@@ -1,10 +1,10 @@
1
- import type { FederatedInstances } from "./FederatedInstances";
1
+ import type { FederatedInstanceView } from "./FederatedInstanceView";
2
+ import type { PaginationCursor } from "./PaginationCursor";
2
3
  /**
3
4
  * A response of federated instances.
4
5
  */
5
6
  export type GetFederatedInstancesResponse = {
6
- /**
7
- * Optional, because federation may be disabled.
8
- */
9
- federated_instances?: FederatedInstances;
7
+ federated_instances: Array<FederatedInstanceView>;
8
+ next_page?: PaginationCursor;
9
+ prev_page?: PaginationCursor;
10
10
  };
@@ -12,4 +12,8 @@ export type Login = {
12
12
  * May be required, if totp is enabled for their account.
13
13
  */
14
14
  totp_2fa_token?: string;
15
+ /**
16
+ * If this is true the login is valid forever, otherwise it expires after one week.
17
+ */
18
+ stay_logged_in?: boolean;
15
19
  };
@@ -27,4 +27,8 @@ export type Register = {
27
27
  * An answer is mandatory if require application is enabled on the server
28
28
  */
29
29
  answer?: string;
30
+ /**
31
+ * If this is true the login is valid forever, otherwise it expires after one week.
32
+ */
33
+ stay_logged_in?: boolean;
30
34
  };
@@ -6,5 +6,8 @@ export type VoteView = {
6
6
  creator: Person;
7
7
  creator_banned: boolean;
8
8
  creator_banned_from_community: boolean;
9
+ /**
10
+ * True means Upvote, False means Downvote.
11
+ */
9
12
  is_upvote: boolean;
10
13
  };
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": "1.0.0-api-updates-3.1",
4
+ "version": "1.0.0-api-updates-4.1",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -1,9 +0,0 @@
1
- import type { InstanceWithFederationState } from "./InstanceWithFederationState";
2
- /**
3
- * A list of federated instances.
4
- */
5
- export type FederatedInstances = {
6
- linked: Array<InstanceWithFederationState>;
7
- allowed: Array<InstanceWithFederationState>;
8
- blocked: Array<InstanceWithFederationState>;
9
- };