@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
  // widgets.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 registerWidgets(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("widgets").description("Widgets");
7
7
 
8
- resource
8
+ declareInputs(resource
9
9
  .command("create-banner")
10
10
  .description("Create a banner widget")
11
11
  .option("--body <json>", "Request body as JSON string")
@@ -14,17 +14,16 @@ export function registerWidgets(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/widgets/banners` + "\n");
23
22
  const result = await client.post(`/api/v2025-06/widgets/banners`, 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-banner")
29
28
  .description("List banner widgets")
30
29
  .option("--filter-status <value>", "Filter banner widgets by status")
@@ -47,9 +46,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
47
46
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/banners` + "\n");
48
47
  const result = await client.get(`/api/v2025-06/widgets/banners`, params);
49
48
  ctx.output(result);
50
- });
49
+ }), () => []);
51
50
 
52
- resource
51
+ declareInputs(resource
53
52
  .command("delete-banner <id>")
54
53
  .description("Delete a banner widget")
55
54
  .action(async (id) => {
@@ -57,9 +56,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
57
56
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/widgets/banners/${id}` + "\n");
58
57
  const result = await client.delete(`/api/v2025-06/widgets/banners/${id}`);
59
58
  ctx.output(result);
60
- });
59
+ }), () => []);
61
60
 
62
- resource
61
+ declareInputs(resource
63
62
  .command("get-banner <id>")
64
63
  .description("Get a banner widget")
65
64
  .action(async (id) => {
@@ -67,9 +66,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
67
66
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/banners/${id}` + "\n");
68
67
  const result = await client.get(`/api/v2025-06/widgets/banners/${id}`);
69
68
  ctx.output(result);
70
- });
69
+ }), () => []);
71
70
 
72
- resource
71
+ declareInputs(resource
73
72
  .command("update-banner <id>")
74
73
  .description("Update a banner widget")
75
74
  .option("--body <json>", "Request body as JSON string")
@@ -78,17 +77,16 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
78
77
  const client = await ctx.getClient();
79
78
  let body: unknown;
80
79
  if (opts.bodyFile) {
81
- const { readFileSync } = await import("fs");
82
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
80
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
83
81
  } else if (opts.body) {
84
82
  body = ctx.parseBody(opts.body);
85
83
  }
86
84
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/v2025-06/widgets/banners/${id}` + "\n");
87
85
  const result = await client.patch(`/api/v2025-06/widgets/banners/${id}`, body);
88
86
  ctx.output(result);
89
- });
87
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
90
88
 
91
- resource
89
+ declareInputs(resource
92
90
  .command("create-cart")
93
91
  .description("Create a cart widget")
94
92
  .option("--body <json>", "Request body as JSON string")
@@ -97,17 +95,16 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
97
95
  const client = await ctx.getClient();
98
96
  let body: unknown;
99
97
  if (opts.bodyFile) {
100
- const { readFileSync } = await import("fs");
101
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
98
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
102
99
  } else if (opts.body) {
103
100
  body = ctx.parseBody(opts.body);
104
101
  }
105
102
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/widgets/carts` + "\n");
106
103
  const result = await client.post(`/api/v2025-06/widgets/carts`, body);
107
104
  ctx.output(result);
108
- });
105
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
109
106
 
110
- resource
107
+ declareInputs(resource
111
108
  .command("list-cart")
112
109
  .description("List cart widgets")
113
110
  .option("--filter-status <value>", "Filter cart widgets by status")
@@ -128,9 +125,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
128
125
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/carts` + "\n");
129
126
  const result = await client.get(`/api/v2025-06/widgets/carts`, params);
130
127
  ctx.output(result);
131
- });
128
+ }), () => []);
132
129
 
133
- resource
130
+ declareInputs(resource
134
131
  .command("delete-cart <id>")
135
132
  .description("Delete a cart widget")
136
133
  .action(async (id) => {
@@ -138,9 +135,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
138
135
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/widgets/carts/${id}` + "\n");
139
136
  const result = await client.delete(`/api/v2025-06/widgets/carts/${id}`);
140
137
  ctx.output(result);
141
- });
138
+ }), () => []);
142
139
 
143
- resource
140
+ declareInputs(resource
144
141
  .command("get-cart <id>")
145
142
  .description("Show a cart widget")
146
143
  .action(async (id) => {
@@ -148,9 +145,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
148
145
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/carts/${id}` + "\n");
149
146
  const result = await client.get(`/api/v2025-06/widgets/carts/${id}`);
150
147
  ctx.output(result);
151
- });
148
+ }), () => []);
152
149
 
153
- resource
150
+ declareInputs(resource
154
151
  .command("update-cart <id>")
155
152
  .description("Update a cart widget")
156
153
  .option("--body <json>", "Request body as JSON string")
@@ -159,17 +156,16 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
159
156
  const client = await ctx.getClient();
160
157
  let body: unknown;
161
158
  if (opts.bodyFile) {
162
- const { readFileSync } = await import("fs");
163
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
159
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
164
160
  } else if (opts.body) {
165
161
  body = ctx.parseBody(opts.body);
166
162
  }
167
163
  if (ctx.verbose) process.stderr.write("PUT " + `/api/v2025-06/widgets/carts/${id}` + "\n");
168
164
  const result = await client.put(`/api/v2025-06/widgets/carts/${id}`, body);
169
165
  ctx.output(result);
170
- });
166
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
171
167
 
172
- resource
168
+ declareInputs(resource
173
169
  .command("create-chat")
174
170
  .description("Create a chat widget")
175
171
  .option("--body <json>", "Request body as JSON string")
@@ -178,17 +174,16 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
178
174
  const client = await ctx.getClient();
179
175
  let body: unknown;
180
176
  if (opts.bodyFile) {
181
- const { readFileSync } = await import("fs");
182
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
177
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
183
178
  } else if (opts.body) {
184
179
  body = ctx.parseBody(opts.body);
185
180
  }
186
181
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/widgets/chats` + "\n");
187
182
  const result = await client.post(`/api/v2025-06/widgets/chats`, body);
188
183
  ctx.output(result);
189
- });
184
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
190
185
 
191
- resource
186
+ declareInputs(resource
192
187
  .command("list-chat")
193
188
  .description("List chat widgets")
194
189
  .option("--filter-status <value>", "Filter chat widgets by status")
@@ -207,9 +202,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
207
202
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/chats` + "\n");
208
203
  const result = await client.get(`/api/v2025-06/widgets/chats`, params);
209
204
  ctx.output(result);
210
- });
205
+ }), () => []);
211
206
 
212
- resource
207
+ declareInputs(resource
213
208
  .command("delete-chat <id>")
214
209
  .description("Delete a chat widget")
215
210
  .action(async (id) => {
@@ -217,9 +212,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
217
212
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/widgets/chats/${id}` + "\n");
218
213
  const result = await client.delete(`/api/v2025-06/widgets/chats/${id}`);
219
214
  ctx.output(result);
220
- });
215
+ }), () => []);
221
216
 
222
- resource
217
+ declareInputs(resource
223
218
  .command("get-chat <id>")
224
219
  .description("Show a chat widget")
225
220
  .action(async (id) => {
@@ -227,9 +222,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
227
222
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/chats/${id}` + "\n");
228
223
  const result = await client.get(`/api/v2025-06/widgets/chats/${id}`);
229
224
  ctx.output(result);
230
- });
225
+ }), () => []);
231
226
 
232
- resource
227
+ declareInputs(resource
233
228
  .command("update-chat <id>")
234
229
  .description("Update a chat widget")
235
230
  .option("--body <json>", "Request body as JSON string")
@@ -238,17 +233,16 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
238
233
  const client = await ctx.getClient();
239
234
  let body: unknown;
240
235
  if (opts.bodyFile) {
241
- const { readFileSync } = await import("fs");
242
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
236
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
243
237
  } else if (opts.body) {
244
238
  body = ctx.parseBody(opts.body);
245
239
  }
246
240
  if (ctx.verbose) process.stderr.write("PUT " + `/api/v2025-06/widgets/chats/${id}` + "\n");
247
241
  const result = await client.put(`/api/v2025-06/widgets/chats/${id}`, body);
248
242
  ctx.output(result);
249
- });
243
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
250
244
 
251
- resource
245
+ declareInputs(resource
252
246
  .command("create-popup")
253
247
  .description("Create a popup widget")
254
248
  .option("--body <json>", "Request body as JSON string")
@@ -257,17 +251,16 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
257
251
  const client = await ctx.getClient();
258
252
  let body: unknown;
259
253
  if (opts.bodyFile) {
260
- const { readFileSync } = await import("fs");
261
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
254
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
262
255
  } else if (opts.body) {
263
256
  body = ctx.parseBody(opts.body);
264
257
  }
265
258
  if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/widgets/popups` + "\n");
266
259
  const result = await client.post(`/api/v2025-06/widgets/popups`, body);
267
260
  ctx.output(result);
268
- });
261
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
269
262
 
270
- resource
263
+ declareInputs(resource
271
264
  .command("list-popup")
272
265
  .description("List popup widgets")
273
266
  .option("--filter-status <value>", "Filter popup widgets by status")
@@ -288,9 +281,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
288
281
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/popups` + "\n");
289
282
  const result = await client.get(`/api/v2025-06/widgets/popups`, params);
290
283
  ctx.output(result);
291
- });
284
+ }), () => []);
292
285
 
293
- resource
286
+ declareInputs(resource
294
287
  .command("delete-popup <id>")
295
288
  .description("Delete a popup widget")
296
289
  .action(async (id) => {
@@ -298,9 +291,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
298
291
  if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/widgets/popups/${id}` + "\n");
299
292
  const result = await client.delete(`/api/v2025-06/widgets/popups/${id}`);
300
293
  ctx.output(result);
301
- });
294
+ }), () => []);
302
295
 
303
- resource
296
+ declareInputs(resource
304
297
  .command("get-popup <id>")
305
298
  .description("Get a popup widget")
306
299
  .action(async (id) => {
@@ -308,9 +301,9 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
308
301
  if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/widgets/popups/${id}` + "\n");
309
302
  const result = await client.get(`/api/v2025-06/widgets/popups/${id}`);
310
303
  ctx.output(result);
311
- });
304
+ }), () => []);
312
305
 
313
- resource
306
+ declareInputs(resource
314
307
  .command("update-popup <id>")
315
308
  .description("Update a popup widget")
316
309
  .option("--body <json>", "Request body as JSON string")
@@ -319,14 +312,13 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
319
312
  const client = await ctx.getClient();
320
313
  let body: unknown;
321
314
  if (opts.bodyFile) {
322
- const { readFileSync } = await import("fs");
323
- body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
315
+ body = ctx.parseBody(ctx.inputs.readFile(opts.bodyFile, "utf-8"));
324
316
  } else if (opts.body) {
325
317
  body = ctx.parseBody(opts.body);
326
318
  }
327
319
  if (ctx.verbose) process.stderr.write("PATCH " + `/api/v2025-06/widgets/popups/${id}` + "\n");
328
320
  const result = await client.patch(`/api/v2025-06/widgets/popups/${id}`, body);
329
321
  ctx.output(result);
330
- });
322
+ }), (opts) => (opts.bodyFile ? [{ kind: "file", path: String(opts.bodyFile) }] : []));
331
323
 
332
324
  }
package/src/lib/types.ts CHANGED
@@ -1,2 +1,3 @@
1
- // Re-export from fluid-cli — generated files import CommandContext from here
1
+ // Re-export from fluid-cli — generated files import CommandContext and declareInputs from here
2
+ export { declareInputs } from "@fluid-app/fluid-cli";
2
3
  export type { CommandContext } from "@fluid-app/fluid-cli";