lemmy-js-client 1.0.0-enum-for-api.5 → 1.0.0-enum-for-api.6

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.
@@ -2,5 +2,10 @@ export type AdminBlockInstanceParams = {
2
2
  instance: string;
3
3
  block: boolean;
4
4
  reason: string;
5
- expires_at?: string;
5
+ /**
6
+ * A time that the block will expire, in unix epoch seconds.
7
+ *
8
+ * An i64 unix timestamp is used for a simpler API client implementation.
9
+ */
10
+ expires_at?: number;
6
11
  };
@@ -1,6 +1,5 @@
1
1
  import type { CommentId } from "./CommentId";
2
2
  import type { CommentSortType } from "./CommentSortType";
3
- import type { CommunityId } from "./CommunityId";
4
3
  import type { ListingType } from "./ListingType";
5
4
  import type { NameOrId } from "./NameOrId";
6
5
  import type { PaginationCursor } from "./PaginationCursor";
@@ -23,7 +22,7 @@ export type GetComments = {
23
22
  /**
24
23
  * Example: `star_trek`, or `star_trek@xyz.tld` or `12`
25
24
  */
26
- community_name_or_id?: NameOrId<CommunityId>;
25
+ community_name_or_id?: NameOrId;
27
26
  post_id?: PostId;
28
27
  parent_id?: CommentId;
29
28
  };
@@ -1,4 +1,3 @@
1
- import type { CommunityId } from "./CommunityId";
2
1
  import type { NameOrId } from "./NameOrId";
3
2
  /**
4
3
  * Get a community. Must provide either an id, or a name (eg star_trek or star_trek@xyz.tld).
@@ -7,5 +6,5 @@ export type GetCommunity = {
7
6
  /**
8
7
  * Example: `star_trek`, or `star_trek@xyz.tld` or `12`
9
8
  */
10
- name_or_id: NameOrId<CommunityId>;
9
+ name_or_id: NameOrId;
11
10
  };
@@ -1,5 +1,4 @@
1
- import type { MultiCommunityId } from "./MultiCommunityId";
2
1
  import type { NameOrId } from "./NameOrId";
3
2
  export type GetMultiCommunity = {
4
- name_or_id: NameOrId<MultiCommunityId>;
3
+ name_or_id: NameOrId;
5
4
  };
@@ -1,5 +1,4 @@
1
1
  import type { NameOrId } from "./NameOrId";
2
- import type { PersonId } from "./PersonId";
3
2
  /**
4
3
  * Gets a person's details.
5
4
  */
@@ -7,5 +6,5 @@ export type GetPersonDetails = {
7
6
  /**
8
7
  * Example: `dessalines`, or `dessalines@xyz.tld`, or `12`
9
8
  */
10
- person_name_or_id: NameOrId<PersonId>;
9
+ person_name_or_id: NameOrId;
11
10
  };
@@ -1,6 +1,4 @@
1
- import type { CommunityId } from "./CommunityId";
2
1
  import type { ListingType } from "./ListingType";
3
- import type { MultiCommunityId } from "./MultiCommunityId";
4
2
  import type { NameOrId } from "./NameOrId";
5
3
  import type { PaginationCursor } from "./PaginationCursor";
6
4
  import type { PostSortType } from "./PostSortType";
@@ -19,8 +17,8 @@ export type GetPosts = {
19
17
  /**
20
18
  * Example: `star_trek`, or `star_trek@xyz.tld` or `12`
21
19
  */
22
- community_name_or_id?: NameOrId<CommunityId>;
23
- multi_community_name_or_id?: NameOrId<MultiCommunityId>;
20
+ community_name_or_id?: NameOrId;
21
+ multi_community_name_or_id?: NameOrId;
24
22
  show_hidden?: boolean;
25
23
  /**
26
24
  * If true, then show the read posts (even if your user setting is to hide them)
@@ -1,7 +1,6 @@
1
1
  import type { NameOrId } from "./NameOrId";
2
2
  import type { PaginationCursor } from "./PaginationCursor";
3
3
  import type { PersonContentType } from "./PersonContentType";
4
- import type { PersonId } from "./PersonId";
5
4
  /**
6
5
  * Gets a person's content (posts and comments)
7
6
  */
@@ -10,7 +9,7 @@ export type ListPersonContent = {
10
9
  /**
11
10
  * Example: `dessalines`, or `dessalines@xyz.tld`, or `12`
12
11
  */
13
- person_name_or_id: NameOrId<PersonId>;
12
+ person_name_or_id: NameOrId;
14
13
  page_cursor?: PaginationCursor;
15
14
  page_back?: boolean;
16
15
  limit?: number;
@@ -1,4 +1,8 @@
1
1
  /**
2
2
  * Takes either a name or a numeric ID. For example `main`, `main@lemmy.ml` or `12`.
3
3
  */
4
- export type NameOrId<T> = string | T;
4
+ export type NameOrId = {
5
+ Name: string;
6
+ } | {
7
+ Id: number;
8
+ };
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-enum-for-api.5",
4
+ "version": "1.0.0-enum-for-api.6",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",