@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.
Files changed (82) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +312 -0
  3. package/dist/auth.js +9 -0
  4. package/dist/cli.js +46 -0
  5. package/dist/client.js +125 -0
  6. package/dist/commands/_group.js +5 -0
  7. package/dist/commands/auth.js +125 -0
  8. package/dist/commands/challenges.js +51 -0
  9. package/dist/commands/custom-agents.js +120 -0
  10. package/dist/commands/dm.js +35 -0
  11. package/dist/commands/messages.js +360 -0
  12. package/dist/commands/room-agents.js +47 -0
  13. package/dist/commands/rooms.js +687 -0
  14. package/dist/commands/users.js +126 -0
  15. package/dist/commands/whoami.js +15 -0
  16. package/dist/generated/_helpers.js +8 -0
  17. package/dist/generated/commands/activity.js +46 -0
  18. package/dist/generated/commands/ai.js +40 -0
  19. package/dist/generated/commands/ambassador.js +34 -0
  20. package/dist/generated/commands/apple-iap.js +61 -0
  21. package/dist/generated/commands/attribution.js +130 -0
  22. package/dist/generated/commands/auth.js +205 -0
  23. package/dist/generated/commands/challenges.js +251 -0
  24. package/dist/generated/commands/clips.js +71 -0
  25. package/dist/generated/commands/contact-match.js +92 -0
  26. package/dist/generated/commands/content-crawler.js +27 -0
  27. package/dist/generated/commands/custom-agents.js +346 -0
  28. package/dist/generated/commands/desktop-releases.js +236 -0
  29. package/dist/generated/commands/discover.js +236 -0
  30. package/dist/generated/commands/dm.js +155 -0
  31. package/dist/generated/commands/drafts.js +41 -0
  32. package/dist/generated/commands/embed.js +34 -0
  33. package/dist/generated/commands/explore.js +19 -0
  34. package/dist/generated/commands/feed.js +67 -0
  35. package/dist/generated/commands/feedback.js +44 -0
  36. package/dist/generated/commands/gamification.js +33 -0
  37. package/dist/generated/commands/google-play-iap.js +73 -0
  38. package/dist/generated/commands/health.js +32 -0
  39. package/dist/generated/commands/internal.js +162 -0
  40. package/dist/generated/commands/interview.js +76 -0
  41. package/dist/generated/commands/invite-redirect.js +20 -0
  42. package/dist/generated/commands/jesuscord-admin.js +36 -0
  43. package/dist/generated/commands/join.js +27 -0
  44. package/dist/generated/commands/kits.js +108 -0
  45. package/dist/generated/commands/meetings.js +81 -0
  46. package/dist/generated/commands/message-folders.js +68 -0
  47. package/dist/generated/commands/messages.js +418 -0
  48. package/dist/generated/commands/one-emulator.js +32 -0
  49. package/dist/generated/commands/pdf-export.js +19 -0
  50. package/dist/generated/commands/pin-folders.js +72 -0
  51. package/dist/generated/commands/pinned-messages.js +81 -0
  52. package/dist/generated/commands/polls.js +152 -0
  53. package/dist/generated/commands/premium-feeds.js +32 -0
  54. package/dist/generated/commands/processors.js +22 -0
  55. package/dist/generated/commands/questions.js +54 -0
  56. package/dist/generated/commands/referrals.js +19 -0
  57. package/dist/generated/commands/reports.js +21 -0
  58. package/dist/generated/commands/room-a2-a.js +81 -0
  59. package/dist/generated/commands/room-agents.js +273 -0
  60. package/dist/generated/commands/room-invites.js +155 -0
  61. package/dist/generated/commands/room-owned-agent.js +36 -0
  62. package/dist/generated/commands/room-page.js +20 -0
  63. package/dist/generated/commands/rooms.js +1117 -0
  64. package/dist/generated/commands/saved-messages.js +84 -0
  65. package/dist/generated/commands/saved-stories.js +125 -0
  66. package/dist/generated/commands/search.js +44 -0
  67. package/dist/generated/commands/shadow-home-agent.js +36 -0
  68. package/dist/generated/commands/shadow.js +64 -0
  69. package/dist/generated/commands/share-cards.js +85 -0
  70. package/dist/generated/commands/share.js +20 -0
  71. package/dist/generated/commands/sponsors.js +20 -0
  72. package/dist/generated/commands/stories.js +324 -0
  73. package/dist/generated/commands/story-by-id.js +20 -0
  74. package/dist/generated/commands/submissions.js +112 -0
  75. package/dist/generated/commands/subscriptions.js +103 -0
  76. package/dist/generated/commands/tips.js +76 -0
  77. package/dist/generated/commands/users.js +373 -0
  78. package/dist/generated/commands/voice-token.js +21 -0
  79. package/dist/generated/commands/well-known.js +32 -0
  80. package/dist/generated/commands/wrapped.js +20 -0
  81. package/dist/generated/index.js +131 -0
  82. package/package.json +60 -0
@@ -0,0 +1,346 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "custom-agents", "CustomAgents operations");
5
+ if (!hasSubcommand(group, "create")) {
6
+ group
7
+ .command("create")
8
+ .description("POST /api/v1/agents")
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/agents`;
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-mine")) {
21
+ group
22
+ .command("list-mine")
23
+ .description("GET /api/v1/agents/mine")
24
+ .option("--include-shadow <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/agents/mine`;
30
+ const query = {};
31
+ {
32
+ const v = opts.includeShadow;
33
+ if (v !== undefined)
34
+ query["includeShadow"] = v;
35
+ }
36
+ const data = await call({ method: "GET", path, asUserId: as, query });
37
+ process.stdout.write(JSON.stringify(data) + "\n");
38
+ });
39
+ }
40
+ if (!hasSubcommand(group, "get-config")) {
41
+ group
42
+ .command("get-config")
43
+ .description("GET /api/v1/agents/config")
44
+ .action(async (opts) => {
45
+ const { as } = program.opts();
46
+ if (!as)
47
+ throw new Error("--as <userId> is required");
48
+ const path = `/api/v1/agents/config`;
49
+ const data = await call({ method: "GET", path, asUserId: as });
50
+ process.stdout.write(JSON.stringify(data) + "\n");
51
+ });
52
+ }
53
+ if (!hasSubcommand(group, "get-mcp-catalog")) {
54
+ group
55
+ .command("get-mcp-catalog")
56
+ .description("GET /api/v1/agents/mcp-catalog")
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/agents/mcp-catalog`;
62
+ const data = await call({ method: "GET", path, asUserId: as });
63
+ process.stdout.write(JSON.stringify(data) + "\n");
64
+ });
65
+ }
66
+ if (!hasSubcommand(group, "list-hermes-flavors")) {
67
+ group
68
+ .command("list-hermes-flavors")
69
+ .description("GET /api/v1/agents/hermes-flavors")
70
+ .action(async (opts) => {
71
+ const { as } = program.opts();
72
+ if (!as)
73
+ throw new Error("--as <userId> is required");
74
+ const path = `/api/v1/agents/hermes-flavors`;
75
+ const data = await call({ method: "GET", path, asUserId: as });
76
+ process.stdout.write(JSON.stringify(data) + "\n");
77
+ });
78
+ }
79
+ if (!hasSubcommand(group, "create-hermes-flavor-agent")) {
80
+ group
81
+ .command("create-hermes-flavor-agent")
82
+ .description("POST /api/v1/agents/hermes-flavors")
83
+ .option("--body <json>", "request body as JSON (no schema available)")
84
+ .action(async (opts) => {
85
+ const { as } = program.opts();
86
+ if (!as)
87
+ throw new Error("--as <userId> is required");
88
+ const path = `/api/v1/agents/hermes-flavors`;
89
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
90
+ const data = await call({ method: "POST", path, asUserId: as, body });
91
+ process.stdout.write(JSON.stringify(data) + "\n");
92
+ });
93
+ }
94
+ if (!hasSubcommand(group, "hermes-flavor-contents")) {
95
+ group
96
+ .command("hermes-flavor-contents")
97
+ .description("GET /api/v1/agents/hermes-flavors/{flavorId}/versions/{version}/contents")
98
+ .requiredOption("--flavor-id <value>", "flavorId (path param)")
99
+ .requiredOption("--version <value>", "version (path param)")
100
+ .action(async (opts) => {
101
+ const { as } = program.opts();
102
+ if (!as)
103
+ throw new Error("--as <userId> is required");
104
+ const path = `/api/v1/agents/hermes-flavors/${encodeURIComponent(opts.flavorId)}/versions/${encodeURIComponent(opts.version)}/contents`;
105
+ const data = await call({ method: "GET", path, asUserId: as });
106
+ process.stdout.write(JSON.stringify(data) + "\n");
107
+ });
108
+ }
109
+ if (!hasSubcommand(group, "marketplace")) {
110
+ group
111
+ .command("marketplace")
112
+ .description("GET /api/v1/agents/marketplace")
113
+ .option("--category <value>", "string")
114
+ .option("--search <value>", "string")
115
+ .option("--page <value>", "string")
116
+ .option("--limit <value>", "string")
117
+ .action(async (opts) => {
118
+ const { as } = program.opts();
119
+ if (!as)
120
+ throw new Error("--as <userId> is required");
121
+ const path = `/api/v1/agents/marketplace`;
122
+ const query = {};
123
+ {
124
+ const v = opts.category;
125
+ if (v !== undefined)
126
+ query["category"] = v;
127
+ }
128
+ {
129
+ const v = opts.search;
130
+ if (v !== undefined)
131
+ query["search"] = v;
132
+ }
133
+ {
134
+ const v = opts.page;
135
+ if (v !== undefined)
136
+ query["page"] = v;
137
+ }
138
+ {
139
+ const v = opts.limit;
140
+ if (v !== undefined)
141
+ query["limit"] = v;
142
+ }
143
+ const data = await call({ method: "GET", path, asUserId: as, query });
144
+ process.stdout.write(JSON.stringify(data) + "\n");
145
+ });
146
+ }
147
+ if (!hasSubcommand(group, "marketplace-detail")) {
148
+ group
149
+ .command("marketplace-detail")
150
+ .description("GET /api/v1/agents/marketplace/{id}")
151
+ .requiredOption("--id <value>", "id (path param)")
152
+ .action(async (opts) => {
153
+ const { as } = program.opts();
154
+ if (!as)
155
+ throw new Error("--as <userId> is required");
156
+ const path = `/api/v1/agents/marketplace/${encodeURIComponent(opts.id)}`;
157
+ const data = await call({ method: "GET", path, asUserId: as });
158
+ process.stdout.write(JSON.stringify(data) + "\n");
159
+ });
160
+ }
161
+ if (!hasSubcommand(group, "get-by-id")) {
162
+ group
163
+ .command("get-by-id")
164
+ .description("GET /api/v1/agents/{id}")
165
+ .requiredOption("--id <value>", "id (path param)")
166
+ .action(async (opts) => {
167
+ const { as } = program.opts();
168
+ if (!as)
169
+ throw new Error("--as <userId> is required");
170
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}`;
171
+ const data = await call({ method: "GET", path, asUserId: as });
172
+ process.stdout.write(JSON.stringify(data) + "\n");
173
+ });
174
+ }
175
+ if (!hasSubcommand(group, "update")) {
176
+ group
177
+ .command("update")
178
+ .description("PATCH /api/v1/agents/{id}")
179
+ .requiredOption("--id <value>", "id (path param)")
180
+ .option("--body <json>", "request body as JSON (no schema available)")
181
+ .action(async (opts) => {
182
+ const { as } = program.opts();
183
+ if (!as)
184
+ throw new Error("--as <userId> is required");
185
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}`;
186
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
187
+ const data = await call({ method: "PATCH", path, asUserId: as, body });
188
+ process.stdout.write(JSON.stringify(data) + "\n");
189
+ });
190
+ }
191
+ if (!hasSubcommand(group, "delete")) {
192
+ group
193
+ .command("delete")
194
+ .description("DELETE /api/v1/agents/{id}")
195
+ .requiredOption("--id <value>", "id (path param)")
196
+ .action(async (opts) => {
197
+ const { as } = program.opts();
198
+ if (!as)
199
+ throw new Error("--as <userId> is required");
200
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}`;
201
+ const data = await call({ method: "DELETE", path, asUserId: as });
202
+ process.stdout.write(JSON.stringify(data) + "\n");
203
+ });
204
+ }
205
+ if (!hasSubcommand(group, "upload-icon")) {
206
+ group
207
+ .command("upload-icon")
208
+ .description("POST /api/v1/agents/{id}/icon")
209
+ .requiredOption("--id <value>", "id (path param)")
210
+ .option("--body <json>", "request body as JSON (no schema available)")
211
+ .action(async (opts) => {
212
+ const { as } = program.opts();
213
+ if (!as)
214
+ throw new Error("--as <userId> is required");
215
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}/icon`;
216
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
217
+ const data = await call({ method: "POST", path, asUserId: as, body });
218
+ process.stdout.write(JSON.stringify(data) + "\n");
219
+ });
220
+ }
221
+ if (!hasSubcommand(group, "generate-key")) {
222
+ group
223
+ .command("generate-key")
224
+ .description("POST /api/v1/agents/{id}/keys")
225
+ .requiredOption("--id <value>", "id (path param)")
226
+ .option("--body <json>", "request body as JSON (no schema available)")
227
+ .action(async (opts) => {
228
+ const { as } = program.opts();
229
+ if (!as)
230
+ throw new Error("--as <userId> is required");
231
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}/keys`;
232
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
233
+ const data = await call({ method: "POST", path, asUserId: as, body });
234
+ process.stdout.write(JSON.stringify(data) + "\n");
235
+ });
236
+ }
237
+ if (!hasSubcommand(group, "list-keys")) {
238
+ group
239
+ .command("list-keys")
240
+ .description("GET /api/v1/agents/{id}/keys")
241
+ .requiredOption("--id <value>", "id (path param)")
242
+ .action(async (opts) => {
243
+ const { as } = program.opts();
244
+ if (!as)
245
+ throw new Error("--as <userId> is required");
246
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}/keys`;
247
+ const data = await call({ method: "GET", path, asUserId: as });
248
+ process.stdout.write(JSON.stringify(data) + "\n");
249
+ });
250
+ }
251
+ if (!hasSubcommand(group, "revoke-key")) {
252
+ group
253
+ .command("revoke-key")
254
+ .description("DELETE /api/v1/agents/{id}/keys/{keyId}")
255
+ .requiredOption("--id <value>", "id (path param)")
256
+ .requiredOption("--key-id <value>", "keyId (path param)")
257
+ .action(async (opts) => {
258
+ const { as } = program.opts();
259
+ if (!as)
260
+ throw new Error("--as <userId> is required");
261
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}/keys/${encodeURIComponent(opts.keyId)}`;
262
+ const data = await call({ method: "DELETE", path, asUserId: as });
263
+ process.stdout.write(JSON.stringify(data) + "\n");
264
+ });
265
+ }
266
+ if (!hasSubcommand(group, "install-hermes-flavor-to-room")) {
267
+ group
268
+ .command("install-hermes-flavor-to-room")
269
+ .description("POST /api/v1/rooms/{roomId}/agents/install-hermes-flavor")
270
+ .requiredOption("--room-id <value>", "roomId (path param)")
271
+ .option("--body <json>", "request body as JSON (no schema available)")
272
+ .action(async (opts) => {
273
+ const { as } = program.opts();
274
+ if (!as)
275
+ throw new Error("--as <userId> is required");
276
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents/install-hermes-flavor`;
277
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
278
+ const data = await call({ method: "POST", path, asUserId: as, body });
279
+ process.stdout.write(JSON.stringify(data) + "\n");
280
+ });
281
+ }
282
+ if (!hasSubcommand(group, "install-to-room")) {
283
+ group
284
+ .command("install-to-room")
285
+ .description("POST /api/v1/rooms/{roomId}/agents/install/{agentId}")
286
+ .requiredOption("--room-id <value>", "roomId (path param)")
287
+ .requiredOption("--agent-id <value>", "agentId (path param)")
288
+ .option("--body <json>", "request body as JSON (no schema available)")
289
+ .action(async (opts) => {
290
+ const { as } = program.opts();
291
+ if (!as)
292
+ throw new Error("--as <userId> is required");
293
+ const path = `/api/v1/rooms/${encodeURIComponent(opts.roomId)}/agents/install/${encodeURIComponent(opts.agentId)}`;
294
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
295
+ const data = await call({ method: "POST", path, asUserId: as, body });
296
+ process.stdout.write(JSON.stringify(data) + "\n");
297
+ });
298
+ }
299
+ if (!hasSubcommand(group, "start-direct-chat")) {
300
+ group
301
+ .command("start-direct-chat")
302
+ .description("POST /api/v1/agents/{id}/start-dm")
303
+ .requiredOption("--id <value>", "id (path param)")
304
+ .option("--body <json>", "request body as JSON (no schema available)")
305
+ .action(async (opts) => {
306
+ const { as } = program.opts();
307
+ if (!as)
308
+ throw new Error("--as <userId> is required");
309
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}/start-dm`;
310
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
311
+ const data = await call({ method: "POST", path, asUserId: as, body });
312
+ process.stdout.write(JSON.stringify(data) + "\n");
313
+ });
314
+ }
315
+ if (!hasSubcommand(group, "agent-card")) {
316
+ group
317
+ .command("agent-card")
318
+ .description("GET /api/v1/agents/{id}/.well-known/agent.json")
319
+ .requiredOption("--id <value>", "id (path param)")
320
+ .action(async (opts) => {
321
+ const { as } = program.opts();
322
+ if (!as)
323
+ throw new Error("--as <userId> is required");
324
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}/.well-known/agent.json`;
325
+ const data = await call({ method: "GET", path, asUserId: as });
326
+ process.stdout.write(JSON.stringify(data) + "\n");
327
+ });
328
+ }
329
+ if (!hasSubcommand(group, "a2a-endpoint")) {
330
+ group
331
+ .command("a2a-endpoint")
332
+ .description("POST /api/v1/agents/{id}/a2a")
333
+ .requiredOption("--id <value>", "id (path param)")
334
+ .option("--body <json>", "request body as JSON (no schema available)")
335
+ .action(async (opts) => {
336
+ const { as } = program.opts();
337
+ if (!as)
338
+ throw new Error("--as <userId> is required");
339
+ const path = `/api/v1/agents/${encodeURIComponent(opts.id)}/a2a`;
340
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
341
+ const data = await call({ method: "POST", path, asUserId: as, body });
342
+ process.stdout.write(JSON.stringify(data) + "\n");
343
+ });
344
+ }
345
+ }
346
+ //# sourceMappingURL=custom-agents.js.map
@@ -0,0 +1,236 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "desktop-releases", "DesktopReleases operations");
5
+ if (!hasSubcommand(group, "upload-urls")) {
6
+ group
7
+ .command("upload-urls")
8
+ .description("POST /api/v1/desktop/releases/upload-url")
9
+ .requiredOption("--brand <value>", "string")
10
+ .requiredOption("--env <value>", "string")
11
+ .requiredOption("--platform <value>", "string")
12
+ .requiredOption("--arch <value>", "string")
13
+ .requiredOption("--files <json>", "array (JSON)")
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/desktop/releases/upload-url`;
19
+ const body = {};
20
+ {
21
+ const v = opts.brand;
22
+ if (v !== undefined)
23
+ body["brand"] = v;
24
+ }
25
+ {
26
+ const v = opts.env;
27
+ if (v !== undefined)
28
+ body["env"] = v;
29
+ }
30
+ {
31
+ const v = opts.platform;
32
+ if (v !== undefined)
33
+ body["platform"] = v;
34
+ }
35
+ {
36
+ const v = opts.arch;
37
+ if (v !== undefined)
38
+ body["arch"] = v;
39
+ }
40
+ {
41
+ const v = opts.files === undefined ? undefined : JSON.parse(opts.files);
42
+ if (v !== undefined)
43
+ body["files"] = v;
44
+ }
45
+ const data = await call({ method: "POST", path, asUserId: as, body });
46
+ process.stdout.write(JSON.stringify(data) + "\n");
47
+ });
48
+ }
49
+ if (!hasSubcommand(group, "register")) {
50
+ group
51
+ .command("register")
52
+ .description("POST /api/v1/desktop/releases")
53
+ .requiredOption("--brand <value>", "string")
54
+ .requiredOption("--env <value>", "string")
55
+ .requiredOption("--platform <value>", "string")
56
+ .requiredOption("--arch <value>", "string")
57
+ .requiredOption("--version <value>", "string")
58
+ .requiredOption("--file-name <value>", "string")
59
+ .requiredOption("--file-type <value>", "string")
60
+ .requiredOption("--size-bytes <n>", "number")
61
+ .requiredOption("--sha512 <value>", "string")
62
+ .requiredOption("--public-url <value>", "string")
63
+ .option("--yml-public-url <value>", "string")
64
+ .option("--release-notes <value>", "string")
65
+ .option("--is-updater-payload <true|false>", "boolean")
66
+ .action(async (opts) => {
67
+ const { as } = program.opts();
68
+ if (!as)
69
+ throw new Error("--as <userId> is required");
70
+ const path = `/api/v1/desktop/releases`;
71
+ const body = {};
72
+ {
73
+ const v = opts.brand;
74
+ if (v !== undefined)
75
+ body["brand"] = v;
76
+ }
77
+ {
78
+ const v = opts.env;
79
+ if (v !== undefined)
80
+ body["env"] = v;
81
+ }
82
+ {
83
+ const v = opts.platform;
84
+ if (v !== undefined)
85
+ body["platform"] = v;
86
+ }
87
+ {
88
+ const v = opts.arch;
89
+ if (v !== undefined)
90
+ body["arch"] = v;
91
+ }
92
+ {
93
+ const v = opts.version;
94
+ if (v !== undefined)
95
+ body["version"] = v;
96
+ }
97
+ {
98
+ const v = opts.fileName;
99
+ if (v !== undefined)
100
+ body["fileName"] = v;
101
+ }
102
+ {
103
+ const v = opts.fileType;
104
+ if (v !== undefined)
105
+ body["fileType"] = v;
106
+ }
107
+ {
108
+ const v = opts.sizeBytes === undefined ? undefined : Number(opts.sizeBytes);
109
+ if (v !== undefined)
110
+ body["sizeBytes"] = v;
111
+ }
112
+ {
113
+ const v = opts.sha512;
114
+ if (v !== undefined)
115
+ body["sha512"] = v;
116
+ }
117
+ {
118
+ const v = opts.publicUrl;
119
+ if (v !== undefined)
120
+ body["publicUrl"] = v;
121
+ }
122
+ {
123
+ const v = opts.ymlPublicUrl;
124
+ if (v !== undefined)
125
+ body["ymlPublicUrl"] = v;
126
+ }
127
+ {
128
+ const v = opts.releaseNotes;
129
+ if (v !== undefined)
130
+ body["releaseNotes"] = v;
131
+ }
132
+ {
133
+ const v = opts.isUpdaterPayload === undefined ? undefined : opts.isUpdaterPayload === "true";
134
+ if (v !== undefined)
135
+ body["isUpdaterPayload"] = v;
136
+ }
137
+ const data = await call({ method: "POST", path, asUserId: as, body });
138
+ process.stdout.write(JSON.stringify(data) + "\n");
139
+ });
140
+ }
141
+ if (!hasSubcommand(group, "list")) {
142
+ group
143
+ .command("list")
144
+ .description("GET /api/v1/desktop/releases")
145
+ .option("--brand <value>", "string")
146
+ .option("--env <value>", "string")
147
+ .option("--platform <value>", "string")
148
+ .option("--arch <value>", "string")
149
+ .option("--cursor <value>", "string")
150
+ .option("--limit <value>", "string")
151
+ .action(async (opts) => {
152
+ const { as } = program.opts();
153
+ if (!as)
154
+ throw new Error("--as <userId> is required");
155
+ const path = `/api/v1/desktop/releases`;
156
+ const query = {};
157
+ {
158
+ const v = opts.brand;
159
+ if (v !== undefined)
160
+ query["brand"] = v;
161
+ }
162
+ {
163
+ const v = opts.env;
164
+ if (v !== undefined)
165
+ query["env"] = v;
166
+ }
167
+ {
168
+ const v = opts.platform;
169
+ if (v !== undefined)
170
+ query["platform"] = v;
171
+ }
172
+ {
173
+ const v = opts.arch;
174
+ if (v !== undefined)
175
+ query["arch"] = v;
176
+ }
177
+ {
178
+ const v = opts.cursor;
179
+ if (v !== undefined)
180
+ query["cursor"] = v;
181
+ }
182
+ {
183
+ const v = opts.limit;
184
+ if (v !== undefined)
185
+ query["limit"] = v;
186
+ }
187
+ const data = await call({ method: "GET", path, asUserId: as, query });
188
+ process.stdout.write(JSON.stringify(data) + "\n");
189
+ });
190
+ }
191
+ if (!hasSubcommand(group, "latest")) {
192
+ group
193
+ .command("latest")
194
+ .description("GET /api/v1/desktop/releases/latest")
195
+ .option("--brand <value>", "string")
196
+ .option("--env <value>", "string")
197
+ .option("--platform <value>", "string")
198
+ .option("--arch <value>", "string")
199
+ .option("--file-type <value>", "string")
200
+ .action(async (opts) => {
201
+ const { as } = program.opts();
202
+ if (!as)
203
+ throw new Error("--as <userId> is required");
204
+ const path = `/api/v1/desktop/releases/latest`;
205
+ const query = {};
206
+ {
207
+ const v = opts.brand;
208
+ if (v !== undefined)
209
+ query["brand"] = v;
210
+ }
211
+ {
212
+ const v = opts.env;
213
+ if (v !== undefined)
214
+ query["env"] = v;
215
+ }
216
+ {
217
+ const v = opts.platform;
218
+ if (v !== undefined)
219
+ query["platform"] = v;
220
+ }
221
+ {
222
+ const v = opts.arch;
223
+ if (v !== undefined)
224
+ query["arch"] = v;
225
+ }
226
+ {
227
+ const v = opts.fileType;
228
+ if (v !== undefined)
229
+ query["fileType"] = v;
230
+ }
231
+ const data = await call({ method: "GET", path, asUserId: as, query });
232
+ process.stdout.write(JSON.stringify(data) + "\n");
233
+ });
234
+ }
235
+ }
236
+ //# sourceMappingURL=desktop-releases.js.map