Releases: unique01082/api2ts
Releases · unique01082/api2ts
Release list
v0.2.0
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
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
What's new
--diffflag /diffModeconfig 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
diffModeset in the config file is no longer silently overridden when the--diffCLI 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 --diffor via config file:
// openapi2ts.config.js
module.exports = {
schemaPath: './swagger.json',
// ...
diffMode: true,
};Full Changelog: v0.0.10...v0.1.1
v0.0.10
v0.0.8
v0.0.6
- feat: translate project fbf5844
v0.0.5
- feat: change name of bin cmd 30c0a92