mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
fix(core): Use stricter typing on queries in cli commands (no-changelog) (#5476)
This has been broken since TypeORM upgrade Fixes: https://linear.app/n8n/issue/ENG-50 https://community.n8n.io/t/execute-command-stdout/22994
This commit is contained in:
committed by
GitHub
parent
522ddfc0cd
commit
a6c59fcbc2
@@ -1,10 +1,10 @@
|
||||
import { flags } from '@oclif/command';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import type { FindOptionsWhere } from 'typeorm';
|
||||
import { Credentials, UserSettings } from 'n8n-core';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import * as Db from '@/Db';
|
||||
import type { ICredentialsDecryptedDb } from '@/Interfaces';
|
||||
import type { ICredentialsDb, ICredentialsDecryptedDb } from '@/Interfaces';
|
||||
import { BaseCommand } from '../BaseCommand';
|
||||
|
||||
export class ExportCredentialsCommand extends BaseCommand {
|
||||
@@ -105,13 +105,12 @@ export class ExportCredentialsCommand extends BaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
const findQuery: IDataObject = {};
|
||||
const findQuery: FindOptionsWhere<ICredentialsDb> = {};
|
||||
if (flags.id) {
|
||||
findQuery.id = flags.id;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const credentials = await Db.collections.Credentials.find(findQuery);
|
||||
const credentials = await Db.collections.Credentials.findBy(findQuery);
|
||||
|
||||
if (flags.decrypted) {
|
||||
const encryptionKey = await UserSettings.getEncryptionKey();
|
||||
|
||||
Reference in New Issue
Block a user