@restatedev/restate-sdk-cloudflare-workers 1.17.3 → 1.18.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/common_api.d.cts +2 -2
- package/dist/common_api.d.cts.map +1 -1
- package/dist/common_api.d.ts +2 -2
- package/dist/common_api.d.ts.map +1 -1
- package/dist/common_api.js.map +1 -1
- package/dist/context.d.cts +25 -8
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.ts +25 -8
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/context_impl.cjs +10 -10
- package/dist/context_impl.js +10 -10
- package/dist/context_impl.js.map +1 -1
- package/dist/endpoint/components.cjs +39 -7
- package/dist/endpoint/components.js +39 -8
- package/dist/endpoint/components.js.map +1 -1
- package/dist/endpoint/handlers/discovery.cjs +12 -2
- package/dist/endpoint/handlers/discovery.js +12 -2
- package/dist/endpoint/handlers/discovery.js.map +1 -1
- package/dist/endpoint/handlers/generic.cjs +1 -1
- package/dist/endpoint/handlers/generic.js +1 -1
- package/dist/endpoint/handlers/generic.js.map +1 -1
- package/dist/endpoint/handlers/vm/sdk_shared_core_wasm_bindings.d.ts +6 -6
- package/dist/endpoint/handlers/vm/sdk_shared_core_wasm_bindings_bg.js +30 -12
- package/dist/endpoint/handlers/vm/sdk_shared_core_wasm_bindings_bg.wasm +0 -0
- package/dist/endpoint/handlers/vm/sdk_shared_core_wasm_bindings_bg.wasm.d.ts +6 -6
- package/dist/fetch.d.cts +3 -3
- package/dist/fetch.d.ts +3 -3
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/internal.cjs +27 -0
- package/dist/internal.d.cts +30 -1
- package/dist/internal.d.cts.map +1 -1
- package/dist/internal.d.ts +30 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +27 -0
- package/dist/internal.js.map +1 -1
- package/dist/lambda.d.cts +3 -3
- package/dist/lambda.d.ts +3 -3
- package/dist/node.d.cts +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/types/errors.cjs +4 -2
- package/dist/types/errors.d.cts.map +1 -1
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +4 -2
- package/dist/types/errors.js.map +1 -1
- package/dist/types/rpc.d.cts +45 -28
- package/dist/types/rpc.d.cts.map +1 -1
- package/dist/types/rpc.d.ts +45 -28
- package/dist/types/rpc.d.ts.map +1 -1
- package/dist/types/rpc.js.map +1 -1
- package/package.json +3 -3
|
@@ -29,7 +29,7 @@ export const wasmvm_is_completed: (a: number, b: number) => number;
|
|
|
29
29
|
export const wasmvm_is_processing: (a: number) => number;
|
|
30
30
|
export const wasmvm_is_ready_to_execute: (a: number) => [number, number, number];
|
|
31
31
|
export const wasmvm_last_command_index: (a: number) => number;
|
|
32
|
-
export const wasmvm_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
32
|
+
export const wasmvm_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
33
33
|
export const wasmvm_notify_error: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
34
34
|
export const wasmvm_notify_error_for_next_command: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
35
35
|
export const wasmvm_notify_error_for_specific_command: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
@@ -45,8 +45,8 @@ export const wasmvm_sys_attach_invocation: (a: number, b: number, c: number) =>
|
|
|
45
45
|
export const wasmvm_sys_awakeable: (a: number) => [number, number, number];
|
|
46
46
|
export const wasmvm_sys_call: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number) => [number, number, number];
|
|
47
47
|
export const wasmvm_sys_cancel_invocation: (a: number, b: number, c: number) => [number, number];
|
|
48
|
-
export const wasmvm_sys_clear_all_state: (a: number) => [number, number];
|
|
49
|
-
export const wasmvm_sys_clear_state: (a: number, b: number, c: number) => [number, number];
|
|
48
|
+
export const wasmvm_sys_clear_all_state: (a: number, b: number, c: number) => [number, number];
|
|
49
|
+
export const wasmvm_sys_clear_state: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
50
50
|
export const wasmvm_sys_complete_awakeable_failure: (a: number, b: number, c: number, d: any) => [number, number];
|
|
51
51
|
export const wasmvm_sys_complete_awakeable_success: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
52
52
|
export const wasmvm_sys_complete_promise_failure: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
@@ -56,13 +56,13 @@ export const wasmvm_sys_complete_signal_success: (a: number, b: number, c: numbe
|
|
|
56
56
|
export const wasmvm_sys_end: (a: number) => [number, number];
|
|
57
57
|
export const wasmvm_sys_get_invocation_output: (a: number, b: number, c: number) => [number, number, number];
|
|
58
58
|
export const wasmvm_sys_get_promise: (a: number, b: number, c: number) => [number, number, number];
|
|
59
|
-
export const wasmvm_sys_get_state: (a: number, b: number, c: number) => [number, number, number];
|
|
60
|
-
export const wasmvm_sys_get_state_keys: (a: number) => [number, number, number];
|
|
59
|
+
export const wasmvm_sys_get_state: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
60
|
+
export const wasmvm_sys_get_state_keys: (a: number, b: number, c: number) => [number, number, number];
|
|
61
61
|
export const wasmvm_sys_input: (a: number) => [number, number, number];
|
|
62
62
|
export const wasmvm_sys_peek_promise: (a: number, b: number, c: number) => [number, number, number];
|
|
63
63
|
export const wasmvm_sys_run: (a: number, b: number, c: number) => [number, number, number];
|
|
64
64
|
export const wasmvm_sys_send: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: bigint, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number) => [number, number, number];
|
|
65
|
-
export const wasmvm_sys_set_state: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
65
|
+
export const wasmvm_sys_set_state: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
66
66
|
export const wasmvm_sys_signal: (a: number, b: number, c: number) => [number, number, number];
|
|
67
67
|
export const wasmvm_sys_sleep: (a: number, b: bigint, c: number, d: number) => [number, number, number];
|
|
68
68
|
export const wasmvm_sys_write_output_failure: (a: number, b: any) => [number, number];
|
package/dist/fetch.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.cjs";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.cjs";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request as Request$1, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request as Request$1, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.cjs";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.cjs";
|
|
7
7
|
import { internal_d_exports } from "./internal.cjs";
|
|
@@ -52,5 +52,5 @@ interface FetchEndpointOptions extends EndpointOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
declare function createEndpointHandler(options: FetchEndpointOptions): (request: Request, ...extraArgs: unknown[]) => Promise<Response>;
|
|
54
54
|
//#endregion
|
|
55
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, type FetchEndpoint, FetchEndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request$1 as Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
55
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, type FetchEndpoint, FetchEndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request$1 as Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
56
56
|
//# sourceMappingURL=fetch.d.cts.map
|
package/dist/fetch.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.js";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.js";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request as Request$1, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request as Request$1, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.js";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.js";
|
|
7
7
|
import { internal_d_exports } from "./internal.js";
|
|
@@ -52,5 +52,5 @@ interface FetchEndpointOptions extends EndpointOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
declare function createEndpointHandler(options: FetchEndpointOptions): (request: Request, ...extraArgs: unknown[]) => Promise<Response>;
|
|
54
54
|
//#endregion
|
|
55
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, type FetchEndpoint, FetchEndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request$1 as Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
55
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, type FetchEndpoint, FetchEndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request$1 as Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
56
56
|
//# sourceMappingURL=fetch.d.ts.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.cjs";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.cjs";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.cjs";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.cjs";
|
|
7
7
|
import { internal_d_exports } from "./internal.cjs";
|
|
@@ -10,4 +10,4 @@ import { FnOf, ObjectImplHandlers, ObjectPerHandlerOpts, ServiceImplHandlers, Se
|
|
|
10
10
|
import { EndpointOptions } from "./endpoint/types.cjs";
|
|
11
11
|
import { CombineablePromise, Descriptor, DescriptorOpts, Duration, HandlerDescriptor, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferInput, InferOutput, JournalValueCodec, ObjectDescriptor, ObjectHandler, RestateContext, RestateObjectContext, RestateObjectSharedContext, RestateWorkflowContext, RestateWorkflowSharedContext, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceInterface, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowSharedHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, iface, serde } from "./common_api.cjs";
|
|
12
12
|
import { NodeEndpointOptions, ServeOptions, createEndpointHandler, endpoint, serve } from "./node.cjs";
|
|
13
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
|
13
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.js";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.js";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.js";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.js";
|
|
7
7
|
import { internal_d_exports } from "./internal.js";
|
|
@@ -10,4 +10,4 @@ import { FnOf, ObjectImplHandlers, ObjectPerHandlerOpts, ServiceImplHandlers, Se
|
|
|
10
10
|
import { EndpointOptions } from "./endpoint/types.js";
|
|
11
11
|
import { CombineablePromise, Descriptor, DescriptorOpts, Duration, HandlerDescriptor, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferInput, InferOutput, JournalValueCodec, ObjectDescriptor, ObjectHandler, RestateContext, RestateObjectContext, RestateObjectSharedContext, RestateWorkflowContext, RestateWorkflowSharedContext, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceInterface, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowSharedHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, iface, serde } from "./common_api.js";
|
|
12
12
|
import { NodeEndpointOptions, ServeOptions, createEndpointHandler, endpoint, serve } from "./node.js";
|
|
13
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
|
13
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
package/dist/internal.cjs
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_errors = require('./types/errors.cjs');
|
|
3
|
+
const require_components = require('./endpoint/components.cjs');
|
|
3
4
|
|
|
4
5
|
//#region src/internal.ts
|
|
5
6
|
var internal_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
6
7
|
asInternal: () => asInternal,
|
|
8
|
+
explicitRecovery: () => explicitRecovery,
|
|
7
9
|
isSuspendedError: () => require_errors.isSuspendedError
|
|
8
10
|
});
|
|
9
11
|
/**
|
|
12
|
+
* Run the handlers with explicit recovery: a retried or resumed invocation doesn't replay the journal of its earlier attempts,
|
|
13
|
+
* but runs the handler again from the start, executing every context operation anew, e.g. reading the current state.
|
|
14
|
+
*
|
|
15
|
+
* The handler takes care of recovering from the effects of the earlier attempts, which might repeat (at least once):
|
|
16
|
+
* * Each attempt's calls and sends are new requests. To reach the invocation an earlier attempt started, give it an idempotency key that is the same on every attempt, such as one made from `ctx.request().id`.
|
|
17
|
+
* * `ctx.run` executes its action again on every attempt.
|
|
18
|
+
* * Awakeables are not supported.
|
|
19
|
+
*
|
|
20
|
+
* Spread the returned options into the service or handler options. Handler options take precedence over service options.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const counter = restate.object({
|
|
25
|
+
* name: "counter",
|
|
26
|
+
* handlers: { ... },
|
|
27
|
+
* options: { ...restate.internal.explicitRecovery() },
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @experimental
|
|
32
|
+
*/
|
|
33
|
+
function explicitRecovery() {
|
|
34
|
+
return { [require_components.EXPLICIT_RECOVERY]: true };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
10
37
|
* Downcast the given context to {@link ContextInternal}, to access the internal APIs.
|
|
11
38
|
*
|
|
12
39
|
* Works with every context type passed to handlers, e.g. `Context`, `ObjectContext`, `ObjectSharedContext`, `WorkflowContext`.
|
package/dist/internal.d.cts
CHANGED
|
@@ -4,8 +4,37 @@ import { Serde } from "@restatedev/restate-sdk-core";
|
|
|
4
4
|
|
|
5
5
|
//#region src/internal.d.ts
|
|
6
6
|
declare namespace internal_d_exports {
|
|
7
|
-
export { ContextInternal, GetProjectOptions, asInternal, isSuspendedError };
|
|
7
|
+
export { ContextInternal, ExplicitRecoveryOptions, GetProjectOptions, asInternal, explicitRecovery, isSuspendedError };
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Options set by {@link explicitRecovery}, to spread into the options of a service, virtual object, workflow or handler.
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
type ExplicitRecoveryOptions = Record<never, never>;
|
|
15
|
+
/**
|
|
16
|
+
* Run the handlers with explicit recovery: a retried or resumed invocation doesn't replay the journal of its earlier attempts,
|
|
17
|
+
* but runs the handler again from the start, executing every context operation anew, e.g. reading the current state.
|
|
18
|
+
*
|
|
19
|
+
* The handler takes care of recovering from the effects of the earlier attempts, which might repeat (at least once):
|
|
20
|
+
* * Each attempt's calls and sends are new requests. To reach the invocation an earlier attempt started, give it an idempotency key that is the same on every attempt, such as one made from `ctx.request().id`.
|
|
21
|
+
* * `ctx.run` executes its action again on every attempt.
|
|
22
|
+
* * Awakeables are not supported.
|
|
23
|
+
*
|
|
24
|
+
* Spread the returned options into the service or handler options. Handler options take precedence over service options.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const counter = restate.object({
|
|
29
|
+
* name: "counter",
|
|
30
|
+
* handlers: { ... },
|
|
31
|
+
* options: { ...restate.internal.explicitRecovery() },
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @experimental
|
|
36
|
+
*/
|
|
37
|
+
declare function explicitRecovery(): ExplicitRecoveryOptions;
|
|
9
38
|
/**
|
|
10
39
|
* Downcast the given context to {@link ContextInternal}, to access the internal APIs.
|
|
11
40
|
*
|
package/dist/internal.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.cts","names":[],"sources":["../src/internal.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.d.cts","names":[],"sources":["../src/internal.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;KAWY,uBAAA,GAA0B;;;;;;AAAtC;AAwBA;AAiBA;AAWA;;;;;;;;;;;;;;AAAgD,iBA5BhC,gBAAA,CAAA,CA4BgC,EA5BZ,uBA4BY;AAuJhD;;;;;;;;;;;;iBAlKgB,UAAA,MAAgB,UAAU;;;;;;;;UAWzB,eAAA,SAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGvB;;;;;;;;;;yBAWO,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAkChB,kBAAkB,UAAU,QAAQ,oBAC9C,kBAAkB,QAAQ,WACnC,eAAe;;;;;;;KAQR;;;;UAIF,MAAM;;;;;;;gBAQA,MAAM"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -4,8 +4,37 @@ import { Serde } from "@restatedev/restate-sdk-core";
|
|
|
4
4
|
|
|
5
5
|
//#region src/internal.d.ts
|
|
6
6
|
declare namespace internal_d_exports {
|
|
7
|
-
export { ContextInternal, GetProjectOptions, asInternal, isSuspendedError };
|
|
7
|
+
export { ContextInternal, ExplicitRecoveryOptions, GetProjectOptions, asInternal, explicitRecovery, isSuspendedError };
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Options set by {@link explicitRecovery}, to spread into the options of a service, virtual object, workflow or handler.
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
type ExplicitRecoveryOptions = Record<never, never>;
|
|
15
|
+
/**
|
|
16
|
+
* Run the handlers with explicit recovery: a retried or resumed invocation doesn't replay the journal of its earlier attempts,
|
|
17
|
+
* but runs the handler again from the start, executing every context operation anew, e.g. reading the current state.
|
|
18
|
+
*
|
|
19
|
+
* The handler takes care of recovering from the effects of the earlier attempts, which might repeat (at least once):
|
|
20
|
+
* * Each attempt's calls and sends are new requests. To reach the invocation an earlier attempt started, give it an idempotency key that is the same on every attempt, such as one made from `ctx.request().id`.
|
|
21
|
+
* * `ctx.run` executes its action again on every attempt.
|
|
22
|
+
* * Awakeables are not supported.
|
|
23
|
+
*
|
|
24
|
+
* Spread the returned options into the service or handler options. Handler options take precedence over service options.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const counter = restate.object({
|
|
29
|
+
* name: "counter",
|
|
30
|
+
* handlers: { ... },
|
|
31
|
+
* options: { ...restate.internal.explicitRecovery() },
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @experimental
|
|
36
|
+
*/
|
|
37
|
+
declare function explicitRecovery(): ExplicitRecoveryOptions;
|
|
9
38
|
/**
|
|
10
39
|
* Downcast the given context to {@link ContextInternal}, to access the internal APIs.
|
|
11
40
|
*
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","names":[],"sources":["../src/internal.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.d.ts","names":[],"sources":["../src/internal.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;KAWY,uBAAA,GAA0B;;;;;;AAAtC;AAwBA;AAiBA;AAWA;;;;;;;;;;;;;;AAAgD,iBA5BhC,gBAAA,CAAA,CA4BgC,EA5BZ,uBA4BY;AAuJhD;;;;;;;;;;;;iBAlKgB,UAAA,MAAgB,UAAU;;;;;;;;UAWzB,eAAA,SAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgGvB;;;;;;;;;;yBAWO,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAkChB,kBAAkB,UAAU,QAAQ,oBAC9C,kBAAkB,QAAQ,WACnC,eAAe;;;;;;;KAQR;;;;UAIF,MAAM;;;;;;;gBAQA,MAAM"}
|
package/dist/internal.js
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
import { __export } from "./_virtual/rolldown_runtime.js";
|
|
2
2
|
import { isSuspendedError } from "./types/errors.js";
|
|
3
|
+
import { EXPLICIT_RECOVERY } from "./endpoint/components.js";
|
|
3
4
|
|
|
4
5
|
//#region src/internal.ts
|
|
5
6
|
var internal_exports = /* @__PURE__ */ __export({
|
|
6
7
|
asInternal: () => asInternal,
|
|
8
|
+
explicitRecovery: () => explicitRecovery,
|
|
7
9
|
isSuspendedError: () => isSuspendedError
|
|
8
10
|
});
|
|
9
11
|
/**
|
|
12
|
+
* Run the handlers with explicit recovery: a retried or resumed invocation doesn't replay the journal of its earlier attempts,
|
|
13
|
+
* but runs the handler again from the start, executing every context operation anew, e.g. reading the current state.
|
|
14
|
+
*
|
|
15
|
+
* The handler takes care of recovering from the effects of the earlier attempts, which might repeat (at least once):
|
|
16
|
+
* * Each attempt's calls and sends are new requests. To reach the invocation an earlier attempt started, give it an idempotency key that is the same on every attempt, such as one made from `ctx.request().id`.
|
|
17
|
+
* * `ctx.run` executes its action again on every attempt.
|
|
18
|
+
* * Awakeables are not supported.
|
|
19
|
+
*
|
|
20
|
+
* Spread the returned options into the service or handler options. Handler options take precedence over service options.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const counter = restate.object({
|
|
25
|
+
* name: "counter",
|
|
26
|
+
* handlers: { ... },
|
|
27
|
+
* options: { ...restate.internal.explicitRecovery() },
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @experimental
|
|
32
|
+
*/
|
|
33
|
+
function explicitRecovery() {
|
|
34
|
+
return { [EXPLICIT_RECOVERY]: true };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
10
37
|
* Downcast the given context to {@link ContextInternal}, to access the internal APIs.
|
|
11
38
|
*
|
|
12
39
|
* Works with every context type passed to handlers, e.g. `Context`, `ObjectContext`, `ObjectSharedContext`, `WorkflowContext`.
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","names":[],"sources":["../src/internal.ts"],"sourcesContent":["import { Context, InvocationId, RestatePromise } from \"./context.js\";\nimport type { Serde } from \"@restatedev/restate-sdk-core\";\n\nexport { isSuspendedError } from \"./types/errors.js\";\n\n/**\n * Downcast the given context to {@link ContextInternal}, to access the internal APIs.\n *\n * Works with every context type passed to handlers, e.g. `Context`, `ObjectContext`, `ObjectSharedContext`, `WorkflowContext`.\n *\n * @example\n * ```ts\n * const ctxInternal = restate.internal.asInternal(ctx);\n * ```\n *\n * @experimental\n */\nexport function asInternal(ctx: Context): ContextInternal {\n return ctx as ContextInternal;\n}\n\n/**\n * Internal {@link Context} interface exposing additional features.\n *\n * Please note that this API is to be considered experimental and might change without notice.\n *\n * @experimental\n */\nexport interface ContextInternal extends Context {\n /**\n * Returns true if the handler is in the processing phase.\n * This is the mechanism used by `ctx.console` to distinguish whether we should log or not in replaying/processing.\n *\n * **WARNING**: This method should not be used to influence control flow, as it will **surely** lead to non-determinism errors!\n *\n * @experimental\n */\n isProcessing(): boolean;\n\n /**\n * Returns a {@link RestatePromise} that resolves with `undefined` when Restate signals cancellation\n * of the current invocation.\n *\n * This method **MUST** only be used when the handler (or its parent service/endpoint) is configured\n * with `explicitCancellation: true`. Without configuring this option, cancellations are propagated automatically,\n * and this promise will **NEVER** resolve.\n *\n * **Promise reuse:** calling this method multiple times returns the **same** promise instance as long as\n * the current cancellation signal has not yet arrived. Once the promise resolves (cancellation received),\n * later calls return a **new** promise that will resolve on the next cancellation signal.\n *\n * @example Race a long-running side effect against cancellation\n * ```ts\n * const greeter = restate.service({\n * name: \"greeter\",\n * handlers: {\n * greet: async (ctx: restate.Context, name: string) => {\n * const ctxInternal = restate.internal.asInternal(ctx);\n * const result = await RestatePromise.race([\n * ctx.run(() => longRunningTask(name)),\n * ctxInternal.cancellation().map(() => { throw new restate.TerminalError(\"Cancelled\") }),\n * ]);\n * return result;\n * },\n * },\n * options: { explicitCancellation: true },\n * });\n * ```\n *\n * @example Use the cancellation promise to create an AbortSignal for ctx.run\n * ```ts\n * const greeter = restate.service({\n * name: \"greeter\",\n * handlers: {\n * greet: async (ctx: restate.Context, name: string) => {\n * const ctxInternal = restate.internal.asInternal(ctx);\n * const controller = new AbortController();\n * const cancellation = ctxInternal.cancellation()\n * .map(() => {\n * controller.abort();\n * throw new restate.TerminalError(\"Cancelled\");\n * });\n *\n * return RestatePromise.race([\n * ctx.run(() => fetch(`https://api.example.com/greet/${name}`, { signal: controller.signal })),\n * cancellation,\n * ]);\n * },\n * },\n * options: { explicitCancellation: true },\n * });\n * ```\n *\n * @example Handle cancellation, perform cleanup, then listen for the next cancellation\n * ```ts\n * const greeter = restate.service({\n * name: \"greeter\",\n * handlers: {\n * greet: async (ctx: restate.Context, name: string) => {\n * const ctxInternal = restate.internal.asInternal(ctx);\n * try {\n * return await RestatePromise.race([\n * ctx.run(() => longRunningTask(name)),\n * ctxInternal.cancellation().map(() => { throw new restate.TerminalError(\"Cancelled\") }),\n * ]);\n * } catch (e) {\n * // Perform cleanup\n * await ctx.run(() => cleanupResources(name));\n *\n * // After cancellation is resolved, ctx.cancellation() returns a fresh promise.\n * // Race cleanup confirmation against the next cancellation signal.\n * await RestatePromise.race([\n * ctx.run(() => confirmCleanup(name)),\n * ctxInternal.cancellation().map(() => { throw new restate.TerminalError(\"Canceled during cleanup\") }),\n * ]);\n * }\n * },\n * },\n * options: { explicitCancellation: true },\n * });\n * ```\n *\n * @experimental\n */\n cancellation(): RestatePromise<void>;\n\n /**\n * Cancel all previous calls made from this handler.\n *\n * This method **MUST** only be used when the handler (or its parent service/endpoint) is configured\n * with `explicitCancellation: true`. Without configuring this option, this operation will always be a no-op.\n *\n * @return the invocation id of the canceled calls.\n * @experimental\n */\n cancelPreviousCalls(): RestatePromise<InvocationId[]>;\n\n /**\n * Get state from the Restate runtime, apply the given `projection` to it,\n * and record in the journal only the result of the projection.\n *\n * Use this to read big state values when you need only a small part of them:\n * unlike `ctx.get`, the complete state value is not recorded in the journal,\n * only its projection.\n *\n * It will appear in the UI as run(project:state_key).\n *\n * This method **MUST** only be used within Virtual Object and Workflow handlers.\n *\n * **NOTE:** Requires Restate >= 1.8 with service protocol V8 enabled, and **does not** work with request/response protocol mode (e.g. with AWS Lambda).\n *\n * @param name key of the state to retrieve\n * @param projection function receiving the state value, or `null` if the state is empty.\n * @param options serde for the state value, and serde for the projection result.\n * @returns a {@link RestatePromise} resolved with the result of the projection.\n *\n * @example\n * ```ts\n * const ctxInternal = restate.internal.asInternal(ctx);\n * const itemsCount = await ctxInternal.getProject<Item[], number>(\n * \"items\",\n * (items) => items?.length ?? 0\n * );\n * ```\n *\n * @experimental\n */\n getProject<TValue, TResult>(\n name: string,\n projection: (value: TValue | null) => TResult | Promise<TResult>,\n options?: GetProjectOptions<TValue, TResult>\n ): RestatePromise<TResult>;\n}\n\n/**\n * Options for {@link ContextInternal.getProject}.\n *\n * @experimental\n */\nexport type GetProjectOptions<TValue, TResult> = {\n /**\n * Serde used to deserialize the state value.\n */\n serde?: Serde<TValue>;\n\n /**\n * Serde used to serialize the projection result, recorded in the journal.\n *\n * If not set, defaults to {@link GetProjectOptions.serde} when that is set,\n * otherwise to the default serde.\n */\n resultSerde?: Serde<TResult>;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.js","names":[],"sources":["../src/internal.ts"],"sourcesContent":["import { Context, InvocationId, RestatePromise } from \"./context.js\";\nimport type { Serde } from \"@restatedev/restate-sdk-core\";\nimport { EXPLICIT_RECOVERY } from \"./endpoint/components.js\";\n\nexport { isSuspendedError } from \"./types/errors.js\";\n\n/**\n * Options set by {@link explicitRecovery}, to spread into the options of a service, virtual object, workflow or handler.\n *\n * @experimental\n */\nexport type ExplicitRecoveryOptions = Record<never, never>;\n\n/**\n * Run the handlers with explicit recovery: a retried or resumed invocation doesn't replay the journal of its earlier attempts,\n * but runs the handler again from the start, executing every context operation anew, e.g. reading the current state.\n *\n * The handler takes care of recovering from the effects of the earlier attempts, which might repeat (at least once):\n * * Each attempt's calls and sends are new requests. To reach the invocation an earlier attempt started, give it an idempotency key that is the same on every attempt, such as one made from `ctx.request().id`.\n * * `ctx.run` executes its action again on every attempt.\n * * Awakeables are not supported.\n *\n * Spread the returned options into the service or handler options. Handler options take precedence over service options.\n *\n * @example\n * ```ts\n * const counter = restate.object({\n * name: \"counter\",\n * handlers: { ... },\n * options: { ...restate.internal.explicitRecovery() },\n * });\n * ```\n *\n * @experimental\n */\nexport function explicitRecovery(): ExplicitRecoveryOptions {\n const options = { [EXPLICIT_RECOVERY]: true };\n return options;\n}\n\n/**\n * Downcast the given context to {@link ContextInternal}, to access the internal APIs.\n *\n * Works with every context type passed to handlers, e.g. `Context`, `ObjectContext`, `ObjectSharedContext`, `WorkflowContext`.\n *\n * @example\n * ```ts\n * const ctxInternal = restate.internal.asInternal(ctx);\n * ```\n *\n * @experimental\n */\nexport function asInternal(ctx: Context): ContextInternal {\n return ctx as ContextInternal;\n}\n\n/**\n * Internal {@link Context} interface exposing additional features.\n *\n * Please note that this API is to be considered experimental and might change without notice.\n *\n * @experimental\n */\nexport interface ContextInternal extends Context {\n /**\n * Returns true if the handler is in the processing phase.\n * This is the mechanism used by `ctx.console` to distinguish whether we should log or not in replaying/processing.\n *\n * **WARNING**: This method should not be used to influence control flow, as it will **surely** lead to non-determinism errors!\n *\n * @experimental\n */\n isProcessing(): boolean;\n\n /**\n * Returns a {@link RestatePromise} that resolves with `undefined` when Restate signals cancellation\n * of the current invocation.\n *\n * This method **MUST** only be used when the handler (or its parent service/endpoint) is configured\n * with `explicitCancellation: true`. Without configuring this option, cancellations are propagated automatically,\n * and this promise will **NEVER** resolve.\n *\n * **Promise reuse:** calling this method multiple times returns the **same** promise instance as long as\n * the current cancellation signal has not yet arrived. Once the promise resolves (cancellation received),\n * later calls return a **new** promise that will resolve on the next cancellation signal.\n *\n * @example Race a long-running side effect against cancellation\n * ```ts\n * const greeter = restate.service({\n * name: \"greeter\",\n * handlers: {\n * greet: async (ctx: restate.Context, name: string) => {\n * const ctxInternal = restate.internal.asInternal(ctx);\n * const result = await RestatePromise.race([\n * ctx.run(() => longRunningTask(name)),\n * ctxInternal.cancellation().map(() => { throw new restate.TerminalError(\"Cancelled\") }),\n * ]);\n * return result;\n * },\n * },\n * options: { explicitCancellation: true },\n * });\n * ```\n *\n * @example Use the cancellation promise to create an AbortSignal for ctx.run\n * ```ts\n * const greeter = restate.service({\n * name: \"greeter\",\n * handlers: {\n * greet: async (ctx: restate.Context, name: string) => {\n * const ctxInternal = restate.internal.asInternal(ctx);\n * const controller = new AbortController();\n * const cancellation = ctxInternal.cancellation()\n * .map(() => {\n * controller.abort();\n * throw new restate.TerminalError(\"Cancelled\");\n * });\n *\n * return RestatePromise.race([\n * ctx.run(() => fetch(`https://api.example.com/greet/${name}`, { signal: controller.signal })),\n * cancellation,\n * ]);\n * },\n * },\n * options: { explicitCancellation: true },\n * });\n * ```\n *\n * @example Handle cancellation, perform cleanup, then listen for the next cancellation\n * ```ts\n * const greeter = restate.service({\n * name: \"greeter\",\n * handlers: {\n * greet: async (ctx: restate.Context, name: string) => {\n * const ctxInternal = restate.internal.asInternal(ctx);\n * try {\n * return await RestatePromise.race([\n * ctx.run(() => longRunningTask(name)),\n * ctxInternal.cancellation().map(() => { throw new restate.TerminalError(\"Cancelled\") }),\n * ]);\n * } catch (e) {\n * // Perform cleanup\n * await ctx.run(() => cleanupResources(name));\n *\n * // After cancellation is resolved, ctx.cancellation() returns a fresh promise.\n * // Race cleanup confirmation against the next cancellation signal.\n * await RestatePromise.race([\n * ctx.run(() => confirmCleanup(name)),\n * ctxInternal.cancellation().map(() => { throw new restate.TerminalError(\"Canceled during cleanup\") }),\n * ]);\n * }\n * },\n * },\n * options: { explicitCancellation: true },\n * });\n * ```\n *\n * @experimental\n */\n cancellation(): RestatePromise<void>;\n\n /**\n * Cancel all previous calls made from this handler.\n *\n * This method **MUST** only be used when the handler (or its parent service/endpoint) is configured\n * with `explicitCancellation: true`. Without configuring this option, this operation will always be a no-op.\n *\n * @return the invocation id of the canceled calls.\n * @experimental\n */\n cancelPreviousCalls(): RestatePromise<InvocationId[]>;\n\n /**\n * Get state from the Restate runtime, apply the given `projection` to it,\n * and record in the journal only the result of the projection.\n *\n * Use this to read big state values when you need only a small part of them:\n * unlike `ctx.get`, the complete state value is not recorded in the journal,\n * only its projection.\n *\n * It will appear in the UI as run(project:state_key).\n *\n * This method **MUST** only be used within Virtual Object and Workflow handlers.\n *\n * **NOTE:** Requires Restate >= 1.8 with service protocol V8 enabled, and **does not** work with request/response protocol mode (e.g. with AWS Lambda).\n *\n * @param name key of the state to retrieve\n * @param projection function receiving the state value, or `null` if the state is empty.\n * @param options serde for the state value, and serde for the projection result.\n * @returns a {@link RestatePromise} resolved with the result of the projection.\n *\n * @example\n * ```ts\n * const ctxInternal = restate.internal.asInternal(ctx);\n * const itemsCount = await ctxInternal.getProject<Item[], number>(\n * \"items\",\n * (items) => items?.length ?? 0\n * );\n * ```\n *\n * @experimental\n */\n getProject<TValue, TResult>(\n name: string,\n projection: (value: TValue | null) => TResult | Promise<TResult>,\n options?: GetProjectOptions<TValue, TResult>\n ): RestatePromise<TResult>;\n}\n\n/**\n * Options for {@link ContextInternal.getProject}.\n *\n * @experimental\n */\nexport type GetProjectOptions<TValue, TResult> = {\n /**\n * Serde used to deserialize the state value.\n */\n serde?: Serde<TValue>;\n\n /**\n * Serde used to serialize the projection result, recorded in the journal.\n *\n * If not set, defaults to {@link GetProjectOptions.serde} when that is set,\n * otherwise to the default serde.\n */\n resultSerde?: Serde<TResult>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,mBAA4C;AAE1D,QADgB,GAAG,oBAAoB,MAAM;;;;;;;;;;;;;;AAgB/C,SAAgB,WAAW,KAA+B;AACxD,QAAO"}
|
package/dist/lambda.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.cjs";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.cjs";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.cjs";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.cjs";
|
|
7
7
|
import { internal_d_exports } from "./internal.cjs";
|
|
@@ -32,5 +32,5 @@ declare function endpoint(): LambdaEndpoint;
|
|
|
32
32
|
*/
|
|
33
33
|
declare function createEndpointHandler(options: EndpointOptions): (event: any, ctx: any) => Promise<any>;
|
|
34
34
|
//#endregion
|
|
35
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, type LambdaEndpoint, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
35
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, type LambdaEndpoint, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
36
36
|
//# sourceMappingURL=lambda.d.cts.map
|
package/dist/lambda.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.js";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.js";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.js";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.js";
|
|
7
7
|
import { internal_d_exports } from "./internal.js";
|
|
@@ -32,5 +32,5 @@ declare function endpoint(): LambdaEndpoint;
|
|
|
32
32
|
*/
|
|
33
33
|
declare function createEndpointHandler(options: EndpointOptions): (event: any, ctx: any) => Promise<any>;
|
|
34
34
|
//#endregion
|
|
35
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, type LambdaEndpoint, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
35
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, type LambdaEndpoint, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, service, workflow };
|
|
36
36
|
//# sourceMappingURL=lambda.d.ts.map
|
package/dist/node.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.cjs";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.cjs";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.cjs";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.cjs";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.cjs";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.cjs";
|
|
7
7
|
import { internal_d_exports } from "./internal.cjs";
|
|
@@ -87,5 +87,5 @@ declare function serve({
|
|
|
87
87
|
...options
|
|
88
88
|
}: ServeOptions): Promise<number>;
|
|
89
89
|
//#endregion
|
|
90
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
|
90
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
|
91
91
|
//# sourceMappingURL=node.d.cts.map
|
package/dist/node.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CancelledError, PauseError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.js";
|
|
2
2
|
import { Hooks, HooksProvider, Interceptor } from "./hooks.js";
|
|
3
|
-
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
-
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
3
|
+
import { Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendClientFromDescriptors, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, StatePreload, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
|
|
4
|
+
import { Context, ContextDate, DurablePromise, EntryOptions, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, ScopedContext, SignalReference, Target, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
|
|
5
5
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.js";
|
|
6
6
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.js";
|
|
7
7
|
import { internal_d_exports } from "./internal.js";
|
|
@@ -87,5 +87,5 @@ declare function serve({
|
|
|
87
87
|
...options
|
|
88
88
|
}: ServeOptions): Promise<number>;
|
|
89
89
|
//#endregion
|
|
90
|
-
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
|
90
|
+
export { CancelledError, Client, ClientCallOptions, ClientFromDescriptors, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, Descriptor, DescriptorOpts, DurablePromise, Duration, EndpointOptions, EntryOptions, FnOf, GenericCall, GenericSend, HandlerDescriptor, Hooks, HooksProvider, ImplementedDefinition, ImplementedObjectDefinition, ImplementedServiceDefinition, ImplementedWorkflowDefinition, InferArg, InferInput, InferOutput, Interceptor, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, InvocationReference, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, NodeEndpointOptions, ObjectContext, ObjectDescriptor, ObjectHandler, ObjectHandlerOpts, ObjectImplHandlers, ObjectOptions, ObjectOpts, ObjectPerHandlerOpts, ObjectSharedContext, Opts, PauseError, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, ScopedContext, SendClient, SendClientFromDescriptors, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceDescriptor, ServiceHandler, ServiceHandlerOpts, ServiceImplHandlers, ServiceInterface, ServiceOptions, ServiceOpts, ServicePerHandlerOpts, SignalReference, StatePreload, Target, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowDescriptor, WorkflowHandler, WorkflowHandlerOpts, WorkflowImplHandlers, WorkflowOptions, WorkflowOpts, WorkflowPerHandlerOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, iface, implement, internal_d_exports as internal, isRestatePromise, object, rpc, serde, serve, service, workflow };
|
|
91
91
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/package.cjs
CHANGED
package/dist/package.js
CHANGED
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@restatedev/restate-sdk\",\n \"version\": \"1.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@restatedev/restate-sdk\",\n \"version\": \"1.18.0\",\n \"description\": \"Typescript SDK for Restate\",\n \"author\": \"Restate Developers\",\n \"email\": \"code@restate.dev\",\n \"license\": \"MIT\",\n \"homepage\": \"https://github.com/restatedev/sdk-typescript#readme\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/restatedev/sdk-typescript.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/restatedev/sdk-typescript/issues\"\n },\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.cts\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./fetch\": {\n \"import\": \"./dist/fetch.js\",\n \"require\": \"./dist/fetch.cjs\"\n },\n \"./lambda\": {\n \"import\": \"./dist/lambda.js\",\n \"require\": \"./dist/lambda.cjs\"\n },\n \"./node\": {\n \"import\": \"./dist/node.js\",\n \"require\": \"./dist/node.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"README.md\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"test\": \"turbo run _test --filter={.}...\",\n \"_test\": \"vitest run\",\n \"build\": \"turbo run _build --filter={.}...\",\n \"_build\": \"tsc --noEmit && tsdown\",\n \"dev\": \"tsc --noEmit --watch\",\n \"clean\": \"rm -rf dist *.tsbuildinfo .turbo\",\n \"check:types\": \"turbo run _check:types --filter={.}...\",\n \"_check:types\": \"tsc --noEmit --project tsconfig.build.json\",\n \"lint\": \"eslint .\",\n \"check:exports\": \"turbo run _check:exports --filter={.}...\",\n \"_check:exports\": \"attw --pack .\",\n \"check:api\": \"turbo run _check:api --filter={.}...\",\n \"_check:api\": \"api-extractor run --local && api-extractor run --local --config api-extractor.fetch.json && api-extractor run --local --config api-extractor.lambda.json && api-extractor run --local --config api-extractor.node.json\"\n },\n \"dependencies\": {\n \"@restatedev/restate-sdk-core\": \"workspace:*\"\n },\n \"devDependencies\": {\n \"@types/aws-lambda\": \"^8.10.115\"\n },\n \"typesVersions\": {\n \"*\": {\n \"fetch\": [\n \"./dist/fetch.d.ts\"\n ],\n \"lambda\": [\n \"./dist/lambda.d.ts\"\n ],\n \"node\": [\n \"./dist/node.d.ts\"\n ]\n }\n }\n}\n"],"mappings":";cAEa"}
|
package/dist/types/errors.cjs
CHANGED
|
@@ -92,8 +92,9 @@ var RetryableError = class RetryableError extends RestateError {
|
|
|
92
92
|
*/
|
|
93
93
|
static from(cause, options) {
|
|
94
94
|
const error = ensureError(cause);
|
|
95
|
+
const errorCode = error instanceof RestateError ? error.code : error["errorCode"];
|
|
95
96
|
return new RetryableError(error.message, {
|
|
96
|
-
errorCode
|
|
97
|
+
errorCode,
|
|
97
98
|
cause,
|
|
98
99
|
...options
|
|
99
100
|
});
|
|
@@ -118,8 +119,9 @@ var PauseError = class PauseError extends RestateError {
|
|
|
118
119
|
*/
|
|
119
120
|
static from(cause) {
|
|
120
121
|
const error = ensureError(cause);
|
|
122
|
+
const errorCode = error instanceof RestateError ? error.code : error["errorCode"];
|
|
121
123
|
return new PauseError(error.message, {
|
|
122
|
-
errorCode
|
|
124
|
+
errorCode,
|
|
123
125
|
cause
|
|
124
126
|
});
|
|
125
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.cts","names":[],"sources":["../../src/types/errors.ts"],"sourcesContent":[],"mappings":";;;;AAwHa,cA3CA,YAAA,SAAqB,KAAA,CA2Ca;EAWlC,SAAA,IAAA,EAAA,MAAe;EAQX,IAAA,EAAA,MAAA;EAaJ,WAAA,CAAA,OAAe,EAAA,MAAA,EAAA,OAuBQ,CAvBR,EAAA;IAGJ,SAAA,CAAA,EAAA,MAAA;IAIV,KAAA,CAAA,EAAA,GAAA;EAgBsB,CAAA;;;;
|
|
1
|
+
{"version":3,"file":"errors.d.cts","names":[],"sources":["../../src/types/errors.ts"],"sourcesContent":[],"mappings":";;;;AAwHa,cA3CA,YAAA,SAAqB,KAAA,CA2Ca;EAWlC,SAAA,IAAA,EAAA,MAAe;EAQX,IAAA,EAAA,MAAA;EAaJ,WAAA,CAAA,OAAe,EAAA,MAAA,EAAA,OAuBQ,CAvBR,EAAA;IAGJ,SAAA,CAAA,EAAA,MAAA;IAIV,KAAA,CAAA,EAAA,GAAA;EAgBsB,CAAA;;;;AAoBpC;AA2CA;;cAlJa,aAAA,SAAsB,YAAA;;sBAEN;;;;;;;;;;;;eAeZ;;;;;;cAWJ,YAAA,SAAqB,aAAA;;;;;;;cAWrB,cAAA,SAAuB,aAAA;;;;UAQnB,qBAAA;;;;eAIF;;;;;;;;cASF,cAAA,SAAuB,YAAA;;wBAGZ;yCAIV;;;;;;;oCAgBsB,wBAAwB;;;;;;;;cAoB/C,UAAA,SAAmB,YAAA;;;;;;;;;2BAoBL;;;;;;;;;;;iBAuBX,gBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","names":[],"sources":["../../src/types/errors.ts"],"sourcesContent":[],"mappings":";;;;AAwHa,cA3CA,YAAA,SAAqB,KAAA,CA2Ca;EAWlC,SAAA,IAAA,EAAA,MAAe;EAQX,IAAA,EAAA,MAAA;EAaJ,WAAA,CAAA,OAAe,EAAA,MAAA,EAAA,OAuBQ,CAvBR,EAAA;IAGJ,SAAA,CAAA,EAAA,MAAA;IAIV,KAAA,CAAA,EAAA,GAAA;EAgBsB,CAAA;;;;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","names":[],"sources":["../../src/types/errors.ts"],"sourcesContent":[],"mappings":";;;;AAwHa,cA3CA,YAAA,SAAqB,KAAA,CA2Ca;EAWlC,SAAA,IAAA,EAAA,MAAe;EAQX,IAAA,EAAA,MAAA;EAaJ,WAAA,CAAA,OAAe,EAAA,MAAA,EAAA,OAuBQ,CAvBR,EAAA;IAGJ,SAAA,CAAA,EAAA,MAAA;IAIV,KAAA,CAAA,EAAA,GAAA;EAgBsB,CAAA;;;;AAoBpC;AA2CA;;cAlJa,aAAA,SAAsB,YAAA;;sBAEN;;;;;;;;;;;;eAeZ;;;;;;cAWJ,YAAA,SAAqB,aAAA;;;;;;;cAWrB,cAAA,SAAuB,aAAA;;;;UAQnB,qBAAA;;;;eAIF;;;;;;;;cASF,cAAA,SAAuB,YAAA;;wBAGZ;yCAIV;;;;;;;oCAgBsB,wBAAwB;;;;;;;;cAoB/C,UAAA,SAAmB,YAAA;;;;;;;;;2BAoBL;;;;;;;;;;;iBAuBX,gBAAA"}
|
package/dist/types/errors.js
CHANGED
|
@@ -91,8 +91,9 @@ var RetryableError = class RetryableError extends RestateError {
|
|
|
91
91
|
*/
|
|
92
92
|
static from(cause, options) {
|
|
93
93
|
const error = ensureError(cause);
|
|
94
|
+
const errorCode = error instanceof RestateError ? error.code : error["errorCode"];
|
|
94
95
|
return new RetryableError(error.message, {
|
|
95
|
-
errorCode
|
|
96
|
+
errorCode,
|
|
96
97
|
cause,
|
|
97
98
|
...options
|
|
98
99
|
});
|
|
@@ -117,8 +118,9 @@ var PauseError = class PauseError extends RestateError {
|
|
|
117
118
|
*/
|
|
118
119
|
static from(cause) {
|
|
119
120
|
const error = ensureError(cause);
|
|
121
|
+
const errorCode = error instanceof RestateError ? error.code : error["errorCode"];
|
|
120
122
|
return new PauseError(error.message, {
|
|
121
|
-
errorCode
|
|
123
|
+
errorCode,
|
|
122
124
|
cause
|
|
123
125
|
});
|
|
124
126
|
}
|