lemmy-js-client 0.17.0-rc.59 → 0.17.0-rc.60

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/utils.d.ts CHANGED
@@ -1,9 +0,0 @@
1
- import { Option } from "@sniptt/monads";
2
- /**
3
- * Converts an option to an undefined. Necessary for API requests.
4
- */
5
- export declare function toUndefined<T>(opt: Option<T>): T;
6
- /**
7
- * Converts a null value to an option.
8
- */
9
- export declare function toOption<T>(val: T): Option<T>;
package/dist/utils.js CHANGED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toOption = exports.toUndefined = void 0;
4
- var monads_1 = require("@sniptt/monads");
5
- /**
6
- * Converts an option to an undefined. Necessary for API requests.
7
- */
8
- function toUndefined(opt) {
9
- return opt.isSome() ? opt.unwrap() : undefined;
10
- }
11
- exports.toUndefined = toUndefined;
12
- /**
13
- * Converts a null value to an option.
14
- */
15
- function toOption(val) {
16
- return (0, monads_1.Some)(val || undefined);
17
- }
18
- exports.toOption = toOption;
@@ -1,4 +1,3 @@
1
- import { ClassConstructor } from "class-transformer";
2
1
  import { CreateComment, CreateCommentLike, CreateCommentReport, DeleteComment, EditComment, GetComments, ListCommentReports, RemoveComment, ResolveCommentReport, SaveComment } from "./interfaces/api/comment";
3
2
  import { AddModToCommunity, BanFromCommunity, BlockCommunity, CreateCommunity, DeleteCommunity, EditCommunity, FollowCommunity, GetCommunity, ListCommunities, RemoveCommunity, TransferCommunity } from "./interfaces/api/community";
4
3
  import { AddAdmin, BanPerson, BlockPerson, ChangePassword, CreatePrivateMessage, CreatePrivateMessageReport, DeleteAccount, DeletePrivateMessage, EditPrivateMessage, GetBannedPersons, GetPersonDetails, GetPersonMentions, GetPrivateMessages, GetReplies, GetReportCount, GetUnreadCount, ListPrivateMessageReports, Login, MarkAllAsRead, MarkCommentReplyAsRead, MarkPersonMentionAsRead, MarkPrivateMessageAsRead, PasswordChange, PasswordReset, Register, ResolvePrivateMessageReport, SaveUserSettings, VerifyEmail } from "./interfaces/api/person";
@@ -356,4 +355,4 @@ export declare function wsUserOp(msg: any): UserOperation;
356
355
  /**
357
356
  * Converts a websocket string response to a usable result
358
357
  */
359
- export declare function wsJsonToRes<ResponseType>(msg: any, responseClass: ClassConstructor<ResponseType>): ResponseType;
358
+ export declare function wsJsonToRes<ResponseType>(msg: any): ResponseType;
package/dist/websocket.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.wsJsonToRes = exports.wsUserOp = exports.LemmyWebsocket = void 0;
4
- var class_transformer_1 = require("class-transformer");
5
4
  var others_1 = require("./interfaces/others");
6
5
  /**
7
6
  * Helps build lemmy websocket message requests, that you can use in your Websocket sends.
@@ -517,7 +516,7 @@ var LemmyWebsocket = /** @class */ (function () {
517
516
  }());
518
517
  exports.LemmyWebsocket = LemmyWebsocket;
519
518
  function wrapper(op, data) {
520
- var send = (0, class_transformer_1.serialize)({ op: others_1.UserOperation[op], data: data });
519
+ var send = JSON.stringify({ op: others_1.UserOperation[op], data: data });
521
520
  return send;
522
521
  }
523
522
  function wsUserOp(msg) {
@@ -528,8 +527,9 @@ exports.wsUserOp = wsUserOp;
528
527
  /**
529
528
  * Converts a websocket string response to a usable result
530
529
  */
531
- function wsJsonToRes(msg, responseClass) {
530
+ // TODO is this still necessary?
531
+ function wsJsonToRes(msg) {
532
532
  // Have to deserialize the response again into the correct class
533
- return (0, class_transformer_1.deserialize)(responseClass, (0, class_transformer_1.serialize)(msg.data));
533
+ return msg.data;
534
534
  }
535
535
  exports.wsJsonToRes = wsJsonToRes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
- "version": "0.17.0-rc.59",
3
+ "version": "0.17.0-rc.60",
4
4
  "description": "A javascript / typescript client for Lemmy",
5
5
  "repository": "https://github.com/LemmyNet/lemmy-js-client",
6
6
  "license": "AGPL-3.0",
@@ -26,10 +26,7 @@
26
26
  ]
27
27
  },
28
28
  "dependencies": {
29
- "@sniptt/monads": "^0.5.10",
30
- "class-transformer": "^0.5.1",
31
- "node-fetch": "2.6.6",
32
- "reflect-metadata": "^0.1.13"
29
+ "node-fetch": "2.6.6"
33
30
  },
34
31
  "devDependencies": {
35
32
  "@types/node": "^18.6.2",