@aws-sdk/types 3.22.0 → 3.34.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.
@@ -0,0 +1,346 @@
1
+ import { Logger } from "./logger";
2
+ import { UserAgent } from "./util";
3
+ export interface InitializeHandlerArguments<Input extends object> {
4
+ /**
5
+ * User input to a command. Reflects the userland representation of the
6
+ * union of data types the command can effectively handle.
7
+ */
8
+ input: Input;
9
+ }
10
+ export interface InitializeHandlerOutput<Output extends object> extends DeserializeHandlerOutput<Output> {
11
+ output: Output;
12
+ }
13
+ export interface SerializeHandlerArguments<Input extends object> extends InitializeHandlerArguments<Input> {
14
+ /**
15
+ * The user input serialized as a request object. The request object is unknown,
16
+ * so you cannot modify it directly. When work with request, you need to guard its
17
+ * type to e.g. HttpRequest with 'instanceof' operand
18
+ *
19
+ * During the build phase of the execution of a middleware stack, a built
20
+ * request may or may not be available.
21
+ */
22
+ request?: unknown;
23
+ }
24
+ export interface SerializeHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}
25
+ export interface BuildHandlerArguments<Input extends object> extends FinalizeHandlerArguments<Input> {}
26
+ export interface BuildHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}
27
+ export interface FinalizeHandlerArguments<Input extends object> extends SerializeHandlerArguments<Input> {
28
+ /**
29
+ * The user input serialized as a request.
30
+ */
31
+ request: unknown;
32
+ }
33
+ export interface FinalizeHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}
34
+ export interface DeserializeHandlerArguments<Input extends object> extends FinalizeHandlerArguments<Input> {}
35
+ export interface DeserializeHandlerOutput<Output extends object> {
36
+ /**
37
+ * The raw response object from runtime is deserialized to structured output object.
38
+ * The response object is unknown so you cannot modify it directly. When work with
39
+ * response, you need to guard its type to e.g. HttpResponse with 'instanceof' operand.
40
+ *
41
+ * During the deserialize phase of the execution of a middleware stack, a deserialized
42
+ * response may or may not be available
43
+ */
44
+ response: unknown;
45
+ output?: Output;
46
+ }
47
+ export interface InitializeHandler<Input extends object, Output extends object> {
48
+ /**
49
+ * Asynchronously converts an input object into an output object.
50
+ *
51
+ * @param args An object containing a input to the command as well as any
52
+ * associated or previously generated execution artifacts.
53
+ */
54
+ (args: InitializeHandlerArguments<Input>): Promise<InitializeHandlerOutput<Output>>;
55
+ }
56
+ export declare type Handler<Input extends object, Output extends object> = InitializeHandler<Input, Output>;
57
+ export interface SerializeHandler<Input extends object, Output extends object> {
58
+ /**
59
+ * Asynchronously converts an input object into an output object.
60
+ *
61
+ * @param args An object containing a input to the command as well as any
62
+ * associated or previously generated execution artifacts.
63
+ */
64
+ (args: SerializeHandlerArguments<Input>): Promise<SerializeHandlerOutput<Output>>;
65
+ }
66
+ export interface FinalizeHandler<Input extends object, Output extends object> {
67
+ /**
68
+ * Asynchronously converts an input object into an output object.
69
+ *
70
+ * @param args An object containing a input to the command as well as any
71
+ * associated or previously generated execution artifacts.
72
+ */
73
+ (args: FinalizeHandlerArguments<Input>): Promise<FinalizeHandlerOutput<Output>>;
74
+ }
75
+ export interface BuildHandler<Input extends object, Output extends object> {
76
+ (args: BuildHandlerArguments<Input>): Promise<BuildHandlerOutput<Output>>;
77
+ }
78
+ export interface DeserializeHandler<Input extends object, Output extends object> {
79
+ (args: DeserializeHandlerArguments<Input>): Promise<DeserializeHandlerOutput<Output>>;
80
+ }
81
+ /**
82
+ * A factory function that creates functions implementing the {Handler}
83
+ * interface.
84
+ */
85
+ export interface InitializeMiddleware<Input extends object, Output extends object> {
86
+ /**
87
+ * @param next The handler to invoke after this middleware has operated on
88
+ * the user input and before this middleware operates on the output.
89
+ *
90
+ * @param context Invariant data and functions for use by the handler.
91
+ */
92
+ (next: InitializeHandler<Input, Output>, context: HandlerExecutionContext): InitializeHandler<Input, Output>;
93
+ }
94
+ /**
95
+ * A factory function that creates functions implementing the {BuildHandler}
96
+ * interface.
97
+ */
98
+ export interface SerializeMiddleware<Input extends object, Output extends object> {
99
+ /**
100
+ * @param next The handler to invoke after this middleware has operated on
101
+ * the user input and before this middleware operates on the output.
102
+ *
103
+ * @param context Invariant data and functions for use by the handler.
104
+ */
105
+ (next: SerializeHandler<Input, Output>, context: HandlerExecutionContext): SerializeHandler<Input, Output>;
106
+ }
107
+ /**
108
+ * A factory function that creates functions implementing the {FinalizeHandler}
109
+ * interface.
110
+ */
111
+ export interface FinalizeRequestMiddleware<Input extends object, Output extends object> {
112
+ /**
113
+ * @param next The handler to invoke after this middleware has operated on
114
+ * the user input and before this middleware operates on the output.
115
+ *
116
+ * @param context Invariant data and functions for use by the handler.
117
+ */
118
+ (next: FinalizeHandler<Input, Output>, context: HandlerExecutionContext): FinalizeHandler<Input, Output>;
119
+ }
120
+ export interface BuildMiddleware<Input extends object, Output extends object> {
121
+ (next: BuildHandler<Input, Output>, context: HandlerExecutionContext): BuildHandler<Input, Output>;
122
+ }
123
+ export interface DeserializeMiddleware<Input extends object, Output extends object> {
124
+ (next: DeserializeHandler<Input, Output>, context: HandlerExecutionContext): DeserializeHandler<Input, Output>;
125
+ }
126
+ export declare type MiddlewareType<Input extends object, Output extends object> =
127
+ | InitializeMiddleware<Input, Output>
128
+ | SerializeMiddleware<Input, Output>
129
+ | BuildMiddleware<Input, Output>
130
+ | FinalizeRequestMiddleware<Input, Output>
131
+ | DeserializeMiddleware<Input, Output>;
132
+ /**
133
+ * A factory function that creates the terminal handler atop which a middleware
134
+ * stack sits.
135
+ */
136
+ export interface Terminalware {
137
+ <Input extends object, Output extends object>(context: HandlerExecutionContext): DeserializeHandler<Input, Output>;
138
+ }
139
+ export declare type Step = "initialize" | "serialize" | "build" | "finalizeRequest" | "deserialize";
140
+ export declare type Priority = "high" | "normal" | "low";
141
+ export interface HandlerOptions {
142
+ /**
143
+ * Handlers are ordered using a "step" that describes the stage of command
144
+ * execution at which the handler will be executed. The available steps are:
145
+ *
146
+ * - initialize: The input is being prepared. Examples of typical
147
+ * initialization tasks include injecting default options computing
148
+ * derived parameters.
149
+ * - serialize: The input is complete and ready to be serialized. Examples
150
+ * of typical serialization tasks include input validation and building
151
+ * an HTTP request from user input.
152
+ * - build: The input has been serialized into an HTTP request, but that
153
+ * request may require further modification. Any request alterations
154
+ * will be applied to all retries. Examples of typical build tasks
155
+ * include injecting HTTP headers that describe a stable aspect of the
156
+ * request, such as `Content-Length` or a body checksum.
157
+ * - finalizeRequest: The request is being prepared to be sent over the wire. The
158
+ * request in this stage should already be semantically complete and
159
+ * should therefore only be altered as match the recipient's
160
+ * expectations. Examples of typical finalization tasks include request
161
+ * signing and injecting hop-by-hop headers.
162
+ * - deserialize: The response has arrived, the middleware here will deserialize
163
+ * the raw response object to structured response
164
+ *
165
+ * Unlike initialization and build handlers, which are executed once
166
+ * per operation execution, finalization and deserialize handlers will be
167
+ * executed foreach HTTP request sent.
168
+ *
169
+ * @default 'initialize'
170
+ */
171
+ step?: Step;
172
+ /**
173
+ * A list of strings to any that identify the general purpose or important
174
+ * characteristics of a given handler.
175
+ */
176
+ tags?: Array<string>;
177
+ /**
178
+ * A unique name to refer to a middleware
179
+ */
180
+ name?: string;
181
+ /**
182
+ * A flag to override the existing middleware with the same name. Without
183
+ * setting it, adding middleware with duplicated name will throw an exception.
184
+ * @internal
185
+ */
186
+ override?: boolean;
187
+ }
188
+ export interface AbsoluteLocation {
189
+ /**
190
+ * By default middleware will be added to individual step in un-guaranteed order.
191
+ * In the case that
192
+ *
193
+ * @default 'normal'
194
+ */
195
+ priority?: Priority;
196
+ }
197
+ export declare type Relation = "before" | "after";
198
+ export interface RelativeLocation {
199
+ /**
200
+ * Specify the relation to be before or after a know middleware.
201
+ */
202
+ relation: Relation;
203
+ /**
204
+ * A known middleware name to indicate inserting middleware's location.
205
+ */
206
+ toMiddleware: string;
207
+ }
208
+ export declare type RelativeMiddlewareOptions = RelativeLocation & Omit<HandlerOptions, "step">;
209
+ export interface InitializeHandlerOptions extends HandlerOptions {
210
+ step?: "initialize";
211
+ }
212
+ export interface SerializeHandlerOptions extends HandlerOptions {
213
+ step: "serialize";
214
+ }
215
+ export interface BuildHandlerOptions extends HandlerOptions {
216
+ step: "build";
217
+ }
218
+ export interface FinalizeRequestHandlerOptions extends HandlerOptions {
219
+ step: "finalizeRequest";
220
+ }
221
+ export interface DeserializeHandlerOptions extends HandlerOptions {
222
+ step: "deserialize";
223
+ }
224
+ /**
225
+ * A stack storing middleware. It can be resolved into a handler. It supports 2
226
+ * approaches for adding middleware:
227
+ * 1. Adding middleware to specific step with `add()`. The order of middleware
228
+ * added into same step is determined by order of adding them. If one middleware
229
+ * needs to be executed at the front of the step or at the end of step, set
230
+ * `priority` options to `high` or `low`.
231
+ * 2. Adding middleware to location relative to known middleware with `addRelativeTo()`.
232
+ * This is useful when given middleware must be executed before or after specific
233
+ * middleware(`toMiddleware`). You can add a middleware relatively to another
234
+ * middleware which also added relatively. But eventually, this relative middleware
235
+ * chain **must** be 'anchored' by a middleware that added using `add()` API
236
+ * with absolute `step` and `priority`. This mothod will throw if specified
237
+ * `toMiddleware` is not found.
238
+ */
239
+ export interface MiddlewareStack<Input extends object, Output extends object> extends Pluggable<Input, Output> {
240
+ /**
241
+ * Add middleware to the stack to be executed during the "initialize" step,
242
+ * optionally specifying a priority, tags and name
243
+ */
244
+ add(middleware: InitializeMiddleware<Input, Output>, options?: InitializeHandlerOptions & AbsoluteLocation): void;
245
+ /**
246
+ * Add middleware to the stack to be executed during the "serialize" step,
247
+ * optionally specifying a priority, tags and name
248
+ */
249
+ add(middleware: SerializeMiddleware<Input, Output>, options: SerializeHandlerOptions & AbsoluteLocation): void;
250
+ /**
251
+ * Add middleware to the stack to be executed during the "build" step,
252
+ * optionally specifying a priority, tags and name
253
+ */
254
+ add(middleware: BuildMiddleware<Input, Output>, options: BuildHandlerOptions & AbsoluteLocation): void;
255
+ /**
256
+ * Add middleware to the stack to be executed during the "finalizeRequest" step,
257
+ * optionally specifying a priority, tags and name
258
+ */
259
+ add(
260
+ middleware: FinalizeRequestMiddleware<Input, Output>,
261
+ options: FinalizeRequestHandlerOptions & AbsoluteLocation
262
+ ): void;
263
+ /**
264
+ * Add middleware to the stack to be executed during the "deserialize" step,
265
+ * optionally specifying a priority, tags and name
266
+ */
267
+ add(middleware: DeserializeMiddleware<Input, Output>, options: DeserializeHandlerOptions & AbsoluteLocation): void;
268
+ /**
269
+ * Add middleware to a stack position before or after a known middleware,optionally
270
+ * specifying name and tags.
271
+ */
272
+ addRelativeTo(middleware: MiddlewareType<Input, Output>, options: RelativeMiddlewareOptions): void;
273
+ /**
274
+ * Apply a customization function to mutate the middleware stack, often
275
+ * used for customizations that requires mutating multiple middleware.
276
+ */
277
+ use(pluggable: Pluggable<Input, Output>): void;
278
+ /**
279
+ * Create a shallow clone of this stack. Step bindings and handler priorities
280
+ * and tags are preserved in the copy.
281
+ */
282
+ clone(): MiddlewareStack<Input, Output>;
283
+ /**
284
+ * Removes middleware from the stack.
285
+ *
286
+ * If a string is provided, it will be treated as middleware name. If a middleware
287
+ * is inserted with the given name, it will be removed.
288
+ *
289
+ * If a middleware class is provided, all usages thereof will be removed.
290
+ */
291
+ remove(toRemove: MiddlewareType<Input, Output> | string): boolean;
292
+ /**
293
+ * Removes middleware that contains given tag
294
+ *
295
+ * Multiple middleware will potentially be removed
296
+ */
297
+ removeByTag(toRemove: string): boolean;
298
+ /**
299
+ * Create a stack containing the middlewares in this stack as well as the
300
+ * middlewares in the `from` stack. Neither source is modified, and step
301
+ * bindings and handler priorities and tags are preserved in the copy.
302
+ */
303
+ concat<InputType extends Input, OutputType extends Output>(
304
+ from: MiddlewareStack<InputType, OutputType>
305
+ ): MiddlewareStack<InputType, OutputType>;
306
+ /**
307
+ * Builds a single handler function from zero or more middleware classes and
308
+ * a core handler. The core handler is meant to send command objects to AWS
309
+ * services and return promises that will resolve with the operation result
310
+ * or be rejected with an error.
311
+ *
312
+ * When a composed handler is invoked, the arguments will pass through all
313
+ * middleware in a defined order, and the return from the innermost handler
314
+ * will pass through all middleware in the reverse of that order.
315
+ */
316
+ resolve<InputType extends Input, OutputType extends Output>(
317
+ handler: DeserializeHandler<InputType, OutputType>,
318
+ context: HandlerExecutionContext
319
+ ): InitializeHandler<InputType, OutputType>;
320
+ }
321
+ /**
322
+ * Data and helper objects that are not expected to change from one execution of
323
+ * a composed handler to another.
324
+ */
325
+ export interface HandlerExecutionContext {
326
+ /**
327
+ * A logger that may be invoked by any handler during execution of an
328
+ * operation.
329
+ */
330
+ logger?: Logger;
331
+ /**
332
+ * Additional user agent that inferred by middleware. It can be used to save
333
+ * the internal user agent sections without overriding the `customUserAgent`
334
+ * config in clients.
335
+ */
336
+ userAgent?: UserAgent;
337
+ [key: string]: any;
338
+ }
339
+ export interface Pluggable<Input extends object, Output extends object> {
340
+ /**
341
+ * A function that mutate the passed in middleware stack. Functions implementing
342
+ * this interface can add, remove, modify existing middleware stack from clients
343
+ * or commands
344
+ */
345
+ applyToStack: (stack: MiddlewareStack<Input, Output>) => void;
346
+ }
@@ -0,0 +1,14 @@
1
+ import { Client } from "./client";
2
+ /**
3
+ * Expected type definition of a paginator.
4
+ */
5
+ export declare type Paginator<T> = AsyncGenerator<T, T, unknown>;
6
+ /**
7
+ * Expected paginator configuration passed to an operation. Services will extend
8
+ * this interface definition and may type client further.
9
+ */
10
+ export interface PaginationConfiguration {
11
+ client: Client<any, any, any>;
12
+ pageSize?: number;
13
+ startingToken?: any;
14
+ }
@@ -0,0 +1,34 @@
1
+ export interface ResponseMetadata {
2
+ /**
3
+ * The status code of the last HTTP response received for this operation.
4
+ */
5
+ httpStatusCode?: number;
6
+ /**
7
+ * A unique identifier for the last request sent for this operation. Often
8
+ * requested by AWS service teams to aid in debugging.
9
+ */
10
+ requestId?: string;
11
+ /**
12
+ * A secondary identifier for the last request sent. Used for debugging.
13
+ */
14
+ extendedRequestId?: string;
15
+ /**
16
+ * A tertiary identifier for the last request sent. Used for debugging.
17
+ */
18
+ cfId?: string;
19
+ /**
20
+ * The number of times this operation was attempted.
21
+ */
22
+ attempts?: number;
23
+ /**
24
+ * The total amount of time (in milliseconds) that was spent waiting between
25
+ * retry attempts.
26
+ */
27
+ totalRetryDelay?: number;
28
+ }
29
+ export interface MetadataBearer {
30
+ /**
31
+ * Metadata pertaining to this request.
32
+ */
33
+ $metadata: ResponseMetadata;
34
+ }
package/src/serde.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ import { Endpoint } from "./http";
2
+ import { RequestHandler } from "./transfer";
3
+ import { Decoder, Encoder, Provider } from "./util";
4
+ /**
5
+ * Interface for object requires an Endpoint set.
6
+ */
7
+ export interface EndpointBearer {
8
+ endpoint: Provider<Endpoint>;
9
+ }
10
+ export interface StreamCollector {
11
+ /**
12
+ * A function that converts a stream into an array of bytes.
13
+ *
14
+ * @param stream The low-level native stream from browser or Nodejs runtime
15
+ */
16
+ (stream: any): Promise<Uint8Array>;
17
+ }
18
+ /**
19
+ * Request and Response serde util functions and settings for AWS services
20
+ */
21
+ export interface SerdeContext extends EndpointBearer {
22
+ base64Encoder: Encoder;
23
+ base64Decoder: Decoder;
24
+ utf8Encoder: Encoder;
25
+ utf8Decoder: Decoder;
26
+ streamCollector: StreamCollector;
27
+ requestHandler: RequestHandler<any, any>;
28
+ disableHostPrefix: boolean;
29
+ }
30
+ export interface RequestSerializer<Request, Context extends EndpointBearer = any> {
31
+ /**
32
+ * Converts the provided `input` into a request object
33
+ *
34
+ * @param input The user input to serialize.
35
+ *
36
+ * @param context Context containing runtime-specific util functions.
37
+ */
38
+ (input: any, context: Context): Promise<Request>;
39
+ }
40
+ export interface ResponseDeserializer<OutputType, ResponseType = any, Context = any> {
41
+ /**
42
+ * Converts the output of an operation into JavaScript types.
43
+ *
44
+ * @param output The HTTP response received from the service
45
+ *
46
+ * @param context context containing runtime-specific util functions.
47
+ */
48
+ (output: ResponseType, context: Context): Promise<OutputType>;
49
+ }
@@ -0,0 +1,51 @@
1
+ import { MetadataBearer } from "./response";
2
+ /**
3
+ * A document type represents an untyped JSON-like value.
4
+ *
5
+ * Not all protocols support document types, and the serialization format of a
6
+ * document type is protocol specific. All JSON protocols SHOULD support
7
+ * document types and they SHOULD serialize document types inline as normal
8
+ * JSON values.
9
+ */
10
+ export declare type DocumentType =
11
+ | null
12
+ | boolean
13
+ | number
14
+ | string
15
+ | DocumentType[]
16
+ | {
17
+ [prop: string]: DocumentType;
18
+ };
19
+ /**
20
+ * A structure shape with the error trait.
21
+ * https://awslabs.github.io/smithy/spec/core.html#retryable-trait
22
+ */
23
+ export interface RetryableTrait {
24
+ /**
25
+ * Indicates that the error is a retryable throttling error.
26
+ */
27
+ readonly throttling?: boolean;
28
+ }
29
+ /**
30
+ * Type that is implemented by all Smithy shapes marked with the
31
+ * error trait.
32
+ */
33
+ export interface SmithyException {
34
+ /**
35
+ * The shape ID name of the exception.
36
+ */
37
+ readonly name: string;
38
+ /**
39
+ * Whether the client or server are at fault.
40
+ */
41
+ readonly $fault: "client" | "server";
42
+ /**
43
+ * The service that encountered the exception.
44
+ */
45
+ readonly $service?: string;
46
+ /**
47
+ * Indicates that an error MAY be retried by the client.
48
+ */
49
+ readonly $retryable?: RetryableTrait;
50
+ }
51
+ export declare type SdkError = Error & Partial<SmithyException> & Partial<MetadataBearer>;
@@ -0,0 +1,100 @@
1
+ import { HttpRequest } from "./http";
2
+ /**
3
+ * A {Date} object, a unix (epoch) timestamp in seconds, or a string that can be
4
+ * understood by the JavaScript {Date} constructor.
5
+ */
6
+ export declare type DateInput = number | string | Date;
7
+ export interface SigningArguments {
8
+ /**
9
+ * The date and time to be used as signature metadata. This value should be
10
+ * a Date object, a unix (epoch) timestamp, or a string that can be
11
+ * understood by the JavaScript `Date` constructor.If not supplied, the
12
+ * value returned by `new Date()` will be used.
13
+ */
14
+ signingDate?: DateInput;
15
+ /**
16
+ * The service signing name. It will override the service name of the signer
17
+ * in current invocation
18
+ */
19
+ signingService?: string;
20
+ /**
21
+ * The region name to sign the request. It will override the signing region of the
22
+ * signer in current invocation
23
+ */
24
+ signingRegion?: string;
25
+ }
26
+ export interface RequestSigningArguments extends SigningArguments {
27
+ /**
28
+ * A set of strings whose members represents headers that cannot be signed.
29
+ * All headers in the provided request will have their names converted to
30
+ * lower case and then checked for existence in the unsignableHeaders set.
31
+ */
32
+ unsignableHeaders?: Set<string>;
33
+ /**
34
+ * A set of strings whose members represents headers that should be signed.
35
+ * Any values passed here will override those provided via unsignableHeaders,
36
+ * allowing them to be signed.
37
+ *
38
+ * All headers in the provided request will have their names converted to
39
+ * lower case before signing.
40
+ */
41
+ signableHeaders?: Set<string>;
42
+ }
43
+ export interface RequestPresigningArguments extends RequestSigningArguments {
44
+ /**
45
+ * The number of seconds before the presigned URL expires
46
+ */
47
+ expiresIn?: number;
48
+ /**
49
+ * A set of strings whose representing headers that should not be hoisted
50
+ * to presigned request's query string. If not supplied, the presigner
51
+ * moves all the AWS-specific headers (starting with `x-amz-`) to the request
52
+ * query string. If supplied, these headers remain in the presigned request's
53
+ * header.
54
+ * All headers in the provided request will have their names converted to
55
+ * lower case and then checked for existence in the unhoistableHeaders set.
56
+ */
57
+ unhoistableHeaders?: Set<string>;
58
+ }
59
+ export interface EventSigningArguments extends SigningArguments {
60
+ priorSignature: string;
61
+ }
62
+ export interface RequestPresigner {
63
+ /**
64
+ * Signs a request for future use.
65
+ *
66
+ * The request will be valid until either the provided `expiration` time has
67
+ * passed or the underlying credentials have expired.
68
+ *
69
+ * @param requestToSign The request that should be signed.
70
+ * @param options Additional signing options.
71
+ */
72
+ presign(requestToSign: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
73
+ }
74
+ /**
75
+ * An object that signs request objects with AWS credentials using one of the
76
+ * AWS authentication protocols.
77
+ */
78
+ export interface RequestSigner {
79
+ /**
80
+ * Sign the provided request for immediate dispatch.
81
+ */
82
+ sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
83
+ }
84
+ export interface StringSigner {
85
+ /**
86
+ * Sign the provided `stringToSign` for use outside of the context of
87
+ * request signing. Typical uses include signed policy generation.
88
+ */
89
+ sign(stringToSign: string, options?: SigningArguments): Promise<string>;
90
+ }
91
+ export interface FormattedEvent {
92
+ headers: Uint8Array;
93
+ payload: Uint8Array;
94
+ }
95
+ export interface EventSigner {
96
+ /**
97
+ * Sign the individual event of the event stream.
98
+ */
99
+ sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;
100
+ }
@@ -0,0 +1,16 @@
1
+ export declare type RequestHandlerOutput<ResponseType> = {
2
+ response: ResponseType;
3
+ };
4
+ export interface RequestHandler<RequestType, ResponseType, HandlerOptions = {}> {
5
+ /**
6
+ * metadata contains information of a handler. For example
7
+ * 'h2' refers this handler is for handling HTTP/2 requests,
8
+ * whereas 'h1' refers handling HTTP1 requests
9
+ */
10
+ metadata?: RequestHandlerMetadata;
11
+ destroy?: () => void;
12
+ handle: (request: RequestType, handlerOptions?: HandlerOptions) => Promise<RequestHandlerOutput<ResponseType>>;
13
+ }
14
+ export interface RequestHandlerMetadata {
15
+ handlerProtocol: string;
16
+ }