@tachybase/module-message 1.0.6 → 1.0.18

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.
@@ -1,14 +1,14 @@
1
1
  module.exports = {
2
- "@tachybase/client": "1.0.6",
3
- "@tachybase/utils": "1.0.6",
4
- "@tachybase/database": "1.0.6",
5
- "@tachybase/server": "1.0.6",
6
- "@tachybase/module-workflow": "1.0.6",
2
+ "@tachybase/client": "1.0.18",
3
+ "@tachybase/utils": "1.0.18",
4
+ "@tachybase/database": "1.0.18",
5
+ "@tachybase/server": "1.0.18",
6
+ "@tachybase/module-workflow": "1.0.18",
7
7
  "jsonwebtoken": "8.5.1",
8
- "@tachybase/components": "1.0.6",
8
+ "@tachybase/components": "1.0.18",
9
9
  "react": "18.3.1",
10
- "@tachybase/actions": "1.0.6",
11
- "@tachybase/schema": "1.0.6",
10
+ "@tachybase/actions": "1.0.18",
11
+ "@tachybase/schema": "1.0.18",
12
12
  "antd": "5.22.5",
13
13
  "lodash": "4.17.21",
14
14
  "@ant-design/icons": "5.3.7",
@@ -1 +1 @@
1
- {"name":"@alicloud/dysmsapi20170525","version":"2.0.24","description":"","main":"dist/client.js","scripts":{"test":"mocha --reporter spec --timeout 3000 test/*.test.js","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Alibaba Cloud SDK","license":"Apache-2.0","devDependencies":{"@types/node":"^12.12.26","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/tea-util":"^1.4.7","@alicloud/openapi-client":"^0.4.4","@alicloud/openapi-util":"^0.3.1","@alicloud/endpoint-util":"^0.0.1"},"files":["dist","src"],"_lastModified":"2025-04-02T03:01:54.653Z"}
1
+ {"name":"@alicloud/dysmsapi20170525","version":"2.0.24","description":"","main":"dist/client.js","scripts":{"test":"mocha --reporter spec --timeout 3000 test/*.test.js","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Alibaba Cloud SDK","license":"Apache-2.0","devDependencies":{"@types/node":"^12.12.26","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/tea-util":"^1.4.7","@alicloud/openapi-client":"^0.4.4","@alicloud/openapi-util":"^0.3.1","@alicloud/endpoint-util":"^0.0.1"},"files":["dist","src"],"_lastModified":"2025-04-18T20:38:20.421Z"}
@@ -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-04-02T03:01:55.301Z"}
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-04-18T20:38:21.097Z"}
@@ -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-04-02T03:01:55.417Z"}
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-04-18T20:38:21.216Z"}
@@ -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-04-02T03:01:59.619Z"}
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-04-18T20:38:25.584Z"}
@@ -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-04-02T03:01:53.780Z"}
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-04-18T20:38:19.540Z"}
@@ -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 = import_jsonwebtoken.default.verify(userMeg.payload.token, process.env.APP_KEY);
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 = client.tags.filter((tag) => !tag.startsWith("app:"));
108
- client.tags.push(`app:${appName}#${userId}`);
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
- console.warn(error.message);
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 = client.tags.filter((tag) => !tag.startsWith("app:"));
122
+ client.tags.forEach((tag) => {
123
+ if (tag.startsWith("app:")) {
124
+ client.tags.delete(tag);
125
+ }
126
+ });
116
127
  } catch (error) {
117
- console.warn(error.message);
128
+ this.app.logger.warn("signOut message connection error", error);
118
129
  }
119
130
  }
120
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/module-message",
3
- "version": "1.0.6",
3
+ "version": "1.0.18",
4
4
  "main": "dist/server/index.js",
5
5
  "dependencies": {},
6
6
  "devDependencies": {
@@ -16,17 +16,17 @@
16
16
  "react-router-dom": "6.28.1",
17
17
  "tencentcloud-sdk-nodejs": "^4.0.996",
18
18
  "ws": "^8.18.0",
19
- "@tachybase/actions": "1.0.6",
20
- "@tachybase/components": "1.0.6",
21
- "@tachybase/utils": "1.0.6"
19
+ "@tachybase/actions": "1.0.18",
20
+ "@tachybase/utils": "1.0.18",
21
+ "@tachybase/components": "1.0.18"
22
22
  },
23
23
  "peerDependencies": {
24
- "@tachybase/client": "1.0.6",
25
- "@tachybase/database": "1.0.6",
26
- "@tachybase/module-workflow": "1.0.6",
27
- "@tachybase/server": "1.0.6",
28
- "@tachybase/schema": "1.0.6",
29
- "@tachybase/test": "1.0.6"
24
+ "@tachybase/client": "1.0.18",
25
+ "@tachybase/module-workflow": "1.0.18",
26
+ "@tachybase/schema": "1.0.18",
27
+ "@tachybase/server": "1.0.18",
28
+ "@tachybase/database": "1.0.18",
29
+ "@tachybase/test": "1.0.18"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tachybase-build --no-dts @tachybase/module-message"