@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,68 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "message-folders", "MessageFolders operations");
|
|
5
|
+
if (!hasSubcommand(group, "list-folders")) {
|
|
6
|
+
group
|
|
7
|
+
.command("list-folders")
|
|
8
|
+
.description("GET /api/v1/users/me/message-folders")
|
|
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/message-folders`;
|
|
14
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
15
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (!hasSubcommand(group, "create-folder")) {
|
|
19
|
+
group
|
|
20
|
+
.command("create-folder")
|
|
21
|
+
.description("POST /api/v1/users/me/message-folders")
|
|
22
|
+
.requiredOption("--name <value>", "string")
|
|
23
|
+
.action(async (opts) => {
|
|
24
|
+
const { as } = program.opts();
|
|
25
|
+
if (!as)
|
|
26
|
+
throw new Error("--as <userId> is required");
|
|
27
|
+
const path = `/api/v1/users/me/message-folders`;
|
|
28
|
+
const body = {};
|
|
29
|
+
{
|
|
30
|
+
const v = opts.name;
|
|
31
|
+
if (v !== undefined)
|
|
32
|
+
body["name"] = v;
|
|
33
|
+
}
|
|
34
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
35
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (!hasSubcommand(group, "delete-folder")) {
|
|
39
|
+
group
|
|
40
|
+
.command("delete-folder")
|
|
41
|
+
.description("DELETE /api/v1/users/me/message-folders/{folderId}")
|
|
42
|
+
.requiredOption("--folder-id <value>", "folderId (path param)")
|
|
43
|
+
.action(async (opts) => {
|
|
44
|
+
const { as } = program.opts();
|
|
45
|
+
if (!as)
|
|
46
|
+
throw new Error("--as <userId> is required");
|
|
47
|
+
const path = `/api/v1/users/me/message-folders/${encodeURIComponent(opts.folderId)}`;
|
|
48
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
49
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (!hasSubcommand(group, "ensure-default")) {
|
|
53
|
+
group
|
|
54
|
+
.command("ensure-default")
|
|
55
|
+
.description("POST /api/v1/users/me/message-folders/ensure-default")
|
|
56
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
57
|
+
.action(async (opts) => {
|
|
58
|
+
const { as } = program.opts();
|
|
59
|
+
if (!as)
|
|
60
|
+
throw new Error("--as <userId> is required");
|
|
61
|
+
const path = `/api/v1/users/me/message-folders/ensure-default`;
|
|
62
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
63
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
64
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=message-folders.js.map
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "messages", "Messages operations");
|
|
5
|
+
if (!hasSubcommand(group, "list")) {
|
|
6
|
+
group
|
|
7
|
+
.command("list")
|
|
8
|
+
.description("GET /api/v1/rooms/{roomId}/messages")
|
|
9
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
10
|
+
.option("--cursor <value>", "string")
|
|
11
|
+
.option("--limit <value>", "string")
|
|
12
|
+
.option("--filter <value>", "string")
|
|
13
|
+
.option("--after <value>", "string")
|
|
14
|
+
.action(async (opts) => {
|
|
15
|
+
const { as } = program.opts();
|
|
16
|
+
if (!as)
|
|
17
|
+
throw new Error("--as <userId> is required");
|
|
18
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages`;
|
|
19
|
+
const query = {};
|
|
20
|
+
{
|
|
21
|
+
const v = opts.cursor;
|
|
22
|
+
if (v !== undefined)
|
|
23
|
+
query["cursor"] = v;
|
|
24
|
+
}
|
|
25
|
+
{
|
|
26
|
+
const v = opts.limit;
|
|
27
|
+
if (v !== undefined)
|
|
28
|
+
query["limit"] = v;
|
|
29
|
+
}
|
|
30
|
+
{
|
|
31
|
+
const v = opts.filter;
|
|
32
|
+
if (v !== undefined)
|
|
33
|
+
query["filter"] = v;
|
|
34
|
+
}
|
|
35
|
+
{
|
|
36
|
+
const v = opts.after;
|
|
37
|
+
if (v !== undefined)
|
|
38
|
+
query["after"] = v;
|
|
39
|
+
}
|
|
40
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
41
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (!hasSubcommand(group, "send")) {
|
|
45
|
+
group
|
|
46
|
+
.command("send")
|
|
47
|
+
.description("POST /api/v1/rooms/{roomId}/messages")
|
|
48
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
49
|
+
.requiredOption("--content <value>", "string, ≤50000 chars")
|
|
50
|
+
.option("--type <value>", "string")
|
|
51
|
+
.option("--parent-message-id <value>", "string")
|
|
52
|
+
.option("--reply-to-id <value>", "string")
|
|
53
|
+
.option("--sender-name <value>", "string, ≤255 chars")
|
|
54
|
+
.option("--attachment-url <value>", "string")
|
|
55
|
+
.option("--attachment-urls <comma-separated>", "array, ≤5 items")
|
|
56
|
+
.option("--file-name <value>", "string, ≤255 chars")
|
|
57
|
+
.option("--file-mime-type <value>", "string, ≤255 chars")
|
|
58
|
+
.option("--file-size <n>", "number")
|
|
59
|
+
.option("--file-attachments <json>", "array, ≤10 items (JSON)")
|
|
60
|
+
.option("--mentions <json>", "array, ≤50 items (JSON)")
|
|
61
|
+
.action(async (opts) => {
|
|
62
|
+
const { as } = program.opts();
|
|
63
|
+
if (!as)
|
|
64
|
+
throw new Error("--as <userId> is required");
|
|
65
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages`;
|
|
66
|
+
const body = {};
|
|
67
|
+
{
|
|
68
|
+
const v = opts.content;
|
|
69
|
+
if (v !== undefined)
|
|
70
|
+
body["content"] = v;
|
|
71
|
+
}
|
|
72
|
+
{
|
|
73
|
+
const v = opts.type;
|
|
74
|
+
if (v !== undefined)
|
|
75
|
+
body["type"] = v;
|
|
76
|
+
}
|
|
77
|
+
{
|
|
78
|
+
const v = opts.parentMessageId;
|
|
79
|
+
if (v !== undefined)
|
|
80
|
+
body["parentMessageId"] = v;
|
|
81
|
+
}
|
|
82
|
+
{
|
|
83
|
+
const v = opts.replyToId;
|
|
84
|
+
if (v !== undefined)
|
|
85
|
+
body["replyToId"] = v;
|
|
86
|
+
}
|
|
87
|
+
{
|
|
88
|
+
const v = opts.senderName;
|
|
89
|
+
if (v !== undefined)
|
|
90
|
+
body["senderName"] = v;
|
|
91
|
+
}
|
|
92
|
+
{
|
|
93
|
+
const v = opts.attachmentUrl;
|
|
94
|
+
if (v !== undefined)
|
|
95
|
+
body["attachmentUrl"] = v;
|
|
96
|
+
}
|
|
97
|
+
{
|
|
98
|
+
const v = opts.attachmentUrls === undefined ? undefined : opts.attachmentUrls.split(",").map((s) => s.trim()).filter(Boolean);
|
|
99
|
+
if (v !== undefined)
|
|
100
|
+
body["attachmentUrls"] = v;
|
|
101
|
+
}
|
|
102
|
+
{
|
|
103
|
+
const v = opts.fileName;
|
|
104
|
+
if (v !== undefined)
|
|
105
|
+
body["fileName"] = v;
|
|
106
|
+
}
|
|
107
|
+
{
|
|
108
|
+
const v = opts.fileMimeType;
|
|
109
|
+
if (v !== undefined)
|
|
110
|
+
body["fileMimeType"] = v;
|
|
111
|
+
}
|
|
112
|
+
{
|
|
113
|
+
const v = opts.fileSize === undefined ? undefined : Number(opts.fileSize);
|
|
114
|
+
if (v !== undefined)
|
|
115
|
+
body["fileSize"] = v;
|
|
116
|
+
}
|
|
117
|
+
{
|
|
118
|
+
const v = opts.fileAttachments === undefined ? undefined : JSON.parse(opts.fileAttachments);
|
|
119
|
+
if (v !== undefined)
|
|
120
|
+
body["fileAttachments"] = v;
|
|
121
|
+
}
|
|
122
|
+
{
|
|
123
|
+
const v = opts.mentions === undefined ? undefined : JSON.parse(opts.mentions);
|
|
124
|
+
if (v !== undefined)
|
|
125
|
+
body["mentions"] = v;
|
|
126
|
+
}
|
|
127
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
128
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (!hasSubcommand(group, "search-messages")) {
|
|
132
|
+
group
|
|
133
|
+
.command("search-messages")
|
|
134
|
+
.description("GET /api/v1/rooms/{roomId}/messages/search")
|
|
135
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
136
|
+
.option("--q <value>", "string")
|
|
137
|
+
.option("--limit <value>", "string")
|
|
138
|
+
.action(async (opts) => {
|
|
139
|
+
const { as } = program.opts();
|
|
140
|
+
if (!as)
|
|
141
|
+
throw new Error("--as <userId> is required");
|
|
142
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/search`;
|
|
143
|
+
const query = {};
|
|
144
|
+
{
|
|
145
|
+
const v = opts.q;
|
|
146
|
+
if (v !== undefined)
|
|
147
|
+
query["q"] = v;
|
|
148
|
+
}
|
|
149
|
+
{
|
|
150
|
+
const v = opts.limit;
|
|
151
|
+
if (v !== undefined)
|
|
152
|
+
query["limit"] = v;
|
|
153
|
+
}
|
|
154
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
155
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (!hasSubcommand(group, "get-message-public-meta")) {
|
|
159
|
+
group
|
|
160
|
+
.command("get-message-public-meta")
|
|
161
|
+
.description("GET /api/v1/rooms/{roomId}/messages/{messageId}/public-meta")
|
|
162
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
163
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
164
|
+
.action(async (opts) => {
|
|
165
|
+
const { as } = program.opts();
|
|
166
|
+
if (!as)
|
|
167
|
+
throw new Error("--as <userId> is required");
|
|
168
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/public-meta`;
|
|
169
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
170
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
if (!hasSubcommand(group, "messages-around")) {
|
|
174
|
+
group
|
|
175
|
+
.command("messages-around")
|
|
176
|
+
.description("GET /api/v1/rooms/{roomId}/messages/around/{messageId}")
|
|
177
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
178
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
179
|
+
.option("--limit <value>", "string")
|
|
180
|
+
.action(async (opts) => {
|
|
181
|
+
const { as } = program.opts();
|
|
182
|
+
if (!as)
|
|
183
|
+
throw new Error("--as <userId> is required");
|
|
184
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/around/${encodeURIComponent(opts.messageId)}`;
|
|
185
|
+
const query = {};
|
|
186
|
+
{
|
|
187
|
+
const v = opts.limit;
|
|
188
|
+
if (v !== undefined)
|
|
189
|
+
query["limit"] = v;
|
|
190
|
+
}
|
|
191
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
192
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (!hasSubcommand(group, "get-a2-ui")) {
|
|
196
|
+
group
|
|
197
|
+
.command("get-a2-ui")
|
|
198
|
+
.description("GET /api/v1/rooms/{roomId}/messages/{messageId}/a2ui")
|
|
199
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
200
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
201
|
+
.action(async (opts) => {
|
|
202
|
+
const { as } = program.opts();
|
|
203
|
+
if (!as)
|
|
204
|
+
throw new Error("--as <userId> is required");
|
|
205
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/a2ui`;
|
|
206
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
207
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
if (!hasSubcommand(group, "thread")) {
|
|
211
|
+
group
|
|
212
|
+
.command("thread")
|
|
213
|
+
.description("GET /api/v1/rooms/{roomId}/messages/{messageId}/thread")
|
|
214
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
215
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
216
|
+
.option("--include-root <value>", "string")
|
|
217
|
+
.option("--cursor <value>", "string")
|
|
218
|
+
.option("--limit <value>", "string")
|
|
219
|
+
.action(async (opts) => {
|
|
220
|
+
const { as } = program.opts();
|
|
221
|
+
if (!as)
|
|
222
|
+
throw new Error("--as <userId> is required");
|
|
223
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/thread`;
|
|
224
|
+
const query = {};
|
|
225
|
+
{
|
|
226
|
+
const v = opts.includeRoot;
|
|
227
|
+
if (v !== undefined)
|
|
228
|
+
query["includeRoot"] = v;
|
|
229
|
+
}
|
|
230
|
+
{
|
|
231
|
+
const v = opts.cursor;
|
|
232
|
+
if (v !== undefined)
|
|
233
|
+
query["cursor"] = v;
|
|
234
|
+
}
|
|
235
|
+
{
|
|
236
|
+
const v = opts.limit;
|
|
237
|
+
if (v !== undefined)
|
|
238
|
+
query["limit"] = v;
|
|
239
|
+
}
|
|
240
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
241
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
if (!hasSubcommand(group, "mark-thread-read")) {
|
|
245
|
+
group
|
|
246
|
+
.command("mark-thread-read")
|
|
247
|
+
.description("POST /api/v1/rooms/{roomId}/messages/{messageId}/thread/read")
|
|
248
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
249
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
250
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
251
|
+
.action(async (opts) => {
|
|
252
|
+
const { as } = program.opts();
|
|
253
|
+
if (!as)
|
|
254
|
+
throw new Error("--as <userId> is required");
|
|
255
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/thread/read`;
|
|
256
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
257
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
258
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
if (!hasSubcommand(group, "get-message-read-by")) {
|
|
262
|
+
group
|
|
263
|
+
.command("get-message-read-by")
|
|
264
|
+
.description("GET /api/v1/rooms/{roomId}/messages/{messageId}/read-by")
|
|
265
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
266
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
267
|
+
.action(async (opts) => {
|
|
268
|
+
const { as } = program.opts();
|
|
269
|
+
if (!as)
|
|
270
|
+
throw new Error("--as <userId> is required");
|
|
271
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/read-by`;
|
|
272
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
273
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
if (!hasSubcommand(group, "edit-message")) {
|
|
277
|
+
group
|
|
278
|
+
.command("edit-message")
|
|
279
|
+
.description("PATCH /api/v1/rooms/{roomId}/messages/{messageId}")
|
|
280
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
281
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
282
|
+
.requiredOption("--content <value>", "string, ≤50000 chars")
|
|
283
|
+
.option("--mentions <json>", "array, ≤50 items (JSON)")
|
|
284
|
+
.action(async (opts) => {
|
|
285
|
+
const { as } = program.opts();
|
|
286
|
+
if (!as)
|
|
287
|
+
throw new Error("--as <userId> is required");
|
|
288
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}`;
|
|
289
|
+
const body = {};
|
|
290
|
+
{
|
|
291
|
+
const v = opts.content;
|
|
292
|
+
if (v !== undefined)
|
|
293
|
+
body["content"] = v;
|
|
294
|
+
}
|
|
295
|
+
{
|
|
296
|
+
const v = opts.mentions === undefined ? undefined : JSON.parse(opts.mentions);
|
|
297
|
+
if (v !== undefined)
|
|
298
|
+
body["mentions"] = v;
|
|
299
|
+
}
|
|
300
|
+
const data = await call({ method: "PATCH", path, asUserId: as, body });
|
|
301
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
if (!hasSubcommand(group, "delete-message")) {
|
|
305
|
+
group
|
|
306
|
+
.command("delete-message")
|
|
307
|
+
.description("DELETE /api/v1/rooms/{roomId}/messages/{messageId}")
|
|
308
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
309
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
310
|
+
.action(async (opts) => {
|
|
311
|
+
const { as } = program.opts();
|
|
312
|
+
if (!as)
|
|
313
|
+
throw new Error("--as <userId> is required");
|
|
314
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}`;
|
|
315
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
316
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
if (!hasSubcommand(group, "unsend-message")) {
|
|
320
|
+
group
|
|
321
|
+
.command("unsend-message")
|
|
322
|
+
.description("POST /api/v1/rooms/{roomId}/messages/{messageId}/unsend")
|
|
323
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
324
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
325
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
326
|
+
.action(async (opts) => {
|
|
327
|
+
const { as } = program.opts();
|
|
328
|
+
if (!as)
|
|
329
|
+
throw new Error("--as <userId> is required");
|
|
330
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/unsend`;
|
|
331
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
332
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
333
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
if (!hasSubcommand(group, "toggle-reaction")) {
|
|
337
|
+
group
|
|
338
|
+
.command("toggle-reaction")
|
|
339
|
+
.description("POST /api/v1/rooms/{roomId}/messages/{messageId}/reactions")
|
|
340
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
341
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
342
|
+
.requiredOption("--type <value>", "string")
|
|
343
|
+
.action(async (opts) => {
|
|
344
|
+
const { as } = program.opts();
|
|
345
|
+
if (!as)
|
|
346
|
+
throw new Error("--as <userId> is required");
|
|
347
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/reactions`;
|
|
348
|
+
const body = {};
|
|
349
|
+
{
|
|
350
|
+
const v = opts.type;
|
|
351
|
+
if (v !== undefined)
|
|
352
|
+
body["type"] = v;
|
|
353
|
+
}
|
|
354
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
355
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
if (!hasSubcommand(group, "remove-reaction")) {
|
|
359
|
+
group
|
|
360
|
+
.command("remove-reaction")
|
|
361
|
+
.description("DELETE /api/v1/rooms/{roomId}/messages/{messageId}/reactions/{reactionId}")
|
|
362
|
+
.requiredOption("--reaction-id <value>", "reactionId (path param)")
|
|
363
|
+
.action(async (opts) => {
|
|
364
|
+
const { as } = program.opts();
|
|
365
|
+
if (!as)
|
|
366
|
+
throw new Error("--as <userId> is required");
|
|
367
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/reactions/${encodeURIComponent(opts.reactionId)}`;
|
|
368
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
369
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
if (!hasSubcommand(group, "accept-suggestion")) {
|
|
373
|
+
group
|
|
374
|
+
.command("accept-suggestion")
|
|
375
|
+
.description("POST /api/v1/rooms/{roomId}/messages/{messageId}/accept-suggestion")
|
|
376
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
377
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
378
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
379
|
+
.action(async (opts) => {
|
|
380
|
+
const { as } = program.opts();
|
|
381
|
+
if (!as)
|
|
382
|
+
throw new Error("--as <userId> is required");
|
|
383
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/accept-suggestion`;
|
|
384
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
385
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
386
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
if (!hasSubcommand(group, "report-message")) {
|
|
390
|
+
group
|
|
391
|
+
.command("report-message")
|
|
392
|
+
.description("POST /api/v1/rooms/{roomId}/messages/{messageId}/report")
|
|
393
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
394
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
395
|
+
.requiredOption("--reason <value>", "string")
|
|
396
|
+
.option("--description <value>", "string, ≤500 chars")
|
|
397
|
+
.action(async (opts) => {
|
|
398
|
+
const { as } = program.opts();
|
|
399
|
+
if (!as)
|
|
400
|
+
throw new Error("--as <userId> is required");
|
|
401
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/report`;
|
|
402
|
+
const body = {};
|
|
403
|
+
{
|
|
404
|
+
const v = opts.reason;
|
|
405
|
+
if (v !== undefined)
|
|
406
|
+
body["reason"] = v;
|
|
407
|
+
}
|
|
408
|
+
{
|
|
409
|
+
const v = opts.description;
|
|
410
|
+
if (v !== undefined)
|
|
411
|
+
body["description"] = v;
|
|
412
|
+
}
|
|
413
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
414
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
//# sourceMappingURL=messages.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, "one-emulator", "OneEmulator operations");
|
|
5
|
+
if (!hasSubcommand(group, "redirect")) {
|
|
6
|
+
group
|
|
7
|
+
.command("redirect")
|
|
8
|
+
.description("GET /api/v1/get/one-emulator")
|
|
9
|
+
.requiredOption("--ref <value>", "string")
|
|
10
|
+
.requiredOption("--challenge <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/get/one-emulator`;
|
|
16
|
+
const query = {};
|
|
17
|
+
{
|
|
18
|
+
const v = opts.ref;
|
|
19
|
+
if (v !== undefined)
|
|
20
|
+
query["ref"] = v;
|
|
21
|
+
}
|
|
22
|
+
{
|
|
23
|
+
const v = opts.challenge;
|
|
24
|
+
if (v !== undefined)
|
|
25
|
+
query["challenge"] = 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=one-emulator.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, "pdf-export", "PdfExport operations");
|
|
5
|
+
if (!hasSubcommand(group, "export-saved-stories")) {
|
|
6
|
+
group
|
|
7
|
+
.command("export-saved-stories")
|
|
8
|
+
.description("GET /api/v1/users/me/saved-stories/export")
|
|
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/saved-stories/export`;
|
|
14
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
15
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=pdf-export.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "pin-folders", "PinFolders operations");
|
|
5
|
+
if (!hasSubcommand(group, "list-folders")) {
|
|
6
|
+
group
|
|
7
|
+
.command("list-folders")
|
|
8
|
+
.description("GET /api/v1/rooms/{roomId}/pin-folders")
|
|
9
|
+
.requiredOption("--room-id <value>", "roomId (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.roomId)}/pin-folders`;
|
|
15
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
16
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
if (!hasSubcommand(group, "create-folder")) {
|
|
20
|
+
group
|
|
21
|
+
.command("create-folder")
|
|
22
|
+
.description("POST /api/v1/rooms/{roomId}/pin-folders")
|
|
23
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
24
|
+
.requiredOption("--name <value>", "string")
|
|
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.roomId)}/pin-folders`;
|
|
30
|
+
const body = {};
|
|
31
|
+
{
|
|
32
|
+
const v = opts.name;
|
|
33
|
+
if (v !== undefined)
|
|
34
|
+
body["name"] = v;
|
|
35
|
+
}
|
|
36
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
37
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (!hasSubcommand(group, "delete-folder")) {
|
|
41
|
+
group
|
|
42
|
+
.command("delete-folder")
|
|
43
|
+
.description("DELETE /api/v1/rooms/{roomId}/pin-folders/{folderId}")
|
|
44
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
45
|
+
.requiredOption("--folder-id <value>", "folderId (path param)")
|
|
46
|
+
.action(async (opts) => {
|
|
47
|
+
const { as } = program.opts();
|
|
48
|
+
if (!as)
|
|
49
|
+
throw new Error("--as <userId> is required");
|
|
50
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/pin-folders/${encodeURIComponent(opts.folderId)}`;
|
|
51
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
52
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (!hasSubcommand(group, "ensure-default")) {
|
|
56
|
+
group
|
|
57
|
+
.command("ensure-default")
|
|
58
|
+
.description("POST /api/v1/rooms/{roomId}/pin-folders/ensure-default")
|
|
59
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
60
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
61
|
+
.action(async (opts) => {
|
|
62
|
+
const { as } = program.opts();
|
|
63
|
+
if (!as)
|
|
64
|
+
throw new Error("--as <userId> is required");
|
|
65
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/pin-folders/ensure-default`;
|
|
66
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
67
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
68
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=pin-folders.js.map
|