@ductape/cli 0.5.3 → 0.5.5

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.
@@ -1,4 +1,8 @@
1
1
  import { type CommandInteractiveFlags } from '../lib/interactive-opts.js';
2
+ export declare function runAppVersions(opts: {
3
+ id: string;
4
+ profile?: string;
5
+ }): Promise<void>;
2
6
  export declare function runAppVersionRename(opts: {
3
7
  id: string;
4
8
  from: string;
@@ -2,10 +2,13 @@ import { schemaKeyForEntity } from '../lib/forms/index.js';
2
2
  import { isInteractive, promptTag } from '../lib/forms/prompt.js';
3
3
  import { toInteractiveOpts } from '../lib/interactive-opts.js';
4
4
  import { bodyRequiredHint, resolveBody } from '../lib/read-body.js';
5
- import { createApp, deleteApp, getApp, listApps, updateApp, updateAppViaProxy, } from '../lib/platform-api.js';
5
+ import { createApp, deleteApp, getApp, getAppVersions, listApps, updateApp, updateAppViaProxy, } from '../lib/platform-api.js';
6
6
  import { printJson } from '../lib/output.js';
7
7
  import { requireWorkspaceContext } from '../lib/workspace-context.js';
8
8
  const VERBS = ['list', 'get', 'create', 'update', 'delete'];
9
+ export async function runAppVersions(opts) {
10
+ printJson(await getAppVersions(requireWorkspaceContext({ profile: opts.profile }), opts.id), true);
11
+ }
9
12
  export async function runAppVersionRename(opts) {
10
13
  if (!opts.from || !opts.to || opts.from === opts.to ||
11
14
  opts.from.trim() !== opts.from || opts.to.trim() !== opts.to) {
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ import { runWorkspacesCurrent, runWorkspacesList, runWorkspacesRefresh, runWorks
33
33
  import { runGeneratePayload, runGenerateSnippet } from './commands/generate.js';
34
34
  import { runCompletion } from './commands/completion.js';
35
35
  import { runProducts, runProductApps, runProductAppActions, runProductComponents, runProductEnvironments } from './commands/products.js';
36
- import { runApps, runAppVersionRename } from './commands/apps.js';
36
+ import { runApps, runAppVersionRename, runAppVersions } from './commands/apps.js';
37
37
  import { runAppsImport } from './commands/apps-import.js';
38
38
  import { runAppActions } from './commands/app-actions.js';
39
39
  import { registerAppWebhooks } from './commands/app-webhooks.js';
@@ -773,6 +773,12 @@ const apps = program
773
773
  throw new Error('Specify a verb: list | get | create | update | delete');
774
774
  return runApps(verb, opts, []);
775
775
  }));
776
+ apps.command('versions')
777
+ .description('Fetch lightweight version metadata without actions, webhooks or credentials')
778
+ .requiredOption('--id <id>', 'App ID')
779
+ .option('--profile <name>')
780
+ .option('--json', 'JSON output')
781
+ .action(wrap((opts) => runAppVersions(opts)));
776
782
  apps.command('rename-version')
777
783
  .description('Rename a version label atomically without changing its contents')
778
784
  .requiredOption('--id <id>', 'App ID')
@@ -24,6 +24,7 @@ export declare function getApp(ctx: WorkspaceContext, opts: {
24
24
  tag?: string;
25
25
  }): Promise<unknown>;
26
26
  export declare function createApp(ctx: WorkspaceContext, body: Record<string, unknown>): Promise<unknown>;
27
+ export declare function getAppVersions(ctx: WorkspaceContext, appId: string): Promise<unknown>;
27
28
  export declare function updateApp(ctx: WorkspaceContext, appId: string, body: Record<string, unknown>): Promise<unknown>;
28
29
  export declare function updateAppViaProxy(ctx: WorkspaceContext, tag: string, body: Record<string, unknown>): Promise<unknown>;
29
30
  export declare function deleteApp(ctx: WorkspaceContext, appId: string): Promise<unknown>;
@@ -428,6 +428,9 @@ export async function createApp(ctx, body) {
428
428
  const result = await client(ctx).post('/apps/v1/create', payload);
429
429
  return unwrapOne(result);
430
430
  }
431
+ export async function getAppVersions(ctx, appId) {
432
+ return unwrapOne(await client(ctx).getPath(`/apps/v1/${appId}/versions/metadata`, workspaceAuthQuery(ctx)));
433
+ }
431
434
  export async function updateApp(ctx, appId, body) {
432
435
  const q = workspaceAuthQuery(ctx);
433
436
  const result = await client(ctx).put(`/apps/v1/${appId}?${new URLSearchParams(q).toString()}`, { component: 'app', ...body });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/cli",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "Ductape CLI — local platform, login, link projects, and manage resources via the proxy (Workbench-compatible)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",