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/http.js +85 -100
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/interfaces/api/comment.d.ts +38 -50
- package/dist/interfaces/api/comment.js +0 -393
- package/dist/interfaces/api/community.d.ts +45 -58
- package/dist/interfaces/api/community.js +0 -466
- package/dist/interfaces/api/person.d.ts +106 -136
- package/dist/interfaces/api/person.js +0 -1004
- package/dist/interfaces/api/post.d.ts +47 -64
- package/dist/interfaces/api/post.js +0 -475
- package/dist/interfaces/api/site.d.ts +142 -157
- package/dist/interfaces/api/site.js +0 -1520
- package/dist/interfaces/others.d.ts +5 -7
- package/dist/interfaces/others.js +1 -63
- package/dist/interfaces/source.d.ts +97 -98
- package/dist/interfaces/source.js +1 -905
- package/dist/interfaces/views.d.ts +57 -59
- package/dist/interfaces/views.js +0 -772
- package/dist/utils.d.ts +0 -9
- package/dist/utils.js +0 -18
- package/dist/websocket.d.ts +1 -2
- package/dist/websocket.js +4 -4
- package/package.json +2 -5
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;
|
package/dist/websocket.d.ts
CHANGED
@@ -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
|
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 =
|
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
|
-
|
530
|
+
// TODO is this still necessary?
|
531
|
+
function wsJsonToRes(msg) {
|
532
532
|
// Have to deserialize the response again into the correct class
|
533
|
-
return
|
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.
|
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
|
-
"
|
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",
|