@fulldivevr/workcord-cli 1.0.0 → 1.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.
- package/README.md +67 -25
- package/dist/auth.js +38 -4
- package/dist/client.js +5 -5
- package/dist/commands/auth.js +7 -2
- package/dist/commands/challenges.js +2 -7
- package/dist/commands/custom-agents.js +3 -8
- package/dist/commands/dm.js +2 -3
- package/dist/commands/messages.js +8 -21
- package/dist/commands/room-agents.js +2 -7
- package/dist/commands/rooms.js +24 -31
- package/dist/commands/users.js +4 -9
- package/dist/commands/whoami.js +24 -7
- package/dist/generated/commands/activity.js +3 -6
- package/dist/generated/commands/ai.js +3 -6
- package/dist/generated/commands/ambassador.js +3 -6
- package/dist/generated/commands/apple-iap.js +4 -9
- package/dist/generated/commands/attribution.js +6 -15
- package/dist/generated/commands/auth.js +9 -24
- package/dist/generated/commands/challenges.js +13 -36
- package/dist/generated/commands/clips.js +3 -6
- package/dist/generated/commands/contact-match.js +7 -18
- package/dist/generated/commands/content-crawler.js +2 -3
- package/dist/generated/commands/custom-agents.js +22 -63
- package/dist/generated/commands/desktop-releases.js +5 -12
- package/dist/generated/commands/discover.js +9 -24
- package/dist/generated/commands/dm.js +10 -27
- package/dist/generated/commands/drafts.js +3 -6
- package/dist/generated/commands/embed.js +3 -6
- package/dist/generated/commands/explore.js +2 -3
- package/dist/generated/commands/feed.js +4 -9
- package/dist/generated/commands/feedback.js +2 -3
- package/dist/generated/commands/gamification.js +3 -6
- package/dist/generated/commands/google-play-iap.js +4 -9
- package/dist/generated/commands/health.js +3 -6
- package/dist/generated/commands/internal.js +9 -24
- package/dist/generated/commands/interview.js +4 -9
- package/dist/generated/commands/invite-redirect.js +2 -3
- package/dist/generated/commands/jesuscord-admin.js +3 -6
- package/dist/generated/commands/join.js +2 -3
- package/dist/generated/commands/kits.js +7 -18
- package/dist/generated/commands/meetings.js +6 -15
- package/dist/generated/commands/message-folders.js +5 -12
- package/dist/generated/commands/messages.js +17 -48
- package/dist/generated/commands/one-emulator.js +2 -3
- package/dist/generated/commands/pdf-export.js +2 -3
- package/dist/generated/commands/pin-folders.js +5 -12
- package/dist/generated/commands/pinned-messages.js +4 -9
- package/dist/generated/commands/polls.js +6 -15
- package/dist/generated/commands/premium-feeds.js +2 -3
- package/dist/generated/commands/processors.js +2 -3
- package/dist/generated/commands/questions.js +3 -6
- package/dist/generated/commands/referrals.js +2 -3
- package/dist/generated/commands/reports.js +2 -3
- package/dist/generated/commands/room-a2-a.js +6 -15
- package/dist/generated/commands/room-agents.js +13 -36
- package/dist/generated/commands/room-invites.js +9 -24
- package/dist/generated/commands/room-owned-agent.js +3 -6
- package/dist/generated/commands/room-page.js +2 -3
- package/dist/generated/commands/rooms.js +45 -132
- package/dist/generated/commands/saved-messages.js +4 -9
- package/dist/generated/commands/saved-stories.js +7 -18
- package/dist/generated/commands/search.js +2 -3
- package/dist/generated/commands/shadow-home-agent.js +3 -6
- package/dist/generated/commands/shadow.js +5 -12
- package/dist/generated/commands/share-cards.js +4 -9
- package/dist/generated/commands/share.js +2 -3
- package/dist/generated/commands/sponsors.js +2 -3
- package/dist/generated/commands/stories.js +12 -33
- package/dist/generated/commands/story-by-id.js +2 -3
- package/dist/generated/commands/submissions.js +4 -9
- package/dist/generated/commands/subscriptions.js +8 -21
- package/dist/generated/commands/tips.js +3 -6
- package/dist/generated/commands/users.js +16 -45
- package/dist/generated/commands/voice-token.js +2 -3
- package/dist/generated/commands/well-known.js +3 -6
- package/dist/generated/commands/wrapped.js +2 -3
- package/package.json +3 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
2
3
|
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
4
|
export function register(program) {
|
|
4
5
|
const group = getOrCreateGroup(program, "rooms", "Rooms operations");
|
|
@@ -13,9 +14,7 @@ export function register(program) {
|
|
|
13
14
|
.option("--include-shadow <value>", "string")
|
|
14
15
|
.option("--shadow-guidance-cards <value>", "string")
|
|
15
16
|
.action(async (opts) => {
|
|
16
|
-
const
|
|
17
|
-
if (!as)
|
|
18
|
-
throw new Error("--as <userId> is required");
|
|
17
|
+
const as = actingUserId(program);
|
|
19
18
|
const path = `/api/v1/rooms`;
|
|
20
19
|
const query = {};
|
|
21
20
|
{
|
|
@@ -86,9 +85,7 @@ export function register(program) {
|
|
|
86
85
|
.option("--message-retention <n>", "number")
|
|
87
86
|
.option("--is-read-only <true|false>", "boolean")
|
|
88
87
|
.action(async (opts) => {
|
|
89
|
-
const
|
|
90
|
-
if (!as)
|
|
91
|
-
throw new Error("--as <userId> is required");
|
|
88
|
+
const as = actingUserId(program);
|
|
92
89
|
const path = `/api/v1/rooms`;
|
|
93
90
|
const body = {};
|
|
94
91
|
{
|
|
@@ -245,9 +242,7 @@ export function register(program) {
|
|
|
245
242
|
.command("list-channel-templates")
|
|
246
243
|
.description("GET /api/v1/rooms/channel-templates")
|
|
247
244
|
.action(async (opts) => {
|
|
248
|
-
const
|
|
249
|
-
if (!as)
|
|
250
|
-
throw new Error("--as <userId> is required");
|
|
245
|
+
const as = actingUserId(program);
|
|
251
246
|
const path = `/api/v1/rooms/channel-templates`;
|
|
252
247
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
253
248
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -259,9 +254,7 @@ export function register(program) {
|
|
|
259
254
|
.description("POST /api/v1/rooms/with-template")
|
|
260
255
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
261
256
|
.action(async (opts) => {
|
|
262
|
-
const
|
|
263
|
-
if (!as)
|
|
264
|
-
throw new Error("--as <userId> is required");
|
|
257
|
+
const as = actingUserId(program);
|
|
265
258
|
const path = `/api/v1/rooms/with-template`;
|
|
266
259
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
267
260
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -274,9 +267,7 @@ export function register(program) {
|
|
|
274
267
|
.description("GET /api/v1/rooms/{roomId}/public-meta")
|
|
275
268
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
276
269
|
.action(async (opts) => {
|
|
277
|
-
const
|
|
278
|
-
if (!as)
|
|
279
|
-
throw new Error("--as <userId> is required");
|
|
270
|
+
const as = actingUserId(program);
|
|
280
271
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/public-meta`;
|
|
281
272
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
282
273
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -288,9 +279,7 @@ export function register(program) {
|
|
|
288
279
|
.description("GET /api/v1/rooms/by-slug/{slug}")
|
|
289
280
|
.requiredOption("--slug <value>", "slug (path param)")
|
|
290
281
|
.action(async (opts) => {
|
|
291
|
-
const
|
|
292
|
-
if (!as)
|
|
293
|
-
throw new Error("--as <userId> is required");
|
|
282
|
+
const as = actingUserId(program);
|
|
294
283
|
const path = `/api/v1/rooms/by-slug/${encodeURIComponent(opts.slug)}`;
|
|
295
284
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
296
285
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -302,9 +291,7 @@ export function register(program) {
|
|
|
302
291
|
.description("GET /api/v1/rooms/resolve-code/{code}")
|
|
303
292
|
.requiredOption("--code <value>", "code (path param)")
|
|
304
293
|
.action(async (opts) => {
|
|
305
|
-
const
|
|
306
|
-
if (!as)
|
|
307
|
-
throw new Error("--as <userId> is required");
|
|
294
|
+
const as = actingUserId(program);
|
|
308
295
|
const path = `/api/v1/rooms/resolve-code/${encodeURIComponent(opts.code)}`;
|
|
309
296
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
310
297
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -317,9 +304,7 @@ export function register(program) {
|
|
|
317
304
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
318
305
|
.option("--limit <value>", "string")
|
|
319
306
|
.action(async (opts) => {
|
|
320
|
-
const
|
|
321
|
-
if (!as)
|
|
322
|
-
throw new Error("--as <userId> is required");
|
|
307
|
+
const as = actingUserId(program);
|
|
323
308
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/preview-messages`;
|
|
324
309
|
const query = {};
|
|
325
310
|
{
|
|
@@ -337,9 +322,7 @@ export function register(program) {
|
|
|
337
322
|
.description("GET /api/v1/rooms/{roomId}")
|
|
338
323
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
339
324
|
.action(async (opts) => {
|
|
340
|
-
const
|
|
341
|
-
if (!as)
|
|
342
|
-
throw new Error("--as <userId> is required");
|
|
325
|
+
const as = actingUserId(program);
|
|
343
326
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}`;
|
|
344
327
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
345
328
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -378,9 +361,7 @@ export function register(program) {
|
|
|
378
361
|
.option("--message-retention <n>", "number")
|
|
379
362
|
.option("--is-read-only <true|false>", "boolean")
|
|
380
363
|
.action(async (opts) => {
|
|
381
|
-
const
|
|
382
|
-
if (!as)
|
|
383
|
-
throw new Error("--as <userId> is required");
|
|
364
|
+
const as = actingUserId(program);
|
|
384
365
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}`;
|
|
385
366
|
const body = {};
|
|
386
367
|
{
|
|
@@ -528,9 +509,7 @@ export function register(program) {
|
|
|
528
509
|
.description("DELETE /api/v1/rooms/{roomId}")
|
|
529
510
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
530
511
|
.action(async (opts) => {
|
|
531
|
-
const
|
|
532
|
-
if (!as)
|
|
533
|
-
throw new Error("--as <userId> is required");
|
|
512
|
+
const as = actingUserId(program);
|
|
534
513
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}`;
|
|
535
514
|
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
536
515
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -542,9 +521,7 @@ export function register(program) {
|
|
|
542
521
|
.description("GET /api/v1/rooms/{roomId}/bootstrap")
|
|
543
522
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
544
523
|
.action(async (opts) => {
|
|
545
|
-
const
|
|
546
|
-
if (!as)
|
|
547
|
-
throw new Error("--as <userId> is required");
|
|
524
|
+
const as = actingUserId(program);
|
|
548
525
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/bootstrap`;
|
|
549
526
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
550
527
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -557,9 +534,7 @@ export function register(program) {
|
|
|
557
534
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
558
535
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
559
536
|
.action(async (opts) => {
|
|
560
|
-
const
|
|
561
|
-
if (!as)
|
|
562
|
-
throw new Error("--as <userId> is required");
|
|
537
|
+
const as = actingUserId(program);
|
|
563
538
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/icon`;
|
|
564
539
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
565
540
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -573,9 +548,7 @@ export function register(program) {
|
|
|
573
548
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
574
549
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
575
550
|
.action(async (opts) => {
|
|
576
|
-
const
|
|
577
|
-
if (!as)
|
|
578
|
-
throw new Error("--as <userId> is required");
|
|
551
|
+
const as = actingUserId(program);
|
|
579
552
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/images`;
|
|
580
553
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
581
554
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -589,9 +562,7 @@ export function register(program) {
|
|
|
589
562
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
590
563
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
591
564
|
.action(async (opts) => {
|
|
592
|
-
const
|
|
593
|
-
if (!as)
|
|
594
|
-
throw new Error("--as <userId> is required");
|
|
565
|
+
const as = actingUserId(program);
|
|
595
566
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/files`;
|
|
596
567
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
597
568
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -605,9 +576,7 @@ export function register(program) {
|
|
|
605
576
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
606
577
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
607
578
|
.action(async (opts) => {
|
|
608
|
-
const
|
|
609
|
-
if (!as)
|
|
610
|
-
throw new Error("--as <userId> is required");
|
|
579
|
+
const as = actingUserId(program);
|
|
611
580
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/files/upload-session`;
|
|
612
581
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
613
582
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -621,9 +590,7 @@ export function register(program) {
|
|
|
621
590
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
622
591
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
623
592
|
.action(async (opts) => {
|
|
624
|
-
const
|
|
625
|
-
if (!as)
|
|
626
|
-
throw new Error("--as <userId> is required");
|
|
593
|
+
const as = actingUserId(program);
|
|
627
594
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/files/complete`;
|
|
628
595
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
629
596
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -639,9 +606,7 @@ export function register(program) {
|
|
|
639
606
|
.option("--invite-token <value>", "string")
|
|
640
607
|
.option("--ref <value>", "string")
|
|
641
608
|
.action(async (opts) => {
|
|
642
|
-
const
|
|
643
|
-
if (!as)
|
|
644
|
-
throw new Error("--as <userId> is required");
|
|
609
|
+
const as = actingUserId(program);
|
|
645
610
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join`;
|
|
646
611
|
const body = {};
|
|
647
612
|
{
|
|
@@ -670,9 +635,7 @@ export function register(program) {
|
|
|
670
635
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
671
636
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
672
637
|
.action(async (opts) => {
|
|
673
|
-
const
|
|
674
|
-
if (!as)
|
|
675
|
-
throw new Error("--as <userId> is required");
|
|
638
|
+
const as = actingUserId(program);
|
|
676
639
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/read`;
|
|
677
640
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
678
641
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -686,9 +649,7 @@ export function register(program) {
|
|
|
686
649
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
687
650
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
688
651
|
.action(async (opts) => {
|
|
689
|
-
const
|
|
690
|
-
if (!as)
|
|
691
|
-
throw new Error("--as <userId> is required");
|
|
652
|
+
const as = actingUserId(program);
|
|
692
653
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/leave`;
|
|
693
654
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
694
655
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -701,9 +662,7 @@ export function register(program) {
|
|
|
701
662
|
.description("GET /api/v1/rooms/{roomId}/members/counts")
|
|
702
663
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
703
664
|
.action(async (opts) => {
|
|
704
|
-
const
|
|
705
|
-
if (!as)
|
|
706
|
-
throw new Error("--as <userId> is required");
|
|
665
|
+
const as = actingUserId(program);
|
|
707
666
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members/counts`;
|
|
708
667
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
709
668
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -720,9 +679,7 @@ export function register(program) {
|
|
|
720
679
|
.option("--exclude-guests <value>", "string")
|
|
721
680
|
.option("--query <value>", "string")
|
|
722
681
|
.action(async (opts) => {
|
|
723
|
-
const
|
|
724
|
-
if (!as)
|
|
725
|
-
throw new Error("--as <userId> is required");
|
|
682
|
+
const as = actingUserId(program);
|
|
726
683
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members`;
|
|
727
684
|
const query = {};
|
|
728
685
|
{
|
|
@@ -762,9 +719,7 @@ export function register(program) {
|
|
|
762
719
|
.requiredOption("--user-id <value>", "userId (path param)")
|
|
763
720
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
764
721
|
.action(async (opts) => {
|
|
765
|
-
const
|
|
766
|
-
if (!as)
|
|
767
|
-
throw new Error("--as <userId> is required");
|
|
722
|
+
const as = actingUserId(program);
|
|
768
723
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members/${encodeURIComponent(opts.userId)}`;
|
|
769
724
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
770
725
|
const data = await call({ method: "PATCH", path, asUserId: as, body });
|
|
@@ -778,9 +733,7 @@ export function register(program) {
|
|
|
778
733
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
779
734
|
.requiredOption("--user-id <value>", "userId (path param)")
|
|
780
735
|
.action(async (opts) => {
|
|
781
|
-
const
|
|
782
|
-
if (!as)
|
|
783
|
-
throw new Error("--as <userId> is required");
|
|
736
|
+
const as = actingUserId(program);
|
|
784
737
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/members/${encodeURIComponent(opts.userId)}`;
|
|
785
738
|
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
786
739
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -792,9 +745,7 @@ export function register(program) {
|
|
|
792
745
|
.description("GET /api/v1/rooms/{roomId}/membership")
|
|
793
746
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
794
747
|
.action(async (opts) => {
|
|
795
|
-
const
|
|
796
|
-
if (!as)
|
|
797
|
-
throw new Error("--as <userId> is required");
|
|
748
|
+
const as = actingUserId(program);
|
|
798
749
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/membership`;
|
|
799
750
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
800
751
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -807,9 +758,7 @@ export function register(program) {
|
|
|
807
758
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
808
759
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
809
760
|
.action(async (opts) => {
|
|
810
|
-
const
|
|
811
|
-
if (!as)
|
|
812
|
-
throw new Error("--as <userId> is required");
|
|
761
|
+
const as = actingUserId(program);
|
|
813
762
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/membership`;
|
|
814
763
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
815
764
|
const data = await call({ method: "PATCH", path, asUserId: as, body });
|
|
@@ -825,9 +774,7 @@ export function register(program) {
|
|
|
825
774
|
.option("--cursor <value>", "string")
|
|
826
775
|
.option("--limit <value>", "string")
|
|
827
776
|
.action(async (opts) => {
|
|
828
|
-
const
|
|
829
|
-
if (!as)
|
|
830
|
-
throw new Error("--as <userId> is required");
|
|
777
|
+
const as = actingUserId(program);
|
|
831
778
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-requests`;
|
|
832
779
|
const query = {};
|
|
833
780
|
{
|
|
@@ -857,9 +804,7 @@ export function register(program) {
|
|
|
857
804
|
.requiredOption("--request-id <value>", "requestId (path param)")
|
|
858
805
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
859
806
|
.action(async (opts) => {
|
|
860
|
-
const
|
|
861
|
-
if (!as)
|
|
862
|
-
throw new Error("--as <userId> is required");
|
|
807
|
+
const as = actingUserId(program);
|
|
863
808
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-requests/${encodeURIComponent(opts.requestId)}/approve`;
|
|
864
809
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
865
810
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -874,9 +819,7 @@ export function register(program) {
|
|
|
874
819
|
.requiredOption("--request-id <value>", "requestId (path param)")
|
|
875
820
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
876
821
|
.action(async (opts) => {
|
|
877
|
-
const
|
|
878
|
-
if (!as)
|
|
879
|
-
throw new Error("--as <userId> is required");
|
|
822
|
+
const as = actingUserId(program);
|
|
880
823
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-requests/${encodeURIComponent(opts.requestId)}/deny`;
|
|
881
824
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
882
825
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -889,9 +832,7 @@ export function register(program) {
|
|
|
889
832
|
.description("GET /api/v1/rooms/{roomId}/join-request-status")
|
|
890
833
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
891
834
|
.action(async (opts) => {
|
|
892
|
-
const
|
|
893
|
-
if (!as)
|
|
894
|
-
throw new Error("--as <userId> is required");
|
|
835
|
+
const as = actingUserId(program);
|
|
895
836
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/join-request-status`;
|
|
896
837
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
897
838
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -904,9 +845,7 @@ export function register(program) {
|
|
|
904
845
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
905
846
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
906
847
|
.action(async (opts) => {
|
|
907
|
-
const
|
|
908
|
-
if (!as)
|
|
909
|
-
throw new Error("--as <userId> is required");
|
|
848
|
+
const as = actingUserId(program);
|
|
910
849
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/regenerate-join-code`;
|
|
911
850
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
912
851
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -919,9 +858,7 @@ export function register(program) {
|
|
|
919
858
|
.description("GET /api/v1/rooms/{roomId}/embed")
|
|
920
859
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
921
860
|
.action(async (opts) => {
|
|
922
|
-
const
|
|
923
|
-
if (!as)
|
|
924
|
-
throw new Error("--as <userId> is required");
|
|
861
|
+
const as = actingUserId(program);
|
|
925
862
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/embed`;
|
|
926
863
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
927
864
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -933,9 +870,7 @@ export function register(program) {
|
|
|
933
870
|
.description("GET /api/v1/rooms/{roomId}/collection-config")
|
|
934
871
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
935
872
|
.action(async (opts) => {
|
|
936
|
-
const
|
|
937
|
-
if (!as)
|
|
938
|
-
throw new Error("--as <userId> is required");
|
|
873
|
+
const as = actingUserId(program);
|
|
939
874
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/collection-config`;
|
|
940
875
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
941
876
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -948,9 +883,7 @@ export function register(program) {
|
|
|
948
883
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
949
884
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
950
885
|
.action(async (opts) => {
|
|
951
|
-
const
|
|
952
|
-
if (!as)
|
|
953
|
-
throw new Error("--as <userId> is required");
|
|
886
|
+
const as = actingUserId(program);
|
|
954
887
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/collection-config`;
|
|
955
888
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
956
889
|
const data = await call({ method: "PATCH", path, asUserId: as, body });
|
|
@@ -963,9 +896,7 @@ export function register(program) {
|
|
|
963
896
|
.description("GET /api/v1/rooms/{roomId}/ctx-config")
|
|
964
897
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
965
898
|
.action(async (opts) => {
|
|
966
|
-
const
|
|
967
|
-
if (!as)
|
|
968
|
-
throw new Error("--as <userId> is required");
|
|
899
|
+
const as = actingUserId(program);
|
|
969
900
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx-config`;
|
|
970
901
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
971
902
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -978,9 +909,7 @@ export function register(program) {
|
|
|
978
909
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
979
910
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
980
911
|
.action(async (opts) => {
|
|
981
|
-
const
|
|
982
|
-
if (!as)
|
|
983
|
-
throw new Error("--as <userId> is required");
|
|
912
|
+
const as = actingUserId(program);
|
|
984
913
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx-config`;
|
|
985
914
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
986
915
|
const data = await call({ method: "PATCH", path, asUserId: as, body });
|
|
@@ -993,9 +922,7 @@ export function register(program) {
|
|
|
993
922
|
.description("GET /api/v1/rooms/{roomId}/wiki")
|
|
994
923
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
995
924
|
.action(async (opts) => {
|
|
996
|
-
const
|
|
997
|
-
if (!as)
|
|
998
|
-
throw new Error("--as <userId> is required");
|
|
925
|
+
const as = actingUserId(program);
|
|
999
926
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/wiki`;
|
|
1000
927
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
1001
928
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -1008,9 +935,7 @@ export function register(program) {
|
|
|
1008
935
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
1009
936
|
.requiredOption("--q <value>", "string")
|
|
1010
937
|
.action(async (opts) => {
|
|
1011
|
-
const
|
|
1012
|
-
if (!as)
|
|
1013
|
-
throw new Error("--as <userId> is required");
|
|
938
|
+
const as = actingUserId(program);
|
|
1014
939
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/wiki/search`;
|
|
1015
940
|
const query = {};
|
|
1016
941
|
{
|
|
@@ -1029,9 +954,7 @@ export function register(program) {
|
|
|
1029
954
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
1030
955
|
.requiredOption("--slug <value>", "slug (path param)")
|
|
1031
956
|
.action(async (opts) => {
|
|
1032
|
-
const
|
|
1033
|
-
if (!as)
|
|
1034
|
-
throw new Error("--as <userId> is required");
|
|
957
|
+
const as = actingUserId(program);
|
|
1035
958
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/wiki/pages/${encodeURIComponent(opts.slug)}`;
|
|
1036
959
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
1037
960
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -1043,9 +966,7 @@ export function register(program) {
|
|
|
1043
966
|
.description("GET /api/v1/rooms/{roomId}/ctx")
|
|
1044
967
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
1045
968
|
.action(async (opts) => {
|
|
1046
|
-
const
|
|
1047
|
-
if (!as)
|
|
1048
|
-
throw new Error("--as <userId> is required");
|
|
969
|
+
const as = actingUserId(program);
|
|
1049
970
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx`;
|
|
1050
971
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
1051
972
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -1058,9 +979,7 @@ export function register(program) {
|
|
|
1058
979
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
1059
980
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
1060
981
|
.action(async (opts) => {
|
|
1061
|
-
const
|
|
1062
|
-
if (!as)
|
|
1063
|
-
throw new Error("--as <userId> is required");
|
|
982
|
+
const as = actingUserId(program);
|
|
1064
983
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/ctx/run`;
|
|
1065
984
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
1066
985
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -1074,9 +993,7 @@ export function register(program) {
|
|
|
1074
993
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
1075
994
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
1076
995
|
.action(async (opts) => {
|
|
1077
|
-
const
|
|
1078
|
-
if (!as)
|
|
1079
|
-
throw new Error("--as <userId> is required");
|
|
996
|
+
const as = actingUserId(program);
|
|
1080
997
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/collect`;
|
|
1081
998
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
1082
999
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -1089,9 +1006,7 @@ export function register(program) {
|
|
|
1089
1006
|
.description("GET /api/v1/rooms/{roomId}/channels")
|
|
1090
1007
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
1091
1008
|
.action(async (opts) => {
|
|
1092
|
-
const
|
|
1093
|
-
if (!as)
|
|
1094
|
-
throw new Error("--as <userId> is required");
|
|
1009
|
+
const as = actingUserId(program);
|
|
1095
1010
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/channels`;
|
|
1096
1011
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
1097
1012
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -1104,9 +1019,7 @@ export function register(program) {
|
|
|
1104
1019
|
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
1105
1020
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
1106
1021
|
.action(async (opts) => {
|
|
1107
|
-
const
|
|
1108
|
-
if (!as)
|
|
1109
|
-
throw new Error("--as <userId> is required");
|
|
1022
|
+
const as = actingUserId(program);
|
|
1110
1023
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/channels`;
|
|
1111
1024
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
1112
1025
|
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
2
3
|
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
4
|
export function register(program) {
|
|
4
5
|
const group = getOrCreateGroup(program, "saved-messages", "SavedMessages operations");
|
|
@@ -10,9 +11,7 @@ export function register(program) {
|
|
|
10
11
|
.requiredOption("--room-id <value>", "string")
|
|
11
12
|
.option("--folder-id <value>", "string")
|
|
12
13
|
.action(async (opts) => {
|
|
13
|
-
const
|
|
14
|
-
if (!as)
|
|
15
|
-
throw new Error("--as <userId> is required");
|
|
14
|
+
const as = actingUserId(program);
|
|
16
15
|
const path = `/api/v1/users/me/saved-messages`;
|
|
17
16
|
const body = {};
|
|
18
17
|
{
|
|
@@ -42,9 +41,7 @@ export function register(program) {
|
|
|
42
41
|
.option("--cursor <value>", "string")
|
|
43
42
|
.option("--limit <value>", "string")
|
|
44
43
|
.action(async (opts) => {
|
|
45
|
-
const
|
|
46
|
-
if (!as)
|
|
47
|
-
throw new Error("--as <userId> is required");
|
|
44
|
+
const as = actingUserId(program);
|
|
48
45
|
const path = `/api/v1/users/me/saved-messages`;
|
|
49
46
|
const query = {};
|
|
50
47
|
{
|
|
@@ -72,9 +69,7 @@ export function register(program) {
|
|
|
72
69
|
.description("DELETE /api/v1/users/me/saved-messages/{id}")
|
|
73
70
|
.requiredOption("--id <value>", "id (path param)")
|
|
74
71
|
.action(async (opts) => {
|
|
75
|
-
const
|
|
76
|
-
if (!as)
|
|
77
|
-
throw new Error("--as <userId> is required");
|
|
72
|
+
const as = actingUserId(program);
|
|
78
73
|
const path = `/api/v1/users/me/saved-messages/${encodeURIComponent(opts.id)}`;
|
|
79
74
|
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
80
75
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
2
3
|
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
4
|
export function register(program) {
|
|
4
5
|
const group = getOrCreateGroup(program, "saved-stories", "SavedStories operations");
|
|
@@ -9,9 +10,7 @@ export function register(program) {
|
|
|
9
10
|
.requiredOption("--story-id <value>", "string")
|
|
10
11
|
.option("--folder-id <value>", "string")
|
|
11
12
|
.action(async (opts) => {
|
|
12
|
-
const
|
|
13
|
-
if (!as)
|
|
14
|
-
throw new Error("--as <userId> is required");
|
|
13
|
+
const as = actingUserId(program);
|
|
15
14
|
const path = `/api/v1/users/me/saved-stories`;
|
|
16
15
|
const body = {};
|
|
17
16
|
{
|
|
@@ -36,9 +35,7 @@ export function register(program) {
|
|
|
36
35
|
.option("--cursor <value>", "string")
|
|
37
36
|
.option("--limit <value>", "string")
|
|
38
37
|
.action(async (opts) => {
|
|
39
|
-
const
|
|
40
|
-
if (!as)
|
|
41
|
-
throw new Error("--as <userId> is required");
|
|
38
|
+
const as = actingUserId(program);
|
|
42
39
|
const path = `/api/v1/users/me/saved-stories`;
|
|
43
40
|
const query = {};
|
|
44
41
|
{
|
|
@@ -66,9 +63,7 @@ export function register(program) {
|
|
|
66
63
|
.description("DELETE /api/v1/users/me/saved-stories/{id}")
|
|
67
64
|
.requiredOption("--id <value>", "id (path param)")
|
|
68
65
|
.action(async (opts) => {
|
|
69
|
-
const
|
|
70
|
-
if (!as)
|
|
71
|
-
throw new Error("--as <userId> is required");
|
|
66
|
+
const as = actingUserId(program);
|
|
72
67
|
const path = `/api/v1/users/me/saved-stories/${encodeURIComponent(opts.id)}`;
|
|
73
68
|
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
74
69
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -79,9 +74,7 @@ export function register(program) {
|
|
|
79
74
|
.command("list-folders")
|
|
80
75
|
.description("GET /api/v1/users/me/folders")
|
|
81
76
|
.action(async (opts) => {
|
|
82
|
-
const
|
|
83
|
-
if (!as)
|
|
84
|
-
throw new Error("--as <userId> is required");
|
|
77
|
+
const as = actingUserId(program);
|
|
85
78
|
const path = `/api/v1/users/me/folders`;
|
|
86
79
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
87
80
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -93,9 +86,7 @@ export function register(program) {
|
|
|
93
86
|
.description("POST /api/v1/users/me/folders")
|
|
94
87
|
.requiredOption("--name <value>", "string")
|
|
95
88
|
.action(async (opts) => {
|
|
96
|
-
const
|
|
97
|
-
if (!as)
|
|
98
|
-
throw new Error("--as <userId> is required");
|
|
89
|
+
const as = actingUserId(program);
|
|
99
90
|
const path = `/api/v1/users/me/folders`;
|
|
100
91
|
const body = {};
|
|
101
92
|
{
|
|
@@ -113,9 +104,7 @@ export function register(program) {
|
|
|
113
104
|
.description("DELETE /api/v1/users/me/folders/{folderId}")
|
|
114
105
|
.requiredOption("--folder-id <value>", "folderId (path param)")
|
|
115
106
|
.action(async (opts) => {
|
|
116
|
-
const
|
|
117
|
-
if (!as)
|
|
118
|
-
throw new Error("--as <userId> is required");
|
|
107
|
+
const as = actingUserId(program);
|
|
119
108
|
const path = `/api/v1/users/me/folders/${encodeURIComponent(opts.folderId)}`;
|
|
120
109
|
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
121
110
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
2
3
|
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
4
|
export function register(program) {
|
|
4
5
|
const group = getOrCreateGroup(program, "search", "Search operations");
|
|
@@ -11,9 +12,7 @@ export function register(program) {
|
|
|
11
12
|
.option("--cursor <value>", "string")
|
|
12
13
|
.option("--limit <value>", "string")
|
|
13
14
|
.action(async (opts) => {
|
|
14
|
-
const
|
|
15
|
-
if (!as)
|
|
16
|
-
throw new Error("--as <userId> is required");
|
|
15
|
+
const as = actingUserId(program);
|
|
17
16
|
const path = `/api/v1/search`;
|
|
18
17
|
const query = {};
|
|
19
18
|
{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
2
3
|
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
4
|
export function register(program) {
|
|
4
5
|
const group = getOrCreateGroup(program, "shadow-home-agent", "ShadowHomeAgent operations");
|
|
@@ -8,9 +9,7 @@ export function register(program) {
|
|
|
8
9
|
.description("GET /api/v1/users/{userId}/shadow-home/.well-known/agent.json")
|
|
9
10
|
.requiredOption("--user-id <value>", "userId (path param)")
|
|
10
11
|
.action(async (opts) => {
|
|
11
|
-
const
|
|
12
|
-
if (!as)
|
|
13
|
-
throw new Error("--as <userId> is required");
|
|
12
|
+
const as = actingUserId(program);
|
|
14
13
|
const path = `/api/v1/users/${encodeURIComponent(opts.userId)}/shadow-home/.well-known/agent.json`;
|
|
15
14
|
const data = await call({ method: "GET", path, asUserId: as });
|
|
16
15
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
@@ -23,9 +22,7 @@ export function register(program) {
|
|
|
23
22
|
.requiredOption("--user-id <value>", "userId (path param)")
|
|
24
23
|
.option("--body <json>", "request body as JSON (no schema available)")
|
|
25
24
|
.action(async (opts) => {
|
|
26
|
-
const
|
|
27
|
-
if (!as)
|
|
28
|
-
throw new Error("--as <userId> is required");
|
|
25
|
+
const as = actingUserId(program);
|
|
29
26
|
const path = `/api/v1/users/${encodeURIComponent(opts.userId)}/shadow-home/a2a`;
|
|
30
27
|
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
31
28
|
const data = await call({ method: "POST", path, asUserId: as, body });
|