disney.js 0.0.1-security → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of disney.js might be problematic. Click here for more details.

Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -3
  3. package/dist/client/bot.d.ts +10 -0
  4. package/dist/client/connection.d.ts +12 -0
  5. package/dist/client/index.d.ts +4 -0
  6. package/dist/client/interface.d.ts +19 -0
  7. package/dist/client/message.client.d.ts +4 -0
  8. package/dist/disney.js.cjs.development.js +1872 -0
  9. package/dist/disney.js.cjs.development.js.map +1 -0
  10. package/dist/disney.js.cjs.production.min.js +2 -0
  11. package/dist/disney.js.cjs.production.min.js.map +1 -0
  12. package/dist/disney.js.esm.js +1859 -0
  13. package/dist/disney.js.esm.js.map +1 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +8 -0
  16. package/dist/services/channel/channel.dto.d.ts +2 -0
  17. package/dist/services/channel/channel.service.d.ts +25 -0
  18. package/dist/services/index.d.ts +9 -0
  19. package/dist/services/interface.d.ts +9 -0
  20. package/dist/services/message/action.service.d.ts +34 -0
  21. package/dist/services/message/button.service.d.ts +22 -0
  22. package/dist/services/message/message.builder.d.ts +11 -0
  23. package/dist/services/message/message.dto.d.ts +10 -0
  24. package/dist/services/message/message.service.d.ts +30 -0
  25. package/dist/services/message/select.service.d.ts +34 -0
  26. package/dist/services/worker.d.ts +12 -0
  27. package/dist/shared/config.d.ts +3 -0
  28. package/dist/shared/entities/action.entity.d.ts +11 -0
  29. package/dist/shared/entities/bot.entity.d.ts +16 -0
  30. package/dist/shared/entities/button.entity.d.ts +16 -0
  31. package/dist/shared/entities/channel.entity.d.ts +14 -0
  32. package/dist/shared/entities/channelCategory.entity.d.ts +8 -0
  33. package/dist/shared/entities/command.entity.d.ts +8 -0
  34. package/dist/shared/entities/emoji.entity.d.ts +9 -0
  35. package/dist/shared/entities/guild.entity.d.ts +13 -0
  36. package/dist/shared/entities/index.d.ts +14 -0
  37. package/dist/shared/entities/member.entity.d.ts +20 -0
  38. package/dist/shared/entities/message.entity.d.ts +13 -0
  39. package/dist/shared/entities/option.entity.d.ts +7 -0
  40. package/dist/shared/entities/react.entity.d.ts +9 -0
  41. package/dist/shared/entities/role.entity.d.ts +14 -0
  42. package/dist/shared/entities/select.entity.d.ts +14 -0
  43. package/dist/shared/entities/user.entity.d.ts +14 -0
  44. package/dist/shared/entities/userBeFriend.entity.d.ts +12 -0
  45. package/dist/shared/index.d.ts +2 -0
  46. package/dist/shared/socket/emit.d.ts +59 -0
  47. package/dist/shared/socket/error.dto.d.ts +3 -0
  48. package/dist/shared/socket/event.d.ts +59 -0
  49. package/dist/shared/socket/namespace.d.ts +14 -0
  50. package/package.json +76 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Nguyên Anh
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.
package/README.md CHANGED
@@ -1,5 +1,39 @@
1
- # Security holding package
1
+ ## Installation
2
2
 
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
3
+ with **npm**
4
4
 
5
- Please refer to www.npmjs.com/advisories?search=disney.js for more information.
5
+ ```shell
6
+ npm i disney.js
7
+ ```
8
+
9
+ or **yarn**
10
+
11
+ ```shell
12
+ yarn add disney.js
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ import { MarkdownBuilder, MessageClient } from 'disney.js';
19
+
20
+ class WeatherClient extends MessageClient {
21
+ async getToday() {
22
+ const data = await fetch('http://weather...')
23
+ this.channel.send({
24
+ content: data.map(d => d.toString()).join('\n'),
25
+ });
26
+ }
27
+
28
+ async getAt(country: string) {
29
+ const data = await fetch(`http://weather...?country=${country}`)
30
+ this.message.reply({
31
+ content: data.map(d => d.toString()).join('\n'),
32
+ });
33
+ }
34
+ }
35
+
36
+ const client = new WeatherClient();
37
+
38
+ client.login('secret_key');
39
+ ```
@@ -0,0 +1,10 @@
1
+ import { BotEntity } from "../shared/entities";
2
+ import { Connection } from "./connection";
3
+ export declare class BotInfo {
4
+ private _connection;
5
+ private _info;
6
+ constructor(_connection: Connection);
7
+ getInfo(token: string): Promise<void>;
8
+ listenUpdate(): void;
9
+ get info(): BotEntity;
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Manager, Socket } from 'socket.io-client';
2
+ export declare class Connection {
3
+ readonly message: Socket;
4
+ readonly channel: Socket;
5
+ readonly role: Socket;
6
+ readonly member: Socket;
7
+ readonly action: Socket;
8
+ readonly button: Socket;
9
+ readonly select: Socket;
10
+ readonly react: Socket;
11
+ constructor(gateway: Manager);
12
+ }
@@ -0,0 +1,4 @@
1
+ export * from './message.client';
2
+ export * from './interface';
3
+ export * from './connection';
4
+ export * from './bot';
@@ -0,0 +1,19 @@
1
+ import { ChannelService, MessageService } from '../services';
2
+ import { BotInfo } from './bot';
3
+ export declare abstract class Client {
4
+ private _connection;
5
+ private _accessToken;
6
+ private _gateway;
7
+ private _bot;
8
+ private _messageService;
9
+ private _channalService;
10
+ constructor();
11
+ login(token: string): Promise<void>;
12
+ /**@return message received: MessageEntity */
13
+ get message(): MessageService;
14
+ set message(messageService: MessageService);
15
+ /**@return channel which received message: ChannelEntity */
16
+ get channel(): ChannelService;
17
+ /**@return currentBot: BotEntity */
18
+ get bot(): BotInfo;
19
+ }
@@ -0,0 +1,4 @@
1
+ import { Client } from './interface';
2
+ export declare class MessageClient extends Client {
3
+ login(token: string): Promise<void>;
4
+ }