@trpc-panel/core 1.0.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/README.md +173 -0
- package/lib/index.js +431 -0
- package/lib/index.mjs +427 -0
- package/lib/react-app/bundle.js +291 -0
- package/lib/react-app/bundle.js.map +1 -0
- package/lib/react-app/index.css +1076 -0
- package/lib/react-app/index.html +16 -0
- package/lib/src/index.d.ts +3 -0
- package/lib/src/meta.d.ts +9 -0
- package/lib/src/parse/__tests__/parseProcedure.test.d.ts +1 -0
- package/lib/src/parse/__tests__/parseRouter.test.d.ts +1 -0
- package/lib/src/parse/__tests__/utils/router.d.ts +159 -0
- package/lib/src/parse/__tests__/utils/schemas.d.ts +7 -0
- package/lib/src/parse/input-mappers/__tests__/zod/array.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/bigint.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/boolean.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/branded.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/default.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/discriminatedUnion.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/effects.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/enum.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/literal.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/null.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/nullable.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/number.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/object.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/optional.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/promise.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/string.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/undefined.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/__tests__/zod/void.test.d.ts +1 -0
- package/lib/src/parse/input-mappers/defaultReferences.d.ts +2 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodArrayDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodBigIntDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodBooleanFieldDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodBrandedDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodDefaultDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodDiscriminatedUnionDef.d.ts +16 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodEffectsDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodEnumDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodLiteralDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodNullDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodNullableDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodNumberDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodObjectDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodOptionalDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodPromiseDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodStringDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodUndefinedDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/parsers/parseZodVoidDef.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/selector.d.ts +3 -0
- package/lib/src/parse/input-mappers/zod/zod-types.d.ts +4 -0
- package/lib/src/parse/parseErrorLogs.d.ts +1 -0
- package/lib/src/parse/parseNodeTypes.d.ts +61 -0
- package/lib/src/parse/parseProcedure.d.ts +18 -0
- package/lib/src/parse/parseRouter.d.ts +21 -0
- package/lib/src/parse/routerType.d.ts +486 -0
- package/lib/src/parse/utils.d.ts +2 -0
- package/lib/src/render.d.ts +7 -0
- package/package.json +100 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const ZodObjectSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
3
|
+
export declare function isZodObject(obj: unknown): obj is z.infer<typeof ZodObjectSchema>;
|
|
4
|
+
declare const SharedProcedureDefPropertiesSchema: z.ZodObject<{
|
|
5
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
6
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
7
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
inputs?: unknown[] | undefined;
|
|
16
|
+
input?: unknown;
|
|
17
|
+
meta?: {
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
inputs?: unknown[] | undefined;
|
|
22
|
+
input?: unknown;
|
|
23
|
+
meta?: {
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
declare const QueryDefSchema: z.ZodIntersection<z.ZodObject<{
|
|
28
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
29
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
description: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
description?: string | undefined;
|
|
36
|
+
}>>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
inputs?: unknown[] | undefined;
|
|
39
|
+
input?: unknown;
|
|
40
|
+
meta?: {
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
inputs?: unknown[] | undefined;
|
|
45
|
+
input?: unknown;
|
|
46
|
+
meta?: {
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
50
|
+
query: z.ZodLiteral<true>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
query: true;
|
|
53
|
+
}, {
|
|
54
|
+
query: true;
|
|
55
|
+
}>, z.ZodObject<{
|
|
56
|
+
type: z.ZodLiteral<"query">;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
type: "query";
|
|
59
|
+
}, {
|
|
60
|
+
type: "query";
|
|
61
|
+
}>]>>;
|
|
62
|
+
export declare function isQueryDef(obj: unknown): obj is QueryDef;
|
|
63
|
+
type QueryDef = z.infer<typeof QueryDefSchema>;
|
|
64
|
+
declare const MutationDefSchema: z.ZodIntersection<z.ZodObject<{
|
|
65
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
66
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
67
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
description: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
description?: string | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
description?: string | undefined;
|
|
73
|
+
}>>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
inputs?: unknown[] | undefined;
|
|
76
|
+
input?: unknown;
|
|
77
|
+
meta?: {
|
|
78
|
+
description?: string | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
inputs?: unknown[] | undefined;
|
|
82
|
+
input?: unknown;
|
|
83
|
+
meta?: {
|
|
84
|
+
description?: string | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
87
|
+
mutation: z.ZodLiteral<true>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
mutation: true;
|
|
90
|
+
}, {
|
|
91
|
+
mutation: true;
|
|
92
|
+
}>, z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"mutation">;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
type: "mutation";
|
|
96
|
+
}, {
|
|
97
|
+
type: "mutation";
|
|
98
|
+
}>]>>;
|
|
99
|
+
export declare function isMutationDef(obj: unknown): obj is MutationDef;
|
|
100
|
+
export type MutationDef = z.infer<typeof MutationDefSchema>;
|
|
101
|
+
declare const SubscriptionDefSchema: z.ZodIntersection<z.ZodObject<{
|
|
102
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
103
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
104
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
description: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
description?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
description?: string | undefined;
|
|
110
|
+
}>>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
inputs?: unknown[] | undefined;
|
|
113
|
+
input?: unknown;
|
|
114
|
+
meta?: {
|
|
115
|
+
description?: string | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
inputs?: unknown[] | undefined;
|
|
119
|
+
input?: unknown;
|
|
120
|
+
meta?: {
|
|
121
|
+
description?: string | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
124
|
+
subscription: z.ZodLiteral<true>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
subscription: true;
|
|
127
|
+
}, {
|
|
128
|
+
subscription: true;
|
|
129
|
+
}>, z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"subscription">;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
type: "subscription";
|
|
133
|
+
}, {
|
|
134
|
+
type: "subscription";
|
|
135
|
+
}>]>>;
|
|
136
|
+
type SubscriptionDef = z.infer<typeof SubscriptionDefSchema>;
|
|
137
|
+
export declare function isSubscriptionDef(obj: unknown): obj is SubscriptionDef;
|
|
138
|
+
export declare const ProcedureDefSchema: z.ZodUnion<[z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
|
|
139
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
140
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
141
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
description: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
description?: string | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
description?: string | undefined;
|
|
147
|
+
}>>;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
inputs?: unknown[] | undefined;
|
|
150
|
+
input?: unknown;
|
|
151
|
+
meta?: {
|
|
152
|
+
description?: string | undefined;
|
|
153
|
+
} | undefined;
|
|
154
|
+
}, {
|
|
155
|
+
inputs?: unknown[] | undefined;
|
|
156
|
+
input?: unknown;
|
|
157
|
+
meta?: {
|
|
158
|
+
description?: string | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
161
|
+
query: z.ZodLiteral<true>;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
query: true;
|
|
164
|
+
}, {
|
|
165
|
+
query: true;
|
|
166
|
+
}>, z.ZodObject<{
|
|
167
|
+
type: z.ZodLiteral<"query">;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
type: "query";
|
|
170
|
+
}, {
|
|
171
|
+
type: "query";
|
|
172
|
+
}>]>>, z.ZodIntersection<z.ZodObject<{
|
|
173
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
174
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
175
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
description: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
description?: string | undefined;
|
|
179
|
+
}, {
|
|
180
|
+
description?: string | undefined;
|
|
181
|
+
}>>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
inputs?: unknown[] | undefined;
|
|
184
|
+
input?: unknown;
|
|
185
|
+
meta?: {
|
|
186
|
+
description?: string | undefined;
|
|
187
|
+
} | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
inputs?: unknown[] | undefined;
|
|
190
|
+
input?: unknown;
|
|
191
|
+
meta?: {
|
|
192
|
+
description?: string | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
195
|
+
mutation: z.ZodLiteral<true>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
mutation: true;
|
|
198
|
+
}, {
|
|
199
|
+
mutation: true;
|
|
200
|
+
}>, z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"mutation">;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
type: "mutation";
|
|
204
|
+
}, {
|
|
205
|
+
type: "mutation";
|
|
206
|
+
}>]>>]>, z.ZodIntersection<z.ZodObject<{
|
|
207
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
208
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
209
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
description: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
|
212
|
+
description?: string | undefined;
|
|
213
|
+
}, {
|
|
214
|
+
description?: string | undefined;
|
|
215
|
+
}>>;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
inputs?: unknown[] | undefined;
|
|
218
|
+
input?: unknown;
|
|
219
|
+
meta?: {
|
|
220
|
+
description?: string | undefined;
|
|
221
|
+
} | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
inputs?: unknown[] | undefined;
|
|
224
|
+
input?: unknown;
|
|
225
|
+
meta?: {
|
|
226
|
+
description?: string | undefined;
|
|
227
|
+
} | undefined;
|
|
228
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
229
|
+
subscription: z.ZodLiteral<true>;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
subscription: true;
|
|
232
|
+
}, {
|
|
233
|
+
subscription: true;
|
|
234
|
+
}>, z.ZodObject<{
|
|
235
|
+
type: z.ZodLiteral<"subscription">;
|
|
236
|
+
}, "strip", z.ZodTypeAny, {
|
|
237
|
+
type: "subscription";
|
|
238
|
+
}, {
|
|
239
|
+
type: "subscription";
|
|
240
|
+
}>]>>]>;
|
|
241
|
+
export type ProcedureDefSharedProperties = z.infer<typeof SharedProcedureDefPropertiesSchema>;
|
|
242
|
+
export type RouterDef = {
|
|
243
|
+
router: true;
|
|
244
|
+
procedures: Record<string, RouterOrProcedure>;
|
|
245
|
+
};
|
|
246
|
+
export type Router = {
|
|
247
|
+
_def: RouterDef;
|
|
248
|
+
} & {
|
|
249
|
+
[key: string]: Router | Procedure;
|
|
250
|
+
};
|
|
251
|
+
export declare function isRouter(obj: unknown): obj is Router;
|
|
252
|
+
declare const ProcedureSchema: z.ZodObject<{
|
|
253
|
+
_def: z.ZodUnion<[z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
|
|
254
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
255
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
256
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
description: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
description?: string | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
description?: string | undefined;
|
|
262
|
+
}>>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
inputs?: unknown[] | undefined;
|
|
265
|
+
input?: unknown;
|
|
266
|
+
meta?: {
|
|
267
|
+
description?: string | undefined;
|
|
268
|
+
} | undefined;
|
|
269
|
+
}, {
|
|
270
|
+
inputs?: unknown[] | undefined;
|
|
271
|
+
input?: unknown;
|
|
272
|
+
meta?: {
|
|
273
|
+
description?: string | undefined;
|
|
274
|
+
} | undefined;
|
|
275
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
276
|
+
query: z.ZodLiteral<true>;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
query: true;
|
|
279
|
+
}, {
|
|
280
|
+
query: true;
|
|
281
|
+
}>, z.ZodObject<{
|
|
282
|
+
type: z.ZodLiteral<"query">;
|
|
283
|
+
}, "strip", z.ZodTypeAny, {
|
|
284
|
+
type: "query";
|
|
285
|
+
}, {
|
|
286
|
+
type: "query";
|
|
287
|
+
}>]>>, z.ZodIntersection<z.ZodObject<{
|
|
288
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
289
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
290
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
291
|
+
description: z.ZodOptional<z.ZodString>;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
description?: string | undefined;
|
|
294
|
+
}, {
|
|
295
|
+
description?: string | undefined;
|
|
296
|
+
}>>;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
inputs?: unknown[] | undefined;
|
|
299
|
+
input?: unknown;
|
|
300
|
+
meta?: {
|
|
301
|
+
description?: string | undefined;
|
|
302
|
+
} | undefined;
|
|
303
|
+
}, {
|
|
304
|
+
inputs?: unknown[] | undefined;
|
|
305
|
+
input?: unknown;
|
|
306
|
+
meta?: {
|
|
307
|
+
description?: string | undefined;
|
|
308
|
+
} | undefined;
|
|
309
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
310
|
+
mutation: z.ZodLiteral<true>;
|
|
311
|
+
}, "strip", z.ZodTypeAny, {
|
|
312
|
+
mutation: true;
|
|
313
|
+
}, {
|
|
314
|
+
mutation: true;
|
|
315
|
+
}>, z.ZodObject<{
|
|
316
|
+
type: z.ZodLiteral<"mutation">;
|
|
317
|
+
}, "strip", z.ZodTypeAny, {
|
|
318
|
+
type: "mutation";
|
|
319
|
+
}, {
|
|
320
|
+
type: "mutation";
|
|
321
|
+
}>]>>]>, z.ZodIntersection<z.ZodObject<{
|
|
322
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
323
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
324
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
325
|
+
description: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, "strip", z.ZodTypeAny, {
|
|
327
|
+
description?: string | undefined;
|
|
328
|
+
}, {
|
|
329
|
+
description?: string | undefined;
|
|
330
|
+
}>>;
|
|
331
|
+
}, "strip", z.ZodTypeAny, {
|
|
332
|
+
inputs?: unknown[] | undefined;
|
|
333
|
+
input?: unknown;
|
|
334
|
+
meta?: {
|
|
335
|
+
description?: string | undefined;
|
|
336
|
+
} | undefined;
|
|
337
|
+
}, {
|
|
338
|
+
inputs?: unknown[] | undefined;
|
|
339
|
+
input?: unknown;
|
|
340
|
+
meta?: {
|
|
341
|
+
description?: string | undefined;
|
|
342
|
+
} | undefined;
|
|
343
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
344
|
+
subscription: z.ZodLiteral<true>;
|
|
345
|
+
}, "strip", z.ZodTypeAny, {
|
|
346
|
+
subscription: true;
|
|
347
|
+
}, {
|
|
348
|
+
subscription: true;
|
|
349
|
+
}>, z.ZodObject<{
|
|
350
|
+
type: z.ZodLiteral<"subscription">;
|
|
351
|
+
}, "strip", z.ZodTypeAny, {
|
|
352
|
+
type: "subscription";
|
|
353
|
+
}, {
|
|
354
|
+
type: "subscription";
|
|
355
|
+
}>]>>]>;
|
|
356
|
+
}, "strip", z.ZodTypeAny, {
|
|
357
|
+
_def: ({
|
|
358
|
+
inputs?: unknown[] | undefined;
|
|
359
|
+
input?: unknown;
|
|
360
|
+
meta?: {
|
|
361
|
+
description?: string | undefined;
|
|
362
|
+
} | undefined;
|
|
363
|
+
} & ({
|
|
364
|
+
query: true;
|
|
365
|
+
} | {
|
|
366
|
+
type: "query";
|
|
367
|
+
})) | ({
|
|
368
|
+
inputs?: unknown[] | undefined;
|
|
369
|
+
input?: unknown;
|
|
370
|
+
meta?: {
|
|
371
|
+
description?: string | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
} & ({
|
|
374
|
+
mutation: true;
|
|
375
|
+
} | {
|
|
376
|
+
type: "mutation";
|
|
377
|
+
})) | ({
|
|
378
|
+
inputs?: unknown[] | undefined;
|
|
379
|
+
input?: unknown;
|
|
380
|
+
meta?: {
|
|
381
|
+
description?: string | undefined;
|
|
382
|
+
} | undefined;
|
|
383
|
+
} & ({
|
|
384
|
+
subscription: true;
|
|
385
|
+
} | {
|
|
386
|
+
type: "subscription";
|
|
387
|
+
}));
|
|
388
|
+
}, {
|
|
389
|
+
_def: ({
|
|
390
|
+
inputs?: unknown[] | undefined;
|
|
391
|
+
input?: unknown;
|
|
392
|
+
meta?: {
|
|
393
|
+
description?: string | undefined;
|
|
394
|
+
} | undefined;
|
|
395
|
+
} & ({
|
|
396
|
+
query: true;
|
|
397
|
+
} | {
|
|
398
|
+
type: "query";
|
|
399
|
+
})) | ({
|
|
400
|
+
inputs?: unknown[] | undefined;
|
|
401
|
+
input?: unknown;
|
|
402
|
+
meta?: {
|
|
403
|
+
description?: string | undefined;
|
|
404
|
+
} | undefined;
|
|
405
|
+
} & ({
|
|
406
|
+
mutation: true;
|
|
407
|
+
} | {
|
|
408
|
+
type: "mutation";
|
|
409
|
+
})) | ({
|
|
410
|
+
inputs?: unknown[] | undefined;
|
|
411
|
+
input?: unknown;
|
|
412
|
+
meta?: {
|
|
413
|
+
description?: string | undefined;
|
|
414
|
+
} | undefined;
|
|
415
|
+
} & ({
|
|
416
|
+
subscription: true;
|
|
417
|
+
} | {
|
|
418
|
+
type: "subscription";
|
|
419
|
+
}));
|
|
420
|
+
}>;
|
|
421
|
+
export type Procedure = z.infer<typeof ProcedureSchema>;
|
|
422
|
+
export declare function isProcedure(obj: unknown | Function): obj is Procedure;
|
|
423
|
+
declare const QuerySchema: z.ZodObject<{
|
|
424
|
+
_def: z.ZodIntersection<z.ZodObject<{
|
|
425
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
426
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
427
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
428
|
+
description: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, "strip", z.ZodTypeAny, {
|
|
430
|
+
description?: string | undefined;
|
|
431
|
+
}, {
|
|
432
|
+
description?: string | undefined;
|
|
433
|
+
}>>;
|
|
434
|
+
}, "strip", z.ZodTypeAny, {
|
|
435
|
+
inputs?: unknown[] | undefined;
|
|
436
|
+
input?: unknown;
|
|
437
|
+
meta?: {
|
|
438
|
+
description?: string | undefined;
|
|
439
|
+
} | undefined;
|
|
440
|
+
}, {
|
|
441
|
+
inputs?: unknown[] | undefined;
|
|
442
|
+
input?: unknown;
|
|
443
|
+
meta?: {
|
|
444
|
+
description?: string | undefined;
|
|
445
|
+
} | undefined;
|
|
446
|
+
}>, z.ZodUnion<[z.ZodObject<{
|
|
447
|
+
query: z.ZodLiteral<true>;
|
|
448
|
+
}, "strip", z.ZodTypeAny, {
|
|
449
|
+
query: true;
|
|
450
|
+
}, {
|
|
451
|
+
query: true;
|
|
452
|
+
}>, z.ZodObject<{
|
|
453
|
+
type: z.ZodLiteral<"query">;
|
|
454
|
+
}, "strip", z.ZodTypeAny, {
|
|
455
|
+
type: "query";
|
|
456
|
+
}, {
|
|
457
|
+
type: "query";
|
|
458
|
+
}>]>>;
|
|
459
|
+
}, "strip", z.ZodTypeAny, {
|
|
460
|
+
_def: {
|
|
461
|
+
inputs?: unknown[] | undefined;
|
|
462
|
+
input?: unknown;
|
|
463
|
+
meta?: {
|
|
464
|
+
description?: string | undefined;
|
|
465
|
+
} | undefined;
|
|
466
|
+
} & ({
|
|
467
|
+
query: true;
|
|
468
|
+
} | {
|
|
469
|
+
type: "query";
|
|
470
|
+
});
|
|
471
|
+
}, {
|
|
472
|
+
_def: {
|
|
473
|
+
inputs?: unknown[] | undefined;
|
|
474
|
+
input?: unknown;
|
|
475
|
+
meta?: {
|
|
476
|
+
description?: string | undefined;
|
|
477
|
+
} | undefined;
|
|
478
|
+
} & ({
|
|
479
|
+
query: true;
|
|
480
|
+
} | {
|
|
481
|
+
type: "query";
|
|
482
|
+
});
|
|
483
|
+
}>;
|
|
484
|
+
export type Query = z.infer<typeof QuerySchema>;
|
|
485
|
+
export type RouterOrProcedure = Router | Procedure;
|
|
486
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnyRouter } from "@trpc/server";
|
|
2
|
+
import { TrpcPanelExtraOptions } from "./parse/parseRouter";
|
|
3
|
+
export type RenderOptions = {
|
|
4
|
+
url: string;
|
|
5
|
+
cache?: boolean;
|
|
6
|
+
} & TrpcPanelExtraOptions;
|
|
7
|
+
export declare function renderTrpcPanel(router: AnyRouter, options: RenderOptions): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@trpc-panel/core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "UI for testing tRPC backends",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.mjs",
|
|
7
|
+
"typings": "lib/src/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"test:watch": "jest --watchAll",
|
|
11
|
+
"build": "bun x rollup --bundleConfigAsCjs --config rollup.config.js",
|
|
12
|
+
"dev": "bun x rollup --config rollup.config.js --watch --bundleConfigAsCjs"
|
|
13
|
+
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./lib/src/index.d.ts",
|
|
22
|
+
"import": "./lib/index.mjs",
|
|
23
|
+
"require": "./lib/index.js",
|
|
24
|
+
"default": "./lib/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/"
|
|
29
|
+
],
|
|
30
|
+
"directories": {
|
|
31
|
+
"lib": "lib"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@trpc/server": "^11.7.2",
|
|
35
|
+
"zod": "^3.19.1"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@babel/core": "^7.20.2",
|
|
39
|
+
"@babel/preset-react": "^7.18.6",
|
|
40
|
+
"@emotion/react": "^11.10.5",
|
|
41
|
+
"@emotion/styled": "^11.10.5",
|
|
42
|
+
"@hookform/resolvers": "^2.9.10",
|
|
43
|
+
"@mui/icons-material": "^5.10.16",
|
|
44
|
+
"@mui/material": "^5.10.16",
|
|
45
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
46
|
+
"@rollup/plugin-commonjs": "^23.0.2",
|
|
47
|
+
"@rollup/plugin-json": "^5.0.1",
|
|
48
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
49
|
+
"@rollup/plugin-replace": "^5.0.1",
|
|
50
|
+
"@rollup/plugin-terser": "^0.2.0",
|
|
51
|
+
"@rollup/plugin-typescript": "^10.0.1",
|
|
52
|
+
"@tanstack/react-query": "^5.0.0",
|
|
53
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
54
|
+
"@testing-library/react": "^13.4.0",
|
|
55
|
+
"@testing-library/user-event": "^14.4.3",
|
|
56
|
+
"@trpc/client": "11.7.2",
|
|
57
|
+
"@trpc/react-query": "11.7.2",
|
|
58
|
+
"@trpc/server": "11.7.2",
|
|
59
|
+
"@types/jest": "^29.2.4",
|
|
60
|
+
"@types/json-bigint": "^1.0.1",
|
|
61
|
+
"@types/node": "^20.10.0",
|
|
62
|
+
"@types/react": "^18.0.21",
|
|
63
|
+
"@types/react-dom": "^18.0.6",
|
|
64
|
+
"ajv": "^8.11.2",
|
|
65
|
+
"ajv-formats": "^2.1.1",
|
|
66
|
+
"autoprefixer": "^10.4.13",
|
|
67
|
+
"devalue": "^4.2.0",
|
|
68
|
+
"gulp": "^4.0.2",
|
|
69
|
+
"gulp-inline-source": "^4.0.0",
|
|
70
|
+
"gulp-replace": "^1.1.3",
|
|
71
|
+
"jest": "^29.3.1",
|
|
72
|
+
"json-bigint": "^1.0.0",
|
|
73
|
+
"postcss": "^8.4.19",
|
|
74
|
+
"react": "18.2.0",
|
|
75
|
+
"react-dom": "18.2.0",
|
|
76
|
+
"react-hook-form": "^7.39.5",
|
|
77
|
+
"react-hot-toast": "^2.4.0",
|
|
78
|
+
"react-hotkeys-hook": "^4.0.6",
|
|
79
|
+
"rollup": "^3.7.4",
|
|
80
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
81
|
+
"rollup-plugin-livereload": "^2.0.5",
|
|
82
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
83
|
+
"rollup-plugin-serve": "^2.0.1",
|
|
84
|
+
"rollup-plugin-visualizer": "^5.8.3",
|
|
85
|
+
"superjson": "^1.12.0",
|
|
86
|
+
"tailwindcss": "^3.2.4",
|
|
87
|
+
"ts-jest": "^29.0.3",
|
|
88
|
+
"tslib": "^2.4.1",
|
|
89
|
+
"typescript": "^5.3.3",
|
|
90
|
+
"url": "^0.11.0",
|
|
91
|
+
"zod": "^3.19.1",
|
|
92
|
+
"zustand": "^4.1.5"
|
|
93
|
+
},
|
|
94
|
+
"dependencies": {
|
|
95
|
+
"fuzzysort": "^2.0.4",
|
|
96
|
+
"path": "^0.12.7",
|
|
97
|
+
"url": "^0.11.0",
|
|
98
|
+
"zod-to-json-schema": "^3.20.0"
|
|
99
|
+
}
|
|
100
|
+
}
|