itd-api 0.12.0 → 0.12.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/events/index.cjs +2 -2
- package/dist/events/index.d.cts +2 -2
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.js +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/rest/index.cjs +2 -2
- package/dist/rest/index.d.cts +3 -3
- package/dist/rest/index.d.ts +3 -3
- package/dist/rest/index.js +2 -2
- package/dist/shared/{events-BpLAIiMj.d.ts → events-9215JDDd.d.ts} +2 -2
- package/dist/shared/{events-C2DJZyI0.cjs → events-BKyxZQNw.cjs} +2 -2
- package/dist/shared/{events-C2DJZyI0.cjs.map → events-BKyxZQNw.cjs.map} +1 -1
- package/dist/shared/{events-9L0Fonak.d.cts → events-FaXfdle0.d.cts} +2 -2
- package/dist/shared/{events-D1BfefBT.js → events-_iYo8EP5.js} +2 -2
- package/dist/shared/{events-D1BfefBT.js.map → events-_iYo8EP5.js.map} +1 -1
- package/dist/shared/{render-CrGXcj6L.cjs → render-BQvC5UxF.cjs} +20 -4
- package/dist/shared/render-BQvC5UxF.cjs.map +1 -0
- package/dist/shared/{render-UsQ1hb2U.d.ts → render-BS09ygcy.d.ts} +42 -60
- package/dist/shared/{render-D3vSEbLL.js → render-CFoF2WaH.js} +20 -4
- package/dist/shared/render-CFoF2WaH.js.map +1 -0
- package/dist/shared/{render-Dzw3KeN5.d.cts → render-X2JCo1JS.d.cts} +42 -60
- package/dist/shared/{url-Dg1u29cu.js → url-CdT4lMxQ.js} +2 -2
- package/dist/shared/{url-Dg1u29cu.js.map → url-CdT4lMxQ.js.map} +1 -1
- package/dist/shared/{url-C9YADYNg.d.ts → url-_R0oJ7gE.d.cts} +24 -29
- package/dist/shared/{url-C9YADYNg.d.cts → url-_R0oJ7gE.d.ts} +24 -29
- package/dist/shared/{url-B21Bdmw_.cjs → url-ioIaywDi.cjs} +2 -2
- package/dist/shared/{url-B21Bdmw_.cjs.map → url-ioIaywDi.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/shared/render-CrGXcj6L.cjs.map +0 -1
- package/dist/shared/render-D3vSEbLL.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_url = require("./url-
|
|
1
|
+
const require_url = require("./url-ioIaywDi.cjs");
|
|
2
2
|
const require_validate = require("./validate-CFx2dISs.cjs");
|
|
3
3
|
const require_redact = require("./redact-BbhtA9o-.cjs");
|
|
4
4
|
const require_options = require("./options-D5ttspWk.cjs");
|
|
@@ -1536,6 +1536,22 @@ function normalizePost(post) {
|
|
|
1536
1536
|
...Array.isArray(post.comments) ? { comments: post.comments.map(normalizeComment) } : {}
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
1539
|
+
/** Читает ответ редактирования поста: `updatedAt` сервера становится `editedAt`. */
|
|
1540
|
+
function normalizePostUpdate(body) {
|
|
1541
|
+
const { updatedAt, ...rest } = body;
|
|
1542
|
+
return {
|
|
1543
|
+
...rest,
|
|
1544
|
+
editedAt: utcStampToIso(updatedAt)
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
/** Читает ответ редактирования комментария. */
|
|
1548
|
+
function normalizeCommentUpdate(body) {
|
|
1549
|
+
const result = body;
|
|
1550
|
+
return {
|
|
1551
|
+
...result,
|
|
1552
|
+
editedAt: utcStampToIso(result.editedAt)
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1539
1555
|
//#endregion
|
|
1540
1556
|
//#region src/resources/content-operations.ts
|
|
1541
1557
|
/** Операция, которая возвращает один пост. */
|
|
@@ -1554,7 +1570,7 @@ function commentOperation(id) {
|
|
|
1554
1570
|
//#region src/resources/comments.ts
|
|
1555
1571
|
const COMMENTS_REPLIES = pageOperation("comments.replies", (body) => mapPage(readPagedPage(body, "replies"), normalizeComment));
|
|
1556
1572
|
const COMMENTS_REPLY = commentOperation("comments.reply");
|
|
1557
|
-
const COMMENTS_UPDATE = require_url.
|
|
1573
|
+
const COMMENTS_UPDATE = require_url.defineBuiltInOperation("comments.update", normalizeCommentUpdate);
|
|
1558
1574
|
const COMMENTS_RESTORE = require_url.voidOperation("comments.restore");
|
|
1559
1575
|
const COMMENTS_LIKE = require_url.passthroughOperation("comments.like");
|
|
1560
1576
|
const COMMENTS_UNLIKE = require_url.passthroughOperation("comments.unlike");
|
|
@@ -3121,7 +3137,7 @@ const POSTS_COMMENTS = pageOperation("posts.comments", (body) => mapPage(readFla
|
|
|
3121
3137
|
const POSTS_STATS = require_url.defineBuiltInOperation("posts.stats", (body) => require_url.pickArray(body, "posts"));
|
|
3122
3138
|
const POSTS_CREATE = postOperation("posts.create");
|
|
3123
3139
|
const POSTS_GET = postOperation("posts.get");
|
|
3124
|
-
const POSTS_UPDATE = require_url.
|
|
3140
|
+
const POSTS_UPDATE = require_url.defineBuiltInOperation("posts.update", normalizePostUpdate);
|
|
3125
3141
|
const POSTS_RESTORE = require_url.voidOperation("posts.restore");
|
|
3126
3142
|
const POSTS_LIKE = require_url.passthroughOperation("posts.like");
|
|
3127
3143
|
const POSTS_UNLIKE = require_url.passthroughOperation("posts.unlike");
|
|
@@ -5320,4 +5336,4 @@ Object.defineProperty(exports, "utcStampToIso", {
|
|
|
5320
5336
|
}
|
|
5321
5337
|
});
|
|
5322
5338
|
|
|
5323
|
-
//# sourceMappingURL=render-
|
|
5339
|
+
//# sourceMappingURL=render-BQvC5UxF.cjs.map
|