mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-08-06 03:48:35 +02:00
25 lines
630 B
TypeScript
25 lines
630 B
TypeScript
import { Column, Entity, ManyToOne, PrimaryColumn } from '@n8n/typeorm';
|
|
import { CredentialsEntity } from './credentials-entity';
|
|
import { WithTimestamps } from './abstract-entity';
|
|
import { Project } from './project';
|
|
|
|
export type CredentialSharingRole = 'credential:owner' | 'credential:user';
|
|
|
|
@Entity()
|
|
export class SharedCredentials extends WithTimestamps {
|
|
@Column()
|
|
role: CredentialSharingRole;
|
|
|
|
@ManyToOne('CredentialsEntity', 'shared')
|
|
credentials: CredentialsEntity;
|
|
|
|
@PrimaryColumn()
|
|
credentialsId: string;
|
|
|
|
@ManyToOne('Project', 'sharedCredentials')
|
|
project: Project;
|
|
|
|
@PrimaryColumn()
|
|
projectId: string;
|
|
}
|