refactor(core): Enforce filename casing in cli package (no-changelog) (#10594)

This commit is contained in:
Iván Ovejero
2024-08-28 17:57:46 +02:00
committed by GitHub
parent dbc10fe9f5
commit 6485ca0a4b
239 changed files with 313 additions and 307 deletions

View File

@@ -1,5 +1,5 @@
import type { QueryRunner } from '@n8n/typeorm';
import { Column } from './Column';
import { Column } from './column';
import {
AddColumns,
AddForeignKey,
@@ -9,8 +9,8 @@ import {
DropForeignKey,
DropNotNull,
DropTable,
} from './Table';
import { CreateIndex, DropIndex } from './Indices';
} from './table';
import { CreateIndex, DropIndex } from './indices';
export const createSchemaBuilder = (tablePrefix: string, queryRunner: QueryRunner) => ({
column: (name: string) => new Column(name),

View File

@@ -1,7 +1,7 @@
import type { TableForeignKeyOptions, TableIndexOptions, QueryRunner } from '@n8n/typeorm';
import { Table, TableColumn, TableForeignKey } from '@n8n/typeorm';
import LazyPromise from 'p-lazy';
import { Column } from './Column';
import { Column } from './column';
import { ApplicationError } from 'n8n-workflow';
abstract class TableOperation<R = void> extends LazyPromise<R> {

View File

@@ -1,4 +1,4 @@
import { User } from '@/databases/entities/User';
import { User } from '@/databases/entities/user';
describe('User Entity', () => {
describe('JSON.stringify', () => {

View File

@@ -1,6 +1,6 @@
import { Column, Entity, ManyToOne, PrimaryColumn, Unique } from '@n8n/typeorm';
import { WithTimestamps } from './abstract-entity';
import { User } from './User';
import { User } from './user';
export type AuthProviderType = 'ldap' | 'email' | 'saml'; // | 'google';

View File

@@ -1,5 +1,5 @@
import { Column, Entity } from '@n8n/typeorm';
import { User } from './User';
import { User } from './user';
@Entity({ name: 'user' })
export class AuthUser extends User {

View File

@@ -2,7 +2,7 @@ import { Column, Entity, Index, OneToMany } from '@n8n/typeorm';
import { IsObject, IsString, Length } from 'class-validator';
import type { SharedCredentials } from './shared-credentials';
import { WithTimestampsAndStringId } from './abstract-entity';
import type { ICredentialsDb } from '@/Interfaces';
import type { ICredentialsDb } from '@/interfaces';
@Entity()
export class CredentialsEntity extends WithTimestampsAndStringId implements ICredentialsDb {

View File

@@ -10,8 +10,8 @@ import { Settings } from './settings';
import { SharedCredentials } from './shared-credentials';
import { SharedWorkflow } from './shared-workflow';
import { TagEntity } from './tag-entity';
import { User } from './User';
import { Variables } from './Variables';
import { User } from './user';
import { Variables } from './variables';
import { WebhookEntity } from './webhook-entity';
import { WorkflowEntity } from './workflow-entity';
import { WorkflowTagMapping } from './workflow-tag-mapping';

View File

@@ -1,5 +1,5 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from '@n8n/typeorm';
import { User } from './User';
import { User } from './user';
import { WithTimestamps } from './abstract-entity';
import { Project } from './project';

View File

@@ -16,7 +16,7 @@ import type { SharedCredentials } from './shared-credentials';
import { NoXss } from '@/validators/no-xss.validator';
import { objectRetriever, lowerCaser } from '../utils/transformers';
import { WithTimestamps, jsonColumnType } from './abstract-entity';
import type { IPersonalizationSurveyAnswers } from '@/Interfaces';
import type { IPersonalizationSurveyAnswers } from '@/interfaces';
import type { AuthIdentity } from './auth-identity';
import {
GLOBAL_OWNER_SCOPES,

View File

@@ -11,7 +11,7 @@ import type { WorkflowStatistics } from './workflow-statistics';
import type { WorkflowTagMapping } from './workflow-tag-mapping';
import { objectRetriever, sqlite } from '../utils/transformers';
import { WithTimestampsAndStringId, dbType, jsonColumnType } from './abstract-entity';
import type { IWorkflowDb } from '@/Interfaces';
import type { IWorkflowDb } from '@/interfaces';
@Entity()
export class WorkflowEntity extends WithTimestampsAndStringId implements IWorkflowDb {

View File

@@ -1,6 +1,6 @@
import type { MigrationContext, ReversibleMigration } from '@/databases/types';
import type { ProjectRole } from '@/databases/entities/project-relation';
import type { User } from '@/databases/entities/User';
import type { User } from '@/databases/entities/user';
import { generateNanoId } from '@/databases/utils/generators';
import { ApplicationError } from 'n8n-workflow';
import { nanoid } from 'nanoid';

View File

@@ -1,5 +1,5 @@
import type { MigrationContext, ReversibleMigration } from '@/databases/types';
import type { UserSettings } from '@/Interfaces';
import type { UserSettings } from '@/interfaces';
export class AddUserActivatedProperty1681134145996 implements ReversibleMigration {
async up({ queryRunner, tablePrefix }: MigrationContext) {

View File

@@ -1,5 +1,5 @@
import type { MigrationContext, ReversibleMigration } from '@/databases/types';
import type { UserSettings } from '@/Interfaces';
import type { UserSettings } from '@/interfaces';
export class AddUserActivatedProperty1681134145996 implements ReversibleMigration {
async up({ queryRunner, tablePrefix }: MigrationContext) {

View File

@@ -1,5 +1,5 @@
import type { MigrationContext, ReversibleMigration } from '@/databases/types';
import type { UserSettings } from '@/Interfaces';
import type { UserSettings } from '@/interfaces';
export class AddUserActivatedProperty1681134145996 implements ReversibleMigration {
async up({ queryRunner, tablePrefix }: MigrationContext) {

View File

@@ -3,7 +3,7 @@ import { In } from '@n8n/typeorm';
import { mock } from 'jest-mock-extended';
import { hasScope } from '@n8n/permissions';
import type { User } from '@/databases/entities/User';
import type { User } from '@/databases/entities/user';
import type { CredentialsEntity } from '@/databases/entities/credentials-entity';
import { SharedCredentials } from '@/databases/entities/shared-credentials';
import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository';

View File

@@ -3,7 +3,7 @@ import { DataSource, In, Repository, Like } from '@n8n/typeorm';
import type { FindManyOptions, FindOptionsWhere } from '@n8n/typeorm';
import { CredentialsEntity } from '../entities/credentials-entity';
import type { ListQuery } from '@/requests';
import type { User } from '../entities/User';
import type { User } from '../entities/user';
import type { Scope } from '@n8n/permissions';
import { RoleService } from '@/services/role.service';

View File

@@ -35,7 +35,7 @@ import type {
IExecutionBase,
IExecutionFlattedDb,
IExecutionResponse,
} from '@/Interfaces';
} from '@/interfaces';
import config from '@/config';
import type { ExecutionData } from '../entities/execution-data';

View File

@@ -2,7 +2,7 @@ import { Service } from 'typedi';
import type { EntityManager, FindOptionsRelations, FindOptionsWhere } from '@n8n/typeorm';
import { DataSource, In, Not, Repository } from '@n8n/typeorm';
import { type CredentialSharingRole, SharedCredentials } from '../entities/shared-credentials';
import type { User } from '../entities/User';
import type { User } from '../entities/user';
import { RoleService } from '@/services/role.service';
import type { Scope } from '@n8n/permissions';
import type { Project } from '../entities/project';

View File

@@ -2,7 +2,7 @@ import { Service } from 'typedi';
import { DataSource, Repository, In, Not } from '@n8n/typeorm';
import type { EntityManager, FindManyOptions, FindOptionsWhere } from '@n8n/typeorm';
import { SharedWorkflow, type WorkflowSharingRole } from '../entities/shared-workflow';
import { type User } from '../entities/User';
import { type User } from '../entities/user';
import type { Scope } from '@n8n/permissions';
import { RoleService } from '@/services/role.service';
import type { Project } from '../entities/project';

View File

@@ -3,7 +3,7 @@ import type { DeepPartial, EntityManager, FindManyOptions } from '@n8n/typeorm';
import { DataSource, In, IsNull, Not, Repository } from '@n8n/typeorm';
import type { ListQuery } from '@/requests';
import { type GlobalRole, User } from '../entities/User';
import { type GlobalRole, User } from '../entities/user';
import { Project } from '../entities/project';
import { ProjectRelation } from '../entities/project-relation';

View File

@@ -1,6 +1,6 @@
import { Service } from 'typedi';
import { DataSource, Repository } from '@n8n/typeorm';
import { Variables } from '../entities/Variables';
import { Variables } from '../entities/variables';
@Service()
export class VariablesRepository extends Repository<Variables> {

View File

@@ -2,7 +2,7 @@ import { Service } from 'typedi';
import { GlobalConfig } from '@n8n/config';
import { DataSource, MoreThanOrEqual, QueryFailedError, Repository } from '@n8n/typeorm';
import { StatisticsNames, WorkflowStatistics } from '../entities/workflow-statistics';
import type { User } from '@/databases/entities/User';
import type { User } from '@/databases/entities/user';
type StatisticsInsertResult = 'insert' | 'failed' | 'alreadyExists';
type StatisticsUpsertResult = StatisticsInsertResult | 'update';

View File

@@ -5,7 +5,7 @@ import { ApplicationError, ErrorReporterProxy } from 'n8n-workflow';
import { Logger } from '@/logger';
import { Project } from '../entities/project';
import { User } from '../entities/User';
import { User } from '../entities/user';
import { UserRepository } from '../repositories/user.repository';
@EventSubscriber()

View File

@@ -1,6 +1,6 @@
import { customAlphabet } from 'nanoid';
import { ALPHABET } from 'n8n-workflow';
import type { N8nInstanceType } from '@/Interfaces';
import type { N8nInstanceType } from '@/interfaces';
const nanoid = customAlphabet(ALPHABET, 16);