fix
This commit is contained in:
parent
a9e234bac6
commit
7980661e6d
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "directus-helpers",
|
||||
"version": "1.6.0",
|
||||
"version": "1.7.0",
|
||||
"description": "Helpers Directus Extensions",
|
||||
"author": "AntoXa PRO <info@antoxa.pro>",
|
||||
"homepage": "https://antoxahub.ru/antoxa/directus-helpers",
|
||||
|
@ -1,9 +1,11 @@
|
||||
import type { SchemaOverview, Accountability } from '@directus/types'
|
||||
|
||||
import type {
|
||||
ItemsService,
|
||||
FilesService,
|
||||
UsersService,
|
||||
RolesService
|
||||
RolesService,
|
||||
AuthenticationService
|
||||
} from '@directus/api/dist/services'
|
||||
|
||||
export type TFactoryServicesOpts = {
|
||||
@ -22,6 +24,7 @@ export class FactoryServices<TTypes extends TFactoryTypes = any> {
|
||||
private _files: FilesService | null = null
|
||||
private _users: UsersService | null = null
|
||||
private _roles: RolesService | null = null
|
||||
private _authentication: AuthenticationService | null = null
|
||||
|
||||
constructor(opts: TFactoryServicesOpts) {
|
||||
this.opts = opts
|
||||
@ -68,4 +71,14 @@ export class FactoryServices<TTypes extends TFactoryTypes = any> {
|
||||
}
|
||||
return this._roles as RolesService
|
||||
}
|
||||
|
||||
get authentication() {
|
||||
if (!this._authentication) {
|
||||
this._authentication = new this.opts.services.AuthenticationService({
|
||||
schema: this.opts.schema,
|
||||
accountability: this.opts.accountability
|
||||
})
|
||||
}
|
||||
return this._authentication as AuthenticationService
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user