automate.ax 0.1.3
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 +21 -0
- package/README.md +119 -0
- package/dist/automation/actions.d.ts +200 -0
- package/dist/automation/actions.d.ts.map +1 -0
- package/dist/automation/actions.js +286 -0
- package/dist/automation/automation.d.ts +16 -0
- package/dist/automation/automation.d.ts.map +1 -0
- package/dist/automation/automation.js +10 -0
- package/dist/automation/integrations.d.ts +63 -0
- package/dist/automation/integrations.d.ts.map +1 -0
- package/dist/automation/integrations.js +58 -0
- package/dist/automation/runtime.d.ts +73 -0
- package/dist/automation/runtime.d.ts.map +1 -0
- package/dist/automation/runtime.js +92 -0
- package/dist/automation/signal.d.ts +58 -0
- package/dist/automation/signal.d.ts.map +1 -0
- package/dist/automation/signal.js +80 -0
- package/dist/automation/subscribe.d.ts +10 -0
- package/dist/automation/subscribe.d.ts.map +1 -0
- package/dist/automation/subscribe.js +16 -0
- package/dist/cli/command-names.d.ts +46 -0
- package/dist/cli/command-names.d.ts.map +1 -0
- package/dist/cli/command-names.js +46 -0
- package/dist/cli/commands/accept.d.ts +20 -0
- package/dist/cli/commands/accept.d.ts.map +1 -0
- package/dist/cli/commands/accept.js +42 -0
- package/dist/cli/commands/debug.d.ts +4 -0
- package/dist/cli/commands/debug.d.ts.map +1 -0
- package/dist/cli/commands/debug.js +52 -0
- package/dist/cli/commands/deploy.d.ts +24 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -0
- package/dist/cli/commands/deploy.js +292 -0
- package/dist/cli/commands/login.d.ts +20 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +145 -0
- package/dist/cli/commands/logout.d.ts +4 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +32 -0
- package/dist/cli/commands/me.d.ts +4 -0
- package/dist/cli/commands/me.d.ts.map +1 -0
- package/dist/cli/commands/me.js +48 -0
- package/dist/cli/commands/org-api-key-create.d.ts +26 -0
- package/dist/cli/commands/org-api-key-create.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-create.js +51 -0
- package/dist/cli/commands/org-api-key-delete.d.ts +33 -0
- package/dist/cli/commands/org-api-key-delete.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-delete.js +57 -0
- package/dist/cli/commands/org-api-key-list.d.ts +16 -0
- package/dist/cli/commands/org-api-key-list.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-list.js +58 -0
- package/dist/cli/commands/org-api-key-rename.d.ts +32 -0
- package/dist/cli/commands/org-api-key-rename.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-rename.js +54 -0
- package/dist/cli/commands/org-api-key.d.ts +2 -0
- package/dist/cli/commands/org-api-key.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key.js +18 -0
- package/dist/cli/commands/org-billing.d.ts +16 -0
- package/dist/cli/commands/org-billing.d.ts.map +1 -0
- package/dist/cli/commands/org-billing.js +78 -0
- package/dist/cli/commands/org-create.d.ts +20 -0
- package/dist/cli/commands/org-create.d.ts.map +1 -0
- package/dist/cli/commands/org-create.js +64 -0
- package/dist/cli/commands/org-delete.d.ts +27 -0
- package/dist/cli/commands/org-delete.d.ts.map +1 -0
- package/dist/cli/commands/org-delete.js +53 -0
- package/dist/cli/commands/org-invite.d.ts +39 -0
- package/dist/cli/commands/org-invite.d.ts.map +1 -0
- package/dist/cli/commands/org-invite.js +66 -0
- package/dist/cli/commands/org-leave.d.ts +27 -0
- package/dist/cli/commands/org-leave.d.ts.map +1 -0
- package/dist/cli/commands/org-leave.js +56 -0
- package/dist/cli/commands/org-list.d.ts +4 -0
- package/dist/cli/commands/org-list.d.ts.map +1 -0
- package/dist/cli/commands/org-list.js +36 -0
- package/dist/cli/commands/org-remove.d.ts +33 -0
- package/dist/cli/commands/org-remove.d.ts.map +1 -0
- package/dist/cli/commands/org-remove.js +66 -0
- package/dist/cli/commands/org-rename.d.ts +26 -0
- package/dist/cli/commands/org-rename.d.ts.map +1 -0
- package/dist/cli/commands/org-rename.js +58 -0
- package/dist/cli/commands/org-show.d.ts +16 -0
- package/dist/cli/commands/org-show.d.ts.map +1 -0
- package/dist/cli/commands/org-show.js +48 -0
- package/dist/cli/commands/org-upgrade.d.ts +42 -0
- package/dist/cli/commands/org-upgrade.d.ts.map +1 -0
- package/dist/cli/commands/org-upgrade.js +171 -0
- package/dist/cli/commands/org.d.ts +2 -0
- package/dist/cli/commands/org.d.ts.map +1 -0
- package/dist/cli/commands/org.js +32 -0
- package/dist/cli/commands/project-create.d.ts +27 -0
- package/dist/cli/commands/project-create.d.ts.map +1 -0
- package/dist/cli/commands/project-create.js +61 -0
- package/dist/cli/commands/project-delete.d.ts +27 -0
- package/dist/cli/commands/project-delete.d.ts.map +1 -0
- package/dist/cli/commands/project-delete.js +55 -0
- package/dist/cli/commands/project-list.d.ts +17 -0
- package/dist/cli/commands/project-list.d.ts.map +1 -0
- package/dist/cli/commands/project-list.js +89 -0
- package/dist/cli/commands/project-rename.d.ts +26 -0
- package/dist/cli/commands/project-rename.d.ts.map +1 -0
- package/dist/cli/commands/project-rename.js +60 -0
- package/dist/cli/commands/project-show.d.ts +16 -0
- package/dist/cli/commands/project-show.d.ts.map +1 -0
- package/dist/cli/commands/project-show.js +37 -0
- package/dist/cli/commands/project.d.ts +2 -0
- package/dist/cli/commands/project.d.ts.map +1 -0
- package/dist/cli/commands/project.js +20 -0
- package/dist/cli/index.d.ts +19 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +63 -0
- package/dist/cli/lib/api-client.d.ts +3 -0
- package/dist/cli/lib/api-client.d.ts.map +1 -0
- package/dist/cli/lib/api-client.js +14 -0
- package/dist/cli/lib/auth-client.d.ts +80 -0
- package/dist/cli/lib/auth-client.d.ts.map +1 -0
- package/dist/cli/lib/auth-client.js +61 -0
- package/dist/cli/lib/automation-build.d.ts +30 -0
- package/dist/cli/lib/automation-build.d.ts.map +1 -0
- package/dist/cli/lib/automation-build.js +90 -0
- package/dist/cli/lib/config-dir.d.ts +47 -0
- package/dist/cli/lib/config-dir.d.ts.map +1 -0
- package/dist/cli/lib/config-dir.js +146 -0
- package/dist/cli/lib/detail-block.d.ts +16 -0
- package/dist/cli/lib/detail-block.d.ts.map +1 -0
- package/dist/cli/lib/detail-block.js +25 -0
- package/dist/cli/lib/env.d.ts +4 -0
- package/dist/cli/lib/env.d.ts.map +1 -0
- package/dist/cli/lib/env.js +7 -0
- package/dist/cli/lib/hijack-clack-logger.d.ts +2 -0
- package/dist/cli/lib/hijack-clack-logger.d.ts.map +1 -0
- package/dist/cli/lib/hijack-clack-logger.js +8 -0
- package/dist/cli/lib/io.d.ts +19 -0
- package/dist/cli/lib/io.d.ts.map +1 -0
- package/dist/cli/lib/io.js +87 -0
- package/dist/cli/lib/json-output.d.ts +9 -0
- package/dist/cli/lib/json-output.d.ts.map +1 -0
- package/dist/cli/lib/json-output.js +12 -0
- package/dist/cli/lib/organization-detail-block.d.ts +30 -0
- package/dist/cli/lib/organization-detail-block.d.ts.map +1 -0
- package/dist/cli/lib/organization-detail-block.js +72 -0
- package/dist/cli/lib/project-config.d.ts +10 -0
- package/dist/cli/lib/project-config.d.ts.map +1 -0
- package/dist/cli/lib/project-config.js +21 -0
- package/dist/cli/lib/spinner.d.ts +18 -0
- package/dist/cli/lib/spinner.d.ts.map +1 -0
- package/dist/cli/lib/spinner.js +111 -0
- package/dist/cli/usage.d.ts +9 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +468 -0
- package/dist/cli/utils.d.ts +291 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +561 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +5 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +9 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/package.json +92 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { type TextOptions } from "@clack/prompts";
|
|
2
|
+
import { z, type ZodType } from "zod";
|
|
3
|
+
import { authClient } from "./lib/auth-client.js";
|
|
4
|
+
import { type ConfigDirMatch } from "./lib/config-dir.js";
|
|
5
|
+
export declare const SESSION_PATH: string;
|
|
6
|
+
export declare const REASONABLE_NAME_SCHEMA: z.ZodString;
|
|
7
|
+
export declare const ORG_OPT: {
|
|
8
|
+
org: {
|
|
9
|
+
type: "string";
|
|
10
|
+
description: string;
|
|
11
|
+
alias: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const API_KEY_OPT: {
|
|
15
|
+
key: {
|
|
16
|
+
type: "string";
|
|
17
|
+
description: string;
|
|
18
|
+
alias: string[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const PROJECT_OPT: {
|
|
22
|
+
project: {
|
|
23
|
+
type: "string";
|
|
24
|
+
description: string;
|
|
25
|
+
alias: string[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const CLI_PREFIX: string;
|
|
29
|
+
/** Reads and validates the saved CLI session token. */
|
|
30
|
+
export declare function loadSavedTokenSync(): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Persists the session token to disk for use by subsequent CLI commands.
|
|
33
|
+
*
|
|
34
|
+
* @param token - Bearer token to save.
|
|
35
|
+
*/
|
|
36
|
+
export declare function saveTokenSync(token: string): void;
|
|
37
|
+
/** Removes the saved CLI session token. */
|
|
38
|
+
export declare function clearSavedTokenSync(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Makes an option nullable only when the CLI can ask for it interactively.
|
|
41
|
+
*
|
|
42
|
+
* @param schema - Schema for the option's explicit value.
|
|
43
|
+
* @param optionName - Human-readable option name used in validation errors.
|
|
44
|
+
*/
|
|
45
|
+
export declare function promptableOption<T extends z.ZodType>(schema: T, optionName?: string): z.ZodPrefault<z.ZodNullable<T>>;
|
|
46
|
+
/**
|
|
47
|
+
* Runs an interactive prompt and handles cancellation consistently.
|
|
48
|
+
*
|
|
49
|
+
* @param promptFactory - Function that starts the prompt.
|
|
50
|
+
* @param optionName - Explicit option users can pass in non-interactive mode.
|
|
51
|
+
* @throws {Error} When prompting is unavailable.
|
|
52
|
+
*/
|
|
53
|
+
export declare function safelyPrompt<T>(promptFactory: () => Promise<T | symbol>, optionName?: string): Promise<T>;
|
|
54
|
+
/**
|
|
55
|
+
* Prompts for text, displays schema validation errors, and parses the result.
|
|
56
|
+
*
|
|
57
|
+
* @param promptOptions - Text prompt labels and defaults.
|
|
58
|
+
* @param schema - Schema used to validate and transform the response.
|
|
59
|
+
* @param optionName - Explicit option users can pass instead of prompting.
|
|
60
|
+
*/
|
|
61
|
+
export declare function safelyPromptTextWithValidation<T extends ZodType>(promptOptions: TextOptions, schema: T, optionName?: string): Promise<z.output<T>>;
|
|
62
|
+
/**
|
|
63
|
+
* Converts an error into the CLI's stable JSON error envelope.
|
|
64
|
+
*
|
|
65
|
+
* @param error - Error to serialize.
|
|
66
|
+
*/
|
|
67
|
+
export declare function formatJsonError(error: unknown): {
|
|
68
|
+
error: {
|
|
69
|
+
formErrors: string[];
|
|
70
|
+
fieldErrors: {};
|
|
71
|
+
message: string;
|
|
72
|
+
};
|
|
73
|
+
} | {
|
|
74
|
+
error: {
|
|
75
|
+
message: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Writes a serialized CLI error to stderr.
|
|
80
|
+
*
|
|
81
|
+
* @param error - Error to serialize and write.
|
|
82
|
+
*/
|
|
83
|
+
export declare function writeJsonError(error: unknown): void;
|
|
84
|
+
export declare const output: {
|
|
85
|
+
normal: (printFn: () => unknown) => /*elided*/ any;
|
|
86
|
+
json: (value: unknown) => /*elided*/ any;
|
|
87
|
+
};
|
|
88
|
+
export interface UseSessionOptions {
|
|
89
|
+
/** If true, will sign in anonymously if not signed in. Defaults to true. */
|
|
90
|
+
signInAnonymously?: boolean;
|
|
91
|
+
}
|
|
92
|
+
type UseSessionReturnType = Awaited<ReturnType<typeof authClient.getSession>>;
|
|
93
|
+
/**
|
|
94
|
+
* Reads the current session without creating an anonymous fallback.
|
|
95
|
+
*
|
|
96
|
+
* @param opts - Session options with anonymous sign-in disabled.
|
|
97
|
+
*/
|
|
98
|
+
export declare function useSession(opts: UseSessionOptions & {
|
|
99
|
+
signInAnonymously: false;
|
|
100
|
+
}): Promise<UseSessionReturnType>;
|
|
101
|
+
/**
|
|
102
|
+
* Reads the current session, creating an anonymous one when necessary.
|
|
103
|
+
*
|
|
104
|
+
* @param opts - Session options allowing anonymous sign-in.
|
|
105
|
+
*/
|
|
106
|
+
export declare function useSession(opts?: UseSessionOptions & {
|
|
107
|
+
signInAnonymously?: true;
|
|
108
|
+
}): Promise<NonNullable<UseSessionReturnType>>;
|
|
109
|
+
/** Session identity accepted by the CLI banner. */
|
|
110
|
+
type SessionArg = {
|
|
111
|
+
user: {
|
|
112
|
+
email: string;
|
|
113
|
+
isAnonymous?: boolean | null | undefined;
|
|
114
|
+
};
|
|
115
|
+
} | null | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Prints the CLI banner and current authentication identity.
|
|
118
|
+
*
|
|
119
|
+
* @param session - Session whose identity should be displayed.
|
|
120
|
+
* @param options - Intro display options.
|
|
121
|
+
* @param options.skipAnonWarning - Whether to suppress the anonymous-user
|
|
122
|
+
* warning.
|
|
123
|
+
*/
|
|
124
|
+
export declare function sessionIntro(session: SessionArg, { skipAnonWarning }?: {
|
|
125
|
+
skipAnonWarning?: boolean;
|
|
126
|
+
}): void;
|
|
127
|
+
/**
|
|
128
|
+
* Requires a real user session. Anonymous sessions can bootstrap local flows,
|
|
129
|
+
* but organization management needs an authenticated account.
|
|
130
|
+
*
|
|
131
|
+
* @param action - User-facing action that requires authentication.
|
|
132
|
+
* @throws {Error} When the current user is signed out or anonymous.
|
|
133
|
+
*/
|
|
134
|
+
export declare function requireAuthenticatedSession(action: string): Promise<import("./lib/auth-client").CliAuthSession>;
|
|
135
|
+
/** Shared schema fragment for commands that operate on an organization. */
|
|
136
|
+
export declare const orgOptsSchema: z.ZodObject<{
|
|
137
|
+
org: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
/** Shared schema fragment for commands that select an organization API key. */
|
|
140
|
+
export declare const apiKeyOptsSchema: z.ZodObject<{
|
|
141
|
+
org: z.ZodOptional<z.ZodString>;
|
|
142
|
+
key: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
type OrgList = {
|
|
145
|
+
id: string;
|
|
146
|
+
name: string;
|
|
147
|
+
plan?: string | null;
|
|
148
|
+
}[];
|
|
149
|
+
export interface UseOrganizationOptions {
|
|
150
|
+
/** What to do when the current user belongs to no organizations. */
|
|
151
|
+
whenEmpty?: "error" | "prompt-create" | "create";
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Resolves an organization from CLI flags or interactive prompt. Precedence:
|
|
155
|
+
* `--org` flag > auto-select (single org) > prompt. Callers opt into inline
|
|
156
|
+
* creation so destructive/update flows don't create empty organizations.
|
|
157
|
+
*
|
|
158
|
+
* @param opts - Parsed organization CLI options.
|
|
159
|
+
* @param options - Empty-organization behavior options.
|
|
160
|
+
* @param options.whenEmpty - Behavior when the user belongs to no
|
|
161
|
+
* organizations.
|
|
162
|
+
*/
|
|
163
|
+
export declare function useOrganization(opts: z.infer<typeof orgOptsSchema>, { whenEmpty }?: UseOrganizationOptions): Promise<{
|
|
164
|
+
id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* Resolves an API key owned by an organization from `--key` or an interactive
|
|
169
|
+
* prompt.
|
|
170
|
+
*
|
|
171
|
+
* @param organizationId - Organization whose API keys may be selected.
|
|
172
|
+
* @param opts - Parsed API key selector.
|
|
173
|
+
*/
|
|
174
|
+
export declare function useOrganizationApiKey(organizationId: string, opts: z.infer<typeof apiKeyOptsSchema>): Promise<{
|
|
175
|
+
id: string;
|
|
176
|
+
name: string | null;
|
|
177
|
+
start: string | null;
|
|
178
|
+
createdAt: Date;
|
|
179
|
+
updatedAt: Date;
|
|
180
|
+
expiresAt: Date | null;
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* Selects an existing organization without offering creation.
|
|
184
|
+
*
|
|
185
|
+
* @param organizations - Organizations available for selection.
|
|
186
|
+
* @param options - Prompt options with creation disabled.
|
|
187
|
+
* @param options.allowCreate - Disables inline organization creation.
|
|
188
|
+
*/
|
|
189
|
+
export declare function promptOrg<T extends {
|
|
190
|
+
name: string;
|
|
191
|
+
id: string;
|
|
192
|
+
}>(organizations: T[], options: {
|
|
193
|
+
allowCreate: false;
|
|
194
|
+
}): Promise<T>;
|
|
195
|
+
/**
|
|
196
|
+
* Selects an organization and optionally offers inline creation.
|
|
197
|
+
*
|
|
198
|
+
* @param organizations - Organizations available for selection.
|
|
199
|
+
* @param options - Prompt options.
|
|
200
|
+
* @param options.allowCreate - Whether to offer inline organization creation.
|
|
201
|
+
*/
|
|
202
|
+
export declare function promptOrg(organizations: OrgList, options: {
|
|
203
|
+
allowCreate: boolean;
|
|
204
|
+
}): Promise<OrgList[number]>;
|
|
205
|
+
/**
|
|
206
|
+
* Selects an organization, offering inline creation by default.
|
|
207
|
+
*
|
|
208
|
+
* @param organizations - Organizations available for selection.
|
|
209
|
+
* @param options - Optional prompt behavior.
|
|
210
|
+
* @param options.allowCreate - Whether to offer inline organization creation.
|
|
211
|
+
*/
|
|
212
|
+
export declare function promptOrg(organizations: OrgList, options?: {
|
|
213
|
+
allowCreate?: true;
|
|
214
|
+
}): Promise<OrgList[number]>;
|
|
215
|
+
/**
|
|
216
|
+
* Asks whether to create the user's first organization, then creates it.
|
|
217
|
+
*
|
|
218
|
+
* @throws {Error} When the user declines creation.
|
|
219
|
+
*/
|
|
220
|
+
export declare function promptCreateOrganization(): Promise<{
|
|
221
|
+
id: string;
|
|
222
|
+
name: string;
|
|
223
|
+
}>;
|
|
224
|
+
/** Shared schema fragment for commands that operate on a project. */
|
|
225
|
+
export declare const projectOptsSchema: z.ZodObject<{
|
|
226
|
+
project: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
/** Shared schema fragment for commands that operate on a config directory. */
|
|
229
|
+
export declare const configDirOptsSchema: z.ZodObject<{
|
|
230
|
+
dir: z.ZodOptional<z.ZodString>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
export interface UseProjectOptions {
|
|
233
|
+
/** Whether project resolution may create a project interactively. */
|
|
234
|
+
mode?: "select" | "select-or-create";
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Resolves a project from CLI flags or interactive prompt. Fetches all projects
|
|
238
|
+
* across all orgs so the user doesn't need to specify an org. Precedence:
|
|
239
|
+
* `--project` flag > auto-select (single project) > prompt (with inline
|
|
240
|
+
* creation).
|
|
241
|
+
*
|
|
242
|
+
* @param opts - Parsed project CLI options.
|
|
243
|
+
* @param options - Project resolution behavior.
|
|
244
|
+
* @param options.mode - Whether interactive project creation is allowed.
|
|
245
|
+
*/
|
|
246
|
+
export declare function useProject(opts: z.infer<typeof projectOptsSchema>, { mode }?: UseProjectOptions): Promise<{
|
|
247
|
+
id: string;
|
|
248
|
+
name: string;
|
|
249
|
+
organizationId: string;
|
|
250
|
+
createdAt: Date;
|
|
251
|
+
createdBy: string | null;
|
|
252
|
+
org: {
|
|
253
|
+
id: string;
|
|
254
|
+
name: string;
|
|
255
|
+
};
|
|
256
|
+
}>;
|
|
257
|
+
/**
|
|
258
|
+
* Resolves the config directory from a positional directory or config search.
|
|
259
|
+
* Precedence: explicit directory > current directory > nearest parent >
|
|
260
|
+
* downward search. Multiple downward matches are selected interactively.
|
|
261
|
+
*
|
|
262
|
+
* @param opts - Parsed config-directory CLI options.
|
|
263
|
+
*/
|
|
264
|
+
export declare function useConfigDir(opts: z.infer<typeof configDirOptsSchema>): Promise<ConfigDirMatch>;
|
|
265
|
+
/**
|
|
266
|
+
* Creates a Citty runner for a command without parsed options.
|
|
267
|
+
*
|
|
268
|
+
* @param optsSchema - `null` because the command accepts no options.
|
|
269
|
+
* @param cb - Command handler to invoke.
|
|
270
|
+
*/
|
|
271
|
+
export declare function createCommandRun(optsSchema: null, cb: () => Promise<void>): (ctx: {
|
|
272
|
+
args: unknown;
|
|
273
|
+
}) => Promise<void>;
|
|
274
|
+
/**
|
|
275
|
+
* Creates a Citty runner that parses command options before handling them.
|
|
276
|
+
*
|
|
277
|
+
* @param optsSchema - Schema for parsing Citty arguments.
|
|
278
|
+
* @param cb - Command handler receiving parsed options.
|
|
279
|
+
*/
|
|
280
|
+
export declare function createCommandRun<T extends ZodType>(optsSchema: T, cb: (opts: z.infer<T>) => Promise<void>): (ctx: {
|
|
281
|
+
args: unknown;
|
|
282
|
+
}) => Promise<void>;
|
|
283
|
+
/**
|
|
284
|
+
* Selects a simple English singular or plural word form.
|
|
285
|
+
*
|
|
286
|
+
* @param count - Quantity determining which form to use.
|
|
287
|
+
* @param singularWord - Singular noun to pluralize when needed.
|
|
288
|
+
*/
|
|
289
|
+
export declare function pluralize(count: number, singularWord: string): string;
|
|
290
|
+
export {};
|
|
291
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/cli/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAKvB,OAAO,EAAE,CAAC,EAAY,KAAK,OAAO,EAAE,MAAM,KAAK,CAAA;AAG/C,OAAO,EAAE,UAAU,EAAE,6BAAyB;AAG9C,OAAO,EAGL,KAAK,cAAc,EACpB,4BAAwB;AAGzB,eAAO,MAAM,YAAY,QAAoD,CAAA;AAE7E,eAAO,MAAM,sBAAsB,aAAoC,CAAA;AAEvE,eAAO,MAAM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