Skip to content

Commit b0602a5

Browse files
committed
Merge branch 'main' of https://github.com/hey-api/openapi-ts into feat/tanstack-set-query-data
2 parents 1217ba8 + 73cc1f2 commit b0602a5

28 files changed

Lines changed: 536 additions & 12 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@hey-api/openapi-ts": minor
3+
---
4+
5+
**BREAKING** **client**: resolve `runtimeConfigPath` relative to the output folder
6+
7+
### Changed `runtimeConfigPath` behavior
8+
9+
This was a known, long-standing issue confusing first-time users. Before, defining client `runtimeConfigPath` value would paste it verbatim to the generated output. This release changes the behavior to resolve relative to the current working directory the same way output path works.
10+

.changeset/mean-paths-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
**plugin(zod)**: fix: fallback `.discriminatedUnion` to `.union` if members contain intersection

.changeset/weak-avocados-tap.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
---
44

55
**BREAKING** **plugin(@hey-api/client-ky)**: respect ky instance defaults
6+
7+
### Changed Ky client behavior
8+
9+
The Ky client was updated to be more intuitive. Some Ky options now need to be passed via the `kyOptions` field and you need to pass `undefined` to unset an option.

docs/openapi-ts/migrating.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ description: Migrating to @hey-api/openapi-ts.
77

88
While we try to avoid breaking changes, sometimes it's unavoidable in order to offer you the latest features. This page lists changes that require updates to your code. If you run into a problem with migration, please [open an issue](https://github.com/hey-api/openapi-ts/issues).
99

10+
## v0.97.0
11+
12+
### Changed `runtimeConfigPath` behavior
13+
14+
This was a known, long-standing issue confusing first-time users. Before, defining client `runtimeConfigPath` value would paste it verbatim to the generated output. This release changes the behavior to resolve relative to the output folder.
15+
16+
### Changed Ky client behavior
17+
18+
The Ky client was updated to be more intuitive. Some Ky options now need to be passed via the `kyOptions` field and you need to pass `undefined` to unset an option.
19+
1020
## v0.96.0
1121

1222
### Removed Node 20 support

examples/openapi-ts-next/openapi-ts.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
plugins: [
1414
{
1515
name: '@hey-api/client-next',
16-
runtimeConfigPath: '../hey-api',
16+
runtimeConfigPath: './src/hey-api',
1717
},
1818
'@hey-api/sdk',
1919
{
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import * as z from 'zod/mini';
4+
5+
export const zUserNotificationDeleteContentBase = z.object({
6+
name: z.string()
7+
});
8+
9+
export const zUserNotificationDeleteContentError = z.intersection(zUserNotificationDeleteContentBase, z.object({
10+
finishedAt: z.iso.datetime(),
11+
error: z.string()
12+
}));
13+
14+
export const zUserNotificationDeleteContentRunning = z.intersection(zUserNotificationDeleteContentBase, z.object({
15+
startedAt: z.iso.datetime()
16+
}));
17+
18+
export const zUserNotificationDeleteContentSuccess = z.intersection(zUserNotificationDeleteContentBase, z.object({
19+
finishedAt: z.iso.datetime()
20+
}));
21+
22+
export const zUserNotificationDeleteContent = z.union([
23+
z.intersection(z.object({
24+
status: z.literal('running')
25+
}), zUserNotificationDeleteContentRunning),
26+
z.intersection(z.object({
27+
status: z.literal('success')
28+
}), zUserNotificationDeleteContentSuccess),
29+
z.intersection(z.object({
30+
status: z.literal('error')
31+
}), zUserNotificationDeleteContentError)
32+
]);
33+
34+
/**
35+
* success
36+
*/
37+
export const zGetNotificationResponse = zUserNotificationDeleteContent;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import { z } from 'zod/v3';
4+
5+
export const zUserNotificationDeleteContentBase = z.object({
6+
name: z.string()
7+
});
8+
9+
export const zUserNotificationDeleteContentError = zUserNotificationDeleteContentBase.and(z.object({
10+
finishedAt: z.string().datetime(),
11+
error: z.string()
12+
}));
13+
14+
export const zUserNotificationDeleteContentRunning = zUserNotificationDeleteContentBase.and(z.object({
15+
startedAt: z.string().datetime()
16+
}));
17+
18+
export const zUserNotificationDeleteContentSuccess = zUserNotificationDeleteContentBase.and(z.object({
19+
finishedAt: z.string().datetime()
20+
}));
21+
22+
export const zUserNotificationDeleteContent = z.union([
23+
z.object({
24+
status: z.literal('running')
25+
}).and(zUserNotificationDeleteContentRunning),
26+
z.object({
27+
status: z.literal('success')
28+
}).and(zUserNotificationDeleteContentSuccess),
29+
z.object({
30+
status: z.literal('error')
31+
}).and(zUserNotificationDeleteContentError)
32+
]);
33+
34+
/**
35+
* success
36+
*/
37+
export const zGetNotificationResponse = zUserNotificationDeleteContent;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import * as z from 'zod';
4+
5+
export const zUserNotificationDeleteContentBase = z.object({
6+
name: z.string()
7+
});
8+
9+
export const zUserNotificationDeleteContentError = zUserNotificationDeleteContentBase.and(z.object({
10+
finishedAt: z.iso.datetime(),
11+
error: z.string()
12+
}));
13+
14+
export const zUserNotificationDeleteContentRunning = zUserNotificationDeleteContentBase.and(z.object({
15+
startedAt: z.iso.datetime()
16+
}));
17+
18+
export const zUserNotificationDeleteContentSuccess = zUserNotificationDeleteContentBase.and(z.object({
19+
finishedAt: z.iso.datetime()
20+
}));
21+
22+
export const zUserNotificationDeleteContent = z.union([
23+
z.object({
24+
status: z.literal('running')
25+
}).and(zUserNotificationDeleteContentRunning),
26+
z.object({
27+
status: z.literal('success')
28+
}).and(zUserNotificationDeleteContentSuccess),
29+
z.object({
30+
status: z.literal('error')
31+
}).and(zUserNotificationDeleteContentError)
32+
]);
33+
34+
/**
35+
* success
36+
*/
37+
export const zGetNotificationResponse = zUserNotificationDeleteContent;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import * as z from 'zod/mini';
4+
5+
export const zUserNotificationDeleteContentBase = z.object({
6+
name: z.string()
7+
});
8+
9+
export const zUserNotificationDeleteContentError = z.intersection(zUserNotificationDeleteContentBase, z.object({
10+
finishedAt: z.iso.datetime(),
11+
error: z.string()
12+
}));
13+
14+
export const zUserNotificationDeleteContentRunning = z.intersection(zUserNotificationDeleteContentBase, z.object({
15+
startedAt: z.iso.datetime()
16+
}));
17+
18+
export const zUserNotificationDeleteContentSuccess = z.intersection(zUserNotificationDeleteContentBase, z.object({
19+
finishedAt: z.iso.datetime()
20+
}));
21+
22+
export const zUserNotificationDeleteContent = z.union([
23+
z.intersection(z.object({
24+
status: z.literal('running')
25+
}), zUserNotificationDeleteContentRunning),
26+
z.intersection(z.object({
27+
status: z.literal('success')
28+
}), zUserNotificationDeleteContentSuccess),
29+
z.intersection(z.object({
30+
status: z.literal('error')
31+
}), zUserNotificationDeleteContentError)
32+
]);
33+
34+
/**
35+
* success
36+
*/
37+
export const zGetNotificationResponse = zUserNotificationDeleteContent;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import { z } from 'zod/v3';
4+
5+
export const zUserNotificationDeleteContentBase = z.object({
6+
name: z.string()
7+
});
8+
9+
export const zUserNotificationDeleteContentError = zUserNotificationDeleteContentBase.and(z.object({
10+
finishedAt: z.string().datetime(),
11+
error: z.string()
12+
}));
13+
14+
export const zUserNotificationDeleteContentRunning = zUserNotificationDeleteContentBase.and(z.object({
15+
startedAt: z.string().datetime()
16+
}));
17+
18+
export const zUserNotificationDeleteContentSuccess = zUserNotificationDeleteContentBase.and(z.object({
19+
finishedAt: z.string().datetime()
20+
}));
21+
22+
export const zUserNotificationDeleteContent = z.union([
23+
z.object({
24+
status: z.literal('running')
25+
}).and(zUserNotificationDeleteContentRunning),
26+
z.object({
27+
status: z.literal('success')
28+
}).and(zUserNotificationDeleteContentSuccess),
29+
z.object({
30+
status: z.literal('error')
31+
}).and(zUserNotificationDeleteContentError)
32+
]);
33+
34+
/**
35+
* success
36+
*/
37+
export const zGetNotificationResponse = zUserNotificationDeleteContent;

0 commit comments

Comments
 (0)