lemmy-js-client 1.0.0-multi-community.13 → 1.0.0-multi-community.15

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 (83) hide show
  1. package/dist/http.d.ts +20 -7
  2. package/dist/http.js +33 -4
  3. package/dist/index.d.ts +4 -1
  4. package/dist/other_types.d.ts +3 -0
  5. package/dist/types/AdminAllowInstance.d.ts +1 -1
  6. package/dist/types/AdminBlockInstance.d.ts +2 -2
  7. package/dist/types/AdminBlockInstanceParams.d.ts +1 -1
  8. package/dist/types/AdminPurgeComment.d.ts +1 -1
  9. package/dist/types/AdminPurgeCommunity.d.ts +1 -1
  10. package/dist/types/AdminPurgePerson.d.ts +1 -1
  11. package/dist/types/AdminPurgePost.d.ts +1 -1
  12. package/dist/types/BanFromCommunity.d.ts +1 -1
  13. package/dist/types/BanPerson.d.ts +1 -1
  14. package/dist/types/Comment.d.ts +2 -2
  15. package/dist/types/CommentActions.d.ts +2 -6
  16. package/dist/types/CommentActions.js +1 -0
  17. package/dist/types/CommentReply.d.ts +1 -1
  18. package/dist/types/CommentReport.d.ts +2 -2
  19. package/dist/types/Community.d.ts +2 -2
  20. package/dist/types/CommunityActions.d.ts +5 -18
  21. package/dist/types/CommunityReport.d.ts +2 -2
  22. package/dist/types/CreatePost.d.ts +1 -1
  23. package/dist/types/CreateSite.d.ts +0 -1
  24. package/dist/types/CustomEmoji.d.ts +2 -2
  25. package/dist/types/EditPost.d.ts +1 -1
  26. package/dist/types/EditSite.d.ts +0 -4
  27. package/dist/types/FederationBlockList.d.ts +3 -3
  28. package/dist/types/GetComments.d.ts +0 -2
  29. package/dist/types/GetPosts.d.ts +0 -2
  30. package/dist/types/Instance.d.ts +2 -2
  31. package/dist/types/InstanceActions.d.ts +3 -7
  32. package/dist/types/InstanceActions.js +1 -0
  33. package/dist/types/InstanceWithFederationState.d.ts +2 -2
  34. package/dist/types/LemmyErrorType.d.ts +2 -0
  35. package/dist/types/LikeType.d.ts +4 -0
  36. package/dist/types/LikeType.js +3 -0
  37. package/dist/types/ListPersonLiked.d.ts +13 -0
  38. package/dist/types/ListPersonLikedResponse.d.ts +13 -0
  39. package/dist/types/ListPersonLikedResponse.js +2 -0
  40. package/dist/types/LocalImage.d.ts +1 -1
  41. package/dist/types/LocalSite.d.ts +2 -6
  42. package/dist/types/LocalSiteRateLimit.d.ts +2 -2
  43. package/dist/types/LocalSiteUrlBlocklist.d.ts +2 -2
  44. package/dist/types/LocalUser.d.ts +1 -1
  45. package/dist/types/LoginToken.d.ts +1 -1
  46. package/dist/types/ModAdd.d.ts +1 -1
  47. package/dist/types/ModAddCommunity.d.ts +1 -1
  48. package/dist/types/ModBan.d.ts +2 -2
  49. package/dist/types/ModBanFromCommunity.d.ts +2 -2
  50. package/dist/types/ModChangeCommunityVisibility.d.ts +1 -2
  51. package/dist/types/ModFeaturePost.d.ts +1 -1
  52. package/dist/types/ModLockPost.d.ts +1 -1
  53. package/dist/types/ModRemoveComment.d.ts +1 -1
  54. package/dist/types/ModRemoveCommunity.d.ts +1 -1
  55. package/dist/types/ModRemovePost.d.ts +1 -1
  56. package/dist/types/ModTransferCommunity.d.ts +1 -1
  57. package/dist/types/MultiCommunity.d.ts +2 -0
  58. package/dist/types/OAuthAccount.d.ts +2 -2
  59. package/dist/types/OAuthProvider.d.ts +2 -2
  60. package/dist/types/Person.d.ts +2 -2
  61. package/dist/types/PersonActions.d.ts +1 -4
  62. package/dist/types/PersonActions.js +1 -0
  63. package/dist/types/PersonCommentMention.d.ts +1 -1
  64. package/dist/types/PersonLikedCombinedView.d.ts +7 -0
  65. package/dist/types/PersonLikedCombinedView.js +2 -0
  66. package/dist/types/PersonPostMention.d.ts +1 -1
  67. package/dist/types/Post.d.ts +4 -4
  68. package/dist/types/PostActions.d.ts +5 -9
  69. package/dist/types/PostActions.js +1 -0
  70. package/dist/types/PostReport.d.ts +2 -2
  71. package/dist/types/PrivateMessage.d.ts +2 -2
  72. package/dist/types/PrivateMessageReport.d.ts +2 -2
  73. package/dist/types/ReadableFederationState.d.ts +2 -2
  74. package/dist/types/RegistrationApplication.d.ts +1 -1
  75. package/dist/types/Search.d.ts +4 -0
  76. package/dist/types/Site.d.ts +2 -2
  77. package/dist/types/SiteResponse.d.ts +0 -4
  78. package/dist/types/Tag.d.ts +2 -2
  79. package/dist/types/Tagline.d.ts +2 -2
  80. package/dist/types/VoteView.d.ts +0 -1
  81. package/package.json +2 -2
  82. package/dist/types/ResolveObjectResponse.d.ts +0 -15
  83. /package/dist/types/{ResolveObjectResponse.js → ListPersonLiked.js} +0 -0
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, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonHiddenI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
2
+ import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
3
3
  import { AddAdmin } from "./types/AddAdmin";
4
4
  import { AddAdminResponse } from "./types/AddAdminResponse";
5
5
  import { AddModToCommunity } from "./types/AddModToCommunity";
@@ -91,7 +91,6 @@ import { RemoveCommunity } from "./types/RemoveCommunity";
91
91
  import { RemovePost } from "./types/RemovePost";
92
92
  import { ResolveCommentReport } from "./types/ResolveCommentReport";
93
93
  import { ResolveCommunityReport } from "./types/ResolveCommunityReport";
94
- import { ResolveObjectResponse } from "./types/ResolveObjectResponse";
95
94
  import { ResolvePostReport } from "./types/ResolvePostReport";
96
95
  import { ResolvePrivateMessageReport } from "./types/ResolvePrivateMessageReport";
97
96
  import { SaveComment } from "./types/SaveComment";
@@ -107,7 +106,6 @@ import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
107
106
  import { UpdateTotp } from "./types/UpdateTotp";
108
107
  import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
109
108
  import { SuccessResponse } from "./types/SuccessResponse";
110
- import { LoginToken } from "./types/LoginToken";
111
109
  import { ListPostLikesResponse } from "./types/ListPostLikesResponse";
112
110
  import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
113
111
  import { HidePost } from "./types/HidePost";
@@ -149,6 +147,8 @@ import { CreateOrDeleteMultiCommunityEntry } from "./types/CreateOrDeleteMultiCo
149
147
  import { GetMultiCommunity } from "./types/GetMultiCommunity";
150
148
  import { GetMultiCommunityResponse } from "./types/GetMultiCommunityResponse";
151
149
  import { FollowMultiCommunity } from "./types/FollowMultiCommunity";
150
+ import { ListLoginsResponse } from "./types/ListLoginsResponse";
151
+ import { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
152
152
  type RequestOptions = Pick<RequestInit, "signal">;
153
153
  /**
154
154
  * Helps build lemmy HTTP requests.
@@ -207,7 +207,7 @@ export declare class LemmyHttp extends Controller {
207
207
  /**
208
208
  * @summary List login tokens for your user
209
209
  */
210
- listLogins(options?: RequestOptions): Promise<LoginToken[]>;
210
+ listLogins(options?: RequestOptions): Promise<ListLoginsResponse>;
211
211
  /**
212
212
  * @summary Returns an error message if your auth token is invalid
213
213
  */
@@ -241,13 +241,13 @@ export declare class LemmyHttp extends Controller {
241
241
  */
242
242
  getModlog(form?: GetModlogI, options?: RequestOptions): Promise<GetModlogResponse>;
243
243
  /**
244
- * @summary Search lemmy.
244
+ * @summary Search lemmy. If `search_term` is a url it also attempts to fetch it, just like `resolve_object`.
245
245
  */
246
246
  search(form: SearchI, options?: RequestOptions): Promise<SearchResponse>;
247
247
  /**
248
248
  * @summary Fetch a non-local / federated object.
249
249
  */
250
- resolveObject(form: ResolveObjectI, options?: RequestOptions): Promise<ResolveObjectResponse>;
250
+ resolveObject(form: ResolveObjectI, options?: RequestOptions): Promise<SearchResponse>;
251
251
  /**
252
252
  * @summary Create a new community.
253
253
  */
@@ -343,7 +343,7 @@ export declare class LemmyHttp extends Controller {
343
343
  /**
344
344
  * @summary Mark a post as read.
345
345
  */
346
- markPostAsRead(form: MarkPostAsRead, options?: RequestOptions): Promise<SuccessResponse>;
346
+ markPostAsRead(form: MarkPostAsRead, options?: RequestOptions): Promise<PostResponse>;
347
347
  /**
348
348
  * @summary Mark multiple posts as read.
349
349
  */
@@ -568,6 +568,10 @@ export declare class LemmyHttp extends Controller {
568
568
  * @summary List your hidden content.
569
569
  */
570
570
  listPersonHidden(form: ListPersonHiddenI, options?: RequestOptions): Promise<ListPersonHiddenResponse>;
571
+ /**
572
+ * @summary List your liked content.
573
+ */
574
+ listPersonLiked(form: ListPersonLikedI, options?: RequestOptions): Promise<ListPersonLikedResponse>;
571
575
  /**
572
576
  * @summary Add an admin to your site.
573
577
  */
@@ -758,4 +762,13 @@ export declare class LemmyHttp extends Controller {
758
762
  [key: string]: string;
759
763
  }): void;
760
764
  }
765
+ /**
766
+ * A Lemmy error type.
767
+ *
768
+ * The name is the i18n translatable error code.
769
+ * The msg is either an empty string, or extra non-translatable info.
770
+ */
771
+ export declare class LemmyError extends Error {
772
+ constructor(name: string, msg?: string);
773
+ }
761
774
  export {};
package/dist/http.js CHANGED
@@ -21,7 +21,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
21
21
  };
22
22
  var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_upload, _LemmyHttp_uploadWithQuery, _LemmyHttp_wrapper;
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.LemmyHttp = void 0;
24
+ exports.LemmyError = exports.LemmyHttp = void 0;
25
25
  const runtime_1 = require("@tsoa/runtime");
26
26
  const other_types_1 = require("./other_types");
27
27
  var HttpType;
@@ -161,7 +161,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
161
161
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/modlog", form, options);
162
162
  }
163
163
  /**
164
- * @summary Search lemmy.
164
+ * @summary Search lemmy. If `search_term` is a url it also attempts to fetch it, just like `resolve_object`.
165
165
  */
166
166
  async search(form, options) {
167
167
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/search", form, options);
@@ -652,6 +652,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
652
652
  async listPersonHidden(form, options) {
653
653
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/hidden", form, options);
654
654
  }
655
+ /**
656
+ * @summary List your liked content.
657
+ */
658
+ async listPersonLiked(form, options) {
659
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/liked", form, options);
660
+ }
655
661
  /**
656
662
  * @summary Add an admin to your site.
657
663
  */
@@ -991,10 +997,11 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
991
997
  json = await response.json();
992
998
  }
993
999
  catch {
994
- throw new Error(response.statusText);
1000
+ throw new LemmyError(response.statusText);
995
1001
  }
996
1002
  if (!response.ok) {
997
- throw new Error(json["error"] ?? response.statusText);
1003
+ let err = new LemmyError(json.error ?? response.statusText, json.message);
1004
+ throw err;
998
1005
  }
999
1006
  else {
1000
1007
  return json;
@@ -1685,6 +1692,13 @@ __decorate([
1685
1692
  __param(0, (0, runtime_1.Queries)()),
1686
1693
  __param(1, (0, runtime_1.Inject)())
1687
1694
  ], LemmyHttp.prototype, "listPersonHidden", null);
1695
+ __decorate([
1696
+ (0, runtime_1.Security)("bearerAuth"),
1697
+ (0, runtime_1.Get)("/account/liked"),
1698
+ (0, runtime_1.Tags)("Account"),
1699
+ __param(0, (0, runtime_1.Queries)()),
1700
+ __param(1, (0, runtime_1.Inject)())
1701
+ ], LemmyHttp.prototype, "listPersonLiked", null);
1688
1702
  __decorate([
1689
1703
  (0, runtime_1.Security)("bearerAuth"),
1690
1704
  (0, runtime_1.Post)("/admin/add"),
@@ -2045,3 +2059,18 @@ function createFormData(image) {
2045
2059
  }
2046
2060
  return formData;
2047
2061
  }
2062
+ /**
2063
+ * A Lemmy error type.
2064
+ *
2065
+ * The name is the i18n translatable error code.
2066
+ * The msg is either an empty string, or extra non-translatable info.
2067
+ */
2068
+ class LemmyError extends Error {
2069
+ constructor(name, msg) {
2070
+ super(msg ?? "");
2071
+ this.name = name;
2072
+ // Set the prototype explicitly.
2073
+ Object.setPrototypeOf(this, LemmyError.prototype);
2074
+ }
2075
+ }
2076
+ exports.LemmyError = LemmyError;
package/dist/index.d.ts CHANGED
@@ -161,6 +161,7 @@ export { InstanceWithFederationState } from "./types/InstanceWithFederationState
161
161
  export { Language } from "./types/Language";
162
162
  export { LanguageId } from "./types/LanguageId";
163
163
  export { LemmyErrorType } from "./types/LemmyErrorType";
164
+ export { LikeType } from "./types/LikeType";
164
165
  export { LinkMetadata } from "./types/LinkMetadata";
165
166
  export { ListCommentLikes } from "./types/ListCommentLikes";
166
167
  export { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
@@ -181,6 +182,8 @@ export { ListPersonContent } from "./types/ListPersonContent";
181
182
  export { ListPersonContentResponse } from "./types/ListPersonContentResponse";
182
183
  export { ListPersonHidden } from "./types/ListPersonHidden";
183
184
  export { ListPersonHiddenResponse } from "./types/ListPersonHiddenResponse";
185
+ export { ListPersonLiked } from "./types/ListPersonLiked";
186
+ export { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
184
187
  export { ListPersonRead } from "./types/ListPersonRead";
185
188
  export { ListPersonReadResponse } from "./types/ListPersonReadResponse";
186
189
  export { ListPersonSaved } from "./types/ListPersonSaved";
@@ -269,6 +272,7 @@ export { PersonCommentMentionView } from "./types/PersonCommentMentionView";
269
272
  export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
270
273
  export { PersonContentType } from "./types/PersonContentType";
271
274
  export { PersonId } from "./types/PersonId";
275
+ export { PersonLikedCombinedView } from "./types/PersonLikedCombinedView";
272
276
  export { PersonPostMention } from "./types/PersonPostMention";
273
277
  export { PersonPostMentionId } from "./types/PersonPostMentionId";
274
278
  export { PersonPostMentionView } from "./types/PersonPostMentionView";
@@ -316,7 +320,6 @@ export { ResendVerificationEmail } from "./types/ResendVerificationEmail";
316
320
  export { ResolveCommentReport } from "./types/ResolveCommentReport";
317
321
  export { ResolveCommunityReport } from "./types/ResolveCommunityReport";
318
322
  export { ResolveObject } from "./types/ResolveObject";
319
- export { ResolveObjectResponse } from "./types/ResolveObjectResponse";
320
323
  export { ResolvePostReport } from "./types/ResolvePostReport";
321
324
  export { ResolvePrivateMessageReport } from "./types/ResolvePrivateMessageReport";
322
325
  export { SaveComment } from "./types/SaveComment";
@@ -21,6 +21,7 @@ import { ListInbox } from "./types/ListInbox";
21
21
  import { ListMedia } from "./types/ListMedia";
22
22
  import { ListPersonContent } from "./types/ListPersonContent";
23
23
  import { ListPersonHidden } from "./types/ListPersonHidden";
24
+ import { ListPersonLiked } from "./types/ListPersonLiked";
24
25
  import { ListPersonRead } from "./types/ListPersonRead";
25
26
  import { ListPersonSaved } from "./types/ListPersonSaved";
26
27
  import { ListPostLikes } from "./types/ListPostLikes";
@@ -79,6 +80,8 @@ export interface ListPersonReadI extends ListPersonRead {
79
80
  }
80
81
  export interface ListPersonHiddenI extends ListPersonHidden {
81
82
  }
83
+ export interface ListPersonLikedI extends ListPersonLiked {
84
+ }
82
85
  export interface ListRegistrationApplicationsI extends ListRegistrationApplications {
83
86
  }
84
87
  export interface GetRegistrationApplicationI extends GetRegistrationApplication {
@@ -7,5 +7,5 @@ export type AdminAllowInstance = {
7
7
  admin_person_id: PersonId;
8
8
  allowed: boolean;
9
9
  reason?: string;
10
- published: string;
10
+ published_at: string;
11
11
  };
@@ -7,6 +7,6 @@ export type AdminBlockInstance = {
7
7
  admin_person_id: PersonId;
8
8
  blocked: boolean;
9
9
  reason?: string;
10
- expires?: string;
11
- published: string;
10
+ expires_at?: string;
11
+ published_at: string;
12
12
  };
@@ -2,5 +2,5 @@ export type AdminBlockInstanceParams = {
2
2
  instance: string;
3
3
  block: boolean;
4
4
  reason?: string;
5
- expires?: string;
5
+ expires_at?: string;
6
6
  };
@@ -9,5 +9,5 @@ export type AdminPurgeComment = {
9
9
  admin_person_id: PersonId;
10
10
  post_id: PostId;
11
11
  reason?: string;
12
- published: string;
12
+ published_at: string;
13
13
  };
@@ -7,5 +7,5 @@ export type AdminPurgeCommunity = {
7
7
  id: AdminPurgeCommunityId;
8
8
  admin_person_id: PersonId;
9
9
  reason?: string;
10
- published: string;
10
+ published_at: string;
11
11
  };
@@ -7,5 +7,5 @@ export type AdminPurgePerson = {
7
7
  id: AdminPurgePersonId;
8
8
  admin_person_id: PersonId;
9
9
  reason?: string;
10
- published: string;
10
+ published_at: string;
11
11
  };
@@ -9,5 +9,5 @@ export type AdminPurgePost = {
9
9
  admin_person_id: PersonId;
10
10
  community_id: CommunityId;
11
11
  reason?: string;
12
- published: string;
12
+ published_at: string;
13
13
  };
@@ -18,5 +18,5 @@ export type BanFromCommunity = {
18
18
  *
19
19
  * An i64 unix timestamp is used for a simpler API client implementation.
20
20
  */
21
- expires?: number;
21
+ expires_at?: number;
22
22
  };
@@ -16,5 +16,5 @@ export type BanPerson = {
16
16
  *
17
17
  * An i64 unix timestamp is used for a simpler API client implementation.
18
18
  */
19
- expires?: number;
19
+ expires_at?: number;
20
20
  };
@@ -15,8 +15,8 @@ export type Comment = {
15
15
  * Whether the comment has been removed.
16
16
  */
17
17
  removed: boolean;
18
- published: string;
19
- updated?: string;
18
+ published_at: string;
19
+ updated_at?: string;
20
20
  /**
21
21
  * Whether the comment has been deleted by its creator.
22
22
  */
@@ -1,8 +1,4 @@
1
- import type { CommentId } from "./CommentId";
2
- import type { PersonId } from "./PersonId";
3
1
  export type CommentActions = {
4
- person_id: PersonId;
5
- comment_id: CommentId;
6
2
  /**
7
3
  * The like / score for the comment.
8
4
  */
@@ -10,9 +6,9 @@ export type CommentActions = {
10
6
  /**
11
7
  * When the comment was liked.
12
8
  */
13
- liked?: string;
9
+ liked_at?: string;
14
10
  /**
15
11
  * When the comment was saved.
16
12
  */
17
- saved?: string;
13
+ saved_at?: string;
18
14
  };
@@ -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 });
@@ -9,5 +9,5 @@ export type CommentReply = {
9
9
  recipient_id: PersonId;
10
10
  comment_id: CommentId;
11
11
  read: boolean;
12
- published: string;
12
+ published_at: string;
13
13
  };
@@ -12,7 +12,7 @@ export type CommentReport = {
12
12
  reason: string;
13
13
  resolved: boolean;
14
14
  resolver_id?: PersonId;
15
- published: string;
16
- updated?: string;
15
+ published_at: string;
16
+ updated_at?: string;
17
17
  violates_instance_rules: boolean;
18
18
  };
@@ -20,8 +20,8 @@ export type Community = {
20
20
  * Whether the community is removed by a mod.
21
21
  */
22
22
  removed: boolean;
23
- published: string;
24
- updated?: string;
23
+ published_at: string;
24
+ updated_at?: string;
25
25
  /**
26
26
  * Whether the community has been deleted by its creator.
27
27
  */
@@ -1,40 +1,27 @@
1
1
  import type { CommunityFollowerState } from "./CommunityFollowerState";
2
- import type { CommunityId } from "./CommunityId";
3
- import type { PersonId } from "./PersonId";
4
2
  export type CommunityActions = {
5
- community_id: CommunityId;
6
- person_id: PersonId;
7
3
  /**
8
4
  * When the community was followed.
9
5
  */
10
- followed?: string;
6
+ followed_at?: string;
11
7
  /**
12
8
  * The state of the community follow.
13
9
  */
14
10
  follow_state?: CommunityFollowerState;
15
- /**
16
- * The approver of the community follow.
17
- */
18
- follow_approver_id?: PersonId;
19
11
  /**
20
12
  * When the community was blocked.
21
13
  */
22
- blocked?: string;
14
+ blocked_at?: string;
23
15
  /**
24
16
  * When this user became a moderator.
25
17
  */
26
- became_moderator?: string;
18
+ became_moderator_at?: string;
27
19
  /**
28
20
  * When this user received a ban.
29
21
  */
30
- received_ban?: string;
22
+ received_ban_at?: string;
31
23
  /**
32
24
  * When their ban expires.
33
25
  */
34
- ban_expires?: string;
35
- /**
36
- * True indicates that user is following this community as part of multi-comm (not part of
37
- * subscribed feed)
38
- */
39
- is_multi_community_follow: boolean | null;
26
+ ban_expires_at?: string;
40
27
  };
@@ -17,6 +17,6 @@ export type CommunityReport = {
17
17
  reason: string;
18
18
  resolved: boolean;
19
19
  resolver_id?: PersonId;
20
- published: string;
21
- updated?: string;
20
+ published_at: string;
21
+ updated_at?: string;
22
22
  };
@@ -30,5 +30,5 @@ export type CreatePost = {
30
30
  /**
31
31
  * Time when this post should be scheduled. Null means publish immediately.
32
32
  */
33
- scheduled_publish_time?: number;
33
+ scheduled_publish_time_at?: number;
34
34
  };
@@ -25,7 +25,6 @@ export type CreateSite = {
25
25
  default_comment_sort_type?: CommentSortType;
26
26
  legal_information?: string;
27
27
  application_email_admins?: boolean;
28
- hide_modlog_mod_names?: boolean;
29
28
  discussion_languages?: Array<LanguageId>;
30
29
  slur_filter_regex?: string;
31
30
  actor_name_max_length?: number;
@@ -9,6 +9,6 @@ export type CustomEmoji = {
9
9
  image_url: DbUrl;
10
10
  alt_text: string;
11
11
  category: string;
12
- published: string;
13
- updated?: string;
12
+ published_at: string;
13
+ updated_at?: string;
14
14
  };
@@ -25,6 +25,6 @@ export type EditPost = {
25
25
  /**
26
26
  * Time when this post should be scheduled. Null means publish immediately.
27
27
  */
28
- scheduled_publish_time?: number;
28
+ scheduled_publish_time_at?: number;
29
29
  tags?: Array<TagId>;
30
30
  };
@@ -67,10 +67,6 @@ export type EditSite = {
67
67
  * Whether to email admins when receiving a new application.
68
68
  */
69
69
  application_email_admins?: boolean;
70
- /**
71
- * Whether to hide moderator names from the modlog.
72
- */
73
- hide_modlog_mod_names?: boolean;
74
70
  /**
75
71
  * A list of allowed discussion languages.
76
72
  */
@@ -1,7 +1,7 @@
1
1
  import type { InstanceId } from "./InstanceId";
2
2
  export type FederationBlockList = {
3
3
  instance_id: InstanceId;
4
- published: string;
5
- updated?: string;
6
- expires?: string;
4
+ published_at: string;
5
+ updated_at?: string;
6
+ expires_at?: string;
7
7
  };
@@ -23,6 +23,4 @@ export type GetComments = {
23
23
  community_name?: string;
24
24
  post_id?: PostId;
25
25
  parent_id?: CommentId;
26
- liked_only?: boolean;
27
- disliked_only?: boolean;
28
26
  };
@@ -18,8 +18,6 @@ export type GetPosts = {
18
18
  community_id?: CommunityId;
19
19
  community_name?: string;
20
20
  multi_community_id?: MultiCommunityId;
21
- liked_only?: boolean;
22
- disliked_only?: boolean;
23
21
  show_hidden?: boolean;
24
22
  /**
25
23
  * If true, then show the read posts (even if your user setting is to hide them)
@@ -6,11 +6,11 @@ import type { InstanceId } from "./InstanceId";
6
6
  export type Instance = {
7
7
  id: InstanceId;
8
8
  domain: string;
9
- published: string;
9
+ published_at: string;
10
10
  /**
11
11
  * When the instance was updated.
12
12
  */
13
- updated?: string;
13
+ updated_at?: string;
14
14
  /**
15
15
  * The software of the instance.
16
16
  */
@@ -1,18 +1,14 @@
1
- import type { InstanceId } from "./InstanceId";
2
- import type { PersonId } from "./PersonId";
3
1
  export type InstanceActions = {
4
- person_id: PersonId;
5
- instance_id: InstanceId;
6
2
  /**
7
3
  * When the instance was blocked.
8
4
  */
9
- blocked?: string;
5
+ blocked_at?: string;
10
6
  /**
11
7
  * When this user received a site ban.
12
8
  */
13
- received_ban?: string;
9
+ received_ban_at?: string;
14
10
  /**
15
11
  * When their ban expires.
16
12
  */
17
- ban_expires?: string;
13
+ ban_expires_at?: string;
18
14
  };
@@ -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 });
@@ -8,11 +8,11 @@ export type InstanceWithFederationState = {
8
8
  federation_state?: ReadableFederationState;
9
9
  id: InstanceId;
10
10
  domain: string;
11
- published: string;
11
+ published_at: string;
12
12
  /**
13
13
  * When the instance was updated.
14
14
  */
15
- updated?: string;
15
+ updated_at?: string;
16
16
  /**
17
17
  * The software of the instance.
18
18
  */
@@ -360,4 +360,6 @@ export type LemmyErrorType = {
360
360
  error: "multi_community_update_wrong_user";
361
361
  } | {
362
362
  error: "cannot_combine_community_id_and_multi_community_id";
363
+ } | {
364
+ error: "multi_community_entry_limit_reached";
363
365
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The like_type for a persons liked content.
3
+ */
4
+ export type LikeType = "All" | "LikedOnly" | "DislikedOnly";
@@ -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 });
@@ -0,0 +1,13 @@
1
+ import type { LikeType } from "./LikeType";
2
+ import type { PaginationCursor } from "./PaginationCursor";
3
+ import type { PersonContentType } from "./PersonContentType";
4
+ /**
5
+ * Gets your liked / disliked posts
6
+ */
7
+ export type ListPersonLiked = {
8
+ type_?: PersonContentType;
9
+ like_type?: LikeType;
10
+ page_cursor?: PaginationCursor;
11
+ page_back?: boolean;
12
+ limit?: number;
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
2
+ import type { PersonLikedCombinedView } from "./PersonLikedCombinedView";
3
+ /**
4
+ * Your liked posts response.
5
+ */
6
+ export type ListPersonLikedResponse = {
7
+ liked: Array<PersonLikedCombinedView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
13
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,7 +2,7 @@ import type { PersonId } from "./PersonId";
2
2
  import type { PostId } from "./PostId";
3
3
  export type LocalImage = {
4
4
  pictrs_alias: string;
5
- published: string;
5
+ published_at: string;
6
6
  person_id: PersonId;
7
7
  /**
8
8
  * This means the image is an auto-generated thumbnail, for a post.
@@ -42,10 +42,6 @@ export type LocalSite = {
42
42
  * An optional legal disclaimer page.
43
43
  */
44
44
  legal_information?: string;
45
- /**
46
- * Whether to hide mod names on the modlog.
47
- */
48
- hide_modlog_mod_names: boolean;
49
45
  /**
50
46
  * Whether new applications email admins.
51
47
  */
@@ -70,8 +66,8 @@ export type LocalSite = {
70
66
  * The captcha difficulty.
71
67
  */
72
68
  captcha_difficulty: string;
73
- published: string;
74
- updated?: string;
69
+ published_at: string;
70
+ updated_at?: string;
75
71
  registration_mode: RegistrationMode;
76
72
  /**
77
73
  * Whether to email admins on new reports.
@@ -16,8 +16,8 @@ export type LocalSiteRateLimit = {
16
16
  comment_per_second: number;
17
17
  search: number;
18
18
  search_per_second: number;
19
- published: string;
20
- updated?: string;
19
+ published_at: string;
20
+ updated_at?: string;
21
21
  import_user_settings: number;
22
22
  import_user_settings_per_second: number;
23
23
  };
@@ -1,6 +1,6 @@
1
1
  export type LocalSiteUrlBlocklist = {
2
2
  id: number;
3
3
  url: string;
4
- published: string;
5
- updated?: string;
4
+ published_at: string;
5
+ updated_at?: string;
6
6
  };
@@ -89,7 +89,7 @@ export type LocalUser = {
89
89
  * The last time a donation request was shown to this user. If this is more than a year ago,
90
90
  * a new notification request should be shown.
91
91
  */
92
- last_donation_notification: string;
92
+ last_donation_notification_at: string;
93
93
  /**
94
94
  * Whether to hide posts containing images/videos
95
95
  */
@@ -7,7 +7,7 @@ export type LoginToken = {
7
7
  /**
8
8
  * Time of login
9
9
  */
10
- published: string;
10
+ published_at: string;
11
11
  /**
12
12
  * IP address where login was made from, allows invalidating logins by IP address.
13
13
  * Could be stored in truncated format, or store derived information for better privacy.
@@ -8,5 +8,5 @@ export type ModAdd = {
8
8
  mod_person_id: PersonId;
9
9
  other_person_id: PersonId;
10
10
  removed: boolean;
11
- published: string;
11
+ published_at: string;
12
12
  };
@@ -10,5 +10,5 @@ export type ModAddCommunity = {
10
10
  other_person_id: PersonId;
11
11
  community_id: CommunityId;
12
12
  removed: boolean;
13
- published: string;
13
+ published_at: string;
14
14
  };
@@ -10,7 +10,7 @@ export type ModBan = {
10
10
  other_person_id: PersonId;
11
11
  reason?: string;
12
12
  banned: boolean;
13
- expires?: string;
14
- published: string;
13
+ expires_at?: string;
14
+ published_at: string;
15
15
  instance_id: InstanceId;
16
16
  };
@@ -11,6 +11,6 @@ export type ModBanFromCommunity = {
11
11
  community_id: CommunityId;
12
12
  reason?: string;
13
13
  banned: boolean;
14
- expires?: string;
15
- published: string;
14
+ expires_at?: string;
15
+ published_at: string;
16
16
  };
@@ -6,7 +6,6 @@ export type ModChangeCommunityVisibility = {
6
6
  id: ModChangeCommunityVisibilityId;
7
7
  community_id: CommunityId;
8
8
  mod_person_id: PersonId;
9
- published: string;
10
- reason?: string;
9
+ published_at: string;
11
10
  visibility: CommunityVisibility;
12
11
  };
@@ -9,6 +9,6 @@ export type ModFeaturePost = {
9
9
  mod_person_id: PersonId;
10
10
  post_id: PostId;
11
11
  featured: boolean;
12
- published: string;
12
+ published_at: string;
13
13
  is_featured_community: boolean;
14
14
  };
@@ -9,6 +9,6 @@ export type ModLockPost = {
9
9
  mod_person_id: PersonId;
10
10
  post_id: PostId;
11
11
  locked: boolean;
12
- published: string;
12
+ published_at: string;
13
13
  reason?: string;
14
14
  };
@@ -10,5 +10,5 @@ export type ModRemoveComment = {
10
10
  comment_id: CommentId;
11
11
  reason?: string;
12
12
  removed: boolean;
13
- published: string;
13
+ published_at: string;
14
14
  };
@@ -10,5 +10,5 @@ export type ModRemoveCommunity = {
10
10
  community_id: CommunityId;
11
11
  reason?: string;
12
12
  removed: boolean;
13
- published: string;
13
+ published_at: string;
14
14
  };
@@ -10,5 +10,5 @@ export type ModRemovePost = {
10
10
  post_id: PostId;
11
11
  reason?: string;
12
12
  removed: boolean;
13
- published: string;
13
+ published_at: string;
14
14
  };
@@ -9,5 +9,5 @@ export type ModTransferCommunity = {
9
9
  mod_person_id: PersonId;
10
10
  other_person_id: PersonId;
11
11
  community_id: CommunityId;
12
- published: string;
12
+ published_at: string;
13
13
  };
@@ -1,9 +1,11 @@
1
1
  import type { DbUrl } from "./DbUrl";
2
+ import type { InstanceId } from "./InstanceId";
2
3
  import type { MultiCommunityId } from "./MultiCommunityId";
3
4
  import type { PersonId } from "./PersonId";
4
5
  export type MultiCommunity = {
5
6
  id: MultiCommunityId;
6
7
  creator_id: PersonId;
8
+ instance_id: InstanceId;
7
9
  name: string;
8
10
  title?: string;
9
11
  description?: string;
@@ -7,6 +7,6 @@ export type OAuthAccount = {
7
7
  local_user_id: LocalUserId;
8
8
  oauth_provider_id: OAuthProviderId;
9
9
  oauth_user_id: string;
10
- published: string;
11
- updated?: string;
10
+ published_at: string;
11
+ updated_at?: string;
12
12
  };
@@ -54,8 +54,8 @@ export type OAuthProvider = {
54
54
  * switch to enable or disable an oauth provider
55
55
  */
56
56
  enabled: boolean;
57
- published: string;
58
- updated?: string;
57
+ published_at: string;
58
+ updated_at?: string;
59
59
  /**
60
60
  * switch to enable or disable PKCE
61
61
  */
@@ -15,8 +15,8 @@ export type Person = {
15
15
  * A URL for an avatar.
16
16
  */
17
17
  avatar?: DbUrl;
18
- published: string;
19
- updated?: string;
18
+ published_at: string;
19
+ updated_at?: string;
20
20
  /**
21
21
  * The federated ap_id.
22
22
  */
@@ -1,9 +1,6 @@
1
- import type { PersonId } from "./PersonId";
2
1
  export type PersonActions = {
3
- target_id: PersonId;
4
- person_id: PersonId;
5
2
  /**
6
3
  * When the person was blocked.
7
4
  */
8
- blocked?: string;
5
+ blocked_at?: string;
9
6
  };
@@ -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 });
@@ -9,5 +9,5 @@ export type PersonCommentMention = {
9
9
  recipient_id: PersonId;
10
10
  comment_id: CommentId;
11
11
  read: boolean;
12
- published: string;
12
+ published_at: string;
13
13
  };
@@ -0,0 +1,7 @@
1
+ import type { CommentView } from "./CommentView";
2
+ import type { PostView } from "./PostView";
3
+ export type PersonLikedCombinedView = ({
4
+ type_: "Post";
5
+ } & PostView) | ({
6
+ type_: "Comment";
7
+ } & CommentView);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,5 +9,5 @@ export type PersonPostMention = {
9
9
  recipient_id: PersonId;
10
10
  post_id: PostId;
11
11
  read: boolean;
12
- published: string;
12
+ published_at: string;
13
13
  };
@@ -27,8 +27,8 @@ export type Post = {
27
27
  * Whether the post is locked.
28
28
  */
29
29
  locked: boolean;
30
- published: string;
31
- updated?: string;
30
+ published_at: string;
31
+ updated_at?: string;
32
32
  /**
33
33
  * Whether the post is deleted.
34
34
  */
@@ -78,7 +78,7 @@ export type Post = {
78
78
  /**
79
79
  * Time at which the post will be published. None means publish immediately.
80
80
  */
81
- scheduled_publish_time?: string;
81
+ scheduled_publish_time_at?: string;
82
82
  comments: number;
83
83
  score: number;
84
84
  upvotes: number;
@@ -86,7 +86,7 @@ export type Post = {
86
86
  /**
87
87
  * The time of the newest comment in the post.
88
88
  */
89
- newest_comment_time: string;
89
+ newest_comment_time_at: string;
90
90
  report_count: number;
91
91
  unresolved_report_count: number;
92
92
  /**
@@ -1,16 +1,12 @@
1
- import type { PersonId } from "./PersonId";
2
- import type { PostId } from "./PostId";
3
1
  export type PostActions = {
4
- post_id: PostId;
5
- person_id: PersonId;
6
2
  /**
7
3
  * When the post was read.
8
4
  */
9
- read?: string;
5
+ read_at?: string;
10
6
  /**
11
7
  * When was the last time you read the comments.
12
8
  */
13
- read_comments?: string;
9
+ read_comments_at?: string;
14
10
  /**
15
11
  * The number of comments you read last. Subtract this from total comments to get an unread
16
12
  * count.
@@ -19,11 +15,11 @@ export type PostActions = {
19
15
  /**
20
16
  * When the post was saved.
21
17
  */
22
- saved?: string;
18
+ saved_at?: string;
23
19
  /**
24
20
  * When the post was liked.
25
21
  */
26
- liked?: string;
22
+ liked_at?: string;
27
23
  /**
28
24
  * The like / score of the post.
29
25
  */
@@ -31,5 +27,5 @@ export type PostActions = {
31
27
  /**
32
28
  * When the post was hidden.
33
29
  */
34
- hidden?: string;
30
+ hidden_at?: string;
35
31
  };
@@ -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 });
@@ -24,7 +24,7 @@ export type PostReport = {
24
24
  reason: string;
25
25
  resolved: boolean;
26
26
  resolver_id?: PersonId;
27
- published: string;
28
- updated?: string;
27
+ published_at: string;
28
+ updated_at?: string;
29
29
  violates_instance_rules: boolean;
30
30
  };
@@ -11,8 +11,8 @@ export type PrivateMessage = {
11
11
  content: string;
12
12
  deleted: boolean;
13
13
  read: boolean;
14
- published: string;
15
- updated?: string;
14
+ published_at: string;
15
+ updated_at?: string;
16
16
  ap_id: DbUrl;
17
17
  local: boolean;
18
18
  removed: boolean;
@@ -15,6 +15,6 @@ export type PrivateMessageReport = {
15
15
  reason: string;
16
16
  resolved: boolean;
17
17
  resolver_id?: PersonId;
18
- published: string;
19
- updated?: string;
18
+ published_at: string;
19
+ updated_at?: string;
20
20
  };
@@ -10,7 +10,7 @@ export type ReadableFederationState = {
10
10
  * the last successfully sent activity id
11
11
  */
12
12
  last_successful_id?: ActivityId;
13
- last_successful_published_time?: string;
13
+ last_successful_published_time_at?: string;
14
14
  /**
15
15
  * how many failed attempts have been made to send the next activity
16
16
  */
@@ -18,5 +18,5 @@ export type ReadableFederationState = {
18
18
  /**
19
19
  * timestamp of the last retry attempt (when the last failing activity was resent)
20
20
  */
21
- last_retry?: string;
21
+ last_retry_at?: string;
22
22
  };
@@ -10,5 +10,5 @@ export type RegistrationApplication = {
10
10
  answer: string;
11
11
  admin_id?: PersonId;
12
12
  deny_reason?: string;
13
- published: string;
13
+ published_at: string;
14
14
  };
@@ -24,6 +24,10 @@ export type Search = {
24
24
  post_url_only?: boolean;
25
25
  liked_only?: boolean;
26
26
  disliked_only?: boolean;
27
+ /**
28
+ * If true, then show the nsfw posts (even if your user setting is to hide them)
29
+ */
30
+ show_nsfw?: boolean;
27
31
  page_cursor?: PaginationCursor;
28
32
  page_back?: boolean;
29
33
  limit?: number;
@@ -12,8 +12,8 @@ export type Site = {
12
12
  * A sidebar for the site in markdown.
13
13
  */
14
14
  sidebar?: string;
15
- published: string;
16
- updated?: string;
15
+ published_at: string;
16
+ updated_at?: string;
17
17
  /**
18
18
  * An icon URL.
19
19
  */
@@ -4,8 +4,4 @@ import type { SiteView } from "./SiteView";
4
4
  */
5
5
  export type SiteResponse = {
6
6
  site_view: SiteView;
7
- /**
8
- * deprecated, use field `tagline` or /api/v4/tagline/list
9
- */
10
- taglines: Array<null>;
11
7
  };
@@ -23,7 +23,7 @@ export type Tag = {
23
23
  * the community that owns this tag
24
24
  */
25
25
  community_id: CommunityId;
26
- published: string;
27
- updated?: string;
26
+ published_at: string;
27
+ updated_at?: string;
28
28
  deleted: boolean;
29
29
  };
@@ -5,6 +5,6 @@ import type { TaglineId } from "./TaglineId";
5
5
  export type Tagline = {
6
6
  id: TaglineId;
7
7
  content: string;
8
- published: string;
9
- updated?: string;
8
+ published_at: string;
9
+ updated_at?: string;
10
10
  };
@@ -4,7 +4,6 @@ import type { Person } from "./Person";
4
4
  */
5
5
  export type VoteView = {
6
6
  creator: Person;
7
- item_id: number;
8
7
  creator_banned_from_community: boolean;
9
8
  score: number;
10
9
  };
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-multi-community.13",
4
+ "version": "1.0.0-multi-community.15",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "typescript": "^5.5.4",
44
44
  "typescript-eslint": "^8.7.0"
45
45
  },
46
- "packageManager": "pnpm@10.11.0",
46
+ "packageManager": "pnpm@10.12.1",
47
47
  "types": "./dist/index.d.ts",
48
48
  "lint-staged": {
49
49
  "*.{ts,tsx,js}": [
@@ -1,15 +0,0 @@
1
- import type { CommentView } from "./CommentView";
2
- import type { CommunityView } from "./CommunityView";
3
- import type { MultiCommunity } from "./MultiCommunity";
4
- import type { PersonView } from "./PersonView";
5
- import type { PostView } from "./PostView";
6
- /**
7
- * The response of an apub object fetch.
8
- */
9
- export type ResolveObjectResponse = {
10
- comment?: CommentView;
11
- post?: PostView;
12
- community?: CommunityView;
13
- person?: PersonView;
14
- multi_community?: MultiCommunity;
15
- };