- update to AdonisJS 6

This commit is contained in:
Kaimbacher 2024-03-14 20:25:27 +01:00
parent f828ca4491
commit cb51a4136f
167 changed files with 21485 additions and 21212 deletions

View file

@ -1,73 +1,63 @@
/**
* Contract source: https://git.io/JOdz5
*
* Feel free to let us know via PR, if you find something broken in this
* file.
*/
// /**
// * Contract source: https://git.io/JOdz5
// *
// * Feel free to let us know via PR, if you find something broken in this
// * file.
// */
import User from 'App/Models/User';
// import User from '#app/Models/User';
declare module '@ioc:Adonis/Addons/Auth' {
/*
|--------------------------------------------------------------------------
| Providers
|--------------------------------------------------------------------------
|
| The providers are used to fetch users. The Auth module comes pre-bundled
| with two providers that are `Lucid` and `Database`. Both uses database
| to fetch user details.
|
| You can also create and register your own custom providers.
|
*/
interface ProvidersList {
/*
|--------------------------------------------------------------------------
| User Provider
|--------------------------------------------------------------------------
|
| The following provider uses Lucid models as a driver for fetching user
| details from the database for authentication.
|
| You can create multiple providers using the same underlying driver with
| different Lucid models.
|
*/
user: {
implementation: LucidProviderContract<typeof User>;
config: LucidProviderConfig<typeof User>;
};
}
// declare module '@ioc:Adonis/Addons/Auth' {
// /*
// |
// interface ProvidersList {
// /*
// |--------------------------------------------------------------------------
// | User Provider
// |--------------------------------------------------------------------------
// |
// | The following provider uses Lucid models as a driver for fetching user
// | details from the database for authentication.
// |
// | You can create multiple providers using the same underlying driver with
// | different Lucid models.
// |
// */
// user: {
// implementation: LucidProviderContract<typeof User>;
// config: LucidProviderConfig<typeof User>;
// };
// }
/*
|--------------------------------------------------------------------------
| Guards
|--------------------------------------------------------------------------
|
| The guards are used for authenticating users using different drivers.
| The auth module comes with 3 different guards.
|
| - SessionGuardContract
| - BasicAuthGuardContract
| - OATGuardContract ( Opaque access token )
|
| Every guard needs a provider for looking up users from the database.
|
*/
interface GuardsList {
/*
|--------------------------------------------------------------------------
| Web Guard
|--------------------------------------------------------------------------
|
| The web guard uses sessions for maintaining user login state. It uses
| the `user` provider for fetching user details.
|
*/
web: {
implementation: SessionGuardContract<'user', 'web'>;
config: SessionGuardConfig<'user'>;
client: SessionClientContract<'user'>;
};
}
}
// /*
// |--------------------------------------------------------------------------
// | Guards
// |--------------------------------------------------------------------------
// |
// | The guards are used for authenticating users using different drivers.
// | The auth module comes with 3 different guards.
// |
// | - SessionGuardContract
// | - BasicAuthGuardContract
// | - OATGuardContract ( Opaque access token )
// |
// | Every guard needs a provider for looking up users from the database.
// |
// */
// interface GuardsList {
// /*
// |--------------------------------------------------------------------------
// | Web Guard
// |--------------------------------------------------------------------------
// |
// | The web guard uses sessions for maintaining user login state. It uses
// | the `user` provider for fetching user details.
// |
// */
// web: {
// implementation: SessionGuardContract<'user', 'web'>;
// config: SessionGuardConfig<'user'>;
// client: SessionClientContract<'user'>;
// };
// }
// }

View file

@ -5,9 +5,9 @@
* file.
*/
import type { InferDisksFromConfig } from '@adonisjs/core/build/config';
import type driveConfig from '../config/drive';
// import type { InferDisksFromConfig } from '@adonisjs/core/build/config';
// import type driveConfig from '../config/drive.js';
declare module '@ioc:Adonis/Core/Drive' {
interface DisksList extends InferDisksFromConfig<typeof driveConfig> {}
}
// declare module '@ioc:Adonis/Core/Drive' {
// interface DisksList extends InferDisksFromConfig<typeof driveConfig> {}
// }

View file

@ -1,23 +0,0 @@
/**
* Contract source: https://git.io/JTm6U
*
* Feel free to let us know via PR, if you find something broken in this contract
* file.
*/
declare module '@ioc:Adonis/Core/Env' {
/*
|--------------------------------------------------------------------------
| Getting types for validated environment variables
|--------------------------------------------------------------------------
|
| The `default` export from the "../env.ts" file exports types for the
| validated environment variables. Here we merge them with the `EnvTypes`
| interface so that you can enjoy intellisense when using the "Env"
| module.
|
*/
type CustomTypes = typeof import('../env').default;
interface EnvTypes extends CustomTypes {}
}

View file

@ -1,31 +0,0 @@
/**
* Contract source: https://git.io/JfefG
*
* Feel free to let us know via PR, if you find something broken in this contract
* file.
*/
declare module '@ioc:Adonis/Core/Event' {
/*
|--------------------------------------------------------------------------
| Define typed events
|--------------------------------------------------------------------------
|
| You can define types for events inside the following interface and
| AdonisJS will make sure that all listeners and emit calls adheres
| to the defined types.
|
| For example:
|
| interface EventsList {
| 'new:user': UserModel
| }
|
| Now calling `Event.emit('new:user')` will statically ensure that passed value is
| an instance of the the UserModel only.
|
*/
interface EventsList {
//
}
}

View file

@ -1,13 +0,0 @@
/**
* Contract source: https://git.io/Jfefs
*
* Feel free to let us know via PR, if you find something broken in this contract
* file.
*/
import type { InferListFromConfig } from '@adonisjs/core/build/config';
import type hashConfig from '../config/hash';
declare module '@ioc:Adonis/Core/Hash' {
interface HashersList extends InferListFromConfig<typeof hashConfig> {}
}

View file

@ -1,5 +0,0 @@
declare module '@ioc:Adonis/Lucid/Orm' {
interface ModelQueryBuilderContract<Model extends LucidModel, Result = InstanceType<Model>> {
pluck(value: string, id?: string): Promise<Object>;
}
}

View file

@ -1,13 +0,0 @@
/**
* Contract source: https://git.io/JemcN
*
* Feel free to let us know via PR, if you find something broken in this config
* file.
*/
import { InferConnectionsFromConfig } from '@adonisjs/redis/build/config'
import redisConfig from '../config/redis'
declare module '@ioc:Adonis/Addons/Redis' {
interface RedisConnectionsList extends InferConnectionsFromConfig<typeof redisConfig> {}
}

View file

@ -1,7 +0,0 @@
declare module '@ioc:Adonis/Core/Response' {
interface ResponseContract {
flash(key: string, message: any): this;
toRoute(route: string): this;
}
}

View file

@ -1,6 +0,0 @@
declare module '@ioc:Adonis/Core/Validator' {
interface Rules {
translatedLanguage(mainLanguageField: string, typeField: string): Rule;
uniqueArray(field: string): Rule;
}
}