@fluid-app/v2025-06-cli-commands 0.1.8 → 0.1.9

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.
@@ -6,7 +6,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
6
6
  const resource = parent.command("widgets").description("Widgets");
7
7
 
8
8
  resource
9
- .command("create-banner-widget")
9
+ .command("create-banner")
10
10
  .description("Create a banner widget")
11
11
  .option("--body <json>", "Request body as JSON string")
12
12
  .option("--body-file <path>", "Read request body from file")
@@ -20,23 +20,21 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
20
20
  body = ctx.parseBody(opts.body);
21
21
  }
22
22
  if (ctx.verbose)
23
- process.stderr.write(
24
- `POST ${new URL(`/api/v2025-06/widgets/banners`, "https://placeholder").pathname}\n`,
25
- );
23
+ process.stderr.write("POST " + `/api/v2025-06/widgets/banners` + "\n");
26
24
  const result = await client.post(`/api/v2025-06/widgets/banners`, body);
27
25
  ctx.output(result);
28
26
  });
29
27
 
30
28
  resource
31
- .command("list-banner-widgets")
29
+ .command("list-banner")
32
30
  .description("List banner widgets")
33
- .option("--filter-status <value>", "filter[status]")
34
- .option("--filter-placement <value>", "filter[placement]")
35
- .option("--filter-behavior <value>", "filter[behavior]")
36
- .option("--filter-name <value>", "filter[name]")
37
- .option("--page-cursor <value>", "page[cursor]")
38
- .option("--page-limit <value>", "page[limit]")
39
- .option("--sort <value>", "sort")
31
+ .option("--filter-status <value>", "Filter banner widgets by status")
32
+ .option("--filter-placement <value>", "Filter banner widgets by placement")
33
+ .option("--filter-behavior <value>", "Filter banner widgets by behavior")
34
+ .option("--filter-name <value>", "Filter banner widgets by name")
35
+ .option("--page-cursor <value>", "Cursor for pagination")
36
+ .option("--page-limit <value>", "Number of records per page")
37
+ .option("--sort <value>", "Sort order")
40
38
  .action(async (opts) => {
41
39
  const client = await ctx.getClient();
42
40
  const params: Record<string, unknown> = {};
@@ -54,41 +52,39 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
54
52
  params["page[limit]"] = Number(opts.pageLimit);
55
53
  if (opts.sort !== undefined) params["sort"] = opts.sort;
56
54
  if (ctx.verbose)
57
- process.stderr.write(
58
- `GET ${new URL(`/api/v2025-06/widgets/banners`, "https://placeholder").pathname}\n`,
59
- );
55
+ process.stderr.write("GET " + `/api/v2025-06/widgets/banners` + "\n");
60
56
  const result = await client.get(`/api/v2025-06/widgets/banners`, params);
61
57
  ctx.output(result);
62
58
  });
63
59
 
64
60
  resource
65
- .command("delete-banner-widget <id>")
61
+ .command("delete-banner <id>")
66
62
  .description("Delete a banner widget")
67
- .action(async (id, opts) => {
63
+ .action(async (id) => {
68
64
  const client = await ctx.getClient();
69
65
  if (ctx.verbose)
70
66
  process.stderr.write(
71
- `DELETE ${new URL(`/api/v2025-06/widgets/banners/${id}`, "https://placeholder").pathname}\n`,
67
+ "DELETE " + `/api/v2025-06/widgets/banners/${id}` + "\n",
72
68
  );
73
69
  const result = await client.delete(`/api/v2025-06/widgets/banners/${id}`);
74
70
  ctx.output(result);
75
71
  });
76
72
 
77
73
  resource
78
- .command("get-banner-widget <id>")
74
+ .command("get-banner <id>")
79
75
  .description("Get a banner widget")
80
- .action(async (id, opts) => {
76
+ .action(async (id) => {
81
77
  const client = await ctx.getClient();
82
78
  if (ctx.verbose)
83
79
  process.stderr.write(
84
- `GET ${new URL(`/api/v2025-06/widgets/banners/${id}`, "https://placeholder").pathname}\n`,
80
+ "GET " + `/api/v2025-06/widgets/banners/${id}` + "\n",
85
81
  );
86
82
  const result = await client.get(`/api/v2025-06/widgets/banners/${id}`);
87
83
  ctx.output(result);
88
84
  });
89
85
 
90
86
  resource
91
- .command("update-banner-widget <id>")
87
+ .command("update-banner <id>")
92
88
  .description("Update a banner widget")
93
89
  .option("--body <json>", "Request body as JSON string")
94
90
  .option("--body-file <path>", "Read request body from file")
@@ -103,7 +99,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
103
99
  }
104
100
  if (ctx.verbose)
105
101
  process.stderr.write(
106
- `PATCH ${new URL(`/api/v2025-06/widgets/banners/${id}`, "https://placeholder").pathname}\n`,
102
+ "PATCH " + `/api/v2025-06/widgets/banners/${id}` + "\n",
107
103
  );
108
104
  const result = await client.patch(
109
105
  `/api/v2025-06/widgets/banners/${id}`,
@@ -113,7 +109,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
113
109
  });
114
110
 
115
111
  resource
116
- .command("create-cart-widget")
112
+ .command("create-cart")
117
113
  .description("Create a cart widget")
118
114
  .option("--body <json>", "Request body as JSON string")
119
115
  .option("--body-file <path>", "Read request body from file")
@@ -127,22 +123,20 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
127
123
  body = ctx.parseBody(opts.body);
128
124
  }
129
125
  if (ctx.verbose)
130
- process.stderr.write(
131
- `POST ${new URL(`/api/v2025-06/widgets/carts`, "https://placeholder").pathname}\n`,
132
- );
126
+ process.stderr.write("POST " + `/api/v2025-06/widgets/carts` + "\n");
133
127
  const result = await client.post(`/api/v2025-06/widgets/carts`, body);
134
128
  ctx.output(result);
135
129
  });
136
130
 
137
131
  resource
138
- .command("list-cart-widgets")
132
+ .command("list-cart")
139
133
  .description("List cart widgets")
140
- .option("--filter-status <value>", "filter[status]")
141
- .option("--filter-placement <value>", "filter[placement]")
142
- .option("--filter-name <value>", "filter[name]")
143
- .option("--page-cursor <value>", "page[cursor]")
144
- .option("--page-limit <value>", "page[limit]")
145
- .option("--sort <value>", "sort")
134
+ .option("--filter-status <value>", "Filter cart widgets by status")
135
+ .option("--filter-placement <value>", "Filter cart widgets by placement")
136
+ .option("--filter-name <value>", "Filter cart widgets by name")
137
+ .option("--page-cursor <value>", "Cursor for pagination")
138
+ .option("--page-limit <value>", "Number of records per page")
139
+ .option("--sort <value>", "Sort order (prefix with - for descending order)")
146
140
  .action(async (opts) => {
147
141
  const client = await ctx.getClient();
148
142
  const params: Record<string, unknown> = {};
@@ -158,41 +152,39 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
158
152
  params["page[limit]"] = Number(opts.pageLimit);
159
153
  if (opts.sort !== undefined) params["sort"] = opts.sort;
160
154
  if (ctx.verbose)
161
- process.stderr.write(
162
- `GET ${new URL(`/api/v2025-06/widgets/carts`, "https://placeholder").pathname}\n`,
163
- );
155
+ process.stderr.write("GET " + `/api/v2025-06/widgets/carts` + "\n");
164
156
  const result = await client.get(`/api/v2025-06/widgets/carts`, params);
165
157
  ctx.output(result);
166
158
  });
167
159
 
168
160
  resource
169
- .command("delete-cart-widget <id>")
161
+ .command("delete-cart <id>")
170
162
  .description("Delete a cart widget")
171
- .action(async (id, opts) => {
163
+ .action(async (id) => {
172
164
  const client = await ctx.getClient();
173
165
  if (ctx.verbose)
174
166
  process.stderr.write(
175
- `DELETE ${new URL(`/api/v2025-06/widgets/carts/${id}`, "https://placeholder").pathname}\n`,
167
+ "DELETE " + `/api/v2025-06/widgets/carts/${id}` + "\n",
176
168
  );
177
169
  const result = await client.delete(`/api/v2025-06/widgets/carts/${id}`);
178
170
  ctx.output(result);
179
171
  });
180
172
 
181
173
  resource
182
- .command("get-cart-widget <id>")
174
+ .command("get-cart <id>")
183
175
  .description("Show a cart widget")
184
- .action(async (id, opts) => {
176
+ .action(async (id) => {
185
177
  const client = await ctx.getClient();
186
178
  if (ctx.verbose)
187
179
  process.stderr.write(
188
- `GET ${new URL(`/api/v2025-06/widgets/carts/${id}`, "https://placeholder").pathname}\n`,
180
+ "GET " + `/api/v2025-06/widgets/carts/${id}` + "\n",
189
181
  );
190
182
  const result = await client.get(`/api/v2025-06/widgets/carts/${id}`);
191
183
  ctx.output(result);
192
184
  });
193
185
 
194
186
  resource
195
- .command("update-cart-widget <id>")
187
+ .command("update-cart <id>")
196
188
  .description("Update a cart widget")
197
189
  .option("--body <json>", "Request body as JSON string")
198
190
  .option("--body-file <path>", "Read request body from file")
@@ -207,7 +199,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
207
199
  }
208
200
  if (ctx.verbose)
209
201
  process.stderr.write(
210
- `PUT ${new URL(`/api/v2025-06/widgets/carts/${id}`, "https://placeholder").pathname}\n`,
202
+ "PUT " + `/api/v2025-06/widgets/carts/${id}` + "\n",
211
203
  );
212
204
  const result = await client.put(
213
205
  `/api/v2025-06/widgets/carts/${id}`,
@@ -217,7 +209,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
217
209
  });
218
210
 
219
211
  resource
220
- .command("create-chat-widget")
212
+ .command("create-chat")
221
213
  .description("Create a chat widget")
222
214
  .option("--body <json>", "Request body as JSON string")
223
215
  .option("--body-file <path>", "Read request body from file")
@@ -231,21 +223,19 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
231
223
  body = ctx.parseBody(opts.body);
232
224
  }
233
225
  if (ctx.verbose)
234
- process.stderr.write(
235
- `POST ${new URL(`/api/v2025-06/widgets/chats`, "https://placeholder").pathname}\n`,
236
- );
226
+ process.stderr.write("POST " + `/api/v2025-06/widgets/chats` + "\n");
237
227
  const result = await client.post(`/api/v2025-06/widgets/chats`, body);
238
228
  ctx.output(result);
239
229
  });
240
230
 
241
231
  resource
242
- .command("list-chat-widgets")
232
+ .command("list-chat")
243
233
  .description("List chat widgets")
244
- .option("--filter-status <value>", "filter[status]")
245
- .option("--filter-name <value>", "filter[name]")
246
- .option("--page-cursor <value>", "page[cursor]")
247
- .option("--page-limit <value>", "page[limit]")
248
- .option("--sort <value>", "sort")
234
+ .option("--filter-status <value>", "Filter chat widgets by status")
235
+ .option("--filter-name <value>", "Filter chat widgets by name")
236
+ .option("--page-cursor <value>", "Cursor for pagination")
237
+ .option("--page-limit <value>", "Number of records per page")
238
+ .option("--sort <value>", "Sort order (prefix with - for descending order)")
249
239
  .action(async (opts) => {
250
240
  const client = await ctx.getClient();
251
241
  const params: Record<string, unknown> = {};
@@ -259,41 +249,39 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
259
249
  params["page[limit]"] = Number(opts.pageLimit);
260
250
  if (opts.sort !== undefined) params["sort"] = opts.sort;
261
251
  if (ctx.verbose)
262
- process.stderr.write(
263
- `GET ${new URL(`/api/v2025-06/widgets/chats`, "https://placeholder").pathname}\n`,
264
- );
252
+ process.stderr.write("GET " + `/api/v2025-06/widgets/chats` + "\n");
265
253
  const result = await client.get(`/api/v2025-06/widgets/chats`, params);
266
254
  ctx.output(result);
267
255
  });
268
256
 
269
257
  resource
270
- .command("delete-chat-widget <id>")
258
+ .command("delete-chat <id>")
271
259
  .description("Delete a chat widget")
272
- .action(async (id, opts) => {
260
+ .action(async (id) => {
273
261
  const client = await ctx.getClient();
274
262
  if (ctx.verbose)
275
263
  process.stderr.write(
276
- `DELETE ${new URL(`/api/v2025-06/widgets/chats/${id}`, "https://placeholder").pathname}\n`,
264
+ "DELETE " + `/api/v2025-06/widgets/chats/${id}` + "\n",
277
265
  );
278
266
  const result = await client.delete(`/api/v2025-06/widgets/chats/${id}`);
279
267
  ctx.output(result);
280
268
  });
281
269
 
282
270
  resource
283
- .command("get-chat-widget <id>")
271
+ .command("get-chat <id>")
284
272
  .description("Show a chat widget")
285
- .action(async (id, opts) => {
273
+ .action(async (id) => {
286
274
  const client = await ctx.getClient();
287
275
  if (ctx.verbose)
288
276
  process.stderr.write(
289
- `GET ${new URL(`/api/v2025-06/widgets/chats/${id}`, "https://placeholder").pathname}\n`,
277
+ "GET " + `/api/v2025-06/widgets/chats/${id}` + "\n",
290
278
  );
291
279
  const result = await client.get(`/api/v2025-06/widgets/chats/${id}`);
292
280
  ctx.output(result);
293
281
  });
294
282
 
295
283
  resource
296
- .command("update-chat-widget <id>")
284
+ .command("update-chat <id>")
297
285
  .description("Update a chat widget")
298
286
  .option("--body <json>", "Request body as JSON string")
299
287
  .option("--body-file <path>", "Read request body from file")
@@ -308,7 +296,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
308
296
  }
309
297
  if (ctx.verbose)
310
298
  process.stderr.write(
311
- `PUT ${new URL(`/api/v2025-06/widgets/chats/${id}`, "https://placeholder").pathname}\n`,
299
+ "PUT " + `/api/v2025-06/widgets/chats/${id}` + "\n",
312
300
  );
313
301
  const result = await client.put(
314
302
  `/api/v2025-06/widgets/chats/${id}`,
@@ -318,7 +306,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
318
306
  });
319
307
 
320
308
  resource
321
- .command("create-popup-widget")
309
+ .command("create-popup")
322
310
  .description("Create a popup widget")
323
311
  .option("--body <json>", "Request body as JSON string")
324
312
  .option("--body-file <path>", "Read request body from file")
@@ -332,22 +320,20 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
332
320
  body = ctx.parseBody(opts.body);
333
321
  }
334
322
  if (ctx.verbose)
335
- process.stderr.write(
336
- `POST ${new URL(`/api/v2025-06/widgets/popups`, "https://placeholder").pathname}\n`,
337
- );
323
+ process.stderr.write("POST " + `/api/v2025-06/widgets/popups` + "\n");
338
324
  const result = await client.post(`/api/v2025-06/widgets/popups`, body);
339
325
  ctx.output(result);
340
326
  });
341
327
 
342
328
  resource
343
- .command("list-popup-widgets")
329
+ .command("list-popup")
344
330
  .description("List popup widgets")
345
- .option("--filter-status <value>", "filter[status]")
346
- .option("--filter-placement <value>", "filter[placement]")
347
- .option("--filter-name <value>", "filter[name]")
348
- .option("--page-cursor <value>", "page[cursor]")
349
- .option("--page-limit <value>", "page[limit]")
350
- .option("--sort <value>", "sort")
331
+ .option("--filter-status <value>", "Filter popup widgets by status")
332
+ .option("--filter-placement <value>", "Filter popup widgets by placement")
333
+ .option("--filter-name <value>", "Filter popup widgets by name")
334
+ .option("--page-cursor <value>", "Cursor for pagination")
335
+ .option("--page-limit <value>", "Number of records per page")
336
+ .option("--sort <value>", "Sort order (prefix with - for descending order)")
351
337
  .action(async (opts) => {
352
338
  const client = await ctx.getClient();
353
339
  const params: Record<string, unknown> = {};
@@ -363,41 +349,39 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
363
349
  params["page[limit]"] = Number(opts.pageLimit);
364
350
  if (opts.sort !== undefined) params["sort"] = opts.sort;
365
351
  if (ctx.verbose)
366
- process.stderr.write(
367
- `GET ${new URL(`/api/v2025-06/widgets/popups`, "https://placeholder").pathname}\n`,
368
- );
352
+ process.stderr.write("GET " + `/api/v2025-06/widgets/popups` + "\n");
369
353
  const result = await client.get(`/api/v2025-06/widgets/popups`, params);
370
354
  ctx.output(result);
371
355
  });
372
356
 
373
357
  resource
374
- .command("delete-popup-widget <id>")
358
+ .command("delete-popup <id>")
375
359
  .description("Delete a popup widget")
376
- .action(async (id, opts) => {
360
+ .action(async (id) => {
377
361
  const client = await ctx.getClient();
378
362
  if (ctx.verbose)
379
363
  process.stderr.write(
380
- `DELETE ${new URL(`/api/v2025-06/widgets/popups/${id}`, "https://placeholder").pathname}\n`,
364
+ "DELETE " + `/api/v2025-06/widgets/popups/${id}` + "\n",
381
365
  );
382
366
  const result = await client.delete(`/api/v2025-06/widgets/popups/${id}`);
383
367
  ctx.output(result);
384
368
  });
385
369
 
386
370
  resource
387
- .command("get-popup-widget <id>")
371
+ .command("get-popup <id>")
388
372
  .description("Get a popup widget")
389
- .action(async (id, opts) => {
373
+ .action(async (id) => {
390
374
  const client = await ctx.getClient();
391
375
  if (ctx.verbose)
392
376
  process.stderr.write(
393
- `GET ${new URL(`/api/v2025-06/widgets/popups/${id}`, "https://placeholder").pathname}\n`,
377
+ "GET " + `/api/v2025-06/widgets/popups/${id}` + "\n",
394
378
  );
395
379
  const result = await client.get(`/api/v2025-06/widgets/popups/${id}`);
396
380
  ctx.output(result);
397
381
  });
398
382
 
399
383
  resource
400
- .command("update-popup-widget <id>")
384
+ .command("update-popup <id>")
401
385
  .description("Update a popup widget")
402
386
  .option("--body <json>", "Request body as JSON string")
403
387
  .option("--body-file <path>", "Read request body from file")
@@ -412,7 +396,7 @@ export function registerWidgets(parent: Command, ctx: CommandContext): void {
412
396
  }
413
397
  if (ctx.verbose)
414
398
  process.stderr.write(
415
- `PATCH ${new URL(`/api/v2025-06/widgets/popups/${id}`, "https://placeholder").pathname}\n`,
399
+ "PATCH " + `/api/v2025-06/widgets/popups/${id}` + "\n",
416
400
  );
417
401
  const result = await client.patch(
418
402
  `/api/v2025-06/widgets/popups/${id}`,