26 lines
818 B
TypeScript
26 lines
818 B
TypeScript
|
import { Connection } from 'typeorm';
|
||
|
import { OAuth2ClientAuthorization } from './oauth2-client-authorization.entity';
|
||
|
import { OAuth2ClientURL } from './oauth2-client-url.entity';
|
||
|
import { OAuth2Client } from './oauth2-client.entity';
|
||
|
|
||
|
export const clientProviders = [
|
||
|
{
|
||
|
provide: 'CLIENT_REPOSITORY',
|
||
|
useFactory: (connection: Connection) =>
|
||
|
connection.getRepository(OAuth2Client),
|
||
|
inject: ['DATABASE_CONNECTION'],
|
||
|
},
|
||
|
{
|
||
|
provide: 'CLIENT_URL_REPOSITORY',
|
||
|
useFactory: (connection: Connection) =>
|
||
|
connection.getRepository(OAuth2ClientURL),
|
||
|
inject: ['DATABASE_CONNECTION'],
|
||
|
},
|
||
|
{
|
||
|
provide: 'CLIENT_AUTHORIZATION_REPOSITORY',
|
||
|
useFactory: (connection: Connection) =>
|
||
|
connection.getRepository(OAuth2ClientAuthorization),
|
||
|
inject: ['DATABASE_CONNECTION'],
|
||
|
},
|
||
|
];
|