typed-openapi 0.1.4 → 0.1.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/dist/{chunk-TUNDL3P7.js → chunk-RMN2CYTB.js} +9 -4
- package/dist/cli.cjs +10 -5
- package/dist/cli.js +2 -2
- package/dist/index.cjs +9 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/map-openapi-endpoints.ts +12 -4
- package/dist/chunk-E7HJBSR2.js +0 -815
- package/dist/chunk-M3WPXWOV.js +0 -821
|
@@ -727,16 +727,21 @@ var mapOpenApiEndpoints = (doc) => {
|
|
|
727
727
|
(acc, paramOrRef) => {
|
|
728
728
|
const param = refs.unwrap(paramOrRef);
|
|
729
729
|
const schema = openApiSchemaToTs({ schema: refs.unwrap(param.schema ?? {}), ctx });
|
|
730
|
-
lists.query.push(param);
|
|
731
730
|
if (param.required)
|
|
732
731
|
endpoint.meta.areParametersRequired = true;
|
|
733
732
|
endpoint.meta.hasParameters = true;
|
|
734
|
-
if (param.in === "query")
|
|
733
|
+
if (param.in === "query") {
|
|
734
|
+
lists.query.push(param);
|
|
735
735
|
acc.query[param.name] = schema;
|
|
736
|
-
|
|
736
|
+
}
|
|
737
|
+
if (param.in === "path") {
|
|
738
|
+
lists.path.push(param);
|
|
737
739
|
acc.path[param.name] = schema;
|
|
738
|
-
|
|
740
|
+
}
|
|
741
|
+
if (param.in === "header") {
|
|
742
|
+
lists.header.push(param);
|
|
739
743
|
acc.header[param.name] = schema;
|
|
744
|
+
}
|
|
740
745
|
return acc;
|
|
741
746
|
},
|
|
742
747
|
{ query: {}, path: {}, header: {} }
|
package/dist/cli.cjs
CHANGED
|
@@ -31,7 +31,7 @@ var import_promises = require("fs/promises");
|
|
|
31
31
|
|
|
32
32
|
// package.json
|
|
33
33
|
var name = "typed-openapi";
|
|
34
|
-
var version = "0.1.
|
|
34
|
+
var version = "0.1.5";
|
|
35
35
|
|
|
36
36
|
// src/generator.ts
|
|
37
37
|
var import_server2 = require("pastable/server");
|
|
@@ -764,16 +764,21 @@ var mapOpenApiEndpoints = (doc) => {
|
|
|
764
764
|
(acc, paramOrRef) => {
|
|
765
765
|
const param = refs.unwrap(paramOrRef);
|
|
766
766
|
const schema = openApiSchemaToTs({ schema: refs.unwrap(param.schema ?? {}), ctx });
|
|
767
|
-
lists.query.push(param);
|
|
768
767
|
if (param.required)
|
|
769
768
|
endpoint.meta.areParametersRequired = true;
|
|
770
769
|
endpoint.meta.hasParameters = true;
|
|
771
|
-
if (param.in === "query")
|
|
770
|
+
if (param.in === "query") {
|
|
771
|
+
lists.query.push(param);
|
|
772
772
|
acc.query[param.name] = schema;
|
|
773
|
-
|
|
773
|
+
}
|
|
774
|
+
if (param.in === "path") {
|
|
775
|
+
lists.path.push(param);
|
|
774
776
|
acc.path[param.name] = schema;
|
|
775
|
-
|
|
777
|
+
}
|
|
778
|
+
if (param.in === "header") {
|
|
779
|
+
lists.header.push(param);
|
|
776
780
|
acc.header[param.name] = schema;
|
|
781
|
+
}
|
|
777
782
|
return acc;
|
|
778
783
|
},
|
|
779
784
|
{ query: {}, path: {}, header: {} }
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
allowedRuntimes,
|
|
3
3
|
generateFile,
|
|
4
4
|
mapOpenApiEndpoints
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RMN2CYTB.js";
|
|
6
6
|
|
|
7
7
|
// src/cli.ts
|
|
8
8
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
@@ -13,7 +13,7 @@ import { writeFile } from "fs/promises";
|
|
|
13
13
|
|
|
14
14
|
// package.json
|
|
15
15
|
var name = "typed-openapi";
|
|
16
|
-
var version = "0.1.
|
|
16
|
+
var version = "0.1.5";
|
|
17
17
|
|
|
18
18
|
// src/cli.ts
|
|
19
19
|
var cwd = process.cwd();
|
package/dist/index.cjs
CHANGED
|
@@ -772,16 +772,21 @@ var mapOpenApiEndpoints = (doc) => {
|
|
|
772
772
|
(acc, paramOrRef) => {
|
|
773
773
|
const param = refs.unwrap(paramOrRef);
|
|
774
774
|
const schema = openApiSchemaToTs({ schema: refs.unwrap(param.schema ?? {}), ctx });
|
|
775
|
-
lists.query.push(param);
|
|
776
775
|
if (param.required)
|
|
777
776
|
endpoint.meta.areParametersRequired = true;
|
|
778
777
|
endpoint.meta.hasParameters = true;
|
|
779
|
-
if (param.in === "query")
|
|
778
|
+
if (param.in === "query") {
|
|
779
|
+
lists.query.push(param);
|
|
780
780
|
acc.query[param.name] = schema;
|
|
781
|
-
|
|
781
|
+
}
|
|
782
|
+
if (param.in === "path") {
|
|
783
|
+
lists.path.push(param);
|
|
782
784
|
acc.path[param.name] = schema;
|
|
783
|
-
|
|
785
|
+
}
|
|
786
|
+
if (param.in === "header") {
|
|
787
|
+
lists.header.push(param);
|
|
784
788
|
acc.header[param.name] = schema;
|
|
789
|
+
}
|
|
785
790
|
return acc;
|
|
786
791
|
},
|
|
787
792
|
{ query: {}, path: {}, header: {} }
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -39,14 +39,22 @@ export const mapOpenApiEndpoints = (doc: OpenAPIObject) => {
|
|
|
39
39
|
(acc, paramOrRef) => {
|
|
40
40
|
const param = refs.unwrap(paramOrRef);
|
|
41
41
|
const schema = openApiSchemaToTs({ schema: refs.unwrap(param.schema ?? {}), ctx });
|
|
42
|
-
lists.query.push(param);
|
|
43
42
|
|
|
44
43
|
if (param.required) endpoint.meta.areParametersRequired = true;
|
|
45
44
|
endpoint.meta.hasParameters = true;
|
|
46
45
|
|
|
47
|
-
if (param.in === "query")
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
if (param.in === "query") {
|
|
47
|
+
lists.query.push(param);
|
|
48
|
+
acc.query[param.name] = schema;
|
|
49
|
+
}
|
|
50
|
+
if (param.in === "path") {
|
|
51
|
+
lists.path.push(param);
|
|
52
|
+
acc.path[param.name] = schema;
|
|
53
|
+
}
|
|
54
|
+
if (param.in === "header") {
|
|
55
|
+
lists.header.push(param);
|
|
56
|
+
acc.header[param.name] = schema;
|
|
57
|
+
}
|
|
50
58
|
|
|
51
59
|
return acc;
|
|
52
60
|
},
|