@synap-core/api-types 1.0.23 → 1.0.30

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.
@@ -1,3052 +1,38 @@
1
- import { EventRecord } from '@synap/database';
2
- import { GeneratedEventType } from '@synap/events';
3
- import { StructuredViewConfig } from '@synap-core/types';
4
- import { TableAction } from '@synap/events';
5
- import { TRPCBuiltRouter } from '@trpc/server';
6
- import { TRPCCreateRouterOptions } from '@trpc/server';
7
- import { TRPCDecorateCreateRouterOptions } from '@trpc/server';
8
- import { TRPCDefaultErrorShape } from '@trpc/server';
9
- import { TRPCMutationProcedure } from '@trpc/server';
10
- import { TRPCQueryProcedure } from '@trpc/server';
11
- import { ViewCategory } from '@synap-core/types';
12
- import { WorkerMetadata } from '@synap/jobs';
13
- import { WorkspaceSettings } from '@synap/database';
14
-
15
1
  export declare type AppRouter = typeof coreRouter;
16
2
 
17
- /**
18
- * Full tRPC context
19
- */
20
- declare interface Context {
21
- db: DatabaseClient;
22
- authenticated: boolean;
23
- userId?: string | null;
24
- user?: User | null;
25
- session?: KratosSession | null;
26
- req?: Request;
27
- socketIO?: any;
28
- }
29
-
30
3
  /**
31
4
  * Core API Router
32
5
  */
33
- declare const coreRouter: TRPCBuiltRouter< {
34
- ctx: Context;
35
- meta: object;
36
- errorShape: TRPCDefaultErrorShape;
37
- transformer: true;
38
- }, TRPCDecorateCreateRouterOptions< {
39
- setup: TRPCBuiltRouter< {
40
- ctx: Context;
41
- meta: object;
42
- errorShape: TRPCDefaultErrorShape;
43
- transformer: true;
44
- }, TRPCDecorateCreateRouterOptions< {
45
- status: TRPCQueryProcedure< {
46
- input: void;
47
- output: {
48
- initialized: boolean;
49
- version: string;
50
- };
51
- meta: object;
52
- }>;
53
- }>>;
54
- events: TRPCBuiltRouter< {
55
- ctx: Context;
56
- meta: object;
57
- errorShape: TRPCDefaultErrorShape;
58
- transformer: true;
59
- }, TRPCDecorateCreateRouterOptions< {
60
- log: TRPCMutationProcedure< {
61
- input: {
62
- data: Record<string, unknown>;
63
- version: number;
64
- subjectId: string;
65
- subjectType: "user" | "system" | "entity" | "relation";
66
- eventType: string;
67
- metadata?: Record<string, unknown> | undefined;
68
- source?: "system" | "api" | "automation" | "sync" | "migration" | undefined;
69
- correlationId?: string | undefined;
70
- causationId?: string | undefined;
71
- };
72
- output: EventRecord;
73
- meta: object;
74
- }>;
75
- list: TRPCQueryProcedure< {
76
- input: {
77
- type?: string | undefined;
78
- limit?: number | undefined;
79
- };
80
- output: EventRecord[];
81
- meta: object;
82
- }>;
83
- }>>;
84
- capture: TRPCBuiltRouter< {
85
- ctx: Context;
86
- meta: object;
87
- errorShape: TRPCDefaultErrorShape;
88
- transformer: true;
89
- }, TRPCDecorateCreateRouterOptions< {
90
- thought: TRPCMutationProcedure< {
91
- input: {
92
- content: string;
93
- context?: Record<string, any> | undefined;
94
- };
95
- output: {
96
- success: boolean;
97
- message: string;
98
- requestId: string;
99
- mode: string;
100
- } | {
101
- success: boolean;
102
- message: string;
103
- mode: string;
104
- requestId?: undefined;
105
- };
106
- meta: object;
107
- }>;
108
- }>>;
109
- entities: TRPCBuiltRouter< {
110
- ctx: Context;
111
- meta: object;
112
- errorShape: TRPCDefaultErrorShape;
113
- transformer: true;
114
- }, TRPCDecorateCreateRouterOptions< {
115
- create: TRPCMutationProcedure< {
116
- input: {
117
- type: "note" | "task" | "project" | "contact" | "meeting" | "idea";
118
- workspaceId: string;
119
- description?: string | undefined;
120
- title?: string | null | undefined;
121
- documentId?: string | null | undefined;
122
- };
123
- output: {
124
- status: string;
125
- message: string;
126
- id: `${string}-${string}-${string}-${string}-${string}`;
127
- entity: {
128
- id: `${string}-${string}-${string}-${string}-${string}`;
129
- type: "note" | "task" | "project" | "contact" | "meeting" | "idea";
130
- title: string | null | undefined;
131
- preview: string | undefined;
132
- userId: string;
133
- workspaceId: string;
134
- documentId: string | null | undefined;
135
- createdAt: Date;
136
- updatedAt: Date;
137
- };
138
- };
139
- meta: object;
140
- }>;
141
- list: TRPCQueryProcedure< {
142
- input: {
143
- type?: "note" | "task" | "project" | "contact" | "meeting" | "idea" | undefined;
144
- limit?: number | undefined;
145
- workspaceId?: string | undefined;
146
- };
147
- output: {
148
- entities: {
149
- userId: string;
150
- id: string;
151
- createdAt: Date;
152
- type: string;
153
- title: string | null;
154
- metadata: unknown;
155
- workspaceId: string;
156
- documentId: string | null;
157
- preview: string | null;
158
- updatedAt: Date;
159
- projectIds: string[] | null;
160
- version: number;
161
- deletedAt: Date | null;
162
- }[];
163
- };
164
- meta: object;
165
- }>;
166
- search: TRPCQueryProcedure< {
167
- input: {
168
- query: string;
169
- type?: "note" | "task" | "project" | "contact" | "meeting" | "idea" | undefined;
170
- limit?: number | undefined;
171
- };
172
- output: {
173
- entities: {
174
- userId: string;
175
- id: string;
176
- createdAt: Date;
177
- type: string;
178
- title: string | null;
179
- metadata: unknown;
180
- workspaceId: string;
181
- documentId: string | null;
182
- preview: string | null;
183
- updatedAt: Date;
184
- projectIds: string[] | null;
185
- version: number;
186
- deletedAt: Date | null;
187
- }[];
188
- };
189
- meta: object;
190
- }>;
191
- get: TRPCQueryProcedure< {
192
- input: {
193
- id: string;
194
- };
195
- output: {
196
- entity: {
197
- userId: string;
198
- id: string;
199
- createdAt: Date;
200
- type: string;
201
- title: string | null;
202
- metadata: unknown;
203
- workspaceId: string;
204
- documentId: string | null;
205
- preview: string | null;
206
- updatedAt: Date;
207
- projectIds: string[] | null;
208
- version: number;
209
- deletedAt: Date | null;
210
- };
211
- };
212
- meta: object;
213
- }>;
214
- update: TRPCMutationProcedure< {
215
- input: {
216
- id: string;
217
- type: string;
218
- workspaceId: string;
219
- title?: string | null | undefined;
220
- documentId?: string | null | undefined;
221
- preview?: string | null | undefined;
222
- };
223
- output: {
224
- status: string;
225
- message: string;
226
- };
227
- meta: object;
228
- }>;
229
- delete: TRPCMutationProcedure< {
230
- input: {
231
- id: string;
232
- };
233
- output: {
234
- status: string;
235
- message: string;
236
- };
237
- meta: object;
238
- }>;
239
- }>>;
240
- chat: TRPCBuiltRouter< {
241
- ctx: Context;
242
- meta: object;
243
- errorShape: TRPCDefaultErrorShape;
244
- transformer: true;
245
- }, TRPCDecorateCreateRouterOptions<TRPCCreateRouterOptions>>;
246
- proposals: TRPCBuiltRouter< {
247
- ctx: Context;
248
- meta: object;
249
- errorShape: TRPCDefaultErrorShape;
250
- transformer: true;
251
- }, TRPCDecorateCreateRouterOptions< {
252
- list: TRPCQueryProcedure< {
253
- input: {
254
- status?: "all" | "pending" | "validated" | "rejected" | undefined;
255
- limit?: number | undefined;
256
- workspaceId?: string | undefined;
257
- targetType?: "document" | "entity" | "whiteboard" | "view" | undefined;
258
- targetId?: string | undefined;
259
- };
260
- output: {
261
- proposals: {
262
- id: string;
263
- createdAt: Date;
264
- status: string;
265
- workspaceId: string;
266
- updatedAt: Date;
267
- targetType: string;
268
- targetId: string;
269
- request: unknown;
270
- reviewedBy: string | null;
271
- reviewedAt: Date | null;
272
- rejectionReason: string | null;
273
- }[];
274
- };
275
- meta: object;
276
- }>;
277
- approve: TRPCMutationProcedure< {
278
- input: {
279
- proposalId: string;
280
- comment?: string | undefined;
281
- };
282
- output: {
283
- success: boolean;
284
- };
285
- meta: object;
286
- }>;
287
- reject: TRPCMutationProcedure< {
288
- input: {
289
- proposalId: string;
290
- reason?: string | undefined;
291
- };
292
- output: {
293
- success: boolean;
294
- };
295
- meta: object;
296
- }>;
297
- submit: TRPCMutationProcedure< {
298
- input: {
299
- data: Record<string, any>;
300
- targetType: "document" | "entity" | "relation" | "view" | "workspace";
301
- changeType: "delete" | "create" | "update";
302
- reasoning?: string | undefined;
303
- targetId?: string | undefined;
304
- };
305
- output: {
306
- success: boolean;
307
- requestId: `${string}-${string}-${string}-${string}-${string}`;
308
- status: string;
309
- message: string;
310
- };
311
- meta: object;
312
- }>;
313
- }>>;
314
- suggestions: TRPCBuiltRouter< {
315
- ctx: Context;
316
- meta: object;
317
- errorShape: TRPCDefaultErrorShape;
318
- transformer: true;
319
- }, TRPCDecorateCreateRouterOptions< {}>>;
320
- system: TRPCBuiltRouter< {
321
- ctx: Context;
322
- meta: object;
323
- errorShape: TRPCDefaultErrorShape;
324
- transformer: true;
325
- }, TRPCDecorateCreateRouterOptions< {
326
- getCapabilities: TRPCQueryProcedure< {
327
- input: void;
328
- output: {
329
- eventTypes: ({
330
- type: GeneratedEventType;
331
- hasSchema: boolean;
332
- category: "generated";
333
- table: string | undefined;
334
- action: TableAction | undefined;
335
- } | {
336
- type: "webhooks.deliver.requested";
337
- hasSchema: boolean;
338
- category: "custom";
339
- })[];
340
- workers: WorkerMetadata[];
341
- tools: {
342
- name: string;
343
- description: string | undefined;
344
- version: string;
345
- source: string;
346
- }[];
347
- routers: {
348
- name: string;
349
- version: string;
350
- source: string;
351
- description: string | undefined;
352
- }[];
353
- stats: {
354
- totalEventTypes: number;
355
- totalHandlers: number;
356
- totalTools: number;
357
- totalRouters: number;
358
- connectedSSEClients: number;
359
- toolsBySource: Record<string, number>;
360
- routersBySource: Record<string, number>;
361
- };
362
- };
363
- meta: object;
364
- }>;
365
- getEventTypeSchema: TRPCQueryProcedure< {
366
- input: {
367
- eventType: string;
368
- };
369
- output: {
370
- hasSchema: boolean;
371
- fields: null;
372
- } | {
373
- hasSchema: boolean;
374
- fields: {
375
- name: string;
376
- type: string;
377
- required: boolean;
378
- description?: string;
379
- options?: string[];
380
- defaultValue?: unknown;
381
- }[];
382
- };
383
- meta: object;
384
- }>;
385
- publishEvent: TRPCMutationProcedure< {
386
- input: {
387
- userId: string;
388
- data: Record<string, unknown>;
389
- type: string;
390
- subjectId?: string | undefined;
391
- source?: "system" | "api" | "automation" | "sync" | "migration" | undefined;
392
- correlationId?: string | undefined;
393
- causationId?: string | undefined;
394
- };
395
- output: {
396
- success: boolean;
397
- eventId: string;
398
- timestamp: string;
399
- message: string;
400
- };
401
- meta: object;
402
- }>;
403
- getRecentEvents: TRPCQueryProcedure< {
404
- input: {
405
- userId?: string | undefined;
406
- limit?: number | undefined;
407
- eventType?: string | undefined;
408
- since?: string | undefined;
409
- };
410
- output: {
411
- events: {
412
- id: string;
413
- type: string;
414
- userId: string;
415
- timestamp: string;
416
- correlationId: string | undefined;
417
- isError: boolean;
418
- }[];
419
- total: number;
420
- timestamp: string;
421
- };
422
- meta: object;
423
- }>;
424
- getTrace: TRPCQueryProcedure< {
425
- input: {
426
- correlationId: string;
427
- };
428
- output: {
429
- correlationId: string;
430
- events: {
431
- id: string;
432
- type: string;
433
- timestamp: string;
434
- userId: string;
435
- subjectId: string;
436
- data: Record<string, unknown>;
437
- metadata: Record<string, unknown> | undefined;
438
- causationId: string | undefined;
439
- }[];
440
- totalEvents: number;
441
- };
442
- meta: object;
443
- }>;
444
- getEventTrace: TRPCQueryProcedure< {
445
- input: {
446
- eventId: string;
447
- };
448
- output: {
449
- event: {
450
- eventId: string;
451
- eventType: string;
452
- timestamp: string;
453
- userId: string;
454
- data: Record<string, unknown>;
455
- metadata: Record<string, unknown> | undefined;
456
- correlationId: string | undefined;
457
- };
458
- relatedEvents: {
459
- eventId: string;
460
- eventType: string;
461
- timestamp: string;
462
- userId: string;
463
- data: Record<string, unknown>;
464
- correlationId: string | undefined;
465
- }[];
466
- };
467
- meta: object;
468
- }>;
469
- searchEvents: TRPCQueryProcedure< {
470
- input: {
471
- userId?: string | undefined;
472
- limit?: number | undefined;
473
- subjectId?: string | undefined;
474
- subjectType?: string | undefined;
475
- correlationId?: string | undefined;
476
- offset?: number | undefined;
477
- eventType?: string | undefined;
478
- fromDate?: string | undefined;
479
- toDate?: string | undefined;
480
- };
481
- output: {
482
- events: {
483
- id: string;
484
- type: string;
485
- timestamp: string;
486
- userId: string;
487
- subjectId: string;
488
- subjectType: string;
489
- data: Record<string, unknown>;
490
- metadata: Record<string, unknown> | undefined;
491
- causationId: string | undefined;
492
- correlationId: string | undefined;
493
- source: string;
494
- }[];
495
- pagination: {
496
- total: number;
497
- limit: number;
498
- offset: number;
499
- hasMore: boolean;
500
- };
501
- };
502
- meta: object;
503
- }>;
504
- getToolSchema: TRPCQueryProcedure< {
505
- input: {
506
- toolName: string;
507
- };
508
- output: {
509
- name: string;
510
- description: string;
511
- schema: {
512
- type: string;
513
- properties: any;
514
- required: string[];
515
- };
516
- metadata: {
517
- version: string;
518
- source: string;
519
- registeredAt: string | undefined;
520
- };
521
- };
522
- meta: object;
523
- }>;
524
- executeTool: TRPCMutationProcedure< {
525
- input: {
526
- userId: string;
527
- toolName: string;
528
- parameters: Record<string, any>;
529
- threadId?: string | undefined;
530
- };
531
- output: {
532
- success: boolean;
533
- result: {
534
- result: any;
535
- };
536
- toolName: string;
537
- executedAt: string;
538
- };
539
- meta: object;
540
- }>;
541
- getDashboardMetrics: TRPCQueryProcedure< {
542
- input: void;
543
- output: {
544
- timestamp: string;
545
- health: {
546
- status: "healthy" | "degraded" | "critical";
547
- errorRate: number;
548
- };
549
- throughput: {
550
- eventsPerSecond: number;
551
- totalEventsLast5Min: number;
552
- };
553
- connections: {
554
- activeSSEClients: number;
555
- activeHandlers: number;
556
- };
557
- tools: {
558
- totalTools: number;
559
- totalExecutions: number;
560
- };
561
- latestEvents: {
562
- id: string;
563
- type: string;
564
- userId: string;
565
- timestamp: string;
566
- isError: boolean;
567
- }[];
568
- };
569
- meta: object;
570
- }>;
571
- getDatabaseTables: TRPCQueryProcedure< {
572
- input: void;
573
- output: any[];
574
- meta: object;
575
- }>;
576
- getDatabaseTableRows: TRPCQueryProcedure< {
577
- input: {
578
- tableName: string;
579
- limit?: number | undefined;
580
- offset?: number | undefined;
581
- };
582
- output: any[];
583
- meta: object;
584
- }>;
585
- }>>;
586
- hub: TRPCBuiltRouter< {
587
- ctx: Context;
588
- meta: object;
589
- errorShape: TRPCDefaultErrorShape;
590
- transformer: true;
591
- }, TRPCDecorateCreateRouterOptions< {
592
- generateAccessToken: TRPCMutationProcedure< {
593
- input: {
594
- scope: ("tasks" | "entities" | "projects" | "relations" | "preferences" | "calendar" | "notes" | "conversations" | "knowledge_facts")[];
595
- requestId: string;
596
- expiresIn?: number | undefined;
597
- };
598
- output: {
599
- token: string;
600
- expiresAt: number;
601
- requestId: string;
602
- };
603
- meta: object;
604
- }>;
605
- requestData: TRPCQueryProcedure< {
606
- input: {
607
- [x: string]: unknown;
608
- token: string;
609
- scope: ("tasks" | "entities" | "projects" | "relations" | "preferences" | "calendar" | "notes" | "conversations" | "knowledge_facts")[];
610
- filters?: {
611
- limit?: number | undefined;
612
- entityTypes?: string[] | undefined;
613
- offset?: number | undefined;
614
- dateRange?: {
615
- start: string;
616
- end: string;
617
- } | undefined;
618
- } | undefined;
619
- };
620
- output: {
621
- userId: string;
622
- requestId: string;
623
- data: Record<string, unknown>;
624
- metadata: {
625
- retrievedAt: string;
626
- scope: ("tasks" | "entities" | "projects" | "relations" | "preferences" | "calendar" | "notes" | "conversations" | "knowledge_facts")[];
627
- recordCount: number;
628
- };
629
- };
630
- meta: object;
631
- }>;
632
- submitInsight: TRPCMutationProcedure< {
633
- input: {
634
- [x: string]: unknown;
635
- token: string;
636
- insight?: any;
637
- };
638
- output: {
639
- success: boolean;
640
- requestId: string;
641
- eventIds: string[];
642
- eventsCreated: number;
643
- errors: {
644
- actionIndex: number;
645
- error: string;
646
- }[] | undefined;
647
- };
648
- meta: object;
649
- }>;
650
- }>>;
651
- apiKeys: TRPCBuiltRouter< {
652
- ctx: Context;
653
- meta: object;
654
- errorShape: TRPCDefaultErrorShape;
655
- transformer: true;
656
- }, TRPCDecorateCreateRouterOptions< {
657
- list: TRPCQueryProcedure< {
658
- input: void;
659
- output: {
660
- id: string;
661
- keyName: string;
662
- keyPrefix: string;
663
- hubId: string | null;
664
- scope: string[];
665
- isActive: boolean;
666
- expiresAt: Date | null;
667
- lastUsedAt: Date | null;
668
- usageCount: number;
669
- createdAt: Date;
670
- revokedAt: Date | null;
671
- revokedReason: string | null;
672
- }[];
673
- meta: object;
674
- }>;
675
- create: TRPCMutationProcedure< {
676
- input: {
677
- keyName: string;
678
- scope: string[];
679
- hubId?: string | undefined;
680
- expiresInDays?: number | undefined;
681
- };
682
- output: {
683
- id: `${string}-${string}-${string}-${string}-${string}`;
684
- key: string;
685
- keyPrefix: string;
686
- status: string;
687
- message: string;
688
- };
689
- meta: object;
690
- }>;
691
- revoke: TRPCMutationProcedure< {
692
- input: {
693
- keyId: string;
694
- reason?: string | undefined;
695
- };
696
- output: {
697
- status: string;
698
- message: string;
699
- };
700
- meta: object;
701
- }>;
702
- rotate: TRPCMutationProcedure< {
703
- input: {
704
- keyId: string;
705
- };
706
- output: {
707
- status: string;
708
- message: string;
709
- };
710
- meta: object;
711
- }>;
712
- }>>;
713
- health: TRPCBuiltRouter< {
714
- ctx: Context;
715
- meta: object;
716
- errorShape: TRPCDefaultErrorShape;
717
- transformer: true;
718
- }, TRPCDecorateCreateRouterOptions< {
719
- alive: TRPCQueryProcedure< {
720
- input: void;
721
- output: {
722
- status: string;
723
- timestamp: string;
724
- };
725
- meta: object;
726
- }>;
727
- ready: TRPCQueryProcedure< {
728
- input: void;
729
- output: {
730
- status: string;
731
- timestamp: string;
732
- checks: {
733
- database: string;
734
- inngest: string;
735
- };
736
- details: {
737
- database: any;
738
- inngest: any;
739
- };
740
- };
741
- meta: object;
742
- }>;
743
- migrations: TRPCQueryProcedure< {
744
- input: void;
745
- output: {
746
- total: number;
747
- migrations: {
748
- version: string;
749
- appliedAt: string;
750
- description: string;
751
- }[];
752
- note: string;
753
- };
754
- meta: object;
755
- }>;
756
- metrics: TRPCQueryProcedure< {
757
- input: void;
758
- output: {
759
- timestamp: string;
760
- uptime: number;
761
- memory: {
762
- used: number;
763
- total: number;
764
- rss: number;
765
- };
766
- events24h: number;
767
- totalEntities: number;
768
- };
769
- meta: object;
770
- }>;
771
- }>>;
772
- integrations: TRPCBuiltRouter< {
773
- ctx: Context;
774
- meta: object;
775
- errorShape: TRPCDefaultErrorShape;
776
- transformer: true;
777
- }, TRPCDecorateCreateRouterOptions< {
778
- create: TRPCMutationProcedure< {
779
- input: {
780
- name: string;
781
- url: string;
782
- eventTypes: string[];
783
- secret?: string | undefined;
784
- };
785
- output: {
786
- subscription: {
787
- userId: string;
788
- id: string;
789
- createdAt: Date;
790
- name: string;
791
- active: boolean;
792
- url: string;
793
- eventTypes: string[];
794
- secret: string;
795
- retryConfig: unknown;
796
- lastTriggeredAt: Date | null;
797
- };
798
- secret: string;
799
- };
800
- meta: object;
801
- }>;
802
- list: TRPCQueryProcedure< {
803
- input: void;
804
- output: {
805
- userId: string;
806
- id: string;
807
- createdAt: Date;
808
- name: string;
809
- active: boolean;
810
- url: string;
811
- eventTypes: string[];
812
- retryConfig: unknown;
813
- lastTriggeredAt: Date | null;
814
- }[];
815
- meta: object;
816
- }>;
817
- update: TRPCMutationProcedure< {
818
- input: {
819
- id: string;
820
- name?: string | undefined;
821
- active?: boolean | undefined;
822
- url?: string | undefined;
823
- eventTypes?: string[] | undefined;
824
- };
825
- output: {
826
- id: string;
827
- userId: string;
828
- name: string;
829
- url: string;
830
- eventTypes: string[];
831
- active: boolean;
832
- retryConfig: unknown;
833
- createdAt: Date;
834
- lastTriggeredAt: Date | null;
835
- };
836
- meta: object;
837
- }>;
838
- delete: TRPCMutationProcedure< {
839
- input: {
840
- id: string;
841
- };
842
- output: {
843
- success: boolean;
844
- };
845
- meta: object;
846
- }>;
847
- }>>;
848
- documents: TRPCBuiltRouter< {
849
- ctx: Context;
850
- meta: object;
851
- errorShape: TRPCDefaultErrorShape;
852
- transformer: true;
853
- }, TRPCDecorateCreateRouterOptions< {
854
- upload: TRPCMutationProcedure< {
855
- input: {
856
- type: "code" | "text" | "markdown" | "pdf" | "docx";
857
- title: string;
858
- content: string;
859
- language?: string | null | undefined;
860
- mimeType?: string | null | undefined;
861
- projectId?: string | null | undefined;
862
- };
863
- output: {
864
- status: string;
865
- message: string;
866
- documentId: `${string}-${string}-${string}-${string}-${string}`;
867
- };
868
- meta: object;
869
- }>;
870
- get: TRPCQueryProcedure< {
871
- input: {
872
- documentId: string;
873
- };
874
- output: {
875
- document: {
876
- id: string;
877
- userId: string;
878
- workspaceId: string;
879
- projectIds: string[] | null;
880
- title: string;
881
- type: string;
882
- language: string | null;
883
- storageUrl: string;
884
- storageKey: string;
885
- size: number;
886
- mimeType: string | null;
887
- currentVersion: number;
888
- lastSavedVersion: number;
889
- workingState: string | null;
890
- workingStateUpdatedAt: Date | null;
891
- projectId: string | null;
892
- metadata: unknown;
893
- createdAt: Date;
894
- updatedAt: Date;
895
- deletedAt: Date | null;
896
- };
897
- content: string;
898
- };
899
- meta: object;
900
- }>;
901
- update: TRPCMutationProcedure< {
902
- input: {
903
- documentId: string;
904
- version: number;
905
- message?: string | undefined;
906
- delta?: {
907
- content: string;
908
- }[] | undefined;
909
- };
910
- output: {
911
- version: number;
912
- success: boolean;
913
- };
914
- meta: object;
915
- }>;
916
- delete: TRPCMutationProcedure< {
917
- input: {
918
- documentId: string;
919
- };
920
- output: {
921
- success: boolean;
922
- };
923
- meta: object;
924
- }>;
925
- saveVersion: TRPCMutationProcedure< {
926
- input: {
927
- documentId: string;
928
- message?: string | undefined;
929
- };
930
- output: {
931
- status: string;
932
- message: string;
933
- };
934
- meta: object;
935
- }>;
936
- listVersions: TRPCQueryProcedure< {
937
- input: {
938
- documentId: string;
939
- limit?: number | undefined;
940
- };
941
- output: {
942
- versions: {
943
- id: string;
944
- version: number;
945
- message: string | null;
946
- createdBy: string;
947
- createdAt: Date;
948
- }[];
949
- latest: {
950
- currentVersion: number;
951
- lastSavedVersion: number;
952
- };
953
- };
954
- meta: object;
955
- }>;
956
- restoreVersion: TRPCMutationProcedure< {
957
- input: {
958
- documentId: string;
959
- versionId: string;
960
- };
961
- output: {
962
- status: string;
963
- message: string;
964
- };
965
- meta: object;
966
- }>;
967
- getVersionPreview: TRPCQueryProcedure< {
968
- input: {
969
- versionId: string;
970
- };
971
- output: {
972
- id: string;
973
- createdAt: Date;
974
- type: string;
975
- message: string | null;
976
- content: string;
977
- documentId: string;
978
- version: number;
979
- delta: unknown;
980
- author: string;
981
- authorId: string;
982
- };
983
- meta: object;
984
- }>;
985
- startSession: TRPCMutationProcedure< {
986
- input: {
987
- documentId: string;
988
- };
989
- output: {
990
- sessionId: string;
991
- chatThreadId: `${string}-${string}-${string}-${string}-${string}`;
992
- };
993
- meta: object;
994
- }>;
995
- list: TRPCQueryProcedure< {
996
- input: {
997
- type?: "code" | "text" | "markdown" | "pdf" | "docx" | undefined;
998
- limit?: number | undefined;
999
- projectId?: string | undefined;
1000
- };
1001
- output: {
1002
- documents: {
1003
- id: string;
1004
- userId: string;
1005
- workspaceId: string;
1006
- projectIds: string[] | null;
1007
- title: string;
1008
- type: string;
1009
- language: string | null;
1010
- storageUrl: string;
1011
- storageKey: string;
1012
- size: number;
1013
- mimeType: string | null;
1014
- currentVersion: number;
1015
- lastSavedVersion: number;
1016
- workingState: string | null;
1017
- workingStateUpdatedAt: Date | null;
1018
- projectId: string | null;
1019
- metadata: unknown;
1020
- createdAt: Date;
1021
- updatedAt: Date;
1022
- deletedAt: Date | null;
1023
- }[];
1024
- total: number;
1025
- };
1026
- meta: object;
1027
- }>;
1028
- }>>;
1029
- content: TRPCBuiltRouter< {
1030
- ctx: Context;
1031
- meta: object;
1032
- errorShape: TRPCDefaultErrorShape;
1033
- transformer: true;
1034
- }, TRPCDecorateCreateRouterOptions< {
1035
- createFromText: TRPCMutationProcedure< {
1036
- input: {
1037
- content: string;
1038
- targetType: "note" | "task";
1039
- metadata?: {
1040
- title?: string | undefined;
1041
- tags?: string[] | undefined;
1042
- } | undefined;
1043
- };
1044
- output: {
1045
- success: boolean;
1046
- status: "pending";
1047
- requestId: `${string}-${string}-${string}-${string}-${string}`;
1048
- entityId: `${string}-${string}-${string}-${string}-${string}`;
1049
- };
1050
- meta: object;
1051
- }>;
1052
- createFromFile: TRPCMutationProcedure< {
1053
- input: {
1054
- targetType: "note" | "document";
1055
- file: string;
1056
- filename: string;
1057
- contentType: string;
1058
- metadata?: {
1059
- description?: string | undefined;
1060
- title?: string | undefined;
1061
- tags?: string[] | undefined;
1062
- } | undefined;
1063
- };
1064
- output: any;
1065
- meta: object;
1066
- }>;
1067
- }>>;
1068
- storage: TRPCBuiltRouter< {
1069
- ctx: Context;
1070
- meta: object;
1071
- errorShape: TRPCDefaultErrorShape;
1072
- transformer: true;
1073
- }, TRPCDecorateCreateRouterOptions< {
1074
- listBuckets: TRPCQueryProcedure< {
1075
- input: void;
1076
- output: {
1077
- buckets: {
1078
- name: string;
1079
- createdAt: string | null;
1080
- }[];
1081
- };
1082
- meta: object;
1083
- }>;
1084
- listFiles: TRPCQueryProcedure< {
1085
- input: {
1086
- bucket?: string | undefined;
1087
- prefix?: string | undefined;
1088
- maxKeys?: number | undefined;
1089
- };
1090
- output: {
1091
- items: ({
1092
- type: "folder";
1093
- name: string;
1094
- path: string;
1095
- } | {
1096
- type: "file";
1097
- name: string;
1098
- path: string;
1099
- size: number;
1100
- lastModified: string | null;
1101
- })[];
1102
- totalItems: number;
1103
- prefix: string;
1104
- bucket: string;
1105
- isTruncated: boolean;
1106
- error?: undefined;
1107
- } | {
1108
- items: never[];
1109
- totalItems: number;
1110
- prefix: string;
1111
- bucket: string;
1112
- isTruncated: boolean;
1113
- error: string;
1114
- };
1115
- meta: object;
1116
- }>;
1117
- getFileMetadata: TRPCQueryProcedure< {
1118
- input: {
1119
- path: string;
1120
- };
1121
- output: {
1122
- success: boolean;
1123
- path: string;
1124
- size: number;
1125
- lastModified: string;
1126
- contentType: string;
1127
- error?: undefined;
1128
- } | {
1129
- success: boolean;
1130
- path: string;
1131
- error: string;
1132
- size?: undefined;
1133
- lastModified?: undefined;
1134
- contentType?: undefined;
1135
- };
1136
- meta: object;
1137
- }>;
1138
- getDownloadUrl: TRPCQueryProcedure< {
1139
- input: {
1140
- path: string;
1141
- expiresIn?: number | undefined;
1142
- };
1143
- output: {
1144
- success: boolean;
1145
- url: string;
1146
- expiresIn: number;
1147
- error?: undefined;
1148
- } | {
1149
- success: boolean;
1150
- error: string;
1151
- url?: undefined;
1152
- expiresIn?: undefined;
1153
- };
1154
- meta: object;
1155
- }>;
1156
- exists: TRPCQueryProcedure< {
1157
- input: {
1158
- path: string;
1159
- };
1160
- output: {
1161
- exists: boolean;
1162
- path: string;
1163
- };
1164
- meta: object;
1165
- }>;
1166
- deleteFile: TRPCMutationProcedure< {
1167
- input: {
1168
- path: string;
1169
- };
1170
- output: {
1171
- success: boolean;
1172
- path: string;
1173
- error?: undefined;
1174
- } | {
1175
- success: boolean;
1176
- path: string;
1177
- error: string;
1178
- };
1179
- meta: object;
1180
- }>;
1181
- }>>;
1182
- notifications: TRPCBuiltRouter< {
1183
- ctx: Context;
1184
- meta: object;
1185
- errorShape: TRPCDefaultErrorShape;
1186
- transformer: true;
1187
- }, TRPCDecorateCreateRouterOptions< {
1188
- ingest: TRPCMutationProcedure< {
1189
- input: {
1190
- items: any[];
1191
- };
1192
- output: {
1193
- success: boolean;
1194
- created: number;
1195
- skipped: number;
1196
- total: number;
1197
- };
1198
- meta: object;
1199
- }>;
1200
- list: TRPCQueryProcedure< {
1201
- input: {
1202
- status?: "archived" | "unread" | "snoozed" | undefined;
1203
- limit?: number | undefined;
1204
- types?: string[] | undefined;
1205
- offset?: number | undefined;
1206
- };
1207
- output: {
1208
- userId: string;
1209
- id: string;
1210
- createdAt: Date;
1211
- data: unknown;
1212
- type: string;
1213
- status: string | null;
1214
- title: string;
1215
- tags: string[] | null;
1216
- workspaceId: string;
1217
- preview: string | null;
1218
- updatedAt: Date;
1219
- projectIds: string[] | null;
1220
- timestamp: Date;
1221
- priority: string | null;
1222
- provider: string;
1223
- account: string;
1224
- externalId: string;
1225
- deepLink: string | null;
1226
- snoozedUntil: Date | null;
1227
- processedAt: Date | null;
1228
- }[];
1229
- meta: object;
1230
- }>;
1231
- updateStatus: TRPCMutationProcedure< {
1232
- input: {
1233
- id: string;
1234
- status: "archived" | "read" | "snoozed";
1235
- snoozedUntil?: Date | undefined;
1236
- };
1237
- output: {
1238
- success: boolean;
1239
- id: string;
1240
- };
1241
- meta: object;
1242
- }>;
1243
- batchUpdate: TRPCMutationProcedure< {
1244
- input: {
1245
- action: "archive" | "snooze" | "markRead";
1246
- ids: string[];
1247
- snoozedUntil?: Date | undefined;
1248
- };
1249
- output: {
1250
- success: boolean;
1251
- updated: number;
1252
- };
1253
- meta: object;
1254
- }>;
1255
- stats: TRPCQueryProcedure< {
1256
- input: void;
1257
- output: {
1258
- unread: number;
1259
- snoozed: number;
1260
- };
1261
- meta: object;
1262
- }>;
1263
- }>>;
1264
- intelligenceRegistry: TRPCBuiltRouter< {
1265
- ctx: Context;
1266
- meta: object;
1267
- errorShape: TRPCDefaultErrorShape;
1268
- transformer: true;
1269
- }, TRPCDecorateCreateRouterOptions< {
1270
- register: TRPCMutationProcedure< {
1271
- input: {
1272
- name: string;
1273
- capabilities: string[];
1274
- serviceId: string;
1275
- webhookUrl: string;
1276
- apiKey: string;
1277
- description?: string | undefined;
1278
- metadata?: Record<string, unknown> | undefined;
1279
- version?: string | undefined;
1280
- pricing?: "custom" | "free" | "premium" | "enterprise" | undefined;
1281
- };
1282
- output: {
1283
- id: string;
1284
- createdAt: Date;
1285
- name: string;
1286
- description: string | null;
1287
- status: string;
1288
- metadata: Record<string, unknown> | null;
1289
- updatedAt: Date;
1290
- version: string | null;
1291
- capabilities: string[];
1292
- serviceId: string;
1293
- webhookUrl: string;
1294
- apiKey: string;
1295
- pricing: string | null;
1296
- enabled: boolean;
1297
- lastHealthCheck: Date | null;
1298
- };
1299
- meta: object;
1300
- }>;
1301
- list: TRPCQueryProcedure< {
1302
- input: {
1303
- status?: "active" | "inactive" | "suspended" | undefined;
1304
- enabled?: boolean | undefined;
1305
- } | undefined;
1306
- output: {
1307
- id: string;
1308
- serviceId: string;
1309
- name: string;
1310
- description: string | null;
1311
- version: string | null;
1312
- capabilities: string[];
1313
- pricing: string | null;
1314
- status: string;
1315
- enabled: boolean;
1316
- createdAt: Date;
1317
- updatedAt: Date;
1318
- }[];
1319
- meta: object;
1320
- }>;
1321
- get: TRPCQueryProcedure< {
1322
- input: {
1323
- id: string;
1324
- };
1325
- output: {
1326
- id: string;
1327
- createdAt: Date;
1328
- name: string;
1329
- description: string | null;
1330
- status: string;
1331
- metadata: Record<string, unknown> | null;
1332
- updatedAt: Date;
1333
- version: string | null;
1334
- capabilities: string[];
1335
- serviceId: string;
1336
- webhookUrl: string;
1337
- pricing: string | null;
1338
- enabled: boolean;
1339
- lastHealthCheck: Date | null;
1340
- };
1341
- meta: object;
1342
- }>;
1343
- update: TRPCMutationProcedure< {
1344
- input: {
1345
- id: string;
1346
- name?: string | undefined;
1347
- description?: string | undefined;
1348
- status?: "active" | "inactive" | "suspended" | undefined;
1349
- metadata?: Record<string, unknown> | undefined;
1350
- version?: string | undefined;
1351
- capabilities?: string[] | undefined;
1352
- webhookUrl?: string | undefined;
1353
- enabled?: boolean | undefined;
1354
- };
1355
- output: {
1356
- id: string;
1357
- serviceId: string;
1358
- name: string;
1359
- description: string | null;
1360
- version: string | null;
1361
- webhookUrl: string;
1362
- apiKey: string;
1363
- capabilities: string[];
1364
- pricing: string | null;
1365
- status: string;
1366
- enabled: boolean;
1367
- metadata: Record<string, unknown> | null;
1368
- createdAt: Date;
1369
- updatedAt: Date;
1370
- lastHealthCheck: Date | null;
1371
- };
1372
- meta: object;
1373
- }>;
1374
- unregister: TRPCMutationProcedure< {
1375
- input: {
1376
- id: string;
1377
- };
1378
- output: {
1379
- success: boolean;
1380
- };
1381
- meta: object;
1382
- }>;
1383
- findByCapability: TRPCQueryProcedure< {
1384
- input: {
1385
- capability: string;
1386
- };
1387
- output: {
1388
- id: string;
1389
- serviceId: string;
1390
- name: string;
1391
- capabilities: string[];
1392
- webhookUrl: string;
1393
- }[];
1394
- meta: object;
1395
- }>;
1396
- }>>;
1397
- capabilities: TRPCBuiltRouter< {
1398
- ctx: Context;
1399
- meta: object;
1400
- errorShape: TRPCDefaultErrorShape;
1401
- transformer: true;
1402
- }, TRPCDecorateCreateRouterOptions< {
1403
- list: TRPCQueryProcedure< {
1404
- input: void;
1405
- output: {
1406
- core: {
1407
- version: string;
1408
- features: string[];
1409
- };
1410
- plugins: {
1411
- name: string;
1412
- version: string;
1413
- enabled: boolean;
1414
- }[];
1415
- intelligenceServices: {
1416
- id: string;
1417
- serviceId: string;
1418
- name: string;
1419
- capabilities: string[];
1420
- pricing: string;
1421
- version: string | null;
1422
- }[];
1423
- };
1424
- meta: object;
1425
- }>;
1426
- hasCapability: TRPCQueryProcedure< {
1427
- input: {
1428
- capability: string;
1429
- };
1430
- output: {
1431
- available: boolean;
1432
- };
1433
- meta: object;
1434
- }>;
1435
- }>>;
1436
- tags: TRPCBuiltRouter< {
1437
- ctx: Context;
1438
- meta: object;
1439
- errorShape: TRPCDefaultErrorShape;
1440
- transformer: true;
1441
- }, TRPCDecorateCreateRouterOptions< {
1442
- list: TRPCQueryProcedure< {
1443
- input: void;
1444
- output: {
1445
- tags: {
1446
- userId: string;
1447
- id: string;
1448
- createdAt: Date;
1449
- name: string;
1450
- workspaceId: string;
1451
- projectIds: string[] | null;
1452
- color: string | null;
1453
- }[];
1454
- };
1455
- meta: object;
1456
- }>;
1457
- create: TRPCMutationProcedure< {
1458
- input: {
1459
- name: string;
1460
- color?: string | null | undefined;
1461
- };
1462
- output: {
1463
- tag: {
1464
- id: `${string}-${string}-${string}-${string}-${string}`;
1465
- userId: string;
1466
- name: string;
1467
- color: string;
1468
- createdAt: Date;
1469
- updatedAt: Date;
1470
- };
1471
- };
1472
- meta: object;
1473
- }>;
1474
- update: TRPCMutationProcedure< {
1475
- input: {
1476
- id?: string | undefined;
1477
- name?: string | undefined;
1478
- color?: string | null | undefined;
1479
- };
1480
- output: {
1481
- tag: {
1482
- name: string;
1483
- color: string | null;
1484
- updatedAt: Date;
1485
- userId: string;
1486
- id: string;
1487
- createdAt: Date;
1488
- workspaceId: string;
1489
- projectIds: string[] | null;
1490
- };
1491
- };
1492
- meta: object;
1493
- }>;
1494
- delete: TRPCMutationProcedure< {
1495
- input: {
1496
- id?: string | undefined;
1497
- };
1498
- output: {
1499
- success: boolean;
1500
- };
1501
- meta: object;
1502
- }>;
1503
- attach: TRPCMutationProcedure< {
1504
- input: {
1505
- entityId: string;
1506
- tagId: string;
1507
- };
1508
- output: {
1509
- status: string;
1510
- };
1511
- meta: object;
1512
- }>;
1513
- detach: TRPCMutationProcedure< {
1514
- input: {
1515
- entityId: string;
1516
- tagId: string;
1517
- };
1518
- output: {
1519
- status: string;
1520
- };
1521
- meta: object;
1522
- }>;
1523
- getForEntity: TRPCQueryProcedure< {
1524
- input: {
1525
- entityId: string;
1526
- };
1527
- output: {
1528
- tags: any[];
1529
- };
1530
- meta: object;
1531
- }>;
1532
- getEntitiesWithTag: TRPCQueryProcedure< {
1533
- input: {
1534
- tagId: string;
1535
- limit?: number | undefined;
1536
- };
1537
- output: {
1538
- entities: any[];
1539
- };
1540
- meta: object;
1541
- }>;
1542
- }>>;
1543
- search: TRPCBuiltRouter< {
1544
- ctx: Context;
1545
- meta: object;
1546
- errorShape: TRPCDefaultErrorShape;
1547
- transformer: true;
1548
- }, TRPCDecorateCreateRouterOptions< {
1549
- entities: TRPCQueryProcedure< {
1550
- input: {
1551
- query: string;
1552
- type?: "note" | "task" | "project" | "document" | undefined;
1553
- limit?: number | undefined;
1554
- };
1555
- output: {
1556
- entities: {
1557
- userId: string;
1558
- id: string;
1559
- createdAt: Date;
1560
- type: string;
1561
- title: string | null;
1562
- metadata: unknown;
1563
- workspaceId: string;
1564
- documentId: string | null;
1565
- preview: string | null;
1566
- updatedAt: Date;
1567
- projectIds: string[] | null;
1568
- version: number;
1569
- deletedAt: Date | null;
1570
- }[];
1571
- };
1572
- meta: object;
1573
- }>;
1574
- semantic: TRPCQueryProcedure< {
1575
- input: {
1576
- query: string;
1577
- type?: "note" | "task" | "project" | "document" | undefined;
1578
- limit?: number | undefined;
1579
- threshold?: number | undefined;
1580
- };
1581
- output: {
1582
- entities: never[];
1583
- message: string;
1584
- };
1585
- meta: object;
1586
- }>;
1587
- related: TRPCQueryProcedure< {
1588
- input: {
1589
- entityId: string;
1590
- limit?: number | undefined;
1591
- };
1592
- output: {
1593
- entities: {
1594
- userId: string;
1595
- id: string;
1596
- createdAt: Date;
1597
- type: string;
1598
- title: string | null;
1599
- metadata: unknown;
1600
- workspaceId: string;
1601
- documentId: string | null;
1602
- preview: string | null;
1603
- updatedAt: Date;
1604
- projectIds: string[] | null;
1605
- version: number;
1606
- deletedAt: Date | null;
1607
- }[];
1608
- };
1609
- meta: object;
1610
- }>;
1611
- byTags: TRPCQueryProcedure< {
1612
- input: {
1613
- tagIds: string[];
1614
- limit?: number | undefined;
1615
- };
1616
- output: {
1617
- entities: any[];
1618
- };
1619
- meta: object;
1620
- }>;
1621
- }>>;
1622
- relations: TRPCBuiltRouter< {
1623
- ctx: Context;
1624
- meta: object;
1625
- errorShape: TRPCDefaultErrorShape;
1626
- transformer: true;
1627
- }, TRPCDecorateCreateRouterOptions< {
1628
- get: TRPCQueryProcedure< {
1629
- input: {
1630
- entityId: string;
1631
- type?: "assigned_to" | "mentions" | "links_to" | "parent_of" | "relates_to" | "tagged_with" | "created_by" | "attended_by" | "depends_on" | "blocks" | undefined;
1632
- limit?: number | undefined;
1633
- direction?: "source" | "target" | "both" | undefined;
1634
- };
1635
- output: {
1636
- relations: {
1637
- userId: string;
1638
- id: string;
1639
- createdAt: Date;
1640
- type: string;
1641
- workspaceId: string;
1642
- projectIds: string[] | null;
1643
- sourceEntityId: string;
1644
- targetEntityId: string;
1645
- }[];
1646
- };
1647
- meta: object;
1648
- }>;
1649
- getRelated: TRPCQueryProcedure< {
1650
- input: {
1651
- entityId: string;
1652
- type?: "assigned_to" | "mentions" | "links_to" | "parent_of" | "relates_to" | "tagged_with" | "created_by" | "attended_by" | "depends_on" | "blocks" | undefined;
1653
- limit?: number | undefined;
1654
- direction?: "source" | "target" | "both" | undefined;
1655
- };
1656
- output: {
1657
- entities: {
1658
- userId: string;
1659
- id: string;
1660
- createdAt: Date;
1661
- type: string;
1662
- title: string | null;
1663
- metadata: unknown;
1664
- workspaceId: string;
1665
- documentId: string | null;
1666
- preview: string | null;
1667
- updatedAt: Date;
1668
- projectIds: string[] | null;
1669
- version: number;
1670
- deletedAt: Date | null;
1671
- }[];
1672
- };
1673
- meta: object;
1674
- }>;
1675
- getStats: TRPCQueryProcedure< {
1676
- input: {
1677
- entityId: string;
1678
- };
1679
- output: {
1680
- total: number;
1681
- outgoing: number;
1682
- incoming: number;
1683
- byType: Record<string, number>;
1684
- };
1685
- meta: object;
1686
- }>;
1687
- create: TRPCMutationProcedure< {
1688
- input: {
1689
- type: "assigned_to" | "mentions" | "links_to" | "parent_of" | "relates_to" | "tagged_with" | "created_by" | "attended_by" | "depends_on" | "blocks";
1690
- sourceEntityId: string;
1691
- targetEntityId: string;
1692
- metadata?: Record<string, any> | undefined;
1693
- };
1694
- output: {
1695
- id: `${string}-${string}-${string}-${string}-${string}`;
1696
- status: string;
1697
- message: string;
1698
- };
1699
- meta: object;
1700
- }>;
1701
- delete: TRPCMutationProcedure< {
1702
- input: {
1703
- id: string;
1704
- };
1705
- output: {
1706
- status: string;
1707
- message: string;
1708
- };
1709
- meta: object;
1710
- }>;
1711
- }>>;
1712
- graph: TRPCBuiltRouter< {
1713
- ctx: Context;
1714
- meta: object;
1715
- errorShape: TRPCDefaultErrorShape;
1716
- transformer: true;
1717
- }, TRPCDecorateCreateRouterOptions< {
1718
- getNode: TRPCQueryProcedure< {
1719
- input: {
1720
- entityId: string;
1721
- relationTypes?: string[] | undefined;
1722
- includeRelations?: boolean | undefined;
1723
- includeRelatedPreviews?: boolean | undefined;
1724
- };
1725
- output: {
1726
- entity: {
1727
- userId: string;
1728
- id: string;
1729
- createdAt: Date;
1730
- type: string;
1731
- title: string | null;
1732
- metadata: unknown;
1733
- workspaceId: string;
1734
- documentId: string | null;
1735
- preview: string | null;
1736
- updatedAt: Date;
1737
- projectIds: string[] | null;
1738
- version: number;
1739
- deletedAt: Date | null;
1740
- };
1741
- relations: never[];
1742
- relatedEntities: never[];
1743
- stats: null;
1744
- } | {
1745
- entity: {
1746
- userId: string;
1747
- id: string;
1748
- createdAt: Date;
1749
- type: string;
1750
- title: string | null;
1751
- metadata: unknown;
1752
- workspaceId: string;
1753
- documentId: string | null;
1754
- preview: string | null;
1755
- updatedAt: Date;
1756
- projectIds: string[] | null;
1757
- version: number;
1758
- deletedAt: Date | null;
1759
- };
1760
- relations: {
1761
- userId: string;
1762
- id: string;
1763
- createdAt: Date;
1764
- type: string;
1765
- workspaceId: string;
1766
- projectIds: string[] | null;
1767
- sourceEntityId: string;
1768
- targetEntityId: string;
1769
- }[];
1770
- relatedEntities: any[];
1771
- stats: {
1772
- total: number;
1773
- outgoing: number;
1774
- incoming: number;
1775
- byType: Record<string, number>;
1776
- };
1777
- };
1778
- meta: object;
1779
- }>;
1780
- getSubgraph: TRPCQueryProcedure< {
1781
- input: {
1782
- entityIds: string[];
1783
- includeInternalRelations?: boolean | undefined;
1784
- includeExternalRelations?: boolean | undefined;
1785
- };
1786
- output: {
1787
- entities: {
1788
- userId: string;
1789
- id: string;
1790
- createdAt: Date;
1791
- type: string;
1792
- title: string | null;
1793
- metadata: unknown;
1794
- workspaceId: string;
1795
- documentId: string | null;
1796
- preview: string | null;
1797
- updatedAt: Date;
1798
- projectIds: string[] | null;
1799
- version: number;
1800
- deletedAt: Date | null;
1801
- }[];
1802
- relations: {
1803
- userId: string;
1804
- id: string;
1805
- createdAt: Date;
1806
- type: string;
1807
- workspaceId: string;
1808
- projectIds: string[] | null;
1809
- sourceEntityId: string;
1810
- targetEntityId: string;
1811
- }[];
1812
- };
1813
- meta: object;
1814
- }>;
1815
- getStats: TRPCQueryProcedure< {
1816
- input: {
1817
- entityId?: string | undefined;
1818
- entityType?: string | undefined;
1819
- };
1820
- output: {
1821
- entityId: string;
1822
- relationCount: number;
1823
- outgoing: number;
1824
- incoming: number;
1825
- totalEntities?: undefined;
1826
- totalRelations?: undefined;
1827
- entityTypeDistribution?: undefined;
1828
- relationTypeDistribution?: undefined;
1829
- averageRelationsPerEntity?: undefined;
1830
- } | {
1831
- totalEntities: number;
1832
- totalRelations: number;
1833
- entityTypeDistribution: Record<string, number>;
1834
- relationTypeDistribution: Record<string, number>;
1835
- averageRelationsPerEntity: number;
1836
- entityId?: undefined;
1837
- relationCount?: undefined;
1838
- outgoing?: undefined;
1839
- incoming?: undefined;
1840
- };
1841
- meta: object;
1842
- }>;
1843
- }>>;
1844
- workspaces: TRPCBuiltRouter< {
1845
- ctx: Context;
1846
- meta: object;
1847
- errorShape: TRPCDefaultErrorShape;
1848
- transformer: true;
1849
- }, TRPCDecorateCreateRouterOptions< {
1850
- create: TRPCMutationProcedure< {
1851
- input: {
1852
- name: string;
1853
- description?: string | undefined;
1854
- type?: "enterprise" | "personal" | "team" | undefined;
1855
- settings?: Record<string, unknown> | undefined;
1856
- };
1857
- output: {
1858
- status: string;
1859
- message: string;
1860
- workspaceId: `${string}-${string}-${string}-${string}-${string}`;
1861
- };
1862
- meta: object;
1863
- }>;
1864
- list: TRPCQueryProcedure< {
1865
- input: void;
1866
- output: {
1867
- role: string;
1868
- joinedAt: Date;
1869
- id: string;
1870
- createdAt: Date;
1871
- name: string;
1872
- description: string | null;
1873
- type: string;
1874
- updatedAt: Date;
1875
- settings: WorkspaceSettings;
1876
- ownerId: string;
1877
- subscriptionTier: string | null;
1878
- subscriptionStatus: string | null;
1879
- stripeCustomerId: string | null;
1880
- }[];
1881
- meta: object;
1882
- }>;
1883
- get: TRPCQueryProcedure< {
1884
- input: {
1885
- id: string;
1886
- };
1887
- output: {
1888
- role: string;
1889
- id: string;
1890
- createdAt: Date;
1891
- name: string;
1892
- description: string | null;
1893
- type: string;
1894
- updatedAt: Date;
1895
- settings: WorkspaceSettings;
1896
- ownerId: string;
1897
- subscriptionTier: string | null;
1898
- subscriptionStatus: string | null;
1899
- stripeCustomerId: string | null;
1900
- };
1901
- meta: object;
1902
- }>;
1903
- update: TRPCMutationProcedure< {
1904
- input: {
1905
- id: string;
1906
- name?: string | undefined;
1907
- description?: string | undefined;
1908
- settings?: Record<string, unknown> | undefined;
1909
- };
1910
- output: {
1911
- status: string;
1912
- message: string;
1913
- };
1914
- meta: object;
1915
- }>;
1916
- delete: TRPCMutationProcedure< {
1917
- input: {
1918
- id: string;
1919
- };
1920
- output: {
1921
- status: string;
1922
- message: string;
1923
- };
1924
- meta: object;
1925
- }>;
1926
- addMember: TRPCMutationProcedure< {
1927
- input: {
1928
- userId: string;
1929
- workspaceId: string;
1930
- role: "owner" | "editor" | "viewer";
1931
- };
1932
- output: {
1933
- status: string;
1934
- message: string;
1935
- };
1936
- meta: object;
1937
- }>;
1938
- listMembers: TRPCQueryProcedure< {
1939
- input: {
1940
- workspaceId: string;
1941
- };
1942
- output: {
1943
- userId: string;
1944
- id: string;
1945
- workspaceId: string;
1946
- role: string;
1947
- joinedAt: Date;
1948
- invitedBy: string | null;
1949
- }[];
1950
- meta: object;
1951
- }>;
1952
- removeMember: TRPCMutationProcedure< {
1953
- input: {
1954
- userId: string;
1955
- workspaceId: string;
1956
- };
1957
- output: {
1958
- status: string;
1959
- message: string;
1960
- };
1961
- meta: object;
1962
- }>;
1963
- updateMemberRole: TRPCMutationProcedure< {
1964
- input: {
1965
- userId: string;
1966
- workspaceId: string;
1967
- role: "editor" | "viewer" | "admin";
1968
- };
1969
- output: {
1970
- status: string;
1971
- message: string;
1972
- };
1973
- meta: object;
1974
- }>;
1975
- createInvite: TRPCMutationProcedure< {
1976
- input: {
1977
- workspaceId: string;
1978
- email: string;
1979
- role: "editor" | "viewer" | "admin";
1980
- };
1981
- output: {
1982
- id: string;
1983
- expiresAt: Date;
1984
- createdAt: Date;
1985
- workspaceId: string;
1986
- email: string;
1987
- role: string;
1988
- invitedBy: string;
1989
- token: string;
1990
- };
1991
- meta: object;
1992
- }>;
1993
- listInvites: TRPCQueryProcedure< {
1994
- input: {
1995
- workspaceId: string;
1996
- };
1997
- output: {
1998
- id: string;
1999
- expiresAt: Date;
2000
- createdAt: Date;
2001
- workspaceId: string;
2002
- email: string;
2003
- role: string;
2004
- invitedBy: string;
2005
- token: string;
2006
- }[];
2007
- meta: object;
2008
- }>;
2009
- acceptInvite: TRPCMutationProcedure< {
2010
- input: {
2011
- token: string;
2012
- };
2013
- output: {
2014
- status: string;
2015
- workspaceId: string;
2016
- message: string;
2017
- };
2018
- meta: object;
2019
- }>;
2020
- revokeInvite: TRPCMutationProcedure< {
2021
- input: {
2022
- id: string;
2023
- };
2024
- output: {
2025
- success: boolean;
2026
- };
2027
- meta: object;
2028
- }>;
2029
- }>>;
2030
- views: TRPCBuiltRouter< {
2031
- ctx: Context;
2032
- meta: object;
2033
- errorShape: TRPCDefaultErrorShape;
2034
- transformer: true;
2035
- }, TRPCDecorateCreateRouterOptions< {
2036
- create: TRPCMutationProcedure< {
2037
- input: {
2038
- name: string;
2039
- type: "calendar" | "list" | "grid" | "timeline" | "table" | "whiteboard" | "graph" | "kanban" | "gallery" | "gantt" | "mindmap";
2040
- description?: string | null | undefined;
2041
- workspaceId?: string | null | undefined;
2042
- initialContent?: any;
2043
- };
2044
- output: {
2045
- view: {
2046
- id: `${string}-${string}-${string}-${string}-${string}`;
2047
- workspaceId: string | null | undefined;
2048
- userId: string;
2049
- type: "calendar" | "list" | "grid" | "timeline" | "table" | "whiteboard" | "graph" | "kanban" | "gallery" | "gantt" | "mindmap";
2050
- category: ViewCategory;
2051
- name: string;
2052
- description: string | null | undefined;
2053
- documentId: string;
2054
- metadata: {
2055
- entityCount: number;
2056
- createdBy: string;
2057
- };
2058
- createdAt: Date;
2059
- updatedAt: Date;
2060
- };
2061
- documentId: string;
2062
- status: string;
2063
- };
2064
- meta: object;
2065
- }>;
2066
- list: TRPCQueryProcedure< {
2067
- input: {
2068
- type?: "all" | "calendar" | "list" | "grid" | "timeline" | "table" | "whiteboard" | "graph" | "kanban" | "gallery" | "gantt" | "mindmap" | undefined;
2069
- workspaceId?: string | undefined;
2070
- };
2071
- output: {
2072
- userId: string;
2073
- id: string;
2074
- createdAt: Date;
2075
- name: string;
2076
- description: string | null;
2077
- type: string;
2078
- metadata: unknown;
2079
- workspaceId: string | null;
2080
- documentId: string | null;
2081
- updatedAt: Date;
2082
- projectIds: string[] | null;
2083
- category: string;
2084
- yjsRoomId: string | null;
2085
- thumbnailUrl: string | null;
2086
- }[];
2087
- meta: object;
2088
- }>;
2089
- get: TRPCQueryProcedure< {
2090
- input: {
2091
- id: string;
2092
- };
2093
- output: {
2094
- view: {
2095
- userId: string;
2096
- id: string;
2097
- createdAt: Date;
2098
- name: string;
2099
- description: string | null;
2100
- type: string;
2101
- metadata: unknown;
2102
- workspaceId: string | null;
2103
- documentId: string | null;
2104
- updatedAt: Date;
2105
- projectIds: string[] | null;
2106
- category: string;
2107
- yjsRoomId: string | null;
2108
- thumbnailUrl: string | null;
2109
- };
2110
- content: {};
2111
- };
2112
- meta: object;
2113
- }>;
2114
- execute: TRPCQueryProcedure< {
2115
- input: {
2116
- id: string;
2117
- };
2118
- output: {
2119
- view: {
2120
- userId: string;
2121
- id: string;
2122
- createdAt: Date;
2123
- name: string;
2124
- description: string | null;
2125
- type: string;
2126
- metadata: unknown;
2127
- workspaceId: string | null;
2128
- documentId: string | null;
2129
- updatedAt: Date;
2130
- projectIds: string[] | null;
2131
- category: string;
2132
- yjsRoomId: string | null;
2133
- thumbnailUrl: string | null;
2134
- };
2135
- content: {};
2136
- entities: never[];
2137
- relations: never[];
2138
- config?: undefined;
2139
- } | {
2140
- view: {
2141
- userId: string;
2142
- id: string;
2143
- createdAt: Date;
2144
- name: string;
2145
- description: string | null;
2146
- type: string;
2147
- metadata: unknown;
2148
- workspaceId: string | null;
2149
- documentId: string | null;
2150
- updatedAt: Date;
2151
- projectIds: string[] | null;
2152
- category: string;
2153
- yjsRoomId: string | null;
2154
- thumbnailUrl: string | null;
2155
- };
2156
- config: StructuredViewConfig | undefined;
2157
- entities: never[];
2158
- relations: never[];
2159
- content?: undefined;
2160
- } | {
2161
- view: {
2162
- userId: string;
2163
- id: string;
2164
- createdAt: Date;
2165
- name: string;
2166
- description: string | null;
2167
- type: string;
2168
- metadata: unknown;
2169
- workspaceId: string | null;
2170
- documentId: string | null;
2171
- updatedAt: Date;
2172
- projectIds: string[] | null;
2173
- category: string;
2174
- yjsRoomId: string | null;
2175
- thumbnailUrl: string | null;
2176
- };
2177
- config: StructuredViewConfig;
2178
- entities: {
2179
- id: string;
2180
- userId: string;
2181
- workspaceId: string;
2182
- projectIds: string[] | null;
2183
- type: string;
2184
- title: string | null;
2185
- preview: string | null;
2186
- documentId: string | null;
2187
- metadata: unknown;
2188
- version: number;
2189
- createdAt: Date;
2190
- updatedAt: Date;
2191
- deletedAt: Date | null;
2192
- }[];
2193
- relations: {
2194
- id: string;
2195
- userId: string;
2196
- workspaceId: string;
2197
- projectIds: string[] | null;
2198
- sourceEntityId: string;
2199
- targetEntityId: string;
2200
- type: string;
2201
- createdAt: Date;
2202
- }[];
2203
- content?: undefined;
2204
- };
2205
- meta: object;
2206
- }>;
2207
- save: TRPCMutationProcedure< {
2208
- input: {
2209
- id: string;
2210
- content?: any;
2211
- metadata?: Record<string, any> | undefined;
2212
- };
2213
- output: {
2214
- success: boolean;
2215
- };
2216
- meta: object;
2217
- }>;
2218
- update: TRPCMutationProcedure< {
2219
- input: {
2220
- id: string;
2221
- name?: string | undefined;
2222
- description?: string | null | undefined;
2223
- };
2224
- output: {
2225
- status: string;
2226
- message: string;
2227
- };
2228
- meta: object;
2229
- }>;
2230
- delete: TRPCMutationProcedure< {
2231
- input: {
2232
- id: string;
2233
- };
2234
- output: {
2235
- success: boolean;
2236
- status: string;
2237
- };
2238
- meta: object;
2239
- }>;
2240
- reorderEntity: TRPCMutationProcedure< {
2241
- input: {
2242
- entityId: string;
2243
- viewId: string;
2244
- beforeEntityId?: string | undefined;
2245
- afterEntityId?: string | undefined;
2246
- };
2247
- output: {
2248
- success: boolean;
2249
- newOrder: number;
2250
- };
2251
- meta: object;
2252
- }>;
2253
- }>>;
2254
- preferences: TRPCBuiltRouter< {
2255
- ctx: Context;
2256
- meta: object;
2257
- errorShape: TRPCDefaultErrorShape;
2258
- transformer: true;
2259
- }, TRPCDecorateCreateRouterOptions< {
2260
- get: TRPCQueryProcedure< {
2261
- input: void;
2262
- output: any;
2263
- meta: object;
2264
- }>;
2265
- update: TRPCMutationProcedure< {
2266
- input: {
2267
- theme?: "light" | "dark" | "system" | undefined;
2268
- customTheme?: {
2269
- colors?: {
2270
- text?: string | undefined;
2271
- primary?: string | undefined;
2272
- accent?: string | undefined;
2273
- background?: string | undefined;
2274
- border?: string | undefined;
2275
- } | undefined;
2276
- spacing?: {
2277
- medium?: string | undefined;
2278
- small?: string | undefined;
2279
- large?: string | undefined;
2280
- } | undefined;
2281
- radii?: {
2282
- medium?: string | undefined;
2283
- small?: string | undefined;
2284
- large?: string | undefined;
2285
- } | undefined;
2286
- animations?: {
2287
- enabled?: boolean | undefined;
2288
- speed?: "normal" | "slow" | "fast" | undefined;
2289
- } | undefined;
2290
- } | undefined;
2291
- defaultTemplates?: Record<string, string> | undefined;
2292
- customEntityTypes?: any[] | undefined;
2293
- entityMetadataSchemas?: Record<string, Record<string, any>> | undefined;
2294
- uiPreferences?: {
2295
- fontSize?: string | undefined;
2296
- animations?: boolean | undefined;
2297
- sidebarCollapsed?: boolean | undefined;
2298
- panelPositions?: Record<string, {
2299
- x: number;
2300
- y: number;
2301
- }> | undefined;
2302
- lastActiveView?: string | undefined;
2303
- compactMode?: boolean | undefined;
2304
- defaultView?: "timeline" | "grid" | "list" | undefined;
2305
- } | undefined;
2306
- graphPreferences?: {
2307
- forceSettings?: {
2308
- linkDistance?: number | undefined;
2309
- chargeStrength?: number | undefined;
2310
- alphaDecay?: number | undefined;
2311
- velocityDecay?: number | undefined;
2312
- } | undefined;
2313
- defaultFilters?: {
2314
- entityTypes?: string[] | undefined;
2315
- relationTypes?: string[] | undefined;
2316
- } | undefined;
2317
- zoom?: number | undefined;
2318
- pan?: {
2319
- x: number;
2320
- y: number;
2321
- } | undefined;
2322
- showMinimap?: boolean | undefined;
2323
- } | undefined;
2324
- onboardingCompleted?: boolean | undefined;
2325
- onboardingStep?: string | undefined;
2326
- };
2327
- output: any;
2328
- meta: object;
2329
- }>;
2330
- updateTheme: TRPCMutationProcedure< {
2331
- input: {
2332
- theme?: "system" | "light" | "dark" | undefined;
2333
- customTheme?: {
2334
- colors?: {
2335
- text?: string | undefined;
2336
- primary?: string | undefined;
2337
- accent?: string | undefined;
2338
- background?: string | undefined;
2339
- border?: string | undefined;
2340
- } | undefined;
2341
- spacing?: {
2342
- small?: string | undefined;
2343
- medium?: string | undefined;
2344
- large?: string | undefined;
2345
- } | undefined;
2346
- radii?: {
2347
- small?: string | undefined;
2348
- medium?: string | undefined;
2349
- large?: string | undefined;
2350
- } | undefined;
2351
- animations?: {
2352
- enabled?: boolean | undefined;
2353
- speed?: "slow" | "normal" | "fast" | undefined;
2354
- } | undefined;
2355
- } | undefined;
2356
- };
2357
- output: {
2358
- success: boolean;
2359
- };
2360
- meta: object;
2361
- }>;
2362
- updateDefaultTemplates: TRPCMutationProcedure< {
2363
- input: {
2364
- entityType: string;
2365
- templateId: string;
2366
- };
2367
- output: {
2368
- success: boolean;
2369
- defaultTemplates: {
2370
- [x: string]: string;
2371
- };
2372
- };
2373
- meta: object;
2374
- }>;
2375
- updateCustomEntityTypes: TRPCMutationProcedure< {
2376
- input: {
2377
- customEntityTypes: any[];
2378
- };
2379
- output: {
2380
- success: boolean;
2381
- };
2382
- meta: object;
2383
- }>;
2384
- getViewModes: TRPCQueryProcedure< {
2385
- input: void;
2386
- output: any;
2387
- meta: object;
2388
- }>;
2389
- updateViewMode: TRPCMutationProcedure< {
2390
- input: {
2391
- context: "entities" | "documents" | "views";
2392
- mode: "list" | "grid" | "table";
2393
- };
2394
- output: {
2395
- success: boolean;
2396
- viewModes: any;
2397
- };
2398
- meta: object;
2399
- }>;
2400
- getIntelligenceServices: TRPCQueryProcedure< {
2401
- input: void;
2402
- output: {
2403
- preferences: any;
2404
- available: any;
2405
- };
2406
- meta: object;
2407
- }>;
2408
- setIntelligenceService: TRPCMutationProcedure< {
2409
- input: {
2410
- serviceId: string;
2411
- capability?: "default" | "chat" | "analysis" | undefined;
2412
- };
2413
- output: {
2414
- success: boolean;
2415
- preferences: any;
2416
- };
2417
- meta: object;
2418
- }>;
2419
- }>>;
2420
- roles: TRPCBuiltRouter< {
2421
- ctx: Context;
2422
- meta: object;
2423
- errorShape: TRPCDefaultErrorShape;
2424
- transformer: true;
2425
- }, TRPCDecorateCreateRouterOptions< {
2426
- list: TRPCQueryProcedure< {
2427
- input: {
2428
- workspaceId?: string | undefined;
2429
- } | undefined;
2430
- output: {
2431
- id: string;
2432
- createdAt: Date;
2433
- createdBy: string;
2434
- name: string;
2435
- description: string | null;
2436
- workspaceId: string | null;
2437
- updatedAt: Date;
2438
- permissions: unknown;
2439
- filters: unknown;
2440
- }[];
2441
- meta: object;
2442
- }>;
2443
- get: TRPCQueryProcedure< {
2444
- input: {
2445
- id: string;
2446
- };
2447
- output: {
2448
- id: string;
2449
- createdAt: Date;
2450
- createdBy: string;
2451
- name: string;
2452
- description: string | null;
2453
- workspaceId: string | null;
2454
- updatedAt: Date;
2455
- permissions: unknown;
2456
- filters: unknown;
2457
- };
2458
- meta: object;
2459
- }>;
2460
- create: TRPCMutationProcedure< {
2461
- input: {
2462
- name: string;
2463
- permissions: Record<string, any>;
2464
- description?: string | undefined;
2465
- workspaceId?: string | undefined;
2466
- filters?: Record<string, any> | undefined;
2467
- };
2468
- output: {
2469
- id: `${string}-${string}-${string}-${string}-${string}`;
2470
- status: string;
2471
- message: string;
2472
- };
2473
- meta: object;
2474
- }>;
2475
- update: TRPCMutationProcedure< {
2476
- input: {
2477
- id: string;
2478
- name?: string | undefined;
2479
- description?: string | undefined;
2480
- permissions?: Record<string, any> | undefined;
2481
- filters?: Record<string, any> | undefined;
2482
- };
2483
- output: {
2484
- status: string;
2485
- message: string;
2486
- };
2487
- meta: object;
2488
- }>;
2489
- delete: TRPCMutationProcedure< {
2490
- input: {
2491
- id: string;
2492
- };
2493
- output: {
2494
- status: string;
2495
- message: string;
2496
- };
2497
- meta: object;
2498
- }>;
2499
- }>>;
2500
- sharing: TRPCBuiltRouter< {
2501
- ctx: Context;
2502
- meta: object;
2503
- errorShape: TRPCDefaultErrorShape;
2504
- transformer: true;
2505
- }, TRPCDecorateCreateRouterOptions< {
2506
- createPublicLink: TRPCMutationProcedure< {
2507
- input: {
2508
- resourceType: string;
2509
- resourceId: string;
2510
- expiresInDays?: number | undefined;
2511
- };
2512
- output: {
2513
- status: string;
2514
- shareId: `${string}-${string}-${string}-${string}-${string}`;
2515
- url: string;
2516
- };
2517
- meta: object;
2518
- }>;
2519
- invite: TRPCMutationProcedure< {
2520
- input: {
2521
- resourceType: string;
2522
- resourceId: string;
2523
- userEmail: string;
2524
- };
2525
- output: {
2526
- status: string;
2527
- inviteId: `${string}-${string}-${string}-${string}-${string}`;
2528
- };
2529
- meta: object;
2530
- }>;
2531
- incrementView: TRPCMutationProcedure< {
2532
- input: {
2533
- shareId: string;
2534
- };
2535
- output: {
2536
- success: boolean;
2537
- };
2538
- meta: object;
2539
- }>;
2540
- getPublic: TRPCQueryProcedure< {
2541
- input: {
2542
- token: string;
2543
- };
2544
- output: {
2545
- resource: {
2546
- userId: string;
2547
- id: string;
2548
- createdAt: Date;
2549
- type: string;
2550
- title: string | null;
2551
- metadata: unknown;
2552
- workspaceId: string;
2553
- documentId: string | null;
2554
- preview: string | null;
2555
- updatedAt: Date;
2556
- projectIds: string[] | null;
2557
- version: number;
2558
- deletedAt: Date | null;
2559
- } | {
2560
- userId: string;
2561
- id: string;
2562
- createdAt: Date;
2563
- name: string;
2564
- description: string | null;
2565
- type: string;
2566
- metadata: unknown;
2567
- workspaceId: string | null;
2568
- documentId: string | null;
2569
- updatedAt: Date;
2570
- projectIds: string[] | null;
2571
- category: string;
2572
- yjsRoomId: string | null;
2573
- thumbnailUrl: string | null;
2574
- document: never;
2575
- };
2576
- permissions: unknown;
2577
- };
2578
- meta: object;
2579
- }>;
2580
- list: TRPCQueryProcedure< {
2581
- input: {
2582
- resourceType: string;
2583
- resourceId: string;
2584
- expiresAt?: Date | null | undefined;
2585
- visibility?: string | undefined;
2586
- };
2587
- output: {
2588
- id: string;
2589
- expiresAt: Date | null;
2590
- createdAt: Date;
2591
- createdBy: string;
2592
- updatedAt: Date;
2593
- permissions: unknown;
2594
- resourceType: string;
2595
- resourceId: string;
2596
- visibility: string;
2597
- publicToken: string | null;
2598
- invitedUsers: string[] | null;
2599
- viewCount: number | null;
2600
- lastAccessedAt: Date | null;
2601
- }[];
2602
- meta: object;
2603
- }>;
2604
- revoke: TRPCMutationProcedure< {
2605
- input: {
2606
- shareId: string;
2607
- };
2608
- output: {
2609
- status: string;
2610
- };
2611
- meta: object;
2612
- }>;
2613
- }>>;
2614
- templates: TRPCBuiltRouter< {
2615
- ctx: Context;
2616
- meta: object;
2617
- errorShape: TRPCDefaultErrorShape;
2618
- transformer: true;
2619
- }, TRPCDecorateCreateRouterOptions< {
2620
- list: TRPCQueryProcedure< {
2621
- input: {
2622
- workspaceId?: string | undefined;
2623
- entityType?: string | undefined;
2624
- targetType?: "project" | "document" | "entity" | "inbox_item" | undefined;
2625
- inboxItemType?: string | undefined;
2626
- includePublic?: boolean | undefined;
2627
- };
2628
- output: {
2629
- id: string;
2630
- name: string;
2631
- description: string | null;
2632
- userId: string | null;
2633
- workspaceId: string | null;
2634
- projectIds: string[] | null;
2635
- targetType: string;
2636
- entityType: string | null;
2637
- inboxItemType: string | null;
2638
- config: unknown;
2639
- isDefault: boolean;
2640
- isPublic: boolean;
2641
- version: number;
2642
- createdAt: Date;
2643
- updatedAt: Date;
2644
- }[];
2645
- meta: object;
2646
- }>;
2647
- getDefault: TRPCQueryProcedure< {
2648
- input: {
2649
- targetType: "project" | "document" | "entity" | "inbox_item";
2650
- workspaceId?: string | undefined;
2651
- entityType?: string | undefined;
2652
- inboxItemType?: string | undefined;
2653
- };
2654
- output: unknown;
2655
- meta: object;
2656
- }>;
2657
- create: TRPCMutationProcedure< {
2658
- input: {
2659
- name: string;
2660
- targetType: "project" | "document" | "entity" | "inbox_item";
2661
- config: {
2662
- layout?: {
2663
- structure: {
2664
- banner?: {
2665
- enabled: boolean;
2666
- slots?: string[] | undefined;
2667
- position?: "left" | "right" | undefined;
2668
- width?: string | undefined;
2669
- layout?: "horizontal" | "vertical" | undefined;
2670
- align?: "left" | "right" | "center" | undefined;
2671
- } | undefined;
2672
- header?: {
2673
- enabled: boolean;
2674
- slots?: string[] | undefined;
2675
- position?: "left" | "right" | undefined;
2676
- width?: string | undefined;
2677
- layout?: "horizontal" | "vertical" | undefined;
2678
- align?: "left" | "right" | "center" | undefined;
2679
- } | undefined;
2680
- sidebar?: {
2681
- enabled: boolean;
2682
- slots?: string[] | undefined;
2683
- position?: "left" | "right" | undefined;
2684
- width?: string | undefined;
2685
- layout?: "horizontal" | "vertical" | undefined;
2686
- align?: "left" | "right" | "center" | undefined;
2687
- } | undefined;
2688
- contentBefore?: {
2689
- enabled: boolean;
2690
- slots?: string[] | undefined;
2691
- position?: "left" | "right" | undefined;
2692
- width?: string | undefined;
2693
- layout?: "horizontal" | "vertical" | undefined;
2694
- align?: "left" | "right" | "center" | undefined;
2695
- } | undefined;
2696
- content?: {
2697
- enabled: boolean;
2698
- slots?: string[] | undefined;
2699
- position?: "left" | "right" | undefined;
2700
- width?: string | undefined;
2701
- layout?: "horizontal" | "vertical" | undefined;
2702
- align?: "left" | "right" | "center" | undefined;
2703
- } | undefined;
2704
- contentAfter?: {
2705
- enabled: boolean;
2706
- slots?: string[] | undefined;
2707
- position?: "left" | "right" | undefined;
2708
- width?: string | undefined;
2709
- layout?: "horizontal" | "vertical" | undefined;
2710
- align?: "left" | "right" | "center" | undefined;
2711
- } | undefined;
2712
- footer?: {
2713
- enabled: boolean;
2714
- slots?: string[] | undefined;
2715
- position?: "left" | "right" | undefined;
2716
- width?: string | undefined;
2717
- layout?: "horizontal" | "vertical" | undefined;
2718
- align?: "left" | "right" | "center" | undefined;
2719
- } | undefined;
2720
- };
2721
- fieldMapping: Record<string, {
2722
- slot: string;
2723
- renderer?: {
2724
- type: "number" | "date" | "link" | "text" | "badge" | "avatar" | "progress" | "checkbox" | "currency" | "relations";
2725
- format?: string | undefined;
2726
- variant?: string | undefined;
2727
- size?: string | undefined;
2728
- appearance?: "compact" | "detailed" | "cards" | undefined;
2729
- } | undefined;
2730
- label?: string | undefined;
2731
- showLabel?: boolean | undefined;
2732
- order?: number | undefined;
2733
- }>;
2734
- } | undefined;
2735
- colors?: {
2736
- text?: string | undefined;
2737
- primary?: string | undefined;
2738
- accent?: string | undefined;
2739
- background?: string | undefined;
2740
- border?: string | undefined;
2741
- muted?: string | undefined;
2742
- success?: string | undefined;
2743
- warning?: string | undefined;
2744
- error?: string | undefined;
2745
- } | undefined;
2746
- styling?: {
2747
- borderRadius?: string | undefined;
2748
- padding?: string | undefined;
2749
- gap?: string | undefined;
2750
- fontSize?: string | undefined;
2751
- fontWeight?: string | undefined;
2752
- shadow?: string | undefined;
2753
- fontFamily?: string | undefined;
2754
- } | undefined;
2755
- };
2756
- description?: string | null | undefined;
2757
- workspaceId?: string | null | undefined;
2758
- entityType?: string | null | undefined;
2759
- inboxItemType?: string | null | undefined;
2760
- isDefault?: boolean | undefined;
2761
- isPublic?: boolean | undefined;
2762
- };
2763
- output: {
2764
- status: string;
2765
- templateId: `${string}-${string}-${string}-${string}-${string}`;
2766
- };
2767
- meta: object;
2768
- }>;
2769
- update: TRPCMutationProcedure< {
2770
- input: {
2771
- id: string;
2772
- name?: string | undefined;
2773
- description?: string | null | undefined;
2774
- config?: {
2775
- layout?: {
2776
- structure: {
2777
- banner?: {
2778
- enabled: boolean;
2779
- slots?: string[] | undefined;
2780
- position?: "left" | "right" | undefined;
2781
- width?: string | undefined;
2782
- layout?: "horizontal" | "vertical" | undefined;
2783
- align?: "left" | "right" | "center" | undefined;
2784
- } | undefined;
2785
- header?: {
2786
- enabled: boolean;
2787
- slots?: string[] | undefined;
2788
- position?: "left" | "right" | undefined;
2789
- width?: string | undefined;
2790
- layout?: "horizontal" | "vertical" | undefined;
2791
- align?: "left" | "right" | "center" | undefined;
2792
- } | undefined;
2793
- sidebar?: {
2794
- enabled: boolean;
2795
- slots?: string[] | undefined;
2796
- position?: "left" | "right" | undefined;
2797
- width?: string | undefined;
2798
- layout?: "horizontal" | "vertical" | undefined;
2799
- align?: "left" | "right" | "center" | undefined;
2800
- } | undefined;
2801
- contentBefore?: {
2802
- enabled: boolean;
2803
- slots?: string[] | undefined;
2804
- position?: "left" | "right" | undefined;
2805
- width?: string | undefined;
2806
- layout?: "horizontal" | "vertical" | undefined;
2807
- align?: "left" | "right" | "center" | undefined;
2808
- } | undefined;
2809
- content?: {
2810
- enabled: boolean;
2811
- slots?: string[] | undefined;
2812
- position?: "left" | "right" | undefined;
2813
- width?: string | undefined;
2814
- layout?: "horizontal" | "vertical" | undefined;
2815
- align?: "left" | "right" | "center" | undefined;
2816
- } | undefined;
2817
- contentAfter?: {
2818
- enabled: boolean;
2819
- slots?: string[] | undefined;
2820
- position?: "left" | "right" | undefined;
2821
- width?: string | undefined;
2822
- layout?: "horizontal" | "vertical" | undefined;
2823
- align?: "left" | "right" | "center" | undefined;
2824
- } | undefined;
2825
- footer?: {
2826
- enabled: boolean;
2827
- slots?: string[] | undefined;
2828
- position?: "left" | "right" | undefined;
2829
- width?: string | undefined;
2830
- layout?: "horizontal" | "vertical" | undefined;
2831
- align?: "left" | "right" | "center" | undefined;
2832
- } | undefined;
2833
- };
2834
- fieldMapping: Record<string, {
2835
- slot: string;
2836
- renderer?: {
2837
- type: "number" | "date" | "link" | "text" | "badge" | "avatar" | "progress" | "checkbox" | "currency" | "relations";
2838
- format?: string | undefined;
2839
- variant?: string | undefined;
2840
- size?: string | undefined;
2841
- appearance?: "compact" | "detailed" | "cards" | undefined;
2842
- } | undefined;
2843
- label?: string | undefined;
2844
- showLabel?: boolean | undefined;
2845
- order?: number | undefined;
2846
- }>;
2847
- } | undefined;
2848
- colors?: {
2849
- text?: string | undefined;
2850
- primary?: string | undefined;
2851
- accent?: string | undefined;
2852
- background?: string | undefined;
2853
- border?: string | undefined;
2854
- muted?: string | undefined;
2855
- success?: string | undefined;
2856
- warning?: string | undefined;
2857
- error?: string | undefined;
2858
- } | undefined;
2859
- styling?: {
2860
- borderRadius?: string | undefined;
2861
- padding?: string | undefined;
2862
- gap?: string | undefined;
2863
- fontSize?: string | undefined;
2864
- fontWeight?: string | undefined;
2865
- shadow?: string | undefined;
2866
- fontFamily?: string | undefined;
2867
- } | undefined;
2868
- } | undefined;
2869
- isDefault?: boolean | undefined;
2870
- isPublic?: boolean | undefined;
2871
- };
2872
- output: {
2873
- status: string;
2874
- };
2875
- meta: object;
2876
- }>;
2877
- delete: TRPCMutationProcedure< {
2878
- input: {
2879
- id: string;
2880
- };
2881
- output: {
2882
- status: string;
2883
- };
2884
- meta: object;
2885
- }>;
2886
- duplicate: TRPCMutationProcedure< {
2887
- input: {
2888
- id: string;
2889
- };
2890
- output: {
2891
- userId: string | null;
2892
- id: string;
2893
- createdAt: Date;
2894
- name: string;
2895
- description: string | null;
2896
- workspaceId: string | null;
2897
- updatedAt: Date;
2898
- projectIds: string[] | null;
2899
- version: number;
2900
- entityType: string | null;
2901
- targetType: string;
2902
- inboxItemType: string | null;
2903
- config: unknown;
2904
- isDefault: boolean;
2905
- isPublic: boolean;
2906
- };
2907
- meta: object;
2908
- }>;
2909
- setDefault: TRPCMutationProcedure< {
2910
- input: {
2911
- id: string;
2912
- };
2913
- output: {
2914
- success: boolean;
2915
- };
2916
- meta: object;
2917
- }>;
2918
- }>>;
2919
- whiteboards: TRPCBuiltRouter< {
2920
- ctx: Context;
2921
- meta: object;
2922
- errorShape: TRPCDefaultErrorShape;
2923
- transformer: true;
2924
- }, TRPCDecorateCreateRouterOptions< {
2925
- saveVersion: TRPCMutationProcedure< {
2926
- input: {
2927
- viewId: string;
2928
- message?: string | undefined;
2929
- };
2930
- output: {
2931
- status: string;
2932
- message: string;
2933
- };
2934
- meta: object;
2935
- }>;
2936
- listVersions: TRPCQueryProcedure< {
2937
- input: {
2938
- viewId: string;
2939
- limit?: number | undefined;
2940
- };
2941
- output: {
2942
- versions: {
2943
- id: string;
2944
- createdAt: Date;
2945
- type: string;
2946
- message: string | null;
2947
- content: string;
2948
- documentId: string;
2949
- version: number;
2950
- delta: unknown;
2951
- author: string;
2952
- authorId: string;
2953
- }[];
2954
- };
2955
- meta: object;
2956
- }>;
2957
- restoreVersion: TRPCMutationProcedure< {
2958
- input: {
2959
- versionId: string;
2960
- viewId: string;
2961
- };
2962
- output: {
2963
- status: string;
2964
- message: string;
2965
- };
2966
- meta: object;
2967
- }>;
2968
- getVersionPreview: TRPCQueryProcedure< {
2969
- input: {
2970
- versionId: string;
2971
- };
2972
- output: {
2973
- version: {
2974
- id: string;
2975
- createdAt: Date;
2976
- type: string;
2977
- message: string | null;
2978
- content: string;
2979
- documentId: string;
2980
- version: number;
2981
- delta: unknown;
2982
- author: string;
2983
- authorId: string;
2984
- };
2985
- metadata: {
2986
- size: number;
2987
- message: string | null;
2988
- author: string;
2989
- createdAt: Date;
2990
- };
2991
- };
2992
- meta: object;
2993
- }>;
2994
- deleteVersion: TRPCMutationProcedure< {
2995
- input: {
2996
- versionId: string;
2997
- viewId: string;
2998
- };
2999
- output: {
3000
- success: boolean;
3001
- };
3002
- meta: object;
3003
- }>;
3004
- }>>;
3005
- }>>;
3006
-
3007
- /**
3008
- * Context Types
3009
- *
3010
- * Proper type definitions for tRPC context to avoid `any` types.
3011
- */
3012
- /**
3013
- * Database client type
3014
- *
3015
- * Note: Using `any` here to preserve Drizzle's schema inference.
3016
- * Attempting to use PostgresJsDatabase<any> loses the schema generic
3017
- * and breaks db.query.tableName access patterns.
3018
- */
3019
- declare type DatabaseClient = any;
3020
-
3021
- /**
3022
- * Ory Kratos identity
3023
- */
3024
- declare interface KratosIdentity {
3025
- id: string;
3026
- traits: {
3027
- email: string;
3028
- name?: string;
3029
- [key: string]: unknown;
3030
- };
3031
- }
3032
-
3033
- /**
3034
- * Ory Kratos session
3035
- */
3036
- declare interface KratosSession {
3037
- identity: KratosIdentity;
3038
- active: boolean;
3039
- expires_at?: string;
3040
- authenticated_at?: string;
3041
- }
3042
-
3043
- /**
3044
- * User object (simplified from Kratos identity)
3045
- */
3046
- declare interface User {
3047
- id: string;
3048
- email: string;
3049
- name?: string;
3050
- }
6
+ declare const coreRouter = router({
7
+ setup: setupRouter,
8
+ events: eventsRouter,
9
+ capture: captureRouter,
10
+ entities: entitiesRouter,
11
+ chat: chatRouter,
12
+ proposals: proposalsRouter,
13
+ suggestions: suggestionsRouter,
14
+ system: systemRouter,
15
+ hub: hubRouter,
16
+ apiKeys: apiKeysRouter,
17
+ health: healthRouter,
18
+ integrations: webhooksRouter,
19
+ documents: documentsRouter,
20
+ content: contentRouter,
21
+ storage: filesRouter,
22
+ notifications: inboxRouter,
23
+ intelligenceRegistry: intelligenceRegistryRouter,
24
+ capabilities: capabilitiesRouter,
25
+ tags: tagsRouter,
26
+ search: searchRouter,
27
+ relations: relationsRouter,
28
+ graph: graphRouter,
29
+ workspaces: workspacesRouter,
30
+ views: viewsRouter,
31
+ preferences: preferencesRouter,
32
+ roles: rolesRouter,
33
+ sharing: sharingRouter,
34
+ templates: templatesRouter,
35
+ whiteboards: whiteboardsRouter,
36
+ });
3051
37
 
3052
38
  export { }