lambda-essentials-ts 4.1.1 → 4.1.5

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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
 
7
+ ## [4.1.5] - 2022-02-10
8
+
9
+ ### Changed
10
+
11
+ `ClientException` now maps `HTTP 422` client responses to `HTTP 422` server responses (was `HTTP 503` before).
12
+
13
+ ## [4.1.2] - 2021-12-02
14
+
15
+ ### Changed
16
+
17
+ Expose the `Location`, `Access-Control-Allow-Origin` and `orion-correlation-id-root` headers
18
+
7
19
  ## [4.1.1] - 2021-11-22
8
20
 
9
21
  ### Fixed
@@ -22,4 +22,5 @@ ClientException.statusCodeMap = {
22
22
  401: 401,
23
23
  403: 403,
24
24
  404: 422,
25
+ 422: 422,
25
26
  };
@@ -13,6 +13,7 @@ export interface ApiRequest<Body = any, Query = any> {
13
13
  headers: Record<string, string>;
14
14
  pathParameters: Record<string, string>;
15
15
  queryStringParameters?: Query;
16
+ multiValueQueryStringParameters?: any;
16
17
  }
17
18
  export interface PostRequest<Body = any, Query = any> extends ApiRequest<Body, Query> {
18
19
  body: Body;
@@ -6,7 +6,11 @@ class ApiResponse {
6
6
  constructor(statusCode, body, headers) {
7
7
  this.body = body;
8
8
  this.statusCode = statusCode;
9
- this.headers = { 'Content-Type': 'application/hal+json', ...headers };
9
+ this.headers = {
10
+ 'Access-Control-Expose-Headers': 'Location, Access-Control-Allow-Origin, orion-correlation-id-root',
11
+ 'Content-Type': 'application/hal+json',
12
+ ...headers,
13
+ };
10
14
  }
11
15
  withCorrelationId(correlationId) {
12
16
  this.headers[shared_1.orionCorrelationIdRoot] = correlationId;
@@ -54,6 +54,7 @@ class OpenApiWrapper {
54
54
  method: request.httpMethod,
55
55
  path: request.path,
56
56
  user: this.userPrincipal,
57
+ query: request.multiValueQueryStringParameters,
57
58
  });
58
59
  return request;
59
60
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambda-essentials-ts",
3
- "version": "4.1.1",
3
+ "version": "4.1.5",
4
4
  "description": "A selection of the finest modules supporting authorization, API routing, error handling, logging and sending HTTP requests.",
5
5
  "main": "lib/index.js",
6
6
  "private": false,