kubun 0.3.2 → 0.3.4
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/README.md +23 -22
- package/dist/commands/serve.js +4 -2
- package/oclif.manifest.json +50 -40
- package/package.json +21 -21
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g kubun
|
|
|
20
20
|
$ kubun COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ kubun (--version)
|
|
23
|
-
kubun/0.3.
|
|
23
|
+
kubun/0.3.4 darwin-arm64 node-v24.12.0
|
|
24
24
|
$ kubun --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ kubun COMMAND
|
|
@@ -71,7 +71,7 @@ USAGE
|
|
|
71
71
|
$ kubun account id -k <value>
|
|
72
72
|
|
|
73
73
|
FLAGS
|
|
74
|
-
-k, --privateKey=<value> (required) base64-encoded private key
|
|
74
|
+
-k, --privateKey=<value> (required) [env: KUBUN_PRIVATE_KEY] base64-encoded private key
|
|
75
75
|
|
|
76
76
|
DESCRIPTION
|
|
77
77
|
Display the DID of an account given its private key
|
|
@@ -87,7 +87,7 @@ USAGE
|
|
|
87
87
|
|
|
88
88
|
FLAGS
|
|
89
89
|
-c, --cluster=<value>... (required) path of the JSON file of the cluster
|
|
90
|
-
-k, --privateKey=<value> (required) base64-encoded private key
|
|
90
|
+
-k, --privateKey=<value> (required) [env: KUBUN_PRIVATE_KEY] base64-encoded private key
|
|
91
91
|
-n, --name=<value> graph name
|
|
92
92
|
--id=<value> graph ID
|
|
93
93
|
--url=<value> Kubun server URL
|
|
@@ -109,7 +109,7 @@ ARGUMENTS
|
|
|
109
109
|
TEXT mutation text
|
|
110
110
|
|
|
111
111
|
FLAGS
|
|
112
|
-
-k, --privateKey=<value> (required) base64-encoded private key
|
|
112
|
+
-k, --privateKey=<value> (required) [env: KUBUN_PRIVATE_KEY] base64-encoded private key
|
|
113
113
|
--url=<value> Kubun server URL
|
|
114
114
|
--variables=<value> query variables as JSON string
|
|
115
115
|
|
|
@@ -130,7 +130,7 @@ ARGUMENTS
|
|
|
130
130
|
TEXT query text
|
|
131
131
|
|
|
132
132
|
FLAGS
|
|
133
|
-
-k, --privateKey=<value> (required) base64-encoded private key
|
|
133
|
+
-k, --privateKey=<value> (required) [env: KUBUN_PRIVATE_KEY] base64-encoded private key
|
|
134
134
|
--url=<value> Kubun server URL
|
|
135
135
|
--variables=<value> query variables as JSON string
|
|
136
136
|
|
|
@@ -163,7 +163,7 @@ USAGE
|
|
|
163
163
|
$ kubun help [COMMAND...] [-n]
|
|
164
164
|
|
|
165
165
|
ARGUMENTS
|
|
166
|
-
COMMAND... Command to show help for.
|
|
166
|
+
[COMMAND...] Command to show help for.
|
|
167
167
|
|
|
168
168
|
FLAGS
|
|
169
169
|
-n, --nested-commands Include all nested commands in the output.
|
|
@@ -172,7 +172,7 @@ DESCRIPTION
|
|
|
172
172
|
Display help for kubun.
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.
|
|
175
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
|
|
176
176
|
|
|
177
177
|
## `kubun model cluster`
|
|
178
178
|
|
|
@@ -234,7 +234,7 @@ EXAMPLES
|
|
|
234
234
|
$ kubun plugins
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
237
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/index.ts)_
|
|
238
238
|
|
|
239
239
|
## `kubun plugins add PLUGIN`
|
|
240
240
|
|
|
@@ -308,7 +308,7 @@ EXAMPLES
|
|
|
308
308
|
$ kubun plugins inspect myplugin
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
311
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/inspect.ts)_
|
|
312
312
|
|
|
313
313
|
## `kubun plugins install PLUGIN`
|
|
314
314
|
|
|
@@ -357,7 +357,7 @@ EXAMPLES
|
|
|
357
357
|
$ kubun plugins install someuser/someplugin
|
|
358
358
|
```
|
|
359
359
|
|
|
360
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
360
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/install.ts)_
|
|
361
361
|
|
|
362
362
|
## `kubun plugins link PATH`
|
|
363
363
|
|
|
@@ -388,7 +388,7 @@ EXAMPLES
|
|
|
388
388
|
$ kubun plugins link myplugin
|
|
389
389
|
```
|
|
390
390
|
|
|
391
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
391
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/link.ts)_
|
|
392
392
|
|
|
393
393
|
## `kubun plugins remove [PLUGIN]`
|
|
394
394
|
|
|
@@ -399,7 +399,7 @@ USAGE
|
|
|
399
399
|
$ kubun plugins remove [PLUGIN...] [-h] [-v]
|
|
400
400
|
|
|
401
401
|
ARGUMENTS
|
|
402
|
-
PLUGIN... plugin to uninstall
|
|
402
|
+
[PLUGIN...] plugin to uninstall
|
|
403
403
|
|
|
404
404
|
FLAGS
|
|
405
405
|
-h, --help Show CLI help.
|
|
@@ -429,7 +429,7 @@ FLAGS
|
|
|
429
429
|
--reinstall Reinstall all plugins after uninstalling.
|
|
430
430
|
```
|
|
431
431
|
|
|
432
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
432
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/reset.ts)_
|
|
433
433
|
|
|
434
434
|
## `kubun plugins uninstall [PLUGIN]`
|
|
435
435
|
|
|
@@ -440,7 +440,7 @@ USAGE
|
|
|
440
440
|
$ kubun plugins uninstall [PLUGIN...] [-h] [-v]
|
|
441
441
|
|
|
442
442
|
ARGUMENTS
|
|
443
|
-
PLUGIN... plugin to uninstall
|
|
443
|
+
[PLUGIN...] plugin to uninstall
|
|
444
444
|
|
|
445
445
|
FLAGS
|
|
446
446
|
-h, --help Show CLI help.
|
|
@@ -457,7 +457,7 @@ EXAMPLES
|
|
|
457
457
|
$ kubun plugins uninstall myplugin
|
|
458
458
|
```
|
|
459
459
|
|
|
460
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
460
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/uninstall.ts)_
|
|
461
461
|
|
|
462
462
|
## `kubun plugins unlink [PLUGIN]`
|
|
463
463
|
|
|
@@ -468,7 +468,7 @@ USAGE
|
|
|
468
468
|
$ kubun plugins unlink [PLUGIN...] [-h] [-v]
|
|
469
469
|
|
|
470
470
|
ARGUMENTS
|
|
471
|
-
PLUGIN... plugin to uninstall
|
|
471
|
+
[PLUGIN...] plugin to uninstall
|
|
472
472
|
|
|
473
473
|
FLAGS
|
|
474
474
|
-h, --help Show CLI help.
|
|
@@ -501,7 +501,7 @@ DESCRIPTION
|
|
|
501
501
|
Update installed plugins.
|
|
502
502
|
```
|
|
503
503
|
|
|
504
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.
|
|
504
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/update.ts)_
|
|
505
505
|
|
|
506
506
|
## `kubun serve`
|
|
507
507
|
|
|
@@ -509,13 +509,14 @@ Start a local Kubun server
|
|
|
509
509
|
|
|
510
510
|
```
|
|
511
511
|
USAGE
|
|
512
|
-
$ kubun serve [--db <value>] [-p <value>] [-k <value> | --id <value>]
|
|
512
|
+
$ kubun serve [-a <value>] [--db <value>] [-p <value>] [-k <value> | --id <value>]
|
|
513
513
|
|
|
514
514
|
FLAGS
|
|
515
|
-
-
|
|
516
|
-
-
|
|
517
|
-
|
|
518
|
-
--
|
|
515
|
+
-a, --allowedOrigin=<value> [default: *, env: KUBUN_ALLOWED_ORIGIN] allowed HTTP origin
|
|
516
|
+
-k, --privateKey=<value> [env: KUBUN_PRIVATE_KEY] base64-encoded private key
|
|
517
|
+
-p, --port=<value> port to listen on
|
|
518
|
+
--db=<value> path to the local SQLite database
|
|
519
|
+
--id=<value> server ID
|
|
519
520
|
|
|
520
521
|
DESCRIPTION
|
|
521
522
|
Start a local Kubun server
|
package/dist/commands/serve.js
CHANGED
|
@@ -16,6 +16,7 @@ import { resolvePath } from '../fs.js';
|
|
|
16
16
|
export default class Serve extends Command {
|
|
17
17
|
static description = 'Start a local Kubun server';
|
|
18
18
|
static flags = {
|
|
19
|
+
allowedOrigin: Flags.string({ char: 'a', description: 'allowed HTTP origin', env: 'KUBUN_ALLOWED_ORIGIN', default: '*' }),
|
|
19
20
|
db: Flags.file({ description: 'path to the local SQLite database' }),
|
|
20
21
|
id: Flags.string({ description: 'server ID' }),
|
|
21
22
|
port: Flags.integer({ char: 'p', description: 'port to listen on' }),
|
|
@@ -59,9 +60,10 @@ export default class Serve extends Command {
|
|
|
59
60
|
db = new KubunDB({ adapter: new SQLiteAdapter({ database }) });
|
|
60
61
|
spinner.info(`Using local SQLite database: ${database}`);
|
|
61
62
|
}
|
|
62
|
-
const
|
|
63
|
+
const allowedOrigin = flags.allowedOrigin.split(',').map((origin) => origin.trim());
|
|
64
|
+
const transport = new ServerTransport({ allowedOrigin });
|
|
63
65
|
serve({ handlers: createHandlers({ db }), id, transport });
|
|
64
|
-
spinner.start(
|
|
66
|
+
spinner.start(`Starting the server with allowed origin: ${allowedOrigin.join(', ')}`);
|
|
65
67
|
const port = flags.port ?? (await getPort({ port: 4321 }));
|
|
66
68
|
const httpServer = serveHTTP({ fetch: transport.fetch, port }, (info) => {
|
|
67
69
|
spinner.succeed(`HTTP server listening on port ${info.port}`);
|
package/oclif.manifest.json
CHANGED
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
"args": {},
|
|
6
6
|
"description": "Start a local Kubun server",
|
|
7
7
|
"flags": {
|
|
8
|
+
"allowedOrigin": {
|
|
9
|
+
"char": "a",
|
|
10
|
+
"description": "allowed HTTP origin",
|
|
11
|
+
"env": "KUBUN_ALLOWED_ORIGIN",
|
|
12
|
+
"name": "allowedOrigin",
|
|
13
|
+
"default": "*",
|
|
14
|
+
"hasDynamicHelp": false,
|
|
15
|
+
"multiple": false,
|
|
16
|
+
"type": "option"
|
|
17
|
+
},
|
|
8
18
|
"db": {
|
|
9
19
|
"description": "path to the local SQLite database",
|
|
10
20
|
"name": "db",
|
|
@@ -285,45 +295,6 @@
|
|
|
285
295
|
"query.js"
|
|
286
296
|
]
|
|
287
297
|
},
|
|
288
|
-
"graphql:schema": {
|
|
289
|
-
"aliases": [],
|
|
290
|
-
"args": {},
|
|
291
|
-
"description": "Create a GraphQL schema from clusters of document models",
|
|
292
|
-
"flags": {
|
|
293
|
-
"cluster": {
|
|
294
|
-
"char": "c",
|
|
295
|
-
"description": "path of the JSON file of the cluster",
|
|
296
|
-
"name": "cluster",
|
|
297
|
-
"required": true,
|
|
298
|
-
"hasDynamicHelp": false,
|
|
299
|
-
"multiple": true,
|
|
300
|
-
"type": "option"
|
|
301
|
-
},
|
|
302
|
-
"output": {
|
|
303
|
-
"char": "o",
|
|
304
|
-
"description": "output file for the GraphQL schema",
|
|
305
|
-
"name": "output",
|
|
306
|
-
"hasDynamicHelp": false,
|
|
307
|
-
"multiple": false,
|
|
308
|
-
"type": "option"
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
"hasDynamicHelp": false,
|
|
312
|
-
"hiddenAliases": [],
|
|
313
|
-
"id": "graphql:schema",
|
|
314
|
-
"pluginAlias": "kubun",
|
|
315
|
-
"pluginName": "kubun",
|
|
316
|
-
"pluginType": "core",
|
|
317
|
-
"strict": true,
|
|
318
|
-
"enableJsonFlag": false,
|
|
319
|
-
"isESM": true,
|
|
320
|
-
"relativePath": [
|
|
321
|
-
"dist",
|
|
322
|
-
"commands",
|
|
323
|
-
"graphql",
|
|
324
|
-
"schema.js"
|
|
325
|
-
]
|
|
326
|
-
},
|
|
327
298
|
"model:cluster": {
|
|
328
299
|
"aliases": [],
|
|
329
300
|
"args": {},
|
|
@@ -432,7 +403,46 @@
|
|
|
432
403
|
"model",
|
|
433
404
|
"create.js"
|
|
434
405
|
]
|
|
406
|
+
},
|
|
407
|
+
"graphql:schema": {
|
|
408
|
+
"aliases": [],
|
|
409
|
+
"args": {},
|
|
410
|
+
"description": "Create a GraphQL schema from clusters of document models",
|
|
411
|
+
"flags": {
|
|
412
|
+
"cluster": {
|
|
413
|
+
"char": "c",
|
|
414
|
+
"description": "path of the JSON file of the cluster",
|
|
415
|
+
"name": "cluster",
|
|
416
|
+
"required": true,
|
|
417
|
+
"hasDynamicHelp": false,
|
|
418
|
+
"multiple": true,
|
|
419
|
+
"type": "option"
|
|
420
|
+
},
|
|
421
|
+
"output": {
|
|
422
|
+
"char": "o",
|
|
423
|
+
"description": "output file for the GraphQL schema",
|
|
424
|
+
"name": "output",
|
|
425
|
+
"hasDynamicHelp": false,
|
|
426
|
+
"multiple": false,
|
|
427
|
+
"type": "option"
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
"hasDynamicHelp": false,
|
|
431
|
+
"hiddenAliases": [],
|
|
432
|
+
"id": "graphql:schema",
|
|
433
|
+
"pluginAlias": "kubun",
|
|
434
|
+
"pluginName": "kubun",
|
|
435
|
+
"pluginType": "core",
|
|
436
|
+
"strict": true,
|
|
437
|
+
"enableJsonFlag": false,
|
|
438
|
+
"isESM": true,
|
|
439
|
+
"relativePath": [
|
|
440
|
+
"dist",
|
|
441
|
+
"commands",
|
|
442
|
+
"graphql",
|
|
443
|
+
"schema.js"
|
|
444
|
+
]
|
|
435
445
|
}
|
|
436
446
|
},
|
|
437
|
-
"version": "0.3.
|
|
447
|
+
"version": "0.3.4"
|
|
438
448
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kubun",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"license": "see LICENSE.md",
|
|
5
5
|
"description": "Kubun CLI",
|
|
6
6
|
"keywords": [],
|
|
@@ -36,38 +36,38 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@enkaku/async": "^0.12.2",
|
|
38
38
|
"@enkaku/codec": "^0.12.0",
|
|
39
|
-
"@enkaku/http-server-transport": "^0.12.
|
|
40
|
-
"@enkaku/server": "^0.12.
|
|
41
|
-
"@enkaku/token": "
|
|
42
|
-
"@hono/node-server": "^1.
|
|
43
|
-
"@oclif/core": "^4.
|
|
44
|
-
"@oclif/plugin-help": "^6.2.
|
|
45
|
-
"@oclif/plugin-plugins": "^5.4.
|
|
39
|
+
"@enkaku/http-server-transport": "^0.12.2",
|
|
40
|
+
"@enkaku/server": "^0.12.2",
|
|
41
|
+
"@enkaku/token": "0.12.3",
|
|
42
|
+
"@hono/node-server": "^1.19.8",
|
|
43
|
+
"@oclif/core": "^4.8.0",
|
|
44
|
+
"@oclif/plugin-help": "^6.2.36",
|
|
45
|
+
"@oclif/plugin-plugins": "^5.4.54",
|
|
46
46
|
"get-port": "^7.1.0",
|
|
47
|
-
"graphql": "^16.
|
|
48
|
-
"ora": "^
|
|
49
|
-
"@kubun/
|
|
50
|
-
"@kubun/db": "^0.3.4",
|
|
47
|
+
"graphql": "^16.12.0",
|
|
48
|
+
"ora": "^9.0.0",
|
|
49
|
+
"@kubun/db": "^0.3.7",
|
|
51
50
|
"@kubun/db-postgres": "^0.3.2",
|
|
52
|
-
"@kubun/
|
|
53
|
-
"@kubun/
|
|
54
|
-
"@kubun/http-client": "^0.3.
|
|
55
|
-
"@kubun/
|
|
56
|
-
"@kubun/
|
|
51
|
+
"@kubun/graphql": "^0.3.14",
|
|
52
|
+
"@kubun/db-sqlite": "^0.3.4",
|
|
53
|
+
"@kubun/http-client": "^0.3.1",
|
|
54
|
+
"@kubun/server": "^0.3.13",
|
|
55
|
+
"@kubun/client": "^0.3.8",
|
|
56
|
+
"@kubun/protocol": "^0.3.11"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@oclif/test": "^4.1.
|
|
60
|
-
"oclif": "^4.22.
|
|
59
|
+
"@oclif/test": "^4.1.15",
|
|
60
|
+
"oclif": "^4.22.63",
|
|
61
61
|
"shx": "^0.4.0",
|
|
62
62
|
"ts-node": "^10",
|
|
63
|
-
"typescript": "^5.9.
|
|
63
|
+
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"kubun": "./bin/dev.js",
|
|
67
67
|
"build": "shx rm -rf dist && tsc -b",
|
|
68
68
|
"posttest": "pnpm run lint",
|
|
69
69
|
"test:types": "tsc --noEmit --skipLibCheck",
|
|
70
|
-
"test:unit": "OCLIF_TEST_ROOT=.
|
|
70
|
+
"test:unit": "OCLIF_TEST_ROOT=. vitest run",
|
|
71
71
|
"test": "pnpm run test:types && pnpm run test:unit",
|
|
72
72
|
"version": "oclif readme && git add README.md"
|
|
73
73
|
}
|