@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.
- package/LICENSE +18 -0
- package/README.md +312 -0
- package/dist/auth.js +9 -0
- package/dist/cli.js +46 -0
- package/dist/client.js +125 -0
- package/dist/commands/_group.js +5 -0
- package/dist/commands/auth.js +125 -0
- package/dist/commands/challenges.js +51 -0
- package/dist/commands/custom-agents.js +120 -0
- package/dist/commands/dm.js +35 -0
- package/dist/commands/messages.js +360 -0
- package/dist/commands/room-agents.js +47 -0
- package/dist/commands/rooms.js +687 -0
- package/dist/commands/users.js +126 -0
- package/dist/commands/whoami.js +15 -0
- package/dist/generated/_helpers.js +8 -0
- package/dist/generated/commands/activity.js +46 -0
- package/dist/generated/commands/ai.js +40 -0
- package/dist/generated/commands/ambassador.js +34 -0
- package/dist/generated/commands/apple-iap.js +61 -0
- package/dist/generated/commands/attribution.js +130 -0
- package/dist/generated/commands/auth.js +205 -0
- package/dist/generated/commands/challenges.js +251 -0
- package/dist/generated/commands/clips.js +71 -0
- package/dist/generated/commands/contact-match.js +92 -0
- package/dist/generated/commands/content-crawler.js +27 -0
- package/dist/generated/commands/custom-agents.js +346 -0
- package/dist/generated/commands/desktop-releases.js +236 -0
- package/dist/generated/commands/discover.js +236 -0
- package/dist/generated/commands/dm.js +155 -0
- package/dist/generated/commands/drafts.js +41 -0
- package/dist/generated/commands/embed.js +34 -0
- package/dist/generated/commands/explore.js +19 -0
- package/dist/generated/commands/feed.js +67 -0
- package/dist/generated/commands/feedback.js +44 -0
- package/dist/generated/commands/gamification.js +33 -0
- package/dist/generated/commands/google-play-iap.js +73 -0
- package/dist/generated/commands/health.js +32 -0
- package/dist/generated/commands/internal.js +162 -0
- package/dist/generated/commands/interview.js +76 -0
- package/dist/generated/commands/invite-redirect.js +20 -0
- package/dist/generated/commands/jesuscord-admin.js +36 -0
- package/dist/generated/commands/join.js +27 -0
- package/dist/generated/commands/kits.js +108 -0
- package/dist/generated/commands/meetings.js +81 -0
- package/dist/generated/commands/message-folders.js +68 -0
- package/dist/generated/commands/messages.js +418 -0
- package/dist/generated/commands/one-emulator.js +32 -0
- package/dist/generated/commands/pdf-export.js +19 -0
- package/dist/generated/commands/pin-folders.js +72 -0
- package/dist/generated/commands/pinned-messages.js +81 -0
- package/dist/generated/commands/polls.js +152 -0
- package/dist/generated/commands/premium-feeds.js +32 -0
- package/dist/generated/commands/processors.js +22 -0
- package/dist/generated/commands/questions.js +54 -0
- package/dist/generated/commands/referrals.js +19 -0
- package/dist/generated/commands/reports.js +21 -0
- package/dist/generated/commands/room-a2-a.js +81 -0
- package/dist/generated/commands/room-agents.js +273 -0
- package/dist/generated/commands/room-invites.js +155 -0
- package/dist/generated/commands/room-owned-agent.js +36 -0
- package/dist/generated/commands/room-page.js +20 -0
- package/dist/generated/commands/rooms.js +1117 -0
- package/dist/generated/commands/saved-messages.js +84 -0
- package/dist/generated/commands/saved-stories.js +125 -0
- package/dist/generated/commands/search.js +44 -0
- package/dist/generated/commands/shadow-home-agent.js +36 -0
- package/dist/generated/commands/shadow.js +64 -0
- package/dist/generated/commands/share-cards.js +85 -0
- package/dist/generated/commands/share.js +20 -0
- package/dist/generated/commands/sponsors.js +20 -0
- package/dist/generated/commands/stories.js +324 -0
- package/dist/generated/commands/story-by-id.js +20 -0
- package/dist/generated/commands/submissions.js +112 -0
- package/dist/generated/commands/subscriptions.js +103 -0
- package/dist/generated/commands/tips.js +76 -0
- package/dist/generated/commands/users.js +373 -0
- package/dist/generated/commands/voice-token.js +21 -0
- package/dist/generated/commands/well-known.js +32 -0
- package/dist/generated/commands/wrapped.js +20 -0
- package/dist/generated/index.js +131 -0
- package/package.json +60 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "pinned-messages", "PinnedMessages operations");
|
|
5
|
+
if (!hasSubcommand(group, "pin")) {
|
|
6
|
+
group
|
|
7
|
+
.command("pin")
|
|
8
|
+
.description("POST /api/v1/rooms/{roomId}/pins")
|
|
9
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
10
|
+
.requiredOption("--message-id <value>", "string")
|
|
11
|
+
.option("--folder-id <value>", "string")
|
|
12
|
+
.action(async (opts) => {
|
|
13
|
+
const { as } = program.opts();
|
|
14
|
+
if (!as)
|
|
15
|
+
throw new Error("--as <userId> is required");
|
|
16
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/pins`;
|
|
17
|
+
const body = {};
|
|
18
|
+
{
|
|
19
|
+
const v = opts.messageId;
|
|
20
|
+
if (v !== undefined)
|
|
21
|
+
body["messageId"] = v;
|
|
22
|
+
}
|
|
23
|
+
{
|
|
24
|
+
const v = opts.folderId;
|
|
25
|
+
if (v !== undefined)
|
|
26
|
+
body["folderId"] = v;
|
|
27
|
+
}
|
|
28
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
29
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (!hasSubcommand(group, "list")) {
|
|
33
|
+
group
|
|
34
|
+
.command("list")
|
|
35
|
+
.description("GET /api/v1/rooms/{roomId}/pins")
|
|
36
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
37
|
+
.option("--folder-id <value>", "string")
|
|
38
|
+
.option("--cursor <value>", "string")
|
|
39
|
+
.option("--limit <value>", "string")
|
|
40
|
+
.action(async (opts) => {
|
|
41
|
+
const { as } = program.opts();
|
|
42
|
+
if (!as)
|
|
43
|
+
throw new Error("--as <userId> is required");
|
|
44
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/pins`;
|
|
45
|
+
const query = {};
|
|
46
|
+
{
|
|
47
|
+
const v = opts.folderId;
|
|
48
|
+
if (v !== undefined)
|
|
49
|
+
query["folderId"] = v;
|
|
50
|
+
}
|
|
51
|
+
{
|
|
52
|
+
const v = opts.cursor;
|
|
53
|
+
if (v !== undefined)
|
|
54
|
+
query["cursor"] = v;
|
|
55
|
+
}
|
|
56
|
+
{
|
|
57
|
+
const v = opts.limit;
|
|
58
|
+
if (v !== undefined)
|
|
59
|
+
query["limit"] = v;
|
|
60
|
+
}
|
|
61
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
62
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (!hasSubcommand(group, "unpin")) {
|
|
66
|
+
group
|
|
67
|
+
.command("unpin")
|
|
68
|
+
.description("DELETE /api/v1/rooms/{roomId}/pins/{pinId}")
|
|
69
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
70
|
+
.requiredOption("--pin-id <value>", "pinId (path param)")
|
|
71
|
+
.action(async (opts) => {
|
|
72
|
+
const { as } = program.opts();
|
|
73
|
+
if (!as)
|
|
74
|
+
throw new Error("--as <userId> is required");
|
|
75
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/pins/${encodeURIComponent(opts.pinId)}`;
|
|
76
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
77
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=pinned-messages.js.map
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "polls", "Polls operations");
|
|
5
|
+
if (!hasSubcommand(group, "create")) {
|
|
6
|
+
group
|
|
7
|
+
.command("create")
|
|
8
|
+
.description("POST /api/v1/rooms/{roomId}/polls")
|
|
9
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
10
|
+
.requiredOption("--question <value>", "string")
|
|
11
|
+
.requiredOption("--options <json>", "array, ≤10 items (JSON)")
|
|
12
|
+
.option("--is-anonymous <true|false>", "boolean")
|
|
13
|
+
.option("--allow-multiple-answers <true|false>", "boolean")
|
|
14
|
+
.option("--is-quiz <true|false>", "boolean")
|
|
15
|
+
.option("--correct-option-index <n>", "number")
|
|
16
|
+
.option("--is-feature-request <true|false>", "boolean")
|
|
17
|
+
.action(async (opts) => {
|
|
18
|
+
const { as } = program.opts();
|
|
19
|
+
if (!as)
|
|
20
|
+
throw new Error("--as <userId> is required");
|
|
21
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/polls`;
|
|
22
|
+
const body = {};
|
|
23
|
+
{
|
|
24
|
+
const v = opts.question;
|
|
25
|
+
if (v !== undefined)
|
|
26
|
+
body["question"] = v;
|
|
27
|
+
}
|
|
28
|
+
{
|
|
29
|
+
const v = opts.options === undefined ? undefined : JSON.parse(opts.options);
|
|
30
|
+
if (v !== undefined)
|
|
31
|
+
body["options"] = v;
|
|
32
|
+
}
|
|
33
|
+
{
|
|
34
|
+
const v = opts.isAnonymous === undefined ? undefined : opts.isAnonymous === "true";
|
|
35
|
+
if (v !== undefined)
|
|
36
|
+
body["isAnonymous"] = v;
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
const v = opts.allowMultipleAnswers === undefined ? undefined : opts.allowMultipleAnswers === "true";
|
|
40
|
+
if (v !== undefined)
|
|
41
|
+
body["allowMultipleAnswers"] = v;
|
|
42
|
+
}
|
|
43
|
+
{
|
|
44
|
+
const v = opts.isQuiz === undefined ? undefined : opts.isQuiz === "true";
|
|
45
|
+
if (v !== undefined)
|
|
46
|
+
body["isQuiz"] = v;
|
|
47
|
+
}
|
|
48
|
+
{
|
|
49
|
+
const v = opts.correctOptionIndex === undefined ? undefined : Number(opts.correctOptionIndex);
|
|
50
|
+
if (v !== undefined)
|
|
51
|
+
body["correctOptionIndex"] = v;
|
|
52
|
+
}
|
|
53
|
+
{
|
|
54
|
+
const v = opts.isFeatureRequest === undefined ? undefined : opts.isFeatureRequest === "true";
|
|
55
|
+
if (v !== undefined)
|
|
56
|
+
body["isFeatureRequest"] = v;
|
|
57
|
+
}
|
|
58
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
59
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (!hasSubcommand(group, "list")) {
|
|
63
|
+
group
|
|
64
|
+
.command("list")
|
|
65
|
+
.description("GET /api/v1/rooms/{roomId}/polls")
|
|
66
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
67
|
+
.option("--cursor <value>", "string")
|
|
68
|
+
.option("--limit <value>", "string")
|
|
69
|
+
.action(async (opts) => {
|
|
70
|
+
const { as } = program.opts();
|
|
71
|
+
if (!as)
|
|
72
|
+
throw new Error("--as <userId> is required");
|
|
73
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/polls`;
|
|
74
|
+
const query = {};
|
|
75
|
+
{
|
|
76
|
+
const v = opts.cursor;
|
|
77
|
+
if (v !== undefined)
|
|
78
|
+
query["cursor"] = v;
|
|
79
|
+
}
|
|
80
|
+
{
|
|
81
|
+
const v = opts.limit;
|
|
82
|
+
if (v !== undefined)
|
|
83
|
+
query["limit"] = v;
|
|
84
|
+
}
|
|
85
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
86
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (!hasSubcommand(group, "list-feature-requests")) {
|
|
90
|
+
group
|
|
91
|
+
.command("list-feature-requests")
|
|
92
|
+
.description("GET /api/v1/rooms/{roomId}/polls/feature-requests")
|
|
93
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
94
|
+
.option("--cursor <value>", "string")
|
|
95
|
+
.option("--limit <value>", "string")
|
|
96
|
+
.action(async (opts) => {
|
|
97
|
+
const { as } = program.opts();
|
|
98
|
+
if (!as)
|
|
99
|
+
throw new Error("--as <userId> is required");
|
|
100
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/polls/feature-requests`;
|
|
101
|
+
const query = {};
|
|
102
|
+
{
|
|
103
|
+
const v = opts.cursor;
|
|
104
|
+
if (v !== undefined)
|
|
105
|
+
query["cursor"] = v;
|
|
106
|
+
}
|
|
107
|
+
{
|
|
108
|
+
const v = opts.limit;
|
|
109
|
+
if (v !== undefined)
|
|
110
|
+
query["limit"] = v;
|
|
111
|
+
}
|
|
112
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
113
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (!hasSubcommand(group, "vote")) {
|
|
117
|
+
group
|
|
118
|
+
.command("vote")
|
|
119
|
+
.description("POST /api/v1/rooms/{roomId}/polls/{pollId}/vote")
|
|
120
|
+
.requiredOption("--poll-id <value>", "pollId (path param)")
|
|
121
|
+
.requiredOption("--option-id <value>", "string")
|
|
122
|
+
.action(async (opts) => {
|
|
123
|
+
const { as } = program.opts();
|
|
124
|
+
if (!as)
|
|
125
|
+
throw new Error("--as <userId> is required");
|
|
126
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/polls/${encodeURIComponent(opts.pollId)}/vote`;
|
|
127
|
+
const body = {};
|
|
128
|
+
{
|
|
129
|
+
const v = opts.optionId;
|
|
130
|
+
if (v !== undefined)
|
|
131
|
+
body["optionId"] = v;
|
|
132
|
+
}
|
|
133
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
134
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (!hasSubcommand(group, "delete")) {
|
|
138
|
+
group
|
|
139
|
+
.command("delete")
|
|
140
|
+
.description("DELETE /api/v1/rooms/{roomId}/polls/{pollId}")
|
|
141
|
+
.requiredOption("--poll-id <value>", "pollId (path param)")
|
|
142
|
+
.action(async (opts) => {
|
|
143
|
+
const { as } = program.opts();
|
|
144
|
+
if (!as)
|
|
145
|
+
throw new Error("--as <userId> is required");
|
|
146
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/polls/${encodeURIComponent(opts.pollId)}`;
|
|
147
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
148
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=polls.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "premium-feeds", "PremiumFeeds operations");
|
|
5
|
+
if (!hasSubcommand(group, "list")) {
|
|
6
|
+
group
|
|
7
|
+
.command("list")
|
|
8
|
+
.description("GET /api/v1/premium-feeds")
|
|
9
|
+
.option("--cursor <value>", "string")
|
|
10
|
+
.option("--limit <value>", "string")
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
const { as } = program.opts();
|
|
13
|
+
if (!as)
|
|
14
|
+
throw new Error("--as <userId> is required");
|
|
15
|
+
const path = `/api/v1/premium-feeds`;
|
|
16
|
+
const query = {};
|
|
17
|
+
{
|
|
18
|
+
const v = opts.cursor;
|
|
19
|
+
if (v !== undefined)
|
|
20
|
+
query["cursor"] = v;
|
|
21
|
+
}
|
|
22
|
+
{
|
|
23
|
+
const v = opts.limit;
|
|
24
|
+
if (v !== undefined)
|
|
25
|
+
query["limit"] = v;
|
|
26
|
+
}
|
|
27
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
28
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=premium-feeds.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "processors", "Processors operations");
|
|
5
|
+
if (!hasSubcommand(group, "verify-story")) {
|
|
6
|
+
group
|
|
7
|
+
.command("verify-story")
|
|
8
|
+
.description("POST /api/v1/rooms/{roomId}/processors/verify")
|
|
9
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
10
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
const { as } = program.opts();
|
|
13
|
+
if (!as)
|
|
14
|
+
throw new Error("--as <userId> is required");
|
|
15
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/processors/verify`;
|
|
16
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
17
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
18
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=processors.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "questions", "Questions operations");
|
|
5
|
+
if (!hasSubcommand(group, "create")) {
|
|
6
|
+
group
|
|
7
|
+
.command("create")
|
|
8
|
+
.description("POST /api/v1/rooms/{roomId}/questions")
|
|
9
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
10
|
+
.requiredOption("--text <value>", "string")
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
const { as } = program.opts();
|
|
13
|
+
if (!as)
|
|
14
|
+
throw new Error("--as <userId> is required");
|
|
15
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/questions`;
|
|
16
|
+
const body = {};
|
|
17
|
+
{
|
|
18
|
+
const v = opts.text;
|
|
19
|
+
if (v !== undefined)
|
|
20
|
+
body["text"] = v;
|
|
21
|
+
}
|
|
22
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
23
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (!hasSubcommand(group, "list")) {
|
|
27
|
+
group
|
|
28
|
+
.command("list")
|
|
29
|
+
.description("GET /api/v1/rooms/{roomId}/questions")
|
|
30
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
31
|
+
.option("--cursor <value>", "string")
|
|
32
|
+
.option("--limit <value>", "string")
|
|
33
|
+
.action(async (opts) => {
|
|
34
|
+
const { as } = program.opts();
|
|
35
|
+
if (!as)
|
|
36
|
+
throw new Error("--as <userId> is required");
|
|
37
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/questions`;
|
|
38
|
+
const query = {};
|
|
39
|
+
{
|
|
40
|
+
const v = opts.cursor;
|
|
41
|
+
if (v !== undefined)
|
|
42
|
+
query["cursor"] = v;
|
|
43
|
+
}
|
|
44
|
+
{
|
|
45
|
+
const v = opts.limit;
|
|
46
|
+
if (v !== undefined)
|
|
47
|
+
query["limit"] = v;
|
|
48
|
+
}
|
|
49
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
50
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=questions.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "referrals", "Referrals operations");
|
|
5
|
+
if (!hasSubcommand(group, "dashboard")) {
|
|
6
|
+
group
|
|
7
|
+
.command("dashboard")
|
|
8
|
+
.description("GET /api/v1/users/me/referrals")
|
|
9
|
+
.action(async (opts) => {
|
|
10
|
+
const { as } = program.opts();
|
|
11
|
+
if (!as)
|
|
12
|
+
throw new Error("--as <userId> is required");
|
|
13
|
+
const path = `/api/v1/users/me/referrals`;
|
|
14
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
15
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=referrals.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "reports", "Reports operations");
|
|
5
|
+
if (!hasSubcommand(group, "create-report")) {
|
|
6
|
+
group
|
|
7
|
+
.command("create-report")
|
|
8
|
+
.description("POST /api/v1/reports")
|
|
9
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
10
|
+
.action(async (opts) => {
|
|
11
|
+
const { as } = program.opts();
|
|
12
|
+
if (!as)
|
|
13
|
+
throw new Error("--as <userId> is required");
|
|
14
|
+
const path = `/api/v1/reports`;
|
|
15
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
16
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
17
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=reports.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "room-a2-a", "RoomA2A operations");
|
|
5
|
+
if (!hasSubcommand(group, "room-agent-card")) {
|
|
6
|
+
group
|
|
7
|
+
.command("room-agent-card")
|
|
8
|
+
.description("GET /api/v1/rooms/{id}/.well-known/agent.json")
|
|
9
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
10
|
+
.action(async (opts) => {
|
|
11
|
+
const { as } = program.opts();
|
|
12
|
+
if (!as)
|
|
13
|
+
throw new Error("--as <userId> is required");
|
|
14
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/.well-known/agent.json`;
|
|
15
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
16
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
if (!hasSubcommand(group, "room-a2-aendpoint")) {
|
|
20
|
+
group
|
|
21
|
+
.command("room-a2-aendpoint")
|
|
22
|
+
.description("POST /api/v1/rooms/{id}/a2a")
|
|
23
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
24
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
25
|
+
.action(async (opts) => {
|
|
26
|
+
const { as } = program.opts();
|
|
27
|
+
if (!as)
|
|
28
|
+
throw new Error("--as <userId> is required");
|
|
29
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a`;
|
|
30
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
31
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
32
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (!hasSubcommand(group, "generate-key")) {
|
|
36
|
+
group
|
|
37
|
+
.command("generate-key")
|
|
38
|
+
.description("POST /api/v1/rooms/{id}/a2a-keys")
|
|
39
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
40
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
41
|
+
.action(async (opts) => {
|
|
42
|
+
const { as } = program.opts();
|
|
43
|
+
if (!as)
|
|
44
|
+
throw new Error("--as <userId> is required");
|
|
45
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a-keys`;
|
|
46
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
47
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
48
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (!hasSubcommand(group, "list-keys")) {
|
|
52
|
+
group
|
|
53
|
+
.command("list-keys")
|
|
54
|
+
.description("GET /api/v1/rooms/{id}/a2a-keys")
|
|
55
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
56
|
+
.action(async (opts) => {
|
|
57
|
+
const { as } = program.opts();
|
|
58
|
+
if (!as)
|
|
59
|
+
throw new Error("--as <userId> is required");
|
|
60
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a-keys`;
|
|
61
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
62
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (!hasSubcommand(group, "revoke-key")) {
|
|
66
|
+
group
|
|
67
|
+
.command("revoke-key")
|
|
68
|
+
.description("DELETE /api/v1/rooms/{id}/a2a-keys/{keyId}")
|
|
69
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
70
|
+
.requiredOption("--key-id <value>", "keyId (path param)")
|
|
71
|
+
.action(async (opts) => {
|
|
72
|
+
const { as } = program.opts();
|
|
73
|
+
if (!as)
|
|
74
|
+
throw new Error("--as <userId> is required");
|
|
75
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.id)}/a2a-keys/${encodeURIComponent(opts.keyId)}`;
|
|
76
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
77
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=room-a2-a.js.map
|