@nerimity/nerimity.js 1.1.1 → 1.3.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/build/Client.d.ts +52 -1
- package/build/Client.d.ts.map +1 -1
- package/build/Client.js +95 -2
- package/build/Client.js.map +1 -1
- package/build/EventNames.d.ts +6 -1
- package/build/EventNames.d.ts.map +1 -1
- package/build/EventNames.js +4 -1
- package/build/EventNames.js.map +1 -1
- package/build/RawData.d.ts +26 -3
- package/build/RawData.d.ts.map +1 -1
- package/build/RawData.js.map +1 -1
- package/package.json +1 -1
- package/src/Client.ts +138 -3
- package/src/EventNames.ts +7 -2
- package/src/RawData.ts +30 -3
package/build/Client.d.ts
CHANGED
|
@@ -1,19 +1,57 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import { Socket } from 'socket.io-client';
|
|
3
3
|
import { ClientEventMap } from './EventNames';
|
|
4
|
-
import { ChannelType, MessageType, RawChannel, RawMessage, RawUser } from './RawData';
|
|
4
|
+
import { ChannelType, MessageType, RawChannel, RawMessage, RawServer, RawServerMember, RawUser } from './RawData';
|
|
5
5
|
export declare const Events: {
|
|
6
6
|
readonly Ready: "ready";
|
|
7
7
|
readonly MessageCreate: "messageCreate";
|
|
8
|
+
readonly ServerMemberLeft: "serverMemberLeft";
|
|
9
|
+
readonly ServerMemberJoined: "serverMemberJoined";
|
|
8
10
|
};
|
|
9
11
|
export declare class Client extends EventEmitter<ClientEventMap> {
|
|
10
12
|
socket: Socket;
|
|
11
13
|
token: string | undefined;
|
|
12
14
|
user: ClientUser | undefined;
|
|
15
|
+
users: Users;
|
|
13
16
|
channels: Channels;
|
|
17
|
+
servers: Servers;
|
|
14
18
|
constructor();
|
|
15
19
|
login(token: string): void;
|
|
16
20
|
}
|
|
21
|
+
export declare class Users {
|
|
22
|
+
client: Client;
|
|
23
|
+
cache: Collection<string, User>;
|
|
24
|
+
constructor(client: Client);
|
|
25
|
+
setCache(rawUser: RawUser): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class Servers {
|
|
28
|
+
client: Client;
|
|
29
|
+
cache: Collection<string, Server>;
|
|
30
|
+
constructor(client: Client);
|
|
31
|
+
setCache(rawServer: RawServer): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class Server {
|
|
34
|
+
client: Client;
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
avatar?: string;
|
|
38
|
+
members: ServerMembers;
|
|
39
|
+
constructor(client: Client, server: RawServer);
|
|
40
|
+
}
|
|
41
|
+
export declare class ServerMembers {
|
|
42
|
+
client: Client;
|
|
43
|
+
cache: Collection<string, ServerMember>;
|
|
44
|
+
constructor(client: Client);
|
|
45
|
+
setCache(rawMember: RawServerMember): ServerMember;
|
|
46
|
+
}
|
|
47
|
+
export declare class ServerMember {
|
|
48
|
+
client: Client;
|
|
49
|
+
id: string;
|
|
50
|
+
user: User;
|
|
51
|
+
server: Server;
|
|
52
|
+
constructor(client: Client, member: RawServerMember);
|
|
53
|
+
toString(): string;
|
|
54
|
+
}
|
|
17
55
|
export declare class Channels {
|
|
18
56
|
client: Client;
|
|
19
57
|
cache: Collection<string, AllChannel>;
|
|
@@ -40,6 +78,7 @@ export declare class ServerChannel extends Channel {
|
|
|
40
78
|
serverId: string;
|
|
41
79
|
permissions: number;
|
|
42
80
|
categoryId?: string;
|
|
81
|
+
server: Server;
|
|
43
82
|
constructor(client: Client, channel: RawChannel);
|
|
44
83
|
}
|
|
45
84
|
export declare class Message {
|
|
@@ -54,6 +93,7 @@ export declare class Message {
|
|
|
54
93
|
constructor(client: Client, message: RawMessage);
|
|
55
94
|
reply(content: string, opts?: MessageOpts): Promise<Message>;
|
|
56
95
|
edit(content: string): Promise<Message>;
|
|
96
|
+
toString(): string;
|
|
57
97
|
}
|
|
58
98
|
declare class User {
|
|
59
99
|
client: Client;
|
|
@@ -69,7 +109,18 @@ declare class User {
|
|
|
69
109
|
constructor(client: Client, user: RawUser);
|
|
70
110
|
toString(): string;
|
|
71
111
|
}
|
|
112
|
+
export interface ActivityOpts {
|
|
113
|
+
action: string;
|
|
114
|
+
name: string;
|
|
115
|
+
startedAt: number;
|
|
116
|
+
endsAt?: number;
|
|
117
|
+
imgSrc?: string;
|
|
118
|
+
title?: string;
|
|
119
|
+
subtitle?: string;
|
|
120
|
+
link?: string;
|
|
121
|
+
}
|
|
72
122
|
declare class ClientUser extends User {
|
|
123
|
+
setActivity(activity?: ActivityOpts | null): void;
|
|
73
124
|
constructor(client: Client, user: RawUser);
|
|
74
125
|
}
|
|
75
126
|
declare class Collection<K, V> extends Map<K, V> {
|
package/build/Client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,MAAM,EAAK,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAwD,MAAM,cAAc,CAAC;AACpG,OAAO,EAAwB,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,MAAM,EAAK,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAwD,MAAM,cAAc,CAAC;AACpG,OAAO,EAAwB,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKxI,eAAO,MAAM,MAAM;;;;;CAAe,CAAC;AAEnC,qBAAa,MAAO,SAAQ,YAAY,CAAC,cAAc,CAAC;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG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M;IAW1B,QAAQ;CAGX;AAGD,cAAM,IAAI;IACN,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;gBACF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAczC,QAAQ;CAGX;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,cAAM,UAAW,SAAQ,IAAI;IAEzB,WAAW,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI;gBAI9B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;CAG5C;AAGD,cAAM,UAAU,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;;CAIvC"}
|
package/build/Client.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Message = exports.ServerChannel = exports.Channel = exports.Channels = exports.Client = exports.Events = void 0;
|
|
6
|
+
exports.Message = exports.ServerChannel = exports.Channel = exports.Channels = exports.ServerMember = exports.ServerMembers = exports.Server = exports.Servers = exports.Users = exports.Client = exports.Events = void 0;
|
|
7
7
|
const eventemitter3_1 = __importDefault(require("eventemitter3"));
|
|
8
8
|
const socket_io_client_1 = require("socket.io-client");
|
|
9
9
|
const EventNames_1 = require("./EventNames");
|
|
@@ -18,6 +18,8 @@ class Client extends eventemitter3_1.default {
|
|
|
18
18
|
autoConnect: false,
|
|
19
19
|
});
|
|
20
20
|
this.channels = new Channels(this);
|
|
21
|
+
this.users = new Users(this);
|
|
22
|
+
this.servers = new Servers(this);
|
|
21
23
|
new EventHandlers(this);
|
|
22
24
|
}
|
|
23
25
|
login(token) {
|
|
@@ -32,6 +34,8 @@ class EventHandlers {
|
|
|
32
34
|
this.socket = client.socket;
|
|
33
35
|
client.socket.on(EventNames_1.SocketServerEvents.CONNECT, this.onConnect.bind(this));
|
|
34
36
|
client.socket.on(EventNames_1.SocketServerEvents.USER_AUTHENTICATED, this.onAuthenticated.bind(this));
|
|
37
|
+
client.socket.on(EventNames_1.SocketServerEvents.SERVER_MEMBER_JOINED, this.onServerMemberJoined.bind(this));
|
|
38
|
+
client.socket.on(EventNames_1.SocketServerEvents.SERVER_MEMBER_LEFT, this.onServerMemberLeft.bind(this));
|
|
35
39
|
client.socket.on(EventNames_1.SocketServerEvents.MESSAGE_CREATED, this.onMessageCreated.bind(this));
|
|
36
40
|
}
|
|
37
41
|
onConnect() {
|
|
@@ -39,17 +43,99 @@ class EventHandlers {
|
|
|
39
43
|
}
|
|
40
44
|
onAuthenticated(payload) {
|
|
41
45
|
this.client.user = new ClientUser(this.client, payload.user);
|
|
46
|
+
for (let i = 0; i < payload.servers.length; i++) {
|
|
47
|
+
const server = payload.servers[i];
|
|
48
|
+
this.client.servers.setCache(server);
|
|
49
|
+
}
|
|
42
50
|
for (let i = 0; i < payload.channels.length; i++) {
|
|
43
51
|
const rawChannel = payload.channels[i];
|
|
44
52
|
this.client.channels.setCache(rawChannel);
|
|
45
53
|
}
|
|
54
|
+
for (let i = 0; i < payload.serverMembers.length; i++) {
|
|
55
|
+
const member = payload.serverMembers[i];
|
|
56
|
+
this.client.users.setCache(member.user);
|
|
57
|
+
const server = this.client.servers.cache.get(member.serverId);
|
|
58
|
+
server?.members.setCache(member);
|
|
59
|
+
}
|
|
46
60
|
this.client.emit(EventNames_1.ClientEvents.Ready);
|
|
47
61
|
}
|
|
62
|
+
onServerMemberJoined(payload) {
|
|
63
|
+
const server = this.client.servers.cache.get(payload.serverId);
|
|
64
|
+
this.client.users.setCache(payload.member.user);
|
|
65
|
+
const member = server?.members.setCache(payload.member);
|
|
66
|
+
if (!member)
|
|
67
|
+
return;
|
|
68
|
+
this.client.emit('serverMemberJoined', member);
|
|
69
|
+
}
|
|
70
|
+
onServerMemberLeft(payload) {
|
|
71
|
+
const server = this.client.servers.cache.get(payload.serverId);
|
|
72
|
+
const member = server?.members.cache.get(payload.userId);
|
|
73
|
+
if (!member)
|
|
74
|
+
return;
|
|
75
|
+
this.client.emit('serverMemberLeft', member);
|
|
76
|
+
server?.members.cache.delete(payload.userId);
|
|
77
|
+
}
|
|
48
78
|
onMessageCreated(payload) {
|
|
49
79
|
const message = new Message(this.client, payload.message);
|
|
50
80
|
this.client.emit(EventNames_1.ClientEvents.MessageCreate, message);
|
|
51
81
|
}
|
|
52
82
|
}
|
|
83
|
+
class Users {
|
|
84
|
+
constructor(client) {
|
|
85
|
+
this.client = client;
|
|
86
|
+
this.cache = new Collection();
|
|
87
|
+
}
|
|
88
|
+
setCache(rawUser) {
|
|
89
|
+
const user = new User(this.client, rawUser);
|
|
90
|
+
this.cache.set(rawUser.id, user);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.Users = Users;
|
|
94
|
+
class Servers {
|
|
95
|
+
constructor(client) {
|
|
96
|
+
this.client = client;
|
|
97
|
+
this.cache = new Collection();
|
|
98
|
+
}
|
|
99
|
+
setCache(rawServer) {
|
|
100
|
+
const server = new Server(this.client, rawServer);
|
|
101
|
+
this.cache.set(server.id, server);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.Servers = Servers;
|
|
105
|
+
class Server {
|
|
106
|
+
constructor(client, server) {
|
|
107
|
+
this.client = client;
|
|
108
|
+
this.id = server.id;
|
|
109
|
+
this.name = server.name;
|
|
110
|
+
this.avatar = server.avatar;
|
|
111
|
+
this.members = new ServerMembers(this.client);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.Server = Server;
|
|
115
|
+
class ServerMembers {
|
|
116
|
+
constructor(client) {
|
|
117
|
+
this.client = client;
|
|
118
|
+
this.cache = new Collection();
|
|
119
|
+
}
|
|
120
|
+
setCache(rawMember) {
|
|
121
|
+
const member = new ServerMember(this.client, rawMember);
|
|
122
|
+
this.cache.set(member.user.id, member);
|
|
123
|
+
return member;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.ServerMembers = ServerMembers;
|
|
127
|
+
class ServerMember {
|
|
128
|
+
constructor(client, member) {
|
|
129
|
+
this.client = client;
|
|
130
|
+
this.id = member.user.id;
|
|
131
|
+
this.user = this.client.users.cache.get(member.user.id);
|
|
132
|
+
this.server = this.client.servers.cache.get(member.serverId);
|
|
133
|
+
}
|
|
134
|
+
toString() {
|
|
135
|
+
return `[@:${this.id}]`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.ServerMember = ServerMember;
|
|
53
139
|
class Channels {
|
|
54
140
|
constructor(client) {
|
|
55
141
|
this.client = client;
|
|
@@ -96,6 +182,7 @@ class ServerChannel extends Channel {
|
|
|
96
182
|
this.createdById = channel.createdById;
|
|
97
183
|
this.serverId = channel.serverId;
|
|
98
184
|
this.categoryId = channel.categoryId;
|
|
185
|
+
this.server = this.client.servers.cache.get(this.serverId);
|
|
99
186
|
}
|
|
100
187
|
}
|
|
101
188
|
exports.ServerChannel = ServerChannel;
|
|
@@ -108,7 +195,7 @@ class Message {
|
|
|
108
195
|
this.content = message.content;
|
|
109
196
|
this.type = message.type;
|
|
110
197
|
this.createdAt = message.createdAt;
|
|
111
|
-
this.user =
|
|
198
|
+
this.user = this.client.users.cache.get(message.createdBy.id);
|
|
112
199
|
}
|
|
113
200
|
reply(content, opts) {
|
|
114
201
|
return this.channel.send(`${this.user} ${content}`, opts);
|
|
@@ -123,6 +210,9 @@ class Message {
|
|
|
123
210
|
const message = new Message(this.client, RawMessage);
|
|
124
211
|
return message;
|
|
125
212
|
}
|
|
213
|
+
toString() {
|
|
214
|
+
return `[q:${this.id}]`;
|
|
215
|
+
}
|
|
126
216
|
}
|
|
127
217
|
exports.Message = Message;
|
|
128
218
|
class User {
|
|
@@ -143,6 +233,9 @@ class User {
|
|
|
143
233
|
}
|
|
144
234
|
}
|
|
145
235
|
class ClientUser extends User {
|
|
236
|
+
setActivity(activity) {
|
|
237
|
+
this.client.socket.emit(EventNames_1.SocketClientEvents.UPDATE_ACTIVITY, activity);
|
|
238
|
+
}
|
|
146
239
|
constructor(client, user) {
|
|
147
240
|
super(client, user);
|
|
148
241
|
}
|
package/build/Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;AACzC,uDAA4C;AAC5C,6CAAoG;AAEpG,8DAAqE;AACrE,kEAAmD;AAGtC,QAAA,MAAM,GAAG,yBAAY,CAAC;AAEnC,MAAa,MAAO,SAAQ,uBAA4B;
|
|
1
|
+
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;AACzC,uDAA4C;AAC5C,6CAAoG;AAEpG,8DAAqE;AACrE,kEAAmD;AAGtC,QAAA,MAAM,GAAG,yBAAY,CAAC;AAEnC,MAAa,MAAO,SAAQ,uBAA4B;IAOpD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,IAAA,qBAAE,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;IACxB,CAAC;CACJ;AAGD,MAAM,UAAiB,SAAQ,GAAS;IACpC;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CACJ"}
|
package/build/EventNames.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { Message } from './Client';
|
|
1
|
+
import { Message, ServerMember } from './Client';
|
|
2
2
|
export declare const ClientEvents: {
|
|
3
3
|
readonly Ready: "ready";
|
|
4
4
|
readonly MessageCreate: "messageCreate";
|
|
5
|
+
readonly ServerMemberLeft: "serverMemberLeft";
|
|
6
|
+
readonly ServerMemberJoined: "serverMemberJoined";
|
|
5
7
|
};
|
|
6
8
|
export type ClientEventMap = {
|
|
7
9
|
'ready': () => void;
|
|
8
10
|
'messageCreate': (message: Message) => void;
|
|
11
|
+
'serverMemberLeft': (member: ServerMember) => void;
|
|
12
|
+
'serverMemberJoined': (member: ServerMember) => void;
|
|
9
13
|
};
|
|
10
14
|
export declare const SocketClientEvents: {
|
|
11
15
|
AUTHENTICATE: string;
|
|
12
16
|
NOTIFICATION_DISMISS: string;
|
|
17
|
+
UPDATE_ACTIVITY: string;
|
|
13
18
|
};
|
|
14
19
|
export declare const SocketServerEvents: {
|
|
15
20
|
readonly CONNECT: "connect";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventNames.d.ts","sourceRoot":"","sources":["../src/EventNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"EventNames.d.ts","sourceRoot":"","sources":["../src/EventNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAGX,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,kBAAkB,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,oBAAoB,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CACxD,CAAA;AAID,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCrB,CAAC"}
|
package/build/EventNames.js
CHANGED
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SocketServerEvents = exports.SocketClientEvents = exports.ClientEvents = void 0;
|
|
4
4
|
exports.ClientEvents = {
|
|
5
5
|
Ready: 'ready',
|
|
6
|
-
MessageCreate: 'messageCreate'
|
|
6
|
+
MessageCreate: 'messageCreate',
|
|
7
|
+
ServerMemberLeft: 'serverMemberLeft',
|
|
8
|
+
ServerMemberJoined: 'serverMemberJoined',
|
|
7
9
|
};
|
|
8
10
|
exports.SocketClientEvents = {
|
|
9
11
|
AUTHENTICATE: 'user:authenticate',
|
|
10
12
|
NOTIFICATION_DISMISS: 'notification:dismiss',
|
|
13
|
+
UPDATE_ACTIVITY: 'user:update_activity',
|
|
11
14
|
};
|
|
12
15
|
exports.SocketServerEvents = {
|
|
13
16
|
CONNECT: 'connect',
|
package/build/EventNames.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventNames.js","sourceRoot":"","sources":["../src/EventNames.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"EventNames.js","sourceRoot":"","sources":["../src/EventNames.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;CAClC,CAAC;AAYE,QAAA,kBAAkB,GAAG;IAC9B,YAAY,EAAE,mBAAmB;IACjC,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,sBAAsB;CAC1C,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAC9B,OAAO,EAAE,SAAS;IAClB,kBAAkB,EAAC,yBAAyB;IAC5C,YAAY,EAAE,cAAc;IAE5B,kBAAkB,EAAE,oBAAoB;IAExC,oBAAoB,EAAE,sBAAsB;IAE5C,mBAAmB,EAAE,qBAAqB;IAC1C,sBAAsB,EAAE,wBAAwB;IAChD,uBAAuB,EAAE,yBAAyB;IAClD,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,sBAAsB,EAAE,wBAAwB;IAEhD,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,cAAc,EAAE,gBAAgB;IAChC,mBAAmB,EAAE,qBAAqB;IAC1C,mBAAmB,EAAE,qBAAqB;IAC1C,yBAAyB,EAAE,2BAA2B;IACtD,4BAA4B,EAAE,8BAA8B;IAE5D,mBAAmB,EAAE,qBAAqB;IAG1C,oBAAoB,EAAE,sBAAsB;IAC5C,kBAAkB,EAAE,oBAAoB;IACxC,qBAAqB,EAAE,uBAAuB;IAC9C,sBAAsB,EAAE,wBAAwB;IAChD,sBAAsB,EAAE,wBAAwB;IAChD,sBAAsB,EAAE,wBAAwB;IAChD,oBAAoB,EAAE,sBAAsB;IAI5C,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;CAC5B,CAAC"}
|
package/build/RawData.d.ts
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
export interface AuthenticatedPayload {
|
|
2
2
|
user: RawUser;
|
|
3
|
-
servers:
|
|
4
|
-
serverMembers:
|
|
3
|
+
servers: RawServer[];
|
|
4
|
+
serverMembers: RawServerMember[];
|
|
5
5
|
messageMentions: any[];
|
|
6
|
-
channels:
|
|
6
|
+
channels: RawChannel[];
|
|
7
7
|
serverRoles: any[];
|
|
8
8
|
presences: any[];
|
|
9
9
|
friends: any[];
|
|
10
10
|
inbox: any[];
|
|
11
11
|
lastSeenServerChannelIds: Record<string, number>;
|
|
12
12
|
}
|
|
13
|
+
export interface RawServer {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
hexColor: string;
|
|
17
|
+
defaultChannelId: string;
|
|
18
|
+
systemChannelId?: string;
|
|
19
|
+
avatar?: string;
|
|
20
|
+
banner?: string;
|
|
21
|
+
defaultRoleId: string;
|
|
22
|
+
createdById: string;
|
|
23
|
+
createdAt: number;
|
|
24
|
+
verified: boolean;
|
|
25
|
+
customEmojis: any[];
|
|
26
|
+
_count?: {
|
|
27
|
+
welcomeQuestions: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
13
30
|
export interface RawUser {
|
|
14
31
|
id: string;
|
|
15
32
|
avatar?: string;
|
|
@@ -39,6 +56,12 @@ export interface RawMessage {
|
|
|
39
56
|
mentions?: Array<RawUser>;
|
|
40
57
|
attachments?: Array<any>;
|
|
41
58
|
}
|
|
59
|
+
export interface RawServerMember {
|
|
60
|
+
serverId: string;
|
|
61
|
+
user: RawUser;
|
|
62
|
+
joinedAt: number;
|
|
63
|
+
roleIds: string[];
|
|
64
|
+
}
|
|
42
65
|
export declare enum ChannelType {
|
|
43
66
|
DM_TEXT = 0,
|
|
44
67
|
SERVER_TEXT = 1,
|
package/build/RawData.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RawData.d.ts","sourceRoot":"","sources":["../src/RawData.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"RawData.d.ts","sourceRoot":"","sources":["../src/RawData.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE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f,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,QAAQ,IAAI;CACf;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAGH,oBAAY,WAAW;IACnB,OAAO,IAAI;IACX,WAAW,IAAI;IACf,QAAQ,IAAI;CACb;AAEH,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAAA;CACjC"}
|
package/build/RawData.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RawData.js","sourceRoot":"","sources":["../src/RawData.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"RawData.js","sourceRoot":"","sources":["../src/RawData.ts"],"names":[],"mappings":";;;AA4CA,IAAY,WAMX;AAND,WAAY,WAAW;IACnB,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,6DAAgB,CAAA;IAChB,uDAAa,CAAA;IACb,qDAAY,CAAA;AAChB,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAsBD,IAAY,WAIT;AAJH,WAAY,WAAW;IACnB,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,qDAAY,CAAA;AACd,CAAC,EAJS,WAAW,2BAAX,WAAW,QAIpB"}
|
package/package.json
CHANGED
package/src/Client.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import {Socket, io} from 'socket.io-client';
|
|
3
3
|
import { ClientEventMap, ClientEvents, SocketClientEvents, SocketServerEvents } from './EventNames';
|
|
4
|
-
import { AuthenticatedPayload, ChannelType, MessageType, RawChannel, RawMessage, RawUser } from './RawData';
|
|
4
|
+
import { AuthenticatedPayload, ChannelType, MessageType, RawChannel, RawMessage, RawServer, RawServerMember, RawUser } from './RawData';
|
|
5
5
|
import { editMessage, postMessage } from './services/MessageService';
|
|
6
6
|
import { path } from './services/serviceEndpoints';
|
|
7
7
|
|
|
@@ -12,7 +12,9 @@ export class Client extends EventEmitter<ClientEventMap> {
|
|
|
12
12
|
socket: Socket;
|
|
13
13
|
token: string | undefined;
|
|
14
14
|
user: ClientUser | undefined;
|
|
15
|
+
users: Users;
|
|
15
16
|
channels: Channels;
|
|
17
|
+
servers: Servers;
|
|
16
18
|
constructor() {
|
|
17
19
|
super();
|
|
18
20
|
this.socket = io(path, {
|
|
@@ -20,6 +22,8 @@ export class Client extends EventEmitter<ClientEventMap> {
|
|
|
20
22
|
autoConnect: false,
|
|
21
23
|
});
|
|
22
24
|
this.channels = new Channels(this);
|
|
25
|
+
this.users = new Users(this);
|
|
26
|
+
this.servers = new Servers(this);
|
|
23
27
|
new EventHandlers(this);
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -39,6 +43,8 @@ class EventHandlers {
|
|
|
39
43
|
|
|
40
44
|
client.socket.on(SocketServerEvents.CONNECT, this.onConnect.bind(this));
|
|
41
45
|
client.socket.on(SocketServerEvents.USER_AUTHENTICATED, this.onAuthenticated.bind(this));
|
|
46
|
+
client.socket.on(SocketServerEvents.SERVER_MEMBER_JOINED, this.onServerMemberJoined.bind(this));
|
|
47
|
+
client.socket.on(SocketServerEvents.SERVER_MEMBER_LEFT, this.onServerMemberLeft.bind(this));
|
|
42
48
|
client.socket.on(SocketServerEvents.MESSAGE_CREATED, this.onMessageCreated.bind(this));
|
|
43
49
|
}
|
|
44
50
|
onConnect() {
|
|
@@ -47,22 +53,128 @@ class EventHandlers {
|
|
|
47
53
|
onAuthenticated(payload: AuthenticatedPayload) {
|
|
48
54
|
this.client.user = new ClientUser(this.client, payload.user);
|
|
49
55
|
|
|
56
|
+
for (let i = 0; i < payload.servers.length; i++) {
|
|
57
|
+
const server = payload.servers[i];
|
|
58
|
+
this.client.servers.setCache(server);
|
|
59
|
+
}
|
|
60
|
+
|
|
50
61
|
for (let i = 0; i < payload.channels.length; i++) {
|
|
51
62
|
const rawChannel = payload.channels[i];
|
|
52
63
|
this.client.channels.setCache(rawChannel);
|
|
53
64
|
}
|
|
65
|
+
for (let i = 0; i < payload.serverMembers.length; i++) {
|
|
66
|
+
const member = payload.serverMembers[i];
|
|
67
|
+
this.client.users.setCache(member.user);
|
|
68
|
+
const server = this.client.servers.cache.get(member.serverId);
|
|
69
|
+
server?.members.setCache(member);
|
|
70
|
+
}
|
|
54
71
|
|
|
55
72
|
this.client.emit(ClientEvents.Ready);
|
|
56
73
|
}
|
|
74
|
+
|
|
75
|
+
onServerMemberJoined(payload: {serverId: string; member: RawServerMember}) {
|
|
76
|
+
const server = this.client.servers.cache.get(payload.serverId);
|
|
77
|
+
this.client.users.setCache(payload.member.user);
|
|
78
|
+
const member = server?.members.setCache(payload.member);
|
|
79
|
+
if (!member) return;
|
|
80
|
+
this.client.emit('serverMemberJoined', member);
|
|
81
|
+
}
|
|
82
|
+
onServerMemberLeft(payload: { userId: string, serverId: string }) {
|
|
83
|
+
const server = this.client.servers.cache.get(payload.serverId);
|
|
84
|
+
const member = server?.members.cache.get(payload.userId);
|
|
85
|
+
if (!member) return;
|
|
86
|
+
this.client.emit('serverMemberLeft', member);
|
|
87
|
+
server?.members.cache.delete(payload.userId);
|
|
88
|
+
}
|
|
57
89
|
onMessageCreated(payload: {message: RawMessage}) {
|
|
58
90
|
const message = new Message(this.client, payload.message);
|
|
59
91
|
this.client.emit(ClientEvents.MessageCreate, message);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
export class Users {
|
|
98
|
+
client: Client;
|
|
99
|
+
cache: Collection<string, User>;
|
|
100
|
+
constructor(client: Client) {
|
|
101
|
+
this.client = client;
|
|
102
|
+
this.cache = new Collection();
|
|
103
|
+
}
|
|
104
|
+
setCache(rawUser: RawUser) {
|
|
105
|
+
const user = new User(this.client, rawUser);
|
|
106
|
+
this.cache.set(rawUser.id, user);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
export class Servers {
|
|
112
|
+
client: Client;
|
|
113
|
+
cache: Collection<string, Server>;
|
|
114
|
+
constructor(client: Client) {
|
|
115
|
+
this.client = client;
|
|
116
|
+
this.cache = new Collection();
|
|
117
|
+
}
|
|
118
|
+
setCache(rawServer: RawServer) {
|
|
119
|
+
const server = new Server(this.client, rawServer);
|
|
120
|
+
this.cache.set(server.id, server);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
export class Server {
|
|
127
|
+
client: Client;
|
|
128
|
+
id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
avatar?: string;
|
|
60
131
|
|
|
132
|
+
members: ServerMembers;
|
|
133
|
+
constructor(client: Client, server: RawServer) {
|
|
134
|
+
this.client = client;
|
|
135
|
+
|
|
136
|
+
this.id = server.id;
|
|
137
|
+
this.name = server.name;
|
|
138
|
+
this.avatar = server.avatar;
|
|
139
|
+
this.members = new ServerMembers(this.client);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export class ServerMembers {
|
|
144
|
+
client: Client;
|
|
145
|
+
cache: Collection<string, ServerMember>;
|
|
146
|
+
constructor(client: Client) {
|
|
147
|
+
this.client = client;
|
|
148
|
+
this.cache = new Collection();
|
|
149
|
+
}
|
|
150
|
+
setCache(rawMember: RawServerMember) {
|
|
151
|
+
const member = new ServerMember(this.client, rawMember);
|
|
152
|
+
this.cache.set(member.user.id, member);
|
|
153
|
+
return member;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export class ServerMember {
|
|
157
|
+
client: Client;
|
|
158
|
+
id: string;
|
|
159
|
+
user: User;
|
|
160
|
+
server: Server;
|
|
161
|
+
|
|
162
|
+
constructor(client: Client, member: RawServerMember) {
|
|
163
|
+
this.client = client;
|
|
164
|
+
this.id = member.user.id;
|
|
165
|
+
|
|
166
|
+
this.user = this.client.users.cache.get(member.user.id)!;
|
|
167
|
+
this.server = this.client.servers.cache.get(member.serverId)!;
|
|
168
|
+
}
|
|
169
|
+
toString() {
|
|
170
|
+
return `[@:${this.id}]`;
|
|
61
171
|
}
|
|
62
172
|
}
|
|
63
173
|
|
|
64
174
|
|
|
65
175
|
|
|
176
|
+
|
|
177
|
+
|
|
66
178
|
export class Channels {
|
|
67
179
|
client: Client;
|
|
68
180
|
cache: Collection<string, AllChannel>;
|
|
@@ -120,6 +232,7 @@ export class ServerChannel extends Channel {
|
|
|
120
232
|
serverId: string;
|
|
121
233
|
permissions: number;
|
|
122
234
|
categoryId?: string;
|
|
235
|
+
server: Server;
|
|
123
236
|
|
|
124
237
|
constructor(client: Client, channel: RawChannel) {
|
|
125
238
|
super(client, channel);
|
|
@@ -128,6 +241,8 @@ export class ServerChannel extends Channel {
|
|
|
128
241
|
this.createdById = channel.createdById!;
|
|
129
242
|
this.serverId = channel.serverId!;
|
|
130
243
|
this.categoryId = channel.categoryId!;
|
|
244
|
+
|
|
245
|
+
this.server = this.client.servers.cache.get(this.serverId)!;
|
|
131
246
|
}
|
|
132
247
|
}
|
|
133
248
|
|
|
@@ -150,7 +265,7 @@ export class Message {
|
|
|
150
265
|
this.content = message.content;
|
|
151
266
|
this.type = message.type;
|
|
152
267
|
this.createdAt = message.createdAt;
|
|
153
|
-
this.user =
|
|
268
|
+
this.user = this.client.users.cache.get(message.createdBy.id)!;
|
|
154
269
|
}
|
|
155
270
|
reply(content: string, opts?: MessageOpts) {
|
|
156
271
|
return this.channel.send(`${this.user} ${content}`, opts);
|
|
@@ -165,8 +280,11 @@ export class Message {
|
|
|
165
280
|
const message = new Message(this.client, RawMessage);
|
|
166
281
|
return message;
|
|
167
282
|
}
|
|
168
|
-
}
|
|
169
283
|
|
|
284
|
+
toString() {
|
|
285
|
+
return `[q:${this.id}]`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
170
288
|
|
|
171
289
|
|
|
172
290
|
class User {
|
|
@@ -199,7 +317,24 @@ class User {
|
|
|
199
317
|
}
|
|
200
318
|
}
|
|
201
319
|
|
|
320
|
+
export interface ActivityOpts {
|
|
321
|
+
action: string;
|
|
322
|
+
name: string;
|
|
323
|
+
startedAt: number;
|
|
324
|
+
endsAt?: number;
|
|
325
|
+
|
|
326
|
+
imgSrc?: string
|
|
327
|
+
title?: string
|
|
328
|
+
subtitle?: string;
|
|
329
|
+
link?: string;
|
|
330
|
+
}
|
|
331
|
+
|
|
202
332
|
class ClientUser extends User {
|
|
333
|
+
|
|
334
|
+
setActivity(activity?: ActivityOpts | null) {
|
|
335
|
+
this.client.socket.emit(SocketClientEvents.UPDATE_ACTIVITY, activity);
|
|
336
|
+
}
|
|
337
|
+
|
|
203
338
|
constructor(client: Client, user: RawUser) {
|
|
204
339
|
super(client, user);
|
|
205
340
|
}
|
package/src/EventNames.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { Message } from './Client';
|
|
1
|
+
import { Message, ServerMember } from './Client';
|
|
2
2
|
|
|
3
3
|
export const ClientEvents = {
|
|
4
4
|
Ready: 'ready',
|
|
5
|
-
MessageCreate: 'messageCreate'
|
|
5
|
+
MessageCreate: 'messageCreate',
|
|
6
|
+
ServerMemberLeft: 'serverMemberLeft',
|
|
7
|
+
ServerMemberJoined: 'serverMemberJoined',
|
|
6
8
|
} as const;
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
export type ClientEventMap = {
|
|
10
12
|
'ready': () => void;
|
|
11
13
|
'messageCreate': (message: Message) => void;
|
|
14
|
+
'serverMemberLeft': (member: ServerMember) => void;
|
|
15
|
+
'serverMemberJoined': (member: ServerMember) => void;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
|
|
@@ -16,6 +20,7 @@ export type ClientEventMap = {
|
|
|
16
20
|
export const SocketClientEvents = {
|
|
17
21
|
AUTHENTICATE: 'user:authenticate',
|
|
18
22
|
NOTIFICATION_DISMISS: 'notification:dismiss',
|
|
23
|
+
UPDATE_ACTIVITY: 'user:update_activity',
|
|
19
24
|
};
|
|
20
25
|
|
|
21
26
|
export const SocketServerEvents = {
|
package/src/RawData.ts
CHANGED
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
export interface AuthenticatedPayload {
|
|
3
3
|
user: RawUser;
|
|
4
|
-
servers:
|
|
5
|
-
serverMembers:
|
|
4
|
+
servers: RawServer[];
|
|
5
|
+
serverMembers: RawServerMember[];
|
|
6
6
|
messageMentions: any[]
|
|
7
|
-
channels:
|
|
7
|
+
channels: RawChannel[];
|
|
8
8
|
serverRoles: any[];
|
|
9
9
|
presences: any[];
|
|
10
10
|
friends: any[];
|
|
11
11
|
inbox: any[];
|
|
12
12
|
lastSeenServerChannelIds: Record<string, number>; // { [channelId]: timestamp }
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
export interface RawServer {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
hexColor: string;
|
|
19
|
+
defaultChannelId: string;
|
|
20
|
+
systemChannelId?: string;
|
|
21
|
+
avatar?: string;
|
|
22
|
+
banner?: string;
|
|
23
|
+
defaultRoleId: string;
|
|
24
|
+
createdById: string;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
verified: boolean;
|
|
27
|
+
customEmojis: any[];
|
|
28
|
+
_count?: {
|
|
29
|
+
welcomeQuestions: number;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
14
33
|
export interface RawUser {
|
|
15
34
|
id: string;
|
|
16
35
|
avatar?: string;
|
|
@@ -43,6 +62,14 @@ export interface RawMessage {
|
|
|
43
62
|
attachments?: Array<any>
|
|
44
63
|
}
|
|
45
64
|
|
|
65
|
+
export interface RawServerMember {
|
|
66
|
+
serverId: string;
|
|
67
|
+
user: RawUser;
|
|
68
|
+
joinedAt: number;
|
|
69
|
+
roleIds: string[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
46
73
|
export enum ChannelType {
|
|
47
74
|
DM_TEXT = 0,
|
|
48
75
|
SERVER_TEXT = 1,
|