@restatedev/restate-sdk-testcontainers 1.11.1 → 1.13.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/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/restate-sdk/src/common_api.d.ts +3 -1
- package/dist/restate-sdk/src/context.d.cts +16 -2
- package/dist/restate-sdk/src/context.d.cts.map +1 -1
- package/dist/restate-sdk/src/context.d.ts +16 -2
- package/dist/restate-sdk/src/context.d.ts.map +1 -1
- package/dist/restate-sdk/src/context_impl.d.ts +2 -0
- package/dist/restate-sdk/src/endpoint/endpoint.d.ts +1 -0
- package/dist/restate-sdk/src/endpoint/handlers/types.d.ts +1 -0
- package/dist/restate-sdk/src/endpoint/types.d.cts +1 -2
- package/dist/restate-sdk/src/endpoint/types.d.cts.map +1 -1
- package/dist/restate-sdk/src/endpoint/types.d.ts +1 -1
- package/dist/restate-sdk/src/endpoint.d.cts +87 -5
- package/dist/restate-sdk/src/endpoint.d.cts.map +1 -1
- package/dist/restate-sdk/src/endpoint.d.ts +87 -5
- package/dist/restate-sdk/src/endpoint.d.ts.map +1 -1
- package/dist/restate-sdk/src/hooks.d.cts +87 -0
- package/dist/restate-sdk/src/hooks.d.cts.map +1 -0
- package/dist/restate-sdk/src/hooks.d.ts +87 -0
- package/dist/restate-sdk/src/hooks.d.ts.map +1 -0
- package/dist/restate-sdk/src/index.d.cts +2 -1
- package/dist/restate-sdk/src/index.d.ts +2 -1
- package/dist/restate-sdk/src/io.d.ts +1 -0
- package/dist/restate-sdk/src/node.d.cts +2 -2
- package/dist/restate-sdk/src/node.d.ts +2 -1
- package/dist/restate-sdk/src/promises.d.ts +2 -0
- package/dist/restate-sdk/src/types/errors.d.cts +0 -4
- package/dist/restate-sdk/src/types/errors.d.cts.map +1 -1
- package/dist/restate-sdk/src/types/errors.d.ts +0 -4
- package/dist/restate-sdk/src/types/errors.d.ts.map +1 -1
- package/dist/restate-sdk/src/types/rpc.d.cts +63 -0
- package/dist/restate-sdk/src/types/rpc.d.cts.map +1 -1
- package/dist/restate-sdk/src/types/rpc.d.ts +63 -0
- package/dist/restate-sdk/src/types/rpc.d.ts.map +1 -1
- package/dist/restate_test_environment.cjs +32 -2
- package/dist/restate_test_environment.d.cts +29 -3
- package/dist/restate_test_environment.d.cts.map +1 -1
- package/dist/restate_test_environment.d.ts +29 -3
- package/dist/restate_test_environment.d.ts.map +1 -1
- package/dist/restate_test_environment.js +32 -2
- package/dist/restate_test_environment.js.map +1 -1
- package/package.json +3 -3
- package/dist/restate-sdk/src/common_api.d.cts +0 -10
package/dist/index.d.cts
CHANGED
|
@@ -3,11 +3,12 @@ import { Serde } from "./restate-sdk-core/src/serde_api.cjs";
|
|
|
3
3
|
import { Duration } from "./restate-sdk-core/src/duration.cjs";
|
|
4
4
|
import { JournalValueCodec } from "./restate-sdk-core/src/entry_codec.cjs";
|
|
5
5
|
import { RestateError, TerminalError } from "./restate-sdk/src/types/errors.cjs";
|
|
6
|
+
import { Hooks, HooksProvider, Interceptor } from "./restate-sdk/src/hooks.cjs";
|
|
6
7
|
import { ObjectOptions, RetryPolicy, ServiceOptions, WorkflowOptions } from "./restate-sdk/src/types/rpc.cjs";
|
|
7
|
-
import { Request, TypedState, UntypedState } from "./restate-sdk/src/context.cjs";
|
|
8
|
+
import { InvocationId, Request, Target, TypedState, UntypedState } from "./restate-sdk/src/context.cjs";
|
|
8
9
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./restate-sdk/src/logging/logger_transport.cjs";
|
|
9
10
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./restate-sdk/src/endpoint.cjs";
|
|
10
11
|
import { EndpointOptions } from "./restate-sdk/src/endpoint/types.cjs";
|
|
11
12
|
import "./restate-sdk/src/index.cjs";
|
|
12
|
-
import { RestateContainer, RestateTestEnvironment, StateProxy } from "./restate_test_environment.cjs";
|
|
13
|
-
export { type DefaultServiceOptions, type Duration, type EndpointOptions, type JournalValueCodec, type LogMetadata, type LogSource, type LoggerContext, type LoggerTransport, type ObjectOptions, type Request, RestateContainer, type RestateEndpoint, type RestateEndpointBase, type RestateError, type RestateLogLevel, RestateTestEnvironment, type RetryPolicy, type Serde, type ServiceDefinition, type ServiceOptions, StateProxy, type TerminalError, type TypedState, type UntypedState, type VirtualObjectDefinition, type WorkflowDefinition, type WorkflowOptions };
|
|
13
|
+
import { RestateContainer, RestateTestEnvironment, StateProxy, TestEnvironmentOptions } from "./restate_test_environment.cjs";
|
|
14
|
+
export { type DefaultServiceOptions, type Duration, type EndpointOptions, type Hooks, type HooksProvider, type Interceptor, type InvocationId, type JournalValueCodec, type LogMetadata, type LogSource, type LoggerContext, type LoggerTransport, type ObjectOptions, type Request, RestateContainer, type RestateEndpoint, type RestateEndpointBase, type RestateError, type RestateLogLevel, RestateTestEnvironment, type RetryPolicy, type Serde, type ServiceDefinition, type ServiceOptions, StateProxy, type Target, type TerminalError, type TestEnvironmentOptions, type TypedState, type UntypedState, type VirtualObjectDefinition, type WorkflowDefinition, type WorkflowOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,12 @@ import { Serde } from "./restate-sdk-core/src/serde_api.js";
|
|
|
3
3
|
import { Duration } from "./restate-sdk-core/src/duration.js";
|
|
4
4
|
import { JournalValueCodec } from "./restate-sdk-core/src/entry_codec.js";
|
|
5
5
|
import { RestateError, TerminalError } from "./restate-sdk/src/types/errors.js";
|
|
6
|
+
import { Hooks, HooksProvider, Interceptor } from "./restate-sdk/src/hooks.js";
|
|
6
7
|
import { ObjectOptions, RetryPolicy, ServiceOptions, WorkflowOptions } from "./restate-sdk/src/types/rpc.js";
|
|
7
|
-
import { Request, TypedState, UntypedState } from "./restate-sdk/src/context.js";
|
|
8
|
+
import { InvocationId, Request, Target, TypedState, UntypedState } from "./restate-sdk/src/context.js";
|
|
8
9
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./restate-sdk/src/logging/logger_transport.js";
|
|
9
10
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./restate-sdk/src/endpoint.js";
|
|
10
11
|
import { EndpointOptions } from "./restate-sdk/src/endpoint/types.js";
|
|
11
12
|
import "./restate-sdk/src/index.js";
|
|
12
|
-
import { RestateContainer, RestateTestEnvironment, StateProxy } from "./restate_test_environment.js";
|
|
13
|
-
export { type DefaultServiceOptions, type Duration, type EndpointOptions, type JournalValueCodec, type LogMetadata, type LogSource, type LoggerContext, type LoggerTransport, type ObjectOptions, type Request, RestateContainer, type RestateEndpoint, type RestateEndpointBase, type RestateError, type RestateLogLevel, RestateTestEnvironment, type RetryPolicy, type Serde, type ServiceDefinition, type ServiceOptions, StateProxy, type TerminalError, type TypedState, type UntypedState, type VirtualObjectDefinition, type WorkflowDefinition, type WorkflowOptions };
|
|
13
|
+
import { RestateContainer, RestateTestEnvironment, StateProxy, TestEnvironmentOptions } from "./restate_test_environment.js";
|
|
14
|
+
export { type DefaultServiceOptions, type Duration, type EndpointOptions, type Hooks, type HooksProvider, type Interceptor, type InvocationId, type JournalValueCodec, type LogMetadata, type LogSource, type LoggerContext, type LoggerTransport, type ObjectOptions, type Request, RestateContainer, type RestateEndpoint, type RestateEndpointBase, type RestateError, type RestateLogLevel, RestateTestEnvironment, type RetryPolicy, type Serde, type ServiceDefinition, type ServiceOptions, StateProxy, type Target, type TerminalError, type TestEnvironmentOptions, type TypedState, type UntypedState, type VirtualObjectDefinition, type WorkflowDefinition, type WorkflowOptions };
|
|
@@ -3,8 +3,10 @@ import { Serde } from "../../restate-sdk-core/src/serde_api.js";
|
|
|
3
3
|
import { Duration } from "../../restate-sdk-core/src/duration.js";
|
|
4
4
|
import { JournalValueCodec } from "../../restate-sdk-core/src/entry_codec.js";
|
|
5
5
|
import { RestateError, TerminalError } from "./types/errors.js";
|
|
6
|
+
import { Hooks, HooksProvider, Interceptor } from "./hooks.js";
|
|
6
7
|
import { ObjectOptions, RetryPolicy, ServiceOptions, WorkflowOptions } from "./types/rpc.js";
|
|
7
|
-
import { Request, TypedState, UntypedState } from "./context.js";
|
|
8
|
+
import { InvocationId, Request, Target, TypedState, UntypedState } from "./context.js";
|
|
8
9
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.js";
|
|
9
10
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.js";
|
|
11
|
+
import "./promises.js";
|
|
10
12
|
import { EndpointOptions } from "./endpoint/types.js";
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
//#region ../restate-sdk/src/context.d.ts
|
|
2
2
|
|
|
3
|
+
interface Target {
|
|
4
|
+
service: string;
|
|
5
|
+
handler: string;
|
|
6
|
+
key?: string;
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
3
9
|
/**
|
|
4
10
|
* Represents the original request as sent to this handler.
|
|
5
11
|
*
|
|
@@ -7,11 +13,12 @@
|
|
|
7
13
|
* request body.
|
|
8
14
|
*/
|
|
9
15
|
interface Request {
|
|
16
|
+
readonly target: Target;
|
|
10
17
|
/**
|
|
11
18
|
* The unique id that identifies the current function invocation. This id is guaranteed to be
|
|
12
19
|
* unique across invocations, but constant across reties and suspensions.
|
|
13
20
|
*/
|
|
14
|
-
readonly id:
|
|
21
|
+
readonly id: InvocationId;
|
|
15
22
|
/**
|
|
16
23
|
* Request headers - the following headers capture the original invocation headers, as provided to
|
|
17
24
|
* the ingress.
|
|
@@ -48,6 +55,13 @@ type TypedState = Record<string, any>;
|
|
|
48
55
|
type UntypedState = {
|
|
49
56
|
_: never;
|
|
50
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Represents an invocation id.
|
|
60
|
+
* @see {@link InvocationIdParser}
|
|
61
|
+
*/
|
|
62
|
+
type InvocationId = string & {
|
|
63
|
+
__brand: "InvocationId";
|
|
64
|
+
};
|
|
51
65
|
//#endregion
|
|
52
|
-
export { Request, TypedState, UntypedState };
|
|
66
|
+
export { InvocationId, Request, Target, TypedState, UntypedState };
|
|
53
67
|
//# sourceMappingURL=context.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../../../../restate-sdk/src/context.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.cts","names":[],"sources":["../../../../restate-sdk/src/context.ts"],"sourcesContent":[],"mappings":";;AAgDmB,UAdF,MAAA,CAcE;EAMJ,OAAA,EAAA,MAAA;EAMK,OAAA,EAAA,MAAA;EAOO,GAAA,CAAA,EAAA,MAAA;EAKV,QAAA,EAAA,EAAA,MAAA;;;AAsBjB;AACA;AA6lBA;;;UA7oBiB,OAAA;mBACE;;;;;eAMJ;;;;;oBAMK;;;;;;2BAOO;;;;iBAKV;;;;;;;;;;;;;;;;mCAkBkB;;KAIvB,UAAA,GAAa;KACb,YAAA;;;;;;;KA6lBA,YAAA"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
//#region ../restate-sdk/src/context.d.ts
|
|
2
2
|
|
|
3
|
+
interface Target {
|
|
4
|
+
service: string;
|
|
5
|
+
handler: string;
|
|
6
|
+
key?: string;
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
3
9
|
/**
|
|
4
10
|
* Represents the original request as sent to this handler.
|
|
5
11
|
*
|
|
@@ -7,11 +13,12 @@
|
|
|
7
13
|
* request body.
|
|
8
14
|
*/
|
|
9
15
|
interface Request {
|
|
16
|
+
readonly target: Target;
|
|
10
17
|
/**
|
|
11
18
|
* The unique id that identifies the current function invocation. This id is guaranteed to be
|
|
12
19
|
* unique across invocations, but constant across reties and suspensions.
|
|
13
20
|
*/
|
|
14
|
-
readonly id:
|
|
21
|
+
readonly id: InvocationId;
|
|
15
22
|
/**
|
|
16
23
|
* Request headers - the following headers capture the original invocation headers, as provided to
|
|
17
24
|
* the ingress.
|
|
@@ -48,6 +55,13 @@ type TypedState = Record<string, any>;
|
|
|
48
55
|
type UntypedState = {
|
|
49
56
|
_: never;
|
|
50
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Represents an invocation id.
|
|
60
|
+
* @see {@link InvocationIdParser}
|
|
61
|
+
*/
|
|
62
|
+
type InvocationId = string & {
|
|
63
|
+
__brand: "InvocationId";
|
|
64
|
+
};
|
|
51
65
|
//#endregion
|
|
52
|
-
export { Request, TypedState, UntypedState };
|
|
66
|
+
export { InvocationId, Request, Target, TypedState, UntypedState };
|
|
53
67
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../../restate-sdk/src/context.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../../restate-sdk/src/context.ts"],"sourcesContent":[],"mappings":";;AAgDmB,UAdF,MAAA,CAcE;EAMJ,OAAA,EAAA,MAAA;EAMK,OAAA,EAAA,MAAA;EAOO,GAAA,CAAA,EAAA,MAAA;EAKV,QAAA,EAAA,EAAA,MAAA;;;AAsBjB;AACA;AA6lBA;;;UA7oBiB,OAAA;mBACE;;;;;eAMJ;;;;;oBAMK;;;;;;2BAOO;;;;iBAKV;;;;;;;;;;;;;;;;mCAkBkB;;KAIvB,UAAA,GAAa;KACb,YAAA;;;;;;;KA6lBA,YAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../endpoint.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../endpoint.js";
|
|
@@ -2,11 +2,10 @@ import { ServiceDefinition, VirtualObjectDefinition, WorkflowDefinition } from "
|
|
|
2
2
|
import { JournalValueCodec } from "../../../restate-sdk-core/src/entry_codec.cjs";
|
|
3
3
|
import { LoggerTransport } from "../logging/logger_transport.cjs";
|
|
4
4
|
import { DefaultServiceOptions } from "../endpoint.cjs";
|
|
5
|
-
import "../common_api.cjs";
|
|
6
5
|
|
|
7
6
|
//#region ../restate-sdk/src/endpoint/types.d.ts
|
|
8
7
|
/**
|
|
9
|
-
* Options for creating an endpoint handler
|
|
8
|
+
* Options for creating an endpoint handler.
|
|
10
9
|
*/
|
|
11
10
|
interface EndpointOptions {
|
|
12
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../../../restate-sdk/src/endpoint/types.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../../../restate-sdk/src/endpoint/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;UAYiB,eAAA;;AAAjB;;EAMM,QAAA,EAFM,KAEN,CADA,iBACA,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,uBAAA,CAAA,MAAA,EAAA,OAAA,CAAA,GACA,kBADA,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;EACA;;;;;;;;;;;;;;;0BAiBoB;;;;;;;;;;;;;;;;;;;;;WAqBf;;;;;;;oCAQyB,QAAQ"}
|
|
@@ -2,7 +2,8 @@ import { ServiceDefinition, VirtualObjectDefinition, WorkflowDefinition } from "
|
|
|
2
2
|
import { JournalValueCodec } from "../../restate-sdk-core/src/entry_codec.cjs";
|
|
3
3
|
import { ObjectOptions, ServiceOptions, WorkflowOptions } from "./types/rpc.cjs";
|
|
4
4
|
import { LoggerTransport } from "./logging/logger_transport.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
|
+
import { Http2ServerRequest, Http2ServerResponse } from "node:http2";
|
|
6
7
|
|
|
7
8
|
//#region ../restate-sdk/src/endpoint.d.ts
|
|
8
9
|
type DefaultServiceOptions = ServiceOptions & ObjectOptions & WorkflowOptions;
|
|
@@ -64,12 +65,15 @@ interface RestateEndpointBase<E> {
|
|
|
64
65
|
/**
|
|
65
66
|
* RestateEndpoint encapsulates all the Restate services served by this endpoint.
|
|
66
67
|
*
|
|
67
|
-
* A RestateEndpoint can
|
|
68
|
+
* A RestateEndpoint can be served as:
|
|
69
|
+
* - An HTTP/2 server using {@link RestateEndpoint.listen}, {@link RestateEndpoint.http2Handler}
|
|
70
|
+
* - An HTTP/1.1 server using {@link RestateEndpoint.http1Handler}
|
|
71
|
+
* - A combined HTTP/1.1 + HTTP/2 server using {@link RestateEndpoint.handler}
|
|
68
72
|
*
|
|
69
73
|
* For Lambda, check {@link LambdaEndpoint}
|
|
70
74
|
*
|
|
71
75
|
* @example
|
|
72
|
-
* A typical endpoint served as HTTP server
|
|
76
|
+
* A typical endpoint served as HTTP/2 server:
|
|
73
77
|
* ```
|
|
74
78
|
* import * as restate from "@restatedev/restate-sdk";
|
|
75
79
|
*
|
|
@@ -78,6 +82,28 @@ interface RestateEndpointBase<E> {
|
|
|
78
82
|
* .bind(myService)
|
|
79
83
|
* .listen(8000);
|
|
80
84
|
* ```
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* Using the HTTP/1.1 handler with your own server:
|
|
88
|
+
* ```
|
|
89
|
+
* import * as http from "node:http";
|
|
90
|
+
* import * as restate from "@restatedev/restate-sdk";
|
|
91
|
+
*
|
|
92
|
+
* const endpoint = restate.endpoint().bind(myService);
|
|
93
|
+
* const server = http.createServer(endpoint.http1Handler());
|
|
94
|
+
* server.listen(8000);
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* Using the combined handler with an HTTP/2 server that also accepts HTTP/1.1:
|
|
99
|
+
* ```
|
|
100
|
+
* import * as http2 from "node:http2";
|
|
101
|
+
* import * as restate from "@restatedev/restate-sdk";
|
|
102
|
+
*
|
|
103
|
+
* const endpoint = restate.endpoint().bind(myService);
|
|
104
|
+
* const server = http2.createSecureServer({ key, cert, allowHTTP1: true }, endpoint.handler());
|
|
105
|
+
* server.listen(8000);
|
|
106
|
+
* ```
|
|
81
107
|
*/
|
|
82
108
|
interface RestateEndpoint extends RestateEndpointBase<RestateEndpoint> {
|
|
83
109
|
/**
|
|
@@ -104,9 +130,65 @@ interface RestateEndpoint extends RestateEndpointBase<RestateEndpoint> {
|
|
|
104
130
|
*/
|
|
105
131
|
listen(port?: number): Promise<number>;
|
|
106
132
|
/**
|
|
107
|
-
* Returns an http2 server handler.
|
|
133
|
+
* Returns an http2 server handler.
|
|
134
|
+
*
|
|
135
|
+
* By default, this handler uses bidirectional streaming (`BIDI_STREAM`).
|
|
136
|
+
* Set `bidirectional: false` to use request-response mode (`REQUEST_RESPONSE`).
|
|
137
|
+
*
|
|
138
|
+
* See {@link RestateEndpoint.listen} for more details.
|
|
139
|
+
*/
|
|
140
|
+
http2Handler(options?: {
|
|
141
|
+
bidirectional?: boolean;
|
|
142
|
+
}): (request: Http2ServerRequest, response: Http2ServerResponse) => void;
|
|
143
|
+
/**
|
|
144
|
+
* Returns an http1 server handler.
|
|
145
|
+
*
|
|
146
|
+
* By default, this handler operates in request-response protocol mode (`REQUEST_RESPONSE`),
|
|
147
|
+
* which buffers the full request before sending the response. This is the safest mode
|
|
148
|
+
* for HTTP/1.1 and works across all environments and proxies.
|
|
149
|
+
*
|
|
150
|
+
* Set `bidirectional: true` to enable bidirectional streaming (`BIDI_STREAM`) for
|
|
151
|
+
* HTTP/1.1 servers that support it. Note that some proxies and clients may not
|
|
152
|
+
* handle HTTP/1.1 bidirectional streaming correctly.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```
|
|
156
|
+
* const httpServer = http.createServer(endpoint.http1Handler());
|
|
157
|
+
* httpServer.listen(port);
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
http1Handler(options?: {
|
|
161
|
+
bidirectional?: boolean;
|
|
162
|
+
}): (request: IncomingMessage, response: ServerResponse) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Returns a combined request handler that auto-detects HTTP/1 vs HTTP/2
|
|
165
|
+
* requests and dispatches to the appropriate internal handler.
|
|
166
|
+
*
|
|
167
|
+
* By default (when `bidirectional` is omitted), HTTP/2+ requests use
|
|
168
|
+
* bidirectional streaming (`BIDI_STREAM`) and HTTP/1 requests use
|
|
169
|
+
* request-response mode (`REQUEST_RESPONSE`).
|
|
170
|
+
*
|
|
171
|
+
* Set `bidirectional: true` to force `BIDI_STREAM` for all requests,
|
|
172
|
+
* or `bidirectional: false` to force `REQUEST_RESPONSE` for all requests.
|
|
173
|
+
*
|
|
174
|
+
* This is useful with `http2.createSecureServer({ allowHTTP1: true })`, where
|
|
175
|
+
* the same server handles both HTTP/1.1 and HTTP/2 connections.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```
|
|
179
|
+
* const server = http2.createSecureServer(
|
|
180
|
+
* { key, cert, allowHTTP1: true },
|
|
181
|
+
* endpoint.handler()
|
|
182
|
+
* );
|
|
183
|
+
* server.listen(port);
|
|
184
|
+
* ```
|
|
108
185
|
*/
|
|
109
|
-
|
|
186
|
+
handler(options?: {
|
|
187
|
+
bidirectional?: boolean;
|
|
188
|
+
}): {
|
|
189
|
+
(request: IncomingMessage, response: ServerResponse): void;
|
|
190
|
+
(request: Http2ServerRequest, response: Http2ServerResponse): void;
|
|
191
|
+
};
|
|
110
192
|
}
|
|
111
193
|
//#endregion
|
|
112
194
|
export { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.cts","names":[],"sources":["../../../../restate-sdk/src/endpoint.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint.d.cts","names":[],"sources":["../../../../restate-sdk/src/endpoint.ts"],"sourcesContent":[],"mappings":";;;;;;;;KA0BY,qBAAA,GAAwB,iBAClC,gBACA;UAEe;;AAJjB;;;;EAEiB,IAAA,CAAA,UAAA,MAAA,EAAA,CAAA,CAAA,CAAA,OAAA,EAUT,iBAVS,CAUS,CAVT,EAUY,CAVZ,CAAA,GAWT,uBAXS,CAWe,CAXf,EAWkB,CAXlB,CAAA,GAYT,kBAZS,CAYU,CAZV,EAYa,CAZb,CAAA,CAAA,EAaZ,CAbY;EAEA;;;;;;;;;EAUT,cAAA,CAAA,GAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAY6B,CAZ7B;EACH;;;;;;;EAmD4C,qBAAA,CAAA,OAAA,EA/BhB,qBA+BgB,CAAA,EA/BQ,CA+BR;EAA6B;;AA8C9E;;;;;;;;;;;;;;;;;;;oBAtDoB,kBAAkB;;;;;;;iDAQW,QAAQ,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8C7D,eAAA,SAAwB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;yBAuBpC;;;;;;;;;;;gBAYT,8BAA8B;;;;;;;;;;;;;;;;;;;;gBAqB9B,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0B7B,2BAA2B;cAC3B,8BAA8B"}
|
|
@@ -2,7 +2,8 @@ import { ServiceDefinition, VirtualObjectDefinition, WorkflowDefinition } from "
|
|
|
2
2
|
import { JournalValueCodec } from "../../restate-sdk-core/src/entry_codec.js";
|
|
3
3
|
import { ObjectOptions, ServiceOptions, WorkflowOptions } from "./types/rpc.js";
|
|
4
4
|
import { LoggerTransport } from "./logging/logger_transport.js";
|
|
5
|
-
import {
|
|
5
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
|
+
import { Http2ServerRequest, Http2ServerResponse } from "node:http2";
|
|
6
7
|
|
|
7
8
|
//#region ../restate-sdk/src/endpoint.d.ts
|
|
8
9
|
type DefaultServiceOptions = ServiceOptions & ObjectOptions & WorkflowOptions;
|
|
@@ -64,12 +65,15 @@ interface RestateEndpointBase<E> {
|
|
|
64
65
|
/**
|
|
65
66
|
* RestateEndpoint encapsulates all the Restate services served by this endpoint.
|
|
66
67
|
*
|
|
67
|
-
* A RestateEndpoint can
|
|
68
|
+
* A RestateEndpoint can be served as:
|
|
69
|
+
* - An HTTP/2 server using {@link RestateEndpoint.listen}, {@link RestateEndpoint.http2Handler}
|
|
70
|
+
* - An HTTP/1.1 server using {@link RestateEndpoint.http1Handler}
|
|
71
|
+
* - A combined HTTP/1.1 + HTTP/2 server using {@link RestateEndpoint.handler}
|
|
68
72
|
*
|
|
69
73
|
* For Lambda, check {@link LambdaEndpoint}
|
|
70
74
|
*
|
|
71
75
|
* @example
|
|
72
|
-
* A typical endpoint served as HTTP server
|
|
76
|
+
* A typical endpoint served as HTTP/2 server:
|
|
73
77
|
* ```
|
|
74
78
|
* import * as restate from "@restatedev/restate-sdk";
|
|
75
79
|
*
|
|
@@ -78,6 +82,28 @@ interface RestateEndpointBase<E> {
|
|
|
78
82
|
* .bind(myService)
|
|
79
83
|
* .listen(8000);
|
|
80
84
|
* ```
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* Using the HTTP/1.1 handler with your own server:
|
|
88
|
+
* ```
|
|
89
|
+
* import * as http from "node:http";
|
|
90
|
+
* import * as restate from "@restatedev/restate-sdk";
|
|
91
|
+
*
|
|
92
|
+
* const endpoint = restate.endpoint().bind(myService);
|
|
93
|
+
* const server = http.createServer(endpoint.http1Handler());
|
|
94
|
+
* server.listen(8000);
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* Using the combined handler with an HTTP/2 server that also accepts HTTP/1.1:
|
|
99
|
+
* ```
|
|
100
|
+
* import * as http2 from "node:http2";
|
|
101
|
+
* import * as restate from "@restatedev/restate-sdk";
|
|
102
|
+
*
|
|
103
|
+
* const endpoint = restate.endpoint().bind(myService);
|
|
104
|
+
* const server = http2.createSecureServer({ key, cert, allowHTTP1: true }, endpoint.handler());
|
|
105
|
+
* server.listen(8000);
|
|
106
|
+
* ```
|
|
81
107
|
*/
|
|
82
108
|
interface RestateEndpoint extends RestateEndpointBase<RestateEndpoint> {
|
|
83
109
|
/**
|
|
@@ -104,9 +130,65 @@ interface RestateEndpoint extends RestateEndpointBase<RestateEndpoint> {
|
|
|
104
130
|
*/
|
|
105
131
|
listen(port?: number): Promise<number>;
|
|
106
132
|
/**
|
|
107
|
-
* Returns an http2 server handler.
|
|
133
|
+
* Returns an http2 server handler.
|
|
134
|
+
*
|
|
135
|
+
* By default, this handler uses bidirectional streaming (`BIDI_STREAM`).
|
|
136
|
+
* Set `bidirectional: false` to use request-response mode (`REQUEST_RESPONSE`).
|
|
137
|
+
*
|
|
138
|
+
* See {@link RestateEndpoint.listen} for more details.
|
|
139
|
+
*/
|
|
140
|
+
http2Handler(options?: {
|
|
141
|
+
bidirectional?: boolean;
|
|
142
|
+
}): (request: Http2ServerRequest, response: Http2ServerResponse) => void;
|
|
143
|
+
/**
|
|
144
|
+
* Returns an http1 server handler.
|
|
145
|
+
*
|
|
146
|
+
* By default, this handler operates in request-response protocol mode (`REQUEST_RESPONSE`),
|
|
147
|
+
* which buffers the full request before sending the response. This is the safest mode
|
|
148
|
+
* for HTTP/1.1 and works across all environments and proxies.
|
|
149
|
+
*
|
|
150
|
+
* Set `bidirectional: true` to enable bidirectional streaming (`BIDI_STREAM`) for
|
|
151
|
+
* HTTP/1.1 servers that support it. Note that some proxies and clients may not
|
|
152
|
+
* handle HTTP/1.1 bidirectional streaming correctly.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```
|
|
156
|
+
* const httpServer = http.createServer(endpoint.http1Handler());
|
|
157
|
+
* httpServer.listen(port);
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
http1Handler(options?: {
|
|
161
|
+
bidirectional?: boolean;
|
|
162
|
+
}): (request: IncomingMessage, response: ServerResponse) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Returns a combined request handler that auto-detects HTTP/1 vs HTTP/2
|
|
165
|
+
* requests and dispatches to the appropriate internal handler.
|
|
166
|
+
*
|
|
167
|
+
* By default (when `bidirectional` is omitted), HTTP/2+ requests use
|
|
168
|
+
* bidirectional streaming (`BIDI_STREAM`) and HTTP/1 requests use
|
|
169
|
+
* request-response mode (`REQUEST_RESPONSE`).
|
|
170
|
+
*
|
|
171
|
+
* Set `bidirectional: true` to force `BIDI_STREAM` for all requests,
|
|
172
|
+
* or `bidirectional: false` to force `REQUEST_RESPONSE` for all requests.
|
|
173
|
+
*
|
|
174
|
+
* This is useful with `http2.createSecureServer({ allowHTTP1: true })`, where
|
|
175
|
+
* the same server handles both HTTP/1.1 and HTTP/2 connections.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```
|
|
179
|
+
* const server = http2.createSecureServer(
|
|
180
|
+
* { key, cert, allowHTTP1: true },
|
|
181
|
+
* endpoint.handler()
|
|
182
|
+
* );
|
|
183
|
+
* server.listen(port);
|
|
184
|
+
* ```
|
|
108
185
|
*/
|
|
109
|
-
|
|
186
|
+
handler(options?: {
|
|
187
|
+
bidirectional?: boolean;
|
|
188
|
+
}): {
|
|
189
|
+
(request: IncomingMessage, response: ServerResponse): void;
|
|
190
|
+
(request: Http2ServerRequest, response: Http2ServerResponse): void;
|
|
191
|
+
};
|
|
110
192
|
}
|
|
111
193
|
//#endregion
|
|
112
194
|
export { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","names":[],"sources":["../../../../restate-sdk/src/endpoint.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","names":[],"sources":["../../../../restate-sdk/src/endpoint.ts"],"sourcesContent":[],"mappings":";;;;;;;;KA0BY,qBAAA,GAAwB,iBAClC,gBACA;UAEe;;AAJjB;;;;EAEiB,IAAA,CAAA,UAAA,MAAA,EAAA,CAAA,CAAA,CAAA,OAAA,EAUT,iBAVS,CAUS,CAVT,EAUY,CAVZ,CAAA,GAWT,uBAXS,CAWe,CAXf,EAWkB,CAXlB,CAAA,GAYT,kBAZS,CAYU,CAZV,EAYa,CAZb,CAAA,CAAA,EAaZ,CAbY;EAEA;;;;;;;;;EAUT,cAAA,CAAA,GAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAY6B,CAZ7B;EACH;;;;;;;EAmD4C,qBAAA,CAAA,OAAA,EA/BhB,qBA+BgB,CAAA,EA/BQ,CA+BR;EAA6B;;AA8C9E;;;;;;;;;;;;;;;;;;;oBAtDoB,kBAAkB;;;;;;;iDAQW,QAAQ,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8C7D,eAAA,SAAwB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;yBAuBpC;;;;;;;;;;;gBAYT,8BAA8B;;;;;;;;;;;;;;;;;;;;gBAqB9B,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0B7B,2BAA2B;cAC3B,8BAA8B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Request } from "./context.cjs";
|
|
2
|
+
|
|
3
|
+
//#region ../restate-sdk/src/hooks.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Interceptors wrap handler and ctx.run() execution. They are part of the
|
|
7
|
+
* invocation — anything that happens inside them (including after `next()`)
|
|
8
|
+
* affects the invocation outcome.
|
|
9
|
+
*
|
|
10
|
+
* ## Error behavior
|
|
11
|
+
*
|
|
12
|
+
* Errors thrown at any point (before or after `next()`) affect the invocation:
|
|
13
|
+
*
|
|
14
|
+
* - **{@link TerminalError}** — the invocation **fails immediately**, no retry.
|
|
15
|
+
* - **Any other error** — Restate **retries** the invocation.
|
|
16
|
+
* - On suspension or pause, `next()` also rejects with an error. This does not
|
|
17
|
+
* mean the invocation failed — the attempt is simply ending. Do any cleanup
|
|
18
|
+
* you need and rethrow.
|
|
19
|
+
*
|
|
20
|
+
* ## Output
|
|
21
|
+
*
|
|
22
|
+
* Interceptors **cannot alter the handler's success return value** (the `void`
|
|
23
|
+
* signature means there is no way to replace it), but they **can transform
|
|
24
|
+
* errors** by catching and rethrowing a different error.
|
|
25
|
+
*
|
|
26
|
+
* ## Rules
|
|
27
|
+
*
|
|
28
|
+
* - `next()` must be called exactly once.
|
|
29
|
+
*
|
|
30
|
+
* ## When interceptors fire
|
|
31
|
+
*
|
|
32
|
+
* - `handler` fires on every attempt.
|
|
33
|
+
* - `run` fires when the `ctx.run()` closure executes. If the result is
|
|
34
|
+
* already in the journal, the closure is skipped and so is the interceptor.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* interceptor: {
|
|
39
|
+
* handler: async (next) => {
|
|
40
|
+
* console.log(`before ${ctx.request.target}`);
|
|
41
|
+
* try {
|
|
42
|
+
* await next();
|
|
43
|
+
* console.log(`after ${ctx.request.target}`);
|
|
44
|
+
* } catch (e) {
|
|
45
|
+
* console.log(`error ${ctx.request.target}: ${e}`);
|
|
46
|
+
* // Always rethrow — swallowing the error changes the
|
|
47
|
+
* // invocation outcome. You can also throw a different
|
|
48
|
+
* // error (e.g. TerminalError to fail immediately).
|
|
49
|
+
* throw e;
|
|
50
|
+
* }
|
|
51
|
+
* },
|
|
52
|
+
* run: async (name, next) => {
|
|
53
|
+
* console.log(` before run "${name}"`);
|
|
54
|
+
* try {
|
|
55
|
+
* await next();
|
|
56
|
+
* console.log(` after run "${name}"`);
|
|
57
|
+
* } catch (e) {
|
|
58
|
+
* console.log(` error run "${name}": ${e}`);
|
|
59
|
+
* throw e;
|
|
60
|
+
* }
|
|
61
|
+
* },
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
interface Interceptor {
|
|
66
|
+
/** Wraps the entire handler invocation. Fires on every attempt. */
|
|
67
|
+
handler?: (next: () => Promise<void>) => Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Wraps each `ctx.run()` call. Only fires for runs that actually execute —
|
|
70
|
+
* replayed runs (already in the journal) are skipped.
|
|
71
|
+
* `name` is the run's label.
|
|
72
|
+
*/
|
|
73
|
+
run?: (name: string, next: () => Promise<void>) => Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
interface Hooks {
|
|
76
|
+
interceptor?: Interceptor;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Factory called on every attempt. Receives the invocation request,
|
|
80
|
+
* returns hooks for that attempt's lifetime. Each attempt gets a fresh call.
|
|
81
|
+
*/
|
|
82
|
+
type HooksProvider = (ctx: {
|
|
83
|
+
request: Request;
|
|
84
|
+
}) => Hooks;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Hooks, HooksProvider, Interceptor };
|
|
87
|
+
//# sourceMappingURL=hooks.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.cts","names":[],"sources":["../../../../restate-sdk/src/hooks.ts"],"sourcesContent":[],"mappings":";;;;;;AAgEA;;;;;;AAaA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAvBiB,WAAA;;yBAEQ,kBAAkB;;;;;;mCAMR,kBAAkB;;UAKpC,KAAA;gBACD;;;;;;KASJ,aAAA;WAAiC;MAAc"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Request } from "./context.js";
|
|
2
|
+
|
|
3
|
+
//#region ../restate-sdk/src/hooks.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Interceptors wrap handler and ctx.run() execution. They are part of the
|
|
7
|
+
* invocation — anything that happens inside them (including after `next()`)
|
|
8
|
+
* affects the invocation outcome.
|
|
9
|
+
*
|
|
10
|
+
* ## Error behavior
|
|
11
|
+
*
|
|
12
|
+
* Errors thrown at any point (before or after `next()`) affect the invocation:
|
|
13
|
+
*
|
|
14
|
+
* - **{@link TerminalError}** — the invocation **fails immediately**, no retry.
|
|
15
|
+
* - **Any other error** — Restate **retries** the invocation.
|
|
16
|
+
* - On suspension or pause, `next()` also rejects with an error. This does not
|
|
17
|
+
* mean the invocation failed — the attempt is simply ending. Do any cleanup
|
|
18
|
+
* you need and rethrow.
|
|
19
|
+
*
|
|
20
|
+
* ## Output
|
|
21
|
+
*
|
|
22
|
+
* Interceptors **cannot alter the handler's success return value** (the `void`
|
|
23
|
+
* signature means there is no way to replace it), but they **can transform
|
|
24
|
+
* errors** by catching and rethrowing a different error.
|
|
25
|
+
*
|
|
26
|
+
* ## Rules
|
|
27
|
+
*
|
|
28
|
+
* - `next()` must be called exactly once.
|
|
29
|
+
*
|
|
30
|
+
* ## When interceptors fire
|
|
31
|
+
*
|
|
32
|
+
* - `handler` fires on every attempt.
|
|
33
|
+
* - `run` fires when the `ctx.run()` closure executes. If the result is
|
|
34
|
+
* already in the journal, the closure is skipped and so is the interceptor.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* interceptor: {
|
|
39
|
+
* handler: async (next) => {
|
|
40
|
+
* console.log(`before ${ctx.request.target}`);
|
|
41
|
+
* try {
|
|
42
|
+
* await next();
|
|
43
|
+
* console.log(`after ${ctx.request.target}`);
|
|
44
|
+
* } catch (e) {
|
|
45
|
+
* console.log(`error ${ctx.request.target}: ${e}`);
|
|
46
|
+
* // Always rethrow — swallowing the error changes the
|
|
47
|
+
* // invocation outcome. You can also throw a different
|
|
48
|
+
* // error (e.g. TerminalError to fail immediately).
|
|
49
|
+
* throw e;
|
|
50
|
+
* }
|
|
51
|
+
* },
|
|
52
|
+
* run: async (name, next) => {
|
|
53
|
+
* console.log(` before run "${name}"`);
|
|
54
|
+
* try {
|
|
55
|
+
* await next();
|
|
56
|
+
* console.log(` after run "${name}"`);
|
|
57
|
+
* } catch (e) {
|
|
58
|
+
* console.log(` error run "${name}": ${e}`);
|
|
59
|
+
* throw e;
|
|
60
|
+
* }
|
|
61
|
+
* },
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
interface Interceptor {
|
|
66
|
+
/** Wraps the entire handler invocation. Fires on every attempt. */
|
|
67
|
+
handler?: (next: () => Promise<void>) => Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Wraps each `ctx.run()` call. Only fires for runs that actually execute —
|
|
70
|
+
* replayed runs (already in the journal) are skipped.
|
|
71
|
+
* `name` is the run's label.
|
|
72
|
+
*/
|
|
73
|
+
run?: (name: string, next: () => Promise<void>) => Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
interface Hooks {
|
|
76
|
+
interceptor?: Interceptor;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Factory called on every attempt. Receives the invocation request,
|
|
80
|
+
* returns hooks for that attempt's lifetime. Each attempt gets a fresh call.
|
|
81
|
+
*/
|
|
82
|
+
type HooksProvider = (ctx: {
|
|
83
|
+
request: Request;
|
|
84
|
+
}) => Hooks;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Hooks, HooksProvider, Interceptor };
|
|
87
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","names":[],"sources":["../../../../restate-sdk/src/hooks.ts"],"sourcesContent":[],"mappings":";;;;;;AAgEA;;;;;;AAaA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAvBiB,WAAA;;yBAEQ,kBAAkB;;;;;;mCAMR,kBAAkB;;UAKpC,KAAA;gBACD;;;;;;KASJ,aAAA;WAAiC;MAAc"}
|
|
@@ -3,8 +3,9 @@ import { Serde } from "../../restate-sdk-core/src/serde_api.cjs";
|
|
|
3
3
|
import { Duration } from "../../restate-sdk-core/src/duration.cjs";
|
|
4
4
|
import { JournalValueCodec } from "../../restate-sdk-core/src/entry_codec.cjs";
|
|
5
5
|
import { RestateError, TerminalError } from "./types/errors.cjs";
|
|
6
|
+
import { Hooks, HooksProvider, Interceptor } from "./hooks.cjs";
|
|
6
7
|
import { ObjectOptions, RetryPolicy, ServiceOptions, WorkflowOptions } from "./types/rpc.cjs";
|
|
7
|
-
import { Request, TypedState, UntypedState } from "./context.cjs";
|
|
8
|
+
import { InvocationId, Request, Target, TypedState, UntypedState } from "./context.cjs";
|
|
8
9
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.cjs";
|
|
9
10
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.cjs";
|
|
10
11
|
import { EndpointOptions } from "./endpoint/types.cjs";
|
|
@@ -3,8 +3,9 @@ import { Serde } from "../../restate-sdk-core/src/serde_api.js";
|
|
|
3
3
|
import { Duration } from "../../restate-sdk-core/src/duration.js";
|
|
4
4
|
import { JournalValueCodec } from "../../restate-sdk-core/src/entry_codec.js";
|
|
5
5
|
import { RestateError, TerminalError } from "./types/errors.js";
|
|
6
|
+
import { Hooks, HooksProvider, Interceptor } from "./hooks.js";
|
|
6
7
|
import { ObjectOptions, RetryPolicy, ServiceOptions, WorkflowOptions } from "./types/rpc.js";
|
|
7
|
-
import { Request, TypedState, UntypedState } from "./context.js";
|
|
8
|
+
import { InvocationId, Request, Target, TypedState, UntypedState } from "./context.js";
|
|
8
9
|
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.js";
|
|
9
10
|
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.js";
|
|
10
11
|
import { EndpointOptions } from "./endpoint/types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./endpoint/handlers/types.js";
|