airfoil 0.1.1 → 0.3.0

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.
Files changed (34) hide show
  1. package/dist/index.js +72253 -73199
  2. package/package.json +6 -7
  3. package/src/commands/cluster/data-lake/create-iceberg.ts +7 -7
  4. package/src/commands/cluster/data-lake/create-parquet.ts +7 -7
  5. package/src/commands/cluster/data-lake/create.ts +1 -1
  6. package/src/commands/cluster/data-lake/delete.ts +5 -5
  7. package/src/commands/cluster/data-lake/get.ts +5 -5
  8. package/src/commands/cluster/data-lake/list.ts +5 -5
  9. package/src/commands/cluster/index.ts +1 -1
  10. package/src/commands/cluster/namespace/create.ts +17 -17
  11. package/src/commands/cluster/namespace/delete.ts +5 -5
  12. package/src/commands/cluster/namespace/get.ts +5 -5
  13. package/src/commands/cluster/namespace/list.ts +5 -5
  14. package/src/commands/cluster/object-store/create-aws.ts +19 -21
  15. package/src/commands/cluster/object-store/create-azure.ts +16 -16
  16. package/src/commands/cluster/object-store/create-google.ts +16 -16
  17. package/src/commands/cluster/object-store/create-s3.ts +22 -21
  18. package/src/commands/cluster/object-store/create.ts +1 -1
  19. package/src/commands/cluster/object-store/delete.ts +5 -5
  20. package/src/commands/cluster/object-store/get.ts +5 -5
  21. package/src/commands/cluster/object-store/list.ts +5 -5
  22. package/src/commands/cluster/tenant/create.ts +5 -7
  23. package/src/commands/cluster/tenant/delete.ts +5 -5
  24. package/src/commands/cluster/tenant/get.ts +5 -5
  25. package/src/commands/cluster/tenant/list.ts +3 -3
  26. package/src/commands/cluster/topic/create.ts +69 -58
  27. package/src/commands/cluster/topic/delete.ts +8 -8
  28. package/src/commands/cluster/topic/get.ts +5 -5
  29. package/src/commands/cluster/topic/list.ts +10 -16
  30. package/src/commands/dev.ts +23 -23
  31. package/src/commands/sql.ts +17 -17
  32. package/src/index.ts +7 -5
  33. package/src/utils/client.ts +1 -1
  34. package/src/utils/options.ts +18 -17
@@ -1,33 +1,33 @@
1
1
  import { readFileSync } from "node:fs";
2
- import { ArrowFlightSqlClient } from "@airfoil/flight";
3
2
  import * as p from "@clack/prompts";
4
- import { Args, Command, Options } from "@effect/cli";
3
+ import { ArrowFlightSqlClient } from "@useairfoil/flight";
5
4
  import { printTable } from "console-table-printer";
6
5
  import { Effect, Option } from "effect";
6
+ import { Argument, Command, Flag } from "effect/unstable/cli";
7
7
  import { Metadata } from "nice-grpc-common";
8
8
  import { handleCliError } from "../utils/effect.js";
9
9
  import { hostOption, portOption } from "../utils/options.js";
10
10
 
11
- const queryArg = Args.text({ name: "query" }).pipe(
12
- Args.withDescription("SQL query to execute"),
13
- Args.optional,
11
+ const queryArg = Argument.string("query").pipe(
12
+ Argument.withDescription("SQL query to execute"),
13
+ Argument.optional,
14
14
  );
15
15
 
16
- const fileOption = Options.text("file").pipe(
17
- Options.withAlias("f"),
18
- Options.withDescription("Execute SQL from file"),
19
- Options.optional,
16
+ const fileOption = Flag.string("file").pipe(
17
+ Flag.withAlias("f"),
18
+ Flag.withDescription("Execute SQL from file"),
19
+ Flag.optional,
20
20
  );
21
21
 
22
- const namespaceOption = Options.text("namespace").pipe(
23
- Options.withAlias("n"),
24
- Options.withDescription("Wings namespace"),
25
- Options.withDefault("tenants/default/namespaces/default"),
22
+ const namespaceOption = Flag.string("namespace").pipe(
23
+ Flag.withAlias("n"),
24
+ Flag.withDescription("Wings namespace"),
25
+ Flag.withDefault("tenants/default/namespaces/default"),
26
26
  );
27
27
 
28
- const jsonOption = Options.boolean("json").pipe(
29
- Options.withDescription("Output results as JSON"),
30
- Options.withDefault(false),
28
+ const jsonOption = Flag.boolean("json").pipe(
29
+ Flag.withDescription("Output results as JSON"),
30
+ Flag.withDefault(false),
31
31
  );
32
32
 
33
33
  export const sqlCommand = Command.make(
@@ -117,5 +117,5 @@ export const sqlCommand = Command.make(
117
117
  }
118
118
  p.outro("✓ Done");
119
119
  });
120
- }).pipe(Effect.catchAll(handleCliError("Command failed"))),
120
+ }).pipe(Effect.catch(handleCliError("Command failed"))),
121
121
  ).pipe(Command.withDescription("Execute SQL queries using Arrow Flight SQL"));
package/src/index.ts CHANGED
@@ -1,18 +1,20 @@
1
1
  #!/usr/bin/env bun
2
- import { Command } from "@effect/cli";
3
- import { NodeContext, NodeRuntime } from "@effect/platform-node";
2
+ import { NodeRuntime, NodeServices } from "@effect/platform-node";
4
3
  import { Effect } from "effect";
4
+ import { Command } from "effect/unstable/cli";
5
+ import packageJson from "../package.json";
5
6
  import { clusterCommand } from "./commands/cluster/index.js";
6
7
  import { devCommand } from "./commands/dev.js";
7
8
  import { sqlCommand } from "./commands/sql.js";
8
9
 
10
+ const version = packageJson.version;
11
+
9
12
  const program = Command.make("airfoil", {}, () => Effect.void).pipe(
10
13
  Command.withSubcommands([devCommand, sqlCommand, clusterCommand]),
11
14
  );
12
15
 
13
16
  const cli = Command.run(program, {
14
- name: "Airfoil CLI - Manage your Wings deployments",
15
- version: "0.1.0",
17
+ version,
16
18
  });
17
19
 
18
- cli(process.argv).pipe(Effect.provide(NodeContext.layer), NodeRuntime.runMain);
20
+ cli.pipe(Effect.provide(NodeServices.layer), NodeRuntime.runMain);
@@ -1,4 +1,4 @@
1
- import { WingsClusterMetadata } from "@airfoil/wings";
1
+ import { WingsClusterMetadata } from "@useairfoil/wings";
2
2
 
3
3
  export const makeClusterMetadataLayer = (host: string, port: number) =>
4
4
  WingsClusterMetadata.layer({
@@ -1,36 +1,37 @@
1
- import { Options } from "@effect/cli";
1
+ import { Flag } from "effect/unstable/cli";
2
2
 
3
3
  /**
4
4
  * Common server connection options
5
5
  */
6
- export const hostOption = Options.text("host").pipe(
7
- Options.withDescription("Server host"),
8
- Options.withDefault("localhost"),
6
+ export const hostOption = Flag.string("host").pipe(
7
+ Flag.withDescription("Server host"),
8
+ Flag.withDefault("localhost"),
9
9
  );
10
10
 
11
- export const portOption = Options.integer("port").pipe(
12
- Options.withDescription("Server port"),
13
- Options.withAlias("p"),
14
- Options.withDefault(7777),
11
+ export const portOption = Flag.integer("port").pipe(
12
+ Flag.withDescription("Server port"),
13
+ Flag.withAlias("p"),
14
+ Flag.withDefault(7777),
15
15
  );
16
16
 
17
17
  /**
18
18
  * Common pagination options
19
19
  */
20
- export const pageSizeOption = Options.integer("page-size").pipe(
21
- Options.withDescription("Number of items to return (max: 1000)"),
22
- Options.withDefault(100),
20
+ export const pageSizeOption = Flag.integer("page-size").pipe(
21
+ Flag.withDescription("Number of items to return (max: 1000)"),
22
+ Flag.withDefault(100),
23
23
  );
24
24
 
25
- export const pageTokenOption = Options.text("page-token").pipe(
26
- Options.withDescription("Continuation token for pagination"),
27
- Options.optional,
25
+ export const pageTokenOption = Flag.optional(
26
+ Flag.string("page-token").pipe(
27
+ Flag.withDescription("Continuation token for pagination"),
28
+ ),
28
29
  );
29
30
 
30
31
  /**
31
32
  * Force flag for destructive operations
32
33
  */
33
- export const forceOption = Options.boolean("force").pipe(
34
- Options.withDescription("Skip confirmation prompt"),
35
- Options.withDefault(false),
34
+ export const forceOption = Flag.boolean("force").pipe(
35
+ Flag.withDescription("Skip confirmation prompt"),
36
+ Flag.withDefault(false),
36
37
  );