refactor(core): Clean up event relays (no-changelog) (#10284)
This commit is contained in:
371
packages/cli/src/events/relay-event-map.ts
Normal file
371
packages/cli/src/events/relay-event-map.ts
Normal file
@@ -0,0 +1,371 @@
|
||||
import type { AuthenticationMethod, IRun, IWorkflowBase } from 'n8n-workflow';
|
||||
import type { IWorkflowDb, IWorkflowExecutionDataProcess } from '@/Interfaces';
|
||||
import type { ProjectRole } from '@/databases/entities/ProjectRelation';
|
||||
import type { GlobalRole } from '@/databases/entities/User';
|
||||
|
||||
export type UserLike = {
|
||||
id: string;
|
||||
email?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
role: string;
|
||||
};
|
||||
|
||||
export type RelayEventMap = {
|
||||
// #region Server
|
||||
|
||||
'server-started': {};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Workflow
|
||||
|
||||
'workflow-created': {
|
||||
user: UserLike;
|
||||
workflow: IWorkflowBase;
|
||||
publicApi: boolean;
|
||||
projectId: string;
|
||||
projectType: string;
|
||||
};
|
||||
|
||||
'workflow-deleted': {
|
||||
user: UserLike;
|
||||
workflowId: string;
|
||||
publicApi: boolean;
|
||||
};
|
||||
|
||||
'workflow-saved': {
|
||||
user: UserLike;
|
||||
workflow: IWorkflowDb;
|
||||
publicApi: boolean;
|
||||
};
|
||||
|
||||
'workflow-pre-execute': {
|
||||
executionId: string;
|
||||
data: IWorkflowExecutionDataProcess /* main process */ | IWorkflowBase /* worker */;
|
||||
};
|
||||
|
||||
'workflow-post-execute': {
|
||||
executionId: string;
|
||||
userId?: string;
|
||||
workflow: IWorkflowBase;
|
||||
runData?: IRun;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Node
|
||||
|
||||
'node-pre-execute': {
|
||||
executionId: string;
|
||||
workflow: IWorkflowBase;
|
||||
nodeName: string;
|
||||
};
|
||||
|
||||
'node-post-execute': {
|
||||
executionId: string;
|
||||
workflow: IWorkflowBase;
|
||||
nodeName: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region User
|
||||
|
||||
'user-deleted': {
|
||||
user: UserLike;
|
||||
};
|
||||
|
||||
'user-invited': {
|
||||
user: UserLike;
|
||||
targetUserId: string[];
|
||||
};
|
||||
|
||||
'user-reinvited': {
|
||||
user: UserLike;
|
||||
targetUserId: string[];
|
||||
};
|
||||
|
||||
'user-updated': {
|
||||
user: UserLike;
|
||||
fieldsChanged: string[];
|
||||
};
|
||||
|
||||
'user-signed-up': {
|
||||
user: UserLike;
|
||||
};
|
||||
|
||||
'user-logged-in': {
|
||||
user: UserLike;
|
||||
authenticationMethod: AuthenticationMethod;
|
||||
};
|
||||
|
||||
'user-login-failed': {
|
||||
userEmail: string;
|
||||
authenticationMethod: AuthenticationMethod;
|
||||
reason?: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Click
|
||||
|
||||
'user-invite-email-click': {
|
||||
inviter: UserLike;
|
||||
invitee: UserLike;
|
||||
};
|
||||
|
||||
'user-password-reset-email-click': {
|
||||
user: UserLike;
|
||||
};
|
||||
|
||||
'user-password-reset-request-click': {
|
||||
user: UserLike;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Public API
|
||||
|
||||
'public-api-key-created': {
|
||||
user: UserLike;
|
||||
publicApi: boolean;
|
||||
};
|
||||
|
||||
'public-api-key-deleted': {
|
||||
user: UserLike;
|
||||
publicApi: boolean;
|
||||
};
|
||||
|
||||
'public-api-invoked': {
|
||||
userId: string;
|
||||
path: string;
|
||||
method: string;
|
||||
apiVersion: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Email
|
||||
|
||||
'email-failed': {
|
||||
user: UserLike;
|
||||
messageType:
|
||||
| 'Reset password'
|
||||
| 'New user invite'
|
||||
| 'Resend invite'
|
||||
| 'Workflow shared'
|
||||
| 'Credentials shared';
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Credentials
|
||||
|
||||
'credentials-created': {
|
||||
user: UserLike;
|
||||
credentialType: string;
|
||||
credentialId: string;
|
||||
publicApi: boolean;
|
||||
projectId?: string;
|
||||
projectType?: string;
|
||||
};
|
||||
|
||||
'credentials-shared': {
|
||||
user: UserLike;
|
||||
credentialType: string;
|
||||
credentialId: string;
|
||||
userIdSharer: string;
|
||||
userIdsShareesAdded: string[];
|
||||
shareesRemoved: number | null;
|
||||
};
|
||||
|
||||
'credentials-updated': {
|
||||
user: UserLike;
|
||||
credentialType: string;
|
||||
credentialId: string;
|
||||
};
|
||||
|
||||
'credentials-deleted': {
|
||||
user: UserLike;
|
||||
credentialType: string;
|
||||
credentialId: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Community package
|
||||
|
||||
'community-package-installed': {
|
||||
user: UserLike;
|
||||
inputString: string;
|
||||
packageName: string;
|
||||
success: boolean;
|
||||
packageVersion?: string;
|
||||
packageNodeNames?: string[];
|
||||
packageAuthor?: string;
|
||||
packageAuthorEmail?: string;
|
||||
failureReason?: string;
|
||||
};
|
||||
|
||||
'community-package-updated': {
|
||||
user: UserLike;
|
||||
packageName: string;
|
||||
packageVersionCurrent: string;
|
||||
packageVersionNew: string;
|
||||
packageNodeNames: string[];
|
||||
packageAuthor?: string;
|
||||
packageAuthorEmail?: string;
|
||||
};
|
||||
|
||||
'community-package-deleted': {
|
||||
user: UserLike;
|
||||
packageName: string;
|
||||
packageVersion: string;
|
||||
packageNodeNames: string[];
|
||||
packageAuthor?: string;
|
||||
packageAuthorEmail?: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Execution
|
||||
|
||||
'execution-throttled': {
|
||||
executionId: string;
|
||||
};
|
||||
|
||||
'execution-started-during-bootup': {
|
||||
executionId: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Project
|
||||
|
||||
'team-project-updated': {
|
||||
userId: string;
|
||||
role: GlobalRole;
|
||||
members: Array<{
|
||||
userId: string;
|
||||
role: ProjectRole;
|
||||
}>;
|
||||
projectId: string;
|
||||
};
|
||||
|
||||
'team-project-deleted': {
|
||||
userId: string;
|
||||
role: GlobalRole;
|
||||
projectId: string;
|
||||
removalType: 'transfer' | 'delete';
|
||||
targetProjectId?: string;
|
||||
};
|
||||
|
||||
'team-project-created': {
|
||||
userId: string;
|
||||
role: GlobalRole;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Source control
|
||||
|
||||
'source-control-settings-updated': {
|
||||
branchName: string;
|
||||
readOnlyInstance: boolean;
|
||||
repoType: 'github' | 'gitlab' | 'other';
|
||||
connected: boolean;
|
||||
};
|
||||
|
||||
'source-control-user-started-pull-ui': {
|
||||
workflowUpdates: number;
|
||||
workflowConflicts: number;
|
||||
credConflicts: number;
|
||||
};
|
||||
|
||||
'source-control-user-finished-pull-ui': {
|
||||
workflowUpdates: number;
|
||||
};
|
||||
|
||||
'source-control-user-pulled-api': {
|
||||
workflowUpdates: number;
|
||||
forced: boolean;
|
||||
};
|
||||
|
||||
'source-control-user-started-push-ui': {
|
||||
workflowsEligible: number;
|
||||
workflowsEligibleWithConflicts: number;
|
||||
credsEligible: number;
|
||||
credsEligibleWithConflicts: number;
|
||||
variablesEligible: number;
|
||||
};
|
||||
|
||||
'source-control-user-finished-push-ui': {
|
||||
workflowsEligible: number;
|
||||
workflowsPushed: number;
|
||||
credsPushed: number;
|
||||
variablesPushed: number;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region License
|
||||
|
||||
'license-renewal-attempted': {
|
||||
success: boolean;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Variable
|
||||
|
||||
'variable-created': {};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region External secrets
|
||||
|
||||
'external-secrets-provider-settings-saved': {
|
||||
userId?: string;
|
||||
vaultType: string;
|
||||
isValid: boolean;
|
||||
isNew: boolean;
|
||||
errorMessage?: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region LDAP
|
||||
|
||||
'ldap-general-sync-finished': {
|
||||
type: string;
|
||||
succeeded: boolean;
|
||||
usersSynced: number;
|
||||
error: string;
|
||||
};
|
||||
|
||||
'ldap-settings-updated': {
|
||||
userId: string;
|
||||
loginIdAttribute: string;
|
||||
firstNameAttribute: string;
|
||||
lastNameAttribute: string;
|
||||
emailAttribute: string;
|
||||
ldapIdAttribute: string;
|
||||
searchPageSize: number;
|
||||
searchTimeout: number;
|
||||
synchronizationEnabled: boolean;
|
||||
synchronizationInterval: number;
|
||||
loginLabel: string;
|
||||
loginEnabled: boolean;
|
||||
};
|
||||
|
||||
'ldap-login-sync-failed': {
|
||||
error: string;
|
||||
};
|
||||
|
||||
'login-failed-due-to-ldap-disabled': {
|
||||
userId: string;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
};
|
||||
Reference in New Issue
Block a user