@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/logger.d.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * A list of logger's log level. These levels are sorted in
3
- * order of increasing severity. Each log level includes itself and all
4
- * the levels behind itself.
5
- *
6
- * @example new Logger({logLevel: 'warn'}) will print all the warn and error
7
- * message.
8
- */
9
- export declare type LogLevel = "all" | "log" | "info" | "warn" | "error" | "off";
10
- /**
11
- * An object consumed by Logger constructor to initiate a logger object.
12
- */
13
- export interface LoggerOptions {
14
- logger?: Logger;
15
- logLevel?: LogLevel;
16
- }
17
- /**
18
- * Represents a logger object that is available in HandlerExecutionContext
19
- * throughout the middleware stack.
20
- */
21
- export interface Logger {
22
- debug(content: object): void;
23
- info(content: object): void;
24
- warn(content: object): void;
25
- error(content: object): void;
26
- }
package/src/logger.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * A list of logger's log level. These levels are sorted in
3
- * order of increasing severity. Each log level includes itself and all
4
- * the levels behind itself.
5
- *
6
- * @example new Logger({logLevel: 'warn'}) will print all the warn and error
7
- * message.
8
- */
9
- export type LogLevel = "all" | "log" | "info" | "warn" | "error" | "off";
10
-
11
- /**
12
- * An object consumed by Logger constructor to initiate a logger object.
13
- */
14
- export interface LoggerOptions {
15
- logger?: Logger;
16
- logLevel?: LogLevel;
17
- }
18
-
19
- /**
20
- * Represents a logger object that is available in HandlerExecutionContext
21
- * throughout the middleware stack.
22
- */
23
- export interface Logger {
24
- debug(content: object): void;
25
- info(content: object): void;
26
- warn(content: object): void;
27
- error(content: object): void;
28
- }
@@ -1,346 +0,0 @@
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
- }