@fluid-app/v2025-06-cli-commands 0.1.0

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.
@@ -0,0 +1,819 @@
1
+ // lighthouse.ts — AUTO-GENERATED, DO NOT EDIT
2
+ import { Command } from "commander";
3
+ import type { CommandContext } from "../lib/types.js";
4
+
5
+ export function registerLighthouse(parent: Command, ctx: CommandContext): void {
6
+ const resource = parent.command("lighthouse").description("Lighthouse");
7
+
8
+ resource
9
+ .command("get-latest-product-lighthouse <product-id>")
10
+ .description("Get latest Lighthouse scan for a product")
11
+ .action(async (productId, opts) => {
12
+ const client = await ctx.getClient();
13
+ if (ctx.verbose)
14
+ process.stderr.write(
15
+ `GET ${new URL(`/api/v202506/products/${productId}/lighthouse`, "https://placeholder").pathname}\n`,
16
+ );
17
+ const result = await client.get(
18
+ `/api/v202506/products/${productId}/lighthouse`,
19
+ );
20
+ ctx.output(result);
21
+ });
22
+
23
+ resource
24
+ .command("list-product-lighthouses <product-id>")
25
+ .description("List all Lighthouse scans for a product")
26
+ .option("--page <value>", "page")
27
+ .option("--per-page <value>", "per_page")
28
+ .action(async (productId, opts) => {
29
+ const client = await ctx.getClient();
30
+ const params: Record<string, unknown> = {};
31
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
32
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
33
+ if (ctx.verbose)
34
+ process.stderr.write(
35
+ `GET ${new URL(`/api/v202506/products/${productId}/lighthouses`, "https://placeholder").pathname}\n`,
36
+ );
37
+ const result = await client.get(
38
+ `/api/v202506/products/${productId}/lighthouses`,
39
+ params,
40
+ );
41
+ ctx.output(result);
42
+ });
43
+
44
+ resource
45
+ .command("create-product-lighthouse <product-id>")
46
+ .description("Create a new Lighthouse scan for a product")
47
+ .option("--body <json>", "Request body as JSON string")
48
+ .option("--body-file <path>", "Read request body from file")
49
+ .action(async (productId, opts) => {
50
+ const client = await ctx.getClient();
51
+ let body: unknown;
52
+ if (opts.bodyFile) {
53
+ const { readFileSync } = await import("fs");
54
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
55
+ } else if (opts.body) {
56
+ body = ctx.parseBody(opts.body);
57
+ }
58
+ if (ctx.verbose)
59
+ process.stderr.write(
60
+ `POST ${new URL(`/api/v202506/products/${productId}/lighthouses`, "https://placeholder").pathname}\n`,
61
+ );
62
+ const result = await client.post(
63
+ `/api/v202506/products/${productId}/lighthouses`,
64
+ body,
65
+ );
66
+ ctx.output(result);
67
+ });
68
+
69
+ resource
70
+ .command("get-product-lighthouse <product-id> <id>")
71
+ .description("Get a specific Lighthouse scan for a product")
72
+ .action(async (productId, id, opts) => {
73
+ const client = await ctx.getClient();
74
+ if (ctx.verbose)
75
+ process.stderr.write(
76
+ `GET ${new URL(`/api/v202506/products/${productId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
77
+ );
78
+ const result = await client.get(
79
+ `/api/v202506/products/${productId}/lighthouses/${id}`,
80
+ );
81
+ ctx.output(result);
82
+ });
83
+
84
+ resource
85
+ .command("update-product-lighthouse <product-id> <id>")
86
+ .description("Update a Lighthouse scan for a product")
87
+ .option("--body <json>", "Request body as JSON string")
88
+ .option("--body-file <path>", "Read request body from file")
89
+ .action(async (productId, id, opts) => {
90
+ const client = await ctx.getClient();
91
+ let body: unknown;
92
+ if (opts.bodyFile) {
93
+ const { readFileSync } = await import("fs");
94
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
95
+ } else if (opts.body) {
96
+ body = ctx.parseBody(opts.body);
97
+ }
98
+ if (ctx.verbose)
99
+ process.stderr.write(
100
+ `PATCH ${new URL(`/api/v202506/products/${productId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
101
+ );
102
+ const result = await client.patch(
103
+ `/api/v202506/products/${productId}/lighthouses/${id}`,
104
+ body,
105
+ );
106
+ ctx.output(result);
107
+ });
108
+
109
+ resource
110
+ .command("delete-product-lighthouse <product-id> <id>")
111
+ .description("Delete a Lighthouse scan for a product")
112
+ .action(async (productId, id, opts) => {
113
+ const client = await ctx.getClient();
114
+ if (ctx.verbose)
115
+ process.stderr.write(
116
+ `DELETE ${new URL(`/api/v202506/products/${productId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
117
+ );
118
+ const result = await client.delete(
119
+ `/api/v202506/products/${productId}/lighthouses/${id}`,
120
+ );
121
+ ctx.output(result);
122
+ });
123
+
124
+ resource
125
+ .command("get-latest-media-lighthouse <medium-id>")
126
+ .description("Get latest Lighthouse scan for media")
127
+ .action(async (mediumId, opts) => {
128
+ const client = await ctx.getClient();
129
+ if (ctx.verbose)
130
+ process.stderr.write(
131
+ `GET ${new URL(`/api/v202506/media/${mediumId}/lighthouse`, "https://placeholder").pathname}\n`,
132
+ );
133
+ const result = await client.get(
134
+ `/api/v202506/media/${mediumId}/lighthouse`,
135
+ );
136
+ ctx.output(result);
137
+ });
138
+
139
+ resource
140
+ .command("list-media-lighthouses <medium-id>")
141
+ .description("List all Lighthouse scans for media")
142
+ .option("--page <value>", "page")
143
+ .option("--per-page <value>", "per_page")
144
+ .action(async (mediumId, opts) => {
145
+ const client = await ctx.getClient();
146
+ const params: Record<string, unknown> = {};
147
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
148
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
149
+ if (ctx.verbose)
150
+ process.stderr.write(
151
+ `GET ${new URL(`/api/v202506/media/${mediumId}/lighthouses`, "https://placeholder").pathname}\n`,
152
+ );
153
+ const result = await client.get(
154
+ `/api/v202506/media/${mediumId}/lighthouses`,
155
+ params,
156
+ );
157
+ ctx.output(result);
158
+ });
159
+
160
+ resource
161
+ .command("create-media-lighthouse <medium-id>")
162
+ .description("Create a new Lighthouse scan for media")
163
+ .option("--body <json>", "Request body as JSON string")
164
+ .option("--body-file <path>", "Read request body from file")
165
+ .action(async (mediumId, opts) => {
166
+ const client = await ctx.getClient();
167
+ let body: unknown;
168
+ if (opts.bodyFile) {
169
+ const { readFileSync } = await import("fs");
170
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
171
+ } else if (opts.body) {
172
+ body = ctx.parseBody(opts.body);
173
+ }
174
+ if (ctx.verbose)
175
+ process.stderr.write(
176
+ `POST ${new URL(`/api/v202506/media/${mediumId}/lighthouses`, "https://placeholder").pathname}\n`,
177
+ );
178
+ const result = await client.post(
179
+ `/api/v202506/media/${mediumId}/lighthouses`,
180
+ body,
181
+ );
182
+ ctx.output(result);
183
+ });
184
+
185
+ resource
186
+ .command("get-media-lighthouse <medium-id> <id>")
187
+ .description("Get a specific Lighthouse scan for media")
188
+ .action(async (mediumId, id, opts) => {
189
+ const client = await ctx.getClient();
190
+ if (ctx.verbose)
191
+ process.stderr.write(
192
+ `GET ${new URL(`/api/v202506/media/${mediumId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
193
+ );
194
+ const result = await client.get(
195
+ `/api/v202506/media/${mediumId}/lighthouses/${id}`,
196
+ );
197
+ ctx.output(result);
198
+ });
199
+
200
+ resource
201
+ .command("update-media-lighthouse <medium-id> <id>")
202
+ .description("Update a Lighthouse scan for media")
203
+ .option("--body <json>", "Request body as JSON string")
204
+ .option("--body-file <path>", "Read request body from file")
205
+ .action(async (mediumId, id, opts) => {
206
+ const client = await ctx.getClient();
207
+ let body: unknown;
208
+ if (opts.bodyFile) {
209
+ const { readFileSync } = await import("fs");
210
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
211
+ } else if (opts.body) {
212
+ body = ctx.parseBody(opts.body);
213
+ }
214
+ if (ctx.verbose)
215
+ process.stderr.write(
216
+ `PATCH ${new URL(`/api/v202506/media/${mediumId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
217
+ );
218
+ const result = await client.patch(
219
+ `/api/v202506/media/${mediumId}/lighthouses/${id}`,
220
+ body,
221
+ );
222
+ ctx.output(result);
223
+ });
224
+
225
+ resource
226
+ .command("delete-media-lighthouse <medium-id> <id>")
227
+ .description("Delete a Lighthouse scan for media")
228
+ .action(async (mediumId, id, opts) => {
229
+ const client = await ctx.getClient();
230
+ if (ctx.verbose)
231
+ process.stderr.write(
232
+ `DELETE ${new URL(`/api/v202506/media/${mediumId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
233
+ );
234
+ const result = await client.delete(
235
+ `/api/v202506/media/${mediumId}/lighthouses/${id}`,
236
+ );
237
+ ctx.output(result);
238
+ });
239
+
240
+ resource
241
+ .command("get-latest-playlist-lighthouse <playlist-id>")
242
+ .description("Get latest Lighthouse scan for a playlist")
243
+ .action(async (playlistId, opts) => {
244
+ const client = await ctx.getClient();
245
+ if (ctx.verbose)
246
+ process.stderr.write(
247
+ `GET ${new URL(`/api/v202506/playlists/${playlistId}/lighthouse`, "https://placeholder").pathname}\n`,
248
+ );
249
+ const result = await client.get(
250
+ `/api/v202506/playlists/${playlistId}/lighthouse`,
251
+ );
252
+ ctx.output(result);
253
+ });
254
+
255
+ resource
256
+ .command("list-playlist-lighthouses <playlist-id>")
257
+ .description("List all Lighthouse scans for a playlist")
258
+ .option("--page <value>", "page")
259
+ .option("--per-page <value>", "per_page")
260
+ .action(async (playlistId, opts) => {
261
+ const client = await ctx.getClient();
262
+ const params: Record<string, unknown> = {};
263
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
264
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
265
+ if (ctx.verbose)
266
+ process.stderr.write(
267
+ `GET ${new URL(`/api/v202506/playlists/${playlistId}/lighthouses`, "https://placeholder").pathname}\n`,
268
+ );
269
+ const result = await client.get(
270
+ `/api/v202506/playlists/${playlistId}/lighthouses`,
271
+ params,
272
+ );
273
+ ctx.output(result);
274
+ });
275
+
276
+ resource
277
+ .command("create-playlist-lighthouse <playlist-id>")
278
+ .description("Create a new Lighthouse scan for a playlist")
279
+ .option("--body <json>", "Request body as JSON string")
280
+ .option("--body-file <path>", "Read request body from file")
281
+ .action(async (playlistId, opts) => {
282
+ const client = await ctx.getClient();
283
+ let body: unknown;
284
+ if (opts.bodyFile) {
285
+ const { readFileSync } = await import("fs");
286
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
287
+ } else if (opts.body) {
288
+ body = ctx.parseBody(opts.body);
289
+ }
290
+ if (ctx.verbose)
291
+ process.stderr.write(
292
+ `POST ${new URL(`/api/v202506/playlists/${playlistId}/lighthouses`, "https://placeholder").pathname}\n`,
293
+ );
294
+ const result = await client.post(
295
+ `/api/v202506/playlists/${playlistId}/lighthouses`,
296
+ body,
297
+ );
298
+ ctx.output(result);
299
+ });
300
+
301
+ resource
302
+ .command("get-playlist-lighthouse <playlist-id> <id>")
303
+ .description("Get a specific Lighthouse scan for a playlist")
304
+ .action(async (playlistId, id, opts) => {
305
+ const client = await ctx.getClient();
306
+ if (ctx.verbose)
307
+ process.stderr.write(
308
+ `GET ${new URL(`/api/v202506/playlists/${playlistId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
309
+ );
310
+ const result = await client.get(
311
+ `/api/v202506/playlists/${playlistId}/lighthouses/${id}`,
312
+ );
313
+ ctx.output(result);
314
+ });
315
+
316
+ resource
317
+ .command("update-playlist-lighthouse <playlist-id> <id>")
318
+ .description("Update a Lighthouse scan for a playlist")
319
+ .option("--body <json>", "Request body as JSON string")
320
+ .option("--body-file <path>", "Read request body from file")
321
+ .action(async (playlistId, id, opts) => {
322
+ const client = await ctx.getClient();
323
+ let body: unknown;
324
+ if (opts.bodyFile) {
325
+ const { readFileSync } = await import("fs");
326
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
327
+ } else if (opts.body) {
328
+ body = ctx.parseBody(opts.body);
329
+ }
330
+ if (ctx.verbose)
331
+ process.stderr.write(
332
+ `PATCH ${new URL(`/api/v202506/playlists/${playlistId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
333
+ );
334
+ const result = await client.patch(
335
+ `/api/v202506/playlists/${playlistId}/lighthouses/${id}`,
336
+ body,
337
+ );
338
+ ctx.output(result);
339
+ });
340
+
341
+ resource
342
+ .command("delete-playlist-lighthouse <playlist-id> <id>")
343
+ .description("Delete a Lighthouse scan for a playlist")
344
+ .action(async (playlistId, id, opts) => {
345
+ const client = await ctx.getClient();
346
+ if (ctx.verbose)
347
+ process.stderr.write(
348
+ `DELETE ${new URL(`/api/v202506/playlists/${playlistId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
349
+ );
350
+ const result = await client.delete(
351
+ `/api/v202506/playlists/${playlistId}/lighthouses/${id}`,
352
+ );
353
+ ctx.output(result);
354
+ });
355
+
356
+ resource
357
+ .command("get-latest-category-lighthouse <category-id>")
358
+ .description("Get latest Lighthouse scan for a category")
359
+ .action(async (categoryId, opts) => {
360
+ const client = await ctx.getClient();
361
+ if (ctx.verbose)
362
+ process.stderr.write(
363
+ `GET ${new URL(`/api/v202506/categories/${categoryId}/lighthouse`, "https://placeholder").pathname}\n`,
364
+ );
365
+ const result = await client.get(
366
+ `/api/v202506/categories/${categoryId}/lighthouse`,
367
+ );
368
+ ctx.output(result);
369
+ });
370
+
371
+ resource
372
+ .command("list-category-lighthouses <category-id>")
373
+ .description("List all Lighthouse scans for a category")
374
+ .option("--page <value>", "page")
375
+ .option("--per-page <value>", "per_page")
376
+ .action(async (categoryId, opts) => {
377
+ const client = await ctx.getClient();
378
+ const params: Record<string, unknown> = {};
379
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
380
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
381
+ if (ctx.verbose)
382
+ process.stderr.write(
383
+ `GET ${new URL(`/api/v202506/categories/${categoryId}/lighthouses`, "https://placeholder").pathname}\n`,
384
+ );
385
+ const result = await client.get(
386
+ `/api/v202506/categories/${categoryId}/lighthouses`,
387
+ params,
388
+ );
389
+ ctx.output(result);
390
+ });
391
+
392
+ resource
393
+ .command("create-category-lighthouse <category-id>")
394
+ .description("Create a new Lighthouse scan for a category")
395
+ .option("--body <json>", "Request body as JSON string")
396
+ .option("--body-file <path>", "Read request body from file")
397
+ .action(async (categoryId, opts) => {
398
+ const client = await ctx.getClient();
399
+ let body: unknown;
400
+ if (opts.bodyFile) {
401
+ const { readFileSync } = await import("fs");
402
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
403
+ } else if (opts.body) {
404
+ body = ctx.parseBody(opts.body);
405
+ }
406
+ if (ctx.verbose)
407
+ process.stderr.write(
408
+ `POST ${new URL(`/api/v202506/categories/${categoryId}/lighthouses`, "https://placeholder").pathname}\n`,
409
+ );
410
+ const result = await client.post(
411
+ `/api/v202506/categories/${categoryId}/lighthouses`,
412
+ body,
413
+ );
414
+ ctx.output(result);
415
+ });
416
+
417
+ resource
418
+ .command("get-category-lighthouse <category-id> <id>")
419
+ .description("Get a specific Lighthouse scan for a category")
420
+ .action(async (categoryId, id, opts) => {
421
+ const client = await ctx.getClient();
422
+ if (ctx.verbose)
423
+ process.stderr.write(
424
+ `GET ${new URL(`/api/v202506/categories/${categoryId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
425
+ );
426
+ const result = await client.get(
427
+ `/api/v202506/categories/${categoryId}/lighthouses/${id}`,
428
+ );
429
+ ctx.output(result);
430
+ });
431
+
432
+ resource
433
+ .command("update-category-lighthouse <category-id> <id>")
434
+ .description("Update a Lighthouse scan for a category")
435
+ .option("--body <json>", "Request body as JSON string")
436
+ .option("--body-file <path>", "Read request body from file")
437
+ .action(async (categoryId, id, opts) => {
438
+ const client = await ctx.getClient();
439
+ let body: unknown;
440
+ if (opts.bodyFile) {
441
+ const { readFileSync } = await import("fs");
442
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
443
+ } else if (opts.body) {
444
+ body = ctx.parseBody(opts.body);
445
+ }
446
+ if (ctx.verbose)
447
+ process.stderr.write(
448
+ `PATCH ${new URL(`/api/v202506/categories/${categoryId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
449
+ );
450
+ const result = await client.patch(
451
+ `/api/v202506/categories/${categoryId}/lighthouses/${id}`,
452
+ body,
453
+ );
454
+ ctx.output(result);
455
+ });
456
+
457
+ resource
458
+ .command("delete-category-lighthouse <category-id> <id>")
459
+ .description("Delete a Lighthouse scan for a category")
460
+ .action(async (categoryId, id, opts) => {
461
+ const client = await ctx.getClient();
462
+ if (ctx.verbose)
463
+ process.stderr.write(
464
+ `DELETE ${new URL(`/api/v202506/categories/${categoryId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
465
+ );
466
+ const result = await client.delete(
467
+ `/api/v202506/categories/${categoryId}/lighthouses/${id}`,
468
+ );
469
+ ctx.output(result);
470
+ });
471
+
472
+ resource
473
+ .command("get-latest-collection-lighthouse <collection-id>")
474
+ .description("Get latest Lighthouse scan for a collection")
475
+ .action(async (collectionId, opts) => {
476
+ const client = await ctx.getClient();
477
+ if (ctx.verbose)
478
+ process.stderr.write(
479
+ `GET ${new URL(`/api/v202506/collections/${collectionId}/lighthouse`, "https://placeholder").pathname}\n`,
480
+ );
481
+ const result = await client.get(
482
+ `/api/v202506/collections/${collectionId}/lighthouse`,
483
+ );
484
+ ctx.output(result);
485
+ });
486
+
487
+ resource
488
+ .command("list-collection-lighthouses <collection-id>")
489
+ .description("List all Lighthouse scans for a collection")
490
+ .option("--page <value>", "page")
491
+ .option("--per-page <value>", "per_page")
492
+ .action(async (collectionId, opts) => {
493
+ const client = await ctx.getClient();
494
+ const params: Record<string, unknown> = {};
495
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
496
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
497
+ if (ctx.verbose)
498
+ process.stderr.write(
499
+ `GET ${new URL(`/api/v202506/collections/${collectionId}/lighthouses`, "https://placeholder").pathname}\n`,
500
+ );
501
+ const result = await client.get(
502
+ `/api/v202506/collections/${collectionId}/lighthouses`,
503
+ params,
504
+ );
505
+ ctx.output(result);
506
+ });
507
+
508
+ resource
509
+ .command("create-collection-lighthouse <collection-id>")
510
+ .description("Create a new Lighthouse scan for a collection")
511
+ .option("--body <json>", "Request body as JSON string")
512
+ .option("--body-file <path>", "Read request body from file")
513
+ .action(async (collectionId, opts) => {
514
+ const client = await ctx.getClient();
515
+ let body: unknown;
516
+ if (opts.bodyFile) {
517
+ const { readFileSync } = await import("fs");
518
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
519
+ } else if (opts.body) {
520
+ body = ctx.parseBody(opts.body);
521
+ }
522
+ if (ctx.verbose)
523
+ process.stderr.write(
524
+ `POST ${new URL(`/api/v202506/collections/${collectionId}/lighthouses`, "https://placeholder").pathname}\n`,
525
+ );
526
+ const result = await client.post(
527
+ `/api/v202506/collections/${collectionId}/lighthouses`,
528
+ body,
529
+ );
530
+ ctx.output(result);
531
+ });
532
+
533
+ resource
534
+ .command("get-collection-lighthouse <collection-id> <id>")
535
+ .description("Get a specific Lighthouse scan for a collection")
536
+ .action(async (collectionId, id, opts) => {
537
+ const client = await ctx.getClient();
538
+ if (ctx.verbose)
539
+ process.stderr.write(
540
+ `GET ${new URL(`/api/v202506/collections/${collectionId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
541
+ );
542
+ const result = await client.get(
543
+ `/api/v202506/collections/${collectionId}/lighthouses/${id}`,
544
+ );
545
+ ctx.output(result);
546
+ });
547
+
548
+ resource
549
+ .command("update-collection-lighthouse <collection-id> <id>")
550
+ .description("Update a Lighthouse scan for a collection")
551
+ .option("--body <json>", "Request body as JSON string")
552
+ .option("--body-file <path>", "Read request body from file")
553
+ .action(async (collectionId, id, opts) => {
554
+ const client = await ctx.getClient();
555
+ let body: unknown;
556
+ if (opts.bodyFile) {
557
+ const { readFileSync } = await import("fs");
558
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
559
+ } else if (opts.body) {
560
+ body = ctx.parseBody(opts.body);
561
+ }
562
+ if (ctx.verbose)
563
+ process.stderr.write(
564
+ `PATCH ${new URL(`/api/v202506/collections/${collectionId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
565
+ );
566
+ const result = await client.patch(
567
+ `/api/v202506/collections/${collectionId}/lighthouses/${id}`,
568
+ body,
569
+ );
570
+ ctx.output(result);
571
+ });
572
+
573
+ resource
574
+ .command("delete-collection-lighthouse <collection-id> <id>")
575
+ .description("Delete a Lighthouse scan for a collection")
576
+ .action(async (collectionId, id, opts) => {
577
+ const client = await ctx.getClient();
578
+ if (ctx.verbose)
579
+ process.stderr.write(
580
+ `DELETE ${new URL(`/api/v202506/collections/${collectionId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
581
+ );
582
+ const result = await client.delete(
583
+ `/api/v202506/collections/${collectionId}/lighthouses/${id}`,
584
+ );
585
+ ctx.output(result);
586
+ });
587
+
588
+ resource
589
+ .command("get-latest-post-lighthouse <post-id>")
590
+ .description("Get latest Lighthouse scan for a post")
591
+ .action(async (postId, opts) => {
592
+ const client = await ctx.getClient();
593
+ if (ctx.verbose)
594
+ process.stderr.write(
595
+ `GET ${new URL(`/api/v202506/posts/${postId}/lighthouse`, "https://placeholder").pathname}\n`,
596
+ );
597
+ const result = await client.get(
598
+ `/api/v202506/posts/${postId}/lighthouse`,
599
+ );
600
+ ctx.output(result);
601
+ });
602
+
603
+ resource
604
+ .command("list-post-lighthouses <post-id>")
605
+ .description("List all Lighthouse scans for a post")
606
+ .option("--page <value>", "page")
607
+ .option("--per-page <value>", "per_page")
608
+ .action(async (postId, opts) => {
609
+ const client = await ctx.getClient();
610
+ const params: Record<string, unknown> = {};
611
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
612
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
613
+ if (ctx.verbose)
614
+ process.stderr.write(
615
+ `GET ${new URL(`/api/v202506/posts/${postId}/lighthouses`, "https://placeholder").pathname}\n`,
616
+ );
617
+ const result = await client.get(
618
+ `/api/v202506/posts/${postId}/lighthouses`,
619
+ params,
620
+ );
621
+ ctx.output(result);
622
+ });
623
+
624
+ resource
625
+ .command("create-post-lighthouse <post-id>")
626
+ .description("Create a new Lighthouse scan for a post")
627
+ .option("--body <json>", "Request body as JSON string")
628
+ .option("--body-file <path>", "Read request body from file")
629
+ .action(async (postId, opts) => {
630
+ const client = await ctx.getClient();
631
+ let body: unknown;
632
+ if (opts.bodyFile) {
633
+ const { readFileSync } = await import("fs");
634
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
635
+ } else if (opts.body) {
636
+ body = ctx.parseBody(opts.body);
637
+ }
638
+ if (ctx.verbose)
639
+ process.stderr.write(
640
+ `POST ${new URL(`/api/v202506/posts/${postId}/lighthouses`, "https://placeholder").pathname}\n`,
641
+ );
642
+ const result = await client.post(
643
+ `/api/v202506/posts/${postId}/lighthouses`,
644
+ body,
645
+ );
646
+ ctx.output(result);
647
+ });
648
+
649
+ resource
650
+ .command("get-post-lighthouse <post-id> <id>")
651
+ .description("Get a specific Lighthouse scan for a post")
652
+ .action(async (postId, id, opts) => {
653
+ const client = await ctx.getClient();
654
+ if (ctx.verbose)
655
+ process.stderr.write(
656
+ `GET ${new URL(`/api/v202506/posts/${postId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
657
+ );
658
+ const result = await client.get(
659
+ `/api/v202506/posts/${postId}/lighthouses/${id}`,
660
+ );
661
+ ctx.output(result);
662
+ });
663
+
664
+ resource
665
+ .command("update-post-lighthouse <post-id> <id>")
666
+ .description("Update a Lighthouse scan for a post")
667
+ .option("--body <json>", "Request body as JSON string")
668
+ .option("--body-file <path>", "Read request body from file")
669
+ .action(async (postId, id, opts) => {
670
+ const client = await ctx.getClient();
671
+ let body: unknown;
672
+ if (opts.bodyFile) {
673
+ const { readFileSync } = await import("fs");
674
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
675
+ } else if (opts.body) {
676
+ body = ctx.parseBody(opts.body);
677
+ }
678
+ if (ctx.verbose)
679
+ process.stderr.write(
680
+ `PATCH ${new URL(`/api/v202506/posts/${postId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
681
+ );
682
+ const result = await client.patch(
683
+ `/api/v202506/posts/${postId}/lighthouses/${id}`,
684
+ body,
685
+ );
686
+ ctx.output(result);
687
+ });
688
+
689
+ resource
690
+ .command("delete-post-lighthouse <post-id> <id>")
691
+ .description("Delete a Lighthouse scan for a post")
692
+ .action(async (postId, id, opts) => {
693
+ const client = await ctx.getClient();
694
+ if (ctx.verbose)
695
+ process.stderr.write(
696
+ `DELETE ${new URL(`/api/v202506/posts/${postId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
697
+ );
698
+ const result = await client.delete(
699
+ `/api/v202506/posts/${postId}/lighthouses/${id}`,
700
+ );
701
+ ctx.output(result);
702
+ });
703
+
704
+ resource
705
+ .command("get-latest-enrollment-pack-lighthouse <enrollment-pack-id>")
706
+ .description("Get latest Lighthouse scan for an enrollment pack")
707
+ .action(async (enrollmentPackId, opts) => {
708
+ const client = await ctx.getClient();
709
+ if (ctx.verbose)
710
+ process.stderr.write(
711
+ `GET ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouse`, "https://placeholder").pathname}\n`,
712
+ );
713
+ const result = await client.get(
714
+ `/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouse`,
715
+ );
716
+ ctx.output(result);
717
+ });
718
+
719
+ resource
720
+ .command("list-enrollment-pack-lighthouses <enrollment-pack-id>")
721
+ .description("List all Lighthouse scans for an enrollment pack")
722
+ .option("--page <value>", "page")
723
+ .option("--per-page <value>", "per_page")
724
+ .action(async (enrollmentPackId, opts) => {
725
+ const client = await ctx.getClient();
726
+ const params: Record<string, unknown> = {};
727
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
728
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
729
+ if (ctx.verbose)
730
+ process.stderr.write(
731
+ `GET ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses`, "https://placeholder").pathname}\n`,
732
+ );
733
+ const result = await client.get(
734
+ `/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses`,
735
+ params,
736
+ );
737
+ ctx.output(result);
738
+ });
739
+
740
+ resource
741
+ .command("create-enrollment-pack-lighthouse <enrollment-pack-id>")
742
+ .description("Create a new Lighthouse scan for an enrollment pack")
743
+ .option("--body <json>", "Request body as JSON string")
744
+ .option("--body-file <path>", "Read request body from file")
745
+ .action(async (enrollmentPackId, opts) => {
746
+ const client = await ctx.getClient();
747
+ let body: unknown;
748
+ if (opts.bodyFile) {
749
+ const { readFileSync } = await import("fs");
750
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
751
+ } else if (opts.body) {
752
+ body = ctx.parseBody(opts.body);
753
+ }
754
+ if (ctx.verbose)
755
+ process.stderr.write(
756
+ `POST ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses`, "https://placeholder").pathname}\n`,
757
+ );
758
+ const result = await client.post(
759
+ `/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses`,
760
+ body,
761
+ );
762
+ ctx.output(result);
763
+ });
764
+
765
+ resource
766
+ .command("get-enrollment-pack-lighthouse <enrollment-pack-id> <id>")
767
+ .description("Get a specific Lighthouse scan for an enrollment pack")
768
+ .action(async (enrollmentPackId, id, opts) => {
769
+ const client = await ctx.getClient();
770
+ if (ctx.verbose)
771
+ process.stderr.write(
772
+ `GET ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
773
+ );
774
+ const result = await client.get(
775
+ `/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses/${id}`,
776
+ );
777
+ ctx.output(result);
778
+ });
779
+
780
+ resource
781
+ .command("update-enrollment-pack-lighthouse <enrollment-pack-id> <id>")
782
+ .description("Update a Lighthouse scan for an enrollment pack")
783
+ .option("--body <json>", "Request body as JSON string")
784
+ .option("--body-file <path>", "Read request body from file")
785
+ .action(async (enrollmentPackId, id, opts) => {
786
+ const client = await ctx.getClient();
787
+ let body: unknown;
788
+ if (opts.bodyFile) {
789
+ const { readFileSync } = await import("fs");
790
+ body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
791
+ } else if (opts.body) {
792
+ body = ctx.parseBody(opts.body);
793
+ }
794
+ if (ctx.verbose)
795
+ process.stderr.write(
796
+ `PATCH ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
797
+ );
798
+ const result = await client.patch(
799
+ `/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses/${id}`,
800
+ body,
801
+ );
802
+ ctx.output(result);
803
+ });
804
+
805
+ resource
806
+ .command("delete-enrollment-pack-lighthouse <enrollment-pack-id> <id>")
807
+ .description("Delete a Lighthouse scan for an enrollment pack")
808
+ .action(async (enrollmentPackId, id, opts) => {
809
+ const client = await ctx.getClient();
810
+ if (ctx.verbose)
811
+ process.stderr.write(
812
+ `DELETE ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses/${id}`, "https://placeholder").pathname}\n`,
813
+ );
814
+ const result = await client.delete(
815
+ `/api/v202506/enrollment_packs/${enrollmentPackId}/lighthouses/${id}`,
816
+ );
817
+ ctx.output(result);
818
+ });
819
+ }