lemmy-js-client 0.17.0-rc.26 → 0.17.0-rc.29
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/interfaces/api/community.js +3 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +3 -0
- package/dist/websocket.d.ts +0 -3
- package/dist/websocket.js +4 -18
- package/package.json +1 -1
@@ -60,6 +60,9 @@ exports.GetCommunity = GetCommunity;
|
|
60
60
|
var GetCommunityResponse = /** @class */ (function () {
|
61
61
|
function GetCommunityResponse() {
|
62
62
|
}
|
63
|
+
__decorate([
|
64
|
+
(0, class_transformer_1.Type)(function () { return views_1.CommunityView; })
|
65
|
+
], GetCommunityResponse.prototype, "community_view", void 0);
|
63
66
|
__decorate([
|
64
67
|
(0, class_transformer_1.Transform)(function (_a) {
|
65
68
|
var value = _a.value;
|
package/dist/utils.d.ts
CHANGED
@@ -3,4 +3,7 @@ import { Option } from "@sniptt/monads";
|
|
3
3
|
* Converts an option to an undefined. Necessary for API requests.
|
4
4
|
*/
|
5
5
|
export declare function toUndefined<T>(opt: Option<T>): T;
|
6
|
+
/**
|
7
|
+
* Converts a null value to an option.
|
8
|
+
*/
|
6
9
|
export declare function toOption<T>(val: T): Option<T>;
|
package/dist/utils.js
CHANGED
package/dist/websocket.d.ts
CHANGED
@@ -332,9 +332,6 @@ export declare class LemmyWebsocket {
|
|
332
332
|
*/
|
333
333
|
blockCommunity(form: BlockCommunity): string;
|
334
334
|
}
|
335
|
-
/**
|
336
|
-
* A websocket JSON response that includes the errors.
|
337
|
-
*/
|
338
335
|
export declare function wsUserOp(msg: any): UserOperation;
|
339
336
|
/**
|
340
337
|
* Converts a websocket string response to a usable result
|
package/dist/websocket.js
CHANGED
@@ -487,24 +487,9 @@ var LemmyWebsocket = /** @class */ (function () {
|
|
487
487
|
}());
|
488
488
|
exports.LemmyWebsocket = LemmyWebsocket;
|
489
489
|
function wrapper(op, data) {
|
490
|
-
var send = { op: others_1.UserOperation[op], data: data };
|
491
|
-
|
492
|
-
return JSON.stringify(send);
|
490
|
+
var send = (0, class_transformer_1.serialize)({ op: others_1.UserOperation[op], data: data });
|
491
|
+
return send;
|
493
492
|
}
|
494
|
-
/**
|
495
|
-
* A websocket JSON response that includes the errors.
|
496
|
-
*/
|
497
|
-
// interface WebSocketJsonResponse {
|
498
|
-
// op?: string;
|
499
|
-
// /**
|
500
|
-
// * This contains the data for a websocket response.
|
501
|
-
// *
|
502
|
-
// * The correct response type if given is in [[LemmyHttp]].
|
503
|
-
// */
|
504
|
-
// data?: ResponseType;
|
505
|
-
// error?: string;
|
506
|
-
// reconnect?: boolean;
|
507
|
-
// }
|
508
493
|
function wsUserOp(msg) {
|
509
494
|
var opStr = msg.op;
|
510
495
|
return others_1.UserOperation[opStr];
|
@@ -514,6 +499,7 @@ exports.wsUserOp = wsUserOp;
|
|
514
499
|
* Converts a websocket string response to a usable result
|
515
500
|
*/
|
516
501
|
function wsJsonToRes(msg, responseClass) {
|
517
|
-
|
502
|
+
// Have to deserialize the response again into the correct class
|
503
|
+
return (0, class_transformer_1.deserialize)(responseClass, (0, class_transformer_1.serialize)(msg.data));
|
518
504
|
}
|
519
505
|
exports.wsJsonToRes = wsJsonToRes;
|
package/package.json
CHANGED