@notidotbot/noti-api-client 1.9.74 → 1.9.76

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 (55) hide show
  1. package/dist/classes/@me.d.ts +45 -0
  2. package/dist/classes/@me.js +25 -0
  3. package/dist/classes/guildInGame.d.ts +259 -0
  4. package/dist/classes/guildInGame.js +114 -0
  5. package/dist/classes/guildInfluencerPanel.d.ts +13 -0
  6. package/dist/classes/guildMessageScheduler.d.ts +15 -1
  7. package/dist/classes/publicGiveaways.d.ts +3 -1
  8. package/dist/classes/publicGiveaways.js +1 -1
  9. package/dist/core/manager.d.ts +2 -0
  10. package/dist/core/manager.js +2 -0
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.js +12 -1
  13. package/dist/other/bitfields.d.ts +7 -4
  14. package/dist/other/bitfields.js +3 -0
  15. package/dist/other/features.d.ts +1 -1
  16. package/dist/other/features.js +1 -0
  17. package/dist/other/inGameAlerts.d.ts +83 -0
  18. package/dist/other/inGameAlerts.js +65 -0
  19. package/dist/other/inGameMiniMessage.d.ts +14 -0
  20. package/dist/other/inGameMiniMessage.js +135 -0
  21. package/dist/other/types.d.ts +2 -0
  22. package/dist/other/zod/clubStreamer.zod.d.ts +5 -0
  23. package/dist/other/zod/clubStreamer.zod.js +7 -0
  24. package/dist/other/zod/giveaways.zod.d.ts +17 -0
  25. package/dist/other/zod/giveaways.zod.js +8 -0
  26. package/dist/other/zod/kickStreamer.zod.d.ts +6 -0
  27. package/dist/other/zod/kickStreamer.zod.js +7 -0
  28. package/dist/other/zod/rumbleStreamer.zod.d.ts +7 -0
  29. package/dist/other/zod/rumbleStreamer.zod.js +7 -0
  30. package/dist/other/zod/scheduledMessage.zod.d.ts +10 -2
  31. package/dist/other/zod/scheduledMessage.zod.js +29 -5
  32. package/dist/other/zod/schema.zod.d.ts +6 -0
  33. package/dist/other/zod/schema.zod.js +7 -1
  34. package/dist/other/zod/tiktokStreamer.zod.d.ts +7 -0
  35. package/dist/other/zod/tiktokStreamer.zod.js +7 -0
  36. package/dist/other/zod/twitchStreamer.zod.d.ts +6 -0
  37. package/dist/other/zod/twitchStreamer.zod.js +7 -0
  38. package/dist/other/zod/twitterStreamer.zod.d.ts +7 -0
  39. package/dist/other/zod/twitterStreamer.zod.js +7 -0
  40. package/dist/other/zod/youtubeStreamer.zod.d.ts +7 -0
  41. package/dist/other/zod/youtubeStreamer.zod.js +7 -0
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +1 -1
  44. package/prisma/generated/ts-prisma.d.ts +129 -0
  45. package/prisma/schema/models/clubStreamer.prisma +5 -0
  46. package/prisma/schema/models/giveaways.prisma +9 -0
  47. package/prisma/schema/models/inGame.prisma +77 -0
  48. package/prisma/schema/models/kickStreamer.prisma +5 -0
  49. package/prisma/schema/models/rumbleStreamer.prisma +5 -0
  50. package/prisma/schema/models/scheduledMessage.prisma +10 -1
  51. package/prisma/schema/models/tiktokStreamer.prisma +5 -0
  52. package/prisma/schema/models/twitchStreamer.prisma +5 -0
  53. package/prisma/schema/models/twitterStreamer.prisma +5 -0
  54. package/prisma/schema/models/youtubeStreamer.prisma +5 -0
  55. package/prisma/schema/schema.prisma +16 -0
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ScheduledMessageZodPartial = exports.ScheduledMessageZod = exports.ScheduledMessageTimingEnum = void 0;
4
4
  const schema_zod_1 = require("./schema.zod");
5
5
  const zod_1 = require("./zod");
6
+ const inGameMiniMessage_1 = require("../inGameMiniMessage");
6
7
  const zod_2 = require("zod");
7
8
  exports.ScheduledMessageTimingEnum = zod_2.z.enum([
8
9
  'on',
@@ -11,9 +12,13 @@ exports.ScheduledMessageTimingEnum = zod_2.z.enum([
11
12
  const GuildScheduledMessageSchema = zod_2.z.object({
12
13
  messageId: zod_1.SnowFlake,
13
14
  guildId: zod_1.SnowFlake,
14
- channelId: zod_1.SnowFlake,
15
+ // Null for a Minecraft-only message.
16
+ channelId: zod_1.SnowFlake.nullable(),
15
17
  creatorId: zod_1.SnowFlake,
16
18
  content: zod_2.z.string().max(2000),
19
+ sendToDiscord: zod_2.z.boolean(),
20
+ sendToInGame: zod_2.z.boolean(),
21
+ minecraftContent: zod_2.z.string().max(2000).nullable(),
17
22
  trigger: schema_zod_1.ScheduledMessageTriggerEnum,
18
23
  recurrence: schema_zod_1.ScheduledMessageRecurrenceEnum,
19
24
  daysOfWeek: zod_2.z.array(zod_2.z.number().int().min(0).max(6)),
@@ -68,8 +73,19 @@ const ScheduledButtonSchema = zod_2.z.object({
68
73
  url: zod_2.z.string().max(2000).nullable().default(null),
69
74
  emojiUnicodeOrId: zod_2.z.string().nullable().default(null),
70
75
  });
76
+ /** Restricted MiniMessage for Minecraft: colours, formatting, hover text and http(s) links only. */
77
+ const MinecraftContent = zod_2.z.string().max(2000).superRefine((text, ctx) => {
78
+ const tag = (0, inGameMiniMessage_1.forbiddenMiniMessageTag)(text);
79
+ if (tag)
80
+ ctx.addIssue({ code: zod_2.z.ZodIssueCode.custom, message: `Minecraft text cannot use ${tag}. Colours, formatting, hover text and web links only.` });
81
+ });
71
82
  const ScheduledMessageCreateSchema = zod_2.z.object({
72
- channelId: zod_1.SnowFlake,
83
+ // Null only for a Minecraft-only message (sendToDiscord false).
84
+ channelId: zod_1.SnowFlake.nullable().default(null),
85
+ sendToDiscord: zod_2.z.boolean().default(true),
86
+ sendToInGame: zod_2.z.boolean().default(false),
87
+ // Blank = the Discord content converted for Minecraft.
88
+ minecraftContent: MinecraftContent.nullable().default(null).transform((v) => (v?.trim() ? v : null)),
73
89
  content: zod_2.z.string().max(2000).default(''),
74
90
  embed: ScheduledEmbedSchema.nullable().default(null).transform((e) => (e && embedHasContent(e) ? e : null)),
75
91
  buttons: zod_2.z.array(ScheduledButtonSchema).max(5).default([]),
@@ -85,12 +101,20 @@ const ScheduledMessageCreateSchema = zod_2.z.object({
85
101
  webhookEnabled: zod_2.z.boolean().default(false),
86
102
  webhookUsername: zod_2.z.string().min(1).max(80).nullable().default(null),
87
103
  webhookAvatarUrl: zod_2.z.string().url().max(2000).nullable().default(null),
88
- }).refine((d) => d.content.trim().length > 0 || !!d.embed, {
89
- message: 'A scheduled message needs content, an embed, or both.',
90
- path: ['content'],
104
+ }).superRefine((d, ctx) => {
105
+ if (!d.sendToDiscord && !d.sendToInGame)
106
+ ctx.addIssue({ code: zod_2.z.ZodIssueCode.custom, message: 'A scheduled message needs somewhere to go: Discord, Minecraft, or both.', path: ['sendToDiscord'] });
107
+ if (d.sendToDiscord && !d.channelId)
108
+ ctx.addIssue({ code: zod_2.z.ZodIssueCode.custom, message: 'Pick a channel to send it to in Discord.', path: ['channelId'] });
109
+ const hasDiscordText = d.content.trim().length > 0 || !!d.embed;
110
+ if (d.sendToDiscord ? !hasDiscordText : !(hasDiscordText || d.minecraftContent)) {
111
+ ctx.addIssue({ code: zod_2.z.ZodIssueCode.custom, message: 'A scheduled message needs content, an embed, or both.', path: ['content'] });
112
+ }
91
113
  });
92
114
  const ScheduledMessageEditSchema = zod_2.z.object({
93
115
  content: zod_2.z.string().max(2000).optional(),
116
+ sendToInGame: zod_2.z.boolean().optional(),
117
+ minecraftContent: MinecraftContent.nullable().optional().transform((v) => (v === undefined ? undefined : v?.trim() ? v : null)),
94
118
  embed: ScheduledEmbedSchema.nullable().optional().transform((e) => (e === undefined ? undefined : (e && embedHasContent(e) ? e : null))),
95
119
  buttons: zod_2.z.array(ScheduledButtonSchema).max(5).optional(),
96
120
  webhookEnabled: zod_2.z.boolean().optional(),
@@ -163,6 +163,12 @@ export declare const RoleBonusEnum: z.ZodEnum<{
163
163
  stackable: "stackable";
164
164
  highest: "highest";
165
165
  }>;
166
+ /** How a giveaway shows in Minecraft (in-game P7): not at all, announced, or announced and enterable in game. */
167
+ export declare const GiveawayInGameModeEnum: z.ZodEnum<{
168
+ off: "off";
169
+ announce: "announce";
170
+ enter: "enter";
171
+ }>;
166
172
  export declare const UserNotificationSeverityEnum: z.ZodEnum<{
167
173
  info: "info";
168
174
  warning: "warning";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScheduledMessageTriggerEnum = exports.ScheduledMessageRecurrenceEnum = exports.GameRobloxKindEnum = exports.NotificationDeliveryEnum = exports.GameDeliveryEnum = exports.GameFlagEnum = exports.GameKindEnum = exports.GameStoreEnum = exports.UserNotificationSeverityEnum = exports.RoleBonusEnum = exports.MediaShareCommandsEnum = exports.MediaShareTypesEnum = exports.FilterEnum = exports.StreamRoleSourceEnum = exports.QueryInEnum = exports.RumbleTypeEnum = exports.PlatformsWithVideosEnum = exports.UserMediaSharePermissionsEnum = exports.ClipperCategoryEnum = exports.ClipForwardPlatformEnum = exports.PlatformEnum = exports.OverrideTypeEnum = exports.OverridesEnum = exports.GuildSingleMessageTypeEnum = exports.GuildMessageTypeEnum = exports.StreamerMessageTypeEnum = exports.SingleMessageTypeEnum = exports.LeaderBoardTypesEnum = void 0;
3
+ exports.ScheduledMessageTriggerEnum = exports.ScheduledMessageRecurrenceEnum = exports.GameRobloxKindEnum = exports.NotificationDeliveryEnum = exports.GameDeliveryEnum = exports.GameFlagEnum = exports.GameKindEnum = exports.GameStoreEnum = exports.UserNotificationSeverityEnum = exports.GiveawayInGameModeEnum = exports.RoleBonusEnum = exports.MediaShareCommandsEnum = exports.MediaShareTypesEnum = exports.FilterEnum = exports.StreamRoleSourceEnum = exports.QueryInEnum = exports.RumbleTypeEnum = exports.PlatformsWithVideosEnum = exports.UserMediaSharePermissionsEnum = exports.ClipperCategoryEnum = exports.ClipForwardPlatformEnum = exports.PlatformEnum = exports.OverrideTypeEnum = exports.OverridesEnum = exports.GuildSingleMessageTypeEnum = exports.GuildMessageTypeEnum = exports.StreamerMessageTypeEnum = exports.SingleMessageTypeEnum = exports.LeaderBoardTypesEnum = void 0;
4
4
  exports.deepPartialify = deepPartialify;
5
5
  const zod_1 = require("zod");
6
6
  function deepPartialify(schema) {
@@ -217,6 +217,12 @@ exports.RoleBonusEnum = zod_1.z.enum([
217
217
  'stackable',
218
218
  'highest',
219
219
  ]);
220
+ /** How a giveaway shows in Minecraft (in-game P7): not at all, announced, or announced and enterable in game. */
221
+ exports.GiveawayInGameModeEnum = zod_1.z.enum([
222
+ 'off',
223
+ 'announce',
224
+ 'enter',
225
+ ]);
220
226
  exports.UserNotificationSeverityEnum = zod_1.z.enum([
221
227
  'info',
222
228
  'warning',
@@ -20,6 +20,13 @@ export declare const TiktokStreamerZod: {
20
20
  video: "video";
21
21
  }>>;
22
22
  }, z.core.$strip>>>;
23
+ inGame: z.ZodBoolean;
24
+ inGameTypes: z.ZodArray<z.ZodEnum<{
25
+ live: "live";
26
+ video: "video";
27
+ offline: "offline";
28
+ }>>;
29
+ inGameServerIds: z.ZodArray<z.ZodString>;
23
30
  customMessages: z.ZodArray<z.ZodLazy<z.ZodObject<{
24
31
  content: z.ZodNullable<z.ZodString>;
25
32
  showInviteButton: z.ZodNullable<z.ZodBoolean>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TiktokStreamerZodPartial = exports.TiktokStreamerZod = void 0;
4
4
  const schema_zod_1 = require("./schema.zod");
5
5
  const multiDestination_1 = require("../multiDestination");
6
+ const inGameAlerts_1 = require("../inGameAlerts");
6
7
  const zod_1 = require("./zod");
7
8
  const offlineGrace_1 = require("../offlineGrace");
8
9
  const zod_2 = require("zod");
@@ -15,6 +16,12 @@ const TiktokStreamerSchema = zod_2.z.object({
15
16
  autoPublishIfAnnouncmentChannel: zod_2.z.boolean().nullable(),
16
17
  /** Premium Plus (`MultiDestination`): up to 2 extra channels, each with its own ping role and post types. */
17
18
  extraDestinations: zod_1.CentralZod.ExtraDestinations(multiDestination_1.DESTINATION_TYPES.tiktok).nullable(),
19
+ /** Minecraft (`inGame` launch flag): show this creator's notifications on connected game servers. Off by default. */
20
+ inGame: zod_2.z.boolean(),
21
+ /** Which notifications show in Minecraft; empty = every type in `IN_GAME_TYPES.tiktok`. */
22
+ inGameTypes: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.enum(inGameAlerts_1.IN_GAME_TYPES.tiktok))),
23
+ /** Which connected servers (InGameServer.id); empty = every active one. Max 10. */
24
+ inGameServerIds: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.string().uuid())).max(inGameAlerts_1.MAX_IN_GAME_SERVER_PICKS),
18
25
  customMessages: zod_2.z.array(zod_2.z.lazy(() => TTSCustomMessageSchema)),
19
26
  liveNotificationChannelId: zod_1.SnowFlake.nullable(),
20
27
  videoNotificationChannelId: zod_1.SnowFlake.nullable(),
@@ -22,6 +22,12 @@ export declare const TwitchStreamerZod: {
22
22
  live: "live";
23
23
  }>>;
24
24
  }, z.core.$strip>>>;
25
+ inGame: z.ZodBoolean;
26
+ inGameTypes: z.ZodArray<z.ZodEnum<{
27
+ live: "live";
28
+ offline: "offline";
29
+ }>>;
30
+ inGameServerIds: z.ZodArray<z.ZodString>;
25
31
  customMessages: z.ZodArray<z.ZodLazy<z.ZodObject<{
26
32
  content: z.ZodNullable<z.ZodString>;
27
33
  showInviteButton: z.ZodNullable<z.ZodBoolean>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TwitchStreamerZodPartial = exports.TwitchStreamerZod = void 0;
4
4
  const schema_zod_1 = require("./schema.zod");
5
5
  const multiDestination_1 = require("../multiDestination");
6
+ const inGameAlerts_1 = require("../inGameAlerts");
6
7
  const zod_1 = require("./zod");
7
8
  const offlineGrace_1 = require("../offlineGrace");
8
9
  const zod_2 = require("zod");
@@ -23,6 +24,12 @@ const TwitchStreamerSchema = zod_2.z.object({
23
24
  updateLivePost: zod_2.z.boolean().nullable(),
24
25
  /** Premium Plus (`MultiDestination`): up to 2 extra channels, each with its own ping role and post types. */
25
26
  extraDestinations: zod_1.CentralZod.ExtraDestinations(multiDestination_1.DESTINATION_TYPES.twitch).nullable(),
27
+ /** Minecraft (`inGame` launch flag): show this creator's notifications on connected game servers. Off by default. */
28
+ inGame: zod_2.z.boolean(),
29
+ /** Which notifications show in Minecraft; empty = every type in `IN_GAME_TYPES.twitch`. */
30
+ inGameTypes: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.enum(inGameAlerts_1.IN_GAME_TYPES.twitch))),
31
+ /** Which connected servers (InGameServer.id); empty = every active one. Max 10. */
32
+ inGameServerIds: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.string().uuid())).max(inGameAlerts_1.MAX_IN_GAME_SERVER_PICKS),
26
33
  customMessages: zod_2.z.array(zod_2.z.lazy(() => TSCustomMessageSchema)),
27
34
  notificationChannelId: zod_1.SnowFlake.nullable(),
28
35
  showNotifyButton: zod_2.z.boolean().nullable(),
@@ -19,6 +19,13 @@ export declare const TwitterStreamerZod: {
19
19
  post: "post";
20
20
  }>>;
21
21
  }, z.core.$strip>>>;
22
+ inGame: z.ZodBoolean;
23
+ inGameTypes: z.ZodArray<z.ZodEnum<{
24
+ live: "live";
25
+ post: "post";
26
+ offline: "offline";
27
+ }>>;
28
+ inGameServerIds: z.ZodArray<z.ZodString>;
22
29
  customMessages: z.ZodArray<z.ZodLazy<z.ZodObject<{
23
30
  content: z.ZodNullable<z.ZodString>;
24
31
  showInviteButton: z.ZodNullable<z.ZodBoolean>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TwitterStreamerZodPartial = exports.TwitterStreamerZod = void 0;
4
4
  const schema_zod_1 = require("./schema.zod");
5
5
  const multiDestination_1 = require("../multiDestination");
6
+ const inGameAlerts_1 = require("../inGameAlerts");
6
7
  const zod_1 = require("./zod");
7
8
  const offlineGrace_1 = require("../offlineGrace");
8
9
  const zod_2 = require("zod");
@@ -15,6 +16,12 @@ const TwitterStreamerSchema = zod_2.z.object({
15
16
  autoPublishIfAnnouncmentChannel: zod_2.z.boolean().nullable(),
16
17
  /** Premium Plus (`MultiDestination`): up to 2 extra channels, each with its own ping role and post types. */
17
18
  extraDestinations: zod_1.CentralZod.ExtraDestinations(multiDestination_1.DESTINATION_TYPES.twitter).nullable(),
19
+ /** Minecraft (`inGame` launch flag): show this creator's notifications on connected game servers. Off by default. */
20
+ inGame: zod_2.z.boolean(),
21
+ /** Which notifications show in Minecraft; empty = every type in `IN_GAME_TYPES.twitter`. */
22
+ inGameTypes: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.enum(inGameAlerts_1.IN_GAME_TYPES.twitter))),
23
+ /** Which connected servers (InGameServer.id); empty = every active one. Max 10. */
24
+ inGameServerIds: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.string().uuid())).max(inGameAlerts_1.MAX_IN_GAME_SERVER_PICKS),
18
25
  customMessages: zod_2.z.array(zod_2.z.lazy(() => TWSCustomMessageSchema)),
19
26
  // POSTS - free tier. Own channel and own ping role.
20
27
  postNotificationChannelId: zod_1.SnowFlake.nullable(),
@@ -22,6 +22,13 @@ export declare const YoutubeStreamerZod: {
22
22
  replay: "replay";
23
23
  }>>;
24
24
  }, z.core.$strip>>>;
25
+ inGame: z.ZodBoolean;
26
+ inGameTypes: z.ZodArray<z.ZodEnum<{
27
+ live: "live";
28
+ video: "video";
29
+ replay: "replay";
30
+ }>>;
31
+ inGameServerIds: z.ZodArray<z.ZodString>;
25
32
  customMessages: z.ZodArray<z.ZodLazy<z.ZodObject<{
26
33
  content: z.ZodNullable<z.ZodString>;
27
34
  showInviteButton: z.ZodNullable<z.ZodBoolean>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.YoutubeStreamerZodPartial = exports.YoutubeStreamerZod = void 0;
4
4
  const schema_zod_1 = require("./schema.zod");
5
5
  const multiDestination_1 = require("../multiDestination");
6
+ const inGameAlerts_1 = require("../inGameAlerts");
6
7
  const zod_1 = require("./zod");
7
8
  const zod_2 = require("zod");
8
9
  const YoutubeStreamerSchema = zod_2.z.object({
@@ -15,6 +16,12 @@ const YoutubeStreamerSchema = zod_2.z.object({
15
16
  autoPublishIfAnnouncmentChannel: zod_2.z.boolean().nullable(),
16
17
  /** Premium Plus (`MultiDestination`): up to 2 extra channels, each with its own ping role and post types. */
17
18
  extraDestinations: zod_1.CentralZod.ExtraDestinations(multiDestination_1.DESTINATION_TYPES.youtube).nullable(),
19
+ /** Minecraft (`inGame` launch flag): show this creator's notifications on connected game servers. Off by default. */
20
+ inGame: zod_2.z.boolean(),
21
+ /** Which notifications show in Minecraft; empty = every type in `IN_GAME_TYPES.youtube`. */
22
+ inGameTypes: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.enum(inGameAlerts_1.IN_GAME_TYPES.youtube))),
23
+ /** Which connected servers (InGameServer.id); empty = every active one. Max 10. */
24
+ inGameServerIds: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.string().uuid())).max(inGameAlerts_1.MAX_IN_GAME_SERVER_PICKS),
18
25
  customMessages: zod_2.z.array(zod_2.z.lazy(() => YTSCustomMessageSchema)),
19
26
  liveNotificationChannelId: zod_1.SnowFlake.nullable(),
20
27
  videoNotificationChannelId: zod_1.SnowFlake.nullable(),