@bctrl/cli 0.1.4 → 0.1.6
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/commands/ai/index.js +29 -21
- package/dist/commands/api-key/index.js +10 -10
- package/dist/commands/browser-extension/index.js +18 -19
- package/dist/commands/file/index.js +17 -18
- package/dist/commands/help/index.js +3 -3
- package/dist/commands/proxy/index.js +26 -20
- package/dist/commands/run/index.js +44 -27
- package/dist/commands/runtime/index.js +159 -130
- package/dist/commands/shared/help.d.ts +1 -0
- package/dist/commands/shared/help.js +9 -5
- package/dist/commands/shared/operation.d.ts +83 -0
- package/dist/commands/shared/{rest.js → operation.js} +87 -46
- package/dist/commands/space/index.js +61 -52
- package/dist/commands/space/list.js +14 -13
- package/dist/commands/subaccount/index.js +35 -53
- package/dist/commands/tool/index.js +18 -20
- package/dist/commands/tool-call/index.js +5 -5
- package/dist/commands/toolset/index.js +11 -13
- package/dist/commands/usage/index.js +3 -3
- package/dist/commands/vault/index.js +23 -21
- package/dist/generated/help.d.ts +5990 -128
- package/dist/generated/help.js +7905 -221
- package/dist/generated/openapi-routes.d.ts +391 -0
- package/dist/generated/openapi-routes.js +100 -0
- package/dist/generated/openapi-types.d.ts +13830 -0
- package/dist/generated/openapi-types.js +5 -0
- package/dist/openapi.d.ts +20 -0
- package/dist/openapi.js +1 -0
- package/package.json +1 -1
- package/dist/commands/shared/rest.d.ts +0 -55
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CLI_OPENAPI_ROUTES } from './generated/openapi-routes.js';
|
|
2
|
+
import type { operations } from './generated/openapi-types.js';
|
|
3
|
+
export type CliOperationId = keyof typeof CLI_OPENAPI_ROUTES & keyof operations;
|
|
4
|
+
export type CliOperationQuery<OperationId extends CliOperationId> = operations[OperationId] extends {
|
|
5
|
+
parameters: {
|
|
6
|
+
query?: infer Query;
|
|
7
|
+
};
|
|
8
|
+
} ? NonNullable<Query> : never;
|
|
9
|
+
export type CliOperationPathParams<OperationId extends CliOperationId> = operations[OperationId] extends {
|
|
10
|
+
parameters: {
|
|
11
|
+
path?: infer PathParams;
|
|
12
|
+
};
|
|
13
|
+
} ? NonNullable<PathParams> : never;
|
|
14
|
+
export type CliOperationJsonBody<OperationId extends CliOperationId> = operations[OperationId] extends {
|
|
15
|
+
requestBody?: infer RequestBody;
|
|
16
|
+
} ? NonNullable<RequestBody> extends {
|
|
17
|
+
content: {
|
|
18
|
+
'application/json': infer Body;
|
|
19
|
+
};
|
|
20
|
+
} ? Body : never : never;
|
package/dist/openapi.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import type { BctrlApiClient } from '../../api/client.js';
|
|
3
|
-
import type { Factory } from '../../factory.js';
|
|
4
|
-
import type { IOStreams } from '../../io/streams.js';
|
|
5
|
-
import { type OutputFlags } from './output.js';
|
|
6
|
-
type ClientMethod = 'get' | 'post' | 'patch' | 'put' | 'delete';
|
|
7
|
-
export type ApiDeps = {
|
|
8
|
-
io: IOStreams;
|
|
9
|
-
apiClient: () => Promise<BctrlApiClient>;
|
|
10
|
-
};
|
|
11
|
-
export declare function pathTemplate(template: string, params: Record<string, string>): string;
|
|
12
|
-
export declare function addPaginationFlags(command: Command): Command;
|
|
13
|
-
export declare function addJsonBodyFlag(command: Command): Command;
|
|
14
|
-
export declare function requestAndPrint(deps: ApiDeps, method: ClientMethod, path: string, options?: {
|
|
15
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
16
|
-
body?: unknown;
|
|
17
|
-
idempotencyKey?: string;
|
|
18
|
-
output?: OutputFlags;
|
|
19
|
-
}): Promise<void>;
|
|
20
|
-
export declare function bodyFromInputOption(path: string | undefined): Promise<unknown>;
|
|
21
|
-
export declare function createListCommand(factory: Factory, config: {
|
|
22
|
-
name?: string;
|
|
23
|
-
description: string;
|
|
24
|
-
path: string;
|
|
25
|
-
query?: (options: Record<string, unknown>) => Record<string, string | number | boolean | undefined>;
|
|
26
|
-
configure?: (command: Command) => Command;
|
|
27
|
-
}): Command;
|
|
28
|
-
export declare function createViewCommand(factory: Factory, config: {
|
|
29
|
-
name?: string;
|
|
30
|
-
description: string;
|
|
31
|
-
path: string;
|
|
32
|
-
argName?: string;
|
|
33
|
-
configure?: (command: Command) => Command;
|
|
34
|
-
query?: (id: string, options: Record<string, unknown>) => Record<string, string | number | boolean | undefined>;
|
|
35
|
-
}): Command;
|
|
36
|
-
export declare function createDeleteCommand(factory: Factory, config: {
|
|
37
|
-
name?: string;
|
|
38
|
-
description: string;
|
|
39
|
-
path: string;
|
|
40
|
-
argNames?: string[];
|
|
41
|
-
configure?: (command: Command) => Command;
|
|
42
|
-
query?: (args: Record<string, string>, options: Record<string, unknown>) => Record<string, string | number | boolean | undefined>;
|
|
43
|
-
}): Command;
|
|
44
|
-
export declare function createJsonBodyCommand(factory: Factory, config: {
|
|
45
|
-
name: string;
|
|
46
|
-
description: string;
|
|
47
|
-
method: Exclude<ClientMethod, 'get' | 'delete'>;
|
|
48
|
-
path: string;
|
|
49
|
-
argNames?: string[];
|
|
50
|
-
configure?: (command: Command) => Command;
|
|
51
|
-
body?: (args: Record<string, string>, options: Record<string, unknown>) => Promise<unknown>;
|
|
52
|
-
query?: (args: Record<string, string>, options: Record<string, unknown>) => Record<string, string | number | boolean | undefined>;
|
|
53
|
-
}): Command;
|
|
54
|
-
export declare function outputFlags(options: Record<string, unknown>): OutputFlags;
|
|
55
|
-
export {};
|