Some checks are pending
Automatisch Backend Tests / test (push) Waiting to run
Automatisch CI / linter (push) Waiting to run
Automatisch CI / start-backend-server (push) Waiting to run
Automatisch CI / start-backend-worker (push) Waiting to run
Automatisch CI / build-web (push) Waiting to run
Automatisch UI Tests / test (push) Waiting to run
22 lines
678 B
JavaScript
22 lines
678 B
JavaScript
import { faker } from '@faker-js/faker';
|
|
import OAuthClient from '../../src/models/oauth-client';
|
|
|
|
const formattedAuthDefaults = {
|
|
oAuthRedirectUrl: faker.internet.url(),
|
|
instanceUrl: faker.internet.url(),
|
|
clientId: faker.string.uuid(),
|
|
clientSecret: faker.string.uuid(),
|
|
};
|
|
|
|
export const createOAuthClient = async (params = {}) => {
|
|
params.name = params?.name || faker.person.fullName();
|
|
params.appKey = params?.appKey || 'deepl';
|
|
params.active = params?.active ?? true;
|
|
params.formattedAuthDefaults =
|
|
params?.formattedAuthDefaults || formattedAuthDefaults;
|
|
|
|
const oauthClient = await OAuthClient.query().insertAndFetch(params);
|
|
|
|
return oauthClient;
|
|
};
|