typed-openapi 0.3.0 → 0.4.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.
@@ -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]);
490
+ return this.fetcher("${method}", this.baseUrl + path, params[0])${match(ctx.runtime).with("zod", () => `as Promise<TEndpoint["response"]> `).otherwise(() => ``)};
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.3.0";
34
+ var version = "0.4.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]);
525
+ return this.fetcher("${method}", this.baseUrl + path, params[0])${(0, import_ts_pattern.match)(ctx.runtime).with("zod", () => `as Promise<TEndpoint["response"]> `).otherwise(() => ``)};
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-6BNKDC6H.js";
5
+ } from "./chunk-YRM7U5OB.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.3.0";
16
+ var version = "0.4.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]);
533
+ return this.fetcher("${method}", this.baseUrl + path, params[0])${(0, import_ts_pattern.match)(ctx.runtime).with("zod", () => `as Promise<TEndpoint["response"]> `).otherwise(() => ``)};
534
534
  }
535
535
  // </ApiClient.${method}>
536
536
  ` : "";
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  openApiSchemaToTs,
8
8
  tsFactory,
9
9
  unwrap
10
- } from "./chunk-6BNKDC6H.js";
10
+ } from "./chunk-YRM7U5OB.js";
11
11
  export {
12
12
  createBoxFactory,
13
13
  createFactory,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typed-openapi",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
7
7
  "bin": {
package/src/generator.ts CHANGED
@@ -293,7 +293,8 @@ export class ApiClient {
293
293
  .with("zod", "yup", () => infer(`TEndpoint["response"]`))
294
294
  .with("arktype", "io-ts", "typebox", "valibot", () => infer(`TEndpoint`) + `["response"]`)
295
295
  .otherwise(() => `TEndpoint["response"]`)}> {
296
- return this.fetcher("${method}", this.baseUrl + path, params[0]);
296
+ return this.fetcher("${method}", this.baseUrl + path, params[0])${match(ctx.runtime)
297
+ .with("zod", () => `as Promise<TEndpoint["response"]> `).otherwise(() => ``)};
297
298
  }
298
299
  // </ApiClient.${method}>
299
300
  `