@mathisalarcon/discord-bot-dashboard-api 1.0.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.
Files changed (41) hide show
  1. package/.http +4 -0
  2. package/dist/index.d.ts +8 -0
  3. package/dist/index.js +230 -0
  4. package/dist/routes/guilds/[guildId]/members/[memberId]/permissions/route.d.ts +3 -0
  5. package/dist/routes/guilds/[guildId]/members/[memberId]/permissions/route.js +72 -0
  6. package/dist/routes/guilds/[guildId]/members/[memberId]/roles/[roleId]/route.d.ts +9 -0
  7. package/dist/routes/guilds/[guildId]/members/[memberId]/roles/[roleId]/route.js +225 -0
  8. package/dist/routes/guilds/[guildId]/members/[memberId]/roles/route.d.ts +3 -0
  9. package/dist/routes/guilds/[guildId]/members/[memberId]/roles/route.js +74 -0
  10. package/dist/routes/guilds/[guildId]/members/[memberId]/route.d.ts +7 -0
  11. package/dist/routes/guilds/[guildId]/members/[memberId]/route.js +72 -0
  12. package/dist/routes/guilds/[guildId]/members/route.d.ts +3 -0
  13. package/dist/routes/guilds/[guildId]/members/route.js +73 -0
  14. package/dist/routes/guilds/[guildId]/roles/[roleId]/members/route.d.ts +3 -0
  15. package/dist/routes/guilds/[guildId]/roles/[roleId]/members/route.js +70 -0
  16. package/dist/routes/guilds/[guildId]/roles/[roleId]/route.d.ts +7 -0
  17. package/dist/routes/guilds/[guildId]/roles/[roleId]/route.js +68 -0
  18. package/dist/routes/guilds/[guildId]/roles/route.d.ts +3 -0
  19. package/dist/routes/guilds/[guildId]/roles/route.js +67 -0
  20. package/dist/routes/guilds/[guildId]/route.d.ts +6 -0
  21. package/dist/routes/guilds/[guildId]/route.js +63 -0
  22. package/dist/routes/guilds/route.d.ts +3 -0
  23. package/dist/routes/guilds/route.js +68 -0
  24. package/dist/routes/middleware.d.ts +2 -0
  25. package/dist/routes/middleware.js +54 -0
  26. package/docs.md +13 -0
  27. package/package.json +28 -0
  28. package/src/index.ts +143 -0
  29. package/src/routes/guilds/[guildId]/members/[memberId]/permissions/route.ts +26 -0
  30. package/src/routes/guilds/[guildId]/members/[memberId]/roles/[roleId]/route.ts +163 -0
  31. package/src/routes/guilds/[guildId]/members/[memberId]/roles/route.ts +29 -0
  32. package/src/routes/guilds/[guildId]/members/[memberId]/route.ts +29 -0
  33. package/src/routes/guilds/[guildId]/members/route.ts +32 -0
  34. package/src/routes/guilds/[guildId]/roles/[roleId]/members/route.ts +25 -0
  35. package/src/routes/guilds/[guildId]/roles/[roleId]/route.ts +27 -0
  36. package/src/routes/guilds/[guildId]/roles/route.ts +22 -0
  37. package/src/routes/guilds/[guildId]/route.ts +23 -0
  38. package/src/routes/guilds/route.ts +28 -0
  39. package/src/routes/middleware.ts +14 -0
  40. package/src/types/express.d.ts +11 -0
  41. package/tsconfig.json +15 -0
package/src/index.ts ADDED
@@ -0,0 +1,143 @@
1
+ import { Client } from "discord.js";
2
+ import "dotenv/config";
3
+ import express, { Router } from "express";
4
+ import path from "path";
5
+ import fs from "fs";
6
+
7
+ var PORT: number = process.env.PORT ? parseInt(process.env.PORT) : 3000;
8
+
9
+ type Options = {
10
+ client: Client;
11
+ secret: string;
12
+ }
13
+ export default async function ({ client, secret }: Options): Promise<void> {
14
+ const app = express().use(express.json());
15
+ app.set("secret", secret);
16
+ const apiRouter = Router();
17
+ app.use("/api", apiRouter);
18
+ await loadBaseMiddleware(apiRouter, client);
19
+ await loadRoutes(apiRouter, client);
20
+ await startServer(app);
21
+ app.bot = client;
22
+ }
23
+
24
+ async function startServer(app: express.Express): Promise<void> {
25
+ return new Promise<void>((resolve) => {
26
+ app.listen(PORT, () => {
27
+ console.log(`Server is running on port ${PORT}`);
28
+ resolve();
29
+ }).on("error", (err: any) => {
30
+ console.log(
31
+ `Failed to start server on port ${PORT}, retrying on port ${++PORT}.\nFor production, set the PORT environment variable to a fixed port.`
32
+ );
33
+ startServer(app).then(() => resolve());
34
+ });
35
+ });
36
+ }
37
+ async function loadRoutes(
38
+ app: Router,
39
+ client: Client,
40
+ dir = path.join(__dirname, "routes")
41
+ ): Promise<void> {
42
+ const files = fs.readdirSync(dir).reverse();
43
+ for (const file of files) {
44
+ const dirname = path.join(dir, file);
45
+ if (fs.statSync(dirname).isDirectory()) {
46
+ // Make router base on the route;
47
+ const router = Router({ mergeParams: true });
48
+ // Check if it is a param or normal route
49
+ // Make the [...] regex
50
+ const route =
51
+ file.startsWith("[") && file.endsWith("]")
52
+ ? `:${file.slice(1, -1)}`
53
+ : file;
54
+
55
+ console.log(`Loading route: /${route}`);
56
+ // check if subfolder has route or middlewares (js or ts files)
57
+ const subFiles = fs.readdirSync(dirname);
58
+ if (
59
+ subFiles
60
+ .map((f) => f.replace(/\.ts|\.js/, ""))
61
+ .includes("middleware")
62
+ ) {
63
+ const middlewareModule: MiddlewareModule = await import(
64
+ path.join(
65
+ dirname,
66
+ subFiles.find(
67
+ (f) => f.replace(/\.ts|\.js/, "") === "middleware"
68
+ ) as string
69
+ )
70
+ );
71
+
72
+ /* require(path.join(
73
+ dirname,
74
+ subFiles.find((f) =>
75
+ f.replace(/\.ts|\.js/, "").includes("middleware")
76
+ ) as string
77
+ )); */
78
+ router.use((req, res, next) =>
79
+ middlewareModule.default(req, res, next, client)
80
+ );
81
+ }
82
+ if (
83
+ subFiles
84
+ .map((f) => f.replace(/\.ts|\.js/, ""))
85
+ .includes("route")
86
+ ) {
87
+ const routerModule: RouteModule = await import(
88
+ path.join(
89
+ dirname,
90
+ subFiles.find(
91
+ (f) => f.replace(/\.ts|\.js/, "") === "route"
92
+ ) as string
93
+ )
94
+ );
95
+ router.all(`/`, (req, res) => {
96
+ const method = req.method.toUpperCase();
97
+ switch (method) {
98
+ case "GET":
99
+ return routerModule.GET(req, res, client);
100
+ case "POST":
101
+ if (routerModule.POST)
102
+ return routerModule.POST(req, res, client);
103
+ break;
104
+ case "PUT":
105
+ if (routerModule.PUT) return routerModule.PUT(req, res, client);
106
+ break;
107
+ case "DELETE":
108
+ if (routerModule.DELETE)
109
+ return routerModule.DELETE(req, res, client);
110
+ break;
111
+ }
112
+ res.status(405).send({ error: "Method Not Allowed" });
113
+ });
114
+ }
115
+ // Recursive load routes
116
+ app.use(`/${route}`, router);
117
+ await loadRoutes(router, client, dirname);
118
+ }
119
+ }
120
+ }
121
+ async function loadBaseMiddleware(app: Router, client: Client): Promise<void> {
122
+ const middlewareModule: MiddlewareModule = await import(
123
+ path.join(__dirname, "routes", `middleware`)
124
+ );
125
+ app.use((req, res, next) =>
126
+ middlewareModule.default(req, res, next, client)
127
+ );
128
+ }
129
+
130
+ type RouteModule = {
131
+ GET(req: express.Request, res: express.Response, client: Client): unknown;
132
+ POST?(req: express.Request, res: express.Response, client: Client): unknown;
133
+ PUT?(req: express.Request, res: express.Response, client: Client): unknown;
134
+ DELETE?(req: express.Request, res: express.Response, client: Client): unknown;
135
+ };
136
+ type MiddlewareModule = {
137
+ default(
138
+ req: express.Request,
139
+ res: express.Response,
140
+ next: express.NextFunction,
141
+ client: Client
142
+ ): unknown;
143
+ };
@@ -0,0 +1,26 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params } from "../route";
4
+
5
+ export async function GET(
6
+ req: express.Request,
7
+ res: express.Response,
8
+ client: Client
9
+ ) {
10
+ const { guildId, memberId } = req.params as Params;
11
+
12
+ try {
13
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
14
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
15
+ const member = await guild.members
16
+ .fetch({
17
+ user: memberId,
18
+ })
19
+ .catch(() => null);
20
+ if (!member) return res.status(404).json({ error: "Member not found", code: "MEMBER_NOT_FOUND" });
21
+
22
+ return res.status(200).json(member.permissions.toArray());
23
+ } catch (error) {
24
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
25
+ }
26
+ }
@@ -0,0 +1,163 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params as SubParams } from "../../route";
4
+
5
+ export type Params = SubParams & {
6
+ roleId: string;
7
+ };
8
+
9
+ export async function GET(
10
+ req: express.Request,
11
+ res: express.Response,
12
+ client: Client
13
+ ) {
14
+ const { guildId, memberId, roleId } = req.params as Params;
15
+
16
+ try {
17
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
18
+ if (!guild)
19
+ return res
20
+ .status(404)
21
+ .json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
22
+
23
+ const member = await guild.members
24
+ .fetch({
25
+ user: memberId,
26
+ })
27
+ .catch(() => null);
28
+ if (!member)
29
+ return res
30
+ .status(404)
31
+ .json({ error: "Member not found", code: "MEMBER_NOT_FOUND" });
32
+
33
+ const role = await guild.roles.fetch(roleId).catch(() => null);
34
+ if (!role)
35
+ return res
36
+ .status(404)
37
+ .json({ error: "Role not found", code: "ROLE_NOT_FOUND" });
38
+
39
+ return res.status(200).json(role.toJSON());
40
+ } catch (error) {
41
+ return res.status(500).json({
42
+ error: "Internal Server Error",
43
+ code: "INTERNAL_SERVER_ERROR",
44
+ });
45
+ }
46
+ }
47
+ export async function POST(
48
+ req: express.Request,
49
+ res: express.Response,
50
+ client: Client
51
+ ) {
52
+ const { guildId, memberId, roleId } = req.params as Params;
53
+
54
+ try {
55
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
56
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
57
+
58
+ const member = await guild.members
59
+ .fetch({
60
+ user: memberId,
61
+ })
62
+ .catch(() => null);
63
+ if (!member) return res.status(404).json({ error: "Member not found", code: "MEMBER_NOT_FOUND" });
64
+
65
+ const role = await guild.roles.fetch(roleId).catch(() => null);
66
+ if (!role) return res.status(404).json({ error: "Role not found", code: "ROLE_NOT_FOUND" });
67
+
68
+ // Check if bot has permission to manage roles
69
+ if (!guild.members.me)
70
+ return res.status(500).json({
71
+ error: "Bot member not found in guild",
72
+ code: "BOT_MEMBER_NOT_FOUND",
73
+ });
74
+ if (!guild.members.me.permissions.has("ManageRoles"))
75
+ return res.status(403).json({
76
+ error: "Bot lacks Manage Roles permission",
77
+ code: "BOT_MISSING_PERMISSIONS",
78
+ });
79
+ // Check if the bot's highest role is higher than the role to be assigned
80
+ if (guild.members.me.roles.highest.position <= role.position)
81
+ return res.status(403).json({
82
+ error: "Bot's highest role is not higher than the role to be assigned",
83
+ code: "BOT_ROLE_HIERARCHY",
84
+ });
85
+
86
+ if(member.roles.cache.has(role.id)) return res.status(400).json({ error: "Member already has the role", code: "ALREADY_EXISTS" });
87
+
88
+ await member.roles.add(role);
89
+
90
+ return res.status(200).json({ message: "Role assigned successfully" });
91
+ } catch (error) {
92
+ return res.status(500).json({
93
+ error: "Internal Server Error",
94
+ code: "INTERNAL_SERVER_ERROR",
95
+ });
96
+ }
97
+ }
98
+ export async function DELETE(
99
+ req: express.Request,
100
+ res: express.Response,
101
+ client: Client
102
+ ) {
103
+ const { guildId, memberId, roleId } = req.params as Params;
104
+
105
+ try {
106
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
107
+ if (!guild)
108
+ return res
109
+ .status(404)
110
+ .json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
111
+
112
+ const member = await guild.members
113
+ .fetch({
114
+ user: memberId,
115
+ })
116
+ .catch(() => null);
117
+ if (!member)
118
+ return res
119
+ .status(404)
120
+ .json({ error: "Member not found", code: "MEMBER_NOT_FOUND" });
121
+
122
+ const role = await guild.roles.fetch(roleId).catch(() => null);
123
+ if (!role)
124
+ return res
125
+ .status(404)
126
+ .json({ error: "Role not found", code: "ROLE_NOT_FOUND" });
127
+
128
+ // Check if bot has permission to manage roles
129
+ if (!guild.members.me)
130
+ return res.status(500).json({
131
+ error: "Bot member not found in guild",
132
+ code: "BOT_MEMBER_NOT_FOUND",
133
+ });
134
+ if (!guild.members.me.permissions.has("ManageRoles"))
135
+ return res.status(403).json({
136
+ error: "Bot lacks Manage Roles permission",
137
+ code: "BOT_MISSING_PERMISSIONS",
138
+ });
139
+ // Check if the bot's highest role is higher than the role to be assigned
140
+ if (guild.members.me.roles.highest.position <= role.position)
141
+ return res.status(403).json({
142
+ error: "Bot's highest role is not higher than the role to be assigned",
143
+ code: "BOT_ROLE_HIERARCHY",
144
+ });
145
+
146
+ if (!member.roles.cache.has(role.id))
147
+ return res
148
+ .status(400)
149
+ .json({
150
+ error: "Member does not have the role",
151
+ code: "ALREADY_EXISTS",
152
+ });
153
+
154
+ await member.roles.remove(role);
155
+
156
+ return res.status(200).json({ message: "Role removed successfully" });
157
+ } catch (error) {
158
+ return res.status(500).json({
159
+ error: "Internal Server Error",
160
+ code: "INTERNAL_SERVER_ERROR",
161
+ });
162
+ }
163
+ }
@@ -0,0 +1,29 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params } from "../route";
4
+
5
+ export async function GET(
6
+ req: express.Request,
7
+ res: express.Response,
8
+ client: Client
9
+ ) {
10
+ const { guildId, memberId } = req.params as Params;
11
+
12
+ try {
13
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
14
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
15
+
16
+ const member = await guild.members
17
+ .fetch({
18
+ user: memberId,
19
+ })
20
+ .catch(() => null);
21
+ if (!member) return res.status(404).json({ error: "Member not found", code: "MEMBER_NOT_FOUND" });
22
+
23
+ return res
24
+ .status(200)
25
+ .json(member.roles.cache.map((role) => role.toJSON()));
26
+ } catch (error) {
27
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
28
+ }
29
+ }
@@ -0,0 +1,29 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params as SubParams } from "../../route";
4
+
5
+ export type Params = SubParams & {
6
+ memberId: string;
7
+ };
8
+
9
+ export async function GET(
10
+ req: express.Request,
11
+ res: express.Response,
12
+ client: Client
13
+ ) {
14
+ const { guildId, memberId } = req.params as Params;
15
+
16
+ try {
17
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
18
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
19
+ const member = await guild.members
20
+ .fetch({
21
+ user: memberId,
22
+ })
23
+ .catch(() => null);
24
+ if (!member) return res.status(404).json({ error: "Member not found", code: "MEMBER_NOT_FOUND" });
25
+ return res.status(200).json(member.toJSON());
26
+ } catch (error) {
27
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
28
+ }
29
+ }
@@ -0,0 +1,32 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params } from "../route";
4
+
5
+ export async function GET(
6
+ req: express.Request,
7
+ res: express.Response,
8
+ client: Client
9
+ ) {
10
+ const { guildId } = req.params as Params;
11
+ const limit = req.query.limit ? Number(req.query.limit) : 50;
12
+ const after = req.query.after ? req.query.after : null;
13
+
14
+ try {
15
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
16
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
17
+
18
+ const members = await guild.members.fetch();
19
+ let membersArray = Array.from(members.values());
20
+
21
+ let startIndex = after
22
+ ? membersArray.findIndex((m) => m.id === after) + 1
23
+ : 0;
24
+ let paginatedMembers = membersArray.slice(
25
+ startIndex,
26
+ startIndex + limit
27
+ );
28
+ return res.status(200).json(paginatedMembers);
29
+ } catch (error) {
30
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
31
+ }
32
+ }
@@ -0,0 +1,25 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params } from "../route";
4
+
5
+ export async function GET(
6
+ req: express.Request,
7
+ res: express.Response,
8
+ client: Client
9
+ ) {
10
+ const { guildId, roleId } = req.params as Params;
11
+
12
+ try {
13
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
14
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
15
+
16
+ const role = await guild.roles.fetch(roleId).catch(() => null);
17
+ if (!role) return res.status(404).json({ error: "Role not found", code: "ROLE_NOT_FOUND" });
18
+
19
+ return res
20
+ .status(200)
21
+ .json(role.members.map((member) => member.toJSON()));
22
+ } catch (error) {
23
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
24
+ }
25
+ }
@@ -0,0 +1,27 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params as SubParams } from "../../route";
4
+
5
+ export type Params = SubParams & {
6
+ roleId: string;
7
+ };
8
+
9
+ export async function GET(
10
+ req: express.Request,
11
+ res: express.Response,
12
+ client: Client
13
+ ) {
14
+ const { guildId, roleId } = req.params as Params;
15
+
16
+ try {
17
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
18
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
19
+
20
+ const role = await guild.roles.fetch(roleId).catch(() => null);
21
+ if (!role) return res.status(404).json({ error: "Role not found", code: "ROLE_NOT_FOUND" });
22
+
23
+ return res.status(200).json(role.toJSON());
24
+ } catch (error) {
25
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
26
+ }
27
+ }
@@ -0,0 +1,22 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+ import { Params } from "../route";
4
+
5
+ export async function GET(
6
+ req: express.Request,
7
+ res: express.Response,
8
+ client: Client
9
+ ) {
10
+ const { guildId } = req.params as Params;
11
+
12
+ try {
13
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
14
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
15
+
16
+ const roles = await guild.roles.fetch();
17
+ const rolesJSON = Array.from(roles.values()).map(role => role.toJSON());
18
+ return res.status(200).json(rolesJSON);
19
+ } catch (error) {
20
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
21
+ }
22
+ }
@@ -0,0 +1,23 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+
4
+ export type Params = {
5
+ guildId: string;
6
+ };
7
+
8
+ export async function GET(
9
+ req: express.Request,
10
+ res: express.Response,
11
+ client: Client
12
+ ) {
13
+ const { guildId } = req.params as Params;
14
+
15
+ try {
16
+ const guild = await client.guilds.fetch(guildId).catch(() => null);
17
+ if (!guild) return res.status(404).json({ error: "Guild not found", code: "GUILD_NOT_FOUND" });
18
+
19
+ return res.status(200).json(guild.toJSON());
20
+ } catch (error) {
21
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
22
+ }
23
+ }
@@ -0,0 +1,28 @@
1
+ import express from "express";
2
+ import { Client } from "discord.js";
3
+
4
+ export async function GET(
5
+ req: express.Request,
6
+ res: express.Response,
7
+ client: Client
8
+ ) {
9
+ const limit = req.query.limit ? Number(req.query.limit) : 50;
10
+ const after = req.query.after ? req.query.after : null;
11
+
12
+ try {
13
+ const guilds = Array.from(
14
+ await client.guilds.fetch().then((g) => g.values())
15
+ );
16
+
17
+ const startIndex = after
18
+ ? guilds.findIndex((g) => g.id === after) + 1
19
+ : 0;
20
+ const paginatedGuilds = guilds.slice(startIndex, startIndex + limit);
21
+
22
+ const guildsJSON = paginatedGuilds.map((guild) => guild.toJSON());
23
+
24
+ return res.status(200).json(guildsJSON);
25
+ } catch (error) {
26
+ return res.status(500).json({ error: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" });
27
+ }
28
+ }
@@ -0,0 +1,14 @@
1
+ import { Client } from "discord.js";
2
+
3
+ export default async function (req: any, res: any, next: any, client: Client) {
4
+ // Check if bot token is provided
5
+ if (!req.headers["authorization"])
6
+ return res
7
+ .status(401)
8
+ .send({ error: "Unauthorized", code: "UNAUTHORIZED" });
9
+
10
+ if (req.headers["authorization"] !== req.app.get("secret"))
11
+ return res.status(403).send({ error: "Forbidden", code: "FORBIDDEN" });
12
+
13
+ next();
14
+ }
@@ -0,0 +1,11 @@
1
+ import { Client } from "discord.js";
2
+
3
+ declare global {
4
+ namespace Express {
5
+ interface Application {
6
+ bot: Client;
7
+ }
8
+ }
9
+ }
10
+
11
+ export {};
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compileOnSave": true,
3
+ "compilerOptions": {
4
+ "module": "commonjs",
5
+ "target": "es5",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "esModuleInterop": true,
9
+ "declaration": true,
10
+ "strict": true,
11
+ "skipLibCheck": true
12
+ },
13
+ "include": ["src", "src/.test.ts"],
14
+ "exclude": ["node_modules"]
15
+ }