create-blocklet 0.11.2 → 0.12.0
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/index.js +6 -5
- package/package.json +4 -4
- package/templates/component-studio/api/src/index.ts +1 -1
- package/templates/component-studio/api/src/libs/auth.ts +4 -4
- package/templates/component-studio/api/src/libs/env.ts +1 -1
- package/templates/component-studio/package.json +14 -14
- package/templates/did-connect-dapp/api/index.js +1 -1
- package/templates/did-connect-dapp/api/libs/auth.js +4 -4
- package/templates/did-connect-dapp/api/libs/env.js +1 -1
- package/templates/did-connect-dapp/package.json +10 -10
- package/templates/did-wallet-dapp/api/functions/app.js +1 -1
- package/templates/did-wallet-dapp/api/routes/user.js +5 -5
- package/templates/did-wallet-dapp/package.json +10 -10
- package/templates/express-api/api/libs/auth.js +4 -4
- package/templates/express-api/api/libs/env.js +1 -1
- package/templates/express-api/package.json +2 -2
- package/templates/nestjs-api/api/libs/auth.js +4 -4
- package/templates/nestjs-api/api/libs/env.js +1 -1
- package/templates/nestjs-api/package.json +2 -2
- package/templates/nextjs-dapp/api/libs/auth.js +4 -4
- package/templates/nextjs-dapp/api/libs/env.js +1 -1
- package/templates/nextjs-dapp/api/routes/index.js +2 -2
- package/templates/nextjs-dapp/package.json +5 -5
- package/templates/react-aigne-dapp/api/src/index.ts +1 -1
- package/templates/react-aigne-dapp/api/src/libs/auth.ts +4 -4
- package/templates/react-aigne-dapp/api/src/libs/env.ts +1 -1
- package/templates/react-aigne-dapp/package.json +11 -11
- package/templates/react-dapp/api/index.js +1 -1
- package/templates/react-dapp/api/libs/auth.js +4 -4
- package/templates/react-dapp/api/libs/env.js +1 -1
- package/templates/react-dapp/api/routes/index.js +2 -2
- package/templates/react-dapp/package.json +6 -6
- package/templates/react-dapp-ts/api/src/index.ts +1 -1
- package/templates/react-dapp-ts/api/src/libs/auth.ts +4 -4
- package/templates/react-dapp-ts/api/src/libs/env.ts +1 -1
- package/templates/react-dapp-ts/api/src/routes/index.ts +2 -2
- package/templates/react-dapp-ts/package.json +6 -6
- package/templates/react-gun-dapp/api/index.js +1 -1
- package/templates/react-gun-dapp/api/libs/auth.js +4 -4
- package/templates/react-gun-dapp/api/libs/env.js +1 -1
- package/templates/react-gun-dapp/api/routes/index.js +2 -2
- package/templates/react-gun-dapp/package.json +5 -5
- package/templates/react-static/package.json +1 -1
- package/templates/solidjs-dapp/api/index.js +1 -1
- package/templates/solidjs-dapp/api/libs/auth.js +4 -4
- package/templates/solidjs-dapp/api/libs/env.js +1 -1
- package/templates/solidjs-dapp/api/routes/index.js +2 -2
- package/templates/solidjs-dapp/package.json +6 -6
- package/templates/solidjs-static/package.json +1 -1
- package/templates/svelte-dapp/api/index.js +1 -1
- package/templates/svelte-dapp/api/libs/auth.js +4 -4
- package/templates/svelte-dapp/api/libs/env.js +1 -1
- package/templates/svelte-dapp/api/routes/index.js +2 -2
- package/templates/svelte-dapp/package.json +6 -6
- package/templates/svelte-static/package.json +1 -1
- package/templates/todo-list-example/api/src/index.ts +1 -1
- package/templates/todo-list-example/api/src/libs/auth.ts +6 -6
- package/templates/todo-list-example/api/src/libs/env.ts +1 -1
- package/templates/todo-list-example/api/src/routes/index.ts +3 -3
- package/templates/todo-list-example/api/src/routes/todo-list/index.ts +3 -3
- package/templates/todo-list-example/package.json +11 -11
- package/templates/vue-dapp/api/index.js +1 -1
- package/templates/vue-dapp/api/libs/auth.js +4 -4
- package/templates/vue-dapp/api/libs/env.js +1 -1
- package/templates/vue-dapp/api/routes/index.js +2 -2
- package/templates/vue-dapp/package.json +6 -6
- package/templates/vue-static/package.json +1 -1
- package/templates/vue-ts-static/package.json +2 -2
- package/templates/vue2-dapp/api/index.js +1 -1
- package/templates/vue2-dapp/api/libs/auth.js +4 -4
- package/templates/vue2-dapp/api/libs/env.js +1 -1
- package/templates/vue2-dapp/api/routes/index.js +2 -2
- package/templates/vue2-dapp/package.json +5 -5
- package/templates/vue2-static/package.json +1 -1
package/index.js
CHANGED
|
@@ -79,11 +79,12 @@ const templates = [
|
|
|
79
79
|
// display: '[dapp] vue2 + express.js',
|
|
80
80
|
// color: green,
|
|
81
81
|
// },
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
// TODO: @LiuShuang svelte@5.x 不兼容旧版本,导致无法启动项目
|
|
83
|
+
// {
|
|
84
|
+
// name: 'svelte-dapp',
|
|
85
|
+
// display: '[dapp] svelte + express.js',
|
|
86
|
+
// color: yellow,
|
|
87
|
+
// },
|
|
87
88
|
// FIXME: @zhanghan add this template in the future
|
|
88
89
|
// {
|
|
89
90
|
// name: 'nextjs-dapp',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-blocklet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"exports": "./index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "git@github.com:blocklet/create-blocklet.git",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"test:run": "vitest run"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@arcblock/did": "^1.
|
|
33
|
-
"@ocap/mcrypto": "^1.
|
|
34
|
-
"@ocap/util": "^1.
|
|
32
|
+
"@arcblock/did": "^1.26.3",
|
|
33
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
34
|
+
"@ocap/util": "^1.26.3",
|
|
35
35
|
"boxen": "^7.1.1",
|
|
36
36
|
"ejs": "^3.1.10",
|
|
37
37
|
"envfile": "^7.1.0",
|
|
@@ -6,7 +6,7 @@ import cookieParser from 'cookie-parser';
|
|
|
6
6
|
import cors from 'cors';
|
|
7
7
|
import dotenv from 'dotenv-flow';
|
|
8
8
|
import express, { ErrorRequestHandler } from 'express';
|
|
9
|
-
import fallback from '@blocklet/sdk/lib/middlewares/fallback';
|
|
9
|
+
import { fallback } from '@blocklet/sdk/lib/middlewares/fallback';
|
|
10
10
|
|
|
11
11
|
import logger from './libs/logger';
|
|
12
12
|
import routes from './routes';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
3
|
import AuthStorage from '@arcblock/did-connect-storage-nedb';
|
|
4
|
-
import getWallet from '@blocklet/sdk/lib/wallet';
|
|
5
|
-
import WalletAuthenticator from '@blocklet/sdk/lib/wallet-authenticator';
|
|
6
|
-
import
|
|
4
|
+
import { getWallet } from '@blocklet/sdk/lib/wallet';
|
|
5
|
+
import { WalletAuthenticator } from '@blocklet/sdk/lib/wallet-authenticator';
|
|
6
|
+
import { WalletHandlers } from '@blocklet/sdk/lib/wallet-handler';
|
|
7
7
|
|
|
8
8
|
import env from './env';
|
|
9
9
|
|
|
10
10
|
export const wallet = getWallet();
|
|
11
11
|
export const authenticator = new WalletAuthenticator();
|
|
12
|
-
export const handlers = new
|
|
12
|
+
export const handlers = new WalletHandlers({
|
|
13
13
|
authenticator,
|
|
14
14
|
tokenStorage: new AuthStorage({
|
|
15
15
|
dbPath: path.join(env.dataDir, 'auth.db'),
|
|
@@ -50,19 +50,19 @@
|
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@arcblock/did-connect-react": "^3.1.
|
|
53
|
+
"@arcblock/did-connect-react": "^3.1.53",
|
|
54
54
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
55
|
-
"@arcblock/ux": "^3.1.
|
|
56
|
-
"@blocklet/pages-kit": "^0.
|
|
57
|
-
"@blocklet/pages-kit-block-studio": "^0.
|
|
58
|
-
"@blocklet/pages-kit-inner-components": "^0.
|
|
59
|
-
"@blocklet/pages-kit-runtime": "^0.
|
|
60
|
-
"@blocklet/sdk": "^1.16.
|
|
61
|
-
"@blocklet/studio-ui": "^0.
|
|
62
|
-
"@blocklet/ui-react": "^3.1.
|
|
63
|
-
"@ocap/client": "^1.
|
|
64
|
-
"@ocap/mcrypto": "^1.
|
|
65
|
-
"@ocap/wallet": "^1.
|
|
55
|
+
"@arcblock/ux": "^3.1.53",
|
|
56
|
+
"@blocklet/pages-kit": "^0.6.106",
|
|
57
|
+
"@blocklet/pages-kit-block-studio": "^0.6.106",
|
|
58
|
+
"@blocklet/pages-kit-inner-components": "^0.6.106",
|
|
59
|
+
"@blocklet/pages-kit-runtime": "^0.6.106",
|
|
60
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
61
|
+
"@blocklet/studio-ui": "^0.6.0",
|
|
62
|
+
"@blocklet/ui-react": "^3.1.53",
|
|
63
|
+
"@ocap/client": "^1.26.3",
|
|
64
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
65
|
+
"@ocap/wallet": "^1.26.3",
|
|
66
66
|
"axios": "^1.7.9",
|
|
67
67
|
"cookie-parser": "^1.4.7",
|
|
68
68
|
"cors": "^2.8.5",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@biomejs/biome": "^1.9.4",
|
|
75
|
-
"@blocklet/js-sdk": "^1.16.
|
|
75
|
+
"@blocklet/js-sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
76
76
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
77
77
|
"@types/cookie-parser": "^1.4.8",
|
|
78
78
|
"@types/cors": "^2.8.17",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"typescript": "^5.7.2",
|
|
98
98
|
"vite": "^7.0.0",
|
|
99
99
|
"vite-node": "^3.2.4",
|
|
100
|
-
"vite-plugin-blocklet": "^0.
|
|
100
|
+
"vite-plugin-blocklet": "^0.12.0",
|
|
101
101
|
"vite-plugin-require": "^1.2.14",
|
|
102
102
|
"vite-plugin-svgr": "^4.3.0",
|
|
103
103
|
"vite-tsconfig-paths": "^5.1.4",
|
|
@@ -3,7 +3,7 @@ require('express-async-errors');
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const express = require('express');
|
|
5
5
|
const cookieParser = require('cookie-parser');
|
|
6
|
-
const fallback = require('@blocklet/sdk/lib/middlewares/fallback');
|
|
6
|
+
const { fallback } = require('@blocklet/sdk/lib/middlewares/fallback');
|
|
7
7
|
|
|
8
8
|
const authRoutes = require('./routes/auth');
|
|
9
9
|
const { name, version } = require('../package.json');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const AuthStorage = require('@arcblock/did-connect-storage-nedb');
|
|
3
|
-
const getWallet = require('@blocklet/sdk/lib/wallet');
|
|
4
|
-
const WalletAuthenticator = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
-
const
|
|
3
|
+
const { getWallet } = require('@blocklet/sdk/lib/wallet');
|
|
4
|
+
const { WalletAuthenticator } = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
+
const { WalletHandlers } = require('@blocklet/sdk/lib/wallet-handler');
|
|
6
6
|
const Client = require('@ocap/client');
|
|
7
7
|
|
|
8
8
|
const env = require('./env');
|
|
@@ -10,7 +10,7 @@ const env = require('./env');
|
|
|
10
10
|
const client = new Client(env.chainHost);
|
|
11
11
|
const wallet = getWallet();
|
|
12
12
|
const authenticator = new WalletAuthenticator();
|
|
13
|
-
const handlers = new
|
|
13
|
+
const handlers = new WalletHandlers({
|
|
14
14
|
authenticator,
|
|
15
15
|
tokenStorage: new AuthStorage({
|
|
16
16
|
dbPath: path.join(env.dataDir, 'auth.db'),
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arcblock/did": "^1.
|
|
41
|
+
"@arcblock/did": "^1.26.3",
|
|
42
42
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
43
|
-
"@blocklet/sdk": "^1.16.
|
|
44
|
-
"@ocap/client": "^1.
|
|
45
|
-
"@ocap/mcrypto": "^1.
|
|
46
|
-
"@ocap/util": "^1.
|
|
47
|
-
"@ocap/wallet": "^1.
|
|
43
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
44
|
+
"@ocap/client": "^1.26.3",
|
|
45
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
46
|
+
"@ocap/util": "^1.26.3",
|
|
47
|
+
"@ocap/wallet": "^1.26.3",
|
|
48
48
|
"cookie-parser": "^1.4.7",
|
|
49
49
|
"dotenv-flow": "^4.1.0",
|
|
50
50
|
"express": "^4.21.2",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"lodash": "^4.17.21"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@arcblock/did-connect-react": "^3.1.
|
|
55
|
+
"@arcblock/did-connect-react": "^3.1.53",
|
|
56
56
|
"@arcblock/eslint-config": "^0.3.3",
|
|
57
|
-
"@arcblock/ux": "^3.1.
|
|
58
|
-
"@blocklet/ui-react": "^3.1.
|
|
57
|
+
"@arcblock/ux": "^3.1.53",
|
|
58
|
+
"@blocklet/ui-react": "^3.1.53",
|
|
59
59
|
"@emotion/react": "^11.14.0",
|
|
60
60
|
"@emotion/styled": "^11.14.1",
|
|
61
61
|
"@iconify-icons/material-symbols": "^1.2.58",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"simple-git-hooks": "^2.11.1",
|
|
78
78
|
"tsx": "^4.19.3",
|
|
79
79
|
"vite": "^7.0.0",
|
|
80
|
-
"vite-plugin-blocklet": "^0.
|
|
80
|
+
"vite-plugin-blocklet": "^0.12.0",
|
|
81
81
|
"vite-plugin-svgr": "^4.3.0",
|
|
82
82
|
"zx": "^8.3.2"
|
|
83
83
|
},
|
|
@@ -5,7 +5,7 @@ const morgan = require('morgan');
|
|
|
5
5
|
const express = require('express');
|
|
6
6
|
const cookieParser = require('cookie-parser');
|
|
7
7
|
const bodyParser = require('body-parser');
|
|
8
|
-
const fallback = require('@blocklet/sdk/lib/middlewares/fallback');
|
|
8
|
+
const { fallback } = require('@blocklet/sdk/lib/middlewares/fallback');
|
|
9
9
|
|
|
10
10
|
const userRoutes = require('../routes/user');
|
|
11
11
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const { BlockletService } = require('@blocklet/sdk/service/auth');
|
|
2
|
+
const { sessionMiddleware } = require('@blocklet/sdk/lib/middlewares/session');
|
|
3
3
|
|
|
4
|
-
const authClient = new
|
|
4
|
+
const authClient = new BlockletService();
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
init(app) {
|
|
8
|
-
//
|
|
9
|
-
app.get('/api/user',
|
|
8
|
+
// sessionMiddleware() is used to get the user info from the session, see more: https://www.arcblock.io/docs/blocklet-developer/blocklet-sdk#session
|
|
9
|
+
app.get('/api/user', sessionMiddleware(), async (req, res) => {
|
|
10
10
|
if (!req.user) {
|
|
11
11
|
res.json({ user: null });
|
|
12
12
|
return;
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"bump-version": "zx --quiet scripts/bump-version.mjs"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@blocklet/sdk": "^1.16.
|
|
23
|
-
"@ocap/mcrypto": "^1.
|
|
24
|
-
"@ocap/util": "^1.
|
|
25
|
-
"@ocap/wallet": "^1.
|
|
22
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
23
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
24
|
+
"@ocap/util": "^1.26.3",
|
|
25
|
+
"@ocap/wallet": "^1.26.3",
|
|
26
26
|
"body-parser": "^1.20.3",
|
|
27
27
|
"cookie-parser": "^1.4.7",
|
|
28
28
|
"cors": "^2.8.5",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"morgan": "^1.10.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@arcblock/did-connect-react": "^3.1.
|
|
34
|
+
"@arcblock/did-connect-react": "^3.1.53",
|
|
35
35
|
"@arcblock/eslint-config": "^0.3.3",
|
|
36
|
-
"@arcblock/ux": "^3.1.
|
|
37
|
-
"@blocklet/js-sdk": "^1.16.
|
|
38
|
-
"@blocklet/ui-react": "^3.1.
|
|
36
|
+
"@arcblock/ux": "^3.1.53",
|
|
37
|
+
"@blocklet/js-sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
38
|
+
"@blocklet/ui-react": "^3.1.53",
|
|
39
39
|
"@emotion/react": "^11.14.0",
|
|
40
40
|
"@emotion/styled": "^11.14.1",
|
|
41
41
|
"@mui/icons-material": "^7.1.2",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"flat": "^6.0.1",
|
|
49
49
|
"nodemon": "^3.1.9",
|
|
50
50
|
"react": "~19.1.0",
|
|
51
|
-
"react-dom": "19.1.0",
|
|
51
|
+
"react-dom": "~19.1.0",
|
|
52
52
|
"react-router-dom": "^6.29.0",
|
|
53
53
|
"rimraf": "^5.0.10",
|
|
54
54
|
"simple-git-hooks": "^2.11.1",
|
|
55
55
|
"vite": "^7.0.0",
|
|
56
56
|
"vite-node": "^3.2.4",
|
|
57
|
-
"vite-plugin-blocklet": "^0.
|
|
57
|
+
"vite-plugin-blocklet": "^0.12.0",
|
|
58
58
|
"vite-plugin-require": "^1.2.14",
|
|
59
59
|
"vite-plugin-svgr": "^4.3.0",
|
|
60
60
|
"zx": "^8.3.2"
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const AuthStorage = require('@arcblock/did-connect-storage-nedb');
|
|
3
|
-
const getWallet = require('@blocklet/sdk/lib/wallet');
|
|
4
|
-
const WalletAuthenticator = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
-
const
|
|
3
|
+
const { getWallet } = require('@blocklet/sdk/lib/wallet');
|
|
4
|
+
const { WalletAuthenticator } = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
+
const { WalletHandlers } = require('@blocklet/sdk/lib/wallet-handler');
|
|
6
6
|
|
|
7
7
|
const env = require('./env');
|
|
8
8
|
|
|
9
9
|
const wallet = getWallet();
|
|
10
10
|
const authenticator = new WalletAuthenticator();
|
|
11
|
-
const handlers = new
|
|
11
|
+
const handlers = new WalletHandlers({
|
|
12
12
|
authenticator,
|
|
13
13
|
tokenStorage: new AuthStorage({
|
|
14
14
|
dbPath: path.join(env.dataDir, 'auth.db'),
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
35
|
-
"@blocklet/sdk": "^1.16.
|
|
36
|
-
"@ocap/client": "^1.
|
|
35
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
36
|
+
"@ocap/client": "^1.26.3",
|
|
37
37
|
"dotenv-flow": "^4.1.0",
|
|
38
38
|
"express": "^4.21.2"
|
|
39
39
|
},
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const AuthStorage = require('@arcblock/did-connect-storage-nedb');
|
|
3
|
-
const getWallet = require('@blocklet/sdk/lib/wallet');
|
|
4
|
-
const WalletAuthenticator = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
-
const
|
|
3
|
+
const { getWallet } = require('@blocklet/sdk/lib/wallet');
|
|
4
|
+
const { WalletAuthenticator } = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
+
const { WalletHandlers } = require('@blocklet/sdk/lib/wallet-handler');
|
|
6
6
|
|
|
7
7
|
const env = require('./env');
|
|
8
8
|
|
|
9
9
|
const wallet = getWallet();
|
|
10
10
|
const authenticator = new WalletAuthenticator();
|
|
11
|
-
const handlers = new
|
|
11
|
+
const handlers = new WalletHandlers({
|
|
12
12
|
authenticator,
|
|
13
13
|
tokenStorage: new AuthStorage({
|
|
14
14
|
dbPath: path.join(env.dataDir, 'auth.db'),
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
39
|
-
"@blocklet/sdk": "^1.16.
|
|
39
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
40
40
|
"@nestjs/common": "^11.0.10",
|
|
41
41
|
"@nestjs/core": "^11.0.10",
|
|
42
42
|
"@nestjs/platform-express": "^11.0.10",
|
|
43
|
-
"@ocap/client": "^1.
|
|
43
|
+
"@ocap/client": "^1.26.3",
|
|
44
44
|
"dotenv-flow": "^4.1.0",
|
|
45
45
|
"express": "^4.21.2",
|
|
46
46
|
"reflect-metadata": "^0.2.2",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const AuthStorage = require('@arcblock/did-connect-storage-nedb');
|
|
3
|
-
const getWallet = require('@blocklet/sdk/lib/wallet');
|
|
4
|
-
const WalletAuthenticator = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
-
const
|
|
3
|
+
const { getWallet } = require('@blocklet/sdk/lib/wallet');
|
|
4
|
+
const { WalletAuthenticator } = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
+
const { WalletHandlers } = require('@blocklet/sdk/lib/wallet-handler');
|
|
6
6
|
|
|
7
7
|
const env = require('./env');
|
|
8
8
|
|
|
9
9
|
const wallet = getWallet();
|
|
10
10
|
const authenticator = new WalletAuthenticator();
|
|
11
|
-
const handlers = new
|
|
11
|
+
const handlers = new WalletHandlers({
|
|
12
12
|
authenticator,
|
|
13
13
|
tokenStorage: new AuthStorage({
|
|
14
14
|
dbPath: path.join(env.dataDir, 'auth.db'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { sessionMiddleware } = require('@blocklet/sdk/lib/middlewares/session');
|
|
2
2
|
const router = require('express').Router();
|
|
3
3
|
|
|
4
|
-
router.use('/user',
|
|
4
|
+
router.use('/user', sessionMiddleware(), (req, res) => res.json(req.user || {}));
|
|
5
5
|
|
|
6
6
|
module.exports = router;
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
32
|
-
"@blocklet/sdk": "^1.16.
|
|
33
|
-
"@ocap/client": "^1.
|
|
34
|
-
"@ocap/mcrypto": "^1.
|
|
35
|
-
"@ocap/wallet": "^1.
|
|
32
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
33
|
+
"@ocap/client": "^1.26.3",
|
|
34
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
35
|
+
"@ocap/wallet": "^1.26.3",
|
|
36
36
|
"dotenv-flow": "^4.1.0",
|
|
37
37
|
"express": "^4.21.2",
|
|
38
38
|
"next": "14.2.4",
|
|
39
39
|
"react": "~19.1.0",
|
|
40
|
-
"react-dom": "19.1.0"
|
|
40
|
+
"react-dom": "~19.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"bumpp": "^9.11.1",
|
|
@@ -5,7 +5,7 @@ import cookieParser from 'cookie-parser';
|
|
|
5
5
|
import cors from 'cors';
|
|
6
6
|
import dotenv from 'dotenv-flow';
|
|
7
7
|
import express, { ErrorRequestHandler } from 'express';
|
|
8
|
-
import fallback from '@blocklet/sdk/lib/middlewares/fallback';
|
|
8
|
+
import { fallback } from '@blocklet/sdk/lib/middlewares/fallback';
|
|
9
9
|
import logger from './libs/logger';
|
|
10
10
|
import { router } from './agents';
|
|
11
11
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
3
|
import AuthStorage from '@arcblock/did-connect-storage-nedb';
|
|
4
|
-
import getWallet from '@blocklet/sdk/lib/wallet';
|
|
5
|
-
import WalletAuthenticator from '@blocklet/sdk/lib/wallet-authenticator';
|
|
6
|
-
import
|
|
4
|
+
import { getWallet } from '@blocklet/sdk/lib/wallet';
|
|
5
|
+
import { WalletAuthenticator } from '@blocklet/sdk/lib/wallet-authenticator';
|
|
6
|
+
import { WalletHandlers } from '@blocklet/sdk/lib/wallet-handler';
|
|
7
7
|
|
|
8
8
|
import env from './env';
|
|
9
9
|
|
|
10
10
|
export const wallet = getWallet();
|
|
11
11
|
export const authenticator = new WalletAuthenticator();
|
|
12
|
-
export const handlers = new
|
|
12
|
+
export const handlers = new WalletHandlers({
|
|
13
13
|
authenticator,
|
|
14
14
|
tokenStorage: new AuthStorage({
|
|
15
15
|
dbPath: path.join(env.dataDir, 'auth.db'),
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@aigne/core": "^1.
|
|
42
|
-
"@aigne/default-memory": "^1.2.
|
|
43
|
-
"@aigne/openai": "^0.4.
|
|
44
|
-
"@arcblock/did-connect-react": "^3.1.
|
|
41
|
+
"@aigne/core": "^1.65.0-beta.4",
|
|
42
|
+
"@aigne/default-memory": "^1.2.13-beta.5",
|
|
43
|
+
"@aigne/openai": "^0.16.4-beta.5",
|
|
44
|
+
"@arcblock/did-connect-react": "^3.1.53",
|
|
45
45
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
46
|
-
"@arcblock/ux": "^3.1.
|
|
47
|
-
"@blocklet/sdk": "^1.16.
|
|
48
|
-
"@blocklet/ui-react": "^3.1.
|
|
46
|
+
"@arcblock/ux": "^3.1.53",
|
|
47
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
48
|
+
"@blocklet/ui-react": "^3.1.53",
|
|
49
49
|
"@mui/icons-material": "^7.1.2",
|
|
50
50
|
"@mui/material": "^7.1.2",
|
|
51
|
-
"@ocap/client": "^1.
|
|
52
|
-
"@ocap/mcrypto": "^1.
|
|
53
|
-
"@ocap/wallet": "^1.
|
|
51
|
+
"@ocap/client": "^1.26.3",
|
|
52
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
53
|
+
"@ocap/wallet": "^1.26.3",
|
|
54
54
|
"axios": "^1.7.9",
|
|
55
55
|
"cookie-parser": "^1.4.7",
|
|
56
56
|
"cors": "^2.8.5",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"tsx": "^4.19.3",
|
|
98
98
|
"typescript": "^5.7.3",
|
|
99
99
|
"vite": "^7.0.0",
|
|
100
|
-
"vite-plugin-blocklet": "^0.
|
|
100
|
+
"vite-plugin-blocklet": "^0.12.0",
|
|
101
101
|
"vite-plugin-svgr": "^4.3.0",
|
|
102
102
|
"zx": "^8.3.2"
|
|
103
103
|
},
|
|
@@ -4,7 +4,7 @@ const path = require('path');
|
|
|
4
4
|
const cors = require('cors');
|
|
5
5
|
const express = require('express');
|
|
6
6
|
const cookieParser = require('cookie-parser');
|
|
7
|
-
const fallback = require('@blocklet/sdk/lib/middlewares/fallback');
|
|
7
|
+
const { fallback } = require('@blocklet/sdk/lib/middlewares/fallback');
|
|
8
8
|
|
|
9
9
|
const { name, version } = require('../package.json');
|
|
10
10
|
const logger = require('./libs/logger');
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const AuthStorage = require('@arcblock/did-connect-storage-nedb');
|
|
3
|
-
const getWallet = require('@blocklet/sdk/lib/wallet');
|
|
4
|
-
const WalletAuthenticator = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
-
const
|
|
3
|
+
const { getWallet } = require('@blocklet/sdk/lib/wallet');
|
|
4
|
+
const { WalletAuthenticator } = require('@blocklet/sdk/lib/wallet-authenticator');
|
|
5
|
+
const { WalletHandlers } = require('@blocklet/sdk/lib/wallet-handler');
|
|
6
6
|
|
|
7
7
|
const env = require('./env');
|
|
8
8
|
|
|
9
9
|
const wallet = getWallet();
|
|
10
10
|
const authenticator = new WalletAuthenticator();
|
|
11
|
-
const handlers = new
|
|
11
|
+
const handlers = new WalletHandlers({
|
|
12
12
|
authenticator,
|
|
13
13
|
tokenStorage: new AuthStorage({
|
|
14
14
|
dbPath: path.join(env.dataDir, 'auth.db'),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { sessionMiddleware } = require('@blocklet/sdk/lib/middlewares/session');
|
|
2
2
|
const router = require('express').Router();
|
|
3
3
|
|
|
4
|
-
router.use('/user',
|
|
4
|
+
router.use('/user', sessionMiddleware(), (req, res) => res.json(req.user || {}));
|
|
5
5
|
|
|
6
6
|
router.use('/data', (req, res) =>
|
|
7
7
|
res.json({
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@arcblock/did-connect-storage-nedb": "^1.8.0",
|
|
44
|
-
"@blocklet/sdk": "^1.16.
|
|
45
|
-
"@ocap/client": "^1.
|
|
46
|
-
"@ocap/mcrypto": "^1.
|
|
47
|
-
"@ocap/wallet": "^1.
|
|
44
|
+
"@blocklet/sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
45
|
+
"@ocap/client": "^1.26.3",
|
|
46
|
+
"@ocap/mcrypto": "^1.26.3",
|
|
47
|
+
"@ocap/wallet": "^1.26.3",
|
|
48
48
|
"axios": "^1.7.9",
|
|
49
49
|
"cookie-parser": "^1.4.7",
|
|
50
50
|
"cors": "^2.8.5",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@arcblock/eslint-config": "^0.3.3",
|
|
57
|
-
"@blocklet/js-sdk": "^1.16.
|
|
57
|
+
"@blocklet/js-sdk": "^1.16.54-beta-20251029-055649-a9143beb",
|
|
58
58
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
59
59
|
"@vitejs/plugin-react": "^4.6.0",
|
|
60
60
|
"bumpp": "^9.11.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"simple-git-hooks": "^2.11.1",
|
|
72
72
|
"tsx": "^4.19.3",
|
|
73
73
|
"vite": "^7.0.0",
|
|
74
|
-
"vite-plugin-blocklet": "^0.
|
|
74
|
+
"vite-plugin-blocklet": "^0.12.0",
|
|
75
75
|
"vite-plugin-svgr": "^4.3.0",
|
|
76
76
|
"zx": "^8.3.2"
|
|
77
77
|
},
|
|
@@ -6,7 +6,7 @@ import cookieParser from 'cookie-parser';
|
|
|
6
6
|
import cors from 'cors';
|
|
7
7
|
import dotenv from 'dotenv-flow';
|
|
8
8
|
import express, { ErrorRequestHandler } from 'express';
|
|
9
|
-
import fallback from '@blocklet/sdk/lib/middlewares/fallback';
|
|
9
|
+
import { fallback } from '@blocklet/sdk/lib/middlewares/fallback';
|
|
10
10
|
|
|
11
11
|
import logger from './libs/logger';
|
|
12
12
|
import routes from './routes';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
3
|
import AuthStorage from '@arcblock/did-connect-storage-nedb';
|
|
4
|
-
import getWallet from '@blocklet/sdk/lib/wallet';
|
|
5
|
-
import WalletAuthenticator from '@blocklet/sdk/lib/wallet-authenticator';
|
|
6
|
-
import
|
|
4
|
+
import { getWallet } from '@blocklet/sdk/lib/wallet';
|
|
5
|
+
import { WalletAuthenticator } from '@blocklet/sdk/lib/wallet-authenticator';
|
|
6
|
+
import { WalletHandlers } from '@blocklet/sdk/lib/wallet-handler';
|
|
7
7
|
|
|
8
8
|
import env from './env';
|
|
9
9
|
|
|
10
10
|
export const wallet = getWallet();
|
|
11
11
|
export const authenticator = new WalletAuthenticator();
|
|
12
|
-
export const handlers = new
|
|
12
|
+
export const handlers = new WalletHandlers({
|
|
13
13
|
authenticator,
|
|
14
14
|
tokenStorage: new AuthStorage({
|
|
15
15
|
dbPath: path.join(env.dataDir, 'auth.db'),
|