@seam-rpc/server 4.3.1 → 4.3.3

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.
@@ -137,7 +137,7 @@ export async function generateClientFile({ tsPath, jsPath, outputPath, }) {
137
137
  * +===================================+
138
138
  */
139
139
 
140
- import { callApi, Result, RpcError } from "@seam-rpc/client";
140
+ import { callApi } from "@seam-rpc/client";
141
141
 
142
142
  `;
143
143
  const functions = [];
package/dist/test.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import * as z from "zod";
2
+ export declare function convert(schema: z.ZodTypeAny): string;
package/dist/test.js ADDED
@@ -0,0 +1,38 @@
1
+ import { zodToTs, createAuxiliaryTypeStore } from "zod-to-ts";
2
+ import * as z from "zod";
3
+ import ts from "typescript";
4
+ export function convert(schema) {
5
+ const store = createAuxiliaryTypeStore();
6
+ const { node } = zodToTs(schema, {
7
+ auxiliaryTypeStore: store,
8
+ });
9
+ const typeAlias = ts.factory.createTypeAliasDeclaration([ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)], ts.factory.createIdentifier("GeneratedType"), undefined, node);
10
+ const file = ts.createSourceFile("types.ts", "", ts.ScriptTarget.Latest, false, ts.ScriptKind.TS);
11
+ const printer = ts.createPrinter({
12
+ newLine: ts.NewLineKind.LineFeed,
13
+ removeComments: false,
14
+ });
15
+ return printer.printNode(ts.EmitHint.Unspecified, typeAlias, file);
16
+ }
17
+ console.log(convert(z.object({
18
+ test: z.object({
19
+ a: z.string(),
20
+ b: z.string(),
21
+ c: z.string(),
22
+ d: z.string(),
23
+ e: z.string(),
24
+ f: z.string(),
25
+ ga: z.string(),
26
+ wea: z.string(),
27
+ waa: z.string(),
28
+ wga: z.string(),
29
+ weega: z.string(),
30
+ wwa: z.string(),
31
+ af: z.string(),
32
+ wha: z.string(),
33
+ ag: z.string(),
34
+ wwea: z.string(),
35
+ we3a: z.string(),
36
+ wada: z.string(),
37
+ })
38
+ })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seam-rpc/server",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "bin": {