@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.
@@ -1,11 +1,11 @@
1
1
  // customers.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 registerCustomers(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("customers").description("Customers");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("create")
10
10
  .description("Create a customer")
11
11
  .option("--body <json>", "Request body as JSON string")
@@ -14,17 +14,16 @@ export function registerCustomers(parent: Command, ctx: CommandContext): void {
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/v2025-06/customers` + "\n");
23
22
  const result = await client.post(`/api/v2025-06/customers`, 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 customers")
30
29
  .option("--params <value>", "Query parameters for filtering, pagination, and sorting")
@@ -35,9 +34,9 @@ export function registerCustomers(parent: Command, ctx: CommandContext): void {
35
34
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/customers` + "\n");
36
35
  const result = await client.get(`/api/v2025-06/customers`, params);
37
36
  ctx.output(result);
38
- });
37
+ }), () => []);
39
38
 
40
- resource
39
+ declareInputs(resource
41
40
  .command("delete <id>")
42
41
  .description("Delete a customer")
43
42
  .action(async (id) => {
@@ -45,9 +44,9 @@ export function registerCustomers(parent: Command, ctx: CommandContext): void {
45
44
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/customers/${id}` + "\n");
46
45
  const result = await client.delete(`/api/v2025-06/customers/${id}`);
47
46
  ctx.output(result);
48
- });
47
+ }), () => []);
49
48
 
50
- resource
49
+ declareInputs(resource
51
50
  .command("get <id>")
52
51
  .description("Get a customer")
53
52
  .action(async (id) => {
@@ -55,9 +54,9 @@ export function registerCustomers(parent: Command, ctx: CommandContext): void {
55
54
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/customers/${id}` + "\n");
56
55
  const result = await client.get(`/api/v2025-06/customers/${id}`);
57
56
  ctx.output(result);
58
- });
57
+ }), () => []);
59
58
 
60
- resource
59
+ declareInputs(resource
61
60
  .command("update <id>")
62
61
  .description("Update a customer")
63
62
  .option("--body <json>", "Request body as JSON string")
@@ -66,17 +65,16 @@ export function registerCustomers(parent: Command, ctx: CommandContext): void {
66
65
  const client = await ctx.getClient();
67
66
  let body: unknown;
68
67
  if (opts.bodyFile) {
69
- const { readFileSync } = await import("fs");
70
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
68
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
71
69
  } else if (opts.body) {
72
70
  body = ctx.parseBody(opts.body);
73
71
  }
74
72
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/v2025-06/customers/${id}` + "\n");
75
73
  const result = await client.patch(`/api/v2025-06/customers/${id}`, body);
76
74
  ctx.output(result);
77
- });
75
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
78
76
 
79
- resource
77
+ declareInputs(resource
80
78
  .command("create-bulk")
81
79
  .description("Create multiple customers")
82
80
  .option("--body <json>", "Request body as JSON string")
@@ -85,17 +83,16 @@ export function registerCustomers(parent: Command, ctx: CommandContext): void {
85
83
  const client = await ctx.getClient();
86
84
  let body: unknown;
87
85
  if (opts.bodyFile) {
88
- const { readFileSync } = await import("fs");
89
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
86
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
90
87
  } else if (opts.body) {
91
88
  body = ctx.parseBody(opts.body);
92
89
  }
93
90
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/customers/bulk` + "\n");
94
91
  const result = await client.post(`/api/v2025-06/customers/bulk`, body);
95
92
  ctx.output(result);
96
- });
93
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
97
94
 
98
- resource
95
+ declareInputs(resource
99
96
  .command("delete-bulk")
100
97
  .description("Delete multiple customers")
101
98
  .option("--body <json>", "Request body as JSON string")
@@ -104,14 +101,13 @@ export function registerCustomers(parent: Command, ctx: CommandContext): void {
104
101
  const client = await ctx.getClient();
105
102
  let body: unknown;
106
103
  if (opts.bodyFile) {
107
- const { readFileSync } = await import("fs");
108
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
104
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
109
105
  } else if (opts.body) {
110
106
  body = ctx.parseBody(opts.body);
111
107
  }
112
108
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/customers/bulk` + "\n");
113
109
  const result = await client.delete(`/api/v2025-06/customers/bulk`, { body });
114
110
  ctx.output(result);
115
- });
111
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
116
112
 
117
113
  }
@@ -1,11 +1,11 @@
1
1
  // default.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 registerDefault(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("default").description("default");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("get-order-journey-events <order-id>")
10
10
  .description("Get order journey events")
11
11
  .action(async (orderId) => {
@@ -13,9 +13,9 @@ export function registerDefault(parent: Command, ctx: CommandContext): void {
13
13
  if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/${orderId}/journey/events` + "\n");
14
14
  const result = await client.get(`/api/v202506/orders/${orderId}/journey/events`);
15
15
  ctx.output(result);
16
- });
16
+ }), () => []);
17
17
 
18
- resource
18
+ declareInputs(resource
19
19
  .command("get-order-journey <order-id>")
20
20
  .description("Get an order journey")
21
21
  .action(async (orderId) => {
@@ -23,6 +23,6 @@ export function registerDefault(parent: Command, ctx: CommandContext): void {
23
23
  if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/${orderId}/journey` + "\n");
24
24
  const result = await client.get(`/api/v202506/orders/${orderId}/journey`);
25
25
  ctx.output(result);
26
- });
26
+ }), () => []);
27
27
 
28
28
  }
@@ -1,11 +1,11 @@
1
1
  // email-settings.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 registerEmailSettings(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("email-settings").description("Email Settings");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("get-company")
10
10
  .description("returns company email settings")
11
11
  .action(async () => {
@@ -13,9 +13,9 @@ export function registerEmailSettings(parent: Command, ctx: CommandContext): voi
13
13
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/company-email-settings` + "\n");
14
14
  const result = await client.get(`/api/v2025-06/company-email-settings`);
15
15
  ctx.output(result);
16
- });
16
+ }), () => []);
17
17
 
18
- resource
18
+ declareInputs(resource
19
19
  .command("update-company <id>")
20
20
  .description("updates company email settings")
21
21
  .option("--body <json>", "Request body as JSON string")
@@ -24,14 +24,13 @@ export function registerEmailSettings(parent: Command, ctx: CommandContext): voi
24
24
  const client = await ctx.getClient();
25
25
  let body: unknown;
26
26
  if (opts.bodyFile) {
27
- const { readFileSync } = await import("fs");
28
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
27
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
29
28
  } else if (opts.body) {
30
29
  body = ctx.parseBody(opts.body);
31
30
  }
32
31
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/v2025-06/company-email-settings/${id}` + "\n");
33
32
  const result = await client.patch(`/api/v2025-06/company-email-settings/${id}`, body);
34
33
  ctx.output(result);
35
- });
34
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
36
35
 
37
36
  }
@@ -1,11 +1,11 @@
1
1
  // enrollment-pack-media.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 registerEnrollmentPackMedia(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("enrollment-pack-media").description("EnrollmentPackMedia");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("list <enrollment-pack-id>")
10
10
  .description("List media associated with enrollment pack")
11
11
  .option("--page <value>", "page")
@@ -16,9 +16,9 @@ export function registerEnrollmentPackMedia(parent: Command, ctx: CommandContext
16
16
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/enrollment_packs/${enrollmentPackId}/media` + "\n");
17
17
  const result = await client.get(`/api/v2025-06/enrollment_packs/${enrollmentPackId}/media`, params);
18
18
  ctx.output(result);
19
- });
19
+ }), () => []);
20
20
 
21
- resource
21
+ declareInputs(resource
22
22
  .command("create <enrollment-pack-id>")
23
23
  .description("Associate media with enrollment pack")
24
24
  .option("--body <json>", "Request body as JSON string")
@@ -27,17 +27,16 @@ export function registerEnrollmentPackMedia(parent: Command, ctx: CommandContext
27
27
  const client = await ctx.getClient();
28
28
  let body: unknown;
29
29
  if (opts.bodyFile) {
30
- const { readFileSync } = await import("fs");
31
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
30
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
32
31
  } else if (opts.body) {
33
32
  body = ctx.parseBody(opts.body);
34
33
  }
35
34
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/enrollment_packs/${enrollmentPackId}/media` + "\n");
36
35
  const result = await client.post(`/api/v2025-06/enrollment_packs/${enrollmentPackId}/media`, body);
37
36
  ctx.output(result);
38
- });
37
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
39
38
 
40
- resource
39
+ declareInputs(resource
41
40
  .command("delete <enrollment-pack-id> <id>")
42
41
  .description("Medium removed from enrollment pack")
43
42
  .action(async (enrollmentPackId, id) => {
@@ -45,6 +44,6 @@ export function registerEnrollmentPackMedia(parent: Command, ctx: CommandContext
45
44
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/enrollment_packs/${enrollmentPackId}/media/${id}` + "\n");
46
45
  const result = await client.delete(`/api/v2025-06/enrollment_packs/${enrollmentPackId}/media/${id}`);
47
46
  ctx.output(result);
48
- });
47
+ }), () => []);
49
48
 
50
49
  }
@@ -1,11 +1,11 @@
1
1
  // fair-share-settings.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 registerFairShareSettings(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("fair-share-settings").description("Fair Share Settings");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("get")
10
10
  .description("Get Fair Share settings")
11
11
  .action(async () => {
@@ -13,9 +13,9 @@ export function registerFairShareSettings(parent: Command, ctx: CommandContext):
13
13
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/fairshare/settings` + "\n");
14
14
  const result = await client.get(`/api/v2025-06/fairshare/settings`);
15
15
  ctx.output(result);
16
- });
16
+ }), () => []);
17
17
 
18
- resource
18
+ declareInputs(resource
19
19
  .command("update")
20
20
  .description("Update Fair Share settings")
21
21
  .option("--body <json>", "Request body as JSON string")
@@ -24,14 +24,13 @@ export function registerFairShareSettings(parent: Command, ctx: CommandContext):
24
24
  const client = await ctx.getClient();
25
25
  let body: unknown;
26
26
  if (opts.bodyFile) {
27
- const { readFileSync } = await import("fs");
28
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
27
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
29
28
  } else if (opts.body) {
30
29
  body = ctx.parseBody(opts.body);
31
30
  }
32
31
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/v2025-06/fairshare/settings` + "\n");
33
32
  const result = await client.patch(`/api/v2025-06/fairshare/settings`, body);
34
33
  ctx.output(result);
35
- });
34
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
36
35
 
37
36
  }