mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor: Fix TypeScript errors workflow package (#9437)
This commit is contained in:
parent
2967df2fe0
commit
451e6590d6
|
@ -11,7 +11,7 @@
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"types": ["vitest/globals"],
|
"types": ["vitest/globals", "../workflow/src/types.d.ts"],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"],
|
"@/*": ["src/*"],
|
||||||
"n8n-design-system/*": ["../design-system/src/*"],
|
"n8n-design-system/*": ["../design-system/src/*"],
|
||||||
|
|
|
@ -29,7 +29,7 @@ export function augmentArray<T>(data: T[]): T[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
const proxy = new Proxy(data, {
|
const proxy = new Proxy(data, {
|
||||||
deleteProperty(target, key: string) {
|
deleteProperty(_target, key: string) {
|
||||||
return Reflect.deleteProperty(getData(), key);
|
return Reflect.deleteProperty(getData(), key);
|
||||||
},
|
},
|
||||||
get(target, key: string, receiver): unknown {
|
get(target, key: string, receiver): unknown {
|
||||||
|
@ -59,7 +59,7 @@ export function augmentArray<T>(data: T[]): T[] {
|
||||||
ownKeys(target) {
|
ownKeys(target) {
|
||||||
return Reflect.ownKeys(newData ?? 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
|
// 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
|
// 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
|
// 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;
|
if (deletedProperties.has(key)) return undefined;
|
||||||
return Object.getOwnPropertyDescriptor(key in newData ? newData : data, key);
|
return Object.getOwnPropertyDescriptor(key in newData ? newData : data, key);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { NativeDoc } from '@/Extensions/Extensions';
|
import type { NativeDoc } from '../Extensions/Extensions';
|
||||||
|
|
||||||
export const arrayMethods: NativeDoc = {
|
export const arrayMethods: NativeDoc = {
|
||||||
typeName: 'Array',
|
typeName: 'Array',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { NativeDoc } from '@/Extensions/Extensions';
|
import type { NativeDoc } from '../Extensions/Extensions';
|
||||||
|
|
||||||
export const booleanMethods: NativeDoc = {
|
export const booleanMethods: NativeDoc = {
|
||||||
typeName: 'Boolean',
|
typeName: 'Boolean',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { NativeDoc } from '@/Extensions/Extensions';
|
import type { NativeDoc } from '../Extensions/Extensions';
|
||||||
|
|
||||||
export const numberMethods: NativeDoc = {
|
export const numberMethods: NativeDoc = {
|
||||||
typeName: 'Number',
|
typeName: 'Number',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { NativeDoc } from '@/Extensions/Extensions';
|
import type { NativeDoc } from '../Extensions/Extensions';
|
||||||
|
|
||||||
export const objectMethods: NativeDoc = {
|
export const objectMethods: NativeDoc = {
|
||||||
typeName: 'Object',
|
typeName: 'Object',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { NativeDoc } from '@/Extensions/Extensions';
|
import type { NativeDoc } from '../Extensions/Extensions';
|
||||||
|
|
||||||
export const stringMethods: NativeDoc = {
|
export const stringMethods: NativeDoc = {
|
||||||
typeName: 'String',
|
typeName: 'String',
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { stringMethods } from './String.methods';
|
||||||
import { arrayMethods } from './Array.methods';
|
import { arrayMethods } from './Array.methods';
|
||||||
import { numberMethods } from './Number.methods';
|
import { numberMethods } from './Number.methods';
|
||||||
import { objectMethods } from './Object.Methods';
|
import { objectMethods } from './Object.Methods';
|
||||||
import type { NativeDoc } from '@/Extensions/Extensions';
|
import type { NativeDoc } from '../Extensions/Extensions';
|
||||||
import { booleanMethods } from './Boolean.methods';
|
import { booleanMethods } from './Boolean.methods';
|
||||||
|
|
||||||
const NATIVE_METHODS: NativeDoc[] = [
|
const NATIVE_METHODS: NativeDoc[] = [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { INode } from '@/Interfaces';
|
import type { INode } from '../Interfaces';
|
||||||
import { ExecutionBaseError } from './abstract/execution-base.error';
|
import { ExecutionBaseError } from './abstract/execution-base.error';
|
||||||
|
|
||||||
export class CredentialAccessError extends ExecutionBaseError {
|
export class CredentialAccessError extends ExecutionBaseError {
|
||||||
|
|
|
@ -6,8 +6,6 @@ import { NodeError } from './abstract/node.error';
|
||||||
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
||||||
*/
|
*/
|
||||||
export class NodeOperationError extends NodeError {
|
export class NodeOperationError extends NodeError {
|
||||||
lineNumber: number | undefined;
|
|
||||||
|
|
||||||
type: string | undefined;
|
type: string | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|
|
@ -9,10 +9,6 @@ export class WorkflowOperationError extends ExecutionBaseError {
|
||||||
|
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
|
|
||||||
lineNumber: number | undefined;
|
|
||||||
|
|
||||||
description: string | undefined;
|
|
||||||
|
|
||||||
constructor(message: string, node?: INode, description?: string) {
|
constructor(message: string, node?: INode, description?: string) {
|
||||||
super(message, { cause: undefined });
|
super(message, { cause: undefined });
|
||||||
this.level = 'warning';
|
this.level = 'warning';
|
||||||
|
|
Loading…
Reference in a new issue