@fulldivevr/workcord-cli 1.3.0 → 2.17.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 +91 -41
- package/dist/auth.js +24 -8
- package/dist/cli.js +7 -3
- package/dist/client.js +8 -1
- package/dist/commands/agent-skills.js +127 -0
- package/dist/commands/hub.js +667 -0
- package/dist/commands/messages.js +150 -4
- package/dist/commands/reflections.js +96 -0
- package/dist/commands/rooms.js +7 -3
- package/dist/generated/commands/agent-feedback-admin.js +69 -0
- package/dist/generated/commands/ai.js +31 -0
- package/dist/generated/commands/call-recordings.js +56 -0
- package/dist/generated/commands/contact-match.js +20 -1
- package/dist/generated/commands/credit-packs.js +112 -0
- package/dist/generated/commands/custom-agents.js +483 -1
- package/dist/generated/commands/desktop-releases.js +2 -2
- package/dist/generated/commands/edge-sizecheck.js +25 -0
- package/dist/generated/commands/feed.js +6 -0
- package/dist/generated/commands/interactive-events.js +47 -0
- package/dist/generated/commands/internal.js +191 -0
- package/dist/generated/commands/meetings.js +12 -0
- package/dist/generated/commands/messages.js +15 -0
- package/dist/generated/commands/my-feedback.js +18 -0
- package/dist/generated/commands/pinned-messages.js +6 -0
- package/dist/generated/commands/proxy-nodes.js +83 -0
- package/dist/generated/commands/push.js +20 -0
- package/dist/generated/commands/reviews.js +96 -0
- package/dist/generated/commands/room-agents.js +243 -1
- package/dist/generated/commands/room-invites.js +12 -0
- package/dist/generated/commands/rooms.js +79 -1
- package/dist/generated/commands/search.js +1 -1
- package/dist/generated/commands/shadow-dispatch-push.js +20 -0
- package/dist/generated/commands/shadow-reflections.js +111 -0
- package/dist/generated/index.js +20 -0
- package/dist/http.js +6 -2
- package/dist/room-types.js +10 -0
- package/package.json +1 -1
- package/dist/generated/commands/health.js +0 -29
|
@@ -17,6 +17,59 @@ export function register(program) {
|
|
|
17
17
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
+
if (!hasSubcommand(group, "emit-call-interim")) {
|
|
21
|
+
group
|
|
22
|
+
.command("emit-call-interim")
|
|
23
|
+
.description("POST /api/v1/internal/calls/{callId}/interim")
|
|
24
|
+
.requiredOption("--call-id <value>", "callId (path param)")
|
|
25
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
26
|
+
.action(async (opts) => {
|
|
27
|
+
const as = actingUserId(program);
|
|
28
|
+
const path = `/api/v1/internal/calls/${encodeURIComponent(opts.callId)}/interim`;
|
|
29
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
30
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
31
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (!hasSubcommand(group, "voice-metrics")) {
|
|
35
|
+
group
|
|
36
|
+
.command("voice-metrics")
|
|
37
|
+
.description("GET /api/v1/internal/calls/voice-metrics")
|
|
38
|
+
.action(async (opts) => {
|
|
39
|
+
const as = actingUserId(program);
|
|
40
|
+
const path = `/api/v1/internal/calls/voice-metrics`;
|
|
41
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
42
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (!hasSubcommand(group, "voice-state")) {
|
|
46
|
+
group
|
|
47
|
+
.command("voice-state")
|
|
48
|
+
.description("POST /api/v1/internal/calls/{callId}/voice-state")
|
|
49
|
+
.requiredOption("--call-id <value>", "callId (path param)")
|
|
50
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
51
|
+
.action(async (opts) => {
|
|
52
|
+
const as = actingUserId(program);
|
|
53
|
+
const path = `/api/v1/internal/calls/${encodeURIComponent(opts.callId)}/voice-state`;
|
|
54
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
55
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
56
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (!hasSubcommand(group, "emit-transcription-status")) {
|
|
60
|
+
group
|
|
61
|
+
.command("emit-transcription-status")
|
|
62
|
+
.description("POST /api/v1/internal/calls/{callId}/transcription-status")
|
|
63
|
+
.requiredOption("--call-id <value>", "callId (path param)")
|
|
64
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
65
|
+
.action(async (opts) => {
|
|
66
|
+
const as = actingUserId(program);
|
|
67
|
+
const path = `/api/v1/internal/calls/${encodeURIComponent(opts.callId)}/transcription-status`;
|
|
68
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
69
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
70
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
20
73
|
if (!hasSubcommand(group, "emit-message")) {
|
|
21
74
|
group
|
|
22
75
|
.command("emit-message")
|
|
@@ -44,6 +97,44 @@ export function register(program) {
|
|
|
44
97
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
45
98
|
});
|
|
46
99
|
}
|
|
100
|
+
if (!hasSubcommand(group, "voice-dispatch-result")) {
|
|
101
|
+
group
|
|
102
|
+
.command("voice-dispatch-result")
|
|
103
|
+
.description("GET /api/v1/internal/voice/dispatch/{taskId}")
|
|
104
|
+
.requiredOption("--task-id <value>", "taskId (path param)")
|
|
105
|
+
.option("--shadow-room-id <value>", "string")
|
|
106
|
+
.option("--agent-id <value>", "string")
|
|
107
|
+
.action(async (opts) => {
|
|
108
|
+
const as = actingUserId(program);
|
|
109
|
+
const path = `/api/v1/internal/voice/dispatch/${encodeURIComponent(opts.taskId)}`;
|
|
110
|
+
const query = {};
|
|
111
|
+
{
|
|
112
|
+
const v = opts.shadowRoomId;
|
|
113
|
+
if (v !== undefined)
|
|
114
|
+
query["shadowRoomId"] = v;
|
|
115
|
+
}
|
|
116
|
+
{
|
|
117
|
+
const v = opts.agentId;
|
|
118
|
+
if (v !== undefined)
|
|
119
|
+
query["agentId"] = v;
|
|
120
|
+
}
|
|
121
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
122
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if (!hasSubcommand(group, "voice-warmup")) {
|
|
126
|
+
group
|
|
127
|
+
.command("voice-warmup")
|
|
128
|
+
.description("POST /api/v1/internal/voice/warmup")
|
|
129
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
130
|
+
.action(async (opts) => {
|
|
131
|
+
const as = actingUserId(program);
|
|
132
|
+
const path = `/api/v1/internal/voice/warmup`;
|
|
133
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
134
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
135
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
136
|
+
});
|
|
137
|
+
}
|
|
47
138
|
if (!hasSubcommand(group, "list-users")) {
|
|
48
139
|
group
|
|
49
140
|
.command("list-users")
|
|
@@ -94,6 +185,106 @@ export function register(program) {
|
|
|
94
185
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
95
186
|
});
|
|
96
187
|
}
|
|
188
|
+
if (!hasSubcommand(group, "ban-user")) {
|
|
189
|
+
group
|
|
190
|
+
.command("ban-user")
|
|
191
|
+
.description("POST /api/v1/internal/users/{userId}/ban")
|
|
192
|
+
.requiredOption("--user-id <value>", "userId (path param)")
|
|
193
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
194
|
+
.action(async (opts) => {
|
|
195
|
+
const as = actingUserId(program);
|
|
196
|
+
const path = `/api/v1/internal/users/${encodeURIComponent(opts.userId)}/ban`;
|
|
197
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
198
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
199
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (!hasSubcommand(group, "ban-status")) {
|
|
203
|
+
group
|
|
204
|
+
.command("ban-status")
|
|
205
|
+
.description("GET /api/v1/internal/users/{userId}/ban")
|
|
206
|
+
.requiredOption("--user-id <value>", "userId (path param)")
|
|
207
|
+
.action(async (opts) => {
|
|
208
|
+
const as = actingUserId(program);
|
|
209
|
+
const path = `/api/v1/internal/users/${encodeURIComponent(opts.userId)}/ban`;
|
|
210
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
211
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
if (!hasSubcommand(group, "unban-user")) {
|
|
215
|
+
group
|
|
216
|
+
.command("unban-user")
|
|
217
|
+
.description("POST /api/v1/internal/users/{userId}/unban")
|
|
218
|
+
.requiredOption("--user-id <value>", "userId (path param)")
|
|
219
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
220
|
+
.action(async (opts) => {
|
|
221
|
+
const as = actingUserId(program);
|
|
222
|
+
const path = `/api/v1/internal/users/${encodeURIComponent(opts.userId)}/unban`;
|
|
223
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
224
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
225
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (!hasSubcommand(group, "ban-content-jobs")) {
|
|
229
|
+
group
|
|
230
|
+
.command("ban-content-jobs")
|
|
231
|
+
.description("GET /api/v1/internal/ban-content-jobs")
|
|
232
|
+
.option("--limit <json>", " (JSON)")
|
|
233
|
+
.action(async (opts) => {
|
|
234
|
+
const as = actingUserId(program);
|
|
235
|
+
const path = `/api/v1/internal/ban-content-jobs`;
|
|
236
|
+
const query = {};
|
|
237
|
+
{
|
|
238
|
+
const v = opts.limit === undefined ? undefined : JSON.parse(opts.limit);
|
|
239
|
+
if (v !== undefined)
|
|
240
|
+
query["limit"] = v;
|
|
241
|
+
}
|
|
242
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
243
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
if (!hasSubcommand(group, "author-profile-jobs")) {
|
|
247
|
+
group
|
|
248
|
+
.command("author-profile-jobs")
|
|
249
|
+
.description("GET /api/v1/internal/author-profile-jobs")
|
|
250
|
+
.option("--limit <json>", " (JSON)")
|
|
251
|
+
.action(async (opts) => {
|
|
252
|
+
const as = actingUserId(program);
|
|
253
|
+
const path = `/api/v1/internal/author-profile-jobs`;
|
|
254
|
+
const query = {};
|
|
255
|
+
{
|
|
256
|
+
const v = opts.limit === undefined ? undefined : JSON.parse(opts.limit);
|
|
257
|
+
if (v !== undefined)
|
|
258
|
+
query["limit"] = v;
|
|
259
|
+
}
|
|
260
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
261
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
if (!hasSubcommand(group, "list-bans")) {
|
|
265
|
+
group
|
|
266
|
+
.command("list-bans")
|
|
267
|
+
.description("GET /api/v1/internal/bans")
|
|
268
|
+
.option("--cursor <value>", "string")
|
|
269
|
+
.option("--limit <json>", " (JSON)")
|
|
270
|
+
.action(async (opts) => {
|
|
271
|
+
const as = actingUserId(program);
|
|
272
|
+
const path = `/api/v1/internal/bans`;
|
|
273
|
+
const query = {};
|
|
274
|
+
{
|
|
275
|
+
const v = opts.cursor;
|
|
276
|
+
if (v !== undefined)
|
|
277
|
+
query["cursor"] = v;
|
|
278
|
+
}
|
|
279
|
+
{
|
|
280
|
+
const v = opts.limit === undefined ? undefined : JSON.parse(opts.limit);
|
|
281
|
+
if (v !== undefined)
|
|
282
|
+
query["limit"] = v;
|
|
283
|
+
}
|
|
284
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
285
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
286
|
+
});
|
|
287
|
+
}
|
|
97
288
|
if (!hasSubcommand(group, "list-email-allowlist")) {
|
|
98
289
|
group
|
|
99
290
|
.command("list-email-allowlist")
|
|
@@ -68,5 +68,17 @@ export function register(program) {
|
|
|
68
68
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
if (!hasSubcommand(group, "report")) {
|
|
72
|
+
group
|
|
73
|
+
.command("report")
|
|
74
|
+
.description("GET /api/v1/meetings/{id}/report")
|
|
75
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
76
|
+
.action(async (opts) => {
|
|
77
|
+
const as = actingUserId(program);
|
|
78
|
+
const path = `/api/v1/meetings/${encodeURIComponent(opts.id)}/report`;
|
|
79
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
80
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
81
|
+
});
|
|
82
|
+
}
|
|
71
83
|
}
|
|
72
84
|
//# sourceMappingURL=meetings.js.map
|
|
@@ -150,6 +150,21 @@ export function register(program) {
|
|
|
150
150
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
+
if (!hasSubcommand(group, "forward")) {
|
|
154
|
+
group
|
|
155
|
+
.command("forward")
|
|
156
|
+
.description("POST /api/v1/rooms/{roomId}/messages/{messageId}/forward")
|
|
157
|
+
.requiredOption("--room-id <value>", "roomId (path param)")
|
|
158
|
+
.requiredOption("--message-id <value>", "messageId (path param)")
|
|
159
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
160
|
+
.action(async (opts) => {
|
|
161
|
+
const as = actingUserId(program);
|
|
162
|
+
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/messages/${encodeURIComponent(opts.messageId)}/forward`;
|
|
163
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
164
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
165
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
166
|
+
});
|
|
167
|
+
}
|
|
153
168
|
if (!hasSubcommand(group, "get-message-public-meta")) {
|
|
154
169
|
group
|
|
155
170
|
.command("get-message-public-meta")
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
3
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
4
|
+
export function register(program) {
|
|
5
|
+
const group = getOrCreateGroup(program, "my-feedback", "MyFeedback operations");
|
|
6
|
+
if (!hasSubcommand(group, "list")) {
|
|
7
|
+
group
|
|
8
|
+
.command("list")
|
|
9
|
+
.description("GET /api/v1/me/agent-feedback")
|
|
10
|
+
.action(async (opts) => {
|
|
11
|
+
const as = actingUserId(program);
|
|
12
|
+
const path = `/api/v1/me/agent-feedback`;
|
|
13
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
14
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=my-feedback.js.map
|
|
@@ -36,6 +36,7 @@ export function register(program) {
|
|
|
36
36
|
.option("--folder-id <value>", "string")
|
|
37
37
|
.option("--cursor <value>", "string")
|
|
38
38
|
.option("--limit <value>", "string")
|
|
39
|
+
.option("--refs <value>", "string")
|
|
39
40
|
.action(async (opts) => {
|
|
40
41
|
const as = actingUserId(program);
|
|
41
42
|
const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/pins`;
|
|
@@ -55,6 +56,11 @@ export function register(program) {
|
|
|
55
56
|
if (v !== undefined)
|
|
56
57
|
query["limit"] = v;
|
|
57
58
|
}
|
|
59
|
+
{
|
|
60
|
+
const v = opts.refs;
|
|
61
|
+
if (v !== undefined)
|
|
62
|
+
query["refs"] = v;
|
|
63
|
+
}
|
|
58
64
|
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
59
65
|
process.stdout.write(JSON.stringify(data) + "\n");
|
|
60
66
|
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
3
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
4
|
+
export function register(program) {
|
|
5
|
+
const group = getOrCreateGroup(program, "proxy-nodes", "ProxyNodes operations");
|
|
6
|
+
if (!hasSubcommand(group, "list")) {
|
|
7
|
+
group
|
|
8
|
+
.command("list")
|
|
9
|
+
.description("GET /api/v1/proxy-nodes")
|
|
10
|
+
.action(async (opts) => {
|
|
11
|
+
const as = actingUserId(program);
|
|
12
|
+
const path = `/api/v1/proxy-nodes`;
|
|
13
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
14
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (!hasSubcommand(group, "register")) {
|
|
18
|
+
group
|
|
19
|
+
.command("register")
|
|
20
|
+
.description("POST /api/v1/proxy-nodes/register")
|
|
21
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
22
|
+
.action(async (opts) => {
|
|
23
|
+
const as = actingUserId(program);
|
|
24
|
+
const path = `/api/v1/proxy-nodes/register`;
|
|
25
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
26
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
27
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (!hasSubcommand(group, "heartbeat")) {
|
|
31
|
+
group
|
|
32
|
+
.command("heartbeat")
|
|
33
|
+
.description("POST /api/v1/proxy-nodes/heartbeat")
|
|
34
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
35
|
+
.action(async (opts) => {
|
|
36
|
+
const as = actingUserId(program);
|
|
37
|
+
const path = `/api/v1/proxy-nodes/heartbeat`;
|
|
38
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
39
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
40
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (!hasSubcommand(group, "list-all")) {
|
|
44
|
+
group
|
|
45
|
+
.command("list-all")
|
|
46
|
+
.description("GET /api/v1/proxy-nodes/admin/all")
|
|
47
|
+
.action(async (opts) => {
|
|
48
|
+
const as = actingUserId(program);
|
|
49
|
+
const path = `/api/v1/proxy-nodes/admin/all`;
|
|
50
|
+
const data = await call({ method: "GET", path, asUserId: as });
|
|
51
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (!hasSubcommand(group, "drain")) {
|
|
55
|
+
group
|
|
56
|
+
.command("drain")
|
|
57
|
+
.description("POST /api/v1/proxy-nodes/admin/{nodeId}/drain")
|
|
58
|
+
.requiredOption("--node-id <value>", "nodeId (path param)")
|
|
59
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
60
|
+
.action(async (opts) => {
|
|
61
|
+
const as = actingUserId(program);
|
|
62
|
+
const path = `/api/v1/proxy-nodes/admin/${encodeURIComponent(opts.nodeId)}/drain`;
|
|
63
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
64
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
65
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (!hasSubcommand(group, "enable")) {
|
|
69
|
+
group
|
|
70
|
+
.command("enable")
|
|
71
|
+
.description("POST /api/v1/proxy-nodes/admin/{nodeId}/enable")
|
|
72
|
+
.requiredOption("--node-id <value>", "nodeId (path param)")
|
|
73
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
74
|
+
.action(async (opts) => {
|
|
75
|
+
const as = actingUserId(program);
|
|
76
|
+
const path = `/api/v1/proxy-nodes/admin/${encodeURIComponent(opts.nodeId)}/enable`;
|
|
77
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
78
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
79
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=proxy-nodes.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
3
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
4
|
+
export function register(program) {
|
|
5
|
+
const group = getOrCreateGroup(program, "push", "Push operations");
|
|
6
|
+
if (!hasSubcommand(group, "unregister")) {
|
|
7
|
+
group
|
|
8
|
+
.command("unregister")
|
|
9
|
+
.description("POST /api/v1/push/unregister")
|
|
10
|
+
.option("--body <json>", "request body as JSON (no schema available)")
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
const as = actingUserId(program);
|
|
13
|
+
const path = `/api/v1/push/unregister`;
|
|
14
|
+
const body = opts.body ? JSON.parse(opts.body) : undefined;
|
|
15
|
+
const data = await call({ method: "POST", path, asUserId: as, body });
|
|
16
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { call } from "../../client.js";
|
|
2
|
+
import { actingUserId } from "../../auth.js";
|
|
3
|
+
import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
|
|
4
|
+
export function register(program) {
|
|
5
|
+
const group = getOrCreateGroup(program, "reviews", "Reviews operations");
|
|
6
|
+
if (!hasSubcommand(group, "ratings")) {
|
|
7
|
+
group
|
|
8
|
+
.command("ratings")
|
|
9
|
+
.description("GET /api/v1/marketplace/ratings")
|
|
10
|
+
.requiredOption("--type <value>", "string")
|
|
11
|
+
.option("--ids <value>", "string")
|
|
12
|
+
.action(async (opts) => {
|
|
13
|
+
const as = actingUserId(program);
|
|
14
|
+
const path = `/api/v1/marketplace/ratings`;
|
|
15
|
+
const query = {};
|
|
16
|
+
{
|
|
17
|
+
const v = opts.type;
|
|
18
|
+
if (v !== undefined)
|
|
19
|
+
query["type"] = v;
|
|
20
|
+
}
|
|
21
|
+
{
|
|
22
|
+
const v = opts.ids;
|
|
23
|
+
if (v !== undefined)
|
|
24
|
+
query["ids"] = v;
|
|
25
|
+
}
|
|
26
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
27
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (!hasSubcommand(group, "list")) {
|
|
31
|
+
group
|
|
32
|
+
.command("list")
|
|
33
|
+
.description("GET /api/v1/marketplace/{type}/{id}/reviews")
|
|
34
|
+
.requiredOption("--type <value>", "type (path param)")
|
|
35
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
36
|
+
.option("--cursor <value>", "string")
|
|
37
|
+
.option("--limit <value>", "string")
|
|
38
|
+
.action(async (opts) => {
|
|
39
|
+
const as = actingUserId(program);
|
|
40
|
+
const path = `/api/v1/marketplace/${encodeURIComponent(opts.type)}/${encodeURIComponent(opts.id)}/reviews`;
|
|
41
|
+
const query = {};
|
|
42
|
+
{
|
|
43
|
+
const v = opts.cursor;
|
|
44
|
+
if (v !== undefined)
|
|
45
|
+
query["cursor"] = v;
|
|
46
|
+
}
|
|
47
|
+
{
|
|
48
|
+
const v = opts.limit;
|
|
49
|
+
if (v !== undefined)
|
|
50
|
+
query["limit"] = v;
|
|
51
|
+
}
|
|
52
|
+
const data = await call({ method: "GET", path, asUserId: as, query });
|
|
53
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (!hasSubcommand(group, "upsert")) {
|
|
57
|
+
group
|
|
58
|
+
.command("upsert")
|
|
59
|
+
.description("PUT /api/v1/marketplace/{type}/{id}/reviews/me")
|
|
60
|
+
.requiredOption("--type <value>", "type (path param)")
|
|
61
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
62
|
+
.requiredOption("--rating <n>", "number")
|
|
63
|
+
.option("--comment <value>", "string, ≤1000 chars")
|
|
64
|
+
.action(async (opts) => {
|
|
65
|
+
const as = actingUserId(program);
|
|
66
|
+
const path = `/api/v1/marketplace/${encodeURIComponent(opts.type)}/${encodeURIComponent(opts.id)}/reviews/me`;
|
|
67
|
+
const body = {};
|
|
68
|
+
{
|
|
69
|
+
const v = opts.rating === undefined ? undefined : Number(opts.rating);
|
|
70
|
+
if (v !== undefined)
|
|
71
|
+
body["rating"] = v;
|
|
72
|
+
}
|
|
73
|
+
{
|
|
74
|
+
const v = opts.comment;
|
|
75
|
+
if (v !== undefined)
|
|
76
|
+
body["comment"] = v;
|
|
77
|
+
}
|
|
78
|
+
const data = await call({ method: "PUT", path, asUserId: as, body });
|
|
79
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (!hasSubcommand(group, "remove")) {
|
|
83
|
+
group
|
|
84
|
+
.command("remove")
|
|
85
|
+
.description("DELETE /api/v1/marketplace/{type}/{id}/reviews/me")
|
|
86
|
+
.requiredOption("--type <value>", "type (path param)")
|
|
87
|
+
.requiredOption("--id <value>", "id (path param)")
|
|
88
|
+
.action(async (opts) => {
|
|
89
|
+
const as = actingUserId(program);
|
|
90
|
+
const path = `/api/v1/marketplace/${encodeURIComponent(opts.type)}/${encodeURIComponent(opts.id)}/reviews/me`;
|
|
91
|
+
const data = await call({ method: "DELETE", path, asUserId: as });
|
|
92
|
+
process.stdout.write(JSON.stringify(data) + "\n");
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=reviews.js.map
|