@abtnode/core 1.17.7-beta-20251230-120126-2836fe04 → 1.17.7-beta-20260104-034806-6a4e6fba
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,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
|
+
/* eslint-disable consistent-return */
|
|
2
3
|
const logger = require('@abtnode/logger')('@abtnode/core:blocklet-manager:blue-green');
|
|
3
4
|
const { BlockletStatus, BlockletGroup, BlockletEvents, BlockletInternalEvents } = require('@blocklet/constant');
|
|
4
5
|
const {
|
|
@@ -60,6 +61,13 @@ const blueGreenStartBlocklet = async (
|
|
|
60
61
|
operator,
|
|
61
62
|
});
|
|
62
63
|
|
|
64
|
+
// 检查 blocklet 是否存在,如果不存在则跳过
|
|
65
|
+
// 这可以防止在 blocklet 被删除后,队列中待处理的重启任务执行时出错
|
|
66
|
+
if (!(await manager.hasBlocklet({ did }))) {
|
|
67
|
+
logger.warn('skip blue-green start: blocklet not found', { did });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
63
71
|
// 获取并验证 blocklet
|
|
64
72
|
const blocklet1 = await manager.ensureBlocklet(did, { e2eMode });
|
|
65
73
|
|
|
@@ -39045,7 +39045,7 @@ module.exports = require("zlib");
|
|
|
39045
39045
|
/***/ ((module) => {
|
|
39046
39046
|
|
|
39047
39047
|
"use strict";
|
|
39048
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.6","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.17.6","@abtnode/auth":"1.17.6","@abtnode/certificate-manager":"1.17.6","@abtnode/constant":"1.17.6","@abtnode/cron":"1.17.6","@abtnode/db-cache":"1.17.6","@abtnode/docker-utils":"1.17.6","@abtnode/logger":"1.17.6","@abtnode/models":"1.17.6","@abtnode/queue":"1.17.6","@abtnode/rbac":"1.17.6","@abtnode/router-provider":"1.17.6","@abtnode/util":"1.17.6","@aigne/aigne-hub":"^0.10.15","@arcblock/did":"^1.27.16","@arcblock/did-connect-js":"^1.27.16","@arcblock/did-ext":"^1.27.16","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"^1.27.16","@arcblock/event-hub":"^1.27.16","@arcblock/jwt":"^1.27.16","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"^1.27.16","@arcblock/vc":"^1.27.16","@blocklet/constant":"1.17.6","@blocklet/did-space-js":"^1.2.12","@blocklet/env":"1.17.6","@blocklet/error":"^0.3.5","@blocklet/meta":"1.17.6","@blocklet/resolver":"1.17.6","@blocklet/sdk":"1.17.6","@blocklet/server-js":"1.17.6","@blocklet/store":"1.17.6","@blocklet/theme":"^3.3.
|
|
39048
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.6","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.17.6","@abtnode/auth":"1.17.6","@abtnode/certificate-manager":"1.17.6","@abtnode/constant":"1.17.6","@abtnode/cron":"1.17.6","@abtnode/db-cache":"1.17.6","@abtnode/docker-utils":"1.17.6","@abtnode/logger":"1.17.6","@abtnode/models":"1.17.6","@abtnode/queue":"1.17.6","@abtnode/rbac":"1.17.6","@abtnode/router-provider":"1.17.6","@abtnode/util":"1.17.6","@aigne/aigne-hub":"^0.10.15","@arcblock/did":"^1.27.16","@arcblock/did-connect-js":"^1.27.16","@arcblock/did-ext":"^1.27.16","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"^1.27.16","@arcblock/event-hub":"^1.27.16","@arcblock/jwt":"^1.27.16","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"^1.27.16","@arcblock/vc":"^1.27.16","@blocklet/constant":"1.17.6","@blocklet/did-space-js":"^1.2.12","@blocklet/env":"1.17.6","@blocklet/error":"^0.3.5","@blocklet/meta":"1.17.6","@blocklet/resolver":"1.17.6","@blocklet/sdk":"1.17.6","@blocklet/server-js":"1.17.6","@blocklet/store":"1.17.6","@blocklet/theme":"^3.3.7","@fidm/x509":"^1.2.1","@ocap/mcrypto":"^1.27.16","@ocap/util":"^1.27.16","@ocap/wallet":"^1.27.16","@slack/webhook":"^7.0.6","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","private-ip":"^2.3.4","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":{"axios-mock-adapter":"^2.1.0","expand-tilde":"^2.0.2","express":"^4.18.2","unzipper":"^0.10.11"},"gitHead":"e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"}');
|
|
39049
39049
|
|
|
39050
39050
|
/***/ }),
|
|
39051
39051
|
|
package/lib/event/index.js
CHANGED
|
@@ -376,7 +376,12 @@ module.exports = ({
|
|
|
376
376
|
/**
|
|
377
377
|
* @type {import('@blocklet/server-js').BlockletState} payload
|
|
378
378
|
*/
|
|
379
|
-
const blocklet = payload
|
|
379
|
+
const blocklet = payload?.blocklet || payload;
|
|
380
|
+
|
|
381
|
+
if (!blocklet) {
|
|
382
|
+
logger.error('blocklet is not found', { eventName, payload });
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
380
385
|
|
|
381
386
|
if (isCLI() && process.env.NODE_ENV !== 'test') {
|
|
382
387
|
if (payload.blocklet && !payload.meta) {
|
package/lib/router/helper.js
CHANGED
|
@@ -496,6 +496,14 @@ const ensureBlockletWellknownRules = (sites, blocklets) => {
|
|
|
496
496
|
.filter(Boolean);
|
|
497
497
|
};
|
|
498
498
|
|
|
499
|
+
const isNotComponentRule = (x) =>
|
|
500
|
+
[
|
|
501
|
+
ROUTING_RULE_TYPES.GENERAL_PROXY,
|
|
502
|
+
ROUTING_RULE_TYPES.DIRECT_RESPONSE,
|
|
503
|
+
ROUTING_RULE_TYPES.GENERAL_REWRITE,
|
|
504
|
+
ROUTING_RULE_TYPES.REDIRECT,
|
|
505
|
+
ROUTING_RULE_TYPES.NONE,
|
|
506
|
+
].includes(x.to.type);
|
|
499
507
|
const expandComponentRules = (sites = [], blocklets) => {
|
|
500
508
|
return sites
|
|
501
509
|
.map((site) => {
|
|
@@ -527,15 +535,17 @@ const expandComponentRules = (sites = [], blocklets) => {
|
|
|
527
535
|
},
|
|
528
536
|
}));
|
|
529
537
|
|
|
530
|
-
//
|
|
531
|
-
site.rules = site.rules
|
|
538
|
+
// console.info('expandComponentRules.before.rules', JSON.stringify(site.rules, null, 2));
|
|
539
|
+
site.rules = site.rules
|
|
540
|
+
.filter((x) => x.isProtected || x.to.pageGroup || isNotComponentRule(x))
|
|
541
|
+
.concat(expandedRules);
|
|
532
542
|
site.rules.forEach((x) => {
|
|
533
543
|
if (x.to.type === ROUTING_RULE_TYPES.COMPONENT) {
|
|
534
544
|
x.to.type = ROUTING_RULE_TYPES.BLOCKLET;
|
|
535
545
|
x.to.componentId = [blocklet.meta.did, x.to.componentId].join('/');
|
|
536
546
|
}
|
|
537
547
|
});
|
|
538
|
-
//
|
|
548
|
+
// console.info('expandComponentRules.after.rules', JSON.stringify(site.rules, null, 2));
|
|
539
549
|
|
|
540
550
|
site.componentExpanded = true;
|
|
541
551
|
return site;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.7-beta-
|
|
6
|
+
"version": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@abtnode/analytics": "1.17.7-beta-
|
|
21
|
-
"@abtnode/auth": "1.17.7-beta-
|
|
22
|
-
"@abtnode/certificate-manager": "1.17.7-beta-
|
|
23
|
-
"@abtnode/constant": "1.17.7-beta-
|
|
24
|
-
"@abtnode/cron": "1.17.7-beta-
|
|
25
|
-
"@abtnode/db-cache": "1.17.7-beta-
|
|
26
|
-
"@abtnode/docker-utils": "1.17.7-beta-
|
|
27
|
-
"@abtnode/logger": "1.17.7-beta-
|
|
28
|
-
"@abtnode/models": "1.17.7-beta-
|
|
29
|
-
"@abtnode/queue": "1.17.7-beta-
|
|
30
|
-
"@abtnode/rbac": "1.17.7-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.17.7-beta-
|
|
32
|
-
"@abtnode/util": "1.17.7-beta-
|
|
20
|
+
"@abtnode/analytics": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
21
|
+
"@abtnode/auth": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
22
|
+
"@abtnode/certificate-manager": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
23
|
+
"@abtnode/constant": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
24
|
+
"@abtnode/cron": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
25
|
+
"@abtnode/db-cache": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
26
|
+
"@abtnode/docker-utils": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
27
|
+
"@abtnode/logger": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
28
|
+
"@abtnode/models": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
29
|
+
"@abtnode/queue": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
30
|
+
"@abtnode/rbac": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
31
|
+
"@abtnode/router-provider": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
32
|
+
"@abtnode/util": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
33
33
|
"@aigne/aigne-hub": "^0.10.15",
|
|
34
34
|
"@arcblock/did": "^1.27.16",
|
|
35
35
|
"@arcblock/did-connect-js": "^1.27.16",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"@arcblock/pm2-events": "^0.0.5",
|
|
42
42
|
"@arcblock/validator": "^1.27.16",
|
|
43
43
|
"@arcblock/vc": "^1.27.16",
|
|
44
|
-
"@blocklet/constant": "1.17.7-beta-
|
|
44
|
+
"@blocklet/constant": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
45
45
|
"@blocklet/did-space-js": "^1.2.12",
|
|
46
|
-
"@blocklet/env": "1.17.7-beta-
|
|
46
|
+
"@blocklet/env": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
47
47
|
"@blocklet/error": "^0.3.5",
|
|
48
|
-
"@blocklet/meta": "1.17.7-beta-
|
|
49
|
-
"@blocklet/resolver": "1.17.7-beta-
|
|
50
|
-
"@blocklet/sdk": "1.17.7-beta-
|
|
51
|
-
"@blocklet/server-js": "1.17.7-beta-
|
|
52
|
-
"@blocklet/store": "1.17.7-beta-
|
|
53
|
-
"@blocklet/theme": "^3.3.
|
|
48
|
+
"@blocklet/meta": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
49
|
+
"@blocklet/resolver": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
50
|
+
"@blocklet/sdk": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
51
|
+
"@blocklet/server-js": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
52
|
+
"@blocklet/store": "1.17.7-beta-20260104-034806-6a4e6fba",
|
|
53
|
+
"@blocklet/theme": "^3.3.7",
|
|
54
54
|
"@fidm/x509": "^1.2.1",
|
|
55
55
|
"@ocap/mcrypto": "^1.27.16",
|
|
56
56
|
"@ocap/util": "^1.27.16",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"express": "^4.18.2",
|
|
115
115
|
"unzipper": "^0.10.11"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "9cebb3f3a88e8fd66e70e5a080c037322685460b"
|
|
118
118
|
}
|