0.6.1 • Published 2 months ago

@byu-oit-sdk/middleware-stack v0.6.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

@byu-oit-sdk/middleware-stack

For a deep-dive on the middleware stack, please read the Introducing Middleware Stack in Modular AWS SDK for JavaScript .

For an example of how to create middleware, please see the Token Middleware or Retry Middleware

Usage

The middleware stack consists of three parts: initialization, transformation, and finalization. It uses a standard stack architecture, meaning that it goes from initialization -> transformation -> finalization -> terminator -> finalization -> transformation -> initialization. The request moves through the stages in order until it reaches the "terminator" and the command is executed, at which point a response is sent back down the stack to be changed to what the sender is expecting to receive.

Initializtion

This stage of the middleware stack initializes an API call. Typically this step adds default input values to a command. The HTTP request has not been constructed by this point. When the response is passed through, it is finalized to ensure it is readable to the program that sent the request.

Transformation

This stage deals with the serialization of the request when moving up the stack, and deserialization when moving down the stack. "Transformation" simply refers to changing the request and response to be in the correct format. In this stage an HTTP request is constructed for the API call. Tasks include input validation and building the HTTP request from user input. When the response object returns through this middleware, it is converted from an HTTP response into a structured object that matches the expectations of the client.

Finalization

This stage alters the now-serialized request to ensure it matches the recipient's expectations. Examples of typical finalization tasks include adding an authorization header and performing retries.

0.6.1-beta.1

2 months ago

0.6.1

2 months ago

0.6.1-beta.0

3 months ago

0.5.2-beta.0

9 months ago

0.6.0-beta.0

9 months ago

0.6.0-beta.1

9 months ago

0.6.0

8 months ago

0.5.1

10 months ago

0.5.0

10 months ago

1.0.0-beta.0

11 months ago

0.3.0

11 months ago

0.3.2

11 months ago

0.4.0

11 months ago

0.3.1

11 months ago

0.2.2

12 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago