mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
Fixing errors
This commit is contained in:
@@ -20,11 +20,4 @@ REDIS_DB=
|
||||
REDIS_HOST=
|
||||
REDIS_PASSWORD=
|
||||
|
||||
SMTP_HOST=
|
||||
SMTP_PORT=
|
||||
SMTP_USERNAME=
|
||||
SMTP_PASSWORD=
|
||||
|
||||
MAILGUN_API_KEY=
|
||||
WAKATIME_API_KEY=
|
||||
GITHUB_TOKEN=
|
||||
|
||||
@@ -1 +1,267 @@
|
||||
{"dump:rcfile":{"settings":{},"commandPath":"@adonisjs/core/build/commands/DumpRc","commandName":"dump:rcfile","description":"Dump contents of .adonisrc.json file along with defaults","args":[],"flags":[]},"list:routes":{"settings":{"loadApp":true},"commandPath":"@adonisjs/core/build/commands/ListRoutes","commandName":"list:routes","description":"List application routes","args":[],"flags":[{"name":"json","propertyName":"json","type":"boolean","description":"Output as JSON"}]},"generate:key":{"settings":{},"commandPath":"@adonisjs/core/build/commands/GenerateKey","commandName":"generate:key","description":"Generate a new APP_KEY secret","args":[],"flags":[]},"repl":{"settings":{"loadApp":true,"environment":"repl","stayAlive":true},"commandPath":"@adonisjs/repl/build/commands/AdonisRepl","commandName":"repl","description":"Start a new REPL session","args":[],"flags":[]},"db:seed":{"settings":{"loadApp":true},"commandPath":"@adonisjs/lucid/build/commands/DbSeed","commandName":"db:seed","description":"Execute database seeder files","args":[],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Define a custom database connection for the seeders","alias":"c"},{"name":"interactive","propertyName":"interactive","type":"boolean","description":"Run seeders in interactive mode","alias":"i"},{"name":"files","propertyName":"files","type":"array","description":"Define a custom set of seeders files names to run","alias":"f"}]},"make:model":{"settings":{},"commandPath":"@adonisjs/lucid/build/commands/MakeModel","commandName":"make:model","description":"Make a new Lucid model","args":[{"type":"string","propertyName":"name","name":"name","required":true,"description":"Name of the model class"}],"flags":[{"name":"migration","propertyName":"migration","type":"boolean","alias":"m","description":"Generate the migration for the model"},{"name":"controller","propertyName":"controller","type":"boolean","alias":"c","description":"Generate the controller for the model"}]},"make:migration":{"settings":{"loadApp":true},"commandPath":"@adonisjs/lucid/build/commands/MakeMigration","commandName":"make:migration","description":"Make a new migration file","args":[{"type":"string","propertyName":"name","name":"name","required":true,"description":"Name of the migration file"}],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Define a custom database connection for the migration"},{"name":"folder","propertyName":"folder","type":"string","description":"Pre-select a migration directory"},{"name":"create","propertyName":"create","type":"string","description":"Define the table name for creating a new table"},{"name":"table","propertyName":"table","type":"string","description":"Define the table name for altering an existing table"}]},"make:seeder":{"settings":{},"commandPath":"@adonisjs/lucid/build/commands/MakeSeeder","commandName":"make:seeder","description":"Make a new Seeder file","args":[{"type":"string","propertyName":"name","name":"name","required":true,"description":"Name of the seeder class"}],"flags":[]},"migration:run":{"settings":{"loadApp":true},"commandPath":"@adonisjs/lucid/build/commands/Migration/Run","commandName":"migration:run","description":"Run pending migrations","args":[],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Define a custom database connection","alias":"c"},{"name":"force","propertyName":"force","type":"boolean","description":"Explicitly force to run migrations in production"},{"name":"dry-run","propertyName":"dryRun","type":"boolean","description":"Print SQL queries, instead of running the migrations"}]},"migration:rollback":{"settings":{"loadApp":true},"commandPath":"@adonisjs/lucid/build/commands/Migration/Rollback","commandName":"migration:rollback","description":"Rollback migrations to a given batch number","args":[],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Define a custom database connection","alias":"c"},{"name":"force","propertyName":"force","type":"boolean","description":"Explictly force to run migrations in production"},{"name":"dry-run","propertyName":"dryRun","type":"boolean","description":"Print SQL queries, instead of running the migrations"},{"name":"batch","propertyName":"batch","type":"number","description":"Define custom batch number for rollback. Use 0 to rollback to initial state"}]},"migration:status":{"settings":{"loadApp":true},"commandPath":"@adonisjs/lucid/build/commands/Migration/Status","commandName":"migration:status","description":"Check migrations current status.","args":[],"flags":[{"name":"connection","propertyName":"connection","type":"string","description":"Define a custom database connection","alias":"c"}]}}
|
||||
{
|
||||
"commands": {
|
||||
"dump:rcfile": {
|
||||
"settings": {},
|
||||
"commandPath": "@adonisjs/core/build/commands/DumpRc",
|
||||
"commandName": "dump:rcfile",
|
||||
"description": "Dump contents of .adonisrc.json file along with defaults",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": []
|
||||
},
|
||||
"list:routes": {
|
||||
"settings": {
|
||||
"loadApp": true
|
||||
},
|
||||
"commandPath": "@adonisjs/core/build/commands/ListRoutes",
|
||||
"commandName": "list:routes",
|
||||
"description": "List application routes",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": [
|
||||
{
|
||||
"name": "json",
|
||||
"propertyName": "json",
|
||||
"type": "boolean",
|
||||
"description": "Output as JSON"
|
||||
}
|
||||
]
|
||||
},
|
||||
"generate:key": {
|
||||
"settings": {},
|
||||
"commandPath": "@adonisjs/core/build/commands/GenerateKey",
|
||||
"commandName": "generate:key",
|
||||
"description": "Generate a new APP_KEY secret",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": []
|
||||
},
|
||||
"repl": {
|
||||
"settings": {
|
||||
"loadApp": true,
|
||||
"environment": "repl",
|
||||
"stayAlive": true
|
||||
},
|
||||
"commandPath": "@adonisjs/repl/build/commands/AdonisRepl",
|
||||
"commandName": "repl",
|
||||
"description": "Start a new REPL session",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": []
|
||||
},
|
||||
"db:seed": {
|
||||
"settings": {
|
||||
"loadApp": true
|
||||
},
|
||||
"commandPath": "@adonisjs/lucid/build/commands/DbSeed",
|
||||
"commandName": "db:seed",
|
||||
"description": "Execute database seeder files",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": [
|
||||
{
|
||||
"name": "connection",
|
||||
"propertyName": "connection",
|
||||
"type": "string",
|
||||
"description": "Define a custom database connection for the seeders",
|
||||
"alias": "c"
|
||||
},
|
||||
{
|
||||
"name": "interactive",
|
||||
"propertyName": "interactive",
|
||||
"type": "boolean",
|
||||
"description": "Run seeders in interactive mode",
|
||||
"alias": "i"
|
||||
},
|
||||
{
|
||||
"name": "files",
|
||||
"propertyName": "files",
|
||||
"type": "array",
|
||||
"description": "Define a custom set of seeders files names to run",
|
||||
"alias": "f"
|
||||
}
|
||||
]
|
||||
},
|
||||
"make:model": {
|
||||
"settings": {},
|
||||
"commandPath": "@adonisjs/lucid/build/commands/MakeModel",
|
||||
"commandName": "make:model",
|
||||
"description": "Make a new Lucid model",
|
||||
"args": [
|
||||
{
|
||||
"type": "string",
|
||||
"propertyName": "name",
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"description": "Name of the model class"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"flags": [
|
||||
{
|
||||
"name": "migration",
|
||||
"propertyName": "migration",
|
||||
"type": "boolean",
|
||||
"alias": "m",
|
||||
"description": "Generate the migration for the model"
|
||||
},
|
||||
{
|
||||
"name": "controller",
|
||||
"propertyName": "controller",
|
||||
"type": "boolean",
|
||||
"alias": "c",
|
||||
"description": "Generate the controller for the model"
|
||||
}
|
||||
]
|
||||
},
|
||||
"make:migration": {
|
||||
"settings": {
|
||||
"loadApp": true
|
||||
},
|
||||
"commandPath": "@adonisjs/lucid/build/commands/MakeMigration",
|
||||
"commandName": "make:migration",
|
||||
"description": "Make a new migration file",
|
||||
"args": [
|
||||
{
|
||||
"type": "string",
|
||||
"propertyName": "name",
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"description": "Name of the migration file"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"flags": [
|
||||
{
|
||||
"name": "connection",
|
||||
"propertyName": "connection",
|
||||
"type": "string",
|
||||
"description": "Define a custom database connection for the migration"
|
||||
},
|
||||
{
|
||||
"name": "folder",
|
||||
"propertyName": "folder",
|
||||
"type": "string",
|
||||
"description": "Pre-select a migration directory"
|
||||
},
|
||||
{
|
||||
"name": "create",
|
||||
"propertyName": "create",
|
||||
"type": "string",
|
||||
"description": "Define the table name for creating a new table"
|
||||
},
|
||||
{
|
||||
"name": "table",
|
||||
"propertyName": "table",
|
||||
"type": "string",
|
||||
"description": "Define the table name for altering an existing table"
|
||||
}
|
||||
]
|
||||
},
|
||||
"make:seeder": {
|
||||
"settings": {},
|
||||
"commandPath": "@adonisjs/lucid/build/commands/MakeSeeder",
|
||||
"commandName": "make:seeder",
|
||||
"description": "Make a new Seeder file",
|
||||
"args": [
|
||||
{
|
||||
"type": "string",
|
||||
"propertyName": "name",
|
||||
"name": "name",
|
||||
"required": true,
|
||||
"description": "Name of the seeder class"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"flags": []
|
||||
},
|
||||
"migration:run": {
|
||||
"settings": {
|
||||
"loadApp": true
|
||||
},
|
||||
"commandPath": "@adonisjs/lucid/build/commands/Migration/Run",
|
||||
"commandName": "migration:run",
|
||||
"description": "Run pending migrations",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": [
|
||||
{
|
||||
"name": "connection",
|
||||
"propertyName": "connection",
|
||||
"type": "string",
|
||||
"description": "Define a custom database connection",
|
||||
"alias": "c"
|
||||
},
|
||||
{
|
||||
"name": "force",
|
||||
"propertyName": "force",
|
||||
"type": "boolean",
|
||||
"description": "Explicitly force to run migrations in production"
|
||||
},
|
||||
{
|
||||
"name": "dry-run",
|
||||
"propertyName": "dryRun",
|
||||
"type": "boolean",
|
||||
"description": "Print SQL queries, instead of running the migrations"
|
||||
}
|
||||
]
|
||||
},
|
||||
"migration:rollback": {
|
||||
"settings": {
|
||||
"loadApp": true
|
||||
},
|
||||
"commandPath": "@adonisjs/lucid/build/commands/Migration/Rollback",
|
||||
"commandName": "migration:rollback",
|
||||
"description": "Rollback migrations to a given batch number",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": [
|
||||
{
|
||||
"name": "connection",
|
||||
"propertyName": "connection",
|
||||
"type": "string",
|
||||
"description": "Define a custom database connection",
|
||||
"alias": "c"
|
||||
},
|
||||
{
|
||||
"name": "force",
|
||||
"propertyName": "force",
|
||||
"type": "boolean",
|
||||
"description": "Explictly force to run migrations in production"
|
||||
},
|
||||
{
|
||||
"name": "dry-run",
|
||||
"propertyName": "dryRun",
|
||||
"type": "boolean",
|
||||
"description": "Print SQL queries, instead of running the migrations"
|
||||
},
|
||||
{
|
||||
"name": "batch",
|
||||
"propertyName": "batch",
|
||||
"type": "number",
|
||||
"description": "Define custom batch number for rollback. Use 0 to rollback to initial state"
|
||||
}
|
||||
]
|
||||
},
|
||||
"migration:status": {
|
||||
"settings": {
|
||||
"loadApp": true
|
||||
},
|
||||
"commandPath": "@adonisjs/lucid/build/commands/Migration/Status",
|
||||
"commandName": "migration:status",
|
||||
"description": "Check migrations current status.",
|
||||
"args": [],
|
||||
"aliases": [],
|
||||
"flags": [
|
||||
{
|
||||
"name": "connection",
|
||||
"propertyName": "connection",
|
||||
"type": "string",
|
||||
"description": "Define a custom database connection",
|
||||
"alias": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"aliases": {}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ export const http: ServerConfig = {
|
||||
| to set the header explicitly.
|
||||
|
|
||||
*/
|
||||
forceContentNegotiationToJSON: true,
|
||||
forceContentNegotiationTo: 'true',
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
*/
|
||||
|
||||
import Env from '@ioc:Adonis/Core/Env'
|
||||
import { OrmConfig } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { DatabaseConfig } from '@ioc:Adonis/Lucid/Database'
|
||||
|
||||
const databaseConfig: DatabaseConfig & { orm: Partial<OrmConfig> } = {
|
||||
const databaseConfig: DatabaseConfig = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Connection
|
||||
@@ -42,28 +41,15 @@ const databaseConfig: DatabaseConfig & { orm: Partial<OrmConfig> } = {
|
||||
user: Env.get('MYSQL_USER'),
|
||||
password: Env.get('MYSQL_PASSWORD', ''),
|
||||
database: Env.get('MYSQL_DB_NAME'),
|
||||
charset: 'utf8mb4'
|
||||
},
|
||||
healthCheck: true,
|
||||
debug: false,
|
||||
migrations: {
|
||||
naturalSort: true,
|
||||
},
|
||||
healthCheck: false,
|
||||
debug: false,
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| ORM Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Following are some of the configuration options to tweak the conventional
|
||||
| settings of the ORM. For example:
|
||||
|
|
||||
| - Define a custom function to compute the default table name for a given model.
|
||||
| - Or define a custom function to compute the primary key for a given model.
|
||||
|
|
||||
*/
|
||||
orm: {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default databaseConfig
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/**
|
||||
* Config source: https://git.io/JvgAf
|
||||
*
|
||||
* Feel free to let us know via PR, if you find something broken in this contract
|
||||
* file.
|
||||
*/
|
||||
|
||||
import Env from '@ioc:Adonis/Core/Env'
|
||||
import { MailConfig } from '@ioc:Adonis/Addons/Mail'
|
||||
|
||||
const mailConfig: MailConfig = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default mailer
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following mailer will be used to send emails, when you don't specify
|
||||
| a mailer
|
||||
|
|
||||
*/
|
||||
mailer: 'smtp',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mailers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You can define or more mailers to send emails from your application. A
|
||||
| single `driver` can be used to define multiple mailers with different
|
||||
| config.
|
||||
|
|
||||
| For example: Postmark driver can be used to have different mailers for
|
||||
| sending transactional and promotional emails
|
||||
|
|
||||
*/
|
||||
mailers: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Smtp
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Uses SMTP protocol for sending email
|
||||
|
|
||||
*/
|
||||
smtp: {
|
||||
driver: 'smtp',
|
||||
host: Env.get('SMTP_HOST'),
|
||||
port: Env.get('SMTP_PORT'),
|
||||
auth: {
|
||||
user: Env.get('SMTP_USERNAME'),
|
||||
pass: Env.get('SMTP_PASSWORD'),
|
||||
type: 'login',
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mailgun
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Uses Mailgun service for sending emails.
|
||||
|
|
||||
*/
|
||||
mailgun: {
|
||||
driver: 'mailgun',
|
||||
baseUrl: 'https://api.mailgun.net/v3',
|
||||
key: Env.get('MAILGUN_API_KEY'),
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
export default mailConfig
|
||||
@@ -9,6 +9,8 @@ import Env from '@ioc:Adonis/Core/Env'
|
||||
import { SessionConfig } from '@ioc:Adonis/Addons/Session'
|
||||
|
||||
const sessionConfig: SessionConfig = {
|
||||
|
||||
enabled: true,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Driver
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* Contract source: https://git.io/JvgAT
|
||||
*
|
||||
* Feel free to let us know via PR, if you find something broken in this contract
|
||||
* file.
|
||||
*/
|
||||
|
||||
declare module '@ioc:Adonis/Addons/Mail' {
|
||||
import { MailDrivers } from '@ioc:Adonis/Addons/Mail'
|
||||
|
||||
interface MailersList {
|
||||
smtp: MailDrivers['smtp'],
|
||||
mailgun: MailDrivers['mailgun'],
|
||||
}
|
||||
}
|
||||
14
env.ts
14
env.ts
@@ -30,6 +30,7 @@ export default Env.rules({
|
||||
REDIS_PASSWORD: Env.schema.string.optional(),
|
||||
|
||||
//Mysql
|
||||
DB_CONNECTION: Env.schema.string(),
|
||||
MYSQL_HOST: Env.schema.string({ format: 'host' }),
|
||||
MYSQL_PORT: Env.schema.number(),
|
||||
MYSQL_USER: Env.schema.string(),
|
||||
@@ -37,16 +38,5 @@ export default Env.rules({
|
||||
MYSQL_DB_NAME: Env.schema.string(),
|
||||
|
||||
//Session
|
||||
SESSION_DRIVER: Env.schema.string(),
|
||||
|
||||
//SMTP
|
||||
SMTP_HOST: Env.schema.string({ format: 'host' }),
|
||||
SMTP_PORT: Env.schema.number(),
|
||||
SMTP_USERNAME: Env.schema.string(),
|
||||
SMTP_PASSWORD: Env.schema.string(),
|
||||
|
||||
//Mailgun
|
||||
MAILGUN_API_KEY: Env.schema.string(),
|
||||
|
||||
WAKATIME_API_KEY: Env.schema.string(),
|
||||
SESSION_DRIVER: Env.schema.string()
|
||||
})
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
"@adonisjs/auth": "^7.0.0",
|
||||
"@adonisjs/core": "^5.1.4",
|
||||
"@adonisjs/lucid": "^12.0.0",
|
||||
"@adonisjs/mail": "^7.0.0",
|
||||
"@adonisjs/redis": "^7.0.0",
|
||||
"@adonisjs/repl": "^3.0.0",
|
||||
"@adonisjs/session": "^6.0.1",
|
||||
|
||||
Reference in New Issue
Block a user