moeralib 0.19.1 → 0.19.2

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/AGENTS.md ADDED
@@ -0,0 +1,5 @@
1
+ # TypeScript
2
+
3
+ 1. Do not use `enum` or `namespace`. Represent string-valued enumerations as
4
+ string literal union types, adding new values with `|`. For example:
5
+ `type NodeSourceUriService = "telegram" | "rss" | "livejournal"`.
package/lib/index.js CHANGED
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeSourceUri = void 0;
4
+ var node_source_uri_1 = require("./node-source-uri");
5
+ Object.defineProperty(exports, "NodeSourceUri", { enumerable: true, get: function () { return node_source_uri_1.NodeSourceUri; } });
@@ -10,6 +10,7 @@ exports.createCommentFingerprint1 = createCommentFingerprint1;
10
10
  exports.createCommentFingerprint0 = createCommentFingerprint0;
11
11
  exports.createMediaGrantFingerprint1 = createMediaGrantFingerprint1;
12
12
  exports.createMediaGrantFingerprint0 = createMediaGrantFingerprint0;
13
+ exports.createNotificationPacketFingerprint2 = createNotificationPacketFingerprint2;
13
14
  exports.createNotificationPacketFingerprint1 = createNotificationPacketFingerprint1;
14
15
  exports.createNotificationPacketFingerprint0 = createNotificationPacketFingerprint0;
15
16
  exports.createPostingFingerprint1 = createPostingFingerprint1;
@@ -151,6 +152,21 @@ function createMediaGrantFingerprint0(nodeName, postingId, commentId, mediaId, e
151
152
  return (0, crypto_1.fingerprintBytes)({ "version": 0, "objectType": "MEDIA_GRANT", nodeName, postingId, commentId, mediaId, expires, download, fileName,
152
153
  salt }, MEDIA_GRANT_FINGERPRINT0_SCHEMA);
153
154
  }
155
+ const NOTIFICATION_PACKET_FINGERPRINT2_SCHEMA = [
156
+ ["version", "number"],
157
+ ["objectType", "string"],
158
+ ["id", "string"],
159
+ ["nodeName", "string"],
160
+ ["fullName", "string"],
161
+ ["nodeSourceUri", "string"],
162
+ ["createdAt", "number"],
163
+ ["type", "string"],
164
+ ["notification", "string"],
165
+ ];
166
+ function createNotificationPacketFingerprint2(id, nodeName, fullName, nodeSourceUri, createdAt, type, notification) {
167
+ return (0, crypto_1.fingerprintBytes)({ "version": 2, "objectType": "NOTIFICATION_PACKET", id, nodeName, fullName, nodeSourceUri, createdAt, type,
168
+ notification }, NOTIFICATION_PACKET_FINGERPRINT2_SCHEMA);
169
+ }
154
170
  const NOTIFICATION_PACKET_FINGERPRINT1_SCHEMA = [
155
171
  ["version", "number"],
156
172
  ["objectType", "string"],
package/lib/node/node.js CHANGED
@@ -1715,62 +1715,6 @@ class MoeraNode extends caller_1.Caller {
1715
1715
  });
1716
1716
  });
1717
1717
  }
1718
- /**
1719
- * Register the plugin. If the plugin authenticates as root admin, the plugin is registered at the server level. If
1720
- * the plugin authenticates as node admin, the plugin is registered at the node level.
1721
- *
1722
- * @param {API.PluginDescription} plugin
1723
- * @return {Promise<API.PluginInfo>}
1724
- */
1725
- registerPlugin(plugin) {
1726
- return __awaiter(this, void 0, void 0, function* () {
1727
- const location = "/plugins";
1728
- return yield this.call("registerPlugin", location, {
1729
- method: "POST", body: plugin, schema: "PluginInfo"
1730
- });
1731
- });
1732
- }
1733
- /**
1734
- * Get information about all plugins registered for the node and server.
1735
- *
1736
- * @return {Promise<API.PluginInfo[]>}
1737
- */
1738
- getPlugins() {
1739
- return __awaiter(this, void 0, void 0, function* () {
1740
- const location = "/plugins";
1741
- return yield this.call("getPlugins", location, {
1742
- method: "GET", schema: "PluginInfoArray"
1743
- });
1744
- });
1745
- }
1746
- /**
1747
- * Get information about the plugin.
1748
- *
1749
- * @param {string} pluginName - name of the plugin
1750
- * @return {Promise<API.PluginInfo>}
1751
- */
1752
- getPlugin(pluginName) {
1753
- return __awaiter(this, void 0, void 0, function* () {
1754
- const location = (0, util_1.ut) `/plugins/${pluginName}`;
1755
- return yield this.call("getPlugin", location, {
1756
- method: "GET", schema: "PluginInfo"
1757
- });
1758
- });
1759
- }
1760
- /**
1761
- * Unregister the plugin.
1762
- *
1763
- * @param {string} pluginName - name of the plugin
1764
- * @return {Promise<API.Result>}
1765
- */
1766
- unregisterPlugin(pluginName) {
1767
- return __awaiter(this, void 0, void 0, function* () {
1768
- const location = (0, util_1.ut) `/plugins/${pluginName}`;
1769
- return yield this.call("unregisterPlugin", location, {
1770
- method: "DELETE", schema: "Result"
1771
- });
1772
- });
1773
- }
1774
1718
  /**
1775
1719
  * Create a new posting from the text given and publish it in the given feeds (if any). The heading and the preview
1776
1720
  * of the posting are created automatically, if needed. The posting owner must authenticate in some way. If the
@@ -2073,8 +2017,9 @@ class MoeraNode extends caller_1.Caller {
2073
2017
  });
2074
2018
  }
2075
2019
  /**
2076
- * Update the profile. Fields that are not set in the request body are left intact. Fields that are set to an empty
2077
- * value are reset to their defaults.
2020
+ * To update a profile attribute, include the field with its new value. For a partial update, include only the
2021
+ * fields to be changed; omitted fields remain unchanged. To delete an attribute, include the field with an empty
2022
+ * value, which resets it to its default.
2078
2023
  *
2079
2024
  * @param {API.ProfileAttributes} profile
2080
2025
  * @return {Promise<API.ProfileInfo>}
package/lib/node/types.js CHANGED
@@ -22,7 +22,6 @@ exports.SCOPE_VALUES = {
22
22
  "view-feeds": 0x00008000,
23
23
  "update-feeds": 0x00010000,
24
24
  "name": 0x00020000,
25
- "plugins": 0x00040000,
26
25
  "view-profile": 0x00080000,
27
26
  "update-profile": 0x00100000,
28
27
  "sheriff": 0x00200000,
@@ -36,5 +35,5 @@ exports.SCOPE_VALUES = {
36
35
  "upload-private-media": 0x20000000,
37
36
  "lease-media": 0x40000000,
38
37
  "view-all": 0x00088404,
39
- "all": 0x7ffffffd,
38
+ "all": 0x7ffbfffd,
40
39
  };