- added own provider for drive methods
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m13s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m13s
- renamed middleware Role and Can to role_middleware and can_middleware - added some typing for inertia vue3 components - npm updates
This commit is contained in:
parent
cb51a4136f
commit
296c8fd46e
67 changed files with 2515 additions and 1913 deletions
62
providers/drive/provider/drive_provider.ts
Normal file
62
providers/drive/provider/drive_provider.ts
Normal file
|
@ -0,0 +1,62 @@
|
|||
import type { ApplicationService } from '@adonisjs/core/types';
|
||||
import { RuntimeException } from '@poppinss/utils';
|
||||
// import DriveManager from '../src/drive_manager.js';
|
||||
import { DriveConfig } from '../src/types/drive.js';
|
||||
|
||||
|
||||
|
||||
export default class DriveProvider {
|
||||
constructor(protected app: ApplicationService) {}
|
||||
|
||||
/**
|
||||
* Register bindings to the container
|
||||
*/
|
||||
async register() {
|
||||
const { default: DriveManager } = await import('../src/drive_manager.js');
|
||||
this.app.container.singleton(DriveManager, async () => {
|
||||
// 1. import the oai configuration
|
||||
// const ttl: number = 86400;
|
||||
const config: DriveConfig = this.app.config.get('drive');
|
||||
// const config: DriveConfig | null = await configProvider.resolve(this.app, driveConfigProvider);
|
||||
// const vite = await this.app.container.make("vite");
|
||||
if (!config) {
|
||||
throw new RuntimeException('Invalid "config/drive.ts" file. Make sure you are using the "defineConfig" method');
|
||||
}
|
||||
|
||||
return new DriveManager(this.app, config);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register drive with the container
|
||||
*/
|
||||
// registerDrive() {
|
||||
// this.app.container.singleton('Adonis/Core/Drive', () => {
|
||||
// const { DriveManager } = require('../src/DriveManager');
|
||||
// const Router = this.app.container.resolveBinding('Adonis/Core/Route');
|
||||
// const Config = this.app.container.resolveBinding('Adonis/Core/Config');
|
||||
// const Logger = this.app.container.resolveBinding('Adonis/Core/Logger');
|
||||
// return new DriveManager(this.app, Router, Logger, Config.get('drive'));
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* The container bindings have booted
|
||||
*/
|
||||
async boot() {}
|
||||
|
||||
/**
|
||||
* The application has been booted
|
||||
*/
|
||||
async start() {}
|
||||
|
||||
/**
|
||||
* The process has been started
|
||||
*/
|
||||
async ready() {}
|
||||
|
||||
/**
|
||||
* Preparing to shutdown the app
|
||||
*/
|
||||
async shutdown() {}
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue