openapi-sync 5.0.4 → 5.0.5
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 +42 -25
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +608 -533
- package/dist/index.mjs +532 -457
- package/package.json +94 -94
- /package/dist/{interactive-init-GI3DBKYN.mjs → interactive-init-OITE22SZ.mjs} +0 -0
package/README.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
+
### 🎉 v5.0.5 - Python Support, Auto-Sync & Infinite Queries
|
|
14
|
+
|
|
15
|
+
- 🐍 **Python Type Generation** - Generate Python `dataclass` definitions alongside TypeScript types.
|
|
16
|
+
- 🔄 **Auto-Sync Capability** - Enhanced OpenAPI sync functionality with real-time auto-sync capability.
|
|
17
|
+
- ⚡ **Infinite Queries & Headers** - Added support for headers configuration and infinite query hooks in API clients.
|
|
18
|
+
|
|
13
19
|
### 🎉 v5.0.0 - Enhanced Client Generation & Developer Experience
|
|
14
20
|
|
|
15
21
|
- 🚀 **Fully-Typed API Client Generation** - Generate type-safe clients for Fetch, Axios, React Query, SWR, and RTK Query with comprehensive inline documentation
|
|
@@ -72,11 +78,11 @@ The wizard will guide you through:
|
|
|
72
78
|
|
|
73
79
|
```json
|
|
74
80
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
"refetchInterval": 5000,
|
|
82
|
+
"folder": "./src/api",
|
|
83
|
+
"api": {
|
|
84
|
+
"petstore": "https://petstore3.swagger.io/api/v3/openapi.json"
|
|
85
|
+
}
|
|
80
86
|
}
|
|
81
87
|
```
|
|
82
88
|
|
|
@@ -240,11 +246,11 @@ Supports multiple configuration formats: `openapi.sync.json`, `openapi.sync.ts`,
|
|
|
240
246
|
|
|
241
247
|
```json
|
|
242
248
|
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
249
|
+
"refetchInterval": 5000,
|
|
250
|
+
"folder": "./src/api",
|
|
251
|
+
"api": {
|
|
252
|
+
"petstore": "https://petstore3.swagger.io/api/v3/openapi.json"
|
|
253
|
+
}
|
|
248
254
|
}
|
|
249
255
|
```
|
|
250
256
|
|
|
@@ -254,18 +260,18 @@ Supports multiple configuration formats: `openapi.sync.json`, `openapi.sync.ts`,
|
|
|
254
260
|
import { IConfig } from "openapi-sync/types";
|
|
255
261
|
|
|
256
262
|
const config: IConfig = {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
refetchInterval: 10000,
|
|
264
|
+
folder: "./src/api",
|
|
265
|
+
api: {
|
|
266
|
+
"main-api": "https://api.example.com/openapi.json",
|
|
267
|
+
},
|
|
268
|
+
folderSplit: { byTags: true },
|
|
269
|
+
types: { name: { prefix: "I", useOperationId: true } },
|
|
270
|
+
endpoints: {
|
|
271
|
+
exclude: { tags: ["deprecated"] },
|
|
272
|
+
doc: { showCurl: true },
|
|
273
|
+
},
|
|
274
|
+
validations: { library: "zod" },
|
|
269
275
|
};
|
|
270
276
|
|
|
271
277
|
export default config;
|
|
@@ -361,9 +367,9 @@ Alternatively, add an override to your `package.json`:
|
|
|
361
367
|
|
|
362
368
|
```json
|
|
363
369
|
{
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
370
|
+
"overrides": {
|
|
371
|
+
"esbuild": "0.17.19"
|
|
372
|
+
}
|
|
367
373
|
}
|
|
368
374
|
```
|
|
369
375
|
|
|
@@ -379,6 +385,17 @@ ISC License - see [LICENSE](LICENSE) file for details.
|
|
|
379
385
|
|
|
380
386
|
Contributions welcome! Submit pull requests to our [GitHub repository](https://github.com/akintomiwa-fisayo/openapi-sync).
|
|
381
387
|
|
|
388
|
+
### Contributors
|
|
389
|
+
|
|
390
|
+
A special thanks to the following contributors for their valuable work on this project:
|
|
391
|
+
|
|
392
|
+
<a href="https://github.com/akintomiwa-fisayo">
|
|
393
|
+
<img src="https://github.com/akintomiwa-fisayo.png" width="50" height="50" alt="Fisayo Akintomiwa" style="border-radius: 50%;" />
|
|
394
|
+
</a>
|
|
395
|
+
<a href="https://github.com/akintomiwaopemipo">
|
|
396
|
+
<img src="https://github.com/akintomiwaopemipo.png" width="50" height="50" alt="Opemipo Akintomiwa" style="border-radius: 50%;" />
|
|
397
|
+
</a>
|
|
398
|
+
|
|
382
399
|
---
|
|
383
400
|
|
|
384
401
|
## Support / Donate
|
package/dist/index.d.mts
CHANGED
|
@@ -338,6 +338,7 @@ type IConfigClientGeneration = {
|
|
|
338
338
|
* @public
|
|
339
339
|
*/
|
|
340
340
|
type IConfig = {
|
|
341
|
+
language?: "typescript" | "python";
|
|
341
342
|
refetchInterval?: number;
|
|
342
343
|
folder?: string;
|
|
343
344
|
api: Record<string, string>;
|
|
@@ -554,7 +555,7 @@ declare const extractCustomCode: (fileContent: string, markerText?: string) => E
|
|
|
554
555
|
*
|
|
555
556
|
* @public
|
|
556
557
|
*/
|
|
557
|
-
declare const createCustomCodeMarker: (position: "top" | "bottom", markerText?: string, includeInstructions?: boolean) => string;
|
|
558
|
+
declare const createCustomCodeMarker: (position: "top" | "bottom", markerText?: string, includeInstructions?: boolean, commentPrefix?: "//" | "#") => string;
|
|
558
559
|
/**
|
|
559
560
|
* Merge generated content with preserved custom code
|
|
560
561
|
*
|
|
@@ -576,6 +577,7 @@ declare const mergeCustomCode: (generatedContent: string, existingFileContent: s
|
|
|
576
577
|
position?: "top" | "bottom" | "both";
|
|
577
578
|
markerText?: string;
|
|
578
579
|
includeInstructions?: boolean;
|
|
580
|
+
commentPrefix?: "//" | "#";
|
|
579
581
|
}) => string;
|
|
580
582
|
|
|
581
583
|
declare const variableName: RegExp;
|
package/dist/index.d.ts
CHANGED
|
@@ -338,6 +338,7 @@ type IConfigClientGeneration = {
|
|
|
338
338
|
* @public
|
|
339
339
|
*/
|
|
340
340
|
type IConfig = {
|
|
341
|
+
language?: "typescript" | "python";
|
|
341
342
|
refetchInterval?: number;
|
|
342
343
|
folder?: string;
|
|
343
344
|
api: Record<string, string>;
|
|
@@ -554,7 +555,7 @@ declare const extractCustomCode: (fileContent: string, markerText?: string) => E
|
|
|
554
555
|
*
|
|
555
556
|
* @public
|
|
556
557
|
*/
|
|
557
|
-
declare const createCustomCodeMarker: (position: "top" | "bottom", markerText?: string, includeInstructions?: boolean) => string;
|
|
558
|
+
declare const createCustomCodeMarker: (position: "top" | "bottom", markerText?: string, includeInstructions?: boolean, commentPrefix?: "//" | "#") => string;
|
|
558
559
|
/**
|
|
559
560
|
* Merge generated content with preserved custom code
|
|
560
561
|
*
|
|
@@ -576,6 +577,7 @@ declare const mergeCustomCode: (generatedContent: string, existingFileContent: s
|
|
|
576
577
|
position?: "top" | "bottom" | "both";
|
|
577
578
|
markerText?: string;
|
|
578
579
|
includeInstructions?: boolean;
|
|
580
|
+
commentPrefix?: "//" | "#";
|
|
579
581
|
}) => string;
|
|
580
582
|
|
|
581
583
|
declare const variableName: RegExp;
|