@abtnode/core 1.16.30-beta-00e8bdd1 → 1.16.30-beta-b7f31b10

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
@@ -296,6 +296,7 @@ class TeamAPI extends EventEmitter {
296
296
  'pk',
297
297
  'role',
298
298
  'email',
299
+ 'phone',
299
300
  'fullName',
300
301
  'approved',
301
302
  'createdAt',
@@ -308,6 +309,7 @@ class TeamAPI extends EventEmitter {
308
309
  'avatar',
309
310
  'locale',
310
311
  'tags',
312
+ 'url',
311
313
  'userSessions',
312
314
  // oauth relate fields
313
315
  'sourceProvider',
@@ -4247,8 +4247,6 @@ class DiskBlockletManager extends BaseBlockletManager {
4247
4247
  nftId: data.controller.nftId,
4248
4248
  });
4249
4249
 
4250
- // TODO: 如果绑定了 DID Space 备份到 DID Space
4251
-
4252
4250
  await this.delete({ did, keepData: false, keepConfigs: false, keepLogsDir: false });
4253
4251
  logger.info('the exceed redemption blocklet already deleted', {
4254
4252
  blockletDid: did,
@@ -391,10 +391,10 @@ class User extends ExtendBase {
391
391
  ...pick(user, [
392
392
  'fullName',
393
393
  'email',
394
+ 'phone',
394
395
  'avatar',
395
396
  'url',
396
397
  'role',
397
-
398
398
  'locale',
399
399
  'extra',
400
400
  'lastLoginIp',
@@ -28,6 +28,7 @@ const {
28
28
  USER_AVATAR_URL_PREFIX,
29
29
  ROLES,
30
30
  LAUNCH_SESSION_STATUS,
31
+ SERVERLESS_BLOCKLET_DATA_RETENTION_DAYS,
31
32
  } = require('@abtnode/constant');
32
33
 
33
34
  const logger = require('@abtnode/logger')('@abtnode/core:util:launcher');
@@ -230,7 +231,7 @@ const setupAppOwner = async ({ node, sessionId, justCreate = false, context }) =
230
231
  if (!user) {
231
232
  throw new Error(`Owner user not found from launcher: ${launcherUrl}`);
232
233
  }
233
- appOwnerProfile = pick(user, ['fullName', 'email', 'avatar']);
234
+ appOwnerProfile = pick(user, ['fullName', 'email', 'avatar', 'phone']);
234
235
  const avatarBase64 = await getAvatarByUrl(joinURL(launcherUrl, user.avatar));
235
236
  appOwnerProfile.avatar = await extractUserAvatar(avatarBase64, { dataDir });
236
237
  logger.info('Create owner from launcher for blocklet', { appDid, ownerDid, ownerPk, sessionId, appOwnerProfile });
@@ -239,7 +240,7 @@ const setupAppOwner = async ({ node, sessionId, justCreate = false, context }) =
239
240
  if (!user) {
240
241
  throw new Error(`Owner user not found in server: ${userDid}`);
241
242
  }
242
- appOwnerProfile = pick(user, ['fullName', 'email', 'avatar']);
243
+ appOwnerProfile = pick(user, ['fullName', 'email', 'avatar', 'phone']);
243
244
  if (user.avatar && user.avatar.startsWith(USER_AVATAR_URL_PREFIX)) {
244
245
  const filename = user.avatar.split('/').pop();
245
246
  const srcFile = getAvatarFile(serverDataDir, filename);
@@ -313,6 +314,7 @@ const setupAppOwner = async ({ node, sessionId, justCreate = false, context }) =
313
314
  did: ownerDid,
314
315
  passport,
315
316
  role,
317
+ fullName: appOwnerProfile?.fullName,
316
318
  secret: appSecret,
317
319
  expiresIn: '1d',
318
320
  });
@@ -409,13 +411,15 @@ const getLaunchSessionStatus = async (blockletDid, controller) => {
409
411
  throw new Error(error);
410
412
  }
411
413
 
412
- logger.info('get launcher session success', { launcherSessionId, launcherSession });
414
+ logger.info('get launcher session success', { blockletDid, launcherSessionId, launcherSession });
413
415
  return launcherSession.status;
414
416
  };
415
417
 
416
418
  const isBlockletExpired = async (blockletDid, controller) => {
417
419
  const status = await getLaunchSessionStatus(blockletDid, controller);
418
- return [LAUNCH_SESSION_STATUS.expired, LAUNCH_SESSION_STATUS.terminated].includes(status);
420
+ return [LAUNCH_SESSION_STATUS.overdue, LAUNCH_SESSION_STATUS.canceled, LAUNCH_SESSION_STATUS.terminated].includes(
421
+ status
422
+ );
419
423
  };
420
424
 
421
425
  const isLaunchSessionTerminated = (session) => session.status === LAUNCH_SESSION_STATUS.terminated;
@@ -425,9 +429,8 @@ const isBlockletTerminated = async (blockletDid, controller) => {
425
429
  return status === LAUNCH_SESSION_STATUS.terminated;
426
430
  };
427
431
 
428
- const DATA_RETENTION_DAYS = 30;
429
432
  const isDataRetentionExceeded = (terminatedAt) =>
430
- !!terminatedAt && dayjs().diff(dayjs(terminatedAt), 'days') > DATA_RETENTION_DAYS;
433
+ !!terminatedAt && dayjs().diff(dayjs(terminatedAt), 'days') > SERVERLESS_BLOCKLET_DATA_RETENTION_DAYS;
431
434
 
432
435
  module.exports = {
433
436
  consumeServerlessNFT,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.30-beta-00e8bdd1",
6
+ "version": "1.16.30-beta-b7f31b10",
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.30-beta-00e8bdd1",
23
- "@abtnode/auth": "1.16.30-beta-00e8bdd1",
24
- "@abtnode/certificate-manager": "1.16.30-beta-00e8bdd1",
25
- "@abtnode/constant": "1.16.30-beta-00e8bdd1",
26
- "@abtnode/cron": "1.16.30-beta-00e8bdd1",
27
- "@abtnode/logger": "1.16.30-beta-00e8bdd1",
28
- "@abtnode/models": "1.16.30-beta-00e8bdd1",
29
- "@abtnode/queue": "1.16.30-beta-00e8bdd1",
30
- "@abtnode/rbac": "1.16.30-beta-00e8bdd1",
31
- "@abtnode/router-provider": "1.16.30-beta-00e8bdd1",
32
- "@abtnode/static-server": "1.16.30-beta-00e8bdd1",
33
- "@abtnode/timemachine": "1.16.30-beta-00e8bdd1",
34
- "@abtnode/util": "1.16.30-beta-00e8bdd1",
22
+ "@abtnode/analytics": "1.16.30-beta-b7f31b10",
23
+ "@abtnode/auth": "1.16.30-beta-b7f31b10",
24
+ "@abtnode/certificate-manager": "1.16.30-beta-b7f31b10",
25
+ "@abtnode/constant": "1.16.30-beta-b7f31b10",
26
+ "@abtnode/cron": "1.16.30-beta-b7f31b10",
27
+ "@abtnode/logger": "1.16.30-beta-b7f31b10",
28
+ "@abtnode/models": "1.16.30-beta-b7f31b10",
29
+ "@abtnode/queue": "1.16.30-beta-b7f31b10",
30
+ "@abtnode/rbac": "1.16.30-beta-b7f31b10",
31
+ "@abtnode/router-provider": "1.16.30-beta-b7f31b10",
32
+ "@abtnode/static-server": "1.16.30-beta-b7f31b10",
33
+ "@abtnode/timemachine": "1.16.30-beta-b7f31b10",
34
+ "@abtnode/util": "1.16.30-beta-b7f31b10",
35
35
  "@arcblock/did": "1.18.128",
36
36
  "@arcblock/did-auth": "1.18.128",
37
37
  "@arcblock/did-ext": "^1.18.128",
@@ -42,12 +42,12 @@
42
42
  "@arcblock/pm2-events": "^0.0.5",
43
43
  "@arcblock/validator": "^1.18.128",
44
44
  "@arcblock/vc": "1.18.128",
45
- "@blocklet/constant": "1.16.30-beta-00e8bdd1",
46
- "@blocklet/env": "1.16.30-beta-00e8bdd1",
47
- "@blocklet/meta": "1.16.30-beta-00e8bdd1",
48
- "@blocklet/resolver": "1.16.30-beta-00e8bdd1",
49
- "@blocklet/sdk": "1.16.30-beta-00e8bdd1",
50
- "@blocklet/store": "1.16.30-beta-00e8bdd1",
45
+ "@blocklet/constant": "1.16.30-beta-b7f31b10",
46
+ "@blocklet/env": "1.16.30-beta-b7f31b10",
47
+ "@blocklet/meta": "1.16.30-beta-b7f31b10",
48
+ "@blocklet/resolver": "1.16.30-beta-b7f31b10",
49
+ "@blocklet/sdk": "1.16.30-beta-b7f31b10",
50
+ "@blocklet/store": "1.16.30-beta-b7f31b10",
51
51
  "@did-space/client": "^0.5.17",
52
52
  "@fidm/x509": "^1.2.1",
53
53
  "@ocap/mcrypto": "1.18.128",
@@ -103,5 +103,5 @@
103
103
  "jest": "^29.7.0",
104
104
  "unzipper": "^0.10.11"
105
105
  },
106
- "gitHead": "e165c7e64a2900b4c390b7435c0bb71abbf9b625"
106
+ "gitHead": "2d429b619b7b54b5603fb05761d3acd9ff674c2c"
107
107
  }