@aouda/client 0.0.1
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 +151 -0
- package/dist/cli/index.cjs +5906 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +52 -0
- package/dist/cli/index.d.ts +52 -0
- package/dist/cli/index.js +5875 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client-DXT2ZAeO.d.cts +3356 -0
- package/dist/client-DXT2ZAeO.d.ts +3356 -0
- package/dist/index.cjs +5535 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +196 -0
- package/dist/index.d.ts +196 -0
- package/dist/index.js +5460 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { A as AoudaClient } from '../client-DXT2ZAeO.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI for @aouda/client.
|
|
5
|
+
* Entry point for `npx @aouda/client generate ...`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface CliOptions {
|
|
9
|
+
/** Override stdout for testing */
|
|
10
|
+
stdout?: NodeJS.WritableStream;
|
|
11
|
+
/** Override stderr for testing */
|
|
12
|
+
stderr?: NodeJS.WritableStream;
|
|
13
|
+
/** Override client factory for testing */
|
|
14
|
+
createClient?: (serverUrl: string, database: string) => AoudaClient;
|
|
15
|
+
/** Override file write for testing (e.g. to simulate write errors) */
|
|
16
|
+
writeFile?: (filePath: string, content: string) => void;
|
|
17
|
+
/** Override cwd for schema discovery (testing) */
|
|
18
|
+
cwd?: string;
|
|
19
|
+
}
|
|
20
|
+
type SchemaSubcommand = "diff" | "apply" | "export" | "validate" | "history" | "seed";
|
|
21
|
+
interface ParsedArgs {
|
|
22
|
+
command: "generate" | "schema" | "help";
|
|
23
|
+
server?: string;
|
|
24
|
+
database?: string;
|
|
25
|
+
output?: string;
|
|
26
|
+
comments: boolean;
|
|
27
|
+
schema: boolean;
|
|
28
|
+
namespace?: string;
|
|
29
|
+
schemaSubcommand?: SchemaSubcommand;
|
|
30
|
+
schemaFile?: string;
|
|
31
|
+
schemaEnv?: string;
|
|
32
|
+
allowDestructive?: boolean;
|
|
33
|
+
dryRun?: boolean;
|
|
34
|
+
json?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parses process.argv-style argument list.
|
|
38
|
+
* @param args - Typically process.argv.slice(2)
|
|
39
|
+
* @returns Parsed options; command is "help" if --help/-h or unknown command
|
|
40
|
+
*/
|
|
41
|
+
declare function parseArgs(args: string[]): ParsedArgs;
|
|
42
|
+
/**
|
|
43
|
+
* Runs the CLI with the given argument list.
|
|
44
|
+
* Used by the binary entry point and by tests.
|
|
45
|
+
*
|
|
46
|
+
* @param args - Argument list (e.g. process.argv.slice(2))
|
|
47
|
+
* @param options - Optional overrides for stdout, stderr, and client factory
|
|
48
|
+
* @returns Exit code (0 on success, 1 on failure)
|
|
49
|
+
*/
|
|
50
|
+
declare function run(args: string[], options?: CliOptions): Promise<number>;
|
|
51
|
+
|
|
52
|
+
export { type CliOptions, type ParsedArgs, type SchemaSubcommand, parseArgs, run };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { A as AoudaClient } from '../client-DXT2ZAeO.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLI for @aouda/client.
|
|
5
|
+
* Entry point for `npx @aouda/client generate ...`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface CliOptions {
|
|
9
|
+
/** Override stdout for testing */
|
|
10
|
+
stdout?: NodeJS.WritableStream;
|
|
11
|
+
/** Override stderr for testing */
|
|
12
|
+
stderr?: NodeJS.WritableStream;
|
|
13
|
+
/** Override client factory for testing */
|
|
14
|
+
createClient?: (serverUrl: string, database: string) => AoudaClient;
|
|
15
|
+
/** Override file write for testing (e.g. to simulate write errors) */
|
|
16
|
+
writeFile?: (filePath: string, content: string) => void;
|
|
17
|
+
/** Override cwd for schema discovery (testing) */
|
|
18
|
+
cwd?: string;
|
|
19
|
+
}
|
|
20
|
+
type SchemaSubcommand = "diff" | "apply" | "export" | "validate" | "history" | "seed";
|
|
21
|
+
interface ParsedArgs {
|
|
22
|
+
command: "generate" | "schema" | "help";
|
|
23
|
+
server?: string;
|
|
24
|
+
database?: string;
|
|
25
|
+
output?: string;
|
|
26
|
+
comments: boolean;
|
|
27
|
+
schema: boolean;
|
|
28
|
+
namespace?: string;
|
|
29
|
+
schemaSubcommand?: SchemaSubcommand;
|
|
30
|
+
schemaFile?: string;
|
|
31
|
+
schemaEnv?: string;
|
|
32
|
+
allowDestructive?: boolean;
|
|
33
|
+
dryRun?: boolean;
|
|
34
|
+
json?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parses process.argv-style argument list.
|
|
38
|
+
* @param args - Typically process.argv.slice(2)
|
|
39
|
+
* @returns Parsed options; command is "help" if --help/-h or unknown command
|
|
40
|
+
*/
|
|
41
|
+
declare function parseArgs(args: string[]): ParsedArgs;
|
|
42
|
+
/**
|
|
43
|
+
* Runs the CLI with the given argument list.
|
|
44
|
+
* Used by the binary entry point and by tests.
|
|
45
|
+
*
|
|
46
|
+
* @param args - Argument list (e.g. process.argv.slice(2))
|
|
47
|
+
* @param options - Optional overrides for stdout, stderr, and client factory
|
|
48
|
+
* @returns Exit code (0 on success, 1 on failure)
|
|
49
|
+
*/
|
|
50
|
+
declare function run(args: string[], options?: CliOptions): Promise<number>;
|
|
51
|
+
|
|
52
|
+
export { type CliOptions, type ParsedArgs, type SchemaSubcommand, parseArgs, run };
|