powertools-lambda-typescript icon indicating copy to clipboard operation
powertools-lambda-typescript copied to clipboard

feat(parser): add types for built-in schemas

Open am29d opened this issue 1 year ago • 1 comments

Description of your changes

This PR adds type exports for the built in schemas. I have slightly changed the names by adding Event suffix. This is similar to the data classes used in python and supports the typing of the event object of the handler.

We don't need all the schema object to be reexported as types, because z.infer will catch all the nested structure implicitly.

Related issues, RFCs

Issue number: closes #1837

Checklist

  • [x] My changes meet the tenets criteria
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [ ] I have added tests that prove my change is effective and works
  • [x] The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • [ ] I have documented the migration process
  • [ ] I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

am29d avatar Jan 08 '24 18:01 am29d

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Jan 08 '24 18:01 sonarqubecloud[bot]