lemmy-js-client 0.20.0-image-api-rework.6 → 0.20.0-image-api-rework.7

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 (28) hide show
  1. package/dist/http.d.ts +8 -24
  2. package/dist/http.js +8 -24
  3. package/dist/index.d.ts +6 -6
  4. package/dist/types/AdminAllowInstance.d.ts +1 -1
  5. package/dist/types/AdminBlockInstance.d.ts +1 -1
  6. package/dist/types/AuthenticateWithOauth.d.ts +1 -1
  7. package/dist/types/GetPosts.d.ts +1 -0
  8. package/dist/types/GetReportCountResponse.d.ts +1 -5
  9. package/dist/types/GetReportCountResponse.js +1 -0
  10. package/dist/types/{ListCommentReports.d.ts → ListReports.d.ts} +5 -6
  11. package/dist/types/ListReportsResponse.d.ts +7 -0
  12. package/dist/types/ReportCombined.d.ts +14 -0
  13. package/dist/types/ReportCombinedId.d.ts +4 -0
  14. package/dist/types/ReportCombinedPaginationCursor.d.ts +4 -0
  15. package/dist/types/ReportCombinedPaginationCursor.js +3 -0
  16. package/dist/types/ReportCombinedView.d.ts +10 -0
  17. package/package.json +1 -1
  18. package/dist/types/ListCommentReportsResponse.d.ts +0 -7
  19. package/dist/types/ListPostReports.d.ts +0 -18
  20. package/dist/types/ListPostReportsResponse.d.ts +0 -7
  21. package/dist/types/ListPrivateMessageReports.d.ts +0 -11
  22. package/dist/types/ListPrivateMessageReportsResponse.d.ts +0 -7
  23. package/dist/types/ListPrivateMessageReportsResponse.js +0 -2
  24. /package/dist/types/{ListCommentReports.js → ListReports.js} +0 -0
  25. /package/dist/types/{ListCommentReportsResponse.js → ListReportsResponse.js} +0 -0
  26. /package/dist/types/{ListPostReports.js → ReportCombined.js} +0 -0
  27. /package/dist/types/{ListPrivateMessageReports.js → ReportCombinedId.js} +0 -0
  28. /package/dist/types/{ListPostReportsResponse.js → ReportCombinedView.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -76,14 +76,8 @@ import { GetSiteMetadataResponse } from "./types/GetSiteMetadataResponse";
76
76
  import { GetSiteResponse } from "./types/GetSiteResponse";
77
77
  import { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
78
78
  import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
79
- import { ListCommentReports } from "./types/ListCommentReports";
80
- import { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
81
79
  import { ListCommunities } from "./types/ListCommunities";
82
80
  import { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
83
- import { ListPostReports } from "./types/ListPostReports";
84
- import { ListPostReportsResponse } from "./types/ListPostReportsResponse";
85
- import { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
86
- import { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageReportsResponse";
87
81
  import { ListRegistrationApplications } from "./types/ListRegistrationApplications";
88
82
  import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
89
83
  import { LockPost } from "./types/LockPost";
@@ -153,6 +147,8 @@ import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPen
153
147
  import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
154
148
  import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
155
149
  import { CommunityId } from "./types/CommunityId";
150
+ import { ListReports } from "./types/ListReports";
151
+ import { ListReportsResponse } from "./types/ListReportsResponse";
156
152
  import { MyUserInfo } from "./types/MyUserInfo";
157
153
  import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
158
154
  import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
@@ -456,12 +452,6 @@ export declare class LemmyHttp {
456
452
  * `HTTP.PUT /post/report/resolve`
457
453
  */
458
454
  resolvePostReport(form: ResolvePostReport, options?: RequestOptions): Promise<PostReportResponse>;
459
- /**
460
- * List post reports.
461
- *
462
- * `HTTP.GET /post/report/list`
463
- */
464
- listPostReports(form: ListPostReports, options?: RequestOptions): Promise<ListPostReportsResponse>;
465
455
  /**
466
456
  * Fetch metadata for any given site.
467
457
  *
@@ -546,12 +536,6 @@ export declare class LemmyHttp {
546
536
  * `HTTP.PUT /comment/report/resolve`
547
537
  */
548
538
  resolveCommentReport(form: ResolveCommentReport, options?: RequestOptions): Promise<CommentReportResponse>;
549
- /**
550
- * List comment reports.
551
- *
552
- * `HTTP.GET /comment/report/list`
553
- */
554
- listCommentReports(form: ListCommentReports, options?: RequestOptions): Promise<ListCommentReportsResponse>;
555
539
  /**
556
540
  * Get / fetch private messages.
557
541
  *
@@ -594,12 +578,6 @@ export declare class LemmyHttp {
594
578
  * `HTTP.PUT /private_message/report/resolve`
595
579
  */
596
580
  resolvePrivateMessageReport(form: ResolvePrivateMessageReport, options?: RequestOptions): Promise<PrivateMessageReportResponse>;
597
- /**
598
- * List private message reports.
599
- *
600
- * `HTTP.GET /private_message/report/list`
601
- */
602
- listPrivateMessageReports(form: ListPrivateMessageReports, options?: RequestOptions): Promise<ListPrivateMessageReportsResponse>;
603
581
  /**
604
582
  * Register a new user.
605
583
  *
@@ -858,6 +836,12 @@ export declare class LemmyHttp {
858
836
  * `HTTP.Get /federated_instances`
859
837
  */
860
838
  getFederatedInstances(options?: RequestOptions): Promise<GetFederatedInstancesResponse>;
839
+ /**
840
+ * List user reports.
841
+ *
842
+ * `HTTP.GET /report/list`
843
+ */
844
+ listReports(form: ListReports, options?: RequestOptions): Promise<ListReportsResponse>;
861
845
  /**
862
846
  * Block an instance as user.
863
847
  *
package/dist/http.js CHANGED
@@ -429,14 +429,6 @@ class LemmyHttp {
429
429
  resolvePostReport(form, options) {
430
430
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/report/resolve", form, options);
431
431
  }
432
- /**
433
- * List post reports.
434
- *
435
- * `HTTP.GET /post/report/list`
436
- */
437
- listPostReports(form, options) {
438
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/report/list", form, options);
439
- }
440
432
  /**
441
433
  * Fetch metadata for any given site.
442
434
  *
@@ -549,14 +541,6 @@ class LemmyHttp {
549
541
  resolveCommentReport(form, options) {
550
542
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/report/resolve", form, options);
551
543
  }
552
- /**
553
- * List comment reports.
554
- *
555
- * `HTTP.GET /comment/report/list`
556
- */
557
- listCommentReports(form, options) {
558
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/report/list", form, options);
559
- }
560
544
  /**
561
545
  * Get / fetch private messages.
562
546
  *
@@ -613,14 +597,6 @@ class LemmyHttp {
613
597
  resolvePrivateMessageReport(form, options) {
614
598
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message/report/resolve", form, options);
615
599
  }
616
- /**
617
- * List private message reports.
618
- *
619
- * `HTTP.GET /private_message/report/list`
620
- */
621
- listPrivateMessageReports(form, options) {
622
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/report/list", form, options);
623
- }
624
600
  /**
625
601
  * Register a new user.
626
602
  *
@@ -965,6 +941,14 @@ class LemmyHttp {
965
941
  getFederatedInstances(options) {
966
942
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {}, options);
967
943
  }
944
+ /**
945
+ * List user reports.
946
+ *
947
+ * `HTTP.GET /report/list`
948
+ */
949
+ listReports(form, options) {
950
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/report/list", form, options);
951
+ }
968
952
  /**
969
953
  * Block an instance as user.
970
954
  *
package/dist/index.d.ts CHANGED
@@ -145,8 +145,6 @@ export { LemmyErrorType } from "./types/LemmyErrorType";
145
145
  export { LinkMetadata } from "./types/LinkMetadata";
146
146
  export { ListCommentLikes } from "./types/ListCommentLikes";
147
147
  export { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
148
- export { ListCommentReports } from "./types/ListCommentReports";
149
- export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
150
148
  export { ListCommunities } from "./types/ListCommunities";
151
149
  export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
152
150
  export { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
@@ -158,12 +156,10 @@ export { ListMedia } from "./types/ListMedia";
158
156
  export { ListMediaResponse } from "./types/ListMediaResponse";
159
157
  export { ListPostLikes } from "./types/ListPostLikes";
160
158
  export { ListPostLikesResponse } from "./types/ListPostLikesResponse";
161
- export { ListPostReports } from "./types/ListPostReports";
162
- export { ListPostReportsResponse } from "./types/ListPostReportsResponse";
163
- export { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
164
- export { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageReportsResponse";
165
159
  export { ListRegistrationApplications } from "./types/ListRegistrationApplications";
166
160
  export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
161
+ export { ListReports } from "./types/ListReports";
162
+ export { ListReportsResponse } from "./types/ListReportsResponse";
167
163
  export { ListTaglines } from "./types/ListTaglines";
168
164
  export { ListTaglinesResponse } from "./types/ListTaglinesResponse";
169
165
  export { ListingType } from "./types/ListingType";
@@ -263,6 +259,10 @@ export { RegistrationMode } from "./types/RegistrationMode";
263
259
  export { RemoveComment } from "./types/RemoveComment";
264
260
  export { RemoveCommunity } from "./types/RemoveCommunity";
265
261
  export { RemovePost } from "./types/RemovePost";
262
+ export { ReportCombined } from "./types/ReportCombined";
263
+ export { ReportCombinedId } from "./types/ReportCombinedId";
264
+ export { ReportCombinedPaginationCursor } from "./types/ReportCombinedPaginationCursor";
265
+ export { ReportCombinedView } from "./types/ReportCombinedView";
266
266
  export { ResolveCommentReport } from "./types/ResolveCommentReport";
267
267
  export { ResolveObject } from "./types/ResolveObject";
268
268
  export { ResolveObjectResponse } from "./types/ResolveObjectResponse";
@@ -6,5 +6,5 @@ export type AdminAllowInstance = {
6
6
  admin_person_id: PersonId;
7
7
  allowed: boolean;
8
8
  reason?: string;
9
- published: string;
9
+ when_: string;
10
10
  };
@@ -7,5 +7,5 @@ export type AdminBlockInstance = {
7
7
  blocked: boolean;
8
8
  reason?: string;
9
9
  expires?: string;
10
- published: string;
10
+ when_: string;
11
11
  };
@@ -4,7 +4,6 @@ import type { OAuthProviderId } from "./OAuthProviderId";
4
4
  */
5
5
  export type AuthenticateWithOauth = {
6
6
  code: string;
7
- pkce_code_verifier?: string;
8
7
  oauth_provider_id: OAuthProviderId;
9
8
  redirect_uri: string;
10
9
  show_nsfw?: boolean;
@@ -16,4 +15,5 @@ export type AuthenticateWithOauth = {
16
15
  * An answer is mandatory if require application is enabled on the server
17
16
  */
18
17
  answer?: string;
18
+ pkce_code_verifier?: string;
19
19
  };
@@ -36,4 +36,5 @@ export type GetPosts = {
36
36
  */
37
37
  no_comments_only?: boolean;
38
38
  page_cursor?: PaginationCursor;
39
+ page_back?: boolean;
39
40
  };
@@ -1,10 +1,6 @@
1
- import type { CommunityId } from "./CommunityId";
2
1
  /**
3
2
  * A response for the number of reports.
4
3
  */
5
4
  export type GetReportCountResponse = {
6
- community_id?: CommunityId;
7
- comment_reports: number;
8
- post_reports: number;
9
- private_message_reports?: number;
5
+ count: number;
10
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 });
@@ -1,12 +1,9 @@
1
- import type { CommentId } from "./CommentId";
2
1
  import type { CommunityId } from "./CommunityId";
2
+ import type { ReportCombinedPaginationCursor } from "./ReportCombinedPaginationCursor";
3
3
  /**
4
- * List comment reports.
4
+ * List reports.
5
5
  */
6
- export type ListCommentReports = {
7
- comment_id?: CommentId;
8
- page?: number;
9
- limit?: number;
6
+ export type ListReports = {
10
7
  /**
11
8
  * Only shows the unresolved reports
12
9
  */
@@ -15,4 +12,6 @@ export type ListCommentReports = {
15
12
  * if no community is given, it returns reports for all communities moderated by the auth user
16
13
  */
17
14
  community_id?: CommunityId;
15
+ page_cursor?: ReportCombinedPaginationCursor;
16
+ page_back?: boolean;
18
17
  };
@@ -0,0 +1,7 @@
1
+ import type { ReportCombinedView } from "./ReportCombinedView";
2
+ /**
3
+ * The post reports response.
4
+ */
5
+ export type ListReportsResponse = {
6
+ reports: Array<ReportCombinedView>;
7
+ };
@@ -0,0 +1,14 @@
1
+ import type { CommentReportId } from "./CommentReportId";
2
+ import type { PostReportId } from "./PostReportId";
3
+ import type { PrivateMessageReportId } from "./PrivateMessageReportId";
4
+ import type { ReportCombinedId } from "./ReportCombinedId";
5
+ /**
6
+ * A combined reports table.
7
+ */
8
+ export type ReportCombined = {
9
+ id: ReportCombinedId;
10
+ published: string;
11
+ post_report_id?: PostReportId;
12
+ comment_report_id?: CommentReportId;
13
+ private_message_report_id?: PrivateMessageReportId;
14
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The report combined id
3
+ */
4
+ export type ReportCombinedId = number;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * like PaginationCursor but for the report_combined table
3
+ */
4
+ export type ReportCombinedPaginationCursor = string;
@@ -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,10 @@
1
+ import type { CommentReportView } from "./CommentReportView";
2
+ import type { PostReportView } from "./PostReportView";
3
+ import type { PrivateMessageReportView } from "./PrivateMessageReportView";
4
+ export type ReportCombinedView = ({
5
+ type_: "Post";
6
+ } & PostReportView) | ({
7
+ type_: "Comment";
8
+ } & CommentReportView) | ({
9
+ type_: "PrivateMessage";
10
+ } & PrivateMessageReportView);
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-image-api-rework.6",
4
+ "version": "0.20.0-image-api-rework.7",
5
5
  "author": "Dessalines <tyhou13@gmx.com>",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -1,7 +0,0 @@
1
- import type { CommentReportView } from "./CommentReportView";
2
- /**
3
- * The comment report list response.
4
- */
5
- export type ListCommentReportsResponse = {
6
- comment_reports: Array<CommentReportView>;
7
- };
@@ -1,18 +0,0 @@
1
- import type { CommunityId } from "./CommunityId";
2
- import type { PostId } from "./PostId";
3
- /**
4
- * List post reports.
5
- */
6
- export type ListPostReports = {
7
- page?: number;
8
- limit?: number;
9
- /**
10
- * Only shows the unresolved reports
11
- */
12
- unresolved_only?: boolean;
13
- /**
14
- * if no community is given, it returns reports for all communities moderated by the auth user
15
- */
16
- community_id?: CommunityId;
17
- post_id?: PostId;
18
- };
@@ -1,7 +0,0 @@
1
- import type { PostReportView } from "./PostReportView";
2
- /**
3
- * The post reports response.
4
- */
5
- export type ListPostReportsResponse = {
6
- post_reports: Array<PostReportView>;
7
- };
@@ -1,11 +0,0 @@
1
- /**
2
- * List private message reports.
3
- */
4
- export type ListPrivateMessageReports = {
5
- page?: number;
6
- limit?: number;
7
- /**
8
- * Only shows the unresolved reports
9
- */
10
- unresolved_only?: boolean;
11
- };
@@ -1,7 +0,0 @@
1
- import type { PrivateMessageReportView } from "./PrivateMessageReportView";
2
- /**
3
- * The response for list private message reports.
4
- */
5
- export type ListPrivateMessageReportsResponse = {
6
- private_message_reports: Array<PrivateMessageReportView>;
7
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });