refactor: Fix TypeScript errors workflow package (#9437)

This commit is contained in:
Elias Meire 2024-05-17 11:28:13 +02:00 committed by GitHub
parent 2967df2fe0
commit 451e6590d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 11 additions and 17 deletions

View file

@ -11,7 +11,7 @@
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"baseUrl": ".",
"types": ["vitest/globals"],
"types": ["vitest/globals", "../workflow/src/types.d.ts"],
"paths": {
"@/*": ["src/*"],
"n8n-design-system/*": ["../design-system/src/*"],

View file

@ -29,7 +29,7 @@ export function augmentArray<T>(data: T[]): T[] {
}
const proxy = new Proxy(data, {
deleteProperty(target, key: string) {
deleteProperty(_target, key: string) {
return Reflect.deleteProperty(getData(), key);
},
get(target, key: string, receiver): unknown {
@ -59,7 +59,7 @@ export function augmentArray<T>(data: T[]): T[] {
ownKeys(target) {
return Reflect.ownKeys(newData ?? target);
},
set(target, key: string, newValue: unknown) {
set(_target, key: string, newValue: unknown) {
// Always proxy all objects. Like that we can check in get simply if it
// is a proxy and it does then not matter if it was already there from the
// beginning and it got proxied at some point or set later and so theoretically
@ -143,7 +143,7 @@ export function augmentObject<T extends object>(data: T): T {
);
},
getOwnPropertyDescriptor(target, key) {
getOwnPropertyDescriptor(_target, key) {
if (deletedProperties.has(key)) return undefined;
return Object.getOwnPropertyDescriptor(key in newData ? newData : data, key);
},

View file

@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';
export const arrayMethods: NativeDoc = {
typeName: 'Array',

View file

@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';
export const booleanMethods: NativeDoc = {
typeName: 'Boolean',

View file

@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';
export const numberMethods: NativeDoc = {
typeName: 'Number',

View file

@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';
export const objectMethods: NativeDoc = {
typeName: 'Object',

View file

@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';
export const stringMethods: NativeDoc = {
typeName: 'String',

View file

@ -2,7 +2,7 @@ import { stringMethods } from './String.methods';
import { arrayMethods } from './Array.methods';
import { numberMethods } from './Number.methods';
import { objectMethods } from './Object.Methods';
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';
import { booleanMethods } from './Boolean.methods';
const NATIVE_METHODS: NativeDoc[] = [

View file

@ -1,4 +1,4 @@
import type { INode } from '@/Interfaces';
import type { INode } from '../Interfaces';
import { ExecutionBaseError } from './abstract/execution-base.error';
export class CredentialAccessError extends ExecutionBaseError {

View file

@ -6,8 +6,6 @@ import { NodeError } from './abstract/node.error';
* Class for instantiating an operational error, e.g. an invalid credentials error.
*/
export class NodeOperationError extends NodeError {
lineNumber: number | undefined;
type: string | undefined;
constructor(

View file

@ -9,10 +9,6 @@ export class WorkflowOperationError extends ExecutionBaseError {
timestamp: number;
lineNumber: number | undefined;
description: string | undefined;
constructor(message: string, node?: INode, description?: string) {
super(message, { cause: undefined });
this.level = 'warning';