@abtnode/core 1.16.23-beta-f85576a6 → 1.16.23-beta-aeb9f5bd
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.
- package/lib/api/team.js +17 -36
- package/lib/blocklet/downloader/resolve-download.js +2 -19
- package/lib/blocklet/manager/disk.js +23 -3
- package/lib/blocklet/manager/helper/install-application-from-general.js +2 -1
- package/lib/blocklet/manager/helper/install-component-from-url.js +7 -1
- package/lib/event/index.js +5 -4
- package/lib/index.js +2 -1
- package/lib/util/blocklet.js +8 -1
- package/lib/util/get-dynamic-components.js +14 -0
- package/package.json +23 -23
package/lib/api/team.js
CHANGED
|
@@ -8,7 +8,6 @@ const logger = require('@abtnode/logger')('@abtnode/core:api:team');
|
|
|
8
8
|
const {
|
|
9
9
|
ROLES,
|
|
10
10
|
genPermissionName,
|
|
11
|
-
EVENTS,
|
|
12
11
|
WHO_CAN_ACCESS,
|
|
13
12
|
PASSPORT_STATUS,
|
|
14
13
|
WELLKNOWN_SERVICE_PATH_PREFIX,
|
|
@@ -18,7 +17,7 @@ const {
|
|
|
18
17
|
USER_AVATAR_URL_PREFIX,
|
|
19
18
|
} = require('@abtnode/constant');
|
|
20
19
|
const { isValid: isValidDid } = require('@arcblock/did');
|
|
21
|
-
const { BlockletEvents } = require('@blocklet/constant');
|
|
20
|
+
const { BlockletEvents, TeamEvents } = require('@blocklet/constant');
|
|
22
21
|
const { sendToUser } = require('@blocklet/sdk/lib/util/send-notification');
|
|
23
22
|
const {
|
|
24
23
|
createPassportVC,
|
|
@@ -177,7 +176,7 @@ class TeamAPI extends EventEmitter {
|
|
|
177
176
|
const { _action, ...doc } = await state.loginUser(user);
|
|
178
177
|
if (_action === 'update') {
|
|
179
178
|
logger.info('user updated successfully', { teamDid, userDid: user.did });
|
|
180
|
-
this.emit(
|
|
179
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc });
|
|
181
180
|
} else if (_action === 'add') {
|
|
182
181
|
if (teamDid === nodeInfo.did && nodeInfo.nodeOwner && user.did !== nodeInfo.nodeOwner.did) {
|
|
183
182
|
await this.notification.create({
|
|
@@ -191,7 +190,7 @@ class TeamAPI extends EventEmitter {
|
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
logger.info('user added successfully', { teamDid, userDid: user.did, userPk: user.pk, userName: user.fullName });
|
|
194
|
-
this.emit(
|
|
193
|
+
this.emit(TeamEvents.userAdded, { teamDid, user: doc });
|
|
195
194
|
}
|
|
196
195
|
return doc;
|
|
197
196
|
}
|
|
@@ -227,7 +226,7 @@ class TeamAPI extends EventEmitter {
|
|
|
227
226
|
});
|
|
228
227
|
}
|
|
229
228
|
|
|
230
|
-
this.emit(
|
|
229
|
+
this.emit(TeamEvents.userAdded, { teamDid, user: doc });
|
|
231
230
|
|
|
232
231
|
return doc;
|
|
233
232
|
}
|
|
@@ -351,7 +350,7 @@ class TeamAPI extends EventEmitter {
|
|
|
351
350
|
const state = await this.getUserState(teamDid);
|
|
352
351
|
const doc = await state.updateUser(user.did, user);
|
|
353
352
|
logger.info('user updated successfully', { teamDid, userDid: user.did });
|
|
354
|
-
this.emit(
|
|
353
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc });
|
|
355
354
|
return doc;
|
|
356
355
|
}
|
|
357
356
|
|
|
@@ -371,7 +370,7 @@ class TeamAPI extends EventEmitter {
|
|
|
371
370
|
const state = await this.getUserState(teamDid);
|
|
372
371
|
const doc = await state.updateTags(did, tags);
|
|
373
372
|
logger.info('user tags updated successfully', { teamDid, userDid: did, tags });
|
|
374
|
-
this.emit(
|
|
373
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc });
|
|
375
374
|
return doc;
|
|
376
375
|
}
|
|
377
376
|
|
|
@@ -390,7 +389,7 @@ class TeamAPI extends EventEmitter {
|
|
|
390
389
|
|
|
391
390
|
await state.remove({ did });
|
|
392
391
|
logger.info('user removed successfully', { teamDid, userDid: did });
|
|
393
|
-
this.emit(
|
|
392
|
+
this.emit(TeamEvents.userRemoved, { teamDid, user: { did } });
|
|
394
393
|
|
|
395
394
|
return { did };
|
|
396
395
|
}
|
|
@@ -411,31 +410,12 @@ class TeamAPI extends EventEmitter {
|
|
|
411
410
|
|
|
412
411
|
logger.info('user approval updated successfully', { teamDid, userDid: user.did, approved: user.approved });
|
|
413
412
|
|
|
414
|
-
this.emit(
|
|
415
|
-
this.emit(
|
|
413
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc2 });
|
|
414
|
+
this.emit(TeamEvents.userPermissionUpdated, { teamDid, user: doc2 });
|
|
416
415
|
|
|
417
416
|
return doc2;
|
|
418
417
|
}
|
|
419
418
|
|
|
420
|
-
/**
|
|
421
|
-
* @deprecated to be removed after passportNFT is ready
|
|
422
|
-
*/
|
|
423
|
-
async updateUserRole({ teamDid, user }) {
|
|
424
|
-
if (user.role === ROLES.OWNER) {
|
|
425
|
-
throw new Error('Cannot update owner\'s role'); // prettier-ignore
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
const state = await this.getUserState(teamDid);
|
|
429
|
-
|
|
430
|
-
const doc = await state.updateRole(pick(user, ['did', 'role']));
|
|
431
|
-
|
|
432
|
-
logger.info('user role updated successfully', { teamDid, userDid: user.did, role: user.role });
|
|
433
|
-
|
|
434
|
-
this.emit(EVENTS.USER_UPDATED, { teamDid, user: doc });
|
|
435
|
-
|
|
436
|
-
return doc;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
419
|
async issuePassportToUser({ teamDid, userDid, role: roleName, notify = true }, context = {}) {
|
|
440
420
|
const { locale = 'en' } = context;
|
|
441
421
|
|
|
@@ -515,8 +495,8 @@ class TeamAPI extends EventEmitter {
|
|
|
515
495
|
|
|
516
496
|
logger.info('user passport revoked successfully', { teamDid, userDid, passportId });
|
|
517
497
|
|
|
518
|
-
this.emit(
|
|
519
|
-
this.emit(
|
|
498
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc });
|
|
499
|
+
this.emit(TeamEvents.userPermissionUpdated, { teamDid, user: doc });
|
|
520
500
|
|
|
521
501
|
return doc;
|
|
522
502
|
}
|
|
@@ -532,8 +512,8 @@ class TeamAPI extends EventEmitter {
|
|
|
532
512
|
|
|
533
513
|
logger.info('user passport enabled successfully', { teamDid, userDid, passportId });
|
|
534
514
|
|
|
535
|
-
this.emit(
|
|
536
|
-
this.emit(
|
|
515
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc });
|
|
516
|
+
this.emit(TeamEvents.userPermissionUpdated, { teamDid, user: doc });
|
|
537
517
|
|
|
538
518
|
return doc;
|
|
539
519
|
}
|
|
@@ -549,8 +529,8 @@ class TeamAPI extends EventEmitter {
|
|
|
549
529
|
|
|
550
530
|
logger.info('user passport remove successfully', { teamDid, userDid, passportId });
|
|
551
531
|
|
|
552
|
-
this.emit(
|
|
553
|
-
this.emit(
|
|
532
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc });
|
|
533
|
+
this.emit(TeamEvents.userPermissionUpdated, { teamDid, user: doc });
|
|
554
534
|
|
|
555
535
|
return doc;
|
|
556
536
|
}
|
|
@@ -596,7 +576,8 @@ class TeamAPI extends EventEmitter {
|
|
|
596
576
|
}
|
|
597
577
|
const doc = await state.updateUser(userDid, mergeData);
|
|
598
578
|
logger.info('User switch-profile successfully', { teamDid, userDid });
|
|
599
|
-
this.emit(
|
|
579
|
+
this.emit(TeamEvents.userUpdated, { teamDid, user: doc });
|
|
580
|
+
this.emit(TeamEvents.userProfileUpdated, { teamDid, user: doc });
|
|
600
581
|
return doc;
|
|
601
582
|
}
|
|
602
583
|
|
|
@@ -16,22 +16,11 @@ const asyncFs = fs.promises;
|
|
|
16
16
|
* decompress file, format dir and move to installDir
|
|
17
17
|
* @param {string} src file
|
|
18
18
|
* @param {{
|
|
19
|
-
* cwd: string;
|
|
20
19
|
* removeTarFile: boolean;
|
|
21
|
-
* originalMeta; // for verification
|
|
22
20
|
* logger;
|
|
23
21
|
* }} option
|
|
24
22
|
*/
|
|
25
|
-
const resolveDownload = async (
|
|
26
|
-
tarFile,
|
|
27
|
-
dist,
|
|
28
|
-
{ cwd = '/', removeTarFile = true, logger = defaultLogger, originalMeta, onProgress } = {}
|
|
29
|
-
) => {
|
|
30
|
-
// eslint-disable-next-line no-param-reassign
|
|
31
|
-
tarFile = path.join(cwd, tarFile);
|
|
32
|
-
// eslint-disable-next-line no-param-reassign
|
|
33
|
-
dist = path.join(cwd, dist);
|
|
34
|
-
|
|
23
|
+
const resolveDownload = async (tarFile, dist, { removeTarFile = true, logger = defaultLogger, onProgress } = {}) => {
|
|
35
24
|
const downloadDir = path.join(path.dirname(tarFile), path.basename(tarFile, path.extname(tarFile)));
|
|
36
25
|
const tmp = `${downloadDir}-tmp`;
|
|
37
26
|
try {
|
|
@@ -71,13 +60,7 @@ const resolveDownload = async (
|
|
|
71
60
|
fs.removeSync(tmp);
|
|
72
61
|
|
|
73
62
|
meta = getBlockletMeta(downloadDir);
|
|
74
|
-
const {
|
|
75
|
-
|
|
76
|
-
// validate
|
|
77
|
-
if (originalMeta && (originalMeta.did !== did || originalMeta.name !== name || originalMeta.version !== version)) {
|
|
78
|
-
logger.error('Meta has differences', { originalMeta, meta });
|
|
79
|
-
throw new Error('There are differences between the meta from tarball file and the original meta');
|
|
80
|
-
}
|
|
63
|
+
const { name, version } = meta;
|
|
81
64
|
|
|
82
65
|
if (typeof onProgress === 'function') {
|
|
83
66
|
onProgress({ name: 'blocklet.zip' });
|
|
@@ -145,6 +145,7 @@ const {
|
|
|
145
145
|
removeAppConfigsFromComponent,
|
|
146
146
|
getConfigsFromInput,
|
|
147
147
|
getPackConfig,
|
|
148
|
+
filterRequiredComponents,
|
|
148
149
|
} = require('../../util/blocklet');
|
|
149
150
|
const { getDidDomainForBlocklet } = require('../../util/get-domain-for-blocklet');
|
|
150
151
|
const states = require('../../states');
|
|
@@ -394,6 +395,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
394
395
|
* downloadTokenList: Array<{did: string, token: string}>;
|
|
395
396
|
* startImmediately: boolean;
|
|
396
397
|
* controller: Controller
|
|
398
|
+
* onlyRequired: boolean;
|
|
397
399
|
* type: BLOCKLET_INSTALL_TYPE
|
|
398
400
|
* }} params
|
|
399
401
|
* @param {{
|
|
@@ -463,13 +465,27 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
463
465
|
* @param {String} name custom component name
|
|
464
466
|
*
|
|
465
467
|
* @param {ConfigEntry} configs pre configs
|
|
468
|
+
* @param {Boolean} onlyRequired only install required components
|
|
466
469
|
*/
|
|
467
470
|
async installComponent(
|
|
468
|
-
{
|
|
471
|
+
{
|
|
472
|
+
rootDid,
|
|
473
|
+
mountPoint,
|
|
474
|
+
url,
|
|
475
|
+
file,
|
|
476
|
+
did,
|
|
477
|
+
diffVersion,
|
|
478
|
+
deleteSet,
|
|
479
|
+
title,
|
|
480
|
+
name,
|
|
481
|
+
configs,
|
|
482
|
+
sync,
|
|
483
|
+
downloadTokenList,
|
|
484
|
+
onlyRequired,
|
|
485
|
+
},
|
|
469
486
|
context = {}
|
|
470
487
|
) {
|
|
471
488
|
logger.debug('start install component', { rootDid, mountPoint, url });
|
|
472
|
-
|
|
473
489
|
if (file) {
|
|
474
490
|
// TODO: 如何触发这种场景?
|
|
475
491
|
const info = await states.node.read();
|
|
@@ -509,6 +525,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
509
525
|
downloadTokenList,
|
|
510
526
|
states,
|
|
511
527
|
manager: this,
|
|
528
|
+
onlyRequired,
|
|
512
529
|
});
|
|
513
530
|
}
|
|
514
531
|
|
|
@@ -2376,7 +2393,6 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
2376
2393
|
const { meta } = blocklet;
|
|
2377
2394
|
const { did, version } = meta;
|
|
2378
2395
|
logger.info('do install blocklet', { did, version });
|
|
2379
|
-
|
|
2380
2396
|
try {
|
|
2381
2397
|
const installedBlocklet = await this._installBlocklet({
|
|
2382
2398
|
did,
|
|
@@ -2995,6 +3011,7 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
2995
3011
|
description,
|
|
2996
3012
|
skSource = '',
|
|
2997
3013
|
folder,
|
|
3014
|
+
onlyRequired,
|
|
2998
3015
|
}) {
|
|
2999
3016
|
const environments = component?.meta?.environments || [];
|
|
3000
3017
|
|
|
@@ -3027,6 +3044,9 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
3027
3044
|
children = isGatewayBlocklet(component.meta) ? [] : [component];
|
|
3028
3045
|
} else {
|
|
3029
3046
|
children = component ? await this._getChildrenForInstallation(component) : [];
|
|
3047
|
+
if (onlyRequired) {
|
|
3048
|
+
children = filterRequiredComponents(component, children);
|
|
3049
|
+
}
|
|
3030
3050
|
}
|
|
3031
3051
|
|
|
3032
3052
|
// FIXME @linchen
|
|
@@ -32,6 +32,7 @@ const installApplicationFromGeneral = async ({
|
|
|
32
32
|
context = {},
|
|
33
33
|
states,
|
|
34
34
|
manager,
|
|
35
|
+
onlyRequired,
|
|
35
36
|
} = {}) => {
|
|
36
37
|
const nodeInfo = await states.node.read();
|
|
37
38
|
|
|
@@ -103,7 +104,7 @@ const installApplicationFromGeneral = async ({
|
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
// create app
|
|
106
|
-
const blocklet = await manager._addBlocklet({ component, name, did, title, description, skSource });
|
|
107
|
+
const blocklet = await manager._addBlocklet({ component, name, did, title, description, skSource, onlyRequired });
|
|
107
108
|
logger.info('blocklet added to database', { did: blocklet.meta.did });
|
|
108
109
|
|
|
109
110
|
// create config
|
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
checkStructVersion,
|
|
17
17
|
checkVersionCompatibility,
|
|
18
18
|
validateBlocklet,
|
|
19
|
+
filterRequiredComponents,
|
|
19
20
|
getComponentNamesWithVersion,
|
|
20
21
|
} = require('../../../util/blocklet');
|
|
21
22
|
const StoreUtil = require('../../../util/store');
|
|
@@ -32,6 +33,7 @@ const installComponentFromUrl = async ({
|
|
|
32
33
|
sync,
|
|
33
34
|
manager,
|
|
34
35
|
states,
|
|
36
|
+
onlyRequired,
|
|
35
37
|
}) => {
|
|
36
38
|
const blocklet = await states.blocklet.getBlocklet(rootDid);
|
|
37
39
|
if (!blocklet) {
|
|
@@ -103,11 +105,15 @@ const installComponentFromUrl = async ({
|
|
|
103
105
|
dynamicComponents.unshift(newChild);
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
|
|
108
|
+
let newChildren = filterDuplicateComponents(dynamicComponents, blocklet.children).map((x) => ({
|
|
107
109
|
...x,
|
|
108
110
|
installedAt: new Date(),
|
|
109
111
|
}));
|
|
110
112
|
|
|
113
|
+
if (onlyRequired) {
|
|
114
|
+
newChildren = filterRequiredComponents(newChild, newChildren);
|
|
115
|
+
}
|
|
116
|
+
|
|
111
117
|
blocklet.children.push(...newChildren);
|
|
112
118
|
|
|
113
119
|
checkVersionCompatibility(blocklet.children);
|
package/lib/event/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const {
|
|
|
9
9
|
BlockletSource,
|
|
10
10
|
BlockletEvents,
|
|
11
11
|
BlockletInternalEvents,
|
|
12
|
+
TeamEvents,
|
|
12
13
|
BLOCKLET_CONFIGURABLE_KEY,
|
|
13
14
|
} = require('@blocklet/constant');
|
|
14
15
|
const { EVENTS, BACKUPS } = require('@abtnode/constant');
|
|
@@ -494,10 +495,10 @@ module.exports = ({
|
|
|
494
495
|
});
|
|
495
496
|
});
|
|
496
497
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
498
|
+
Object.keys(TeamEvents).forEach((key) => {
|
|
499
|
+
listen(teamAPI, TeamEvents[key], onEvent);
|
|
500
|
+
});
|
|
501
|
+
|
|
501
502
|
listen(teamAPI, BlockletEvents.updated, onEvent);
|
|
502
503
|
listen(teamManager, BlockletEvents.storeChange, onEvent);
|
|
503
504
|
listen(teamManager, EVENTS.NOTIFICATION_BLOCKLET_CREATE, onEvent);
|
package/lib/index.js
CHANGED
|
@@ -39,6 +39,7 @@ const { createDataArchive } = require('./util/blocklet');
|
|
|
39
39
|
const { toStatus, fromStatus, ensureDataDirs, getQueueConcurrencyByMem, getStateCrons } = require('./util');
|
|
40
40
|
const { clearCache } = require('./util/cache');
|
|
41
41
|
const getMetaFromUrl = require('./util/get-meta-from-url');
|
|
42
|
+
const getDynamicComponents = require('./util/get-dynamic-components');
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
45
|
* @param {object} options
|
|
@@ -411,7 +412,6 @@ function ABTNode(options) {
|
|
|
411
412
|
updateUserTags: teamAPI.updateUserTags.bind(teamAPI),
|
|
412
413
|
updateUserExtra: teamAPI.updateUserExtra.bind(teamAPI),
|
|
413
414
|
updateUserApproval: teamAPI.updateUserApproval.bind(teamAPI),
|
|
414
|
-
updateUserRole: teamAPI.updateUserRole.bind(teamAPI),
|
|
415
415
|
getUserByDid: teamAPI.getUserByDid.bind(teamAPI),
|
|
416
416
|
isPassportValid: teamAPI.isPassportValid.bind(teamAPI),
|
|
417
417
|
isConnectedAccount: teamAPI.isConnectedAccount.bind(teamAPI),
|
|
@@ -580,6 +580,7 @@ function ABTNode(options) {
|
|
|
580
580
|
|
|
581
581
|
// public utils used in launch workflow
|
|
582
582
|
getBlockletMetaFromUrl: getMetaFromUrl,
|
|
583
|
+
getDynamicComponents,
|
|
583
584
|
getLauncherSession,
|
|
584
585
|
isLauncherSessionConsumed,
|
|
585
586
|
setupAppOwner,
|
package/lib/util/blocklet.js
CHANGED
|
@@ -47,6 +47,8 @@ const {
|
|
|
47
47
|
filterDuplicateComponents,
|
|
48
48
|
validateBlockletMeta,
|
|
49
49
|
getComponentConfig,
|
|
50
|
+
parseOptionalComponents,
|
|
51
|
+
filterRequiredComponents,
|
|
50
52
|
} = require('@blocklet/resolver');
|
|
51
53
|
const formatBackSlash = require('@abtnode/util/lib/format-back-slash');
|
|
52
54
|
const { isPortsOccupiedByOtherProcess, killProcessOccupiedPorts } = require('@abtnode/util/lib/port');
|
|
@@ -591,6 +593,7 @@ const startBlockletProcess = async (
|
|
|
591
593
|
listen_timeout: 3000,
|
|
592
594
|
max_memory_restart: `${maxMemoryRestart}M`,
|
|
593
595
|
max_restarts: b.mode === BLOCKLET_MODES.DEVELOPMENT ? 0 : 3,
|
|
596
|
+
exp_backoff_restart_delay: 300,
|
|
594
597
|
env: {
|
|
595
598
|
...environmentObj,
|
|
596
599
|
...env,
|
|
@@ -627,7 +630,7 @@ const startBlockletProcess = async (
|
|
|
627
630
|
|
|
628
631
|
const cmdPath = path.join(path.dirname(nodejsBinPath), 'node_modules', cmd);
|
|
629
632
|
|
|
630
|
-
const pkg = JSON.parse(fs.readFileSync(path.join(cmdPath, 'package.json')));
|
|
633
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(cmdPath, 'package.json'), 'utf8'));
|
|
631
634
|
const cmdBinPath = pkg.bin[cmd];
|
|
632
635
|
|
|
633
636
|
options.script = path.resolve(cmdPath, cmdBinPath);
|
|
@@ -1330,6 +1333,9 @@ const getBlocklet = async ({
|
|
|
1330
1333
|
fillBlockletConfigs(component, configs);
|
|
1331
1334
|
});
|
|
1332
1335
|
|
|
1336
|
+
const optionalComponents = await parseOptionalComponents(blocklet.children);
|
|
1337
|
+
blocklet.optionalComponents = optionalComponents;
|
|
1338
|
+
|
|
1333
1339
|
return blocklet;
|
|
1334
1340
|
};
|
|
1335
1341
|
|
|
@@ -1978,6 +1984,7 @@ module.exports = {
|
|
|
1978
1984
|
forEachBlocklet,
|
|
1979
1985
|
getBlockletMetaFromUrl: (url) => getBlockletMetaFromUrl(url, { logger }),
|
|
1980
1986
|
parseComponents,
|
|
1987
|
+
filterRequiredComponents,
|
|
1981
1988
|
getComponentDirs,
|
|
1982
1989
|
getAppSystemEnvironments,
|
|
1983
1990
|
getAppOverwrittenEnvironments,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const { default: axios } = require('axios');
|
|
2
|
+
const { filterDuplicateComponents, parseComponents } = require('./blocklet');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param {String} url
|
|
6
|
+
* @returns {Promise<import('@abtnode/types').TComponentState[]>}
|
|
7
|
+
*/
|
|
8
|
+
async function getDynamicComponents({ url }) {
|
|
9
|
+
const rawMeta = await axios.get(url).then((res) => res.data);
|
|
10
|
+
const { dynamicComponents } = await parseComponents({ meta: rawMeta });
|
|
11
|
+
return filterDuplicateComponents(dynamicComponents);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = getDynamicComponents;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.23-beta-
|
|
6
|
+
"version": "1.16.23-beta-aeb9f5bd",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,19 +19,19 @@
|
|
|
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.23-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.23-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.23-beta-
|
|
25
|
-
"@abtnode/constant": "1.16.23-beta-
|
|
26
|
-
"@abtnode/cron": "1.16.23-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.23-beta-
|
|
28
|
-
"@abtnode/models": "1.16.23-beta-
|
|
29
|
-
"@abtnode/queue": "1.16.23-beta-
|
|
30
|
-
"@abtnode/rbac": "1.16.23-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.16.23-beta-
|
|
32
|
-
"@abtnode/static-server": "1.16.23-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.16.23-beta-
|
|
34
|
-
"@abtnode/util": "1.16.23-beta-
|
|
22
|
+
"@abtnode/analytics": "1.16.23-beta-aeb9f5bd",
|
|
23
|
+
"@abtnode/auth": "1.16.23-beta-aeb9f5bd",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.23-beta-aeb9f5bd",
|
|
25
|
+
"@abtnode/constant": "1.16.23-beta-aeb9f5bd",
|
|
26
|
+
"@abtnode/cron": "1.16.23-beta-aeb9f5bd",
|
|
27
|
+
"@abtnode/logger": "1.16.23-beta-aeb9f5bd",
|
|
28
|
+
"@abtnode/models": "1.16.23-beta-aeb9f5bd",
|
|
29
|
+
"@abtnode/queue": "1.16.23-beta-aeb9f5bd",
|
|
30
|
+
"@abtnode/rbac": "1.16.23-beta-aeb9f5bd",
|
|
31
|
+
"@abtnode/router-provider": "1.16.23-beta-aeb9f5bd",
|
|
32
|
+
"@abtnode/static-server": "1.16.23-beta-aeb9f5bd",
|
|
33
|
+
"@abtnode/timemachine": "1.16.23-beta-aeb9f5bd",
|
|
34
|
+
"@abtnode/util": "1.16.23-beta-aeb9f5bd",
|
|
35
35
|
"@arcblock/did": "1.18.108",
|
|
36
36
|
"@arcblock/did-auth": "1.18.108",
|
|
37
37
|
"@arcblock/did-ext": "^1.18.108",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"@arcblock/pm2-events": "^0.0.5",
|
|
43
43
|
"@arcblock/validator": "^1.18.108",
|
|
44
44
|
"@arcblock/vc": "1.18.108",
|
|
45
|
-
"@blocklet/constant": "1.16.23-beta-
|
|
46
|
-
"@blocklet/env": "1.16.23-beta-
|
|
47
|
-
"@blocklet/meta": "1.16.23-beta-
|
|
48
|
-
"@blocklet/resolver": "1.16.23-beta-
|
|
49
|
-
"@blocklet/sdk": "1.16.23-beta-
|
|
50
|
-
"@did-space/client": "^0.3.
|
|
45
|
+
"@blocklet/constant": "1.16.23-beta-aeb9f5bd",
|
|
46
|
+
"@blocklet/env": "1.16.23-beta-aeb9f5bd",
|
|
47
|
+
"@blocklet/meta": "1.16.23-beta-aeb9f5bd",
|
|
48
|
+
"@blocklet/resolver": "1.16.23-beta-aeb9f5bd",
|
|
49
|
+
"@blocklet/sdk": "1.16.23-beta-aeb9f5bd",
|
|
50
|
+
"@did-space/client": "^0.3.55",
|
|
51
51
|
"@fidm/x509": "^1.2.1",
|
|
52
52
|
"@ocap/mcrypto": "1.18.108",
|
|
53
53
|
"@ocap/util": "1.18.108",
|
|
@@ -92,15 +92,15 @@
|
|
|
92
92
|
"transliteration": "^2.3.5",
|
|
93
93
|
"ua-parser-js": "^1.0.2",
|
|
94
94
|
"url-join": "^4.0.1",
|
|
95
|
-
"uuid": "^
|
|
95
|
+
"uuid": "^9.0.1",
|
|
96
96
|
"valid-url": "^1.0.9",
|
|
97
97
|
"xbytes": "^1.8.0"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
100
|
"expand-tilde": "^2.0.2",
|
|
101
101
|
"express": "^4.18.2",
|
|
102
|
-
"jest": "^
|
|
102
|
+
"jest": "^29.7.0",
|
|
103
103
|
"unzipper": "^0.10.11"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "418cacd970d373aecc8706f8992e57369d394577"
|
|
106
106
|
}
|