@fnlb-project/database 1.0.77 → 1.0.79

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 (3) hide show
  1. package/dist/index.d.ts +206 -2
  2. package/dist/index.js +460 -460
  3. package/package.json +34 -34
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
- import { GenericErrorSender } from '@fnlb-project/shared/errors';
4
- import { CategoryConfigSupportedPlatforms, Locales } from '@fnlb-project/shared/types';
5
3
  import { ConnectOptions, HydratedDocument, Model, Schema, connection } from 'mongoose';
6
4
 
7
5
  export declare class DatabaseClient {
@@ -10,6 +8,63 @@ export declare class DatabaseClient {
10
8
  connect(options?: ConnectOptions): Promise<void>;
11
9
  private connectWithRetry;
12
10
  }
11
+ declare enum GeneralErrorCodes {
12
+ GenericUnknown = "net.fnlb.errors.generic.unknown",
13
+ GenericInternalError = "net.fnlb.errors.generic.internal_error",
14
+ GenericValidationFailed = "net.fnlb.errors.generic.validation_failed",
15
+ GenericParseFailed = "net.fnlb.errors.generic.parse_failed",
16
+ GenericNotFound = "net.fnlb.errors.generic.not_found",
17
+ GenericAlreadyExists = "net.fnlb.errors.generic.already_exists",
18
+ CommonInvalidRequest = "net.fnlb.errors.common.invalid_request",
19
+ CommonUnableToProcessRequest = "net.fnlb.errors.common.unable_to_process_request",
20
+ CommonInvalidFieldsLength = "net.fnlb.errors.common.invalid_body_fields_length",
21
+ CommonRateLimitExceeded = "net.fnlb.errors.common.rate_limit_exceeded",
22
+ CommonLimitExceeded = "net.fnlb.errors.common.limit_exceeded",
23
+ CommonUnableToSaveToDatabase = "net.fnlb.errors.common.unable_to_save_to_database",
24
+ CommonUpdateRequired = "net.fnlb.errors.common.update_required",
25
+ CommonMaintenanceMode = "net.fnlb.errors.common.maintenance_mode",
26
+ AuthInvalidToken = "net.fnlb.errors.auth.invalid_token",
27
+ AuthInvalidAPIToken = "net.fnlb.errors.auth.invalid_api_token",
28
+ AuthManagedAuthRefused = "net.fnlb.errors.auth.managed_auth_refused",
29
+ AuthInvalidCaptchaToken = "net.fnlb.errors.auth.invalid_captcha_token",
30
+ AuthUnauthorized = "net.fnlb.errors.auth.unauthorized",
31
+ AuthForbidden = "net.fnlb.errors.auth.forbidden",
32
+ AuthUserBanned = "net.fnlb.errors.auth.user_banned",
33
+ Oauth2InvalidCode = "net.fnlb.errors.oauth2.invalid_code",
34
+ Oauth2InvalidScope = "net.fnlb.errors.oauth2.invalid_scope",
35
+ Oauth2TokenInvalid = "net.fnlb.errors.oauth2.token_invalid",
36
+ Oauth2UnableToFetchUser = "net.fnlb.errors.oauth2.unable_to_fetch_user",
37
+ Oauth2UnableToFetchConnections = "net.fnlb.errors.oauth2.unable_to_fetch_connections",
38
+ Oauth2UserWithoutConnection = "net.fnlb.errors.oauth2.user_without_connection",
39
+ Oauth2ConnectionNotVerified = "net.fnlb.errors.oauth2.connection_not_verified",
40
+ ReleaseNotFound = "net.fnlb.errors.release.no_release_found",
41
+ ReleaseVersionAlreadyExists = "net.fnlb.errors.release.version_already_exists",
42
+ ReleaseHashMismatch = "net.fnlb.errors.release.hash_mismatch",
43
+ MfaNotEnabled = "net.fnlb.errors.mfa.not_enabled",
44
+ MfaAlreadyEnabled = "net.fnlb.errors.mfa.already_enabled",
45
+ MfaChallengeExpired = "net.fnlb.errors.mfa.challenge_expired",
46
+ MfaSetupExpired = "net.fnlb.errors.mfa.setup_expired"
47
+ }
48
+ declare enum InputErrorCodes {
49
+ LoginInvalidCredentials = "net.fnlb.errors.login.invalid_credentials",
50
+ LoginInvalidEmail = "net.fnlb.errors.login.invalid_email",
51
+ LoginInvalidOrUsedEmail = "net.fnlb.errors.login.invalid_or_used_email",
52
+ AuthPasswordConfirmationInvalid = "net.fnlb.errors.auth.invalid_password_confirmation",
53
+ MfaInvalidCode = "net.fnlb.errors.mfa.invalid_code",
54
+ MfaRequired = "net.fnlb.errors.mfa.required"
55
+ }
56
+ export type ErrorCodes = GeneralErrorCodes | InputErrorCodes;
57
+ declare enum ErrorInputTypes {
58
+ Username = "username",
59
+ Email = "email",
60
+ Password = "password",
61
+ Shared = "shared",
62
+ MfaCode = "mfaCode"
63
+ }
64
+ export type ErrorSenderErrors = GeneralErrorCodes | GeneralErrorCodes[] | InputErrorCodes | InputErrorCodes[] | ErrorCodes | ErrorCodes[];
65
+ declare abstract class GenericErrorSender {
66
+ abstract sendError(code: number, errors: ErrorSenderErrors, input?: ErrorInputTypes): unknown;
67
+ }
13
68
  export declare class DatabaseErrorHandler {
14
69
  static handleError(err: any, errorSender: GenericErrorSender): unknown;
15
70
  }
@@ -175,6 +230,55 @@ export declare const BotModel: import("mongoose").Model<{
175
230
  } & {
176
231
  __v: number;
177
232
  }>>;
233
+ declare enum CategoryConfigSupportedPlatforms {
234
+ Win = "WIN",
235
+ Mac = "MAC",
236
+ Psn = "PSN",
237
+ Xbl = "XBL",
238
+ Swt = "SWT",
239
+ Swt2 = "SWT2",
240
+ Ios = "IOS",
241
+ And = "AND",
242
+ Ps5 = "PS5",
243
+ Xsx = "XSX"
244
+ }
245
+ declare enum CommunityListingKind {
246
+ Bot = "bot",
247
+ Preset = "preset",
248
+ Category = "category",
249
+ Event = "event",
250
+ CustomCommand = "custom_command",
251
+ Scheduled = "scheduled"
252
+ }
253
+ declare enum CommunityListingStatus {
254
+ Pending = "pending",
255
+ Published = "published",
256
+ Rejected = "rejected",
257
+ Unlisted = "unlisted"
258
+ }
259
+ declare enum Locales {
260
+ Default = "en",
261
+ EnUS = "en-US",
262
+ Es = "es",
263
+ Es419 = "es-419",
264
+ Ar = "ar",
265
+ De = "de",
266
+ Fr = "fr",
267
+ He = "he",
268
+ Id = "id",
269
+ It = "it",
270
+ Ja = "ja",
271
+ Ko = "ko",
272
+ Pl = "pl",
273
+ Pt = "pt",
274
+ PtBR = "pt-BR",
275
+ Ru = "ru",
276
+ Th = "th",
277
+ Tr = "tr",
278
+ Vi = "vi",
279
+ Zh = "zh",
280
+ ZhHant = "zh-Hant"
281
+ }
178
282
  export declare const CategoryModel: import("mongoose").Model<{
179
283
  owner: import("mongoose").Types.ObjectId;
180
284
  name: string;
@@ -3262,6 +3366,105 @@ export declare const CategoryModel: import("mongoose").Model<{
3262
3366
  } & {
3263
3367
  __v: number;
3264
3368
  }>>;
3369
+ export declare const CommunityListingModel: import("mongoose").Model<{
3370
+ kind: CommunityListingKind;
3371
+ slug: string;
3372
+ title: string;
3373
+ author: import("mongoose").Types.ObjectId;
3374
+ status: CommunityListingStatus;
3375
+ description?: string | null | undefined;
3376
+ tags?: string[] | null | undefined;
3377
+ stats?: {
3378
+ installs?: number | null | undefined;
3379
+ } | null | undefined;
3380
+ liveRef?: {
3381
+ categoryId: string;
3382
+ } | null | undefined;
3383
+ payload?: any;
3384
+ }, {}, {}, {}, import("mongoose").Document<unknown, {}, {
3385
+ kind: CommunityListingKind;
3386
+ slug: string;
3387
+ title: string;
3388
+ author: import("mongoose").Types.ObjectId;
3389
+ status: CommunityListingStatus;
3390
+ description?: string | null | undefined;
3391
+ tags?: string[] | null | undefined;
3392
+ stats?: {
3393
+ installs?: number | null | undefined;
3394
+ } | null | undefined;
3395
+ liveRef?: {
3396
+ categoryId: string;
3397
+ } | null | undefined;
3398
+ payload?: any;
3399
+ }, {}, import("mongoose").DefaultSchemaOptions> & {
3400
+ kind: CommunityListingKind;
3401
+ slug: string;
3402
+ title: string;
3403
+ author: import("mongoose").Types.ObjectId;
3404
+ status: CommunityListingStatus;
3405
+ description?: string | null | undefined;
3406
+ tags?: string[] | null | undefined;
3407
+ stats?: {
3408
+ installs?: number | null | undefined;
3409
+ } | null | undefined;
3410
+ liveRef?: {
3411
+ categoryId: string;
3412
+ } | null | undefined;
3413
+ payload?: any;
3414
+ } & {
3415
+ _id: import("mongoose").Types.ObjectId;
3416
+ } & {
3417
+ __v: number;
3418
+ }, Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
3419
+ kind: CommunityListingKind;
3420
+ slug: string;
3421
+ title: string;
3422
+ author: import("mongoose").Types.ObjectId;
3423
+ status: CommunityListingStatus;
3424
+ description?: string | null | undefined;
3425
+ tags?: string[] | null | undefined;
3426
+ stats?: {
3427
+ installs?: number | null | undefined;
3428
+ } | null | undefined;
3429
+ liveRef?: {
3430
+ categoryId: string;
3431
+ } | null | undefined;
3432
+ payload?: any;
3433
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
3434
+ kind: CommunityListingKind;
3435
+ slug: string;
3436
+ title: string;
3437
+ author: import("mongoose").Types.ObjectId;
3438
+ status: CommunityListingStatus;
3439
+ description?: string | null | undefined;
3440
+ tags?: string[] | null | undefined;
3441
+ stats?: {
3442
+ installs?: number | null | undefined;
3443
+ } | null | undefined;
3444
+ liveRef?: {
3445
+ categoryId: string;
3446
+ } | null | undefined;
3447
+ payload?: any;
3448
+ }>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<{
3449
+ kind: CommunityListingKind;
3450
+ slug: string;
3451
+ title: string;
3452
+ author: import("mongoose").Types.ObjectId;
3453
+ status: CommunityListingStatus;
3454
+ description?: string | null | undefined;
3455
+ tags?: string[] | null | undefined;
3456
+ stats?: {
3457
+ installs?: number | null | undefined;
3458
+ } | null | undefined;
3459
+ liveRef?: {
3460
+ categoryId: string;
3461
+ } | null | undefined;
3462
+ payload?: any;
3463
+ }> & {
3464
+ _id: import("mongoose").Types.ObjectId;
3465
+ } & {
3466
+ __v: number;
3467
+ }>>;
3265
3468
  export declare const PresetModel: import("mongoose").Model<{
3266
3469
  owner: import("mongoose").Types.ObjectId;
3267
3470
  name: string;
@@ -3471,6 +3674,7 @@ export interface IUserApplication {
3471
3674
  export interface IUser {
3472
3675
  token: string;
3473
3676
  username: string;
3677
+ avatar?: string;
3474
3678
  email: string;
3475
3679
  password: string;
3476
3680
  apiToken: string;