openapi-sync 2.1.11 → 2.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  [![NPM Version](https://img.shields.io/npm/v/openapi-sync.svg)](https://www.npmjs.com/package/openapi-sync)
2
2
  [![License](https://img.shields.io/npm/l/openapi-sync.svg)](https://github.com/akintomiwa-fisayo/openapi-sync/blob/main/LICENSE)
3
+ [![Tests](https://img.shields.io/badge/tests-passing-brightgreen.svg)](https://github.com/akintomiwa-fisayo/openapi-sync)
3
4
 
4
5
  **OpenAPI Sync** is a powerful developer tool that automates the synchronization of your API documentation with your codebase using OpenAPI (formerly Swagger) specifications. It generates TypeScript types, endpoint definitions, and comprehensive documentation from your OpenAPI schema, ensuring your API documentation stays up-to-date with your code.
5
6
 
@@ -436,15 +437,12 @@ OpenAPI Sync generates a structured output in your specified folder:
436
437
  ```
437
438
  src/api/
438
439
  ├── petstore/
439
- │ ├── endpoints.ts # Endpoint URLs and metadata
440
- │ └── types/
441
- ├── index.ts # Endpoint-specific types
442
- └── shared.ts # Shared component types
443
- └── auth-api/
444
- ├── endpoints.ts
445
- └── types/
446
- ├── index.ts
447
- └── shared.ts
440
+ │ ├── endpoints.ts # Endpoint URLs and metadata
441
+ │ └── types.ts # Endpoint-specific types
442
+ ├── auth-api/
443
+ ├── endpoints.ts # Endpoint URLs and metadata
444
+ └── types.ts # Endpoint-specific types
445
+ └── shared.ts # Shared component types
448
446
  ```
449
447
 
450
448
  ### Folder Splitting Structure
@@ -456,26 +454,21 @@ src/api/
456
454
  ├── petstore/
457
455
  │ ├── admin/ # Endpoints with "admin" tag
458
456
  │ │ ├── endpoints.ts
459
- │ │ └── types/
460
- │ │ ├── index.ts
461
- │ │ └── shared.ts
457
+ │ │ └── types.ts
462
458
  │ ├── public/ # Endpoints with "public" tag
463
459
  │ │ ├── endpoints.ts
464
- │ │ └── types/
465
- │ │ ├── index.ts
466
- │ │ └── shared.ts
460
+ │ │ └── types.ts
467
461
  │ └── user/ # Endpoints with "user" tag
468
462
  │ ├── endpoints.ts
469
- │ └── types/
470
- │ ├── index.ts
471
- └── shared.ts
472
- └── auth-api/
473
- ├── v1/ # Custom folder logic
474
- ├── endpoints.ts
475
- └── types/
476
- └── v2/
477
- ├── endpoints.ts
478
- └── types/
463
+ │ └── types.ts
464
+ │── auth-api/
465
+ ├── v1/ # Custom folder logic
466
+ │ │ ├── endpoints.ts
467
+ │ │ └── types.ts
468
+ └── v2/
469
+ ├── endpoints.ts
470
+ └── types.ts
471
+ └── shared.ts # Shared component types
479
472
  ```
480
473
 
481
474
  ### Generated Endpoints
@@ -1186,9 +1179,21 @@ The tool maintains state in `db.json` to track changes:
1186
1179
 
1187
1180
  ### Previous Versions
1188
1181
 
1182
+ - v2.1.13: Fix dts type fixes and Clean up tsup build config and introduction of unit testing
1183
+ - v2.1.12: Add automatic sync support for function-based config, improved handling of missing OpenAPI urls
1184
+ - v2.1.11: Folder splitting configuration for organized code generation
1185
+ - v2.1.10: OperationId-based naming for types and endpoints, enhanced filtering and tag support
1189
1186
  - v2.1.9: Enhanced JSONStringify function improvements
1190
1187
  - v2.1.8: File extension corrections and path handling
1191
1188
  - v2.1.7: Endpoint tags support in API documentation
1189
+ - v2.1.6: Improved handling of nullable fields in generated types
1190
+ - v2.1.5: Fixed bug with recursive schema references
1191
+ - v2.1.4: Enhanced error messages on invalid config
1192
+ - v2.1.3: Add more informative debugging logs
1193
+ - v2.1.2: Support enum descriptions in output
1194
+ - v2.1.1: Update dependencies, minor TypeScript type fixes
1195
+ - v2.1.0: Initial v2 major release with new sync engine
1196
+ - v2.0.0: Major refactor and breaking changes for v2
1192
1197
 
1193
1198
  ## License
1194
1199
 
package/bin/cli.js CHANGED
@@ -7,6 +7,7 @@ const { hideBin } = require("yargs/helpers");
7
7
 
8
8
  // Setup yargs
9
9
  const argv = yargs(hideBin(process.argv))
10
+ .usage("Usage: $0 [options]")
10
11
  .option("refreshinterval", {
11
12
  alias: "ri",
12
13
  type: "number",