mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(core): Upgrade oclif (no-changelog) (#8381)
This commit is contained in:
committed by
GitHub
parent
2c146cca62
commit
913c8c6b0c
@@ -1,18 +1,19 @@
|
||||
import { flags } from '@oclif/command';
|
||||
import { Container } from 'typedi';
|
||||
import { Flags } from '@oclif/core';
|
||||
import { ApplicationError, jsonParse } from 'n8n-workflow';
|
||||
import fs from 'fs';
|
||||
import glob from 'fast-glob';
|
||||
import { Container } from 'typedi';
|
||||
|
||||
import { UM_FIX_INSTRUCTION } from '@/constants';
|
||||
import { WorkflowEntity } from '@db/entities/WorkflowEntity';
|
||||
import { disableAutoGeneratedIds } from '@db/utils/commandHelpers';
|
||||
import type { IWorkflowToImport } from '@/Interfaces';
|
||||
import { BaseCommand } from '../BaseCommand';
|
||||
import { generateNanoId } from '@db/utils/generators';
|
||||
import { RoleService } from '@/services/role.service';
|
||||
import { UM_FIX_INSTRUCTION } from '@/constants';
|
||||
import { UserRepository } from '@db/repositories/user.repository';
|
||||
import { WorkflowRepository } from '@db/repositories/workflow.repository';
|
||||
import type { IWorkflowToImport } from '@/Interfaces';
|
||||
import { RoleService } from '@/services/role.service';
|
||||
import { ImportService } from '@/services/import.service';
|
||||
import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
|
||||
import { BaseCommand } from '../BaseCommand';
|
||||
|
||||
function assertHasWorkflowsToImport(workflows: unknown): asserts workflows is IWorkflowToImport[] {
|
||||
if (!Array.isArray(workflows)) {
|
||||
@@ -43,15 +44,15 @@ export class ImportWorkflowsCommand extends BaseCommand {
|
||||
];
|
||||
|
||||
static flags = {
|
||||
help: flags.help({ char: 'h' }),
|
||||
input: flags.string({
|
||||
help: Flags.help({ char: 'h' }),
|
||||
input: Flags.string({
|
||||
char: 'i',
|
||||
description: 'Input file name or directory if --separate is used',
|
||||
}),
|
||||
separate: flags.boolean({
|
||||
separate: Flags.boolean({
|
||||
description: 'Imports *.json files from directory provided by --input',
|
||||
}),
|
||||
userId: flags.string({
|
||||
userId: Flags.string({
|
||||
description: 'The ID of the user to assign the imported workflows to',
|
||||
}),
|
||||
};
|
||||
@@ -62,8 +63,7 @@ export class ImportWorkflowsCommand extends BaseCommand {
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const { flags } = this.parse(ImportWorkflowsCommand);
|
||||
const { flags } = await this.parse(ImportWorkflowsCommand);
|
||||
|
||||
if (!flags.input) {
|
||||
this.logger.info('An input file or directory with --input must be provided');
|
||||
|
||||
Reference in New Issue
Block a user