@fsai-flow/workflow 0.0.2 → 0.1.0
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/dist/README.md +31 -0
- package/dist/package.json +42 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +68 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/Constants.d.ts +69 -0
- package/dist/src/lib/Constants.d.ts.map +1 -0
- package/dist/src/lib/Constants.js +106 -0
- package/dist/src/lib/Constants.js.map +1 -0
- package/dist/src/lib/DeferredPromise.d.ts +7 -0
- package/dist/src/lib/DeferredPromise.d.ts.map +1 -0
- package/dist/src/lib/DeferredPromise.js +11 -0
- package/dist/src/lib/DeferredPromise.js.map +1 -0
- package/dist/src/lib/Expression.d.ts +66 -0
- package/dist/src/lib/Expression.d.ts.map +1 -0
- package/dist/src/lib/Expression.js +247 -0
- package/dist/src/lib/Expression.js.map +1 -0
- package/dist/src/lib/Interfaces.d.ts +1623 -0
- package/dist/src/lib/Interfaces.d.ts.map +1 -0
- package/dist/src/lib/Interfaces.js +44 -0
- package/dist/src/lib/Interfaces.js.map +1 -0
- package/dist/src/lib/LoggerProxy.d.ts +10 -0
- package/dist/src/lib/LoggerProxy.d.ts.map +1 -0
- package/dist/src/lib/LoggerProxy.js +40 -0
- package/dist/src/lib/LoggerProxy.js.map +1 -0
- package/dist/src/lib/MetadataUtils.d.ts +5 -0
- package/dist/src/lib/MetadataUtils.d.ts.map +1 -0
- package/dist/src/lib/MetadataUtils.js +27 -0
- package/dist/src/lib/MetadataUtils.js.map +1 -0
- package/dist/src/lib/NodeErrors.d.ts +83 -0
- package/dist/src/lib/NodeErrors.d.ts.map +1 -0
- package/dist/src/lib/NodeErrors.js +284 -0
- package/dist/src/lib/NodeErrors.js.map +1 -0
- package/dist/src/lib/NodeHelpers.d.ts +199 -0
- package/dist/src/lib/NodeHelpers.d.ts.map +1 -0
- package/dist/src/lib/NodeHelpers.js +1335 -0
- package/dist/src/lib/NodeHelpers.js.map +1 -0
- package/dist/src/lib/ObservableObject.d.ts +6 -0
- package/dist/src/lib/ObservableObject.d.ts.map +1 -0
- package/dist/src/lib/ObservableObject.js +61 -0
- package/dist/src/lib/ObservableObject.js.map +1 -0
- package/dist/src/lib/RoutingNode.d.ts +24 -0
- package/dist/src/lib/RoutingNode.d.ts.map +1 -0
- package/dist/src/lib/RoutingNode.js +528 -0
- package/dist/src/lib/RoutingNode.js.map +1 -0
- package/dist/src/lib/TelemetryHelpers.d.ts +4 -0
- package/dist/src/lib/TelemetryHelpers.d.ts.map +1 -0
- package/dist/src/lib/TelemetryHelpers.js +67 -0
- package/dist/src/lib/TelemetryHelpers.js.map +1 -0
- package/dist/src/lib/TypeValidation.d.ts +22 -0
- package/dist/src/lib/TypeValidation.d.ts.map +1 -0
- package/dist/src/lib/TypeValidation.js +376 -0
- package/dist/src/lib/TypeValidation.js.map +1 -0
- package/dist/src/lib/VersionedNodeType.d.ts +10 -0
- package/dist/src/lib/VersionedNodeType.d.ts.map +1 -0
- package/dist/src/lib/VersionedNodeType.js +24 -0
- package/dist/src/lib/VersionedNodeType.js.map +1 -0
- package/dist/src/lib/Workflow.d.ts +249 -0
- package/dist/src/lib/Workflow.d.ts.map +1 -0
- package/dist/src/lib/Workflow.js +899 -0
- package/dist/src/lib/Workflow.js.map +1 -0
- package/dist/src/lib/WorkflowDataProxy.d.ts +88 -0
- package/dist/src/lib/WorkflowDataProxy.d.ts.map +1 -0
- package/dist/src/lib/WorkflowDataProxy.js +583 -0
- package/dist/src/lib/WorkflowDataProxy.js.map +1 -0
- package/dist/src/lib/WorkflowErrors.d.ts +10 -0
- package/dist/src/lib/WorkflowErrors.d.ts.map +1 -0
- package/dist/src/lib/WorkflowErrors.js +18 -0
- package/dist/src/lib/WorkflowErrors.js.map +1 -0
- package/dist/src/lib/WorkflowHooks.d.ts +12 -0
- package/dist/src/lib/WorkflowHooks.d.ts.map +1 -0
- package/dist/src/lib/WorkflowHooks.js +32 -0
- package/dist/src/lib/WorkflowHooks.js.map +1 -0
- package/dist/src/lib/errors/base/base.error.d.ts +30 -0
- package/dist/src/lib/errors/base/base.error.d.ts.map +1 -0
- package/dist/src/lib/errors/base/base.error.js +47 -0
- package/dist/src/lib/errors/base/base.error.js.map +1 -0
- package/dist/src/lib/errors/base/operational.error.d.ts +16 -0
- package/dist/src/lib/errors/base/operational.error.d.ts.map +1 -0
- package/dist/src/lib/errors/base/operational.error.js +19 -0
- package/dist/src/lib/errors/base/operational.error.js.map +1 -0
- package/dist/src/lib/errors/error.types.d.ts +14 -0
- package/dist/src/lib/errors/error.types.d.ts.map +1 -0
- package/dist/src/lib/errors/error.types.js +3 -0
- package/dist/src/lib/errors/error.types.js.map +1 -0
- package/dist/src/lib/errors/index.d.ts +2 -0
- package/dist/src/lib/errors/index.d.ts.map +1 -0
- package/dist/src/lib/errors/index.js +6 -0
- package/dist/src/lib/errors/index.js.map +1 -0
- package/dist/src/lib/result.d.ts +20 -0
- package/dist/src/lib/result.d.ts.map +1 -0
- package/dist/src/lib/result.js +36 -0
- package/dist/src/lib/result.js.map +1 -0
- package/dist/src/lib/utils.d.ts +51 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +119 -0
- package/dist/src/lib/utils.js.map +1 -0
- package/package.json +49 -35
- package/.eslintrc.json +0 -33
- package/eslint.config.js +0 -19
- package/jest.config.ts +0 -10
- package/project.json +0 -19
- package/src/index.ts +0 -33
- package/src/lib/Constants.ts +0 -124
- package/src/lib/DeferredPromise.ts +0 -14
- package/src/lib/Expression.ts +0 -375
- package/src/lib/Interfaces.ts +0 -2262
- package/src/lib/LoggerProxy.ts +0 -43
- package/src/lib/MetadataUtils.ts +0 -34
- package/src/lib/NodeErrors.ts +0 -332
- package/src/lib/NodeHelpers.ts +0 -1666
- package/src/lib/ObservableObject.ts +0 -77
- package/src/lib/RoutingNode.ts +0 -862
- package/src/lib/TelemetryHelpers.ts +0 -86
- package/src/lib/TypeValidation.ts +0 -431
- package/src/lib/VersionedNodeType.ts +0 -30
- package/src/lib/Workflow.ts +0 -1270
- package/src/lib/WorkflowDataProxy.ts +0 -708
- package/src/lib/WorkflowErrors.ts +0 -18
- package/src/lib/WorkflowHooks.ts +0 -51
- package/src/lib/errors/base/base.error.ts +0 -68
- package/src/lib/errors/base/operational.error.ts +0 -21
- package/src/lib/errors/error.types.ts +0 -14
- package/src/lib/errors/index.ts +0 -1
- package/src/lib/result.ts +0 -34
- package/src/lib/utils.ts +0 -166
- package/tests/Helpers.ts +0 -667
- package/tests/NodeHelpers.test.ts +0 -3053
- package/tests/ObservableObject.test.ts +0 -171
- package/tests/RoutingNode.test.ts +0 -1680
- package/tests/Workflow.test.ts +0 -1284
- package/tests/WorkflowDataProxy.test.ts +0 -199
- package/tsconfig.json +0 -27
- package/tsconfig.lib.json +0 -11
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowHooks = void 0;
|
|
4
|
+
class WorkflowHooks {
|
|
5
|
+
mode;
|
|
6
|
+
workflowData;
|
|
7
|
+
executionId;
|
|
8
|
+
sessionId;
|
|
9
|
+
retryOf;
|
|
10
|
+
hookFunctions;
|
|
11
|
+
constructor(hookFunctions, mode, executionId, workflowData, optionalParameters) {
|
|
12
|
+
// eslint-disable-next-line no-param-reassign, @typescript-eslint/prefer-nullish-coalescing
|
|
13
|
+
optionalParameters = optionalParameters || {};
|
|
14
|
+
this.hookFunctions = hookFunctions;
|
|
15
|
+
this.mode = mode;
|
|
16
|
+
this.executionId = executionId;
|
|
17
|
+
this.workflowData = workflowData;
|
|
18
|
+
this.sessionId = optionalParameters.sessionId;
|
|
19
|
+
this.retryOf = optionalParameters.retryOf;
|
|
20
|
+
}
|
|
21
|
+
async executeHookFunctions(hookName, parameters) {
|
|
22
|
+
if (this.hookFunctions[hookName] !== undefined && Array.isArray(this.hookFunctions[hookName])) {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, no-restricted-syntax
|
|
24
|
+
for (const hookFunction of this.hookFunctions[hookName]) {
|
|
25
|
+
// eslint-disable-next-line no-await-in-loop
|
|
26
|
+
await hookFunction.apply(this, parameters);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.WorkflowHooks = WorkflowHooks;
|
|
32
|
+
//# sourceMappingURL=WorkflowHooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowHooks.js","sourceRoot":"","sources":["../../../src/lib/WorkflowHooks.ts"],"names":[],"mappings":";;;AAQA,MAAa,aAAa;IACzB,IAAI,CAAsB;IAE1B,YAAY,CAAgB;IAE5B,WAAW,CAAS;IAEpB,SAAS,CAAU;IAEnB,OAAO,CAAU;IAEjB,aAAa,CAAwB;IAErC,YACC,aAAoC,EACpC,IAAyB,EACzB,WAAmB,EACnB,YAA2B,EAC3B,kBAAqD;QAErD,2FAA2F;QAC3F,kBAAkB,GAAG,kBAAkB,IAAI,EAAE,CAAC;QAE9C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,QAAgB,EAAE,UAAqB;QACjE,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC/F,0FAA0F;YAC1F,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAE,EAAE,CAAC;gBAC1D,4CAA4C;gBAC5C,MAAM,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,UAAqB,CAAC,CAAC;YACvD,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAxCD,sCAwCC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ErrorExtra, ErrorLevel, ErrorTags, ReportingOptions } from "../error.types";
|
|
2
|
+
export type BaseErrorOptions = {
|
|
3
|
+
description?: undefined | null;
|
|
4
|
+
} & ErrorOptions & ReportingOptions;
|
|
5
|
+
interface ErrorOptions {
|
|
6
|
+
cause?: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Base class for all errors
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class BaseError extends Error {
|
|
12
|
+
/**
|
|
13
|
+
* Error level. Defines which level the error should be logged/reported
|
|
14
|
+
* @default 'error'
|
|
15
|
+
*/
|
|
16
|
+
level: ErrorLevel;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the error should be reported to Sentry.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
readonly shouldReport: boolean;
|
|
22
|
+
readonly description: string | null | undefined;
|
|
23
|
+
readonly tags: ErrorTags;
|
|
24
|
+
readonly extra?: ErrorExtra;
|
|
25
|
+
readonly packageName?: string;
|
|
26
|
+
readonly cause?: unknown;
|
|
27
|
+
constructor(message: string, { level, description, shouldReport, tags, extra, ...rest }?: BaseErrorOptions);
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=base.error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.error.d.ts","sourceRoot":"","sources":["../../../../../src/lib/errors/base/base.error.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE1F,MAAM,MAAM,gBAAgB,GAAG;IAAE,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEpG,UAAU,YAAY;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,8BAAsB,SAAU,SAAQ,KAAK;IAC5C;;;OAGG;IACH,KAAK,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEhD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAE5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,SAAkB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAGjC,OAAO,EAAE,MAAM,EACf,EAAE,KAAe,EAAE,WAAW,EAAE,YAAY,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAE,gBAAqB;CAqBjG"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BaseError = void 0;
|
|
7
|
+
const callsites_1 = __importDefault(require("callsites"));
|
|
8
|
+
/**
|
|
9
|
+
* Base class for all errors
|
|
10
|
+
*/
|
|
11
|
+
class BaseError extends Error {
|
|
12
|
+
/**
|
|
13
|
+
* Error level. Defines which level the error should be logged/reported
|
|
14
|
+
* @default 'error'
|
|
15
|
+
*/
|
|
16
|
+
level;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the error should be reported to Sentry.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
shouldReport;
|
|
22
|
+
description;
|
|
23
|
+
tags;
|
|
24
|
+
extra;
|
|
25
|
+
packageName;
|
|
26
|
+
cause;
|
|
27
|
+
constructor(message, { level = "error", description, shouldReport, tags = {}, extra, ...rest } = {}) {
|
|
28
|
+
super(message);
|
|
29
|
+
if (rest.cause !== undefined) {
|
|
30
|
+
this.cause = rest.cause;
|
|
31
|
+
}
|
|
32
|
+
this.level = level;
|
|
33
|
+
this.shouldReport = shouldReport ?? (level === "error" || level === "fatal");
|
|
34
|
+
this.description = description;
|
|
35
|
+
this.tags = tags;
|
|
36
|
+
this.extra = extra;
|
|
37
|
+
try {
|
|
38
|
+
const filePath = (0, callsites_1.default)()[2].getFileName() ?? "";
|
|
39
|
+
const match = /packages\/([^/]+)\//.exec(filePath)?.[1];
|
|
40
|
+
if (match)
|
|
41
|
+
this.tags.packageName = match;
|
|
42
|
+
}
|
|
43
|
+
catch { }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.BaseError = BaseError;
|
|
47
|
+
//# sourceMappingURL=base.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.error.js","sourceRoot":"","sources":["../../../../../src/lib/errors/base/base.error.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAUlC;;GAEG;AACH,MAAsB,SAAU,SAAQ,KAAK;IAC5C;;;OAGG;IACH,KAAK,CAAa;IAElB;;;OAGG;IACM,YAAY,CAAU;IAEtB,WAAW,CAA4B;IAEvC,IAAI,CAAY;IAEhB,KAAK,CAAc;IAEnB,WAAW,CAAU;IAEZ,KAAK,CAAW;IAElC,YACC,OAAe,EACf,EAAE,KAAK,GAAG,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,KAAuB,EAAE;QAEhG,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,CAAC,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC;QAC7E,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,IAAA,mBAAS,GAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;YACpD,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAExD,IAAI,KAAK;gBAAE,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;CACD;AA9CD,8BA8CC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BaseErrorOptions } from "./base.error";
|
|
2
|
+
import { BaseError } from "./base.error";
|
|
3
|
+
export type OperationalErrorOptions = Omit<BaseErrorOptions, "level"> & {
|
|
4
|
+
level?: "info" | "warning" | "error";
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Error that indicates a transient issue, like a network request failing,
|
|
8
|
+
* a database query timing out, etc. These are expected to happen, are
|
|
9
|
+
* transient by nature and should be handled gracefully.
|
|
10
|
+
*
|
|
11
|
+
* Default level: warning
|
|
12
|
+
*/
|
|
13
|
+
export declare class OperationalError extends BaseError {
|
|
14
|
+
constructor(message: string, opts?: OperationalErrorOptions);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=operational.error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational.error.d.ts","sourceRoot":"","sources":["../../../../../src/lib/errors/base/operational.error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAAG;IACvE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;CACrC,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;gBAClC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,uBAA4B;CAK/D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationalError = void 0;
|
|
4
|
+
const base_error_1 = require("./base.error");
|
|
5
|
+
/**
|
|
6
|
+
* Error that indicates a transient issue, like a network request failing,
|
|
7
|
+
* a database query timing out, etc. These are expected to happen, are
|
|
8
|
+
* transient by nature and should be handled gracefully.
|
|
9
|
+
*
|
|
10
|
+
* Default level: warning
|
|
11
|
+
*/
|
|
12
|
+
class OperationalError extends base_error_1.BaseError {
|
|
13
|
+
constructor(message, opts = {}) {
|
|
14
|
+
opts.level = opts.level ?? "warning";
|
|
15
|
+
super(message, opts);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.OperationalError = OperationalError;
|
|
19
|
+
//# sourceMappingURL=operational.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational.error.js","sourceRoot":"","sources":["../../../../../src/lib/errors/base/operational.error.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAMzC;;;;;;GAMG;AACH,MAAa,gBAAiB,SAAQ,sBAAS;IAC9C,YAAY,OAAe,EAAE,OAAgC,EAAE;QAC9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC;QAErC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACtB,CAAC;CACD;AAND,4CAMC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Primitive = number | string | boolean | bigint | symbol | null | undefined;
|
|
2
|
+
export type ErrorLevel = "fatal" | "error" | "warning" | "info";
|
|
3
|
+
export type ErrorTags = Record<string, Primitive>;
|
|
4
|
+
export type ErrorExtra = Record<string, unknown>;
|
|
5
|
+
export type ReportingOptions = {
|
|
6
|
+
/** Whether the error should be reported to Sentry */
|
|
7
|
+
shouldReport?: boolean;
|
|
8
|
+
level?: ErrorLevel;
|
|
9
|
+
tags?: ErrorTags;
|
|
10
|
+
extra?: ErrorExtra;
|
|
11
|
+
executionId?: string;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=error.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/errors/error.types.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAEhF,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG;IAC9B,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.types.js","sourceRoot":"","sources":["../../../../src/lib/errors/error.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationalError = void 0;
|
|
4
|
+
var operational_error_1 = require("./base/operational.error");
|
|
5
|
+
Object.defineProperty(exports, "OperationalError", { enumerable: true, get: function () { return operational_error_1.OperationalError; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/errors/index.ts"],"names":[],"mappings":";;;AAAA,8DAA0F;AAAjF,qHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ResultOk<T> = {
|
|
2
|
+
ok: true;
|
|
3
|
+
result: T;
|
|
4
|
+
};
|
|
5
|
+
export type ResultError<E> = {
|
|
6
|
+
ok: false;
|
|
7
|
+
error: E;
|
|
8
|
+
};
|
|
9
|
+
export type Result<T, E> = ResultOk<T> | ResultError<E>;
|
|
10
|
+
export declare const createResultOk: <T>(data: T) => ResultOk<T>;
|
|
11
|
+
export declare const createResultError: <E = unknown>(error: E) => ResultError<E>;
|
|
12
|
+
export declare function ensureError(error: unknown): Error;
|
|
13
|
+
/**
|
|
14
|
+
* Executes the given function and converts it to a Result object.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const result = toResult(() => fs.writeFileSync('file.txt', 'Hello, World!'));
|
|
18
|
+
*/
|
|
19
|
+
export declare const toResult: <T, E extends Error = Error>(fn: () => T) => Result<T, E>;
|
|
20
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/lib/result.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC;AAClD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,MAAM,CAAC,KAAG,QAAQ,CAAC,CAAC,CAGpD,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAAI,CAAC,GAAG,OAAO,EAAE,OAAO,CAAC,KAAG,WAAW,CAAC,CAAC,CAGrE,CAAC;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAIjD;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,SAAS,KAAK,GAAG,KAAK,EAAE,IAAI,MAAM,CAAC,KAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAO7E,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toResult = exports.createResultError = exports.createResultOk = void 0;
|
|
4
|
+
exports.ensureError = ensureError;
|
|
5
|
+
const createResultOk = (data) => ({
|
|
6
|
+
ok: true,
|
|
7
|
+
result: data,
|
|
8
|
+
});
|
|
9
|
+
exports.createResultOk = createResultOk;
|
|
10
|
+
const createResultError = (error) => ({
|
|
11
|
+
ok: false,
|
|
12
|
+
error,
|
|
13
|
+
});
|
|
14
|
+
exports.createResultError = createResultError;
|
|
15
|
+
function ensureError(error) {
|
|
16
|
+
return error instanceof Error
|
|
17
|
+
? error
|
|
18
|
+
: new Error(`Error that was not an instance of Error was thrown, cause: ${error}`);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Executes the given function and converts it to a Result object.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const result = toResult(() => fs.writeFileSync('file.txt', 'Hello, World!'));
|
|
25
|
+
*/
|
|
26
|
+
const toResult = (fn) => {
|
|
27
|
+
try {
|
|
28
|
+
return (0, exports.createResultOk)(fn());
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
const error = ensureError(e);
|
|
32
|
+
return (0, exports.createResultError)(error);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.toResult = toResult;
|
|
36
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/lib/result.ts"],"names":[],"mappings":";;;AAcA,kCAIC;AAdM,MAAM,cAAc,GAAG,CAAI,IAAO,EAAe,EAAE,CAAC,CAAC;IAC3D,EAAE,EAAE,IAAI;IACR,MAAM,EAAE,IAAI;CACZ,CAAC,CAAC;AAHU,QAAA,cAAc,kBAGxB;AAEI,MAAM,iBAAiB,GAAG,CAAc,KAAQ,EAAkB,EAAE,CAAC,CAAC;IAC5E,EAAE,EAAE,KAAK;IACT,KAAK;CACL,CAAC,CAAC;AAHU,QAAA,iBAAiB,qBAG3B;AAEH,SAAgB,WAAW,CAAC,KAAc;IACzC,OAAO,KAAK,YAAY,KAAK;QAC5B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,KAAK,CAAC,8DAA8D,KAAK,EAAE,CAAC,CAAC;AACrF,CAAC;AAED;;;;;GAKG;AACI,MAAM,QAAQ,GAAG,CAA6B,EAAW,EAAgB,EAAE;IACjF,IAAI,CAAC;QACJ,OAAO,IAAA,sBAAc,EAAI,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO,IAAA,yBAAiB,EAAI,KAAU,CAAC,CAAC;IACzC,CAAC;AACF,CAAC,CAAC;AAPW,QAAA,QAAQ,YAOnB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { IDisplayOptions, INodeProperties } from "./Interfaces";
|
|
2
|
+
export declare function updateDisplayOptions(displayOptions: IDisplayOptions, properties: INodeProperties[]): {
|
|
3
|
+
displayOptions: IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("./Interfaces").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("./Interfaces").INodePropertyTypeOptions;
|
|
8
|
+
default: import("./Interfaces").NodeParameterValue | import("./Interfaces").INodeParameters | import("./Interfaces").INodeParameters[] | import("./Interfaces").NodeParameterValue[];
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
options?: Array<import("./Interfaces").INodePropertyOptions | INodeProperties | import("./Interfaces").INodePropertyCollection>;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
isNodeSetting?: boolean;
|
|
14
|
+
noDataExpression?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
routing?: import("./Interfaces").INodePropertyRouting;
|
|
17
|
+
modes?: import("./Interfaces").INodePropertyMode[];
|
|
18
|
+
validateType?: import("./Interfaces").FieldType;
|
|
19
|
+
ignoreValidationDuringExecution?: boolean;
|
|
20
|
+
disabledOptions?: {
|
|
21
|
+
show?: {
|
|
22
|
+
[key: string]: Array<import("./Interfaces").NodeParameterValue | import("./Interfaces").DisplayCondition> | import("./Interfaces").NodeParameterValue[] | undefined;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
26
|
+
export declare function randomInt(max: number): number;
|
|
27
|
+
export declare function randomInt(min: number, max: number): number;
|
|
28
|
+
type MutuallyExclusive<T, U> = (T & {
|
|
29
|
+
[k in Exclude<keyof U, keyof T>]?: never;
|
|
30
|
+
}) | (U & {
|
|
31
|
+
[k in Exclude<keyof T, keyof U>]?: never;
|
|
32
|
+
});
|
|
33
|
+
type JSONParseOptions<T> = {
|
|
34
|
+
acceptJSObject?: boolean;
|
|
35
|
+
} & MutuallyExclusive<{
|
|
36
|
+
errorMessage?: string;
|
|
37
|
+
}, {
|
|
38
|
+
fallbackValue?: T;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const jsonParse: <T>(jsonString: string, options?: JSONParseOptions<T>) => T;
|
|
41
|
+
type JSONStringifyOptions = {
|
|
42
|
+
replaceCircularRefs?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export declare const replaceCircularReferences: <T>(value: T, knownObjects?: WeakSet<WeakKey>) => T;
|
|
45
|
+
export declare const jsonStringify: (obj: unknown, options?: JSONStringifyOptions) => string;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if a value is an object with a specific key and provides a type guard for the key.
|
|
48
|
+
*/
|
|
49
|
+
export declare function hasKey<T extends PropertyKey>(value: unknown, key: T): value is Record<T, unknown>;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAErE,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,eAAe,EAAE,UAAU,EA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C,EAAE,OAAO,CAAC,CAEjG"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonStringify = exports.replaceCircularReferences = exports.jsonParse = void 0;
|
|
4
|
+
exports.updateDisplayOptions = updateDisplayOptions;
|
|
5
|
+
exports.randomInt = randomInt;
|
|
6
|
+
exports.hasKey = hasKey;
|
|
7
|
+
const esprima_next_1 = require("esprima-next");
|
|
8
|
+
const lodash_1 = require("lodash");
|
|
9
|
+
function updateDisplayOptions(displayOptions, properties) {
|
|
10
|
+
return properties.map((nodeProperty) => {
|
|
11
|
+
return {
|
|
12
|
+
...nodeProperty,
|
|
13
|
+
displayOptions: (0, lodash_1.merge)({}, nodeProperty.displayOptions, displayOptions),
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generates a random integer within a specified range.
|
|
19
|
+
*
|
|
20
|
+
* @param {number} min - The lower bound of the range. If `max` is not provided, this value is used as the upper bound and the lower bound is set to 0.
|
|
21
|
+
* @param {number} [max] - The upper bound of the range, not inclusive.
|
|
22
|
+
* @returns {number} A random integer within the specified range.
|
|
23
|
+
*/
|
|
24
|
+
function randomInt(min, max) {
|
|
25
|
+
if (max === undefined) {
|
|
26
|
+
max = min;
|
|
27
|
+
min = 0;
|
|
28
|
+
}
|
|
29
|
+
if (max <= min) {
|
|
30
|
+
throw new Error("max must be greater than min");
|
|
31
|
+
}
|
|
32
|
+
const range = max - min;
|
|
33
|
+
const maxUnbiased = Math.floor(0xffffffff / range) * range;
|
|
34
|
+
let rand;
|
|
35
|
+
do {
|
|
36
|
+
rand = crypto.getRandomValues(new Uint32Array(1))[0];
|
|
37
|
+
} while (rand >= maxUnbiased);
|
|
38
|
+
return min + (rand % range);
|
|
39
|
+
}
|
|
40
|
+
const jsonParse = (jsonString, options) => {
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(jsonString);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (options?.acceptJSObject) {
|
|
46
|
+
try {
|
|
47
|
+
const jsonStringCleaned = parseJSObject(jsonString);
|
|
48
|
+
return jsonStringCleaned;
|
|
49
|
+
}
|
|
50
|
+
catch (_e) {
|
|
51
|
+
// Ignore this error and return the original error or the fallback value
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (options?.fallbackValue !== undefined) {
|
|
55
|
+
if (options.fallbackValue instanceof Function) {
|
|
56
|
+
return options.fallbackValue();
|
|
57
|
+
}
|
|
58
|
+
return options.fallbackValue;
|
|
59
|
+
}
|
|
60
|
+
if (options?.errorMessage) {
|
|
61
|
+
// TODO REFACTOR: Use ApplicationError from offical @fsai-flow/workflow repo
|
|
62
|
+
throw new Error(options.errorMessage);
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.jsonParse = jsonParse;
|
|
68
|
+
const replaceCircularReferences = (value, knownObjects = new WeakSet()) => {
|
|
69
|
+
if (typeof value !== "object" || value === null || value instanceof RegExp)
|
|
70
|
+
return value;
|
|
71
|
+
if ("toJSON" in value && typeof value.toJSON === "function")
|
|
72
|
+
return value.toJSON();
|
|
73
|
+
if (knownObjects.has(value))
|
|
74
|
+
return "[Circular Reference]";
|
|
75
|
+
knownObjects.add(value);
|
|
76
|
+
const copy = (Array.isArray(value) ? [] : {});
|
|
77
|
+
for (const key in value) {
|
|
78
|
+
copy[key] = (0, exports.replaceCircularReferences)(value[key], knownObjects);
|
|
79
|
+
}
|
|
80
|
+
knownObjects.delete(value);
|
|
81
|
+
return copy;
|
|
82
|
+
};
|
|
83
|
+
exports.replaceCircularReferences = replaceCircularReferences;
|
|
84
|
+
const jsonStringify = (obj, options = {}) => {
|
|
85
|
+
return JSON.stringify(options?.replaceCircularRefs ? (0, exports.replaceCircularReferences)(obj) : obj);
|
|
86
|
+
};
|
|
87
|
+
exports.jsonStringify = jsonStringify;
|
|
88
|
+
function syntaxNodeToValue(expression) {
|
|
89
|
+
switch (expression?.type) {
|
|
90
|
+
case esprima_next_1.Syntax.ObjectExpression:
|
|
91
|
+
return Object.fromEntries(expression.properties
|
|
92
|
+
.filter((prop) => prop.type === esprima_next_1.Syntax.Property)
|
|
93
|
+
.map(({ key, value }) => [syntaxNodeToValue(key), syntaxNodeToValue(value)]));
|
|
94
|
+
case esprima_next_1.Syntax.Identifier:
|
|
95
|
+
return expression.name;
|
|
96
|
+
case esprima_next_1.Syntax.Literal:
|
|
97
|
+
return expression.value;
|
|
98
|
+
case esprima_next_1.Syntax.ArrayExpression:
|
|
99
|
+
return expression.elements.map((exp) => syntaxNodeToValue(exp));
|
|
100
|
+
default:
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Parse any JavaScript ObjectExpression, including:
|
|
106
|
+
* - single quoted keys
|
|
107
|
+
* - unquoted keys
|
|
108
|
+
*/
|
|
109
|
+
function parseJSObject(objectAsString) {
|
|
110
|
+
const jsExpression = (0, esprima_next_1.parse)(`(${objectAsString})`).body.find((node) => node.type === esprima_next_1.Syntax.ExpressionStatement && node.expression.type === esprima_next_1.Syntax.ObjectExpression);
|
|
111
|
+
return syntaxNodeToValue(jsExpression?.expression);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Checks if a value is an object with a specific key and provides a type guard for the key.
|
|
115
|
+
*/
|
|
116
|
+
function hasKey(value, key) {
|
|
117
|
+
return value !== null && typeof value === "object" && Object.hasOwn(value, key);
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":";;;AAIA,oDAOC;AAUD,8BAmBC;AA8FD,wBAEC;AAxID,+CAAgH;AAChH,mCAA+B;AAG/B,SAAgB,oBAAo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AY,EAAC,IAAI,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CACjE,CAAC,IAAI,EAA+B,EAAE,CACrC,IAAI,CAAC,IAAI,KAAK,qBAAM,CAAC,mBAAmB,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,qBAAM,CAAC,gBAAgB,CAC7F,CAAC;IAEF,OAAO,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAW,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAwB,KAAc,EAAE,GAAM;IACnE,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACjF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,37 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
"name": "@fsai-flow/workflow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "PolyForm Noncommercial License 1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc -p tsconfig.lib.json",
|
|
7
|
+
"check": "biome check .",
|
|
8
|
+
"check:fix": "biome check --write .",
|
|
9
|
+
"test": "vitest run",
|
|
10
|
+
"test:watch": "vitest",
|
|
11
|
+
"test:coverage": "vitest run --coverage",
|
|
12
|
+
"prepublishOnly": "npm run check && npm run build && npm run test"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"callsites": "^4.2.0",
|
|
16
|
+
"esprima-next": "6.0.3",
|
|
17
|
+
"form-data": "^4.0.5",
|
|
18
|
+
"jmespath": "^0.16.0",
|
|
19
|
+
"lodash.get": "^4.4.2",
|
|
20
|
+
"lodash.isequal": "^4.5.0",
|
|
21
|
+
"lodash.merge": "^4.6.2",
|
|
22
|
+
"luxon": "^3.7.2",
|
|
23
|
+
"riot-tmpl": "^3.0.8",
|
|
24
|
+
"tslib": "^2.8.1",
|
|
25
|
+
"xml2js": "^0.6.2"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@biomejs/biome": "^2.4.4",
|
|
29
|
+
"@types/express": "^5.0.6",
|
|
30
|
+
"@types/jmespath": "^0.15.2",
|
|
31
|
+
"@types/lodash": "^4.17.23",
|
|
32
|
+
"@types/lodash.get": "^4.4.9",
|
|
33
|
+
"@types/lodash.isequal": "^4.5.8",
|
|
34
|
+
"@types/lodash.merge": "^4.6.9",
|
|
35
|
+
"@types/luxon": "^3.7.1",
|
|
36
|
+
"@types/node": "^25.3.0",
|
|
37
|
+
"@types/xml2js": "^0.4.14",
|
|
38
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
39
|
+
"lodash": "^4.17.23",
|
|
40
|
+
"typescript": "^5.9.3",
|
|
41
|
+
"vitest": "^4.0.18"
|
|
42
|
+
},
|
|
43
|
+
"type": "commonjs",
|
|
44
|
+
"main": "./dist/src/index.js",
|
|
45
|
+
"typings": "./dist/src/index.d.ts",
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE"
|
|
50
|
+
]
|
|
37
51
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"parser": "@typescript-eslint/parser", // Usando o parser para TypeScript
|
|
4
|
-
"parserOptions": {
|
|
5
|
-
"ecmaVersion": 2020, // Permite o uso de sintaxe moderna
|
|
6
|
-
"sourceType": "module", // Permite o uso de módulos ES6 (import/export)
|
|
7
|
-
"project": "./tsconfig.json" // Caminho para o seu tsconfig.json (ajuste conforme necessário)
|
|
8
|
-
},
|
|
9
|
-
"overrides": [
|
|
10
|
-
{
|
|
11
|
-
"files": ["libs/workflow/**/*"],
|
|
12
|
-
"rules": {
|
|
13
|
-
"no-console": "off",
|
|
14
|
-
"no-unused-vars": "off",
|
|
15
|
-
"eqeqeq": "off",
|
|
16
|
-
"semi": "off",
|
|
17
|
-
"quotes": "off"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"extends": [
|
|
22
|
-
"eslint:recommended", // Regras recomendadas do ESLint
|
|
23
|
-
"plugin:@typescript-eslint/recommended" // Regras recomendadas do plugin do TypeScript
|
|
24
|
-
],
|
|
25
|
-
"plugins": [
|
|
26
|
-
"@typescript-eslint" // Ativa o plugin do TypeScript
|
|
27
|
-
],
|
|
28
|
-
"rules": {
|
|
29
|
-
// Aqui você pode customizar as regras globais se necessário
|
|
30
|
-
"no-unused-vars": "warn", // Exemplo de personalização para variável não usada
|
|
31
|
-
"no-empty-function": "off" // Desativa a regra de funções vazias (se necessário)
|
|
32
|
-
}
|
|
33
|
-
}
|
package/eslint.config.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const baseConfig = require('../../eslint.config.js');
|
|
2
|
-
|
|
3
|
-
module.exports = [
|
|
4
|
-
...baseConfig,
|
|
5
|
-
{
|
|
6
|
-
files: ['**/*.json'],
|
|
7
|
-
rules: {
|
|
8
|
-
'@nx/dependency-checks': [
|
|
9
|
-
'error',
|
|
10
|
-
{
|
|
11
|
-
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
},
|
|
15
|
-
languageOptions: {
|
|
16
|
-
parser: require('jsonc-eslint-parser'),
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
];
|
package/jest.config.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
displayName: 'workflow',
|
|
3
|
-
preset: '../../jest.preset.js',
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
transform: {
|
|
6
|
-
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
|
7
|
-
},
|
|
8
|
-
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
9
|
-
coverageDirectory: '../../coverage/libs/workflow',
|
|
10
|
-
};
|