@nocobase/plugin-notification-in-app-message 2.1.0-beta.43 → 2.1.0-beta.44

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.
@@ -9,23 +9,23 @@
9
9
 
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
- "@nocobase/client": "2.1.0-beta.43",
13
- "@nocobase/plugin-notification-manager": "2.1.0-beta.43",
14
- "@nocobase/plugin-mobile": "2.1.0-beta.43",
15
- "@nocobase/utils": "2.1.0-beta.43",
16
- "@nocobase/client-v2": "2.1.0-beta.43",
17
- "@nocobase/flow-engine": "2.1.0-beta.43",
12
+ "@nocobase/client": "2.1.0-beta.44",
13
+ "@nocobase/plugin-notification-manager": "2.1.0-beta.44",
14
+ "@nocobase/plugin-mobile": "2.1.0-beta.44",
15
+ "@nocobase/utils": "2.1.0-beta.44",
16
+ "@nocobase/client-v2": "2.1.0-beta.44",
17
+ "@nocobase/flow-engine": "2.1.0-beta.44",
18
18
  "react-i18next": "11.18.6",
19
19
  "dayjs": "1.11.13",
20
- "@nocobase/database": "2.1.0-beta.43",
21
- "@nocobase/server": "2.1.0-beta.43",
20
+ "@nocobase/database": "2.1.0-beta.44",
21
+ "@nocobase/server": "2.1.0-beta.44",
22
22
  "sequelize": "6.35.2",
23
- "@nocobase/actions": "2.1.0-beta.43",
23
+ "@nocobase/actions": "2.1.0-beta.44",
24
24
  "antd": "5.24.2",
25
25
  "antd-style": "3.7.1",
26
26
  "@emotion/css": "11.13.0",
27
27
  "@formily/react": "2.3.7",
28
- "@nocobase/plugin-workflow": "2.1.0-beta.43",
28
+ "@nocobase/plugin-workflow": "2.1.0-beta.44",
29
29
  "react-router-dom": "6.30.1",
30
30
  "@formily/reactive": "2.3.7",
31
31
  "ahooks": "3.7.8",
@@ -1 +1 @@
1
- {"name":"uuid","version":"10.0.0","description":"RFC9562 UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122","rfc9562"],"license":"MIT","bin":{"uuid":"dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/esm-node/index.js":"./dist/esm-browser/index.js","./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.24.6","@babel/core":"7.24.6","@babel/eslint-parser":"7.24.6","@babel/plugin-syntax-import-attributes":"7.24.6","@babel/preset-env":"7.24.6","@commitlint/cli":"19.3.0","@commitlint/config-conventional":"19.2.2","@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6","bundlewatch":"0.3.3","eslint":"9.4.0","eslint-plugin-prettier":"5.1.3","globals":"15.3.0","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.5","neostandard":"0.5.1","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"3.3.0","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","test:matching":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && HUSKY=0 npm install && npm test","prettier:check":"prettier --check .","prettier:fix":"prettier --write .","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"npm run build && npx runmd --output=README.md README_js.md","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"git+https://github.com/uuidjs/uuid.git"},"lint-staged":{"*":["prettier --no-error-on-unmatched-pattern --write"],"*.{js,jsx}":["eslint --no-error-on-unmatched-pattern --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"packageManager":"npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483","_lastModified":"2026-06-02T14:17:51.597Z"}
1
+ {"name":"uuid","version":"10.0.0","description":"RFC9562 UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122","rfc9562"],"license":"MIT","bin":{"uuid":"dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/esm-node/index.js":"./dist/esm-browser/index.js","./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.24.6","@babel/core":"7.24.6","@babel/eslint-parser":"7.24.6","@babel/plugin-syntax-import-attributes":"7.24.6","@babel/preset-env":"7.24.6","@commitlint/cli":"19.3.0","@commitlint/config-conventional":"19.2.2","@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6","bundlewatch":"0.3.3","eslint":"9.4.0","eslint-plugin-prettier":"5.1.3","globals":"15.3.0","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.5","neostandard":"0.5.1","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"3.3.0","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","test:matching":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && HUSKY=0 npm install && npm test","prettier:check":"prettier --check .","prettier:fix":"prettier --write .","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"npm run build && npx runmd --output=README.md README_js.md","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"git+https://github.com/uuidjs/uuid.git"},"lint-staged":{"*":["prettier --no-error-on-unmatched-pattern --write"],"*.{js,jsx}":["eslint --no-error-on-unmatched-pattern --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"packageManager":"npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483","_lastModified":"2026-06-03T13:58:05.622Z"}
@@ -32,14 +32,38 @@ module.exports = __toCommonJS(defineMyInAppChannels_exports);
32
32
  var import_sequelize = require("sequelize");
33
33
  var import_plugin_notification_manager = require("@nocobase/plugin-notification-manager");
34
34
  var import_types = require("../types");
35
+ function parseLatestMsgReceiveTimestampLt(filter) {
36
+ const latestMsgReceiveTimestamp = typeof filter === "object" && filter !== null ? filter.latestMsgReceiveTimestamp : null;
37
+ if (typeof latestMsgReceiveTimestamp !== "object" || latestMsgReceiveTimestamp === null || !Object.prototype.hasOwnProperty.call(latestMsgReceiveTimestamp, "$lt")) {
38
+ return null;
39
+ }
40
+ const value = latestMsgReceiveTimestamp.$lt;
41
+ if (typeof value === "string" && value.trim() === "") {
42
+ throw new Error("Invalid latest message receive timestamp filter");
43
+ }
44
+ if (typeof value !== "number" && typeof value !== "string") {
45
+ throw new Error("Invalid latest message receive timestamp filter");
46
+ }
47
+ const timestamp = Number(value);
48
+ if (!Number.isFinite(timestamp)) {
49
+ throw new Error("Invalid latest message receive timestamp filter");
50
+ }
51
+ return timestamp;
52
+ }
35
53
  function defineMyInAppChannels(app) {
36
54
  app.resourceManager.define({
37
55
  name: "myInAppChannels",
38
56
  actions: {
39
57
  list: {
40
58
  handler: async (ctx) => {
41
- var _a, _b;
59
+ var _a;
42
60
  const { filter = {}, limit = 30 } = ((_a = ctx.action) == null ? void 0 : _a.params) ?? {};
61
+ let latestMsgReceiveTimestampLt;
62
+ try {
63
+ latestMsgReceiveTimestampLt = parseLatestMsgReceiveTimestampLt(filter);
64
+ } catch (error) {
65
+ return ctx.throw(400, error.message);
66
+ }
43
67
  const messagesCollection = app.db.getCollection(import_types.InAppMessagesDefinition.name);
44
68
  const messagesTableName = messagesCollection.getRealTableName(true);
45
69
  const channelsCollection = app.db.getCollection(import_plugin_notification_manager.ChannelsCollectionDefinition.name);
@@ -77,7 +101,7 @@ function defineMyInAppChannels(app) {
77
101
  ORDER BY messages.${messagesFieldName.receiveTimestamp} DESC
78
102
  LIMIT 1
79
103
  )`;
80
- const latestMsgReceiveTSFilter = ((_b = filter == null ? void 0 : filter.latestMsgReceiveTimestamp) == null ? void 0 : _b.$lt) ? import_sequelize.Sequelize.literal(`${latestMsgReceiveTimestampSQL} < ${filter.latestMsgReceiveTimestamp.$lt}`) : null;
104
+ const latestMsgReceiveTSFilter = latestMsgReceiveTimestampLt !== null ? import_sequelize.Sequelize.where(import_sequelize.Sequelize.literal(latestMsgReceiveTimestampSQL), import_sequelize.Op.lt, latestMsgReceiveTimestampLt) : null;
81
105
  const channelIdFilter = (filter == null ? void 0 : filter.id) ? { id: filter.id } : null;
82
106
  const channelNameFilter = (filter == null ? void 0 : filter.name) ? { name: filter.name } : null;
83
107
  const statusMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-notification-in-app-message",
3
- "version": "2.1.0-beta.43",
3
+ "version": "2.1.0-beta.44",
4
4
  "displayName": "Notification: In-app message",
5
5
  "displayName.ru-RU": "Уведомления: Всплывающие сообщения внутри приложения",
6
6
  "displayName.zh-CN": "通知:站内信",
@@ -33,5 +33,5 @@
33
33
  "react-router-dom": "^6.x"
34
34
  },
35
35
  "license": "Apache-2.0",
36
- "gitHead": "6d7750e2373bf2451d246de88cc1f62491685e18"
36
+ "gitHead": "540d4897b1696cc24c0754521b0b766978b4933c"
37
37
  }