@notidotbot/noti-api-client 1.9.35 → 1.9.37

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.
@@ -349,6 +349,16 @@ export type GuildFishingConfigInput = {
349
349
  * records while switching off the level-up feed, which is the main thing this exists for. A form
350
350
  * that omits a key and a form that sends null mean different things.
351
351
  *
352
+ * **A PATCH REPLACES this map, it does not merge into it.** Send the whole thing every time. That
353
+ * is the only semantics the three states can work under: "use the default" is the ABSENCE of a key,
354
+ * so returning a kind to the default means sending a map without it. Under merge, a key once
355
+ * written could never be removed and the default would be unreachable after the first save.
356
+ *
357
+ * Distinct from the body, which IS patched field by field: omitting `logChannelOverrides` entirely
358
+ * leaves the stored map untouched. Present replaces wholesale, absent changes nothing.
359
+ *
360
+ * Prefer `{}` over `null` to clear every override. Both work, `{}` is unambiguous.
361
+ *
352
362
  * Keys are validated server-side against the live kind list - send an unknown one and the whole
353
363
  * PATCH is refused with a 400, rather than storing a route that can never match. `logKinds` on the
354
364
  * response is that list; prefer it over the union here, which is a hand-copy.
@@ -1,4 +1,4 @@
1
- import { AllPlatforms, ClubStreamer, ClubStreamerZod, TwitterStreamer, TwitterStreamerZod, KickStreamer, KickStreamerZod, RumbleStreamer, RumbleStreamerZod, TikTokStreamer, TikTokStreamerZod, TwitchStreamer, TwitchStreamerZod, YouTubeStreamer, YouTubeStreamerZod } from '../other/prisma';
1
+ import { AllPlatforms, ClubStreamer, ClubStreamerZod, TwitterStreamer, TwitterStreamerZod, WhatnotStreamer, WhatnotStreamerZod, 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 : T extends 'club' ? ClubStreamerZod : T extends 'twitter' ? TwitterStreamerZod : 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 : T extends 'twitter' ? TwitterStreamer & 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 : T extends 'whatnot' ? WhatnotStreamerZod : T extends 'twitter' ? TwitterStreamerZod : 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 : T extends 'whatnot' ? WhatnotStreamer & UsersForLiveRole : T extends 'twitter' ? TwitterStreamer & 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;
@@ -59,6 +59,10 @@ class APIGuildPlatform {
59
59
  }
60
60
  }
61
61
  exports.APIGuildPlatform = APIGuildPlatform;
62
+ const _everyPlatformHasAStreamerType = true;
63
+ void _everyPlatformHasAStreamerType;
64
+ const _everyStreamerModelHasAPlatform = true;
65
+ void _everyStreamerModelHasAPlatform;
62
66
  /**
63
67
  * The only values `KickStreamer.thumbnailWaitSeconds` will accept, in seconds. `null` is the default.
64
68
  *
@@ -1,4 +1,4 @@
1
- import { AllPlatforms, ClubStreamerZod, TwitterStreamerZod, KickStreamerZod, RumbleStreamerZod, TikTokStreamerZod, TwitchStreamerZod, YouTubeStreamerZod } from '../other/prisma';
1
+ import { AllPlatforms, ClubStreamerZod, TwitterStreamerZod, WhatnotStreamerZod, 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 | ClubStreamerZod | TwitterStreamerZod)['customMessages'][number];
83
+ export type StreamerUpdateMessage = (KickStreamerZod | TwitchStreamerZod | RumbleStreamerZod | TikTokStreamerZod | YouTubeStreamerZod | ClubStreamerZod | TwitterStreamerZod | WhatnotStreamerZod)['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;
@@ -7,6 +7,7 @@ import { TiktokStreamerZod } from './zod/tiktokStreamer.zod';
7
7
  import { RumbleStreamerZod } from './zod/rumbleStreamer.zod';
8
8
  import { ClubStreamerZod } from './zod/clubStreamer.zod';
9
9
  import { TwitterStreamerZod } from './zod/twitterStreamer.zod';
10
+ import { WhatnotStreamerZod } from './zod/whatnotStreamer.zod';
10
11
  import { KickStreamerZod } from './zod/kickStreamer.zod';
11
12
  import { GuildStarboardZod } from './zod/starboard.zod';
12
13
  import { GuildGiveawayZod } from './zod/giveaways.zod';
@@ -37,6 +38,7 @@ export type TikTokStreamer = TSPrisma.TSPrismaModelsFull['TiktokStreamer'];
37
38
  export type YouTubeStreamer = TSPrisma.TSPrismaModelsFull['YoutubeStreamer'];
38
39
  export type ClubStreamer = TSPrisma.TSPrismaModelsFull['ClubStreamer'];
39
40
  export type TwitterStreamer = TSPrisma.TSPrismaModelsFull['TwitterStreamer'];
41
+ export type WhatnotStreamer = TSPrisma.TSPrismaModelsFull['WhatnotStreamer'];
40
42
  export type GuildStarboard = TSPrisma.TSPrismaModelsFull['GuildStarboard'];
41
43
  export type GuildGiveaway = TSPrisma.TSPrismaModelsFull['GuildGiveaway'];
42
44
  export type GuildRolePanel = TSPrisma.TSPrismaModelsFull['GuildRolePanel'];
@@ -65,6 +67,7 @@ export type TikTokStreamerZod = z.infer<typeof TiktokStreamerZod.TiktokStreamerS
65
67
  export type YouTubeStreamerZod = z.infer<typeof YoutubeStreamerZod.YoutubeStreamerSchema>;
66
68
  export type ClubStreamerZod = z.infer<typeof ClubStreamerZod.ClubStreamerSchema>;
67
69
  export type TwitterStreamerZod = z.infer<typeof TwitterStreamerZod.TwitterStreamerSchema>;
70
+ export type WhatnotStreamerZod = z.infer<typeof WhatnotStreamerZod.WhatnotStreamerSchema>;
68
71
  export type GuildStarboardZod = z.infer<typeof GuildStarboardZod.GuildStarboardSchema>;
69
72
  export type GuildGiveawayZod = z.infer<typeof GuildGiveawayZod.GuildGiveawaySchema>;
70
73
  export type GuildGiveawayCreateSchema = z.infer<typeof GuildGiveawayZod.GuildGiveawayCreateSchema>;
@@ -0,0 +1,151 @@
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], WhatnotStreamerRelations>>;
6
+ export type WhatnotStreamerRelations = 'db' | 'whatnotStreamer' | 'wsCustomMessage' | 'wsMessageEmbed';
7
+ export declare const WhatnotStreamerZod: {
8
+ readonly WhatnotStreamerSchema: z.ZodObject<{
9
+ streamerUserName: z.ZodString;
10
+ guildId: z.ZodString;
11
+ deleteEmbeds: z.ZodNullable<z.ZodBoolean>;
12
+ sendOfflineMessage: z.ZodNullable<z.ZodBoolean>;
13
+ usePerStreamerEmbeds: z.ZodNullable<z.ZodBoolean>;
14
+ autoPublishIfAnnouncmentChannel: z.ZodNullable<z.ZodBoolean>;
15
+ customMessages: z.ZodArray<z.ZodLazy<z.ZodObject<{
16
+ content: z.ZodNullable<z.ZodString>;
17
+ showInviteButton: z.ZodNullable<z.ZodBoolean>;
18
+ showWatchButton: z.ZodNullable<z.ZodBoolean>;
19
+ embed: z.ZodNullable<z.ZodLazy<z.ZodObject<{
20
+ title: z.ZodNullable<z.ZodString>;
21
+ url: z.ZodNullable<z.ZodString>;
22
+ description: z.ZodString;
23
+ color: z.ZodNullable<z.ZodString>;
24
+ footer: z.ZodNullable<z.ZodString>;
25
+ footerIcon: z.ZodNullable<z.ZodString>;
26
+ image: z.ZodNullable<z.ZodString>;
27
+ thumbnail: z.ZodNullable<z.ZodString>;
28
+ author: z.ZodNullable<z.ZodString>;
29
+ authorIcon: z.ZodNullable<z.ZodString>;
30
+ fields: z.ZodArray<z.ZodLazy<z.ZodObject<{
31
+ name: z.ZodString;
32
+ value: z.ZodNullable<z.ZodString>;
33
+ inline: z.ZodNullable<z.ZodBoolean>;
34
+ }, z.core.$strip>>>;
35
+ }, z.core.$strip>>>;
36
+ buttons: z.ZodArray<z.ZodLazy<z.ZodObject<{
37
+ title: z.ZodString;
38
+ url: z.ZodNullable<z.ZodString>;
39
+ emojiUnicodeOrId: z.ZodNullable<z.ZodString>;
40
+ }, z.core.$strip>>>;
41
+ webhook: z.ZodNullable<z.ZodLazy<z.ZodObject<{
42
+ enabled: z.ZodNullable<z.ZodBoolean>;
43
+ username: z.ZodNullable<z.ZodString>;
44
+ avatarUrl: z.ZodNullable<z.ZodString>;
45
+ }, z.core.$strip>>>;
46
+ type: z.ZodEnum<{
47
+ clip: "clip";
48
+ clipForward: "clipForward";
49
+ vod: "vod";
50
+ kickLive: "kickLive";
51
+ kickOffline: "kickOffline";
52
+ twitchLive: "twitchLive";
53
+ twitchOffline: "twitchOffline";
54
+ rumbleLive: "rumbleLive";
55
+ rumbleOffline: "rumbleOffline";
56
+ rumbleVideo: "rumbleVideo";
57
+ tiktokLive: "tiktokLive";
58
+ tiktokOffline: "tiktokOffline";
59
+ tiktokVideo: "tiktokVideo";
60
+ youtubeLive: "youtubeLive";
61
+ youtubeVideo: "youtubeVideo";
62
+ whatnotLive: "whatnotLive";
63
+ whatnotOffline: "whatnotOffline";
64
+ clubPost: "clubPost";
65
+ twitterPost: "twitterPost";
66
+ twitterLive: "twitterLive";
67
+ twitterOffline: "twitterOffline";
68
+ }>;
69
+ }, z.core.$strip>>>;
70
+ notificationChannelId: z.ZodNullable<z.ZodString>;
71
+ showNotifyButton: z.ZodNullable<z.ZodBoolean>;
72
+ pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
73
+ customCoolDownBeforeNextLive: z.ZodNullable<z.ZodNumber>;
74
+ liveRoleId: z.ZodNullable<z.ZodString>;
75
+ usersForLiveRole: z.ZodArray<z.ZodString>;
76
+ usersWhoHaveLiveRole: z.ZodArray<z.ZodString>;
77
+ statsChannelIds: z.ZodNullable<z.ZodLazy<z.ZodObject<{
78
+ isLive: z.ZodNullable<z.ZodString>;
79
+ }, z.core.$strip>>>;
80
+ isCurrentlyLive: z.ZodNullable<z.ZodLazy<z.ZodObject<{
81
+ correct: z.ZodNullable<z.ZodBoolean>;
82
+ channelId: z.ZodNullable<z.ZodString>;
83
+ messageId: z.ZodNullable<z.ZodString>;
84
+ }, z.core.$strip>>>;
85
+ lastLive: z.ZodNullable<z.ZodDate>;
86
+ }, z.core.$strip>;
87
+ readonly WSCustomMessageSchema: z.ZodObject<{
88
+ content: z.ZodNullable<z.ZodString>;
89
+ showInviteButton: z.ZodNullable<z.ZodBoolean>;
90
+ showWatchButton: z.ZodNullable<z.ZodBoolean>;
91
+ embed: z.ZodNullable<z.ZodLazy<z.ZodObject<{
92
+ title: z.ZodNullable<z.ZodString>;
93
+ url: z.ZodNullable<z.ZodString>;
94
+ description: z.ZodString;
95
+ color: z.ZodNullable<z.ZodString>;
96
+ footer: z.ZodNullable<z.ZodString>;
97
+ footerIcon: z.ZodNullable<z.ZodString>;
98
+ image: z.ZodNullable<z.ZodString>;
99
+ thumbnail: z.ZodNullable<z.ZodString>;
100
+ author: z.ZodNullable<z.ZodString>;
101
+ authorIcon: z.ZodNullable<z.ZodString>;
102
+ fields: z.ZodArray<z.ZodLazy<z.ZodObject<{
103
+ name: z.ZodString;
104
+ value: z.ZodNullable<z.ZodString>;
105
+ inline: z.ZodNullable<z.ZodBoolean>;
106
+ }, z.core.$strip>>>;
107
+ }, z.core.$strip>>>;
108
+ buttons: z.ZodArray<z.ZodLazy<z.ZodObject<{
109
+ title: z.ZodString;
110
+ url: z.ZodNullable<z.ZodString>;
111
+ emojiUnicodeOrId: z.ZodNullable<z.ZodString>;
112
+ }, z.core.$strip>>>;
113
+ webhook: z.ZodNullable<z.ZodLazy<z.ZodObject<{
114
+ enabled: z.ZodNullable<z.ZodBoolean>;
115
+ username: z.ZodNullable<z.ZodString>;
116
+ avatarUrl: z.ZodNullable<z.ZodString>;
117
+ }, z.core.$strip>>>;
118
+ type: z.ZodEnum<{
119
+ clip: "clip";
120
+ clipForward: "clipForward";
121
+ vod: "vod";
122
+ kickLive: "kickLive";
123
+ kickOffline: "kickOffline";
124
+ twitchLive: "twitchLive";
125
+ twitchOffline: "twitchOffline";
126
+ rumbleLive: "rumbleLive";
127
+ rumbleOffline: "rumbleOffline";
128
+ rumbleVideo: "rumbleVideo";
129
+ tiktokLive: "tiktokLive";
130
+ tiktokOffline: "tiktokOffline";
131
+ tiktokVideo: "tiktokVideo";
132
+ youtubeLive: "youtubeLive";
133
+ youtubeVideo: "youtubeVideo";
134
+ whatnotLive: "whatnotLive";
135
+ whatnotOffline: "whatnotOffline";
136
+ clubPost: "clubPost";
137
+ twitterPost: "twitterPost";
138
+ twitterLive: "twitterLive";
139
+ twitterOffline: "twitterOffline";
140
+ }>;
141
+ }, z.core.$strip>;
142
+ readonly WSStatsChannelIdSchema: z.ZodObject<{
143
+ isLive: z.ZodNullable<z.ZodString>;
144
+ }, z.core.$strip>;
145
+ readonly WSCurrentlyLiveSchema: z.ZodObject<{
146
+ correct: z.ZodNullable<z.ZodBoolean>;
147
+ channelId: z.ZodNullable<z.ZodString>;
148
+ messageId: z.ZodNullable<z.ZodString>;
149
+ }, z.core.$strip>;
150
+ };
151
+ export declare const WhatnotStreamerZodPartial: PartialZodObject<typeof WhatnotStreamerZod>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WhatnotStreamerZodPartial = exports.WhatnotStreamerZod = void 0;
4
+ const schema_zod_1 = require("./schema.zod");
5
+ const zod_1 = require("./zod");
6
+ const zod_2 = require("zod");
7
+ const WhatnotStreamerSchema = zod_2.z.object({
8
+ streamerUserName: zod_2.z.string(),
9
+ guildId: zod_1.SnowFlake,
10
+ deleteEmbeds: zod_2.z.boolean().nullable(),
11
+ sendOfflineMessage: zod_2.z.boolean().nullable(),
12
+ usePerStreamerEmbeds: zod_2.z.boolean().nullable(),
13
+ autoPublishIfAnnouncmentChannel: zod_2.z.boolean().nullable(),
14
+ customMessages: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.lazy(() => WSCustomMessageSchema)), ['type']),
15
+ notificationChannelId: zod_1.SnowFlake.nullable(),
16
+ showNotifyButton: zod_2.z.boolean().nullable(),
17
+ pingRoleId: zod_1.SnowFlakeOrEveryone.nullable(),
18
+ customCoolDownBeforeNextLive: zod_2.z.number().min(0).max(360).nullable(),
19
+ liveRoleId: zod_1.SnowFlake.nullable(),
20
+ usersForLiveRole: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_1.SnowFlake)),
21
+ usersWhoHaveLiveRole: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_1.SnowFlake)),
22
+ statsChannelIds: zod_2.z.lazy(() => WSStatsChannelIdSchema).nullable(),
23
+ isCurrentlyLive: zod_2.z.lazy(() => WSCurrentlyLiveSchema).nullable(),
24
+ lastLive: zod_2.z.date().nullable(),
25
+ });
26
+ const WSCustomMessageSchema = zod_2.z.object({
27
+ type: schema_zod_1.StreamerMessageTypeEnum,
28
+ ...zod_1.CentralZod.Message(),
29
+ });
30
+ const WSStatsChannelIdSchema = zod_2.z.object({
31
+ isLive: zod_2.z.string().nullable(),
32
+ });
33
+ const WSCurrentlyLiveSchema = zod_2.z.object({
34
+ correct: zod_2.z.boolean().nullable(),
35
+ channelId: zod_1.SnowFlake.nullable(),
36
+ messageId: zod_1.SnowFlake.nullable(),
37
+ });
38
+ exports.WhatnotStreamerZod = {
39
+ WhatnotStreamerSchema,
40
+ WSCustomMessageSchema,
41
+ WSStatsChannelIdSchema,
42
+ WSCurrentlyLiveSchema,
43
+ };
44
+ exports.WhatnotStreamerZodPartial = Object.fromEntries(Object.entries(exports.WhatnotStreamerZod).map(([key, value]) => [key, (0, schema_zod_1.deepPartialify)(value)]));