2024-06-19 04:33:57 -07:00
|
|
|
import { randomInt } from 'n8n-workflow';
|
2023-12-13 03:41:06 -08:00
|
|
|
import { User } from '@db/entities/User';
|
|
|
|
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
|
2024-06-19 04:33:57 -07:00
|
|
|
import { Project } from '@db/entities/Project';
|
2023-12-13 03:41:06 -08:00
|
|
|
|
|
|
|
import {
|
|
|
|
randomCredentialPayload,
|
|
|
|
randomEmail,
|
|
|
|
randomName,
|
2024-05-17 01:53:15 -07:00
|
|
|
uniqueId,
|
2024-08-05 02:12:25 -07:00
|
|
|
} from '../integration/shared/random';
|
2023-12-13 03:41:06 -08:00
|
|
|
|
|
|
|
export const mockCredential = (): CredentialsEntity =>
|
|
|
|
Object.assign(new CredentialsEntity(), randomCredentialPayload());
|
|
|
|
|
|
|
|
export const mockUser = (): User =>
|
|
|
|
Object.assign(new User(), {
|
2024-06-19 04:33:57 -07:00
|
|
|
id: randomInt(1000),
|
2023-12-13 03:41:06 -08:00
|
|
|
email: randomEmail(),
|
|
|
|
firstName: randomName(),
|
|
|
|
lastName: randomName(),
|
|
|
|
});
|
2024-05-17 01:53:15 -07:00
|
|
|
|
|
|
|
export const mockProject = (): Project =>
|
|
|
|
Object.assign(new Project(), {
|
|
|
|
id: uniqueId(),
|
|
|
|
type: 'personal',
|
|
|
|
name: 'Nathan Fillion <nathan.fillion@n8n.io>',
|
|
|
|
});
|