Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor JS lib to use our new codegen #1700

Merged
merged 14 commits into from
Feb 20, 2025
Merged

Refactor JS lib to use our new codegen #1700

merged 14 commits into from
Feb 20, 2025

Conversation

svix-jplatte
Copy link
Member

@svix-jplatte svix-jplatte commented Feb 5, 2025

TODO:

  • Export all models from src/index.ts
  • Decide what we want to do about undefined fields in the response body
    Currently if the server omits a field from the response body, the json deserialization wont fail. And anyone using the js/ts lib will just get undefined if they try to access that field

Breaking changes

  • endpoint.oauthUpdate and endpoint.oauthDelete are no longer generated
  • Deprecated endpoint MessageAttempt.list is removed
  • Generated exceptions and models are no longer exported from webhook.ts

New resources

I figured since they are publicly documented in api.svix.com/docs we should add them here.

  • Environment
  • Health

ref:

@svix-jplatte svix-jplatte force-pushed the jplatte/js-new-models branch from 64a8903 to f07beda Compare February 5, 2025 12:32
@svix-mman
Copy link
Contributor

Open source review

Dev dependency

Replace

  • "@typescript-eslint/eslint-plugin": "^4.15.2"
  • "@typescript-eslint/parser": "^4.15.2"
  • "@typescript-eslint/typescript-estree": "^4.15.2"

With "typescript-eslint": "^8.24.0"

@svix-mman svix-mman force-pushed the jplatte/js-new-models branch from 9f2bfa4 to eb0a634 Compare February 14, 2025 20:09
@svix-mman
Copy link
Contributor

Open source review

Dev dependency

https://github.com/httptoolkit/mockttp

  • Apache-2.0 license

Used to test that out going requests are de/serialized correctly

@svix-mman svix-mman force-pushed the jplatte/js-new-models branch 2 times, most recently from 3496cc4 to 81e8168 Compare February 17, 2025 16:45
@svix-mman svix-mman changed the title js: [WIP] new model codegen Refactor JS lib to use our new codegen Feb 17, 2025
@svix-mman svix-mman force-pushed the jplatte/js-new-models branch from 650f929 to 7eda6b3 Compare February 19, 2025 15:44
@svix-mman svix-mman force-pushed the jplatte/js-new-models branch 2 times, most recently from 9fac4e3 to f48c73b Compare February 19, 2025 17:58
@svix-mman svix-mman force-pushed the jplatte/js-new-models branch from 28590d2 to 6930222 Compare February 19, 2025 19:01
@svix-mman svix-mman marked this pull request as ready for review February 19, 2025 19:02
@svix-mman svix-mman requested a review from a team as a code owner February 19, 2025 19:02
@svix-mman svix-mman marked this pull request as draft February 19, 2025 19:02
@svix-mman svix-mman marked this pull request as ready for review February 19, 2025 20:01
For some reason Date was hard-coded to always be `Date | null`
And since I have tests for Date de/serialization, I am confident I can remove this
@svix-lucho svix-lucho merged commit 7f9f2cb into main Feb 20, 2025
8 checks passed
@svix-lucho svix-lucho deleted the jplatte/js-new-models branch February 20, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants