zitejs 0.9.7 → 0.9.8

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.
@@ -151,8 +151,8 @@ function generateApiTs(endpointFiles, flowId) {
151
151
  // Inferred input/output types per endpoint (e.g. GetDashboardInputType, GetDashboardOutputType)
152
152
  for (const name of endpointNames) {
153
153
  const pascal = toPascalCase(name);
154
- lines.push(`export type ${pascal}InputType = typeof ${name}Endpoint extends { inputSchema: { _output: infer T } } ? T : unknown;`);
155
- lines.push(`export type ${pascal}OutputType = typeof ${name}Endpoint extends { outputSchema: { _output: infer T } } ? T : unknown;`);
154
+ lines.push(`export type ${pascal}InputType = Parameters<typeof ${name}Endpoint.execute>[0]['input'];`);
155
+ lines.push(`export type ${pascal}OutputType = Awaited<ReturnType<typeof ${name}Endpoint.execute>>;`);
156
156
  }
157
157
  lines.push('');
158
158
  // Also export as a single api object
@@ -143,8 +143,8 @@ export function generateApiTs(endpointFiles, flowId) {
143
143
  // Inferred input/output types per endpoint (e.g. GetDashboardInputType, GetDashboardOutputType)
144
144
  for (const name of endpointNames) {
145
145
  const pascal = toPascalCase(name);
146
- lines.push(`export type ${pascal}InputType = typeof ${name}Endpoint extends { inputSchema: { _output: infer T } } ? T : unknown;`);
147
- lines.push(`export type ${pascal}OutputType = typeof ${name}Endpoint extends { outputSchema: { _output: infer T } } ? T : unknown;`);
146
+ lines.push(`export type ${pascal}InputType = Parameters<typeof ${name}Endpoint.execute>[0]['input'];`);
147
+ lines.push(`export type ${pascal}OutputType = Awaited<ReturnType<typeof ${name}Endpoint.execute>>;`);
148
148
  }
149
149
  lines.push('');
150
150
  // Also export as a single api object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/runtime/index.js",