@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,236 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "discover", "Discover operations");
5
+ if (!hasSubcommand(group, "tags")) {
6
+ group
7
+ .command("tags")
8
+ .description("GET /api/v1/discover/tags")
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/discover/tags`;
14
+ const data = await call({ method: "GET", path, asUserId: as });
15
+ process.stdout.write(JSON.stringify(data) + "\n");
16
+ });
17
+ }
18
+ if (!hasSubcommand(group, "discover-rooms")) {
19
+ group
20
+ .command("discover-rooms")
21
+ .description("GET /api/v1/discover/rooms")
22
+ .option("--category <value>", "string")
23
+ .option("--language <value>", "string")
24
+ .option("--search <value>", "string")
25
+ .option("--tags <value>", "string")
26
+ .option("--sort <value>", "string")
27
+ .option("--cursor <value>", "string")
28
+ .option("--limit <value>", "string")
29
+ .option("--page <value>", "string")
30
+ .action(async (opts) => {
31
+ const { as } = program.opts();
32
+ if (!as)
33
+ throw new Error("--as <userId> is required");
34
+ const path = `/api/v1/discover/rooms`;
35
+ const query = {};
36
+ {
37
+ const v = opts.category;
38
+ if (v !== undefined)
39
+ query["category"] = v;
40
+ }
41
+ {
42
+ const v = opts.language;
43
+ if (v !== undefined)
44
+ query["language"] = v;
45
+ }
46
+ {
47
+ const v = opts.search;
48
+ if (v !== undefined)
49
+ query["search"] = v;
50
+ }
51
+ {
52
+ const v = opts.tags;
53
+ if (v !== undefined)
54
+ query["tags"] = v;
55
+ }
56
+ {
57
+ const v = opts.sort;
58
+ if (v !== undefined)
59
+ query["sort"] = v;
60
+ }
61
+ {
62
+ const v = opts.cursor;
63
+ if (v !== undefined)
64
+ query["cursor"] = v;
65
+ }
66
+ {
67
+ const v = opts.limit;
68
+ if (v !== undefined)
69
+ query["limit"] = v;
70
+ }
71
+ {
72
+ const v = opts.page;
73
+ if (v !== undefined)
74
+ query["page"] = v;
75
+ }
76
+ const data = await call({ method: "GET", path, asUserId: as, query });
77
+ process.stdout.write(JSON.stringify(data) + "\n");
78
+ });
79
+ }
80
+ if (!hasSubcommand(group, "trending-rooms")) {
81
+ group
82
+ .command("trending-rooms")
83
+ .description("GET /api/v1/discover/rooms/trending")
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/discover/rooms/trending`;
89
+ const data = await call({ method: "GET", path, asUserId: as });
90
+ process.stdout.write(JSON.stringify(data) + "\n");
91
+ });
92
+ }
93
+ if (!hasSubcommand(group, "room-by-slug")) {
94
+ group
95
+ .command("room-by-slug")
96
+ .description("GET /api/v1/discover/rooms/by-slug/{slug}")
97
+ .requiredOption("--slug <value>", "slug (path param)")
98
+ .action(async (opts) => {
99
+ const { as } = program.opts();
100
+ if (!as)
101
+ throw new Error("--as <userId> is required");
102
+ const path = `/api/v1/discover/rooms/by-slug/${encodeURIComponent(opts.slug)}`;
103
+ const data = await call({ method: "GET", path, asUserId: as });
104
+ process.stdout.write(JSON.stringify(data) + "\n");
105
+ });
106
+ }
107
+ if (!hasSubcommand(group, "trending-stories")) {
108
+ group
109
+ .command("trending-stories")
110
+ .description("GET /api/v1/discover/stories/trending")
111
+ .option("--limit <value>", "string")
112
+ .action(async (opts) => {
113
+ const { as } = program.opts();
114
+ if (!as)
115
+ throw new Error("--as <userId> is required");
116
+ const path = `/api/v1/discover/stories/trending`;
117
+ const query = {};
118
+ {
119
+ const v = opts.limit;
120
+ if (v !== undefined)
121
+ query["limit"] = v;
122
+ }
123
+ const data = await call({ method: "GET", path, asUserId: as, query });
124
+ process.stdout.write(JSON.stringify(data) + "\n");
125
+ });
126
+ }
127
+ if (!hasSubcommand(group, "enriched-rooms")) {
128
+ group
129
+ .command("enriched-rooms")
130
+ .description("GET /api/v1/discover/rooms/enriched")
131
+ .option("--category <value>", "string")
132
+ .option("--language <value>", "string")
133
+ .option("--search <value>", "string")
134
+ .option("--tags <value>", "string")
135
+ .option("--sort <value>", "string")
136
+ .option("--cursor <value>", "string")
137
+ .option("--limit <value>", "string")
138
+ .option("--page <value>", "string")
139
+ .action(async (opts) => {
140
+ const { as } = program.opts();
141
+ if (!as)
142
+ throw new Error("--as <userId> is required");
143
+ const path = `/api/v1/discover/rooms/enriched`;
144
+ const query = {};
145
+ {
146
+ const v = opts.category;
147
+ if (v !== undefined)
148
+ query["category"] = v;
149
+ }
150
+ {
151
+ const v = opts.language;
152
+ if (v !== undefined)
153
+ query["language"] = v;
154
+ }
155
+ {
156
+ const v = opts.search;
157
+ if (v !== undefined)
158
+ query["search"] = v;
159
+ }
160
+ {
161
+ const v = opts.tags;
162
+ if (v !== undefined)
163
+ query["tags"] = v;
164
+ }
165
+ {
166
+ const v = opts.sort;
167
+ if (v !== undefined)
168
+ query["sort"] = v;
169
+ }
170
+ {
171
+ const v = opts.cursor;
172
+ if (v !== undefined)
173
+ query["cursor"] = v;
174
+ }
175
+ {
176
+ const v = opts.limit;
177
+ if (v !== undefined)
178
+ query["limit"] = v;
179
+ }
180
+ {
181
+ const v = opts.page;
182
+ if (v !== undefined)
183
+ query["page"] = v;
184
+ }
185
+ const data = await call({ method: "GET", path, asUserId: as, query });
186
+ process.stdout.write(JSON.stringify(data) + "\n");
187
+ });
188
+ }
189
+ if (!hasSubcommand(group, "active-challenges")) {
190
+ group
191
+ .command("active-challenges")
192
+ .description("GET /api/v1/discover/challenges/active")
193
+ .option("--limit <value>", "string")
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/discover/challenges/active`;
199
+ const query = {};
200
+ {
201
+ const v = opts.limit;
202
+ if (v !== undefined)
203
+ query["limit"] = v;
204
+ }
205
+ const data = await call({ method: "GET", path, asUserId: as, query });
206
+ process.stdout.write(JSON.stringify(data) + "\n");
207
+ });
208
+ }
209
+ if (!hasSubcommand(group, "templates")) {
210
+ group
211
+ .command("templates")
212
+ .description("GET /api/v1/discover/templates")
213
+ .option("--cursor <value>", "string")
214
+ .option("--limit <value>", "string")
215
+ .action(async (opts) => {
216
+ const { as } = program.opts();
217
+ if (!as)
218
+ throw new Error("--as <userId> is required");
219
+ const path = `/api/v1/discover/templates`;
220
+ const query = {};
221
+ {
222
+ const v = opts.cursor;
223
+ if (v !== undefined)
224
+ query["cursor"] = v;
225
+ }
226
+ {
227
+ const v = opts.limit;
228
+ if (v !== undefined)
229
+ query["limit"] = 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=discover.js.map
@@ -0,0 +1,155 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "dm", "Dm operations");
5
+ if (!hasSubcommand(group, "start-dm")) {
6
+ group
7
+ .command("start-dm")
8
+ .description("POST /api/v1/dm/start")
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/dm/start`;
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, "start-agent-dm")) {
21
+ group
22
+ .command("start-agent-dm")
23
+ .description("POST /api/v1/dm/start-agent")
24
+ .option("--body <json>", "request body as JSON (no schema available)")
25
+ .action(async (opts) => {
26
+ const { as } = program.opts();
27
+ if (!as)
28
+ throw new Error("--as <userId> is required");
29
+ const path = `/api/v1/dm/start-agent`;
30
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
31
+ const data = await call({ method: "POST", path, asUserId: as, body });
32
+ process.stdout.write(JSON.stringify(data) + "\n");
33
+ });
34
+ }
35
+ if (!hasSubcommand(group, "list-dms")) {
36
+ group
37
+ .command("list-dms")
38
+ .description("GET /api/v1/dm")
39
+ .option("--cursor <value>", "string")
40
+ .option("--limit <value>", "string")
41
+ .option("--include-shadow <value>", "string")
42
+ .action(async (opts) => {
43
+ const { as } = program.opts();
44
+ if (!as)
45
+ throw new Error("--as <userId> is required");
46
+ const path = `/api/v1/dm`;
47
+ const query = {};
48
+ {
49
+ const v = opts.cursor;
50
+ if (v !== undefined)
51
+ query["cursor"] = v;
52
+ }
53
+ {
54
+ const v = opts.limit;
55
+ if (v !== undefined)
56
+ query["limit"] = v;
57
+ }
58
+ {
59
+ const v = opts.includeShadow;
60
+ if (v !== undefined)
61
+ query["includeShadow"] = v;
62
+ }
63
+ const data = await call({ method: "GET", path, asUserId: as, query });
64
+ process.stdout.write(JSON.stringify(data) + "\n");
65
+ });
66
+ }
67
+ if (!hasSubcommand(group, "block-user")) {
68
+ group
69
+ .command("block-user")
70
+ .description("POST /api/v1/dm/block/{userId}")
71
+ .requiredOption("--user-id <value>", "userId (path param)")
72
+ .option("--body <json>", "request body as JSON (no schema available)")
73
+ .action(async (opts) => {
74
+ const { as } = program.opts();
75
+ if (!as)
76
+ throw new Error("--as <userId> is required");
77
+ const path = `/api/v1/dm/block/${encodeURIComponent(opts.userId)}`;
78
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
79
+ const data = await call({ method: "POST", path, asUserId: as, body });
80
+ process.stdout.write(JSON.stringify(data) + "\n");
81
+ });
82
+ }
83
+ if (!hasSubcommand(group, "unblock-user")) {
84
+ group
85
+ .command("unblock-user")
86
+ .description("DELETE /api/v1/dm/block/{userId}")
87
+ .requiredOption("--user-id <value>", "userId (path param)")
88
+ .action(async (opts) => {
89
+ const { as } = program.opts();
90
+ if (!as)
91
+ throw new Error("--as <userId> is required");
92
+ const path = `/api/v1/dm/block/${encodeURIComponent(opts.userId)}`;
93
+ const data = await call({ method: "DELETE", path, asUserId: as });
94
+ process.stdout.write(JSON.stringify(data) + "\n");
95
+ });
96
+ }
97
+ if (!hasSubcommand(group, "list-blocked-users")) {
98
+ group
99
+ .command("list-blocked-users")
100
+ .description("GET /api/v1/dm/blocked")
101
+ .action(async (opts) => {
102
+ const { as } = program.opts();
103
+ if (!as)
104
+ throw new Error("--as <userId> is required");
105
+ const path = `/api/v1/dm/blocked`;
106
+ const data = await call({ method: "GET", path, asUserId: as });
107
+ process.stdout.write(JSON.stringify(data) + "\n");
108
+ });
109
+ }
110
+ if (!hasSubcommand(group, "check-block")) {
111
+ group
112
+ .command("check-block")
113
+ .description("GET /api/v1/dm/check-block/{userId}")
114
+ .requiredOption("--user-id <value>", "userId (path param)")
115
+ .action(async (opts) => {
116
+ const { as } = program.opts();
117
+ if (!as)
118
+ throw new Error("--as <userId> is required");
119
+ const path = `/api/v1/dm/check-block/${encodeURIComponent(opts.userId)}`;
120
+ const data = await call({ method: "GET", path, asUserId: as });
121
+ process.stdout.write(JSON.stringify(data) + "\n");
122
+ });
123
+ }
124
+ if (!hasSubcommand(group, "clear-messages")) {
125
+ group
126
+ .command("clear-messages")
127
+ .description("POST /api/v1/dm/rooms/{roomId}/clear")
128
+ .requiredOption("--room-id <value>", "roomId (path param)")
129
+ .option("--body <json>", "request body as JSON (no schema available)")
130
+ .action(async (opts) => {
131
+ const { as } = program.opts();
132
+ if (!as)
133
+ throw new Error("--as <userId> is required");
134
+ const path = `/api/v1/dm/rooms/${encodeURIComponent(opts.roomId)}/clear`;
135
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
136
+ const data = await call({ method: "POST", path, asUserId: as, body });
137
+ process.stdout.write(JSON.stringify(data) + "\n");
138
+ });
139
+ }
140
+ if (!hasSubcommand(group, "remove-room")) {
141
+ group
142
+ .command("remove-room")
143
+ .description("DELETE /api/v1/dm/rooms/{roomId}")
144
+ .requiredOption("--room-id <value>", "roomId (path param)")
145
+ .action(async (opts) => {
146
+ const { as } = program.opts();
147
+ if (!as)
148
+ throw new Error("--as <userId> is required");
149
+ const path = `/api/v1/dm/rooms/${encodeURIComponent(opts.roomId)}`;
150
+ const data = await call({ method: "DELETE", path, asUserId: as });
151
+ process.stdout.write(JSON.stringify(data) + "\n");
152
+ });
153
+ }
154
+ }
155
+ //# sourceMappingURL=dm.js.map
@@ -0,0 +1,41 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "drafts", "Drafts operations");
5
+ if (!hasSubcommand(group, "list")) {
6
+ group
7
+ .command("list")
8
+ .description("GET /api/v1/drafts")
9
+ .option("--room-id <value>", "string")
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/drafts`;
15
+ const query = {};
16
+ {
17
+ const v = opts.roomId;
18
+ if (v !== undefined)
19
+ query["roomId"] = v;
20
+ }
21
+ const data = await call({ method: "GET", path, asUserId: as, query });
22
+ process.stdout.write(JSON.stringify(data) + "\n");
23
+ });
24
+ }
25
+ if (!hasSubcommand(group, "save")) {
26
+ group
27
+ .command("save")
28
+ .description("PATCH /api/v1/drafts")
29
+ .option("--body <json>", "request body as JSON (no schema available)")
30
+ .action(async (opts) => {
31
+ const { as } = program.opts();
32
+ if (!as)
33
+ throw new Error("--as <userId> is required");
34
+ const path = `/api/v1/drafts`;
35
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
36
+ const data = await call({ method: "PATCH", path, asUserId: as, body });
37
+ process.stdout.write(JSON.stringify(data) + "\n");
38
+ });
39
+ }
40
+ }
41
+ //# sourceMappingURL=drafts.js.map
@@ -0,0 +1,34 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "embed", "Embed operations");
5
+ if (!hasSubcommand(group, "embed-story")) {
6
+ group
7
+ .command("embed-story")
8
+ .description("GET /embed/{storyId}")
9
+ .requiredOption("--story-id <value>", "storyId (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 = `/embed/${encodeURIComponent(opts.storyId)}`;
15
+ const data = await call({ method: "GET", path, asUserId: as });
16
+ process.stdout.write(JSON.stringify(data) + "\n");
17
+ });
18
+ }
19
+ if (!hasSubcommand(group, "embed-snippet")) {
20
+ group
21
+ .command("embed-snippet")
22
+ .description("GET /embed/{storyId}/snippet")
23
+ .requiredOption("--story-id <value>", "storyId (path param)")
24
+ .action(async (opts) => {
25
+ const { as } = program.opts();
26
+ if (!as)
27
+ throw new Error("--as <userId> is required");
28
+ const path = `/embed/${encodeURIComponent(opts.storyId)}/snippet`;
29
+ const data = await call({ method: "GET", path, asUserId: as });
30
+ process.stdout.write(JSON.stringify(data) + "\n");
31
+ });
32
+ }
33
+ }
34
+ //# sourceMappingURL=embed.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, "explore", "Explore operations");
5
+ if (!hasSubcommand(group, "explore-page")) {
6
+ group
7
+ .command("explore-page")
8
+ .description("GET /explore")
9
+ .action(async (opts) => {
10
+ const { as } = program.opts();
11
+ if (!as)
12
+ throw new Error("--as <userId> is required");
13
+ const path = `/explore`;
14
+ const data = await call({ method: "GET", path, asUserId: as });
15
+ process.stdout.write(JSON.stringify(data) + "\n");
16
+ });
17
+ }
18
+ }
19
+ //# sourceMappingURL=explore.js.map
@@ -0,0 +1,67 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "feed", "Feed operations");
5
+ if (!hasSubcommand(group, "get-feed")) {
6
+ group
7
+ .command("get-feed")
8
+ .description("GET /api/v1/users/me/feed")
9
+ .option("--cursor <value>", "string")
10
+ .option("--limit <value>", "string")
11
+ .action(async (opts) => {
12
+ const { as } = program.opts();
13
+ if (!as)
14
+ throw new Error("--as <userId> is required");
15
+ const path = `/api/v1/users/me/feed`;
16
+ const query = {};
17
+ {
18
+ const v = opts.cursor;
19
+ if (v !== undefined)
20
+ query["cursor"] = v;
21
+ }
22
+ {
23
+ const v = opts.limit;
24
+ if (v !== undefined)
25
+ query["limit"] = v;
26
+ }
27
+ const data = await call({ method: "GET", path, asUserId: as, query });
28
+ process.stdout.write(JSON.stringify(data) + "\n");
29
+ });
30
+ }
31
+ if (!hasSubcommand(group, "get-suggestions")) {
32
+ group
33
+ .command("get-suggestions")
34
+ .description("GET /api/v1/users/me/feed/suggestions")
35
+ .option("--limit <value>", "string")
36
+ .action(async (opts) => {
37
+ const { as } = program.opts();
38
+ if (!as)
39
+ throw new Error("--as <userId> is required");
40
+ const path = `/api/v1/users/me/feed/suggestions`;
41
+ const query = {};
42
+ {
43
+ const v = opts.limit;
44
+ if (v !== undefined)
45
+ query["limit"] = v;
46
+ }
47
+ const data = await call({ method: "GET", path, asUserId: as, query });
48
+ process.stdout.write(JSON.stringify(data) + "\n");
49
+ });
50
+ }
51
+ if (!hasSubcommand(group, "dismiss")) {
52
+ group
53
+ .command("dismiss")
54
+ .description("POST /api/v1/users/me/feed/dismiss")
55
+ .option("--body <json>", "request body as JSON (no schema available)")
56
+ .action(async (opts) => {
57
+ const { as } = program.opts();
58
+ if (!as)
59
+ throw new Error("--as <userId> is required");
60
+ const path = `/api/v1/users/me/feed/dismiss`;
61
+ const body = opts.body ? JSON.parse(opts.body) : undefined;
62
+ const data = await call({ method: "POST", path, asUserId: as, body });
63
+ process.stdout.write(JSON.stringify(data) + "\n");
64
+ });
65
+ }
66
+ }
67
+ //# sourceMappingURL=feed.js.map
@@ -0,0 +1,44 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "feedback", "Feedback operations");
5
+ if (!hasSubcommand(group, "submit")) {
6
+ group
7
+ .command("submit")
8
+ .description("POST /api/v1/feedback")
9
+ .requiredOption("--type <value>", "string")
10
+ .requiredOption("--message <value>", "string")
11
+ .option("--screenshot <value>", "string")
12
+ .option("--rating <n>", "number")
13
+ .action(async (opts) => {
14
+ const { as } = program.opts();
15
+ if (!as)
16
+ throw new Error("--as <userId> is required");
17
+ const path = `/api/v1/feedback`;
18
+ const body = {};
19
+ {
20
+ const v = opts.type;
21
+ if (v !== undefined)
22
+ body["type"] = v;
23
+ }
24
+ {
25
+ const v = opts.message;
26
+ if (v !== undefined)
27
+ body["message"] = v;
28
+ }
29
+ {
30
+ const v = opts.screenshot;
31
+ if (v !== undefined)
32
+ body["screenshot"] = v;
33
+ }
34
+ {
35
+ const v = opts.rating === undefined ? undefined : Number(opts.rating);
36
+ if (v !== undefined)
37
+ body["rating"] = v;
38
+ }
39
+ const data = await call({ method: "POST", path, asUserId: as, body });
40
+ process.stdout.write(JSON.stringify(data) + "\n");
41
+ });
42
+ }
43
+ }
44
+ //# sourceMappingURL=feedback.js.map
@@ -0,0 +1,33 @@
1
+ import { call } from "../../client.js";
2
+ import { getOrCreateGroup, hasSubcommand } from "../_helpers.js";
3
+ export function register(program) {
4
+ const group = getOrCreateGroup(program, "gamification", "Gamification operations");
5
+ if (!hasSubcommand(group, "my-impact")) {
6
+ group
7
+ .command("my-impact")
8
+ .description("GET /api/v1/users/me/impact")
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/impact`;
14
+ const data = await call({ method: "GET", path, asUserId: as });
15
+ process.stdout.write(JSON.stringify(data) + "\n");
16
+ });
17
+ }
18
+ if (!hasSubcommand(group, "public-impact")) {
19
+ group
20
+ .command("public-impact")
21
+ .description("GET /api/v1/users/{userId}/impact")
22
+ .requiredOption("--user-id <value>", "userId (path param)")
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/${encodeURIComponent(opts.userId)}/impact`;
28
+ const data = await call({ method: "GET", path, asUserId: as });
29
+ process.stdout.write(JSON.stringify(data) + "\n");
30
+ });
31
+ }
32
+ }
33
+ //# sourceMappingURL=gamification.js.map