@tachybase/module-message 1.0.6 → 1.0.25
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/client/index.js +4 -4
- package/dist/externalVersion.js +8 -8
- package/dist/node_modules/@alicloud/dysmsapi20170525/dist/client.js +2 -2
- package/dist/node_modules/@alicloud/dysmsapi20170525/package.json +1 -1
- package/dist/node_modules/@alicloud/openapi-client/dist/client.js +2 -2
- package/dist/node_modules/@alicloud/openapi-client/package.json +1 -1
- package/dist/node_modules/@alicloud/tea-util/package.json +1 -1
- package/dist/node_modules/tencentcloud-sdk-nodejs/package.json +1 -1
- package/dist/node_modules/ws/package.json +1 -1
- package/dist/server/plugin.js +18 -7
- package/package.json +17 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@alicloud/openapi-client","version":"0.4.12","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts --timeout=10000","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"","license":"ISC","devDependencies":{"@types/mocha":"^5.2.7","mocha":"^6.2.0","@types/node":"^12.12.26","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5","@alicloud/gateway-pop":"0.0.6"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/tea-util":"^1.4.9","@alicloud/credentials":"^2.3.1","@alicloud/openapi-util":"^0.3.2","@alicloud/gateway-spi":"^0.0.8","@alicloud/tea-xml":"0.0.3"},"files":["dist","src"],"repository":"git@github.com:aliyun/darabonba-openapi.git","_lastModified":"2025-
|
|
1
|
+
{"name":"@alicloud/openapi-client","version":"0.4.12","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts --timeout=10000","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"","license":"ISC","devDependencies":{"@types/mocha":"^5.2.7","mocha":"^6.2.0","@types/node":"^12.12.26","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5","@alicloud/gateway-pop":"0.0.6"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/tea-util":"^1.4.9","@alicloud/credentials":"^2.3.1","@alicloud/openapi-util":"^0.3.2","@alicloud/gateway-spi":"^0.0.8","@alicloud/tea-xml":"0.0.3"},"files":["dist","src"],"repository":"git@github.com:aliyun/darabonba-openapi.git","_lastModified":"2025-05-22T02:04:34.329Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@alicloud/tea-util","version":"1.4.9","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Jackson Tian","license":"Apache-2.0","devDependencies":{"@types/mocha":"^7.0.1","@types/node":"^12.12.26","mocha":"^7.0.1","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.5.1","kitx":"^2.0.0"},"files":["dist","src"],"repository":"git@github.com:aliyun/tea-util.git","_lastModified":"2025-
|
|
1
|
+
{"name":"@alicloud/tea-util","version":"1.4.9","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Jackson Tian","license":"Apache-2.0","devDependencies":{"@types/mocha":"^7.0.1","@types/node":"^12.12.26","mocha":"^7.0.1","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.5.1","kitx":"^2.0.0"},"files":["dist","src"],"repository":"git@github.com:aliyun/tea-util.git","_lastModified":"2025-05-22T02:04:34.434Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"tencentcloud-sdk-nodejs","version":"4.0.996","description":"腾讯云 API NODEJS SDK","main":"tencentcloud/index.js","scripts":{"test":"mocha -t 10000","build":"tsc","prettier":"prettier --config prettier.config.js --write 'src/**/*.{tsx,ts,jsx,js,css,json,vue}'"},"engines":{"node":">=10"},"keywords":["tencentcloudapi","tencentcloud","qcloud","sdk","js","nodejs"],"author":"tencentcloudapi","license":"Apache-2.0","dependencies":{"form-data":"^3.0.0","get-stream":"^6.0.0","https-proxy-agent":"^5.0.0","is-stream":"^2.0.0","json-bigint":"^1.0.0","node-fetch":"^2.2.0","tslib":"1.13.0","uuid":"^9.0.1"},"directories":{"example":"examples","lib":"lib"},"repository":{"type":"git","url":"https://github.com/tencentcloud/tencentcloud-sdk-nodejs"},"devDependencies":{"@types/form-data":"^2.5.0","@types/json-bigint":"^1.0.1","@types/node":"^14.0.26","@types/node-fetch":"^2.5.7","@types/uuid":"^9.0.8","@typescript-eslint/eslint-plugin":"^2.34.0","@typescript-eslint/parser":"^2.34.0","babel-eslint":"^10.0.2","chai":"^4.2.0","eslint":"^6.8.0","eslint-plugin-react":"^7.17.0","mocha":"^8.1.1","prettier":"^2.3.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2025-
|
|
1
|
+
{"name":"tencentcloud-sdk-nodejs","version":"4.0.996","description":"腾讯云 API NODEJS SDK","main":"tencentcloud/index.js","scripts":{"test":"mocha -t 10000","build":"tsc","prettier":"prettier --config prettier.config.js --write 'src/**/*.{tsx,ts,jsx,js,css,json,vue}'"},"engines":{"node":">=10"},"keywords":["tencentcloudapi","tencentcloud","qcloud","sdk","js","nodejs"],"author":"tencentcloudapi","license":"Apache-2.0","dependencies":{"form-data":"^3.0.0","get-stream":"^6.0.0","https-proxy-agent":"^5.0.0","is-stream":"^2.0.0","json-bigint":"^1.0.0","node-fetch":"^2.2.0","tslib":"1.13.0","uuid":"^9.0.1"},"directories":{"example":"examples","lib":"lib"},"repository":{"type":"git","url":"https://github.com/tencentcloud/tencentcloud-sdk-nodejs"},"devDependencies":{"@types/form-data":"^2.5.0","@types/json-bigint":"^1.0.1","@types/node":"^14.0.26","@types/node-fetch":"^2.5.7","@types/uuid":"^9.0.8","@typescript-eslint/eslint-plugin":"^2.34.0","@typescript-eslint/parser":"^2.34.0","babel-eslint":"^10.0.2","chai":"^4.2.0","eslint":"^6.8.0","eslint-plugin-react":"^7.17.0","mocha":"^8.1.1","prettier":"^2.3.0","ts-node":"^8.10.2","typescript":"^3.9.7"},"_lastModified":"2025-05-22T02:04:38.039Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ws","version":"8.18.0","description":"Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js","keywords":["HyBi","Push","RFC-6455","WebSocket","WebSockets","real-time"],"homepage":"https://github.com/websockets/ws","bugs":"https://github.com/websockets/ws/issues","repository":{"type":"git","url":"git+https://github.com/websockets/ws.git"},"author":"Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)","license":"MIT","main":"index.js","exports":{".":{"browser":"./browser.js","import":"./wrapper.mjs","require":"./index.js"},"./package.json":"./package.json"},"browser":"browser.js","engines":{"node":">=10.0.0"},"files":["browser.js","index.js","lib/*.js","wrapper.mjs"],"scripts":{"test":"nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js","integration":"mocha --throw-deprecation test/*.integration.js","lint":"eslint . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\""},"peerDependencies":{"bufferutil":"^4.0.1","utf-8-validate":">=5.0.2"},"peerDependenciesMeta":{"bufferutil":{"optional":true},"utf-8-validate":{"optional":true}},"devDependencies":{"benchmark":"^2.1.4","bufferutil":"^4.0.1","eslint":"^9.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","globals":"^15.0.0","mocha":"^8.4.0","nyc":"^15.0.0","prettier":"^3.0.0","utf-8-validate":"^6.0.0"},"_lastModified":"2025-
|
|
1
|
+
{"name":"ws","version":"8.18.0","description":"Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js","keywords":["HyBi","Push","RFC-6455","WebSocket","WebSockets","real-time"],"homepage":"https://github.com/websockets/ws","bugs":"https://github.com/websockets/ws/issues","repository":{"type":"git","url":"git+https://github.com/websockets/ws.git"},"author":"Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)","license":"MIT","main":"index.js","exports":{".":{"browser":"./browser.js","import":"./wrapper.mjs","require":"./index.js"},"./package.json":"./package.json"},"browser":"browser.js","engines":{"node":">=10.0.0"},"files":["browser.js","index.js","lib/*.js","wrapper.mjs"],"scripts":{"test":"nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js","integration":"mocha --throw-deprecation test/*.integration.js","lint":"eslint . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\""},"peerDependencies":{"bufferutil":"^4.0.1","utf-8-validate":">=5.0.2"},"peerDependenciesMeta":{"bufferutil":{"optional":true},"utf-8-validate":{"optional":true}},"devDependencies":{"benchmark":"^2.1.4","bufferutil":"^4.0.1","eslint":"^9.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","globals":"^15.0.0","mocha":"^8.4.0","nyc":"^15.0.0","prettier":"^3.0.0","utf-8-validate":"^6.0.0"},"_lastModified":"2025-05-22T02:04:32.943Z"}
|
package/dist/server/plugin.js
CHANGED
|
@@ -33,7 +33,6 @@ module.exports = __toCommonJS(plugin_exports);
|
|
|
33
33
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
34
34
|
var import_server = require("@tachybase/server");
|
|
35
35
|
var import_utils = require("@tachybase/utils");
|
|
36
|
-
var import_jsonwebtoken = __toESM(require("jsonwebtoken"));
|
|
37
36
|
var import_messages_providers = require("../common/collections/messages_providers");
|
|
38
37
|
var import_actions = require("./actions");
|
|
39
38
|
var import_constants = require("./constants");
|
|
@@ -97,24 +96,36 @@ class ModuleMessagesServer extends import_server.Plugin {
|
|
|
97
96
|
const ws = gateway["wsServer"];
|
|
98
97
|
(_a = ws == null ? void 0 : ws.wss) == null ? void 0 : _a.on("connection", async (websocket) => {
|
|
99
98
|
websocket.on("message", async (data) => {
|
|
99
|
+
var _a2, _b;
|
|
100
100
|
if (data.toString() !== "ping") {
|
|
101
101
|
const userMeg = JSON.parse(data.toString());
|
|
102
102
|
if (userMeg.type === "signIn") {
|
|
103
|
+
if (!userMeg.payload.token) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
103
106
|
try {
|
|
104
|
-
const analysis =
|
|
107
|
+
const analysis = await ((_b = (_a2 = this.app.authManager) == null ? void 0 : _a2.jwt) == null ? void 0 : _b.verifyToken(userMeg.payload.token));
|
|
105
108
|
const userId = analysis.userId;
|
|
106
109
|
const client = ws.webSocketClients.get(websocket.id);
|
|
107
|
-
client.tags
|
|
108
|
-
|
|
110
|
+
client.tags.forEach((tag) => {
|
|
111
|
+
if (tag.startsWith("app:")) {
|
|
112
|
+
client.tags.delete(tag);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
client.tags.add(`app:${appName}#${userId}`);
|
|
109
116
|
} catch (error) {
|
|
110
|
-
|
|
117
|
+
this.app.logger.warn("signIn message connection error", error);
|
|
111
118
|
}
|
|
112
119
|
} else if (userMeg.type === "signOut") {
|
|
113
120
|
try {
|
|
114
121
|
const client = ws.webSocketClients.get(websocket.id);
|
|
115
|
-
client.tags
|
|
122
|
+
client.tags.forEach((tag) => {
|
|
123
|
+
if (tag.startsWith("app:")) {
|
|
124
|
+
client.tags.delete(tag);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
116
127
|
} catch (error) {
|
|
117
|
-
|
|
128
|
+
this.app.logger.warn("signOut message connection error", error);
|
|
118
129
|
}
|
|
119
130
|
}
|
|
120
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-message",
|
|
3
|
-
"
|
|
3
|
+
"displayName": "Message",
|
|
4
|
+
"version": "1.0.25",
|
|
5
|
+
"description": "Send messages to users.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"System management"
|
|
8
|
+
],
|
|
4
9
|
"main": "dist/server/index.js",
|
|
5
10
|
"dependencies": {},
|
|
6
11
|
"devDependencies": {
|
|
@@ -16,18 +21,20 @@
|
|
|
16
21
|
"react-router-dom": "6.28.1",
|
|
17
22
|
"tencentcloud-sdk-nodejs": "^4.0.996",
|
|
18
23
|
"ws": "^8.18.0",
|
|
19
|
-
"@tachybase/actions": "1.0.
|
|
20
|
-
"@tachybase/components": "1.0.
|
|
21
|
-
"@tachybase/utils": "1.0.
|
|
24
|
+
"@tachybase/actions": "1.0.25",
|
|
25
|
+
"@tachybase/components": "1.0.25",
|
|
26
|
+
"@tachybase/utils": "1.0.25"
|
|
22
27
|
},
|
|
23
28
|
"peerDependencies": {
|
|
24
|
-
"@tachybase/client": "1.0.
|
|
25
|
-
"@tachybase/
|
|
26
|
-
"@tachybase/
|
|
27
|
-
"@tachybase/
|
|
28
|
-
"@tachybase/
|
|
29
|
-
"@tachybase/test": "1.0.
|
|
29
|
+
"@tachybase/client": "1.0.25",
|
|
30
|
+
"@tachybase/module-workflow": "1.0.25",
|
|
31
|
+
"@tachybase/database": "1.0.25",
|
|
32
|
+
"@tachybase/schema": "1.0.25",
|
|
33
|
+
"@tachybase/server": "1.0.25",
|
|
34
|
+
"@tachybase/test": "1.0.25"
|
|
30
35
|
},
|
|
36
|
+
"description.zh-CN": "用于给用户发送消息",
|
|
37
|
+
"displayName.zh-CN": "消息通知",
|
|
31
38
|
"scripts": {
|
|
32
39
|
"build": "tachybase-build --no-dts @tachybase/module-message"
|
|
33
40
|
}
|