@abtnode/core 1.16.46-beta-20250703-050038-4ba2582f → 1.16.46-beta-20250706-075512-de1b046b

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.
@@ -764,6 +764,7 @@ module.exports = Object.freeze({
764
764
  launchBlockletByLauncher: true,
765
765
  launchBlockletWithoutWallet: true,
766
766
  backupBlocklet: true,
767
+ destroySelf: true,
767
768
  },
768
769
  NOTIFICATION_SEND_STATUS: {
769
770
  PENDING: 0, // 待发送
@@ -38901,7 +38902,7 @@ module.exports = require("zlib");
38901
38902
  /***/ ((module) => {
38902
38903
 
38903
38904
  "use strict";
38904
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.45","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.16.45","@abtnode/auth":"1.16.45","@abtnode/certificate-manager":"1.16.45","@abtnode/client":"1.16.45","@abtnode/constant":"1.16.45","@abtnode/cron":"1.16.45","@abtnode/db-cache":"1.16.45","@abtnode/docker-utils":"1.16.45","@abtnode/logger":"1.16.45","@abtnode/models":"1.16.45","@abtnode/queue":"1.16.45","@abtnode/rbac":"1.16.45","@abtnode/router-provider":"1.16.45","@abtnode/static-server":"1.16.45","@abtnode/timemachine":"1.16.45","@abtnode/util":"1.16.45","@arcblock/did":"1.20.14","@arcblock/did-auth":"1.20.14","@arcblock/did-ext":"1.20.14","@arcblock/did-motif":"^1.1.13","@arcblock/did-util":"1.20.14","@arcblock/event-hub":"1.20.14","@arcblock/jwt":"1.20.14","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.20.14","@arcblock/vc":"1.20.14","@blocklet/constant":"1.16.45","@blocklet/did-space-js":"^1.0.62","@blocklet/env":"1.16.45","@blocklet/error":"^0.2.5","@blocklet/meta":"1.16.45","@blocklet/resolver":"1.16.45","@blocklet/sdk":"1.16.45","@blocklet/store":"1.16.45","@blocklet/theme":"^2.13.70","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.20.14","@ocap/util":"1.20.14","@ocap/wallet":"1.20.14","@slack/webhook":"^5.0.4","archiver":"^7.0.1","axios":"^1.7.9","axon":"^2.0.3","chalk":"^4.1.2","cross-spawn":"^7.0.3","dayjs":"^1.11.13","deep-diff":"^1.0.2","detect-port":"^1.5.1","envfile":"^7.1.0","escape-string-regexp":"^4.0.0","fast-glob":"^3.3.2","filesize":"^10.1.1","flat":"^5.0.2","fs-extra":"^11.2.0","get-port":"^5.1.1","hasha":"^5.2.2","is-base64":"^1.1.0","is-cidr":"4","is-ip":"3","is-url":"^1.2.4","joi":"17.12.2","joi-extension-semver":"^5.0.0","js-yaml":"^4.1.0","kill-port":"^2.0.1","lodash":"^4.17.21","node-stream-zip":"^1.15.0","p-all":"^3.0.0","p-limit":"^3.1.0","p-map":"^4.0.0","p-retry":"^4.6.2","p-wait-for":"^3.2.0","rate-limiter-flexible":"^5.0.5","read-last-lines":"^1.8.0","semver":"^7.6.3","sequelize":"^6.35.0","shelljs":"^0.8.5","slugify":"^1.6.6","ssri":"^8.0.1","stream-throttle":"^0.1.3","stream-to-promise":"^3.0.0","systeminformation":"^5.23.3","tail":"^2.2.4","tar":"^6.1.11","transliteration":"^2.3.5","ua-parser-js":"^1.0.2","ufo":"^1.5.3","uuid":"^9.0.1","valid-url":"^1.0.9","which":"^2.0.2","xbytes":"^1.8.0"},"devDependencies":{"expand-tilde":"^2.0.2","express":"^4.18.2","jest":"^29.7.0","unzipper":"^0.10.11"},"gitHead":"e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"}');
38905
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.45","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.16.45","@abtnode/auth":"1.16.45","@abtnode/certificate-manager":"1.16.45","@abtnode/client":"1.16.45","@abtnode/constant":"1.16.45","@abtnode/cron":"1.16.45","@abtnode/db-cache":"1.16.45","@abtnode/docker-utils":"1.16.45","@abtnode/logger":"1.16.45","@abtnode/models":"1.16.45","@abtnode/queue":"1.16.45","@abtnode/rbac":"1.16.45","@abtnode/router-provider":"1.16.45","@abtnode/static-server":"1.16.45","@abtnode/timemachine":"1.16.45","@abtnode/util":"1.16.45","@arcblock/did":"1.20.15","@arcblock/did-auth":"1.20.15","@arcblock/did-ext":"1.20.15","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.20.15","@arcblock/event-hub":"1.20.15","@arcblock/jwt":"1.20.15","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.20.15","@arcblock/vc":"1.20.15","@blocklet/constant":"1.16.45","@blocklet/did-space-js":"^1.1.0","@blocklet/env":"1.16.45","@blocklet/error":"^0.2.5","@blocklet/meta":"1.16.45","@blocklet/resolver":"1.16.45","@blocklet/sdk":"1.16.45","@blocklet/store":"1.16.45","@blocklet/theme":"^3.0.19","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.20.15","@ocap/util":"1.20.15","@ocap/wallet":"1.20.15","@slack/webhook":"^5.0.4","archiver":"^7.0.1","axios":"^1.7.9","axon":"^2.0.3","chalk":"^4.1.2","cross-spawn":"^7.0.3","dayjs":"^1.11.13","deep-diff":"^1.0.2","detect-port":"^1.5.1","envfile":"^7.1.0","escape-string-regexp":"^4.0.0","fast-glob":"^3.3.2","filesize":"^10.1.1","flat":"^5.0.2","fs-extra":"^11.2.0","get-port":"^5.1.1","hasha":"^5.2.2","is-base64":"^1.1.0","is-cidr":"4","is-ip":"3","is-url":"^1.2.4","joi":"17.12.2","joi-extension-semver":"^5.0.0","js-yaml":"^4.1.0","kill-port":"^2.0.1","lodash":"^4.17.21","node-stream-zip":"^1.15.0","p-all":"^3.0.0","p-limit":"^3.1.0","p-map":"^4.0.0","p-retry":"^4.6.2","p-wait-for":"^3.2.0","rate-limiter-flexible":"^5.0.5","read-last-lines":"^1.8.0","semver":"^7.6.3","sequelize":"^6.35.0","shelljs":"^0.8.5","slugify":"^1.6.6","ssri":"^8.0.1","stream-throttle":"^0.1.3","stream-to-promise":"^3.0.0","systeminformation":"^5.23.3","tail":"^2.2.4","tar":"^6.1.11","transliteration":"^2.3.5","ua-parser-js":"^1.0.2","ufo":"^1.5.3","uuid":"^9.0.1","valid-url":"^1.0.9","which":"^2.0.2","xbytes":"^1.8.0"},"devDependencies":{"expand-tilde":"^2.0.2","express":"^4.18.2","jest":"^29.7.0","unzipper":"^0.10.11"},"gitHead":"e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"}');
38905
38906
 
38906
38907
  /***/ }),
38907
38908
 
@@ -407,7 +407,7 @@ const getLogContent = async (action, args, context, result, info, node) => {
407
407
  return `updated tag ${args.tag.id}`;
408
408
  case 'deleteTag':
409
409
  return `deleted tag ${args.tag.id}`;
410
- case 'destroyMyself':
410
+ case 'destroySelf':
411
411
  return `user ${result.did} initiated account deletion`;
412
412
 
413
413
  // accessKeys
@@ -647,7 +647,7 @@ const getLogCategory = (action) => {
647
647
  case 'loginByMaster':
648
648
  case 'loginFederatedMaster':
649
649
  case 'migrateFederatedAccount':
650
- case 'destroyMyself':
650
+ case 'destroySelf':
651
651
  return 'team';
652
652
 
653
653
  // accessKeys
@@ -662,10 +662,11 @@ class NotificationState extends BaseState {
662
662
  notificationId,
663
663
  };
664
664
  if (userName) {
665
+ const likeOp = this.model.sequelize.getDialect() === 'postgres' ? Op.iLike : Op.like;
665
666
  const users = await this.user.find({
666
667
  where: {
667
668
  fullName: {
668
- [Op.like]: `%${userName}%`,
669
+ [likeOp]: `%${userName}%`,
669
670
  },
670
671
  },
671
672
  attributes: ['did'],
@@ -273,7 +273,8 @@ class User extends ExtendBase {
273
273
  if (isValid(search)) {
274
274
  where.did = toAddress(search);
275
275
  } else {
276
- where[Op.or] = [{ fullName: { [Op.like]: `%${search}%` } }, { email: { [Op.like]: `%${search}%` } }];
276
+ const likeOp = this.model.sequelize.getDialect() === 'postgres' ? Op.iLike : Op.like;
277
+ where[Op.or] = [{ fullName: { [likeOp]: `%${search}%` } }, { email: { [Op.like]: `%${search}%` } }];
277
278
  }
278
279
  }
279
280
 
@@ -8,6 +8,9 @@ const fs = require('fs');
8
8
  const fsp = require('fs/promises');
9
9
  const path = require('path');
10
10
 
11
+ const ignoreErrorTableNames = new Set(['runtime_insights', 'notification_receivers', 'notifications']);
12
+ const needCleanDataTableNames = new Set(['sessions']);
13
+
11
14
  function sortTableNames(tableNames, sort) {
12
15
  return [...tableNames].sort((a, b) => {
13
16
  const indexA = sort.indexOf(a);
@@ -177,6 +180,31 @@ async function migrateAllTablesNoModels(dbPath) {
177
180
  // build bind values for ONLY the non-autoInc cols
178
181
  const bindVals = insertCols.map((c) => row[c]);
179
182
 
183
+ if (needCleanDataTableNames.has(tableName)) {
184
+ for (let i = 0; i < bindVals.length; i++) {
185
+ const colName = insertCols[i];
186
+ const isJsonCol = jsonCols.some((j) => j.name === colName);
187
+ const val = bindVals[i];
188
+
189
+ if (isJsonCol && typeof val === 'string' && val.includes('\\u0000')) {
190
+ try {
191
+ const parsed = JSON.parse(val);
192
+ const cleaned = JSON.stringify(parsed, (key, value) => {
193
+ if (typeof value === 'string') {
194
+ // eslint-disable-next-line no-control-regex
195
+ return value.replace(/\u0000/g, '');
196
+ }
197
+ return value;
198
+ });
199
+ bindVals[i] = cleaned;
200
+ } catch (e) {
201
+ console.warn(`⚠️ JSON parse error during clean on column "${colName}" [index ${i}]:`, e);
202
+ // 不抛错,继续迁移
203
+ }
204
+ }
205
+ }
206
+ }
207
+
180
208
  try {
181
209
  await pgDb.query(upsertSQL, { bind: bindVals });
182
210
  } catch (err) {
@@ -208,7 +236,15 @@ async function migrateAllTablesNoModels(dbPath) {
208
236
  console.error(` ❌ ${tableName}: string too long for VARCHAR columns:`, badCols);
209
237
  continue;
210
238
  }
211
- console.error(` ❌ Upsert failed for ${tableName} : ${err.message}`);
239
+ console.error(` ❌ Upsert failed for ${tableName} : ${err.message}, SQL:${upsertSQL} value: ${bindVals}`);
240
+ if (ignoreErrorTableNames.has(tableName)) {
241
+ console.log(` ❌ Ignore error for ${tableName}`);
242
+ continue;
243
+ }
244
+ if (err.message.includes('enum_webhook_attempts_status')) {
245
+ console.log(' ❌ Ignore error for enum_webhook_attempts_status');
246
+ continue;
247
+ }
212
248
  throw err;
213
249
  }
214
250
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.46-beta-20250703-050038-4ba2582f",
6
+ "version": "1.16.46-beta-20250706-075512-de1b046b",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,45 +19,45 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@abtnode/analytics": "1.16.46-beta-20250703-050038-4ba2582f",
23
- "@abtnode/auth": "1.16.46-beta-20250703-050038-4ba2582f",
24
- "@abtnode/certificate-manager": "1.16.46-beta-20250703-050038-4ba2582f",
25
- "@abtnode/client": "1.16.46-beta-20250703-050038-4ba2582f",
26
- "@abtnode/constant": "1.16.46-beta-20250703-050038-4ba2582f",
27
- "@abtnode/cron": "1.16.46-beta-20250703-050038-4ba2582f",
28
- "@abtnode/db-cache": "1.16.46-beta-20250703-050038-4ba2582f",
29
- "@abtnode/docker-utils": "1.16.46-beta-20250703-050038-4ba2582f",
30
- "@abtnode/logger": "1.16.46-beta-20250703-050038-4ba2582f",
31
- "@abtnode/models": "1.16.46-beta-20250703-050038-4ba2582f",
32
- "@abtnode/queue": "1.16.46-beta-20250703-050038-4ba2582f",
33
- "@abtnode/rbac": "1.16.46-beta-20250703-050038-4ba2582f",
34
- "@abtnode/router-provider": "1.16.46-beta-20250703-050038-4ba2582f",
35
- "@abtnode/static-server": "1.16.46-beta-20250703-050038-4ba2582f",
36
- "@abtnode/timemachine": "1.16.46-beta-20250703-050038-4ba2582f",
37
- "@abtnode/util": "1.16.46-beta-20250703-050038-4ba2582f",
38
- "@arcblock/did": "1.20.14",
39
- "@arcblock/did-auth": "1.20.14",
40
- "@arcblock/did-ext": "1.20.14",
41
- "@arcblock/did-motif": "^1.1.13",
42
- "@arcblock/did-util": "1.20.14",
43
- "@arcblock/event-hub": "1.20.14",
44
- "@arcblock/jwt": "1.20.14",
22
+ "@abtnode/analytics": "1.16.46-beta-20250706-075512-de1b046b",
23
+ "@abtnode/auth": "1.16.46-beta-20250706-075512-de1b046b",
24
+ "@abtnode/certificate-manager": "1.16.46-beta-20250706-075512-de1b046b",
25
+ "@abtnode/client": "1.16.46-beta-20250706-075512-de1b046b",
26
+ "@abtnode/constant": "1.16.46-beta-20250706-075512-de1b046b",
27
+ "@abtnode/cron": "1.16.46-beta-20250706-075512-de1b046b",
28
+ "@abtnode/db-cache": "1.16.46-beta-20250706-075512-de1b046b",
29
+ "@abtnode/docker-utils": "1.16.46-beta-20250706-075512-de1b046b",
30
+ "@abtnode/logger": "1.16.46-beta-20250706-075512-de1b046b",
31
+ "@abtnode/models": "1.16.46-beta-20250706-075512-de1b046b",
32
+ "@abtnode/queue": "1.16.46-beta-20250706-075512-de1b046b",
33
+ "@abtnode/rbac": "1.16.46-beta-20250706-075512-de1b046b",
34
+ "@abtnode/router-provider": "1.16.46-beta-20250706-075512-de1b046b",
35
+ "@abtnode/static-server": "1.16.46-beta-20250706-075512-de1b046b",
36
+ "@abtnode/timemachine": "1.16.46-beta-20250706-075512-de1b046b",
37
+ "@abtnode/util": "1.16.46-beta-20250706-075512-de1b046b",
38
+ "@arcblock/did": "1.20.15",
39
+ "@arcblock/did-auth": "1.20.15",
40
+ "@arcblock/did-ext": "1.20.15",
41
+ "@arcblock/did-motif": "^1.1.14",
42
+ "@arcblock/did-util": "1.20.15",
43
+ "@arcblock/event-hub": "1.20.15",
44
+ "@arcblock/jwt": "1.20.15",
45
45
  "@arcblock/pm2-events": "^0.0.5",
46
- "@arcblock/validator": "1.20.14",
47
- "@arcblock/vc": "1.20.14",
48
- "@blocklet/constant": "1.16.46-beta-20250703-050038-4ba2582f",
49
- "@blocklet/did-space-js": "^1.0.62",
50
- "@blocklet/env": "1.16.46-beta-20250703-050038-4ba2582f",
46
+ "@arcblock/validator": "1.20.15",
47
+ "@arcblock/vc": "1.20.15",
48
+ "@blocklet/constant": "1.16.46-beta-20250706-075512-de1b046b",
49
+ "@blocklet/did-space-js": "^1.1.0",
50
+ "@blocklet/env": "1.16.46-beta-20250706-075512-de1b046b",
51
51
  "@blocklet/error": "^0.2.5",
52
- "@blocklet/meta": "1.16.46-beta-20250703-050038-4ba2582f",
53
- "@blocklet/resolver": "1.16.46-beta-20250703-050038-4ba2582f",
54
- "@blocklet/sdk": "1.16.46-beta-20250703-050038-4ba2582f",
55
- "@blocklet/store": "1.16.46-beta-20250703-050038-4ba2582f",
56
- "@blocklet/theme": "^2.13.70",
52
+ "@blocklet/meta": "1.16.46-beta-20250706-075512-de1b046b",
53
+ "@blocklet/resolver": "1.16.46-beta-20250706-075512-de1b046b",
54
+ "@blocklet/sdk": "1.16.46-beta-20250706-075512-de1b046b",
55
+ "@blocklet/store": "1.16.46-beta-20250706-075512-de1b046b",
56
+ "@blocklet/theme": "^3.0.19",
57
57
  "@fidm/x509": "^1.2.1",
58
- "@ocap/mcrypto": "1.20.14",
59
- "@ocap/util": "1.20.14",
60
- "@ocap/wallet": "1.20.14",
58
+ "@ocap/mcrypto": "1.20.15",
59
+ "@ocap/util": "1.20.15",
60
+ "@ocap/wallet": "1.20.15",
61
61
  "@slack/webhook": "^5.0.4",
62
62
  "archiver": "^7.0.1",
63
63
  "axios": "^1.7.9",
@@ -116,5 +116,5 @@
116
116
  "jest": "^29.7.0",
117
117
  "unzipper": "^0.10.11"
118
118
  },
119
- "gitHead": "8d7838277e51ecabae489db51937f6deb51e015f"
119
+ "gitHead": "e6d80405142a38be22341a684229625361be7293"
120
120
  }