feat: Support create, read, delete variables in Public API (#10241)
This commit is contained in:
@@ -78,7 +78,11 @@ export async function createUserWithMfaEnabled(
|
||||
};
|
||||
}
|
||||
|
||||
export async function createOwner() {
|
||||
export async function createOwner({ withApiKey } = { withApiKey: false }) {
|
||||
if (withApiKey) {
|
||||
return await addApiKey(await createUser({ role: 'global:owner' }));
|
||||
}
|
||||
|
||||
return await createUser({ role: 'global:owner' });
|
||||
}
|
||||
|
||||
|
||||
12
packages/cli/test/integration/shared/db/variables.ts
Normal file
12
packages/cli/test/integration/shared/db/variables.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { VariablesRepository } from '@/databases/repositories/variables.repository';
|
||||
import { generateNanoId } from '@/databases/utils/generators';
|
||||
import { randomString } from 'n8n-workflow';
|
||||
import Container from 'typedi';
|
||||
|
||||
export async function createVariable(key = randomString(5), value = randomString(5)) {
|
||||
return await Container.get(VariablesRepository).save({ id: generateNanoId(), key, value });
|
||||
}
|
||||
|
||||
export async function getVariableOrFail(id: string) {
|
||||
return await Container.get(VariablesRepository).findOneOrFail({ where: { id } });
|
||||
}
|
||||
Reference in New Issue
Block a user