@synap-core/types 0.1.0 → 0.3.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.
Files changed (47) hide show
  1. package/.turbo/turbo-build.log +29 -30
  2. package/dist/chunk-2BEUWD3P.js +0 -0
  3. package/dist/chunk-2N5ZC5EB.js +0 -0
  4. package/dist/chunk-6OHYLFUB.js +16 -0
  5. package/dist/chunk-7LKCNZXD.js +0 -0
  6. package/dist/chunk-IZA3UKBT.js +0 -0
  7. package/dist/chunk-OPLFDITK.js +84 -0
  8. package/dist/chunk-X5L3VJJZ.js +0 -0
  9. package/dist/chunk-ZFFMXKF2.js +49 -0
  10. package/dist/chunk-ZTGPGYVX.js +0 -0
  11. package/dist/documents/index.d.ts +8 -60
  12. package/dist/documents/index.js +1 -1
  13. package/dist/entities/index.d.ts +4 -2
  14. package/dist/entities/index.js +11 -73
  15. package/dist/events/index.d.ts +122 -0
  16. package/dist/events/index.js +6 -0
  17. package/dist/inbox/index.d.ts +8 -6
  18. package/dist/inbox/index.js +6 -43
  19. package/dist/index.d.ts +8 -2
  20. package/dist/index.js +27 -116
  21. package/dist/preferences/index.d.ts +23 -0
  22. package/dist/preferences/index.js +1 -0
  23. package/dist/realtime/index.d.ts +57 -0
  24. package/dist/realtime/index.js +1 -0
  25. package/dist/users/index.d.ts +1 -65
  26. package/dist/users/index.js +1 -1
  27. package/dist/views/index.d.ts +31 -0
  28. package/dist/views/index.js +1 -0
  29. package/dist/workspaces/index.d.ts +30 -0
  30. package/dist/workspaces/index.js +1 -0
  31. package/package.json +31 -2
  32. package/src/documents/index.ts +14 -73
  33. package/src/entities/types.ts +9 -2
  34. package/src/events/index.ts +168 -0
  35. package/src/inbox/index.ts +9 -2
  36. package/src/index.ts +18 -1
  37. package/src/preferences/index.ts +29 -0
  38. package/src/realtime/index.ts +60 -0
  39. package/src/users/index.ts +15 -93
  40. package/src/views/index.ts +39 -0
  41. package/src/workspaces/index.ts +42 -0
  42. package/tsup.config.ts +13 -9
  43. package/dist/documents/index.js.map +0 -1
  44. package/dist/entities/index.js.map +0 -1
  45. package/dist/inbox/index.js.map +0 -1
  46. package/dist/index.js.map +0 -1
  47. package/dist/users/index.js.map +0 -1
@@ -1,30 +1,29 @@
1
-
2
- 
3
- > @synap-core/types@0.1.0 build /Users/antoine/Documents/Code/synap/synap-backend/packages/types
4
- > tsup
5
-
6
- CLI Building entry: {"index":"src/index.ts","entities/index":"src/entities/index.ts","documents/index":"src/documents/index.ts","users/index":"src/users/index.ts","inbox/index":"src/inbox/index.ts"}
7
- CLI Using tsconfig: tsconfig.json
8
- CLI tsup v8.5.1
9
- CLI Using tsup config: /Users/antoine/Documents/Code/synap/synap-backend/packages/types/tsup.config.ts
10
- CLI Target: es2022
11
- CLI Cleaning output folder
12
- ESM Build start
13
- ESM dist/index.js 3.57 KB
14
- ESM dist/users/index.js 33.00 B
15
- ESM dist/entities/index.js 2.40 KB
16
- ESM dist/inbox/index.js 1.18 KB
17
- ESM dist/documents/index.js 33.00 B
18
- ESM dist/entities/index.js.map 6.12 KB
19
- ESM dist/inbox/index.js.map 3.91 KB
20
- ESM dist/users/index.js.map 71.00 B
21
- ESM dist/index.js.map 9.99 KB
22
- ESM dist/documents/index.js.map 71.00 B
23
- ESM ⚡️ Build success in 15ms
24
- DTS Build start
25
- DTS ⚡️ Build success in 1457ms
26
- DTS dist/index.d.ts 687.00 B
27
- DTS dist/documents/index.d.ts 1.49 KB
28
- DTS dist/users/index.d.ts 1.55 KB
29
- DTS dist/inbox/index.d.ts 4.45 KB
30
- DTS dist/entities/index.d.ts 10.23 KB
1
+
2
+ > @synap-core/types@0.1.0 build /Users/antoine/Documents/Code/synap/synap-backend/packages/types
3
+ > tsup
4
+
5
+ CLI Building entry: src/index.ts, src/documents/index.ts, src/entities/index.ts, src/inbox/index.ts, src/preferences/index.ts, src/realtime/index.ts, src/users/index.ts, src/views/index.ts, src/workspaces/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Using tsup config: /Users/antoine/Documents/Code/synap/synap-backend/packages/types/tsup.config.ts
9
+ CLI Target: es2022
10
+ CLI Cleaning output folder
11
+ ESM Build start
12
+ ESM dist/chunk-7LKCNZXD.js 0 B
13
+ ESM dist/chunk-IZA3UKBT.js 0 B
14
+ ESM dist/chunk-2BEUWD3P.js 0 B
15
+ ESM dist/chunk-X5L3VJJZ.js 0 B
16
+ ESM dist/chunk-2N5ZC5EB.js 0 B
17
+ ESM dist/chunk-ZTGPGYVX.js 0 B
18
+ ESM dist/index.js 717.00 B
19
+ ESM dist/documents/index.js 31.00 B
20
+ ESM dist/workspaces/index.js 31.00 B
21
+ ESM dist/entities/index.js 340.00 B
22
+ ESM dist/chunk-OPLFDITK.js 2.37 KB
23
+ ESM dist/realtime/index.js 31.00 B
24
+ ESM dist/views/index.js 31.00 B
25
+ ESM dist/users/index.js 31.00 B
26
+ ESM dist/preferences/index.js 31.00 B
27
+ ESM dist/chunk-ZFFMXKF2.js 1.15 KB
28
+ ESM dist/inbox/index.js 210.00 B
29
+ ESM ⚡️ Build success in 226ms
File without changes
File without changes
@@ -0,0 +1,16 @@
1
+ // src/events/index.ts
2
+ var DomainEventNames = {
3
+ ENTITY_CREATED: "entity:created",
4
+ ENTITY_UPDATED: "entity:updated",
5
+ ENTITY_DELETED: "entity:deleted",
6
+ DOCUMENT_UPDATED: "document:updated",
7
+ DOCUMENT_VERSION: "document:version",
8
+ AI_PROPOSAL: "ai:proposal",
9
+ AI_PROPOSAL_STATUS: "ai:proposal:status",
10
+ CHAT_MESSAGE: "chat:message",
11
+ CHAT_STREAM: "chat:stream"
12
+ };
13
+
14
+ export {
15
+ DomainEventNames
16
+ };
File without changes
File without changes
@@ -0,0 +1,84 @@
1
+ // src/entities/schemas.ts
2
+ import { z } from "zod";
3
+ var ENTITY_SCHEMAS = {
4
+ task: z.object({
5
+ status: z.enum(["todo", "in_progress", "done", "archived"]).default("todo"),
6
+ priority: z.enum(["low", "medium", "high", "urgent"]).optional(),
7
+ dueDate: z.string().datetime().optional(),
8
+ completedAt: z.string().datetime().optional(),
9
+ assignee: z.string().uuid().optional(),
10
+ estimatedMinutes: z.number().int().positive().optional(),
11
+ actualMinutes: z.number().int().positive().optional()
12
+ }),
13
+ note: z.object({
14
+ tags: z.array(z.string()).default([]),
15
+ format: z.enum(["markdown", "plain", "rich"]).default("markdown"),
16
+ linkedEntities: z.array(z.string().uuid()).optional(),
17
+ isFavorite: z.boolean().default(false)
18
+ }),
19
+ person: z.object({
20
+ email: z.string().email().optional(),
21
+ phone: z.string().optional(),
22
+ company: z.string().optional(),
23
+ role: z.string().optional(),
24
+ linkedInUrl: z.string().url().optional(),
25
+ twitterHandle: z.string().optional(),
26
+ notes: z.string().optional()
27
+ }),
28
+ event: z.object({
29
+ startTime: z.string().datetime(),
30
+ endTime: z.string().datetime(),
31
+ location: z.string().optional(),
32
+ attendees: z.array(z.string().uuid()).optional(),
33
+ recurring: z.boolean().default(false),
34
+ recurrenceRule: z.string().optional(),
35
+ // iCal RRULE format
36
+ isAllDay: z.boolean().default(false),
37
+ reminderMinutes: z.number().int().optional()
38
+ }),
39
+ file: z.object({
40
+ mimeType: z.string(),
41
+ sizeBytes: z.number().int().positive(),
42
+ extension: z.string(),
43
+ thumbnailUrl: z.string().url().optional(),
44
+ downloadUrl: z.string().url().optional()
45
+ })
46
+ };
47
+ function validateEntityMetadata(type, metadata) {
48
+ return ENTITY_SCHEMAS[type].parse(metadata);
49
+ }
50
+ function safeValidateEntityMetadata(type, metadata) {
51
+ return ENTITY_SCHEMAS[type].safeParse(metadata);
52
+ }
53
+
54
+ // src/entities/guards.ts
55
+ function isTask(entity) {
56
+ return entity.type === "task";
57
+ }
58
+ function isNote(entity) {
59
+ return entity.type === "note";
60
+ }
61
+ function isPerson(entity) {
62
+ return entity.type === "person";
63
+ }
64
+ function isEvent(entity) {
65
+ return entity.type === "event";
66
+ }
67
+ function isFile(entity) {
68
+ return entity.type === "file";
69
+ }
70
+ function isEntityOfType(entity, type) {
71
+ return entity.type === type;
72
+ }
73
+
74
+ export {
75
+ ENTITY_SCHEMAS,
76
+ validateEntityMetadata,
77
+ safeValidateEntityMetadata,
78
+ isTask,
79
+ isNote,
80
+ isPerson,
81
+ isEvent,
82
+ isFile,
83
+ isEntityOfType
84
+ };
File without changes
@@ -0,0 +1,49 @@
1
+ // src/inbox/index.ts
2
+ import { z } from "zod";
3
+ var INBOX_SCHEMAS = {
4
+ email: z.object({
5
+ from: z.string().email(),
6
+ to: z.array(z.string().email()),
7
+ subject: z.string(),
8
+ snippet: z.string(),
9
+ threadId: z.string().optional(),
10
+ labels: z.array(z.string()).optional()
11
+ }),
12
+ calendar_event: z.object({
13
+ summary: z.string(),
14
+ description: z.string().optional(),
15
+ location: z.string().optional(),
16
+ start: z.string().datetime(),
17
+ end: z.string().datetime(),
18
+ attendees: z.array(z.object({
19
+ email: z.string().email(),
20
+ name: z.string().optional()
21
+ })).optional()
22
+ }),
23
+ slack_message: z.object({
24
+ channel: z.string(),
25
+ user: z.string(),
26
+ text: z.string(),
27
+ threadTs: z.string().optional(),
28
+ reactions: z.array(z.object({
29
+ name: z.string(),
30
+ count: z.number()
31
+ })).optional()
32
+ })
33
+ };
34
+ function isEmailInboxItem(item) {
35
+ return item.type === "email";
36
+ }
37
+ function isCalendarInboxItem(item) {
38
+ return item.type === "calendar_event";
39
+ }
40
+ function isSlackInboxItem(item) {
41
+ return item.type === "slack_message";
42
+ }
43
+
44
+ export {
45
+ INBOX_SCHEMAS,
46
+ isEmailInboxItem,
47
+ isCalendarInboxItem,
48
+ isSlackInboxItem
49
+ };
File without changes
@@ -1,66 +1,14 @@
1
+ import { Document } from '@synap/database/schema';
2
+ export { Document, DocumentSession, DocumentVersion, NewDocument, NewDocumentSession, NewDocumentVersion } from '@synap/database/schema';
3
+
1
4
  /**
2
5
  * Document Types
3
6
  *
4
- * Types for document storage and versioning.
5
- */
6
- /**
7
- * Document - stores file content with versioning
8
- */
9
- interface Document {
10
- id: string;
11
- userId: string;
12
- title: string;
13
- type: 'text' | 'markdown' | 'code' | 'pdf' | 'docx';
14
- language?: string;
15
- storageUrl: string;
16
- storageKey: string;
17
- size: number;
18
- mimeType?: string;
19
- currentVersion: number;
20
- projectId?: string;
21
- metadata?: Record<string, unknown>;
22
- createdAt: Date;
23
- updatedAt: Date;
24
- deletedAt?: Date;
25
- }
26
- /**
27
- * Document version - stores historical versions
28
- */
29
- interface DocumentVersion {
30
- id: string;
31
- documentId: string;
32
- version: number;
33
- content: string;
34
- delta?: unknown;
35
- author: '​user' | 'ai';
36
- authorId: string;
37
- message?: string;
38
- createdAt: Date;
39
- }
40
- /**
41
- * Document session - for real-time collaboration
42
- */
43
- interface DocumentSession {
44
- id: string;
45
- documentId: string;
46
- userId: string;
47
- chatThreadId: string;
48
- isActive: boolean;
49
- activeCollaborators?: Array<{
50
- type: 'user' | 'ai';
51
- id: string;
52
- cursor?: unknown;
53
- }>;
54
- startedAt: Date;
55
- endedAt?: Date;
56
- }
57
- /**
58
- * New document (for creation)
59
- */
60
- type NewDocument = Omit<Document, 'id' | 'currentVersion' | 'createdAt' | 'updatedAt'>;
61
- /**
62
- * Document update (for updates)
7
+ * Re-exports document types from database schema (single source of truth).
8
+ *
9
+ * @see {@link file:///.../packages/database/src/schema/documents.ts}
63
10
  */
11
+
64
12
  type UpdateDocument = Partial<Omit<Document, 'id' | 'userId' | 'createdAt' | 'updatedAt'>>;
65
13
 
66
- export type { Document, DocumentSession, DocumentVersion, NewDocument, UpdateDocument };
14
+ export type { UpdateDocument };
@@ -1 +1 @@
1
- //# sourceMappingURL=index.js.map
1
+ import "../chunk-7LKCNZXD.js";
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export { Entity as DBEntity, NewEntity as NewEntityDB } from '@synap/database/schema';
2
3
 
3
4
  /**
4
5
  * Entity Metadata Schemas
@@ -224,8 +225,9 @@ declare function safeValidateEntityMetadata<T extends EntityType>(type: T, metad
224
225
  /**
225
226
  * Entity Types
226
227
  *
227
- * TypeScript types for entities with discriminated unions.
228
- * Types are automatically generated from Zod schemas.
228
+ * Re-exports base entity types from database and adds discriminated unions.
229
+ *
230
+ * @see {@link file:///.../packages/database/src/schema/entities.ts}
229
231
  */
230
232
 
231
233
  /**
@@ -1,75 +1,14 @@
1
- // src/entities/schemas.ts
2
- import { z } from "zod";
3
- var ENTITY_SCHEMAS = {
4
- task: z.object({
5
- status: z.enum(["todo", "in_progress", "done", "archived"]).default("todo"),
6
- priority: z.enum(["low", "medium", "high", "urgent"]).optional(),
7
- dueDate: z.string().datetime().optional(),
8
- completedAt: z.string().datetime().optional(),
9
- assignee: z.string().uuid().optional(),
10
- estimatedMinutes: z.number().int().positive().optional(),
11
- actualMinutes: z.number().int().positive().optional()
12
- }),
13
- note: z.object({
14
- tags: z.array(z.string()).default([]),
15
- format: z.enum(["markdown", "plain", "rich"]).default("markdown"),
16
- linkedEntities: z.array(z.string().uuid()).optional(),
17
- isFavorite: z.boolean().default(false)
18
- }),
19
- person: z.object({
20
- email: z.string().email().optional(),
21
- phone: z.string().optional(),
22
- company: z.string().optional(),
23
- role: z.string().optional(),
24
- linkedInUrl: z.string().url().optional(),
25
- twitterHandle: z.string().optional(),
26
- notes: z.string().optional()
27
- }),
28
- event: z.object({
29
- startTime: z.string().datetime(),
30
- endTime: z.string().datetime(),
31
- location: z.string().optional(),
32
- attendees: z.array(z.string().uuid()).optional(),
33
- recurring: z.boolean().default(false),
34
- recurrenceRule: z.string().optional(),
35
- // iCal RRULE format
36
- isAllDay: z.boolean().default(false),
37
- reminderMinutes: z.number().int().optional()
38
- }),
39
- file: z.object({
40
- mimeType: z.string(),
41
- sizeBytes: z.number().int().positive(),
42
- extension: z.string(),
43
- thumbnailUrl: z.string().url().optional(),
44
- downloadUrl: z.string().url().optional()
45
- })
46
- };
47
- function validateEntityMetadata(type, metadata) {
48
- return ENTITY_SCHEMAS[type].parse(metadata);
49
- }
50
- function safeValidateEntityMetadata(type, metadata) {
51
- return ENTITY_SCHEMAS[type].safeParse(metadata);
52
- }
53
-
54
- // src/entities/guards.ts
55
- function isTask(entity) {
56
- return entity.type === "task";
57
- }
58
- function isNote(entity) {
59
- return entity.type === "note";
60
- }
61
- function isPerson(entity) {
62
- return entity.type === "person";
63
- }
64
- function isEvent(entity) {
65
- return entity.type === "event";
66
- }
67
- function isFile(entity) {
68
- return entity.type === "file";
69
- }
70
- function isEntityOfType(entity, type) {
71
- return entity.type === type;
72
- }
1
+ import {
2
+ ENTITY_SCHEMAS,
3
+ isEntityOfType,
4
+ isEvent,
5
+ isFile,
6
+ isNote,
7
+ isPerson,
8
+ isTask,
9
+ safeValidateEntityMetadata,
10
+ validateEntityMetadata
11
+ } from "../chunk-OPLFDITK.js";
73
12
  export {
74
13
  ENTITY_SCHEMAS,
75
14
  isEntityOfType,
@@ -81,4 +20,3 @@ export {
81
20
  safeValidateEntityMetadata,
82
21
  validateEntityMetadata
83
22
  };
84
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Domain Event Types
3
+ *
4
+ * Type definitions for Socket.IO domain events.
5
+ * These are emitted by Inngest workers via the realtime bridge
6
+ * to notify clients about data changes.
7
+ *
8
+ * SINGLE SOURCE OF TRUTH - Frontend imports from here.
9
+ */
10
+ interface EntityCreatedEvent {
11
+ entityId: string;
12
+ workspaceId: string;
13
+ type: string;
14
+ title: string;
15
+ createdBy: string;
16
+ createdAt: string;
17
+ }
18
+ interface EntityUpdatedEvent {
19
+ entityId: string;
20
+ workspaceId: string;
21
+ changes: Record<string, unknown>;
22
+ updatedBy: string;
23
+ updatedAt: string;
24
+ }
25
+ interface EntityDeletedEvent {
26
+ entityId: string;
27
+ workspaceId: string;
28
+ deletedBy: string;
29
+ deletedAt: string;
30
+ }
31
+ interface DocumentUpdatedEvent {
32
+ documentId: string;
33
+ workspaceId: string;
34
+ version: number;
35
+ updatedBy: string;
36
+ updatedAt: string;
37
+ }
38
+ interface DocumentVersionCreatedEvent {
39
+ documentId: string;
40
+ workspaceId: string;
41
+ version: number;
42
+ message?: string;
43
+ createdBy: string;
44
+ createdAt: string;
45
+ }
46
+ interface AIProposalEvent {
47
+ proposalId: string;
48
+ workspaceId: string;
49
+ targetType: 'entity' | 'document';
50
+ targetId?: string;
51
+ operation: 'create' | 'update' | 'delete';
52
+ data: unknown;
53
+ reasoning: string;
54
+ confidence: number;
55
+ createdAt: string;
56
+ }
57
+ interface AIProposalStatusEvent {
58
+ proposalId: string;
59
+ workspaceId: string;
60
+ status: 'approved' | 'rejected';
61
+ processedBy: string;
62
+ processedAt: string;
63
+ }
64
+ interface ChatMessageEvent {
65
+ threadId: string;
66
+ messageId: string;
67
+ workspaceId: string;
68
+ role: 'user' | 'assistant';
69
+ content: string;
70
+ createdAt: string;
71
+ }
72
+ interface ChatStreamEvent {
73
+ threadId: string;
74
+ messageId: string;
75
+ chunk: string;
76
+ done: boolean;
77
+ }
78
+ /**
79
+ * All domain events emitted from server to client.
80
+ * Use this for typed Socket.IO client setup.
81
+ */
82
+ interface DomainServerToClientEvents {
83
+ 'entity:created': (data: EntityCreatedEvent) => void;
84
+ 'entity:updated': (data: EntityUpdatedEvent) => void;
85
+ 'entity:deleted': (data: EntityDeletedEvent) => void;
86
+ 'document:updated': (data: DocumentUpdatedEvent) => void;
87
+ 'document:version': (data: DocumentVersionCreatedEvent) => void;
88
+ 'ai:proposal': (data: AIProposalEvent) => void;
89
+ 'ai:proposal:status': (data: AIProposalStatusEvent) => void;
90
+ 'chat:message': (data: ChatMessageEvent) => void;
91
+ 'chat:stream': (data: ChatStreamEvent) => void;
92
+ 'error': (data: {
93
+ code: string;
94
+ message: string;
95
+ }) => void;
96
+ }
97
+ /**
98
+ * Events clients can send to server.
99
+ */
100
+ interface DomainClientToServerEvents {
101
+ 'join-workspace': (workspaceId: string) => void;
102
+ 'leave-workspace': (workspaceId: string) => void;
103
+ 'join-document': (documentId: string) => void;
104
+ 'leave-document': (documentId: string) => void;
105
+ }
106
+ /**
107
+ * All domain event names for type checking
108
+ */
109
+ declare const DomainEventNames: {
110
+ readonly ENTITY_CREATED: "entity:created";
111
+ readonly ENTITY_UPDATED: "entity:updated";
112
+ readonly ENTITY_DELETED: "entity:deleted";
113
+ readonly DOCUMENT_UPDATED: "document:updated";
114
+ readonly DOCUMENT_VERSION: "document:version";
115
+ readonly AI_PROPOSAL: "ai:proposal";
116
+ readonly AI_PROPOSAL_STATUS: "ai:proposal:status";
117
+ readonly CHAT_MESSAGE: "chat:message";
118
+ readonly CHAT_STREAM: "chat:stream";
119
+ };
120
+ type DomainEventName = typeof DomainEventNames[keyof typeof DomainEventNames];
121
+
122
+ export { type AIProposalEvent, type AIProposalStatusEvent, type ChatMessageEvent, type ChatStreamEvent, type DocumentUpdatedEvent, type DocumentVersionCreatedEvent, type DomainClientToServerEvents, type DomainEventName, DomainEventNames, type DomainServerToClientEvents, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent };
@@ -0,0 +1,6 @@
1
+ import {
2
+ DomainEventNames
3
+ } from "../chunk-6OHYLFUB.js";
4
+ export {
5
+ DomainEventNames
6
+ };
@@ -1,10 +1,12 @@
1
1
  import { z } from 'zod';
2
+ export { InboxItem as DBInboxItem, NewInboxItem } from '@synap/database/schema';
2
3
 
3
4
  /**
4
5
  * Inbox Item Schemas & Types
5
6
  *
6
- * Types for external items (emails, calendar events, etc.)
7
- * that are staged in the inbox before becoming entities.
7
+ * Re-exports inbox types from database and adds provider-specific schemas.
8
+ *
9
+ * @see {@link file:///.../packages/database/src/schema/inbox-items.ts}
8
10
  */
9
11
 
10
12
  /**
@@ -86,18 +88,18 @@ declare const INBOX_SCHEMAS: {
86
88
  count: number;
87
89
  }>, "many">>;
88
90
  }, "strip", z.ZodTypeAny, {
89
- text: string;
90
- user: string;
91
91
  channel: string;
92
+ user: string;
93
+ text: string;
92
94
  threadTs?: string | undefined;
93
95
  reactions?: {
94
96
  name: string;
95
97
  count: number;
96
98
  }[] | undefined;
97
99
  }, {
98
- text: string;
99
- user: string;
100
100
  channel: string;
101
+ user: string;
102
+ text: string;
101
103
  threadTs?: string | undefined;
102
104
  reactions?: {
103
105
  name: string;
@@ -1,49 +1,12 @@
1
- // src/inbox/index.ts
2
- import { z } from "zod";
3
- var INBOX_SCHEMAS = {
4
- email: z.object({
5
- from: z.string().email(),
6
- to: z.array(z.string().email()),
7
- subject: z.string(),
8
- snippet: z.string(),
9
- threadId: z.string().optional(),
10
- labels: z.array(z.string()).optional()
11
- }),
12
- calendar_event: z.object({
13
- summary: z.string(),
14
- description: z.string().optional(),
15
- location: z.string().optional(),
16
- start: z.string().datetime(),
17
- end: z.string().datetime(),
18
- attendees: z.array(z.object({
19
- email: z.string().email(),
20
- name: z.string().optional()
21
- })).optional()
22
- }),
23
- slack_message: z.object({
24
- channel: z.string(),
25
- user: z.string(),
26
- text: z.string(),
27
- threadTs: z.string().optional(),
28
- reactions: z.array(z.object({
29
- name: z.string(),
30
- count: z.number()
31
- })).optional()
32
- })
33
- };
34
- function isEmailInboxItem(item) {
35
- return item.type === "email";
36
- }
37
- function isCalendarInboxItem(item) {
38
- return item.type === "calendar_event";
39
- }
40
- function isSlackInboxItem(item) {
41
- return item.type === "slack_message";
42
- }
1
+ import {
2
+ INBOX_SCHEMAS,
3
+ isCalendarInboxItem,
4
+ isEmailInboxItem,
5
+ isSlackInboxItem
6
+ } from "../chunk-ZFFMXKF2.js";
43
7
  export {
44
8
  INBOX_SCHEMAS,
45
9
  isCalendarInboxItem,
46
10
  isEmailInboxItem,
47
11
  isSlackInboxItem
48
12
  };
49
- //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  export { BaseEntity, ENTITY_SCHEMAS, Entity, EntityMetadata, EntityType, Event, File, NewEntity, Note, Person, Task, UpdateEntity, isEntityOfType, isEvent, isFile, isNote, isPerson, isTask, safeValidateEntityMetadata, validateEntityMetadata } from './entities/index.js';
2
- export { Document, DocumentSession, DocumentVersion, NewDocument, UpdateDocument } from './documents/index.js';
3
- export { EntityEnrichment, EntityRelationship, ReasoningTrace, UserEntityState } from './users/index.js';
2
+ export { UpdateDocument } from './documents/index.js';
3
+ export { Entity as DBEntity, InboxItem as DBInboxItem, Document, DocumentSession, DocumentVersion, EntityEnrichment, EntityRelationship, NewDocument, NewDocumentSession, NewDocumentVersion, NewEntity as NewEntityDB, NewEntityEnrichment, NewEntityRelationship, NewInboxItem, NewReasoningTrace, NewUserEntityState, NewUserPreference as NewUserPreferences, NewView, NewWorkspace, NewWorkspaceInvite, NewWorkspaceMember, ReasoningTrace, UserEntityState, UserPreference as UserPreferences, View, Workspace, WorkspaceInvite, WorkspaceMember } from '@synap/database/schema';
4
4
  export { CalendarInboxItem, EmailInboxItem, INBOX_SCHEMAS, InboxItem, InboxItemType, SlackInboxItem, isCalendarInboxItem, isEmailInboxItem, isSlackInboxItem } from './inbox/index.js';
5
+ export { CreateWorkspaceInput, InviteMemberInput, UpdateWorkspaceInput, WorkspaceRole, WorkspaceType } from './workspaces/index.js';
6
+ export { CreateViewInput, SaveViewInput, UpdateViewInput, ViewType } from './views/index.js';
7
+ export { Theme, UpdatePreferencesInput } from './preferences/index.js';
8
+ export { CollaborationEvent, CursorUpdate, PresenceInit, PresenceStatus, UserPresence } from './realtime/index.js';
9
+ export { AIProposalEvent, AIProposalStatusEvent, ChatMessageEvent, ChatStreamEvent, DocumentUpdatedEvent, DocumentVersionCreatedEvent, DomainClientToServerEvents, DomainEventName, DomainEventNames, DomainServerToClientEvents, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent } from './events/index.js';
10
+ export { Array as YArray, Doc as YDoc, Map as YMap, Text as YText } from 'yjs';
5
11
  import 'zod';