@abtnode/core 1.16.28-beta-8acda0e6 → 1.16.28-next-5a717317

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 CHANGED
@@ -2,7 +2,7 @@ const { EventEmitter } = require('events');
2
2
  const pick = require('lodash/pick');
3
3
  const defaults = require('lodash/defaults');
4
4
  const cloneDeep = require('lodash/cloneDeep');
5
- const { joinURL } = require('ufo');
5
+ const joinUrl = require('url-join');
6
6
 
7
7
  const logger = require('@abtnode/logger')('@abtnode/core:api:team');
8
8
  const {
@@ -511,7 +511,7 @@ class TeamAPI extends EventEmitter {
511
511
  role,
512
512
  }),
513
513
  endpoint: getPassportStatusEndpoint({
514
- baseUrl: joinURL(appUrl, WELLKNOWN_SERVICE_PATH_PREFIX),
514
+ baseUrl: joinUrl(appUrl, WELLKNOWN_SERVICE_PATH_PREFIX),
515
515
  userDid,
516
516
  teamDid,
517
517
  }),
@@ -966,7 +966,7 @@ class TeamAPI extends EventEmitter {
966
966
  role,
967
967
  }),
968
968
  endpoint: getPassportStatusEndpoint({
969
- baseUrl: joinURL(appUrl, WELLKNOWN_SERVICE_PATH_PREFIX),
969
+ baseUrl: joinUrl(appUrl, WELLKNOWN_SERVICE_PATH_PREFIX),
970
970
  userDid,
971
971
  teamDid,
972
972
  }),
@@ -1,13 +1,11 @@
1
1
  const get = require('lodash/get');
2
2
  const camelCase = require('lodash/camelCase');
3
3
  const runScript = require('@abtnode/util/lib/run-script');
4
- const { getSecurityNodeOptions } = require('@abtnode/util/lib/security');
5
4
 
6
5
  // eslint-disable-next-line global-require
7
6
  const logger = require('@abtnode/logger')(`${require('../../package.json').name}:blocklet:hooks`);
8
7
 
9
8
  const { getSafeEnv } = require('../util');
10
- const states = require('../states');
11
9
 
12
10
  const runUserHook = async (label, hookName, args) => {
13
11
  const {
@@ -29,16 +27,10 @@ const runUserHook = async (label, hookName, args) => {
29
27
  }
30
28
 
31
29
  logger.info(`run hook:${hookName}:`, { label, hook });
32
-
33
- const nodeInfo = await states.node.read();
34
30
  // FIXME @linchen timeout 应该动态设置或不设置
35
31
  await runScript(hook, [label, hookName].join(':'), {
36
32
  cwd: appDir,
37
- env: {
38
- ...getSafeEnv(env),
39
- BLOCKLET_HOOK_NAME: hookName,
40
- NODE_OPTIONS: getSecurityNodeOptions({ environmentObj: env, ...args }, nodeInfo.enableFileSystemIsolation),
41
- },
33
+ env: { ...getSafeEnv(env), BLOCKLET_HOOK_NAME: hookName },
42
34
  silent,
43
35
  output: outputFile,
44
36
  error: errorFile,
@@ -16,7 +16,7 @@ const { sign } = require('@arcblock/jwt');
16
16
  const { isInServerlessMode } = require('@abtnode/util/lib/serverless');
17
17
  const sleep = require('@abtnode/util/lib/sleep');
18
18
  const getBlockletInfo = require('@blocklet/meta/lib/info');
19
- const { joinURL } = require('ufo');
19
+ const joinUrl = require('url-join');
20
20
  const { sendToUser } = require('@blocklet/sdk/lib/util/send-notification');
21
21
 
22
22
  const logger = require('@abtnode/logger')('@abtnode/core:blocklet:manager');
@@ -2799,7 +2799,7 @@ class DiskBlockletManager extends BaseBlockletManager {
2799
2799
  * @type {import('@abtnode/client').NodeState}
2800
2800
  */
2801
2801
  const node = await states.node.read();
2802
- referrer = joinURL(
2802
+ referrer = joinUrl(
2803
2803
  `https://${encode(node.did)}.${DEFAULT_DID_DOMAIN}`,
2804
2804
  node.routing.adminPath,
2805
2805
  `/blocklets/${did}/storage`
@@ -3253,8 +3253,7 @@ class DiskBlockletManager extends BaseBlockletManager {
3253
3253
  logo: '',
3254
3254
  };
3255
3255
  } else {
3256
- // Note: the component maybe in dev mode or removed
3257
- logger.warn(`engine component ${engineId} not found for ${did}`);
3256
+ throw new Error(`engine component ${engineId} not found`);
3258
3257
  }
3259
3258
  } else {
3260
3259
  component.engine = getEngine(engine.interpreter)?.describe();
@@ -4487,7 +4486,7 @@ class FederatedBlockletManager extends DiskBlockletManager {
4487
4486
  async joinFederatedLogin({ appUrl, did }, context) {
4488
4487
  const url = new URL(appUrl);
4489
4488
  // master service api 的地址
4490
- url.pathname = joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/api/federated/join');
4489
+ url.pathname = joinUrl(WELLKNOWN_SERVICE_PATH_PREFIX, '/api/federated/join');
4491
4490
 
4492
4491
  const blocklet = await this.getBlocklet(did);
4493
4492
  const nodeInfo = await states.node.read();
@@ -4504,7 +4503,7 @@ class FederatedBlockletManager extends DiskBlockletManager {
4504
4503
  aliasDomain: domainAliases.map((x) => x.value),
4505
4504
  appLogo:
4506
4505
  blocklet.environmentObj.BLOCKLET_APP_LOGO ||
4507
- normalizePathPrefix(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/blocklet/logo')) ||
4506
+ normalizePathPrefix(joinUrl(WELLKNOWN_SERVICE_PATH_PREFIX, '/blocklet/logo')) ||
4508
4507
  '/',
4509
4508
  appLogoRect: blocklet.environmentObj.BLOCKLET_APP_LOGO_RECT,
4510
4509
  did: permanentWallet.address,
@@ -1,4 +1,4 @@
1
- const { EventEmitter } = require('events');
1
+ const EventEmitter = require('events');
2
2
 
3
3
  const cloneDeep = require('lodash/cloneDeep');
4
4
  const pLimit = require('p-limit');
@@ -1,4 +1,4 @@
1
- const { EventEmitter } = require('events');
1
+ const EventEmitter = require('events');
2
2
  const dayjs = require('@abtnode/util/lib/dayjs');
3
3
  const pick = require('lodash/pick');
4
4
  const cloneDeep = require('lodash/cloneDeep');
@@ -10,7 +10,7 @@ const get = require('lodash/get');
10
10
  const cloneDeep = require('lodash/cloneDeep');
11
11
  const groupBy = require('lodash/groupBy');
12
12
  const isEqual = require('lodash/isEqual');
13
- const { joinURL } = require('ufo');
13
+ const joinUrl = require('url-join');
14
14
  const {
15
15
  replaceSlotToIp,
16
16
  findComponentById,
@@ -288,7 +288,7 @@ const ensureLatestInterfaceInfo = async (sites = []) => {
288
288
  if (rule.isProtected && rule.to.target === WELLKNOWN_SERVICE_PATH_PREFIX) {
289
289
  return rule;
290
290
  }
291
- if (rule.isProtected && rule.to.target === joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, USER_AVATAR_PATH_PREFIX)) {
291
+ if (rule.isProtected && rule.to.target === joinUrl(WELLKNOWN_SERVICE_PATH_PREFIX, USER_AVATAR_PATH_PREFIX)) {
292
292
  return rule;
293
293
  }
294
294
 
@@ -359,7 +359,7 @@ const ensureWellknownRule = async (sites = []) => {
359
359
  const rule = grouped[groupPathPrefix][0];
360
360
 
361
361
  // Serve blocklet service always
362
- const servicePathPrefix = joinURL(groupPathPrefix, WELLKNOWN_SERVICE_PATH_PREFIX);
362
+ const servicePathPrefix = joinUrl(groupPathPrefix, WELLKNOWN_SERVICE_PATH_PREFIX);
363
363
  if (!site.rules.some((x) => x.from.pathPrefix === servicePathPrefix)) {
364
364
  site.rules.push({
365
365
  id: rule.id,
@@ -380,7 +380,7 @@ const ensureWellknownRule = async (sites = []) => {
380
380
  }
381
381
 
382
382
  // Cache user avatar from gateway
383
- const avatarPathPrefix = joinURL(servicePathPrefix, USER_AVATAR_PATH_PREFIX);
383
+ const avatarPathPrefix = joinUrl(servicePathPrefix, USER_AVATAR_PATH_PREFIX);
384
384
  if (!site.rules.some((x) => x.from.pathPrefix === avatarPathPrefix)) {
385
385
  site.rules.push({
386
386
  id: rule.id,
@@ -492,7 +492,7 @@ const ensureBlockletWellknownRules = (sites, blocklets) => {
492
492
 
493
493
  const tmpMountPoint = mountPoint || blocklet.mountPoint;
494
494
  if (tmpMountPoint) {
495
- pathPrefix = joinURL(tmpMountPoint, pathPrefix);
495
+ pathPrefix = joinUrl(tmpMountPoint, pathPrefix);
496
496
  }
497
497
 
498
498
  const port = findInterfacePortByName(blocklet, tmpInterface.name);
@@ -585,7 +585,7 @@ const expandComponentRules = (sites = [], blocklets) => {
585
585
  newRule.from.pathPrefix = baseRule.from.pathPrefix;
586
586
  newRule.to.pageGroup = baseRule.to.pageGroup;
587
587
  } else {
588
- newRule.from.pathPrefix = joinURL(baseRule.from.pathPrefix, x.mountPoint);
588
+ newRule.from.pathPrefix = joinUrl(baseRule.from.pathPrefix, x.mountPoint);
589
589
  }
590
590
 
591
591
  expandedRules.push(newRule);
@@ -633,7 +633,7 @@ const ensureBlockletCache = (sites = [], blocklets) => {
633
633
  const cacheable = get(findWebInterface(component), 'cacheable', []);
634
634
  cacheable.forEach((cachePrefix) => {
635
635
  const clone = cloneDeep(rule);
636
- clone.from.pathPrefix = joinURL(rule.from.pathPrefix, cachePrefix);
636
+ clone.from.pathPrefix = joinUrl(rule.from.pathPrefix, cachePrefix);
637
637
  clone.to.cacheGroup = isServiceFeDevelopment ? '' : 'blockletProxy';
638
638
  clone.to.targetPrefix = cachePrefix;
639
639
  clone.dynamic = true; // mark as dynamic to avoid redundant generated rules
@@ -674,7 +674,7 @@ const decompressCertificates = async (source, dest) => {
674
674
  return dest;
675
675
  };
676
676
 
677
- const joinCertDownUrl = (baseUrl, name) => joinURL(baseUrl, '/certs', name);
677
+ const joinCertDownUrl = (baseUrl, name) => joinUrl(baseUrl, '/certs', name);
678
678
 
679
679
  const getIpEchoCertDownloadUrl = (baseUrl) => joinCertDownUrl(baseUrl, 'ip-abtnet-io.tar.gz');
680
680
  const getDidDomainCertDownloadUrl = (baseUrl) => joinCertDownUrl(baseUrl, 'did-abtnet-io.tar.gz');
@@ -13,7 +13,7 @@ const toLower = require('lodash/toLower');
13
13
  const { EventEmitter } = require('events');
14
14
  const uuid = require('uuid');
15
15
  const isUrl = require('is-url');
16
- const { joinURL } = require('ufo');
16
+ const joinUrl = require('url-join');
17
17
  const cloneDeep = require('lodash/cloneDeep');
18
18
  const normalizePathPrefix = require('@abtnode/util/lib/normalize-path-prefix');
19
19
  const logger = require('@abtnode/logger')('@abtnode/core:router:manager');
@@ -704,7 +704,7 @@ class RouterManager extends EventEmitter {
704
704
  const blockletPrefix = normalizePathPrefix(rawRule.from.pathPrefix);
705
705
 
706
706
  // root component's mountPoint may not be '/'
707
- const rootComponentPrefix = joinURL(blockletPrefix, blocklet.mountPoint || '/');
707
+ const rootComponentPrefix = joinUrl(blockletPrefix, blocklet.mountPoint || '/');
708
708
  rawRule.from.pathPrefix = normalizePathPrefix(rootComponentPrefix);
709
709
 
710
710
  const isOccupiable = isGatewayBlocklet(blocklet.meta);
@@ -3,7 +3,7 @@
3
3
  const pick = require('lodash/pick');
4
4
  const get = require('lodash/get');
5
5
  const uniq = require('lodash/uniq');
6
- const { joinURL } = require('ufo');
6
+ const joinUrl = require('url-join');
7
7
  const { getDisplayName } = require('@blocklet/meta/lib/util');
8
8
  const { BLOCKLET_SITE_GROUP_SUFFIX, NODE_SERVICES } = require('@abtnode/constant');
9
9
  const logger = require('@abtnode/logger')('@abtnode/core:states:audit-log');
@@ -12,7 +12,7 @@ const BaseState = require('./base');
12
12
 
13
13
  const { parse } = require('../util/ua');
14
14
 
15
- const getServerInfo = (info) => `[${info.name}](${joinURL(info.routing.adminPath, '/settings/about')})`;
15
+ const getServerInfo = (info) => `[${info.name}](${joinUrl(info.routing.adminPath, '/settings/about')})`;
16
16
  /**
17
17
  * @description
18
18
  * @param {import('@abtnode/client').BlockletState} blocklet
@@ -21,7 +21,7 @@ const getServerInfo = (info) => `[${info.name}](${joinURL(info.routing.adminPath
21
21
  * }} info
22
22
  * @returns {string}
23
23
  */
24
- const getBlockletInfo = (blocklet, info) => `[${getDisplayName(blocklet)}](${joinURL(info.routing.adminPath, '/blocklets/', blocklet.meta.did, '/overview')})`; // prettier-ignore
24
+ const getBlockletInfo = (blocklet, info) => `[${getDisplayName(blocklet)}](${joinUrl(info.routing.adminPath, '/blocklets/', blocklet.meta.did, '/overview')})`; // prettier-ignore
25
25
  const componentOrApplication = (componentDids) => (componentDids?.length ? 'component' : 'application');
26
26
  const getComponentNames = (blocklet, componentDids, withVersion) =>
27
27
  uniq(componentDids || [])
@@ -82,10 +82,10 @@ const expandUser = async (teamDid, userDid, passportId, info, node) => {
82
82
  const passport = user.passports.find((x) => x.id === passportId);
83
83
 
84
84
  if (teamDid === info.did) {
85
- return [`[${user.fullName}](${joinURL(info.routing.adminPath, '/team/members')})`, passport ? passport.name : ''];
85
+ return [`[${user.fullName}](${joinUrl(info.routing.adminPath, '/team/members')})`, passport ? passport.name : ''];
86
86
  }
87
87
 
88
- return [`[${user.fullName}](${joinURL(info.routing.adminPath, '/blocklets/', teamDid, '/members')})`, passport ? passport.name : '']; // prettier-ignore
88
+ return [`[${user.fullName}](${joinUrl(info.routing.adminPath, '/blocklets/', teamDid, '/members')})`, passport ? passport.name : '']; // prettier-ignore
89
89
  };
90
90
 
91
91
  /**
@@ -393,7 +393,6 @@ class User extends ExtendBase {
393
393
  'email',
394
394
  'avatar',
395
395
  'role',
396
-
397
396
  'locale',
398
397
  'extra',
399
398
  'lastLoginIp',
@@ -414,8 +413,6 @@ class User extends ExtendBase {
414
413
  if (updates.sourceAppPid) {
415
414
  delete updates.sourceAppPid;
416
415
  }
417
- // 登录不再更新 locale
418
- delete updates.locale;
419
416
  // update user, connectedAccount, passport
420
417
  updates.connectedAccounts = updateConnectedAccount(exist.connectedAccounts, user.connectedAccount);
421
418
  updated = await this.updateUser(exist.did, updates);
@@ -1,4 +1,3 @@
1
- /* eslint-disable camelcase */
2
1
  /* eslint-disable no-await-in-loop */
3
2
 
4
3
  const fs = require('fs-extra');
@@ -28,7 +27,7 @@ const logger = require('@abtnode/logger')('@abtnode/core:util:blocklet');
28
27
  const pm2 = require('@abtnode/util/lib/async-pm2');
29
28
  const sleep = require('@abtnode/util/lib/sleep');
30
29
  const getPm2ProcessInfo = require('@abtnode/util/lib/get-pm2-process-info');
31
- const { formatEnv, getSecurityNodeOptions } = require('@abtnode/util/lib/security');
30
+ const { formatEnv } = require('@abtnode/util/lib/security');
32
31
  const ensureEndpointHealthy = require('@abtnode/util/lib/ensure-endpoint-healthy');
33
32
  const getFolderSize = require('@abtnode/util/lib/get-folder-size');
34
33
  const normalizePathPrefix = require('@abtnode/util/lib/normalize-path-prefix');
@@ -181,9 +180,7 @@ const getComponentDirs = (component, { dataDirs, ensure = false, ancestors = []
181
180
  };
182
181
 
183
182
  /**
184
- * @param component {import('@abtnode/client').ComponentState & { environmentObj: {[key: string]: string } } }
185
- * @returns {{cwd, script, args, environmentObj, interpreter, interpreterArgs}: { args: []}}
186
- * @return {*}
183
+ * @returns { cwd, script, args, environmentObj, interpreter, interpreterArgs }
187
184
  */
188
185
  const getComponentStartEngine = (component, { e2eMode = false } = {}) => {
189
186
  if (!hasStartEngine(component.meta)) {
@@ -211,8 +208,8 @@ const getComponentStartEngine = (component, { e2eMode = false } = {}) => {
211
208
  }
212
209
 
213
210
  let script = null;
214
- let interpreter;
215
- let interpreterArgs = [];
211
+ let interpreter = '';
212
+ let interpreterArgs = '';
216
213
  const environmentObj = {};
217
214
  let args = [];
218
215
 
@@ -229,18 +226,11 @@ const getComponentStartEngine = (component, { e2eMode = false } = {}) => {
229
226
 
230
227
  if (component.mode !== BLOCKLET_MODES.DEVELOPMENT) {
231
228
  const engine = getEngine(blockletEngineInfo.interpreter);
232
- interpreter = engine.interpreter === 'node' ? undefined : engine.interpreter;
233
- interpreterArgs = interpreterArgs.concat(engine.args ? [engine.args] : []);
229
+ interpreter = engine.interpreter === 'node' ? '' : engine.interpreter;
230
+ interpreterArgs = engine.args || '';
234
231
  }
235
232
 
236
- return {
237
- cwd,
238
- script,
239
- args,
240
- environmentObj,
241
- interpreter,
242
- interpreterArgs: interpreterArgs.join(' ').trim(),
243
- };
233
+ return { cwd, script, args, environmentObj, interpreter, interpreterArgs };
244
234
  };
245
235
 
246
236
  const getBlockletConfigObj = (blocklet, { excludeSecure } = {}) => {
@@ -258,6 +248,7 @@ const getBlockletConfigObj = (blocklet, { excludeSecure } = {}) => {
258
248
 
259
249
  return obj;
260
250
  };
251
+
261
252
  /**
262
253
  * set 'configs', configObj', 'environmentObj' to blocklet TODO
263
254
  * @param {*} blocklet
@@ -540,12 +531,6 @@ const startBlockletProcess = async (
540
531
 
541
532
  await forEachBlocklet(
542
533
  blocklet,
543
- /**
544
- *
545
- * @param {import('@abtnode/client').BlockletState} b
546
- * @param {*} param1
547
- * @returns
548
- */
549
534
  async (b, { ancestors }) => {
550
535
  if (b.meta.group === BlockletGroup.gateway) {
551
536
  return;
@@ -587,10 +572,10 @@ const startBlockletProcess = async (
587
572
  await installExternalDependencies({ appDir: env?.BLOCKLET_APP_DIR });
588
573
 
589
574
  // run hook
590
- await preFlight(b, { env: { ...env } });
575
+ await preFlight(b, { env });
591
576
 
592
577
  // run hook
593
- await preStart(b, { env: { ...env } });
578
+ await preStart(b, { env });
594
579
 
595
580
  // kill process if port is occupied
596
581
  try {
@@ -603,9 +588,6 @@ const startBlockletProcess = async (
603
588
  // start process
604
589
  const maxMemoryRestart = get(nodeInfo, 'runtimeConfig.blockletMaxMemoryLimit', BLOCKLET_MAX_MEM_LIMIT_IN_MB);
605
590
 
606
- /**
607
- * @type {pm2.StartOptions}
608
- */
609
591
  const options = {
610
592
  namespace: 'blocklets',
611
593
  name: processId,
@@ -624,7 +606,6 @@ const startBlockletProcess = async (
624
606
  ...env,
625
607
  NODE_ENV: 'production',
626
608
  BLOCKLET_START_AT: now,
627
- NODE_OPTIONS: getSecurityNodeOptions(b, nodeInfo.enableFileSystemIsolation),
628
609
  },
629
610
  script,
630
611
  args,
@@ -1,4 +1,4 @@
1
- const { joinURL } = require('ufo');
1
+ const joinUrl = require('url-join');
2
2
  const axios = require('@abtnode/util/lib/axios');
3
3
  const { DEFAULT_IP_DOMAIN, WELLKNOWN_SERVER_ADMIN_PATH } = require('@abtnode/constant');
4
4
  const logger = require('@abtnode/logger')('@abtnode/core:util:get-accessible-external-node-ip');
@@ -15,7 +15,7 @@ const timeout = process.env.NODE_ENV === 'test' ? 500 : 5000;
15
15
  const checkConnected = async ({ ip, info }) => {
16
16
  const { adminPath = WELLKNOWN_SERVER_ADMIN_PATH } = info.routing || {};
17
17
  const origin = `https://${getNodeDomain(ip)}`;
18
- const endpoint = joinURL(origin, adminPath);
18
+ const endpoint = joinUrl(origin, adminPath);
19
19
  await axios.get(endpoint, { timeout });
20
20
  };
21
21
 
package/lib/util/index.js CHANGED
@@ -8,7 +8,7 @@ const camelCase = require('lodash/camelCase');
8
8
  const get = require('lodash/get');
9
9
  const pickBy = require('lodash/pickBy');
10
10
  const { isFromPublicKey } = require('@arcblock/did');
11
- const { joinURL } = require('ufo');
11
+ const joinUrl = require('url-join');
12
12
  const { Certificate } = require('@fidm/x509');
13
13
  const getPortLib = require('get-port');
14
14
  const v8 = require('v8');
@@ -362,7 +362,7 @@ const getStateCrons = (states) => [
362
362
 
363
363
  const getDelegateState = async (chainHost, address) => {
364
364
  const result = await axios.post(
365
- joinURL(chainHost, '/gql/'),
365
+ joinUrl(chainHost, '/gql/'),
366
366
  JSON.stringify({
367
367
  query: `{
368
368
  getDelegateState(address: "${address}") {
@@ -388,7 +388,7 @@ const getDelegateState = async (chainHost, address) => {
388
388
  };
389
389
 
390
390
  const getNFTState = async (chainHost, nftId) => {
391
- const url = joinURL(new URL(chainHost).origin, '/api/gql/');
391
+ const url = joinUrl(new URL(chainHost).origin, '/api/gql/');
392
392
 
393
393
  const result = await axios.post(
394
394
  url,
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
  const fs = require('fs-extra');
3
- const { joinURL } = require('ufo');
3
+ const joinUrl = require('url-join');
4
4
  const dayjs = require('@abtnode/util/lib/dayjs');
5
5
  const pick = require('lodash/pick');
6
6
  const uniq = require('lodash/uniq');
@@ -206,7 +206,7 @@ const setupAppOwner = async (node, sessionId) => {
206
206
  throw new Error(`Owner user not found from launcher: ${launcherUrl}`);
207
207
  }
208
208
  appOwnerProfile = pick(user, ['fullName', 'email', 'avatar']);
209
- const avatarBase64 = await getAvatarByUrl(joinURL(launcherUrl, user.avatar));
209
+ const avatarBase64 = await getAvatarByUrl(joinUrl(launcherUrl, user.avatar));
210
210
  appOwnerProfile.avatar = await extractUserAvatar(avatarBase64, { dataDir });
211
211
  logger.info('Create owner from launcher for blocklet', { appDid, ownerDid, ownerPk, sessionId, appOwnerProfile });
212
212
  } else {
@@ -242,7 +242,7 @@ const setupAppOwner = async (node, sessionId) => {
242
242
  endpoint: appUrl,
243
243
  }),
244
244
  endpoint: getPassportStatusEndpoint({
245
- baseUrl: joinURL(appUrl, WELLKNOWN_SERVICE_PATH_PREFIX),
245
+ baseUrl: joinUrl(appUrl, WELLKNOWN_SERVICE_PATH_PREFIX),
246
246
  userDid: ownerDid,
247
247
  teamDid: appDid,
248
248
  }),
@@ -3,7 +3,7 @@ const { default: axios } = require('axios');
3
3
  const isUrl = require('is-url');
4
4
  const isArray = require('lodash/isArray');
5
5
  const isEmpty = require('lodash/isEmpty');
6
- const { joinURL, withQuery } = require('ufo');
6
+ const joinUrl = require('url-join');
7
7
 
8
8
  /**
9
9
  * @description
@@ -35,9 +35,7 @@ function getBackupFilesUrlFromEndpoint(endpoint) {
35
35
  const spaceDid = strArray.at(-4);
36
36
  const appDid = strArray.at(-2);
37
37
 
38
- return withQuery(joinURL(prefix, 'space', spaceDid, 'apps', appDid, 'explorer'), {
39
- key: `/apps/${appDid}/.did-objects/${appDid}/`,
40
- });
38
+ return joinUrl(prefix, 'space', spaceDid, 'apps', appDid, 'explorer', `?key=/apps/${appDid}/.did-objects/${appDid}/`);
41
39
  }
42
40
 
43
41
  function getDIDSpacesUrlFromEndpoint(endpoint) {
package/lib/util/store.js CHANGED
@@ -1,4 +1,4 @@
1
- const { joinURL, withQuery } = require('ufo');
1
+ const joinUrl = require('url-join');
2
2
  const pick = require('lodash/pick');
3
3
  const isBase64 = require('is-base64');
4
4
 
@@ -48,9 +48,7 @@ const fixAndVerifyMetaFromStore = (meta) => {
48
48
 
49
49
  const getStoreMeta = async (registry) => {
50
50
  try {
51
- const url = withQuery(joinURL(registry, BLOCKLET_STORE_META_PATH), {
52
- __t__: Date.now(),
53
- });
51
+ const url = joinUrl(registry, BLOCKLET_STORE_META_PATH, `?__t__=${Date.now()}`);
54
52
  const { data } = await request.get(url);
55
53
 
56
54
  if (!data) {
@@ -71,7 +69,7 @@ const getStoreMeta = async (registry) => {
71
69
  } else if (isBase64(logoUrl, { allowMime: true })) {
72
70
  result.logoUrl = logoUrl;
73
71
  } else {
74
- result.logoUrl = joinURL(registry, logoUrl);
72
+ result.logoUrl = joinUrl(registry, logoUrl);
75
73
  }
76
74
  }
77
75
 
@@ -126,14 +124,14 @@ const resolveTarballURL = ({ did, tarball = '', storeUrl = '' }) => {
126
124
  return '';
127
125
  }
128
126
 
129
- return joinURL(storeUrl, 'api', 'blocklets', did, tarball);
127
+ return joinUrl(storeUrl, 'api', 'blocklets', did, tarball);
130
128
  };
131
129
 
132
130
  const getBlockletMetaUrl = ({ did, storeUrl }) =>
133
- joinURL(storeUrl, BLOCKLET_STORE_API_PREFIX, `/blocklets/${did}/blocklet.json`);
131
+ joinUrl(storeUrl, BLOCKLET_STORE_API_PREFIX, `/blocklets/${did}/blocklet.json`);
134
132
 
135
133
  const getBlockletMeta = async ({ did, storeUrl }) => {
136
- const url = joinURL(storeUrl, BLOCKLET_STORE_API_PREFIX, `/blocklets/${did}/blocklet.json?__t__=${Date.now()}`);
134
+ const url = joinUrl(storeUrl, BLOCKLET_STORE_API_PREFIX, `/blocklets/${did}/blocklet.json?__t__=${Date.now()}`);
137
135
 
138
136
  const { data } = await request.get(url);
139
137
  try {
@@ -39,7 +39,6 @@ const nodeInfoSchema = Joi.object({
39
39
  }),
40
40
  autoUpgrade: Joi.boolean(),
41
41
  enableWelcomePage: Joi.boolean(),
42
- enableFileSystemIsolation: Joi.boolean(),
43
42
  diskAlertThreshold: Joi.number()
44
43
  .label('disk alarm threshold')
45
44
  .max(99)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.28-beta-8acda0e6",
6
+ "version": "1.16.28-next-5a717317",
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.28-beta-8acda0e6",
23
- "@abtnode/auth": "1.16.28-beta-8acda0e6",
24
- "@abtnode/certificate-manager": "1.16.28-beta-8acda0e6",
25
- "@abtnode/constant": "1.16.28-beta-8acda0e6",
26
- "@abtnode/cron": "1.16.28-beta-8acda0e6",
27
- "@abtnode/logger": "1.16.28-beta-8acda0e6",
28
- "@abtnode/models": "1.16.28-beta-8acda0e6",
29
- "@abtnode/queue": "1.16.28-beta-8acda0e6",
30
- "@abtnode/rbac": "1.16.28-beta-8acda0e6",
31
- "@abtnode/router-provider": "1.16.28-beta-8acda0e6",
32
- "@abtnode/static-server": "1.16.28-beta-8acda0e6",
33
- "@abtnode/timemachine": "1.16.28-beta-8acda0e6",
34
- "@abtnode/util": "1.16.28-beta-8acda0e6",
22
+ "@abtnode/analytics": "1.16.28-next-5a717317",
23
+ "@abtnode/auth": "1.16.28-next-5a717317",
24
+ "@abtnode/certificate-manager": "1.16.28-next-5a717317",
25
+ "@abtnode/constant": "1.16.28-next-5a717317",
26
+ "@abtnode/cron": "1.16.28-next-5a717317",
27
+ "@abtnode/logger": "1.16.28-next-5a717317",
28
+ "@abtnode/models": "1.16.28-next-5a717317",
29
+ "@abtnode/queue": "1.16.28-next-5a717317",
30
+ "@abtnode/rbac": "1.16.28-next-5a717317",
31
+ "@abtnode/router-provider": "1.16.28-next-5a717317",
32
+ "@abtnode/static-server": "1.16.28-next-5a717317",
33
+ "@abtnode/timemachine": "1.16.28-next-5a717317",
34
+ "@abtnode/util": "1.16.28-next-5a717317",
35
35
  "@arcblock/did": "1.18.123",
36
36
  "@arcblock/did-auth": "1.18.123",
37
37
  "@arcblock/did-ext": "^1.18.123",
@@ -42,20 +42,20 @@
42
42
  "@arcblock/pm2-events": "^0.0.5",
43
43
  "@arcblock/validator": "^1.18.123",
44
44
  "@arcblock/vc": "1.18.123",
45
- "@blocklet/constant": "1.16.28-beta-8acda0e6",
46
- "@blocklet/env": "1.16.28-beta-8acda0e6",
47
- "@blocklet/meta": "1.16.28-beta-8acda0e6",
48
- "@blocklet/resolver": "1.16.28-beta-8acda0e6",
49
- "@blocklet/sdk": "1.16.28-beta-8acda0e6",
50
- "@blocklet/store": "1.16.28-beta-8acda0e6",
51
- "@did-space/client": "^0.5.1",
45
+ "@blocklet/constant": "1.16.28-next-5a717317",
46
+ "@blocklet/env": "1.16.28-next-5a717317",
47
+ "@blocklet/meta": "1.16.28-next-5a717317",
48
+ "@blocklet/resolver": "1.16.28-next-5a717317",
49
+ "@blocklet/sdk": "1.16.28-next-5a717317",
50
+ "@blocklet/store": "1.16.28-next-5a717317",
51
+ "@did-space/client": "^0.4.20",
52
52
  "@fidm/x509": "^1.2.1",
53
53
  "@ocap/mcrypto": "1.18.123",
54
54
  "@ocap/util": "1.18.123",
55
55
  "@ocap/wallet": "1.18.123",
56
56
  "@slack/webhook": "^5.0.4",
57
57
  "archiver": "^7.0.1",
58
- "axios": "^1.7.2",
58
+ "axios": "^0.27.2",
59
59
  "axon": "^2.0.3",
60
60
  "chalk": "^4.1.2",
61
61
  "cross-spawn": "^7.0.3",
@@ -92,7 +92,7 @@
92
92
  "tar": "^6.1.11",
93
93
  "transliteration": "^2.3.5",
94
94
  "ua-parser-js": "^1.0.2",
95
- "ufo": "^1.5.3",
95
+ "url-join": "^4.0.1",
96
96
  "uuid": "^9.0.1",
97
97
  "valid-url": "^1.0.9",
98
98
  "xbytes": "^1.8.0"
@@ -103,5 +103,5 @@
103
103
  "jest": "^29.7.0",
104
104
  "unzipper": "^0.10.11"
105
105
  },
106
- "gitHead": "a1a896a7d34abc6a1f24b855524c228c0b0a3ade"
106
+ "gitHead": "3624967f9549de3a25a87ed6b20f82519ddb4757"
107
107
  }