@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
|
@@ -10,12 +10,13 @@ export declare class APIPremium {
|
|
|
10
10
|
getPremiumPlans({ refreshCache }: PremiumFunctionsInput['getPremiumPlans']): Promise<import("../types").WebResponse<PremiumPlans>>;
|
|
11
11
|
getPremiumPlan<T extends boolean>({ planId, includeFreeAmountOfAddons }: PremiumFunctionsInput<never, T>['getPremiumPlan']): Promise<import("../types").WebResponse<PremiumPlan<T>>>;
|
|
12
12
|
createCheckoutSession<T extends 'guild' | 'user'>({ auth, body, type }: PremiumFunctionsInput<T>['createCheckoutSession']): Promise<import("../types").WebResponse<string>>;
|
|
13
|
-
getAllUserSubscriptions({ auth }: PremiumFunctionsInput<never>['getAllUserSubscriptions']): Promise<import("../types").WebResponse<AllSubscriptions>>;
|
|
13
|
+
getAllUserSubscriptions({ auth, force }: PremiumFunctionsInput<never>['getAllUserSubscriptions']): Promise<import("../types").WebResponse<AllSubscriptions>>;
|
|
14
14
|
changePaymentMethods({ auth }: PremiumFunctionsInput<never>['changePaymentMethods']): Promise<import("../types").WebResponse<string>>;
|
|
15
15
|
changeSubscriptionTier({ auth, body }: PremiumFunctionsInput<never>['changeSubscriptionTier']): Promise<import("../types").WebResponse<string>>;
|
|
16
16
|
changeSubscriptionAddons({ auth, body }: PremiumFunctionsInput<never>['changeSubscriptionAddons']): Promise<import("../types").WebResponse<string>>;
|
|
17
|
-
cancelSubscription({ auth, subscriptionId }: PremiumFunctionsInput<never>['cancelSubscription']): Promise<import("../types").WebResponse<string>>;
|
|
17
|
+
cancelSubscription({ auth, subscriptionId, immediately }: PremiumFunctionsInput<never>['cancelSubscription']): Promise<import("../types").WebResponse<string>>;
|
|
18
18
|
syncStripeSubscriptions({ auth }: PremiumFunctionsInput<never>['syncStripeSubscriptions']): Promise<import("../types").WebResponse<SyncSubscriptionsResponse>>;
|
|
19
|
+
adjustCustomerBalance({ auth, body }: PremiumFunctionsInput['adjustCustomerBalance']): Promise<import("../types").WebResponse<AdjustCustomerBalanceResponse>>;
|
|
19
20
|
}
|
|
20
21
|
export type PremiumFunctionsInput<T extends 'guild' | 'user' = never, I extends boolean = never> = {
|
|
21
22
|
'getPremumData': {
|
|
@@ -43,6 +44,7 @@ export type PremiumFunctionsInput<T extends 'guild' | 'user' = never, I extends
|
|
|
43
44
|
};
|
|
44
45
|
'getAllUserSubscriptions': {
|
|
45
46
|
auth: string;
|
|
47
|
+
force?: boolean;
|
|
46
48
|
};
|
|
47
49
|
'changePaymentMethods': {
|
|
48
50
|
auth: string;
|
|
@@ -58,10 +60,15 @@ export type PremiumFunctionsInput<T extends 'guild' | 'user' = never, I extends
|
|
|
58
60
|
'cancelSubscription': {
|
|
59
61
|
auth: string;
|
|
60
62
|
subscriptionId: string;
|
|
63
|
+
immediately?: boolean;
|
|
61
64
|
};
|
|
62
65
|
'syncStripeSubscriptions': {
|
|
63
66
|
auth: string;
|
|
64
67
|
};
|
|
68
|
+
'adjustCustomerBalance': {
|
|
69
|
+
auth: string;
|
|
70
|
+
body: AdjustCustomerBalanceBody;
|
|
71
|
+
};
|
|
65
72
|
};
|
|
66
73
|
export type PremiumReturnTypes = {
|
|
67
74
|
'getPremumDataRaw': Awaited<ReturnType<APIPremium['getPremumData']>>;
|
|
@@ -86,6 +93,8 @@ export type PremiumReturnTypes = {
|
|
|
86
93
|
'cancelSubscriptionSuccess': CancelOutWebResponses<Awaited<ReturnType<APIPremium['cancelSubscription']>>>;
|
|
87
94
|
'syncStripeSubscriptionsRaw': Awaited<ReturnType<APIPremium['syncStripeSubscriptions']>>;
|
|
88
95
|
'syncStripeSubscriptionsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIPremium['syncStripeSubscriptions']>>>;
|
|
96
|
+
'adjustCustomerBalanceRaw': Awaited<ReturnType<APIPremium['adjustCustomerBalance']>>;
|
|
97
|
+
'adjustCustomerBalanceSuccess': CancelOutWebResponses<Awaited<ReturnType<APIPremium['adjustCustomerBalance']>>>;
|
|
89
98
|
};
|
|
90
99
|
export type CreateCheckoutSessionBody<T extends 'guild' | 'user'> = T extends 'guild' ? {
|
|
91
100
|
email: string;
|
|
@@ -115,6 +124,14 @@ export type PremiumPlans = {
|
|
|
115
124
|
addonId: string;
|
|
116
125
|
priceCents: number;
|
|
117
126
|
isActive: boolean;
|
|
127
|
+
currency: string;
|
|
128
|
+
}[];
|
|
129
|
+
addonMetadata: {
|
|
130
|
+
addonId: string;
|
|
131
|
+
name: string;
|
|
132
|
+
priceCents: number;
|
|
133
|
+
isBoolean: boolean;
|
|
134
|
+
isActive: boolean;
|
|
118
135
|
}[];
|
|
119
136
|
};
|
|
120
137
|
export type PortalData = {
|
|
@@ -131,10 +148,12 @@ export type PremiumPlan<T extends boolean> = T extends true ? PremiumPlanType &
|
|
|
131
148
|
} : PremiumPlanType;
|
|
132
149
|
export type UpdatePremiumData<T extends 'guild' | 'user'> = T extends 'guild' ? {
|
|
133
150
|
newPlanId?: string;
|
|
134
|
-
newBitfield?: string;
|
|
135
|
-
overrideBranding?: boolean;
|
|
151
|
+
newBitfield?: string | null;
|
|
152
|
+
overrideBranding?: boolean | null;
|
|
153
|
+
vodDownloadStoreForHours?: number | null;
|
|
136
154
|
} & ListOfDefaultItems : T extends 'user' ? {
|
|
137
|
-
newPlanId
|
|
155
|
+
newPlanId?: string;
|
|
156
|
+
newBitfield?: string | null;
|
|
138
157
|
} : never;
|
|
139
158
|
export type ListOfDefaultItems = Partial<Omit<NonNullable<DeepRequired<Guild>['premium']>, 'tier' | 'enabled' | 'dbId' | 'guildId'>>;
|
|
140
159
|
export type RemoveAdditional<T> = T extends `additional${infer Rest}` ? Rest : T;
|
|
@@ -145,8 +164,9 @@ export type SliceAdditionalFromItem = {
|
|
|
145
164
|
export type PremiumData<T extends 'guild' | 'user'> = T extends 'guild' ? {
|
|
146
165
|
bitfield: Guild['bitfield'];
|
|
147
166
|
premium: Guild['premium'];
|
|
148
|
-
overrideBranding: Guild['overrideBranding'];
|
|
149
167
|
freeTierInfo: SliceAdditionalFromItem;
|
|
168
|
+
vodDownloadStoreForHours: Guild['vodDownloadStoreForHours'];
|
|
169
|
+
overrideBranding: Guild['overrideBranding'];
|
|
150
170
|
} : T extends 'user' ? {
|
|
151
171
|
badges: User['badges'];
|
|
152
172
|
bitfield: User['bitfield'];
|
|
@@ -171,11 +191,34 @@ export type AllSubscriptions = {
|
|
|
171
191
|
guilds: (PremiumSubscription & {
|
|
172
192
|
guildId: string;
|
|
173
193
|
})[];
|
|
194
|
+
unpaidInvoices: {
|
|
195
|
+
id: string;
|
|
196
|
+
amountDueCents: number;
|
|
197
|
+
amountPaidCents: number;
|
|
198
|
+
status: string | null;
|
|
199
|
+
dueDate: string | null;
|
|
200
|
+
url: string | null;
|
|
201
|
+
createdAt: string;
|
|
202
|
+
}[];
|
|
174
203
|
};
|
|
175
204
|
export type ChangeSubscriptionTierBody = {
|
|
176
205
|
subscriptionId: string;
|
|
177
206
|
newTierId: string;
|
|
178
207
|
};
|
|
208
|
+
export type AdjustCustomerBalanceBody = {
|
|
209
|
+
customerId: string;
|
|
210
|
+
balanceAdjustmentCents: number;
|
|
211
|
+
reason: string;
|
|
212
|
+
};
|
|
213
|
+
export type AdjustCustomerBalanceResponse = {
|
|
214
|
+
success: true;
|
|
215
|
+
customerId: string;
|
|
216
|
+
previousBalance: number;
|
|
217
|
+
newBalance: number;
|
|
218
|
+
adjustment: number;
|
|
219
|
+
reason: string;
|
|
220
|
+
timestamp: string;
|
|
221
|
+
};
|
|
179
222
|
export type ChangeSubscriptionAddonsBody = {
|
|
180
223
|
subscriptionId: string;
|
|
181
224
|
newAddons: {
|
|
@@ -187,9 +230,9 @@ export type SyncSubscriptionsResponse = {
|
|
|
187
230
|
status: 200;
|
|
188
231
|
message: string;
|
|
189
232
|
synced: number;
|
|
190
|
-
created
|
|
191
|
-
updated
|
|
192
|
-
alreadyCorrect
|
|
233
|
+
created?: number;
|
|
234
|
+
updated?: number;
|
|
235
|
+
alreadyCorrect?: number;
|
|
193
236
|
errors?: Array<{
|
|
194
237
|
guildId: string;
|
|
195
238
|
subscriptionId: string;
|
package/dist/classes/premium.js
CHANGED
|
@@ -42,10 +42,12 @@ class APIPremium {
|
|
|
42
42
|
endpoint: this.web.qp('/stripe/sessions/' + type),
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
async getAllUserSubscriptions({ auth }) {
|
|
45
|
+
async getAllUserSubscriptions({ auth, force }) {
|
|
46
46
|
return await this.web.request({
|
|
47
47
|
method: 'GET', auth,
|
|
48
|
-
endpoint: this.web.qp('/stripe/subscriptions'
|
|
48
|
+
endpoint: this.web.qp('/stripe/subscriptions', {
|
|
49
|
+
force: force || false,
|
|
50
|
+
}),
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
async changePaymentMethods({ auth }) {
|
|
@@ -66,10 +68,12 @@ class APIPremium {
|
|
|
66
68
|
endpoint: this.web.qp('/stripe/subscriptions/addons'),
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
|
-
async cancelSubscription({ auth, subscriptionId }) {
|
|
71
|
+
async cancelSubscription({ auth, subscriptionId, immediately }) {
|
|
70
72
|
return await this.web.request({
|
|
71
73
|
method: 'DELETE', auth,
|
|
72
|
-
endpoint: this.web.qp('/stripe/subscriptions/' + subscriptionId
|
|
74
|
+
endpoint: this.web.qp('/stripe/subscriptions/' + subscriptionId, {
|
|
75
|
+
immediately: immediately || false,
|
|
76
|
+
}),
|
|
73
77
|
});
|
|
74
78
|
}
|
|
75
79
|
async syncStripeSubscriptions({ auth }) {
|
|
@@ -78,5 +82,11 @@ class APIPremium {
|
|
|
78
82
|
endpoint: this.web.qp('/stripe/sync-subscriptions'),
|
|
79
83
|
});
|
|
80
84
|
}
|
|
85
|
+
async adjustCustomerBalance({ auth, body }) {
|
|
86
|
+
return await this.web.request({
|
|
87
|
+
method: 'POST', auth, body,
|
|
88
|
+
endpoint: this.web.qp('/support/customer-balance'),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
92
|
exports.APIPremium = APIPremium;
|
|
@@ -5,7 +5,7 @@ export declare class APISessions {
|
|
|
5
5
|
private web;
|
|
6
6
|
constructor(web: WebDataManager);
|
|
7
7
|
checkSession({ auth }: SessionsFunctionsInput['checkSession']): Promise<import("../types").WebResponse<boolean>>;
|
|
8
|
-
postSession({ code, auth, addToServer }: SessionsFunctionsInput['postSession']): Promise<import("../types").WebResponse<SessionPostReturnType>>;
|
|
8
|
+
postSession({ code, auth, addToServer, state }: SessionsFunctionsInput['postSession']): Promise<import("../types").WebResponse<SessionPostReturnType>>;
|
|
9
9
|
deleteSession({ auth }: SessionsFunctionsInput['deleteSession']): Promise<import("../types").WebResponse<true>>;
|
|
10
10
|
}
|
|
11
11
|
export type SessionsFunctionsInput = {
|
|
@@ -16,6 +16,7 @@ export type SessionsFunctionsInput = {
|
|
|
16
16
|
code: string;
|
|
17
17
|
auth: string;
|
|
18
18
|
addToServer?: boolean;
|
|
19
|
+
state?: string;
|
|
19
20
|
};
|
|
20
21
|
'deleteSession': {
|
|
21
22
|
auth: string;
|
package/dist/classes/sessions.js
CHANGED
|
@@ -14,11 +14,12 @@ class APISessions {
|
|
|
14
14
|
endpoint: this.web.qp('/sessions'),
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
async postSession({ code, auth, addToServer }) {
|
|
17
|
+
async postSession({ code, auth, addToServer, state }) {
|
|
18
18
|
return await this.web.request({
|
|
19
19
|
method: 'POST', auth,
|
|
20
20
|
endpoint: this.web.qp('/sessions', {
|
|
21
21
|
code,
|
|
22
|
+
state,
|
|
22
23
|
add: addToServer || true,
|
|
23
24
|
}),
|
|
24
25
|
});
|
package/dist/classes/teams.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { CancelOutWebResponses, DeepPartial } from '../types';
|
|
2
|
+
import { Team, TeamZod } from '../other/prisma';
|
|
1
3
|
import { WebDataManager } from '../core/manager';
|
|
2
|
-
import { CancelOutWebResponses } from '../types';
|
|
3
|
-
import { Team } from '../other/prisma';
|
|
4
4
|
export declare class APITeams {
|
|
5
5
|
private web;
|
|
6
6
|
constructor(web: WebDataManager);
|
|
7
7
|
getAllUserTeams({ auth }: TeamsFunctionsInput['getAllUserTeams']): Promise<import("../types").WebResponse<TeamsGetType>>;
|
|
8
|
-
createTeam({ auth,
|
|
8
|
+
createTeam({ auth, team }: TeamsFunctionsInput['createTeam']): Promise<import("../types").WebResponse<string>>;
|
|
9
9
|
joinOrLeaveTeam({ auth, teamOrCode, action }: TeamsFunctionsInput['joinOrLeaveTeam']): Promise<import("../types").WebResponse<string>>;
|
|
10
10
|
createTeamInvite({ auth, teamId, maxUses, bitfieldToSet, expiresAt }: TeamsFunctionsInput['createTeamInvite']): Promise<import("../types").WebResponse<string>>;
|
|
11
11
|
kickTeamMember({ auth, teamId, userId }: TeamsFunctionsInput['kickTeamMember']): Promise<import("../types").WebResponse<string>>;
|
|
12
12
|
updateMemberPermissions({ auth, teamId, userId, bitfieldToSet }: TeamsFunctionsInput['updateMemberPermissions']): Promise<import("../types").WebResponse<string>>;
|
|
13
|
-
|
|
14
|
-
deleteTeam({ auth, teamId }: TeamsFunctionsInput['
|
|
13
|
+
updateTeam({ auth, teamId, team }: TeamsFunctionsInput['updateTeam']): Promise<import("../types").WebResponse<string>>;
|
|
14
|
+
deleteTeam({ auth, teamId }: TeamsFunctionsInput['deleteTeam']): Promise<import("../types").WebResponse<string>>;
|
|
15
15
|
}
|
|
16
16
|
export type TeamsFunctionsInput = {
|
|
17
17
|
'getAllUserTeams': {
|
|
@@ -19,7 +19,7 @@ export type TeamsFunctionsInput = {
|
|
|
19
19
|
};
|
|
20
20
|
'createTeam': {
|
|
21
21
|
auth: string;
|
|
22
|
-
|
|
22
|
+
team: DeepPartial<TeamZod>;
|
|
23
23
|
};
|
|
24
24
|
'joinOrLeaveTeam': {
|
|
25
25
|
auth: string;
|
|
@@ -29,9 +29,9 @@ export type TeamsFunctionsInput = {
|
|
|
29
29
|
'createTeamInvite': {
|
|
30
30
|
auth: string;
|
|
31
31
|
teamId: string;
|
|
32
|
-
maxUses: number;
|
|
33
32
|
bitfieldToSet: string;
|
|
34
|
-
|
|
33
|
+
maxUses?: number;
|
|
34
|
+
expiresAt?: number;
|
|
35
35
|
};
|
|
36
36
|
'kickTeamMember': {
|
|
37
37
|
auth: string;
|
|
@@ -44,10 +44,10 @@ export type TeamsFunctionsInput = {
|
|
|
44
44
|
userId: string;
|
|
45
45
|
bitfieldToSet: string;
|
|
46
46
|
};
|
|
47
|
-
'
|
|
47
|
+
'updateTeam': {
|
|
48
48
|
auth: string;
|
|
49
49
|
teamId: string;
|
|
50
|
-
|
|
50
|
+
team: DeepPartial<TeamZod>;
|
|
51
51
|
};
|
|
52
52
|
'deleteTeam': {
|
|
53
53
|
auth: string;
|
|
@@ -67,18 +67,23 @@ export type TeamsGetReturnTypes = {
|
|
|
67
67
|
'kickTeamMemberSuccess': CancelOutWebResponses<Awaited<ReturnType<APITeams['kickTeamMember']>>>;
|
|
68
68
|
'updateMemberPermissionsRaw': Awaited<ReturnType<APITeams['updateMemberPermissions']>>;
|
|
69
69
|
'updateMemberPermissionsSuccess': CancelOutWebResponses<Awaited<ReturnType<APITeams['updateMemberPermissions']>>>;
|
|
70
|
-
'
|
|
71
|
-
'
|
|
70
|
+
'updateTeamRaw': Awaited<ReturnType<APITeams['updateTeam']>>;
|
|
71
|
+
'updateTeamSuccess': CancelOutWebResponses<Awaited<ReturnType<APITeams['updateTeam']>>>;
|
|
72
72
|
'deleteTeamRaw': Awaited<ReturnType<APITeams['deleteTeam']>>;
|
|
73
73
|
'deleteTeamSuccess': CancelOutWebResponses<Awaited<ReturnType<APITeams['deleteTeam']>>>;
|
|
74
74
|
};
|
|
75
|
+
export type TeamInviteBody = {
|
|
76
|
+
bitfieldToSet: string;
|
|
77
|
+
maxUses?: number;
|
|
78
|
+
expiresAt?: number;
|
|
79
|
+
};
|
|
75
80
|
export type TeamsGetType = {
|
|
76
|
-
managedTeam: Team & {
|
|
81
|
+
managedTeam: (Team & {
|
|
77
82
|
teamMembers: (Team['teamMembers'][number] & {
|
|
78
83
|
username: string | null;
|
|
79
84
|
kickUsername: string | null;
|
|
80
85
|
})[];
|
|
81
|
-
};
|
|
86
|
+
}) | null;
|
|
82
87
|
memberTeams: {
|
|
83
88
|
teamId: string;
|
|
84
89
|
teamName: string;
|
package/dist/classes/teams.js
CHANGED
|
@@ -14,11 +14,10 @@ class APITeams {
|
|
|
14
14
|
endpoint: this.web.qp('/data/teams'),
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
async createTeam({ auth,
|
|
17
|
+
async createTeam({ auth, team }) {
|
|
18
18
|
return await this.web.request({
|
|
19
|
-
method: 'POST', auth,
|
|
19
|
+
method: 'POST', auth, body: team,
|
|
20
20
|
endpoint: this.web.qp('/data/teams'),
|
|
21
|
-
body: { teamName },
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
async joinOrLeaveTeam({ auth, teamOrCode, action }) {
|
|
@@ -31,29 +30,28 @@ class APITeams {
|
|
|
31
30
|
async createTeamInvite({ auth, teamId, maxUses, bitfieldToSet, expiresAt }) {
|
|
32
31
|
return await this.web.request({
|
|
33
32
|
method: 'PUT', auth,
|
|
34
|
-
endpoint: this.web.qp(`/data/teams/${teamId}/invite`),
|
|
35
33
|
body: { maxUses, bitfieldToSet, expiresAt },
|
|
34
|
+
endpoint: this.web.qp(`/data/teams/${teamId}/invite`),
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
37
|
async kickTeamMember({ auth, teamId, userId }) {
|
|
39
38
|
return await this.web.request({
|
|
40
39
|
method: 'PUT', auth,
|
|
41
|
-
endpoint: this.web.qp(`/data/teams/${teamId}/kick`),
|
|
42
40
|
body: { userId },
|
|
41
|
+
endpoint: this.web.qp(`/data/teams/${teamId}/kick`),
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
44
|
async updateMemberPermissions({ auth, teamId, userId, bitfieldToSet }) {
|
|
46
45
|
return await this.web.request({
|
|
47
46
|
method: 'PUT', auth,
|
|
48
|
-
endpoint: this.web.qp(`/data/teams/${teamId}/update`),
|
|
49
47
|
body: { userId, bitfieldToSet },
|
|
48
|
+
endpoint: this.web.qp(`/data/teams/${teamId}/update`),
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
|
-
async
|
|
51
|
+
async updateTeam({ auth, teamId, team }) {
|
|
53
52
|
return await this.web.request({
|
|
54
|
-
method: 'PATCH', auth,
|
|
53
|
+
method: 'PATCH', auth, body: team,
|
|
55
54
|
endpoint: this.web.qp(`/data/teams/${teamId}`),
|
|
56
|
-
body: { teamName },
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
57
|
async deleteTeam({ auth, teamId }) {
|
package/dist/classes/user.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class APIUser {
|
|
|
7
7
|
constructor(web: WebDataManager);
|
|
8
8
|
getUser({ auth, userId }: UserFunctionsInput['getUser']): Promise<import("../types").WebResponse<UserResponse>>;
|
|
9
9
|
updateUser({ auth, userId, user }: UserFunctionsInput['updateUser']): Promise<import("../types").WebResponse<string>>;
|
|
10
|
-
deleteUser({ auth, userId }: UserFunctionsInput['
|
|
10
|
+
deleteUser({ auth, userId }: UserFunctionsInput['deleteUser']): Promise<import("../types").WebResponse<string>>;
|
|
11
11
|
}
|
|
12
12
|
export type UserFunctionsInput = {
|
|
13
13
|
'getUser': {
|
package/dist/classes/vods.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type VodsFunctionsInput = {
|
|
|
25
25
|
fileKey: string;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export type
|
|
28
|
+
export type VodsReturnTypes = {
|
|
29
29
|
'getTotalFilesRaw': Awaited<ReturnType<APIVods['getTotalFiles']>>;
|
|
30
30
|
'getTotalFilesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIVods['getTotalFiles']>>>;
|
|
31
31
|
'getGuildFileVodDataRaw': Awaited<ReturnType<APIVods['getGuildFileVodData']>>;
|
|
@@ -42,14 +42,20 @@ export type VodResponse = {
|
|
|
42
42
|
export type VodGuildFileData = {
|
|
43
43
|
guildId: string;
|
|
44
44
|
allowedUntil: Date;
|
|
45
|
+
thumbnail: string | null;
|
|
45
46
|
tempUrl: string;
|
|
46
47
|
};
|
|
48
|
+
export type VodAllowedGuild = {
|
|
49
|
+
guildId: string;
|
|
50
|
+
allowedUntil: Date | null;
|
|
51
|
+
};
|
|
47
52
|
export type VodFileData = {
|
|
48
53
|
key: string;
|
|
49
54
|
contentType?: string;
|
|
50
55
|
contentLength?: number;
|
|
51
56
|
lastModified?: number;
|
|
52
57
|
expiresAt?: string;
|
|
53
|
-
allowedGuilds:
|
|
58
|
+
allowedGuilds: VodAllowedGuild[];
|
|
59
|
+
thumbnail: string | null;
|
|
54
60
|
tempUrl: string;
|
|
55
61
|
};
|
package/dist/core/manager.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { APIGuildPlatform } from '../classes/guildPlatform';
|
|
|
4
4
|
import { APIGuildGiveaway } from '../classes/guildGiveaway';
|
|
5
5
|
import { APIGuildDrops } from '../classes/guildDrops';
|
|
6
6
|
import { APIDropsGames } from '../classes/dropsGames';
|
|
7
|
+
import { APIGames } from '../classes/games';
|
|
7
8
|
import { AxiosResponse } from 'axios';
|
|
8
9
|
import { RequestMethod, WebResponse } from '../types';
|
|
9
10
|
import { APITelemetry } from '../classes/telemetry';
|
|
@@ -47,6 +48,7 @@ export declare class WebDataManager {
|
|
|
47
48
|
readonly guildGiveaway: APIGuildGiveaway;
|
|
48
49
|
readonly guildStarboard: APIGuildStarboard;
|
|
49
50
|
readonly guildPlatformAction: APIPlatformAction;
|
|
51
|
+
readonly games: APIGames;
|
|
50
52
|
constructor(url: string, options?: {
|
|
51
53
|
log?: boolean;
|
|
52
54
|
} | undefined);
|
package/dist/core/manager.js
CHANGED
|
@@ -10,6 +10,7 @@ const guildPlatform_1 = require("../classes/guildPlatform");
|
|
|
10
10
|
const guildGiveaway_1 = require("../classes/guildGiveaway");
|
|
11
11
|
const guildDrops_1 = require("../classes/guildDrops");
|
|
12
12
|
const dropsGames_1 = require("../classes/dropsGames");
|
|
13
|
+
const games_1 = require("../classes/games");
|
|
13
14
|
const axios_1 = __importDefault(require("axios"));
|
|
14
15
|
const telemetry_1 = require("../classes/telemetry");
|
|
15
16
|
const sessions_1 = require("../classes/sessions");
|
|
@@ -51,6 +52,7 @@ class WebDataManager {
|
|
|
51
52
|
guildGiveaway = new guildGiveaway_1.APIGuildGiveaway(this);
|
|
52
53
|
guildStarboard = new guildStarboard_1.APIGuildStarboard(this);
|
|
53
54
|
guildPlatformAction = new guildPlatformAction_1.APIPlatformAction(this);
|
|
55
|
+
games = new games_1.APIGames(this);
|
|
54
56
|
constructor(url, options) {
|
|
55
57
|
this.url = url;
|
|
56
58
|
this.options = options;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './classes/guildPlatform';
|
|
|
21
21
|
export * from './classes/guildGiveaway';
|
|
22
22
|
export * from './classes/guildStarboard';
|
|
23
23
|
export * from './classes/guildPlatformAction';
|
|
24
|
+
export * from './classes/games';
|
|
24
25
|
export { GuildMessageTypeEnum, StreamerMessageTypeEnum, PlatformEnum, $Enums } from './other/enums';
|
|
25
26
|
export type { Prisma, TSPrisma } from '@prisma/client';
|
|
26
27
|
export type { ClientChangelog, Guild, User, Team, Member, KickStreamer, TwitchStreamer, YoutubeStreamer, TiktokStreamer, RumbleStreamer, GuildGiveaway } from '@prisma/client';
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __exportStar(require("./classes/guildPlatform"), exports);
|
|
|
38
38
|
__exportStar(require("./classes/guildGiveaway"), exports);
|
|
39
39
|
__exportStar(require("./classes/guildStarboard"), exports);
|
|
40
40
|
__exportStar(require("./classes/guildPlatformAction"), exports);
|
|
41
|
+
__exportStar(require("./classes/games"), exports);
|
|
41
42
|
// Re-export Prisma generated enums (browser-safe)
|
|
42
43
|
var enums_1 = require("./other/enums");
|
|
43
44
|
Object.defineProperty(exports, "GuildMessageTypeEnum", { enumerable: true, get: function () { return enums_1.GuildMessageTypeEnum; } });
|
package/dist/other/prisma.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { R2StorageZod } from './zod/r2Storage.zod';
|
|
|
12
12
|
import { MemberZod } from './zod/member.zod';
|
|
13
13
|
import { ClientZod } from './zod/client.zod';
|
|
14
14
|
import { GuildZod } from './zod/guild.zod';
|
|
15
|
+
import { GameConfigZod } from './zod/gameConfig.zod';
|
|
15
16
|
import { DropsZod } from './zod/drops.zod';
|
|
16
17
|
import { UserZod } from './zod/user.zod';
|
|
17
18
|
import { TeamZod } from './zod/team.zod';
|
|
@@ -59,6 +60,10 @@ export type GuildDropsWebhookZod = z.infer<typeof DropsZod.GuildDropsWebhookSche
|
|
|
59
60
|
export type GuildDropsGameZod = z.infer<typeof DropsZod.GuildDropsGameSchema>;
|
|
60
61
|
export type GuildDropsGameWebhookZod = z.infer<typeof DropsZod.GuildDropsGameWebhookSchema>;
|
|
61
62
|
export type SentDropZod = z.infer<typeof DropsZod.SentDropSchema>;
|
|
63
|
+
export type GameConfigZod = z.infer<typeof GameConfigZod.GuildGameConfigSchema>;
|
|
64
|
+
export type GuildGameCategoryRouteZod = z.infer<typeof GameConfigZod.GuildGameCategoryRouteSchema>;
|
|
65
|
+
export type GuildTrackedGameZod = z.infer<typeof GameConfigZod.GuildTrackedGameSchema>;
|
|
66
|
+
export type GuildGameChangelogZod = z.infer<typeof GameConfigZod.GuildGameChangelogSchema>;
|
|
62
67
|
export type AllPlatforms = (typeof PlatformEnum)[keyof typeof PlatformEnum];
|
|
63
68
|
export type AllPlatformsWithVideos = Enums['PlatformsWithVideosEnum'];
|
|
64
69
|
export type PlatformsToLinkType = typeof PlatformsToLink[number];
|
|
@@ -0,0 +1,134 @@
|
|
|
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], GameConfigRelations>>;
|
|
6
|
+
export type GameConfigRelations = 'db' | 'gameConfig';
|
|
7
|
+
export declare const GameConfigZod: {
|
|
8
|
+
readonly GuildGameConfigSchema: z.ZodObject<{
|
|
9
|
+
guildId: z.ZodString;
|
|
10
|
+
enabled: z.ZodBoolean;
|
|
11
|
+
notificationChannelId: z.ZodNullable<z.ZodString>;
|
|
12
|
+
pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
13
|
+
deliveryMode: z.ZodEnum<{
|
|
14
|
+
weekly: "weekly";
|
|
15
|
+
instant: "instant";
|
|
16
|
+
daily: "daily";
|
|
17
|
+
}>;
|
|
18
|
+
digestHourUTC: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
digestWeekday: z.ZodNullable<z.ZodNumber>;
|
|
20
|
+
freeGamesEnabled: z.ZodBoolean;
|
|
21
|
+
freeDlcEnabled: z.ZodBoolean;
|
|
22
|
+
freeGameStores: z.ZodArray<z.ZodEnum<{
|
|
23
|
+
steam: "steam";
|
|
24
|
+
epic: "epic";
|
|
25
|
+
gog: "gog";
|
|
26
|
+
prime: "prime";
|
|
27
|
+
}>>;
|
|
28
|
+
upcomingFreeEnabled: z.ZodBoolean;
|
|
29
|
+
freeWeekendEnabled: z.ZodBoolean;
|
|
30
|
+
discountsEnabled: z.ZodBoolean;
|
|
31
|
+
discountStores: z.ZodArray<z.ZodEnum<{
|
|
32
|
+
steam: "steam";
|
|
33
|
+
epic: "epic";
|
|
34
|
+
gog: "gog";
|
|
35
|
+
prime: "prime";
|
|
36
|
+
}>>;
|
|
37
|
+
minDiscountPercent: z.ZodNullable<z.ZodNumber>;
|
|
38
|
+
maxPriceCents: z.ZodNullable<z.ZodNumber>;
|
|
39
|
+
genres: z.ZodArray<z.ZodString>;
|
|
40
|
+
tags: z.ZodArray<z.ZodString>;
|
|
41
|
+
studios: z.ZodArray<z.ZodString>;
|
|
42
|
+
allTimeLowEnabled: z.ZodBoolean;
|
|
43
|
+
allTimeLowMaxPriceCents: z.ZodNullable<z.ZodNumber>;
|
|
44
|
+
changelogChannelId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
changelogPingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
46
|
+
categoryRoutes: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
47
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
48
|
+
free_game: "free_game";
|
|
49
|
+
free_dlc_or_loot: "free_dlc_or_loot";
|
|
50
|
+
discount: "discount";
|
|
51
|
+
upcoming_free: "upcoming_free";
|
|
52
|
+
}>>;
|
|
53
|
+
stores: z.ZodArray<z.ZodEnum<{
|
|
54
|
+
steam: "steam";
|
|
55
|
+
epic: "epic";
|
|
56
|
+
gog: "gog";
|
|
57
|
+
prime: "prime";
|
|
58
|
+
}>>;
|
|
59
|
+
flags: z.ZodArray<z.ZodEnum<{
|
|
60
|
+
freeWeekend: "freeWeekend";
|
|
61
|
+
allTimeLow: "allTimeLow";
|
|
62
|
+
featured: "featured";
|
|
63
|
+
aaa: "aaa";
|
|
64
|
+
earlyAccess: "earlyAccess";
|
|
65
|
+
}>>;
|
|
66
|
+
genres: z.ZodArray<z.ZodString>;
|
|
67
|
+
tags: z.ZodArray<z.ZodString>;
|
|
68
|
+
minDiscountPercent: z.ZodNullable<z.ZodNumber>;
|
|
69
|
+
channelId: z.ZodNullable<z.ZodString>;
|
|
70
|
+
pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
71
|
+
webhookEnabled: z.ZodNullable<z.ZodBoolean>;
|
|
72
|
+
webhookUsername: z.ZodNullable<z.ZodString>;
|
|
73
|
+
webhookAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
74
|
+
priority: z.ZodNumber;
|
|
75
|
+
}, z.core.$strip>>>;
|
|
76
|
+
trackedGames: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
77
|
+
steamAppId: z.ZodNullable<z.ZodNumber>;
|
|
78
|
+
title: z.ZodNullable<z.ZodString>;
|
|
79
|
+
itemId: z.ZodNullable<z.ZodString>;
|
|
80
|
+
channelId: z.ZodNullable<z.ZodString>;
|
|
81
|
+
pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
82
|
+
minDiscountPercent: z.ZodNullable<z.ZodNumber>;
|
|
83
|
+
atlOnly: z.ZodBoolean;
|
|
84
|
+
}, z.core.$strip>>>;
|
|
85
|
+
changelogGames: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
86
|
+
steamAppId: z.ZodNumber;
|
|
87
|
+
title: z.ZodNullable<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
readonly GuildGameCategoryRouteSchema: z.ZodObject<{
|
|
91
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
92
|
+
free_game: "free_game";
|
|
93
|
+
free_dlc_or_loot: "free_dlc_or_loot";
|
|
94
|
+
discount: "discount";
|
|
95
|
+
upcoming_free: "upcoming_free";
|
|
96
|
+
}>>;
|
|
97
|
+
stores: z.ZodArray<z.ZodEnum<{
|
|
98
|
+
steam: "steam";
|
|
99
|
+
epic: "epic";
|
|
100
|
+
gog: "gog";
|
|
101
|
+
prime: "prime";
|
|
102
|
+
}>>;
|
|
103
|
+
flags: z.ZodArray<z.ZodEnum<{
|
|
104
|
+
freeWeekend: "freeWeekend";
|
|
105
|
+
allTimeLow: "allTimeLow";
|
|
106
|
+
featured: "featured";
|
|
107
|
+
aaa: "aaa";
|
|
108
|
+
earlyAccess: "earlyAccess";
|
|
109
|
+
}>>;
|
|
110
|
+
genres: z.ZodArray<z.ZodString>;
|
|
111
|
+
tags: z.ZodArray<z.ZodString>;
|
|
112
|
+
minDiscountPercent: z.ZodNullable<z.ZodNumber>;
|
|
113
|
+
channelId: z.ZodNullable<z.ZodString>;
|
|
114
|
+
pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
115
|
+
webhookEnabled: z.ZodNullable<z.ZodBoolean>;
|
|
116
|
+
webhookUsername: z.ZodNullable<z.ZodString>;
|
|
117
|
+
webhookAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
118
|
+
priority: z.ZodNumber;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
readonly GuildTrackedGameSchema: z.ZodObject<{
|
|
121
|
+
steamAppId: z.ZodNullable<z.ZodNumber>;
|
|
122
|
+
title: z.ZodNullable<z.ZodString>;
|
|
123
|
+
itemId: z.ZodNullable<z.ZodString>;
|
|
124
|
+
channelId: z.ZodNullable<z.ZodString>;
|
|
125
|
+
pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
126
|
+
minDiscountPercent: z.ZodNullable<z.ZodNumber>;
|
|
127
|
+
atlOnly: z.ZodBoolean;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
readonly GuildGameChangelogSchema: z.ZodObject<{
|
|
130
|
+
steamAppId: z.ZodNumber;
|
|
131
|
+
title: z.ZodNullable<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
};
|
|
134
|
+
export declare const GameConfigZodPartial: PartialZodObject<typeof GameConfigZod>;
|