@ironflow/node 0.20.2 → 0.21.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/agent/agent.d.ts +60 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +133 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/approve.d.ts +23 -0
- package/dist/agent/approve.d.ts.map +1 -0
- package/dist/agent/approve.js +42 -0
- package/dist/agent/approve.js.map +1 -0
- package/dist/agent/dispatch.d.ts +63 -0
- package/dist/agent/dispatch.d.ts.map +1 -0
- package/dist/agent/dispatch.js +130 -0
- package/dist/agent/dispatch.js.map +1 -0
- package/dist/agent/errors.d.ts +90 -0
- package/dist/agent/errors.d.ts.map +1 -0
- package/dist/agent/errors.js +136 -0
- package/dist/agent/errors.js.map +1 -0
- package/dist/agent/index.d.ts +35 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +32 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/internal-registry.d.ts +27 -0
- package/dist/agent/internal-registry.d.ts.map +1 -0
- package/dist/agent/internal-registry.js +36 -0
- package/dist/agent/internal-registry.js.map +1 -0
- package/dist/agent/internal.d.ts +24 -0
- package/dist/agent/internal.d.ts.map +1 -0
- package/dist/agent/internal.js +29 -0
- package/dist/agent/internal.js.map +1 -0
- package/dist/agent/llm.d.ts +39 -0
- package/dist/agent/llm.d.ts.map +1 -0
- package/dist/agent/llm.js +59 -0
- package/dist/agent/llm.js.map +1 -0
- package/dist/agent/mcp.d.ts +51 -0
- package/dist/agent/mcp.d.ts.map +1 -0
- package/dist/agent/mcp.js +155 -0
- package/dist/agent/mcp.js.map +1 -0
- package/dist/agent/memory.d.ts +74 -0
- package/dist/agent/memory.d.ts.map +1 -0
- package/dist/agent/memory.js +130 -0
- package/dist/agent/memory.js.map +1 -0
- package/dist/agent/spawn.d.ts +20 -0
- package/dist/agent/spawn.d.ts.map +1 -0
- package/dist/agent/spawn.js +29 -0
- package/dist/agent/spawn.js.map +1 -0
- package/dist/agent/tool.d.ts +39 -0
- package/dist/agent/tool.d.ts.map +1 -0
- package/dist/agent/tool.js +103 -0
- package/dist/agent/tool.js.map +1 -0
- package/dist/agent/types.d.ts +363 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +9 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/client.d.ts +942 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1557 -0
- package/dist/client.js.map +1 -0
- package/dist/command-dedup.d.ts +61 -0
- package/dist/command-dedup.d.ts.map +1 -0
- package/dist/command-dedup.js +129 -0
- package/dist/command-dedup.js.map +1 -0
- package/dist/config-client.d.ts +58 -0
- package/dist/config-client.d.ts.map +1 -0
- package/dist/config-client.js +171 -0
- package/dist/config-client.js.map +1 -0
- package/dist/function.d.ts +53 -0
- package/dist/function.d.ts.map +1 -0
- package/dist/function.js +72 -0
- package/dist/function.js.map +1 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/assert-defined.d.ts +10 -0
- package/dist/internal/assert-defined.d.ts.map +1 -0
- package/dist/internal/assert-defined.js +15 -0
- package/dist/internal/assert-defined.js.map +1 -0
- package/dist/internal/context.d.ts +142 -0
- package/dist/internal/context.d.ts.map +1 -0
- package/dist/internal/context.js +306 -0
- package/dist/internal/context.js.map +1 -0
- package/dist/internal/errors.d.ts +66 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +29 -0
- package/dist/internal/errors.js.map +1 -0
- package/dist/internal/run-context.d.ts +10 -0
- package/dist/internal/run-context.d.ts.map +1 -0
- package/dist/internal/run-context.js +23 -0
- package/dist/internal/run-context.js.map +1 -0
- package/dist/kv.d.ts +86 -0
- package/dist/kv.d.ts.map +1 -0
- package/dist/kv.js +261 -0
- package/dist/kv.js.map +1 -0
- package/dist/projection-runner.d.ts +83 -0
- package/dist/projection-runner.d.ts.map +1 -0
- package/dist/projection-runner.js +498 -0
- package/dist/projection-runner.js.map +1 -0
- package/dist/projection.d.ts +36 -0
- package/dist/projection.d.ts.map +1 -0
- package/dist/projection.js +55 -0
- package/dist/projection.js.map +1 -0
- package/dist/secrets.d.ts +6 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +19 -0
- package/dist/secrets.js.map +1 -0
- package/dist/serve.d.ts +71 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +460 -0
- package/dist/serve.js.map +1 -0
- package/dist/step.d.ts +18 -0
- package/dist/step.d.ts.map +1 -0
- package/dist/step.js +581 -0
- package/dist/step.js.map +1 -0
- package/dist/subscribe.d.ts +164 -0
- package/dist/subscribe.d.ts.map +1 -0
- package/dist/subscribe.js +487 -0
- package/dist/subscribe.js.map +1 -0
- package/dist/test/index.d.ts +22 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +112 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/test-step.d.ts +21 -0
- package/dist/test/test-step.d.ts.map +1 -0
- package/dist/test/test-step.js +83 -0
- package/dist/test/test-step.js.map +1 -0
- package/dist/types.d.ts +108 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist/webhook.d.ts +22 -0
- package/dist/webhook.d.ts.map +1 -0
- package/dist/webhook.js +23 -0
- package/dist/webhook.js.map +1 -0
- package/dist/worker-streaming.d.ts +17 -0
- package/dist/worker-streaming.d.ts.map +1 -0
- package/dist/worker-streaming.js +510 -0
- package/dist/worker-streaming.js.map +1 -0
- package/dist/worker.d.ts +28 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +559 -0
- package/dist/worker.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
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@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ironflow/node
|
|
3
|
+
*
|
|
4
|
+
* Node.js SDK for Ironflow, an event-driven backend platform.
|
|
5
|
+
* Provides workers, serve handlers, and step execution for serverless and long-running functions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Define a workflow function
|
|
10
|
+
* import { ironflow } from "@ironflow/node";
|
|
11
|
+
*
|
|
12
|
+
* const processOrder = ironflow.createFunction(
|
|
13
|
+
* {
|
|
14
|
+
* id: "process-order",
|
|
15
|
+
* triggers: [{ event: "order.placed" }],
|
|
16
|
+
* },
|
|
17
|
+
* async ({ event, step }) => {
|
|
18
|
+
* const result = await step.run("process", async () => {
|
|
19
|
+
* return { processed: true };
|
|
20
|
+
* });
|
|
21
|
+
* return result;
|
|
22
|
+
* }
|
|
23
|
+
* );
|
|
24
|
+
*
|
|
25
|
+
* // Push mode (serverless)
|
|
26
|
+
* import { serve } from "@ironflow/node/serve";
|
|
27
|
+
* export const POST = serve({ functions: [processOrder] });
|
|
28
|
+
*
|
|
29
|
+
* // Pull mode (worker)
|
|
30
|
+
* import { createWorker } from "@ironflow/node/worker";
|
|
31
|
+
* const worker = createWorker({
|
|
32
|
+
* serverUrl: "http://localhost:9123",
|
|
33
|
+
* functions: [processOrder],
|
|
34
|
+
* });
|
|
35
|
+
* await worker.start();
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @packageDocumentation
|
|
39
|
+
*/
|
|
40
|
+
export { ironflow, createFunction } from "./function.js";
|
|
41
|
+
export { serve, createHandler } from "./serve.js";
|
|
42
|
+
export { createWorker } from "./worker.js";
|
|
43
|
+
export { createProjection } from "./projection.js";
|
|
44
|
+
export { createProjectionRunner, ProjectionRunner, StreamingUnsupportedError, type ProjectionRunnerConfig } from "./projection-runner.js";
|
|
45
|
+
export { createWebhook } from "./webhook.js";
|
|
46
|
+
export { createSecretsClient } from "./secrets.js";
|
|
47
|
+
export { createClient, IronflowClient } from "./client.js";
|
|
48
|
+
export { createSubscriptionClient, SubscriptionClient, type SubscriptionClientConfig, } from "./subscribe.js";
|
|
49
|
+
export type { IronflowClientConfig, RegisterFunctionRequest, RegisterFunctionResult, } from "./client.js";
|
|
50
|
+
export { KVClient, KVBucketHandle } from "./kv.js";
|
|
51
|
+
export type { KVClientConfig } from "./kv.js";
|
|
52
|
+
export { CommandDedup, DEFAULT_COMMAND_DEDUP_TTL_SECONDS } from "./command-dedup.js";
|
|
53
|
+
export type { CommandDedupOptions } from "./command-dedup.js";
|
|
54
|
+
export { ConfigClient } from "./config-client.js";
|
|
55
|
+
export type { ConfigClientConfig, ConfigWatchEvent, ConfigWatchCallbacks, ConfigWatcher } from "./config-client.js";
|
|
56
|
+
export type { ServeConfig, HandlerOptions, HandlerContext, WorkerConfig, Worker, CreateFunctionConfig, ErrorContext, OnErrorHandler, } from "./types.js";
|
|
57
|
+
export type { Branded, RunId, FunctionId, StepId, EventId, JobId, WorkerId, SubscriptionId, FunctionConfig, FunctionContext, FunctionHandler, IronflowFunction, Trigger, RetryConfig, ConcurrencyConfig, ExecutionMode, IronflowEvent, EventFilter, StepClient, Duration, ParallelOptions, RunInfo, Run, RunStatus, ListRunsOptions, ListRunsResult, InvokeResult, TriggerResult, // deprecated alias for InvokeResult
|
|
58
|
+
TriggerSyncOptions, TriggerSyncResult, EmitOptions, EmitResult, AppendEventInput, AppendOptions, AppendResult, ReadStreamOptions, StreamEvent, StreamInfo, SecretsClient, Logger, PushRequest, PushResponse, CompletedStep, ResumeContext, StepResult, YieldInfo, SleepYield, WaitEventYield, KVBucketConfig, KVBucketInfo, KVEntry, KVPutResult, KVListKeysResult, KVListBucketsResult, KVWatchEvent, KVWatchCallbacks, KVWatchOptions, KVWatcher, ConfigResponse, ConfigEntry, ConfigSetResult, SubscribeOptions, SubscriptionEvent, SubscriptionErrorInfo, Subscription, AckableSubscription, ConnectionState, WebhookConfig, WebhookRequest, WebhookEvent, IronflowWebhook, ProjectionMode, ProjectionStatus, ProjectionContext, ManagedProjectionHandler, ExternalProjectionHandler, ProjectionConfig, IronflowProjection, ProjectionStatusInfo, ProjectionStateResult, GetProjectionOptions, RebuildProjectionOptions, ProjectionSubscriptionCallbacks, APIKey, APIKeyWithSecret, CreateAPIKeyInput, Organization, CreateOrgInput, UpdateOrgInput, Role, CreateRoleInput, UpdateRoleInput, Policy, CreatePolicyInput, UpdatePolicyInput, WebhookSource, CreateWebhookSourceInput, WebhookDelivery, ListWebhookDeliveriesOptions, User, CreateUserInput, UpdateUserInput, Tenant, } from "@ironflow/core";
|
|
59
|
+
export { createRunId, createFunctionId, createStepId, createEventId, createJobId, createWorkerId, createSubscriptionId, } from "@ironflow/core";
|
|
60
|
+
export { IronflowError, StepError, TimeoutError, ValidationError, SchemaValidationError, SignatureError, FunctionNotFoundError, RunNotFoundError, NonRetryableError, UnauthenticatedError, EnterpriseRequiredError, UnauthorizedError, isRetryable, isIronflowError, } from "@ironflow/core";
|
|
61
|
+
export { parseDuration, calculateBackoff, sleep, generateId, createLogger, createNoopLogger, type LogLevel, type LoggerConfig, } from "@ironflow/core";
|
|
62
|
+
export { DEFAULT_PORT, DEFAULT_HOST, DEFAULT_SERVER_URL, DEFAULT_TIMEOUTS, DEFAULT_RETRY, DEFAULT_WORKER, ENV_VARS, getServerUrl, patterns, } from "@ironflow/core";
|
|
63
|
+
export { PushRequestSchema, RunStatusSchema, parseAndValidate, validate, } from "@ironflow/core";
|
|
64
|
+
export { withRunContext, getCurrentRunId } from "./internal/run-context.js";
|
|
65
|
+
declare const _default: {
|
|
66
|
+
ironflow: {
|
|
67
|
+
createFunction: typeof import("./function.js").createFunction;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export default _default;
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAA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AI,EACJ,eAAe,EACf,eAAe,EAGf,MAAM,GACP,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,aAAa,EACb,SAAS,EACT,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;;;;;;AAG5E,wBAA4B"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ironflow/node
|
|
3
|
+
*
|
|
4
|
+
* Node.js SDK for Ironflow, an event-driven backend platform.
|
|
5
|
+
* Provides workers, serve handlers, and step execution for serverless and long-running functions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Define a workflow function
|
|
10
|
+
* import { ironflow } from "@ironflow/node";
|
|
11
|
+
*
|
|
12
|
+
* const processOrder = ironflow.createFunction(
|
|
13
|
+
* {
|
|
14
|
+
* id: "process-order",
|
|
15
|
+
* triggers: [{ event: "order.placed" }],
|
|
16
|
+
* },
|
|
17
|
+
* async ({ event, step }) => {
|
|
18
|
+
* const result = await step.run("process", async () => {
|
|
19
|
+
* return { processed: true };
|
|
20
|
+
* });
|
|
21
|
+
* return result;
|
|
22
|
+
* }
|
|
23
|
+
* );
|
|
24
|
+
*
|
|
25
|
+
* // Push mode (serverless)
|
|
26
|
+
* import { serve } from "@ironflow/node/serve";
|
|
27
|
+
* export const POST = serve({ functions: [processOrder] });
|
|
28
|
+
*
|
|
29
|
+
* // Pull mode (worker)
|
|
30
|
+
* import { createWorker } from "@ironflow/node/worker";
|
|
31
|
+
* const worker = createWorker({
|
|
32
|
+
* serverUrl: "http://localhost:9123",
|
|
33
|
+
* functions: [processOrder],
|
|
34
|
+
* });
|
|
35
|
+
* await worker.start();
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @packageDocumentation
|
|
39
|
+
*/
|
|
40
|
+
// Main exports
|
|
41
|
+
import { ironflow } from "./function.js";
|
|
42
|
+
export { ironflow, createFunction } from "./function.js";
|
|
43
|
+
export { serve, createHandler } from "./serve.js";
|
|
44
|
+
export { createWorker } from "./worker.js";
|
|
45
|
+
export { createProjection } from "./projection.js";
|
|
46
|
+
export { createProjectionRunner, ProjectionRunner, StreamingUnsupportedError } from "./projection-runner.js";
|
|
47
|
+
// NOTE: createStreamingWorker is NOT exported here to avoid loading protobuf
|
|
48
|
+
// dependencies. Import from "@ironflow/node/worker-streaming" if you need it.
|
|
49
|
+
export { createWebhook } from "./webhook.js";
|
|
50
|
+
export { createSecretsClient } from "./secrets.js";
|
|
51
|
+
export { createClient, IronflowClient } from "./client.js";
|
|
52
|
+
export { createSubscriptionClient, SubscriptionClient, } from "./subscribe.js";
|
|
53
|
+
export { KVClient, KVBucketHandle } from "./kv.js";
|
|
54
|
+
export { CommandDedup, DEFAULT_COMMAND_DEDUP_TTL_SECONDS } from "./command-dedup.js";
|
|
55
|
+
export { ConfigClient } from "./config-client.js";
|
|
56
|
+
// Re-export branded ID creators
|
|
57
|
+
export { createRunId, createFunctionId, createStepId, createEventId, createJobId, createWorkerId, createSubscriptionId, } from "@ironflow/core";
|
|
58
|
+
// Re-export errors
|
|
59
|
+
export { IronflowError, StepError, TimeoutError, ValidationError, SchemaValidationError, SignatureError, FunctionNotFoundError, RunNotFoundError, NonRetryableError, UnauthenticatedError, EnterpriseRequiredError, UnauthorizedError, isRetryable, isIronflowError, } from "@ironflow/core";
|
|
60
|
+
// Re-export utilities
|
|
61
|
+
export { parseDuration, calculateBackoff, sleep, generateId, createLogger, createNoopLogger, } from "@ironflow/core";
|
|
62
|
+
// Re-export constants
|
|
63
|
+
export { DEFAULT_PORT, DEFAULT_HOST, DEFAULT_SERVER_URL, DEFAULT_TIMEOUTS, DEFAULT_RETRY, DEFAULT_WORKER, ENV_VARS, getServerUrl, patterns, } from "@ironflow/core";
|
|
64
|
+
// Re-export schemas for advanced usage
|
|
65
|
+
export { PushRequestSchema, RunStatusSchema, parseAndValidate, validate, } from "@ironflow/core";
|
|
66
|
+
// Run context — advanced usage
|
|
67
|
+
export { withRunContext, getCurrentRunId } from "./internal/run-context.js";
|
|
68
|
+
// Default export
|
|
69
|
+
export default { ironflow };
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,eAAe;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBA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,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAExB,+BAA+B;AAC/B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5E,iBAAiB;AACjB,eAAe,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-side assertion that narrows `T | null | undefined` to `T`.
|
|
3
|
+
*
|
|
4
|
+
* Used at sites where `noUncheckedIndexedAccess` widens an array index
|
|
5
|
+
* lookup to `T | undefined`, or where an API surface returns `T | null`.
|
|
6
|
+
* Throws with a useful message instead of scattering bare `!` non-null
|
|
7
|
+
* assertions across test code.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertDefined<T>(value: T | null | undefined, label?: string): T;
|
|
10
|
+
//# sourceMappingURL=assert-defined.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-defined.d.ts","sourceRoot":"","sources":["../../src/internal/assert-defined.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC3B,KAAK,SAAU,GACd,CAAC,CAKH"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-side assertion that narrows `T | null | undefined` to `T`.
|
|
3
|
+
*
|
|
4
|
+
* Used at sites where `noUncheckedIndexedAccess` widens an array index
|
|
5
|
+
* lookup to `T | undefined`, or where an API surface returns `T | null`.
|
|
6
|
+
* Throws with a useful message instead of scattering bare `!` non-null
|
|
7
|
+
* assertions across test code.
|
|
8
|
+
*/
|
|
9
|
+
export function assertDefined(value, label = "value") {
|
|
10
|
+
if (value === undefined || value === null) {
|
|
11
|
+
throw new Error(`assertDefined: expected ${label} to be defined`);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=assert-defined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-defined.js","sourceRoot":"","sources":["../../src/internal/assert-defined.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,KAA2B,EAC3B,KAAK,GAAG,OAAO;IAEf,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,2BAA2B,KAAK,gBAAgB,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal Execution Context
|
|
3
|
+
*
|
|
4
|
+
* Manages step memoization and resume state during function execution.
|
|
5
|
+
*/
|
|
6
|
+
import type { IronflowEvent, Logger, RunInfo, PushRequest, CompletedStep, StepResult, EventDefinitionRegistry } from "@ironflow/core";
|
|
7
|
+
/**
|
|
8
|
+
* Execution context for a function invocation
|
|
9
|
+
*/
|
|
10
|
+
export declare class ExecutionContext {
|
|
11
|
+
/** The run ID */
|
|
12
|
+
readonly runId: string;
|
|
13
|
+
/** The function ID */
|
|
14
|
+
readonly functionId: string;
|
|
15
|
+
/** Current attempt number */
|
|
16
|
+
readonly attempt: number;
|
|
17
|
+
/** The triggering event */
|
|
18
|
+
readonly event: IronflowEvent;
|
|
19
|
+
/** Run information */
|
|
20
|
+
readonly runInfo: RunInfo;
|
|
21
|
+
/** Logger instance */
|
|
22
|
+
readonly logger: Logger;
|
|
23
|
+
/** Step counters for generating unique step IDs */
|
|
24
|
+
private stepCounters;
|
|
25
|
+
/** Completed steps from previous execution (memoized) */
|
|
26
|
+
private completedSteps;
|
|
27
|
+
/** Steps executed in this invocation */
|
|
28
|
+
private executedSteps;
|
|
29
|
+
/** Resume context for sleep/waitForEvent */
|
|
30
|
+
private resumeContext?;
|
|
31
|
+
/** Whether we've processed the resume */
|
|
32
|
+
private resumeProcessed;
|
|
33
|
+
/** Compensation registry: step name -> compensation function */
|
|
34
|
+
private compensationRegistry;
|
|
35
|
+
/** Ordered list of step names that have compensations registered */
|
|
36
|
+
private compensationOrder;
|
|
37
|
+
/** Function-level default step timeout */
|
|
38
|
+
readonly stepTimeout?: string;
|
|
39
|
+
/** Server URL for steps that need to call back to the server (e.g., publish) */
|
|
40
|
+
readonly serverUrl?: string;
|
|
41
|
+
/** API key for authenticated requests from steps */
|
|
42
|
+
readonly apiKey?: string;
|
|
43
|
+
constructor(request: PushRequest, logger?: Logger, eventDefinitions?: EventDefinitionRegistry, stepTimeout?: string, serverUrl?: string, apiKey?: string);
|
|
44
|
+
/**
|
|
45
|
+
* Generate a unique step ID
|
|
46
|
+
*/
|
|
47
|
+
generateStepId(name: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Create a scoped context for a parallel branch
|
|
50
|
+
*/
|
|
51
|
+
createBranchContext(parallelName: string, branchIndex: number): BranchContext;
|
|
52
|
+
/**
|
|
53
|
+
* Check if a step is already completed (memoized)
|
|
54
|
+
*/
|
|
55
|
+
getCompletedStep(stepId: string): CompletedStep | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Check if we should skip step execution due to memoization
|
|
58
|
+
*/
|
|
59
|
+
shouldSkipStep(stepId: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Get the error data for a failed step, if it exists.
|
|
62
|
+
* Returns undefined if the step is not failed or not present.
|
|
63
|
+
*/
|
|
64
|
+
getFailedStep(stepId: string): unknown | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Check if a step has status "timed_out"
|
|
67
|
+
*/
|
|
68
|
+
isStepTimedOut(stepId: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Get the memoized output for a step
|
|
71
|
+
*/
|
|
72
|
+
getMemoizedOutput<T>(stepId: string): T | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Check if we're resuming from a specific step
|
|
75
|
+
*/
|
|
76
|
+
isResumingFrom(stepId: string, type: "sleep" | "wait_for_event"): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Get the resume data (for waitForEvent)
|
|
79
|
+
*/
|
|
80
|
+
getResumeData<T>(): T | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Mark the resume as processed
|
|
83
|
+
*/
|
|
84
|
+
markResumeProcessed(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Check if the resume has been processed
|
|
87
|
+
*/
|
|
88
|
+
hasResumeBeenProcessed(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Record a step execution result
|
|
91
|
+
*/
|
|
92
|
+
recordStep(step: StepResult): void;
|
|
93
|
+
/**
|
|
94
|
+
* Get all steps executed in this invocation
|
|
95
|
+
*/
|
|
96
|
+
getExecutedSteps(): StepResult[];
|
|
97
|
+
/**
|
|
98
|
+
* Register a compensation handler for a step
|
|
99
|
+
*/
|
|
100
|
+
registerCompensation(stepName: string, fn: () => Promise<void>): void;
|
|
101
|
+
/**
|
|
102
|
+
* Get compensations in reverse registration order
|
|
103
|
+
*/
|
|
104
|
+
getCompensationsInReverse(): Array<{
|
|
105
|
+
stepName: string;
|
|
106
|
+
fn: () => Promise<void>;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Check if any compensations are registered
|
|
110
|
+
*/
|
|
111
|
+
hasCompensations(): boolean;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A scoped context for parallel branch execution
|
|
115
|
+
*/
|
|
116
|
+
export declare class BranchContext {
|
|
117
|
+
private readonly parent;
|
|
118
|
+
private readonly scopePrefix;
|
|
119
|
+
private stepCounters;
|
|
120
|
+
get logger(): Logger;
|
|
121
|
+
get runId(): string;
|
|
122
|
+
get serverUrl(): string | undefined;
|
|
123
|
+
get apiKey(): string | undefined;
|
|
124
|
+
constructor(parent: ExecutionContext, scopePrefix: string);
|
|
125
|
+
generateStepId(name: string): string;
|
|
126
|
+
shouldSkipStep(stepId: string): boolean;
|
|
127
|
+
getFailedStep(stepId: string): unknown | undefined;
|
|
128
|
+
isStepTimedOut(stepId: string): boolean;
|
|
129
|
+
getMemoizedOutput<T>(stepId: string): T | undefined;
|
|
130
|
+
isResumingFrom(stepId: string, type: "sleep" | "wait_for_event"): boolean;
|
|
131
|
+
getResumeData<T>(): T | undefined;
|
|
132
|
+
markResumeProcessed(): void;
|
|
133
|
+
recordStep(step: StepResult): void;
|
|
134
|
+
createBranchContext(parallelName: string, branchIndex: number): BranchContext;
|
|
135
|
+
registerCompensation(stepName: string, fn: () => Promise<void>): void;
|
|
136
|
+
getCompensationsInReverse(): Array<{
|
|
137
|
+
stepName: string;
|
|
138
|
+
fn: () => Promise<void>;
|
|
139
|
+
}>;
|
|
140
|
+
hasCompensations(): boolean;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/internal/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,MAAM,EACN,OAAO,EACP,WAAW,EACX,aAAa,EAEb,UAAU,EACV,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,iBAAiB;IACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sBAAsB;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,sBAAsB;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,sBAAsB;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,mDAAmD;IACnD,OAAO,CAAC,YAAY,CAAkC;IACt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GAAG,SAAS;IAInD,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,gBAAgB,GAAG,OAAO;IAIzE,aAAa,CAAC,CAAC,KAAK,CAAC,GAAG,SAAS;IAIjC,mBAAmB,IAAI,IAAI;IAI3B,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAIlC,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa;IAK7E,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAIrE,yBAAyB,IAAI,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC;IAIjF,gBAAgB,IAAI,OAAO;CAG5B"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal Execution Context
|
|
3
|
+
*
|
|
4
|
+
* Manages step memoization and resume state during function execution.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Execution context for a function invocation
|
|
8
|
+
*/
|
|
9
|
+
export class ExecutionContext {
|
|
10
|
+
/** The run ID */
|
|
11
|
+
runId;
|
|
12
|
+
/** The function ID */
|
|
13
|
+
functionId;
|
|
14
|
+
/** Current attempt number */
|
|
15
|
+
attempt;
|
|
16
|
+
/** The triggering event */
|
|
17
|
+
event;
|
|
18
|
+
/** Run information */
|
|
19
|
+
runInfo;
|
|
20
|
+
/** Logger instance */
|
|
21
|
+
logger;
|
|
22
|
+
/** Step counters for generating unique step IDs */
|
|
23
|
+
stepCounters = new Map();
|
|
24
|
+
/** Completed steps from previous execution (memoized) */
|
|
25
|
+
completedSteps = new Map();
|
|
26
|
+
/** Steps executed in this invocation */
|
|
27
|
+
executedSteps = [];
|
|
28
|
+
/** Resume context for sleep/waitForEvent */
|
|
29
|
+
resumeContext;
|
|
30
|
+
/** Whether we've processed the resume */
|
|
31
|
+
resumeProcessed = false;
|
|
32
|
+
/** Compensation registry: step name -> compensation function */
|
|
33
|
+
compensationRegistry = new Map();
|
|
34
|
+
/** Ordered list of step names that have compensations registered */
|
|
35
|
+
compensationOrder = [];
|
|
36
|
+
/** Function-level default step timeout */
|
|
37
|
+
stepTimeout;
|
|
38
|
+
/** Server URL for steps that need to call back to the server (e.g., publish) */
|
|
39
|
+
serverUrl;
|
|
40
|
+
/** API key for authenticated requests from steps */
|
|
41
|
+
apiKey;
|
|
42
|
+
constructor(request, logger, eventDefinitions, stepTimeout, serverUrl, apiKey) {
|
|
43
|
+
this.runId = request.run_id;
|
|
44
|
+
this.functionId = request.function_id;
|
|
45
|
+
this.attempt = request.attempt;
|
|
46
|
+
// Parse event
|
|
47
|
+
const eventVersion = request.event.version ?? 1;
|
|
48
|
+
let eventData = request.event.data;
|
|
49
|
+
// Apply upcasting if registry is provided
|
|
50
|
+
if (eventDefinitions) {
|
|
51
|
+
eventData = eventDefinitions.upcastEvent(request.event.name, eventData, eventVersion);
|
|
52
|
+
}
|
|
53
|
+
this.event = {
|
|
54
|
+
id: request.event.id,
|
|
55
|
+
name: request.event.name,
|
|
56
|
+
version: eventVersion,
|
|
57
|
+
data: eventData,
|
|
58
|
+
timestamp: new Date(request.event.timestamp),
|
|
59
|
+
idempotencyKey: request.event.idempotency_key,
|
|
60
|
+
source: request.event.source,
|
|
61
|
+
metadata: request.event.metadata,
|
|
62
|
+
};
|
|
63
|
+
// Build run info
|
|
64
|
+
this.runInfo = {
|
|
65
|
+
id: this.runId,
|
|
66
|
+
functionId: this.functionId,
|
|
67
|
+
attempt: this.attempt,
|
|
68
|
+
startedAt: new Date(),
|
|
69
|
+
};
|
|
70
|
+
// Store completed steps for memoization
|
|
71
|
+
for (const step of request.steps) {
|
|
72
|
+
this.completedSteps.set(step.id, step);
|
|
73
|
+
}
|
|
74
|
+
// Store resume context
|
|
75
|
+
this.resumeContext = request.resume;
|
|
76
|
+
// Use provided logger or create default
|
|
77
|
+
this.logger = logger ?? createDefaultLogger(this.runId);
|
|
78
|
+
this.stepTimeout = stepTimeout;
|
|
79
|
+
this.serverUrl = serverUrl;
|
|
80
|
+
this.apiKey = apiKey;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Generate a unique step ID
|
|
84
|
+
*/
|
|
85
|
+
generateStepId(name) {
|
|
86
|
+
const index = this.stepCounters.get(name) ?? 0;
|
|
87
|
+
this.stepCounters.set(name, index + 1);
|
|
88
|
+
return `${this.runId}:${name}:${index}`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create a scoped context for a parallel branch
|
|
92
|
+
*/
|
|
93
|
+
createBranchContext(parallelName, branchIndex) {
|
|
94
|
+
const scopePrefix = `${this.runId}:${parallelName}:${branchIndex}`;
|
|
95
|
+
return new BranchContext(this, scopePrefix);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Check if a step is already completed (memoized)
|
|
99
|
+
*/
|
|
100
|
+
getCompletedStep(stepId) {
|
|
101
|
+
return this.completedSteps.get(stepId);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Check if we should skip step execution due to memoization
|
|
105
|
+
*/
|
|
106
|
+
shouldSkipStep(stepId) {
|
|
107
|
+
const completed = this.completedSteps.get(stepId);
|
|
108
|
+
return completed?.status === "completed";
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get the error data for a failed step, if it exists.
|
|
112
|
+
* Returns undefined if the step is not failed or not present.
|
|
113
|
+
*/
|
|
114
|
+
getFailedStep(stepId) {
|
|
115
|
+
const step = this.completedSteps.get(stepId);
|
|
116
|
+
if (step?.status !== "failed") {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
if (typeof step.error === "string") {
|
|
120
|
+
try {
|
|
121
|
+
return JSON.parse(step.error);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return step.error;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return step.error;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Check if a step has status "timed_out"
|
|
131
|
+
*/
|
|
132
|
+
isStepTimedOut(stepId) {
|
|
133
|
+
const step = this.completedSteps.get(stepId);
|
|
134
|
+
return step?.status === "timed_out";
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get the memoized output for a step
|
|
138
|
+
*/
|
|
139
|
+
getMemoizedOutput(stepId) {
|
|
140
|
+
const completed = this.completedSteps.get(stepId);
|
|
141
|
+
if (completed?.status === "completed") {
|
|
142
|
+
return completed.output;
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Check if we're resuming from a specific step
|
|
148
|
+
*/
|
|
149
|
+
isResumingFrom(stepId, type) {
|
|
150
|
+
if (!this.resumeContext) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
return (this.resumeContext.step_id === stepId && this.resumeContext.type === type);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Get the resume data (for waitForEvent)
|
|
157
|
+
*/
|
|
158
|
+
getResumeData() {
|
|
159
|
+
return this.resumeContext?.data;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Mark the resume as processed
|
|
163
|
+
*/
|
|
164
|
+
markResumeProcessed() {
|
|
165
|
+
this.resumeProcessed = true;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Check if the resume has been processed
|
|
169
|
+
*/
|
|
170
|
+
hasResumeBeenProcessed() {
|
|
171
|
+
return this.resumeProcessed;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Record a step execution result
|
|
175
|
+
*/
|
|
176
|
+
recordStep(step) {
|
|
177
|
+
this.executedSteps.push(step);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get all steps executed in this invocation
|
|
181
|
+
*/
|
|
182
|
+
getExecutedSteps() {
|
|
183
|
+
return [...this.executedSteps];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Register a compensation handler for a step
|
|
187
|
+
*/
|
|
188
|
+
registerCompensation(stepName, fn) {
|
|
189
|
+
if (this.compensationRegistry.has(stepName)) {
|
|
190
|
+
throw new Error(`Compensation already registered for step: ${stepName}`);
|
|
191
|
+
}
|
|
192
|
+
this.compensationRegistry.set(stepName, fn);
|
|
193
|
+
this.compensationOrder.push(stepName);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Get compensations in reverse registration order
|
|
197
|
+
*/
|
|
198
|
+
getCompensationsInReverse() {
|
|
199
|
+
const reversed = [...this.compensationOrder].reverse();
|
|
200
|
+
return reversed
|
|
201
|
+
.map((stepName) => {
|
|
202
|
+
const fn = this.compensationRegistry.get(stepName);
|
|
203
|
+
return fn ? { stepName, fn } : null;
|
|
204
|
+
})
|
|
205
|
+
.filter((entry) => entry !== null);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Check if any compensations are registered
|
|
209
|
+
*/
|
|
210
|
+
hasCompensations() {
|
|
211
|
+
return this.compensationOrder.length > 0;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* A scoped context for parallel branch execution
|
|
216
|
+
*/
|
|
217
|
+
export class BranchContext {
|
|
218
|
+
parent;
|
|
219
|
+
scopePrefix;
|
|
220
|
+
stepCounters = new Map();
|
|
221
|
+
get logger() {
|
|
222
|
+
return this.parent.logger;
|
|
223
|
+
}
|
|
224
|
+
get runId() {
|
|
225
|
+
return this.parent.runId;
|
|
226
|
+
}
|
|
227
|
+
get serverUrl() {
|
|
228
|
+
return this.parent.serverUrl;
|
|
229
|
+
}
|
|
230
|
+
get apiKey() {
|
|
231
|
+
return this.parent.apiKey;
|
|
232
|
+
}
|
|
233
|
+
constructor(parent, scopePrefix) {
|
|
234
|
+
this.parent = parent;
|
|
235
|
+
this.scopePrefix = scopePrefix;
|
|
236
|
+
}
|
|
237
|
+
generateStepId(name) {
|
|
238
|
+
const index = this.stepCounters.get(name) ?? 0;
|
|
239
|
+
this.stepCounters.set(name, index + 1);
|
|
240
|
+
return `${this.scopePrefix}:${name}:${index}`;
|
|
241
|
+
}
|
|
242
|
+
shouldSkipStep(stepId) {
|
|
243
|
+
return this.parent.shouldSkipStep(stepId);
|
|
244
|
+
}
|
|
245
|
+
getFailedStep(stepId) {
|
|
246
|
+
return this.parent.getFailedStep(stepId);
|
|
247
|
+
}
|
|
248
|
+
isStepTimedOut(stepId) {
|
|
249
|
+
return this.parent.isStepTimedOut(stepId);
|
|
250
|
+
}
|
|
251
|
+
getMemoizedOutput(stepId) {
|
|
252
|
+
return this.parent.getMemoizedOutput(stepId);
|
|
253
|
+
}
|
|
254
|
+
isResumingFrom(stepId, type) {
|
|
255
|
+
return this.parent.isResumingFrom(stepId, type);
|
|
256
|
+
}
|
|
257
|
+
getResumeData() {
|
|
258
|
+
return this.parent.getResumeData();
|
|
259
|
+
}
|
|
260
|
+
markResumeProcessed() {
|
|
261
|
+
this.parent.markResumeProcessed();
|
|
262
|
+
}
|
|
263
|
+
recordStep(step) {
|
|
264
|
+
this.parent.recordStep(step);
|
|
265
|
+
}
|
|
266
|
+
createBranchContext(parallelName, branchIndex) {
|
|
267
|
+
const nestedPrefix = `${this.scopePrefix}:${parallelName}:${branchIndex}`;
|
|
268
|
+
return new BranchContext(this.parent, nestedPrefix);
|
|
269
|
+
}
|
|
270
|
+
registerCompensation(stepName, fn) {
|
|
271
|
+
this.parent.registerCompensation(stepName, fn);
|
|
272
|
+
}
|
|
273
|
+
getCompensationsInReverse() {
|
|
274
|
+
return this.parent.getCompensationsInReverse();
|
|
275
|
+
}
|
|
276
|
+
hasCompensations() {
|
|
277
|
+
return this.parent.hasCompensations();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Create a default logger that logs to console
|
|
282
|
+
*/
|
|
283
|
+
function createDefaultLogger(runId) {
|
|
284
|
+
const prefix = `[ironflow:${runId.slice(-8)}]`;
|
|
285
|
+
return {
|
|
286
|
+
debug(message, data) {
|
|
287
|
+
if (process.env["IRONFLOW_DEBUG"]) {
|
|
288
|
+
// eslint-disable-next-line no-console
|
|
289
|
+
console.debug(prefix, message, data ?? "");
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
info(message, data) {
|
|
293
|
+
// eslint-disable-next-line no-console
|
|
294
|
+
console.info(prefix, message, data ?? "");
|
|
295
|
+
},
|
|
296
|
+
warn(message, data) {
|
|
297
|
+
// eslint-disable-next-line no-console
|
|
298
|
+
console.warn(prefix, message, data ?? "");
|
|
299
|
+
},
|
|
300
|
+
error(message, data) {
|
|
301
|
+
// eslint-disable-next-line no-console
|
|
302
|
+
console.error(prefix, message, data ?? "");
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/internal/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC3B,iBAAiB;IACR,KAAK,CAAS;IACvB,sBAAsB;IACb,UAAU,CAAS;IAC5B,6BAA6B;IACpB,OAAO,CAAS;IACzB,2BAA2B;IAClB,KAAK,CAAgB;IAC9B,sBAAsB;IACb,OAAO,CAAU;IAC1B,sBAAsB;IACb,MAAM,CAAS;IAExB,mDAAmD;IAC3C,YAAY,GAAwB,IAAI,GAAG,EAAE,CAAC;IACtD,yDAAyD;IACjD,cAAc,GAA+B,IAAI,GAAG,EAAE,CAAC;IAC/D,wCAAwC;IAChC,aAAa,GAAiB,EAAE,CAAC;IACzC,4CAA4C;IACpC,aAAa,CAAiB;IACtC,yCAAyC;IACjC,eAAe,GAAG,KAAK,CAAC;IAChC,gEAAgE;IACxD,oBAAoB,GAAqC,IA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