n8n-workflow
Advanced tools
Comparing version 0.147.1 to 0.148.0
@@ -26,3 +26,3 @@ /// <reference types="node" /> | ||
export { LoggerProxy, NodeHelpers, ObservableObject, TelemetryHelpers }; | ||
export { deepCopy, jsonParse, jsonStringify, sleep, fileTypeFromMimeType, assert } from './utils'; | ||
export { isObjectEmpty, deepCopy, jsonParse, jsonStringify, sleep, fileTypeFromMimeType, assert, } from './utils'; | ||
export { isINodeProperties, isINodePropertyOptions, isINodePropertyCollection, isINodePropertiesList, isINodePropertyCollectionList, isINodePropertyOptionsList, } from './type-guards'; | ||
@@ -29,0 +29,0 @@ export { ExpressionExtensions } from './Extensions'; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NativeMethods = exports.ExpressionExtensions = exports.isINodePropertyOptionsList = exports.isINodePropertyCollectionList = exports.isINodePropertiesList = exports.isINodePropertyCollection = exports.isINodePropertyOptions = exports.isINodeProperties = exports.assert = exports.fileTypeFromMimeType = exports.sleep = exports.jsonStringify = exports.jsonParse = exports.deepCopy = exports.TelemetryHelpers = exports.ObservableObject = exports.NodeHelpers = exports.LoggerProxy = exports.ErrorReporterProxy = void 0; | ||
exports.NativeMethods = exports.ExpressionExtensions = exports.isINodePropertyOptionsList = exports.isINodePropertyCollectionList = exports.isINodePropertiesList = exports.isINodePropertyCollection = exports.isINodePropertyOptions = exports.isINodeProperties = exports.assert = exports.fileTypeFromMimeType = exports.sleep = exports.jsonStringify = exports.jsonParse = exports.deepCopy = exports.isObjectEmpty = exports.TelemetryHelpers = exports.ObservableObject = exports.NodeHelpers = exports.LoggerProxy = exports.ErrorReporterProxy = void 0; | ||
const LoggerProxy = __importStar(require("./LoggerProxy")); | ||
@@ -59,2 +59,3 @@ exports.LoggerProxy = LoggerProxy; | ||
var utils_1 = require("./utils"); | ||
Object.defineProperty(exports, "isObjectEmpty", { enumerable: true, get: function () { return utils_1.isObjectEmpty; } }); | ||
Object.defineProperty(exports, "deepCopy", { enumerable: true, get: function () { return utils_1.deepCopy; } }); | ||
@@ -61,0 +62,0 @@ Object.defineProperty(exports, "jsonParse", { enumerable: true, get: function () { return utils_1.jsonParse; } }); |
@@ -174,3 +174,3 @@ "use strict"; | ||
'502': 'Bad gateway - the service failed to handle your request', | ||
'503': 'Service unavailable - perhaps try again later?', | ||
'503': 'Service unavailable - try again later or consider setting this node to retry automatically (in the node settings)', | ||
'504': 'Gateway timed out - perhaps try again later?', | ||
@@ -183,2 +183,3 @@ ECONNREFUSED: 'The service refused the connection - perhaps it is offline', | ||
constructor(node, error, { message, description, httpCode, parseXml, runIndex, itemIndex } = {}) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
super(node, error); | ||
@@ -188,2 +189,28 @@ if (error.error) { | ||
} | ||
if ((!message && (error.message || ((_a = error === null || error === void 0 ? void 0 : error.reason) === null || _a === void 0 ? void 0 : _a.message))) || description) { | ||
this.message = ((_d = (_b = error.message) !== null && _b !== void 0 ? _b : (_c = error === null || error === void 0 ? void 0 : error.reason) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : description); | ||
} | ||
if (!description && (error.description || ((_e = error === null || error === void 0 ? void 0 : error.reason) === null || _e === void 0 ? void 0 : _e.description))) { | ||
this.description = ((_f = error.description) !== null && _f !== void 0 ? _f : (_g = error === null || error === void 0 ? void 0 : error.reason) === null || _g === void 0 ? void 0 : _g.description); | ||
} | ||
if (!httpCode && | ||
!message && | ||
this.message && | ||
this.message.toUpperCase().includes('ECONNREFUSED')) { | ||
httpCode = 'ECONNREFUSED'; | ||
const originalMessage = this.message; | ||
if (!description) { | ||
this.description = `${originalMessage}; ${(_h = this.description) !== null && _h !== void 0 ? _h : ''}`; | ||
} | ||
} | ||
if (!httpCode && | ||
!message && | ||
this.message && | ||
this.message.toLowerCase().includes('bad gateway')) { | ||
httpCode = '502'; | ||
const originalMessage = this.message; | ||
if (!description) { | ||
this.description = `${originalMessage}; ${(_j = this.description) !== null && _j !== void 0 ? _j : ''}`; | ||
} | ||
} | ||
if (error.reason) { | ||
@@ -201,3 +228,8 @@ const reason = error.reason; | ||
} | ||
this.httpCode = this.findProperty(error, ERROR_STATUS_PROPERTIES, ERROR_NESTING_PROPERTIES); | ||
if (httpCode) { | ||
this.httpCode = httpCode; | ||
} | ||
else { | ||
this.httpCode = this.findProperty(error, ERROR_STATUS_PROPERTIES, ERROR_NESTING_PROPERTIES); | ||
} | ||
this.setMessage(); | ||
@@ -225,3 +257,3 @@ if (parseXml) { | ||
this.httpCode = null; | ||
this.message = UNKNOWN_ERROR_MESSAGE; | ||
this.message = this.message || this.description || UNKNOWN_ERROR_MESSAGE; | ||
return; | ||
@@ -241,3 +273,3 @@ } | ||
default: | ||
this.message = UNKNOWN_ERROR_MESSAGE; | ||
this.message = this.message || this.description || UNKNOWN_ERROR_MESSAGE; | ||
} | ||
@@ -244,0 +276,0 @@ if (this.node.type === 'n8n-nodes-base.noOp' && this.message === UNKNOWN_ERROR_MESSAGE) { |
import type { BinaryFileType } from './Interfaces'; | ||
export declare const isObjectEmpty: (obj: object | null | undefined) => boolean; | ||
export type Primitives = string | number | boolean | bigint | symbol | null | undefined; | ||
@@ -3,0 +4,0 @@ export declare const deepCopy: <T extends Primitives | ((object | Date) & { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.assert = exports.fileTypeFromMimeType = exports.sleep = exports.jsonStringify = exports.jsonParse = exports.deepCopy = void 0; | ||
exports.assert = exports.fileTypeFromMimeType = exports.sleep = exports.jsonStringify = exports.jsonParse = exports.deepCopy = exports.isObjectEmpty = void 0; | ||
const readStreamClasses = new Set(['ReadStream', 'Readable', 'ReadableStream']); | ||
const isObjectEmpty = (obj) => { | ||
if (obj === undefined || obj === null) | ||
return true; | ||
if (typeof obj === 'object') { | ||
if (Array.isArray(obj)) | ||
return obj.length === 0; | ||
if (obj instanceof Set || obj instanceof Map) | ||
return obj.size === 0; | ||
if (ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer) | ||
return obj.byteLength === 0; | ||
if (Symbol.iterator in obj || readStreamClasses.has(obj.constructor.name)) | ||
return false; | ||
return Object.keys(obj).length === 0; | ||
} | ||
return true; | ||
}; | ||
exports.isObjectEmpty = isObjectEmpty; | ||
const deepCopy = (source, hash = new WeakMap(), path = '') => { | ||
@@ -5,0 +23,0 @@ const hasOwnProp = Object.prototype.hasOwnProperty.bind(source); |
{ | ||
"name": "n8n-workflow", | ||
"version": "0.147.1", | ||
"version": "0.148.0", | ||
"description": "Workflow base code of n8n", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
652770
8875