@notidotbot/noti-api-client 1.6.6 → 1.6.9

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 (42) hide show
  1. package/dist/classes/@me.d.ts +2 -0
  2. package/dist/classes/admin.d.ts +342 -0
  3. package/dist/classes/admin.js +86 -0
  4. package/dist/classes/guildPlatform.d.ts +6 -3
  5. package/dist/classes/guildPlatformAction.d.ts +2 -2
  6. package/dist/classes/guildRolePanel.d.ts +2 -0
  7. package/dist/index.d.ts +3 -1
  8. package/dist/index.js +4 -1
  9. package/dist/other/bitfields.d.ts +5 -2
  10. package/dist/other/bitfields.js +2 -0
  11. package/dist/other/enums.d.ts +6 -0
  12. package/dist/other/enums.js +3 -0
  13. package/dist/other/features.d.ts +4 -0
  14. package/dist/other/features.js +18 -0
  15. package/dist/other/prisma.d.ts +3 -0
  16. package/dist/other/templates.d.ts +38 -0
  17. package/dist/other/templates.js +29 -0
  18. package/dist/other/zod/client.zod.d.ts +2 -0
  19. package/dist/other/zod/clipForward.zod.d.ts +3 -0
  20. package/dist/other/zod/clubStreamer.zod.d.ts +117 -0
  21. package/dist/other/zod/clubStreamer.zod.js +28 -0
  22. package/dist/other/zod/drops.zod.d.ts +1 -0
  23. package/dist/other/zod/guild.zod.d.ts +5 -0
  24. package/dist/other/zod/kickStreamer.zod.d.ts +2 -0
  25. package/dist/other/zod/rolePanels.zod.d.ts +2 -0
  26. package/dist/other/zod/rolePanels.zod.js +1 -0
  27. package/dist/other/zod/rumbleStreamer.zod.d.ts +2 -0
  28. package/dist/other/zod/scheduledMessage.zod.d.ts +46 -2
  29. package/dist/other/zod/scheduledMessage.zod.js +32 -2
  30. package/dist/other/zod/schema.zod.d.ts +3 -0
  31. package/dist/other/zod/schema.zod.js +3 -0
  32. package/dist/other/zod/tiktokStreamer.zod.d.ts +2 -0
  33. package/dist/other/zod/twitchStreamer.zod.d.ts +2 -0
  34. package/dist/other/zod/youtubeStreamer.zod.d.ts +2 -0
  35. package/dist/other/zod/zod.d.ts +2 -0
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +1 -1
  38. package/prisma/generated/ts-prisma.d.ts +11106 -7305
  39. package/prisma/schema/models/clubStreamer.prisma +95 -0
  40. package/prisma/schema/models/rolePanels.prisma +1 -0
  41. package/prisma/schema/models/scheduledMessage.prisma +46 -0
  42. package/prisma/schema/schema.prisma +3 -0
@@ -1,4 +1,5 @@
1
1
  import { PlatformsToLinkType, User } from '../other/prisma';
2
+ import { FeatureName, ResolvedFeature } from '../other/features';
2
3
  import { WebDataManager } from '../core/manager';
3
4
  import { CancelOutWebResponses } from '../types';
4
5
  export declare class APIMe {
@@ -81,6 +82,7 @@ export type CurrentUser = {
81
82
  isDev: boolean;
82
83
  isStaff: boolean;
83
84
  notifications: string[];
85
+ features: Record<FeatureName, ResolvedFeature>;
84
86
  discord: DCUserData;
85
87
  database: User & {
86
88
  premium: {
@@ -1,4 +1,5 @@
1
1
  import { FirstCapital, AllPlatforms } from '../other/prisma';
2
+ import { FeatureName, FeatureStatus } from '../other/features';
2
3
  import { CancelOutWebResponses } from '../types';
3
4
  import { WebDataManager } from '../core/manager';
4
5
  export declare class APIAdmin {
@@ -14,6 +15,20 @@ export declare class APIAdmin {
14
15
  deleteFixUrlRule({ auth, ruleId }: AdminFunctionsInput['deleteFixUrlRule']): Promise<import("../types").WebResponse<string>>;
15
16
  getNotificationProviders({ auth }: AdminFunctionsInput['getNotificationProviders']): Promise<import("../types").WebResponse<NotificationProviderStatus[]>>;
16
17
  setNotificationProvider({ auth, name, enabled }: AdminFunctionsInput['setNotificationProvider']): Promise<import("../types").WebResponse<NotificationProvider>>;
18
+ getFeatureFlags({ auth }: AdminFunctionsInput['getFeatureFlags']): Promise<import("../types").WebResponse<FeatureFlagStatus[]>>;
19
+ setFeatureFlag({ auth, feature, status }: AdminFunctionsInput['setFeatureFlag']): Promise<import("../types").WebResponse<FeatureFlag>>;
20
+ listDropGames({ auth, page, limit, platform, search, status }: AdminFunctionsInput['listDropGames']): Promise<import("../types").WebResponse<DropGamesListResponse>>;
21
+ toggleDropGame({ auth, dbId, ignored }: AdminFunctionsInput['toggleDropGame']): Promise<import("../types").WebResponse<DropGameToggleResult>>;
22
+ bulkToggleDropGames({ auth, ignored, dbIds, all, platform }: AdminFunctionsInput['bulkToggleDropGames']): Promise<import("../types").WebResponse<DropGamesBulkResult>>;
23
+ reconcileDropGames({ auth, keep, platform }: AdminFunctionsInput['reconcileDropGames']): Promise<import("../types").WebResponse<DropGamesReconcileResult>>;
24
+ listDropCampaigns({ auth, page, limit, platform, status, gameId }: AdminFunctionsInput['listDropCampaigns']): Promise<import("../types").WebResponse<DropCampaignsListResponse>>;
25
+ getDropsSettings({ auth }: AdminFunctionsInput['getDropsSettings']): Promise<import("../types").WebResponse<DropsSettingsResult>>;
26
+ setDropsSettings({ auth, global, kick, twitch }: AdminFunctionsInput['setDropsSettings']): Promise<import("../types").WebResponse<DropsSettingsResult>>;
27
+ getGuildVods({ auth, guildId, page, limit, creator, enrich }: AdminFunctionsInput['getGuildVods']): Promise<import("../types").WebResponse<GuildVodsResponse>>;
28
+ getGuildDropsAudit({ auth, guildId, platform }: AdminFunctionsInput['getGuildDropsAudit']): Promise<import("../types").WebResponse<GuildDropsAuditResponse>>;
29
+ getPubSubHealth({ auth, platform, channel, all }: AdminFunctionsInput['getPubSubHealth']): Promise<import("../types").WebResponse<PubSubHealthResponse>>;
30
+ getCooldowns({ auth, streamer, guildId, platform, page, limit }: AdminFunctionsInput['getCooldowns']): Promise<import("../types").WebResponse<CooldownsResponse>>;
31
+ getSystemHealth({ auth }: AdminFunctionsInput['getSystemHealth']): Promise<import("../types").WebResponse<SystemHealthResponse>>;
17
32
  }
18
33
  export type AdminFunctionsInput = {
19
34
  'getAdmin': {
@@ -62,6 +77,86 @@ export type AdminFunctionsInput = {
62
77
  name: NotificationProviderName;
63
78
  enabled: boolean;
64
79
  };
80
+ 'getFeatureFlags': {
81
+ auth: string;
82
+ };
83
+ 'setFeatureFlag': {
84
+ auth: string;
85
+ feature: FeatureName;
86
+ status: FeatureStatus;
87
+ };
88
+ 'listDropGames': {
89
+ auth: string;
90
+ page?: number;
91
+ limit?: number;
92
+ platform?: DropPlatform;
93
+ search?: string;
94
+ status?: 'enabled' | 'disabled' | 'all';
95
+ };
96
+ 'toggleDropGame': {
97
+ auth: string;
98
+ dbId: string;
99
+ ignored: boolean;
100
+ };
101
+ 'bulkToggleDropGames': {
102
+ auth: string;
103
+ ignored: boolean;
104
+ dbIds?: string[];
105
+ all?: boolean;
106
+ platform?: DropPlatform;
107
+ };
108
+ 'reconcileDropGames': {
109
+ auth: string;
110
+ keep: string[];
111
+ platform?: DropPlatform;
112
+ };
113
+ 'listDropCampaigns': {
114
+ auth: string;
115
+ page?: number;
116
+ limit?: number;
117
+ platform?: DropPlatform;
118
+ status?: string;
119
+ gameId?: string;
120
+ };
121
+ 'getDropsSettings': {
122
+ auth: string;
123
+ };
124
+ 'setDropsSettings': {
125
+ auth: string;
126
+ global?: boolean;
127
+ kick?: boolean;
128
+ twitch?: boolean;
129
+ };
130
+ 'getGuildVods': {
131
+ auth: string;
132
+ guildId: string;
133
+ page?: number;
134
+ limit?: number;
135
+ creator?: string;
136
+ enrich?: boolean;
137
+ };
138
+ 'getGuildDropsAudit': {
139
+ auth: string;
140
+ guildId: string;
141
+ platform?: DropPlatform;
142
+ };
143
+ 'getPubSubHealth': {
144
+ auth: string;
145
+ platform: 'youtube';
146
+ channel?: string;
147
+ all?: boolean;
148
+ };
149
+ 'getCooldowns': {
150
+ auth: string;
151
+ streamer?: string;
152
+ guildId?: string;
153
+ platform?: string;
154
+ page?: number;
155
+ limit?: number;
156
+ };
157
+ 'getSystemHealth': {
158
+ auth: string;
159
+ };
65
160
  };
66
161
  export type AdminGetReturnTypes = {
67
162
  'getAdminRaw': Awaited<ReturnType<APIAdmin['getAdmin']>>;
@@ -84,6 +179,34 @@ export type AdminGetReturnTypes = {
84
179
  'getNotificationProvidersSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getNotificationProviders']>>>;
85
180
  'setNotificationProviderRaw': Awaited<ReturnType<APIAdmin['setNotificationProvider']>>;
86
181
  'setNotificationProviderSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['setNotificationProvider']>>>;
182
+ 'getFeatureFlagsRaw': Awaited<ReturnType<APIAdmin['getFeatureFlags']>>;
183
+ 'getFeatureFlagsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getFeatureFlags']>>>;
184
+ 'setFeatureFlagRaw': Awaited<ReturnType<APIAdmin['setFeatureFlag']>>;
185
+ 'setFeatureFlagSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['setFeatureFlag']>>>;
186
+ 'listDropGamesRaw': Awaited<ReturnType<APIAdmin['listDropGames']>>;
187
+ 'listDropGamesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['listDropGames']>>>;
188
+ 'toggleDropGameRaw': Awaited<ReturnType<APIAdmin['toggleDropGame']>>;
189
+ 'toggleDropGameSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['toggleDropGame']>>>;
190
+ 'bulkToggleDropGamesRaw': Awaited<ReturnType<APIAdmin['bulkToggleDropGames']>>;
191
+ 'bulkToggleDropGamesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['bulkToggleDropGames']>>>;
192
+ 'reconcileDropGamesRaw': Awaited<ReturnType<APIAdmin['reconcileDropGames']>>;
193
+ 'reconcileDropGamesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['reconcileDropGames']>>>;
194
+ 'listDropCampaignsRaw': Awaited<ReturnType<APIAdmin['listDropCampaigns']>>;
195
+ 'listDropCampaignsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['listDropCampaigns']>>>;
196
+ 'getDropsSettingsRaw': Awaited<ReturnType<APIAdmin['getDropsSettings']>>;
197
+ 'getDropsSettingsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getDropsSettings']>>>;
198
+ 'setDropsSettingsRaw': Awaited<ReturnType<APIAdmin['setDropsSettings']>>;
199
+ 'setDropsSettingsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['setDropsSettings']>>>;
200
+ 'getGuildVodsRaw': Awaited<ReturnType<APIAdmin['getGuildVods']>>;
201
+ 'getGuildVodsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getGuildVods']>>>;
202
+ 'getGuildDropsAuditRaw': Awaited<ReturnType<APIAdmin['getGuildDropsAudit']>>;
203
+ 'getGuildDropsAuditSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getGuildDropsAudit']>>>;
204
+ 'getPubSubHealthRaw': Awaited<ReturnType<APIAdmin['getPubSubHealth']>>;
205
+ 'getPubSubHealthSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getPubSubHealth']>>>;
206
+ 'getCooldownsRaw': Awaited<ReturnType<APIAdmin['getCooldowns']>>;
207
+ 'getCooldownsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getCooldowns']>>>;
208
+ 'getSystemHealthRaw': Awaited<ReturnType<APIAdmin['getSystemHealth']>>;
209
+ 'getSystemHealthSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getSystemHealth']>>>;
87
210
  };
88
211
  export type NotificationProviderName = 'kick' | 'twitch' | 'rumble' | 'tiktok' | 'youtube' | 'vods' | 'clips' | 'gameDeal' | 'gameChangelog' | 'roblox';
89
212
  export type FixUrlRule = {
@@ -105,6 +228,16 @@ export type NotificationProviderStatus = {
105
228
  enabled: boolean;
106
229
  updatedAt: Date | null;
107
230
  };
231
+ export type FeatureFlag = {
232
+ feature: FeatureName;
233
+ status: FeatureStatus;
234
+ };
235
+ export type FeatureFlagStatus = {
236
+ feature: FeatureName;
237
+ label: string;
238
+ status: FeatureStatus;
239
+ updatedAt: string | null;
240
+ };
108
241
  export type EmailList = {
109
242
  userId: string;
110
243
  email: string;
@@ -161,3 +294,212 @@ export type AnalyticsData<T extends string = string> = {
161
294
  };
162
295
  };
163
296
  };
297
+ export type DropPlatform = 'kick' | 'twitch';
298
+ export type DropGameAdmin = {
299
+ dbId: string;
300
+ gameId: string;
301
+ platform: DropPlatform;
302
+ name: string;
303
+ slug: string | null;
304
+ imageUrl: string | null;
305
+ ignored: boolean;
306
+ dropCount: number;
307
+ };
308
+ export type DropGamesListResponse = {
309
+ games: DropGameAdmin[];
310
+ pagination: {
311
+ page: number;
312
+ limit: number;
313
+ totalGames: number;
314
+ totalPages: number;
315
+ hasMore: boolean;
316
+ hasPrevious: boolean;
317
+ };
318
+ summary: {
319
+ total: number;
320
+ enabled: number;
321
+ disabled: number;
322
+ };
323
+ };
324
+ export type DropGameToggleResult = {
325
+ dbId: string;
326
+ name: string;
327
+ platform: DropPlatform;
328
+ ignored: boolean;
329
+ };
330
+ export type DropGamesBulkResult = {
331
+ updated: number;
332
+ };
333
+ export type DropGamesReconcileResult = {
334
+ enabled: number;
335
+ disabled: number;
336
+ };
337
+ export type DropCampaign = {
338
+ dbId: string;
339
+ dropId: string;
340
+ platform: DropPlatform;
341
+ name: string;
342
+ status: string;
343
+ startsAt: Date;
344
+ endsAt: Date;
345
+ organizationName: string | null;
346
+ game: {
347
+ name: string;
348
+ slug: string | null;
349
+ } | null;
350
+ sentCount: number;
351
+ };
352
+ export type DropCampaignsListResponse = {
353
+ campaigns: DropCampaign[];
354
+ pagination: {
355
+ page: number;
356
+ limit: number;
357
+ total: number;
358
+ totalPages: number;
359
+ hasMore: boolean;
360
+ hasPrevious: boolean;
361
+ };
362
+ };
363
+ export type DropsPauseState = {
364
+ global: boolean;
365
+ kick: boolean;
366
+ twitch: boolean;
367
+ };
368
+ export type DropsSettingsResult = {
369
+ paused: DropsPauseState;
370
+ };
371
+ export type Pagination = {
372
+ page: number;
373
+ limit: number;
374
+ total: number;
375
+ totalPages: number;
376
+ hasMore: boolean;
377
+ hasPrevious: boolean;
378
+ };
379
+ export type GuildVod = {
380
+ key: string;
381
+ tempUrl: string | null;
382
+ urlExpiresAt: string | Date | null;
383
+ title: string | null;
384
+ streamDate: string | Date | null;
385
+ thumbnail: string | null;
386
+ vodInfo: {
387
+ streamer?: string;
388
+ title?: string;
389
+ startTime?: string;
390
+ duration?: number;
391
+ viewers?: number;
392
+ thumbnail?: string | null;
393
+ } | null;
394
+ };
395
+ export type GuildVodsResponse = {
396
+ guildId: string;
397
+ vods: GuildVod[];
398
+ pagination: Pagination;
399
+ };
400
+ export type GuildDropAuditItem = {
401
+ dbId: string;
402
+ dropId: string;
403
+ platform: DropPlatform;
404
+ name: string;
405
+ status: string;
406
+ startsAt: string | Date;
407
+ endsAt: string | Date;
408
+ game: {
409
+ name: string;
410
+ slug: string | null;
411
+ } | null;
412
+ sent: boolean;
413
+ notification: {
414
+ channelId: string | null;
415
+ messageId: string | null;
416
+ sentAt: string | Date;
417
+ } | null;
418
+ };
419
+ export type GuildDropsAuditResponse = {
420
+ guildId: string;
421
+ filters: {
422
+ platform: DropPlatform | 'all';
423
+ };
424
+ enabled: {
425
+ kick: boolean;
426
+ twitch: boolean;
427
+ };
428
+ summary: {
429
+ relevant: number;
430
+ sent: number;
431
+ pending: number;
432
+ };
433
+ drops: GuildDropAuditItem[];
434
+ };
435
+ export type PubSubSubscription = {
436
+ userId: string;
437
+ username?: string;
438
+ expiresAt?: number;
439
+ };
440
+ export type PubSubHealthResponse = {
441
+ platform: 'youtube';
442
+ total: number;
443
+ subscriptions: PubSubSubscription[];
444
+ } | {
445
+ platform: 'youtube';
446
+ channel: string;
447
+ subscribed: boolean;
448
+ subscription: PubSubSubscription | null;
449
+ };
450
+ export type Cooldown = {
451
+ key: string;
452
+ guildId: string;
453
+ platform: string;
454
+ streamerUsername: string;
455
+ cooldownSetAt: number;
456
+ expiresAt: number;
457
+ isExpired: boolean;
458
+ timeUntilExpiry: number;
459
+ };
460
+ export type CooldownsResponse = {
461
+ filters: {
462
+ streamer: string;
463
+ guildId: string;
464
+ platform: string;
465
+ };
466
+ cooldowns: Cooldown[];
467
+ pagination: Pagination;
468
+ truncated: boolean;
469
+ };
470
+ export type SystemHealthResponse = {
471
+ timestamp: string;
472
+ clusters: Array<{
473
+ clusterId: number;
474
+ rss: number;
475
+ heapUsed: number;
476
+ heapTotal: number;
477
+ guilds: number;
478
+ }>;
479
+ redis: {
480
+ notificationsCooldowns: number;
481
+ streamerCacheTotal: number;
482
+ activePromises: number;
483
+ streamerCacheByPlatform: Record<string, number>;
484
+ };
485
+ platforms: {
486
+ kick: {
487
+ workerLoad: number | null;
488
+ creating: number | null;
489
+ };
490
+ twitch: {
491
+ polling: boolean;
492
+ };
493
+ tiktok: {
494
+ polling: boolean;
495
+ circuitBreakerFailures: number;
496
+ };
497
+ youtube: {
498
+ active: boolean;
499
+ };
500
+ rumble: {
501
+ polling: boolean;
502
+ intervals: number;
503
+ };
504
+ };
505
+ };
@@ -76,5 +76,91 @@ class APIAdmin {
76
76
  endpoint: this.web.qp('/admin/providers/' + name),
77
77
  });
78
78
  }
79
+ async getFeatureFlags({ auth }) {
80
+ return await this.web.request({
81
+ method: 'GET', auth,
82
+ endpoint: this.web.qp('/admin/features'),
83
+ });
84
+ }
85
+ async setFeatureFlag({ auth, feature, status }) {
86
+ return await this.web.request({
87
+ method: 'PATCH', auth, body: { status },
88
+ endpoint: this.web.qp('/admin/features/' + feature),
89
+ });
90
+ }
91
+ // Game Drops admin — manage the global per-game ignore flag + the drops pause kill switch.
92
+ async listDropGames({ auth, page, limit, platform, search, status }) {
93
+ return await this.web.request({
94
+ method: 'GET', auth,
95
+ endpoint: this.web.qp('/admin/drops/games', { page, limit, platform, search, status }),
96
+ });
97
+ }
98
+ async toggleDropGame({ auth, dbId, ignored }) {
99
+ return await this.web.request({
100
+ method: 'PATCH', auth, body: { ignored },
101
+ endpoint: this.web.qp('/admin/drops/games/' + dbId),
102
+ });
103
+ }
104
+ async bulkToggleDropGames({ auth, ignored, dbIds, all, platform }) {
105
+ return await this.web.request({
106
+ method: 'PATCH', auth, body: { ignored, dbIds, all, platform },
107
+ endpoint: this.web.qp('/admin/drops/games/bulk'),
108
+ });
109
+ }
110
+ async reconcileDropGames({ auth, keep, platform }) {
111
+ return await this.web.request({
112
+ method: 'POST', auth, body: { keep, platform },
113
+ endpoint: this.web.qp('/admin/drops/games/reconcile'),
114
+ });
115
+ }
116
+ async listDropCampaigns({ auth, page, limit, platform, status, gameId }) {
117
+ return await this.web.request({
118
+ method: 'GET', auth,
119
+ endpoint: this.web.qp('/admin/drops/campaigns', { page, limit, platform, status, gameId }),
120
+ });
121
+ }
122
+ async getDropsSettings({ auth }) {
123
+ return await this.web.request({
124
+ method: 'GET', auth,
125
+ endpoint: this.web.qp('/admin/drops/settings'),
126
+ });
127
+ }
128
+ async setDropsSettings({ auth, global, kick, twitch }) {
129
+ return await this.web.request({
130
+ method: 'PATCH', auth, body: { global, kick, twitch },
131
+ endpoint: this.web.qp('/admin/drops/settings'),
132
+ });
133
+ }
134
+ // Read-only ops/support views (dashboard equivalents of the /metrics/* diagnostics).
135
+ async getGuildVods({ auth, guildId, page, limit, creator, enrich }) {
136
+ return await this.web.request({
137
+ method: 'GET', auth,
138
+ endpoint: this.web.qp(`/admin/guilds/${guildId}/vods`, { page, limit, creator, enrich }),
139
+ });
140
+ }
141
+ async getGuildDropsAudit({ auth, guildId, platform }) {
142
+ return await this.web.request({
143
+ method: 'GET', auth,
144
+ endpoint: this.web.qp(`/admin/guilds/${guildId}/drops`, { platform }),
145
+ });
146
+ }
147
+ async getPubSubHealth({ auth, platform, channel, all }) {
148
+ return await this.web.request({
149
+ method: 'GET', auth,
150
+ endpoint: this.web.qp(`/admin/pubsub/${platform}`, { channel, all }),
151
+ });
152
+ }
153
+ async getCooldowns({ auth, streamer, guildId, platform, page, limit }) {
154
+ return await this.web.request({
155
+ method: 'GET', auth,
156
+ endpoint: this.web.qp('/admin/cooldowns', { streamer, guildId, platform, page, limit }),
157
+ });
158
+ }
159
+ async getSystemHealth({ auth }) {
160
+ return await this.web.request({
161
+ method: 'GET', auth,
162
+ endpoint: this.web.qp('/admin/system/health'),
163
+ });
164
+ }
79
165
  }
80
166
  exports.APIAdmin = APIAdmin;
@@ -1,4 +1,4 @@
1
- import { AllPlatforms, KickStreamer, KickStreamerZod, RumbleStreamer, RumbleStreamerZod, TikTokStreamer, TikTokStreamerZod, TwitchStreamer, TwitchStreamerZod, YouTubeStreamer, YouTubeStreamerZod } from '../other/prisma';
1
+ import { AllPlatforms, ClubStreamer, ClubStreamerZod, KickStreamer, KickStreamerZod, RumbleStreamer, RumbleStreamerZod, TikTokStreamer, TikTokStreamerZod, TwitchStreamer, TwitchStreamerZod, YouTubeStreamer, YouTubeStreamerZod } from '../other/prisma';
2
2
  import { CancelOutWebResponses, DeepPartial } from '../types';
3
3
  import { WebDataManager } from '../core/manager';
4
4
  export declare class APIGuildPlatform {
@@ -77,8 +77,8 @@ export type UsersForLiveRole = {
77
77
  id: string;
78
78
  name: string;
79
79
  }[];
80
- export type GuildSingleStreamer<T extends AllPlatforms> = T extends 'kick' ? KickStreamerZod : T extends 'twitch' ? TwitchStreamerZod : T extends 'rumble' ? RumbleStreamerZod : T extends 'tiktok' ? TikTokStreamerZod : T extends 'youtube' ? YouTubeStreamerZod : never;
81
- export type GuildSingleStreamerWithFormatedRole<T extends AllPlatforms> = T extends 'kick' ? KickStreamer & UsersForLiveRole : T extends 'twitch' ? TwitchStreamer & UsersForLiveRole : T extends 'rumble' ? RumbleStreamer & UsersForLiveRole : T extends 'tiktok' ? TikTokStreamer & UsersForLiveRole : T extends 'youtube' ? YouTubeStreamerZod & UsersForLiveRole : never;
80
+ export type GuildSingleStreamer<T extends AllPlatforms> = T extends 'kick' ? KickStreamerZod : T extends 'twitch' ? TwitchStreamerZod : T extends 'rumble' ? RumbleStreamerZod : T extends 'tiktok' ? TikTokStreamerZod : T extends 'youtube' ? YouTubeStreamerZod : T extends 'club' ? ClubStreamerZod : never;
81
+ export type GuildSingleStreamerWithFormatedRole<T extends AllPlatforms> = T extends 'kick' ? KickStreamer & UsersForLiveRole : T extends 'twitch' ? TwitchStreamer & UsersForLiveRole : T extends 'rumble' ? RumbleStreamer & UsersForLiveRole : T extends 'tiktok' ? TikTokStreamer & UsersForLiveRole : T extends 'youtube' ? YouTubeStreamerZod & UsersForLiveRole : T extends 'club' ? ClubStreamer & UsersForLiveRole : never;
82
82
  export type Platformstreamers<T extends boolean, P extends AllPlatforms> = {
83
83
  streamers: T extends true ? P extends 'kick' ? {
84
84
  streamerUserName: string;
@@ -100,6 +100,9 @@ export type Platformstreamers<T extends boolean, P extends AllPlatforms> = {
100
100
  streamerUserName: string;
101
101
  streamerId: string;
102
102
  guildId: string | null;
103
+ }[] : P extends 'club' ? {
104
+ streamerUserName: string;
105
+ guildId: string;
103
106
  }[] : never : P extends 'kick' ? KickStreamer[] : P extends 'twitch' ? TwitchStreamer[] : P extends 'rumble' ? RumbleStreamer[] : P extends 'tiktok' ? TikTokStreamer[] : P extends 'youtube' ? YouTubeStreamer[] : never;
104
107
  currentTotal: number;
105
108
  maxLimit: number;
@@ -1,4 +1,4 @@
1
- import { AllPlatforms, KickStreamerZod, RumbleStreamerZod, TikTokStreamerZod, TwitchStreamerZod, YouTubeStreamerZod } from '../other/prisma';
1
+ import { AllPlatforms, ClubStreamerZod, KickStreamerZod, RumbleStreamerZod, TikTokStreamerZod, TwitchStreamerZod, YouTubeStreamerZod } from '../other/prisma';
2
2
  import { LeaderBoardTypesEnum, StreamerMessageTypeEnum } from '@prisma/client';
3
3
  import { RumbleType } from './guildPlatform';
4
4
  import { CancelOutWebResponses } from '../types';
@@ -80,7 +80,7 @@ export type PlatformActionReturnTypes = {
80
80
  'deleteKickStreamerRolesRaw': Awaited<ReturnType<APIPlatformAction['deleteKickStreamerRoles']>>;
81
81
  'deleteKickStreamerRolesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIPlatformAction['deleteKickStreamerRoles']>>>;
82
82
  };
83
- export type StreamerUpdateMessage = (KickStreamerZod | TwitchStreamerZod | RumbleStreamerZod | TikTokStreamerZod | YouTubeStreamerZod)['customMessages'][number];
83
+ export type StreamerUpdateMessage = (KickStreamerZod | TwitchStreamerZod | RumbleStreamerZod | TikTokStreamerZod | YouTubeStreamerZod | ClubStreamerZod)['customMessages'][number];
84
84
  export type KickRolesType = 'leaderboardSyncRoles' | 'giftedSubRoles';
85
85
  export type KickRolesSubType<T extends KickRolesType> = T extends 'leaderboardSyncRoles' ? LeaderBoardTypesEnum : T extends 'giftedSubRoles' ? string : never;
86
86
  export type KickRolesData<T extends KickRolesType> = T extends 'leaderboardSyncRoles' ? KickStreamerZod['leaderBoardSyncRoles'][number] : T extends 'giftedSubRoles' ? KickStreamerZod['giftedSubRoles'][number] : never;
@@ -68,6 +68,7 @@ export declare class APIGuildRolePanel {
68
68
  logChannelId: string | null;
69
69
  requireAccountAgeDays: number | null;
70
70
  requireJoinAgeDays: number | null;
71
+ requireMessageCount: number | null;
71
72
  boosterOnly: boolean | null;
72
73
  })[]>>;
73
74
  getGuildRolePanel({ auth, guildId, panelId }: GuildRolePanelFunctionsInput['getGuildRolePanel']): Promise<import("../types").WebResponse<{
@@ -134,6 +135,7 @@ export declare class APIGuildRolePanel {
134
135
  logChannelId: string | null;
135
136
  requireAccountAgeDays: number | null;
136
137
  requireJoinAgeDays: number | null;
138
+ requireMessageCount: number | null;
137
139
  boosterOnly: boolean | null;
138
140
  }>>;
139
141
  createRolePanel({ auth, guildId, body }: GuildRolePanelFunctionsInput['createRolePanel']): Promise<import("../types").WebResponse<string>>;
package/dist/index.d.ts CHANGED
@@ -28,5 +28,7 @@ export * from './classes/guildClipper';
28
28
  export * from './classes/guildMessageScheduler';
29
29
  export * from './classes/games';
30
30
  export { GuildMessageTypeEnum, StreamerMessageTypeEnum, PlatformEnum, $Enums } from './other/enums';
31
+ export { FEATURE_NAMES, } from './other/features';
32
+ export type { FeatureName, FeatureStatus, ResolvedFeature, } from './other/features';
31
33
  export type { Prisma, TSPrisma } from '@prisma/client';
32
- export type { ClientChangelog, Guild, User, Team, Member, KickStreamer, TwitchStreamer, YoutubeStreamer, TiktokStreamer, RumbleStreamer, GuildGiveaway, GuildRolePanel, GuildClipForward } from '@prisma/client';
34
+ export type { ClientChangelog, Guild, User, Team, Member, KickStreamer, TwitchStreamer, YoutubeStreamer, TiktokStreamer, RumbleStreamer, ClubStreamer, GuildGiveaway, GuildRolePanel, GuildClipForward } from '@prisma/client';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.$Enums = exports.PlatformEnum = exports.StreamerMessageTypeEnum = exports.GuildMessageTypeEnum = void 0;
17
+ exports.FEATURE_NAMES = exports.$Enums = exports.PlatformEnum = exports.StreamerMessageTypeEnum = exports.GuildMessageTypeEnum = void 0;
18
18
  __exportStar(require("./core/manager"), exports);
19
19
  __exportStar(require("./types"), exports);
20
20
  __exportStar(require("./classes/@me"), exports);
@@ -50,3 +50,6 @@ Object.defineProperty(exports, "GuildMessageTypeEnum", { enumerable: true, get:
50
50
  Object.defineProperty(exports, "StreamerMessageTypeEnum", { enumerable: true, get: function () { return enums_1.StreamerMessageTypeEnum; } });
51
51
  Object.defineProperty(exports, "PlatformEnum", { enumerable: true, get: function () { return enums_1.PlatformEnum; } });
52
52
  Object.defineProperty(exports, "$Enums", { enumerable: true, get: function () { return enums_1.$Enums; } });
53
+ // Re-export per-feature launch-gate types + constants.
54
+ var features_1 = require("./other/features");
55
+ Object.defineProperty(exports, "FEATURE_NAMES", { enumerable: true, get: function () { return features_1.FEATURE_NAMES; } });
@@ -94,6 +94,7 @@ export declare const GuildFeatures: {
94
94
  KickClipperSubscribe: bigint;
95
95
  KickClipForwarding: bigint;
96
96
  TwitchClipForwarding: bigint;
97
+ ClubNotifications: bigint;
97
98
  };
98
99
  export declare const GuildFeaturesText: Record<keyof typeof GuildFeatures, string>;
99
100
  export declare const UserFeatures: {
@@ -174,8 +175,9 @@ export declare class GuildFeaturesManager extends BitFieldManager<typeof GuildFe
174
175
  KickClipperSubscribe: bigint;
175
176
  KickClipForwarding: bigint;
176
177
  TwitchClipForwarding: bigint;
178
+ ClubNotifications: bigint;
177
179
  };
178
- t: Record<"StickyMessages" | "StatusRoles" | "Starboards" | "KickClips" | "BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "ManageBranding" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "KickClipForwarding" | "TwitchClipForwarding", string>;
180
+ t: Record<"StickyMessages" | "StatusRoles" | "Starboards" | "KickClips" | "BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "ManageBranding" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "KickClipForwarding" | "TwitchClipForwarding" | "ClubNotifications", string>;
179
181
  all: bigint;
180
182
  static b: {
181
183
  BaseSyncableRoles: bigint;
@@ -233,8 +235,9 @@ export declare class GuildFeaturesManager extends BitFieldManager<typeof GuildFe
233
235
  KickClipperSubscribe: bigint;
234
236
  KickClipForwarding: bigint;
235
237
  TwitchClipForwarding: bigint;
238
+ ClubNotifications: bigint;
236
239
  };
237
- static t: Record<"StickyMessages" | "StatusRoles" | "Starboards" | "KickClips" | "BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "ManageBranding" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "KickClipForwarding" | "TwitchClipForwarding", string>;
240
+ static t: Record<"StickyMessages" | "StatusRoles" | "Starboards" | "KickClips" | "BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "ManageBranding" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "KickClipForwarding" | "TwitchClipForwarding" | "ClubNotifications", string>;
238
241
  static all: bigint;
239
242
  convertBitToField<T extends EnumValues<typeof GuildFeatures>>(bit: T): string | null;
240
243
  }
@@ -179,6 +179,7 @@ exports.GuildFeatures = {
179
179
  KickClipperSubscribe: 1n << 61n,
180
180
  KickClipForwarding: 1n << 67n, // Premium: forward Kick native clips (Clip Forwarding).
181
181
  TwitchClipForwarding: 1n << 68n, // Premium: forward Twitch clips (Clip Forwarding).
182
+ ClubNotifications: 1n << 69n, // New-post notifications for a followed Club (club.com) user.
182
183
  };
183
184
  exports.GuildFeaturesText = {
184
185
  BaseSyncableRoles: 'Basic Syncable Roles',
@@ -236,6 +237,7 @@ exports.GuildFeaturesText = {
236
237
  KickClipperSubscribe: 'Kick Clipper Subscription',
237
238
  KickClipForwarding: 'Kick Clip Forwarding',
238
239
  TwitchClipForwarding: 'Twitch Clip Forwarding',
240
+ ClubNotifications: 'Club Notifications',
239
241
  };
240
242
  exports.UserFeatures = {
241
243
  HasOneServerPremium: 1n << 0n,