@read-frog/api-contract 0.1.3 → 0.2.1

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/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import * as zod_v4_core0 from "zod/v4/core";
2
- import * as z$1 from "zod";
3
- import { z } from "zod";
4
1
  import * as _orpc_contract0 from "@orpc/contract";
5
2
  import { ContractRouterClient } from "@orpc/contract";
3
+ import * as zod from "zod";
4
+ import { z } from "zod";
5
+ import * as zod_v4_core0 from "zod/v4/core";
6
6
 
7
7
  //#region src/schemas/column.d.ts
8
8
  declare const ColumnAddInputSchema: z.ZodObject<{
@@ -81,37 +81,51 @@ declare const ColumnDeleteOutputSchema: z.ZodObject<{
81
81
  //#endregion
82
82
  //#region src/schemas/custom-table.d.ts
83
83
  declare const CustomTableListInputSchema: z.ZodObject<{}, z.core.$strip>;
84
+ type CustomTableListInput = z.infer<typeof CustomTableListInputSchema>;
84
85
  declare const CustomTableListItemSchema: z.ZodObject<{
85
86
  id: z.ZodString;
86
87
  name: z.ZodString;
87
88
  }, z.core.$strip>;
89
+ type CustomTableListItem = z.infer<typeof CustomTableListItemSchema>;
88
90
  declare const CustomTableListOutputSchema: z.ZodArray<z.ZodObject<{
89
91
  id: z.ZodString;
90
92
  name: z.ZodString;
91
93
  }, z.core.$strip>>;
94
+ type CustomTableListOutput = z.infer<typeof CustomTableListOutputSchema>;
92
95
  declare const CustomTableCreateInputSchema: z.ZodObject<{
93
96
  id: z.ZodOptional<z.ZodUUID>;
94
97
  name: z.ZodString;
95
98
  }, z.core.$strip>;
99
+ type CustomTableCreateInput = z.infer<typeof CustomTableCreateInputSchema>;
96
100
  declare const CustomTableCreateOutputSchema: z.ZodObject<{
97
101
  txid: z.ZodNumber;
98
102
  }, z.core.$strip>;
103
+ type CustomTableCreateOutput = z.infer<typeof CustomTableCreateOutputSchema>;
99
104
  declare const CustomTableUpdateInputSchema: z.ZodObject<{
100
105
  id: z.ZodUUID;
101
106
  name: z.ZodOptional<z.ZodString>;
102
107
  }, z.core.$strip>;
108
+ type CustomTableUpdateInput = z.infer<typeof CustomTableUpdateInputSchema>;
103
109
  declare const CustomTableUpdateOutputSchema: z.ZodObject<{
104
110
  txid: z.ZodNumber;
105
111
  }, z.core.$strip>;
112
+ type CustomTableUpdateOutput = z.infer<typeof CustomTableUpdateOutputSchema>;
106
113
  declare const CustomTableDeleteInputSchema: z.ZodObject<{
107
114
  id: z.ZodUUID;
108
115
  }, z.core.$strip>;
116
+ type CustomTableDeleteInput = z.infer<typeof CustomTableDeleteInputSchema>;
109
117
  declare const CustomTableDeleteOutputSchema: z.ZodObject<{
110
118
  txid: z.ZodNumber;
111
119
  }, z.core.$strip>;
120
+ type CustomTableDeleteOutput = z.infer<typeof CustomTableDeleteOutputSchema>;
112
121
  declare const CustomTableGetInputSchema: z.ZodObject<{
113
122
  id: z.ZodUUID;
114
123
  }, z.core.$strip>;
124
+ type CustomTableGetInput = z.infer<typeof CustomTableGetInputSchema>;
125
+ declare const CustomTableGetSchemaInputSchema: z.ZodObject<{
126
+ id: z.ZodUUID;
127
+ }, z.core.$strip>;
128
+ type CustomTableGetSchemaInput = z.infer<typeof CustomTableGetSchemaInputSchema>;
115
129
  declare const TableColumnSchema: z.ZodObject<{
116
130
  id: z.ZodString;
117
131
  tableId: z.ZodString;
@@ -145,6 +159,7 @@ declare const TableColumnSchema: z.ZodObject<{
145
159
  createdAt: z.ZodCoercedDate<unknown>;
146
160
  updatedAt: z.ZodCoercedDate<unknown>;
147
161
  }, z.core.$strip>;
162
+ type TableColumn = z.infer<typeof TableColumnSchema>;
148
163
  declare const TableRowSchema: z.ZodObject<{
149
164
  id: z.ZodString;
150
165
  tableId: z.ZodString;
@@ -153,6 +168,7 @@ declare const TableRowSchema: z.ZodObject<{
153
168
  createdAt: z.ZodCoercedDate<unknown>;
154
169
  updatedAt: z.ZodCoercedDate<unknown>;
155
170
  }, z.core.$strip>;
171
+ type TableRow = z.infer<typeof TableRowSchema>;
156
172
  declare const TableViewSchema: z.ZodObject<{
157
173
  id: z.ZodString;
158
174
  tableId: z.ZodString;
@@ -169,6 +185,7 @@ declare const TableViewSchema: z.ZodObject<{
169
185
  createdAt: z.ZodCoercedDate<unknown>;
170
186
  updatedAt: z.ZodCoercedDate<unknown>;
171
187
  }, z.core.$strip>;
188
+ type TableView = z.infer<typeof TableViewSchema>;
172
189
  declare const CustomTableGetOutputSchema: z.ZodObject<{
173
190
  id: z.ZodString;
174
191
  userId: z.ZodString;
@@ -233,17 +250,46 @@ declare const CustomTableGetOutputSchema: z.ZodObject<{
233
250
  updatedAt: z.ZodCoercedDate<unknown>;
234
251
  }, z.core.$strip>>;
235
252
  }, z.core.$strip>;
236
- //#endregion
237
- //#region src/schemas/echo.d.ts
238
- declare const EchoInputSchema: z$1.ZodObject<{
239
- message: z$1.ZodString;
240
- }, z$1.core.$strip>;
241
- declare const EchoOutputSchema: z$1.ZodObject<{
242
- echoedMessage: z$1.ZodString;
243
- }, z$1.core.$strip>;
244
- declare const EchoTwiceOutputSchema: z$1.ZodObject<{
245
- echoedTwiceMessage: z$1.ZodString;
246
- }, z$1.core.$strip>;
253
+ type CustomTableGetOutput = z.infer<typeof CustomTableGetOutputSchema>;
254
+ declare const CustomTableGetSchemaOutputSchema: z.ZodObject<{
255
+ id: z.ZodString;
256
+ name: z.ZodString;
257
+ updatedAt: z.ZodCoercedDate<unknown>;
258
+ columns: z.ZodArray<z.ZodObject<{
259
+ id: z.ZodString;
260
+ tableId: z.ZodString;
261
+ name: z.ZodString;
262
+ config: z.ZodDiscriminatedUnion<[z.ZodObject<{
263
+ type: z.ZodLiteral<"string">;
264
+ }, z.core.$strip>, z.ZodObject<{
265
+ type: z.ZodLiteral<"number">;
266
+ decimal: z.ZodDefault<z.ZodNumber>;
267
+ format: z.ZodDefault<z.ZodEnum<{
268
+ number: "number";
269
+ currency: "currency";
270
+ percent: "percent";
271
+ }>>;
272
+ }, z.core.$strip>, z.ZodObject<{
273
+ type: z.ZodLiteral<"boolean">;
274
+ }, z.core.$strip>, z.ZodObject<{
275
+ type: z.ZodLiteral<"date">;
276
+ dateFormat: z.ZodOptional<z.ZodString>;
277
+ }, z.core.$strip>, z.ZodObject<{
278
+ type: z.ZodLiteral<"select">;
279
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
280
+ id: z.ZodString;
281
+ value: z.ZodString;
282
+ color: z.ZodString;
283
+ }, z.core.$strip>>>;
284
+ }, z.core.$strip>], "type">;
285
+ position: z.ZodNumber;
286
+ isPrimary: z.ZodBoolean;
287
+ width: z.ZodNullable<z.ZodNumber>;
288
+ createdAt: z.ZodCoercedDate<unknown>;
289
+ updatedAt: z.ZodCoercedDate<unknown>;
290
+ }, z.core.$strip>>;
291
+ }, z.core.$strip>;
292
+ type CustomTableGetSchemaOutput = z.infer<typeof CustomTableGetSchemaOutputSchema>;
247
293
  //#endregion
248
294
  //#region src/schemas/row.d.ts
249
295
  declare const RowAddInputSchema: z.ZodObject<{
@@ -254,9 +300,11 @@ declare const RowAddInputSchema: z.ZodObject<{
254
300
  position: z.ZodOptional<z.ZodNumber>;
255
301
  }, z.core.$strict>;
256
302
  }, z.core.$strip>;
303
+ type RowAddInput = z.infer<typeof RowAddInputSchema>;
257
304
  declare const RowAddOutputSchema: z.ZodObject<{
258
305
  txid: z.ZodNumber;
259
306
  }, z.core.$strip>;
307
+ type RowAddOutput = z.infer<typeof RowAddOutputSchema>;
260
308
  declare const RowUpdateInputSchema: z.ZodObject<{
261
309
  rowId: z.ZodUUID;
262
310
  data: z.ZodObject<{
@@ -264,6 +312,7 @@ declare const RowUpdateInputSchema: z.ZodObject<{
264
312
  position: z.ZodOptional<z.ZodNumber>;
265
313
  }, z.core.$strict>;
266
314
  }, z.core.$strip>;
315
+ type RowUpdateInput = z.infer<typeof RowUpdateInputSchema>;
267
316
  declare const RowUpdateOutputSchema: z.ZodObject<{
268
317
  id: z.ZodUUID;
269
318
  tableId: z.ZodUUID;
@@ -273,221 +322,253 @@ declare const RowUpdateOutputSchema: z.ZodObject<{
273
322
  updatedAt: z.ZodDate;
274
323
  txid: z.ZodNumber;
275
324
  }, z.core.$strip>;
325
+ type RowUpdateOutput = z.infer<typeof RowUpdateOutputSchema>;
276
326
  declare const RowDeleteInputSchema: z.ZodObject<{
277
327
  rowId: z.ZodUUID;
278
328
  }, z.core.$strip>;
329
+ type RowDeleteInput = z.infer<typeof RowDeleteInputSchema>;
279
330
  declare const RowDeleteOutputSchema: z.ZodObject<{
280
331
  txid: z.ZodNumber;
281
332
  }, z.core.$strip>;
333
+ type RowDeleteOutput = z.infer<typeof RowDeleteOutputSchema>;
282
334
  //#endregion
283
335
  //#region src/index.d.ts
284
336
  declare const contract: {
285
337
  customTable: {
286
- list: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{}, zod_v4_core0.$strip>, z$1.ZodArray<z$1.ZodObject<{
287
- id: z$1.ZodString;
288
- name: z$1.ZodString;
338
+ list: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{}, zod_v4_core0.$strip>, zod.ZodArray<zod.ZodObject<{
339
+ id: zod.ZodString;
340
+ name: zod.ZodString;
289
341
  }, zod_v4_core0.$strip>>, Record<never, never>, Record<never, never>>;
290
- get: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
291
- id: z$1.ZodUUID;
292
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
293
- id: z$1.ZodString;
294
- userId: z$1.ZodString;
295
- name: z$1.ZodString;
296
- createdAt: z$1.ZodCoercedDate<unknown>;
297
- updatedAt: z$1.ZodCoercedDate<unknown>;
298
- columns: z$1.ZodArray<z$1.ZodObject<{
299
- id: z$1.ZodString;
300
- tableId: z$1.ZodString;
301
- name: z$1.ZodString;
302
- config: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
303
- type: z$1.ZodLiteral<"string">;
304
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
305
- type: z$1.ZodLiteral<"number">;
306
- decimal: z$1.ZodDefault<z$1.ZodNumber>;
307
- format: z$1.ZodDefault<z$1.ZodEnum<{
342
+ get: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
343
+ id: zod.ZodUUID;
344
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
345
+ id: zod.ZodString;
346
+ userId: zod.ZodString;
347
+ name: zod.ZodString;
348
+ createdAt: zod.ZodCoercedDate<unknown>;
349
+ updatedAt: zod.ZodCoercedDate<unknown>;
350
+ columns: zod.ZodArray<zod.ZodObject<{
351
+ id: zod.ZodString;
352
+ tableId: zod.ZodString;
353
+ name: zod.ZodString;
354
+ config: zod.ZodDiscriminatedUnion<[zod.ZodObject<{
355
+ type: zod.ZodLiteral<"string">;
356
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
357
+ type: zod.ZodLiteral<"number">;
358
+ decimal: zod.ZodDefault<zod.ZodNumber>;
359
+ format: zod.ZodDefault<zod.ZodEnum<{
308
360
  number: "number";
309
361
  currency: "currency";
310
362
  percent: "percent";
311
363
  }>>;
312
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
313
- type: z$1.ZodLiteral<"boolean">;
314
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
315
- type: z$1.ZodLiteral<"date">;
316
- dateFormat: z$1.ZodOptional<z$1.ZodString>;
317
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
318
- type: z$1.ZodLiteral<"select">;
319
- options: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
320
- id: z$1.ZodString;
321
- value: z$1.ZodString;
322
- color: z$1.ZodString;
364
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
365
+ type: zod.ZodLiteral<"boolean">;
366
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
367
+ type: zod.ZodLiteral<"date">;
368
+ dateFormat: zod.ZodOptional<zod.ZodString>;
369
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
370
+ type: zod.ZodLiteral<"select">;
371
+ options: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
372
+ id: zod.ZodString;
373
+ value: zod.ZodString;
374
+ color: zod.ZodString;
323
375
  }, zod_v4_core0.$strip>>>;
324
376
  }, zod_v4_core0.$strip>], "type">;
325
- position: z$1.ZodNumber;
326
- isPrimary: z$1.ZodBoolean;
327
- width: z$1.ZodNullable<z$1.ZodNumber>;
328
- createdAt: z$1.ZodCoercedDate<unknown>;
329
- updatedAt: z$1.ZodCoercedDate<unknown>;
377
+ position: zod.ZodNumber;
378
+ isPrimary: zod.ZodBoolean;
379
+ width: zod.ZodNullable<zod.ZodNumber>;
380
+ createdAt: zod.ZodCoercedDate<unknown>;
381
+ updatedAt: zod.ZodCoercedDate<unknown>;
330
382
  }, zod_v4_core0.$strip>>;
331
- rows: z$1.ZodArray<z$1.ZodObject<{
332
- id: z$1.ZodString;
333
- tableId: z$1.ZodString;
334
- cells: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
335
- position: z$1.ZodNullable<z$1.ZodNumber>;
336
- createdAt: z$1.ZodCoercedDate<unknown>;
337
- updatedAt: z$1.ZodCoercedDate<unknown>;
383
+ rows: zod.ZodArray<zod.ZodObject<{
384
+ id: zod.ZodString;
385
+ tableId: zod.ZodString;
386
+ cells: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
387
+ position: zod.ZodNullable<zod.ZodNumber>;
388
+ createdAt: zod.ZodCoercedDate<unknown>;
389
+ updatedAt: zod.ZodCoercedDate<unknown>;
338
390
  }, zod_v4_core0.$strip>>;
339
- views: z$1.ZodArray<z$1.ZodObject<{
340
- id: z$1.ZodString;
341
- tableId: z$1.ZodString;
342
- name: z$1.ZodString;
343
- type: z$1.ZodEnum<{
391
+ views: zod.ZodArray<zod.ZodObject<{
392
+ id: zod.ZodString;
393
+ tableId: zod.ZodString;
394
+ name: zod.ZodString;
395
+ type: zod.ZodEnum<{
344
396
  table: "table";
345
397
  kanban: "kanban";
346
398
  gallery: "gallery";
347
399
  }>;
348
- config: z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
349
- filters: z$1.ZodNullable<z$1.ZodArray<z$1.ZodUnknown>>;
350
- sorts: z$1.ZodNullable<z$1.ZodArray<z$1.ZodUnknown>>;
351
- position: z$1.ZodNumber;
352
- createdAt: z$1.ZodCoercedDate<unknown>;
353
- updatedAt: z$1.ZodCoercedDate<unknown>;
400
+ config: zod.ZodNullable<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
401
+ filters: zod.ZodNullable<zod.ZodArray<zod.ZodUnknown>>;
402
+ sorts: zod.ZodNullable<zod.ZodArray<zod.ZodUnknown>>;
403
+ position: zod.ZodNumber;
404
+ createdAt: zod.ZodCoercedDate<unknown>;
405
+ updatedAt: zod.ZodCoercedDate<unknown>;
354
406
  }, zod_v4_core0.$strip>>;
355
407
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
356
- create: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
357
- id: z$1.ZodOptional<z$1.ZodUUID>;
358
- name: z$1.ZodString;
359
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
360
- txid: z$1.ZodNumber;
408
+ getSchema: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
409
+ id: zod.ZodUUID;
410
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
411
+ id: zod.ZodString;
412
+ name: zod.ZodString;
413
+ updatedAt: zod.ZodCoercedDate<unknown>;
414
+ columns: zod.ZodArray<zod.ZodObject<{
415
+ id: zod.ZodString;
416
+ tableId: zod.ZodString;
417
+ name: zod.ZodString;
418
+ config: zod.ZodDiscriminatedUnion<[zod.ZodObject<{
419
+ type: zod.ZodLiteral<"string">;
420
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
421
+ type: zod.ZodLiteral<"number">;
422
+ decimal: zod.ZodDefault<zod.ZodNumber>;
423
+ format: zod.ZodDefault<zod.ZodEnum<{
424
+ number: "number";
425
+ currency: "currency";
426
+ percent: "percent";
427
+ }>>;
428
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
429
+ type: zod.ZodLiteral<"boolean">;
430
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
431
+ type: zod.ZodLiteral<"date">;
432
+ dateFormat: zod.ZodOptional<zod.ZodString>;
433
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
434
+ type: zod.ZodLiteral<"select">;
435
+ options: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
436
+ id: zod.ZodString;
437
+ value: zod.ZodString;
438
+ color: zod.ZodString;
439
+ }, zod_v4_core0.$strip>>>;
440
+ }, zod_v4_core0.$strip>], "type">;
441
+ position: zod.ZodNumber;
442
+ isPrimary: zod.ZodBoolean;
443
+ width: zod.ZodNullable<zod.ZodNumber>;
444
+ createdAt: zod.ZodCoercedDate<unknown>;
445
+ updatedAt: zod.ZodCoercedDate<unknown>;
446
+ }, zod_v4_core0.$strip>>;
447
+ }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
448
+ create: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
449
+ id: zod.ZodOptional<zod.ZodUUID>;
450
+ name: zod.ZodString;
451
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
452
+ txid: zod.ZodNumber;
361
453
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
362
- update: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
363
- id: z$1.ZodUUID;
364
- name: z$1.ZodOptional<z$1.ZodString>;
365
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
366
- txid: z$1.ZodNumber;
454
+ update: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
455
+ id: zod.ZodUUID;
456
+ name: zod.ZodOptional<zod.ZodString>;
457
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
458
+ txid: zod.ZodNumber;
367
459
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
368
- delete: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
369
- id: z$1.ZodUUID;
370
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
371
- txid: z$1.ZodNumber;
460
+ delete: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
461
+ id: zod.ZodUUID;
462
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
463
+ txid: zod.ZodNumber;
372
464
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
373
465
  };
374
466
  column: {
375
- add: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
376
- tableId: z$1.ZodUUID;
377
- data: z$1.ZodObject<{
378
- id: z$1.ZodOptional<z$1.ZodUUID>;
379
- name: z$1.ZodString;
380
- config: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
381
- type: z$1.ZodLiteral<"string">;
382
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
383
- type: z$1.ZodLiteral<"number">;
384
- decimal: z$1.ZodDefault<z$1.ZodNumber>;
385
- format: z$1.ZodDefault<z$1.ZodEnum<{
467
+ add: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
468
+ tableId: zod.ZodUUID;
469
+ data: zod.ZodObject<{
470
+ id: zod.ZodOptional<zod.ZodUUID>;
471
+ name: zod.ZodString;
472
+ config: zod.ZodDiscriminatedUnion<[zod.ZodObject<{
473
+ type: zod.ZodLiteral<"string">;
474
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
475
+ type: zod.ZodLiteral<"number">;
476
+ decimal: zod.ZodDefault<zod.ZodNumber>;
477
+ format: zod.ZodDefault<zod.ZodEnum<{
386
478
  number: "number";
387
479
  currency: "currency";
388
480
  percent: "percent";
389
481
  }>>;
390
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
391
- type: z$1.ZodLiteral<"boolean">;
392
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
393
- type: z$1.ZodLiteral<"date">;
394
- dateFormat: z$1.ZodOptional<z$1.ZodString>;
395
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
396
- type: z$1.ZodLiteral<"select">;
397
- options: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
398
- id: z$1.ZodString;
399
- value: z$1.ZodString;
400
- color: z$1.ZodString;
482
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
483
+ type: zod.ZodLiteral<"boolean">;
484
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
485
+ type: zod.ZodLiteral<"date">;
486
+ dateFormat: zod.ZodOptional<zod.ZodString>;
487
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
488
+ type: zod.ZodLiteral<"select">;
489
+ options: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
490
+ id: zod.ZodString;
491
+ value: zod.ZodString;
492
+ color: zod.ZodString;
401
493
  }, zod_v4_core0.$strip>>>;
402
494
  }, zod_v4_core0.$strip>], "type">;
403
- position: z$1.ZodOptional<z$1.ZodNumber>;
495
+ position: zod.ZodOptional<zod.ZodNumber>;
404
496
  }, zod_v4_core0.$strict>;
405
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
406
- txid: z$1.ZodNumber;
497
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
498
+ txid: zod.ZodNumber;
407
499
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
408
- update: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
409
- columnId: z$1.ZodUUID;
410
- data: z$1.ZodObject<{
411
- name: z$1.ZodOptional<z$1.ZodString>;
412
- config: z$1.ZodOptional<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
413
- type: z$1.ZodLiteral<"string">;
414
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
415
- type: z$1.ZodLiteral<"number">;
416
- decimal: z$1.ZodDefault<z$1.ZodNumber>;
417
- format: z$1.ZodDefault<z$1.ZodEnum<{
500
+ update: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
501
+ columnId: zod.ZodUUID;
502
+ data: zod.ZodObject<{
503
+ name: zod.ZodOptional<zod.ZodString>;
504
+ config: zod.ZodOptional<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
505
+ type: zod.ZodLiteral<"string">;
506
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
507
+ type: zod.ZodLiteral<"number">;
508
+ decimal: zod.ZodDefault<zod.ZodNumber>;
509
+ format: zod.ZodDefault<zod.ZodEnum<{
418
510
  number: "number";
419
511
  currency: "currency";
420
512
  percent: "percent";
421
513
  }>>;
422
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
423
- type: z$1.ZodLiteral<"boolean">;
424
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
425
- type: z$1.ZodLiteral<"date">;
426
- dateFormat: z$1.ZodOptional<z$1.ZodString>;
427
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
428
- type: z$1.ZodLiteral<"select">;
429
- options: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
430
- id: z$1.ZodString;
431
- value: z$1.ZodString;
432
- color: z$1.ZodString;
514
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
515
+ type: zod.ZodLiteral<"boolean">;
516
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
517
+ type: zod.ZodLiteral<"date">;
518
+ dateFormat: zod.ZodOptional<zod.ZodString>;
519
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
520
+ type: zod.ZodLiteral<"select">;
521
+ options: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
522
+ id: zod.ZodString;
523
+ value: zod.ZodString;
524
+ color: zod.ZodString;
433
525
  }, zod_v4_core0.$strip>>>;
434
526
  }, zod_v4_core0.$strip>], "type">>;
435
- width: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
527
+ width: zod.ZodOptional<zod.ZodNullable<zod.ZodNumber>>;
436
528
  }, zod_v4_core0.$strict>;
437
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
438
- txid: z$1.ZodNumber;
529
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
530
+ txid: zod.ZodNumber;
439
531
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
440
- delete: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
441
- columnId: z$1.ZodUUID;
442
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
443
- txid: z$1.ZodNumber;
532
+ delete: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
533
+ columnId: zod.ZodUUID;
534
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
535
+ txid: zod.ZodNumber;
444
536
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
445
537
  };
446
538
  row: {
447
- add: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
448
- tableId: z$1.ZodUUID;
449
- data: z$1.ZodObject<{
450
- id: z$1.ZodOptional<z$1.ZodUUID>;
451
- cells: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
452
- position: z$1.ZodOptional<z$1.ZodNumber>;
539
+ add: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
540
+ tableId: zod.ZodUUID;
541
+ data: zod.ZodObject<{
542
+ id: zod.ZodOptional<zod.ZodUUID>;
543
+ cells: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
544
+ position: zod.ZodOptional<zod.ZodNumber>;
453
545
  }, zod_v4_core0.$strict>;
454
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
455
- txid: z$1.ZodNumber;
546
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
547
+ txid: zod.ZodNumber;
456
548
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
457
- update: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
458
- rowId: z$1.ZodUUID;
459
- data: z$1.ZodObject<{
460
- cells: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
461
- position: z$1.ZodOptional<z$1.ZodNumber>;
549
+ update: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
550
+ rowId: zod.ZodUUID;
551
+ data: zod.ZodObject<{
552
+ cells: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
553
+ position: zod.ZodOptional<zod.ZodNumber>;
462
554
  }, zod_v4_core0.$strict>;
463
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
464
- id: z$1.ZodUUID;
465
- tableId: z$1.ZodUUID;
466
- cells: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
467
- position: z$1.ZodNullable<z$1.ZodNumber>;
468
- createdAt: z$1.ZodDate;
469
- updatedAt: z$1.ZodDate;
470
- txid: z$1.ZodNumber;
471
- }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
472
- delete: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
473
- rowId: z$1.ZodUUID;
474
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
475
- txid: z$1.ZodNumber;
476
- }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
477
- };
478
- echo: {
479
- once: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
480
- message: z$1.ZodString;
481
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
482
- echoedMessage: z$1.ZodString;
555
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
556
+ id: zod.ZodUUID;
557
+ tableId: zod.ZodUUID;
558
+ cells: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
559
+ position: zod.ZodNullable<zod.ZodNumber>;
560
+ createdAt: zod.ZodDate;
561
+ updatedAt: zod.ZodDate;
562
+ txid: zod.ZodNumber;
483
563
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
484
- twice: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z$1.ZodObject<{
485
- message: z$1.ZodString;
486
- }, zod_v4_core0.$strip>, z$1.ZodObject<{
487
- echoedTwiceMessage: z$1.ZodString;
564
+ delete: _orpc_contract0.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
565
+ rowId: zod.ZodUUID;
566
+ }, zod_v4_core0.$strip>, zod.ZodObject<{
567
+ txid: zod.ZodNumber;
488
568
  }, zod_v4_core0.$strip>, Record<never, never>, Record<never, never>>;
489
569
  };
490
570
  };
491
571
  type ORPCRouterClient = ContractRouterClient<typeof contract>;
492
572
  //#endregion
493
- export { ColumnAddInputSchema, ColumnAddOutputSchema, ColumnDeleteInputSchema, ColumnDeleteOutputSchema, ColumnUpdateInputSchema, ColumnUpdateOutputSchema, CustomTableCreateInputSchema, CustomTableCreateOutputSchema, CustomTableDeleteInputSchema, CustomTableDeleteOutputSchema, CustomTableGetInputSchema, CustomTableGetOutputSchema, CustomTableListInputSchema, CustomTableListItemSchema, CustomTableListOutputSchema, CustomTableUpdateInputSchema, CustomTableUpdateOutputSchema, EchoInputSchema, EchoOutputSchema, EchoTwiceOutputSchema, ORPCRouterClient, RowAddInputSchema, RowAddOutputSchema, RowDeleteInputSchema, RowDeleteOutputSchema, RowUpdateInputSchema, RowUpdateOutputSchema, TableColumnSchema, TableRowSchema, TableViewSchema, contract };
573
+ export { ColumnAddInputSchema, ColumnAddOutputSchema, ColumnDeleteInputSchema, ColumnDeleteOutputSchema, ColumnUpdateInputSchema, ColumnUpdateOutputSchema, CustomTableCreateInput, CustomTableCreateInputSchema, CustomTableCreateOutput, CustomTableCreateOutputSchema, CustomTableDeleteInput, CustomTableDeleteInputSchema, CustomTableDeleteOutput, CustomTableDeleteOutputSchema, CustomTableGetInput, CustomTableGetInputSchema, CustomTableGetOutput, CustomTableGetOutputSchema, CustomTableGetSchemaInput, CustomTableGetSchemaInputSchema, CustomTableGetSchemaOutput, CustomTableGetSchemaOutputSchema, CustomTableListInput, CustomTableListInputSchema, CustomTableListItem, CustomTableListItemSchema, CustomTableListOutput, CustomTableListOutputSchema, CustomTableUpdateInput, CustomTableUpdateInputSchema, CustomTableUpdateOutput, CustomTableUpdateOutputSchema, ORPCRouterClient, RowAddInput, RowAddInputSchema, RowAddOutput, RowAddOutputSchema, RowDeleteInput, RowDeleteInputSchema, RowDeleteOutput, RowDeleteOutputSchema, RowUpdateInput, RowUpdateInputSchema, RowUpdateOutput, RowUpdateOutputSchema, TableColumn, TableColumnSchema, TableRow, TableRowSchema, TableView, TableViewSchema, contract };
574
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,229 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { COLUMN_MAX_WIDTH, COLUMN_MIN_WIDTH, columnConfigSchema } from "@read-frog/definitions";
3
+ import { z } from "zod";
4
+
5
+ //#region src/schemas/column.ts
6
+ const ColumnAddInputSchema = z.object({
7
+ tableId: z.uuid(),
8
+ data: z.object({
9
+ id: z.uuid().optional(),
10
+ name: z.string().min(1),
11
+ config: columnConfigSchema,
12
+ position: z.number().int().optional()
13
+ }).strict()
14
+ });
15
+ const ColumnAddOutputSchema = z.object({ txid: z.number() });
16
+ const ColumnUpdateInputSchema = z.object({
17
+ columnId: z.uuid(),
18
+ data: z.object({
19
+ name: z.string().min(1).optional(),
20
+ config: columnConfigSchema.optional(),
21
+ width: z.number().int().min(COLUMN_MIN_WIDTH).max(COLUMN_MAX_WIDTH).nullable().optional()
22
+ }).strict()
23
+ });
24
+ const ColumnUpdateOutputSchema = z.object({ txid: z.number() });
25
+ const ColumnDeleteInputSchema = z.object({ columnId: z.uuid() });
26
+ const ColumnDeleteOutputSchema = z.object({ txid: z.number() });
27
+
28
+ //#endregion
29
+ //#region src/contracts/column.ts
30
+ const columnContract = {
31
+ add: oc.route({
32
+ method: "POST",
33
+ path: "/columns",
34
+ summary: "Add column to table",
35
+ tags: ["Columns"]
36
+ }).input(ColumnAddInputSchema).output(ColumnAddOutputSchema),
37
+ update: oc.route({
38
+ method: "PATCH",
39
+ path: "/columns/{columnId}",
40
+ summary: "Update column name",
41
+ tags: ["Columns"]
42
+ }).input(ColumnUpdateInputSchema).output(ColumnUpdateOutputSchema),
43
+ delete: oc.route({
44
+ method: "DELETE",
45
+ path: "/columns/{columnId}",
46
+ summary: "Delete column",
47
+ tags: ["Columns"]
48
+ }).input(ColumnDeleteInputSchema).output(ColumnDeleteOutputSchema)
49
+ };
50
+
51
+ //#endregion
52
+ //#region src/schemas/custom-table.ts
53
+ const CustomTableListInputSchema = z.object({});
54
+ const CustomTableListItemSchema = z.object({
55
+ id: z.string(),
56
+ name: z.string()
57
+ });
58
+ const CustomTableListOutputSchema = z.array(CustomTableListItemSchema);
59
+ const CustomTableCreateInputSchema = z.object({
60
+ id: z.uuid().optional(),
61
+ name: z.string().min(1)
62
+ });
63
+ const CustomTableCreateOutputSchema = z.object({ txid: z.number() });
64
+ const CustomTableUpdateInputSchema = z.object({
65
+ id: z.uuid(),
66
+ name: z.string().min(1).optional()
67
+ });
68
+ const CustomTableUpdateOutputSchema = z.object({ txid: z.number() });
69
+ const CustomTableDeleteInputSchema = z.object({ id: z.uuid() });
70
+ const CustomTableDeleteOutputSchema = z.object({ txid: z.number() });
71
+ const CustomTableGetInputSchema = z.object({ id: z.uuid() });
72
+ const CustomTableGetSchemaInputSchema = z.object({ id: z.uuid() });
73
+ const TableColumnSchema = z.object({
74
+ id: z.string(),
75
+ tableId: z.string(),
76
+ name: z.string(),
77
+ config: columnConfigSchema,
78
+ position: z.number(),
79
+ isPrimary: z.boolean(),
80
+ width: z.number().nullable(),
81
+ createdAt: z.coerce.date(),
82
+ updatedAt: z.coerce.date()
83
+ });
84
+ const TableRowSchema = z.object({
85
+ id: z.string(),
86
+ tableId: z.string(),
87
+ cells: z.record(z.string(), z.unknown()),
88
+ position: z.number().nullable(),
89
+ createdAt: z.coerce.date(),
90
+ updatedAt: z.coerce.date()
91
+ });
92
+ const TableViewSchema = z.object({
93
+ id: z.string(),
94
+ tableId: z.string(),
95
+ name: z.string(),
96
+ type: z.enum([
97
+ "table",
98
+ "kanban",
99
+ "gallery"
100
+ ]),
101
+ config: z.record(z.string(), z.unknown()).nullable(),
102
+ filters: z.array(z.unknown()).nullable(),
103
+ sorts: z.array(z.unknown()).nullable(),
104
+ position: z.number(),
105
+ createdAt: z.coerce.date(),
106
+ updatedAt: z.coerce.date()
107
+ });
108
+ const CustomTableGetOutputSchema = z.object({
109
+ id: z.string(),
110
+ userId: z.string(),
111
+ name: z.string(),
112
+ createdAt: z.coerce.date(),
113
+ updatedAt: z.coerce.date(),
114
+ columns: z.array(TableColumnSchema),
115
+ rows: z.array(TableRowSchema),
116
+ views: z.array(TableViewSchema)
117
+ });
118
+ const CustomTableGetSchemaOutputSchema = z.object({
119
+ id: z.string(),
120
+ name: z.string(),
121
+ updatedAt: z.coerce.date(),
122
+ columns: z.array(TableColumnSchema)
123
+ });
124
+
125
+ //#endregion
126
+ //#region src/contracts/custom-table.ts
127
+ const customTableContract = {
128
+ list: oc.route({
129
+ method: "GET",
130
+ path: "/custom-tables",
131
+ summary: "List custom tables",
132
+ tags: ["Custom Tables"]
133
+ }).input(CustomTableListInputSchema).output(CustomTableListOutputSchema),
134
+ get: oc.route({
135
+ method: "GET",
136
+ path: "/custom-tables/{id}",
137
+ summary: "Get custom table with columns, rows, and views",
138
+ tags: ["Custom Tables"]
139
+ }).input(CustomTableGetInputSchema).output(CustomTableGetOutputSchema),
140
+ getSchema: oc.route({
141
+ method: "GET",
142
+ path: "/custom-tables/{id}/schema",
143
+ summary: "Get custom table schema",
144
+ tags: ["Custom Tables"]
145
+ }).input(CustomTableGetSchemaInputSchema).output(CustomTableGetSchemaOutputSchema),
146
+ create: oc.route({
147
+ method: "POST",
148
+ path: "/custom-tables",
149
+ summary: "Create custom table",
150
+ tags: ["Custom Tables"]
151
+ }).input(CustomTableCreateInputSchema).output(CustomTableCreateOutputSchema),
152
+ update: oc.route({
153
+ method: "PUT",
154
+ path: "/custom-tables/{id}",
155
+ summary: "Update custom table",
156
+ tags: ["Custom Tables"]
157
+ }).input(CustomTableUpdateInputSchema).output(CustomTableUpdateOutputSchema),
158
+ delete: oc.route({
159
+ method: "DELETE",
160
+ path: "/custom-tables/{id}",
161
+ summary: "Delete custom table",
162
+ tags: ["Custom Tables"]
163
+ }).input(CustomTableDeleteInputSchema).output(CustomTableDeleteOutputSchema)
164
+ };
165
+
166
+ //#endregion
167
+ //#region src/schemas/row.ts
168
+ const RowAddInputSchema = z.object({
169
+ tableId: z.uuid(),
170
+ data: z.object({
171
+ id: z.uuid().optional(),
172
+ cells: z.record(z.string(), z.unknown()),
173
+ position: z.number().int().optional()
174
+ }).strict()
175
+ });
176
+ const RowAddOutputSchema = z.object({ txid: z.number() });
177
+ const RowUpdateInputSchema = z.object({
178
+ rowId: z.uuid(),
179
+ data: z.object({
180
+ cells: z.record(z.string(), z.unknown()).optional(),
181
+ position: z.number().int().optional()
182
+ }).strict()
183
+ });
184
+ const RowUpdateOutputSchema = z.object({
185
+ id: z.uuid(),
186
+ tableId: z.uuid(),
187
+ cells: z.record(z.string(), z.unknown()),
188
+ position: z.number().int().nullable(),
189
+ createdAt: z.date(),
190
+ updatedAt: z.date(),
191
+ txid: z.number()
192
+ });
193
+ const RowDeleteInputSchema = z.object({ rowId: z.uuid() });
194
+ const RowDeleteOutputSchema = z.object({ txid: z.number() });
195
+
196
+ //#endregion
197
+ //#region src/contracts/row.ts
198
+ const rowContract = {
199
+ add: oc.route({
200
+ method: "POST",
201
+ path: "/rows",
202
+ summary: "Add row to table",
203
+ tags: ["Rows"]
204
+ }).input(RowAddInputSchema).output(RowAddOutputSchema),
205
+ update: oc.route({
206
+ method: "PATCH",
207
+ path: "/rows/{rowId}",
208
+ summary: "Update row cells",
209
+ tags: ["Rows"]
210
+ }).input(RowUpdateInputSchema).output(RowUpdateOutputSchema),
211
+ delete: oc.route({
212
+ method: "DELETE",
213
+ path: "/rows/{rowId}",
214
+ summary: "Delete row",
215
+ tags: ["Rows"]
216
+ }).input(RowDeleteInputSchema).output(RowDeleteOutputSchema)
217
+ };
218
+
219
+ //#endregion
220
+ //#region src/index.ts
221
+ const contract = {
222
+ customTable: customTableContract,
223
+ column: columnContract,
224
+ row: rowContract
225
+ };
226
+
227
+ //#endregion
228
+ export { ColumnAddInputSchema, ColumnAddOutputSchema, ColumnDeleteInputSchema, ColumnDeleteOutputSchema, ColumnUpdateInputSchema, ColumnUpdateOutputSchema, CustomTableCreateInputSchema, CustomTableCreateOutputSchema, CustomTableDeleteInputSchema, CustomTableDeleteOutputSchema, CustomTableGetInputSchema, CustomTableGetOutputSchema, CustomTableGetSchemaInputSchema, CustomTableGetSchemaOutputSchema, CustomTableListInputSchema, CustomTableListItemSchema, CustomTableListOutputSchema, CustomTableUpdateInputSchema, CustomTableUpdateOutputSchema, RowAddInputSchema, RowAddOutputSchema, RowDeleteInputSchema, RowDeleteOutputSchema, RowUpdateInputSchema, RowUpdateOutputSchema, TableColumnSchema, TableRowSchema, TableViewSchema, contract };
229
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/schemas/column.ts","../src/contracts/column.ts","../src/schemas/custom-table.ts","../src/contracts/custom-table.ts","../src/schemas/row.ts","../src/contracts/row.ts","../src/index.ts"],"sourcesContent":["import { COLUMN_MAX_WIDTH, COLUMN_MIN_WIDTH, columnConfigSchema } from '@read-frog/definitions'\nimport { z } from 'zod'\n\nexport const ColumnAddInputSchema = z.object({\n tableId: z.uuid(),\n data: z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n config: columnConfigSchema,\n position: z.number().int().optional(),\n }).strict(),\n})\n\nexport const ColumnAddOutputSchema = z.object({\n txid: z.number(),\n})\n\nexport const ColumnUpdateInputSchema = z.object({\n columnId: z.uuid(),\n data: z.object({\n name: z.string().min(1).optional(),\n config: columnConfigSchema.optional(),\n width: z.number().int().min(COLUMN_MIN_WIDTH).max(COLUMN_MAX_WIDTH).nullable().optional(),\n }).strict(),\n})\n\nexport const ColumnUpdateOutputSchema = z.object({\n txid: z.number(),\n})\n\nexport const ColumnDeleteInputSchema = z.object({\n columnId: z.uuid(),\n})\n\nexport const ColumnDeleteOutputSchema = z.object({\n txid: z.number(),\n})\n","import { oc } from '@orpc/contract'\nimport {\n ColumnAddInputSchema,\n ColumnAddOutputSchema,\n ColumnDeleteInputSchema,\n ColumnDeleteOutputSchema,\n ColumnUpdateInputSchema,\n ColumnUpdateOutputSchema,\n} from '@/schemas/column'\n\nexport const columnContract = {\n add: oc\n .route({\n method: 'POST',\n path: '/columns',\n summary: 'Add column to table',\n tags: ['Columns'],\n })\n .input(ColumnAddInputSchema)\n .output(ColumnAddOutputSchema),\n\n update: oc\n .route({\n method: 'PATCH',\n path: '/columns/{columnId}',\n summary: 'Update column name',\n tags: ['Columns'],\n })\n .input(ColumnUpdateInputSchema)\n .output(ColumnUpdateOutputSchema),\n\n delete: oc\n .route({\n method: 'DELETE',\n path: '/columns/{columnId}',\n summary: 'Delete column',\n tags: ['Columns'],\n })\n .input(ColumnDeleteInputSchema)\n .output(ColumnDeleteOutputSchema),\n}\n","import { columnConfigSchema } from '@read-frog/definitions'\nimport { z } from 'zod'\n\nexport const CustomTableListInputSchema = z.object({})\nexport type CustomTableListInput = z.infer<typeof CustomTableListInputSchema>\n\nexport const CustomTableListItemSchema = z.object({\n id: z.string(),\n name: z.string(),\n})\nexport type CustomTableListItem = z.infer<typeof CustomTableListItemSchema>\n\nexport const CustomTableListOutputSchema = z.array(CustomTableListItemSchema)\nexport type CustomTableListOutput = z.infer<typeof CustomTableListOutputSchema>\n\nexport const CustomTableCreateInputSchema = z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n})\nexport type CustomTableCreateInput = z.infer<typeof CustomTableCreateInputSchema>\n\nexport const CustomTableCreateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type CustomTableCreateOutput = z.infer<typeof CustomTableCreateOutputSchema>\n\nexport const CustomTableUpdateInputSchema = z.object({\n id: z.uuid(),\n name: z.string().min(1).optional(),\n})\nexport type CustomTableUpdateInput = z.infer<typeof CustomTableUpdateInputSchema>\n\nexport const CustomTableUpdateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type CustomTableUpdateOutput = z.infer<typeof CustomTableUpdateOutputSchema>\n\nexport const CustomTableDeleteInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CustomTableDeleteInput = z.infer<typeof CustomTableDeleteInputSchema>\n\nexport const CustomTableDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type CustomTableDeleteOutput = z.infer<typeof CustomTableDeleteOutputSchema>\n\n// Get endpoint schemas\nexport const CustomTableGetInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CustomTableGetInput = z.infer<typeof CustomTableGetInputSchema>\n\nexport const CustomTableGetSchemaInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CustomTableGetSchemaInput = z.infer<typeof CustomTableGetSchemaInputSchema>\n\nexport const TableColumnSchema = z.object({\n id: z.string(),\n tableId: z.string(),\n name: z.string(),\n config: columnConfigSchema,\n position: z.number(),\n isPrimary: z.boolean(),\n width: z.number().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type TableColumn = z.infer<typeof TableColumnSchema>\n\nexport const TableRowSchema = z.object({\n id: z.string(),\n tableId: z.string(),\n cells: z.record(z.string(), z.unknown()),\n position: z.number().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type TableRow = z.infer<typeof TableRowSchema>\n\nexport const TableViewSchema = z.object({\n id: z.string(),\n tableId: z.string(),\n name: z.string(),\n type: z.enum(['table', 'kanban', 'gallery']),\n config: z.record(z.string(), z.unknown()).nullable(),\n filters: z.array(z.unknown()).nullable(),\n sorts: z.array(z.unknown()).nullable(),\n position: z.number(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type TableView = z.infer<typeof TableViewSchema>\n\nexport const CustomTableGetOutputSchema = z.object({\n id: z.string(),\n userId: z.string(),\n name: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n columns: z.array(TableColumnSchema),\n rows: z.array(TableRowSchema),\n views: z.array(TableViewSchema),\n})\nexport type CustomTableGetOutput = z.infer<typeof CustomTableGetOutputSchema>\n\nexport const CustomTableGetSchemaOutputSchema = z.object({\n id: z.string(),\n name: z.string(),\n updatedAt: z.coerce.date(),\n columns: z.array(TableColumnSchema),\n})\nexport type CustomTableGetSchemaOutput = z.infer<typeof CustomTableGetSchemaOutputSchema>\n","import { oc } from '@orpc/contract'\nimport {\n CustomTableCreateInputSchema,\n CustomTableCreateOutputSchema,\n CustomTableDeleteInputSchema,\n CustomTableDeleteOutputSchema,\n CustomTableGetInputSchema,\n CustomTableGetOutputSchema,\n CustomTableGetSchemaInputSchema,\n CustomTableGetSchemaOutputSchema,\n CustomTableListInputSchema,\n CustomTableListOutputSchema,\n CustomTableUpdateInputSchema,\n CustomTableUpdateOutputSchema,\n} from '@/schemas/custom-table'\n\nexport const customTableContract = {\n list: oc\n .route({\n method: 'GET',\n path: '/custom-tables',\n summary: 'List custom tables',\n tags: ['Custom Tables'],\n })\n .input(CustomTableListInputSchema)\n .output(CustomTableListOutputSchema),\n\n get: oc\n .route({\n method: 'GET',\n path: '/custom-tables/{id}',\n summary: 'Get custom table with columns, rows, and views',\n tags: ['Custom Tables'],\n })\n .input(CustomTableGetInputSchema)\n .output(CustomTableGetOutputSchema),\n\n getSchema: oc\n .route({\n method: 'GET',\n path: '/custom-tables/{id}/schema',\n summary: 'Get custom table schema',\n tags: ['Custom Tables'],\n })\n .input(CustomTableGetSchemaInputSchema)\n .output(CustomTableGetSchemaOutputSchema),\n\n create: oc\n .route({\n method: 'POST',\n path: '/custom-tables',\n summary: 'Create custom table',\n tags: ['Custom Tables'],\n })\n .input(CustomTableCreateInputSchema)\n .output(CustomTableCreateOutputSchema),\n\n update: oc\n .route({\n method: 'PUT',\n path: '/custom-tables/{id}',\n summary: 'Update custom table',\n tags: ['Custom Tables'],\n })\n .input(CustomTableUpdateInputSchema)\n .output(CustomTableUpdateOutputSchema),\n\n delete: oc\n .route({\n method: 'DELETE',\n path: '/custom-tables/{id}',\n summary: 'Delete custom table',\n tags: ['Custom Tables'],\n })\n .input(CustomTableDeleteInputSchema)\n .output(CustomTableDeleteOutputSchema),\n}\n","import { z } from 'zod'\n\nexport const RowAddInputSchema = z.object({\n tableId: z.uuid(),\n data: z.object({\n id: z.uuid().optional(),\n cells: z.record(z.string(), z.unknown()),\n position: z.number().int().optional(),\n }).strict(),\n})\nexport type RowAddInput = z.infer<typeof RowAddInputSchema>\n\nexport const RowAddOutputSchema = z.object({\n txid: z.number(),\n})\nexport type RowAddOutput = z.infer<typeof RowAddOutputSchema>\n\nexport const RowUpdateInputSchema = z.object({\n rowId: z.uuid(),\n data: z.object({\n cells: z.record(z.string(), z.unknown()).optional(),\n position: z.number().int().optional(),\n }).strict(),\n})\nexport type RowUpdateInput = z.infer<typeof RowUpdateInputSchema>\n\nexport const RowUpdateOutputSchema = z.object({\n id: z.uuid(),\n tableId: z.uuid(),\n cells: z.record(z.string(), z.unknown()),\n position: z.number().int().nullable(),\n createdAt: z.date(),\n updatedAt: z.date(),\n txid: z.number(),\n})\nexport type RowUpdateOutput = z.infer<typeof RowUpdateOutputSchema>\n\nexport const RowDeleteInputSchema = z.object({\n rowId: z.uuid(),\n})\nexport type RowDeleteInput = z.infer<typeof RowDeleteInputSchema>\n\nexport const RowDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type RowDeleteOutput = z.infer<typeof RowDeleteOutputSchema>\n","import { oc } from '@orpc/contract'\nimport {\n RowAddInputSchema,\n RowAddOutputSchema,\n RowDeleteInputSchema,\n RowDeleteOutputSchema,\n RowUpdateInputSchema,\n RowUpdateOutputSchema,\n} from '@/schemas/row'\n\nexport const rowContract = {\n add: oc\n .route({\n method: 'POST',\n path: '/rows',\n summary: 'Add row to table',\n tags: ['Rows'],\n })\n .input(RowAddInputSchema)\n .output(RowAddOutputSchema),\n\n update: oc\n .route({\n method: 'PATCH',\n path: '/rows/{rowId}',\n summary: 'Update row cells',\n tags: ['Rows'],\n })\n .input(RowUpdateInputSchema)\n .output(RowUpdateOutputSchema),\n\n delete: oc\n .route({\n method: 'DELETE',\n path: '/rows/{rowId}',\n summary: 'Delete row',\n tags: ['Rows'],\n })\n .input(RowDeleteInputSchema)\n .output(RowDeleteOutputSchema),\n}\n","import type { ContractRouterClient } from '@orpc/contract'\nimport { columnContract } from './contracts/column'\nimport { customTableContract } from './contracts/custom-table'\nimport { rowContract } from './contracts/row'\n\nexport const contract = {\n customTable: customTableContract,\n column: columnContract,\n row: rowContract,\n}\n\nexport type ORPCRouterClient = ContractRouterClient<typeof contract>\n\n// Re-export schemas for convenience\nexport * from './schemas/column'\nexport * from './schemas/custom-table'\nexport * from './schemas/row'\n"],"mappings":";;;;;AAGA,MAAa,uBAAuB,EAAE,OAAO;CAC3C,SAAS,EAAE,MAAM;CACjB,MAAM,EAAE,OAAO;EACb,IAAI,EAAE,MAAM,CAAC,UAAU;EACvB,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE;EACvB,QAAQ;EACR,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACtC,CAAC,CAAC,QAAQ;CACZ,CAAC;AAEF,MAAa,wBAAwB,EAAE,OAAO,EAC5C,MAAM,EAAE,QAAQ,EACjB,CAAC;AAEF,MAAa,0BAA0B,EAAE,OAAO;CAC9C,UAAU,EAAE,MAAM;CAClB,MAAM,EAAE,OAAO;EACb,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,UAAU;EAClC,QAAQ,mBAAmB,UAAU;EACrC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,IAAI,iBAAiB,CAAC,UAAU,CAAC,UAAU;EAC1F,CAAC,CAAC,QAAQ;CACZ,CAAC;AAEF,MAAa,2BAA2B,EAAE,OAAO,EAC/C,MAAM,EAAE,QAAQ,EACjB,CAAC;AAEF,MAAa,0BAA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OAAO,sBAAsB;CAEhC,QAAQ,GACL,MAAM;EACL,QAAQ;EACR,MAAM;EACN,SAAS;EACT,MAAM,CAAC,OAAO;EACf,CAAC,CACD,MAAM,qBAAqB,CAC3B,OAAO,sBAAsB;CACjC;;;;ACnCD,MAAa,WAAW;CACtB,aAAa;CACb,QAAQ;CACR,KAAK;CACN"}
package/package.json CHANGED
@@ -1,30 +1,36 @@
1
1
  {
2
2
  "name": "@read-frog/api-contract",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.2.1",
5
5
  "private": false,
6
6
  "exports": {
7
- ".": "./dist/index.d.ts"
7
+ ".": {
8
+ "import": "./dist/index.js",
9
+ "types": "./dist/index.d.ts"
10
+ }
8
11
  },
9
- "main": "./dist/index.d.ts",
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
10
14
  "files": [
11
15
  "dist"
12
16
  ],
13
17
  "dependencies": {
14
- "@orpc/contract": "^1.13.4",
18
+ "@orpc/contract": "^1.13.5",
15
19
  "zod": "^4.3.6",
16
- "@read-frog/definitions": "0.1.1"
20
+ "@read-frog/definitions": "0.1.2"
17
21
  },
18
22
  "devDependencies": {
19
- "@types/node": "^25.2.1",
23
+ "@types/node": "^25.5.0",
20
24
  "tsdown": "^0.20.3",
21
25
  "@repo/eslint-config": "0.0.0",
26
+ "@repo/tsdown-config": "0.0.0",
22
27
  "@repo/typescript-config": "0.0.0"
23
28
  },
24
29
  "scripts": {
30
+ "build": "tsdown",
31
+ "dev": "tsdown --watch",
25
32
  "build:publish": "tsdown",
26
33
  "lint": "eslint .",
27
34
  "lint:fix": "eslint --fix"
28
- },
29
- "types": "./dist/index.d.ts"
35
+ }
30
36
  }