@huni_ee/nazu 0.0.0-stage → 0.1.1
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/LICENSE +201 -0
- package/README.md +72 -2
- package/dist/api/auth.d.ts +10 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +81 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/friends.d.ts +12 -0
- package/dist/api/friends.d.ts.map +1 -0
- package/dist/api/friends.js +126 -0
- package/dist/api/friends.js.map +1 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +9 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/self-profile.d.ts +8 -0
- package/dist/api/self-profile.d.ts.map +1 -0
- package/dist/api/self-profile.js +89 -0
- package/dist/api/self-profile.js.map +1 -0
- package/dist/api/types.d.ts +133 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +7 -0
- package/dist/api/types.js.map +1 -0
- package/dist/channel/channel.d.ts +122 -0
- package/dist/channel/channel.d.ts.map +1 -0
- package/dist/channel/channel.js +280 -0
- package/dist/channel/channel.js.map +1 -0
- package/dist/channel/index.d.ts +5 -0
- package/dist/channel/index.d.ts.map +1 -0
- package/dist/channel/index.js +9 -0
- package/dist/channel/index.js.map +1 -0
- package/dist/channel/media.d.ts +4 -0
- package/dist/channel/media.d.ts.map +1 -0
- package/dist/channel/media.js +42 -0
- package/dist/channel/media.js.map +1 -0
- package/dist/channel/normal-channel.d.ts +27 -0
- package/dist/channel/normal-channel.d.ts.map +1 -0
- package/dist/channel/normal-channel.js +39 -0
- package/dist/channel/normal-channel.js.map +1 -0
- package/dist/channel/open-channel.d.ts +25 -0
- package/dist/channel/open-channel.d.ts.map +1 -0
- package/dist/channel/open-channel.js +34 -0
- package/dist/channel/open-channel.js.map +1 -0
- package/dist/chat/attachment.d.ts +5 -0
- package/dist/chat/attachment.d.ts.map +1 -0
- package/dist/chat/attachment.js +90 -0
- package/dist/chat/attachment.js.map +1 -0
- package/dist/chat/chat-type.d.ts +31 -0
- package/dist/chat/chat-type.d.ts.map +1 -0
- package/dist/chat/chat-type.js +39 -0
- package/dist/chat/chat-type.js.map +1 -0
- package/dist/chat/chat.d.ts +15 -0
- package/dist/chat/chat.d.ts.map +1 -0
- package/dist/chat/chat.js +23 -0
- package/dist/chat/chat.js.map +1 -0
- package/dist/chat/feed.d.ts +231 -0
- package/dist/chat/feed.d.ts.map +1 -0
- package/dist/chat/feed.js +374 -0
- package/dist/chat/feed.js.map +1 -0
- package/dist/chat/index.d.ts +5 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +9 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/message.d.ts +170 -0
- package/dist/chat/message.d.ts.map +1 -0
- package/dist/chat/message.js +345 -0
- package/dist/chat/message.js.map +1 -0
- package/dist/client/arisa-client.d.ts +150 -0
- package/dist/client/arisa-client.d.ts.map +1 -0
- package/dist/client/arisa-client.js +439 -0
- package/dist/client/arisa-client.js.map +1 -0
- package/dist/client/client-helper.d.ts +58 -0
- package/dist/client/client-helper.d.ts.map +1 -0
- package/dist/client/client-helper.js +270 -0
- package/dist/client/client-helper.js.map +1 -0
- package/dist/client/event-handler.d.ts +19 -0
- package/dist/client/event-handler.d.ts.map +1 -0
- package/dist/client/event-handler.js +243 -0
- package/dist/client/event-handler.js.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/listeners.d.ts +34 -0
- package/dist/client/listeners.d.ts.map +1 -0
- package/dist/client/listeners.js +68 -0
- package/dist/client/listeners.js.map +1 -0
- package/dist/client/open-profile-watcher.d.ts +25 -0
- package/dist/client/open-profile-watcher.d.ts.map +1 -0
- package/dist/client/open-profile-watcher.js +85 -0
- package/dist/client/open-profile-watcher.js.map +1 -0
- package/dist/dashboard/server/client-adapter.d.ts +4 -0
- package/dist/dashboard/server/client-adapter.d.ts.map +1 -0
- package/dist/dashboard/server/client-adapter.js +277 -0
- package/dist/dashboard/server/client-adapter.js.map +1 -0
- package/dist/dashboard/server/credential.d.ts +5 -0
- package/dist/dashboard/server/credential.d.ts.map +1 -0
- package/dist/dashboard/server/credential.js +20 -0
- package/dist/dashboard/server/credential.js.map +1 -0
- package/dist/dashboard/server/handler.d.ts +8 -0
- package/dist/dashboard/server/handler.d.ts.map +1 -0
- package/dist/dashboard/server/handler.js +61 -0
- package/dist/dashboard/server/handler.js.map +1 -0
- package/dist/dashboard/server/http.d.ts +11 -0
- package/dist/dashboard/server/http.d.ts.map +1 -0
- package/dist/dashboard/server/http.js +60 -0
- package/dist/dashboard/server/http.js.map +1 -0
- package/dist/dashboard/server/index.d.ts +7 -0
- package/dist/dashboard/server/index.d.ts.map +1 -0
- package/dist/dashboard/server/index.js +252 -0
- package/dist/dashboard/server/index.js.map +1 -0
- package/dist/dashboard/server/posts.d.ts +5 -0
- package/dist/dashboard/server/posts.d.ts.map +1 -0
- package/dist/dashboard/server/posts.js +30 -0
- package/dist/dashboard/server/posts.js.map +1 -0
- package/dist/dashboard/server/role-store.d.ts +13 -0
- package/dist/dashboard/server/role-store.d.ts.map +1 -0
- package/dist/dashboard/server/role-store.js +60 -0
- package/dist/dashboard/server/role-store.js.map +1 -0
- package/dist/dashboard/server/routes/channels.d.ts +4 -0
- package/dist/dashboard/server/routes/channels.d.ts.map +1 -0
- package/dist/dashboard/server/routes/channels.js +262 -0
- package/dist/dashboard/server/routes/channels.js.map +1 -0
- package/dist/dashboard/server/routes/friends.d.ts +7 -0
- package/dist/dashboard/server/routes/friends.d.ts.map +1 -0
- package/dist/dashboard/server/routes/friends.js +130 -0
- package/dist/dashboard/server/routes/friends.js.map +1 -0
- package/dist/dashboard/server/routes/index.d.ts +8 -0
- package/dist/dashboard/server/routes/index.d.ts.map +1 -0
- package/dist/dashboard/server/routes/index.js +13 -0
- package/dist/dashboard/server/routes/index.js.map +1 -0
- package/dist/dashboard/server/routes/me.d.ts +4 -0
- package/dist/dashboard/server/routes/me.d.ts.map +1 -0
- package/dist/dashboard/server/routes/me.js +77 -0
- package/dist/dashboard/server/routes/me.js.map +1 -0
- package/dist/dashboard/server/routes/media-uploads.d.ts +8 -0
- package/dist/dashboard/server/routes/media-uploads.d.ts.map +1 -0
- package/dist/dashboard/server/routes/media-uploads.js +253 -0
- package/dist/dashboard/server/routes/media-uploads.js.map +1 -0
- package/dist/dashboard/server/routes/roles.d.ts +4 -0
- package/dist/dashboard/server/routes/roles.d.ts.map +1 -0
- package/dist/dashboard/server/routes/roles.js +57 -0
- package/dist/dashboard/server/routes/roles.js.map +1 -0
- package/dist/dashboard/server/routes/static.d.ts +4 -0
- package/dist/dashboard/server/routes/static.d.ts.map +1 -0
- package/dist/dashboard/server/routes/static.js +96 -0
- package/dist/dashboard/server/routes/static.js.map +1 -0
- package/dist/dashboard/server/routes/tools.d.ts +4 -0
- package/dist/dashboard/server/routes/tools.d.ts.map +1 -0
- package/dist/dashboard/server/routes/tools.js +355 -0
- package/dist/dashboard/server/routes/tools.js.map +1 -0
- package/dist/dashboard/server/self-profile.d.ts +19 -0
- package/dist/dashboard/server/self-profile.d.ts.map +1 -0
- package/dist/dashboard/server/self-profile.js +68 -0
- package/dist/dashboard/server/self-profile.js.map +1 -0
- package/dist/dashboard/server/sql.d.ts +3 -0
- package/dist/dashboard/server/sql.d.ts.map +1 -0
- package/dist/dashboard/server/sql.js +142 -0
- package/dist/dashboard/server/sql.js.map +1 -0
- package/dist/dashboard/server/types.d.ts +125 -0
- package/dist/dashboard/server/types.d.ts.map +1 -0
- package/dist/dashboard/server/types.js +7 -0
- package/dist/dashboard/server/types.js.map +1 -0
- package/dist/dashboard/server/validation.d.ts +9 -0
- package/dist/dashboard/server/validation.d.ts.map +1 -0
- package/dist/dashboard/server/validation.js +43 -0
- package/dist/dashboard/server/validation.js.map +1 -0
- package/dist/dashboard/web/assets/dashboard-Bta0crBA.js +3 -0
- package/dist/dashboard/web/assets/index-0JKvA2WI.js +2 -0
- package/dist/dashboard/web/assets/index-DIlIxwIo.css +1 -0
- package/dist/dashboard/web/assets/theme-init.js +32 -0
- package/dist/dashboard/web/fonts/PretendardVariable.woff2 +0 -0
- package/dist/dashboard/web/icons/profile-certified.svg +12 -0
- package/dist/dashboard/web/images/favicon.ico +0 -0
- package/dist/dashboard/web/index.html +16 -0
- package/dist/dashboard/web/licenses/LICENSE-FontAwesome-Free +165 -0
- package/dist/dashboard/web/licenses/LICENSE-Fuwari-MIT +21 -0
- package/dist/dashboard/web/licenses/LICENSE-KiwiTalk-APACHE +201 -0
- package/dist/dashboard/web/licenses/LICENSE-Lucide +43 -0
- package/dist/dashboard/web/licenses/LICENSE-MageIcons-APACHE +202 -0
- package/dist/dashboard/web/licenses/LICENSE-MaterialSymbols-APACHE +202 -0
- package/dist/dashboard/web/licenses/LICENSE-Pretendard-OFL +104 -0
- package/dist/dashboard/web/licenses/LICENSE-RemixIcon-APACHE +201 -0
- package/dist/dashboard/web/licenses/LICENSE-Tabler-MIT +21 -0
- package/dist/decorators/index.d.ts +47 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +95 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/grpc/arisa-grpc.d.ts +62 -0
- package/dist/grpc/arisa-grpc.d.ts.map +1 -0
- package/dist/grpc/arisa-grpc.js +242 -0
- package/dist/grpc/arisa-grpc.js.map +1 -0
- package/dist/grpc/generated/arisa.pb.d.ts +493 -0
- package/dist/grpc/generated/arisa.pb.d.ts.map +1 -0
- package/dist/grpc/generated/arisa.pb.js +3315 -0
- package/dist/grpc/generated/arisa.pb.js.map +1 -0
- package/dist/grpc/generated/google/protobuf/empty.pb.d.ts +38 -0
- package/dist/grpc/generated/google/protobuf/empty.pb.d.ts.map +1 -0
- package/dist/grpc/generated/google/protobuf/empty.pb.js +49 -0
- package/dist/grpc/generated/google/protobuf/empty.pb.js.map +1 -0
- package/dist/grpc/grpc-store.d.ts +32 -0
- package/dist/grpc/grpc-store.d.ts.map +1 -0
- package/dist/grpc/grpc-store.js +376 -0
- package/dist/grpc/grpc-store.js.map +1 -0
- package/dist/grpc/store.d.ts +77 -0
- package/dist/grpc/store.d.ts.map +1 -0
- package/dist/grpc/store.js +7 -0
- package/dist/grpc/store.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/kakao-link/index.d.ts +2 -0
- package/dist/kakao-link/index.d.ts.map +1 -0
- package/dist/kakao-link/index.js +7 -0
- package/dist/kakao-link/index.js.map +1 -0
- package/dist/kakao-link/kakao-link.d.ts +112 -0
- package/dist/kakao-link/kakao-link.d.ts.map +1 -0
- package/dist/kakao-link/kakao-link.js +334 -0
- package/dist/kakao-link/kakao-link.js.map +1 -0
- package/dist/types/channel.d.ts +83 -0
- package/dist/types/channel.d.ts.map +1 -0
- package/dist/types/channel.js +7 -0
- package/dist/types/channel.js.map +1 -0
- package/dist/types/chat.d.ts +233 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +7 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/types/client.d.ts +26 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/client.js +7 -0
- package/dist/types/client.js.map +1 -0
- package/dist/types/event.d.ts +66 -0
- package/dist/types/event.d.ts.map +1 -0
- package/dist/types/event.js +7 -0
- package/dist/types/event.js.map +1 -0
- package/dist/types/user.d.ts +76 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/user.js +7 -0
- package/dist/types/user.js.map +1 -0
- package/dist/user/bot-user.d.ts +16 -0
- package/dist/user/bot-user.d.ts.map +1 -0
- package/dist/user/bot-user.js +35 -0
- package/dist/user/bot-user.js.map +1 -0
- package/dist/user/event-user.d.ts +78 -0
- package/dist/user/event-user.d.ts.map +1 -0
- package/dist/user/event-user.js +123 -0
- package/dist/user/event-user.js.map +1 -0
- package/dist/user/index.d.ts +8 -0
- package/dist/user/index.d.ts.map +1 -0
- package/dist/user/index.js +12 -0
- package/dist/user/index.js.map +1 -0
- package/dist/user/normal-user.d.ts +18 -0
- package/dist/user/normal-user.d.ts.map +1 -0
- package/dist/user/normal-user.js +42 -0
- package/dist/user/normal-user.js.map +1 -0
- package/dist/user/open-user.d.ts +20 -0
- package/dist/user/open-user.d.ts.map +1 -0
- package/dist/user/open-user.js +73 -0
- package/dist/user/open-user.js.map +1 -0
- package/dist/user/user-self.d.ts +24 -0
- package/dist/user/user-self.d.ts.map +1 -0
- package/dist/user/user-self.js +72 -0
- package/dist/user/user-self.js.map +1 -0
- package/dist/user/user.d.ts +47 -0
- package/dist/user/user.d.ts.map +1 -0
- package/dist/user/user.js +108 -0
- package/dist/user/user.js.map +1 -0
- package/dist/utils/database/index.d.ts +6 -0
- package/dist/utils/database/index.d.ts.map +1 -0
- package/dist/utils/database/index.js +90 -0
- package/dist/utils/database/index.js.map +1 -0
- package/dist/utils/id/index.d.ts +3 -0
- package/dist/utils/id/index.d.ts.map +1 -0
- package/dist/utils/id/index.js +11 -0
- package/dist/utils/id/index.js.map +1 -0
- package/dist/utils/json/index.d.ts +6 -0
- package/dist/utils/json/index.d.ts.map +1 -0
- package/dist/utils/json/index.js +25 -0
- package/dist/utils/json/index.js.map +1 -0
- package/package.json +83 -4
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Copyright (c) 2021, Kil Hyung-jin (https://github.com/orioncactus/pretendard),
|
|
2
|
+
with Reserved Font Name 'Pretendard'.
|
|
3
|
+
|
|
4
|
+
Copyright 2014-2021 Adobe (http://www.adobe.com/),
|
|
5
|
+
with Reserved Font Name 'Source'.
|
|
6
|
+
Source is a trademark of Adobe in the United States and/or other countries.
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter),
|
|
9
|
+
with Reserved Font Name 'Inter'.
|
|
10
|
+
|
|
11
|
+
Copyright 2021 The M+ FONTS Project Authors (https://github.com/coz-m/MPLUS_FONTS),
|
|
12
|
+
with Reserved Font Name 'M PLUS 1'.
|
|
13
|
+
|
|
14
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
15
|
+
This license is copied below, and is also available with a FAQ at:
|
|
16
|
+
https://scripts.sil.org/OFL
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
-----------------------------------------------------------
|
|
20
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
21
|
+
-----------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
PREAMBLE
|
|
24
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
25
|
+
development of collaborative font projects, to support the font creation
|
|
26
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
27
|
+
open framework in which fonts may be shared and improved in partnership
|
|
28
|
+
with others.
|
|
29
|
+
|
|
30
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
31
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
32
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
33
|
+
redistributed and/or sold with any software provided that any reserved
|
|
34
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
35
|
+
however, cannot be released under any other type of license. The
|
|
36
|
+
requirement for fonts to remain under this license does not apply
|
|
37
|
+
to any document created using the fonts or their derivatives.
|
|
38
|
+
|
|
39
|
+
DEFINITIONS
|
|
40
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
41
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
42
|
+
include source files, build scripts and documentation.
|
|
43
|
+
|
|
44
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
45
|
+
copyright statement(s).
|
|
46
|
+
|
|
47
|
+
"Original Version" refers to the collection of Font Software components as
|
|
48
|
+
distributed by the Copyright Holder(s).
|
|
49
|
+
|
|
50
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
51
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
52
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
53
|
+
new environment.
|
|
54
|
+
|
|
55
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
56
|
+
writer or other person who contributed to the Font Software.
|
|
57
|
+
|
|
58
|
+
PERMISSION & CONDITIONS
|
|
59
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
60
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
61
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
62
|
+
Software, subject to the following conditions:
|
|
63
|
+
|
|
64
|
+
1) Neither the Font Software nor any of its individual components,
|
|
65
|
+
in Original or Modified Versions, may be sold by itself.
|
|
66
|
+
|
|
67
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
68
|
+
redistributed and/or sold with any software, provided that each copy
|
|
69
|
+
contains the above copyright notice and this license. These can be
|
|
70
|
+
included either as stand-alone text files, human-readable headers or
|
|
71
|
+
in the appropriate machine-readable metadata fields within text or
|
|
72
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
73
|
+
|
|
74
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
75
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
76
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
77
|
+
presented to the users.
|
|
78
|
+
|
|
79
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
80
|
+
Software shall not be used to promote, endorse or advertise any
|
|
81
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
82
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
83
|
+
permission.
|
|
84
|
+
|
|
85
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
86
|
+
must be distributed entirely under this license, and must not be
|
|
87
|
+
distributed under any other license. The requirement for fonts to
|
|
88
|
+
remain under this license does not apply to any document created
|
|
89
|
+
using the Font Software.
|
|
90
|
+
|
|
91
|
+
TERMINATION
|
|
92
|
+
This license becomes null and void if any of the above conditions are
|
|
93
|
+
not met.
|
|
94
|
+
|
|
95
|
+
DISCLAIMER
|
|
96
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
97
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
98
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
99
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
100
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
101
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
102
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
103
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
104
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2026 Paweł Kuna
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Channel } from '../channel/channel.js';
|
|
2
|
+
import type { MessageChat } from '../chat/message.js';
|
|
3
|
+
import type { User } from '../user/user.js';
|
|
4
|
+
type MessageMethod<This, Args extends unknown[] = [], Result extends void | Promise<void> = void | Promise<void>> = (this: This, chat: MessageChat, channel: Channel, ...args: Args) => Result;
|
|
5
|
+
type MessageHandler<Args extends unknown[] = [], Result extends void | Promise<void> = void | Promise<void>> = (chat: MessageChat, channel: Channel, ...args: Args) => Result;
|
|
6
|
+
type MessageDecorator = {
|
|
7
|
+
<This, Args extends unknown[], Result extends void | Promise<void>>(listener: MessageMethod<This, Args, Result>, context: ClassMethodDecoratorContext<This, MessageMethod<This, Args, Result>>): MessageMethod<This, Args, Result>;
|
|
8
|
+
<Args extends unknown[], Result extends void | Promise<void>>(listener: MessageHandler<Args, Result>): MessageHandler<Args, Result>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* 답장이나 스레드 메세지일 때만 리스너를 실행합니다. 아니면 답장으로 다시 요청하라는 안내를 채팅방에 보냅니다.
|
|
12
|
+
*
|
|
13
|
+
* 메세지 리스너를 감싸거나 클래스 메서드 데코레이터로 씁니다.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* client.on('message', isReply(async (chat, channel) => {
|
|
18
|
+
* const source = await chat.getSource();
|
|
19
|
+
* await channel.send(source.text);
|
|
20
|
+
* }));
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const isReply: MessageDecorator;
|
|
24
|
+
/** 앞뒤 공백을 뺀 메세지가 두 단어 이상일 때만 리스너를 실행합니다. */
|
|
25
|
+
export declare const hasParam: MessageDecorator;
|
|
26
|
+
/** 보낸 유저가 관리자 목록에 있을 때만 리스너를 실행합니다. 관리자는 대시보드에서 추가합니다. */
|
|
27
|
+
export declare const isAdmin: MessageDecorator;
|
|
28
|
+
/** 보낸 유저가 밴 목록에 없을 때만 리스너를 실행합니다. 유저 정보가 없거나 데이터베이스가 준비되지 않았어도 실행합니다. */
|
|
29
|
+
export declare const isNotBanned: MessageDecorator;
|
|
30
|
+
/**
|
|
31
|
+
* 유저가 관리자 목록에 있는지 확인합니다.
|
|
32
|
+
*
|
|
33
|
+
* 관리자와 밴 목록은 실행 폴더의 `data/arisa.db`에 저장됩니다. 유저가 `null`이거나 데이터베이스가 아직 준비되지 않았으면 `false`를 돌려줍니다.
|
|
34
|
+
*/
|
|
35
|
+
export declare function adminCheck(user: User | null): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 유저가 밴 목록에 있는지 확인합니다.
|
|
38
|
+
*
|
|
39
|
+
* 관리자와 밴 목록은 실행 폴더의 `data/arisa.db`에 저장됩니다. 유저가 `null`이거나 데이터베이스가 아직 준비되지 않았으면 `false`를 돌려줍니다.
|
|
40
|
+
*/
|
|
41
|
+
export declare function banCheck(user: User | null): boolean;
|
|
42
|
+
/** 유저를 밴 목록에 추가합니다. 새로 추가했으면 `true`, 이미 있었으면 `false` */
|
|
43
|
+
export declare function addBan(user: User | null): boolean;
|
|
44
|
+
/** 유저를 밴 목록에서 뺍니다. 뺐으면 `true`, 목록에 없었으면 `false` */
|
|
45
|
+
export declare function removeBan(user: User | null): boolean;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,KAAK,aAAa,CAAC,IAAI,EAAE,IAAI,SAAS,OAAO,EAAE,GAAG,EAAE,EAAE,MAAM,SAAS,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAClH,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,OAAO,EAChB,GAAG,IAAI,EAAE,IAAI,KACV,MAAM,CAAC;AAEZ,KAAK,cAAc,CAAC,IAAI,SAAS,OAAO,EAAE,GAAG,EAAE,EAAE,MAAM,SAAS,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAC7G,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,OAAO,EAChB,GAAG,IAAI,EAAE,IAAI,KACV,MAAM,CAAC;AAIZ,KAAK,gBAAgB,GAAG;IACtB,CAAC,IAAI,EAAE,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,SAAS,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAChE,QAAQ,EAAE,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAC3C,OAAO,EAAE,2BAA2B,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,GAC5E,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,SAAS,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC1D,QAAQ,EAAE,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,GACrC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;CACjC,CAAC;AAeF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,kBAKlB,CAAC;AAEH,4CAA4C;AAC5C,eAAO,MAAM,QAAQ,kBAA+D,CAAC;AAErF,0DAA0D;AAC1D,eAAO,MAAM,OAAO,kBAA4C,CAAC;AAEjE,yEAAyE;AACzE,eAAO,MAAM,WAAW,kBAA2C,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAerD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CASnD;AAED,wDAAwD;AACxD,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAQjD;AAED,mDAAmD;AACnD,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAQpD"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Created on Fri Nov 13 2026
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) huni-ee. Licensed under the Apache-2.0 License.
|
|
5
|
+
*/
|
|
6
|
+
import { getDatabase } from '../utils/database/index.js';
|
|
7
|
+
function decorate(check) {
|
|
8
|
+
return function (listener, _context) {
|
|
9
|
+
return async function (chat, channel, ...args) {
|
|
10
|
+
if (!(await check(chat, channel)))
|
|
11
|
+
return;
|
|
12
|
+
await listener.call(this, chat, channel, ...args);
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 답장이나 스레드 메세지일 때만 리스너를 실행합니다. 아니면 답장으로 다시 요청하라는 안내를 채팅방에 보냅니다.
|
|
18
|
+
*
|
|
19
|
+
* 메세지 리스너를 감싸거나 클래스 메서드 데코레이터로 씁니다.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* client.on('message', isReply(async (chat, channel) => {
|
|
24
|
+
* const source = await chat.getSource();
|
|
25
|
+
* await channel.send(source.text);
|
|
26
|
+
* }));
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const isReply = decorate(async (chat, channel) => {
|
|
30
|
+
if (chat.isReply())
|
|
31
|
+
return true;
|
|
32
|
+
await channel.send('메세지에 답장하여 요청하세요.');
|
|
33
|
+
return false;
|
|
34
|
+
});
|
|
35
|
+
/** 앞뒤 공백을 뺀 메세지가 두 단어 이상일 때만 리스너를 실행합니다. */
|
|
36
|
+
export const hasParam = decorate((chat) => chat.text.trim().split(/\s+/).length > 1);
|
|
37
|
+
/** 보낸 유저가 관리자 목록에 있을 때만 리스너를 실행합니다. 관리자는 대시보드에서 추가합니다. */
|
|
38
|
+
export const isAdmin = decorate((chat) => adminCheck(chat.user));
|
|
39
|
+
/** 보낸 유저가 밴 목록에 없을 때만 리스너를 실행합니다. 유저 정보가 없거나 데이터베이스가 준비되지 않았어도 실행합니다. */
|
|
40
|
+
export const isNotBanned = decorate((chat) => !banCheck(chat.user));
|
|
41
|
+
/**
|
|
42
|
+
* 유저가 관리자 목록에 있는지 확인합니다.
|
|
43
|
+
*
|
|
44
|
+
* 관리자와 밴 목록은 실행 폴더의 `data/arisa.db`에 저장됩니다. 유저가 `null`이거나 데이터베이스가 아직 준비되지 않았으면 `false`를 돌려줍니다.
|
|
45
|
+
*/
|
|
46
|
+
export function adminCheck(user) {
|
|
47
|
+
if (user === null)
|
|
48
|
+
return false;
|
|
49
|
+
const database = getDatabase();
|
|
50
|
+
if (database === null)
|
|
51
|
+
return false;
|
|
52
|
+
const admin = database.prepare('SELECT 1 FROM admin WHERE user_id = ?').get(user.id);
|
|
53
|
+
if (admin !== undefined)
|
|
54
|
+
return true;
|
|
55
|
+
const hasAdmin = database.prepare('SELECT 1 FROM admin LIMIT 1').get() !== undefined;
|
|
56
|
+
if (!hasAdmin) {
|
|
57
|
+
console.log('관리자 목록이 비어있는 상태에서 admin 체크가 실행되고 있습니다.');
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 유저가 밴 목록에 있는지 확인합니다.
|
|
63
|
+
*
|
|
64
|
+
* 관리자와 밴 목록은 실행 폴더의 `data/arisa.db`에 저장됩니다. 유저가 `null`이거나 데이터베이스가 아직 준비되지 않았으면 `false`를 돌려줍니다.
|
|
65
|
+
*/
|
|
66
|
+
export function banCheck(user) {
|
|
67
|
+
if (user === null)
|
|
68
|
+
return false;
|
|
69
|
+
const database = getDatabase();
|
|
70
|
+
if (database === null)
|
|
71
|
+
return false;
|
|
72
|
+
const banned = database.prepare('SELECT 1 FROM ban WHERE user_id = ?').get(user.id);
|
|
73
|
+
return banned !== undefined;
|
|
74
|
+
}
|
|
75
|
+
/** 유저를 밴 목록에 추가합니다. 새로 추가했으면 `true`, 이미 있었으면 `false` */
|
|
76
|
+
export function addBan(user) {
|
|
77
|
+
if (user === null)
|
|
78
|
+
return false;
|
|
79
|
+
const database = getDatabase();
|
|
80
|
+
if (database === null)
|
|
81
|
+
return false;
|
|
82
|
+
const result = database.prepare('INSERT OR IGNORE INTO ban (user_id) VALUES (?)').run(user.id);
|
|
83
|
+
return result.changes > 0;
|
|
84
|
+
}
|
|
85
|
+
/** 유저를 밴 목록에서 뺍니다. 뺐으면 `true`, 목록에 없었으면 `false` */
|
|
86
|
+
export function removeBan(user) {
|
|
87
|
+
if (user === null)
|
|
88
|
+
return false;
|
|
89
|
+
const database = getDatabase();
|
|
90
|
+
if (database === null)
|
|
91
|
+
return false;
|
|
92
|
+
const result = database.prepare('DELETE FROM ban WHERE user_id = ?').run(user.id);
|
|
93
|
+
return result.changes > 0;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AA4BzD,SAAS,QAAQ,CAAC,KAAmB;IACnC,OAAO,UACL,QAA2C,EAC3C,QAA+E;QAE/E,OAAO,KAAK,WAAuB,IAAI,EAAE,OAAO,EAAE,GAAG,IAAU;YAC7D,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAAE,OAAO;YAE1C,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACpD,CAAsC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACtD,IAAI,IAAI,CAAC,OAAO,EAAE;QAAE,OAAO,IAAI,CAAC;IAEhC,MAAM,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,CAAC;AAEH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,C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C,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE9F,OAAO,MAAM,KAAK,SAAS,CAAC;AAC9B,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,MAAM,CAAC,IAAiB;IACtC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEhC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEpC,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAW,gDAAgD,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzG,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,SAAS,CAAC,IAAiB;IACzC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEhC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEpC,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAW,mCAAmC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5F,OAAO,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ClientReadableStream } from '@grpc/grpc-js';
|
|
2
|
+
import { type ChannelMembers, type Channel as ChannelData, type Credential, type Event, type Member } from './generated/arisa.pb.js';
|
|
3
|
+
import type { MediaFile, MediaMode as MediaModeName } from '../types/channel.js';
|
|
4
|
+
type RawQueryParam = string | number | boolean | null;
|
|
5
|
+
/** 파일을 조각으로 나눠 보내는 미디어 업로드 스트림 */
|
|
6
|
+
export interface MediaUploadStream {
|
|
7
|
+
file(name: string, mime: string, size: number): Promise<void>;
|
|
8
|
+
chunk(data: Buffer): Promise<void>;
|
|
9
|
+
finish(): Promise<void>;
|
|
10
|
+
cancel(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class ArisaGrpc {
|
|
13
|
+
private readonly target;
|
|
14
|
+
private client;
|
|
15
|
+
private stream;
|
|
16
|
+
private closed;
|
|
17
|
+
constructor(target: string);
|
|
18
|
+
private createClient;
|
|
19
|
+
/** 닫힌 클라이언트는 다시 만들고, Arisa 서버가 응답하는지 확인한다. */
|
|
20
|
+
connect(): Promise<void>;
|
|
21
|
+
/** Arisa 서버가 1초 안에 응답하는지 확인한다. */
|
|
22
|
+
healthCheck(): Promise<void>;
|
|
23
|
+
/** 서버 이벤트 스트림을 구독한다. */
|
|
24
|
+
subscribeEvents(): ClientReadableStream<Event>;
|
|
25
|
+
/** 채팅방에 메세지를 보낸다. */
|
|
26
|
+
reply(channelId: string, message: string, threadId?: string | null): Promise<void>;
|
|
27
|
+
/** 채팅방을 읽음 처리한다. */
|
|
28
|
+
markRead(channelId: string): Promise<void>;
|
|
29
|
+
/** 채팅방에 입장한다. */
|
|
30
|
+
enterChannel(channelId: string): Promise<void>;
|
|
31
|
+
/** 미디어 업로드 스트림을 열고, 파일 정보와 조각을 보낼 함수를 돌려준다. */
|
|
32
|
+
openMediaStream(channelId: string, count: number, mode: MediaModeName): MediaUploadStream;
|
|
33
|
+
/**
|
|
34
|
+
* 미디어 파일을 조각으로 나눠 보낸다.
|
|
35
|
+
* 파일은 차례대로 하나씩 읽고, 조각마다 전송이 끝난 뒤에 다음 조각을 보내
|
|
36
|
+
* 메모리에는 지금 보내는 파일 하나만 남게 한다.
|
|
37
|
+
*/
|
|
38
|
+
sendMedia(channelId: string, files: readonly (() => Promise<MediaFile>)[], mode: MediaModeName): Promise<void>;
|
|
39
|
+
/** Arisa 인증 정보를 가져온다. */
|
|
40
|
+
getCredential(): Promise<Credential>;
|
|
41
|
+
/** 채팅방 기준으로 유저 한 명의 정보를 가져온다. `channelId`가 `'0'`이면 일반 유저로 조회한다. */
|
|
42
|
+
getUser(channelId: string, userId: string): Promise<Member>;
|
|
43
|
+
/** 채팅방 유저 정보를 가져온다. */
|
|
44
|
+
getUsers(channelId: string, userIds: string[]): Promise<Member[]>;
|
|
45
|
+
/** 메세지 하나를 가져온다. */
|
|
46
|
+
getMessage(channelId: string, logId: string): Promise<Event>;
|
|
47
|
+
/** 여러 메세지를 가져온다. */
|
|
48
|
+
getMessages(channelId: string, logIds: string[]): Promise<Event[]>;
|
|
49
|
+
/** 채팅방 정보를 가져온다. */
|
|
50
|
+
getChannel(channelId: string): Promise<ChannelData>;
|
|
51
|
+
/** 채팅방 멤버 목록을 가져온다. */
|
|
52
|
+
getChannelMembers(channelId: string): Promise<ChannelMembers>;
|
|
53
|
+
/** 암호화된 값을 복호화한다. */
|
|
54
|
+
decrypt(ciphertext: string, enc: number, userId?: string | null): Promise<string>;
|
|
55
|
+
/** Arisa 서버에서 SQL을 실행한다. */
|
|
56
|
+
rawQuery(sql: string, params?: readonly RawQueryParam[], limit?: number): Promise<Record<string, unknown>[]>;
|
|
57
|
+
private unary;
|
|
58
|
+
/** gRPC 연결을 종료한다. */
|
|
59
|
+
close(): void;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=arisa-grpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arisa-grpc.d.ts","sourceRoot":"","sources":["../../src/grpc/arisa-grpc.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,oBAAoB,EAI1B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,OAAO,IAAI,WAAW,EAC3B,KAAK,UAAU,EAGf,KAAK,KAAK,EAQV,KAAK,MAAM,EAIZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGjF,KAAK,aAAa,GAAG,MAAM,GAAG,MA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