@adonisjs/core 6.1.5-26 → 6.1.5-28
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/build/commands/configure.js +1 -0
- package/build/factories/core/ace.d.ts +1 -1
- package/build/factories/core/ignitor.d.ts +1 -1
- package/build/factories/core/ignitor.js +2 -4
- package/build/factories/core/main.d.ts +0 -1
- package/build/factories/core/main.js +0 -1
- package/build/factories/core/test_utils.d.ts +1 -1
- package/build/factories/stubs.d.ts +2 -2
- package/build/index.d.ts +10 -139
- package/build/index.js +4 -0
- package/build/modules/ace/codemods.d.ts +11 -6
- package/build/modules/ace/shell.d.ts +1 -1
- package/build/modules/env/editor.d.ts +1 -0
- package/build/modules/env/editor.js +9 -0
- package/build/modules/hash/define_config.d.ts +29 -13
- package/build/modules/hash/define_config.js +49 -14
- package/build/modules/hash/main.d.ts +1 -2
- package/build/modules/hash/main.js +1 -2
- package/build/modules/hash/phc_formatter.d.ts +1 -0
- package/build/modules/hash/phc_formatter.js +9 -0
- package/build/modules/http/main.js +1 -0
- package/build/modules/http/request_validator.js +2 -2
- package/build/providers/app_provider.d.ts +14 -0
- package/build/providers/app_provider.js +42 -0
- package/build/providers/edge_provider.d.ts +1 -1
- package/build/providers/hash_provider.d.ts +1 -9
- package/build/providers/hash_provider.js +11 -28
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/src/config_provider.d.ts +9 -0
- package/build/src/config_provider.js +26 -0
- package/build/src/debug.d.ts +1 -1
- package/build/src/ignitor/http.d.ts +2 -2
- package/build/src/ignitor/main.d.ts +1 -1
- package/build/src/test_utils/http.d.ts +2 -2
- package/build/src/test_utils/main.d.ts +3 -3
- package/build/src/types.d.ts +12 -14
- package/build/stubs/make/command/main.stub +6 -4
- package/build/stubs/make/controller/api.stub +6 -4
- package/build/stubs/make/controller/main.stub +6 -4
- package/build/stubs/make/controller/resource.stub +6 -4
- package/build/stubs/make/event/main.stub +5 -3
- package/build/stubs/make/exception/main.stub +5 -3
- package/build/stubs/make/listener/for_event.stub +6 -4
- package/build/stubs/make/listener/main.stub +5 -3
- package/build/stubs/make/middleware/main.stub +7 -5
- package/build/stubs/make/preload_file/main.stub +5 -3
- package/build/stubs/make/provider/main.stub +6 -4
- package/build/stubs/make/service/main.stub +5 -3
- package/build/stubs/make/test/main.stub +5 -3
- package/build/stubs/make/validator/main.stub +5 -3
- package/build/stubs/make/view/main.stub +5 -3
- package/package.json +36 -34
- package/build/modules/hash/drivers_collection.d.ts +0 -21
- package/build/modules/hash/drivers_collection.js +0 -45
- package/build/providers/http_provider.d.ts +0 -26
- package/build/providers/http_provider.js +0 -61
- /package/build/modules/{env.d.ts → env/main.d.ts} +0 -0
- /package/build/modules/{env.js → env/main.js} +0 -0
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { RuntimeException } from '@poppinss/utils';
|
|
10
|
+
import { Hash } from '../modules/hash/main.js';
|
|
11
|
+
import { configProvider } from '../src/config_provider.js';
|
|
10
12
|
/**
|
|
11
13
|
* Registers the passwords hasher with the container
|
|
12
14
|
*/
|
|
@@ -15,23 +17,6 @@ export default class HashServiceProvider {
|
|
|
15
17
|
constructor(app) {
|
|
16
18
|
this.app = app;
|
|
17
19
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Lazily registers a hash driver with the driversList collection
|
|
20
|
-
*/
|
|
21
|
-
async registerHashDrivers(driversInUse) {
|
|
22
|
-
if (driversInUse.has('bcrypt')) {
|
|
23
|
-
const { Bcrypt } = await import('../modules/hash/drivers/bcrypt.js');
|
|
24
|
-
driversList.extend('bcrypt', (config) => new Bcrypt(config));
|
|
25
|
-
}
|
|
26
|
-
if (driversInUse.has('scrypt')) {
|
|
27
|
-
const { Scrypt } = await import('../modules/hash/drivers/scrypt.js');
|
|
28
|
-
driversList.extend('scrypt', (config) => new Scrypt(config));
|
|
29
|
-
}
|
|
30
|
-
if (driversInUse.has('argon2')) {
|
|
31
|
-
const { Argon } = await import('../modules/hash/drivers/argon.js');
|
|
32
|
-
driversList.extend('argon2', (config) => new Argon(config));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
20
|
/**
|
|
36
21
|
* Registering the hash class to resolve an instance with the
|
|
37
22
|
* default hasher.
|
|
@@ -47,7 +32,14 @@ export default class HashServiceProvider {
|
|
|
47
32
|
*/
|
|
48
33
|
registerHashManager() {
|
|
49
34
|
this.app.container.singleton('hash', async () => {
|
|
50
|
-
const
|
|
35
|
+
const hashConfigProvider = this.app.config.get('hash');
|
|
36
|
+
/**
|
|
37
|
+
* Resolve config from the provider
|
|
38
|
+
*/
|
|
39
|
+
const config = await configProvider.resolve(this.app, hashConfigProvider);
|
|
40
|
+
if (!config) {
|
|
41
|
+
throw new RuntimeException('Invalid "config/hash.ts" file. Make sure you are using the "defineConfig" method');
|
|
42
|
+
}
|
|
51
43
|
const { HashManager } = await import('../modules/hash/main.js');
|
|
52
44
|
return new HashManager(config);
|
|
53
45
|
});
|
|
@@ -59,13 +51,4 @@ export default class HashServiceProvider {
|
|
|
59
51
|
this.registerHashManager();
|
|
60
52
|
this.registerHash();
|
|
61
53
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Register drivers based upon hash config
|
|
64
|
-
*/
|
|
65
|
-
boot() {
|
|
66
|
-
this.app.container.resolving('hash', async () => {
|
|
67
|
-
const config = this.app.config.get('hash');
|
|
68
|
-
await this.registerHashDrivers(config.driversInUse);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
54
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApplicationService, ConfigProvider } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Helper to create config provider and resolve config from
|
|
4
|
+
* them
|
|
5
|
+
*/
|
|
6
|
+
export declare const configProvider: {
|
|
7
|
+
create<T>(resolver: (app: ApplicationService) => Promise<T>): ConfigProvider<T>;
|
|
8
|
+
resolve<T_1>(app: ApplicationService, provider: unknown): Promise<T_1 | null>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/core
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Helper to create config provider and resolve config from
|
|
11
|
+
* them
|
|
12
|
+
*/
|
|
13
|
+
export const configProvider = {
|
|
14
|
+
create(resolver) {
|
|
15
|
+
return {
|
|
16
|
+
type: 'provider',
|
|
17
|
+
resolver,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
async resolve(app, provider) {
|
|
21
|
+
if (provider && typeof provider === 'object' && 'type' in provider) {
|
|
22
|
+
return provider.resolver(app);
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
},
|
|
26
|
+
};
|
package/build/src/debug.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="
|
|
2
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
import type { Server as NodeHttpsServer } from 'node:https';
|
|
4
4
|
import { IncomingMessage, ServerResponse, Server as NodeHttpServer } from 'node:http';
|
|
5
5
|
import { Ignitor } from './main.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="
|
|
2
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
import type { TestUtils } from './main.js';
|
|
4
4
|
import type { Server as NodeHttpsServer } from 'node:https';
|
|
5
5
|
import { IncomingMessage, ServerResponse, Server as NodeHttpServer } from 'node:http';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import Macroable from '@poppinss/macroable';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
4
4
|
import { HttpServerUtils } from './http.js';
|
|
5
|
-
import { CookieClient } from '../../modules/http/main.js';
|
|
6
5
|
import type { ApplicationService } from '../types.js';
|
|
6
|
+
import { CookieClient, type HttpContext } from '../../modules/http/main.js';
|
|
7
7
|
/**
|
|
8
8
|
* Test utils has a collection of helper methods to make testing
|
|
9
9
|
* experience great for AdonisJS applications
|
|
@@ -33,5 +33,5 @@ export declare class TestUtils extends Macroable {
|
|
|
33
33
|
createHttpContext(options?: {
|
|
34
34
|
req?: IncomingMessage;
|
|
35
35
|
res?: ServerResponse;
|
|
36
|
-
}): Promise<
|
|
36
|
+
}): Promise<HttpContext>;
|
|
37
37
|
}
|
package/build/src/types.d.ts
CHANGED
|
@@ -7,14 +7,20 @@ import type { TestUtils } from './test_utils/main.js';
|
|
|
7
7
|
import type { LoggerManager } from '../modules/logger.js';
|
|
8
8
|
import type { HashManager } from '../modules/hash/main.js';
|
|
9
9
|
import type { Encryption } from '../modules/encryption.js';
|
|
10
|
+
import type { ManagerDriverFactory } from '../types/hash.js';
|
|
10
11
|
import type { Router, Server } from '../modules/http/main.js';
|
|
11
12
|
import type { HttpRequestFinishedPayload } from '../types/http.js';
|
|
12
13
|
import type { ContainerResolveEventData } from '../types/container.js';
|
|
13
14
|
import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.js';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* A config provider waits for the application to get booted
|
|
17
|
+
* and then resolves the config. It receives an instance
|
|
18
|
+
* of the application service.
|
|
19
|
+
*/
|
|
20
|
+
export type ConfigProvider<T> = {
|
|
21
|
+
type: 'provider';
|
|
22
|
+
resolver: (app: ApplicationService) => Promise<T>;
|
|
23
|
+
};
|
|
18
24
|
/**
|
|
19
25
|
* Options accepted by ignitor
|
|
20
26
|
*/
|
|
@@ -41,22 +47,14 @@ export interface EventsList {
|
|
|
41
47
|
export interface LoggersList {
|
|
42
48
|
}
|
|
43
49
|
export type InferLoggers<T extends LoggerManagerConfig<any>> = T['loggers'];
|
|
44
|
-
/**
|
|
45
|
-
* A list of globally available hash drivers
|
|
46
|
-
*/
|
|
47
|
-
export interface HashDriversList {
|
|
48
|
-
bcrypt: (config: BcryptConfig) => Bcrypt;
|
|
49
|
-
argon2: (config: ArgonConfig) => Argon;
|
|
50
|
-
scrypt: (config: ScryptConfig) => Scrypt;
|
|
51
|
-
}
|
|
52
50
|
/**
|
|
53
51
|
* A list of known hashers inferred from the user config
|
|
54
52
|
*/
|
|
55
53
|
export interface HashersList {
|
|
56
54
|
}
|
|
57
|
-
export type InferHashers<T extends {
|
|
55
|
+
export type InferHashers<T extends ConfigProvider<{
|
|
58
56
|
list: Record<string, ManagerDriverFactory>;
|
|
59
|
-
}
|
|
57
|
+
}>> = Awaited<ReturnType<T['resolver']>>['list'];
|
|
60
58
|
/**
|
|
61
59
|
* ----------------------------------------------------------------
|
|
62
60
|
* Container services
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{{#var commandName = generators.commandName(entity.name)}}
|
|
2
2
|
{{#var commandTerminalName = generators.commandTerminalName(entity.name)}}
|
|
3
3
|
{{#var commandFileName = generators.commandFileName(entity.name)}}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
{{{
|
|
5
|
+
exports({
|
|
6
|
+
to: app.commandsPath(entity.path, commandFileName)
|
|
7
|
+
})
|
|
8
|
+
}}}
|
|
7
9
|
import { BaseCommand } from '@adonisjs/core/ace'
|
|
8
|
-
import { CommandOptions } from '@adonisjs/core/types/ace'
|
|
10
|
+
import type { CommandOptions } from '@adonisjs/core/types/ace'
|
|
9
11
|
|
|
10
12
|
export default class {{ commandName }} extends BaseCommand {
|
|
11
13
|
static commandName = '{{ commandTerminalName }}'
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{{#var controllerName = generators.controllerName(entity.name)}}
|
|
2
2
|
{{#var controllerFileName = generators.controllerFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.httpControllersPath(entity.path, controllerFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
8
|
+
import type { HttpContext } from '@adonisjs/core/http'
|
|
7
9
|
|
|
8
10
|
export default class {{ controllerName }} {
|
|
9
11
|
/**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{{#var controllerName = generators.controllerName(entity.name)}}
|
|
2
2
|
{{#var controllerFileName = generators.controllerFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.httpControllersPath(entity.path, controllerFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
8
|
+
// import type { HttpContext } from '@adonisjs/core/http'
|
|
7
9
|
|
|
8
10
|
export default class {{ controllerName }} {
|
|
9
11
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{{#var controllerName = generators.controllerName(entity.name)}}
|
|
2
2
|
{{#var controllerFileName = generators.controllerFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.httpControllersPath(entity.path, controllerFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
8
|
+
import type { HttpContext } from '@adonisjs/core/http'
|
|
7
9
|
|
|
8
10
|
export default class {{ controllerName }} {
|
|
9
11
|
/**
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{{#var eventName = generators.eventName(entity.name)}}
|
|
2
2
|
{{#var eventFileName = generators.eventFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.eventsPath(entity.path, eventFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
6
8
|
import { BaseEvent } from '@adonisjs/core/events'
|
|
7
9
|
|
|
8
10
|
export default class {{ eventName }} extends BaseEvent {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{{#var exceptionName = generators.exceptionName(entity.name)}}
|
|
2
2
|
{{#var exceptionFileName = generators.exceptionFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.exceptionsPath(entity.path, exceptionFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
6
8
|
import { Exception } from '@adonisjs/core/exceptions'
|
|
7
9
|
|
|
8
10
|
export default class {{ exceptionName }} extends Exception {
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
{{#var eventName = generators.eventName(event.name)}}
|
|
4
4
|
{{#var eventFileName = generators.eventFileName(event.name)}}
|
|
5
5
|
{{#var eventImportPath = generators.importPath('#events', event.path, eventFileName)}}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
{{{
|
|
7
|
+
exports({
|
|
8
|
+
to: app.listenersPath(entity.path, listenerFileName)
|
|
9
|
+
})
|
|
10
|
+
}}}
|
|
11
|
+
import type {{ eventName }} from '{{ eventImportPath }}'
|
|
10
12
|
|
|
11
13
|
export default class {{ listenerName }} {
|
|
12
14
|
async handle(event: {{ eventName }}) {}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{{#var listenerName = generators.listenerName(entity.name)}}
|
|
2
2
|
{{#var listenerFileName = generators.listenerFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.listenersPath(entity.path, listenerFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
6
8
|
export default class {{ listenerName }} {
|
|
7
9
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{{#var middlewareName = generators.middlewareName(entity.name)}}
|
|
2
2
|
{{#var middlewareFileName = generators.middlewareFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.middlewarePath(entity.path, middlewareFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
8
|
+
import type { HttpContext } from '@adonisjs/core/http'
|
|
9
|
+
import type { NextFn } from '@adonisjs/core/types/http'
|
|
8
10
|
|
|
9
11
|
export default class {{ middlewareName }} {
|
|
10
12
|
async handle(ctx: HttpContext, next: NextFn) {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{{#var providerName = generators.providerName(entity.name)}}
|
|
2
2
|
{{#var providerFileName = generators.providerFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.providersPath(entity.path, providerFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
8
|
+
import type { ApplicationService } from '@adonisjs/core/types'
|
|
7
9
|
|
|
8
10
|
export default class {{ providerName }} {
|
|
9
11
|
constructor(protected app: ApplicationService) {}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{{#var testGroupName = generators.testGroupName(entity)}}
|
|
2
2
|
{{#var testFileName = generators.testFileName(entity.name)}}
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
{{{
|
|
4
|
+
exports({
|
|
5
|
+
to: app.makePath(suite.directory, entity.path, testFileName)
|
|
6
|
+
})
|
|
7
|
+
}}}
|
|
6
8
|
import { test } from '@japa/runner'
|
|
7
9
|
|
|
8
10
|
test.group('{{ testGroupName }}', () => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
{{#var validatorFileName = generators.validatorFileName(entity.name)}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
{{{
|
|
3
|
+
exports({
|
|
4
|
+
to: app.validatorsPath(entity.path, validatorFileName)
|
|
5
|
+
})
|
|
6
|
+
}}}
|
|
5
7
|
import vine from '@vinejs/vine'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/core",
|
|
3
3
|
"description": "Core of AdonisJS",
|
|
4
|
-
"version": "6.1.5-
|
|
4
|
+
"version": "6.1.5-28",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"./bodyparser": "./build/modules/bodyparser/main.js",
|
|
41
41
|
"./bodyparser_middleware": "./build/modules/bodyparser/bodyparser_middleware.js",
|
|
42
42
|
"./hash": "./build/modules/hash/main.js",
|
|
43
|
+
"./hash/phc_formatter": "./build/modules/hash/phc_formatter.js",
|
|
43
44
|
"./hash/drivers/argon": "./build/modules/hash/drivers/argon.js",
|
|
44
45
|
"./hash/drivers/bcrypt": "./build/modules/hash/drivers/bcrypt.js",
|
|
45
46
|
"./hash/drivers/scrypt": "./build/modules/hash/drivers/scrypt.js",
|
|
@@ -47,7 +48,8 @@
|
|
|
47
48
|
"./config": "./build/modules/config.js",
|
|
48
49
|
"./container": "./build/modules/container.js",
|
|
49
50
|
"./encryption": "./build/modules/encryption.js",
|
|
50
|
-
"./env": "./build/modules/env.js",
|
|
51
|
+
"./env": "./build/modules/env/main.js",
|
|
52
|
+
"./env/editor": "./build/modules/env/editor.js",
|
|
51
53
|
"./events": "./build/modules/events.js",
|
|
52
54
|
"./http": "./build/modules/http/main.js",
|
|
53
55
|
"./logger": "./build/modules/logger.js",
|
|
@@ -75,21 +77,21 @@
|
|
|
75
77
|
"index:commands": "node --loader=ts-node/esm toolkit/main.js index build/commands"
|
|
76
78
|
},
|
|
77
79
|
"devDependencies": {
|
|
78
|
-
"@adonisjs/assembler": "^6.1.3-
|
|
80
|
+
"@adonisjs/assembler": "^6.1.3-25",
|
|
79
81
|
"@adonisjs/eslint-config": "^1.1.8",
|
|
80
82
|
"@adonisjs/prettier-config": "^1.1.8",
|
|
81
83
|
"@adonisjs/tsconfig": "^1.1.8",
|
|
82
|
-
"@commitlint/cli": "^17.
|
|
83
|
-
"@commitlint/config-conventional": "^17.
|
|
84
|
-
"@japa/assert": "2.0.0
|
|
85
|
-
"@japa/expect-type": "2.0.0
|
|
86
|
-
"@japa/file-system": "2.0.0
|
|
87
|
-
"@japa/runner": "^3.0.
|
|
88
|
-
"@swc/core": "
|
|
89
|
-
"@types/node": "^20.
|
|
84
|
+
"@commitlint/cli": "^17.8.0",
|
|
85
|
+
"@commitlint/config-conventional": "^17.8.0",
|
|
86
|
+
"@japa/assert": "^2.0.0",
|
|
87
|
+
"@japa/expect-type": "^2.0.0",
|
|
88
|
+
"@japa/file-system": "^2.0.0",
|
|
89
|
+
"@japa/runner": "^3.0.2",
|
|
90
|
+
"@swc/core": "1.3.82",
|
|
91
|
+
"@types/node": "^20.8.6",
|
|
90
92
|
"@types/pretty-hrtime": "^1.0.1",
|
|
91
|
-
"@types/sinon": "^10.0.
|
|
92
|
-
"@types/supertest": "^2.0.
|
|
93
|
+
"@types/sinon": "^10.0.19",
|
|
94
|
+
"@types/supertest": "^2.0.14",
|
|
93
95
|
"@types/test-console": "^2.0.0",
|
|
94
96
|
"@vinejs/vine": "^1.6.0",
|
|
95
97
|
"argon2": "^0.31.1",
|
|
@@ -98,52 +100,52 @@
|
|
|
98
100
|
"copyfiles": "^2.4.1",
|
|
99
101
|
"cross-env": "^7.0.3",
|
|
100
102
|
"del-cli": "^5.1.0",
|
|
101
|
-
"edge.js": "^6.0.0-
|
|
102
|
-
"eslint": "^8.
|
|
103
|
+
"edge.js": "^6.0.0-10",
|
|
104
|
+
"eslint": "^8.51.0",
|
|
103
105
|
"get-port": "^7.0.0",
|
|
104
106
|
"github-label-sync": "^2.3.1",
|
|
105
107
|
"husky": "^8.0.3",
|
|
106
108
|
"np": "^8.0.4",
|
|
107
109
|
"prettier": "^3.0.3",
|
|
108
|
-
"sinon": "^
|
|
110
|
+
"sinon": "^16.1.0",
|
|
109
111
|
"supertest": "^6.3.3",
|
|
110
112
|
"test-console": "^2.0.0",
|
|
111
113
|
"ts-node": "^10.9.1",
|
|
112
114
|
"typescript": "^5.2.2"
|
|
113
115
|
},
|
|
114
116
|
"dependencies": {
|
|
115
|
-
"@adonisjs/ace": "^12.3.
|
|
116
|
-
"@adonisjs/application": "^
|
|
117
|
-
"@adonisjs/bodyparser": "^
|
|
118
|
-
"@adonisjs/config": "^4.2.1-
|
|
119
|
-
"@adonisjs/encryption": "^5.1.2-
|
|
120
|
-
"@adonisjs/env": "^4.2.0-
|
|
121
|
-
"@adonisjs/events": "^
|
|
122
|
-
"@adonisjs/fold": "^9.9.3-
|
|
123
|
-
"@adonisjs/hash": "^8.3.1-
|
|
124
|
-
"@adonisjs/http-server": "^
|
|
125
|
-
"@adonisjs/logger": "^5.4.2-
|
|
126
|
-
"@adonisjs/repl": "^4.0.0-
|
|
117
|
+
"@adonisjs/ace": "^12.3.2-0",
|
|
118
|
+
"@adonisjs/application": "^8.0.0-0",
|
|
119
|
+
"@adonisjs/bodyparser": "^10.0.0-0",
|
|
120
|
+
"@adonisjs/config": "^4.2.1-5",
|
|
121
|
+
"@adonisjs/encryption": "^5.1.2-3",
|
|
122
|
+
"@adonisjs/env": "^4.2.0-6",
|
|
123
|
+
"@adonisjs/events": "^9.0.0-0",
|
|
124
|
+
"@adonisjs/fold": "^9.9.3-10",
|
|
125
|
+
"@adonisjs/hash": "^8.3.1-7",
|
|
126
|
+
"@adonisjs/http-server": "^7.0.0-0",
|
|
127
|
+
"@adonisjs/logger": "^5.4.2-6",
|
|
128
|
+
"@adonisjs/repl": "^4.0.0-8",
|
|
127
129
|
"@antfu/install-pkg": "^0.1.1",
|
|
128
130
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
129
131
|
"@poppinss/macroable": "^1.0.0-7",
|
|
130
132
|
"@poppinss/utils": "^6.5.0-3",
|
|
131
|
-
"@sindresorhus/is": "^6.0.
|
|
132
|
-
"@types/he": "^1.2.
|
|
133
|
+
"@sindresorhus/is": "^6.0.1",
|
|
134
|
+
"@types/he": "^1.2.1",
|
|
133
135
|
"execa": "^8.0.1",
|
|
134
136
|
"he": "^1.2.0",
|
|
135
137
|
"parse-imports": "^1.1.2",
|
|
136
138
|
"pretty-hrtime": "^1.0.3",
|
|
137
139
|
"string-width": "^6.1.0",
|
|
138
|
-
"youch": "^3.3.
|
|
139
|
-
"youch-terminal": "^2.2.
|
|
140
|
+
"youch": "^3.3.2",
|
|
141
|
+
"youch-terminal": "^2.2.3"
|
|
140
142
|
},
|
|
141
143
|
"peerDependencies": {
|
|
142
|
-
"@adonisjs/assembler": "^6.1.3-
|
|
144
|
+
"@adonisjs/assembler": "^6.1.3-25",
|
|
143
145
|
"@vinejs/vine": "^1.6.0",
|
|
144
146
|
"argon2": "^0.31.1",
|
|
145
147
|
"bcrypt": "^5.1.1",
|
|
146
|
-
"edge.js": "^6.0.0-
|
|
148
|
+
"edge.js": "^6.0.0-10"
|
|
147
149
|
},
|
|
148
150
|
"peerDependenciesMeta": {
|
|
149
151
|
"argon2": {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { HashDriversList } from '../../src/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* A global collection of Hash drivers
|
|
4
|
-
*/
|
|
5
|
-
declare class HashDriversCollection {
|
|
6
|
-
/**
|
|
7
|
-
* List of registered drivers
|
|
8
|
-
*/
|
|
9
|
-
list: Partial<HashDriversList>;
|
|
10
|
-
/**
|
|
11
|
-
* Extend drivers collection and add a custom
|
|
12
|
-
* driver to it.
|
|
13
|
-
*/
|
|
14
|
-
extend<Name extends keyof HashDriversList>(driverName: Name, factoryCallback: HashDriversList[Name]): this;
|
|
15
|
-
/**
|
|
16
|
-
* Creates the driver instance with config
|
|
17
|
-
*/
|
|
18
|
-
create<Name extends keyof HashDriversList>(name: Name, config: Parameters<HashDriversList[Name]>[0]): import("@adonisjs/hash/drivers/bcrypt").Bcrypt | import("@adonisjs/hash/drivers/argon").Argon | import("@adonisjs/hash/drivers/scrypt").Scrypt;
|
|
19
|
-
}
|
|
20
|
-
declare const _default: HashDriversCollection;
|
|
21
|
-
export default _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @adonisjs/core
|
|
3
|
-
*
|
|
4
|
-
* (c) AdonisJS
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* This class exists in the core, because it maintains a list of
|
|
11
|
-
* globally available drivers applicable to the hash manager
|
|
12
|
-
* instance registered with the container.
|
|
13
|
-
*
|
|
14
|
-
* In other words, these drivers are not needed by the hash module
|
|
15
|
-
* regular usage and specific to AdonisJS container flow.
|
|
16
|
-
*/
|
|
17
|
-
import { RuntimeException } from '@poppinss/utils';
|
|
18
|
-
/**
|
|
19
|
-
* A global collection of Hash drivers
|
|
20
|
-
*/
|
|
21
|
-
class HashDriversCollection {
|
|
22
|
-
/**
|
|
23
|
-
* List of registered drivers
|
|
24
|
-
*/
|
|
25
|
-
list = {};
|
|
26
|
-
/**
|
|
27
|
-
* Extend drivers collection and add a custom
|
|
28
|
-
* driver to it.
|
|
29
|
-
*/
|
|
30
|
-
extend(driverName, factoryCallback) {
|
|
31
|
-
this.list[driverName] = factoryCallback;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Creates the driver instance with config
|
|
36
|
-
*/
|
|
37
|
-
create(name, config) {
|
|
38
|
-
const driverFactory = this.list[name];
|
|
39
|
-
if (!driverFactory) {
|
|
40
|
-
throw new RuntimeException(`Unknown hash driver "${String(name)}". Make sure the driver is registered`);
|
|
41
|
-
}
|
|
42
|
-
return driverFactory(config);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export default new HashDriversCollection();
|