@blocklet/sdk 1.16.27-beta-8f022f16 → 1.16.27-beta-9397aa36

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.
@@ -8,8 +8,8 @@ declare const getAuthenticatorProps: (options?: {}) => {
8
8
  request: any;
9
9
  baseUrl: any;
10
10
  }): Promise<{
11
- name: any;
12
- description: any;
11
+ name: string;
12
+ description: string;
13
13
  icon: string;
14
14
  link: string;
15
15
  updateSubEndpoint: boolean;
@@ -16,7 +16,7 @@ export declare function getFederatedMasterAppInfo({ blocklet, sourceAppPid, vers
16
16
  export declare function getAppInfo({ request, baseUrl, getBlocklet, getNodeInfo, }: {
17
17
  request: $TSFixMe;
18
18
  baseUrl: string;
19
- getBlocklet: () => Promise<$TSFixMe>;
19
+ getBlocklet: () => Promise<ABTNodeClient.BlockletState>;
20
20
  getNodeInfo: () => Promise<{
21
21
  did: string;
22
22
  }>;
@@ -32,13 +32,13 @@ export declare function getAppInfo({ request, baseUrl, getBlocklet, getNodeInfo,
32
32
  export declare function getMemberAppInfo({ request, baseUrl, getBlocklet, getNodeInfo, }: {
33
33
  request: any;
34
34
  baseUrl: string;
35
- getBlocklet: () => Promise<$TSFixMe>;
35
+ getBlocklet: () => Promise<ABTNodeClient.BlockletState>;
36
36
  getNodeInfo: () => Promise<{
37
37
  did: string;
38
38
  }>;
39
39
  }): Promise<{
40
- name: any;
41
- description: any;
40
+ name: string;
41
+ description: string;
42
42
  icon: string;
43
43
  link: string;
44
44
  updateSubEndpoint: boolean;
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getMemberAppInfo = exports.getAppInfo = exports.getFederatedMasterAppInfo = void 0;
7
7
  const ufo_1 = require("ufo");
8
- const get_1 = __importDefault(require("lodash/get"));
9
8
  const util_1 = require("@blocklet/meta/lib/util");
9
+ const info_1 = __importDefault(require("@blocklet/meta/lib/info"));
10
10
  const constant_1 = require("@abtnode/constant");
11
11
  const login_1 = require("./login");
12
12
  function getFederatedMasterAppInfo({ blocklet, sourceAppPid, version, groupPathPrefix, nodeInfo, }) {
@@ -27,7 +27,10 @@ async function getAppInfo({ request, baseUrl, getBlocklet, getNodeInfo, }) {
27
27
  const groupPathPrefix = request.headers['x-group-path-prefix'] || '/';
28
28
  const [blocklet, info] = await Promise.all([getBlocklet(), getNodeInfo()]);
29
29
  const sourceAppPid = (0, login_1.getSourceAppPid)(request);
30
- const version = (0, get_1.default)(blocklet, 'meta.version', '');
30
+ const blockletInfo = (0, info_1.default)(blocklet, undefined, {
31
+ returnWallet: false,
32
+ });
33
+ const { version, name, description } = blockletInfo;
31
34
  if (sourceAppPid) {
32
35
  return getFederatedMasterAppInfo({
33
36
  blocklet,
@@ -37,11 +40,9 @@ async function getAppInfo({ request, baseUrl, getBlocklet, getNodeInfo, }) {
37
40
  nodeInfo: info,
38
41
  });
39
42
  }
40
- const blockletName = blocklet.environmentObj?.BLOCKLET_APP_NAME || blocklet.meta?.name;
41
- const blockletDescription = blocklet.environmentObj?.BLOCKLET_APP_DESCRIPTION || blocklet.meta?.description;
42
43
  return {
43
- name: blockletName,
44
- description: blockletDescription || `Connect to ${blockletName}`,
44
+ name,
45
+ description: description || `Connect to ${name}`,
45
46
  icon: (0, ufo_1.joinURL)(baseUrl, constant_1.WELLKNOWN_SERVICE_PATH_PREFIX, `/blocklet/logo?v=${version}`),
46
47
  link: (0, util_1.getConnectAppUrl)({ request, baseUrl }),
47
48
  updateSubEndpoint: true,
@@ -55,13 +56,14 @@ async function getMemberAppInfo({ request, baseUrl, getBlocklet, getNodeInfo, })
55
56
  const groupPathPrefix = request.headers['x-group-path-prefix'] || '/';
56
57
  const [blocklet, info] = await Promise.all([getBlocklet(), getNodeInfo()]);
57
58
  const sourceAppPid = (0, login_1.getSourceAppPid)(request);
58
- const version = (0, get_1.default)(blocklet, 'meta.version', '');
59
+ const blockletInfo = (0, info_1.default)(blocklet, undefined, {
60
+ returnWallet: false,
61
+ });
62
+ const { version, name, description } = blockletInfo;
59
63
  if (sourceAppPid && blocklet) {
60
- const blockletName = blocklet.environmentObj?.BLOCKLET_APP_NAME || blocklet.meta?.name;
61
- const blockletDescription = blocklet.environmentObj?.BLOCKLET_APP_DESCRIPTION || blocklet.meta?.description;
62
64
  return {
63
- name: blockletName,
64
- description: blockletDescription || `Connect to ${blockletName}`,
65
+ name,
66
+ description: description || `Connect to ${name}`,
65
67
  icon: (0, ufo_1.joinURL)(baseUrl, constant_1.WELLKNOWN_SERVICE_PATH_PREFIX, `/blocklet/logo?v=${version}`),
66
68
  link: (0, util_1.getConnectAppUrl)({ request, baseUrl }),
67
69
  updateSubEndpoint: true,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.27-beta-8f022f16",
6
+ "version": "1.16.27-beta-9397aa36",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
@@ -27,15 +27,15 @@
27
27
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@abtnode/client": "1.16.27-beta-8f022f16",
31
- "@abtnode/constant": "1.16.27-beta-8f022f16",
30
+ "@abtnode/client": "1.16.27-beta-9397aa36",
31
+ "@abtnode/constant": "1.16.27-beta-9397aa36",
32
32
  "@arcblock/did": "1.18.123",
33
33
  "@arcblock/did-auth": "1.18.123",
34
34
  "@arcblock/jwt": "1.18.123",
35
35
  "@arcblock/ws": "1.18.123",
36
- "@blocklet/constant": "1.16.27-beta-8f022f16",
37
- "@blocklet/env": "1.16.27-beta-8f022f16",
38
- "@blocklet/meta": "1.16.27-beta-8f022f16",
36
+ "@blocklet/constant": "1.16.27-beta-9397aa36",
37
+ "@blocklet/env": "1.16.27-beta-9397aa36",
38
+ "@blocklet/meta": "1.16.27-beta-9397aa36",
39
39
  "@did-connect/authenticator": "^2.2.4",
40
40
  "@did-connect/handler": "^2.2.4",
41
41
  "@nedb/core": "^2.1.5",
@@ -76,5 +76,5 @@
76
76
  "ts-node": "^10.9.1",
77
77
  "typescript": "^5.0.4"
78
78
  },
79
- "gitHead": "8889fa58ff4cc85b60cd999126341a4a8d0ae9d4"
79
+ "gitHead": "7291d8a3c582e96b8e7ea3edffed07938e56dea3"
80
80
  }