Breaking changes
- The `HTTPResponseError` class is no longer exported, and `HTTPResponseError.isHTTPResponseError(error)` is replaced by `isHTTPResponseError(error)`.
- Most error class constructor signatures have changed. Please see the types for more details. Error class constructors no longer reference the `got` library.
New features
- The `got` library is replaced with `node-fetch`.
- You may now pass a `fetch` function when creating a `Client` instance. The client will use this fetch function for all HTTP requests.
- Error types have been reworked for improved type safety. No more stringly-typed errors! Inside a `isNotionClientError` type guard, both `error.name` and `error.code` are enumerated unions that can be used to further refine the type of `error`.
- `error.code` is guaranteed to be in your library's `APIErrorCode` or `ClientErrorCode` enum types, even if the API returns a new, unknown `code` in a response. In this case, `error.code` will be `ClientErrorCode.ResponseError`.
- Types have been updated according to the [API changes](https://developers.notion.com/changelog/database-objects-now-return-parent).