typed-openapi 0.6.0 → 0.7.0
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-UHCVCAGY.js → chunk-T4QUCLXL.js} +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/generator.ts +3 -1
|
@@ -487,7 +487,7 @@ export class ApiClient {
|
|
|
487
487
|
path: Path,
|
|
488
488
|
...params: MaybeOptionalArg<${match(ctx.runtime).with("zod", "yup", () => infer(`TEndpoint["parameters"]`)).with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["parameters"]`).otherwise(() => `TEndpoint["parameters"]`)}>
|
|
489
489
|
): Promise<${match(ctx.runtime).with("zod", "yup", () => infer(`TEndpoint["response"]`)).with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["response"]`).otherwise(() => `TEndpoint["response"]`)}> {
|
|
490
|
-
return this.fetcher("${method}", this.baseUrl + path, params[0])${match(ctx.runtime).with("zod", () => `as Promise<${infer(`TEndpoint["response"]`)}>`).otherwise(() =>
|
|
490
|
+
return this.fetcher("${method}", this.baseUrl + path, params[0])${match(ctx.runtime).with("zod", "yup", () => `as Promise<${infer(`TEndpoint["response"]`)}>`).with("arktype", "io-ts", "typebox", "valibot", () => `as Promise<${infer(`TEndpoint`) + `["response"]`}>`).otherwise(() => `as Promise<TEndpoint["response"]>`)};
|
|
491
491
|
}
|
|
492
492
|
// </ApiClient.${method}>
|
|
493
493
|
` : "";
|
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.
|
|
34
|
+
var version = "0.7.0";
|
|
35
35
|
|
|
36
36
|
// src/generator.ts
|
|
37
37
|
var import_server2 = require("pastable/server");
|
|
@@ -522,7 +522,7 @@ export class ApiClient {
|
|
|
522
522
|
path: Path,
|
|
523
523
|
...params: MaybeOptionalArg<${(0, import_ts_pattern.match)(ctx.runtime).with("zod", "yup", () => infer(`TEndpoint["parameters"]`)).with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["parameters"]`).otherwise(() => `TEndpoint["parameters"]`)}>
|
|
524
524
|
): Promise<${(0, import_ts_pattern.match)(ctx.runtime).with("zod", "yup", () => infer(`TEndpoint["response"]`)).with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["response"]`).otherwise(() => `TEndpoint["response"]`)}> {
|
|
525
|
-
return this.fetcher("${method}", this.baseUrl + path, params[0])${(0, import_ts_pattern.match)(ctx.runtime).with("zod", () => `as Promise<${infer(`TEndpoint["response"]`)}>`).otherwise(() =>
|
|
525
|
+
return this.fetcher("${method}", this.baseUrl + path, params[0])${(0, import_ts_pattern.match)(ctx.runtime).with("zod", "yup", () => `as Promise<${infer(`TEndpoint["response"]`)}>`).with("arktype", "io-ts", "typebox", "valibot", () => `as Promise<${infer(`TEndpoint`) + `["response"]`}>`).otherwise(() => `as Promise<TEndpoint["response"]>`)};
|
|
526
526
|
}
|
|
527
527
|
// </ApiClient.${method}>
|
|
528
528
|
` : "";
|
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-T4QUCLXL.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.
|
|
16
|
+
var version = "0.7.0";
|
|
17
17
|
|
|
18
18
|
// src/cli.ts
|
|
19
19
|
var cwd = process.cwd();
|
package/dist/index.cjs
CHANGED
|
@@ -530,7 +530,7 @@ export class ApiClient {
|
|
|
530
530
|
path: Path,
|
|
531
531
|
...params: MaybeOptionalArg<${(0, import_ts_pattern.match)(ctx.runtime).with("zod", "yup", () => infer(`TEndpoint["parameters"]`)).with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["parameters"]`).otherwise(() => `TEndpoint["parameters"]`)}>
|
|
532
532
|
): Promise<${(0, import_ts_pattern.match)(ctx.runtime).with("zod", "yup", () => infer(`TEndpoint["response"]`)).with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["response"]`).otherwise(() => `TEndpoint["response"]`)}> {
|
|
533
|
-
return this.fetcher("${method}", this.baseUrl + path, params[0])${(0, import_ts_pattern.match)(ctx.runtime).with("zod", () => `as Promise<${infer(`TEndpoint["response"]`)}>`).otherwise(() =>
|
|
533
|
+
return this.fetcher("${method}", this.baseUrl + path, params[0])${(0, import_ts_pattern.match)(ctx.runtime).with("zod", "yup", () => `as Promise<${infer(`TEndpoint["response"]`)}>`).with("arktype", "io-ts", "typebox", "valibot", () => `as Promise<${infer(`TEndpoint`) + `["response"]`}>`).otherwise(() => `as Promise<TEndpoint["response"]>`)};
|
|
534
534
|
}
|
|
535
535
|
// </ApiClient.${method}>
|
|
536
536
|
` : "";
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
package/src/generator.ts
CHANGED
|
@@ -294,7 +294,9 @@ export class ApiClient {
|
|
|
294
294
|
.with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["response"]`)
|
|
295
295
|
.otherwise(() => `TEndpoint["response"]`)}> {
|
|
296
296
|
return this.fetcher("${method}", this.baseUrl + path, params[0])${match(ctx.runtime)
|
|
297
|
-
|
|
297
|
+
.with("zod", "yup", () => `as Promise<${infer(`TEndpoint["response"]`)}>`)
|
|
298
|
+
.with("arktype", "io-ts", "typebox", "valibot", () => `as Promise<${infer(`TEndpoint`) + `["response"]`}>`)
|
|
299
|
+
.otherwise(() => `as Promise<TEndpoint["response"]>`)};
|
|
298
300
|
}
|
|
299
301
|
// </ApiClient.${method}>
|
|
300
302
|
`
|