@notidotbot/noti-api-client 1.9.121 → 1.9.123

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.
@@ -110,10 +110,10 @@ class APIAdmin {
110
110
  });
111
111
  }
112
112
  // Game Drops admin — manage the global per-game ignore flag + the drops pause kill switch.
113
- async listDropGames({ auth, page, limit, platform, search, status }) {
113
+ async listDropGames({ auth, page, limit, platform, search, status, sort }) {
114
114
  return await this.web.request({
115
115
  method: 'GET', auth,
116
- endpoint: this.web.qp('/admin/drops/games', { page, limit, platform, search, status }),
116
+ endpoint: this.web.qp('/admin/drops/games', { page, limit, platform, search, status, sort }),
117
117
  });
118
118
  }
119
119
  async toggleDropGame({ auth, dbId, ignored }) {
@@ -134,10 +134,10 @@ class APIAdmin {
134
134
  endpoint: this.web.qp('/admin/drops/games/reconcile'),
135
135
  });
136
136
  }
137
- async listDropCampaigns({ auth, page, limit, platform, status, gameId }) {
137
+ async listDropCampaigns({ auth, page, limit, platform, status, gameId, sent }) {
138
138
  return await this.web.request({
139
139
  method: 'GET', auth,
140
- endpoint: this.web.qp('/admin/drops/campaigns', { page, limit, platform, status, gameId }),
140
+ endpoint: this.web.qp('/admin/drops/campaigns', { page, limit, platform, status, gameId, sent }),
141
141
  });
142
142
  }
143
143
  async getDropsSettings({ auth }) {
@@ -152,6 +152,256 @@ class APIAdmin {
152
152
  endpoint: this.web.qp('/admin/drops/settings'),
153
153
  });
154
154
  }
155
+ // Linked-account moderation (was /utils link_ban). A user, or a platform + handle; bad input is a 400 with the reason.
156
+ async listLinkBans({ auth }) {
157
+ return await this.web.request({
158
+ method: 'GET', auth,
159
+ endpoint: this.web.qp('/admin/link-bans'),
160
+ });
161
+ }
162
+ /** Ban a user from linking anything, or an account from being linked by anyone. Removes the existing links. */
163
+ async createLinkBan({ auth, userId, platform, handle, reason }) {
164
+ return await this.web.request({
165
+ method: 'POST', auth, body: { userId, platform, handle, reason },
166
+ endpoint: this.web.qp('/admin/link-bans'),
167
+ });
168
+ }
169
+ /** Lift a ban. Old links are not restored. */
170
+ async deleteLinkBan({ auth, userId, platform, handle }) {
171
+ return await this.web.request({
172
+ method: 'DELETE', auth, body: { userId, platform, handle },
173
+ endpoint: this.web.qp('/admin/link-bans'),
174
+ });
175
+ }
176
+ /** Unlink an account from whoever has it, WITHOUT a ban - the real owner can still link it. */
177
+ async deleteLinkedAccount({ auth, platform, handle, reason }) {
178
+ return await this.web.request({
179
+ method: 'DELETE', auth, body: { platform, handle, reason },
180
+ endpoint: this.web.qp('/admin/linked-accounts'),
181
+ });
182
+ }
183
+ /** Link history, newest 25: a userId and/or a platform + handle (kick included). */
184
+ async listLinkEvents({ auth, userId, platform, handle }) {
185
+ return await this.web.request({
186
+ method: 'GET', auth,
187
+ endpoint: this.web.qp('/admin/link-events', { userId, platform, handle }),
188
+ });
189
+ }
190
+ /** Lift a Kick account's switch lock: another Discord account may earn roles with it again. History is kept. */
191
+ async createKickLinkReset({ auth, handle, reason }) {
192
+ return await this.web.request({
193
+ method: 'POST', auth, body: { handle, reason },
194
+ endpoint: this.web.qp('/admin/kick-link-resets'),
195
+ });
196
+ }
197
+ // User-data deletions (privacy requests): scheduled 7 days out, a 2FA code to request, cancellable until they run.
198
+ /** Pending deletions, soonest first. */
199
+ async listUserDataDeletions({ auth }) {
200
+ return await this.web.request({
201
+ method: 'GET', auth,
202
+ endpoint: this.web.qp('/admin/data-deletions'),
203
+ });
204
+ }
205
+ /** Schedule a deletion 7 days out. `code` = the 6-digit code from the authenticator app. 403 = bad / reused code, 409 = already pending (error says so), 503 = 2FA not configured on this deployment. */
206
+ async createUserDataDeletion({ auth, userId, code }) {
207
+ return await this.web.request({
208
+ method: 'POST', auth, body: { code },
209
+ endpoint: this.web.qp(`/admin/users/${userId}/data-deletions`),
210
+ });
211
+ }
212
+ /** Cancel a pending deletion - nothing is deleted. No code needed. 404 = nothing pending. */
213
+ async deleteUserDataDeletion({ auth, userId }) {
214
+ return await this.web.request({
215
+ method: 'DELETE', auth,
216
+ endpoint: this.web.qp(`/admin/users/${userId}/data-deletions`),
217
+ });
218
+ }
219
+ // AI assistant tools (was /utils assistant).
220
+ /** Live chat chain / memory / guard models, and the env defaults they fall back to. */
221
+ async getAssistantModels({ auth }) {
222
+ return await this.web.request({
223
+ method: 'GET', auth,
224
+ endpoint: this.web.qp('/admin/assistant/models'),
225
+ });
226
+ }
227
+ /** Change any of the three. Each is checked against OpenRouter (exists, structured outputs, price ceiling); a 400 says which and why, and nothing is saved. */
228
+ async updateAssistantModels({ auth, chatModels, memoryModel, guardModel }) {
229
+ return await this.web.request({
230
+ method: 'PATCH', auth, body: { chatModels, memoryModel, guardModel },
231
+ endpoint: this.web.qp('/admin/assistant/models'),
232
+ });
233
+ }
234
+ /** Proposal fields users corrected most, last 30 days (keys only, top 50). */
235
+ async listAssistantDrafts({ auth }) {
236
+ return await this.web.request({
237
+ method: 'GET', auth,
238
+ endpoint: this.web.qp('/admin/assistant/drafts'),
239
+ });
240
+ }
241
+ /** Chats users shared for review. `status` defaults to new. */
242
+ async listAssistantShares({ auth, status }) {
243
+ return await this.web.request({
244
+ method: 'GET', auth,
245
+ endpoint: this.web.qp('/admin/assistant/shares', { status }),
246
+ });
247
+ }
248
+ /** One shared chat: its turns, proposals and the full plain-text transcript. */
249
+ async getAssistantShare({ auth, id }) {
250
+ return await this.web.request({
251
+ method: 'GET', auth,
252
+ endpoint: this.web.qp('/admin/assistant/shares/' + id),
253
+ });
254
+ }
255
+ /** Mark a shared chat as reviewed. */
256
+ async updateAssistantShare({ auth, id, status }) {
257
+ return await this.web.request({
258
+ method: 'PATCH', auth, body: { status },
259
+ endpoint: this.web.qp('/admin/assistant/shares/' + id),
260
+ });
261
+ }
262
+ /** Docs-pass memory entries. `status` defaults to pending. */
263
+ async listAssistantMemories({ auth, status }) {
264
+ return await this.web.request({
265
+ method: 'GET', auth,
266
+ endpoint: this.web.qp('/admin/assistant/memories', { status }),
267
+ });
268
+ }
269
+ /** One entry: its lines marked same (already in the docs) / new, and `check` (null = valid). */
270
+ async getAssistantMemory({ auth, id }) {
271
+ return await this.web.request({
272
+ method: 'GET', auth,
273
+ endpoint: this.web.qp('/admin/assistant/memories/' + id),
274
+ });
275
+ }
276
+ /** Approve (re-validated - 400 with the reason if not) or reject a PENDING entry. 404 = not pending. */
277
+ async updateAssistantMemory({ auth, id, status }) {
278
+ return await this.web.request({
279
+ method: 'PATCH', auth, body: { status },
280
+ endpoint: this.web.qp('/admin/assistant/memories/' + id),
281
+ });
282
+ }
283
+ // Misc staff tools (was /utils sessions, feedback_panel, decrypt_image_hash).
284
+ /** Your own dashboard logins. Only the last 4 characters of each key are sent; `current` = this login. */
285
+ async listAdminSessions({ auth }) {
286
+ return await this.web.request({
287
+ method: 'GET', auth,
288
+ endpoint: this.web.qp('/admin/sessions'),
289
+ });
290
+ }
291
+ /** Sign one of your own logins out (it stops working at once). 404 = not one of yours. */
292
+ async deleteAdminSession({ auth, id }) {
293
+ return await this.web.request({
294
+ method: 'DELETE', auth,
295
+ endpoint: this.web.qp('/admin/sessions/' + id),
296
+ });
297
+ }
298
+ /** Post the feedback panel (Submit / Top / Open) in a channel. `boardId` empty = the main board. 400/404 say why it could not post. */
299
+ async createFeedbackPanel({ auth, guildId, channelId, boardId }) {
300
+ return await this.web.request({
301
+ method: 'POST', auth, body: { guildId, channelId, boardId },
302
+ endpoint: this.web.qp('/admin/feedback/panels'),
303
+ });
304
+ }
305
+ /** Which image an image.noti.bot hash points at. Takes the hash or the whole proxy url. 400 = not an image hash. */
306
+ async decryptImageHash({ auth, hash }) {
307
+ return await this.web.request({
308
+ method: 'POST', auth, body: { hash },
309
+ endpoint: this.web.qp('/admin/image-hashes/decryptions'),
310
+ });
311
+ }
312
+ // Staff lists + presence opt-out (was /utils dash_whitelist, staff_whitelist, presence_optout).
313
+ /** The dashboard allowlist or the staff list. WHILE THE DASHBOARD LIST HAS ANYONE ON IT, ONLY those people (plus developers) can use the dashboard. */
314
+ async listStaffList({ auth, kind }) {
315
+ return await this.web.request({
316
+ method: 'GET', auth,
317
+ endpoint: this.web.qp('/admin/whitelists/' + kind),
318
+ });
319
+ }
320
+ /** Add someone (no-op if already on it). Returns the new list. */
321
+ async addStaffListUser({ auth, kind, userId }) {
322
+ return await this.web.request({
323
+ method: 'PUT', auth,
324
+ endpoint: this.web.qp('/admin/whitelists/' + kind + '/' + userId),
325
+ });
326
+ }
327
+ /** Remove someone. Returns the new list. */
328
+ async removeStaffListUser({ auth, kind, userId }) {
329
+ return await this.web.request({
330
+ method: 'DELETE', auth,
331
+ endpoint: this.web.qp('/admin/whitelists/' + kind + '/' + userId),
332
+ });
333
+ }
334
+ /** Empty a list. For `dashboard` this OPENS the dashboard to everyone again. */
335
+ async clearStaffList({ auth, kind }) {
336
+ return await this.web.request({
337
+ method: 'DELETE', auth,
338
+ endpoint: this.web.qp('/admin/whitelists/' + kind),
339
+ });
340
+ }
341
+ /** Members whose presence Noti ignores (Status / Auto Live / Stream Roles), at their request. */
342
+ async listPresenceOptOuts({ auth }) {
343
+ return await this.web.request({
344
+ method: 'GET', auth,
345
+ endpoint: this.web.qp('/admin/presence-optouts'),
346
+ });
347
+ }
348
+ /** Stop processing this member's presence. `clustersUpdated: false` = it applies at the next load, not now. */
349
+ async addPresenceOptOut({ auth, userId }) {
350
+ return await this.web.request({
351
+ method: 'PUT', auth,
352
+ endpoint: this.web.qp('/admin/presence-optouts/' + userId),
353
+ });
354
+ }
355
+ /** Process this member's presence again. */
356
+ async removePresenceOptOut({ auth, userId }) {
357
+ return await this.web.request({
358
+ method: 'DELETE', auth,
359
+ endpoint: this.web.qp('/admin/presence-optouts/' + userId),
360
+ });
361
+ }
362
+ // Platform debug lookups (was /debug youtube_pubsub, tiktok_lookup, log_raw_data_for).
363
+ /** One YouTube creator's subscription: our Redis renewal vs Google's hub, and the webhooks we received. 404 = no such creator, 503 = YouTube not running. */
364
+ async getYoutubePubSub({ auth, username }) {
365
+ return await this.web.request({
366
+ method: 'GET', auth,
367
+ endpoint: this.web.qp('/admin/youtube/creators/' + encodeURIComponent(username) + '/pubsub'),
368
+ });
369
+ }
370
+ /** Ask tokapi about a TikTok creator RIGHT NOW (a paid call; the raw answer also goes to Sonar). 429 = one per 10 seconds. */
371
+ async getTiktokLookup({ auth, username }) {
372
+ return await this.web.request({
373
+ method: 'GET', auth,
374
+ endpoint: this.web.qp('/admin/tiktok/creators/' + encodeURIComponent(username) + '/lookup'),
375
+ });
376
+ }
377
+ /** Creators whose raw API responses get logged (applies on the next poll). */
378
+ async listRawLogs({ auth }) {
379
+ return await this.web.request({
380
+ method: 'GET', auth,
381
+ endpoint: this.web.qp('/admin/raw-logs'),
382
+ });
383
+ }
384
+ /** Start logging raw responses for a creator. `exists` = already listed. */
385
+ async addRawLog({ auth, platform, username }) {
386
+ return await this.web.request({
387
+ method: 'POST', auth, body: { platform, username },
388
+ endpoint: this.web.qp('/admin/raw-logs'),
389
+ });
390
+ }
391
+ /** Stop logging one. 404 = not on the list. */
392
+ async removeRawLog({ auth, platform, username }) {
393
+ return await this.web.request({
394
+ method: 'DELETE', auth,
395
+ endpoint: this.web.qp('/admin/raw-logs/' + platform + '/' + encodeURIComponent(username)),
396
+ });
397
+ }
398
+ /** Stop logging everyone. */
399
+ async clearRawLogs({ auth }) {
400
+ return await this.web.request({
401
+ method: 'DELETE', auth,
402
+ endpoint: this.web.qp('/admin/raw-logs'),
403
+ });
404
+ }
155
405
  // Badge Notifications: every badge each platform's last sync detected (a name match - neither platform
156
406
  // marks a badge), active or not, with how many servers each was sent to. The check that detection
157
407
  // catches badges and nothing else.
@@ -215,6 +465,35 @@ class APIAdmin {
215
465
  endpoint: this.web.qp('/admin/cooldowns', { streamer, guildId, platform, page, limit }),
216
466
  });
217
467
  }
468
+ /** Clear one creator's cooldown in one server (was /utils clear_cooldown): its next live / video posts as if it were the first. 404 = not set up there. */
469
+ async deleteCooldown({ auth, guildId, platform, streamer }) {
470
+ return await this.web.request({
471
+ method: 'DELETE', auth,
472
+ endpoint: this.web.qp(`/admin/cooldowns/${guildId}/${platform}/${encodeURIComponent(streamer)}`),
473
+ });
474
+ }
475
+ // Premium tools (was /utils status manual_premium / reconcile_subscriptions / sync_premium_roles).
476
+ /** Premium servers with no Stripe subscription behind them (comps, staff plans, hand grants), by tier. */
477
+ async getManualPremium({ auth, tier }) {
478
+ return await this.web.request({
479
+ method: 'GET', auth,
480
+ endpoint: this.web.qp('/admin/premium/manual', { tier }),
481
+ });
482
+ }
483
+ /** Re-grant premium Stripe says is owed; `downgradeStale` also revokes Stripe-linked servers whose sub ended. DRY RUN unless `dryRun: false`. */
484
+ async createSubscriptionReconciliation({ auth, dryRun, downgradeStale }) {
485
+ return await this.web.request({
486
+ method: 'POST', auth, body: { dryRun, downgradeStale },
487
+ endpoint: this.web.qp('/admin/premium/reconciliations'),
488
+ });
489
+ }
490
+ /** Fix support-server premium roles for one user or everyone (`limit` written per call, default 100, max 200 - run again while `remaining` > 0). DRY RUN unless `dryRun: false`. */
491
+ async createPremiumRoleSync({ auth, userId, dryRun, limit }) {
492
+ return await this.web.request({
493
+ method: 'POST', auth, body: { userId, dryRun, limit },
494
+ endpoint: this.web.qp('/admin/premium/role-syncs'),
495
+ });
496
+ }
218
497
  async getSystemHealth({ auth }) {
219
498
  return await this.web.request({
220
499
  method: 'GET', auth,
@@ -66,7 +66,7 @@ export type AssistantShareTurn = {
66
66
  clarify?: string[];
67
67
  };
68
68
  /** The areas the assistant can propose changes to. Mirrors the bot's `AREAS` (assistant/areas.ts). */
69
- export declare const ASSISTANT_AREAS: readonly ["kick", "twitch", "youtube", "tiktok", "rumble", "twitter", "club", "rss", "overrides", "welcome", "autoRoles", "badges", "bounties"];
69
+ export declare const ASSISTANT_AREAS: readonly ["kick", "twitch", "youtube", "tiktok", "rumble", "twitter", "club", "rss", "instagram", "overrides", "welcome", "autoRoles", "statusRoles", "streamRoles", "autoLiveRoles", "clipForwards", "starboards", "stickyMessages", "giveaways", "boosts", "scheduledMessages", "badges", "bounties"];
70
70
  export type AssistantArea = (typeof ASSISTANT_AREAS)[number];
71
71
  /**
72
72
  * How a field is edited on the card. Mirrors the bot's `FieldKind` (assistant/labels.ts):
@@ -141,8 +141,9 @@ export type AssistantProposal = {
141
141
  /** Pass to `sendAssistantOutcome`. Valid for an hour. */
142
142
  id: string;
143
143
  area: AssistantArea;
144
- op: 'add' | 'update';
145
- /** Which item: `{ username }` for creators, `{ name }` for auto roles, `{ priority }` for overrides, `{}` otherwise. */
144
+ /** `remove` (clip forwarding, starboards, sticky messages): no fields - apply it with the area's DELETE route. Never tick it by default. */
145
+ op: 'add' | 'update' | 'remove';
146
+ /** Which item: `{ username }` for creators, `{ name }` for auto roles, `{ priority }` for overrides, `{ role, roleId }` for role rows, `{ platform, username, clipForwardId }` for clip forwards (`clipForwardId` on edit / remove), `{ channel, channelId }` for starboards and sticky messages, `{}` otherwise. */
146
147
  target: Record<string, string>;
147
148
  title: string;
148
149
  fields: AssistantField[];
@@ -78,7 +78,7 @@ class APIGuildAssistant {
78
78
  }
79
79
  exports.APIGuildAssistant = APIGuildAssistant;
80
80
  /** The areas the assistant can propose changes to. Mirrors the bot's `AREAS` (assistant/areas.ts). */
81
- exports.ASSISTANT_AREAS = ['kick', 'twitch', 'youtube', 'tiktok', 'rumble', 'twitter', 'club', 'rss', 'overrides', 'welcome', 'autoRoles', 'badges', 'bounties'];
81
+ exports.ASSISTANT_AREAS = ['kick', 'twitch', 'youtube', 'tiktok', 'rumble', 'twitter', 'club', 'rss', 'instagram', 'overrides', 'welcome', 'autoRoles', 'statusRoles', 'streamRoles', 'autoLiveRoles', 'clipForwards', 'starboards', 'stickyMessages', 'giveaways', 'boosts', 'scheduledMessages', 'badges', 'bounties'];
82
82
  /**
83
83
  * How a field is edited on the card. Mirrors the bot's `FieldKind` (assistant/labels.ts):
84
84
  * `channel` - a channel picker; `role` - a role picker; `role-or-everyone` - a role picker that also offers
@@ -62,7 +62,9 @@ export type SetupProfile = SetupAnswers & {
62
62
  updatedAt: string;
63
63
  };
64
64
  /**
65
- * `reasons`: why it fits - `type:<serverType>`, `goal:<goal>`, `platform:<platform>` (render your own copy).
65
+ * `reasons`: why it fits - `type:<serverType>`, `goal:<goal>`, `platform:<platform>` (render your own copy), or `starter`
66
+ * first when nothing in the answers fit and this is the starter set (e.g. "A good place to start").
67
+ * `group`: `live` / `community` / `extras` - show and apply one group at a time, live first.
66
68
  * `feature`: a promotable feature id (ClipForwarding, Starboards, ...) or `Creators` (live notifications).
67
69
  * `premium`: needs a paid plan or add-on; `unlocked`: this server already has it; `requiredPlan`: the cheapest plan
68
70
  * that includes it (e.g. 'Server Premium'), 'Add-on' for add-ons, null when free.
@@ -78,8 +80,10 @@ export type SetupNeed = {
78
80
  score: number;
79
81
  }[];
80
82
  };
83
+ export type SetupGroup = 'live' | 'community' | 'extras';
81
84
  export type SetupSuggestion = {
82
85
  feature: string;
86
+ group: SetupGroup;
83
87
  reasons: string[];
84
88
  status: 'suggested' | 'alreadySetUp';
85
89
  needs: SetupNeed[];
@@ -87,11 +91,13 @@ export type SetupSuggestion = {
87
91
  unlocked: boolean;
88
92
  requiredPlan: string | null;
89
93
  };
94
+ /** `groups`: the groups that need it (sorted live first). Create only what the group being applied needs. */
90
95
  export type SetupMissing = {
91
96
  kind: 'channel' | 'role';
92
97
  name: string;
93
98
  key: string;
94
99
  forFeatures: string[];
100
+ groups: SetupGroup[];
95
101
  };
96
102
  export type SetupCreator = {
97
103
  platform: string;
@@ -7,7 +7,6 @@ export declare class APIUser {
7
7
  constructor(web: WebDataManager);
8
8
  getUser({ auth, userId }: UserFunctionsInput['getUser']): Promise<import("../types").WebResponse<UserResponse>>;
9
9
  updateUser({ auth, userId, user }: UserFunctionsInput['updateUser']): Promise<import("../types").WebResponse<string>>;
10
- deleteUser({ auth, userId }: UserFunctionsInput['deleteUser']): Promise<import("../types").WebResponse<string>>;
11
10
  }
12
11
  export type UserFunctionsInput = {
13
12
  'getUser': {
@@ -19,18 +18,12 @@ export type UserFunctionsInput = {
19
18
  userId: string;
20
19
  user: DeepPartial<UserZod>;
21
20
  };
22
- 'deleteUser': {
23
- auth: string;
24
- userId: string;
25
- };
26
21
  };
27
22
  export type UserReturnTypes = {
28
23
  'getUserRaw': Awaited<ReturnType<APIUser['getUser']>>;
29
24
  'getUserSuccess': CancelOutWebResponses<Awaited<ReturnType<APIUser['getUser']>>>;
30
25
  'updateUserRaw': Awaited<ReturnType<APIUser['updateUser']>>;
31
26
  'updateUserSuccess': CancelOutWebResponses<Awaited<ReturnType<APIUser['updateUser']>>>;
32
- 'deleteUserRaw': Awaited<ReturnType<APIUser['deleteUser']>>;
33
- 'deleteUserSuccess': CancelOutWebResponses<Awaited<ReturnType<APIUser['deleteUser']>>>;
34
27
  };
35
28
  export type UserResponse = Omit<CurrentUser, 'discord' | 'database'> & UserWithPremium;
36
29
  export type UserWithPremium = CurrentUser['database'] & {
@@ -20,11 +20,5 @@ class APIUser {
20
20
  endpoint: this.web.qp('/data/user/' + userId),
21
21
  });
22
22
  }
23
- async deleteUser({ auth, userId }) {
24
- return await this.web.request({
25
- method: 'DELETE', auth,
26
- endpoint: this.web.qp('/data/user/' + userId),
27
- });
28
- }
29
23
  }
30
24
  exports.APIUser = APIUser;