@notidotbot/noti-api-client 1.5.7 → 1.6.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.
@@ -40,15 +40,15 @@ export declare class APIClient {
40
40
  content: string;
41
41
  thumbnail: string | null;
42
42
  authorIcon: string;
43
+ createdAt: Date;
44
+ tags: string[];
43
45
  clientId: string;
44
46
  identifier: string;
45
47
  isPinned: boolean;
46
48
  views: number | null;
47
49
  reactions: string[];
48
50
  reactionsCount: number | null;
49
- tags: string[];
50
51
  authorName: string;
51
- createdAt: Date;
52
52
  lastEdited: Date;
53
53
  isPublic: boolean;
54
54
  }[]>>;
@@ -3,7 +3,7 @@ import { CancelOutWebResponses, WebResponse } from '../types';
3
3
  export type GameStore = 'steam' | 'epic' | 'gog' | 'prime';
4
4
  export type GameKind = 'free_game' | 'free_dlc_or_loot' | 'discount' | 'upcoming_free';
5
5
  export type GameDiscountTier = '100' | '90_plus' | '75_plus' | '50_plus' | '33_plus' | 'under_33';
6
- export type GameDelivery = 'instant' | 'daily' | 'weekly';
6
+ export type GameDelivery = 'instant' | 'window' | 'scheduled';
7
7
  export type GameFlag = 'freeWeekend' | 'allTimeLow' | 'featured' | 'aaa' | 'earlyAccess';
8
8
  export type GameSourceId = 'epic_free' | 'cheapshark' | 'steam_featured' | 'gamerpower' | 'watchlist' | 'steam_weekend';
9
9
  export interface DealPrice {
@@ -257,9 +257,15 @@ export interface GameConfig {
257
257
  enabled: boolean;
258
258
  notificationChannelId: string | null;
259
259
  pingRoleId: string | null;
260
+ /** Delivery schedule (non-instant is premium). All hours are evaluated in the guild's `timezone`. */
260
261
  deliveryMode: GameDelivery;
261
- digestHourUTC: number | null;
262
- digestWeekday: number | null;
262
+ /** `window` mode: send instantly inside [windowStartHour, windowEndHour); hold + batch outside until it opens. */
263
+ windowStartHour: number | null;
264
+ windowEndHour: number | null;
265
+ /** `scheduled` mode: hold every event and flush the batch at each of these hours (0–23). */
266
+ scheduledHours: number[];
267
+ /** `scheduled` mode: restrict flushes to these weekdays (0=Sun … 6=Sat). Empty = every day. */
268
+ scheduledWeekdays: number[];
263
269
  freeGamesEnabled: boolean;
264
270
  /** Master switch for free DLC/loot alerts. `freeDlcStores` narrows it (empty = all stores). */
265
271
  freeDlcEnabled: boolean;
@@ -308,6 +314,8 @@ export interface GameEntitlements {
308
314
  }
309
315
  export interface GameConfigResponse {
310
316
  config: GameConfig;
317
+ /** Guild-wide IANA timezone (default `UTC`) that digest/scheduled sends are evaluated against. */
318
+ timezone: string;
311
319
  entitlements: GameEntitlements;
312
320
  }
313
321
  export interface GameSourceHealth {
@@ -431,6 +439,7 @@ export type GamesFunctionsInput = {
431
439
  updateConfig: {
432
440
  auth: string;
433
441
  guildId: string;
442
+ timezone?: string;
434
443
  } & Partial<Omit<GameConfig, 'guildId' | 'categoryRoutes' | 'trackedGames' | 'changelogGames' | 'robloxGames'>>;
435
444
  updateTrackedGames: {
436
445
  auth: string;
@@ -1,10 +1,11 @@
1
1
  import { WebDataManager } from '../core/manager';
2
2
  import { CancelOutWebResponses, WebResponse } from '../types';
3
+ export type DeliveryMode = 'instant' | 'window' | 'scheduled';
3
4
  export declare class APIGuildDrops {
4
5
  private web;
5
6
  constructor(web: WebDataManager);
6
7
  getGuildDrops({ auth, guildId }: GuildDropsFunctionsInput['getGuildDrops']): Promise<WebResponse<GuildDropsData>>;
7
- updateGuildDrops({ auth, guildId, kickEnabled, twitchEnabled, kickLiveNotifications, twitchLiveNotifications, kickChannelId, twitchChannelId, kickRoleId, twitchRoleId, kickLiveNotificationChannelId, kickLiveNotificationRoleId, twitchLiveNotificationChannelId, twitchLiveNotificationRoleId, webhook, games }: GuildDropsFunctionsInput['updateGuildDrops']): Promise<WebResponse<GuildDropsData>>;
8
+ updateGuildDrops({ auth, guildId, timezone, kickDeliveryMode, kickWindowStartHour, kickWindowEndHour, kickScheduledHours, kickScheduledWeekdays, twitchDeliveryMode, twitchWindowStartHour, twitchWindowEndHour, twitchScheduledHours, twitchScheduledWeekdays, kickEnabled, twitchEnabled, kickLiveNotifications, twitchLiveNotifications, kickChannelId, twitchChannelId, kickRoleId, twitchRoleId, kickLiveNotificationChannelId, kickLiveNotificationRoleId, twitchLiveNotificationChannelId, twitchLiveNotificationRoleId, webhook, games }: GuildDropsFunctionsInput['updateGuildDrops']): Promise<WebResponse<GuildDropsData>>;
8
9
  }
9
10
  export type GuildDropsFunctionsInput = {
10
11
  'getGuildDrops': {
@@ -14,6 +15,17 @@ export type GuildDropsFunctionsInput = {
14
15
  'updateGuildDrops': {
15
16
  auth: string;
16
17
  guildId: string;
18
+ timezone?: string;
19
+ kickDeliveryMode?: DeliveryMode;
20
+ kickWindowStartHour?: number | null;
21
+ kickWindowEndHour?: number | null;
22
+ kickScheduledHours?: number[];
23
+ kickScheduledWeekdays?: number[];
24
+ twitchDeliveryMode?: DeliveryMode;
25
+ twitchWindowStartHour?: number | null;
26
+ twitchWindowEndHour?: number | null;
27
+ twitchScheduledHours?: number[];
28
+ twitchScheduledWeekdays?: number[];
17
29
  kickEnabled?: boolean;
18
30
  twitchEnabled?: boolean;
19
31
  kickLiveNotifications?: boolean;
@@ -66,6 +78,17 @@ export type GameDropConfig = {
66
78
  webhook: WebhookConfig | null;
67
79
  };
68
80
  export type GuildDropsData = {
81
+ timezone: string;
82
+ kickDeliveryMode: DeliveryMode;
83
+ kickWindowStartHour: number | null;
84
+ kickWindowEndHour: number | null;
85
+ kickScheduledHours: number[];
86
+ kickScheduledWeekdays: number[];
87
+ twitchDeliveryMode: DeliveryMode;
88
+ twitchWindowStartHour: number | null;
89
+ twitchWindowEndHour: number | null;
90
+ twitchScheduledHours: number[];
91
+ twitchScheduledWeekdays: number[];
69
92
  kickEnabled: boolean;
70
93
  twitchEnabled: boolean;
71
94
  kickLiveNotifications: boolean;
@@ -14,11 +14,22 @@ class APIGuildDrops {
14
14
  endpoint: this.web.qp(`/data/guild/${guildId}/drops`),
15
15
  });
16
16
  }
17
- async updateGuildDrops({ auth, guildId, kickEnabled, twitchEnabled, kickLiveNotifications, twitchLiveNotifications, kickChannelId, twitchChannelId, kickRoleId, twitchRoleId, kickLiveNotificationChannelId, kickLiveNotificationRoleId, twitchLiveNotificationChannelId, twitchLiveNotificationRoleId, webhook, games }) {
17
+ async updateGuildDrops({ auth, guildId, timezone, kickDeliveryMode, kickWindowStartHour, kickWindowEndHour, kickScheduledHours, kickScheduledWeekdays, twitchDeliveryMode, twitchWindowStartHour, twitchWindowEndHour, twitchScheduledHours, twitchScheduledWeekdays, kickEnabled, twitchEnabled, kickLiveNotifications, twitchLiveNotifications, kickChannelId, twitchChannelId, kickRoleId, twitchRoleId, kickLiveNotificationChannelId, kickLiveNotificationRoleId, twitchLiveNotificationChannelId, twitchLiveNotificationRoleId, webhook, games }) {
18
18
  return await this.web.request({
19
19
  method: 'PATCH', auth,
20
20
  endpoint: this.web.qp(`/data/guild/${guildId}/drops`),
21
21
  body: {
22
+ timezone,
23
+ kickDeliveryMode,
24
+ kickWindowStartHour,
25
+ kickWindowEndHour,
26
+ kickScheduledHours,
27
+ kickScheduledWeekdays,
28
+ twitchDeliveryMode,
29
+ twitchWindowStartHour,
30
+ twitchWindowEndHour,
31
+ twitchScheduledHours,
32
+ twitchScheduledWeekdays,
22
33
  kickEnabled,
23
34
  twitchEnabled,
24
35
  kickLiveNotifications,
@@ -0,0 +1,93 @@
1
+ import { GuildScheduledMessage } from '../other/prisma';
2
+ import { WebDataManager } from '../core/manager';
3
+ import { CancelOutWebResponses, WebResponse } from '../types';
4
+ export type ScheduledMessageTrigger = 'time' | 'stage' | 'guildEvent';
5
+ export type ScheduledMessageRecurrence = 'once' | 'daily' | 'weekly' | 'days' | 'interval';
6
+ export type ScheduledMessageTiming = 'on' | 'before';
7
+ export declare class APIGuildMessageScheduler {
8
+ private web;
9
+ constructor(web: WebDataManager);
10
+ getScheduledMessages({ auth, guildId }: GuildMessageSchedulerFunctionsInput['getScheduledMessages']): Promise<WebResponse<ScheduledMessageData[]>>;
11
+ getScheduledMessage({ auth, guildId, messageId }: GuildMessageSchedulerFunctionsInput['getScheduledMessage']): Promise<WebResponse<ScheduledMessageData>>;
12
+ createScheduledMessage({ auth, guildId, body }: GuildMessageSchedulerFunctionsInput['createScheduledMessage']): Promise<WebResponse<CreateScheduledMessageResponse>>;
13
+ editScheduledMessage({ auth, guildId, messageId, body }: GuildMessageSchedulerFunctionsInput['editScheduledMessage']): Promise<WebResponse<string>>;
14
+ pauseScheduledMessage({ auth, guildId, messageId }: GuildMessageSchedulerFunctionsInput['pauseScheduledMessage']): Promise<WebResponse<string>>;
15
+ resumeScheduledMessage({ auth, guildId, messageId }: GuildMessageSchedulerFunctionsInput['resumeScheduledMessage']): Promise<WebResponse<string>>;
16
+ deleteScheduledMessage({ auth, guildId, messageId }: GuildMessageSchedulerFunctionsInput['deleteScheduledMessage']): Promise<WebResponse<string>>;
17
+ }
18
+ export type GuildMessageSchedulerFunctionsInput = {
19
+ 'getScheduledMessages': {
20
+ auth: string;
21
+ guildId: string;
22
+ };
23
+ 'getScheduledMessage': {
24
+ auth: string;
25
+ guildId: string;
26
+ messageId: string;
27
+ };
28
+ 'createScheduledMessage': {
29
+ auth: string;
30
+ guildId: string;
31
+ body: ScheduledMessageCreateBody;
32
+ };
33
+ 'editScheduledMessage': {
34
+ auth: string;
35
+ guildId: string;
36
+ messageId: string;
37
+ body: ScheduledMessageEditBody;
38
+ };
39
+ 'pauseScheduledMessage': {
40
+ auth: string;
41
+ guildId: string;
42
+ messageId: string;
43
+ };
44
+ 'resumeScheduledMessage': {
45
+ auth: string;
46
+ guildId: string;
47
+ messageId: string;
48
+ };
49
+ 'deleteScheduledMessage': {
50
+ auth: string;
51
+ guildId: string;
52
+ messageId: string;
53
+ };
54
+ };
55
+ export type GuildMessageSchedulerReturnTypes = {
56
+ 'getScheduledMessagesRaw': Awaited<ReturnType<APIGuildMessageScheduler['getScheduledMessages']>>;
57
+ 'getScheduledMessagesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildMessageScheduler['getScheduledMessages']>>>;
58
+ 'getScheduledMessageRaw': Awaited<ReturnType<APIGuildMessageScheduler['getScheduledMessage']>>;
59
+ 'getScheduledMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildMessageScheduler['getScheduledMessage']>>>;
60
+ 'createScheduledMessageRaw': Awaited<ReturnType<APIGuildMessageScheduler['createScheduledMessage']>>;
61
+ 'createScheduledMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildMessageScheduler['createScheduledMessage']>>>;
62
+ 'editScheduledMessageRaw': Awaited<ReturnType<APIGuildMessageScheduler['editScheduledMessage']>>;
63
+ 'editScheduledMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildMessageScheduler['editScheduledMessage']>>>;
64
+ 'pauseScheduledMessageRaw': Awaited<ReturnType<APIGuildMessageScheduler['pauseScheduledMessage']>>;
65
+ 'pauseScheduledMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildMessageScheduler['pauseScheduledMessage']>>>;
66
+ 'resumeScheduledMessageRaw': Awaited<ReturnType<APIGuildMessageScheduler['resumeScheduledMessage']>>;
67
+ 'resumeScheduledMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildMessageScheduler['resumeScheduledMessage']>>>;
68
+ 'deleteScheduledMessageRaw': Awaited<ReturnType<APIGuildMessageScheduler['deleteScheduledMessage']>>;
69
+ 'deleteScheduledMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildMessageScheduler['deleteScheduledMessage']>>>;
70
+ };
71
+ export type ScheduledMessageData = GuildScheduledMessage & {
72
+ schedule: string;
73
+ };
74
+ export type CreateScheduledMessageResponse = {
75
+ messageId: string;
76
+ nextRunAt: Date | null;
77
+ };
78
+ export type ScheduledMessageCreateBody = {
79
+ channelId: string;
80
+ content: string;
81
+ trigger?: ScheduledMessageTrigger;
82
+ recurrence?: ScheduledMessageRecurrence;
83
+ daysOfWeek?: number[];
84
+ intervalMinutes?: number | null;
85
+ time?: string | null;
86
+ date?: string | null;
87
+ eventId?: string | null;
88
+ timing?: ScheduledMessageTiming | null;
89
+ offsetMinutes?: number | null;
90
+ };
91
+ export type ScheduledMessageEditBody = {
92
+ content: string;
93
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APIGuildMessageScheduler = void 0;
4
+ // Data.
5
+ class APIGuildMessageScheduler {
6
+ web;
7
+ constructor(web) {
8
+ this.web = web;
9
+ }
10
+ // Methods.
11
+ async getScheduledMessages({ auth, guildId }) {
12
+ return await this.web.request({
13
+ method: 'GET', auth,
14
+ endpoint: this.web.qp(`/data/scheduledMessages/${guildId}`),
15
+ });
16
+ }
17
+ async getScheduledMessage({ auth, guildId, messageId }) {
18
+ return await this.web.request({
19
+ method: 'GET', auth,
20
+ endpoint: this.web.qp(`/data/scheduledMessages/${guildId}/${messageId}`),
21
+ });
22
+ }
23
+ async createScheduledMessage({ auth, guildId, body }) {
24
+ return await this.web.request({
25
+ method: 'POST', auth, body,
26
+ endpoint: this.web.qp(`/data/scheduledMessages/${guildId}`),
27
+ });
28
+ }
29
+ async editScheduledMessage({ auth, guildId, messageId, body }) {
30
+ return await this.web.request({
31
+ method: 'PATCH', auth, body,
32
+ endpoint: this.web.qp(`/data/scheduledMessages/${guildId}/${messageId}`),
33
+ });
34
+ }
35
+ async pauseScheduledMessage({ auth, guildId, messageId }) {
36
+ return await this.web.request({
37
+ method: 'POST', auth,
38
+ endpoint: this.web.qp(`/data/scheduledMessages/${guildId}/${messageId}/pause`),
39
+ });
40
+ }
41
+ async resumeScheduledMessage({ auth, guildId, messageId }) {
42
+ return await this.web.request({
43
+ method: 'POST', auth,
44
+ endpoint: this.web.qp(`/data/scheduledMessages/${guildId}/${messageId}/resume`),
45
+ });
46
+ }
47
+ async deleteScheduledMessage({ auth, guildId, messageId }) {
48
+ return await this.web.request({
49
+ method: 'DELETE', auth,
50
+ endpoint: this.web.qp(`/data/scheduledMessages/${guildId}/${messageId}`),
51
+ });
52
+ }
53
+ }
54
+ exports.APIGuildMessageScheduler = APIGuildMessageScheduler;
@@ -9,9 +9,9 @@ export declare class APIGuildStarboard {
9
9
  dbId: string;
10
10
  guildStarboardId: string;
11
11
  roles: string[];
12
- channels: string[];
13
12
  roleMode: import("@prisma/client").$Enums.FilterEnum | null;
14
13
  channelMode: import("@prisma/client").$Enums.FilterEnum | null;
14
+ channels: string[];
15
15
  } | null;
16
16
  } & {
17
17
  dbId: string;
@@ -1,3 +1,4 @@
1
+ import { APIGuildMessageScheduler } from '../classes/guildMessageScheduler';
1
2
  import { APIPlatformAction } from '../classes/guildPlatformAction';
2
3
  import { APIGuildStarboard } from '../classes/guildStarboard';
3
4
  import { APIGuildFixURL } from '../classes/guildFixURL';
@@ -52,6 +53,7 @@ export declare class WebDataManager {
52
53
  readonly guildPlatformAction: APIPlatformAction;
53
54
  readonly guildFixURL: APIGuildFixURL;
54
55
  readonly guildClipper: APIGuildClipper;
56
+ readonly guildMessageScheduler: APIGuildMessageScheduler;
55
57
  readonly games: APIGames;
56
58
  constructor(url: string, options?: {
57
59
  log?: boolean;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.WebDataManager = void 0;
7
+ const guildMessageScheduler_1 = require("../classes/guildMessageScheduler");
7
8
  const guildPlatformAction_1 = require("../classes/guildPlatformAction");
8
9
  const guildStarboard_1 = require("../classes/guildStarboard");
9
10
  const guildFixURL_1 = require("../classes/guildFixURL");
@@ -56,6 +57,7 @@ class WebDataManager {
56
57
  guildPlatformAction = new guildPlatformAction_1.APIPlatformAction(this);
57
58
  guildFixURL = new guildFixURL_1.APIGuildFixURL(this);
58
59
  guildClipper = new guildClipper_1.APIGuildClipper(this);
60
+ guildMessageScheduler = new guildMessageScheduler_1.APIGuildMessageScheduler(this);
59
61
  games = new games_1.APIGames(this);
60
62
  constructor(url, options) {
61
63
  this.url = url;
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from './classes/guildStarboard';
23
23
  export * from './classes/guildPlatformAction';
24
24
  export * from './classes/guildFixURL';
25
25
  export * from './classes/guildClipper';
26
+ export * from './classes/guildMessageScheduler';
26
27
  export * from './classes/games';
27
28
  export { GuildMessageTypeEnum, StreamerMessageTypeEnum, PlatformEnum, $Enums } from './other/enums';
28
29
  export type { Prisma, TSPrisma } from '@prisma/client';
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ __exportStar(require("./classes/guildStarboard"), exports);
40
40
  __exportStar(require("./classes/guildPlatformAction"), exports);
41
41
  __exportStar(require("./classes/guildFixURL"), exports);
42
42
  __exportStar(require("./classes/guildClipper"), exports);
43
+ __exportStar(require("./classes/guildMessageScheduler"), exports);
43
44
  __exportStar(require("./classes/games"), exports);
44
45
  // Re-export Prisma generated enums (browser-safe)
45
46
  var enums_1 = require("./other/enums");
@@ -128,6 +128,18 @@ export declare const UserNotificationSeverityEnum: {
128
128
  readonly warning: "warning";
129
129
  readonly emergency: "emergency";
130
130
  };
131
+ export declare const ScheduledMessageRecurrenceEnum: {
132
+ readonly once: "once";
133
+ readonly daily: "daily";
134
+ readonly weekly: "weekly";
135
+ readonly days: "days";
136
+ readonly interval: "interval";
137
+ };
138
+ export declare const ScheduledMessageTriggerEnum: {
139
+ readonly time: "time";
140
+ readonly stage: "stage";
141
+ readonly guildEvent: "guildEvent";
142
+ };
131
143
  export declare const $Enums: {
132
144
  readonly LeaderBoardTypesEnum: {
133
145
  readonly weekly: "weekly";
@@ -259,5 +271,17 @@ export declare const $Enums: {
259
271
  readonly warning: "warning";
260
272
  readonly emergency: "emergency";
261
273
  };
274
+ readonly ScheduledMessageRecurrenceEnum: {
275
+ readonly once: "once";
276
+ readonly daily: "daily";
277
+ readonly weekly: "weekly";
278
+ readonly days: "days";
279
+ readonly interval: "interval";
280
+ };
281
+ readonly ScheduledMessageTriggerEnum: {
282
+ readonly time: "time";
283
+ readonly stage: "stage";
284
+ readonly guildEvent: "guildEvent";
285
+ };
262
286
  };
263
287
  export type $EnumsType = typeof $Enums;
@@ -3,7 +3,7 @@
3
3
  // These mirror the Prisma enums and provide plain JS objects/arrays so the
4
4
  // docs/client code can safely import them during bundling.
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.$Enums = exports.UserNotificationSeverityEnum = exports.RoleBonusEnum = exports.MediaShareCommandsEnum = exports.MediaShareTypesEnum = exports.FilterEnum = exports.QueryInEnum = exports.RumbleTypeEnum = exports.PlatformsWithVideosEnum = exports.UserMediaSharePermissionsEnum = exports.ClipperCategoryEnum = exports.PlatformEnum = exports.OverridesEnum = exports.GuildSingleMessageTypeEnum = exports.GuildMessageTypeEnum = exports.StreamerMessageTypeEnum = exports.SingleMessageTypeEnum = exports.LeaderBoardTypesEnum = void 0;
6
+ exports.$Enums = exports.ScheduledMessageTriggerEnum = exports.ScheduledMessageRecurrenceEnum = exports.UserNotificationSeverityEnum = exports.RoleBonusEnum = exports.MediaShareCommandsEnum = exports.MediaShareTypesEnum = exports.FilterEnum = exports.QueryInEnum = exports.RumbleTypeEnum = exports.PlatformsWithVideosEnum = exports.UserMediaSharePermissionsEnum = exports.ClipperCategoryEnum = exports.PlatformEnum = exports.OverridesEnum = exports.GuildSingleMessageTypeEnum = exports.GuildMessageTypeEnum = exports.StreamerMessageTypeEnum = exports.SingleMessageTypeEnum = exports.LeaderBoardTypesEnum = void 0;
7
7
  exports.LeaderBoardTypesEnum = {
8
8
  weekly: 'weekly',
9
9
  monthly: 'monthly',
@@ -135,6 +135,18 @@ exports.UserNotificationSeverityEnum = {
135
135
  warning: 'warning',
136
136
  emergency: 'emergency',
137
137
  };
138
+ exports.ScheduledMessageRecurrenceEnum = {
139
+ once: 'once',
140
+ daily: 'daily',
141
+ weekly: 'weekly',
142
+ days: 'days',
143
+ interval: 'interval',
144
+ };
145
+ exports.ScheduledMessageTriggerEnum = {
146
+ time: 'time',
147
+ stage: 'stage',
148
+ guildEvent: 'guildEvent',
149
+ };
138
150
  exports.$Enums = {
139
151
  LeaderBoardTypesEnum: exports.LeaderBoardTypesEnum,
140
152
  SingleMessageTypeEnum: exports.SingleMessageTypeEnum,
@@ -153,4 +165,6 @@ exports.$Enums = {
153
165
  MediaShareCommandsEnum: exports.MediaShareCommandsEnum,
154
166
  RoleBonusEnum: exports.RoleBonusEnum,
155
167
  UserNotificationSeverityEnum: exports.UserNotificationSeverityEnum,
168
+ ScheduledMessageRecurrenceEnum: exports.ScheduledMessageRecurrenceEnum,
169
+ ScheduledMessageTriggerEnum: exports.ScheduledMessageTriggerEnum,
156
170
  };
@@ -13,6 +13,7 @@ import { MemberZod } from './zod/member.zod';
13
13
  import { ClientZod } from './zod/client.zod';
14
14
  import { GuildZod } from './zod/guild.zod';
15
15
  import { GameConfigZod } from './zod/gameConfig.zod';
16
+ import { ScheduledMessageZod } from './zod/scheduledMessage.zod';
16
17
  import { DropsZod } from './zod/drops.zod';
17
18
  import { UserZod } from './zod/user.zod';
18
19
  import { TeamZod } from './zod/team.zod';
@@ -39,6 +40,7 @@ export type GuildDropsWebhook = TSPrisma.TSPrismaModelsFull['GuildDropsWebhook']
39
40
  export type GuildDropsGame = TSPrisma.TSPrismaModelsFull['GuildDropsGame'];
40
41
  export type GuildDropsGameWebhook = TSPrisma.TSPrismaModelsFull['GuildDropsGameWebhook'];
41
42
  export type SentDrop = TSPrisma.TSPrismaModelsFull['SentDrop'];
43
+ export type GuildScheduledMessage = TSPrisma.TSPrismaModelsFull['GuildScheduledMessage'];
42
44
  export type TeamZod = z.infer<typeof TeamZod.TeamSchema>;
43
45
  export type UserZod = z.infer<typeof UserZod.UserSchema>;
44
46
  export type GuildZod = z.infer<typeof GuildZod.GuildSchema>;
@@ -64,6 +66,9 @@ export type GameConfigZod = z.infer<typeof GameConfigZod.GuildGameConfigSchema>;
64
66
  export type GuildGameCategoryRouteZod = z.infer<typeof GameConfigZod.GuildGameCategoryRouteSchema>;
65
67
  export type GuildTrackedGameZod = z.infer<typeof GameConfigZod.GuildTrackedGameSchema>;
66
68
  export type GuildGameChangelogZod = z.infer<typeof GameConfigZod.GuildGameChangelogSchema>;
69
+ export type GuildScheduledMessageZod = z.infer<typeof ScheduledMessageZod.GuildScheduledMessageSchema>;
70
+ export type ScheduledMessageCreateZod = z.infer<typeof ScheduledMessageZod.ScheduledMessageCreateSchema>;
71
+ export type ScheduledMessageEditZod = z.infer<typeof ScheduledMessageZod.ScheduledMessageEditSchema>;
67
72
  export type AllPlatforms = (typeof PlatformEnum)[keyof typeof PlatformEnum];
68
73
  export type AllPlatformsWithVideos = Enums['PlatformsWithVideosEnum'];
69
74
  export type PlatformsToLinkType = typeof PlatformsToLink[number];
@@ -53,6 +53,17 @@ const GuildDropsSchema = zod_2.z.object({
53
53
  kickLiveNotificationRoleId: zod_2.z.string().nullable(),
54
54
  twitchLiveNotificationChannelId: zod_2.z.string().nullable(),
55
55
  twitchLiveNotificationRoleId: zod_2.z.string().nullable(),
56
+ // Independent per-platform delivery schedule (hours in the guild timezone).
57
+ kickDeliveryMode: schema_zod_1.NotificationDeliveryEnum,
58
+ kickWindowStartHour: zod_2.z.number().min(0).max(23).nullable(),
59
+ kickWindowEndHour: zod_2.z.number().min(0).max(23).nullable(),
60
+ kickScheduledHours: zod_2.z.array(zod_2.z.number().min(0).max(23)),
61
+ kickScheduledWeekdays: zod_2.z.array(zod_2.z.number().min(0).max(6)),
62
+ twitchDeliveryMode: schema_zod_1.NotificationDeliveryEnum,
63
+ twitchWindowStartHour: zod_2.z.number().min(0).max(23).nullable(),
64
+ twitchWindowEndHour: zod_2.z.number().min(0).max(23).nullable(),
65
+ twitchScheduledHours: zod_2.z.array(zod_2.z.number().min(0).max(23)),
66
+ twitchScheduledWeekdays: zod_2.z.array(zod_2.z.number().min(0).max(6)),
56
67
  games: zod_2.z.array(zod_2.z.lazy(() => GuildDropsGameSchema)),
57
68
  webhook: zod_2.z.lazy(() => GuildDropsWebhookSchema).nullable(),
58
69
  createdAt: zod_2.z.date(),
@@ -11,12 +11,14 @@ export declare const GameConfigZod: {
11
11
  notificationChannelId: z.ZodNullable<z.ZodString>;
12
12
  pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
13
13
  deliveryMode: z.ZodEnum<{
14
- weekly: "weekly";
15
14
  instant: "instant";
16
- daily: "daily";
15
+ window: "window";
16
+ scheduled: "scheduled";
17
17
  }>;
18
- digestHourUTC: z.ZodNullable<z.ZodNumber>;
19
- digestWeekday: z.ZodNullable<z.ZodNumber>;
18
+ windowStartHour: z.ZodNullable<z.ZodNumber>;
19
+ windowEndHour: z.ZodNullable<z.ZodNumber>;
20
+ scheduledHours: z.ZodArray<z.ZodNumber>;
21
+ scheduledWeekdays: z.ZodArray<z.ZodNumber>;
20
22
  freeGamesEnabled: z.ZodBoolean;
21
23
  freeDlcEnabled: z.ZodBoolean;
22
24
  freeDlcStores: z.ZodArray<z.ZodEnum<{
@@ -58,10 +58,12 @@ const GuildGameConfigSchema = zod_2.z.object({
58
58
  // Default routing — the free-tier "one channel + one mention role" target.
59
59
  notificationChannelId: zod_1.SnowFlake.nullable(),
60
60
  pingRoleId: zod_1.SnowFlakeOrEveryone.nullable(),
61
- // Delivery tier. Window/day customization is premium; free guilds get the default window.
62
- deliveryMode: schema_zod_1.GameDeliveryEnum,
63
- digestHourUTC: zod_2.z.number().min(0).max(23).nullable(),
64
- digestWeekday: zod_2.z.number().min(0).max(6).nullable(),
61
+ // Delivery schedule (non-instant is premium). Hours are evaluated in the guild timezone.
62
+ deliveryMode: schema_zod_1.NotificationDeliveryEnum,
63
+ windowStartHour: zod_2.z.number().min(0).max(23).nullable(),
64
+ windowEndHour: zod_2.z.number().min(0).max(23).nullable(),
65
+ scheduledHours: zod_2.z.array(zod_2.z.number().min(0).max(23)),
66
+ scheduledWeekdays: zod_2.z.array(zod_2.z.number().min(0).max(6)),
65
67
  // Free-to-keep games (always free-tier), upcoming freebies, and Steam play-free weekends.
66
68
  // Each `*Enabled` boolean is the master switch; the matching `*Stores` array narrows the
67
69
  // type to specific stores (empty = all, same as freeGameStores).
@@ -8,6 +8,7 @@ export declare const GuildZod: {
8
8
  readonly GuildSchema: z.ZodObject<{
9
9
  guildId: z.ZodString;
10
10
  locale: z.ZodString;
11
+ timezone: z.ZodString;
11
12
  blacklisted: z.ZodBoolean;
12
13
  leftAt: z.ZodNullable<z.ZodDate>;
13
14
  premium: z.ZodNullable<z.ZodLazy<z.ZodObject<{
@@ -7,6 +7,7 @@ const zod_2 = require("zod");
7
7
  const GuildSchema = zod_2.z.object({
8
8
  guildId: zod_1.SnowFlake,
9
9
  locale: zod_2.z.string(),
10
+ timezone: zod_2.z.string(),
10
11
  blacklisted: zod_2.z.boolean(),
11
12
  leftAt: zod_2.z.date().nullable(),
12
13
  premium: zod_2.z.lazy(() => GuildPremiumSchema).nullable(),
@@ -9,8 +9,8 @@ export declare const RumbleStreamerZod: {
9
9
  streamerUserName: z.ZodString;
10
10
  guildId: z.ZodString;
11
11
  type: z.ZodEnum<{
12
- user: "user";
13
12
  channel: "channel";
13
+ user: "user";
14
14
  }>;
15
15
  deleteEmbeds: z.ZodNullable<z.ZodBoolean>;
16
16
  sendOfflineMessage: z.ZodNullable<z.ZodBoolean>;
@@ -0,0 +1,71 @@
1
+ import { PartialZodObject } from './schema.zod';
2
+ import { RemoveProperties } from '../prisma';
3
+ import { TSPrisma } from '@prisma/client';
4
+ import { z } from 'zod';
5
+ export type RT<T extends TSPrisma.AllModelNames> = z.ZodType<RemoveProperties<TSPrisma.TSPrismaModelsFull[T], GuildScheduledMessageRelations>>;
6
+ export type GuildScheduledMessageRelations = 'db';
7
+ export declare const ScheduledMessageTimingEnum: z.ZodEnum<{
8
+ on: "on";
9
+ before: "before";
10
+ }>;
11
+ export declare const ScheduledMessageZod: {
12
+ readonly GuildScheduledMessageSchema: z.ZodObject<{
13
+ messageId: z.ZodString;
14
+ guildId: z.ZodString;
15
+ channelId: z.ZodString;
16
+ creatorId: z.ZodString;
17
+ content: z.ZodString;
18
+ trigger: z.ZodEnum<{
19
+ time: "time";
20
+ stage: "stage";
21
+ guildEvent: "guildEvent";
22
+ }>;
23
+ recurrence: z.ZodEnum<{
24
+ weekly: "weekly";
25
+ once: "once";
26
+ daily: "daily";
27
+ days: "days";
28
+ interval: "interval";
29
+ }>;
30
+ daysOfWeek: z.ZodArray<z.ZodNumber>;
31
+ intervalMinutes: z.ZodNullable<z.ZodNumber>;
32
+ timeOfDay: z.ZodNullable<z.ZodString>;
33
+ guildEventId: z.ZodNullable<z.ZodString>;
34
+ eventOffsetMinutes: z.ZodNullable<z.ZodNumber>;
35
+ timezone: z.ZodString;
36
+ nextRunAt: z.ZodNullable<z.ZodDate>;
37
+ lastRunAt: z.ZodNullable<z.ZodDate>;
38
+ paused: z.ZodBoolean;
39
+ createdAt: z.ZodDate;
40
+ }, z.core.$strip>;
41
+ readonly ScheduledMessageCreateSchema: z.ZodObject<{
42
+ channelId: z.ZodString;
43
+ content: z.ZodString;
44
+ trigger: z.ZodDefault<z.ZodEnum<{
45
+ time: "time";
46
+ stage: "stage";
47
+ guildEvent: "guildEvent";
48
+ }>>;
49
+ recurrence: z.ZodDefault<z.ZodEnum<{
50
+ weekly: "weekly";
51
+ once: "once";
52
+ daily: "daily";
53
+ days: "days";
54
+ interval: "interval";
55
+ }>>;
56
+ daysOfWeek: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
57
+ intervalMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
58
+ time: z.ZodDefault<z.ZodNullable<z.ZodString>>;
59
+ date: z.ZodDefault<z.ZodNullable<z.ZodString>>;
60
+ eventId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
61
+ timing: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
62
+ on: "on";
63
+ before: "before";
64
+ }>>>;
65
+ offsetMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
66
+ }, z.core.$strip>;
67
+ readonly ScheduledMessageEditSchema: z.ZodObject<{
68
+ content: z.ZodString;
69
+ }, z.core.$strip>;
70
+ };
71
+ export declare const ScheduledMessageZodPartial: PartialZodObject<typeof ScheduledMessageZod>;