Skip to content

Commit

Permalink
Fix TypeScript errors workflow package
Browse files Browse the repository at this point in the history
  • Loading branch information
elsmr committed May 17, 2024
1 parent ce3eb12 commit 84ad6a4
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/editor-ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"],
Expand Down
6 changes: 3 additions & 3 deletions packages/workflow/src/AugmentObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
},
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/src/NativeMethods/Array.methods.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';

export const arrayMethods: NativeDoc = {
typeName: 'Array',
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/src/NativeMethods/Boolean.methods.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';

export const booleanMethods: NativeDoc = {
typeName: 'Boolean',
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/src/NativeMethods/Number.methods.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';

export const numberMethods: NativeDoc = {
typeName: 'Number',
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/src/NativeMethods/Object.Methods.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';

export const objectMethods: NativeDoc = {
typeName: 'Object',
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/src/NativeMethods/String.methods.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NativeDoc } from '@/Extensions/Extensions';
import type { NativeDoc } from '../Extensions/Extensions';

export const stringMethods: NativeDoc = {
typeName: 'String',
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/src/NativeMethods/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/src/errors/credential-access-error.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions packages/workflow/src/errors/node-operation.error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 0 additions & 4 deletions packages/workflow/src/errors/workflow-operation.error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 84ad6a4

Please sign in to comment.