@aws-lambda-powertools/validation 2.26.1 → 2.28.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This utility provides JSON Schema validation for events and responses, including JMESPath support to unwrap events before validation.
4
4
 
5
- Powertools for AWS Lambda (TypeScript) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda/typescript/latest/#features). You can use the library in both TypeScript and JavaScript code bases.
5
+ Powertools for AWS Lambda (TypeScript) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.aws.amazon.com/powertools/typescript/latest/#features). You can use the library in both TypeScript and JavaScript code bases.
6
6
 
7
7
  To get started, install the package by running:
8
8
 
@@ -225,7 +225,7 @@ const validatedData = validate({
225
225
  });
226
226
  ```
227
227
 
228
- For more information on how to use the `validate` function, please refer to the [documentation](https://docs.powertools.aws.dev/lambda/typescript/latest/features/validation).
228
+ For more information on how to use the `validate` function, please refer to the [documentation](https://docs.aws.amazon.com/powertools/typescript/latest/features/validation).
229
229
 
230
230
  ## Contribute
231
231
 
@@ -272,11 +272,11 @@ The following companies, among others, use Powertools:
272
272
 
273
273
  ### Sharing your work
274
274
 
275
- Share what you did with Powertools for AWS Lambda (TypeScript) 💞💞. Blog post, workshops, presentation, sample apps and others. Check out what the community has [already shared](https://docs.powertools.aws.dev/lambda/typescript/latest/we_made_this) about Powertools for AWS Lambda (TypeScript).
275
+ Share what you did with Powertools for AWS Lambda (TypeScript) 💞💞. Blog post, workshops, presentation, sample apps and others. Check out what the community has [already shared](https://docs.aws.amazon.com/powertools/typescript/latest/we_made_this) about Powertools for AWS Lambda (TypeScript).
276
276
 
277
277
  ### Using Lambda Layer
278
278
 
279
- This helps us understand who uses Powertools for AWS Lambda (TypeScript) in a non-intrusive way, and helps us gain future investments for other Powertools for AWS Lambda languages. When [using Layers](https://docs.powertools.aws.dev/lambda/typescript/latest/getting-started/lambda-layers/), you can add Powertools as a dev dependency to not impact the development process.
279
+ This helps us understand who uses Powertools for AWS Lambda (TypeScript) in a non-intrusive way, and helps us gain future investments for other Powertools for AWS Lambda languages. When [using Layers](https://docs.aws.amazon.com/powertools/typescript/latest/getting-started/lambda-layers/), you can add Powertools as a dev dependency to not impact the development process.
280
280
 
281
281
  ## License
282
282
 
@@ -99,7 +99,7 @@ import type { ValidatorOptions } from './types.js';
99
99
  */
100
100
  declare const validator: (options: ValidatorOptions) => {
101
101
  before: MiddlewareFn;
102
- after: (handler: MiddyLikeRequest) => Promise<void>;
102
+ after: (handler: MiddyLikeRequest) => void;
103
103
  };
104
104
  export { validator };
105
105
  //# sourceMappingURL=middleware.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,QAAA,MAAM,SAAS,GAAI,SAAS,gBAAgB;;qBAqBZ,gBAAgB;CAsB/C,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,QAAA,MAAM,SAAS,GAAI,SAAS,gBAAgB;;qBAqBlB,gBAAgB;CAsBzC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -102,7 +102,7 @@ const validate_js_1 = require("./validate.js");
102
102
  * @param options.ajv - Optional Ajv instance to use for validation, if not provided a new instance will be created.
103
103
  */
104
104
  const validator = (options) => {
105
- const before = async (request) => {
105
+ const before = (request) => {
106
106
  if (options.inboundSchema) {
107
107
  const originalEvent = structuredClone(request.event);
108
108
  try {
@@ -122,7 +122,7 @@ const validator = (options) => {
122
122
  }
123
123
  }
124
124
  };
125
- const after = async (handler) => {
125
+ const after = (handler) => {
126
126
  if (options.outboundSchema) {
127
127
  try {
128
128
  handler.response = (0, validate_js_1.validate)({
@@ -99,7 +99,7 @@ import type { ValidatorOptions } from './types.js';
99
99
  */
100
100
  declare const validator: (options: ValidatorOptions) => {
101
101
  before: MiddlewareFn;
102
- after: (handler: MiddyLikeRequest) => Promise<void>;
102
+ after: (handler: MiddyLikeRequest) => void;
103
103
  };
104
104
  export { validator };
105
105
  //# sourceMappingURL=middleware.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,QAAA,MAAM,SAAS,GAAI,SAAS,gBAAgB;;qBAqBZ,gBAAgB;CAsB/C,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,QAAA,MAAM,SAAS,GAAI,SAAS,gBAAgB;;qBAqBlB,gBAAgB;CAsBzC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -99,7 +99,7 @@ import { validate } from './validate.js';
99
99
  * @param options.ajv - Optional Ajv instance to use for validation, if not provided a new instance will be created.
100
100
  */
101
101
  const validator = (options) => {
102
- const before = async (request) => {
102
+ const before = (request) => {
103
103
  if (options.inboundSchema) {
104
104
  const originalEvent = structuredClone(request.event);
105
105
  try {
@@ -119,7 +119,7 @@ const validator = (options) => {
119
119
  }
120
120
  }
121
121
  };
122
- const after = async (handler) => {
122
+ const after = (handler) => {
123
123
  if (options.outboundSchema) {
124
124
  try {
125
125
  handler.response = validate({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-lambda-powertools/validation",
3
- "version": "2.26.1",
3
+ "version": "2.28.0",
4
4
  "description": "An utility to validate events and responses using JSON Schemas",
5
5
  "author": {
6
6
  "name": "Amazon Web Services",
@@ -27,8 +27,8 @@
27
27
  "serverless"
28
28
  ],
29
29
  "dependencies": {
30
- "@aws-lambda-powertools/commons": "2.26.1",
31
- "@aws-lambda-powertools/jmespath": "2.26.1",
30
+ "@aws-lambda-powertools/commons": "2.28.0",
31
+ "@aws-lambda-powertools/jmespath": "2.28.0",
32
32
  "ajv": "^8.17.1"
33
33
  },
34
34
  "main": "./lib/cjs/index.js",