@abtnode/core 1.16.47-beta-20250729-045152-0bde0f98 → 1.16.47-beta-20250730-070104-87a128a5

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.
@@ -38918,7 +38918,7 @@ module.exports = require("zlib");
38918
38918
  /***/ ((module) => {
38919
38919
 
38920
38920
  "use strict";
38921
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.46","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.46","@abtnode/auth":"1.16.46","@abtnode/certificate-manager":"1.16.46","@abtnode/client":"1.16.46","@abtnode/constant":"1.16.46","@abtnode/cron":"1.16.46","@abtnode/db-cache":"1.16.46","@abtnode/docker-utils":"1.16.46","@abtnode/logger":"1.16.46","@abtnode/models":"1.16.46","@abtnode/queue":"1.16.46","@abtnode/rbac":"1.16.46","@abtnode/router-provider":"1.16.46","@abtnode/static-server":"1.16.46","@abtnode/timemachine":"1.16.46","@abtnode/util":"1.16.46","@aigne/aigne-hub":"^0.2.2","@arcblock/did":"1.21.0","@arcblock/did-auth":"1.21.0","@arcblock/did-ext":"1.21.0","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.21.0","@arcblock/event-hub":"1.21.0","@arcblock/jwt":"1.21.0","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.21.0","@arcblock/vc":"1.21.0","@blocklet/constant":"1.16.46","@blocklet/did-space-js":"^1.1.10","@blocklet/env":"1.16.46","@blocklet/error":"^0.2.5","@blocklet/meta":"1.16.46","@blocklet/resolver":"1.16.46","@blocklet/sdk":"1.16.46","@blocklet/store":"1.16.46","@blocklet/theme":"^3.0.34","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.21.0","@ocap/util":"1.21.0","@ocap/wallet":"1.21.0","@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":"^11.1.0","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"}');
38921
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.46","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.46","@abtnode/auth":"1.16.46","@abtnode/certificate-manager":"1.16.46","@abtnode/client":"1.16.46","@abtnode/constant":"1.16.46","@abtnode/cron":"1.16.46","@abtnode/db-cache":"1.16.46","@abtnode/docker-utils":"1.16.46","@abtnode/logger":"1.16.46","@abtnode/models":"1.16.46","@abtnode/queue":"1.16.46","@abtnode/rbac":"1.16.46","@abtnode/router-provider":"1.16.46","@abtnode/static-server":"1.16.46","@abtnode/timemachine":"1.16.46","@abtnode/util":"1.16.46","@aigne/aigne-hub":"^0.2.2","@arcblock/did":"1.21.0","@arcblock/did-auth":"1.21.0","@arcblock/did-ext":"1.21.0","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.21.0","@arcblock/event-hub":"1.21.0","@arcblock/jwt":"1.21.0","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.21.0","@arcblock/vc":"1.21.0","@blocklet/constant":"1.16.46","@blocklet/did-space-js":"^1.1.10","@blocklet/env":"1.16.46","@blocklet/error":"^0.2.5","@blocklet/meta":"1.16.46","@blocklet/resolver":"1.16.46","@blocklet/sdk":"1.16.46","@blocklet/store":"1.16.46","@blocklet/theme":"^3.0.35","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.21.0","@ocap/util":"1.21.0","@ocap/wallet":"1.21.0","@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":"^11.1.0","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"}');
38922
38922
 
38923
38923
  /***/ }),
38924
38924
 
@@ -261,11 +261,6 @@ class User extends ExtendBase {
261
261
  where.approved = approved;
262
262
  }
263
263
 
264
- const sorting = pickBy(sort, (x) => !isNullOrUndefined(x));
265
- if (!Object.keys(sorting).length) {
266
- sorting.createdAt = -1;
267
- }
268
-
269
264
  if (search) {
270
265
  if (search.length > 50) {
271
266
  throw new CustomError(400, 'the length of search text should not more than 50');
@@ -385,6 +380,28 @@ SELECT did,inviter,generation FROM UserTree`.trim();
385
380
  include.push(this.getConnectedInclude());
386
381
  }
387
382
 
383
+ const dialect = this.model.sequelize.getDialect();
384
+ const isPostgres = dialect === 'postgres';
385
+
386
+ const sorting = [];
387
+ const cleanedSort = pickBy(sort, (x) => !isNullOrUndefined(x));
388
+ if (cleanedSort.lastLoginAt) {
389
+ const direction = cleanedSort.lastLoginAt === -1 ? 'DESC' : 'ASC';
390
+ if (isPostgres) {
391
+ sorting.push(Sequelize.literal(`"lastLoginAt" ${direction} NULLS LAST`));
392
+ } else {
393
+ sorting.push(['lastLoginAt', direction]); // SQLite 等不支持 NULLS LAST 语法,DESC 默认就是 NULLS LAST
394
+ }
395
+ } else if (Object.keys(cleanedSort).length) {
396
+ for (const [key, dir] of Object.entries(cleanedSort)) {
397
+ if (key !== 'lastLoginAt') {
398
+ sorting.push([key, dir === -1 ? 'DESC' : 'ASC']);
399
+ }
400
+ }
401
+ } else {
402
+ sorting.push(['createdAt', 'DESC']);
403
+ }
404
+
388
405
  const result = await this.paginate({ where, include, replacements }, sorting, paging);
389
406
  return { list: result.list, paging: { ...result.paging, total: total || result.paging.total } };
390
407
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.47-beta-20250729-045152-0bde0f98",
6
+ "version": "1.16.47-beta-20250730-070104-87a128a5",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,22 +19,22 @@
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.47-beta-20250729-045152-0bde0f98",
23
- "@abtnode/auth": "1.16.47-beta-20250729-045152-0bde0f98",
24
- "@abtnode/certificate-manager": "1.16.47-beta-20250729-045152-0bde0f98",
25
- "@abtnode/client": "1.16.47-beta-20250729-045152-0bde0f98",
26
- "@abtnode/constant": "1.16.47-beta-20250729-045152-0bde0f98",
27
- "@abtnode/cron": "1.16.47-beta-20250729-045152-0bde0f98",
28
- "@abtnode/db-cache": "1.16.47-beta-20250729-045152-0bde0f98",
29
- "@abtnode/docker-utils": "1.16.47-beta-20250729-045152-0bde0f98",
30
- "@abtnode/logger": "1.16.47-beta-20250729-045152-0bde0f98",
31
- "@abtnode/models": "1.16.47-beta-20250729-045152-0bde0f98",
32
- "@abtnode/queue": "1.16.47-beta-20250729-045152-0bde0f98",
33
- "@abtnode/rbac": "1.16.47-beta-20250729-045152-0bde0f98",
34
- "@abtnode/router-provider": "1.16.47-beta-20250729-045152-0bde0f98",
35
- "@abtnode/static-server": "1.16.47-beta-20250729-045152-0bde0f98",
36
- "@abtnode/timemachine": "1.16.47-beta-20250729-045152-0bde0f98",
37
- "@abtnode/util": "1.16.47-beta-20250729-045152-0bde0f98",
22
+ "@abtnode/analytics": "1.16.47-beta-20250730-070104-87a128a5",
23
+ "@abtnode/auth": "1.16.47-beta-20250730-070104-87a128a5",
24
+ "@abtnode/certificate-manager": "1.16.47-beta-20250730-070104-87a128a5",
25
+ "@abtnode/client": "1.16.47-beta-20250730-070104-87a128a5",
26
+ "@abtnode/constant": "1.16.47-beta-20250730-070104-87a128a5",
27
+ "@abtnode/cron": "1.16.47-beta-20250730-070104-87a128a5",
28
+ "@abtnode/db-cache": "1.16.47-beta-20250730-070104-87a128a5",
29
+ "@abtnode/docker-utils": "1.16.47-beta-20250730-070104-87a128a5",
30
+ "@abtnode/logger": "1.16.47-beta-20250730-070104-87a128a5",
31
+ "@abtnode/models": "1.16.47-beta-20250730-070104-87a128a5",
32
+ "@abtnode/queue": "1.16.47-beta-20250730-070104-87a128a5",
33
+ "@abtnode/rbac": "1.16.47-beta-20250730-070104-87a128a5",
34
+ "@abtnode/router-provider": "1.16.47-beta-20250730-070104-87a128a5",
35
+ "@abtnode/static-server": "1.16.47-beta-20250730-070104-87a128a5",
36
+ "@abtnode/timemachine": "1.16.47-beta-20250730-070104-87a128a5",
37
+ "@abtnode/util": "1.16.47-beta-20250730-070104-87a128a5",
38
38
  "@aigne/aigne-hub": "^0.2.2",
39
39
  "@arcblock/did": "1.21.0",
40
40
  "@arcblock/did-auth": "1.21.0",
@@ -46,15 +46,15 @@
46
46
  "@arcblock/pm2-events": "^0.0.5",
47
47
  "@arcblock/validator": "1.21.0",
48
48
  "@arcblock/vc": "1.21.0",
49
- "@blocklet/constant": "1.16.47-beta-20250729-045152-0bde0f98",
49
+ "@blocklet/constant": "1.16.47-beta-20250730-070104-87a128a5",
50
50
  "@blocklet/did-space-js": "^1.1.10",
51
- "@blocklet/env": "1.16.47-beta-20250729-045152-0bde0f98",
51
+ "@blocklet/env": "1.16.47-beta-20250730-070104-87a128a5",
52
52
  "@blocklet/error": "^0.2.5",
53
- "@blocklet/meta": "1.16.47-beta-20250729-045152-0bde0f98",
54
- "@blocklet/resolver": "1.16.47-beta-20250729-045152-0bde0f98",
55
- "@blocklet/sdk": "1.16.47-beta-20250729-045152-0bde0f98",
56
- "@blocklet/store": "1.16.47-beta-20250729-045152-0bde0f98",
57
- "@blocklet/theme": "^3.0.34",
53
+ "@blocklet/meta": "1.16.47-beta-20250730-070104-87a128a5",
54
+ "@blocklet/resolver": "1.16.47-beta-20250730-070104-87a128a5",
55
+ "@blocklet/sdk": "1.16.47-beta-20250730-070104-87a128a5",
56
+ "@blocklet/store": "1.16.47-beta-20250730-070104-87a128a5",
57
+ "@blocklet/theme": "^3.0.35",
58
58
  "@fidm/x509": "^1.2.1",
59
59
  "@ocap/mcrypto": "1.21.0",
60
60
  "@ocap/util": "1.21.0",
@@ -117,5 +117,5 @@
117
117
  "jest": "^29.7.0",
118
118
  "unzipper": "^0.10.11"
119
119
  },
120
- "gitHead": "554bd257e6e9aaa2c63d2b6558871f632f7f8ea4"
120
+ "gitHead": "a202f415488de553a2534d1a3d2a489dda27936c"
121
121
  }