@synap-core/types 1.2.10 → 1.2.12

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.
@@ -32,6 +32,7 @@ var CustomThemeSchema = z.object({
32
32
  var UIPreferencesSchema = z.object({
33
33
  sidebarCollapsed: z.boolean().optional(),
34
34
  panelPositions: z.record(
35
+ z.string(),
35
36
  z.object({
36
37
  x: z.number(),
37
38
  y: z.number()
@@ -66,7 +67,7 @@ var UpdatePreferencesInputSchema = z.object({
66
67
  customTheme: CustomThemeSchema,
67
68
  defaultTemplates: z.record(z.string(), z.string()).optional(),
68
69
  customEntityTypes: z.array(z.any()).optional(),
69
- entityMetadataSchemas: z.record(z.string(), z.record(z.any())).optional(),
70
+ entityMetadataSchemas: z.record(z.string(), z.record(z.string(), z.any())).optional(),
70
71
  uiPreferences: UIPreferencesSchema,
71
72
  graphPreferences: GraphPreferencesSchema,
72
73
  onboardingCompleted: z.boolean().optional(),
@@ -0,0 +1 @@
1
+ export { Document, DocumentSession, NewDocumentSession, NewDocumentVersion, insertDocumentSessionSchema, insertDocumentVersionSchema, selectDocumentSessionSchema, selectDocumentVersionSchema } from '@synap/database/schema';
@@ -0,0 +1,38 @@
1
+ import { E as Entity, T as Task, N as Note, P as Person, e as Event, F as File } from '../types-DEHO6DAD.js';
2
+ export { B as BaseEntity, C as Contact, a as ENTITY_SCHEMAS, c as EntityMetadata, d as EntitySchema, b as EntityType, I as Idea, M as Meeting, g as NewEntity, f as Project, U as UpdateEntity, s as safeValidateEntityMetadata, v as validateEntityMetadata } from '../types-DEHO6DAD.js';
3
+ import 'zod';
4
+
5
+ /**
6
+ * Entity Type Guards
7
+ *
8
+ * Type guard functions for narrowing entity types.
9
+ */
10
+
11
+ /**
12
+ * Type guard for Task entities
13
+ */
14
+ declare function isTask(entity: Entity): entity is Task;
15
+ /**
16
+ * Type guard for Note entities
17
+ */
18
+ declare function isNote(entity: Entity): entity is Note;
19
+ /**
20
+ * Type guard for Person entities
21
+ */
22
+ declare function isPerson(entity: Entity): entity is Person;
23
+ /**
24
+ * Type guard for Event entities
25
+ */
26
+ declare function isEvent(entity: Entity): entity is Event;
27
+ /**
28
+ * Type guard for File entities
29
+ */
30
+ declare function isFile(entity: Entity): entity is File;
31
+ /**
32
+ * Generic type guard for any entity type
33
+ */
34
+ declare function isEntityOfType<T extends Entity["type"]>(entity: Entity, type: T): entity is Extract<Entity, {
35
+ type: T;
36
+ }>;
37
+
38
+ export { Entity, Event, File, Note, Person, Task, isEntityOfType, isEvent, isFile, isNote, isPerson, isTask };
@@ -0,0 +1,139 @@
1
+ import { E as Entity } from '../types-DEHO6DAD.js';
2
+ import 'zod';
3
+
4
+ /**
5
+ * Domain Event Types
6
+ *
7
+ * Type definitions for Socket.IO domain events.
8
+ * These are emitted by Inngest workers via the realtime bridge
9
+ * to notify clients about data changes.
10
+ *
11
+ * SINGLE SOURCE OF TRUTH - Frontend imports from here.
12
+ */
13
+
14
+ interface EntityCreatedEvent {
15
+ entityId: string;
16
+ workspaceId: string;
17
+ type: string;
18
+ title: string;
19
+ entity?: Entity;
20
+ createdBy: string;
21
+ createdAt: string;
22
+ }
23
+ interface EntityUpdatedEvent {
24
+ entityId: string;
25
+ workspaceId: string;
26
+ changes: Record<string, unknown>;
27
+ entity?: Entity;
28
+ updatedBy: string;
29
+ updatedAt: string;
30
+ }
31
+ interface EntityDeletedEvent {
32
+ entityId: string;
33
+ workspaceId: string;
34
+ deletedBy: string;
35
+ deletedAt: string;
36
+ }
37
+ interface EntityApprovalEvent {
38
+ requestId: string;
39
+ entityId?: string;
40
+ workspaceId: string;
41
+ entityType: string;
42
+ status: "pending" | "approved" | "rejected" | "created";
43
+ reason?: string;
44
+ createdBy: string;
45
+ timestamp: string;
46
+ }
47
+ interface DocumentUpdatedEvent {
48
+ documentId: string;
49
+ workspaceId: string;
50
+ version: number;
51
+ updatedBy: string;
52
+ updatedAt: string;
53
+ }
54
+ interface DocumentVersionCreatedEvent {
55
+ documentId: string;
56
+ workspaceId: string;
57
+ version: number;
58
+ message?: string;
59
+ createdBy: string;
60
+ createdAt: string;
61
+ }
62
+ interface AIProposalEvent {
63
+ proposalId: string;
64
+ workspaceId: string;
65
+ targetType: "entity" | "document";
66
+ targetId?: string;
67
+ operation: "create" | "update" | "delete";
68
+ data: unknown;
69
+ reasoning: string;
70
+ confidence: number;
71
+ createdAt: string;
72
+ }
73
+ interface AIProposalStatusEvent {
74
+ proposalId: string;
75
+ workspaceId: string;
76
+ status: "approved" | "rejected";
77
+ processedBy: string;
78
+ processedAt: string;
79
+ }
80
+ interface ChatMessageEvent {
81
+ threadId: string;
82
+ messageId: string;
83
+ workspaceId: string;
84
+ role: "user" | "assistant";
85
+ content: string;
86
+ createdAt: string;
87
+ }
88
+ interface ChatStreamEvent {
89
+ threadId: string;
90
+ messageId: string;
91
+ chunk: string;
92
+ done: boolean;
93
+ }
94
+ /**
95
+ * All domain events emitted from server to client.
96
+ * Use this for typed Socket.IO client setup.
97
+ */
98
+ interface DomainServerToClientEvents {
99
+ "entity:created": (data: EntityCreatedEvent) => void;
100
+ "entity:updated": (data: EntityUpdatedEvent) => void;
101
+ "entity:deleted": (data: EntityDeletedEvent) => void;
102
+ "entity:approval": (data: EntityApprovalEvent) => void;
103
+ "document:updated": (data: DocumentUpdatedEvent) => void;
104
+ "document:version": (data: DocumentVersionCreatedEvent) => void;
105
+ "ai:proposal": (data: AIProposalEvent) => void;
106
+ "ai:proposal:status": (data: AIProposalStatusEvent) => void;
107
+ "chat:message": (data: ChatMessageEvent) => void;
108
+ "chat:stream": (data: ChatStreamEvent) => void;
109
+ error: (data: {
110
+ code: string;
111
+ message: string;
112
+ }) => void;
113
+ }
114
+ /**
115
+ * Events clients can send to server.
116
+ */
117
+ interface DomainClientToServerEvents {
118
+ "join-workspace": (workspaceId: string) => void;
119
+ "leave-workspace": (workspaceId: string) => void;
120
+ "join-document": (documentId: string) => void;
121
+ "leave-document": (documentId: string) => void;
122
+ }
123
+ /**
124
+ * All domain event names for type checking
125
+ */
126
+ declare const DomainEventNames: {
127
+ readonly ENTITY_CREATED: "entity:created";
128
+ readonly ENTITY_UPDATED: "entity:updated";
129
+ readonly ENTITY_DELETED: "entity:deleted";
130
+ readonly DOCUMENT_UPDATED: "document:updated";
131
+ readonly DOCUMENT_VERSION: "document:version";
132
+ readonly AI_PROPOSAL: "ai:proposal";
133
+ readonly AI_PROPOSAL_STATUS: "ai:proposal:status";
134
+ readonly CHAT_MESSAGE: "chat:message";
135
+ readonly CHAT_STREAM: "chat:stream";
136
+ };
137
+ type DomainEventName = (typeof DomainEventNames)[keyof typeof DomainEventNames];
138
+
139
+ export { type AIProposalEvent, type AIProposalStatusEvent, type ChatMessageEvent, type ChatStreamEvent, type DocumentUpdatedEvent, type DocumentVersionCreatedEvent, type DomainClientToServerEvents, type DomainEventName, DomainEventNames, type DomainServerToClientEvents, type EntityApprovalEvent, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent };
@@ -0,0 +1,2 @@
1
+
2
+ export { }