@aws-sdk/types 3.35.0 → 3.36.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist-cjs/abort.js +0 -1
  3. package/dist-cjs/client.js +0 -1
  4. package/dist-cjs/command.js +0 -1
  5. package/dist-cjs/credentials.js +0 -1
  6. package/dist-cjs/crypto.js +0 -1
  7. package/dist-cjs/eventStream.js +0 -1
  8. package/dist-cjs/http.js +0 -1
  9. package/dist-cjs/index.js +0 -1
  10. package/dist-cjs/logger.js +0 -1
  11. package/dist-cjs/middleware.js +0 -1
  12. package/dist-cjs/pagination.js +0 -1
  13. package/dist-cjs/response.js +0 -1
  14. package/dist-cjs/serde.js +0 -1
  15. package/dist-cjs/shapes.js +0 -1
  16. package/dist-cjs/signature.js +0 -1
  17. package/dist-cjs/transfer.js +0 -1
  18. package/dist-cjs/util.js +0 -1
  19. package/dist-cjs/waiter.js +0 -1
  20. package/dist-es/abort.js +0 -1
  21. package/dist-es/client.js +0 -1
  22. package/dist-es/command.js +0 -1
  23. package/dist-es/credentials.js +0 -1
  24. package/dist-es/crypto.js +0 -1
  25. package/dist-es/eventStream.js +0 -1
  26. package/dist-es/http.js +0 -1
  27. package/dist-es/index.js +0 -1
  28. package/dist-es/logger.js +0 -1
  29. package/dist-es/middleware.js +0 -1
  30. package/dist-es/pagination.js +0 -1
  31. package/dist-es/response.js +0 -1
  32. package/dist-es/serde.js +0 -1
  33. package/dist-es/shapes.js +0 -1
  34. package/dist-es/signature.js +0 -1
  35. package/dist-es/transfer.js +0 -1
  36. package/dist-es/util.js +0 -1
  37. package/dist-es/waiter.js +0 -1
  38. package/package.json +4 -1
  39. package/src/abort.d.ts +0 -42
  40. package/src/abort.ts +0 -46
  41. package/src/client.d.ts +0 -34
  42. package/src/client.ts +0 -35
  43. package/src/command.d.ts +0 -17
  44. package/src/command.ts +0 -18
  45. package/src/credentials.d.ts +0 -24
  46. package/src/credentials.ts +0 -29
  47. package/src/crypto.d.ts +0 -45
  48. package/src/crypto.ts +0 -50
  49. package/src/eventStream.d.ts +0 -100
  50. package/src/eventStream.ts +0 -119
  51. package/src/http.d.ts +0 -92
  52. package/src/http.ts +0 -101
  53. package/src/index.d.ts +0 -17
  54. package/src/index.ts +0 -17
  55. package/src/logger.d.ts +0 -26
  56. package/src/logger.ts +0 -28
  57. package/src/middleware.d.ts +0 -346
  58. package/src/middleware.ts +0 -400
  59. package/src/pagination.d.ts +0 -14
  60. package/src/pagination.ts +0 -16
  61. package/src/response.d.ts +0 -34
  62. package/src/response.ts +0 -40
  63. package/src/serde.d.ts +0 -49
  64. package/src/serde.ts +0 -54
  65. package/src/shapes.d.ts +0 -51
  66. package/src/shapes.ts +0 -50
  67. package/src/signature.d.ts +0 -100
  68. package/src/signature.ts +0 -113
  69. package/src/transfer.d.ts +0 -16
  70. package/src/transfer.ts +0 -18
  71. package/src/util.d.ts +0 -100
  72. package/src/util.ts +0 -115
  73. package/src/waiter.d.ts +0 -32
  74. package/src/waiter.ts +0 -38
  75. package/tsconfig.cjs.json +0 -9
  76. package/tsconfig.es.json +0 -10
  77. package/tsconfig.types.json +0 -9
package/src/middleware.ts DELETED
@@ -1,400 +0,0 @@
1
- import { Logger } from "./logger";
2
- import { UserAgent } from "./util";
3
-
4
- export interface InitializeHandlerArguments<Input extends object> {
5
- /**
6
- * User input to a command. Reflects the userland representation of the
7
- * union of data types the command can effectively handle.
8
- */
9
- input: Input;
10
- }
11
-
12
- export interface InitializeHandlerOutput<Output extends object> extends DeserializeHandlerOutput<Output> {
13
- output: Output;
14
- }
15
-
16
- export interface SerializeHandlerArguments<Input extends object> extends InitializeHandlerArguments<Input> {
17
- /**
18
- * The user input serialized as a request object. The request object is unknown,
19
- * so you cannot modify it directly. When work with request, you need to guard its
20
- * type to e.g. HttpRequest with 'instanceof' operand
21
- *
22
- * During the build phase of the execution of a middleware stack, a built
23
- * request may or may not be available.
24
- */
25
- request?: unknown;
26
- }
27
-
28
- export interface SerializeHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}
29
-
30
- export interface BuildHandlerArguments<Input extends object> extends FinalizeHandlerArguments<Input> {}
31
-
32
- export interface BuildHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}
33
-
34
- export interface FinalizeHandlerArguments<Input extends object> extends SerializeHandlerArguments<Input> {
35
- /**
36
- * The user input serialized as a request.
37
- */
38
- request: unknown;
39
- }
40
-
41
- export interface FinalizeHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}
42
-
43
- export interface DeserializeHandlerArguments<Input extends object> extends FinalizeHandlerArguments<Input> {}
44
-
45
- export interface DeserializeHandlerOutput<Output extends object> {
46
- /**
47
- * The raw response object from runtime is deserialized to structured output object.
48
- * The response object is unknown so you cannot modify it directly. When work with
49
- * response, you need to guard its type to e.g. HttpResponse with 'instanceof' operand.
50
- *
51
- * During the deserialize phase of the execution of a middleware stack, a deserialized
52
- * response may or may not be available
53
- */
54
- response: unknown;
55
- output?: Output;
56
- }
57
-
58
- export interface InitializeHandler<Input extends object, Output extends object> {
59
- /**
60
- * Asynchronously converts an input object into an output object.
61
- *
62
- * @param args An object containing a input to the command as well as any
63
- * associated or previously generated execution artifacts.
64
- */
65
- (args: InitializeHandlerArguments<Input>): Promise<InitializeHandlerOutput<Output>>;
66
- }
67
-
68
- export type Handler<Input extends object, Output extends object> = InitializeHandler<Input, Output>;
69
-
70
- export interface SerializeHandler<Input extends object, Output extends object> {
71
- /**
72
- * Asynchronously converts an input object into an output object.
73
- *
74
- * @param args An object containing a input to the command as well as any
75
- * associated or previously generated execution artifacts.
76
- */
77
- (args: SerializeHandlerArguments<Input>): Promise<SerializeHandlerOutput<Output>>;
78
- }
79
-
80
- export interface FinalizeHandler<Input extends object, Output extends object> {
81
- /**
82
- * Asynchronously converts an input object into an output object.
83
- *
84
- * @param args An object containing a input to the command as well as any
85
- * associated or previously generated execution artifacts.
86
- */
87
- (args: FinalizeHandlerArguments<Input>): Promise<FinalizeHandlerOutput<Output>>;
88
- }
89
-
90
- export interface BuildHandler<Input extends object, Output extends object> {
91
- (args: BuildHandlerArguments<Input>): Promise<BuildHandlerOutput<Output>>;
92
- }
93
-
94
- export interface DeserializeHandler<Input extends object, Output extends object> {
95
- (args: DeserializeHandlerArguments<Input>): Promise<DeserializeHandlerOutput<Output>>;
96
- }
97
-
98
- /**
99
- * A factory function that creates functions implementing the {Handler}
100
- * interface.
101
- */
102
- export interface InitializeMiddleware<Input extends object, Output extends object> {
103
- /**
104
- * @param next The handler to invoke after this middleware has operated on
105
- * the user input and before this middleware operates on the output.
106
- *
107
- * @param context Invariant data and functions for use by the handler.
108
- */
109
- (next: InitializeHandler<Input, Output>, context: HandlerExecutionContext): InitializeHandler<Input, Output>;
110
- }
111
-
112
- /**
113
- * A factory function that creates functions implementing the {BuildHandler}
114
- * interface.
115
- */
116
- export interface SerializeMiddleware<Input extends object, Output extends object> {
117
- /**
118
- * @param next The handler to invoke after this middleware has operated on
119
- * the user input and before this middleware operates on the output.
120
- *
121
- * @param context Invariant data and functions for use by the handler.
122
- */
123
- (next: SerializeHandler<Input, Output>, context: HandlerExecutionContext): SerializeHandler<Input, Output>;
124
- }
125
-
126
- /**
127
- * A factory function that creates functions implementing the {FinalizeHandler}
128
- * interface.
129
- */
130
- export interface FinalizeRequestMiddleware<Input extends object, Output extends object> {
131
- /**
132
- * @param next The handler to invoke after this middleware has operated on
133
- * the user input and before this middleware operates on the output.
134
- *
135
- * @param context Invariant data and functions for use by the handler.
136
- */
137
- (next: FinalizeHandler<Input, Output>, context: HandlerExecutionContext): FinalizeHandler<Input, Output>;
138
- }
139
-
140
- export interface BuildMiddleware<Input extends object, Output extends object> {
141
- (next: BuildHandler<Input, Output>, context: HandlerExecutionContext): BuildHandler<Input, Output>;
142
- }
143
-
144
- export interface DeserializeMiddleware<Input extends object, Output extends object> {
145
- (next: DeserializeHandler<Input, Output>, context: HandlerExecutionContext): DeserializeHandler<Input, Output>;
146
- }
147
-
148
- export type MiddlewareType<Input extends object, Output extends object> =
149
- | InitializeMiddleware<Input, Output>
150
- | SerializeMiddleware<Input, Output>
151
- | BuildMiddleware<Input, Output>
152
- | FinalizeRequestMiddleware<Input, Output>
153
- | DeserializeMiddleware<Input, Output>;
154
-
155
- /**
156
- * A factory function that creates the terminal handler atop which a middleware
157
- * stack sits.
158
- */
159
- export interface Terminalware {
160
- <Input extends object, Output extends object>(context: HandlerExecutionContext): DeserializeHandler<Input, Output>;
161
- }
162
-
163
- export type Step = "initialize" | "serialize" | "build" | "finalizeRequest" | "deserialize";
164
-
165
- export type Priority = "high" | "normal" | "low";
166
-
167
- export interface HandlerOptions {
168
- /**
169
- * Handlers are ordered using a "step" that describes the stage of command
170
- * execution at which the handler will be executed. The available steps are:
171
- *
172
- * - initialize: The input is being prepared. Examples of typical
173
- * initialization tasks include injecting default options computing
174
- * derived parameters.
175
- * - serialize: The input is complete and ready to be serialized. Examples
176
- * of typical serialization tasks include input validation and building
177
- * an HTTP request from user input.
178
- * - build: The input has been serialized into an HTTP request, but that
179
- * request may require further modification. Any request alterations
180
- * will be applied to all retries. Examples of typical build tasks
181
- * include injecting HTTP headers that describe a stable aspect of the
182
- * request, such as `Content-Length` or a body checksum.
183
- * - finalizeRequest: The request is being prepared to be sent over the wire. The
184
- * request in this stage should already be semantically complete and
185
- * should therefore only be altered as match the recipient's
186
- * expectations. Examples of typical finalization tasks include request
187
- * signing and injecting hop-by-hop headers.
188
- * - deserialize: The response has arrived, the middleware here will deserialize
189
- * the raw response object to structured response
190
- *
191
- * Unlike initialization and build handlers, which are executed once
192
- * per operation execution, finalization and deserialize handlers will be
193
- * executed foreach HTTP request sent.
194
- *
195
- * @default 'initialize'
196
- */
197
- step?: Step;
198
-
199
- /**
200
- * A list of strings to any that identify the general purpose or important
201
- * characteristics of a given handler.
202
- */
203
- tags?: Array<string>;
204
-
205
- /**
206
- * A unique name to refer to a middleware
207
- */
208
- name?: string;
209
-
210
- /**
211
- * A flag to override the existing middleware with the same name. Without
212
- * setting it, adding middleware with duplicated name will throw an exception.
213
- * @internal
214
- */
215
- override?: boolean;
216
- }
217
- export interface AbsoluteLocation {
218
- /**
219
- * By default middleware will be added to individual step in un-guaranteed order.
220
- * In the case that
221
- *
222
- * @default 'normal'
223
- */
224
- priority?: Priority;
225
- }
226
-
227
- export type Relation = "before" | "after";
228
-
229
- export interface RelativeLocation {
230
- /**
231
- * Specify the relation to be before or after a know middleware.
232
- */
233
- relation: Relation;
234
-
235
- /**
236
- * A known middleware name to indicate inserting middleware's location.
237
- */
238
- toMiddleware: string;
239
- }
240
-
241
- export type RelativeMiddlewareOptions = RelativeLocation & Omit<HandlerOptions, "step">;
242
-
243
- export interface InitializeHandlerOptions extends HandlerOptions {
244
- step?: "initialize";
245
- }
246
-
247
- export interface SerializeHandlerOptions extends HandlerOptions {
248
- step: "serialize";
249
- }
250
-
251
- export interface BuildHandlerOptions extends HandlerOptions {
252
- step: "build";
253
- }
254
-
255
- export interface FinalizeRequestHandlerOptions extends HandlerOptions {
256
- step: "finalizeRequest";
257
- }
258
-
259
- export interface DeserializeHandlerOptions extends HandlerOptions {
260
- step: "deserialize";
261
- }
262
-
263
- /**
264
- * A stack storing middleware. It can be resolved into a handler. It supports 2
265
- * approaches for adding middleware:
266
- * 1. Adding middleware to specific step with `add()`. The order of middleware
267
- * added into same step is determined by order of adding them. If one middleware
268
- * needs to be executed at the front of the step or at the end of step, set
269
- * `priority` options to `high` or `low`.
270
- * 2. Adding middleware to location relative to known middleware with `addRelativeTo()`.
271
- * This is useful when given middleware must be executed before or after specific
272
- * middleware(`toMiddleware`). You can add a middleware relatively to another
273
- * middleware which also added relatively. But eventually, this relative middleware
274
- * chain **must** be 'anchored' by a middleware that added using `add()` API
275
- * with absolute `step` and `priority`. This mothod will throw if specified
276
- * `toMiddleware` is not found.
277
- */
278
- export interface MiddlewareStack<Input extends object, Output extends object> extends Pluggable<Input, Output> {
279
- /**
280
- * Add middleware to the stack to be executed during the "initialize" step,
281
- * optionally specifying a priority, tags and name
282
- */
283
- add(middleware: InitializeMiddleware<Input, Output>, options?: InitializeHandlerOptions & AbsoluteLocation): void;
284
-
285
- /**
286
- * Add middleware to the stack to be executed during the "serialize" step,
287
- * optionally specifying a priority, tags and name
288
- */
289
- add(middleware: SerializeMiddleware<Input, Output>, options: SerializeHandlerOptions & AbsoluteLocation): void;
290
-
291
- /**
292
- * Add middleware to the stack to be executed during the "build" step,
293
- * optionally specifying a priority, tags and name
294
- */
295
- add(middleware: BuildMiddleware<Input, Output>, options: BuildHandlerOptions & AbsoluteLocation): void;
296
-
297
- /**
298
- * Add middleware to the stack to be executed during the "finalizeRequest" step,
299
- * optionally specifying a priority, tags and name
300
- */
301
- add(
302
- middleware: FinalizeRequestMiddleware<Input, Output>,
303
- options: FinalizeRequestHandlerOptions & AbsoluteLocation
304
- ): void;
305
-
306
- /**
307
- * Add middleware to the stack to be executed during the "deserialize" step,
308
- * optionally specifying a priority, tags and name
309
- */
310
- add(middleware: DeserializeMiddleware<Input, Output>, options: DeserializeHandlerOptions & AbsoluteLocation): void;
311
-
312
- /**
313
- * Add middleware to a stack position before or after a known middleware,optionally
314
- * specifying name and tags.
315
- */
316
- addRelativeTo(middleware: MiddlewareType<Input, Output>, options: RelativeMiddlewareOptions): void;
317
-
318
- /**
319
- * Apply a customization function to mutate the middleware stack, often
320
- * used for customizations that requires mutating multiple middleware.
321
- */
322
- use(pluggable: Pluggable<Input, Output>): void;
323
-
324
- /**
325
- * Create a shallow clone of this stack. Step bindings and handler priorities
326
- * and tags are preserved in the copy.
327
- */
328
- clone(): MiddlewareStack<Input, Output>;
329
-
330
- /**
331
- * Removes middleware from the stack.
332
- *
333
- * If a string is provided, it will be treated as middleware name. If a middleware
334
- * is inserted with the given name, it will be removed.
335
- *
336
- * If a middleware class is provided, all usages thereof will be removed.
337
- */
338
- remove(toRemove: MiddlewareType<Input, Output> | string): boolean;
339
-
340
- /**
341
- * Removes middleware that contains given tag
342
- *
343
- * Multiple middleware will potentially be removed
344
- */
345
- removeByTag(toRemove: string): boolean;
346
-
347
- /**
348
- * Create a stack containing the middlewares in this stack as well as the
349
- * middlewares in the `from` stack. Neither source is modified, and step
350
- * bindings and handler priorities and tags are preserved in the copy.
351
- */
352
- concat<InputType extends Input, OutputType extends Output>(
353
- from: MiddlewareStack<InputType, OutputType>
354
- ): MiddlewareStack<InputType, OutputType>;
355
-
356
- /**
357
- * Builds a single handler function from zero or more middleware classes and
358
- * a core handler. The core handler is meant to send command objects to AWS
359
- * services and return promises that will resolve with the operation result
360
- * or be rejected with an error.
361
- *
362
- * When a composed handler is invoked, the arguments will pass through all
363
- * middleware in a defined order, and the return from the innermost handler
364
- * will pass through all middleware in the reverse of that order.
365
- */
366
- resolve<InputType extends Input, OutputType extends Output>(
367
- handler: DeserializeHandler<InputType, OutputType>,
368
- context: HandlerExecutionContext
369
- ): InitializeHandler<InputType, OutputType>;
370
- }
371
-
372
- /**
373
- * Data and helper objects that are not expected to change from one execution of
374
- * a composed handler to another.
375
- */
376
- export interface HandlerExecutionContext {
377
- /**
378
- * A logger that may be invoked by any handler during execution of an
379
- * operation.
380
- */
381
- logger?: Logger;
382
-
383
- /**
384
- * Additional user agent that inferred by middleware. It can be used to save
385
- * the internal user agent sections without overriding the `customUserAgent`
386
- * config in clients.
387
- */
388
- userAgent?: UserAgent;
389
-
390
- [key: string]: any;
391
- }
392
-
393
- export interface Pluggable<Input extends object, Output extends object> {
394
- /**
395
- * A function that mutate the passed in middleware stack. Functions implementing
396
- * this interface can add, remove, modify existing middleware stack from clients
397
- * or commands
398
- */
399
- applyToStack: (stack: MiddlewareStack<Input, Output>) => void;
400
- }
@@ -1,14 +0,0 @@
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
- }
package/src/pagination.ts DELETED
@@ -1,16 +0,0 @@
1
- import { Client } from "./client";
2
-
3
- /**
4
- * Expected type definition of a paginator.
5
- */
6
- export type Paginator<T> = AsyncGenerator<T, T, unknown>;
7
-
8
- /**
9
- * Expected paginator configuration passed to an operation. Services will extend
10
- * this interface definition and may type client further.
11
- */
12
- export interface PaginationConfiguration {
13
- client: Client<any, any, any>;
14
- pageSize?: number;
15
- startingToken?: any;
16
- }
package/src/response.d.ts DELETED
@@ -1,34 +0,0 @@
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/response.ts DELETED
@@ -1,40 +0,0 @@
1
- export interface ResponseMetadata {
2
- /**
3
- * The status code of the last HTTP response received for this operation.
4
- */
5
- httpStatusCode?: number;
6
-
7
- /**
8
- * A unique identifier for the last request sent for this operation. Often
9
- * requested by AWS service teams to aid in debugging.
10
- */
11
- requestId?: string;
12
-
13
- /**
14
- * A secondary identifier for the last request sent. Used for debugging.
15
- */
16
- extendedRequestId?: string;
17
-
18
- /**
19
- * A tertiary identifier for the last request sent. Used for debugging.
20
- */
21
- cfId?: string;
22
-
23
- /**
24
- * The number of times this operation was attempted.
25
- */
26
- attempts?: number;
27
-
28
- /**
29
- * The total amount of time (in milliseconds) that was spent waiting between
30
- * retry attempts.
31
- */
32
- totalRetryDelay?: number;
33
- }
34
-
35
- export interface MetadataBearer {
36
- /**
37
- * Metadata pertaining to this request.
38
- */
39
- $metadata: ResponseMetadata;
40
- }
package/src/serde.d.ts DELETED
@@ -1,49 +0,0 @@
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
- }
package/src/serde.ts DELETED
@@ -1,54 +0,0 @@
1
- import { Endpoint } from "./http";
2
- import { RequestHandler } from "./transfer";
3
- import { Decoder, Encoder, Provider } from "./util";
4
-
5
- /**
6
- * Interface for object requires an Endpoint set.
7
- */
8
- export interface EndpointBearer {
9
- endpoint: Provider<Endpoint>;
10
- }
11
-
12
- export interface StreamCollector {
13
- /**
14
- * A function that converts a stream into an array of bytes.
15
- *
16
- * @param stream The low-level native stream from browser or Nodejs runtime
17
- */
18
- (stream: any): Promise<Uint8Array>;
19
- }
20
-
21
- /**
22
- * Request and Response serde util functions and settings for AWS services
23
- */
24
- export interface SerdeContext extends EndpointBearer {
25
- base64Encoder: Encoder;
26
- base64Decoder: Decoder;
27
- utf8Encoder: Encoder;
28
- utf8Decoder: Decoder;
29
- streamCollector: StreamCollector;
30
- requestHandler: RequestHandler<any, any>;
31
- disableHostPrefix: boolean;
32
- }
33
-
34
- export interface RequestSerializer<Request, Context extends EndpointBearer = any> {
35
- /**
36
- * Converts the provided `input` into a request object
37
- *
38
- * @param input The user input to serialize.
39
- *
40
- * @param context Context containing runtime-specific util functions.
41
- */
42
- (input: any, context: Context): Promise<Request>;
43
- }
44
-
45
- export interface ResponseDeserializer<OutputType, ResponseType = any, Context = any> {
46
- /**
47
- * Converts the output of an operation into JavaScript types.
48
- *
49
- * @param output The HTTP response received from the service
50
- *
51
- * @param context context containing runtime-specific util functions.
52
- */
53
- (output: ResponseType, context: Context): Promise<OutputType>;
54
- }
package/src/shapes.d.ts DELETED
@@ -1,51 +0,0 @@
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>;