@notidotbot/noti-api-client 1.4.0
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/cname.js +3 -0
- package/dist/classes/@me.d.ts +122 -0
- package/dist/classes/@me.js +59 -0
- package/dist/classes/admin.d.ts +71 -0
- package/dist/classes/admin.js +26 -0
- package/dist/classes/client.d.ts +156 -0
- package/dist/classes/client.js +116 -0
- package/dist/classes/emotes.d.ts +31 -0
- package/dist/classes/emotes.js +24 -0
- package/dist/classes/files.d.ts +36 -0
- package/dist/classes/files.js +36 -0
- package/dist/classes/guild.d.ts +187 -0
- package/dist/classes/guild.js +140 -0
- package/dist/classes/guildDrops.d.ts +58 -0
- package/dist/classes/guildDrops.js +32 -0
- package/dist/classes/guildGiveaway.d.ts +110 -0
- package/dist/classes/guildGiveaway.js +76 -0
- package/dist/classes/guildPlatform.d.ts +163 -0
- package/dist/classes/guildPlatform.js +99 -0
- package/dist/classes/guildPlatformAction.d.ts +67 -0
- package/dist/classes/guildPlatformAction.js +26 -0
- package/dist/classes/guildStarboard.d.ts +66 -0
- package/dist/classes/guildStarboard.js +36 -0
- package/dist/classes/linked.d.ts +26 -0
- package/dist/classes/linked.js +32 -0
- package/dist/classes/other.d.ts +83 -0
- package/dist/classes/other.js +53 -0
- package/dist/classes/platform.d.ts +227 -0
- package/dist/classes/platform.js +30 -0
- package/dist/classes/premium.d.ts +179 -0
- package/dist/classes/premium.js +76 -0
- package/dist/classes/sessions.d.ts +42 -0
- package/dist/classes/sessions.js +30 -0
- package/dist/classes/teams.d.ts +88 -0
- package/dist/classes/teams.js +66 -0
- package/dist/classes/telemetry.d.ts +32 -0
- package/dist/classes/telemetry.js +28 -0
- package/dist/classes/user.d.ts +40 -0
- package/dist/classes/user.js +30 -0
- package/dist/classes/vods.d.ts +55 -0
- package/dist/classes/vods.js +38 -0
- package/dist/core/manager.d.ts +57 -0
- package/dist/core/manager.js +78 -0
- package/dist/core/utils.d.ts +4 -0
- package/dist/core/utils.js +26 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +42 -0
- package/dist/modules/stripe.d.ts +12 -0
- package/dist/modules/stripe.js +18 -0
- package/dist/other/bitfields.d.ts +283 -0
- package/dist/other/bitfields.js +323 -0
- package/dist/other/enums.d.ts +2 -0
- package/dist/other/enums.js +10 -0
- package/dist/other/prisma.d.ts +76 -0
- package/dist/other/prisma.js +9 -0
- package/dist/other/templates.d.ts +795 -0
- package/dist/other/templates.js +706 -0
- package/dist/other/types.d.ts +45 -0
- package/dist/other/types.js +17 -0
- package/dist/other/utils.d.ts +5 -0
- package/dist/other/utils.js +51 -0
- package/dist/other/zod/client.zod.d.ts +349 -0
- package/dist/other/zod/client.zod.js +63 -0
- package/dist/other/zod/drops.zod.d.ts +16 -0
- package/dist/other/zod/drops.zod.js +93 -0
- package/dist/other/zod/giveaways.zod.d.ts +382 -0
- package/dist/other/zod/giveaways.zod.js +72 -0
- package/dist/other/zod/guild.zod.d.ts +1638 -0
- package/dist/other/zod/guild.zod.js +139 -0
- package/dist/other/zod/kickStreamer.zod.d.ts +761 -0
- package/dist/other/zod/kickStreamer.zod.js +92 -0
- package/dist/other/zod/member.zod.d.ts +22 -0
- package/dist/other/zod/member.zod.js +15 -0
- package/dist/other/zod/r2Storage.zod.d.ts +56 -0
- package/dist/other/zod/r2Storage.zod.js +21 -0
- package/dist/other/zod/rumbleStreamer.zod.d.ts +530 -0
- package/dist/other/zod/rumbleStreamer.zod.js +45 -0
- package/dist/other/zod/schema.zod.d.ts +25 -0
- package/dist/other/zod/schema.zod.js +168 -0
- package/dist/other/zod/starboard.zod.d.ts +167 -0
- package/dist/other/zod/starboard.zod.js +46 -0
- package/dist/other/zod/team.zod.d.ts +107 -0
- package/dist/other/zod/team.zod.js +30 -0
- package/dist/other/zod/tiktokStreamer.zod.d.ts +473 -0
- package/dist/other/zod/tiktokStreamer.zod.js +46 -0
- package/dist/other/zod/twitchStreamer.zod.d.ts +473 -0
- package/dist/other/zod/twitchStreamer.zod.js +46 -0
- package/dist/other/zod/user.zod.d.ts +678 -0
- package/dist/other/zod/user.zod.js +124 -0
- package/dist/other/zod/youtubeStreamer.zod.d.ts +476 -0
- package/dist/other/zod/youtubeStreamer.zod.js +47 -0
- package/dist/other/zod/zod.d.ts +177 -0
- package/dist/other/zod/zod.js +60 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +37 -0
- package/dist/types.js +2 -0
- package/package.json +63 -0
- package/prisma/generated/index.ts +25 -0
- package/prisma/generated/ts-prisma.d.ts +91725 -0
- package/prisma/schema/models/client.prisma +89 -0
- package/prisma/schema/models/drops.prisma +167 -0
- package/prisma/schema/models/giveaways.prisma +82 -0
- package/prisma/schema/models/guild.prisma +368 -0
- package/prisma/schema/models/kickStreamer.prisma +202 -0
- package/prisma/schema/models/member.prisma +10 -0
- package/prisma/schema/models/r2Storage.prisma +22 -0
- package/prisma/schema/models/rumbleStreamer.prisma +121 -0
- package/prisma/schema/models/starboard.prisma +66 -0
- package/prisma/schema/models/team.prisma +38 -0
- package/prisma/schema/models/tiktokStreamer.prisma +121 -0
- package/prisma/schema/models/twitchStreamer.prisma +122 -0
- package/prisma/schema/models/user.prisma +212 -0
- package/prisma/schema/models/youtubeStreamer.prisma +123 -0
- package/prisma/schema/schema.prisma +182 -0
- package/prisma.config.ts +6 -0
package/cname.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { PlatformsToLinkType, User } from '../other/prisma';
|
|
2
|
+
import { WebDataManager } from '../core/manager';
|
|
3
|
+
import { CancelOutWebResponses } from '../types';
|
|
4
|
+
export declare class APIMe {
|
|
5
|
+
private web;
|
|
6
|
+
constructor(web: WebDataManager);
|
|
7
|
+
getCurrentUser({ auth }: MeFunctionsInput['getCurrentUser']): Promise<import("../types").WebResponse<CurrentUser>>;
|
|
8
|
+
clearCurrentUserNotifications({ auth }: MeFunctionsInput['clearCurrentUserNotifications']): Promise<import("../types").WebResponse<true>>;
|
|
9
|
+
getCurrentUserGuilds({ auth }: MeFunctionsInput['getCurrentUserGuilds']): Promise<import("../types").WebResponse<CurrentUserGuilds>>;
|
|
10
|
+
getGuildDiscordData<T extends GuildDataType>({ auth, guildId, types, force }: MeFunctionsInput['getGuildDiscordData']): Promise<import("../types").WebResponse<DiscordGuildData<T>>>;
|
|
11
|
+
getConnectPlatformUrl({ platform }: MeFunctionsInput['getConnectPlatformUrl']): Promise<import("../types").WebResponse<string>>;
|
|
12
|
+
connectPlatform({ auth, platform, code, state }: MeFunctionsInput['connectPlatform']): Promise<import("../types").WebResponse<string>>;
|
|
13
|
+
unlinkPlatform({ auth, platform }: MeFunctionsInput['unlinkPlatform']): Promise<import("../types").WebResponse<string>>;
|
|
14
|
+
}
|
|
15
|
+
export type MeFunctionsInput<T extends GuildDataType = never> = {
|
|
16
|
+
'getCurrentUser': {
|
|
17
|
+
auth: string;
|
|
18
|
+
};
|
|
19
|
+
'clearCurrentUserNotifications': {
|
|
20
|
+
auth: string;
|
|
21
|
+
};
|
|
22
|
+
'getCurrentUserGuilds': {
|
|
23
|
+
auth: string;
|
|
24
|
+
};
|
|
25
|
+
'getGuildDiscordData': {
|
|
26
|
+
auth: string;
|
|
27
|
+
guildId: string;
|
|
28
|
+
types: T[];
|
|
29
|
+
force?: boolean;
|
|
30
|
+
};
|
|
31
|
+
'getConnectPlatformUrl': {
|
|
32
|
+
auth: string;
|
|
33
|
+
platform: 'twitch' | 'kick';
|
|
34
|
+
};
|
|
35
|
+
'connectPlatform': {
|
|
36
|
+
auth: string;
|
|
37
|
+
platform: PlatformsToLinkType;
|
|
38
|
+
code: string;
|
|
39
|
+
state?: string;
|
|
40
|
+
};
|
|
41
|
+
'unlinkPlatform': {
|
|
42
|
+
auth: string;
|
|
43
|
+
platform: PlatformsToLinkType;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export type MeGetReturnTypes = {
|
|
47
|
+
'getCurrentUserRaw': Awaited<ReturnType<APIMe['getCurrentUser']>>;
|
|
48
|
+
'getCurrentUserSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['getCurrentUser']>>>;
|
|
49
|
+
'clearCurrentUserNotificationsRaw': Awaited<ReturnType<APIMe['clearCurrentUserNotifications']>>;
|
|
50
|
+
'clearCurrentUserNotificationsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['clearCurrentUserNotifications']>>>;
|
|
51
|
+
'getCurrentUserGuildsRaw': Awaited<ReturnType<APIMe['getCurrentUserGuilds']>>;
|
|
52
|
+
'getCurrentUserGuildsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['getCurrentUserGuilds']>>>;
|
|
53
|
+
'getGuildDiscordDataRaw': Awaited<ReturnType<APIMe['getGuildDiscordData']>>;
|
|
54
|
+
'getGuildDiscordDataSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['getGuildDiscordData']>>>;
|
|
55
|
+
'getConnectPlatformUrlRaw': Awaited<ReturnType<APIMe['getConnectPlatformUrl']>>;
|
|
56
|
+
'getConnectPlatformUrlSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['getConnectPlatformUrl']>>>;
|
|
57
|
+
'connectPlatformRaw': Awaited<ReturnType<APIMe['connectPlatform']>>;
|
|
58
|
+
'connectPlatformSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['connectPlatform']>>>;
|
|
59
|
+
'unlinkPlatformRaw': Awaited<ReturnType<APIMe['unlinkPlatform']>>;
|
|
60
|
+
'unlinkPlatformSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['unlinkPlatform']>>>;
|
|
61
|
+
};
|
|
62
|
+
export type DCUserData = {
|
|
63
|
+
id: string;
|
|
64
|
+
email: string | null;
|
|
65
|
+
avatar: string | null;
|
|
66
|
+
banner: string | null;
|
|
67
|
+
isBotDev: boolean;
|
|
68
|
+
username: string;
|
|
69
|
+
globalName: string | null;
|
|
70
|
+
accentColor: string;
|
|
71
|
+
discriminator: string;
|
|
72
|
+
useNewUsername: boolean;
|
|
73
|
+
};
|
|
74
|
+
export type ModToSomene = {
|
|
75
|
+
userId: string;
|
|
76
|
+
username: string;
|
|
77
|
+
kickAccount: string | null;
|
|
78
|
+
twitchAccount: string | null;
|
|
79
|
+
rumbleAccount: string | null;
|
|
80
|
+
}[];
|
|
81
|
+
export type CurrentUser = {
|
|
82
|
+
isDev: boolean;
|
|
83
|
+
isStaff: boolean;
|
|
84
|
+
discord: DCUserData;
|
|
85
|
+
database: User & {
|
|
86
|
+
premium: {
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
} | null;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export type CurrentUserGuilds = {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
icon: string | null;
|
|
95
|
+
banner: string | null;
|
|
96
|
+
isBotIn: boolean;
|
|
97
|
+
}[];
|
|
98
|
+
export type GuildDataType = 'channels' | 'roles' | 'emojis';
|
|
99
|
+
export type DiscordGuildData<T extends GuildDataType = GuildDataType> = {
|
|
100
|
+
[K in T]: K extends 'channels' ? {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
validPermissions: boolean;
|
|
104
|
+
missingPermissions: string[];
|
|
105
|
+
}[] : K extends 'roles' ? {
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
validPermissions: boolean;
|
|
109
|
+
reasons: string[];
|
|
110
|
+
}[] : K extends 'emojis' ? {
|
|
111
|
+
list: {
|
|
112
|
+
id: string;
|
|
113
|
+
name: string | null;
|
|
114
|
+
animated: boolean;
|
|
115
|
+
}[];
|
|
116
|
+
maxEach: number;
|
|
117
|
+
current: {
|
|
118
|
+
normal: number;
|
|
119
|
+
animated: number;
|
|
120
|
+
};
|
|
121
|
+
} : never;
|
|
122
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIMe = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIMe {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getCurrentUser({ auth }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp('/@me'),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async clearCurrentUserNotifications({ auth }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'DELETE', auth,
|
|
20
|
+
endpoint: this.web.qp('/@me/notifications'),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async getCurrentUserGuilds({ auth }) {
|
|
24
|
+
return await this.web.request({
|
|
25
|
+
method: 'GET', auth,
|
|
26
|
+
endpoint: this.web.qp('/@me/guilds'),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async getGuildDiscordData({ auth, guildId, types, force }) {
|
|
30
|
+
return await this.web.request({
|
|
31
|
+
method: 'GET', auth,
|
|
32
|
+
endpoint: this.web.qp('/@me/guilds/' + guildId, {
|
|
33
|
+
types,
|
|
34
|
+
force,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async getConnectPlatformUrl({ platform }) {
|
|
39
|
+
return await this.web.request({
|
|
40
|
+
method: 'GET',
|
|
41
|
+
endpoint: this.web.qp('/@me/connect/' + platform),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async connectPlatform({ auth, platform, code, state }) {
|
|
45
|
+
return await this.web.request({
|
|
46
|
+
method: 'POST', auth, body: { code },
|
|
47
|
+
endpoint: this.web.qp('/@me/connect/' + platform, {
|
|
48
|
+
state,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async unlinkPlatform({ auth, platform }) {
|
|
53
|
+
return await this.web.request({
|
|
54
|
+
method: 'DELETE', auth,
|
|
55
|
+
endpoint: this.web.qp('/@me/connect/' + platform),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.APIMe = APIMe;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FirstCapital, AllPlatforms } from '../other/prisma';
|
|
2
|
+
import { CancelOutWebResponses } from '../types';
|
|
3
|
+
import { WebDataManager } from '../core/manager';
|
|
4
|
+
export declare class APIAdmin {
|
|
5
|
+
private web;
|
|
6
|
+
constructor(web: WebDataManager);
|
|
7
|
+
getEmailList({ auth }: AdminFunctionsInput['getEmailList']): Promise<import("../types").WebResponse<EmailList>>;
|
|
8
|
+
getAnalytics<T extends string = string>({ auth, lookback }: AdminFunctionsInput['getAnalytics']): Promise<import("../types").WebResponse<Analytics<T, string>>>;
|
|
9
|
+
}
|
|
10
|
+
export type AdminFunctionsInput = {
|
|
11
|
+
'getEmailList': {
|
|
12
|
+
auth: string;
|
|
13
|
+
};
|
|
14
|
+
'getAnalytics': {
|
|
15
|
+
auth: string;
|
|
16
|
+
lookback?: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type AdminGetReturnTypes = {
|
|
20
|
+
'getEmailListRaw': Awaited<ReturnType<APIAdmin['getEmailList']>>;
|
|
21
|
+
'getEmailListSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getEmailList']>>>;
|
|
22
|
+
'getAnalyticsRaw': Awaited<ReturnType<APIAdmin['getAnalytics']>>;
|
|
23
|
+
'getAnalyticsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getAnalytics']>>>;
|
|
24
|
+
};
|
|
25
|
+
export type EmailList = {
|
|
26
|
+
userId: string;
|
|
27
|
+
email: string;
|
|
28
|
+
}[];
|
|
29
|
+
export type Analytics<B extends string = string, C extends string = string> = {
|
|
30
|
+
db: DBAnalytics;
|
|
31
|
+
commands: AnalyticsData<C>;
|
|
32
|
+
buttons: AnalyticsData<B>;
|
|
33
|
+
};
|
|
34
|
+
export type DBAnalytics = {
|
|
35
|
+
totalUsers: number;
|
|
36
|
+
totalGuilds: number;
|
|
37
|
+
totalTeams: number;
|
|
38
|
+
totalR2Objects: number;
|
|
39
|
+
totalServersUsingX: {
|
|
40
|
+
birthday: number;
|
|
41
|
+
welcomeLeaves: number;
|
|
42
|
+
statusRoles: number;
|
|
43
|
+
autoLiveRoles: number;
|
|
44
|
+
notificationOverrides: number;
|
|
45
|
+
};
|
|
46
|
+
totalUsersLinkedWith: {
|
|
47
|
+
kick: number;
|
|
48
|
+
twitch: number;
|
|
49
|
+
rumble: number;
|
|
50
|
+
};
|
|
51
|
+
totalGiveaways: number;
|
|
52
|
+
totalNotifications: number;
|
|
53
|
+
totalStatChannels: number;
|
|
54
|
+
totalStatusRoles: number;
|
|
55
|
+
totalClips: number;
|
|
56
|
+
totalVods: number;
|
|
57
|
+
} & Record<`total${FirstCapital<AllPlatforms>}Streamers`, number>;
|
|
58
|
+
export type AnalyticsData<T extends string = string> = {
|
|
59
|
+
global: {
|
|
60
|
+
daily: Record<string, number>;
|
|
61
|
+
weekly: Record<string, number>;
|
|
62
|
+
monthly: Record<string, number>;
|
|
63
|
+
};
|
|
64
|
+
usages: {
|
|
65
|
+
[key in T]: {
|
|
66
|
+
daily: Record<string, number>;
|
|
67
|
+
weekly: Record<string, number>;
|
|
68
|
+
monthly: Record<string, number>;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIAdmin = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIAdmin {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getEmailList({ auth }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp('/admin/emails'),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async getAnalytics({ auth, lookback }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'GET', auth,
|
|
20
|
+
endpoint: this.web.qp('/admin/analytics', {
|
|
21
|
+
lookback,
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.APIAdmin = APIAdmin;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Client, ClientZod } from '../other/prisma';
|
|
2
|
+
import { WebDataManager } from '../core/manager';
|
|
3
|
+
import { CancelOutWebResponses } from '../types';
|
|
4
|
+
export declare class APIClient {
|
|
5
|
+
private web;
|
|
6
|
+
constructor(web: WebDataManager);
|
|
7
|
+
getFaqAnswers({ auth, question }: ClientFunctionsInput['getFaqAnswers']): Promise<import("../types").WebResponse<FaqReturnType[]>>;
|
|
8
|
+
askFaq({ auth, body }: ClientFunctionsInput['askFaq']): Promise<import("../types").WebResponse<string>>;
|
|
9
|
+
getFaqData({ auth, questionIdentifier }: ClientFunctionsInput['getFaqData']): Promise<import("../types").WebResponse<FaqReturnType>>;
|
|
10
|
+
createFaq({ auth, body }: ClientFunctionsInput['createFaq']): Promise<import("../types").WebResponse<string>>;
|
|
11
|
+
updateFaq({ auth, questionIdentifier, body }: ClientFunctionsInput['updateFaq']): Promise<import("../types").WebResponse<string>>;
|
|
12
|
+
deleteFaq({ auth, questionIdentifier }: ClientFunctionsInput['deleteFaq']): Promise<import("../types").WebResponse<string>>;
|
|
13
|
+
getNews(): Promise<import("../types").WebResponse<{
|
|
14
|
+
dbId: string;
|
|
15
|
+
date: Date;
|
|
16
|
+
title: string;
|
|
17
|
+
thumbnail: string | null;
|
|
18
|
+
clientId: string;
|
|
19
|
+
identifier: string;
|
|
20
|
+
isPublic: boolean;
|
|
21
|
+
changes: string[];
|
|
22
|
+
}[]>>;
|
|
23
|
+
getNewsAdmin({ auth }: ClientFunctionsInput['getNewsAdmin']): Promise<import("../types").WebResponse<{
|
|
24
|
+
dbId: string;
|
|
25
|
+
date: Date;
|
|
26
|
+
title: string;
|
|
27
|
+
thumbnail: string | null;
|
|
28
|
+
clientId: string;
|
|
29
|
+
identifier: string;
|
|
30
|
+
isPublic: boolean;
|
|
31
|
+
changes: string[];
|
|
32
|
+
}[]>>;
|
|
33
|
+
createNews({ auth, body }: ClientFunctionsInput['createNews']): Promise<import("../types").WebResponse<string>>;
|
|
34
|
+
deleteNews({ auth, identifier }: ClientFunctionsInput['deleteNews']): Promise<import("../types").WebResponse<string>>;
|
|
35
|
+
updateNews({ auth, identifier, body }: ClientFunctionsInput['updateNews']): Promise<import("../types").WebResponse<string>>;
|
|
36
|
+
getBlogs(): Promise<import("../types").WebResponse<BlogWithout<"reactions">[]>>;
|
|
37
|
+
getBlogsAdmin({ auth }: ClientFunctionsInput['getBlogsAdmin']): Promise<import("../types").WebResponse<{
|
|
38
|
+
dbId: string;
|
|
39
|
+
title: string;
|
|
40
|
+
content: string;
|
|
41
|
+
thumbnail: string | null;
|
|
42
|
+
authorIcon: string;
|
|
43
|
+
clientId: string;
|
|
44
|
+
identifier: string;
|
|
45
|
+
isPinned: boolean;
|
|
46
|
+
views: number | null;
|
|
47
|
+
reactions: string[];
|
|
48
|
+
reactionsCount: number | null;
|
|
49
|
+
tags: string[];
|
|
50
|
+
authorName: string;
|
|
51
|
+
createdAt: Date;
|
|
52
|
+
lastEdited: Date;
|
|
53
|
+
isPublic: boolean;
|
|
54
|
+
}[]>>;
|
|
55
|
+
getBlog({ identifier }: ClientFunctionsInput['getBlog']): Promise<import("../types").WebResponse<BlogWithout<"reactions">>>;
|
|
56
|
+
createBlog({ auth, body }: ClientFunctionsInput['createBlog']): Promise<import("../types").WebResponse<string>>;
|
|
57
|
+
updateBlog({ auth, identifier, body }: ClientFunctionsInput['updateBlog']): Promise<import("../types").WebResponse<string>>;
|
|
58
|
+
deleteBlog({ auth, identifier }: ClientFunctionsInput['deleteBlog']): Promise<import("../types").WebResponse<string>>;
|
|
59
|
+
}
|
|
60
|
+
export type ClientFunctionsInput = {
|
|
61
|
+
'getFaqAnswers': {
|
|
62
|
+
auth: string;
|
|
63
|
+
question?: string;
|
|
64
|
+
};
|
|
65
|
+
'askFaq': {
|
|
66
|
+
auth: string;
|
|
67
|
+
body: AskFaqBody;
|
|
68
|
+
};
|
|
69
|
+
'getFaqData': {
|
|
70
|
+
auth: string;
|
|
71
|
+
questionIdentifier: string;
|
|
72
|
+
};
|
|
73
|
+
'createFaq': {
|
|
74
|
+
auth: string;
|
|
75
|
+
body: Omit<ClientZod['faq'][number], 'identifier'>;
|
|
76
|
+
};
|
|
77
|
+
'updateFaq': {
|
|
78
|
+
auth: string;
|
|
79
|
+
questionIdentifier: string;
|
|
80
|
+
body: Partial<Omit<ClientZod['faq'][number], 'identifier'>>;
|
|
81
|
+
};
|
|
82
|
+
'deleteFaq': {
|
|
83
|
+
auth: string;
|
|
84
|
+
questionIdentifier: string;
|
|
85
|
+
};
|
|
86
|
+
'createNews': {
|
|
87
|
+
auth: string;
|
|
88
|
+
body: ClientZod['changelogs'][number];
|
|
89
|
+
};
|
|
90
|
+
'updateNews': {
|
|
91
|
+
auth: string;
|
|
92
|
+
identifier: string;
|
|
93
|
+
body: Partial<Omit<ClientZod['changelogs'][number], 'identifier'>>;
|
|
94
|
+
};
|
|
95
|
+
'getNewsAdmin': {
|
|
96
|
+
auth: string;
|
|
97
|
+
};
|
|
98
|
+
'deleteNews': {
|
|
99
|
+
auth: string;
|
|
100
|
+
identifier: string;
|
|
101
|
+
};
|
|
102
|
+
'getBlog': {
|
|
103
|
+
identifier: string;
|
|
104
|
+
};
|
|
105
|
+
'getBlogsAdmin': {
|
|
106
|
+
auth: string;
|
|
107
|
+
};
|
|
108
|
+
'createBlog': {
|
|
109
|
+
auth: string;
|
|
110
|
+
body: Omit<ClientZod['blogs'][number], BlogToOmitCreate>;
|
|
111
|
+
};
|
|
112
|
+
'updateBlog': {
|
|
113
|
+
auth: string;
|
|
114
|
+
identifier: string;
|
|
115
|
+
body: Partial<Omit<ClientZod['blogs'][number], BlogToOmitUpdate>>;
|
|
116
|
+
};
|
|
117
|
+
'deleteBlog': {
|
|
118
|
+
auth: string;
|
|
119
|
+
identifier: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
export type ClientReturnTypes = {
|
|
123
|
+
'getFaqAnswersRaw': Awaited<ReturnType<APIClient['getFaqAnswers']>>;
|
|
124
|
+
'getFaqAnswersSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getFaqAnswers']>>>;
|
|
125
|
+
'askFaqRaw': Awaited<ReturnType<APIClient['askFaq']>>;
|
|
126
|
+
'askFaqSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['askFaq']>>>;
|
|
127
|
+
'getFaqDataRaw': Awaited<ReturnType<APIClient['getFaqData']>>;
|
|
128
|
+
'getFaqDataSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getFaqData']>>>;
|
|
129
|
+
'createFaqRaw': Awaited<ReturnType<APIClient['createFaq']>>;
|
|
130
|
+
'createFaqSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['createFaq']>>>;
|
|
131
|
+
'updateFaqRaw': Awaited<ReturnType<APIClient['updateFaq']>>;
|
|
132
|
+
'updateFaqSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['updateFaq']>>>;
|
|
133
|
+
'deleteFaqRaw': Awaited<ReturnType<APIClient['deleteFaq']>>;
|
|
134
|
+
'deleteFaqSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['deleteFaq']>>>;
|
|
135
|
+
'getNewsRaw': Awaited<ReturnType<APIClient['getNews']>>;
|
|
136
|
+
'getNewsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['getNews']>>>;
|
|
137
|
+
'createNewsRaw': Awaited<ReturnType<APIClient['createNews']>>;
|
|
138
|
+
'createNewsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['createNews']>>>;
|
|
139
|
+
'deleteNewsRaw': Awaited<ReturnType<APIClient['deleteNews']>>;
|
|
140
|
+
'deleteNewsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIClient['deleteNews']>>>;
|
|
141
|
+
};
|
|
142
|
+
export type FaqReturnType = {
|
|
143
|
+
dbId: string;
|
|
144
|
+
identifier: string;
|
|
145
|
+
question: string | null;
|
|
146
|
+
answer: string | null;
|
|
147
|
+
clientId: string;
|
|
148
|
+
};
|
|
149
|
+
export type AskFaqBody = {
|
|
150
|
+
question: string;
|
|
151
|
+
username: string;
|
|
152
|
+
avatarUrl: string;
|
|
153
|
+
};
|
|
154
|
+
export type BlogWithout<T extends keyof Client['blogs'][number] = never> = Omit<Client['blogs'][number], T>;
|
|
155
|
+
export type BlogToOmitCreate = 'views' | 'reactions' | 'reactionsCount' | 'createdAt' | 'lastEdited';
|
|
156
|
+
export type BlogToOmitUpdate = 'identifier' | BlogToOmitCreate;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIClient = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIClient {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getFaqAnswers({ auth, question }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp('/data/faq', {
|
|
15
|
+
question,
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async askFaq({ auth, body }) {
|
|
20
|
+
return await this.web.request({
|
|
21
|
+
method: 'POST', auth, body,
|
|
22
|
+
endpoint: this.web.qp('/data/faq/ask'),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async getFaqData({ auth, questionIdentifier }) {
|
|
26
|
+
return await this.web.request({
|
|
27
|
+
method: 'GET', auth,
|
|
28
|
+
endpoint: this.web.qp('/data/faq/' + questionIdentifier),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async createFaq({ auth, body }) {
|
|
32
|
+
return await this.web.request({
|
|
33
|
+
method: 'POST', auth, body,
|
|
34
|
+
endpoint: this.web.qp('/data/faq'),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async updateFaq({ auth, questionIdentifier, body }) {
|
|
38
|
+
return await this.web.request({
|
|
39
|
+
method: 'PATCH', auth, body,
|
|
40
|
+
endpoint: this.web.qp('/data/faq/' + questionIdentifier),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async deleteFaq({ auth, questionIdentifier }) {
|
|
44
|
+
return await this.web.request({
|
|
45
|
+
method: 'DELETE', auth,
|
|
46
|
+
endpoint: this.web.qp('/data/faq/' + questionIdentifier),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async getNews() {
|
|
50
|
+
return await this.web.request({
|
|
51
|
+
method: 'GET',
|
|
52
|
+
endpoint: this.web.qp('/data/news'),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async getNewsAdmin({ auth }) {
|
|
56
|
+
return await this.web.request({
|
|
57
|
+
method: 'GET', auth,
|
|
58
|
+
endpoint: this.web.qp('/data/news/raw'),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async createNews({ auth, body }) {
|
|
62
|
+
return await this.web.request({
|
|
63
|
+
method: 'POST', auth, body,
|
|
64
|
+
endpoint: this.web.qp('/data/news'),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async deleteNews({ auth, identifier }) {
|
|
68
|
+
return await this.web.request({
|
|
69
|
+
method: 'DELETE', auth,
|
|
70
|
+
endpoint: this.web.qp('/data/news/' + identifier),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
async updateNews({ auth, identifier, body }) {
|
|
74
|
+
return await this.web.request({
|
|
75
|
+
method: 'PATCH', auth, body,
|
|
76
|
+
endpoint: this.web.qp('/data/news/' + identifier),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async getBlogs() {
|
|
80
|
+
return await this.web.request({
|
|
81
|
+
method: 'GET',
|
|
82
|
+
endpoint: this.web.qp('/data/blogs'),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async getBlogsAdmin({ auth }) {
|
|
86
|
+
return await this.web.request({
|
|
87
|
+
method: 'GET', auth,
|
|
88
|
+
endpoint: this.web.qp('/data/blogs/raw'),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
async getBlog({ identifier }) {
|
|
92
|
+
return await this.web.request({
|
|
93
|
+
method: 'GET',
|
|
94
|
+
endpoint: this.web.qp('/data/blogs/' + identifier),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async createBlog({ auth, body }) {
|
|
98
|
+
return await this.web.request({
|
|
99
|
+
method: 'POST', auth, body,
|
|
100
|
+
endpoint: this.web.qp('/data/blogs'),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async updateBlog({ auth, identifier, body }) {
|
|
104
|
+
return await this.web.request({
|
|
105
|
+
method: 'PATCH', auth, body,
|
|
106
|
+
endpoint: this.web.qp('/data/blogs/' + identifier),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
async deleteBlog({ auth, identifier }) {
|
|
110
|
+
return await this.web.request({
|
|
111
|
+
method: 'DELETE', auth,
|
|
112
|
+
endpoint: this.web.qp('/data/blogs/' + identifier),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.APIClient = APIClient;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { WebDataManager } from '../core/manager';
|
|
2
|
+
import { CancelOutWebResponses } from '../types';
|
|
3
|
+
export declare class APIEmotes {
|
|
4
|
+
private web;
|
|
5
|
+
constructor(web: WebDataManager);
|
|
6
|
+
getEmotesFor({ auth, platform, username }: EmotesFunctionsInput['getEmotesFor']): Promise<import("../types").WebResponse<EmojiType[]>>;
|
|
7
|
+
createDownloadZip({ auth, emotes }: EmotesFunctionsInput['createDownloadZip']): Promise<import("../types").WebResponse<DownloadZipType>>;
|
|
8
|
+
}
|
|
9
|
+
export type EmotesFunctionsInput = {
|
|
10
|
+
'getEmotesFor': {
|
|
11
|
+
auth: string;
|
|
12
|
+
platform: string;
|
|
13
|
+
username: string;
|
|
14
|
+
};
|
|
15
|
+
'createDownloadZip': {
|
|
16
|
+
auth: string;
|
|
17
|
+
emotes: Omit<EmojiType, 'id'>[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type EmotesReturnTypes = {
|
|
21
|
+
'getEmotesForRaw': Awaited<ReturnType<APIEmotes['getEmotesFor']>>;
|
|
22
|
+
'getEmotesForSuccess': CancelOutWebResponses<Awaited<ReturnType<APIEmotes['getEmotesFor']>>>;
|
|
23
|
+
};
|
|
24
|
+
export type EmojiType = {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
url: string;
|
|
28
|
+
};
|
|
29
|
+
export type DownloadZipType = {
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIEmotes = void 0;
|
|
4
|
+
// Data.
|
|
5
|
+
class APIEmotes {
|
|
6
|
+
web;
|
|
7
|
+
constructor(web) {
|
|
8
|
+
this.web = web;
|
|
9
|
+
}
|
|
10
|
+
// Methods.
|
|
11
|
+
async getEmotesFor({ auth, platform, username }) {
|
|
12
|
+
return await this.web.request({
|
|
13
|
+
method: 'GET', auth,
|
|
14
|
+
endpoint: this.web.qp(`/data/emotes/${platform}/${username}`),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async createDownloadZip({ auth, emotes }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'POST', auth, body: emotes,
|
|
20
|
+
endpoint: this.web.qp('/data/emotes'),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.APIEmotes = APIEmotes;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { WebDataManager } from '../core/manager';
|
|
2
|
+
import { CancelOutWebResponses } from '../types';
|
|
3
|
+
export declare class APIFiles {
|
|
4
|
+
private web;
|
|
5
|
+
constructor(web: WebDataManager);
|
|
6
|
+
getFiles({ auth }: FilesFunctionsInput['getFiles']): Promise<import("../types").WebResponse<AllFiles>>;
|
|
7
|
+
uploadFile({ auth, key, file }: FilesFunctionsInput['uploadFile']): Promise<import("../types").WebResponse<string>>;
|
|
8
|
+
deleteFile({ auth, key }: FilesFunctionsInput['deleteFile']): Promise<import("../types").WebResponse<string>>;
|
|
9
|
+
}
|
|
10
|
+
export type FilesFunctionsInput = {
|
|
11
|
+
'getFiles': {
|
|
12
|
+
auth: string;
|
|
13
|
+
};
|
|
14
|
+
'uploadFile': {
|
|
15
|
+
auth: string;
|
|
16
|
+
key: string;
|
|
17
|
+
file: Blob;
|
|
18
|
+
};
|
|
19
|
+
'deleteFile': {
|
|
20
|
+
auth: string;
|
|
21
|
+
key: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type FilesReturnTypes = {
|
|
25
|
+
'getFilesRaw': Awaited<ReturnType<APIFiles['getFiles']>>;
|
|
26
|
+
'getFilesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIFiles['getFiles']>>>;
|
|
27
|
+
'uploadFileRaw': Awaited<ReturnType<APIFiles['uploadFile']>>;
|
|
28
|
+
'uploadFileSuccess': CancelOutWebResponses<Awaited<ReturnType<APIFiles['uploadFile']>>>;
|
|
29
|
+
'deleteFileRaw': Awaited<ReturnType<APIFiles['deleteFile']>>;
|
|
30
|
+
'deleteFileSuccess': CancelOutWebResponses<Awaited<ReturnType<APIFiles['deleteFile']>>>;
|
|
31
|
+
};
|
|
32
|
+
export type AllFiles = {
|
|
33
|
+
key?: string;
|
|
34
|
+
size?: number;
|
|
35
|
+
lastModified?: string;
|
|
36
|
+
}[];
|