@notidotbot/noti-api-client 1.4.14 → 1.4.16
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 +26 -0
- package/dist/classes/admin.js +18 -0
- package/dist/classes/client.d.ts +26 -0
- package/dist/classes/client.js +6 -0
- package/dist/classes/emotes.d.ts +2 -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/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/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/schema/models/guild.prisma +4 -0
- package/prisma/schema/models/r2Storage.prisma +1 -0
- package/prisma/schema/models/youtubeStreamer.prisma +2 -1
package/dist/classes/other.d.ts
CHANGED
|
@@ -6,28 +6,50 @@ export declare class APIOther {
|
|
|
6
6
|
status<T extends boolean>({ withTopServers }?: {
|
|
7
7
|
withTopServers?: T;
|
|
8
8
|
}): Promise<import("../types").WebResponse<StatusType<T>>>;
|
|
9
|
+
guildStatus({ auth, guildId }: OtherFunctionsInput['guildStatus']): Promise<import("../types").WebResponse<GuildStatusType>>;
|
|
9
10
|
recentActivity(): Promise<import("../types").WebResponse<RecentActivityType>>;
|
|
11
|
+
scheduler({ auth, body }: OtherFunctionsInput['scheduler']): Promise<import("../types").WebResponse<string>>;
|
|
10
12
|
checkRateLimit({ auth }: OtherFunctionsInput['checkRateLimit']): Promise<import("../types").WebResponse<string>>;
|
|
11
13
|
getAllLanguages(): Promise<import("../types").WebResponse<LanguageList>>;
|
|
12
|
-
oAuth2({ guildId }
|
|
14
|
+
oAuth2({ state, guildId }?: OtherFunctionsInput['oAuth2']): Promise<import("../types").WebResponse<OAuth2Type>>;
|
|
15
|
+
eval({ auth, body }: OtherFunctionsInput['eval']): Promise<import("../types").WebResponse<unknown>>;
|
|
13
16
|
isDown(): Promise<boolean>;
|
|
14
17
|
}
|
|
15
18
|
export type OtherFunctionsInput = {
|
|
19
|
+
'guildStatus': {
|
|
20
|
+
auth: string;
|
|
21
|
+
guildId: string;
|
|
22
|
+
};
|
|
23
|
+
'scheduler': {
|
|
24
|
+
auth: string;
|
|
25
|
+
body: SchedulerBody;
|
|
26
|
+
};
|
|
16
27
|
'checkRateLimit': {
|
|
17
28
|
auth: string;
|
|
18
29
|
};
|
|
19
30
|
'getAllLanguages': never;
|
|
20
31
|
'oAuth2': {
|
|
32
|
+
state?: OAuth2State;
|
|
21
33
|
guildId?: string;
|
|
22
34
|
};
|
|
35
|
+
'eval': {
|
|
36
|
+
auth: string;
|
|
37
|
+
body: EvalBody;
|
|
38
|
+
};
|
|
23
39
|
};
|
|
24
40
|
export type OtherReturnTypes = {
|
|
41
|
+
'guildStatusRaw': Awaited<ReturnType<APIOther['guildStatus']>>;
|
|
42
|
+
'guildStatusSuccess': CancelOutWebResponses<Awaited<ReturnType<APIOther['guildStatus']>>>;
|
|
43
|
+
'schedulerRaw': Awaited<ReturnType<APIOther['scheduler']>>;
|
|
44
|
+
'schedulerSuccess': CancelOutWebResponses<Awaited<ReturnType<APIOther['scheduler']>>>;
|
|
25
45
|
'checkRateLimitRaw': Awaited<ReturnType<APIOther['checkRateLimit']>>;
|
|
26
46
|
'checkRateLimitSuccess': CancelOutWebResponses<Awaited<ReturnType<APIOther['checkRateLimit']>>>;
|
|
27
47
|
'getAllLanguagesRaw': Awaited<ReturnType<APIOther['getAllLanguages']>>;
|
|
28
48
|
'getAllLanguagesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIOther['getAllLanguages']>>>;
|
|
29
49
|
'oAuth2Raw': Awaited<ReturnType<APIOther['oAuth2']>>;
|
|
30
50
|
'oAuth2Success': CancelOutWebResponses<Awaited<ReturnType<APIOther['oAuth2']>>>;
|
|
51
|
+
'evalRaw': Awaited<ReturnType<APIOther['eval']>>;
|
|
52
|
+
'evalSuccess': CancelOutWebResponses<Awaited<ReturnType<APIOther['eval']>>>;
|
|
31
53
|
};
|
|
32
54
|
export type LanguageList = {
|
|
33
55
|
name: string;
|
|
@@ -38,14 +60,34 @@ export type RecentActivityType = {
|
|
|
38
60
|
message: string;
|
|
39
61
|
createdAt: number;
|
|
40
62
|
}[];
|
|
63
|
+
export type OAuth2State = 'l' | 'd' | 'c';
|
|
41
64
|
export type OAuth2Type = {
|
|
42
65
|
login: string;
|
|
43
66
|
invite: string;
|
|
44
67
|
};
|
|
68
|
+
export type SchedulerBody = Record<string, unknown>;
|
|
69
|
+
export type EvalBody = {
|
|
70
|
+
code: string;
|
|
71
|
+
context: 'client' | 'manager';
|
|
72
|
+
};
|
|
73
|
+
export type EvalResponse = unknown;
|
|
74
|
+
export type GuildStatusType = {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
icon: string | null;
|
|
78
|
+
isVerified: boolean;
|
|
79
|
+
isPartnered: boolean;
|
|
80
|
+
shardData: {
|
|
81
|
+
shardId: number;
|
|
82
|
+
shardPing: number;
|
|
83
|
+
status: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
45
86
|
export type StatusType<T extends boolean = false> = {
|
|
46
87
|
devMode: boolean;
|
|
47
88
|
shardsPerClusters: number;
|
|
48
89
|
totalStreamers: number;
|
|
90
|
+
totalGiveaways: number;
|
|
49
91
|
totalNotifications: number;
|
|
50
92
|
totalStatChannels: number;
|
|
51
93
|
totalStatusRoles: number;
|
package/dist/classes/other.js
CHANGED
|
@@ -16,12 +16,24 @@ class APIOther {
|
|
|
16
16
|
}),
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
+
async guildStatus({ auth, guildId }) {
|
|
20
|
+
return await this.web.request({
|
|
21
|
+
method: 'GET', auth,
|
|
22
|
+
endpoint: this.web.qp('/status/' + guildId),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
19
25
|
async recentActivity() {
|
|
20
26
|
return await this.web.request({
|
|
21
27
|
method: 'GET',
|
|
22
28
|
endpoint: this.web.qp('/recent'),
|
|
23
29
|
});
|
|
24
30
|
}
|
|
31
|
+
async scheduler({ auth, body }) {
|
|
32
|
+
return await this.web.request({
|
|
33
|
+
method: 'POST', auth, body,
|
|
34
|
+
endpoint: this.web.qp('/scheduler'),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
25
37
|
async checkRateLimit({ auth }) {
|
|
26
38
|
return await this.web.request({
|
|
27
39
|
method: 'GET', auth,
|
|
@@ -34,14 +46,21 @@ class APIOther {
|
|
|
34
46
|
endpoint: this.web.qp('/data/languages'),
|
|
35
47
|
});
|
|
36
48
|
}
|
|
37
|
-
async oAuth2({ guildId }) {
|
|
49
|
+
async oAuth2({ state, guildId } = {}) {
|
|
38
50
|
return await this.web.request({
|
|
39
51
|
method: 'GET',
|
|
40
52
|
endpoint: this.web.qp('/oauth2', {
|
|
53
|
+
state,
|
|
41
54
|
guildId,
|
|
42
55
|
}),
|
|
43
56
|
});
|
|
44
57
|
}
|
|
58
|
+
async eval({ auth, body }) {
|
|
59
|
+
return await this.web.request({
|
|
60
|
+
method: 'POST', auth, body,
|
|
61
|
+
endpoint: this.web.qp('/eval'),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
45
64
|
async isDown() {
|
|
46
65
|
const response = await this.web.request({
|
|
47
66
|
method: 'GET',
|
|
@@ -4,8 +4,8 @@ import { AllPlatforms } from '../other/prisma';
|
|
|
4
4
|
export declare class APIPlatform {
|
|
5
5
|
private web;
|
|
6
6
|
constructor(web: WebDataManager);
|
|
7
|
-
getActivePlatforms({ auth }: PlatformFunctionsInput['getActivePlatforms']): Promise<import("../types").WebResponse<
|
|
8
|
-
getPlatformWorkerStats<P extends AllPlatforms>({ auth, platform }: PlatformFunctionsInput<P>['getPlatformWorkerStats']): Promise<import("../types").WebResponse<PlatformStats>>;
|
|
7
|
+
getActivePlatforms({ auth }: PlatformFunctionsInput['getActivePlatforms']): Promise<import("../types").WebResponse<AllPlatforms[]>>;
|
|
8
|
+
getPlatformWorkerStats<P extends AllPlatforms>({ auth, platform, page, limit }: PlatformFunctionsInput<P>['getPlatformWorkerStats']): Promise<import("../types").WebResponse<PlatformStats>>;
|
|
9
9
|
getGuildsForStreamer<P extends AllPlatforms>({ auth, platform, username }: PlatformFunctionsInput<P>['getGuildsForStreamer']): Promise<import("../types").WebResponse<GuildsForStreamer>>;
|
|
10
10
|
}
|
|
11
11
|
export type PlatformFunctionsInput<P extends AllPlatforms = never> = {
|
|
@@ -15,6 +15,8 @@ export type PlatformFunctionsInput<P extends AllPlatforms = never> = {
|
|
|
15
15
|
'getPlatformWorkerStats': {
|
|
16
16
|
auth: string;
|
|
17
17
|
platform: P;
|
|
18
|
+
page?: number;
|
|
19
|
+
limit?: number;
|
|
18
20
|
};
|
|
19
21
|
'getGuildsForStreamer': {
|
|
20
22
|
auth: string;
|
|
@@ -31,7 +33,10 @@ export type PlatformReturnTypes = {
|
|
|
31
33
|
'getGuildsForStreamerSuccess': CancelOutWebResponses<Awaited<ReturnType<APIPlatform['getGuildsForStreamer']>>>;
|
|
32
34
|
};
|
|
33
35
|
export type PlatformStats = {
|
|
34
|
-
monitoredUsernames:
|
|
36
|
+
monitoredUsernames: {
|
|
37
|
+
username: string;
|
|
38
|
+
isLive: boolean | null;
|
|
39
|
+
}[];
|
|
35
40
|
status: 'online' | 'offline';
|
|
36
41
|
lastUpdated: number;
|
|
37
42
|
workerId: number;
|
package/dist/classes/platform.js
CHANGED
|
@@ -14,10 +14,13 @@ class APIPlatform {
|
|
|
14
14
|
endpoint: this.web.qp('/data/platforms'),
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
async getPlatformWorkerStats({ auth, platform }) {
|
|
17
|
+
async getPlatformWorkerStats({ auth, platform, page, limit }) {
|
|
18
18
|
return await this.web.request({
|
|
19
19
|
method: 'GET', auth,
|
|
20
|
-
endpoint: this.web.qp('/data/platforms/' + platform
|
|
20
|
+
endpoint: this.web.qp('/data/platforms/' + platform, {
|
|
21
|
+
page: page,
|
|
22
|
+
limit: limit,
|
|
23
|
+
}),
|
|
21
24
|
});
|
|
22
25
|
}
|
|
23
26
|
async getGuildsForStreamer({ auth, platform, username }) {
|
|
@@ -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
|
};
|
|
@@ -42,6 +42,9 @@ export declare const GuildZod: {
|
|
|
42
42
|
}, z.core.$strip>>>;
|
|
43
43
|
birthdayRoleId: z.ZodNullable<z.ZodString>;
|
|
44
44
|
birthdayChannelId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
birthdayPanelChannelId: z.ZodNullable<z.ZodString>;
|
|
46
|
+
birthdayPanelMessageId: z.ZodNullable<z.ZodString>;
|
|
47
|
+
birthdayPanelDuration: z.ZodNullable<z.ZodString>;
|
|
45
48
|
welcomeChannelId: z.ZodNullable<z.ZodString>;
|
|
46
49
|
leaveChannelId: z.ZodNullable<z.ZodString>;
|
|
47
50
|
birthdayEnabled: z.ZodNullable<z.ZodBoolean>;
|
|
@@ -15,6 +15,9 @@ const GuildSchema = zod_2.z.object({
|
|
|
15
15
|
disableBranding: zod_2.z.lazy(() => GuildDisableBrandingSchema).nullable(),
|
|
16
16
|
birthdayRoleId: zod_1.SnowFlake.nullable(),
|
|
17
17
|
birthdayChannelId: zod_1.SnowFlake.nullable(),
|
|
18
|
+
birthdayPanelChannelId: zod_1.SnowFlake.nullable(),
|
|
19
|
+
birthdayPanelMessageId: zod_1.SnowFlake.nullable(),
|
|
20
|
+
birthdayPanelDuration: zod_2.z.string().nullable(),
|
|
18
21
|
welcomeChannelId: zod_1.SnowFlake.nullable(),
|
|
19
22
|
leaveChannelId: zod_1.SnowFlake.nullable(),
|
|
20
23
|
birthdayEnabled: zod_2.z.boolean().nullable(),
|
|
@@ -10,6 +10,7 @@ export declare const R2StorageZod: {
|
|
|
10
10
|
tempUrl: z.ZodNullable<z.ZodString>;
|
|
11
11
|
urlExpiresAt: z.ZodNullable<z.ZodDate>;
|
|
12
12
|
thumbnail: z.ZodNullable<z.ZodString>;
|
|
13
|
+
title: z.ZodNullable<z.ZodString>;
|
|
13
14
|
streamDate: z.ZodNullable<z.ZodDate>;
|
|
14
15
|
guilds: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
15
16
|
guildId: z.ZodString;
|
|
@@ -9,6 +9,7 @@ const R2StorageSchema = zod_2.z.object({
|
|
|
9
9
|
tempUrl: zod_2.z.string().nullable(),
|
|
10
10
|
urlExpiresAt: zod_2.z.date().nullable(),
|
|
11
11
|
thumbnail: zod_2.z.string().nullable(),
|
|
12
|
+
title: zod_2.z.string().nullable(),
|
|
12
13
|
streamDate: zod_2.z.date().nullable(),
|
|
13
14
|
guilds: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_2.z.lazy(() => R2StorageGuildSchema)), ['guildId']),
|
|
14
15
|
});
|
|
@@ -9,8 +9,8 @@ export declare const RumbleStreamerZod: {
|
|
|
9
9
|
streamerUserName: z.ZodString;
|
|
10
10
|
guildId: z.ZodString;
|
|
11
11
|
type: z.ZodEnum<{
|
|
12
|
-
user: "user";
|
|
13
12
|
channel: "channel";
|
|
13
|
+
user: "user";
|
|
14
14
|
}>;
|
|
15
15
|
deleteEmbeds: z.ZodNullable<z.ZodBoolean>;
|
|
16
16
|
sendOfflineMessage: z.ZodNullable<z.ZodBoolean>;
|
|
@@ -63,6 +63,7 @@ export declare const YoutubeStreamerZod: {
|
|
|
63
63
|
videoNotificationChannelId: z.ZodNullable<z.ZodString>;
|
|
64
64
|
showNotifyButton: z.ZodNullable<z.ZodBoolean>;
|
|
65
65
|
pingRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
66
|
+
videoRoleId: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"everyone">, z.ZodLiteral<"here">]>>;
|
|
66
67
|
customCoolDownBeforeNextLive: z.ZodNullable<z.ZodNumber>;
|
|
67
68
|
liveRoleId: z.ZodNullable<z.ZodString>;
|
|
68
69
|
usersForLiveRole: z.ZodArray<z.ZodString>;
|
|
@@ -17,6 +17,7 @@ const YoutubeStreamerSchema = zod_2.z.object({
|
|
|
17
17
|
videoNotificationChannelId: zod_1.SnowFlake.nullable(),
|
|
18
18
|
showNotifyButton: zod_2.z.boolean().nullable(),
|
|
19
19
|
pingRoleId: zod_1.SnowFlakeOrEveryone.nullable(),
|
|
20
|
+
videoRoleId: zod_1.SnowFlakeOrEveryone.nullable(),
|
|
20
21
|
customCoolDownBeforeNextLive: zod_2.z.number().min(0).max(360).nullable(),
|
|
21
22
|
liveRoleId: zod_1.SnowFlake.nullable(),
|
|
22
23
|
usersForLiveRole: (0, zod_1.NoDuplicate)(zod_2.z.array(zod_1.SnowFlake)),
|