Skip to content

Releases: unique01082/api2ts

v0.2.0

Choose a tag to compare

@unique01082 unique01082 released this 16 Aug 08:00
2a9cc6b

Highlights

  • Replace the README with complete single-page documentation covering setup, generated output, all configuration options, request adapters, hooks, templates, mocks, diff mode, CLI and programmatic APIs, troubleshooting, and release verification.
  • Add safe interface declarations for compatible object schemas while retaining type aliases for complex schemas.
  • Add configurable API-prefix deduplication, opt-in object-valued mock output, and opt-in application/json Blob parts for multipart objects.

Fixes

  • Omit the authorization header when no credential is configured.
  • Generate valid identifiers for numeric and reserved controller names.
  • Fall back safely when OpenAPI request or response schemas are incomplete.

Compatibility

  • Existing 0.1.x configuration remains supported. New output modes are opt-in, and complex type aliases preserve their previous representation.

Verification

  • Full regression suite and TypeScript build passed on the release commit.
  • Configuration-file CLI smoke test passed.
  • npm pack produced 27 expected files.
  • Clean tarball TypeScript consumer check passed with skipLibCheck disabled.
  • Published npm integrity and SHA-1 match the verified local tarball.

Full Changelog: v0.1.2...v0.2.0

v0.1.2

Choose a tag to compare

@unique01082 unique01082 released this 16 Aug 06:18
8a04dde

Fixes

  • Generate valid TypeScript index bindings when controller tags such as Import or Export become reserved words after camel-casing.
  • Preserve existing controller filenames such as import.ts and export.ts for consumer compatibility.
  • Declare tslib as a runtime dependency so clean tarball consumers can load the package.

Verification

  • Frozen install, full tests, TypeScript build, package dry-run, and clean-consumer tarball smoke passed.
  • The npm registry tarball was downloaded again, its integrity matched the published metadata, and the Import/Export fixture typechecked with zero diagnostics.

Full Changelog: v0.1.1...v0.1.2

v0.1.1

Choose a tag to compare

@unique01082 unique01082 released this 13 Aug 08:49

What's new

  • --diff flag / diffMode config option (#1, thanks @yuko-9k!): before generating, compares the current OpenAPI spec against a saved snapshot and prints a colored report of added/removed/modified APIs (params, body, response types). If any API would be removed, you'll be prompted to confirm before files are regenerated.

Fixes on top of the original contribution

  • diffMode set in the config file is no longer silently overridden when the --diff CLI flag is absent.
  • Snapshot files are now namespaced per schemaPath (.openapi-snapshot.<hash>.json), so projects with multiple configs/schemas no longer overwrite each other's snapshot.
  • The removal-confirmation prompt now safely aborts instead of hanging when there's no interactive terminal (e.g. CI pipelines).

Usage

api2ts --diff

or via config file:

// openapi2ts.config.js
module.exports = {
  schemaPath: './swagger.json',
  // ...
  diffMode: true,
};

Full Changelog: v0.0.10...v0.1.1

v0.0.10

Choose a tag to compare

@unique01082 unique01082 released this 21 Jan 11:45
0.0.10

v0.0.8

Choose a tag to compare

@unique01082 unique01082 released this 05 Dec 10:02

Full Changelog: v0.0.7...v0.0.8

v0.0.6

Choose a tag to compare

@unique01082 unique01082 released this 07 Nov 15:24

v0.0.5...v0.0.6

v0.0.5

Choose a tag to compare

@unique01082 unique01082 released this 07 Nov 08:47
  • feat: change name of bin cmd 30c0a92

v0.0.4...v0.0.5

v0.0.1

Choose a tag to compare

@unique01082 unique01082 released this 07 Nov 08:37
  • chore: reset version to 0.0.0 b8a9f97
  • feat: change package visibility 71ac0fd

v0.0.3...v0.0.1