@revition/plugin-dev 0.0.0-canary.a06d97b
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/LICENSE +201 -0
- package/NOTICE +8 -0
- package/dist/api.d.ts +40 -0
- package/dist/api.js +16 -0
- package/dist/api.js.map +1 -0
- package/dist/apps/apps-api.d.ts +12 -0
- package/dist/apps/apps-api.js +19 -0
- package/dist/apps/apps-api.js.map +1 -0
- package/dist/apps/keys.d.ts +26 -0
- package/dist/apps/keys.js +13 -0
- package/dist/apps/keys.js.map +1 -0
- package/dist/checks/local-checks.d.ts +40 -0
- package/dist/checks/local-checks.js +123 -0
- package/dist/checks/local-checks.js.map +1 -0
- package/dist/commands/account/link-workspace.d.ts +12 -0
- package/dist/commands/account/link-workspace.js +29 -0
- package/dist/commands/account/link-workspace.js.map +1 -0
- package/dist/commands/account/register.d.ts +14 -0
- package/dist/commands/account/register.js +51 -0
- package/dist/commands/account/register.js.map +1 -0
- package/dist/commands/account/status.d.ts +9 -0
- package/dist/commands/account/status.js +33 -0
- package/dist/commands/account/status.js.map +1 -0
- package/dist/commands/analytics.d.ts +55 -0
- package/dist/commands/analytics.js +79 -0
- package/dist/commands/analytics.js.map +1 -0
- package/dist/commands/apps/create.d.ts +13 -0
- package/dist/commands/apps/create.js +39 -0
- package/dist/commands/apps/create.js.map +1 -0
- package/dist/commands/apps/keys/create.d.ts +19 -0
- package/dist/commands/apps/keys/create.js +39 -0
- package/dist/commands/apps/keys/create.js.map +1 -0
- package/dist/commands/apps/keys/list.d.ts +16 -0
- package/dist/commands/apps/keys/list.js +28 -0
- package/dist/commands/apps/keys/list.js.map +1 -0
- package/dist/commands/apps/keys/revoke.d.ts +19 -0
- package/dist/commands/apps/keys/revoke.js +35 -0
- package/dist/commands/apps/keys/revoke.js.map +1 -0
- package/dist/commands/apps/keys/rotate.d.ts +17 -0
- package/dist/commands/apps/keys/rotate.js +38 -0
- package/dist/commands/apps/keys/rotate.js.map +1 -0
- package/dist/commands/apps/list.d.ts +13 -0
- package/dist/commands/apps/list.js +26 -0
- package/dist/commands/apps/list.js.map +1 -0
- package/dist/commands/apps/listing.d.ts +11 -0
- package/dist/commands/apps/listing.js +26 -0
- package/dist/commands/apps/listing.js.map +1 -0
- package/dist/commands/apps/scopes/set.d.ts +25 -0
- package/dist/commands/apps/scopes/set.js +52 -0
- package/dist/commands/apps/scopes/set.js.map +1 -0
- package/dist/commands/apps/view.d.ts +12 -0
- package/dist/commands/apps/view.js +26 -0
- package/dist/commands/apps/view.js.map +1 -0
- package/dist/commands/audit.d.ts +31 -0
- package/dist/commands/audit.js +48 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/branches/eval.d.ts +42 -0
- package/dist/commands/branches/eval.js +104 -0
- package/dist/commands/branches/eval.js.map +1 -0
- package/dist/commands/branches/list.d.ts +21 -0
- package/dist/commands/branches/list.js +43 -0
- package/dist/commands/branches/list.js.map +1 -0
- package/dist/commands/branches/status.d.ts +26 -0
- package/dist/commands/branches/status.js +47 -0
- package/dist/commands/branches/status.js.map +1 -0
- package/dist/commands/branches/view.d.ts +19 -0
- package/dist/commands/branches/view.js +41 -0
- package/dist/commands/branches/view.js.map +1 -0
- package/dist/commands/build.d.ts +42 -0
- package/dist/commands/build.js +76 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/changelog.d.ts +41 -0
- package/dist/commands/changelog.js +44 -0
- package/dist/commands/changelog.js.map +1 -0
- package/dist/commands/deploy.d.ts +74 -0
- package/dist/commands/deploy.js +75 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts +43 -0
- package/dist/commands/dev.js +191 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/docs.d.ts +33 -0
- package/dist/commands/docs.js +101 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/eval/list.d.ts +18 -0
- package/dist/commands/eval/list.js +49 -0
- package/dist/commands/eval/list.js.map +1 -0
- package/dist/commands/eval/run.d.ts +28 -0
- package/dist/commands/eval/run.js +186 -0
- package/dist/commands/eval/run.js.map +1 -0
- package/dist/commands/extension-points.d.ts +19 -0
- package/dist/commands/extension-points.js +26 -0
- package/dist/commands/extension-points.js.map +1 -0
- package/dist/commands/generate.d.ts +44 -0
- package/dist/commands/generate.js +145 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +29 -0
- package/dist/commands/init.js +91 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/link.d.ts +19 -0
- package/dist/commands/link.js +54 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/logs.d.ts +77 -0
- package/dist/commands/logs.js +128 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/open.d.ts +28 -0
- package/dist/commands/open.js +53 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/runs/list.d.ts +31 -0
- package/dist/commands/runs/list.js +56 -0
- package/dist/commands/runs/list.js.map +1 -0
- package/dist/commands/scaffold.d.ts +22 -0
- package/dist/commands/scaffold.js +40 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/secrets/list.d.ts +13 -0
- package/dist/commands/secrets/list.js +32 -0
- package/dist/commands/secrets/list.js.map +1 -0
- package/dist/commands/secrets/set.d.ts +23 -0
- package/dist/commands/secrets/set.js +45 -0
- package/dist/commands/secrets/set.js.map +1 -0
- package/dist/commands/secrets/unset.d.ts +20 -0
- package/dist/commands/secrets/unset.js +33 -0
- package/dist/commands/secrets/unset.js.map +1 -0
- package/dist/commands/starters/list.d.ts +16 -0
- package/dist/commands/starters/list.js +33 -0
- package/dist/commands/starters/list.js.map +1 -0
- package/dist/commands/starters/view.d.ts +19 -0
- package/dist/commands/starters/view.js +27 -0
- package/dist/commands/starters/view.js.map +1 -0
- package/dist/commands/submissions/list.d.ts +18 -0
- package/dist/commands/submissions/list.js +35 -0
- package/dist/commands/submissions/list.js.map +1 -0
- package/dist/commands/submissions/open.d.ts +27 -0
- package/dist/commands/submissions/open.js +48 -0
- package/dist/commands/submissions/open.js.map +1 -0
- package/dist/commands/submissions/view.d.ts +16 -0
- package/dist/commands/submissions/view.js +32 -0
- package/dist/commands/submissions/view.js.map +1 -0
- package/dist/commands/submit.d.ts +46 -0
- package/dist/commands/submit.js +81 -0
- package/dist/commands/submit.js.map +1 -0
- package/dist/commands/test.d.ts +42 -0
- package/dist/commands/test.js +137 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/commands/versions/channels.d.ts +26 -0
- package/dist/commands/versions/channels.js +34 -0
- package/dist/commands/versions/channels.js.map +1 -0
- package/dist/commands/versions/list.d.ts +27 -0
- package/dist/commands/versions/list.js +41 -0
- package/dist/commands/versions/list.js.map +1 -0
- package/dist/commands/versions/open.d.ts +27 -0
- package/dist/commands/versions/open.js +43 -0
- package/dist/commands/versions/open.js.map +1 -0
- package/dist/commands/versions/rollouts.d.ts +27 -0
- package/dist/commands/versions/rollouts.js +32 -0
- package/dist/commands/versions/rollouts.js.map +1 -0
- package/dist/commands/wallet/open.d.ts +14 -0
- package/dist/commands/wallet/open.js +27 -0
- package/dist/commands/wallet/open.js.map +1 -0
- package/dist/commands/wallet/show.d.ts +25 -0
- package/dist/commands/wallet/show.js +46 -0
- package/dist/commands/wallet/show.js.map +1 -0
- package/dist/dev/sandbox-session.d.ts +48 -0
- package/dist/dev/sandbox-session.js +50 -0
- package/dist/dev/sandbox-session.js.map +1 -0
- package/dist/dev/uploader.d.ts +11 -0
- package/dist/dev/uploader.js +63 -0
- package/dist/dev/uploader.js.map +1 -0
- package/dist/dev/watcher.d.ts +6 -0
- package/dist/dev/watcher.js +30 -0
- package/dist/dev/watcher.js.map +1 -0
- package/dist/eval/report.d.ts +65 -0
- package/dist/eval/report.js +42 -0
- package/dist/eval/report.js.map +1 -0
- package/dist/generate/manifest-patch.d.ts +18 -0
- package/dist/generate/manifest-patch.js +59 -0
- package/dist/generate/manifest-patch.js.map +1 -0
- package/dist/generate/render.d.ts +20 -0
- package/dist/generate/render.js +55 -0
- package/dist/generate/render.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/local/fixture-sdk.d.ts +27 -0
- package/dist/local/fixture-sdk.js +105 -0
- package/dist/local/fixture-sdk.js.map +1 -0
- package/dist/local/local-run.d.ts +58 -0
- package/dist/local/local-run.js +197 -0
- package/dist/local/local-run.js.map +1 -0
- package/dist/project/ownership.d.ts +8 -0
- package/dist/project/ownership.js +27 -0
- package/dist/project/ownership.js.map +1 -0
- package/dist/project/project-link.d.ts +13 -0
- package/dist/project/project-link.js +34 -0
- package/dist/project/project-link.js.map +1 -0
- package/dist/project/read-project.d.ts +6 -0
- package/dist/project/read-project.js +30 -0
- package/dist/project/read-project.js.map +1 -0
- package/dist/project/write-starter.d.ts +12 -0
- package/dist/project/write-starter.js +38 -0
- package/dist/project/write-starter.js.map +1 -0
- package/dist/secrets/secrets-api.d.ts +35 -0
- package/dist/secrets/secrets-api.js +54 -0
- package/dist/secrets/secrets-api.js.map +1 -0
- package/oclif.manifest.json +5658 -0
- package/package.json +72 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
/**
|
|
3
|
+
* T2.4.4 - `revition open [app|project|sessions|wallet|docs]`: the Developer Portal page for the thing named; only
|
|
4
|
+
* Revition pages over https are opened (`assertOpenable`), and with no browser the URL is printed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const OPEN_TARGETS: readonly ["app", "project", "sessions", "wallet", "docs"];
|
|
7
|
+
type Target = (typeof OPEN_TARGETS)[number];
|
|
8
|
+
/** The portal page of each target (apps/web/src/app/developer/*, served from the developer host). PURE. */
|
|
9
|
+
export declare function targetUrl(target: Target, projectId: string | null): string;
|
|
10
|
+
interface Out {
|
|
11
|
+
readonly target: Target;
|
|
12
|
+
readonly url: string;
|
|
13
|
+
readonly opened: boolean;
|
|
14
|
+
}
|
|
15
|
+
export default class Open extends RevitionCommand<Out> {
|
|
16
|
+
static summary: string;
|
|
17
|
+
static examples: string[];
|
|
18
|
+
static meta: CommandMeta;
|
|
19
|
+
static args: {
|
|
20
|
+
target: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
21
|
+
};
|
|
22
|
+
static flags: {
|
|
23
|
+
dir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
};
|
|
25
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
26
|
+
protected human(o: Out): HumanView;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { canOpenBrowser, openBrowser, RevitionCommand } from '@revition/cli-core';
|
|
4
|
+
import { DEVELOPER_PORTAL_URL } from '../api.js';
|
|
5
|
+
import { readLink } from '../project/project-link.js';
|
|
6
|
+
import { assertOpenable } from './submissions/open.js';
|
|
7
|
+
/**
|
|
8
|
+
* T2.4.4 - `revition open [app|project|sessions|wallet|docs]`: the Developer Portal page for the thing named; only
|
|
9
|
+
* Revition pages over https are opened (`assertOpenable`), and with no browser the URL is printed.
|
|
10
|
+
*/
|
|
11
|
+
export const OPEN_TARGETS = ['app', 'project', 'sessions', 'wallet', 'docs'];
|
|
12
|
+
/** The portal page of each target (apps/web/src/app/developer/*, served from the developer host). PURE. */
|
|
13
|
+
export function targetUrl(target, projectId) {
|
|
14
|
+
switch (target) {
|
|
15
|
+
case 'app':
|
|
16
|
+
return `${DEVELOPER_PORTAL_URL}/apps`;
|
|
17
|
+
case 'project':
|
|
18
|
+
return projectId === null ? `${DEVELOPER_PORTAL_URL}/ide` : `${DEVELOPER_PORTAL_URL}/ide/${encodeURIComponent(projectId)}`;
|
|
19
|
+
case 'sessions':
|
|
20
|
+
return `${DEVELOPER_PORTAL_URL}/cli-sessions`;
|
|
21
|
+
case 'wallet':
|
|
22
|
+
return `${DEVELOPER_PORTAL_URL}/`;
|
|
23
|
+
case 'docs':
|
|
24
|
+
return `${DEVELOPER_PORTAL_URL}/docs`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export default class Open extends RevitionCommand {
|
|
28
|
+
static summary = 'Open a Developer Portal page (prints the URL when no browser is available).';
|
|
29
|
+
static examples = ['revition open', 'revition open project', 'revition open sessions'];
|
|
30
|
+
static meta = {
|
|
31
|
+
id: 'open',
|
|
32
|
+
summary: Open.summary,
|
|
33
|
+
examples: Open.examples,
|
|
34
|
+
requiredScopes: [],
|
|
35
|
+
mutates: false,
|
|
36
|
+
confirm: 'none',
|
|
37
|
+
jsonSchemaId: 'revition.open.v1',
|
|
38
|
+
stability: 'stable',
|
|
39
|
+
};
|
|
40
|
+
static args = { target: Args.string({ options: [...OPEN_TARGETS], description: 'What to open (default: app).' }) };
|
|
41
|
+
static flags = { dir: Flags.string({ description: 'The project directory (default: the current directory).' }) };
|
|
42
|
+
async run2(ctx) {
|
|
43
|
+
const target = (typeof ctx.args['target'] === 'string' ? ctx.args['target'] : 'app');
|
|
44
|
+
const dir = resolve(process.cwd(), typeof ctx.commandFlags['dir'] === 'string' ? ctx.commandFlags['dir'] : '.');
|
|
45
|
+
const url = assertOpenable(targetUrl(target, readLink(dir)?.projectId ?? null));
|
|
46
|
+
const opened = !ctx.flags.json && canOpenBrowser(ctx.env, process.platform) ? await openBrowser(url) : false;
|
|
47
|
+
return { target, url, opened };
|
|
48
|
+
}
|
|
49
|
+
human(o) {
|
|
50
|
+
return { text: `${o.opened ? 'Opened' : 'Open'} ${o.url}\n` };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=open.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../src/commands/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW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AAE,MAAM,EAAE,CAAC;IACjC,CAAC;IAEkB,KAAK,CAAC,CAAM;QAC7B,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC;IAChE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
import { type RunSummary } from '../logs.js';
|
|
3
|
+
/** `--since 30m|6h|7d|90s` -> milliseconds; null when not given. PURE. */
|
|
4
|
+
export declare function parseDuration(v: unknown): number | null;
|
|
5
|
+
/** The server's list, filtered here (the route takes no query parameters). PURE. */
|
|
6
|
+
export declare function filterRuns(runs: readonly RunSummary[], f: {
|
|
7
|
+
readonly ok: boolean;
|
|
8
|
+
readonly failed: boolean;
|
|
9
|
+
readonly sinceMs: number | null;
|
|
10
|
+
readonly nowMs: number;
|
|
11
|
+
}): RunSummary[];
|
|
12
|
+
interface Out {
|
|
13
|
+
readonly appId: string;
|
|
14
|
+
readonly runs: readonly RunSummary[];
|
|
15
|
+
readonly notes: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export default class RunsList extends RevitionCommand<Out> {
|
|
18
|
+
static summary: string;
|
|
19
|
+
static examples: string[];
|
|
20
|
+
static meta: CommandMeta;
|
|
21
|
+
static flags: {
|
|
22
|
+
app: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
dir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
ok: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
failed: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
26
|
+
since: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
};
|
|
28
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
29
|
+
protected human(o: Out): HumanView;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { RevitionCommand, renderTable, terminalTable, usageError } from '@revition/cli-core';
|
|
3
|
+
import { devApi } from '../../api.js';
|
|
4
|
+
import { listAppRuns } from '../logs.js';
|
|
5
|
+
import { appOf } from '../submit.js';
|
|
6
|
+
/** `--since 30m|6h|7d|90s` -> milliseconds; null when not given. PURE. */
|
|
7
|
+
export function parseDuration(v) {
|
|
8
|
+
if (v === undefined)
|
|
9
|
+
return null;
|
|
10
|
+
const m = typeof v === 'string' ? /^(\d+)(s|m|h|d)$/.exec(v) : null;
|
|
11
|
+
if (m === null)
|
|
12
|
+
throw usageError('INVALID_DURATION', `--since "${String(v)}" is not a duration.`, 'Use e.g. 90s, 30m, 6h or 7d.');
|
|
13
|
+
const unit = { s: 1_000, m: 60_000, h: 3_600_000, d: 86_400_000 }[m[2]];
|
|
14
|
+
return Number(m[1]) * unit;
|
|
15
|
+
}
|
|
16
|
+
/** The server's list, filtered here (the route takes no query parameters). PURE. */
|
|
17
|
+
export function filterRuns(runs, f) {
|
|
18
|
+
return runs.filter((r) => (!f.ok || r.ok) && (!f.failed || !r.ok) && (f.sinceMs === null || Date.parse(r.at) >= f.nowMs - f.sinceMs));
|
|
19
|
+
}
|
|
20
|
+
export default class RunsList extends RevitionCommand {
|
|
21
|
+
static summary = "An app's runs (builds, runs in agents, evaluations), newest first.";
|
|
22
|
+
static examples = ['revition runs list --app dapp_123', 'revition runs list --failed --since 7d', 'revition runs list --json'];
|
|
23
|
+
static meta = {
|
|
24
|
+
id: 'runs:list',
|
|
25
|
+
summary: RunsList.summary,
|
|
26
|
+
examples: RunsList.examples,
|
|
27
|
+
requiredScopes: ['cli:read'],
|
|
28
|
+
mutates: false,
|
|
29
|
+
confirm: 'none',
|
|
30
|
+
jsonSchemaId: 'revition.runs.list.v1',
|
|
31
|
+
stability: 'stable',
|
|
32
|
+
};
|
|
33
|
+
static flags = {
|
|
34
|
+
app: Flags.string({ description: 'The app id (default: the linked app).' }),
|
|
35
|
+
dir: Flags.string({ description: 'The project directory (default: the current directory).' }),
|
|
36
|
+
ok: Flags.boolean({ description: 'Only the runs that succeeded.', exclusive: ['failed'] }),
|
|
37
|
+
failed: Flags.boolean({ description: 'Only the runs that failed.', exclusive: ['ok'] }),
|
|
38
|
+
since: Flags.string({ description: 'Only the runs newer than this (90s, 30m, 6h, 7d).' }),
|
|
39
|
+
};
|
|
40
|
+
async run2(ctx) {
|
|
41
|
+
const f = ctx.commandFlags;
|
|
42
|
+
const appId = appOf(ctx);
|
|
43
|
+
const sinceMs = parseDuration(f['since']);
|
|
44
|
+
const all = await listAppRuns(await devApi(ctx), appId);
|
|
45
|
+
return { appId, runs: filterRuns(all.runs, { ok: f['ok'] === true, failed: f['failed'] === true, sinceMs, nowMs: Date.now() }), notes: all.notes };
|
|
46
|
+
}
|
|
47
|
+
human(o) {
|
|
48
|
+
const notes = o.notes.map((n) => `${n}.\n`).join('');
|
|
49
|
+
if (o.runs.length === 0)
|
|
50
|
+
return { text: `${notes}No runs of ${o.appId} match.\n` };
|
|
51
|
+
return {
|
|
52
|
+
text: `${notes}${renderTable(['run', 'kind', 'ok', 'at', 'what'], o.runs.map((r) => [r.runId, r.kind, r.ok ? 'yes' : 'no', r.at, r.label]), terminalTable())}`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/runs/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAyD,MAAM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
interface Out {
|
|
3
|
+
readonly dir: string;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly files: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* T2.1.1 - the legacy `revition scaffold <starter> [dir]` (T0.1.3 parity): the starter's files, byte-equal to the
|
|
9
|
+
* legacy CLI's output, into a new directory (default: the starter id). `init` is the full flow (link + ignore lines).
|
|
10
|
+
*/
|
|
11
|
+
export default class Scaffold extends RevitionCommand<Out> {
|
|
12
|
+
static summary: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static meta: CommandMeta;
|
|
15
|
+
static args: {
|
|
16
|
+
starter: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
17
|
+
dir: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
20
|
+
protected human(o: Out): HumanView;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { Args } from '@oclif/core';
|
|
3
|
+
import { RevitionCommand } from '@revition/cli-core';
|
|
4
|
+
import { devApi, seg } from '../api.js';
|
|
5
|
+
import { writeStarter } from '../project/write-starter.js';
|
|
6
|
+
/**
|
|
7
|
+
* T2.1.1 - the legacy `revition scaffold <starter> [dir]` (T0.1.3 parity): the starter's files, byte-equal to the
|
|
8
|
+
* legacy CLI's output, into a new directory (default: the starter id). `init` is the full flow (link + ignore lines).
|
|
9
|
+
*/
|
|
10
|
+
export default class Scaffold extends RevitionCommand {
|
|
11
|
+
static summary = 'Write a starter project into a new directory (the legacy form of `revition init`).';
|
|
12
|
+
static examples = ['revition scaffold hello-tool', 'revition scaffold hello-tool my-tool'];
|
|
13
|
+
static meta = {
|
|
14
|
+
id: 'scaffold',
|
|
15
|
+
summary: Scaffold.summary,
|
|
16
|
+
examples: Scaffold.examples,
|
|
17
|
+
requiredScopes: ['cli:read'],
|
|
18
|
+
mutates: false,
|
|
19
|
+
confirm: 'none',
|
|
20
|
+
jsonSchemaId: 'revition.scaffold.v1',
|
|
21
|
+
stability: 'stable',
|
|
22
|
+
};
|
|
23
|
+
static args = {
|
|
24
|
+
starter: Args.string({ required: true, description: 'The starter id.' }),
|
|
25
|
+
dir: Args.string({ description: 'The new directory (default: the starter id).' }),
|
|
26
|
+
};
|
|
27
|
+
async run2(ctx) {
|
|
28
|
+
const starterId = String(ctx.args['starter']);
|
|
29
|
+
const dir = resolve(process.cwd(), typeof ctx.args['dir'] === 'string' ? ctx.args['dir'] : starterId);
|
|
30
|
+
const api = await devApi(ctx);
|
|
31
|
+
const s = (await api.request({ method: 'GET', path: `/dev/starters/${seg(starterId)}` })).body;
|
|
32
|
+
// Legacy semantics: refuse only when a target file exists (a non-empty directory is fine).
|
|
33
|
+
const files = writeStarter(dir, s.files, { force: true });
|
|
34
|
+
return { dir, title: s.title, files };
|
|
35
|
+
}
|
|
36
|
+
human(o) {
|
|
37
|
+
return { text: `${o.files.map((f) => `wrote ${f}`).join('\n')}\n${o.title} is in ${o.dir}. Next: revition build, then revition test.\n` };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/commands/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,eAAe,EAAyD,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,MAAM,EAAE,GAAG,EAAsB,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAQ3D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,eAAoB;IAC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GAAG,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC;IAEkB,KAAK,CAAC,CAAM;QAC7B,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,GAAG,+CAA+C,EAAE,CAAC;IAC5I,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
import { type SecretsList } from '../../secrets/secrets-api.js';
|
|
3
|
+
export default class SecretsListCommand extends RevitionCommand<SecretsList> {
|
|
4
|
+
static summary: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static meta: CommandMeta;
|
|
7
|
+
static flags: {
|
|
8
|
+
app: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
env: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
protected run2(ctx: CommandContext): Promise<SecretsList>;
|
|
12
|
+
protected human(d: SecretsList): HumanView;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { RevitionCommand, renderTable, terminalTable } from '@revition/cli-core';
|
|
3
|
+
import { devApi } from '../../api.js';
|
|
4
|
+
import { listSecrets, SECRET_ENVS, secretEnvOf } from '../../secrets/secrets-api.js';
|
|
5
|
+
export default class SecretsListCommand extends RevitionCommand {
|
|
6
|
+
static summary = "List runtime secret NAMES (the workspace's, or an app's with --app); values are never shown.";
|
|
7
|
+
static examples = ['revition secrets list', 'revition secrets list --app dapp_123 --json'];
|
|
8
|
+
static meta = {
|
|
9
|
+
id: 'secrets:list',
|
|
10
|
+
summary: SecretsListCommand.summary,
|
|
11
|
+
examples: SecretsListCommand.examples,
|
|
12
|
+
requiredScopes: ['cli:read'],
|
|
13
|
+
mutates: false,
|
|
14
|
+
confirm: 'none',
|
|
15
|
+
jsonSchemaId: 'revition.secrets.list.v1',
|
|
16
|
+
stability: 'stable',
|
|
17
|
+
};
|
|
18
|
+
static flags = {
|
|
19
|
+
app: Flags.string({ description: "An app's secrets (an independent developer's apps) instead of the workspace's." }),
|
|
20
|
+
env: Flags.string({ options: [...SECRET_ENVS], description: "The workspace secret's environment (dev, test, staging, prod); default prod." }),
|
|
21
|
+
};
|
|
22
|
+
async run2(ctx) {
|
|
23
|
+
const app = typeof ctx.commandFlags['app'] === 'string' ? ctx.commandFlags['app'] : null;
|
|
24
|
+
return listSecrets(await devApi(ctx), app, secretEnvOf(app, ctx.commandFlags['env']));
|
|
25
|
+
}
|
|
26
|
+
human(d) {
|
|
27
|
+
return {
|
|
28
|
+
text: renderTable(['name', 'updated'], d.names.map((n) => [n.name, n.updatedAt ?? '-']), terminalTable()),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/secrets/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAyD,MAAM,oBAAoB,CAAC;AAExI,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAoB,MAAM,8BAA8B,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CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC;SAC1G,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
interface Out {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly scope: 'workspace' | 'app';
|
|
5
|
+
readonly appId: string | null;
|
|
6
|
+
}
|
|
7
|
+
export default class SecretsSet extends RevitionCommand<Out> {
|
|
8
|
+
static summary: string;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static meta: CommandMeta;
|
|
11
|
+
static args: {
|
|
12
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
static flags: {
|
|
15
|
+
app: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
env: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
/** The cost of the first app secret (its store), shown before the confirmation when the platform passes one on. */
|
|
19
|
+
protected beforeConfirm(ctx: CommandContext): Promise<void>;
|
|
20
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
21
|
+
protected human(o: Out): HumanView;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { RevitionCommand } from '@revition/cli-core';
|
|
3
|
+
import { devApi } from '../../api.js';
|
|
4
|
+
import { listSecrets, putSecret, readSecretValue, SECRET_ENVS, secretEnvOf } from '../../secrets/secrets-api.js';
|
|
5
|
+
export default class SecretsSet extends RevitionCommand {
|
|
6
|
+
static summary = 'Set a runtime secret. The value comes from stdin or a hidden prompt, never from an argument.';
|
|
7
|
+
static examples = ['revition secrets set API_KEY', 'revition secrets set API_KEY --yes < key.txt', 'cat cert.pem | revition secrets set TLS_CERT --app dapp_123 --yes'];
|
|
8
|
+
static meta = {
|
|
9
|
+
id: 'secrets:set',
|
|
10
|
+
summary: SecretsSet.summary,
|
|
11
|
+
examples: SecretsSet.examples,
|
|
12
|
+
requiredScopes: ['cli:write'],
|
|
13
|
+
mutates: true,
|
|
14
|
+
confirm: 'prompt',
|
|
15
|
+
jsonSchemaId: 'revition.secrets.set.v1',
|
|
16
|
+
stability: 'stable',
|
|
17
|
+
};
|
|
18
|
+
// The NAME only: there is deliberately no flag or argument for the value (T1.3.6, T2.2.3 AC1).
|
|
19
|
+
static args = { name: Args.string({ required: true, description: 'The secret name.' }) };
|
|
20
|
+
static flags = {
|
|
21
|
+
app: Flags.string({ description: "An app's secret instead of the workspace's." }),
|
|
22
|
+
env: Flags.string({ options: [...SECRET_ENVS], description: "The workspace secret's environment (dev, test, staging, prod); default prod." }),
|
|
23
|
+
};
|
|
24
|
+
/** The cost of the first app secret (its store), shown before the confirmation when the platform passes one on. */
|
|
25
|
+
async beforeConfirm(ctx) {
|
|
26
|
+
const app = typeof ctx.commandFlags['app'] === 'string' ? ctx.commandFlags['app'] : null;
|
|
27
|
+
if (app === null)
|
|
28
|
+
return;
|
|
29
|
+
const cost = (await listSecrets(await devApi(ctx), app)).firstSetCost;
|
|
30
|
+
if (cost !== null)
|
|
31
|
+
ctx.io.err(`Your first secret creates your secret store: $${cost.monthlyUsd.toFixed(2)} a month (${cost.note}).\n`);
|
|
32
|
+
}
|
|
33
|
+
async run2(ctx) {
|
|
34
|
+
const name = String(ctx.args['name']);
|
|
35
|
+
const app = typeof ctx.commandFlags['app'] === 'string' ? ctx.commandFlags['app'] : null;
|
|
36
|
+
const env = secretEnvOf(app, ctx.commandFlags['env']);
|
|
37
|
+
const value = await readSecretValue(ctx);
|
|
38
|
+
await putSecret(await devApi(ctx), app, name, value, env);
|
|
39
|
+
return { name, scope: app === null ? 'workspace' : 'app', appId: app };
|
|
40
|
+
}
|
|
41
|
+
human(o) {
|
|
42
|
+
return { text: `Set ${o.name}${o.appId === null ? '' : ` for ${o.appId}`}.\n` };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/secrets/set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAyD,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAQjH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,eAAoB;IAC1D,MAAM,CAAU,OAAO,GAAG,8FAA8F,CAAC;IACzH,MAAM,CAAU,QAAQ,GAAG,CAAC,8BAA8B,EAAE,8CAA8C,EAAE,mEAAmE,CAAC,CAAC;IACjL,MAAM,CAAC,IAAI,GAAgB;QACzB,EAAE,EAAE,aAAa;QACjB,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,cAAc,EAAE,CAAC,WAAW,CAAC;QAC7B,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,QAAQ;QACjB,YAAY,EAAE,yBAAyB;QACvC,SAAS,EAAE,QAAQ;KACpB,CAAC;IACF,+FAA+F;IAC/F,MAAM,CAAU,IAAI,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC;IAClG,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,EAAE,KAAK,CAAC,MAA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CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC1D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACzE,CAAC;IAEkB,KAAK,CAAC,CAAM;QAC7B,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;IAClF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
interface Out {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly appId: string | null;
|
|
5
|
+
}
|
|
6
|
+
export default class SecretsUnset extends RevitionCommand<Out> {
|
|
7
|
+
static summary: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static meta: CommandMeta;
|
|
10
|
+
static args: {
|
|
11
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
static flags: {
|
|
14
|
+
app: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
env: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
18
|
+
protected human(o: Out): HumanView;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { RevitionCommand } from '@revition/cli-core';
|
|
3
|
+
import { devApi } from '../../api.js';
|
|
4
|
+
import { deleteSecret, SECRET_ENVS, secretEnvOf } from '../../secrets/secrets-api.js';
|
|
5
|
+
export default class SecretsUnset extends RevitionCommand {
|
|
6
|
+
static summary = 'Remove a runtime secret.';
|
|
7
|
+
static examples = ['revition secrets unset API_KEY', 'revition secrets unset API_KEY --app dapp_123 --yes'];
|
|
8
|
+
static meta = {
|
|
9
|
+
id: 'secrets:unset',
|
|
10
|
+
summary: SecretsUnset.summary,
|
|
11
|
+
examples: SecretsUnset.examples,
|
|
12
|
+
requiredScopes: ['cli:write'],
|
|
13
|
+
mutates: true,
|
|
14
|
+
confirm: 'prompt',
|
|
15
|
+
jsonSchemaId: 'revition.secrets.unset.v1',
|
|
16
|
+
stability: 'stable',
|
|
17
|
+
};
|
|
18
|
+
static args = { name: Args.string({ required: true, description: 'The secret name.' }) };
|
|
19
|
+
static flags = {
|
|
20
|
+
app: Flags.string({ description: "An app's secret instead of the workspace's." }),
|
|
21
|
+
env: Flags.string({ options: [...SECRET_ENVS], description: "The workspace secret's environment (dev, test, staging, prod); default prod." }),
|
|
22
|
+
};
|
|
23
|
+
async run2(ctx) {
|
|
24
|
+
const name = String(ctx.args['name']);
|
|
25
|
+
const app = typeof ctx.commandFlags['app'] === 'string' ? ctx.commandFlags['app'] : null;
|
|
26
|
+
await deleteSecret(await devApi(ctx), app, name, secretEnvOf(app, ctx.commandFlags['env']));
|
|
27
|
+
return { name, appId: app };
|
|
28
|
+
}
|
|
29
|
+
human(o) {
|
|
30
|
+
return { text: `Removed ${o.name}${o.appId === null ? '' : ` from ${o.appId}`}.\n` };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=unset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../src/commands/secrets/unset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EA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CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACzF,MAAM,YAAY,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5F,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAC9B,CAAC;IAEkB,KAAK,CAAC,CAAM;QAC7B,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;IACvF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
import { type Starter } from '../../api.js';
|
|
3
|
+
interface Out {
|
|
4
|
+
readonly starters: readonly Starter[];
|
|
5
|
+
}
|
|
6
|
+
export default class StartersList extends RevitionCommand<Out> {
|
|
7
|
+
static summary: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static meta: CommandMeta;
|
|
10
|
+
static flags: {
|
|
11
|
+
point: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
14
|
+
protected human(d: Out): HumanView;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { RevitionCommand, renderTable, terminalTable } from '@revition/cli-core';
|
|
3
|
+
import { devApi } from '../../api.js';
|
|
4
|
+
export default class StartersList extends RevitionCommand {
|
|
5
|
+
static summary = "List the platform's project starters.";
|
|
6
|
+
static examples = ['revition starters list', 'revition starters list --point scheduled_job --json'];
|
|
7
|
+
static meta = {
|
|
8
|
+
id: 'starters:list',
|
|
9
|
+
summary: StartersList.summary,
|
|
10
|
+
examples: StartersList.examples,
|
|
11
|
+
requiredScopes: ['cli:read'],
|
|
12
|
+
mutates: false,
|
|
13
|
+
confirm: 'none',
|
|
14
|
+
jsonSchemaId: 'revition.starters.list.v1',
|
|
15
|
+
stability: 'stable',
|
|
16
|
+
};
|
|
17
|
+
static flags = {
|
|
18
|
+
point: Flags.string({ description: 'Only the starters of this extension point.' }),
|
|
19
|
+
};
|
|
20
|
+
async run2(ctx) {
|
|
21
|
+
const api = await devApi(ctx);
|
|
22
|
+
const point = ctx.commandFlags['point'];
|
|
23
|
+
const query = typeof point === 'string' && point !== '' ? { extensionPoint: point } : undefined;
|
|
24
|
+
const body = (await api.request({ method: 'GET', path: '/dev/starters', ...(query === undefined ? {} : { query }) })).body;
|
|
25
|
+
return { starters: body.starters };
|
|
26
|
+
}
|
|
27
|
+
human(d) {
|
|
28
|
+
return {
|
|
29
|
+
text: renderTable(['id', 'title', 'extension point', 'language'], d.starters.map((s) => [s.id, s.title, s.extensionPoint, s.language]), terminalTable()),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/starters/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAyD,MAAM,oBAAoB,CAAC;AAExI,OAAO,EAAE,MAAM,EAAgB,MAAM,cAAc,CAAC;AAMpD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,eAAoB;IAC5D,MAAM,CAAU,OAAO,GAAG,uCAAuC,CAAC;IAClE,MAAM,CAAU,QAAQ,GAAG,CAAC,wBAAwB,E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,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EACpE,aAAa,EAAE,CAChB;SACF,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
interface Out {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly extensionPoint: string;
|
|
6
|
+
readonly language: string;
|
|
7
|
+
readonly files: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export default class StartersView extends RevitionCommand<Out> {
|
|
10
|
+
static summary: string;
|
|
11
|
+
static examples: string[];
|
|
12
|
+
static meta: CommandMeta;
|
|
13
|
+
static args: {
|
|
14
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
17
|
+
protected human(s: Out): HumanView;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { RevitionCommand } from '@revition/cli-core';
|
|
3
|
+
import { devApi, seg } from '../../api.js';
|
|
4
|
+
export default class StartersView extends RevitionCommand {
|
|
5
|
+
static summary = 'Show one starter and the files it creates.';
|
|
6
|
+
static examples = ['revition starters view hello-tool'];
|
|
7
|
+
static meta = {
|
|
8
|
+
id: 'starters:view',
|
|
9
|
+
summary: StartersView.summary,
|
|
10
|
+
examples: StartersView.examples,
|
|
11
|
+
requiredScopes: ['cli:read'],
|
|
12
|
+
mutates: false,
|
|
13
|
+
confirm: 'none',
|
|
14
|
+
jsonSchemaId: 'revition.starters.view.v1',
|
|
15
|
+
stability: 'stable',
|
|
16
|
+
};
|
|
17
|
+
static args = { id: Args.string({ required: true, description: 'The starter id (from `starters list`).' }) };
|
|
18
|
+
async run2(ctx) {
|
|
19
|
+
const api = await devApi(ctx);
|
|
20
|
+
const s = (await api.request({ method: 'GET', path: `/dev/starters/${seg(String(ctx.args['id']))}` })).body;
|
|
21
|
+
return { id: s.id, title: s.title, extensionPoint: s.extensionPoint, language: s.language, files: Object.keys(s.files ?? {}).sort() };
|
|
22
|
+
}
|
|
23
|
+
human(s) {
|
|
24
|
+
return { text: `${s.title} (${s.id})\nextension point: ${s.extensionPoint} language: ${s.language}\nfiles:\n${s.files.map((f) => ` ${f}`).join('\n')}\n` };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/commands/starters/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,eAAe,EAAyD,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,MAAM,EAAE,GAAG,EAAsB,MAAM,cAAc,CAAC;AAU/D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,eAAoB;IAC5D,MAAM,CAAU,OAAO,GAAG,4CAA4C,CAAC;IACvE,MAAM,CAAU,QAAQ,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjE,MAAM,CAAC,IAAI,GAAgB;QACzB,EAAE,EAAE,eAAe;QACnB,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,cAAc,EAAE,CAAC,UAAU,CAAC;QAC5B,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,2BAA2B;QACzC,SAAS,EAAE,QAAQ;KACpB,CAAC;IACF,MAAM,CAAU,IAAI,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC,EAAE,CAAC;IAE5G,KAAK,CAAC,IAAI,CAAC,GAAmB;QACtC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,CAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3H,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IACxI,CAAC;IAEkB,KAAK,CAAC,CAAM;QAC7B,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC,cAAc,eAAe,CAAC,CAAC,QAAQ,aAAa,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/J,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RevitionCommand, type CommandContext, type CommandMeta, type HumanView } from '@revition/cli-core';
|
|
2
|
+
import { type SubmissionView } from '../submit.js';
|
|
3
|
+
interface Out {
|
|
4
|
+
readonly appId: string;
|
|
5
|
+
readonly submissions: readonly SubmissionView[];
|
|
6
|
+
}
|
|
7
|
+
export default class SubmissionsList extends RevitionCommand<Out> {
|
|
8
|
+
static summary: string;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static meta: CommandMeta;
|
|
11
|
+
static flags: {
|
|
12
|
+
app: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
dir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
protected run2(ctx: CommandContext): Promise<Out>;
|
|
16
|
+
protected human(o: Out): HumanView;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { RevitionCommand, renderTable, terminalTable } from '@revition/cli-core';
|
|
3
|
+
import { devApi, seg } from '../../api.js';
|
|
4
|
+
import { appOf } from '../submit.js';
|
|
5
|
+
export default class SubmissionsList extends RevitionCommand {
|
|
6
|
+
static summary = "List an app's submitted versions and where each stands.";
|
|
7
|
+
static examples = ['revition submissions list', 'revition submissions list --app dapp_123 --json'];
|
|
8
|
+
static meta = {
|
|
9
|
+
id: 'submissions:list',
|
|
10
|
+
summary: SubmissionsList.summary,
|
|
11
|
+
examples: SubmissionsList.examples,
|
|
12
|
+
requiredScopes: ['cli:read'],
|
|
13
|
+
mutates: false,
|
|
14
|
+
confirm: 'none',
|
|
15
|
+
jsonSchemaId: 'revition.submissions.list.v1',
|
|
16
|
+
stability: 'stable',
|
|
17
|
+
};
|
|
18
|
+
static flags = {
|
|
19
|
+
app: Flags.string({ description: 'The app id (default: the linked app).' }),
|
|
20
|
+
dir: Flags.string({ description: 'The project directory (default: the current directory).' }),
|
|
21
|
+
};
|
|
22
|
+
async run2(ctx) {
|
|
23
|
+
const appId = appOf(ctx);
|
|
24
|
+
const api = await devApi(ctx);
|
|
25
|
+
return { appId, submissions: (await api.request({ method: 'GET', path: `/dev/apps/${seg(appId)}/submissions` })).body.submissions };
|
|
26
|
+
}
|
|
27
|
+
human(o) {
|
|
28
|
+
if (o.submissions.length === 0)
|
|
29
|
+
return { text: `No submissions for ${o.appId} yet. Run \`revition submit --version <x.y.z>\`.\n` };
|
|
30
|
+
return {
|
|
31
|
+
text: renderTable(['version', 'state', 'submitted', 'updated'], o.submissions.map((s) => [s.version, s.state === 'certified' ? 'certified (ready to publish)' : s.state, s.createdAt.slice(0, 10), s.updatedAt.slice(0, 10)]), terminalTable()),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/submissions/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAyD,MAAM,oBAAoB,CAAC;AAExI,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAuB,MAAM,cAAc,CAAC;AAO1D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,eAAoB;IAC/D,MAAM,CAAU,OAAO,GAAG,yDAAyD,CAAC;IACpF,MAAM,CAAU,QAAQ,GAAG,CAAC,2BAA2B,EAAE,iDAAiD,CAAC,CAAC;IAC5G,MAAM,CAAC,IAAI,GAAgB;QACzB,EAAE,EAAE,kBAAkB;QACtB,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,QAAQ,EAAE,eAAe,CAAC,QAAQ;QAClC,cAAc,EAAE,CAAC,UAAU,CAAC;QAC5B,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,8BAA8B;QAC5C,SAAS,EAAE,QAAQ;KACpB,CAAC;IACF,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,CA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