lemmy-js-client 1.0.0-bool-vote.0 → 1.0.0-bool-vote.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
@@ -9,11 +9,8 @@ import { BanFromCommunity } from "./types/BanFromCommunity";
9
9
  import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
10
10
  import { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
11
11
  import { BanPerson } from "./types/BanPerson";
12
- import { BanPersonResponse } from "./types/BanPersonResponse";
13
12
  import { BlockCommunity } from "./types/BlockCommunity";
14
- import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
15
13
  import { BlockPerson } from "./types/BlockPerson";
16
- import { BlockPersonResponse } from "./types/BlockPersonResponse";
17
14
  import { ChangePassword } from "./types/ChangePassword";
18
15
  import { CommentReportResponse } from "./types/CommentReportResponse";
19
16
  import { CommentResponse } from "./types/CommentResponse";
@@ -149,6 +146,8 @@ import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
149
146
  import { ModEditPost } from "./types/ModEditPost";
150
147
  import { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
151
148
  import { UpdatePostNotifications } from "./types/UpdatePostNotifications";
149
+ import { MultiCommunityResponse } from "./types/MultiCommunityResponse";
150
+ import { PersonResponse } from "./types/PersonResponse";
152
151
  type RequestOptions = Pick<RequestInit, "signal">;
153
152
  /**
154
153
  * Helps build lemmy HTTP requests.
@@ -283,7 +282,7 @@ export declare class LemmyHttp extends Controller {
283
282
  /**
284
283
  * @summary Block a community.
285
284
  */
286
- blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<BlockCommunityResponse>;
285
+ blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<CommunityResponse>;
287
286
  /**
288
287
  * @summary Delete a community.
289
288
  */
@@ -495,7 +494,7 @@ export declare class LemmyHttp extends Controller {
495
494
  /**
496
495
  * @summary Ban a person from your site.
497
496
  */
498
- banPerson(form: BanPerson, options?: RequestOptions): Promise<BanPersonResponse>;
497
+ banPerson(form: BanPerson, options?: RequestOptions): Promise<PersonResponse>;
499
498
  /**
500
499
  * @summary Get a list of users.
501
500
  */
@@ -503,7 +502,7 @@ export declare class LemmyHttp extends Controller {
503
502
  /**
504
503
  * @summary Block a person.
505
504
  */
506
- blockPerson(form: BlockPerson, options?: RequestOptions): Promise<BlockPersonResponse>;
505
+ blockPerson(form: BlockPerson, options?: RequestOptions): Promise<PersonResponse>;
507
506
  /**
508
507
  * @summary Fetch a Captcha.
509
508
  */
@@ -752,13 +751,13 @@ export declare class LemmyHttp extends Controller {
752
751
  * Mark donation dialog as shown, so it isn't displayed anymore.
753
752
  */
754
753
  donationDialogShown(options?: RequestOptions): Promise<SuccessResponse>;
755
- createMultiCommunity(form: CreateMultiCommunity, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
756
- updateMultiCommunity(form: UpdateMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
754
+ createMultiCommunity(form: CreateMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
755
+ updateMultiCommunity(form: UpdateMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
757
756
  getMultiCommunity(form: GetMultiCommunityI, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
758
- createMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
757
+ createMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<CommunityResponse>;
759
758
  deleteMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
760
759
  listMultiCommunities(form: ListMultiCommunitiesI, options?: RequestOptions): Promise<ListMultiCommunitiesResponse>;
761
- followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
760
+ followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
762
761
  /**
763
762
  * @summary Change notification settings for a community
764
763
  */
package/dist/http.js CHANGED
@@ -1018,7 +1018,7 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
1018
1018
  throw new LemmyError(response.statusText, response.status);
1019
1019
  }
1020
1020
  if (!response.ok) {
1021
- console.error(`Request error while calling ${type_} ${endpoint} with ${form}`);
1021
+ console.error(`Request error while calling ${type_} ${endpoint} with ${JSON.stringify(form)}`);
1022
1022
  let err = new LemmyError(json.error ?? response.statusText, response.status, json.message);
1023
1023
  throw err;
1024
1024
  }
package/dist/index.d.ts CHANGED
@@ -43,11 +43,8 @@ export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
43
43
  export { BanFromCommunity } from "./types/BanFromCommunity";
44
44
  export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
45
45
  export { BanPerson } from "./types/BanPerson";
46
- export { BanPersonResponse } from "./types/BanPersonResponse";
47
46
  export { BlockCommunity } from "./types/BlockCommunity";
48
- export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
49
47
  export { BlockPerson } from "./types/BlockPerson";
50
- export { BlockPersonResponse } from "./types/BlockPersonResponse";
51
48
  export { CaptchaResponse } from "./types/CaptchaResponse";
52
49
  export { ChangePassword } from "./types/ChangePassword";
53
50
  export { Comment } from "./types/Comment";
@@ -253,6 +250,7 @@ export { ModlogCombinedView } from "./types/ModlogCombinedView";
253
250
  export { MultiCommunity } from "./types/MultiCommunity";
254
251
  export { MultiCommunityFollow } from "./types/MultiCommunityFollow";
255
252
  export { MultiCommunityId } from "./types/MultiCommunityId";
253
+ export { MultiCommunityResponse } from "./types/MultiCommunityResponse";
256
254
  export { MultiCommunityView } from "./types/MultiCommunityView";
257
255
  export { MyUserInfo } from "./types/MyUserInfo";
258
256
  export { NotePerson } from "./types/NotePerson";
@@ -276,6 +274,7 @@ export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
276
274
  export { PersonContentType } from "./types/PersonContentType";
277
275
  export { PersonId } from "./types/PersonId";
278
276
  export { PersonLikedCombinedView } from "./types/PersonLikedCombinedView";
277
+ export { PersonResponse } from "./types/PersonResponse";
279
278
  export { PersonSavedCombinedView } from "./types/PersonSavedCombinedView";
280
279
  export { PersonView } from "./types/PersonView";
281
280
  export { PluginMetadata } from "./types/PluginMetadata";
@@ -20,12 +20,10 @@ exports.AllLemmyErrors = [
20
20
  "cannot_leave_mod",
21
21
  "cannot_leave_mod",
22
22
  "cannot_leave_mod",
23
- "image_url_missing_path_segments",
24
- "image_url_missing_last_path_segment",
23
+ "pictrs_api_key_not_provided",
25
24
  "pictrs_api_key_not_provided",
26
25
  "no_content_type_header",
27
26
  "not_an_image_type",
28
- "invalid_image_upload",
29
27
  "image_upload_disabled",
30
28
  "not_a_mod_or_admin",
31
29
  "not_top_mod",
@@ -1,4 +1,5 @@
1
1
  import type { MultiCommunityId } from "./MultiCommunityId";
2
2
  export type GetMultiCommunity = {
3
- id: MultiCommunityId;
3
+ id?: MultiCommunityId;
4
+ name?: string;
4
5
  };
@@ -40,18 +40,15 @@ export type LemmyErrorType = {
40
40
  } | {
41
41
  error: "pictrs_purge_response_error";
42
42
  message: string;
43
- } | {
44
- error: "image_url_missing_path_segments";
45
- } | {
46
- error: "image_url_missing_last_path_segment";
47
43
  } | {
48
44
  error: "pictrs_api_key_not_provided";
45
+ } | {
46
+ error: "pictrs_invalid_image_upload";
47
+ message: string;
49
48
  } | {
50
49
  error: "no_content_type_header";
51
50
  } | {
52
51
  error: "not_an_image_type";
53
- } | {
54
- error: "invalid_image_upload";
55
52
  } | {
56
53
  error: "image_upload_disabled";
57
54
  } | {
@@ -0,0 +1,4 @@
1
+ import type { MultiCommunityView } from "./MultiCommunityView";
2
+ export type MultiCommunityResponse = {
3
+ multi_community_view: MultiCommunityView;
4
+ };
@@ -1,6 +1,8 @@
1
+ import type { CommunityFollowerState } from "./CommunityFollowerState";
1
2
  import type { MultiCommunity } from "./MultiCommunity";
2
3
  import type { Person } from "./Person";
3
4
  export type MultiCommunityView = {
4
5
  multi: MultiCommunity;
6
+ follow_state?: CommunityFollowerState;
5
7
  owner: Person;
6
8
  };
@@ -0,0 +1,7 @@
1
+ import type { PersonView } from "./PersonView";
2
+ /**
3
+ * A person response for actions done to a person.
4
+ */
5
+ export type PersonResponse = {
6
+ person_view: PersonView;
7
+ };
@@ -9,4 +9,4 @@ export type UntranslatedError = "InvalidCommunity" | "CannotCreatePostOrCommentI
9
9
  DomainNotInAllowList: string;
10
10
  } | "FederationDisabledByStrictAllowList" | "ContradictingFilters" | "UrlWithoutDomain" | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" | "ObjectIsNotPrivate" | {
11
11
  InvalidFollow: string;
12
- } | "Unreachable" | "CouldntSendWebmention" | "CommunityHasNoFollowers";
12
+ } | "PurgeInvalidImageUrl" | "Unreachable" | "CouldntSendWebmention" | "CommunityHasNoFollowers";
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-bool-vote.0",
4
+ "version": "1.0.0-bool-vote.1",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -1,8 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- /**
3
- * A response for a banned person.
4
- */
5
- export type BanPersonResponse = {
6
- person_view: PersonView;
7
- banned: boolean;
8
- };
@@ -1,8 +0,0 @@
1
- import type { CommunityView } from "./CommunityView";
2
- /**
3
- * The block community response.
4
- */
5
- export type BlockCommunityResponse = {
6
- community_view: CommunityView;
7
- blocked: boolean;
8
- };
@@ -1,8 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- /**
3
- * The response for a person block.
4
- */
5
- export type BlockPersonResponse = {
6
- person_view: PersonView;
7
- blocked: boolean;
8
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });