mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
ci: Break most of the circular dependencies in code (no-changelog) (#4990)
This commit is contained in:
committed by
GitHub
parent
82f763589b
commit
5db9c46043
@@ -20,7 +20,7 @@ import { CREDENTIAL_BLANKING_VALUE, RESPONSE_ERROR_MESSAGES } from '@/constants'
|
||||
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
|
||||
import { SharedCredentials } from '@db/entities/SharedCredentials';
|
||||
import { validateEntity } from '@/GenericHelpers';
|
||||
import { externalHooks } from '../Server';
|
||||
import { ExternalHooks } from '@/ExternalHooks';
|
||||
|
||||
import type { User } from '@db/entities/User';
|
||||
import type { CredentialRequest } from '@/requests';
|
||||
@@ -234,7 +234,7 @@ export class CredentialsService {
|
||||
credentialId: string,
|
||||
newCredentialData: ICredentialsDb,
|
||||
): Promise<ICredentialsDb | undefined> {
|
||||
await externalHooks.run('credentials.update', [newCredentialData]);
|
||||
await ExternalHooks().run('credentials.update', [newCredentialData]);
|
||||
|
||||
// Update the credentials in DB
|
||||
await Db.collections.Credentials.update(credentialId, newCredentialData);
|
||||
@@ -253,7 +253,7 @@ export class CredentialsService {
|
||||
const newCredential = new CredentialsEntity();
|
||||
Object.assign(newCredential, credential, encryptedData);
|
||||
|
||||
await externalHooks.run('credentials.create', [encryptedData]);
|
||||
await ExternalHooks().run('credentials.create', [encryptedData]);
|
||||
|
||||
const role = await Db.collections.Role.findOneOrFail({
|
||||
name: 'owner',
|
||||
@@ -285,7 +285,7 @@ export class CredentialsService {
|
||||
}
|
||||
|
||||
static async delete(credentials: CredentialsEntity): Promise<void> {
|
||||
await externalHooks.run('credentials.delete', [credentials.id]);
|
||||
await ExternalHooks().run('credentials.delete', [credentials.id]);
|
||||
|
||||
await Db.collections.Credentials.remove(credentials);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user