@duque.edits/sdk 0.0.4 → 0.0.5

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 (155) hide show
  1. package/{v1/index.ts → dist/index.d.ts} +27 -30
  2. package/dist/index.js +43 -0
  3. package/dist/managers/bet/GuildBetManager.d.ts +32 -0
  4. package/dist/managers/bet/GuildBetManager.js +107 -0
  5. package/dist/managers/betuser/GuildBetUserManager.d.ts +30 -0
  6. package/dist/managers/betuser/GuildBetUserManager.js +94 -0
  7. package/dist/managers/channel/ChannelManager.d.ts +39 -0
  8. package/dist/managers/channel/ChannelManager.js +147 -0
  9. package/dist/managers/groupedchannel/GroupedChannelManager.d.ts +34 -0
  10. package/dist/managers/groupedchannel/GroupedChannelManager.js +92 -0
  11. package/dist/managers/guild/GuildManager.d.ts +24 -0
  12. package/dist/managers/guild/GuildManager.js +75 -0
  13. package/dist/managers/match/GuildMatchManager.d.ts +32 -0
  14. package/dist/managers/match/GuildMatchManager.js +103 -0
  15. package/dist/managers/mediator/GuildMediatorManager.d.ts +32 -0
  16. package/dist/managers/mediator/GuildMediatorManager.js +97 -0
  17. package/dist/managers/messages/MessagesManager.d.ts +32 -0
  18. package/dist/managers/messages/MessagesManager.js +82 -0
  19. package/dist/managers/permission/GuildPermissionManager.d.ts +26 -0
  20. package/dist/managers/permission/GuildPermissionManager.js +70 -0
  21. package/dist/managers/product/GuildProductManager.d.ts +32 -0
  22. package/dist/managers/product/GuildProductManager.js +102 -0
  23. package/dist/managers/ticket/GuildTicketManager.d.ts +32 -0
  24. package/dist/managers/ticket/GuildTicketManager.js +99 -0
  25. package/dist/managers/user/GuildUserManager.d.ts +32 -0
  26. package/dist/managers/user/GuildUserManager.js +106 -0
  27. package/dist/rest/APIEndpoints.d.ts +11 -0
  28. package/dist/rest/APIEndpoints.js +12 -0
  29. package/dist/rest/REST.d.ts +51 -0
  30. package/dist/rest/REST.js +96 -0
  31. package/dist/rest/Routes.d.ts +84 -0
  32. package/dist/rest/Routes.js +89 -0
  33. package/dist/structures/Collection.d.ts +17 -0
  34. package/dist/structures/Collection.js +87 -0
  35. package/dist/structures/bet/GuildBet.d.ts +86 -0
  36. package/dist/structures/bet/GuildBet.js +276 -0
  37. package/dist/structures/betuser/GuildBetUser.d.ts +82 -0
  38. package/dist/structures/betuser/GuildBetUser.js +194 -0
  39. package/dist/structures/channel/Channel.d.ts +31 -0
  40. package/dist/structures/channel/Channel.js +57 -0
  41. package/dist/structures/groupedchannel/GroupedChannel.d.ts +34 -0
  42. package/dist/structures/groupedchannel/GroupedChannel.js +121 -0
  43. package/dist/structures/guild/Guild.d.ts +89 -0
  44. package/dist/structures/guild/Guild.js +223 -0
  45. package/dist/structures/match/GuildMatch.d.ts +84 -0
  46. package/dist/structures/match/GuildMatch.js +327 -0
  47. package/dist/structures/mediator/GuildMediator.d.ts +41 -0
  48. package/dist/structures/mediator/GuildMediator.js +131 -0
  49. package/dist/structures/product/GuildProduct.d.ts +52 -0
  50. package/dist/structures/product/GuildProduct.js +175 -0
  51. package/dist/structures/shop/GuildShop.d.ts +34 -0
  52. package/dist/structures/shop/GuildShop.js +80 -0
  53. package/dist/structures/ticket/GuildTicket.d.ts +51 -0
  54. package/dist/structures/ticket/GuildTicket.js +170 -0
  55. package/dist/structures/user/GuildUser.d.ts +82 -0
  56. package/dist/structures/user/GuildUser.js +209 -0
  57. package/dist/types/api/APIBaseChannel.d.ts +10 -0
  58. package/dist/types/api/APIBaseChannel.js +2 -0
  59. package/dist/types/api/APIBetChannel.d.ts +10 -0
  60. package/dist/types/api/APIBetChannel.js +2 -0
  61. package/dist/types/api/APIBetMessage.d.ts +10 -0
  62. package/dist/types/api/APIBetMessage.js +2 -0
  63. package/dist/types/api/APIGuild.d.ts +92 -0
  64. package/dist/types/api/APIGuild.js +2 -0
  65. package/dist/types/api/APIGuildBet.d.ts +48 -0
  66. package/dist/types/api/APIGuildBet.js +2 -0
  67. package/dist/types/api/APIGuildBetUser.d.ts +32 -0
  68. package/dist/types/api/APIGuildBetUser.js +2 -0
  69. package/dist/types/api/APIGuildChannel.d.ts +10 -0
  70. package/dist/types/api/APIGuildChannel.js +2 -0
  71. package/dist/types/api/APIGuildEmoji.d.ts +12 -0
  72. package/dist/types/api/APIGuildEmoji.js +2 -0
  73. package/dist/types/api/APIGuildGroupedChannel.d.ts +10 -0
  74. package/dist/types/api/APIGuildGroupedChannel.js +2 -0
  75. package/dist/types/api/APIGuildMatch.d.ts +46 -0
  76. package/dist/types/api/APIGuildMatch.js +2 -0
  77. package/dist/types/api/APIGuildMediator.d.ts +13 -0
  78. package/dist/types/api/APIGuildMediator.js +3 -0
  79. package/dist/types/api/APIGuildMessage.d.ts +10 -0
  80. package/dist/types/api/APIGuildMessage.js +2 -0
  81. package/dist/types/api/APIGuildPermissions.d.ts +6 -0
  82. package/dist/types/api/APIGuildPermissions.js +2 -0
  83. package/dist/types/api/APIGuildRole.d.ts +10 -0
  84. package/dist/types/api/APIGuildRole.js +2 -0
  85. package/dist/types/api/APIGuildShop.d.ts +11 -0
  86. package/dist/types/api/APIGuildShop.js +2 -0
  87. package/dist/types/api/APIGuildTicket.d.ts +25 -0
  88. package/dist/types/api/APIGuildTicket.js +3 -0
  89. package/dist/types/api/APIGuildUser.d.ts +31 -0
  90. package/dist/types/api/APIGuildUser.js +2 -0
  91. package/dist/types/api/APIMessage.d.ts +12 -0
  92. package/dist/types/api/APIMessage.js +2 -0
  93. package/dist/types/api/APIPlayer.d.ts +10 -0
  94. package/dist/types/api/APIPlayer.js +2 -0
  95. package/dist/types/api/APIProduct.d.ts +19 -0
  96. package/dist/types/api/APIProduct.js +3 -0
  97. package/dist/types/api/index.d.ts +130 -0
  98. package/dist/types/api/index.js +35 -0
  99. package/{v1/types/index.ts → dist/types/index.d.ts} +21 -24
  100. package/dist/types/index.js +37 -0
  101. package/dist/utils/Assertion.d.ts +32 -0
  102. package/dist/utils/Assertion.js +60 -0
  103. package/package.json +5 -1
  104. package/.gitattributes +0 -2
  105. package/tests/index.ts +0 -86
  106. package/tsconfig.json +0 -15
  107. package/v1/managers/bet/GuildBetManager.ts +0 -117
  108. package/v1/managers/betuser/GuildBetUserManager.ts +0 -103
  109. package/v1/managers/channel/ChannelManager.ts +0 -168
  110. package/v1/managers/groupedchannel/GroupedChannelManager.ts +0 -117
  111. package/v1/managers/guild/GuildManager.ts +0 -84
  112. package/v1/managers/match/GuildMatchManager.ts +0 -115
  113. package/v1/managers/mediator/GuildMediatorManager.ts +0 -111
  114. package/v1/managers/messages/MessagesManager.ts +0 -95
  115. package/v1/managers/permission/GuildPermissionManager.ts +0 -88
  116. package/v1/managers/product/GuildProductManager.ts +0 -115
  117. package/v1/managers/ticket/GuildTicketManager.ts +0 -112
  118. package/v1/managers/user/GuildUserManager.ts +0 -116
  119. package/v1/rest/APIEndpoints.ts +0 -11
  120. package/v1/rest/REST.ts +0 -126
  121. package/v1/rest/Routes.ts +0 -143
  122. package/v1/structures/Collection.ts +0 -85
  123. package/v1/structures/bet/GuildBet.ts +0 -332
  124. package/v1/structures/betuser/GuildBetUser.ts +0 -247
  125. package/v1/structures/channel/Channel.ts +0 -78
  126. package/v1/structures/groupedchannel/GroupedChannel.ts +0 -165
  127. package/v1/structures/guild/Guild.ts +0 -302
  128. package/v1/structures/match/GuildMatch.ts +0 -385
  129. package/v1/structures/mediator/GuildMediator.ts +0 -175
  130. package/v1/structures/product/GuildProduct.ts +0 -217
  131. package/v1/structures/shop/GuildShop.ts +0 -98
  132. package/v1/structures/ticket/GuildTicket.ts +0 -227
  133. package/v1/structures/user/GuildUser.ts +0 -248
  134. package/v1/types/api/APIBaseChannel.ts +0 -13
  135. package/v1/types/api/APIBetChannel.ts +0 -13
  136. package/v1/types/api/APIBetMessage.ts +0 -13
  137. package/v1/types/api/APIGuild.ts +0 -123
  138. package/v1/types/api/APIGuildBet.ts +0 -69
  139. package/v1/types/api/APIGuildBetUser.ts +0 -46
  140. package/v1/types/api/APIGuildChannel.ts +0 -13
  141. package/v1/types/api/APIGuildEmoji.ts +0 -16
  142. package/v1/types/api/APIGuildGroupedChannel.ts +0 -13
  143. package/v1/types/api/APIGuildMatch.ts +0 -67
  144. package/v1/types/api/APIGuildMediator.ts +0 -18
  145. package/v1/types/api/APIGuildMessage.ts +0 -13
  146. package/v1/types/api/APIGuildPermissions.ts +0 -7
  147. package/v1/types/api/APIGuildRole.ts +0 -13
  148. package/v1/types/api/APIGuildShop.ts +0 -15
  149. package/v1/types/api/APIGuildTicket.ts +0 -36
  150. package/v1/types/api/APIGuildUser.ts +0 -45
  151. package/v1/types/api/APIMessage.ts +0 -16
  152. package/v1/types/api/APIPlayer.ts +0 -13
  153. package/v1/types/api/APIProduct.ts +0 -27
  154. package/v1/types/api/index.ts +0 -180
  155. package/v1/utils/Assertion.ts +0 -56
@@ -1,15 +0,0 @@
1
- import { APIProduct } from "./APIProduct";
2
-
3
- export interface APIGuildShop {
4
- /** Shop's product */
5
- products: APIProduct[];
6
-
7
- /** Bought count */
8
- boughtCount: number;
9
-
10
- /** Creation Date */
11
- createdAt: Date;
12
-
13
- /** Updated Date */
14
- updatedAt: Date;
15
- }
@@ -1,36 +0,0 @@
1
- import { APIMessage } from "./APIMessage";
2
-
3
- export interface APIGuildTicket {
4
- /** Ticket's id */
5
- id: string;
6
-
7
- /** Ticket's creator id */
8
- creatorId: string;
9
-
10
- /** Ticket's admin id */
11
- adminId: string;
12
-
13
- /** Ticket's rating that customer gave */
14
- customerRating: number;
15
-
16
- /** Ticket's channel id */
17
- channelId: string;
18
-
19
- /** Ticket's closed by who */
20
- closedById: string;
21
-
22
- /** Ticket's type */
23
- type: string;
24
-
25
- /** Ticket's status */
26
- status: "on" | "off";
27
-
28
- /** Ticket's messages */
29
- messages: APIMessage[];
30
-
31
- /** Creation Date */
32
- createdAt: Date;
33
-
34
- /** Updated Date */
35
- updatedAt: Date;
36
- };
@@ -1,45 +0,0 @@
1
- import { Accessory, Daily, Items, OriginalChannels } from ".";
2
-
3
- export interface APIGuildUser {
4
- /** User's id */
5
- id: string;
6
-
7
- /** User name */
8
- name: string;
9
-
10
- /** User's daily */
11
- daily: Omit<Daily, "credit">;
12
-
13
- /** User's points */
14
- points: number;
15
-
16
- /** User's wins */
17
- wins: number;
18
-
19
- /** User's mvps */
20
- mvps: number;
21
-
22
- /** User's losses */
23
- losses: number;
24
-
25
- /** User's games */
26
- games: number;
27
-
28
- /** If user is blacklisted */
29
- blacklist: boolean;
30
-
31
- /** User's accessories such as double point */
32
- accessories: Accessory[];
33
-
34
- /** User's original channels */
35
- originalChannels: OriginalChannels;
36
-
37
- /** User's items */
38
- items: Items;
39
-
40
- /** Creation Date */
41
- createdAt: Date;
42
-
43
- /** Updated Date */
44
- updatedAt: Date;
45
- }
@@ -1,16 +0,0 @@
1
- export interface APIMessage {
2
- /** Message's content */
3
- content: string | object;
4
-
5
- /** Message's creator id */
6
- userId: string;
7
-
8
- /** Message's type */
9
- type: "text" | "img" | ".png" | ".gif" | ".jpg";
10
-
11
- /** Creation Date */
12
- createdAt: Date;
13
-
14
- /** Updated Date */
15
- updatedAt: Date;
16
- }
@@ -1,13 +0,0 @@
1
- export interface APIPlayer {
2
- /** The player's id */
3
- id: string;
4
-
5
- /** The player's name */
6
- name: string;
7
-
8
- /** When player was created */
9
- createdAt?: Date;
10
-
11
- /** Last time player was updated */
12
- updateAt?: Date;
13
- }
@@ -1,27 +0,0 @@
1
- import { APIPlayer } from "./APIPlayer";
2
-
3
- export interface APIProduct {
4
- /** Product's name */
5
- name: string;
6
-
7
- /** Product's description */
8
- description: string;
9
-
10
- /** Product's id */
11
- id: string;
12
-
13
- /** Product's price */
14
- price: number;
15
-
16
- /** Product's buyers */
17
- buyers: APIPlayer[];
18
-
19
- /** Product's emoji */
20
- emoji: string;
21
-
22
- /** Creation Date */
23
- createdAt: Date;
24
-
25
- /** Updated Date */
26
- updatedAt: Date;
27
- };
@@ -1,180 +0,0 @@
1
- export interface APITicketCategory {
2
- /** Category's type */
3
- type: string;
4
-
5
- /** Category's emoji */
6
- emoji: string;
7
-
8
- /** Category's description */
9
- description: string;
10
-
11
- /** Category's alias */
12
- alias: string;
13
- }
14
-
15
- export interface Blacklisted {
16
- /** Blacklist's id */
17
- id: string;
18
-
19
- /** Blacklist added by */
20
- addedBy: string;
21
-
22
- /** Guild Creation Date */
23
- createdAt: Date;
24
-
25
- /** Guild Updated Date */
26
- updatedAt: Date;
27
- }
28
- export type GuildBlacklist = Blacklisted[];
29
-
30
- export interface LogMessage {
31
- /** The message's content */
32
- content: string | Buffer<any>;
33
-
34
- /** The message's sender */
35
- userId: string;
36
-
37
- /** The message's type */
38
- type: string;
39
- }
40
-
41
- /** Base match modes */
42
- export type BaseMatchModes =
43
- | "1x1"
44
- | "2x2"
45
- | "3x3"
46
- | "4x4"
47
- | "5x5"
48
- | "6x6"
49
- | "1v1"
50
- | "2v2"
51
- | "3v3"
52
- | "4v4"
53
- | "5v5"
54
- | "6v6";
55
-
56
- /** Base match status */
57
- export type BaseMatchStatus = "on" | "created" | "off" | "shutted";
58
-
59
- /** The logs of the structure */
60
- export interface Logs {
61
- /** The messages of the structure */
62
- messages: LogMessage[];
63
- }
64
-
65
- /** Original Channel */
66
- export type OriginalChannel = {
67
- /** Channel id */
68
- channelId: string;
69
-
70
- /** Match id */
71
- matchId: string;
72
- };
73
-
74
- /** Items */
75
- export type Items = string[];
76
-
77
- /** Original Channels */
78
- export type OriginalChannels = OriginalChannel[];
79
-
80
- /** Accessories */
81
- export type Accessory = {
82
- /** Accessory type */
83
- type: "point_protect" | "immunity" | "double_points";
84
-
85
- /** Accessory longevity */
86
- longevity: string;
87
-
88
- /** Accessory adder */
89
- addedBy: string;
90
-
91
- /** When accessory added */
92
- when: Date;
93
-
94
- /** If accessory has expired */
95
- expired: boolean;
96
- };
97
-
98
- /** Daily information */
99
- export type Daily = {
100
- /** Wins */
101
- wins: number;
102
-
103
- /** Coins */
104
- coins: number;
105
-
106
- /** Points */
107
- points: number;
108
-
109
- /** Credit */
110
- credit: number;
111
-
112
- /** Losses */
113
- losses: number;
114
-
115
- /** Mvps */
116
- mvps: number;
117
-
118
- /** Date of the daily */
119
- date: Date;
120
- };
121
-
122
- export interface Banner {
123
- /** Equipped banner */
124
- equipped: number;
125
-
126
- /** Bought banners */
127
- allowed: number[];
128
- }
129
-
130
- export interface ProfileCard {
131
- /** Profile's description */
132
- description: string;
133
-
134
- /** Profile's banner */
135
- banner: Banner;
136
- }
137
-
138
- export interface Confirm {
139
- /** Confirm's type */
140
- type: string;
141
-
142
- /** Confirm's id */
143
- ids: string[];
144
-
145
- /** Confirm's counts */
146
- count: number;
147
- }
148
-
149
- export type Optional<T> = { [K in keyof T]?: T[K] };
150
-
151
-
152
- export enum MATCHTYPES {
153
- OneVOne = "1v1",
154
- TwoVTwo = "2v2",
155
- ThreeVThree = "3v3",
156
- FourVFour = "4v4",
157
- FiveVFive = "5v5",
158
- SixVSix = "6v6",
159
- }
160
- export enum MATCHSTATUS {
161
- ON = "on",
162
- OFF = "off",
163
- CREATED = "created",
164
- SHUTTED = "shutted",
165
- }
166
-
167
- export enum BETSTATUS {
168
- ON = "on",
169
- OFF = "off",
170
- CREATED = "created",
171
- SHUTTED = "shutted",
172
- WAITING = "waiting",
173
- }
174
- export enum STATES {
175
- ON = "on",
176
- OFF = "off",
177
- CREATED = "created",
178
- SHUTTED = "shutted",
179
- WAITING = "waiting",
180
- }
@@ -1,56 +0,0 @@
1
- /**
2
- * Class used to assert types in the sdk
3
- */
4
- export class Assertion {
5
- constructor() {}
6
-
7
- /**
8
- * Tests if given key is a string
9
- * @param key Key to test
10
- */
11
- static assertString(key: unknown): key is string {
12
- if (typeof key !== "string") throw new Error(`${key} must be a string`);
13
- if (!key || key === "") throw new Error(`${key} must be a string`);
14
- return true;
15
- }
16
-
17
- /**
18
- * Tests if given key is a number
19
- * @param key Key to test
20
- */
21
- static assertNumber(key: unknown): key is number {
22
- if (typeof key !== "number") throw new Error(`${key} must be a number`);
23
- return true;
24
- }
25
-
26
- /**
27
- * Tests if given key is a boolean
28
- * @param key Key to test
29
- */
30
- static assertBoolean(key: unknown): key is boolean {
31
- if (typeof key !== "boolean") throw new Error(`${key} must be a boolean`);
32
- return true;
33
- }
34
-
35
- /**
36
- * Tests if given key is an array
37
- * @param key Key to test
38
- */
39
- static assertArray(key: unknown): key is object {
40
- if (!Array.isArray(key)) throw new Error(`${key} must be an array`);
41
- return true;
42
- }
43
-
44
- /**
45
- * Tests if given key is an object
46
- * @param key Key to test
47
- */
48
- static assertObject(key: unknown): key is object {
49
- if (typeof key !== "object") throw new Error(`${key} must be an object`);
50
- return true;
51
- }
52
-
53
- toString() {
54
- return 'string, number, boolean, array, object';
55
- }
56
- }