@fulldivevr/workcord-cli 1.0.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.
Files changed (82) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +312 -0
  3. package/dist/auth.js +9 -0
  4. package/dist/cli.js +46 -0
  5. package/dist/client.js +125 -0
  6. package/dist/commands/_group.js +5 -0
  7. package/dist/commands/auth.js +125 -0
  8. package/dist/commands/challenges.js +51 -0
  9. package/dist/commands/custom-agents.js +120 -0
  10. package/dist/commands/dm.js +35 -0
  11. package/dist/commands/messages.js +360 -0
  12. package/dist/commands/room-agents.js +47 -0
  13. package/dist/commands/rooms.js +687 -0
  14. package/dist/commands/users.js +126 -0
  15. package/dist/commands/whoami.js +15 -0
  16. package/dist/generated/_helpers.js +8 -0
  17. package/dist/generated/commands/activity.js +46 -0
  18. package/dist/generated/commands/ai.js +40 -0
  19. package/dist/generated/commands/ambassador.js +34 -0
  20. package/dist/generated/commands/apple-iap.js +61 -0
  21. package/dist/generated/commands/attribution.js +130 -0
  22. package/dist/generated/commands/auth.js +205 -0
  23. package/dist/generated/commands/challenges.js +251 -0
  24. package/dist/generated/commands/clips.js +71 -0
  25. package/dist/generated/commands/contact-match.js +92 -0
  26. package/dist/generated/commands/content-crawler.js +27 -0
  27. package/dist/generated/commands/custom-agents.js +346 -0
  28. package/dist/generated/commands/desktop-releases.js +236 -0
  29. package/dist/generated/commands/discover.js +236 -0
  30. package/dist/generated/commands/dm.js +155 -0
  31. package/dist/generated/commands/drafts.js +41 -0
  32. package/dist/generated/commands/embed.js +34 -0
  33. package/dist/generated/commands/explore.js +19 -0
  34. package/dist/generated/commands/feed.js +67 -0
  35. package/dist/generated/commands/feedback.js +44 -0
  36. package/dist/generated/commands/gamification.js +33 -0
  37. package/dist/generated/commands/google-play-iap.js +73 -0
  38. package/dist/generated/commands/health.js +32 -0
  39. package/dist/generated/commands/internal.js +162 -0
  40. package/dist/generated/commands/interview.js +76 -0
  41. package/dist/generated/commands/invite-redirect.js +20 -0
  42. package/dist/generated/commands/jesuscord-admin.js +36 -0
  43. package/dist/generated/commands/join.js +27 -0
  44. package/dist/generated/commands/kits.js +108 -0
  45. package/dist/generated/commands/meetings.js +81 -0
  46. package/dist/generated/commands/message-folders.js +68 -0
  47. package/dist/generated/commands/messages.js +418 -0
  48. package/dist/generated/commands/one-emulator.js +32 -0
  49. package/dist/generated/commands/pdf-export.js +19 -0
  50. package/dist/generated/commands/pin-folders.js +72 -0
  51. package/dist/generated/commands/pinned-messages.js +81 -0
  52. package/dist/generated/commands/polls.js +152 -0
  53. package/dist/generated/commands/premium-feeds.js +32 -0
  54. package/dist/generated/commands/processors.js +22 -0
  55. package/dist/generated/commands/questions.js +54 -0
  56. package/dist/generated/commands/referrals.js +19 -0
  57. package/dist/generated/commands/reports.js +21 -0
  58. package/dist/generated/commands/room-a2-a.js +81 -0
  59. package/dist/generated/commands/room-agents.js +273 -0
  60. package/dist/generated/commands/room-invites.js +155 -0
  61. package/dist/generated/commands/room-owned-agent.js +36 -0
  62. package/dist/generated/commands/room-page.js +20 -0
  63. package/dist/generated/commands/rooms.js +1117 -0
  64. package/dist/generated/commands/saved-messages.js +84 -0
  65. package/dist/generated/commands/saved-stories.js +125 -0
  66. package/dist/generated/commands/search.js +44 -0
  67. package/dist/generated/commands/shadow-home-agent.js +36 -0
  68. package/dist/generated/commands/shadow.js +64 -0
  69. package/dist/generated/commands/share-cards.js +85 -0
  70. package/dist/generated/commands/share.js +20 -0
  71. package/dist/generated/commands/sponsors.js +20 -0
  72. package/dist/generated/commands/stories.js +324 -0
  73. package/dist/generated/commands/story-by-id.js +20 -0
  74. package/dist/generated/commands/submissions.js +112 -0
  75. package/dist/generated/commands/subscriptions.js +103 -0
  76. package/dist/generated/commands/tips.js +76 -0
  77. package/dist/generated/commands/users.js +373 -0
  78. package/dist/generated/commands/voice-token.js +21 -0
  79. package/dist/generated/commands/well-known.js +32 -0
  80. package/dist/generated/commands/wrapped.js +20 -0
  81. package/dist/generated/index.js +131 -0
  82. package/package.json +60 -0
@@ -0,0 +1,1117 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "rooms", "Rooms operations");
5
+ if (!hasSubcommand(group, "list-rooms")) {
6
+ group
7
+ .command("list-rooms")
8
+ .description("GET /api/v1/rooms")
9
+ .option("--inbox-category <value>", "string")
10
+ .option("--status <value>", "string")
11
+ .option("--cursor <value>", "string")
12
+ .option("--limit <value>", "string")
13
+ .option("--include-shadow <value>", "string")
14
+ .option("--shadow-guidance-cards <value>", "string")
15
+ .action(async (opts) => {
16
+ const { as } = program.opts();
17
+ if (!as)
18
+ throw new Error("--as <userId> is required");
19
+ const path = `/api/v1/rooms`;
20
+ const query = {};
21
+ {
22
+ const v = opts.inboxCategory;
23
+ if (v !== undefined)
24
+ query["inboxCategory"] = v;
25
+ }
26
+ {
27
+ const v = opts.status;
28
+ if (v !== undefined)
29
+ query["status"] = v;
30
+ }
31
+ {
32
+ const v = opts.cursor;
33
+ if (v !== undefined)
34
+ query["cursor"] = v;
35
+ }
36
+ {
37
+ const v = opts.limit;
38
+ if (v !== undefined)
39
+ query["limit"] = v;
40
+ }
41
+ {
42
+ const v = opts.includeShadow;
43
+ if (v !== undefined)
44
+ query["includeShadow"] = v;
45
+ }
46
+ {
47
+ const v = opts.shadowGuidanceCards;
48
+ if (v !== undefined)
49
+ query["shadowGuidanceCards"] = v;
50
+ }
51
+ const data = await call({ method: "GET", path, asUserId: as, query });
52
+ process.stdout.write(JSON.stringify(data) + "\n");
53
+ });
54
+ }
55
+ if (!hasSubcommand(group, "create-room")) {
56
+ group
57
+ .command("create-room")
58
+ .description("POST /api/v1/rooms")
59
+ .requiredOption("--name <value>", "string, ≥1 chars")
60
+ .option("--type <value>", "string")
61
+ .option("--briefing-time <value>", "string")
62
+ .option("--briefing-languages <comma-separated>", "array")
63
+ .option("--sources <json>", "array (JSON)")
64
+ .option("--content-filters <json>", "object (JSON)")
65
+ .option("--is-public <true|false>", "boolean")
66
+ .option("--category <value>", "string")
67
+ .option("--tags <comma-separated>", "array")
68
+ .option("--language <value>", "string")
69
+ .option("--template-id <value>", "string")
70
+ .option("--access-level <value>", "string")
71
+ .option("--member-identity <value>", "string")
72
+ .option("--agents <comma-separated>", "array")
73
+ .option("--content-formats <comma-separated>", "array")
74
+ .option("--lens <value>", "string")
75
+ .option("--inbox-category <value>", "string")
76
+ .option("--in-room-agents <comma-separated>", "array")
77
+ .option("--description <value>", "string")
78
+ .option("--rules <value>", "string")
79
+ .option("--pin-permission <value>", "string")
80
+ .option("--only-admins-can-post <true|false>", "boolean")
81
+ .option("--web-app-url <value>", "string")
82
+ .option("--install-agent-id <value>", "string")
83
+ .option("--invite-permission <value>", "string")
84
+ .option("--slow-mode-seconds <n>", "number")
85
+ .option("--media-permission <value>", "string")
86
+ .option("--message-retention <n>", "number")
87
+ .option("--is-read-only <true|false>", "boolean")
88
+ .action(async (opts) => {
89
+ const { as } = program.opts();
90
+ if (!as)
91
+ throw new Error("--as <userId> is required");
92
+ const path = `/api/v1/rooms`;
93
+ const body = {};
94
+ {
95
+ const v = opts.name;
96
+ if (v !== undefined)
97
+ body["name"] = v;
98
+ }
99
+ {
100
+ const v = opts.type;
101
+ if (v !== undefined)
102
+ body["type"] = v;
103
+ }
104
+ {
105
+ const v = opts.briefingTime;
106
+ if (v !== undefined)
107
+ body["briefingTime"] = v;
108
+ }
109
+ {
110
+ const v = opts.briefingLanguages === undefined ? undefined : opts.briefingLanguages.split(",").map((s) => s.trim()).filter(Boolean);
111
+ if (v !== undefined)
112
+ body["briefingLanguages"] = v;
113
+ }
114
+ {
115
+ const v = opts.sources === undefined ? undefined : JSON.parse(opts.sources);
116
+ if (v !== undefined)
117
+ body["sources"] = v;
118
+ }
119
+ {
120
+ const v = opts.contentFilters === undefined ? undefined : JSON.parse(opts.contentFilters);
121
+ if (v !== undefined)
122
+ body["contentFilters"] = v;
123
+ }
124
+ {
125
+ const v = opts.isPublic === undefined ? undefined : opts.isPublic === "true";
126
+ if (v !== undefined)
127
+ body["isPublic"] = v;
128
+ }
129
+ {
130
+ const v = opts.category;
131
+ if (v !== undefined)
132
+ body["category"] = v;
133
+ }
134
+ {
135
+ const v = opts.tags === undefined ? undefined : opts.tags.split(",").map((s) => s.trim()).filter(Boolean);
136
+ if (v !== undefined)
137
+ body["tags"] = v;
138
+ }
139
+ {
140
+ const v = opts.language;
141
+ if (v !== undefined)
142
+ body["language"] = v;
143
+ }
144
+ {
145
+ const v = opts.templateId;
146
+ if (v !== undefined)
147
+ body["templateId"] = v;
148
+ }
149
+ {
150
+ const v = opts.accessLevel;
151
+ if (v !== undefined)
152
+ body["accessLevel"] = v;
153
+ }
154
+ {
155
+ const v = opts.memberIdentity;
156
+ if (v !== undefined)
157
+ body["memberIdentity"] = v;
158
+ }
159
+ {
160
+ const v = opts.agents === undefined ? undefined : opts.agents.split(",").map((s) => s.trim()).filter(Boolean);
161
+ if (v !== undefined)
162
+ body["agents"] = v;
163
+ }
164
+ {
165
+ const v = opts.contentFormats === undefined ? undefined : opts.contentFormats.split(",").map((s) => s.trim()).filter(Boolean);
166
+ if (v !== undefined)
167
+ body["contentFormats"] = v;
168
+ }
169
+ {
170
+ const v = opts.lens;
171
+ if (v !== undefined)
172
+ body["lens"] = v;
173
+ }
174
+ {
175
+ const v = opts.inboxCategory;
176
+ if (v !== undefined)
177
+ body["inboxCategory"] = v;
178
+ }
179
+ {
180
+ const v = opts.inRoomAgents === undefined ? undefined : opts.inRoomAgents.split(",").map((s) => s.trim()).filter(Boolean);
181
+ if (v !== undefined)
182
+ body["inRoomAgents"] = v;
183
+ }
184
+ {
185
+ const v = opts.description;
186
+ if (v !== undefined)
187
+ body["description"] = v;
188
+ }
189
+ {
190
+ const v = opts.rules;
191
+ if (v !== undefined)
192
+ body["rules"] = v;
193
+ }
194
+ {
195
+ const v = opts.pinPermission;
196
+ if (v !== undefined)
197
+ body["pinPermission"] = v;
198
+ }
199
+ {
200
+ const v = opts.onlyAdminsCanPost === undefined ? undefined : opts.onlyAdminsCanPost === "true";
201
+ if (v !== undefined)
202
+ body["onlyAdminsCanPost"] = v;
203
+ }
204
+ {
205
+ const v = opts.webAppUrl;
206
+ if (v !== undefined)
207
+ body["webAppUrl"] = v;
208
+ }
209
+ {
210
+ const v = opts.installAgentId;
211
+ if (v !== undefined)
212
+ body["installAgentId"] = v;
213
+ }
214
+ {
215
+ const v = opts.invitePermission;
216
+ if (v !== undefined)
217
+ body["invitePermission"] = v;
218
+ }
219
+ {
220
+ const v = opts.slowModeSeconds === undefined ? undefined : Number(opts.slowModeSeconds);
221
+ if (v !== undefined)
222
+ body["slowModeSeconds"] = v;
223
+ }
224
+ {
225
+ const v = opts.mediaPermission;
226
+ if (v !== undefined)
227
+ body["mediaPermission"] = v;
228
+ }
229
+ {
230
+ const v = opts.messageRetention === undefined ? undefined : Number(opts.messageRetention);
231
+ if (v !== undefined)
232
+ body["messageRetention"] = v;
233
+ }
234
+ {
235
+ const v = opts.isReadOnly === undefined ? undefined : opts.isReadOnly === "true";
236
+ if (v !== undefined)
237
+ body["isReadOnly"] = v;
238
+ }
239
+ const data = await call({ method: "POST", path, asUserId: as, body });
240
+ process.stdout.write(JSON.stringify(data) + "\n");
241
+ });
242
+ }
243
+ if (!hasSubcommand(group, "list-channel-templates")) {
244
+ group
245
+ .command("list-channel-templates")
246
+ .description("GET /api/v1/rooms/channel-templates")
247
+ .action(async (opts) => {
248
+ const { as } = program.opts();
249
+ if (!as)
250
+ throw new Error("--as <userId> is required");
251
+ const path = `/api/v1/rooms/channel-templates`;
252
+ const data = await call({ method: "GET", path, asUserId: as });
253
+ process.stdout.write(JSON.stringify(data) + "\n");
254
+ });
255
+ }
256
+ if (!hasSubcommand(group, "create-room-with-template")) {
257
+ group
258
+ .command("create-room-with-template")
259
+ .description("POST /api/v1/rooms/with-template")
260
+ .option("--body <json>", "request body as JSON (no schema available)")
261
+ .action(async (opts) => {
262
+ const { as } = program.opts();
263
+ if (!as)
264
+ throw new Error("--as <userId> is required");
265
+ const path = `/api/v1/rooms/with-template`;
266
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
267
+ const data = await call({ method: "POST", path, asUserId: as, body });
268
+ process.stdout.write(JSON.stringify(data) + "\n");
269
+ });
270
+ }
271
+ if (!hasSubcommand(group, "get-public-meta")) {
272
+ group
273
+ .command("get-public-meta")
274
+ .description("GET /api/v1/rooms/{roomId}/public-meta")
275
+ .requiredOption("--room-id <value>", "roomId (path param)")
276
+ .action(async (opts) => {
277
+ const { as } = program.opts();
278
+ if (!as)
279
+ throw new Error("--as <userId> is required");
280
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/public-meta`;
281
+ const data = await call({ method: "GET", path, asUserId: as });
282
+ process.stdout.write(JSON.stringify(data) + "\n");
283
+ });
284
+ }
285
+ if (!hasSubcommand(group, "get-by-slug")) {
286
+ group
287
+ .command("get-by-slug")
288
+ .description("GET /api/v1/rooms/by-slug/{slug}")
289
+ .requiredOption("--slug <value>", "slug (path param)")
290
+ .action(async (opts) => {
291
+ const { as } = program.opts();
292
+ if (!as)
293
+ throw new Error("--as <userId> is required");
294
+ const path = `/api/v1/rooms/by-slug/${encodeURIComponent(opts.slug)}`;
295
+ const data = await call({ method: "GET", path, asUserId: as });
296
+ process.stdout.write(JSON.stringify(data) + "\n");
297
+ });
298
+ }
299
+ if (!hasSubcommand(group, "resolve-by-code")) {
300
+ group
301
+ .command("resolve-by-code")
302
+ .description("GET /api/v1/rooms/resolve-code/{code}")
303
+ .requiredOption("--code <value>", "code (path param)")
304
+ .action(async (opts) => {
305
+ const { as } = program.opts();
306
+ if (!as)
307
+ throw new Error("--as <userId> is required");
308
+ const path = `/api/v1/rooms/resolve-code/${encodeURIComponent(opts.code)}`;
309
+ const data = await call({ method: "GET", path, asUserId: as });
310
+ process.stdout.write(JSON.stringify(data) + "\n");
311
+ });
312
+ }
313
+ if (!hasSubcommand(group, "preview-messages")) {
314
+ group
315
+ .command("preview-messages")
316
+ .description("GET /api/v1/rooms/{roomId}/preview-messages")
317
+ .requiredOption("--room-id <value>", "roomId (path param)")
318
+ .option("--limit <value>", "string")
319
+ .action(async (opts) => {
320
+ const { as } = program.opts();
321
+ if (!as)
322
+ throw new Error("--as <userId> is required");
323
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/preview-messages`;
324
+ const query = {};
325
+ {
326
+ const v = opts.limit;
327
+ if (v !== undefined)
328
+ query["limit"] = v;
329
+ }
330
+ const data = await call({ method: "GET", path, asUserId: as, query });
331
+ process.stdout.write(JSON.stringify(data) + "\n");
332
+ });
333
+ }
334
+ if (!hasSubcommand(group, "get-room")) {
335
+ group
336
+ .command("get-room")
337
+ .description("GET /api/v1/rooms/{roomId}")
338
+ .requiredOption("--room-id <value>", "roomId (path param)")
339
+ .action(async (opts) => {
340
+ const { as } = program.opts();
341
+ if (!as)
342
+ throw new Error("--as <userId> is required");
343
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}`;
344
+ const data = await call({ method: "GET", path, asUserId: as });
345
+ process.stdout.write(JSON.stringify(data) + "\n");
346
+ });
347
+ }
348
+ if (!hasSubcommand(group, "update-room")) {
349
+ group
350
+ .command("update-room")
351
+ .description("PATCH /api/v1/rooms/{roomId}")
352
+ .requiredOption("--room-id <value>", "roomId (path param)")
353
+ .option("--name <value>", "string, ≥1 chars")
354
+ .option("--briefing-time <value>", "string")
355
+ .option("--briefing-languages <comma-separated>", "array")
356
+ .option("--sources <json>", "array (JSON)")
357
+ .option("--content-filters <json>", "object (JSON)")
358
+ .option("--is-public <true|false>", "boolean")
359
+ .option("--category <value>", "string")
360
+ .option("--tags <comma-separated>", "array")
361
+ .option("--access-level <value>", "string")
362
+ .option("--member-identity <value>", "string")
363
+ .option("--agents <comma-separated>", "array")
364
+ .option("--content-formats <comma-separated>", "array")
365
+ .option("--lens <value>", "string")
366
+ .option("--inbox-category <value>", "string")
367
+ .option("--icon-url <value>", "string")
368
+ .option("--in-room-agents <comma-separated>", "array")
369
+ .option("--description <value>", "string")
370
+ .option("--rules <value>", "string")
371
+ .option("--pin-permission <value>", "string")
372
+ .option("--only-admins-can-post <true|false>", "boolean")
373
+ .option("--web-app-url <value>", "string")
374
+ .option("--invite-permission <value>", "string")
375
+ .option("--slow-mode-seconds <n>", "number")
376
+ .option("--media-permission <value>", "string")
377
+ .option("--member-limit <n>", "number")
378
+ .option("--message-retention <n>", "number")
379
+ .option("--is-read-only <true|false>", "boolean")
380
+ .action(async (opts) => {
381
+ const { as } = program.opts();
382
+ if (!as)
383
+ throw new Error("--as <userId> is required");
384
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}`;
385
+ const body = {};
386
+ {
387
+ const v = opts.name;
388
+ if (v !== undefined)
389
+ body["name"] = v;
390
+ }
391
+ {
392
+ const v = opts.briefingTime;
393
+ if (v !== undefined)
394
+ body["briefingTime"] = v;
395
+ }
396
+ {
397
+ const v = opts.briefingLanguages === undefined ? undefined : opts.briefingLanguages.split(",").map((s) => s.trim()).filter(Boolean);
398
+ if (v !== undefined)
399
+ body["briefingLanguages"] = v;
400
+ }
401
+ {
402
+ const v = opts.sources === undefined ? undefined : JSON.parse(opts.sources);
403
+ if (v !== undefined)
404
+ body["sources"] = v;
405
+ }
406
+ {
407
+ const v = opts.contentFilters === undefined ? undefined : JSON.parse(opts.contentFilters);
408
+ if (v !== undefined)
409
+ body["contentFilters"] = v;
410
+ }
411
+ {
412
+ const v = opts.isPublic === undefined ? undefined : opts.isPublic === "true";
413
+ if (v !== undefined)
414
+ body["isPublic"] = v;
415
+ }
416
+ {
417
+ const v = opts.category;
418
+ if (v !== undefined)
419
+ body["category"] = v;
420
+ }
421
+ {
422
+ const v = opts.tags === undefined ? undefined : opts.tags.split(",").map((s) => s.trim()).filter(Boolean);
423
+ if (v !== undefined)
424
+ body["tags"] = v;
425
+ }
426
+ {
427
+ const v = opts.accessLevel;
428
+ if (v !== undefined)
429
+ body["accessLevel"] = v;
430
+ }
431
+ {
432
+ const v = opts.memberIdentity;
433
+ if (v !== undefined)
434
+ body["memberIdentity"] = v;
435
+ }
436
+ {
437
+ const v = opts.agents === undefined ? undefined : opts.agents.split(",").map((s) => s.trim()).filter(Boolean);
438
+ if (v !== undefined)
439
+ body["agents"] = v;
440
+ }
441
+ {
442
+ const v = opts.contentFormats === undefined ? undefined : opts.contentFormats.split(",").map((s) => s.trim()).filter(Boolean);
443
+ if (v !== undefined)
444
+ body["contentFormats"] = v;
445
+ }
446
+ {
447
+ const v = opts.lens;
448
+ if (v !== undefined)
449
+ body["lens"] = v;
450
+ }
451
+ {
452
+ const v = opts.inboxCategory;
453
+ if (v !== undefined)
454
+ body["inboxCategory"] = v;
455
+ }
456
+ {
457
+ const v = opts.iconUrl;
458
+ if (v !== undefined)
459
+ body["iconUrl"] = v;
460
+ }
461
+ {
462
+ const v = opts.inRoomAgents === undefined ? undefined : opts.inRoomAgents.split(",").map((s) => s.trim()).filter(Boolean);
463
+ if (v !== undefined)
464
+ body["inRoomAgents"] = v;
465
+ }
466
+ {
467
+ const v = opts.description;
468
+ if (v !== undefined)
469
+ body["description"] = v;
470
+ }
471
+ {
472
+ const v = opts.rules;
473
+ if (v !== undefined)
474
+ body["rules"] = v;
475
+ }
476
+ {
477
+ const v = opts.pinPermission;
478
+ if (v !== undefined)
479
+ body["pinPermission"] = v;
480
+ }
481
+ {
482
+ const v = opts.onlyAdminsCanPost === undefined ? undefined : opts.onlyAdminsCanPost === "true";
483
+ if (v !== undefined)
484
+ body["onlyAdminsCanPost"] = v;
485
+ }
486
+ {
487
+ const v = opts.webAppUrl;
488
+ if (v !== undefined)
489
+ body["webAppUrl"] = v;
490
+ }
491
+ {
492
+ const v = opts.invitePermission;
493
+ if (v !== undefined)
494
+ body["invitePermission"] = v;
495
+ }
496
+ {
497
+ const v = opts.slowModeSeconds === undefined ? undefined : Number(opts.slowModeSeconds);
498
+ if (v !== undefined)
499
+ body["slowModeSeconds"] = v;
500
+ }
501
+ {
502
+ const v = opts.mediaPermission;
503
+ if (v !== undefined)
504
+ body["mediaPermission"] = v;
505
+ }
506
+ {
507
+ const v = opts.memberLimit === undefined ? undefined : Number(opts.memberLimit);
508
+ if (v !== undefined)
509
+ body["memberLimit"] = v;
510
+ }
511
+ {
512
+ const v = opts.messageRetention === undefined ? undefined : Number(opts.messageRetention);
513
+ if (v !== undefined)
514
+ body["messageRetention"] = v;
515
+ }
516
+ {
517
+ const v = opts.isReadOnly === undefined ? undefined : opts.isReadOnly === "true";
518
+ if (v !== undefined)
519
+ body["isReadOnly"] = v;
520
+ }
521
+ const data = await call({ method: "PATCH", path, asUserId: as, body });
522
+ process.stdout.write(JSON.stringify(data) + "\n");
523
+ });
524
+ }
525
+ if (!hasSubcommand(group, "delete-room")) {
526
+ group
527
+ .command("delete-room")
528
+ .description("DELETE /api/v1/rooms/{roomId}")
529
+ .requiredOption("--room-id <value>", "roomId (path param)")
530
+ .action(async (opts) => {
531
+ const { as } = program.opts();
532
+ if (!as)
533
+ throw new Error("--as <userId> is required");
534
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}`;
535
+ const data = await call({ method: "DELETE", path, asUserId: as });
536
+ process.stdout.write(JSON.stringify(data) + "\n");
537
+ });
538
+ }
539
+ if (!hasSubcommand(group, "bootstrap")) {
540
+ group
541
+ .command("bootstrap")
542
+ .description("GET /api/v1/rooms/{roomId}/bootstrap")
543
+ .requiredOption("--room-id <value>", "roomId (path param)")
544
+ .action(async (opts) => {
545
+ const { as } = program.opts();
546
+ if (!as)
547
+ throw new Error("--as <userId> is required");
548
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/bootstrap`;
549
+ const data = await call({ method: "GET", path, asUserId: as });
550
+ process.stdout.write(JSON.stringify(data) + "\n");
551
+ });
552
+ }
553
+ if (!hasSubcommand(group, "upload-room-icon")) {
554
+ group
555
+ .command("upload-room-icon")
556
+ .description("POST /api/v1/rooms/{roomId}/icon")
557
+ .requiredOption("--room-id <value>", "roomId (path param)")
558
+ .option("--body <json>", "request body as JSON (no schema available)")
559
+ .action(async (opts) => {
560
+ const { as } = program.opts();
561
+ if (!as)
562
+ throw new Error("--as <userId> is required");
563
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/icon`;
564
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
565
+ const data = await call({ method: "POST", path, asUserId: as, body });
566
+ process.stdout.write(JSON.stringify(data) + "\n");
567
+ });
568
+ }
569
+ if (!hasSubcommand(group, "upload-image")) {
570
+ group
571
+ .command("upload-image")
572
+ .description("POST /api/v1/rooms/{roomId}/images")
573
+ .requiredOption("--room-id <value>", "roomId (path param)")
574
+ .option("--body <json>", "request body as JSON (no schema available)")
575
+ .action(async (opts) => {
576
+ const { as } = program.opts();
577
+ if (!as)
578
+ throw new Error("--as <userId> is required");
579
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/images`;
580
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
581
+ const data = await call({ method: "POST", path, asUserId: as, body });
582
+ process.stdout.write(JSON.stringify(data) + "\n");
583
+ });
584
+ }
585
+ if (!hasSubcommand(group, "upload-file")) {
586
+ group
587
+ .command("upload-file")
588
+ .description("POST /api/v1/rooms/{roomId}/files")
589
+ .requiredOption("--room-id <value>", "roomId (path param)")
590
+ .option("--body <json>", "request body as JSON (no schema available)")
591
+ .action(async (opts) => {
592
+ const { as } = program.opts();
593
+ if (!as)
594
+ throw new Error("--as <userId> is required");
595
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/files`;
596
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
597
+ const data = await call({ method: "POST", path, asUserId: as, body });
598
+ process.stdout.write(JSON.stringify(data) + "\n");
599
+ });
600
+ }
601
+ if (!hasSubcommand(group, "create-file-upload-session")) {
602
+ group
603
+ .command("create-file-upload-session")
604
+ .description("POST /api/v1/rooms/{roomId}/files/upload-session")
605
+ .requiredOption("--room-id <value>", "roomId (path param)")
606
+ .option("--body <json>", "request body as JSON (no schema available)")
607
+ .action(async (opts) => {
608
+ const { as } = program.opts();
609
+ if (!as)
610
+ throw new Error("--as <userId> is required");
611
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/files/upload-session`;
612
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
613
+ const data = await call({ method: "POST", path, asUserId: as, body });
614
+ process.stdout.write(JSON.stringify(data) + "\n");
615
+ });
616
+ }
617
+ if (!hasSubcommand(group, "complete-file-upload")) {
618
+ group
619
+ .command("complete-file-upload")
620
+ .description("POST /api/v1/rooms/{roomId}/files/complete")
621
+ .requiredOption("--room-id <value>", "roomId (path param)")
622
+ .option("--body <json>", "request body as JSON (no schema available)")
623
+ .action(async (opts) => {
624
+ const { as } = program.opts();
625
+ if (!as)
626
+ throw new Error("--as <userId> is required");
627
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/files/complete`;
628
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
629
+ const data = await call({ method: "POST", path, asUserId: as, body });
630
+ process.stdout.write(JSON.stringify(data) + "\n");
631
+ });
632
+ }
633
+ if (!hasSubcommand(group, "join-room")) {
634
+ group
635
+ .command("join-room")
636
+ .description("POST /api/v1/rooms/{roomId}/join")
637
+ .requiredOption("--room-id <value>", "roomId (path param)")
638
+ .option("--join-code <value>", "string")
639
+ .option("--invite-token <value>", "string")
640
+ .option("--ref <value>", "string")
641
+ .action(async (opts) => {
642
+ const { as } = program.opts();
643
+ if (!as)
644
+ throw new Error("--as <userId> is required");
645
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join`;
646
+ const body = {};
647
+ {
648
+ const v = opts.joinCode;
649
+ if (v !== undefined)
650
+ body["joinCode"] = v;
651
+ }
652
+ {
653
+ const v = opts.inviteToken;
654
+ if (v !== undefined)
655
+ body["inviteToken"] = v;
656
+ }
657
+ {
658
+ const v = opts.ref;
659
+ if (v !== undefined)
660
+ body["ref"] = v;
661
+ }
662
+ const data = await call({ method: "POST", path, asUserId: as, body });
663
+ process.stdout.write(JSON.stringify(data) + "\n");
664
+ });
665
+ }
666
+ if (!hasSubcommand(group, "mark-room-read")) {
667
+ group
668
+ .command("mark-room-read")
669
+ .description("POST /api/v1/rooms/{roomId}/read")
670
+ .requiredOption("--room-id <value>", "roomId (path param)")
671
+ .option("--body <json>", "request body as JSON (no schema available)")
672
+ .action(async (opts) => {
673
+ const { as } = program.opts();
674
+ if (!as)
675
+ throw new Error("--as <userId> is required");
676
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/read`;
677
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
678
+ const data = await call({ method: "POST", path, asUserId: as, body });
679
+ process.stdout.write(JSON.stringify(data) + "\n");
680
+ });
681
+ }
682
+ if (!hasSubcommand(group, "leave-room")) {
683
+ group
684
+ .command("leave-room")
685
+ .description("POST /api/v1/rooms/{roomId}/leave")
686
+ .requiredOption("--room-id <value>", "roomId (path param)")
687
+ .option("--body <json>", "request body as JSON (no schema available)")
688
+ .action(async (opts) => {
689
+ const { as } = program.opts();
690
+ if (!as)
691
+ throw new Error("--as <userId> is required");
692
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/leave`;
693
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
694
+ const data = await call({ method: "POST", path, asUserId: as, body });
695
+ process.stdout.write(JSON.stringify(data) + "\n");
696
+ });
697
+ }
698
+ if (!hasSubcommand(group, "member-counts")) {
699
+ group
700
+ .command("member-counts")
701
+ .description("GET /api/v1/rooms/{roomId}/members/counts")
702
+ .requiredOption("--room-id <value>", "roomId (path param)")
703
+ .action(async (opts) => {
704
+ const { as } = program.opts();
705
+ if (!as)
706
+ throw new Error("--as <userId> is required");
707
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members/counts`;
708
+ const data = await call({ method: "GET", path, asUserId: as });
709
+ process.stdout.write(JSON.stringify(data) + "\n");
710
+ });
711
+ }
712
+ if (!hasSubcommand(group, "list-members")) {
713
+ group
714
+ .command("list-members")
715
+ .description("GET /api/v1/rooms/{roomId}/members")
716
+ .requiredOption("--room-id <value>", "roomId (path param)")
717
+ .option("--cursor <value>", "string")
718
+ .option("--limit <value>", "string")
719
+ .option("--sort <value>", "string")
720
+ .option("--exclude-guests <value>", "string")
721
+ .option("--query <value>", "string")
722
+ .action(async (opts) => {
723
+ const { as } = program.opts();
724
+ if (!as)
725
+ throw new Error("--as <userId> is required");
726
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members`;
727
+ const query = {};
728
+ {
729
+ const v = opts.cursor;
730
+ if (v !== undefined)
731
+ query["cursor"] = v;
732
+ }
733
+ {
734
+ const v = opts.limit;
735
+ if (v !== undefined)
736
+ query["limit"] = v;
737
+ }
738
+ {
739
+ const v = opts.sort;
740
+ if (v !== undefined)
741
+ query["sort"] = v;
742
+ }
743
+ {
744
+ const v = opts.excludeGuests;
745
+ if (v !== undefined)
746
+ query["excludeGuests"] = v;
747
+ }
748
+ {
749
+ const v = opts.query;
750
+ if (v !== undefined)
751
+ query["query"] = v;
752
+ }
753
+ const data = await call({ method: "GET", path, asUserId: as, query });
754
+ process.stdout.write(JSON.stringify(data) + "\n");
755
+ });
756
+ }
757
+ if (!hasSubcommand(group, "update-member")) {
758
+ group
759
+ .command("update-member")
760
+ .description("PATCH /api/v1/rooms/{roomId}/members/{userId}")
761
+ .requiredOption("--room-id <value>", "roomId (path param)")
762
+ .requiredOption("--user-id <value>", "userId (path param)")
763
+ .option("--body <json>", "request body as JSON (no schema available)")
764
+ .action(async (opts) => {
765
+ const { as } = program.opts();
766
+ if (!as)
767
+ throw new Error("--as <userId> is required");
768
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members/${encodeURIComponent(opts.userId)}`;
769
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
770
+ const data = await call({ method: "PATCH", path, asUserId: as, body });
771
+ process.stdout.write(JSON.stringify(data) + "\n");
772
+ });
773
+ }
774
+ if (!hasSubcommand(group, "remove-member")) {
775
+ group
776
+ .command("remove-member")
777
+ .description("DELETE /api/v1/rooms/{roomId}/members/{userId}")
778
+ .requiredOption("--room-id <value>", "roomId (path param)")
779
+ .requiredOption("--user-id <value>", "userId (path param)")
780
+ .action(async (opts) => {
781
+ const { as } = program.opts();
782
+ if (!as)
783
+ throw new Error("--as <userId> is required");
784
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members/${encodeURIComponent(opts.userId)}`;
785
+ const data = await call({ method: "DELETE", path, asUserId: as });
786
+ process.stdout.write(JSON.stringify(data) + "\n");
787
+ });
788
+ }
789
+ if (!hasSubcommand(group, "get-membership")) {
790
+ group
791
+ .command("get-membership")
792
+ .description("GET /api/v1/rooms/{roomId}/membership")
793
+ .requiredOption("--room-id <value>", "roomId (path param)")
794
+ .action(async (opts) => {
795
+ const { as } = program.opts();
796
+ if (!as)
797
+ throw new Error("--as <userId> is required");
798
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/membership`;
799
+ const data = await call({ method: "GET", path, asUserId: as });
800
+ process.stdout.write(JSON.stringify(data) + "\n");
801
+ });
802
+ }
803
+ if (!hasSubcommand(group, "update-membership")) {
804
+ group
805
+ .command("update-membership")
806
+ .description("PATCH /api/v1/rooms/{roomId}/membership")
807
+ .requiredOption("--room-id <value>", "roomId (path param)")
808
+ .option("--body <json>", "request body as JSON (no schema available)")
809
+ .action(async (opts) => {
810
+ const { as } = program.opts();
811
+ if (!as)
812
+ throw new Error("--as <userId> is required");
813
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/membership`;
814
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
815
+ const data = await call({ method: "PATCH", path, asUserId: as, body });
816
+ process.stdout.write(JSON.stringify(data) + "\n");
817
+ });
818
+ }
819
+ if (!hasSubcommand(group, "list-join-requests")) {
820
+ group
821
+ .command("list-join-requests")
822
+ .description("GET /api/v1/rooms/{roomId}/join-requests")
823
+ .requiredOption("--room-id <value>", "roomId (path param)")
824
+ .option("--status <value>", "string")
825
+ .option("--cursor <value>", "string")
826
+ .option("--limit <value>", "string")
827
+ .action(async (opts) => {
828
+ const { as } = program.opts();
829
+ if (!as)
830
+ throw new Error("--as <userId> is required");
831
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-requests`;
832
+ const query = {};
833
+ {
834
+ const v = opts.status;
835
+ if (v !== undefined)
836
+ query["status"] = v;
837
+ }
838
+ {
839
+ const v = opts.cursor;
840
+ if (v !== undefined)
841
+ query["cursor"] = v;
842
+ }
843
+ {
844
+ const v = opts.limit;
845
+ if (v !== undefined)
846
+ query["limit"] = v;
847
+ }
848
+ const data = await call({ method: "GET", path, asUserId: as, query });
849
+ process.stdout.write(JSON.stringify(data) + "\n");
850
+ });
851
+ }
852
+ if (!hasSubcommand(group, "approve-join-request")) {
853
+ group
854
+ .command("approve-join-request")
855
+ .description("POST /api/v1/rooms/{roomId}/join-requests/{requestId}/approve")
856
+ .requiredOption("--room-id <value>", "roomId (path param)")
857
+ .requiredOption("--request-id <value>", "requestId (path param)")
858
+ .option("--body <json>", "request body as JSON (no schema available)")
859
+ .action(async (opts) => {
860
+ const { as } = program.opts();
861
+ if (!as)
862
+ throw new Error("--as <userId> is required");
863
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-requests/${encodeURIComponent(opts.requestId)}/approve`;
864
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
865
+ const data = await call({ method: "POST", path, asUserId: as, body });
866
+ process.stdout.write(JSON.stringify(data) + "\n");
867
+ });
868
+ }
869
+ if (!hasSubcommand(group, "deny-join-request")) {
870
+ group
871
+ .command("deny-join-request")
872
+ .description("POST /api/v1/rooms/{roomId}/join-requests/{requestId}/deny")
873
+ .requiredOption("--room-id <value>", "roomId (path param)")
874
+ .requiredOption("--request-id <value>", "requestId (path param)")
875
+ .option("--body <json>", "request body as JSON (no schema available)")
876
+ .action(async (opts) => {
877
+ const { as } = program.opts();
878
+ if (!as)
879
+ throw new Error("--as <userId> is required");
880
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-requests/${encodeURIComponent(opts.requestId)}/deny`;
881
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
882
+ const data = await call({ method: "POST", path, asUserId: as, body });
883
+ process.stdout.write(JSON.stringify(data) + "\n");
884
+ });
885
+ }
886
+ if (!hasSubcommand(group, "get-join-request-status")) {
887
+ group
888
+ .command("get-join-request-status")
889
+ .description("GET /api/v1/rooms/{roomId}/join-request-status")
890
+ .requiredOption("--room-id <value>", "roomId (path param)")
891
+ .action(async (opts) => {
892
+ const { as } = program.opts();
893
+ if (!as)
894
+ throw new Error("--as <userId> is required");
895
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-request-status`;
896
+ const data = await call({ method: "GET", path, asUserId: as });
897
+ process.stdout.write(JSON.stringify(data) + "\n");
898
+ });
899
+ }
900
+ if (!hasSubcommand(group, "regenerate-join-code")) {
901
+ group
902
+ .command("regenerate-join-code")
903
+ .description("POST /api/v1/rooms/{roomId}/regenerate-join-code")
904
+ .requiredOption("--room-id <value>", "roomId (path param)")
905
+ .option("--body <json>", "request body as JSON (no schema available)")
906
+ .action(async (opts) => {
907
+ const { as } = program.opts();
908
+ if (!as)
909
+ throw new Error("--as <userId> is required");
910
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/regenerate-join-code`;
911
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
912
+ const data = await call({ method: "POST", path, asUserId: as, body });
913
+ process.stdout.write(JSON.stringify(data) + "\n");
914
+ });
915
+ }
916
+ if (!hasSubcommand(group, "get-embed")) {
917
+ group
918
+ .command("get-embed")
919
+ .description("GET /api/v1/rooms/{roomId}/embed")
920
+ .requiredOption("--room-id <value>", "roomId (path param)")
921
+ .action(async (opts) => {
922
+ const { as } = program.opts();
923
+ if (!as)
924
+ throw new Error("--as <userId> is required");
925
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/embed`;
926
+ const data = await call({ method: "GET", path, asUserId: as });
927
+ process.stdout.write(JSON.stringify(data) + "\n");
928
+ });
929
+ }
930
+ if (!hasSubcommand(group, "get-collection-config")) {
931
+ group
932
+ .command("get-collection-config")
933
+ .description("GET /api/v1/rooms/{roomId}/collection-config")
934
+ .requiredOption("--room-id <value>", "roomId (path param)")
935
+ .action(async (opts) => {
936
+ const { as } = program.opts();
937
+ if (!as)
938
+ throw new Error("--as <userId> is required");
939
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/collection-config`;
940
+ const data = await call({ method: "GET", path, asUserId: as });
941
+ process.stdout.write(JSON.stringify(data) + "\n");
942
+ });
943
+ }
944
+ if (!hasSubcommand(group, "update-collection-config")) {
945
+ group
946
+ .command("update-collection-config")
947
+ .description("PATCH /api/v1/rooms/{roomId}/collection-config")
948
+ .requiredOption("--room-id <value>", "roomId (path param)")
949
+ .option("--body <json>", "request body as JSON (no schema available)")
950
+ .action(async (opts) => {
951
+ const { as } = program.opts();
952
+ if (!as)
953
+ throw new Error("--as <userId> is required");
954
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/collection-config`;
955
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
956
+ const data = await call({ method: "PATCH", path, asUserId: as, body });
957
+ process.stdout.write(JSON.stringify(data) + "\n");
958
+ });
959
+ }
960
+ if (!hasSubcommand(group, "get-ctx-config")) {
961
+ group
962
+ .command("get-ctx-config")
963
+ .description("GET /api/v1/rooms/{roomId}/ctx-config")
964
+ .requiredOption("--room-id <value>", "roomId (path param)")
965
+ .action(async (opts) => {
966
+ const { as } = program.opts();
967
+ if (!as)
968
+ throw new Error("--as <userId> is required");
969
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx-config`;
970
+ const data = await call({ method: "GET", path, asUserId: as });
971
+ process.stdout.write(JSON.stringify(data) + "\n");
972
+ });
973
+ }
974
+ if (!hasSubcommand(group, "update-ctx-config")) {
975
+ group
976
+ .command("update-ctx-config")
977
+ .description("PATCH /api/v1/rooms/{roomId}/ctx-config")
978
+ .requiredOption("--room-id <value>", "roomId (path param)")
979
+ .option("--body <json>", "request body as JSON (no schema available)")
980
+ .action(async (opts) => {
981
+ const { as } = program.opts();
982
+ if (!as)
983
+ throw new Error("--as <userId> is required");
984
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx-config`;
985
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
986
+ const data = await call({ method: "PATCH", path, asUserId: as, body });
987
+ process.stdout.write(JSON.stringify(data) + "\n");
988
+ });
989
+ }
990
+ if (!hasSubcommand(group, "get-room-wiki")) {
991
+ group
992
+ .command("get-room-wiki")
993
+ .description("GET /api/v1/rooms/{roomId}/wiki")
994
+ .requiredOption("--room-id <value>", "roomId (path param)")
995
+ .action(async (opts) => {
996
+ const { as } = program.opts();
997
+ if (!as)
998
+ throw new Error("--as <userId> is required");
999
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/wiki`;
1000
+ const data = await call({ method: "GET", path, asUserId: as });
1001
+ process.stdout.write(JSON.stringify(data) + "\n");
1002
+ });
1003
+ }
1004
+ if (!hasSubcommand(group, "search-room-wiki")) {
1005
+ group
1006
+ .command("search-room-wiki")
1007
+ .description("GET /api/v1/rooms/{roomId}/wiki/search")
1008
+ .requiredOption("--room-id <value>", "roomId (path param)")
1009
+ .requiredOption("--q <value>", "string")
1010
+ .action(async (opts) => {
1011
+ const { as } = program.opts();
1012
+ if (!as)
1013
+ throw new Error("--as <userId> is required");
1014
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/wiki/search`;
1015
+ const query = {};
1016
+ {
1017
+ const v = opts.q;
1018
+ if (v !== undefined)
1019
+ query["q"] = v;
1020
+ }
1021
+ const data = await call({ method: "GET", path, asUserId: as, query });
1022
+ process.stdout.write(JSON.stringify(data) + "\n");
1023
+ });
1024
+ }
1025
+ if (!hasSubcommand(group, "get-room-wiki-page")) {
1026
+ group
1027
+ .command("get-room-wiki-page")
1028
+ .description("GET /api/v1/rooms/{roomId}/wiki/pages/{slug}")
1029
+ .requiredOption("--room-id <value>", "roomId (path param)")
1030
+ .requiredOption("--slug <value>", "slug (path param)")
1031
+ .action(async (opts) => {
1032
+ const { as } = program.opts();
1033
+ if (!as)
1034
+ throw new Error("--as <userId> is required");
1035
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/wiki/pages/${encodeURIComponent(opts.slug)}`;
1036
+ const data = await call({ method: "GET", path, asUserId: as });
1037
+ process.stdout.write(JSON.stringify(data) + "\n");
1038
+ });
1039
+ }
1040
+ if (!hasSubcommand(group, "get-ctx")) {
1041
+ group
1042
+ .command("get-ctx")
1043
+ .description("GET /api/v1/rooms/{roomId}/ctx")
1044
+ .requiredOption("--room-id <value>", "roomId (path param)")
1045
+ .action(async (opts) => {
1046
+ const { as } = program.opts();
1047
+ if (!as)
1048
+ throw new Error("--as <userId> is required");
1049
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx`;
1050
+ const data = await call({ method: "GET", path, asUserId: as });
1051
+ process.stdout.write(JSON.stringify(data) + "\n");
1052
+ });
1053
+ }
1054
+ if (!hasSubcommand(group, "run-ctx")) {
1055
+ group
1056
+ .command("run-ctx")
1057
+ .description("POST /api/v1/rooms/{roomId}/ctx/run")
1058
+ .requiredOption("--room-id <value>", "roomId (path param)")
1059
+ .option("--body <json>", "request body as JSON (no schema available)")
1060
+ .action(async (opts) => {
1061
+ const { as } = program.opts();
1062
+ if (!as)
1063
+ throw new Error("--as <userId> is required");
1064
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx/run`;
1065
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
1066
+ const data = await call({ method: "POST", path, asUserId: as, body });
1067
+ process.stdout.write(JSON.stringify(data) + "\n");
1068
+ });
1069
+ }
1070
+ if (!hasSubcommand(group, "collect-stories")) {
1071
+ group
1072
+ .command("collect-stories")
1073
+ .description("POST /api/v1/rooms/{roomId}/collect")
1074
+ .requiredOption("--room-id <value>", "roomId (path param)")
1075
+ .option("--body <json>", "request body as JSON (no schema available)")
1076
+ .action(async (opts) => {
1077
+ const { as } = program.opts();
1078
+ if (!as)
1079
+ throw new Error("--as <userId> is required");
1080
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/collect`;
1081
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
1082
+ const data = await call({ method: "POST", path, asUserId: as, body });
1083
+ process.stdout.write(JSON.stringify(data) + "\n");
1084
+ });
1085
+ }
1086
+ if (!hasSubcommand(group, "list-channels")) {
1087
+ group
1088
+ .command("list-channels")
1089
+ .description("GET /api/v1/rooms/{roomId}/channels")
1090
+ .requiredOption("--room-id <value>", "roomId (path param)")
1091
+ .action(async (opts) => {
1092
+ const { as } = program.opts();
1093
+ if (!as)
1094
+ throw new Error("--as <userId> is required");
1095
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/channels`;
1096
+ const data = await call({ method: "GET", path, asUserId: as });
1097
+ process.stdout.write(JSON.stringify(data) + "\n");
1098
+ });
1099
+ }
1100
+ if (!hasSubcommand(group, "create-channel")) {
1101
+ group
1102
+ .command("create-channel")
1103
+ .description("POST /api/v1/rooms/{roomId}/channels")
1104
+ .requiredOption("--room-id <value>", "roomId (path param)")
1105
+ .option("--body <json>", "request body as JSON (no schema available)")
1106
+ .action(async (opts) => {
1107
+ const { as } = program.opts();
1108
+ if (!as)
1109
+ throw new Error("--as <userId> is required");
1110
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/channels`;
1111
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
1112
+ const data = await call({ method: "POST", path, asUserId: as, body });
1113
+ process.stdout.write(JSON.stringify(data) + "\n");
1114
+ });
1115
+ }
1116
+ }
1117
+ //# sourceMappingURL=rooms.js.map