@notidotbot/noti-api-client 1.4.15 → 1.4.17
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.
- package/dist/classes/@me.d.ts +2 -2
- package/dist/classes/admin.d.ts +6 -0
- package/dist/classes/admin.js +6 -0
- package/dist/classes/client.d.ts +27 -1
- package/dist/classes/client.js +6 -0
- package/dist/classes/emotes.d.ts +2 -0
- package/dist/classes/games.d.ts +363 -0
- package/dist/classes/games.js +49 -0
- package/dist/classes/guild.d.ts +4 -3
- package/dist/classes/guild.js +3 -2
- package/dist/classes/guildDrops.d.ts +1 -0
- package/dist/classes/guildGiveaway.d.ts +6 -2
- package/dist/classes/guildPlatform.d.ts +4 -57
- package/dist/classes/guildPlatform.js +0 -38
- package/dist/classes/guildPlatformAction.d.ts +58 -1
- package/dist/classes/guildPlatformAction.js +38 -0
- package/dist/classes/guildStarboard.d.ts +2 -2
- package/dist/classes/linked.d.ts +10 -7
- package/dist/classes/linked.js +8 -5
- package/dist/classes/other.d.ts +43 -1
- package/dist/classes/other.js +20 -1
- package/dist/classes/platform.d.ts +8 -3
- package/dist/classes/platform.js +5 -2
- package/dist/classes/premium.d.ts +52 -9
- package/dist/classes/premium.js +14 -4
- package/dist/classes/sessions.d.ts +2 -1
- package/dist/classes/sessions.js +2 -1
- package/dist/classes/teams.d.ts +19 -14
- package/dist/classes/teams.js +7 -9
- package/dist/classes/user.d.ts +1 -1
- package/dist/classes/vods.d.ts +8 -2
- package/dist/core/manager.d.ts +2 -0
- package/dist/core/manager.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/other/prisma.d.ts +5 -0
- package/dist/other/zod/gameConfig.zod.d.ts +134 -0
- package/dist/other/zod/gameConfig.zod.js +82 -0
- package/dist/other/zod/guild.zod.d.ts +3 -0
- package/dist/other/zod/guild.zod.js +3 -0
- package/dist/other/zod/r2Storage.zod.d.ts +1 -0
- package/dist/other/zod/r2Storage.zod.js +1 -0
- package/dist/other/zod/rumbleStreamer.zod.d.ts +1 -1
- package/dist/other/zod/schema.zod.d.ts +30 -6
- package/dist/other/zod/schema.zod.js +27 -1
- package/dist/other/zod/youtubeStreamer.zod.d.ts +1 -0
- package/dist/other/zod/youtubeStreamer.zod.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/prisma/generated/ts-prisma.d.ts +862 -0
- package/prisma/schema/models/gameConfig.prisma +128 -0
- package/prisma/schema/models/guild.prisma +4 -0
- package/prisma/schema/models/r2Storage.prisma +1 -0
- package/prisma/schema/models/youtubeStreamer.prisma +2 -1
- package/prisma/schema/schema.prisma +154 -120
package/dist/classes/@me.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class APIMe {
|
|
|
5
5
|
private web;
|
|
6
6
|
constructor(web: WebDataManager);
|
|
7
7
|
getCurrentUser({ auth }: MeFunctionsInput['getCurrentUser']): Promise<import("../types").WebResponse<CurrentUser>>;
|
|
8
|
-
clearCurrentUserNotifications({ auth }: MeFunctionsInput['clearCurrentUserNotifications']): Promise<import("../types").WebResponse<
|
|
8
|
+
clearCurrentUserNotifications({ auth }: MeFunctionsInput['clearCurrentUserNotifications']): Promise<import("../types").WebResponse<string>>;
|
|
9
9
|
getCurrentUserGuilds({ auth }: MeFunctionsInput['getCurrentUserGuilds']): Promise<import("../types").WebResponse<CurrentUserGuilds>>;
|
|
10
10
|
getGuildDiscordData<T extends GuildDataType>({ auth, guildId, types, refresh }: MeFunctionsInput['getGuildDiscordData']): Promise<import("../types").WebResponse<DiscordGuildData<T>>>;
|
|
11
11
|
getConnectPlatformUrl({ platform }: MeFunctionsInput['getConnectPlatformUrl']): Promise<import("../types").WebResponse<string>>;
|
|
@@ -29,7 +29,6 @@ export type MeFunctionsInput<T extends GuildDataType = never> = {
|
|
|
29
29
|
refresh?: boolean;
|
|
30
30
|
};
|
|
31
31
|
'getConnectPlatformUrl': {
|
|
32
|
-
auth: string;
|
|
33
32
|
platform: 'twitch' | 'kick';
|
|
34
33
|
};
|
|
35
34
|
'connectPlatform': {
|
|
@@ -81,6 +80,7 @@ export type ModToSomene = {
|
|
|
81
80
|
export type CurrentUser = {
|
|
82
81
|
isDev: boolean;
|
|
83
82
|
isStaff: boolean;
|
|
83
|
+
notifications: string[];
|
|
84
84
|
discord: DCUserData;
|
|
85
85
|
database: User & {
|
|
86
86
|
premium: {
|
package/dist/classes/admin.d.ts
CHANGED
|
@@ -4,11 +4,15 @@ import { WebDataManager } from '../core/manager';
|
|
|
4
4
|
export declare class APIAdmin {
|
|
5
5
|
private web;
|
|
6
6
|
constructor(web: WebDataManager);
|
|
7
|
+
getAdmin({ auth }: AdminFunctionsInput['getAdmin']): Promise<import("../types").WebResponse<string>>;
|
|
7
8
|
getEmailList({ auth }: AdminFunctionsInput['getEmailList']): Promise<import("../types").WebResponse<EmailList>>;
|
|
8
9
|
getAnalytics<T extends string = string>({ auth, lookback }: AdminFunctionsInput['getAnalytics']): Promise<import("../types").WebResponse<Analytics<T, string>>>;
|
|
9
10
|
stripeCharge({ auth, guildId, subscriptionId, amountCents, description, dueDays }: AdminFunctionsInput['stripeCharge']): Promise<import("../types").WebResponse<AdminStripeChargeResponse>>;
|
|
10
11
|
}
|
|
11
12
|
export type AdminFunctionsInput = {
|
|
13
|
+
'getAdmin': {
|
|
14
|
+
auth: string;
|
|
15
|
+
};
|
|
12
16
|
'getEmailList': {
|
|
13
17
|
auth: string;
|
|
14
18
|
};
|
|
@@ -26,6 +30,8 @@ export type AdminFunctionsInput = {
|
|
|
26
30
|
};
|
|
27
31
|
};
|
|
28
32
|
export type AdminGetReturnTypes = {
|
|
33
|
+
'getAdminRaw': Awaited<ReturnType<APIAdmin['getAdmin']>>;
|
|
34
|
+
'getAdminSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getAdmin']>>>;
|
|
29
35
|
'getEmailListRaw': Awaited<ReturnType<APIAdmin['getEmailList']>>;
|
|
30
36
|
'getEmailListSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getEmailList']>>>;
|
|
31
37
|
'getAnalyticsRaw': Awaited<ReturnType<APIAdmin['getAnalytics']>>;
|
package/dist/classes/admin.js
CHANGED
|
@@ -8,6 +8,12 @@ class APIAdmin {
|
|
|
8
8
|
this.web = web;
|
|
9
9
|
}
|
|
10
10
|
// Methods.
|
|
11
|
+
async getAdmin({ auth }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp('/admin'),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
11
17
|
async getEmailList({ auth }) {
|
|
12
18
|
return await this.web.request({
|
|
13
19
|
method: 'GET', auth,
|
package/dist/classes/client.d.ts
CHANGED
|
@@ -40,13 +40,13 @@ export declare class APIClient {
|
|
|
40
40
|
content: string;
|
|
41
41
|
thumbnail: string | null;
|
|
42
42
|
authorIcon: string;
|
|
43
|
+
tags: string[];
|
|
43
44
|
clientId: string;
|
|
44
45
|
identifier: string;
|
|
45
46
|
isPinned: boolean;
|
|
46
47
|
views: number | null;
|
|
47
48
|
reactions: string[];
|
|
48
49
|
reactionsCount: number | null;
|
|
49
|
-
tags: string[];
|
|
50
50
|
authorName: string;
|
|
51
51
|
createdAt: Date;
|
|
52
52
|
lastEdited: Date;
|
|
@@ -55,6 +55,7 @@ export declare class APIClient {
|
|
|
55
55
|
getBlog({ identifier }: ClientFunctionsInput['getBlog']): Promise<import("../types").WebResponse<BlogWithout<"reactions">>>;
|
|
56
56
|
createBlog({ auth, body }: ClientFunctionsInput['createBlog']): Promise<import("../types").WebResponse<string>>;
|
|
57
57
|
updateBlog({ auth, identifier, body }: ClientFunctionsInput['updateBlog']): Promise<import("../types").WebResponse<string>>;
|
|
58
|
+
reactBlog({ auth, identifier }: ClientFunctionsInput['reactBlog']): Promise<import("../types").WebResponse<ReactBlogResponse>>;
|
|
58
59
|
deleteBlog({ auth, identifier }: ClientFunctionsInput['deleteBlog']): Promise<import("../types").WebResponse<string>>;
|
|
59
60
|
}
|
|
60
61
|
export type ClientFunctionsInput = {
|
|
@@ -114,6 +115,10 @@ export type ClientFunctionsInput = {
|
|
|
114
115
|
identifier: string;
|
|
115
116
|
body: Partial<Omit<ClientZod['blogs'][number], BlogToOmitUpdate>>;
|
|
116
117
|
};
|
|
118
|
+
'reactBlog': {
|
|
119
|
+
auth: string;
|
|
120
|
+
identifier: string;
|
|
121
|
+
};
|
|
117
122
|
'deleteBlog': {
|
|
118
123
|
auth: string;
|
|
119
124
|
identifier: string;
|
|
@@ -134,10 +139,28 @@ export type ClientReturnTypes = {
|
|
|
134
139
|
'deleteFaqSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['deleteFaq']>>>;
|
|
135
140
|
'getNewsRaw': Awaited<ReturnType<APIClient['getNews']>>;
|
|
136
141
|
'getNewsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getNews']>>>;
|
|
142
|
+
'getNewsAdminRaw': Awaited<ReturnType<APIClient['getNewsAdmin']>>;
|
|
143
|
+
'getNewsAdminSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getNewsAdmin']>>>;
|
|
137
144
|
'createNewsRaw': Awaited<ReturnType<APIClient['createNews']>>;
|
|
138
145
|
'createNewsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['createNews']>>>;
|
|
146
|
+
'updateNewsRaw': Awaited<ReturnType<APIClient['updateNews']>>;
|
|
147
|
+
'updateNewsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['updateNews']>>>;
|
|
139
148
|
'deleteNewsRaw': Awaited<ReturnType<APIClient['deleteNews']>>;
|
|
140
149
|
'deleteNewsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['deleteNews']>>>;
|
|
150
|
+
'getBlogsRaw': Awaited<ReturnType<APIClient['getBlogs']>>;
|
|
151
|
+
'getBlogsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getBlogs']>>>;
|
|
152
|
+
'getBlogsAdminRaw': Awaited<ReturnType<APIClient['getBlogsAdmin']>>;
|
|
153
|
+
'getBlogsAdminSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getBlogsAdmin']>>>;
|
|
154
|
+
'getBlogRaw': Awaited<ReturnType<APIClient['getBlog']>>;
|
|
155
|
+
'getBlogSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getBlog']>>>;
|
|
156
|
+
'createBlogRaw': Awaited<ReturnType<APIClient['createBlog']>>;
|
|
157
|
+
'createBlogSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['createBlog']>>>;
|
|
158
|
+
'updateBlogRaw': Awaited<ReturnType<APIClient['updateBlog']>>;
|
|
159
|
+
'updateBlogSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['updateBlog']>>>;
|
|
160
|
+
'reactBlogRaw': Awaited<ReturnType<APIClient['reactBlog']>>;
|
|
161
|
+
'reactBlogSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['reactBlog']>>>;
|
|
162
|
+
'deleteBlogRaw': Awaited<ReturnType<APIClient['deleteBlog']>>;
|
|
163
|
+
'deleteBlogSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['deleteBlog']>>>;
|
|
141
164
|
};
|
|
142
165
|
export type FaqReturnType = {
|
|
143
166
|
dbId: string;
|
|
@@ -152,5 +175,8 @@ export type AskFaqBody = {
|
|
|
152
175
|
avatarUrl: string;
|
|
153
176
|
};
|
|
154
177
|
export type BlogWithout<T extends keyof Client['blogs'][number] = never> = Omit<Client['blogs'][number], T>;
|
|
178
|
+
export type ReactBlogResponse = {
|
|
179
|
+
currentReactState: boolean;
|
|
180
|
+
};
|
|
155
181
|
export type BlogToOmitCreate = 'views' | 'reactions' | 'reactionsCount' | 'createdAt' | 'lastEdited';
|
|
156
182
|
export type BlogToOmitUpdate = 'identifier' | BlogToOmitCreate;
|
package/dist/classes/client.js
CHANGED
|
@@ -106,6 +106,12 @@ class APIClient {
|
|
|
106
106
|
endpoint: this.web.qp('/data/blogs/' + identifier),
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
async reactBlog({ auth, identifier }) {
|
|
110
|
+
return await this.web.request({
|
|
111
|
+
method: 'PUT', auth,
|
|
112
|
+
endpoint: this.web.qp('/data/blogs/' + identifier),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
109
115
|
async deleteBlog({ auth, identifier }) {
|
|
110
116
|
return await this.web.request({
|
|
111
117
|
method: 'DELETE', auth,
|
package/dist/classes/emotes.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export type EmotesFunctionsInput = {
|
|
|
20
20
|
export type EmotesReturnTypes = {
|
|
21
21
|
'getEmotesForRaw': Awaited<ReturnType<APIEmotes['getEmotesFor']>>;
|
|
22
22
|
'getEmotesForSuccess': CancelOutWebResponses<Awaited<ReturnType<APIEmotes['getEmotesFor']>>>;
|
|
23
|
+
'createDownloadZipRaw': Awaited<ReturnType<APIEmotes['createDownloadZip']>>;
|
|
24
|
+
'createDownloadZipSuccess': CancelOutWebResponses<Awaited<ReturnType<APIEmotes['createDownloadZip']>>>;
|
|
23
25
|
};
|
|
24
26
|
export type EmojiType = {
|
|
25
27
|
id: string;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { WebDataManager } from '../core/manager';
|
|
2
|
+
import { CancelOutWebResponses, WebResponse } from '../types';
|
|
3
|
+
export type GameStore = 'steam' | 'epic' | 'gog' | 'prime';
|
|
4
|
+
export type GameKind = 'free_game' | 'free_dlc_or_loot' | 'discount' | 'upcoming_free';
|
|
5
|
+
export type GameDiscountTier = '100' | '90_plus' | '75_plus' | '50_plus' | '33_plus' | 'under_33';
|
|
6
|
+
export type GameDelivery = 'instant' | 'daily' | 'weekly';
|
|
7
|
+
export type GameFlag = 'freeWeekend' | 'allTimeLow' | 'featured' | 'aaa' | 'earlyAccess';
|
|
8
|
+
export type GameSourceId = 'epic_free' | 'cheapshark' | 'steam_featured' | 'gamerpower' | 'watchlist' | 'steam_weekend';
|
|
9
|
+
export interface DealPrice {
|
|
10
|
+
currency: 'USD';
|
|
11
|
+
originalCents: number | null;
|
|
12
|
+
finalCents: number | null;
|
|
13
|
+
discountPercent: number;
|
|
14
|
+
}
|
|
15
|
+
export interface DealArtwork {
|
|
16
|
+
wide: string | null;
|
|
17
|
+
tall: string | null;
|
|
18
|
+
thumb: string | null;
|
|
19
|
+
header: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface DealRatings {
|
|
22
|
+
steamRatingPercent: number | null;
|
|
23
|
+
steamRatingCount: number | null;
|
|
24
|
+
steamRatingText: string | null;
|
|
25
|
+
metacritic: number | null;
|
|
26
|
+
dealRating: number | null;
|
|
27
|
+
}
|
|
28
|
+
export interface DealFlags {
|
|
29
|
+
aaa: boolean;
|
|
30
|
+
featured: boolean;
|
|
31
|
+
earlyAccess: boolean;
|
|
32
|
+
freeWeekend: boolean;
|
|
33
|
+
allTimeLow: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** One catalog item — the single shape every catalog endpoint + WS event speaks. */
|
|
36
|
+
export interface DealItem {
|
|
37
|
+
id: string;
|
|
38
|
+
kind: GameKind;
|
|
39
|
+
store: GameStore;
|
|
40
|
+
title: string;
|
|
41
|
+
description: string | null;
|
|
42
|
+
isDlcOrAddon: boolean;
|
|
43
|
+
price: DealPrice;
|
|
44
|
+
discountTier: GameDiscountTier;
|
|
45
|
+
worth: string | null;
|
|
46
|
+
/** canonical store/claim URL — what the user should click */
|
|
47
|
+
url: string;
|
|
48
|
+
/** CheapShark redirect URL — use this for deal links when present (terms requirement) */
|
|
49
|
+
dealUrl: string | null;
|
|
50
|
+
artwork: DealArtwork;
|
|
51
|
+
startsAt: string | null;
|
|
52
|
+
/** claim deadline for free-to-keep items; price-revert for discounts */
|
|
53
|
+
endsAt: string | null;
|
|
54
|
+
/** end of a Steam play-for-free window — independent of endsAt */
|
|
55
|
+
freeWeekendEndsAt: string | null;
|
|
56
|
+
flags: DealFlags;
|
|
57
|
+
ratings: DealRatings | null;
|
|
58
|
+
steamAppId: number | null;
|
|
59
|
+
cheapsharkGameId: string | null;
|
|
60
|
+
allTimeLowCents: number | null;
|
|
61
|
+
/** enrichment — null until metadata lands (show a skeleton, not broken UI) */
|
|
62
|
+
developers: string[] | null;
|
|
63
|
+
publishers: string[] | null;
|
|
64
|
+
genres: string[] | null;
|
|
65
|
+
tags: string[] | null;
|
|
66
|
+
enrichedAt: string | null;
|
|
67
|
+
watched: boolean;
|
|
68
|
+
sources: GameSourceId[];
|
|
69
|
+
sourceIds: Partial<Record<GameSourceId, string>>;
|
|
70
|
+
firstSeenAt: string;
|
|
71
|
+
updatedAt: string;
|
|
72
|
+
lastSeenAt: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ChangelogEntry {
|
|
75
|
+
id: string;
|
|
76
|
+
appid: number;
|
|
77
|
+
title: string;
|
|
78
|
+
gameTitle: string | null;
|
|
79
|
+
kind: 'patch' | 'announcement';
|
|
80
|
+
url: string;
|
|
81
|
+
author: string | null;
|
|
82
|
+
/** Discord-ready markdown, ≤1500 chars */
|
|
83
|
+
contentsPreview: string;
|
|
84
|
+
publishedAt: string;
|
|
85
|
+
feedLabel: string;
|
|
86
|
+
}
|
|
87
|
+
export interface DealsCatalogResponse {
|
|
88
|
+
items: DealItem[];
|
|
89
|
+
nextCursor: string | null;
|
|
90
|
+
total: number;
|
|
91
|
+
asOf: string;
|
|
92
|
+
}
|
|
93
|
+
export interface FreeCatalogResponse {
|
|
94
|
+
items: DealItem[];
|
|
95
|
+
total: number;
|
|
96
|
+
asOf: string;
|
|
97
|
+
}
|
|
98
|
+
export interface ChangelogsResponse {
|
|
99
|
+
items: ChangelogEntry[];
|
|
100
|
+
total: number;
|
|
101
|
+
asOf: string;
|
|
102
|
+
}
|
|
103
|
+
export interface ProviderCapabilities {
|
|
104
|
+
giveaways: boolean;
|
|
105
|
+
discounts: boolean;
|
|
106
|
+
upcomingFree: boolean;
|
|
107
|
+
freeWeekends: boolean;
|
|
108
|
+
allTimeLows: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface ProviderCounts {
|
|
111
|
+
items: number;
|
|
112
|
+
freeNow: number;
|
|
113
|
+
discounts: number;
|
|
114
|
+
upcomingFree: number;
|
|
115
|
+
freeWeekends: number;
|
|
116
|
+
allTimeLows: number;
|
|
117
|
+
}
|
|
118
|
+
export interface Provider {
|
|
119
|
+
id: GameStore;
|
|
120
|
+
label: string;
|
|
121
|
+
capabilities: ProviderCapabilities;
|
|
122
|
+
counts: ProviderCounts;
|
|
123
|
+
}
|
|
124
|
+
export interface ProvidersResponse {
|
|
125
|
+
providers: Provider[];
|
|
126
|
+
asOf: string;
|
|
127
|
+
}
|
|
128
|
+
export interface TaxonomyTerm {
|
|
129
|
+
name: string;
|
|
130
|
+
count: number;
|
|
131
|
+
}
|
|
132
|
+
export interface TaxonomyResponse {
|
|
133
|
+
genres: TaxonomyTerm[];
|
|
134
|
+
tags: TaxonomyTerm[];
|
|
135
|
+
developers: TaxonomyTerm[];
|
|
136
|
+
publishers: TaxonomyTerm[];
|
|
137
|
+
}
|
|
138
|
+
export interface GameCategoryRoute {
|
|
139
|
+
dbId?: string;
|
|
140
|
+
kinds: GameKind[];
|
|
141
|
+
stores: GameStore[];
|
|
142
|
+
flags: GameFlag[];
|
|
143
|
+
genres: string[];
|
|
144
|
+
tags: string[];
|
|
145
|
+
minDiscountPercent: number | null;
|
|
146
|
+
channelId: string | null;
|
|
147
|
+
pingRoleId: string | null;
|
|
148
|
+
webhookEnabled?: boolean | null;
|
|
149
|
+
webhookUsername?: string | null;
|
|
150
|
+
webhookAvatarUrl?: string | null;
|
|
151
|
+
priority: number;
|
|
152
|
+
}
|
|
153
|
+
export interface TrackedGame {
|
|
154
|
+
dbId?: string;
|
|
155
|
+
steamAppId: number | null;
|
|
156
|
+
title: string | null;
|
|
157
|
+
itemId?: string | null;
|
|
158
|
+
channelId?: string | null;
|
|
159
|
+
pingRoleId?: string | null;
|
|
160
|
+
minDiscountPercent?: number | null;
|
|
161
|
+
atlOnly?: boolean;
|
|
162
|
+
}
|
|
163
|
+
export interface ChangelogGame {
|
|
164
|
+
dbId?: string;
|
|
165
|
+
steamAppId: number;
|
|
166
|
+
title: string | null;
|
|
167
|
+
}
|
|
168
|
+
export interface GameConfig {
|
|
169
|
+
guildId?: string;
|
|
170
|
+
enabled: boolean;
|
|
171
|
+
notificationChannelId: string | null;
|
|
172
|
+
pingRoleId: string | null;
|
|
173
|
+
deliveryMode: GameDelivery;
|
|
174
|
+
digestHourUTC: number | null;
|
|
175
|
+
digestWeekday: number | null;
|
|
176
|
+
freeGamesEnabled: boolean;
|
|
177
|
+
freeDlcEnabled: boolean;
|
|
178
|
+
freeGameStores: GameStore[];
|
|
179
|
+
upcomingFreeEnabled: boolean;
|
|
180
|
+
freeWeekendEnabled: boolean;
|
|
181
|
+
discountsEnabled: boolean;
|
|
182
|
+
discountStores: GameStore[];
|
|
183
|
+
minDiscountPercent: number | null;
|
|
184
|
+
maxPriceCents: number | null;
|
|
185
|
+
genres: string[];
|
|
186
|
+
tags: string[];
|
|
187
|
+
studios: string[];
|
|
188
|
+
allTimeLowEnabled: boolean;
|
|
189
|
+
allTimeLowMaxPriceCents: number | null;
|
|
190
|
+
changelogChannelId: string | null;
|
|
191
|
+
changelogPingRoleId: string | null;
|
|
192
|
+
categoryRoutes: GameCategoryRoute[];
|
|
193
|
+
trackedGames: TrackedGame[];
|
|
194
|
+
changelogGames: ChangelogGame[];
|
|
195
|
+
}
|
|
196
|
+
/** Resolved premium entitlements + limits for the guild (gating is visual, never hidden). */
|
|
197
|
+
export interface GameEntitlements {
|
|
198
|
+
premium: boolean;
|
|
199
|
+
categoryRouting: boolean;
|
|
200
|
+
allTimeLow: boolean;
|
|
201
|
+
customWebhooks: boolean;
|
|
202
|
+
changelogs: boolean;
|
|
203
|
+
trackedGameLimit: number;
|
|
204
|
+
}
|
|
205
|
+
export interface GameConfigResponse {
|
|
206
|
+
config: GameConfig;
|
|
207
|
+
entitlements: GameEntitlements;
|
|
208
|
+
}
|
|
209
|
+
export interface GameSourceHealth {
|
|
210
|
+
lastSuccessAt: string | null;
|
|
211
|
+
lastError: string | null;
|
|
212
|
+
consecutiveFailures: number;
|
|
213
|
+
state: string;
|
|
214
|
+
}
|
|
215
|
+
export interface GameHealthBundle {
|
|
216
|
+
bot: {
|
|
217
|
+
enabled: boolean;
|
|
218
|
+
wsConnected: boolean;
|
|
219
|
+
dashboards: number;
|
|
220
|
+
trackedGuilds: number;
|
|
221
|
+
};
|
|
222
|
+
gameApi: {
|
|
223
|
+
status: 'ok' | 'degraded';
|
|
224
|
+
uptimeSec: number;
|
|
225
|
+
itemCount: number;
|
|
226
|
+
seq: number;
|
|
227
|
+
enrichmentQueue: number;
|
|
228
|
+
sources: Record<string, GameSourceHealth>;
|
|
229
|
+
} | null;
|
|
230
|
+
}
|
|
231
|
+
export type GamesWsEvent = {
|
|
232
|
+
op: 'hello';
|
|
233
|
+
connected: boolean;
|
|
234
|
+
wsReady: boolean;
|
|
235
|
+
serverTime: string;
|
|
236
|
+
} | {
|
|
237
|
+
op: 'pong';
|
|
238
|
+
t: number;
|
|
239
|
+
} | {
|
|
240
|
+
op: 'event';
|
|
241
|
+
type: GameDealEventType;
|
|
242
|
+
at: string;
|
|
243
|
+
item: DealItem;
|
|
244
|
+
} | {
|
|
245
|
+
op: 'event';
|
|
246
|
+
type: 'changelog.new';
|
|
247
|
+
at: string;
|
|
248
|
+
changelog: ChangelogEntry;
|
|
249
|
+
};
|
|
250
|
+
export type GameDealEventType = 'deal.new' | 'deal.updated' | 'deal.expired' | 'deal.enriched' | 'free.new' | 'free.upcoming' | 'free.expired' | 'free.weekend' | 'deal.lowest';
|
|
251
|
+
export declare class APIGames {
|
|
252
|
+
private web;
|
|
253
|
+
constructor(web: WebDataManager);
|
|
254
|
+
getConfig({ auth, guildId }: GamesFunctionsInput['getConfig']): Promise<WebResponse<GameConfigResponse>>;
|
|
255
|
+
updateConfig({ auth, guildId, ...body }: GamesFunctionsInput['updateConfig']): Promise<WebResponse<GameConfig>>;
|
|
256
|
+
updateTrackedGames({ auth, guildId, games }: GamesFunctionsInput['updateTrackedGames']): Promise<WebResponse<{
|
|
257
|
+
games: TrackedGame[];
|
|
258
|
+
}>>;
|
|
259
|
+
updateChangelogGames({ auth, guildId, games }: GamesFunctionsInput['updateChangelogGames']): Promise<WebResponse<{
|
|
260
|
+
games: ChangelogGame[];
|
|
261
|
+
}>>;
|
|
262
|
+
updateCategoryRoutes({ auth, guildId, routes }: GamesFunctionsInput['updateCategoryRoutes']): Promise<WebResponse<{
|
|
263
|
+
routes: GameCategoryRoute[];
|
|
264
|
+
}>>;
|
|
265
|
+
getProviders({ auth, guildId }: GamesFunctionsInput['getProviders']): Promise<WebResponse<ProvidersResponse>>;
|
|
266
|
+
getTaxonomy({ auth, guildId, store }: GamesFunctionsInput['getTaxonomy']): Promise<WebResponse<TaxonomyResponse>>;
|
|
267
|
+
getFree({ auth, guildId, store, dlc, playFree }: GamesFunctionsInput['getFree']): Promise<WebResponse<FreeCatalogResponse>>;
|
|
268
|
+
getUpcoming({ auth, guildId, store }: GamesFunctionsInput['getUpcoming']): Promise<WebResponse<FreeCatalogResponse>>;
|
|
269
|
+
getDeals({ auth, guildId, ...query }: GamesFunctionsInput['getDeals']): Promise<WebResponse<DealsCatalogResponse>>;
|
|
270
|
+
getChangelogs({ auth, guildId, appid, kind, limit }: GamesFunctionsInput['getChangelogs']): Promise<WebResponse<ChangelogsResponse>>;
|
|
271
|
+
getHealth({ auth, guildId }: GamesFunctionsInput['getHealth']): Promise<WebResponse<GameHealthBundle>>;
|
|
272
|
+
}
|
|
273
|
+
export type GameDealsQuery = {
|
|
274
|
+
kind?: string;
|
|
275
|
+
store?: string;
|
|
276
|
+
tier?: string;
|
|
277
|
+
minDiscount?: number;
|
|
278
|
+
maxPriceCents?: number;
|
|
279
|
+
aaa?: boolean;
|
|
280
|
+
featured?: boolean;
|
|
281
|
+
freeWeekend?: boolean;
|
|
282
|
+
atLow?: boolean;
|
|
283
|
+
genre?: string;
|
|
284
|
+
tag?: string;
|
|
285
|
+
developer?: string;
|
|
286
|
+
publisher?: string;
|
|
287
|
+
q?: string;
|
|
288
|
+
endingWithinHours?: number;
|
|
289
|
+
minRating?: number;
|
|
290
|
+
sort?: 'updated' | 'discount' | 'ending';
|
|
291
|
+
limit?: number;
|
|
292
|
+
cursor?: string;
|
|
293
|
+
};
|
|
294
|
+
export type GamesFunctionsInput = {
|
|
295
|
+
getConfig: {
|
|
296
|
+
auth: string;
|
|
297
|
+
guildId: string;
|
|
298
|
+
};
|
|
299
|
+
updateConfig: {
|
|
300
|
+
auth: string;
|
|
301
|
+
guildId: string;
|
|
302
|
+
} & Partial<Omit<GameConfig, 'guildId' | 'categoryRoutes' | 'trackedGames' | 'changelogGames'>>;
|
|
303
|
+
updateTrackedGames: {
|
|
304
|
+
auth: string;
|
|
305
|
+
guildId: string;
|
|
306
|
+
games: TrackedGame[];
|
|
307
|
+
};
|
|
308
|
+
updateChangelogGames: {
|
|
309
|
+
auth: string;
|
|
310
|
+
guildId: string;
|
|
311
|
+
games: ChangelogGame[];
|
|
312
|
+
};
|
|
313
|
+
updateCategoryRoutes: {
|
|
314
|
+
auth: string;
|
|
315
|
+
guildId: string;
|
|
316
|
+
routes: GameCategoryRoute[];
|
|
317
|
+
};
|
|
318
|
+
getProviders: {
|
|
319
|
+
auth: string;
|
|
320
|
+
guildId: string;
|
|
321
|
+
};
|
|
322
|
+
getTaxonomy: {
|
|
323
|
+
auth: string;
|
|
324
|
+
guildId: string;
|
|
325
|
+
store?: string;
|
|
326
|
+
};
|
|
327
|
+
getFree: {
|
|
328
|
+
auth: string;
|
|
329
|
+
guildId: string;
|
|
330
|
+
store?: string;
|
|
331
|
+
dlc?: '0' | '1';
|
|
332
|
+
playFree?: '1';
|
|
333
|
+
};
|
|
334
|
+
getUpcoming: {
|
|
335
|
+
auth: string;
|
|
336
|
+
guildId: string;
|
|
337
|
+
store?: string;
|
|
338
|
+
};
|
|
339
|
+
getDeals: {
|
|
340
|
+
auth: string;
|
|
341
|
+
guildId: string;
|
|
342
|
+
} & GameDealsQuery;
|
|
343
|
+
getChangelogs: {
|
|
344
|
+
auth: string;
|
|
345
|
+
guildId: string;
|
|
346
|
+
appid?: number;
|
|
347
|
+
kind?: 'patch' | 'announcement';
|
|
348
|
+
limit?: number;
|
|
349
|
+
};
|
|
350
|
+
getHealth: {
|
|
351
|
+
auth: string;
|
|
352
|
+
guildId: string;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
export type GamesReturnTypes = {
|
|
356
|
+
getConfigRaw: Awaited<ReturnType<APIGames['getConfig']>>;
|
|
357
|
+
getConfigSuccess: CancelOutWebResponses<Awaited<ReturnType<APIGames['getConfig']>>>;
|
|
358
|
+
getDealsSuccess: CancelOutWebResponses<Awaited<ReturnType<APIGames['getDeals']>>>;
|
|
359
|
+
getFreeSuccess: CancelOutWebResponses<Awaited<ReturnType<APIGames['getFree']>>>;
|
|
360
|
+
getProvidersSuccess: CancelOutWebResponses<Awaited<ReturnType<APIGames['getProviders']>>>;
|
|
361
|
+
getTaxonomySuccess: CancelOutWebResponses<Awaited<ReturnType<APIGames['getTaxonomy']>>>;
|
|
362
|
+
getHealthSuccess: CancelOutWebResponses<Awaited<ReturnType<APIGames['getHealth']>>>;
|
|
363
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIGames = void 0;
|
|
4
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
class APIGames {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// ── Config ──────────────────────────────────────────────────────────────
|
|
11
|
+
async getConfig({ auth, guildId }) {
|
|
12
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games`) });
|
|
13
|
+
}
|
|
14
|
+
async updateConfig({ auth, guildId, ...body }) {
|
|
15
|
+
return this.web.request({ method: 'PUT', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games`), body });
|
|
16
|
+
}
|
|
17
|
+
async updateTrackedGames({ auth, guildId, games }) {
|
|
18
|
+
return this.web.request({ method: 'PUT', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/tracked`), body: { games } });
|
|
19
|
+
}
|
|
20
|
+
async updateChangelogGames({ auth, guildId, games }) {
|
|
21
|
+
return this.web.request({ method: 'PUT', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/changelogs`), body: { games } });
|
|
22
|
+
}
|
|
23
|
+
async updateCategoryRoutes({ auth, guildId, routes }) {
|
|
24
|
+
return this.web.request({ method: 'PUT', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/routes`), body: { routes } });
|
|
25
|
+
}
|
|
26
|
+
// ── Catalog (proxied/cached from gameApi by the bot) ──────────────────────
|
|
27
|
+
async getProviders({ auth, guildId }) {
|
|
28
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/providers`) });
|
|
29
|
+
}
|
|
30
|
+
async getTaxonomy({ auth, guildId, store }) {
|
|
31
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/taxonomy`, { store }) });
|
|
32
|
+
}
|
|
33
|
+
async getFree({ auth, guildId, store, dlc, playFree }) {
|
|
34
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/catalog/free`, { store, dlc, playFree }) });
|
|
35
|
+
}
|
|
36
|
+
async getUpcoming({ auth, guildId, store }) {
|
|
37
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/catalog/upcoming`, { store }) });
|
|
38
|
+
}
|
|
39
|
+
async getDeals({ auth, guildId, ...query }) {
|
|
40
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/catalog/deals`, query) });
|
|
41
|
+
}
|
|
42
|
+
async getChangelogs({ auth, guildId, appid, kind, limit }) {
|
|
43
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/catalog/changelogs`, { appid, kind, limit }) });
|
|
44
|
+
}
|
|
45
|
+
async getHealth({ auth, guildId }) {
|
|
46
|
+
return this.web.request({ method: 'GET', auth, endpoint: this.web.qp(`/data/guild/${guildId}/games/health`) });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.APIGames = APIGames;
|
package/dist/classes/guild.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ export declare class APIGuild {
|
|
|
9
9
|
getGuild({ auth, guildId }: GuildFunctionsInput['getGuild']): Promise<import("../types").WebResponse<GuildWithStuff>>;
|
|
10
10
|
updateGuild({ auth, guildId, guild }: GuildFunctionsInput['updateGuild']): Promise<import("../types").WebResponse<string>>;
|
|
11
11
|
getCustomBotProfile({ auth, guildId }: GuildFunctionsInput['getCustomBotProfile']): Promise<import("../types").WebResponse<GetCustomBotProfileResponse>>;
|
|
12
|
-
updateCustomBotProfile({ auth, guildId, formData }: GuildFunctionsInput['updateCustomBotProfile']): Promise<import("../types").WebResponse<
|
|
12
|
+
updateCustomBotProfile({ auth, guildId, formData }: GuildFunctionsInput['updateCustomBotProfile']): Promise<import("../types").WebResponse<GetCustomBotProfileResponse>>;
|
|
13
13
|
getGuildErrors({ auth, guildId }: GuildFunctionsInput['getGuildErrors']): Promise<import("../types").WebResponse<GuildErrors>>;
|
|
14
14
|
clearGuildErrors({ auth, guildId }: GuildFunctionsInput['clearGuildErrors']): Promise<import("../types").WebResponse<string>>;
|
|
15
15
|
sendGuildPanelOrNotification<T extends SendPanelType>({ auth, guildId, panel, body }: GuildFunctionsInput<T>['sendGuildPanelOrNotification']): Promise<import("../types").WebResponse<string>>;
|
|
16
|
-
sendTestKickBotNotification({ auth, guildId,
|
|
16
|
+
sendTestKickBotNotification({ auth, guildId, streamerUserName, type, dontPing }: GuildFunctionsInput['sendTestKickBotNotification']): Promise<import("../types").WebResponse<string>>;
|
|
17
17
|
sendGreetOrBirthdayMessage({ auth, guildId, type }: GuildFunctionsInput['sendGreetOrBirthdayMessage']): Promise<import("../types").WebResponse<string>>;
|
|
18
18
|
createOrUpdateGuildMessage<T extends GuildMessageType, S extends GuildMessageSubType<T>>({ auth, guildId, messageType, messageSubType, data }: GuildFunctionsInput<never, T, S>['createOrUpdateGuildMessage']): Promise<import("../types").WebResponse<string>>;
|
|
19
19
|
deleteGuildMessage<T extends GuildMessageType, S extends GuildMessageSubType<T>>({ auth, guildId, messageType, messageSubType }: GuildFunctionsInput<never, T, S>['deleteGuildMessage']): Promise<import("../types").WebResponse<string>>;
|
|
@@ -55,8 +55,9 @@ export type GuildFunctionsInput<T extends SendPanelType = never, T2 extends Guil
|
|
|
55
55
|
'sendTestKickBotNotification': {
|
|
56
56
|
auth: string;
|
|
57
57
|
guildId: string;
|
|
58
|
-
|
|
58
|
+
streamerUserName: string;
|
|
59
59
|
type: 'vod' | 'clip';
|
|
60
|
+
dontPing?: boolean;
|
|
60
61
|
};
|
|
61
62
|
'getGuildErrors': {
|
|
62
63
|
auth: string;
|
package/dist/classes/guild.js
CHANGED
|
@@ -53,11 +53,12 @@ class APIGuild {
|
|
|
53
53
|
endpoint: this.web.qp('/data/guild/' + guildId + '/panel/' + panel),
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
async sendTestKickBotNotification({ auth, guildId,
|
|
56
|
+
async sendTestKickBotNotification({ auth, guildId, streamerUserName, type, dontPing }) {
|
|
57
57
|
return await this.web.request({
|
|
58
58
|
method: 'PUT', auth,
|
|
59
|
+
body: { streamerUserName },
|
|
59
60
|
endpoint: this.web.qp('/data/guild/' + guildId + '/kickbot/' + type, {
|
|
60
|
-
|
|
61
|
+
dontPing: dontPing,
|
|
61
62
|
}),
|
|
62
63
|
});
|
|
63
64
|
}
|
|
@@ -78,8 +78,10 @@ export type GuildGiveawayFunctionsInput<T extends WhenCreate = never> = {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
export type GuildGiveawayReturnTypes = {
|
|
81
|
-
'
|
|
82
|
-
'
|
|
81
|
+
'getGuildGiveawaysRaw': Awaited<ReturnType<APIGuildGiveaway['getGuildGiveaways']>>;
|
|
82
|
+
'getGuildGiveawaysSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['getGuildGiveaways']>>>;
|
|
83
|
+
'getGuildGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['getGuildGiveaway']>>;
|
|
84
|
+
'getGuildGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['getGuildGiveaway']>>>;
|
|
83
85
|
'getGuildGiveawayEntriesRaw': Awaited<ReturnType<APIGuildGiveaway['getGuildGiveawayEntries']>>;
|
|
84
86
|
'getGuildGiveawayEntriesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['getGuildGiveawayEntries']>>>;
|
|
85
87
|
'createGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['createGiveaway']>>;
|
|
@@ -88,6 +90,8 @@ export type GuildGiveawayReturnTypes = {
|
|
|
88
90
|
'updateGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['updateGiveaway']>>>;
|
|
89
91
|
'resendGiveawayMessageRaw': Awaited<ReturnType<APIGuildGiveaway['resendGiveawayMessage']>>;
|
|
90
92
|
'resendGiveawayMessageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['resendGiveawayMessage']>>>;
|
|
93
|
+
'startScheduledGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['startScheduledGiveaway']>>;
|
|
94
|
+
'startScheduledGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['startScheduledGiveaway']>>>;
|
|
91
95
|
'deleteGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['deleteGiveaway']>>;
|
|
92
96
|
'deleteGiveawaySuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuildGiveaway['deleteGiveaway']>>>;
|
|
93
97
|
'endGiveawayRaw': Awaited<ReturnType<APIGuildGiveaway['endGiveaway']>>;
|