@fsai-flow/workflow 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -2
- package/package.json +1 -4
- package/src/lib/Interfaces.ts +33 -0
- package/src/lib/Workflow.ts +4 -0
- package/src/lib/utils.ts +123 -89
- package/dist/README.md +0 -11
- package/dist/package.json +0 -42
- package/dist/src/index.d.ts +0 -21
- package/dist/src/index.js +0 -33
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/Constants.d.ts +0 -68
- package/dist/src/lib/Constants.js +0 -106
- package/dist/src/lib/Constants.js.map +0 -1
- package/dist/src/lib/DeferredPromise.d.ts +0 -6
- package/dist/src/lib/DeferredPromise.js +0 -11
- package/dist/src/lib/DeferredPromise.js.map +0 -1
- package/dist/src/lib/Expression.d.ts +0 -65
- package/dist/src/lib/Expression.js +0 -215
- package/dist/src/lib/Expression.js.map +0 -1
- package/dist/src/lib/Interfaces.d.ts +0 -1569
- package/dist/src/lib/Interfaces.js +0 -44
- package/dist/src/lib/Interfaces.js.map +0 -1
- package/dist/src/lib/LoggerProxy.d.ts +0 -9
- package/dist/src/lib/LoggerProxy.js +0 -40
- package/dist/src/lib/LoggerProxy.js.map +0 -1
- package/dist/src/lib/MetadataUtils.d.ts +0 -4
- package/dist/src/lib/MetadataUtils.js +0 -27
- package/dist/src/lib/MetadataUtils.js.map +0 -1
- package/dist/src/lib/NodeErrors.d.ts +0 -82
- package/dist/src/lib/NodeErrors.js +0 -289
- package/dist/src/lib/NodeErrors.js.map +0 -1
- package/dist/src/lib/NodeHelpers.d.ts +0 -198
- package/dist/src/lib/NodeHelpers.js +0 -1348
- package/dist/src/lib/NodeHelpers.js.map +0 -1
- package/dist/src/lib/ObservableObject.d.ts +0 -5
- package/dist/src/lib/ObservableObject.js +0 -61
- package/dist/src/lib/ObservableObject.js.map +0 -1
- package/dist/src/lib/RoutingNode.d.ts +0 -18
- package/dist/src/lib/RoutingNode.js +0 -508
- package/dist/src/lib/RoutingNode.js.map +0 -1
- package/dist/src/lib/TelemetryHelpers.d.ts +0 -3
- package/dist/src/lib/TelemetryHelpers.js +0 -69
- package/dist/src/lib/TelemetryHelpers.js.map +0 -1
- package/dist/src/lib/TypeValidation.d.ts +0 -21
- package/dist/src/lib/TypeValidation.js +0 -385
- package/dist/src/lib/TypeValidation.js.map +0 -1
- package/dist/src/lib/VersionedNodeType.d.ts +0 -9
- package/dist/src/lib/VersionedNodeType.js +0 -26
- package/dist/src/lib/VersionedNodeType.js.map +0 -1
- package/dist/src/lib/Workflow.d.ts +0 -248
- package/dist/src/lib/Workflow.js +0 -901
- package/dist/src/lib/Workflow.js.map +0 -1
- package/dist/src/lib/WorkflowDataProxy.d.ts +0 -87
- package/dist/src/lib/WorkflowDataProxy.js +0 -556
- package/dist/src/lib/WorkflowDataProxy.js.map +0 -1
- package/dist/src/lib/WorkflowErrors.d.ts +0 -9
- package/dist/src/lib/WorkflowErrors.js +0 -18
- package/dist/src/lib/WorkflowErrors.js.map +0 -1
- package/dist/src/lib/WorkflowHooks.d.ts +0 -11
- package/dist/src/lib/WorkflowHooks.js +0 -34
- package/dist/src/lib/WorkflowHooks.js.map +0 -1
- package/dist/src/lib/errors/base/base.error.d.ts +0 -30
- package/dist/src/lib/errors/base/base.error.js +0 -45
- package/dist/src/lib/errors/base/base.error.js.map +0 -1
- package/dist/src/lib/errors/base/operational.error.d.ts +0 -15
- package/dist/src/lib/errors/base/operational.error.js +0 -19
- package/dist/src/lib/errors/base/operational.error.js.map +0 -1
- package/dist/src/lib/errors/error.types.d.ts +0 -11
- package/dist/src/lib/errors/error.types.js +0 -3
- package/dist/src/lib/errors/error.types.js.map +0 -1
- package/dist/src/lib/errors/index.d.ts +0 -1
- package/dist/src/lib/errors/index.js +0 -6
- package/dist/src/lib/errors/index.js.map +0 -1
- package/dist/src/lib/result.d.ts +0 -19
- package/dist/src/lib/result.js +0 -36
- package/dist/src/lib/result.js.map +0 -1
- package/dist/src/lib/utils.d.ts +0 -50
- package/dist/src/lib/utils.js +0 -110
- package/dist/src/lib/utils.js.map +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeConnectionTypes = exports.Node = exports.ICredentialsHelper = exports.ICredentials = void 0;
|
|
4
|
-
class ICredentials {
|
|
5
|
-
id;
|
|
6
|
-
name;
|
|
7
|
-
type;
|
|
8
|
-
data;
|
|
9
|
-
nodesAccess;
|
|
10
|
-
constructor(nodeCredentials, type, nodesAccess, data) {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
12
|
-
this.id = nodeCredentials.id || undefined;
|
|
13
|
-
this.name = nodeCredentials.name;
|
|
14
|
-
this.type = type;
|
|
15
|
-
this.nodesAccess = nodesAccess;
|
|
16
|
-
this.data = data;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.ICredentials = ICredentials;
|
|
20
|
-
class ICredentialsHelper {
|
|
21
|
-
encryptionKey;
|
|
22
|
-
constructor(encryptionKey) {
|
|
23
|
-
this.encryptionKey = encryptionKey;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.ICredentialsHelper = ICredentialsHelper;
|
|
27
|
-
class Node {
|
|
28
|
-
}
|
|
29
|
-
exports.Node = Node;
|
|
30
|
-
exports.NodeConnectionTypes = {
|
|
31
|
-
AiAgent: 'ai_agent',
|
|
32
|
-
AiChain: 'ai_chain',
|
|
33
|
-
AiDocument: 'ai_document',
|
|
34
|
-
AiEmbedding: 'ai_embedding',
|
|
35
|
-
AiLanguageModel: 'ai_languageModel',
|
|
36
|
-
AiMemory: 'ai_memory',
|
|
37
|
-
AiOutputParser: 'ai_outputParser',
|
|
38
|
-
AiRetriever: 'ai_retriever',
|
|
39
|
-
AiTextSplitter: 'ai_textSplitter',
|
|
40
|
-
AiTool: 'ai_tool',
|
|
41
|
-
AiVectorStore: 'ai_vectorStore',
|
|
42
|
-
Main: 'main',
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=Interfaces.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../../../src/lib/Interfaces.ts"],"names":[],"mappings":";;;AAmEA,MAAsB,YAAY;IACjC,EAAE,CAAU;IAEZ,IAAI,CAAS;IAEb,IAAI,CAAS;IAEb,IAAI,CAAqB;IAEzB,WAAW,CAA0B;IAErC,YACC,eAAwC,EACxC,IAAY,EACZ,WAAoC,EACpC,IAAa;QAEb,wEAAwE;QACxE,IAAI,CAAC,EAAE,GAAG,eAAe,CAAC,EAAE,IAAI,SAAS,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CAaD;AApCD,oCAoCC;AAsDD,MAAsB,kBAAkB;IACvC,aAAa,CAAS;IAEtB,YAAY,aAAqB;QAChC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACpC,CAAC;CA8BD;AAnCD,gDAmCC;AASD,MAAsB,IAAI;CAKzB;AALD,oBAKC;AA82CY,QAAA,mBAAmB,GAAG;IAClC,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,kBAAkB;IACnC,QAAQ,EAAE,WAAW;IACrB,cAAc,EAAE,iBAAiB;IACjC,WAAW,EAAE,cAAc;IAC3B,cAAc,EAAE,iBAAiB;IACjC,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,gBAAgB;IAC/B,IAAI,EAAE,MAAM;CACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ILogger, LogTypes } from './Interfaces';
|
|
2
|
-
export declare function init(loggerInstance: ILogger): void;
|
|
3
|
-
export declare function getInstance(): ILogger;
|
|
4
|
-
export declare function log(type: LogTypes, message: string, meta?: object): void;
|
|
5
|
-
export declare function debug(message: string, meta?: object): void;
|
|
6
|
-
export declare function info(message: string, meta?: object): void;
|
|
7
|
-
export declare function error(message: string, meta?: object): void;
|
|
8
|
-
export declare function verbose(message: string, meta?: object): void;
|
|
9
|
-
export declare function warn(message: string, meta?: object): void;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.init = init;
|
|
4
|
-
exports.getInstance = getInstance;
|
|
5
|
-
exports.log = log;
|
|
6
|
-
exports.debug = debug;
|
|
7
|
-
exports.info = info;
|
|
8
|
-
exports.error = error;
|
|
9
|
-
exports.verbose = verbose;
|
|
10
|
-
exports.warn = warn;
|
|
11
|
-
let logger;
|
|
12
|
-
function init(loggerInstance) {
|
|
13
|
-
logger = loggerInstance;
|
|
14
|
-
}
|
|
15
|
-
function getInstance() {
|
|
16
|
-
if (logger === undefined) {
|
|
17
|
-
throw new Error('LoggerProxy not initialized');
|
|
18
|
-
}
|
|
19
|
-
return logger;
|
|
20
|
-
}
|
|
21
|
-
function log(type, message, meta = {}) {
|
|
22
|
-
getInstance().log(type, message, meta);
|
|
23
|
-
}
|
|
24
|
-
// Convenience methods below
|
|
25
|
-
function debug(message, meta = {}) {
|
|
26
|
-
getInstance().log('debug', message, meta);
|
|
27
|
-
}
|
|
28
|
-
function info(message, meta = {}) {
|
|
29
|
-
getInstance().log('info', message, meta);
|
|
30
|
-
}
|
|
31
|
-
function error(message, meta = {}) {
|
|
32
|
-
getInstance().log('error', message, meta);
|
|
33
|
-
}
|
|
34
|
-
function verbose(message, meta = {}) {
|
|
35
|
-
getInstance().log('verbose', message, meta);
|
|
36
|
-
}
|
|
37
|
-
function warn(message, meta = {}) {
|
|
38
|
-
getInstance().log('warn', message, meta);
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=LoggerProxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerProxy.js","sourceRoot":"","sources":["../../../src/lib/LoggerProxy.ts"],"names":[],"mappings":";;AAMA,oBAEC;AAED,kCAMC;AAED,kBAEC;AAID,sBAEC;AAED,oBAEC;AAED,sBAEC;AAED,0BAEC;AAED,oBAEC;AAtCD,IAAI,MAA2B,CAAC;AAEhC,SAAgB,IAAI,CAAC,cAAuB;IAC3C,MAAM,GAAG,cAAc,CAAC;AACzB,CAAC;AAED,SAAgB,WAAW;IAC1B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAgB,GAAG,CAAC,IAAc,EAAE,OAAe,EAAE,OAAe,EAAE;IACrE,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,4BAA4B;AAE5B,SAAgB,KAAK,CAAC,OAAe,EAAE,OAAe,EAAE;IACvD,WAAW,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,IAAI,CAAC,OAAe,EAAE,OAAe,EAAE;IACtD,WAAW,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,SAAgB,KAAK,CAAC,OAAe,EAAE,OAAe,EAAE;IACvD,WAAW,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,OAAO,CAAC,OAAe,EAAE,OAAe,EAAE;IACzD,WAAW,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,IAAI,CAAC,OAAe,EAAE,OAAe,EAAE;IACtD,WAAW,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseErrorMetadata = parseErrorMetadata;
|
|
4
|
-
const utils_1 = require("./utils");
|
|
5
|
-
function responseHasSubworkflowData(response) {
|
|
6
|
-
return ['executionId', 'workflowId'].every((x) => (0, utils_1.hasKey)(response, x) && typeof response[x] === 'string');
|
|
7
|
-
}
|
|
8
|
-
function parseErrorResponseWorkflowMetadata(response) {
|
|
9
|
-
if (!responseHasSubworkflowData(response))
|
|
10
|
-
return undefined;
|
|
11
|
-
return {
|
|
12
|
-
subExecution: {
|
|
13
|
-
executionId: response.executionId,
|
|
14
|
-
workflowId: response.workflowId,
|
|
15
|
-
},
|
|
16
|
-
subExecutionsCount: 1,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function parseErrorMetadata(error) {
|
|
20
|
-
if ((0, utils_1.hasKey)(error, 'errorResponse')) {
|
|
21
|
-
return parseErrorResponseWorkflowMetadata(error.errorResponse);
|
|
22
|
-
}
|
|
23
|
-
// This accounts for cases where the backend attaches the properties on plain errors
|
|
24
|
-
// e.g. from custom nodes throwing literal `Error` or `ApplicationError` objects directly
|
|
25
|
-
return parseErrorResponseWorkflowMetadata(error);
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=MetadataUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetadataUtils.js","sourceRoot":"","sources":["../../../src/lib/MetadataUtils.ts"],"names":[],"mappings":";;AAyBA,gDAQC;AAhCD,mCAAiC;AAEjC,SAAS,0BAA0B,CAClC,QAAiB;IAEjB,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,KAAK,CACzC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,cAAM,EAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,CAC7D,CAAC;AACH,CAAC;AAID,SAAS,kCAAkC,CAAC,QAAiB;IAC5D,IAAI,CAAC,0BAA0B,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IAE5D,OAAO;QACN,YAAY,EAAE;YACb,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,UAAU,EAAE,QAAQ,CAAC,UAAU;SAC/B;QACD,kBAAkB,EAAE,CAAC;KACrB,CAAC;AACH,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAc;IAChD,IAAI,IAAA,cAAM,EAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,kCAAkC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAChE,CAAC;IAED,oFAAoF;IACpF,yFAAyF;IACzF,OAAO,kCAAkC,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { INode, JsonObject } from '..';
|
|
2
|
-
/**
|
|
3
|
-
* Base class for specific NodeError-types, with functionality for finding
|
|
4
|
-
* a value recursively inside an error object.
|
|
5
|
-
*/
|
|
6
|
-
declare abstract class NodeError extends Error {
|
|
7
|
-
description: string | null | undefined;
|
|
8
|
-
cause: Error | JsonObject;
|
|
9
|
-
node: INode;
|
|
10
|
-
timestamp: number;
|
|
11
|
-
constructor(node: INode, error: Error | JsonObject);
|
|
12
|
-
/**
|
|
13
|
-
* Finds property through exploration based on potential keys and traversal keys.
|
|
14
|
-
* Depth-first approach.
|
|
15
|
-
*
|
|
16
|
-
* This method iterates over `potentialKeys` and, if the value at the key is a
|
|
17
|
-
* truthy value, the type of the value is checked:
|
|
18
|
-
* (1) if a string or number, the value is returned as a string; or
|
|
19
|
-
* (2) if an array,
|
|
20
|
-
* its string or number elements are collected as a long string,
|
|
21
|
-
* its object elements are traversed recursively (restart this function
|
|
22
|
-
* with each object as a starting point), or
|
|
23
|
-
* (3) if it is an object, it traverses the object and nested ones recursively
|
|
24
|
-
* based on the `potentialKeys` and returns a string if found.
|
|
25
|
-
*
|
|
26
|
-
* If nothing found via `potentialKeys` this method iterates over `traversalKeys` and
|
|
27
|
-
* if the value at the key is a traversable object, it restarts with the object as the
|
|
28
|
-
* new starting point (recursion).
|
|
29
|
-
* If nothing found for any of the `traversalKeys`, exploration continues with remaining
|
|
30
|
-
* `traversalKeys`.
|
|
31
|
-
*
|
|
32
|
-
* Otherwise, if all the paths have been exhausted and no value is eligible, `null` is
|
|
33
|
-
* returned.
|
|
34
|
-
*
|
|
35
|
-
* @param {JsonObject} error
|
|
36
|
-
* @param {string[]} potentialKeys
|
|
37
|
-
* @param {string[]} traversalKeys
|
|
38
|
-
* @returns {string | null}
|
|
39
|
-
*/
|
|
40
|
-
protected findProperty(error: JsonObject, potentialKeys: string[], traversalKeys?: string[]): string | null;
|
|
41
|
-
/**
|
|
42
|
-
* Check if a value is an object with at least one key, i.e. it can be traversed.
|
|
43
|
-
*/
|
|
44
|
-
protected isTraversableObject(value: any): value is JsonObject;
|
|
45
|
-
/**
|
|
46
|
-
* Remove circular references from objects.
|
|
47
|
-
*/
|
|
48
|
-
protected removeCircularRefs(obj: JsonObject, seen?: Set<unknown>): void;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
|
52
|
-
*/
|
|
53
|
-
export declare class NodeOperationError extends NodeError {
|
|
54
|
-
itemIndex?: number;
|
|
55
|
-
functionality?: string;
|
|
56
|
-
constructor(node: INode, error: Error | string, options?: {
|
|
57
|
-
description?: string;
|
|
58
|
-
itemIndex?: number;
|
|
59
|
-
functionality?: string;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Class for instantiating an error in an API response, e.g. a 404 Not Found response,
|
|
64
|
-
* with an HTTP error code, an error message and a description.
|
|
65
|
-
*/
|
|
66
|
-
export declare class NodeApiError extends NodeError {
|
|
67
|
-
httpCode: string | null;
|
|
68
|
-
constructor(node: INode, error: JsonObject, { message, description, httpCode, parseXml, }?: {
|
|
69
|
-
message?: string;
|
|
70
|
-
description?: string;
|
|
71
|
-
httpCode?: string;
|
|
72
|
-
parseXml?: boolean;
|
|
73
|
-
});
|
|
74
|
-
private setDescriptionFromXml;
|
|
75
|
-
/**
|
|
76
|
-
* Set the error's message based on the HTTP status code.
|
|
77
|
-
*
|
|
78
|
-
* @returns {void}
|
|
79
|
-
*/
|
|
80
|
-
private setMessage;
|
|
81
|
-
}
|
|
82
|
-
export {};
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeApiError = exports.NodeOperationError = void 0;
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-shadow */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
6
|
-
/* eslint-disable no-param-reassign */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
10
|
-
// eslint-disable-next-line max-classes-per-file
|
|
11
|
-
const xml2js_1 = require("xml2js");
|
|
12
|
-
/**
|
|
13
|
-
* Top-level properties where an error message can be found in an API response.
|
|
14
|
-
*/
|
|
15
|
-
const ERROR_MESSAGE_PROPERTIES = [
|
|
16
|
-
'cause',
|
|
17
|
-
'error',
|
|
18
|
-
'message',
|
|
19
|
-
'Message',
|
|
20
|
-
'msg',
|
|
21
|
-
'messages',
|
|
22
|
-
'description',
|
|
23
|
-
'reason',
|
|
24
|
-
'detail',
|
|
25
|
-
'details',
|
|
26
|
-
'errors',
|
|
27
|
-
'errorMessage',
|
|
28
|
-
'errorMessages',
|
|
29
|
-
'ErrorMessage',
|
|
30
|
-
'error_message',
|
|
31
|
-
'_error_message',
|
|
32
|
-
'errorDescription',
|
|
33
|
-
'error_description',
|
|
34
|
-
'error_summary',
|
|
35
|
-
'title',
|
|
36
|
-
'text',
|
|
37
|
-
'field',
|
|
38
|
-
'err',
|
|
39
|
-
'type',
|
|
40
|
-
];
|
|
41
|
-
/**
|
|
42
|
-
* Top-level properties where an HTTP error code can be found in an API response.
|
|
43
|
-
*/
|
|
44
|
-
const ERROR_STATUS_PROPERTIES = [
|
|
45
|
-
'statusCode',
|
|
46
|
-
'status',
|
|
47
|
-
'code',
|
|
48
|
-
'status_code',
|
|
49
|
-
'errorCode',
|
|
50
|
-
'error_code',
|
|
51
|
-
];
|
|
52
|
-
/**
|
|
53
|
-
* Properties where a nested object can be found in an API response.
|
|
54
|
-
*/
|
|
55
|
-
const ERROR_NESTING_PROPERTIES = ['error', 'err', 'response', 'body', 'data'];
|
|
56
|
-
/**
|
|
57
|
-
* Base class for specific NodeError-types, with functionality for finding
|
|
58
|
-
* a value recursively inside an error object.
|
|
59
|
-
*/
|
|
60
|
-
class NodeError extends Error {
|
|
61
|
-
description;
|
|
62
|
-
cause;
|
|
63
|
-
node;
|
|
64
|
-
timestamp;
|
|
65
|
-
constructor(node, error) {
|
|
66
|
-
super();
|
|
67
|
-
this.name = this.constructor.name;
|
|
68
|
-
this.cause = error;
|
|
69
|
-
this.node = node;
|
|
70
|
-
this.timestamp = Date.now();
|
|
71
|
-
if (error.message) {
|
|
72
|
-
this.message = error.message;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Finds property through exploration based on potential keys and traversal keys.
|
|
77
|
-
* Depth-first approach.
|
|
78
|
-
*
|
|
79
|
-
* This method iterates over `potentialKeys` and, if the value at the key is a
|
|
80
|
-
* truthy value, the type of the value is checked:
|
|
81
|
-
* (1) if a string or number, the value is returned as a string; or
|
|
82
|
-
* (2) if an array,
|
|
83
|
-
* its string or number elements are collected as a long string,
|
|
84
|
-
* its object elements are traversed recursively (restart this function
|
|
85
|
-
* with each object as a starting point), or
|
|
86
|
-
* (3) if it is an object, it traverses the object and nested ones recursively
|
|
87
|
-
* based on the `potentialKeys` and returns a string if found.
|
|
88
|
-
*
|
|
89
|
-
* If nothing found via `potentialKeys` this method iterates over `traversalKeys` and
|
|
90
|
-
* if the value at the key is a traversable object, it restarts with the object as the
|
|
91
|
-
* new starting point (recursion).
|
|
92
|
-
* If nothing found for any of the `traversalKeys`, exploration continues with remaining
|
|
93
|
-
* `traversalKeys`.
|
|
94
|
-
*
|
|
95
|
-
* Otherwise, if all the paths have been exhausted and no value is eligible, `null` is
|
|
96
|
-
* returned.
|
|
97
|
-
*
|
|
98
|
-
* @param {JsonObject} error
|
|
99
|
-
* @param {string[]} potentialKeys
|
|
100
|
-
* @param {string[]} traversalKeys
|
|
101
|
-
* @returns {string | null}
|
|
102
|
-
*/
|
|
103
|
-
findProperty(error, potentialKeys, traversalKeys = []) {
|
|
104
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
105
|
-
for (const key of potentialKeys) {
|
|
106
|
-
if (error[key]) {
|
|
107
|
-
if (typeof error[key] === 'string')
|
|
108
|
-
return error[key];
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
110
|
-
if (typeof error[key] === 'number')
|
|
111
|
-
return error[key].toString();
|
|
112
|
-
if (Array.isArray(error[key])) {
|
|
113
|
-
// @ts-ignore
|
|
114
|
-
const resolvedErrors = error[key]
|
|
115
|
-
// @ts-ignore
|
|
116
|
-
.map((error) => {
|
|
117
|
-
if (typeof error === 'string')
|
|
118
|
-
return error;
|
|
119
|
-
if (typeof error === 'number')
|
|
120
|
-
return error.toString();
|
|
121
|
-
if (this.isTraversableObject(error)) {
|
|
122
|
-
return this.findProperty(error, potentialKeys);
|
|
123
|
-
}
|
|
124
|
-
return null;
|
|
125
|
-
})
|
|
126
|
-
.filter((errorValue) => errorValue !== null);
|
|
127
|
-
if (resolvedErrors.length === 0) {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
return resolvedErrors.join(' | ');
|
|
131
|
-
}
|
|
132
|
-
if (this.isTraversableObject(error[key])) {
|
|
133
|
-
const property = this.findProperty(error[key], potentialKeys);
|
|
134
|
-
if (property) {
|
|
135
|
-
return property;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
141
|
-
for (const key of traversalKeys) {
|
|
142
|
-
if (this.isTraversableObject(error[key])) {
|
|
143
|
-
const property = this.findProperty(error[key], potentialKeys, traversalKeys);
|
|
144
|
-
if (property) {
|
|
145
|
-
return property;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Check if a value is an object with at least one key, i.e. it can be traversed.
|
|
153
|
-
*/
|
|
154
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
|
-
isTraversableObject(value) {
|
|
156
|
-
return (value && typeof value === 'object' && !Array.isArray(value) && !!Object.keys(value).length);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Remove circular references from objects.
|
|
160
|
-
*/
|
|
161
|
-
removeCircularRefs(obj, seen = new Set()) {
|
|
162
|
-
seen.add(obj);
|
|
163
|
-
Object.entries(obj).forEach(([key, value]) => {
|
|
164
|
-
if (this.isTraversableObject(value)) {
|
|
165
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
166
|
-
seen.has(value)
|
|
167
|
-
? (obj[key] = { circularReference: true })
|
|
168
|
-
: this.removeCircularRefs(value, seen);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (Array.isArray(value)) {
|
|
172
|
-
value.forEach((val, index) => {
|
|
173
|
-
if (seen.has(val)) {
|
|
174
|
-
value[index] = { circularReference: true };
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (this.isTraversableObject(val)) {
|
|
178
|
-
this.removeCircularRefs(val, seen);
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
|
187
|
-
*/
|
|
188
|
-
class NodeOperationError extends NodeError {
|
|
189
|
-
itemIndex;
|
|
190
|
-
functionality;
|
|
191
|
-
constructor(node, error, options) {
|
|
192
|
-
if (typeof error === 'string') {
|
|
193
|
-
error = new Error(error);
|
|
194
|
-
}
|
|
195
|
-
super(node, error);
|
|
196
|
-
if (options?.description) {
|
|
197
|
-
this.description = options.description;
|
|
198
|
-
}
|
|
199
|
-
if (options?.itemIndex !== undefined) {
|
|
200
|
-
this.itemIndex = options.itemIndex;
|
|
201
|
-
}
|
|
202
|
-
if (options?.functionality) {
|
|
203
|
-
this.functionality = options.functionality;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
exports.NodeOperationError = NodeOperationError;
|
|
208
|
-
const STATUS_CODE_MESSAGES = {
|
|
209
|
-
'4XX': 'Your request is invalid or could not be processed by the service',
|
|
210
|
-
'400': 'Bad request - please check your parameters',
|
|
211
|
-
'401': 'Authorization failed - please check your credentials',
|
|
212
|
-
'402': 'Payment required - perhaps check your payment details?',
|
|
213
|
-
'403': 'Forbidden - perhaps check your credentials?',
|
|
214
|
-
'404': 'The resource you are requesting could not be found',
|
|
215
|
-
'405': 'Method not allowed - please check you are using the right HTTP method',
|
|
216
|
-
'429': 'The service is receiving too many requests from you! Perhaps take a break?',
|
|
217
|
-
'5XX': 'The service failed to process your request',
|
|
218
|
-
'500': 'The service was not able to process your request',
|
|
219
|
-
'502': 'Bad gateway - the service failed to handle your request',
|
|
220
|
-
'503': 'Service unavailable - perhaps try again later?',
|
|
221
|
-
'504': 'Gateway timed out - perhaps try again later?',
|
|
222
|
-
};
|
|
223
|
-
const UNKNOWN_ERROR_MESSAGE = 'UNKNOWN ERROR - check the detailed error for more information';
|
|
224
|
-
/**
|
|
225
|
-
* Class for instantiating an error in an API response, e.g. a 404 Not Found response,
|
|
226
|
-
* with an HTTP error code, an error message and a description.
|
|
227
|
-
*/
|
|
228
|
-
class NodeApiError extends NodeError {
|
|
229
|
-
httpCode;
|
|
230
|
-
constructor(node, error, { message, description, httpCode, parseXml, } = {}) {
|
|
231
|
-
super(node, error);
|
|
232
|
-
if (error['error']) {
|
|
233
|
-
// only for request library error
|
|
234
|
-
this.removeCircularRefs(error['error']);
|
|
235
|
-
}
|
|
236
|
-
if (message) {
|
|
237
|
-
this.message = message;
|
|
238
|
-
this.description = description;
|
|
239
|
-
this.httpCode = httpCode ?? null;
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
this.httpCode = this.findProperty(error, ERROR_STATUS_PROPERTIES, ERROR_NESTING_PROPERTIES);
|
|
243
|
-
this.setMessage();
|
|
244
|
-
if (parseXml) {
|
|
245
|
-
this.setDescriptionFromXml(error['error']);
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
this.description = this.findProperty(error, ERROR_MESSAGE_PROPERTIES, ERROR_NESTING_PROPERTIES);
|
|
249
|
-
}
|
|
250
|
-
setDescriptionFromXml(xml) {
|
|
251
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
252
|
-
(0, xml2js_1.parseString)(xml, { explicitArray: false }, (_, result) => {
|
|
253
|
-
if (!result)
|
|
254
|
-
return;
|
|
255
|
-
const topLevelKey = Object.keys(result)[0];
|
|
256
|
-
this.description = this.findProperty(
|
|
257
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
258
|
-
result[topLevelKey], ERROR_MESSAGE_PROPERTIES, ['Error'].concat(ERROR_NESTING_PROPERTIES));
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Set the error's message based on the HTTP status code.
|
|
263
|
-
*
|
|
264
|
-
* @returns {void}
|
|
265
|
-
*/
|
|
266
|
-
setMessage() {
|
|
267
|
-
if (!this.httpCode) {
|
|
268
|
-
this.httpCode = null;
|
|
269
|
-
this.message = UNKNOWN_ERROR_MESSAGE;
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
if (STATUS_CODE_MESSAGES[this.httpCode]) {
|
|
273
|
-
this.message = STATUS_CODE_MESSAGES[this.httpCode];
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
switch (this.httpCode.charAt(0)) {
|
|
277
|
-
case '4':
|
|
278
|
-
this.message = STATUS_CODE_MESSAGES['4XX'];
|
|
279
|
-
break;
|
|
280
|
-
case '5':
|
|
281
|
-
this.message = STATUS_CODE_MESSAGES['5XX'];
|
|
282
|
-
break;
|
|
283
|
-
default:
|
|
284
|
-
this.message = UNKNOWN_ERROR_MESSAGE;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
exports.NodeApiError = NodeApiError;
|
|
289
|
-
//# sourceMappingURL=NodeErrors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeErrors.js","sourceRoot":"","sources":["../../../src/lib/NodeErrors.ts"],"names":[],"mappings":";;;AAAA,iDAAiD;AACjD,sDAAsD;AACtD,sCAAsC;AACtC,+DAA+D;AAC/D,wDAAwD;AACxD,4DAA4D;AAC5D,gDAAgD;AAChD,mCAAqC;AAIrC;;GAEG;AACH,MAAM,wBAAwB,GAAG;IAChC,OAAO;IACP,OAAO;IACP,SAAS;IACT,SAAS;IACT,KAAK;IACL,UAAU;IACV,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,cAAc;IACd,eAAe;IACf,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,eA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