@lifesi/genesis-cli 0.1.3 → 0.1.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/dist/hives-node-transport.js +1 -1
- package/dist/index.js +18 -2
- package/package.json +2 -2
|
@@ -13,7 +13,7 @@ export async function closeHivesNodeTransport() {
|
|
|
13
13
|
export function hivesOperationBudget(id) {
|
|
14
14
|
if (['hives_list_buckets', 'hives_create_bucket', 'hives_get_bucket', 'hives_delete_bucket', 'hives_list_objects', 'hives_upload_object', 'hives_upload_object_by_key', 'hives_delete_object', 'hives_delete_object_by_key', 'hives_download_object_by_key', 'hives_get_cors_config', 'hives_set_cors_config', 'hives_generate_presigned_url', 'hives_reconcile'].includes(id))
|
|
15
15
|
return 100_000;
|
|
16
|
-
if (id === 'hives_cancel_deployment' || id === 'hives_delete_deployment')
|
|
16
|
+
if (id === 'hives_cancel_deployment' || id === 'hives_delete_deployment' || id === 'hives_stop_deployment')
|
|
17
17
|
return 330_000;
|
|
18
18
|
if (['hives_create_deployment', 'hives_upload_deployment', 'hives_invoke_deployment', 'hives_invoke_function', 'hives_invoke_function_async'].includes(id))
|
|
19
19
|
return 40_000;
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export function buildProgram(deps = {}) {
|
|
|
32
32
|
const auth = { ...authConfig(env, f), sleep: deps.sleep };
|
|
33
33
|
const program = new Command('genesis')
|
|
34
34
|
.description('One CLI for every Genesis service.')
|
|
35
|
-
.version('0.1.
|
|
35
|
+
.version('0.1.4')
|
|
36
36
|
.option('--json', 'machine-readable JSON output')
|
|
37
37
|
.option('--api-key <key>', 'use this API key (default: GENESIS_API_KEY, then your `genesis login`)')
|
|
38
38
|
.option('--base-url <url>', 'gateway URL (default: GENESIS_BASE_URL or https://console.life.one/api)')
|
|
@@ -48,7 +48,7 @@ export function buildProgram(deps = {}) {
|
|
|
48
48
|
const opts = {
|
|
49
49
|
apiKey: o.apiKey ?? env.GENESIS_API_KEY, token: env.GENESIS_TOKEN,
|
|
50
50
|
baseUrl: o.baseUrl ?? env.GENESIS_BASE_URL, routing: o.direct || env.GENESIS_ROUTING === 'direct' ? 'direct' : 'gateway',
|
|
51
|
-
fetch: f, userAgent: 'genesis-cli/0.1.
|
|
51
|
+
fetch: f, userAgent: 'genesis-cli/0.1.4',
|
|
52
52
|
credentials: store ? savedLoginProvider(auth, store) : undefined,
|
|
53
53
|
};
|
|
54
54
|
return new Genesis(hivesTransport ? { ...opts, fetch: createHivesNodeTransport(opts, deps.signal) } : opts);
|
|
@@ -77,6 +77,12 @@ export function buildProgram(deps = {}) {
|
|
|
77
77
|
return s.organization_id;
|
|
78
78
|
return (await gen.whoami()).org;
|
|
79
79
|
};
|
|
80
|
+
const silos = program.command('silos').description('Serverless PostgreSQL');
|
|
81
|
+
const silosProjects = silos.command('projects').description('Projects in your verified organization');
|
|
82
|
+
silosProjects.command('list').action(async () => out.log(JSON.stringify(await (await client()).silos.projects.list(), null, 2)));
|
|
83
|
+
silosProjects.command('get <project_id>').action(async (id) => out.log(JSON.stringify(await (await client()).silos.projects.get(id), null, 2)));
|
|
84
|
+
silosProjects.command('create').requiredOption('--name <name>', 'Project name').requiredOption('--slug <slug>', 'Unique project slug')
|
|
85
|
+
.action(async (options) => out.log(JSON.stringify(await (await client()).silos.projects.create({ name: options.name, slug: options.slug }), null, 2)));
|
|
80
86
|
registerDials(program, { client, orgId, emit });
|
|
81
87
|
// ---- auth ------------------------------------------------------------
|
|
82
88
|
program.command('login').description('Sign in with LifeID in your browser').option('--no-browser', 'just print the link')
|
|
@@ -221,6 +227,8 @@ export function buildProgram(deps = {}) {
|
|
|
221
227
|
.action(async (project, deployment, o) => emitDeployment(await (await hivesClient()).hives.deployments.rollback(project, deployment, { reason: o.reason })));
|
|
222
228
|
deployments.command('cancel <project_id> <deployment_id>')
|
|
223
229
|
.action(async (project, deployment) => emitDeployment(await (await hivesClient()).hives.deployments.cancel(project, deployment)));
|
|
230
|
+
deployments.command('stop <project_id> <deployment_id>').description('Stop the runtime; read its state before explicitly reconciling an uncertain result')
|
|
231
|
+
.action(async (project, deployment) => emitDeployment(await (await hivesClient()).hives.deployments.stop(project, deployment)));
|
|
224
232
|
deployments.command('delete <project_id> <deployment_id>').description('Delete a deployment that is not currently active')
|
|
225
233
|
.action(async (project, deployment) => { const result = await (await hivesClient()).hives.deployments.delete(project, deployment); emit(result, () => `Deleted deployment ${deployment}.`); });
|
|
226
234
|
deployments.command('logs <project_id> <deployment_id>').description('Read real persisted deployment logs')
|
|
@@ -436,6 +444,14 @@ export function buildProgram(deps = {}) {
|
|
|
436
444
|
const r = await (await client()).relays.zones.list(o.search ? { search: o.search } : {});
|
|
437
445
|
emit(r, () => table((r.zones ?? []), ['name', 'type', 'record_count', 'dnssec_enabled', 'status']));
|
|
438
446
|
});
|
|
447
|
+
relays.command('zone <zone>').description('Read one DNS zone').action(async (zone) => {
|
|
448
|
+
const result = await (await client()).relays.zones.get(zone);
|
|
449
|
+
emit(result, () => JSON.stringify(result, null, 2));
|
|
450
|
+
});
|
|
451
|
+
relays.command('dnssec <zone>').description('Read DNSSEC status and authoritative key availability').action(async (zone) => {
|
|
452
|
+
const result = await (await client()).relays.zones.dnssec(zone);
|
|
453
|
+
emit(result, () => JSON.stringify(result, null, 2));
|
|
454
|
+
});
|
|
439
455
|
const records = relays.command('records').description('DNS records in a zone');
|
|
440
456
|
records.command('list <zone>', { isDefault: true }).option('--type <type>').action(async (zone, o) => {
|
|
441
457
|
const r = await (await client()).relays.records.list(zone, o.type ? { type: o.type } : {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifesi/genesis-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/l1felabs/genesis-api.git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"commander": "^14.0.0",
|
|
20
20
|
"undici": "6.29.0",
|
|
21
|
-
"@lifesi/genesis": "0.1.
|
|
21
|
+
"@lifesi/genesis": "0.1.4"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
24
|
"@napi-rs/keyring": "^1.2.0"
|