@fluid-app/v2025-06-cli-commands 0.1.337 → 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
  // media-enrollment-packs.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 registerMediaEnrollmentPacks(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("media-enrollment-packs").description("MediaEnrollmentPacks");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("list <media-id>")
10
10
  .description("List enrollment_packs associated with media")
11
11
  .option("--page <value>", "page")
@@ -16,9 +16,9 @@ export function registerMediaEnrollmentPacks(parent: Command, ctx: CommandContex
16
16
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/media/${mediaId}/enrollment_packs` + "\n");
17
17
  const result = await client.get(`/api/v2025-06/media/${mediaId}/enrollment_packs`, params);
18
18
  ctx.output(result);
19
- });
19
+ }), () => []);
20
20
 
21
- resource
21
+ declareInputs(resource
22
22
  .command("create <media-id>")
23
23
  .description("Associate enrollment_pack with media")
24
24
  .option("--body <json>", "Request body as JSON string")
@@ -27,17 +27,16 @@ export function registerMediaEnrollmentPacks(parent: Command, ctx: CommandContex
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/media/${mediaId}/enrollment_packs` + "\n");
36
35
  const result = await client.post(`/api/v2025-06/media/${mediaId}/enrollment_packs`, 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 <media-id> <id>")
42
41
  .description("Enrollment Pack removed from media")
43
42
  .action(async (mediaId, id) => {
@@ -45,6 +44,6 @@ export function registerMediaEnrollmentPacks(parent: Command, ctx: CommandContex
45
44
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/media/${mediaId}/enrollment_packs/${id}` + "\n");
46
45
  const result = await client.delete(`/api/v2025-06/media/${mediaId}/enrollment_packs/${id}`);
47
46
  ctx.output(result);
48
- });
47
+ }), () => []);
49
48
 
50
49
  }
@@ -1,11 +1,11 @@
1
1
  // media-products.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 registerMediaProducts(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("media-products").description("MediaProducts");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("list <media-id>")
10
10
  .description("List products associated with media")
11
11
  .option("--page <value>", "page")
@@ -16,9 +16,9 @@ export function registerMediaProducts(parent: Command, ctx: CommandContext): voi
16
16
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/media/${mediaId}/products` + "\n");
17
17
  const result = await client.get(`/api/v2025-06/media/${mediaId}/products`, params);
18
18
  ctx.output(result);
19
- });
19
+ }), () => []);
20
20
 
21
- resource
21
+ declareInputs(resource
22
22
  .command("create <media-id>")
23
23
  .description("Associate product with media")
24
24
  .option("--body <json>", "Request body as JSON string")
@@ -27,17 +27,16 @@ export function registerMediaProducts(parent: Command, ctx: CommandContext): voi
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/media/${mediaId}/products` + "\n");
36
35
  const result = await client.post(`/api/v2025-06/media/${mediaId}/products`, 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 <media-id> <id>")
42
41
  .description("Product removed from media")
43
42
  .action(async (mediaId, id) => {
@@ -45,6 +44,6 @@ export function registerMediaProducts(parent: Command, ctx: CommandContext): voi
45
44
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/media/${mediaId}/products/${id}` + "\n");
46
45
  const result = await client.delete(`/api/v2025-06/media/${mediaId}/products/${id}`);
47
46
  ctx.output(result);
48
- });
47
+ }), () => []);
49
48
 
50
49
  }
@@ -1,11 +1,11 @@
1
1
  // orders.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 registerOrders(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("orders").description("Orders");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("export-csv")
10
10
  .description("Export orders as CSV")
11
11
  .option("--params <value>", "Query parameters for CSV export")
@@ -16,9 +16,9 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
16
16
  if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/export_csv` + "\n");
17
17
  const result = await client.get(`/api/v202506/orders/export_csv`, params);
18
18
  ctx.output(result);
19
- });
19
+ }), () => []);
20
20
 
21
- resource
21
+ declareInputs(resource
22
22
  .command("list")
23
23
  .description("List orders")
24
24
  .option("--params <value>", "Query parameters for filtering, pagination, and sorting")
@@ -29,9 +29,9 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
29
29
  if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders` + "\n");
30
30
  const result = await client.get(`/api/v202506/orders`, params);
31
31
  ctx.output(result);
32
- });
32
+ }), () => []);
33
33
 
34
- resource
34
+ declareInputs(resource
35
35
  .command("get <id>")
36
36
  .description("Get an order")
37
37
  .action(async (id) => {
@@ -39,9 +39,9 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
39
39
  if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/${id}` + "\n");
40
40
  const result = await client.get(`/api/v202506/orders/${id}`);
41
41
  ctx.output(result);
42
- });
42
+ }), () => []);
43
43
 
44
- resource
44
+ declareInputs(resource
45
45
  .command("get-stats")
46
46
  .description("Get order statistics")
47
47
  .option("--params <value>", "Query parameters for filtering statistics")
@@ -52,6 +52,6 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
52
52
  if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/stats` + "\n");
53
53
  const result = await client.get(`/api/v202506/orders/stats`, params);
54
54
  ctx.output(result);
55
- });
55
+ }), () => []);
56
56
 
57
57
  }
@@ -1,11 +1,11 @@
1
1
  // partner-tokens.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 registerPartnerTokens(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("partner-tokens").description("Partner Tokens");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("list-deprecated")
10
10
  .description("returns an array of partner tokens")
11
11
  .action(async () => {
@@ -13,9 +13,9 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
13
13
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/partner_tokens` + "\n");
14
14
  const result = await client.get(`/api/v2025-06/partner_tokens`);
15
15
  ctx.output(result);
16
- });
16
+ }), () => []);
17
17
 
18
- resource
18
+ declareInputs(resource
19
19
  .command("create-deprecated")
20
20
  .description("creates a new partner token")
21
21
  .option("--body <json>", "Request body as JSON string")
@@ -24,17 +24,16 @@ export function registerPartnerTokens(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("POST " + `/api/v2025-06/partner_tokens` + "\n");
33
32
  const result = await client.post(`/api/v2025-06/partner_tokens`, body);
34
33
  ctx.output(result);
35
- });
34
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
36
35
 
37
- resource
36
+ declareInputs(resource
38
37
  .command("get-deprecated <id>")
39
38
  .description("returns a specific partner token")
40
39
  .action(async (id) => {
@@ -42,9 +41,9 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
42
41
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/partner_tokens/${id}` + "\n");
43
42
  const result = await client.get(`/api/v2025-06/partner_tokens/${id}`);
44
43
  ctx.output(result);
45
- });
44
+ }), () => []);
46
45
 
47
- resource
46
+ declareInputs(resource
48
47
  .command("update-deprecated <id>")
49
48
  .description("updates a partner token")
50
49
  .option("--body <json>", "Request body as JSON string")
@@ -53,17 +52,16 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
53
52
  const client = await ctx.getClient();
54
53
  let body: unknown;
55
54
  if (opts.bodyFile) {
56
- const { readFileSync } = await import("fs");
57
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
55
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
58
56
  } else if (opts.body) {
59
57
  body = ctx.parseBody(opts.body);
60
58
  }
61
59
  if (ctx.verbose) process.stderr.write("PUT " + `/api/v2025-06/partner_tokens/${id}` + "\n");
62
60
  const result = await client.put(`/api/v2025-06/partner_tokens/${id}`, body);
63
61
  ctx.output(result);
64
- });
62
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
65
63
 
66
- resource
64
+ declareInputs(resource
67
65
  .command("delete-deprecated <id>")
68
66
  .description("deletes a partner token")
69
67
  .action(async (id) => {
@@ -71,9 +69,9 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
71
69
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/partner_tokens/${id}` + "\n");
72
70
  const result = await client.delete(`/api/v2025-06/partner_tokens/${id}`);
73
71
  ctx.output(result);
74
- });
72
+ }), () => []);
75
73
 
76
- resource
74
+ declareInputs(resource
77
75
  .command("list")
78
76
  .description("returns an array of partner tokens")
79
77
  .action(async () => {
@@ -81,9 +79,9 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
81
79
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/tokens/partner` + "\n");
82
80
  const result = await client.get(`/api/v2025-06/tokens/partner`);
83
81
  ctx.output(result);
84
- });
82
+ }), () => []);
85
83
 
86
- resource
84
+ declareInputs(resource
87
85
  .command("create")
88
86
  .description("creates a new partner token")
89
87
  .option("--body <json>", "Request body as JSON string")
@@ -92,17 +90,16 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
92
90
  const client = await ctx.getClient();
93
91
  let body: unknown;
94
92
  if (opts.bodyFile) {
95
- const { readFileSync } = await import("fs");
96
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
93
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
97
94
  } else if (opts.body) {
98
95
  body = ctx.parseBody(opts.body);
99
96
  }
100
97
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/tokens/partner` + "\n");
101
98
  const result = await client.post(`/api/v2025-06/tokens/partner`, body);
102
99
  ctx.output(result);
103
- });
100
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
104
101
 
105
- resource
102
+ declareInputs(resource
106
103
  .command("get <id>")
107
104
  .description("returns a specific partner token")
108
105
  .action(async (id) => {
@@ -110,9 +107,9 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
110
107
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/tokens/partner/${id}` + "\n");
111
108
  const result = await client.get(`/api/v2025-06/tokens/partner/${id}`);
112
109
  ctx.output(result);
113
- });
110
+ }), () => []);
114
111
 
115
- resource
112
+ declareInputs(resource
116
113
  .command("update <id>")
117
114
  .description("updates a partner token")
118
115
  .option("--body <json>", "Request body as JSON string")
@@ -121,17 +118,16 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
121
118
  const client = await ctx.getClient();
122
119
  let body: unknown;
123
120
  if (opts.bodyFile) {
124
- const { readFileSync } = await import("fs");
125
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
121
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
126
122
  } else if (opts.body) {
127
123
  body = ctx.parseBody(opts.body);
128
124
  }
129
125
  if (ctx.verbose) process.stderr.write("PUT " + `/api/v2025-06/tokens/partner/${id}` + "\n");
130
126
  const result = await client.put(`/api/v2025-06/tokens/partner/${id}`, body);
131
127
  ctx.output(result);
132
- });
128
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
133
129
 
134
- resource
130
+ declareInputs(resource
135
131
  .command("delete <id>")
136
132
  .description("deletes a partner token")
137
133
  .action(async (id) => {
@@ -139,6 +135,6 @@ export function registerPartnerTokens(parent: Command, ctx: CommandContext): voi
139
135
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/tokens/partner/${id}` + "\n");
140
136
  const result = await client.delete(`/api/v2025-06/tokens/partner/${id}`);
141
137
  ctx.output(result);
142
- });
138
+ }), () => []);
143
139
 
144
140
  }
@@ -1,11 +1,11 @@
1
1
  // playlists.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 registerPlaylists(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("playlists").description("Playlists");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("clone <playlist-id>")
10
10
  .description("Clone a playlist")
11
11
  .option("--body <json>", "Request body as JSON string")
@@ -14,17 +14,16 @@ export function registerPlaylists(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/playlists/${playlistId}/clone` + "\n");
23
22
  const result = await client.post(`/api/v2025-06/playlists/${playlistId}/clone`, 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("add-items <playlist-id>")
29
28
  .description("add items to playlist")
30
29
  .option("--body <json>", "Request body as JSON string")
@@ -33,17 +32,16 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
33
32
  const client = await ctx.getClient();
34
33
  let body: unknown;
35
34
  if (opts.bodyFile) {
36
- const { readFileSync } = await import("fs");
37
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
35
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
38
36
  } else if (opts.body) {
39
37
  body = ctx.parseBody(opts.body);
40
38
  }
41
39
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/playlists/${playlistId}/items` + "\n");
42
40
  const result = await client.post(`/api/v2025-06/playlists/${playlistId}/items`, body);
43
41
  ctx.output(result);
44
- });
42
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
45
43
 
46
- resource
44
+ declareInputs(resource
47
45
  .command("remove-items <playlist-id>")
48
46
  .description("remove items from playlist")
49
47
  .option("--body <json>", "Request body as JSON string")
@@ -52,17 +50,16 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
52
50
  const client = await ctx.getClient();
53
51
  let body: unknown;
54
52
  if (opts.bodyFile) {
55
- const { readFileSync } = await import("fs");
56
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
53
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
57
54
  } else if (opts.body) {
58
55
  body = ctx.parseBody(opts.body);
59
56
  }
60
57
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/playlists/${playlistId}/items` + "\n");
61
58
  const result = await client.delete(`/api/v2025-06/playlists/${playlistId}/items`, { body });
62
59
  ctx.output(result);
63
- });
60
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
64
61
 
65
- resource
62
+ declareInputs(resource
66
63
  .command("create")
67
64
  .description("create playlist")
68
65
  .option("--body <json>", "Request body as JSON string")
@@ -71,17 +68,16 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
71
68
  const client = await ctx.getClient();
72
69
  let body: unknown;
73
70
  if (opts.bodyFile) {
74
- const { readFileSync } = await import("fs");
75
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
71
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
76
72
  } else if (opts.body) {
77
73
  body = ctx.parseBody(opts.body);
78
74
  }
79
75
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/playlists` + "\n");
80
76
  const result = await client.post(`/api/v2025-06/playlists`, body);
81
77
  ctx.output(result);
82
- });
78
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
83
79
 
84
- resource
80
+ declareInputs(resource
85
81
  .command("list")
86
82
  .description("list playlists")
87
83
  .option("--page-cursor <value>", "Cursor for pagination")
@@ -98,9 +94,9 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
98
94
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/playlists` + "\n");
99
95
  const result = await client.get(`/api/v2025-06/playlists`, params);
100
96
  ctx.output(result);
101
- });
97
+ }), () => []);
102
98
 
103
- resource
99
+ declareInputs(resource
104
100
  .command("delete <id>")
105
101
  .description("delete playlist")
106
102
  .action(async (id) => {
@@ -108,9 +104,9 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
108
104
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/playlists/${id}` + "\n");
109
105
  const result = await client.delete(`/api/v2025-06/playlists/${id}`);
110
106
  ctx.output(result);
111
- });
107
+ }), () => []);
112
108
 
113
- resource
109
+ declareInputs(resource
114
110
  .command("get <id>")
115
111
  .description("show playlist")
116
112
  .action(async (id) => {
@@ -118,9 +114,9 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
118
114
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/playlists/${id}` + "\n");
119
115
  const result = await client.get(`/api/v2025-06/playlists/${id}`);
120
116
  ctx.output(result);
121
- });
117
+ }), () => []);
122
118
 
123
- resource
119
+ declareInputs(resource
124
120
  .command("update <id>")
125
121
  .description("update playlist")
126
122
  .option("--body <json>", "Request body as JSON string")
@@ -129,17 +125,16 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
129
125
  const client = await ctx.getClient();
130
126
  let body: unknown;
131
127
  if (opts.bodyFile) {
132
- const { readFileSync } = await import("fs");
133
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
128
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
134
129
  } else if (opts.body) {
135
130
  body = ctx.parseBody(opts.body);
136
131
  }
137
132
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/v2025-06/playlists/${id}` + "\n");
138
133
  const result = await client.patch(`/api/v2025-06/playlists/${id}`, body);
139
134
  ctx.output(result);
140
- });
135
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
141
136
 
142
- resource
137
+ declareInputs(resource
143
138
  .command("get-shareable-items")
144
139
  .description("search shareable items")
145
140
  .option("--type <value>", "Type of resource to search for ('Page', 'Product', 'Promotion', 'EnrollmentPack', 'Medium')")
@@ -154,6 +149,6 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
154
149
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/playlists/shareables` + "\n");
155
150
  const result = await client.get(`/api/v2025-06/playlists/shareables`, params);
156
151
  ctx.output(result);
157
- });
152
+ }), () => []);
158
153
 
159
154
  }
@@ -1,11 +1,11 @@
1
1
  // product-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 registerProductMedia(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("product-media").description("ProductMedia");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("list <product-id>")
10
10
  .description("List media associated with product")
11
11
  .option("--page <value>", "page")
@@ -16,9 +16,9 @@ export function registerProductMedia(parent: Command, ctx: CommandContext): void
16
16
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/products/${productId}/media` + "\n");
17
17
  const result = await client.get(`/api/v2025-06/products/${productId}/media`, params);
18
18
  ctx.output(result);
19
- });
19
+ }), () => []);
20
20
 
21
- resource
21
+ declareInputs(resource
22
22
  .command("create <product-id>")
23
23
  .description("Associate media with product")
24
24
  .option("--body <json>", "Request body as JSON string")
@@ -27,17 +27,16 @@ export function registerProductMedia(parent: Command, ctx: CommandContext): void
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/products/${productId}/media` + "\n");
36
35
  const result = await client.post(`/api/v2025-06/products/${productId}/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 <product-id> <id>")
42
41
  .description("Media removed from product")
43
42
  .action(async (productId, id) => {
@@ -45,6 +44,6 @@ export function registerProductMedia(parent: Command, ctx: CommandContext): void
45
44
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/products/${productId}/media/${id}` + "\n");
46
45
  const result = await client.delete(`/api/v2025-06/products/${productId}/media/${id}`);
47
46
  ctx.output(result);
48
- });
47
+ }), () => []);
49
48
 
50
49
  }