@abtnode/core 1.17.8-beta-20260115-130425-5c8d9a61 → 1.17.8-beta-20260116-051624-4b021245
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,6 +1,8 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const fs = require('fs-extra');
|
|
3
3
|
const { BlockletStatus, BLOCKLET_MODES, BlockletSource } = require('@blocklet/constant');
|
|
4
|
+
const { ROLES } = require('@abtnode/constant');
|
|
5
|
+
const { generateRandomString } = require('@abtnode/models/lib/util');
|
|
4
6
|
|
|
5
7
|
const logger = require('@abtnode/logger')('@abtnode/core:install-app-dev');
|
|
6
8
|
const { ensureMeta, updateBlockletFallbackLogo, getBundleDir } = require('../../../util/blocklet');
|
|
@@ -64,6 +66,71 @@ const installApplicationFromDev = async ({ folder, meta, states, manager } = {})
|
|
|
64
66
|
|
|
65
67
|
await states.blocklet.setInstalledAt(did);
|
|
66
68
|
|
|
69
|
+
// Init team db for dev mode (same as production install flow)
|
|
70
|
+
await manager.teamManager.initTeam(did);
|
|
71
|
+
logger.info('initTeam completed for dev mode', { did });
|
|
72
|
+
|
|
73
|
+
// In dev mode, auto set server owner as blocklet owner
|
|
74
|
+
const nodeInfo = await states.node.read();
|
|
75
|
+
if (nodeInfo.nodeOwner?.did && nodeInfo.nodeOwner?.pk) {
|
|
76
|
+
// Set blocklet owner in settings
|
|
77
|
+
await manager.setInitialized({
|
|
78
|
+
did,
|
|
79
|
+
owner: {
|
|
80
|
+
did: nodeInfo.nodeOwner.did,
|
|
81
|
+
pk: nodeInfo.nodeOwner.pk,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
logger.info('set blocklet owner from server owner in dev mode', { did, owner: nodeInfo.nodeOwner.did });
|
|
85
|
+
|
|
86
|
+
// Add owner to user table so it shows in Members page
|
|
87
|
+
try {
|
|
88
|
+
// Get server owner's user info from server team
|
|
89
|
+
const serverUserState = await manager.teamManager.getUserState(nodeInfo.did);
|
|
90
|
+
const serverOwner = await serverUserState.getUser(nodeInfo.nodeOwner.did);
|
|
91
|
+
|
|
92
|
+
// Get blocklet's user state
|
|
93
|
+
const blockletUserState = await manager.teamManager.getUserState(did);
|
|
94
|
+
|
|
95
|
+
// Generate a passport ID for the owner
|
|
96
|
+
const passportId = `z${generateRandomString(40)}`;
|
|
97
|
+
|
|
98
|
+
// Add owner to blocklet's user table with owner role and passport
|
|
99
|
+
const ownerUser = {
|
|
100
|
+
did: nodeInfo.nodeOwner.did,
|
|
101
|
+
pk: nodeInfo.nodeOwner.pk,
|
|
102
|
+
fullName: serverOwner?.fullName || 'Owner',
|
|
103
|
+
avatar: serverOwner?.avatar || '',
|
|
104
|
+
role: ROLES.OWNER,
|
|
105
|
+
approved: true,
|
|
106
|
+
passports: [
|
|
107
|
+
{
|
|
108
|
+
id: passportId,
|
|
109
|
+
type: ['NFTPassport', 'VerifiableCredential', 'ABTNodePassport'],
|
|
110
|
+
issuer: {
|
|
111
|
+
id: did,
|
|
112
|
+
pk: nodeInfo.pk,
|
|
113
|
+
name: meta.title || meta.name,
|
|
114
|
+
},
|
|
115
|
+
specVersion: '1.0.0',
|
|
116
|
+
name: ROLES.OWNER,
|
|
117
|
+
title: 'Owner',
|
|
118
|
+
endpoint: '',
|
|
119
|
+
status: 'valid',
|
|
120
|
+
role: ROLES.OWNER,
|
|
121
|
+
source: 'issue',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
await blockletUserState.addUser(ownerUser);
|
|
126
|
+
logger.info('added owner to blocklet user table in dev mode', { did, ownerDid: nodeInfo.nodeOwner.did });
|
|
127
|
+
} catch (err) {
|
|
128
|
+
logger.warn('failed to add owner to blocklet user table in dev mode', { did, error: err.message });
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
logger.warn('server owner not found, blocklet owner not set in dev mode', { did });
|
|
132
|
+
}
|
|
133
|
+
|
|
67
134
|
blocklet = await manager.getBlocklet(did);
|
|
68
135
|
|
|
69
136
|
return blocklet;
|
|
@@ -39021,7 +39021,7 @@ module.exports = require("zlib");
|
|
|
39021
39021
|
/***/ ((module) => {
|
|
39022
39022
|
|
|
39023
39023
|
"use strict";
|
|
39024
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.7","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.7","@abtnode/auth":"1.17.7","@abtnode/certificate-manager":"1.17.7","@abtnode/constant":"1.17.7","@abtnode/cron":"1.17.7","@abtnode/db-cache":"1.17.7","@abtnode/docker-utils":"1.17.7","@abtnode/logger":"1.17.7","@abtnode/models":"1.17.7","@abtnode/queue":"1.17.7","@abtnode/rbac":"1.17.7","@abtnode/router-provider":"1.17.7","@abtnode/util":"1.17.7","@
|
|
39024
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.7","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.7","@abtnode/auth":"1.17.7","@abtnode/certificate-manager":"1.17.7","@abtnode/constant":"1.17.7","@abtnode/cron":"1.17.7","@abtnode/db-cache":"1.17.7","@abtnode/docker-utils":"1.17.7","@abtnode/logger":"1.17.7","@abtnode/models":"1.17.7","@abtnode/queue":"1.17.7","@abtnode/rbac":"1.17.7","@abtnode/router-provider":"1.17.7","@abtnode/util":"1.17.7","@arcblock/did":"^1.28.5","@arcblock/did-connect-js":"^1.28.5","@arcblock/did-ext":"^1.28.5","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"^1.28.5","@arcblock/event-hub":"^1.28.5","@arcblock/jwt":"^1.28.5","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"^1.28.5","@arcblock/vc":"^1.28.5","@blocklet/constant":"1.17.7","@blocklet/did-space-js":"^1.2.15","@blocklet/env":"1.17.7","@blocklet/error":"^0.3.5","@blocklet/meta":"1.17.7","@blocklet/resolver":"1.17.7","@blocklet/sdk":"1.17.7","@blocklet/server-js":"1.17.7","@blocklet/store":"1.17.7","@blocklet/theme":"^3.4.7","@fidm/x509":"^1.2.1","@ocap/mcrypto":"^1.28.5","@ocap/util":"^1.28.5","@ocap/wallet":"^1.28.5","@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"}');
|
|
39025
39025
|
|
|
39026
39026
|
/***/ }),
|
|
39027
39027
|
|
package/lib/event/index.js
CHANGED
|
@@ -863,8 +863,8 @@ module.exports = ({
|
|
|
863
863
|
}
|
|
864
864
|
const translations = {
|
|
865
865
|
en: {
|
|
866
|
-
title: 'You are logged in a new device',
|
|
867
|
-
body: `You are logged in a new device: ${userSession.ua}. \n\nIf this is not you, please click "View Your Account" button to view details`,
|
|
866
|
+
title: 'You are logged in on a new device',
|
|
867
|
+
body: `You are logged in on a new device: ${userSession.ua}. \n\nIf this is not you, please click "View Your Account" button to view details`,
|
|
868
868
|
loginIp: 'Login IP',
|
|
869
869
|
loginAt: 'Login At',
|
|
870
870
|
viewYourAccount: 'View Your Account',
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.17.8-beta-
|
|
6
|
+
"version": "1.17.8-beta-20260116-051624-4b021245",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -17,20 +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.8-beta-
|
|
21
|
-
"@abtnode/auth": "1.17.8-beta-
|
|
22
|
-
"@abtnode/certificate-manager": "1.17.8-beta-
|
|
23
|
-
"@abtnode/constant": "1.17.8-beta-
|
|
24
|
-
"@abtnode/cron": "1.17.8-beta-
|
|
25
|
-
"@abtnode/db-cache": "1.17.8-beta-
|
|
26
|
-
"@abtnode/docker-utils": "1.17.8-beta-
|
|
27
|
-
"@abtnode/logger": "1.17.8-beta-
|
|
28
|
-
"@abtnode/models": "1.17.8-beta-
|
|
29
|
-
"@abtnode/queue": "1.17.8-beta-
|
|
30
|
-
"@abtnode/rbac": "1.17.8-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.17.8-beta-
|
|
32
|
-
"@abtnode/util": "1.17.8-beta-
|
|
33
|
-
"@aigne/aigne-hub": "^0.10.15",
|
|
20
|
+
"@abtnode/analytics": "1.17.8-beta-20260116-051624-4b021245",
|
|
21
|
+
"@abtnode/auth": "1.17.8-beta-20260116-051624-4b021245",
|
|
22
|
+
"@abtnode/certificate-manager": "1.17.8-beta-20260116-051624-4b021245",
|
|
23
|
+
"@abtnode/constant": "1.17.8-beta-20260116-051624-4b021245",
|
|
24
|
+
"@abtnode/cron": "1.17.8-beta-20260116-051624-4b021245",
|
|
25
|
+
"@abtnode/db-cache": "1.17.8-beta-20260116-051624-4b021245",
|
|
26
|
+
"@abtnode/docker-utils": "1.17.8-beta-20260116-051624-4b021245",
|
|
27
|
+
"@abtnode/logger": "1.17.8-beta-20260116-051624-4b021245",
|
|
28
|
+
"@abtnode/models": "1.17.8-beta-20260116-051624-4b021245",
|
|
29
|
+
"@abtnode/queue": "1.17.8-beta-20260116-051624-4b021245",
|
|
30
|
+
"@abtnode/rbac": "1.17.8-beta-20260116-051624-4b021245",
|
|
31
|
+
"@abtnode/router-provider": "1.17.8-beta-20260116-051624-4b021245",
|
|
32
|
+
"@abtnode/util": "1.17.8-beta-20260116-051624-4b021245",
|
|
34
33
|
"@arcblock/did": "^1.28.5",
|
|
35
34
|
"@arcblock/did-connect-js": "^1.28.5",
|
|
36
35
|
"@arcblock/did-ext": "^1.28.5",
|
|
@@ -41,15 +40,15 @@
|
|
|
41
40
|
"@arcblock/pm2-events": "^0.0.5",
|
|
42
41
|
"@arcblock/validator": "^1.28.5",
|
|
43
42
|
"@arcblock/vc": "^1.28.5",
|
|
44
|
-
"@blocklet/constant": "1.17.8-beta-
|
|
43
|
+
"@blocklet/constant": "1.17.8-beta-20260116-051624-4b021245",
|
|
45
44
|
"@blocklet/did-space-js": "^1.2.15",
|
|
46
|
-
"@blocklet/env": "1.17.8-beta-
|
|
45
|
+
"@blocklet/env": "1.17.8-beta-20260116-051624-4b021245",
|
|
47
46
|
"@blocklet/error": "^0.3.5",
|
|
48
|
-
"@blocklet/meta": "1.17.8-beta-
|
|
49
|
-
"@blocklet/resolver": "1.17.8-beta-
|
|
50
|
-
"@blocklet/sdk": "1.17.8-beta-
|
|
51
|
-
"@blocklet/server-js": "1.17.8-beta-
|
|
52
|
-
"@blocklet/store": "1.17.8-beta-
|
|
47
|
+
"@blocklet/meta": "1.17.8-beta-20260116-051624-4b021245",
|
|
48
|
+
"@blocklet/resolver": "1.17.8-beta-20260116-051624-4b021245",
|
|
49
|
+
"@blocklet/sdk": "1.17.8-beta-20260116-051624-4b021245",
|
|
50
|
+
"@blocklet/server-js": "1.17.8-beta-20260116-051624-4b021245",
|
|
51
|
+
"@blocklet/store": "1.17.8-beta-20260116-051624-4b021245",
|
|
53
52
|
"@blocklet/theme": "^3.4.7",
|
|
54
53
|
"@fidm/x509": "^1.2.1",
|
|
55
54
|
"@ocap/mcrypto": "^1.28.5",
|
|
@@ -114,5 +113,5 @@
|
|
|
114
113
|
"express": "^4.18.2",
|
|
115
114
|
"unzipper": "^0.10.11"
|
|
116
115
|
},
|
|
117
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "52ebef2dd95e6e734ca63ab2dd5ce92a7293cc75"
|
|
118
117
|
}
|