koigrid 0.7.0 → 0.9.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/CHANGELOG.md +19 -2
- package/dist/api.js +78 -6
- package/dist/args.js +19 -0
- package/dist/commands/analytics.js +1 -1
- package/dist/commands/apps.js +369 -27
- package/dist/commands/audit.js +1 -1
- package/dist/commands/billing.js +87 -0
- package/dist/commands/bots.js +1 -1
- package/dist/commands/changelog.js +19 -0
- package/dist/commands/checks.js +4 -3
- package/dist/commands/config.js +9 -6
- package/dist/commands/connect.js +2 -2
- package/dist/commands/db.js +761 -17
- package/dist/commands/dns.js +1 -1
- package/dist/commands/errors.js +1 -1
- package/dist/commands/events.js +15 -3
- package/dist/commands/experiments.js +105 -0
- package/dist/commands/flags.js +22 -3
- package/dist/commands/heartbeats.js +3 -3
- package/dist/commands/images.js +1 -1
- package/dist/commands/jobs.js +39 -4
- package/dist/commands/links.js +59 -0
- package/dist/commands/logs.js +1 -1
- package/dist/commands/members.js +26 -1
- package/dist/commands/network.js +28 -0
- package/dist/commands/notices.js +24 -0
- package/dist/commands/notifications.js +2 -2
- package/dist/commands/otel.js +1 -1
- package/dist/commands/pricing.js +37 -0
- package/dist/commands/projects.js +1 -1
- package/dist/commands/queues.js +4 -3
- package/dist/commands/redis.js +80 -2
- package/dist/commands/registry.js +58 -3
- package/dist/commands/rewards.js +92 -14
- package/dist/commands/sandboxes.js +507 -2
- package/dist/commands/speed.js +1 -1
- package/dist/commands/spend.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/storage.js +51 -3
- package/dist/commands/support.js +47 -0
- package/dist/commands/tokens.js +7 -3
- package/dist/commands/up.js +6 -2
- package/dist/commands/waf.js +1 -1
- package/dist/commands/webhooks.js +1 -1
- package/dist/commands/wordpress.js +4 -3
- package/dist/commands/workflows.js +4 -3
- package/dist/esperar.js +41 -0
- package/dist/help.js +14 -1
- package/dist/index.js +26 -6
- package/dist/manifest.js +29 -12
- package/dist/output.js +1 -0
- package/dist/proyecto.js +6 -0
- package/dist/registry-flags.js +17 -0
- package/dist/registry.js +8 -2
- package/package.json +1 -1
- package/dist/commands/ai.js +0 -56
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { api } from '../api.js';
|
|
2
|
+
import { output } from '../output.js';
|
|
3
|
+
// koigrid changelog — qué ha cambiado. Existe para no tener que reejecutar todas tus pruebas para averiguar si
|
|
4
|
+
// tu problema ya está arreglado. `--since` acota a lo posterior a una fecha.
|
|
5
|
+
export async function changelog(a) {
|
|
6
|
+
const json = !!a.flags.json;
|
|
7
|
+
const since = a.flags.since || a.positionals[0] || '';
|
|
8
|
+
// Sin credenciales: es público a propósito (ver lib/changelog.ts).
|
|
9
|
+
const r = await api(`/changelog${since ? `?since=${encodeURIComponent(since)}` : ''}`, { anon: true });
|
|
10
|
+
const l = r.entries || [];
|
|
11
|
+
if (json)
|
|
12
|
+
return console.log(JSON.stringify(r, null, 2));
|
|
13
|
+
if (!l.length)
|
|
14
|
+
return console.log(`Sin cambios${since ? ` posteriores a ${since}` : ''}. Último cambio: ${r.latest ?? '—'}`);
|
|
15
|
+
return output(l, false, {
|
|
16
|
+
rows: l.map((x) => ({ date: x.date, kind: x.kind, summary: x.summary })),
|
|
17
|
+
columns: ['date', 'kind', 'summary'],
|
|
18
|
+
});
|
|
19
|
+
}
|
package/dist/commands/checks.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green } from '../output.js';
|
|
3
|
-
|
|
3
|
+
import { proyectoDeFlags } from '../proyecto.js';
|
|
4
|
+
// koigrid checks — uptime & synthetic monitoring (ver docs/products/CHECKS.md).
|
|
4
5
|
export async function checks(a) {
|
|
5
6
|
const json = !!a.flags.json;
|
|
6
7
|
const sub = a.sub || 'ls';
|
|
@@ -16,8 +17,8 @@ export async function checks(a) {
|
|
|
16
17
|
const name = a.positionals[0];
|
|
17
18
|
const target = a.flags.url || a.flags.target || a.positionals[1];
|
|
18
19
|
if (!name || !target)
|
|
19
|
-
throw new Error('usage: koigrid checks create <name> --url <https://…> [--interval 300] [--contains TEXT] [--max-latency 800]');
|
|
20
|
-
const body = { name, target, type: a.flags.type || 'url' };
|
|
20
|
+
throw new Error('usage: koigrid checks create <name> --url <https://…> [--interval 300] [--contains TEXT] [--max-latency 800] [--project <id>]');
|
|
21
|
+
const body = { name, target, type: a.flags.type || 'url', ...proyectoDeFlags(a) };
|
|
21
22
|
if (a.flags.interval)
|
|
22
23
|
body.intervalSeconds = Number(a.flags.interval);
|
|
23
24
|
if (a.flags.method)
|
package/dist/commands/config.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green } from '../output.js';
|
|
3
|
-
// koigrid config — config/secrets compartida del proyecto (cifrada). Ver docs/CONFIG.md.
|
|
3
|
+
// koigrid config — config/secrets compartida del proyecto (cifrada). Ver docs/products/CONFIG.md.
|
|
4
4
|
export async function config(a) {
|
|
5
|
+
// --project <id>: el proyecto de la config (un token de toda la organización usaría el Default).
|
|
6
|
+
const proyecto = a.flags.project ? String(a.flags.project) : '';
|
|
7
|
+
const qp = proyecto ? `?projectId=${encodeURIComponent(proyecto)}` : '';
|
|
5
8
|
const json = !!a.flags.json;
|
|
6
9
|
const sub = a.sub || 'ls';
|
|
7
10
|
if (sub === 'ls' || sub === 'list') {
|
|
8
|
-
const r = await api(
|
|
11
|
+
const r = await api(`/config${qp}`);
|
|
9
12
|
const l = r.config || [];
|
|
10
13
|
return output(l, json, {
|
|
11
14
|
rows: l.map((x) => ({ key: x.key, value: x.masked })),
|
|
@@ -17,18 +20,18 @@ export async function config(a) {
|
|
|
17
20
|
const value = a.positionals[1];
|
|
18
21
|
if (!key || value === undefined)
|
|
19
22
|
throw new Error('usage: koigrid config set <KEY> <value>');
|
|
20
|
-
await api('/config', { method: 'PUT', body: { key, value } });
|
|
23
|
+
await api('/config', { method: 'PUT', body: { key, value, ...(proyecto ? { projectId: proyecto } : {}) } });
|
|
21
24
|
return console.log(green(`✓ Set ${key}`));
|
|
22
25
|
}
|
|
23
26
|
if (sub === 'rm' || sub === 'delete') {
|
|
24
27
|
const key = a.positionals[0];
|
|
25
28
|
if (!key)
|
|
26
29
|
throw new Error('usage: koigrid config rm <KEY>');
|
|
27
|
-
await api(`/config/${encodeURIComponent(key)}`, { method: 'DELETE' });
|
|
30
|
+
await api(`/config/${encodeURIComponent(key)}?projectId=${encodeURIComponent(proyecto)}`, { method: 'DELETE' });
|
|
28
31
|
return console.log(green(`✓ Deleted ${key}`));
|
|
29
32
|
}
|
|
30
33
|
if (sub === 'pull') {
|
|
31
|
-
const r = await api(
|
|
34
|
+
const r = await api(`/config/pull${qp}`);
|
|
32
35
|
const c = r.config || {};
|
|
33
36
|
if (json)
|
|
34
37
|
return console.log(JSON.stringify(c, null, 2));
|
|
@@ -42,7 +45,7 @@ export async function config(a) {
|
|
|
42
45
|
// Uso: koigrid config run -- <command> [args…] (como `railway run`)
|
|
43
46
|
if (!a.passthrough || a.passthrough.length === 0)
|
|
44
47
|
throw new Error('usage: koigrid config run -- <command> [args…]');
|
|
45
|
-
const r = await api(
|
|
48
|
+
const r = await api(`/config/pull${qp}`);
|
|
46
49
|
const env = { ...process.env, ...(r.config || {}) };
|
|
47
50
|
const { spawnSync } = await import('node:child_process');
|
|
48
51
|
const res = spawnSync(a.passthrough[0], a.passthrough.slice(1), { stdio: 'inherit', env });
|
package/dist/commands/connect.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green } from '../output.js';
|
|
3
|
+
import { proyectoDeFlags } from '../proyecto.js';
|
|
3
4
|
// koigrid connect — Connect: broker de credenciales de agente (STS/AssumeRole para agentes).
|
|
4
5
|
// Un GRANT solo puede intercambiarse por tokens EFÍMEROS acotados; en el env va el grant, no un token largo.
|
|
5
6
|
// koigrid connect grants (alias: connect ls)
|
|
@@ -30,8 +31,7 @@ export async function connect(a) {
|
|
|
30
31
|
body.maxTtlSeconds = Number(a.flags['max-ttl']);
|
|
31
32
|
if (a.flags['max-cost'] !== undefined)
|
|
32
33
|
body.maxCostCents = Number(a.flags['max-cost']);
|
|
33
|
-
|
|
34
|
-
body.projectId = String(a.flags.project);
|
|
34
|
+
Object.assign(body, proyectoDeFlags(a));
|
|
35
35
|
const r = await api('/connect/grants', { method: 'POST', body });
|
|
36
36
|
if (json)
|
|
37
37
|
return console.log(JSON.stringify(r, null, 2));
|