@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,251 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "challenges", "Challenges operations");
|
|
5
|
+
if (!hasSubcommand(group, "create")) {
|
|
6
|
+
group
|
|
7
|
+
.command("create")
|
|
8
|
+
.description("POST /api/v1/challenges")
|
|
9
|
+
.requiredOption("--room-id <value>", "string")
|
|
10
|
+
.requiredOption("--week-number <n>", "number")
|
|
11
|
+
.requiredOption("--title <value>", "string")
|
|
12
|
+
.requiredOption("--game-title <value>", "string")
|
|
13
|
+
.requiredOption("--description <value>", "string")
|
|
14
|
+
.requiredOption("--rules-text <value>", "string")
|
|
15
|
+
.option("--win-condition <value>", "string")
|
|
16
|
+
.option("--prize <value>", "string")
|
|
17
|
+
.requiredOption("--starts-at <value>", "string")
|
|
18
|
+
.requiredOption("--ends-at <value>", "string")
|
|
19
|
+
.action(async (opts) => {
|
|
20
|
+
const { as } = program.opts();
|
|
21
|
+
if (!as)
|
|
22
|
+
throw new Error("--as <userId> is required");
|
|
23
|
+
const path = `/api/v1/challenges`;
|
|
24
|
+
const body = {};
|
|
25
|
+
{
|
|
26
|
+
const v = opts.roomId;
|
|
27
|
+
if (v !== undefined)
|
|
28
|
+
body["roomId"] = v;
|
|
29
|
+
}
|
|
30
|
+
{
|
|
31
|
+
const v = opts.weekNumber === undefined ? undefined : Number(opts.weekNumber);
|
|
32
|
+
if (v !== undefined)
|
|
33
|
+
body["weekNumber"] = v;
|
|
34
|
+
}
|
|
35
|
+
{
|
|
36
|
+
const v = opts.title;
|
|
37
|
+
if (v !== undefined)
|
|
38
|
+
body["title"] = v;
|
|
39
|
+
}
|
|
40
|
+
{
|
|
41
|
+
const v = opts.gameTitle;
|
|
42
|
+
if (v !== undefined)
|
|
43
|
+
body["gameTitle"] = v;
|
|
44
|
+
}
|
|
45
|
+
{
|
|
46
|
+
const v = opts.description;
|
|
47
|
+
if (v !== undefined)
|
|
48
|
+
body["description"] = v;
|
|
49
|
+
}
|
|
50
|
+
{
|
|
51
|
+
const v = opts.rulesText;
|
|
52
|
+
if (v !== undefined)
|
|
53
|
+
body["rulesText"] = v;
|
|
54
|
+
}
|
|
55
|
+
{
|
|
56
|
+
const v = opts.winCondition;
|
|
57
|
+
if (v !== undefined)
|
|
58
|
+
body["winCondition"] = v;
|
|
59
|
+
}
|
|
60
|
+
{
|
|
61
|
+
const v = opts.prize;
|
|
62
|
+
if (v !== undefined)
|
|
63
|
+
body["prize"] = v;
|
|
64
|
+
}
|
|
65
|
+
{
|
|
66
|
+
const v = opts.startsAt;
|
|
67
|
+
if (v !== undefined)
|
|
68
|
+
body["startsAt"] = v;
|
|
69
|
+
}
|
|
70
|
+
{
|
|
71
|
+
const v = opts.endsAt;
|
|
72
|
+
if (v !== undefined)
|
|
73
|
+
body["endsAt"] = v;
|
|
74
|
+
}
|
|
75
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
76
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (!hasSubcommand(group, "current")) {
|
|
80
|
+
group
|
|
81
|
+
.command("current")
|
|
82
|
+
.description("GET /api/v1/rooms/{roomId}/challenge/current")
|
|
83
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
84
|
+
.option("--challenge-id <json>", " (JSON)")
|
|
85
|
+
.action(async (opts) => {
|
|
86
|
+
const { as } = program.opts();
|
|
87
|
+
if (!as)
|
|
88
|
+
throw new Error("--as <userId> is required");
|
|
89
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/challenge/current`;
|
|
90
|
+
const query = {};
|
|
91
|
+
{
|
|
92
|
+
const v = opts.challengeId === undefined ? undefined : JSON.parse(opts.challengeId);
|
|
93
|
+
if (v !== undefined)
|
|
94
|
+
query["challengeId"] = v;
|
|
95
|
+
}
|
|
96
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
97
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (!hasSubcommand(group, "join")) {
|
|
101
|
+
group
|
|
102
|
+
.command("join")
|
|
103
|
+
.description("POST /api/v1/challenges/{id}/join")
|
|
104
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
105
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
106
|
+
.action(async (opts) => {
|
|
107
|
+
const { as } = program.opts();
|
|
108
|
+
if (!as)
|
|
109
|
+
throw new Error("--as <userId> is required");
|
|
110
|
+
const path = `/api/v1/challenges/${encodeURIComponent(opts.id)}/join`;
|
|
111
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
112
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
113
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (!hasSubcommand(group, "card")) {
|
|
117
|
+
group
|
|
118
|
+
.command("card")
|
|
119
|
+
.description("GET /api/v1/challenges/{id}/card")
|
|
120
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
121
|
+
.action(async (opts) => {
|
|
122
|
+
const { as } = program.opts();
|
|
123
|
+
if (!as)
|
|
124
|
+
throw new Error("--as <userId> is required");
|
|
125
|
+
const path = `/api/v1/challenges/${encodeURIComponent(opts.id)}/card`;
|
|
126
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
127
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (!hasSubcommand(group, "leaderboard")) {
|
|
131
|
+
group
|
|
132
|
+
.command("leaderboard")
|
|
133
|
+
.description("GET /api/v1/challenges/{id}/leaderboard")
|
|
134
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
135
|
+
.action(async (opts) => {
|
|
136
|
+
const { as } = program.opts();
|
|
137
|
+
if (!as)
|
|
138
|
+
throw new Error("--as <userId> is required");
|
|
139
|
+
const path = `/api/v1/challenges/${encodeURIComponent(opts.id)}/leaderboard`;
|
|
140
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
141
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (!hasSubcommand(group, "resolve-invite")) {
|
|
145
|
+
group
|
|
146
|
+
.command("resolve-invite")
|
|
147
|
+
.description("GET /api/v1/challenges/invite/{inviteCode}")
|
|
148
|
+
.requiredOption("--invite-code <value>", "inviteCode (path param)")
|
|
149
|
+
.action(async (opts) => {
|
|
150
|
+
const { as } = program.opts();
|
|
151
|
+
if (!as)
|
|
152
|
+
throw new Error("--as <userId> is required");
|
|
153
|
+
const path = `/api/v1/challenges/invite/${encodeURIComponent(opts.inviteCode)}`;
|
|
154
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
155
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (!hasSubcommand(group, "log-invite-click")) {
|
|
159
|
+
group
|
|
160
|
+
.command("log-invite-click")
|
|
161
|
+
.description("POST /api/v1/challenges/invite/{inviteCode}/click")
|
|
162
|
+
.requiredOption("--invite-code <value>", "inviteCode (path param)")
|
|
163
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
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/challenges/invite/${encodeURIComponent(opts.inviteCode)}/click`;
|
|
169
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
170
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
171
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
if (!hasSubcommand(group, "list")) {
|
|
175
|
+
group
|
|
176
|
+
.command("list")
|
|
177
|
+
.description("GET /api/v1/rooms/{roomId}/challenges")
|
|
178
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
179
|
+
.action(async (opts) => {
|
|
180
|
+
const { as } = program.opts();
|
|
181
|
+
if (!as)
|
|
182
|
+
throw new Error("--as <userId> is required");
|
|
183
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/challenges`;
|
|
184
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
185
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
if (!hasSubcommand(group, "close")) {
|
|
189
|
+
group
|
|
190
|
+
.command("close")
|
|
191
|
+
.description("POST /api/v1/challenges/{id}/close")
|
|
192
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
193
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
194
|
+
.action(async (opts) => {
|
|
195
|
+
const { as } = program.opts();
|
|
196
|
+
if (!as)
|
|
197
|
+
throw new Error("--as <userId> is required");
|
|
198
|
+
const path = `/api/v1/challenges/${encodeURIComponent(opts.id)}/close`;
|
|
199
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
200
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
201
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
if (!hasSubcommand(group, "regenerate-image")) {
|
|
205
|
+
group
|
|
206
|
+
.command("regenerate-image")
|
|
207
|
+
.description("POST /api/v1/challenges/{id}/regenerate-image")
|
|
208
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
209
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
210
|
+
.action(async (opts) => {
|
|
211
|
+
const { as } = program.opts();
|
|
212
|
+
if (!as)
|
|
213
|
+
throw new Error("--as <userId> is required");
|
|
214
|
+
const path = `/api/v1/challenges/${encodeURIComponent(opts.id)}/regenerate-image`;
|
|
215
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
216
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
217
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (!hasSubcommand(group, "regenerate-cards")) {
|
|
221
|
+
group
|
|
222
|
+
.command("regenerate-cards")
|
|
223
|
+
.description("POST /api/v1/challenges/{id}/regenerate-cards")
|
|
224
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
225
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
226
|
+
.action(async (opts) => {
|
|
227
|
+
const { as } = program.opts();
|
|
228
|
+
if (!as)
|
|
229
|
+
throw new Error("--as <userId> is required");
|
|
230
|
+
const path = `/api/v1/challenges/${encodeURIComponent(opts.id)}/regenerate-cards`;
|
|
231
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
232
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
233
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (!hasSubcommand(group, "delete")) {
|
|
237
|
+
group
|
|
238
|
+
.command("delete")
|
|
239
|
+
.description("DELETE /api/v1/challenges/{id}")
|
|
240
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
241
|
+
.action(async (opts) => {
|
|
242
|
+
const { as } = program.opts();
|
|
243
|
+
if (!as)
|
|
244
|
+
throw new Error("--as <userId> is required");
|
|
245
|
+
const path = `/api/v1/challenges/${encodeURIComponent(opts.id)}`;
|
|
246
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
247
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=challenges.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "clips", "Clips operations");
|
|
5
|
+
if (!hasSubcommand(group, "create")) {
|
|
6
|
+
group
|
|
7
|
+
.command("create")
|
|
8
|
+
.description("POST /api/v1/stories/{storyId}/clips")
|
|
9
|
+
.requiredOption("--story-id <value>", "storyId (path param)")
|
|
10
|
+
.option("--voiceover-tone <value>", "string")
|
|
11
|
+
.option("--background <value>", "string")
|
|
12
|
+
.option("--show-source-logos <true|false>", "boolean")
|
|
13
|
+
.option("--show-end-card <true|false>", "boolean")
|
|
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/stories/${encodeURIComponent(opts.storyId)}/clips`;
|
|
19
|
+
const body = {};
|
|
20
|
+
{
|
|
21
|
+
const v = opts.voiceoverTone;
|
|
22
|
+
if (v !== undefined)
|
|
23
|
+
body["voiceoverTone"] = v;
|
|
24
|
+
}
|
|
25
|
+
{
|
|
26
|
+
const v = opts.background;
|
|
27
|
+
if (v !== undefined)
|
|
28
|
+
body["background"] = v;
|
|
29
|
+
}
|
|
30
|
+
{
|
|
31
|
+
const v = opts.showSourceLogos === undefined ? undefined : opts.showSourceLogos === "true";
|
|
32
|
+
if (v !== undefined)
|
|
33
|
+
body["showSourceLogos"] = v;
|
|
34
|
+
}
|
|
35
|
+
{
|
|
36
|
+
const v = opts.showEndCard === undefined ? undefined : opts.showEndCard === "true";
|
|
37
|
+
if (v !== undefined)
|
|
38
|
+
body["showEndCard"] = v;
|
|
39
|
+
}
|
|
40
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
41
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (!hasSubcommand(group, "list-mine")) {
|
|
45
|
+
group
|
|
46
|
+
.command("list-mine")
|
|
47
|
+
.description("GET /api/v1/users/me/clips")
|
|
48
|
+
.option("--cursor <value>", "string")
|
|
49
|
+
.option("--limit <value>", "string")
|
|
50
|
+
.action(async (opts) => {
|
|
51
|
+
const { as } = program.opts();
|
|
52
|
+
if (!as)
|
|
53
|
+
throw new Error("--as <userId> is required");
|
|
54
|
+
const path = `/api/v1/users/me/clips`;
|
|
55
|
+
const query = {};
|
|
56
|
+
{
|
|
57
|
+
const v = opts.cursor;
|
|
58
|
+
if (v !== undefined)
|
|
59
|
+
query["cursor"] = v;
|
|
60
|
+
}
|
|
61
|
+
{
|
|
62
|
+
const v = opts.limit;
|
|
63
|
+
if (v !== undefined)
|
|
64
|
+
query["limit"] = v;
|
|
65
|
+
}
|
|
66
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
67
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=clips.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "contact-match", "ContactMatch operations");
|
|
5
|
+
if (!hasSubcommand(group, "match")) {
|
|
6
|
+
group
|
|
7
|
+
.command("match")
|
|
8
|
+
.description("POST /api/v1/users/me/contacts/match")
|
|
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/users/me/contacts/match`;
|
|
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
|
+
if (!hasSubcommand(group, "list")) {
|
|
21
|
+
group
|
|
22
|
+
.command("list")
|
|
23
|
+
.description("GET /api/v1/users/me/contacts")
|
|
24
|
+
.action(async (opts) => {
|
|
25
|
+
const { as } = program.opts();
|
|
26
|
+
if (!as)
|
|
27
|
+
throw new Error("--as <userId> is required");
|
|
28
|
+
const path = `/api/v1/users/me/contacts`;
|
|
29
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
30
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (!hasSubcommand(group, "sync")) {
|
|
34
|
+
group
|
|
35
|
+
.command("sync")
|
|
36
|
+
.description("POST /api/v1/users/me/contacts/sync")
|
|
37
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
38
|
+
.action(async (opts) => {
|
|
39
|
+
const { as } = program.opts();
|
|
40
|
+
if (!as)
|
|
41
|
+
throw new Error("--as <userId> is required");
|
|
42
|
+
const path = `/api/v1/users/me/contacts/sync`;
|
|
43
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
44
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
45
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!hasSubcommand(group, "add")) {
|
|
49
|
+
group
|
|
50
|
+
.command("add")
|
|
51
|
+
.description("POST /api/v1/users/me/contacts/add")
|
|
52
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
53
|
+
.action(async (opts) => {
|
|
54
|
+
const { as } = program.opts();
|
|
55
|
+
if (!as)
|
|
56
|
+
throw new Error("--as <userId> is required");
|
|
57
|
+
const path = `/api/v1/users/me/contacts/add`;
|
|
58
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
59
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
60
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (!hasSubcommand(group, "remove")) {
|
|
64
|
+
group
|
|
65
|
+
.command("remove")
|
|
66
|
+
.description("DELETE /api/v1/users/me/contacts/{contactId}")
|
|
67
|
+
.requiredOption("--contact-id <value>", "contactId (path param)")
|
|
68
|
+
.action(async (opts) => {
|
|
69
|
+
const { as } = program.opts();
|
|
70
|
+
if (!as)
|
|
71
|
+
throw new Error("--as <userId> is required");
|
|
72
|
+
const path = `/api/v1/users/me/contacts/${encodeURIComponent(opts.contactId)}`;
|
|
73
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
74
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (!hasSubcommand(group, "check")) {
|
|
78
|
+
group
|
|
79
|
+
.command("check")
|
|
80
|
+
.description("GET /api/v1/users/me/contacts/check/{userId}")
|
|
81
|
+
.requiredOption("--user-id <value>", "userId (path param)")
|
|
82
|
+
.action(async (opts) => {
|
|
83
|
+
const { as } = program.opts();
|
|
84
|
+
if (!as)
|
|
85
|
+
throw new Error("--as <userId> is required");
|
|
86
|
+
const path = `/api/v1/users/me/contacts/check/${encodeURIComponent(opts.userId)}`;
|
|
87
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
88
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=contact-match.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
3
|
+
export function register(program) {
|
|
4
|
+
const group = getOrCreateGroup(program, "content-crawler", "ContentCrawler operations");
|
|
5
|
+
if (!hasSubcommand(group, "search")) {
|
|
6
|
+
group
|
|
7
|
+
.command("search")
|
|
8
|
+
.description("POST /api/v1/rooms/{roomId}/content-search")
|
|
9
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
10
|
+
.requiredOption("--query <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)}/content-search`;
|
|
16
|
+
const body = {};
|
|
17
|
+
{
|
|
18
|
+
const v = opts.query;
|
|
19
|
+
if (v !== undefined)
|
|
20
|
+
body["query"] = v;
|
|
21
|
+
}
|
|
22
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
23
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=content-crawler.js.map
|