Skip to content

Releases: BitGo/api-ts

@api-ts/[email protected]

18 Jul 18:55
c75b51b
Compare
Choose a tag to compare

@api-ts/typed-express-router 1.1.14 (2025-07-18)

Dependencies

  • @api-ts/superagent-wrapper: upgraded to 1.3.4

@api-ts/[email protected]

18 Jul 18:55
c75b51b
Compare
Choose a tag to compare

@api-ts/superagent-wrapper 1.3.4 (2025-07-18)

Bug Fixes

  • use decoded body (or text) in response (f626d91)

@api-ts/[email protected]

18 Jul 18:55
c75b51b
Compare
Choose a tag to compare

@api-ts/express-wrapper 1.0.34 (2025-07-18)

Dependencies

  • @api-ts/typed-express-router: upgraded to 1.1.14
  • @api-ts/superagent-wrapper: upgraded to 1.3.4

@api-ts/[email protected]

18 Jul 17:22
872e93c
Compare
Choose a tag to compare
Pre-release

@api-ts/typed-express-router 2.0.0-beta.1 (2025-07-18)

Features

  • opentelemetry: create otel instrumentation for typed-express-router (296a92e)

BREAKING CHANGES

  • opentelemetry: To enforce stricter checks for http response sending types, there is now a check that the response is in a JSON format. This will make it more difficult to send a response or accidentally send a malformed response.
    • wrapRouter modified to create decode and encode spans if @opentelemetry/api is installed
      • if @opentelemetry/api is not installed, spans are not created
    • onDecodeError option removed. Please use decodeErrorFormatter and getDecodeErrorStatusCode
      • decodeErrorFormatter takes in an array of ValidationErrors and a WrappedRequest, returning a Json object.
      • getDecodeErrorStatusCode takes in an array of ValidationErrors and a WrappedRequest, returning a number.
    • onEncodeError option removed. Please use encodeErrorFormatter and getEncodeErrorStatusCode
      • encodeErrorFormatter takes in an error and a WrappedRequest, returning a Json object.
      • getEncodeErrorStatusCode takes in an error and a WrappedRequest, returning a number.
    • typed-express-router now handles the sending of the http response when there is a decode or encode error

Consequently, to use createRouter or wrapRouter, instead of using onDecodeError and onEncodeError:

  const router = createRouter(spec, {
    onDecodeError: (errs, req, res) => {
        const validationErrorMessage = /* use errs to craft an error message */;
        res.status(400).json({ error: validationErrorMessage }).end();
    },
    onEncodeError: (err, req, res) => {
        const encodeErrorMessage =  /* use err to craft an error message */;
        res.status(500).json({ error: encodeErrorMessage }).end();
    },
  });

We now use decodeErrorFormatter, getDecodeErrorStatusCode, encodeErrorFormatter, and getEncodeErrorStatusCode:

  const router = createRouter(spec, {
    decodeErrorFormatter: (errs, req) => {
        const validationErrorMessage = /* use errs to craft an error message */;
        return ({error: validationErrorMessage});
    },
    getDecodeErrorStatusCode: (errs, req) => {
        return 400;
    },
    encodeErrorFormatter: (err, req) => {
        const encodeErrorMessage =  /* use err to craft an error message */;
        return ({error: encodeErrorMessage});
    },
    getEncodeErrorStatusCode: (err, req) => {
        return 500;
    },
  });

@api-ts/[email protected]

18 Jul 17:22
872e93c
Compare
Choose a tag to compare
Pre-release

@api-ts/express-wrapper 2.0.0-beta.1 (2025-07-18)

Features

  • opentelemetry: create otel instrumentation for typed-express-router (296a92e)

BREAKING CHANGES

  • opentelemetry: onDecodeError and onEncodeError have been removed. Please use decodeErrorFormatter, getDecodeErrorStatusCode, encodeErrorFormatter, and getEncodeErrorStatusCode

Dependencies

  • @api-ts/typed-express-router: upgraded to 2.0.0-beta.1

@api-ts/[email protected]

05 Mar 19:31
3359aeb
Compare
Choose a tag to compare

@api-ts/openapi-generator 5.7.0 (2025-03-05)

Features

  • Output boolean query parameters as booleans instead of string enums (#1017)

    This feature update changes how boolean parameters are represented in the OpenAPI specification generated by api-ts. Previously, boolean values in query parameters were represented as string enums with values "true" and "false". With this change, they are now represented as native OpenAPI boolean types.

    Concretely, this httpRoute:

    import * as t from 'io-ts';
    import * as h from '@api-ts/io-ts-http';
    import { BooleanFromString } from 'io-ts-types';
    
    export const route = h.httpRoute({
      path: '/resources',
      method: 'GET',
      request: h.httpRequest({
        query: {
          // Boolean parameters
          isActive: BooleanFromString,
          includeDeleted: BooleanFromString,
          // Mixed boolean/number union
          filterOption: t.union([BooleanFromString, t.number])
        }
      }),
      response: {
        200: t.type({
          results: t.array(t.string),
          pagination: t.type({
            hasMore: t.boolean
          })
        })
      }
    });

    now generates the following OpenAPI specification:

    {
      "openapi": "3.0.3",
      "paths": {
        "/resources": {
          "get": {
            "parameters": [
              {
                "name": "isActive",
                "in": "query",
                "required": true,
                "schema": {
    -              "type": "string",
    -              "enum": ["true", "false"]
    +              "type": "boolean"
                }
              },
              {
                "name": "includeDeleted",
                "in": "query",
                "required": true,
                "schema": {
    -              "type": "string",
    -              "enum": ["true", "false"]
    +              "type": "boolean"
                }
              },
              {
                "name": "filterOption",
                "in": "query",
                "required": true,
                "schema": {
                  "oneOf": [
    -                { "type": "string", "enum": ["true", "false"] },
    +                { "type": "boolean" },
                    { "type": "number" }
                  ]
                }
              }
            ],
            "responses": {
              "200": {
                "description": "OK",
                "content": {
                  "application/json": {
                    "schema": {
                      "type": "object",
                      "properties": {
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "hasMore": {
                              "type": "boolean"
                            }
                          },
                          "required": ["hasMore"]
                        }
                      },
                      "required": ["results", "pagination"]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }

    This update aligns with OpenAPI best practices by using native types rather than string-based enumerations for boolean query parameters in API specifications.

@api-ts/[email protected]

10 Feb 23:40
18d8b41
Compare
Choose a tag to compare

@api-ts/openapi-generator 5.6.1 (2025-02-10)

Bug Fixes

  • implement lazy file processing with improved dependency handling (dda6fcd)

@api-ts/[email protected]

07 Feb 15:49
047d2f2
Compare
Choose a tag to compare

@api-ts/openapi-generator 5.6.0 (2025-02-07)

This release contains no differences to functionality or code.

Added tests

  • Add test case for private headers with x-internal tag (99e5ee6)

@api-ts/[email protected]

28 Jan 21:58
486df33
Compare
Choose a tag to compare

@api-ts/openapi-generator 5.5.2 (2025-01-28)

Bug Fixes

  • deduplicate header parameters (4d1de4b)

@api-ts/[email protected]

17 Jan 17:33
45f5fcb
Compare
Choose a tag to compare

@api-ts/openapi-generator 5.5.1 (2025-01-17)

Bug Fixes