@abtnode/core 1.17.12 → 1.17.13-beta-20260512-042419-7b556a38

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.
@@ -529,7 +529,7 @@ async function getPassportIssuances(api, { teamDid, ownerDid }) {
529
529
  async function getPassportIssuance(api, { teamDid, sessionId }) {
530
530
  const state = await api.getSessionState(teamDid);
531
531
  const doc = await state.read(sessionId);
532
- // FIXME: @zhanghan 指定被邀请者的邀请需要查询被邀请者的详细信息
532
+ // FIXME: 指定被邀请者的邀请需要查询被邀请者的详细信息
533
533
  return doc;
534
534
  }
535
535
 
@@ -546,7 +546,7 @@ async function logoutUser(api, { teamDid, userDid, visitorId = '', appPid = '',
546
546
  callFederated({
547
547
  action: 'sync',
548
548
  permanentWallet,
549
- // FIXME: @zhanghan 是否还需要通知其他 Member 站点,执行退出登录的操作
549
+ // FIXME: 是否还需要通知其他 Member 站点,执行退出登录的操作
550
550
  site: masterSite,
551
551
  data: {
552
552
  userSessions: [
@@ -113,7 +113,7 @@ async function getUsers(api, { teamDid, query, paging: inputPaging, sort, dids }
113
113
  // eslint-disable-next-line function-paren-newline
114
114
  );
115
115
  return {
116
- // FIXME: @zhanghan 这里做字段过滤的目的是?gql 本身已经对字段做了过滤了
116
+ // FIXME: 这里做字段过滤的目的是?gql 本身已经对字段做了过滤了
117
117
  users,
118
118
  paging,
119
119
  };
@@ -570,7 +570,7 @@ async function syncFederatedConfig(manager, { did }) {
570
570
  let siteInfoList = [];
571
571
  if (isSelfMaster) {
572
572
  siteInfoList = await pMap(
573
- // FIXME: @zhanghan 需要对 sites 做一次去重处理
573
+ // FIXME: 需要对 sites 做一次去重处理
574
574
  uniqBy(federated.sites, 'appPid'),
575
575
  async (item) => {
576
576
  if (item.appPid === teamDid) {
@@ -326,7 +326,7 @@ async function _addBlocklet(
326
326
  }
327
327
  }
328
328
 
329
- // FIXME @linchen
329
+ // FIXME:
330
330
  // 当应用本身是容器时, 下载这个容器, 因为容器可能除 blocklet.yml 额外的文件
331
331
  // 本身就是容器的应用, 在容器中添加额外文件可能不是合理的做法
332
332
  // 容器只在安装时有效, 安装后容器无法升级
@@ -431,7 +431,7 @@ async function _attachRuntimeInfo(manager, { did, nodeInfo, diskInfo = false, co
431
431
  version: engineComponent.meta.version,
432
432
  available: true,
433
433
  visible: true,
434
- // FIXME: @wangshijun this should be dynamic
434
+ // FIXME: this should be dynamic
435
435
  logo: '',
436
436
  };
437
437
  } else if (engineId !== STATIC_SERVER_ENGINE_DID) {
@@ -1370,7 +1370,7 @@ class DiskBlockletManager extends BaseBlockletManager {
1370
1370
  }
1371
1371
 
1372
1372
  /**
1373
- * FIXME: @linchen support cancel
1373
+ * FIXME: support cancel
1374
1374
  * @param {import('@blocklet/server-js').RequestRestoreBlockletInput} input
1375
1375
  * @memberof BlockletManager
1376
1376
  */
@@ -88,7 +88,7 @@ const installApplicationFromGeneral = async ({
88
88
  ? {
89
89
  store: registryUrl,
90
90
  name: meta.bundleName || meta.name,
91
- // FIXME @linchen version should be specified
91
+ // FIXME: version should be specified
92
92
  version: 'latest',
93
93
  }
94
94
  : { url: componentSourceUrl },
@@ -88,7 +88,7 @@ const installComponentFromUrl = async ({
88
88
  ? {
89
89
  store: registryUrl,
90
90
  name: meta.bundleName || meta.name,
91
- // FIXME @linchen version should be specified
91
+ // FIXME: version should be specified
92
92
  version: 'latest',
93
93
  }
94
94
  : { url },
@@ -223,7 +223,7 @@ const migrateApplicationToStructV2 = async ({ did, appSk: newAppSk, context = {}
223
223
  extraData.meta.name = appPid;
224
224
  }
225
225
  // fork root component's configs to container
226
- // FIXME: @linchen the configs in container should be managed in dashboard ?
226
+ // FIXME: should configs in container be managed in dashboard?
227
227
  extraData.configs = (extraData.configs || []).filter((x) => x.key !== BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SK);
228
228
 
229
229
  // If appSk not configured before, then set derived appSk as permanent appSk
@@ -55,7 +55,7 @@ const getNoopLogger = (label = '') => {
55
55
  // singleton per process
56
56
  let addedRejectionExceptionTransport = false;
57
57
 
58
- // 目前的实现不支持 splat, 但是我测试了好多次,但是依然没搞明白为什么 splat 中包含了所有的 metadata
58
+ // splat is intentionally unused here; the splat array unexpectedly contains all metadata
59
59
  const customPrintfCallback = ({ level, message, label, timestamp, [Symbol.for('splat')]: metadata }) => {
60
60
  let result = `[${process.pid}] [${timestamp}] [${level}] [${label || 'default'}] [${message || ''}]`;
61
61
 
@@ -9865,14 +9865,14 @@ const { areIdentical } = __nccwpck_require__(887)
9865
9865
  async function createLink (srcpath, dstpath) {
9866
9866
  let dstStat
9867
9867
  try {
9868
- dstStat = await fs.lstat(dstpath)
9868
+ dstStat = await fs.lstat(dstpath, { bigint: true })
9869
9869
  } catch {
9870
9870
  // ignore error
9871
9871
  }
9872
9872
 
9873
9873
  let srcStat
9874
9874
  try {
9875
- srcStat = await fs.lstat(srcpath)
9875
+ srcStat = await fs.lstat(srcpath, { bigint: true })
9876
9876
  } catch (err) {
9877
9877
  err.message = err.message.replace('lstat', 'ensureLink')
9878
9878
  throw err
@@ -9894,11 +9894,11 @@ async function createLink (srcpath, dstpath) {
9894
9894
  function createLinkSync (srcpath, dstpath) {
9895
9895
  let dstStat
9896
9896
  try {
9897
- dstStat = fs.lstatSync(dstpath)
9897
+ dstStat = fs.lstatSync(dstpath, { bigint: true })
9898
9898
  } catch {}
9899
9899
 
9900
9900
  try {
9901
- const srcStat = fs.lstatSync(srcpath)
9901
+ const srcStat = fs.lstatSync(srcpath, { bigint: true })
9902
9902
  if (dstStat && areIdentical(srcStat, dstStat)) return
9903
9903
  } catch (err) {
9904
9904
  err.message = err.message.replace('lstat', 'ensureLink')
@@ -10098,11 +10098,22 @@ async function createSymlink (srcpath, dstpath, type) {
10098
10098
  } catch { }
10099
10099
 
10100
10100
  if (stats && stats.isSymbolicLink()) {
10101
- const [srcStat, dstStat] = await Promise.all([
10102
- fs.stat(srcpath),
10103
- fs.stat(dstpath)
10104
- ])
10101
+ // When srcpath is relative, resolve it relative to dstpath's directory
10102
+ // (standard symlink behavior) or fall back to cwd if that doesn't exist
10103
+ let srcStat
10104
+ if (path.isAbsolute(srcpath)) {
10105
+ srcStat = await fs.stat(srcpath, { bigint: true })
10106
+ } else {
10107
+ const dstdir = path.dirname(dstpath)
10108
+ const relativeToDst = path.join(dstdir, srcpath)
10109
+ try {
10110
+ srcStat = await fs.stat(relativeToDst, { bigint: true })
10111
+ } catch {
10112
+ srcStat = await fs.stat(srcpath, { bigint: true })
10113
+ }
10114
+ }
10105
10115
 
10116
+ const dstStat = await fs.stat(dstpath, { bigint: true })
10106
10117
  if (areIdentical(srcStat, dstStat)) return
10107
10118
  }
10108
10119
 
@@ -10124,8 +10135,22 @@ function createSymlinkSync (srcpath, dstpath, type) {
10124
10135
  stats = fs.lstatSync(dstpath)
10125
10136
  } catch { }
10126
10137
  if (stats && stats.isSymbolicLink()) {
10127
- const srcStat = fs.statSync(srcpath)
10128
- const dstStat = fs.statSync(dstpath)
10138
+ // When srcpath is relative, resolve it relative to dstpath's directory
10139
+ // (standard symlink behavior) or fall back to cwd if that doesn't exist
10140
+ let srcStat
10141
+ if (path.isAbsolute(srcpath)) {
10142
+ srcStat = fs.statSync(srcpath, { bigint: true })
10143
+ } else {
10144
+ const dstdir = path.dirname(dstpath)
10145
+ const relativeToDst = path.join(dstdir, srcpath)
10146
+ try {
10147
+ srcStat = fs.statSync(relativeToDst, { bigint: true })
10148
+ } catch {
10149
+ srcStat = fs.statSync(srcpath, { bigint: true })
10150
+ }
10151
+ }
10152
+
10153
+ const dstStat = fs.statSync(dstpath, { bigint: true })
10129
10154
  if (areIdentical(srcStat, dstStat)) return
10130
10155
  }
10131
10156
 
@@ -10937,30 +10962,47 @@ const fs = __nccwpck_require__(3506)
10937
10962
  const u = (__nccwpck_require__(5077).fromPromise)
10938
10963
 
10939
10964
  async function utimesMillis (path, atime, mtime) {
10940
- // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
10941
10965
  const fd = await fs.open(path, 'r+')
10942
10966
 
10943
- let closeErr = null
10967
+ let error = null
10944
10968
 
10945
10969
  try {
10946
10970
  await fs.futimes(fd, atime, mtime)
10971
+ } catch (futimesErr) {
10972
+ error = futimesErr
10947
10973
  } finally {
10948
10974
  try {
10949
10975
  await fs.close(fd)
10950
- } catch (e) {
10951
- closeErr = e
10976
+ } catch (closeErr) {
10977
+ if (!error) error = closeErr
10952
10978
  }
10953
10979
  }
10954
10980
 
10955
- if (closeErr) {
10956
- throw closeErr
10981
+ if (error) {
10982
+ throw error
10957
10983
  }
10958
10984
  }
10959
10985
 
10960
10986
  function utimesMillisSync (path, atime, mtime) {
10961
10987
  const fd = fs.openSync(path, 'r+')
10962
- fs.futimesSync(fd, atime, mtime)
10963
- return fs.closeSync(fd)
10988
+
10989
+ let error = null
10990
+
10991
+ try {
10992
+ fs.futimesSync(fd, atime, mtime)
10993
+ } catch (futimesErr) {
10994
+ error = futimesErr
10995
+ } finally {
10996
+ try {
10997
+ fs.closeSync(fd)
10998
+ } catch (closeErr) {
10999
+ if (!error) error = closeErr
11000
+ }
11001
+ }
11002
+
11003
+ if (error) {
11004
+ throw error
11005
+ }
10964
11006
  }
10965
11007
 
10966
11008
  module.exports = {
@@ -12310,6 +12352,10 @@ function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces
12310
12352
  const EOF = finalEOL ? EOL : ''
12311
12353
  const str = JSON.stringify(obj, replacer, spaces)
12312
12354
 
12355
+ if (str === undefined) {
12356
+ throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`)
12357
+ }
12358
+
12313
12359
  return str.replace(/\n/g, EOL) + EOF
12314
12360
  }
12315
12361
 
@@ -16340,7 +16386,7 @@ module.exports = setCacheAdd;
16340
16386
  * @name has
16341
16387
  * @memberOf SetCache
16342
16388
  * @param {*} value The value to search for.
16343
- * @returns {number} Returns `true` if `value` is found, else `false`.
16389
+ * @returns {boolean} Returns `true` if `value` is found, else `false`.
16344
16390
  */
16345
16391
  function setCacheHas(value) {
16346
16392
  return this.__data__.has(value);
@@ -31705,7 +31751,7 @@ const diff = (version1, version2) => {
31705
31751
  return prefix + 'patch'
31706
31752
  }
31707
31753
 
31708
- // high and low are preleases
31754
+ // high and low are prereleases
31709
31755
  return 'prerelease'
31710
31756
  }
31711
31757
 
@@ -31959,6 +32005,62 @@ const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
31959
32005
  module.exports = sort
31960
32006
 
31961
32007
 
32008
+ /***/ }),
32009
+
32010
+ /***/ 6114:
32011
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
32012
+
32013
+ "use strict";
32014
+
32015
+
32016
+ const parse = __nccwpck_require__(6353)
32017
+ const constants = __nccwpck_require__(5101)
32018
+ const SemVer = __nccwpck_require__(7163)
32019
+
32020
+ const truncate = (version, truncation, options) => {
32021
+ if (!constants.RELEASE_TYPES.includes(truncation)) {
32022
+ return null
32023
+ }
32024
+
32025
+ const clonedVersion = cloneInputVersion(version, options)
32026
+ return clonedVersion && doTruncation(clonedVersion, truncation)
32027
+ }
32028
+
32029
+ const cloneInputVersion = (version, options) => {
32030
+ const versionStringToParse = (
32031
+ version instanceof SemVer ? version.version : version
32032
+ )
32033
+
32034
+ return parse(versionStringToParse, options)
32035
+ }
32036
+
32037
+ const doTruncation = (version, truncation) => {
32038
+ if (isPrerelease(truncation)) {
32039
+ return version.version
32040
+ }
32041
+
32042
+ version.prerelease = []
32043
+
32044
+ switch (truncation) {
32045
+ case 'major':
32046
+ version.minor = 0
32047
+ version.patch = 0
32048
+ break
32049
+ case 'minor':
32050
+ version.patch = 0
32051
+ break
32052
+ }
32053
+
32054
+ return version.format()
32055
+ }
32056
+
32057
+ const isPrerelease = (type) => {
32058
+ return type.startsWith('pre')
32059
+ }
32060
+
32061
+ module.exports = truncate
32062
+
32063
+
31962
32064
  /***/ }),
31963
32065
 
31964
32066
  /***/ 8780:
@@ -32011,6 +32113,7 @@ const gte = __nccwpck_require__(1236)
32011
32113
  const lte = __nccwpck_require__(6717)
32012
32114
  const cmp = __nccwpck_require__(8646)
32013
32115
  const coerce = __nccwpck_require__(5385)
32116
+ const truncate = __nccwpck_require__(6114)
32014
32117
  const Comparator = __nccwpck_require__(9379)
32015
32118
  const Range = __nccwpck_require__(6782)
32016
32119
  const satisfies = __nccwpck_require__(8011)
@@ -32049,6 +32152,7 @@ module.exports = {
32049
32152
  lte,
32050
32153
  cmp,
32051
32154
  coerce,
32155
+ truncate,
32052
32156
  Comparator,
32053
32157
  Range,
32054
32158
  satisfies,
@@ -32336,8 +32440,8 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
32336
32440
 
32337
32441
  // ## Pre-release Version Identifier
32338
32442
  // A numeric identifier, or a non-numeric identifier.
32339
- // Non-numberic identifiers include numberic identifiers but can be longer.
32340
- // Therefore non-numberic identifiers must go first.
32443
+ // Non-numeric identifiers include numeric identifiers but can be longer.
32444
+ // Therefore non-numeric identifiers must go first.
32341
32445
 
32342
32446
  createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
32343
32447
  }|${src[t.NUMERICIDENTIFIER]})`)
@@ -32394,7 +32498,7 @@ createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
32394
32498
  createToken('GTLT', '((?:<|>)?=?)')
32395
32499
 
32396
32500
  // Something like "2.*" or "1.2.x".
32397
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
32501
+ // Note that "x.x" is a valid xRange identifier, meaning "any version"
32398
32502
  // Only the first item is strictly required.
32399
32503
  createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
32400
32504
  createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
@@ -32859,7 +32963,7 @@ const compare = __nccwpck_require__(8469)
32859
32963
  // - If LT
32860
32964
  // - If LT.semver is greater than any < or <= comp in C, return false
32861
32965
  // - If LT is <=, and LT.semver does not satisfy every C, return false
32862
- // - If GT.semver has a prerelease, and not in prerelease mode
32966
+ // - If LT.semver has a prerelease, and not in prerelease mode
32863
32967
  // - If no C has a prerelease and the LT.semver tuple, return false
32864
32968
  // - Else return true
32865
32969
 
@@ -38062,6 +38166,7 @@ module.exports = require("zlib");
38062
38166
  /***/ 567:
38063
38167
  /***/ ((__unused_webpack_module, exports) => {
38064
38168
 
38169
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
38065
38170
 
38066
38171
  //#region src/roles.js
38067
38172
  const ROLES = /* @__PURE__ */ Object.freeze({
@@ -39103,7 +39208,7 @@ exports.isSystemRole = isSystemRole;
39103
39208
  /***/ ((module) => {
39104
39209
 
39105
39210
  "use strict";
39106
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.11","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.11","@abtnode/auth":"1.17.11","@abtnode/certificate-manager":"1.17.11","@abtnode/constant":"1.17.11","@abtnode/cron":"1.17.11","@abtnode/db-cache":"1.17.11","@abtnode/docker-utils":"1.17.11","@abtnode/logger":"1.17.11","@abtnode/models":"1.17.11","@abtnode/queue":"1.17.11","@abtnode/rbac":"1.17.11","@abtnode/router-provider":"1.17.11","@abtnode/util":"1.17.11","@arcblock/did":"1.29.27","@arcblock/did-connect-js":"1.29.27","@arcblock/did-ext":"1.29.27","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.29.27","@arcblock/event-hub":"1.29.27","@arcblock/jwt":"1.29.27","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.29.27","@arcblock/vc":"1.29.27","@blocklet/constant":"1.17.11","@blocklet/did-space-js":"1.2.23","@blocklet/env":"1.17.11","@blocklet/error":"^0.3.5","@blocklet/meta":"1.17.11","@blocklet/resolver":"1.17.11","@blocklet/sdk":"1.17.11","@blocklet/server-js":"1.17.11","@blocklet/store":"1.17.11","@blocklet/theme":"^3.5.2","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.29.27","@ocap/util":"1.29.27","@ocap/wallet":"1.29.27","@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"}');
39211
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.17.12","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib"},"keywords":[],"author":{"name":"ArcBlock","email":"blocklet@arcblock.io","url":"https://github.com/ArcBlock"},"license":"Apache-2.0","repository":{"type":"git","url":"https://github.com/ArcBlock/blocklet-server.git","directory":"core/state"},"bugs":{"url":"https://github.com/ArcBlock/blocklet-server/issues"},"homepage":"https://github.com/ArcBlock/blocklet-server/tree/main/core/state#readme","dependencies":{"@abtnode/analytics":"1.17.12","@abtnode/auth":"1.17.12","@abtnode/certificate-manager":"1.17.12","@abtnode/constant":"1.17.12","@abtnode/cron":"1.17.12","@abtnode/db-cache":"1.17.12","@abtnode/docker-utils":"1.17.12","@abtnode/logger":"1.17.12","@abtnode/models":"1.17.12","@abtnode/queue":"1.17.12","@abtnode/rbac":"1.17.12","@abtnode/router-provider":"1.17.12","@abtnode/util":"1.17.12","@arcblock/did":"1.29.27","@arcblock/did-connect-js":"1.29.27","@arcblock/did-ext":"1.29.27","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.29.27","@arcblock/event-hub":"1.29.27","@arcblock/jwt":"1.29.27","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.29.27","@arcblock/vc":"1.29.27","@blocklet/constant":"1.17.12","@blocklet/did-space-js":"1.2.23","@blocklet/env":"1.17.12","@blocklet/error":"^0.3.5","@blocklet/meta":"1.17.12","@blocklet/resolver":"1.17.12","@blocklet/sdk":"1.17.12","@blocklet/server-js":"1.17.12","@blocklet/store":"1.17.12","@blocklet/theme":"^3.5.2","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.29.27","@ocap/util":"1.29.27","@ocap/wallet":"1.29.27","@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","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":"^7.5.13","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"}');
39107
39212
 
39108
39213
  /***/ }),
39109
39214
 
@@ -3,7 +3,6 @@
3
3
  /* eslint-disable prefer-destructuring */
4
4
  const fs = require('fs-extra');
5
5
  const path = require('path');
6
- const tar = require('tar');
7
6
  const dns = require('dns').promises;
8
7
  const UUID = require('uuid');
9
8
  const dayjs = require('@abtnode/util/lib/dayjs');
@@ -27,6 +26,7 @@ const normalizePathPrefix = require('@abtnode/util/lib/normalize-path-prefix');
27
26
  const getTmpDir = require('@abtnode/util/lib/get-tmp-directory');
28
27
  const downloadFile = require('@abtnode/util/lib/download-file');
29
28
  const axios = require('@abtnode/util/lib/axios');
29
+ const { safeTarExtract } = require('@abtnode/util/lib/safe-tar');
30
30
  const { getIpDnsDomainForBlocklet, getDidDomainForBlocklet } = require('@abtnode/util/lib/get-domain-for-blocklet');
31
31
  const { hasMountPoint } = require('@blocklet/meta/lib/engine');
32
32
  const { forEachBlockletSync } = require('@blocklet/meta/lib/util');
@@ -840,7 +840,7 @@ const ensureLatestInfo = async (sites = [], blocklets = [], teamManager = null,
840
840
 
841
841
  const decompressCertificates = async (source, dest) => {
842
842
  fs.ensureDirSync(dest);
843
- await tar.x({ file: source, C: dest });
843
+ await safeTarExtract({ file: source, cwd: dest });
844
844
  return dest;
845
845
  };
846
846
 
@@ -2188,7 +2188,7 @@ module.exports = function getRouterHelpers({
2188
2188
 
2189
2189
  const analyzeLock = path.join(logDir, '.analyze.lock20241030');
2190
2190
  if (fs.existsSync(analyzeLock)) {
2191
- // FIXME: @wangshijun how do we support real time logs
2191
+ // FIXME: how do we support real time logs
2192
2192
  const date = dayjs().subtract(1, 'day').format('YYYY-MM-DD');
2193
2193
  await doAnalyze(date, cloneDeep(groups));
2194
2194
  } else {
@@ -1,4 +1,4 @@
1
- // FIXME: @wangshijun use a crash safe store for the limiter
1
+ // FIXME: use a crash safe store for the limiter
2
2
  const dayjs = require('@abtnode/util/lib/dayjs');
3
3
  const { BLACKLIST_SCOPE } = require('@abtnode/constant');
4
4
  const { RateLimiterMemory } = require('rate-limiter-flexible');
@@ -972,8 +972,8 @@ class AuditLogState extends BaseState {
972
972
  protocol: 'http',
973
973
  user: {
974
974
  meta: 'profile',
975
- fullName: 'wangshijun',
976
- email: 'shijun@arcblock.io',
975
+ fullName: 'user',
976
+ email: 'user@example.com',
977
977
  type: 'profile',
978
978
  did: 'z1jq5bGF64wnZiy29EbRyuQqUxmRHmSdt1Q',
979
979
  pk: 'zHTcKwgi9DK8US8QQY9K7wQ3qF79CtrWYn6BYAgTQUeVQ',
@@ -16,7 +16,7 @@ const { validateUpdateDomainAliases } = require('../validators/router');
16
16
  // };
17
17
 
18
18
  /**
19
- * FIXME: @wangshijun some functions may not be performant
19
+ * FIXME: some functions may not be performant
20
20
  * @extends BaseState<import('@abtnode/models').SiteState>
21
21
  */
22
22
  class SiteState extends BaseState {
@@ -100,7 +100,7 @@ class User extends ExtendBase {
100
100
  }
101
101
  }
102
102
 
103
- // FIXME: @wangshijun wrap these in a transaction
103
+ // FIXME: wrap these in a transaction
104
104
  async addUser(user) {
105
105
  if (!validateOwner(user)) {
106
106
  throw new CustomError(400, 'user is invalid');
@@ -120,7 +120,7 @@ class User extends ExtendBase {
120
120
  await Promise.all((get(user, 'passports') || []).map((x) => this.passport.insert({ ...x, userDid: user.did })));
121
121
  await Promise.all(
122
122
  (get(user, 'connectedAccounts') || []).map((x) => {
123
- // FIXME: @zhanghan 这里在修复完 https://github.com/blocklet/tweet-token/issues/131 之后需要去除特殊处理的逻辑
123
+ // FIXME: 这里在修复完 https://github.com/blocklet/tweet-token/issues/131 之后需要去除特殊处理的逻辑
124
124
  const mergeData = { ...x, userDid: user.did };
125
125
  if (mergeData.id === null && mergeData.provider === LOGIN_PROVIDER.AUTH0) {
126
126
  mergeData.provider = LOGIN_PROVIDER.WALLET;
@@ -132,7 +132,7 @@ class User extends ExtendBase {
132
132
  return this.getUser(user.did);
133
133
  }
134
134
 
135
- // FIXME: @wangshijun wrap these in a transaction
135
+ // FIXME: wrap these in a transaction
136
136
  async updateUser(did, updates) {
137
137
  const exist = await super.findOne({ did });
138
138
  if (!exist) {
@@ -176,7 +176,7 @@ class User extends ExtendBase {
176
176
  (get(cloneData, 'connectedAccounts') || [])
177
177
  .filter((x) => x.did)
178
178
  .map((x) => {
179
- // FIXME: @zhanghan 这里在修复完 https://github.com/blocklet/tweet-token/issues/131 之后需要去除特殊处理的逻辑
179
+ // FIXME: 这里在修复完 https://github.com/blocklet/tweet-token/issues/131 之后需要去除特殊处理的逻辑
180
180
  const mergeData = { ...x, userDid: did };
181
181
  if (mergeData.id === null && mergeData.provider === LOGIN_PROVIDER.AUTH0) {
182
182
  mergeData.provider = LOGIN_PROVIDER.WALLET;
@@ -111,7 +111,7 @@ const _getBlocklet = async ({
111
111
  const settings = states.blockletExtras.getFromDoc({ doc: extraDoc, dids: [blocklet.meta.did], name: 'settings' });
112
112
 
113
113
  // app settings
114
- // FIXME: @zhanghan 在 server 开发模式下,使用 `node /workspace/arcblock/blocklet-server/core/cli/tools/dev.js` 运行的 blocklet,blocklet.meta.did 和 blocklet.appPid 是不一致的
114
+ // FIXME: 在 server 开发模式下,使用 `node /workspace/arcblock/blocklet-server/core/cli/tools/dev.js` 运行的 blocklet,blocklet.meta.did 和 blocklet.appPid 是不一致的
115
115
  blocklet.trustedPassports = get(settings, 'trustedPassports') || [];
116
116
  blocklet.trustedFactories = (get(settings, 'trustedFactories') || []).map((x) => {
117
117
  if (!x.passport.ttlPolicy) {
@@ -8,7 +8,6 @@
8
8
 
9
9
  const fs = require('fs-extra');
10
10
  const path = require('node:path');
11
- const tar = require('tar');
12
11
  const get = require('lodash/get');
13
12
  const streamToPromise = require('stream-to-promise');
14
13
  const { Throttle } = require('stream-throttle');
@@ -18,6 +17,7 @@ const diff = require('deep-diff');
18
17
  const logger = require('@abtnode/logger')('@abtnode/core:util:blocklet:install-utils');
19
18
  const formatBackSlash = require('@abtnode/util/lib/format-back-slash');
20
19
  const hashFiles = require('@abtnode/util/lib/hash-files');
20
+ const { createSafeTarExtractStream } = require('@abtnode/util/lib/safe-tar');
21
21
  const { BLOCKLET_INSTALL_TYPE } = require('@abtnode/constant');
22
22
 
23
23
  const { BlockletStatus, BlockletSource, fromBlockletStatus } = require('@blocklet/constant');
@@ -61,7 +61,7 @@ const expandTarball = async ({ source, dest, strip = 1 }) => {
61
61
  fs
62
62
  .createReadStream(source)
63
63
  .pipe(new Throttle({ rate: 1024 * 1024 * 20 })) // 20MB
64
- .pipe(tar.x({ C: dest, strip }))
64
+ .pipe(createSafeTarExtractStream({ cwd: dest, strip }))
65
65
  );
66
66
 
67
67
  return dest;
@@ -87,7 +87,7 @@ const fetch = async (nodeInfo) => {
87
87
 
88
88
  module.exports.refresh = fetch;
89
89
  module.exports.getFromCache = (nodeInfo) => {
90
- // FIXME: @zhanghan 用于修复 unit-test 中 `should add dynamic component as expected` 中的错误,暂不知道为什么会影响
90
+ // FIXME: 用于修复 unit-test 中 `should add dynamic component as expected` 中的错误,暂不知道为什么会影响
91
91
  if (process.env.NODE_ENV === 'test') {
92
92
  return cache;
93
93
  }
@@ -505,7 +505,7 @@ const getLauncherSession = async ({ launcherUrl, launcherSessionId, external = t
505
505
  return result;
506
506
  };
507
507
 
508
- // Check local first, then remote, FIXME: @wangshijun should we check on chain nft?
508
+ // Check local first, then remote, FIXME: should we check on chain nft?
509
509
  const isLauncherSessionConsumed = async (params) => {
510
510
  let consumed = await states.blockletExtras.isLauncherSessionConsumed(params.launcherSessionId);
511
511
  logger.info('Launcher session consumed at local?', { params, consumed });
@@ -19,7 +19,7 @@ const getBackupEndpoint = (configs) => {
19
19
  };
20
20
 
21
21
  /**
22
- * @FIXME 希望之后放在 sdk @jianchao
22
+ * FIXME: move this into the SDK later
23
23
  * @description
24
24
  * @param {string} endpoint
25
25
  * @returns {string}
@@ -6,7 +6,7 @@ const { didExtension } = require('@blocklet/meta/lib/extension');
6
6
  */
7
7
  const Joi = JOI.extend(didExtension);
8
8
 
9
- // TODO: @zhanghan 这里目前仅包含必填的字段,后续需要增加其他字段
9
+ // TODO: 这里目前仅包含必填的字段,后续需要增加其他字段
10
10
  const passportSchema = Joi.object({
11
11
  id: Joi.string().required(),
12
12
  role: Joi.string().required(),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.12",
6
+ "version": "1.17.13-beta-20260512-042419-7b556a38",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -14,22 +14,35 @@
14
14
  "lint:fix": "eslint --fix tests lib"
15
15
  },
16
16
  "keywords": [],
17
- "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
17
+ "author": {
18
+ "name": "ArcBlock",
19
+ "email": "blocklet@arcblock.io",
20
+ "url": "https://github.com/ArcBlock"
21
+ },
18
22
  "license": "Apache-2.0",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/ArcBlock/blocklet-server.git",
26
+ "directory": "core/state"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/ArcBlock/blocklet-server/issues"
30
+ },
31
+ "homepage": "https://github.com/ArcBlock/blocklet-server/tree/main/core/state#readme",
19
32
  "dependencies": {
20
- "@abtnode/analytics": "1.17.12",
21
- "@abtnode/auth": "1.17.12",
22
- "@abtnode/certificate-manager": "1.17.12",
23
- "@abtnode/constant": "1.17.12",
24
- "@abtnode/cron": "1.17.12",
25
- "@abtnode/db-cache": "1.17.12",
26
- "@abtnode/docker-utils": "1.17.12",
27
- "@abtnode/logger": "1.17.12",
28
- "@abtnode/models": "1.17.12",
29
- "@abtnode/queue": "1.17.12",
30
- "@abtnode/rbac": "1.17.12",
31
- "@abtnode/router-provider": "1.17.12",
32
- "@abtnode/util": "1.17.12",
33
+ "@abtnode/analytics": "1.17.13-beta-20260512-042419-7b556a38",
34
+ "@abtnode/auth": "1.17.13-beta-20260512-042419-7b556a38",
35
+ "@abtnode/certificate-manager": "1.17.13-beta-20260512-042419-7b556a38",
36
+ "@abtnode/constant": "1.17.13-beta-20260512-042419-7b556a38",
37
+ "@abtnode/cron": "1.17.13-beta-20260512-042419-7b556a38",
38
+ "@abtnode/db-cache": "1.17.13-beta-20260512-042419-7b556a38",
39
+ "@abtnode/docker-utils": "1.17.13-beta-20260512-042419-7b556a38",
40
+ "@abtnode/logger": "1.17.13-beta-20260512-042419-7b556a38",
41
+ "@abtnode/models": "1.17.13-beta-20260512-042419-7b556a38",
42
+ "@abtnode/queue": "1.17.13-beta-20260512-042419-7b556a38",
43
+ "@abtnode/rbac": "1.17.13-beta-20260512-042419-7b556a38",
44
+ "@abtnode/router-provider": "1.17.13-beta-20260512-042419-7b556a38",
45
+ "@abtnode/util": "1.17.13-beta-20260512-042419-7b556a38",
33
46
  "@arcblock/did": "1.29.27",
34
47
  "@arcblock/did-connect-js": "1.29.27",
35
48
  "@arcblock/did-ext": "1.29.27",
@@ -40,15 +53,15 @@
40
53
  "@arcblock/pm2-events": "^0.0.5",
41
54
  "@arcblock/validator": "1.29.27",
42
55
  "@arcblock/vc": "1.29.27",
43
- "@blocklet/constant": "1.17.12",
56
+ "@blocklet/constant": "1.17.13-beta-20260512-042419-7b556a38",
44
57
  "@blocklet/did-space-js": "1.2.23",
45
- "@blocklet/env": "1.17.12",
58
+ "@blocklet/env": "1.17.13-beta-20260512-042419-7b556a38",
46
59
  "@blocklet/error": "^0.3.5",
47
- "@blocklet/meta": "1.17.12",
48
- "@blocklet/resolver": "1.17.12",
49
- "@blocklet/sdk": "1.17.12",
50
- "@blocklet/server-js": "1.17.12",
51
- "@blocklet/store": "1.17.12",
60
+ "@blocklet/meta": "1.17.13-beta-20260512-042419-7b556a38",
61
+ "@blocklet/resolver": "1.17.13-beta-20260512-042419-7b556a38",
62
+ "@blocklet/sdk": "1.17.13-beta-20260512-042419-7b556a38",
63
+ "@blocklet/server-js": "1.17.13-beta-20260512-042419-7b556a38",
64
+ "@blocklet/store": "1.17.13-beta-20260512-042419-7b556a38",
52
65
  "@blocklet/theme": "^3.5.2",
53
66
  "@fidm/x509": "^1.2.1",
54
67
  "@ocap/mcrypto": "1.29.27",
@@ -86,7 +99,6 @@
86
99
  "p-map": "^4.0.0",
87
100
  "p-retry": "^4.6.2",
88
101
  "p-wait-for": "^3.2.0",
89
- "private-ip": "^2.3.4",
90
102
  "rate-limiter-flexible": "^5.0.5",
91
103
  "read-last-lines": "^1.8.0",
92
104
  "semver": "^7.6.3",
@@ -98,7 +110,7 @@
98
110
  "stream-to-promise": "^3.0.0",
99
111
  "systeminformation": "^5.23.3",
100
112
  "tail": "^2.2.4",
101
- "tar": "^6.1.11",
113
+ "tar": "^7.5.13",
102
114
  "transliteration": "2.3.5",
103
115
  "ua-parser-js": "^1.0.2",
104
116
  "ufo": "^1.5.3",
@@ -113,5 +125,5 @@
113
125
  "express": "^4.18.2",
114
126
  "unzipper": "^0.10.11"
115
127
  },
116
- "gitHead": "a851c46d35a66372b7aa8fb5d7eed7d26980da8a"
128
+ "gitHead": "2d9bc75c45b999ed599bb396e93cf5f2d53c4d52"
117
129
  }