@blocklet/sdk 1.16.0-beta-1f8bf936 → 1.16.0-beta-58020de5
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/connect/shared.d.ts +5 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/service/notification.js +7 -4
- package/package.json +15 -14
- package/lib/env.d.ts +0 -18
- package/lib/env.js +0 -3
- package/lib/util/env.d.ts +0 -20
- package/lib/util/env.js +0 -34
package/lib/connect/shared.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ declare const getAuthenticatorProps: (options?: {}) => {
|
|
|
14
14
|
}>;
|
|
15
15
|
delegator: () => WalletObject<string>;
|
|
16
16
|
delegation: () => string;
|
|
17
|
-
chainInfo: () =>
|
|
17
|
+
chainInfo: () => {
|
|
18
|
+
type: "arcblock" | "ethereum" | "solona";
|
|
19
|
+
id: string;
|
|
20
|
+
host: string;
|
|
21
|
+
};
|
|
18
22
|
};
|
|
19
23
|
export { getDelegation, getDelegator, getDelegatee, getAuthenticatorProps };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TNavigation, TTheme } from '@blocklet/meta/lib/types';
|
|
2
|
+
import env from '@blocklet/env';
|
|
2
3
|
import Auth from './service/auth';
|
|
3
4
|
import Notification from './service/notification';
|
|
4
5
|
import WalletAuthenticator from './wallet-authenticator';
|
|
@@ -6,7 +7,6 @@ import WalletHandlers from './wallet-handler';
|
|
|
6
7
|
import BlockletAuthenticator from './connect/authenticator';
|
|
7
8
|
import createConnectHandlers from './connect/handler';
|
|
8
9
|
import Database from './database/index';
|
|
9
|
-
import env from './env';
|
|
10
10
|
import middlewares from './middlewares/index';
|
|
11
11
|
import getWallet from './wallet';
|
|
12
12
|
import Component, { MountPoint } from './component/index';
|
package/lib/index.js
CHANGED
|
@@ -18,6 +18,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.config = exports.Security = exports.Component = exports.component = exports.middlewares = exports.env = exports.getWallet = exports.Database = exports.createConnectHandlers = exports.BlockletAuthenticator = exports.WalletAuthenticator = exports.WalletHandlers = exports.Notification = exports.NotificationService = exports.Auth = exports.AuthService = void 0;
|
|
21
|
+
const env_1 = __importDefault(require("@blocklet/env"));
|
|
22
|
+
exports.env = env_1.default;
|
|
21
23
|
const auth_1 = __importDefault(require("./service/auth"));
|
|
22
24
|
exports.AuthService = auth_1.default;
|
|
23
25
|
exports.Auth = auth_1.default;
|
|
@@ -34,8 +36,6 @@ const handler_1 = __importDefault(require("./connect/handler"));
|
|
|
34
36
|
exports.createConnectHandlers = handler_1.default;
|
|
35
37
|
const index_1 = __importDefault(require("./database/index"));
|
|
36
38
|
exports.Database = index_1.default;
|
|
37
|
-
const env_1 = __importDefault(require("./env"));
|
|
38
|
-
exports.env = env_1.default;
|
|
39
39
|
const index_2 = __importDefault(require("./middlewares/index"));
|
|
40
40
|
exports.middlewares = index_2.default;
|
|
41
41
|
const wallet_1 = __importDefault(require("./wallet"));
|
|
@@ -37,10 +37,13 @@ const send_notification_1 = require("../util/send-notification");
|
|
|
37
37
|
const constants_1 = require("../util/constants");
|
|
38
38
|
const wallet_1 = __importDefault(require("../wallet"));
|
|
39
39
|
const notification_1 = require("../validators/notification");
|
|
40
|
-
const getSender = () =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const getSender = () => {
|
|
41
|
+
const wallet = (0, wallet_1.default)();
|
|
42
|
+
return {
|
|
43
|
+
appDid: wallet.address,
|
|
44
|
+
appSk: wallet.secretKey,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
44
47
|
/**
|
|
45
48
|
*
|
|
46
49
|
* @param {Notification} notification
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.0-beta-
|
|
6
|
+
"version": "1.16.0-beta-58020de5",
|
|
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",
|
|
@@ -26,19 +26,20 @@
|
|
|
26
26
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@abtnode/client": "1.16.0-beta-
|
|
30
|
-
"@abtnode/constant": "1.16.0-beta-
|
|
31
|
-
"@arcblock/did": "1.18.
|
|
32
|
-
"@arcblock/did-auth": "1.18.
|
|
33
|
-
"@arcblock/jwt": "1.18.
|
|
34
|
-
"@arcblock/ws": "1.18.
|
|
35
|
-
"@blocklet/constant": "1.16.0-beta-
|
|
36
|
-
"@blocklet/
|
|
37
|
-
"@
|
|
38
|
-
"@did-connect/
|
|
29
|
+
"@abtnode/client": "1.16.0-beta-58020de5",
|
|
30
|
+
"@abtnode/constant": "1.16.0-beta-58020de5",
|
|
31
|
+
"@arcblock/did": "1.18.64",
|
|
32
|
+
"@arcblock/did-auth": "1.18.64",
|
|
33
|
+
"@arcblock/jwt": "1.18.64",
|
|
34
|
+
"@arcblock/ws": "1.18.64",
|
|
35
|
+
"@blocklet/constant": "1.16.0-beta-58020de5",
|
|
36
|
+
"@blocklet/env": "1.16.0-beta-58020de5",
|
|
37
|
+
"@blocklet/meta": "1.16.0-beta-58020de5",
|
|
38
|
+
"@did-connect/authenticator": "^2.1.46",
|
|
39
|
+
"@did-connect/handler": "^2.1.46",
|
|
39
40
|
"@nedb/core": "^2.1.5",
|
|
40
|
-
"@ocap/mcrypto": "1.18.
|
|
41
|
-
"@ocap/wallet": "1.18.
|
|
41
|
+
"@ocap/mcrypto": "1.18.64",
|
|
42
|
+
"@ocap/wallet": "1.18.64",
|
|
42
43
|
"axios": "^0.27.2",
|
|
43
44
|
"cheerio": "^1.0.0-rc.12",
|
|
44
45
|
"fs-extra": "^10.1.0",
|
|
@@ -71,5 +72,5 @@
|
|
|
71
72
|
"ts-node": "^10.9.1",
|
|
72
73
|
"typescript": "^4.8.4"
|
|
73
74
|
},
|
|
74
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "9d3f47f9827acf13e9efea38cd605d3b36f9f523"
|
|
75
76
|
}
|
package/lib/env.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _default: Readonly<{
|
|
2
|
-
appId: string;
|
|
3
|
-
appPid: string;
|
|
4
|
-
appIds: string[];
|
|
5
|
-
appName: string;
|
|
6
|
-
appDescription: string;
|
|
7
|
-
appUrl: string;
|
|
8
|
-
isComponent: boolean;
|
|
9
|
-
dataDir: string;
|
|
10
|
-
cacheDir: string;
|
|
11
|
-
mode: string;
|
|
12
|
-
appStorageEndpoint: string;
|
|
13
|
-
serverVersion: string;
|
|
14
|
-
preferences: {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
export = _default;
|
package/lib/env.js
DELETED
package/lib/util/env.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
type BlockletPreferences = {
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
};
|
|
5
|
-
export declare function parseEnv(env?: NodeJS.ProcessEnv): Readonly<{
|
|
6
|
-
appId: string;
|
|
7
|
-
appPid: string;
|
|
8
|
-
appIds: string[];
|
|
9
|
-
appName: string;
|
|
10
|
-
appDescription: string;
|
|
11
|
-
appUrl: string;
|
|
12
|
-
isComponent: boolean;
|
|
13
|
-
dataDir: string;
|
|
14
|
-
cacheDir: string;
|
|
15
|
-
mode: string;
|
|
16
|
-
appStorageEndpoint: string;
|
|
17
|
-
serverVersion: string;
|
|
18
|
-
preferences: BlockletPreferences;
|
|
19
|
-
}>;
|
|
20
|
-
export {};
|
package/lib/util/env.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseEnv = void 0;
|
|
4
|
-
const constant_1 = require("@blocklet/constant");
|
|
5
|
-
function parseEnv(env = process.env) {
|
|
6
|
-
const preferences = Object.keys(env)
|
|
7
|
-
.filter((x) => x.startsWith(constant_1.BLOCKLET_PREFERENCE_PREFIX))
|
|
8
|
-
.reduce((acc, x) => {
|
|
9
|
-
const key = x.replace(constant_1.BLOCKLET_PREFERENCE_PREFIX, '');
|
|
10
|
-
try {
|
|
11
|
-
acc[key] = JSON.parse(env[x]);
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
acc[key] = env[x];
|
|
15
|
-
}
|
|
16
|
-
return acc;
|
|
17
|
-
}, {});
|
|
18
|
-
return Object.freeze({
|
|
19
|
-
appId: env.BLOCKLET_APP_ID,
|
|
20
|
-
appPid: env.BLOCKLET_APP_PID,
|
|
21
|
-
appIds: (env.BLOCKLET_APP_IDS || '').split(','),
|
|
22
|
-
appName: env.BLOCKLET_APP_NAME,
|
|
23
|
-
appDescription: env.BLOCKLET_APP_DESCRIPTION,
|
|
24
|
-
appUrl: env.BLOCKLET_APP_URL,
|
|
25
|
-
isComponent: env.BLOCKLET_DID !== env.BLOCKLET_REAL_DID,
|
|
26
|
-
dataDir: env.BLOCKLET_DATA_DIR,
|
|
27
|
-
cacheDir: env.BLOCKLET_CACHE_DIR,
|
|
28
|
-
mode: env.BLOCKLET_MODE,
|
|
29
|
-
appStorageEndpoint: env.BLOCKLET_APP_SPACE_ENDPOINT,
|
|
30
|
-
serverVersion: env.ABT_NODE,
|
|
31
|
-
preferences,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
exports.parseEnv = parseEnv;
|