@fnlb-project/shared 1.0.3

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/README.md ADDED
@@ -0,0 +1 @@
1
+ # Pragmatic
@@ -0,0 +1,125 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ declare enum ErrorTypes {
4
+ General = "general",
5
+ Input = "input"
6
+ }
7
+ declare const errorMap: {
8
+ readonly "net.fnlb.errors.common.invalid_request": {
9
+ readonly type: ErrorTypes.General;
10
+ readonly message: "The request is not valid.";
11
+ };
12
+ readonly "net.fnlb.errors.common.unable_to_process_request": {
13
+ readonly type: ErrorTypes.General;
14
+ readonly message: "Unable to process the request. Please try again.";
15
+ };
16
+ readonly "net.fnlb.errors.common.invalid_body_fields_length": {
17
+ readonly type: ErrorTypes.General;
18
+ readonly message: "The body fields have an invalid length.";
19
+ };
20
+ readonly "net.fnlb.errors.common.rate_limit_exceeded": {
21
+ readonly type: ErrorTypes.General;
22
+ readonly message: "You are being rate limited.";
23
+ };
24
+ readonly "net.fnlb.errors.common.unable_to_save_to_database": {
25
+ readonly type: ErrorTypes.General;
26
+ readonly message: "Unable to save changes. Please check all fields.";
27
+ };
28
+ readonly "net.fnlb.errors.auth.invalid_token": {
29
+ readonly type: ErrorTypes.General;
30
+ readonly message: "Invalid token provided.";
31
+ };
32
+ readonly "net.fnlb.errors.auth.invalid_api_token": {
33
+ readonly type: ErrorTypes.General;
34
+ readonly message: "Invalid API token provided.";
35
+ };
36
+ readonly "net.fnlb.errors.auth.invalid_captcha_token": {
37
+ readonly type: ErrorTypes.General;
38
+ readonly message: "Sorry, the captcha was not resolved correctly. Please try again.";
39
+ };
40
+ readonly "net.fnlb.errors.auth.unauthorized": {
41
+ readonly type: ErrorTypes.General;
42
+ readonly message: "You are not authorized to perform this action.";
43
+ };
44
+ readonly "net.fnlb.errors.auth.user_banned": {
45
+ readonly type: ErrorTypes.General;
46
+ readonly message: "Your account is banned from the service.";
47
+ };
48
+ readonly "net.fnlb.errors.login.invalid_credentials": {
49
+ readonly type: ErrorTypes.Input;
50
+ readonly message: "The email or password is incorrect";
51
+ };
52
+ readonly "net.fnlb.errors.login.invalid_email": {
53
+ readonly type: ErrorTypes.Input;
54
+ readonly message: "The email is invalid.";
55
+ };
56
+ readonly "net.fnlb.errors.login.invalid_or_used_email": {
57
+ readonly type: ErrorTypes.Input;
58
+ readonly message: "The email is invalid or is already used.";
59
+ };
60
+ readonly "net.fnlb.errors.oauth2.invalid_code": {
61
+ readonly type: ErrorTypes.General;
62
+ readonly message: "Unable to verify your request at this moment. Please try again later.";
63
+ };
64
+ readonly "net.fnlb.errors.oauth2.invalid_scope": {
65
+ readonly type: ErrorTypes.General;
66
+ readonly message: "Invalid scope provided.";
67
+ };
68
+ readonly "net.fnlb.errors.oauth2.token_invalid": {
69
+ readonly type: ErrorTypes.General;
70
+ readonly message: "Unable to verify Oauth2 token. Please try again later.";
71
+ };
72
+ readonly "net.fnlb.errors.oauth2.unable_to_fetch_user": {
73
+ readonly type: ErrorTypes.General;
74
+ readonly message: "Unable to obtain user information. Please try again later.";
75
+ };
76
+ readonly "net.fnlb.errors.oauth2.unable_to_fetch_connections": {
77
+ readonly type: ErrorTypes.General;
78
+ readonly message: "Unable to obtain user connections. Please try again later.";
79
+ };
80
+ readonly "net.fnlb.errors.oauth2.user_without_connection": {
81
+ readonly type: ErrorTypes.General;
82
+ readonly message: "User does not have connections. Please try again later.";
83
+ };
84
+ readonly "net.fnlb.errors.oauth2.connection_not_verified": {
85
+ readonly type: ErrorTypes.General;
86
+ readonly message: "User does have a connection, but the connection is not verified. Please try again later.";
87
+ };
88
+ readonly "net.fnlb.errors.release.no_release_found": {
89
+ readonly type: ErrorTypes.General;
90
+ readonly message: "Sorry, no release found. Please try again later.";
91
+ };
92
+ readonly "net.fnlb.errors.release.version_already_exists": {
93
+ readonly type: ErrorTypes.General;
94
+ readonly message: "Release version already exists.";
95
+ };
96
+ };
97
+ declare enum ErrorCodes {
98
+ CommonInvalidRequest = "net.fnlb.errors.common.invalid_request",
99
+ CommonUnableToProcessRequest = "net.fnlb.errors.common.unable_to_process_request",
100
+ CommonInvalidFieldsLength = "net.fnlb.errors.common.invalid_body_fields_length",
101
+ CommonRateLimitExceeded = "net.fnlb.errors.common.rate_limit_exceeded",
102
+ CommonUnableToSaveToDatabase = "net.fnlb.errors.common.unable_to_save_to_database",
103
+ AuthInvalidToken = "net.fnlb.errors.auth.invalid_token",
104
+ AuthInvalidAPIToken = "net.fnlb.errors.auth.invalid_api_token",
105
+ AuthInvalidCaptchaToken = "net.fnlb.errors.auth.invalid_captcha_token",
106
+ AuthUnauthorized = "net.fnlb.errors.auth.unauthorized",
107
+ AuthUserBanned = "net.fnlb.errors.auth.user_banned",
108
+ LoginInvalidCredentials = "net.fnlb.errors.login.invalid_credentials",
109
+ LoginInvalidEmail = "net.fnlb.errors.login.invalid_email",
110
+ LoginInvalidOrUsedEmail = "net.fnlb.errors.login.invalid_or_used_email",
111
+ Oauth2InvalidCode = "net.fnlb.errors.oauth2.invalid_code",
112
+ Oauth2InvalidScope = "net.fnlb.errors.oauth2.invalid_scope",
113
+ Oauth2TokenInvalid = "net.fnlb.errors.oauth2.token_invalid",
114
+ Oauth2UnableToFetchUser = "net.fnlb.errors.oauth2.unable_to_fetch_user",
115
+ Oauth2UnableToFetchConnections = "net.fnlb.errors.oauth2.unable_to_fetch_connections",
116
+ Oauth2UserWithoutConnection = "net.fnlb.errors.oauth2.user_without_connection",
117
+ Oauth2ConnectionNotVerified = "net.fnlb.errors.oauth2.connection_not_verified",
118
+ ReleaseNotFound = "net.fnlb.errors.release.no_release_found",
119
+ ReleaseVersionAlreadyExists = "net.fnlb.errors.release.version_already_exists"
120
+ }
121
+ export declare abstract class ErrorHandler {
122
+ static getError<T extends ErrorCodes>(error: T): (typeof errorMap)[T];
123
+ }
124
+
125
+ export {};
@@ -0,0 +1 @@
1
+ var e={"net.fnlb.errors.common.invalid_request":{type:"general",message:"The request is not valid."},"net.fnlb.errors.common.unable_to_process_request":{type:"general",message:"Unable to process the request. Please try again."},"net.fnlb.errors.common.invalid_body_fields_length":{type:"general",message:"The body fields have an invalid length."},"net.fnlb.errors.common.rate_limit_exceeded":{type:"general",message:"You are being rate limited."},"net.fnlb.errors.common.unable_to_save_to_database":{type:"general",message:"Unable to save changes. Please check all fields."},"net.fnlb.errors.auth.invalid_token":{type:"general",message:"Invalid token provided."},"net.fnlb.errors.auth.invalid_api_token":{type:"general",message:"Invalid API token provided."},"net.fnlb.errors.auth.invalid_captcha_token":{type:"general",message:"Sorry, the captcha was not resolved correctly. Please try again."},"net.fnlb.errors.auth.unauthorized":{type:"general",message:"You are not authorized to perform this action."},"net.fnlb.errors.auth.user_banned":{type:"general",message:"Your account is banned from the service."},"net.fnlb.errors.login.invalid_credentials":{type:"input",message:"The email or password is incorrect"},"net.fnlb.errors.login.invalid_email":{type:"input",message:"The email is invalid."},"net.fnlb.errors.login.invalid_or_used_email":{type:"input",message:"The email is invalid or is already used."},"net.fnlb.errors.oauth2.invalid_code":{type:"general",message:"Unable to verify your request at this moment. Please try again later."},"net.fnlb.errors.oauth2.invalid_scope":{type:"general",message:"Invalid scope provided."},"net.fnlb.errors.oauth2.token_invalid":{type:"general",message:"Unable to verify Oauth2 token. Please try again later."},"net.fnlb.errors.oauth2.unable_to_fetch_user":{type:"general",message:"Unable to obtain user information. Please try again later."},"net.fnlb.errors.oauth2.unable_to_fetch_connections":{type:"general",message:"Unable to obtain user connections. Please try again later."},"net.fnlb.errors.oauth2.user_without_connection":{type:"general",message:"User does not have connections. Please try again later."},"net.fnlb.errors.oauth2.connection_not_verified":{type:"general",message:"User does have a connection, but the connection is not verified. Please try again later."},"net.fnlb.errors.release.no_release_found":{type:"general",message:"Sorry, no release found. Please try again later."},"net.fnlb.errors.release.version_already_exists":{type:"general",message:"Release version already exists."}};class a{static getError(n){return e[n]}}export{a as ErrorHandler};
@@ -0,0 +1,383 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export declare enum BotTypes {
4
+ Public = 0,
5
+ Private = 1
6
+ }
7
+ export declare enum BotStatus {
8
+ Offline = 0,
9
+ Booting = 1,
10
+ Available = 2,
11
+ Busy = 3,
12
+ Disconnected = 4
13
+ }
14
+ export declare enum CategoryConfigSupportedPlatforms {
15
+ Win = "WIN",
16
+ Mac = "MAC",
17
+ Psn = "PSN",
18
+ Xbl = "XBL",
19
+ Swt = "SWT",
20
+ Ios = "IOS",
21
+ And = "AND",
22
+ Ps5 = "PS5",
23
+ Xsx = "XSX"
24
+ }
25
+ export declare enum CategoryConfigPartyPrivacy {
26
+ Public = 0,
27
+ Private = 1
28
+ }
29
+ export declare enum CategoryConfigTriggerStringDetectionMethod {
30
+ Equals = 0,
31
+ Includes = 1,
32
+ StartsWith = 2,
33
+ EndsWith = 3
34
+ }
35
+ export declare enum CategoryConfigTriggerAction {
36
+ ChatBan = 0,
37
+ Kick = 1,
38
+ Block = 2,
39
+ RemoveFriend = 3,
40
+ AddFriend = 4,
41
+ Promote = 5,
42
+ Copy = 6,
43
+ Mimic = 7,
44
+ Hide = 8,
45
+ Show = 9,
46
+ Blacklist = 10,
47
+ Whitelist = 11
48
+ }
49
+ export declare enum ErrorTypes {
50
+ General = "general",
51
+ Input = "input"
52
+ }
53
+ declare const errorMap: {
54
+ readonly "net.fnlb.errors.common.invalid_request": {
55
+ readonly type: ErrorTypes.General;
56
+ readonly message: "The request is not valid.";
57
+ };
58
+ readonly "net.fnlb.errors.common.unable_to_process_request": {
59
+ readonly type: ErrorTypes.General;
60
+ readonly message: "Unable to process the request. Please try again.";
61
+ };
62
+ readonly "net.fnlb.errors.common.invalid_body_fields_length": {
63
+ readonly type: ErrorTypes.General;
64
+ readonly message: "The body fields have an invalid length.";
65
+ };
66
+ readonly "net.fnlb.errors.common.rate_limit_exceeded": {
67
+ readonly type: ErrorTypes.General;
68
+ readonly message: "You are being rate limited.";
69
+ };
70
+ readonly "net.fnlb.errors.common.unable_to_save_to_database": {
71
+ readonly type: ErrorTypes.General;
72
+ readonly message: "Unable to save changes. Please check all fields.";
73
+ };
74
+ readonly "net.fnlb.errors.auth.invalid_token": {
75
+ readonly type: ErrorTypes.General;
76
+ readonly message: "Invalid token provided.";
77
+ };
78
+ readonly "net.fnlb.errors.auth.invalid_api_token": {
79
+ readonly type: ErrorTypes.General;
80
+ readonly message: "Invalid API token provided.";
81
+ };
82
+ readonly "net.fnlb.errors.auth.invalid_captcha_token": {
83
+ readonly type: ErrorTypes.General;
84
+ readonly message: "Sorry, the captcha was not resolved correctly. Please try again.";
85
+ };
86
+ readonly "net.fnlb.errors.auth.unauthorized": {
87
+ readonly type: ErrorTypes.General;
88
+ readonly message: "You are not authorized to perform this action.";
89
+ };
90
+ readonly "net.fnlb.errors.auth.user_banned": {
91
+ readonly type: ErrorTypes.General;
92
+ readonly message: "Your account is banned from the service.";
93
+ };
94
+ readonly "net.fnlb.errors.login.invalid_credentials": {
95
+ readonly type: ErrorTypes.Input;
96
+ readonly message: "The email or password is incorrect";
97
+ };
98
+ readonly "net.fnlb.errors.login.invalid_email": {
99
+ readonly type: ErrorTypes.Input;
100
+ readonly message: "The email is invalid.";
101
+ };
102
+ readonly "net.fnlb.errors.login.invalid_or_used_email": {
103
+ readonly type: ErrorTypes.Input;
104
+ readonly message: "The email is invalid or is already used.";
105
+ };
106
+ readonly "net.fnlb.errors.oauth2.invalid_code": {
107
+ readonly type: ErrorTypes.General;
108
+ readonly message: "Unable to verify your request at this moment. Please try again later.";
109
+ };
110
+ readonly "net.fnlb.errors.oauth2.invalid_scope": {
111
+ readonly type: ErrorTypes.General;
112
+ readonly message: "Invalid scope provided.";
113
+ };
114
+ readonly "net.fnlb.errors.oauth2.token_invalid": {
115
+ readonly type: ErrorTypes.General;
116
+ readonly message: "Unable to verify Oauth2 token. Please try again later.";
117
+ };
118
+ readonly "net.fnlb.errors.oauth2.unable_to_fetch_user": {
119
+ readonly type: ErrorTypes.General;
120
+ readonly message: "Unable to obtain user information. Please try again later.";
121
+ };
122
+ readonly "net.fnlb.errors.oauth2.unable_to_fetch_connections": {
123
+ readonly type: ErrorTypes.General;
124
+ readonly message: "Unable to obtain user connections. Please try again later.";
125
+ };
126
+ readonly "net.fnlb.errors.oauth2.user_without_connection": {
127
+ readonly type: ErrorTypes.General;
128
+ readonly message: "User does not have connections. Please try again later.";
129
+ };
130
+ readonly "net.fnlb.errors.oauth2.connection_not_verified": {
131
+ readonly type: ErrorTypes.General;
132
+ readonly message: "User does have a connection, but the connection is not verified. Please try again later.";
133
+ };
134
+ readonly "net.fnlb.errors.release.no_release_found": {
135
+ readonly type: ErrorTypes.General;
136
+ readonly message: "Sorry, no release found. Please try again later.";
137
+ };
138
+ readonly "net.fnlb.errors.release.version_already_exists": {
139
+ readonly type: ErrorTypes.General;
140
+ readonly message: "Release version already exists.";
141
+ };
142
+ };
143
+ export declare enum ErrorCodes {
144
+ CommonInvalidRequest = "net.fnlb.errors.common.invalid_request",
145
+ CommonUnableToProcessRequest = "net.fnlb.errors.common.unable_to_process_request",
146
+ CommonInvalidFieldsLength = "net.fnlb.errors.common.invalid_body_fields_length",
147
+ CommonRateLimitExceeded = "net.fnlb.errors.common.rate_limit_exceeded",
148
+ CommonUnableToSaveToDatabase = "net.fnlb.errors.common.unable_to_save_to_database",
149
+ AuthInvalidToken = "net.fnlb.errors.auth.invalid_token",
150
+ AuthInvalidAPIToken = "net.fnlb.errors.auth.invalid_api_token",
151
+ AuthInvalidCaptchaToken = "net.fnlb.errors.auth.invalid_captcha_token",
152
+ AuthUnauthorized = "net.fnlb.errors.auth.unauthorized",
153
+ AuthUserBanned = "net.fnlb.errors.auth.user_banned",
154
+ LoginInvalidCredentials = "net.fnlb.errors.login.invalid_credentials",
155
+ LoginInvalidEmail = "net.fnlb.errors.login.invalid_email",
156
+ LoginInvalidOrUsedEmail = "net.fnlb.errors.login.invalid_or_used_email",
157
+ Oauth2InvalidCode = "net.fnlb.errors.oauth2.invalid_code",
158
+ Oauth2InvalidScope = "net.fnlb.errors.oauth2.invalid_scope",
159
+ Oauth2TokenInvalid = "net.fnlb.errors.oauth2.token_invalid",
160
+ Oauth2UnableToFetchUser = "net.fnlb.errors.oauth2.unable_to_fetch_user",
161
+ Oauth2UnableToFetchConnections = "net.fnlb.errors.oauth2.unable_to_fetch_connections",
162
+ Oauth2UserWithoutConnection = "net.fnlb.errors.oauth2.user_without_connection",
163
+ Oauth2ConnectionNotVerified = "net.fnlb.errors.oauth2.connection_not_verified",
164
+ ReleaseNotFound = "net.fnlb.errors.release.no_release_found",
165
+ ReleaseVersionAlreadyExists = "net.fnlb.errors.release.version_already_exists"
166
+ }
167
+ export type GeneralErrorCodes = {
168
+ [K in keyof typeof errorMap]: (typeof errorMap)[K] extends {
169
+ type: ErrorTypes.General;
170
+ } ? K : never;
171
+ }[keyof typeof errorMap];
172
+ export type InputErrorCodes = {
173
+ [K in keyof typeof errorMap]: (typeof errorMap)[K] extends {
174
+ type: ErrorTypes.Input;
175
+ } ? K : never;
176
+ }[keyof typeof errorMap];
177
+ export declare enum ErrorInputTypes {
178
+ Username = "username",
179
+ Email = "email",
180
+ Password = "password",
181
+ Shared = "shared"
182
+ }
183
+ export declare enum Locales {
184
+ Default = "en",
185
+ De = "de",
186
+ Es = "es",
187
+ Fr = "fr",
188
+ It = "it",
189
+ Pl = "pl",
190
+ Pt = "pt",
191
+ Tr = "tr"
192
+ }
193
+ export interface IDBBot {
194
+ id: string;
195
+ owner: string;
196
+ parent: string;
197
+ nickname: string;
198
+ type: BotTypes;
199
+ email: string;
200
+ deviceAuth: {
201
+ accountId: string;
202
+ deviceId: string;
203
+ secret: string;
204
+ };
205
+ }
206
+ export interface IClientBot extends IDBBot {
207
+ }
208
+ export interface IBot extends IClientBot {
209
+ email: never;
210
+ deviceAuth: never;
211
+ }
212
+ export interface ICosmeticVariantData {
213
+ t: string;
214
+ n: string;
215
+ o: {
216
+ t: string;
217
+ n: string | null;
218
+ }[];
219
+ }
220
+ export interface ICosmeticVariantMeta {
221
+ c: string;
222
+ v: string;
223
+ dE?: number;
224
+ }
225
+ export interface ICosmeticVariants {
226
+ outfit?: ICosmeticVariantMeta[];
227
+ backpack?: ICosmeticVariantMeta[];
228
+ pickaxe?: ICosmeticVariantMeta[];
229
+ }
230
+ export interface IPartyMember {
231
+ id: string;
232
+ displayName?: string;
233
+ outfit?: string;
234
+ emote?: string;
235
+ backpack?: string;
236
+ pickaxe?: string;
237
+ variants?: ICosmeticVariants;
238
+ isReady?: boolean;
239
+ isLeader?: boolean;
240
+ isSittingOut?: boolean;
241
+ isPlaying?: boolean;
242
+ }
243
+ export interface IConnectedBot extends IBot {
244
+ status: BotStatus;
245
+ epicId?: string;
246
+ friendsCount?: number;
247
+ party?: {
248
+ id?: string;
249
+ members: IPartyMember[];
250
+ };
251
+ }
252
+ export interface IConnectedClientBot extends IClientBot {
253
+ status: BotStatus;
254
+ epicId?: string;
255
+ friendsCount?: number;
256
+ party?: {
257
+ id?: string;
258
+ members: IPartyMember[];
259
+ };
260
+ }
261
+ export interface ICategoryConfig {
262
+ replyLangs?: Locales[];
263
+ searchLangs?: Locales[];
264
+ platform?: `${CategoryConfigSupportedPlatforms}`[];
265
+ privacy?: `${CategoryConfigPartyPrivacy}`;
266
+ prefixes?: string[];
267
+ extraOwners?: string[];
268
+ admins?: string[];
269
+ whitelistUsers?: string[];
270
+ blacklistUsers?: string[];
271
+ excludedAutoAddFriends?: string[];
272
+ otherBots?: string[];
273
+ statusText?: string[];
274
+ statusInterval?: number[];
275
+ level?: number[];
276
+ bpLevel?: number[];
277
+ disableMatchmakingChecks?: boolean;
278
+ disableJoinMessages?: boolean;
279
+ inviteTimeout?: number;
280
+ maxBotsPerLobby?: number;
281
+ maxBotsPerLobbyWithOwner?: number;
282
+ maxBotsPerLobbyWithAdmin?: number;
283
+ maxBotsPerLobbyWithWhitelistUser?: number;
284
+ allowMatchmaking?: boolean;
285
+ acceptFriendRequests?: boolean;
286
+ sendFriendRequestOnJoinParty?: boolean;
287
+ sendFriendRequestOnMemberJoinParty?: boolean;
288
+ runCommandsWithoutPrefix?: boolean;
289
+ setCosmeticsWithoutCommands?: boolean;
290
+ usernameTriggers?: {
291
+ triggers?: string[];
292
+ detectionMethods?: CategoryConfigTriggerStringDetectionMethod[];
293
+ actions?: CategoryConfigTriggerAction[];
294
+ messages?: string[];
295
+ }[];
296
+ messageContentTriggers?: {
297
+ triggers?: string[];
298
+ detectionMethods?: CategoryConfigTriggerStringDetectionMethod[];
299
+ actions?: CategoryConfigTriggerAction[];
300
+ messages?: string[];
301
+ }[];
302
+ cosmeticTriggers?: {
303
+ triggers?: string[];
304
+ detectionMethods?: CategoryConfigTriggerStringDetectionMethod[];
305
+ actions?: CategoryConfigTriggerAction[];
306
+ messages?: string[];
307
+ }[];
308
+ addFriendTrigger?: {
309
+ actions?: CategoryConfigTriggerAction[];
310
+ messages?: string[];
311
+ };
312
+ memberJoinTrigger?: {
313
+ actions?: CategoryConfigTriggerAction[];
314
+ messages?: string[];
315
+ };
316
+ changeCosmeticTrigger?: {
317
+ actions?: CategoryConfigTriggerAction[];
318
+ messages?: string[];
319
+ };
320
+ onlyOwnerCommands?: string[];
321
+ onlyAdminCommands?: string[];
322
+ onlyWhitelistUsersCommands?: string[];
323
+ onlyFriendsCommands?: string[];
324
+ onlyPartyMembersCommands?: string[];
325
+ onlyWhisperCommands?: string[];
326
+ startOutfit?: string[];
327
+ startOutfitVariants?: number[][][];
328
+ startBackpack?: string[];
329
+ startBackpackVariants?: number[][][];
330
+ startPickaxe?: string[];
331
+ startPickaxeVariants?: number[][][];
332
+ startBanner?: string[];
333
+ joinOutfit?: string[];
334
+ joinOutfitVariants?: number[][][];
335
+ joinBackpack?: string[];
336
+ joinBackpackVariants?: number[][][];
337
+ joinPickaxe?: string[];
338
+ joinPickaxeVariants?: number[][][];
339
+ joinEmote?: string[];
340
+ joinEmoji?: string[];
341
+ joinBanner?: string[];
342
+ memberJoinOutfit?: string[];
343
+ memberJoinOutfitVariants?: number[][][];
344
+ memberJoinBackpack?: string[];
345
+ memberJoinBackpackVariants?: number[][][];
346
+ memberJoinPickaxe?: string[];
347
+ memberJoinPickaxeVariants?: number[][][];
348
+ memberJoinEmote?: string[];
349
+ memberJoinEmoji?: string[];
350
+ memberJoinBanner?: string[];
351
+ }
352
+ export interface IDBCategory {
353
+ id: string;
354
+ owner: string;
355
+ name: string;
356
+ config: ICategoryConfig;
357
+ }
358
+ export interface ICategory extends IDBCategory {
359
+ }
360
+ export interface IDBUser {
361
+ id: string;
362
+ token: string;
363
+ username: string;
364
+ email: string;
365
+ password: string;
366
+ apiToken: string;
367
+ connections?: {
368
+ epic?: {
369
+ id: string;
370
+ username: string;
371
+ };
372
+ discord?: {
373
+ id: string;
374
+ username: string;
375
+ };
376
+ };
377
+ }
378
+ export interface IClientUser extends IDBUser {
379
+ token: never;
380
+ password: never;
381
+ }
382
+
383
+ export {};
@@ -0,0 +1 @@
1
+ var _;((a)=>{a[a.Public=0]="Public";a[a.Private=1]="Private"})(_||={});var b;((m)=>{m[m.Offline=0]="Offline";m[m.Booting=1]="Booting";m[m.Available=2]="Available";m[m.Busy=3]="Busy";m[m.Disconnected=4]="Disconnected"})(b||={});var h;((p)=>{p.Win="WIN";p.Mac="MAC";p.Psn="PSN";p.Xbl="XBL";p.Swt="SWT";p.Ios="IOS";p.And="AND";p.Ps5="PS5";p.Xsx="XSX"})(h||={});var v;((a)=>{a[a.Public=0]="Public";a[a.Private=1]="Private"})(v||={});var s;((l)=>{l[l.Equals=0]="Equals";l[l.Includes=1]="Includes";l[l.StartsWith=2]="StartsWith";l[l.EndsWith=3]="EndsWith"})(s||={});var d;((e)=>{e[e.ChatBan=0]="ChatBan";e[e.Kick=1]="Kick";e[e.Block=2]="Block";e[e.RemoveFriend=3]="RemoveFriend";e[e.AddFriend=4]="AddFriend";e[e.Promote=5]="Promote";e[e.Copy=6]="Copy";e[e.Mimic=7]="Mimic";e[e.Hide=8]="Hide";e[e.Show=9]="Show";e[e.Blacklist=10]="Blacklist";e[e.Whitelist=11]="Whitelist"})(d||={});var x;((n)=>{n.CommonInvalidRequest="net.fnlb.errors.common.invalid_request";n.CommonUnableToProcessRequest="net.fnlb.errors.common.unable_to_process_request";n.CommonInvalidFieldsLength="net.fnlb.errors.common.invalid_body_fields_length";n.CommonRateLimitExceeded="net.fnlb.errors.common.rate_limit_exceeded";n.CommonUnableToSaveToDatabase="net.fnlb.errors.common.unable_to_save_to_database";n.AuthInvalidToken="net.fnlb.errors.auth.invalid_token";n.AuthInvalidAPIToken="net.fnlb.errors.auth.invalid_api_token";n.AuthInvalidCaptchaToken="net.fnlb.errors.auth.invalid_captcha_token";n.AuthUnauthorized="net.fnlb.errors.auth.unauthorized";n.AuthUserBanned="net.fnlb.errors.auth.user_banned";n.LoginInvalidCredentials="net.fnlb.errors.login.invalid_credentials";n.LoginInvalidEmail="net.fnlb.errors.login.invalid_email";n.LoginInvalidOrUsedEmail="net.fnlb.errors.login.invalid_or_used_email";n.Oauth2InvalidCode="net.fnlb.errors.oauth2.invalid_code";n.Oauth2InvalidScope="net.fnlb.errors.oauth2.invalid_scope";n.Oauth2TokenInvalid="net.fnlb.errors.oauth2.token_invalid";n.Oauth2UnableToFetchUser="net.fnlb.errors.oauth2.unable_to_fetch_user";n.Oauth2UnableToFetchConnections="net.fnlb.errors.oauth2.unable_to_fetch_connections";n.Oauth2UserWithoutConnection="net.fnlb.errors.oauth2.user_without_connection";n.Oauth2ConnectionNotVerified="net.fnlb.errors.oauth2.connection_not_verified";n.ReleaseNotFound="net.fnlb.errors.release.no_release_found";n.ReleaseVersionAlreadyExists="net.fnlb.errors.release.version_already_exists"})(x||={});var f;((l)=>{l.Username="username";l.Email="email";l.Password="password";l.Shared="shared"})(f||={});var t;((a)=>{a.General="general";a.Input="input"})(t||={});var k;((u)=>{u.Default="en";u.De="de";u.Es="es";u.Fr="fr";u.It="it";u.Pl="pl";u.Pt="pt";u.Tr="tr"})(k||={});export{k as Locales,t as ErrorTypes,f as ErrorInputTypes,x as ErrorCodes,s as CategoryConfigTriggerStringDetectionMethod,d as CategoryConfigTriggerAction,h as CategoryConfigSupportedPlatforms,v as CategoryConfigPartyPrivacy,_ as BotTypes,b as BotStatus};
@@ -0,0 +1,17 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export declare abstract class AuthUtil {
4
+ static encodeToken(id: string, auth: string): string;
5
+ static decodeToken(token: string): {
6
+ id: string;
7
+ auth: string;
8
+ } | null;
9
+ }
10
+ export declare abstract class PromiseUtil {
11
+ static wait(ms: number): Promise<void>;
12
+ }
13
+ export declare abstract class TextUtil {
14
+ static cutText(text: string, maxLength: number, addDots?: boolean): string;
15
+ }
16
+
17
+ export {};
@@ -0,0 +1 @@
1
+ class i{static encodeToken(r,t){return Buffer.from(`${r}.${t}`).toString("base64").replaceAll("=","")}static decodeToken(r){const[t,e]=Buffer.from(r,"base64").toString("utf8").split(".");if(!t||!e)return null;return{id:t,auth:e}}}class s{static wait(r){return new Promise((t)=>setTimeout(t,r))}}class n{static cutText(r,t,e=!0){return r.length>t?`${r.slice(0,e?Math.max(t-3,0):t)}${e?"...":""}`:r}}export{n as TextUtil,s as PromiseUtil,i as AuthUtil};
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@fnlb-project/shared",
3
+ "description": "FNLB Shared Library",
4
+ "version": "1.0.3",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "scripts": {
10
+ "build": "bun run build.ts",
11
+ "prepublishOnly": "bun run build",
12
+ "lint": "bun run lint:biome && bun run lint:tsc",
13
+ "lint:biome": "bun biome check --write .",
14
+ "lint:tsc": "bun tsc --noEmit",
15
+ "test": "bun run test/index.ts"
16
+ },
17
+ "author": "FNLB-Project",
18
+ "files": ["dist"],
19
+ "exports": {
20
+ "./errors": {
21
+ "default": "./dist/errors/index.js",
22
+ "types": "./dist/errors/index.d.ts"
23
+ },
24
+ "./types": {
25
+ "default": "./dist/types/index.js",
26
+ "types": "./dist/types/index.d.ts"
27
+ },
28
+ "./util": {
29
+ "default": "./dist/util/index.js",
30
+ "types": "./dist/util/index.d.ts"
31
+ }
32
+ },
33
+ "devDependencies": {
34
+ "@biomejs/biome": "^1.8.3",
35
+ "@types/bun": "^1.1.6",
36
+ "bun-plugin-dts": "^0.2.3",
37
+ "typescript": "^5.5.3"
38
+ },
39
+ "packageManager": "bun@1.1.17"
40
+ }