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

Update TypeScript to 5.6.3, bump version to v1.9.0 #46

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ This changelog documents the changes between release versions.
## [Unreleased]
Changes to be included in the next upcoming release

## [1.9.0] - 2024-10-24

### Added
- Exported the `@hasura/ndc-lambda-sdk/connector` module to make it easier to build entirely new connectors that extend the existing functionality provided by the SDK ([#45](https://github.com/hasura/ndc-nodejs-lambda/pull/45))

### Changed
* Updated to use [TypeScript v5.6.3](https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/) ([#46](https://github.com/hasura/ndc-nodejs-lambda/pull/46))

## [1.8.0] - 2024-09-20
- Updated the NDC TypeScript SDK to v7.0.0 ([#44](https://github.com/hasura/ndc-nodejs-lambda/pull/44))
- Added support for exporting OpenTelemetry traces and metrics over GRPC. A new environment variable `OTEL_EXPORTER_OTLP_PROTOCOL` lets you switch between `http/protobuf` and `grpc`.
Expand Down
12 changes: 6 additions & 6 deletions ndc-lambda-sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ndc-lambda-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hasura/ndc-lambda-sdk",
"version": "1.8.0",
"version": "1.9.0",
"description": "SDK that can automatically expose TypeScript functions as Hasura NDC functions/procedures",
"author": "Hasura",
"license": "Apache-2.0",
Expand Down Expand Up @@ -39,7 +39,7 @@
"p-limit": "^3.1.0",
"ts-api-utils": "^1.3.0",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
"typescript": "^5.6.3"
},
"devDependencies": {
"@types/chai": "^4.3.11",
Expand Down
4 changes: 2 additions & 2 deletions ndc-lambda-sdk/src/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function reshapeResultUsingFieldSelection(value: unknown, type: schema.Ty
switch (type.type) {
case "array":
if (!isArray(value))
throw new sdk.InternalServerError(`Expected an array, but received '${value === null ? "null" : null ?? typeof value}'`);
throw new sdk.InternalServerError(`Expected an array, but received '${value === null ? "null" : typeof value}'`);

const elementFieldSelection = (() => {
switch (fieldSelection.type) {
Expand Down Expand Up @@ -314,7 +314,7 @@ export function reshapeResultUsingFieldSelection(value: unknown, type: schema.Ty
if (objectType === undefined)
throw new sdk.InternalServerError(`Unable to find object type definition '${type.name}'`)
if (value === null || Array.isArray(value) || typeof value !== "object")
throw new sdk.InternalServerError(`Expected an object, but received '${value === null ? "null" : null ?? Array.isArray(value) ? "array" : null ?? typeof value}'`);
throw new sdk.InternalServerError(`Expected an object, but received '${value === null ? "null" : Array.isArray(value) ? "array" : typeof value}'`);

const selectedFields: Record<string, sdk.Field> = (() => {
switch (fieldSelection.type) {
Expand Down