@fluid-app/v2025-06-cli-commands 0.1.336 → 0.1.338

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-app/v2025-06-cli-commands",
3
- "version": "0.1.336",
3
+ "version": "0.1.338",
4
4
  "description": "Auto-generated CLI commands for Fluid v2025-06 API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -17,7 +17,7 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@fluid-app/fluid-cli": "0.1.348",
20
+ "@fluid-app/fluid-cli": "0.1.350",
21
21
  "commander": "^12.0.0"
22
22
  },
23
23
  "devDependencies": {
@@ -1,11 +1,11 @@
1
1
  // company-contacts.ts — AUTO-GENERATED, DO NOT EDIT
2
2
  import { Command } from "commander";
3
- import type { CommandContext } from "../lib/types.js";
3
+ import { declareInputs, type CommandContext } from "../lib/types.js";
4
4
 
5
5
  export function registerCompanyContacts(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("company-contacts").description("Company Contacts");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("create")
10
10
  .description("Create a company contact")
11
11
  .option("--body <json>", "Request body as JSON string")
@@ -14,17 +14,16 @@ export function registerCompanyContacts(parent: Command, ctx: CommandContext): v
14
14
  const client = await ctx.getClient();
15
15
  let body: unknown;
16
16
  if (opts.bodyFile) {
17
- const { readFileSync } = await import("fs");
18
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
17
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
19
18
  } else if (opts.body) {
20
19
  body = ctx.parseBody(opts.body);
21
20
  }
22
21
  if (ctx.verbose) process.stderr.write("POST " + `/api/company/contacts` + "\n");
23
22
  const result = await client.post(`/api/company/contacts`, body);
24
23
  ctx.output(result);
25
- });
24
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
26
25
 
27
- resource
26
+ declareInputs(resource
28
27
  .command("list")
29
28
  .description("List company contacts")
30
29
  .option("--page <value>", "Page number for pagination")
@@ -43,9 +42,9 @@ export function registerCompanyContacts(parent: Command, ctx: CommandContext): v
43
42
  if (ctx.verbose) process.stderr.write("GET " + `/api/company/contacts` + "\n");
44
43
  const result = await client.get(`/api/company/contacts`, params);
45
44
  ctx.output(result);
46
- });
45
+ }), () => []);
47
46
 
48
- resource
47
+ declareInputs(resource
49
48
  .command("delete <id>")
50
49
  .description("Delete a company contact")
51
50
  .action(async (id) => {
@@ -53,9 +52,9 @@ export function registerCompanyContacts(parent: Command, ctx: CommandContext): v
53
52
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/company/contacts/${id}` + "\n");
54
53
  const result = await client.delete(`/api/company/contacts/${id}`);
55
54
  ctx.output(result);
56
- });
55
+ }), () => []);
57
56
 
58
- resource
57
+ declareInputs(resource
59
58
  .command("get <id>")
60
59
  .description("Get a company contact")
61
60
  .action(async (id) => {
@@ -63,9 +62,9 @@ export function registerCompanyContacts(parent: Command, ctx: CommandContext): v
63
62
  if (ctx.verbose) process.stderr.write("GET " + `/api/company/contacts/${id}` + "\n");
64
63
  const result = await client.get(`/api/company/contacts/${id}`);
65
64
  ctx.output(result);
66
- });
65
+ }), () => []);
67
66
 
68
- resource
67
+ declareInputs(resource
69
68
  .command("update <id>")
70
69
  .description("Update a company contact")
71
70
  .option("--body <json>", "Request body as JSON string")
@@ -74,14 +73,13 @@ export function registerCompanyContacts(parent: Command, ctx: CommandContext): v
74
73
  const client = await ctx.getClient();
75
74
  let body: unknown;
76
75
  if (opts.bodyFile) {
77
- const { readFileSync } = await import("fs");
78
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
76
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
79
77
  } else if (opts.body) {
80
78
  body = ctx.parseBody(opts.body);
81
79
  }
82
80
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/company/contacts/${id}` + "\n");
83
81
  const result = await client.patch(`/api/company/contacts/${id}`, body);
84
82
  ctx.output(result);
85
- });
83
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
86
84
 
87
85
  }