@synap-core/types 1.2.6 → 1.2.7

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 (136) hide show
  1. package/.turbo/turbo-build.log +49 -0
  2. package/dist/documents/index.d.ts +1 -7
  3. package/dist/documents/index.js +12 -7
  4. package/dist/entities/index.d.ts +35 -6
  5. package/dist/entities/index.js +24 -12
  6. package/dist/events/index.d.ts +20 -16
  7. package/dist/events/index.js +14 -26
  8. package/dist/inbox/index.d.ts +2 -2
  9. package/dist/inbox/index.js +1 -2
  10. package/dist/index.d.ts +5489 -25
  11. package/dist/index.js +760 -42
  12. package/dist/preferences/index.d.ts +573 -5
  13. package/dist/preferences/index.js +16 -13
  14. package/dist/proposals/index.d.ts +6 -4
  15. package/dist/proposals/index.js +8 -7
  16. package/dist/realtime/index.d.ts +12 -9
  17. package/dist/realtime/index.js +1 -8
  18. package/dist/relations/index.d.ts +8 -5
  19. package/dist/relations/index.js +1 -9
  20. package/dist/users/index.d.ts +1 -9
  21. package/dist/users/index.js +1 -9
  22. package/dist/views/index.d.ts +1596 -10
  23. package/dist/views/index.js +28 -14
  24. package/dist/workspaces/index.d.ts +11 -8
  25. package/dist/workspaces/index.js +1 -9
  26. package/package.json +2 -2
  27. package/src/chat/index.ts +1 -1
  28. package/src/entities/guards.ts +1 -1
  29. package/src/entities/schemas.ts +2 -2
  30. package/src/errors/index.ts +6 -6
  31. package/src/preferences/schemas.ts +1 -1
  32. package/src/templates/schemas.ts +1 -1
  33. package/src/views/schemas.ts +2 -2
  34. package/src/views/types.ts +2 -2
  35. package/tsconfig.json +4 -10
  36. package/tsconfig.tsbuildinfo +1 -1
  37. package/dist/approvals/index.d.ts +0 -107
  38. package/dist/approvals/index.d.ts.map +0 -1
  39. package/dist/approvals/index.js +0 -8
  40. package/dist/approvals/index.js.map +0 -1
  41. package/dist/chat/index.d.ts +0 -120
  42. package/dist/chat/index.d.ts.map +0 -1
  43. package/dist/chat/index.js +0 -8
  44. package/dist/chat/index.js.map +0 -1
  45. package/dist/documents/index.d.ts.map +0 -1
  46. package/dist/documents/index.js.map +0 -1
  47. package/dist/entities/guards.d.ts +0 -33
  48. package/dist/entities/guards.d.ts.map +0 -1
  49. package/dist/entities/guards.js +0 -42
  50. package/dist/entities/guards.js.map +0 -1
  51. package/dist/entities/index.d.ts.map +0 -1
  52. package/dist/entities/index.js.map +0 -1
  53. package/dist/entities/schemas.d.ts +0 -274
  54. package/dist/entities/schemas.d.ts.map +0 -1
  55. package/dist/entities/schemas.js +0 -84
  56. package/dist/entities/schemas.js.map +0 -1
  57. package/dist/entities/types.d.ts +0 -740
  58. package/dist/entities/types.d.ts.map +0 -1
  59. package/dist/entities/types.js +0 -69
  60. package/dist/entities/types.js.map +0 -1
  61. package/dist/errors/index.d.ts +0 -182
  62. package/dist/errors/index.d.ts.map +0 -1
  63. package/dist/errors/index.js +0 -232
  64. package/dist/errors/index.js.map +0 -1
  65. package/dist/events/index.d.ts.map +0 -1
  66. package/dist/events/index.js.map +0 -1
  67. package/dist/hub-protocol/index.d.ts +0 -218
  68. package/dist/hub-protocol/index.d.ts.map +0 -1
  69. package/dist/hub-protocol/index.js +0 -58
  70. package/dist/hub-protocol/index.js.map +0 -1
  71. package/dist/inbox/index.d.ts.map +0 -1
  72. package/dist/inbox/index.js.map +0 -1
  73. package/dist/index.d.ts.map +0 -1
  74. package/dist/index.js.map +0 -1
  75. package/dist/preferences/index.d.ts.map +0 -1
  76. package/dist/preferences/index.js.map +0 -1
  77. package/dist/preferences/schemas.d.ts +0 -566
  78. package/dist/preferences/schemas.d.ts.map +0 -1
  79. package/dist/preferences/schemas.js +0 -103
  80. package/dist/preferences/schemas.js.map +0 -1
  81. package/dist/proposals/index.d.ts.map +0 -1
  82. package/dist/proposals/index.js.map +0 -1
  83. package/dist/realtime/index.d.ts.map +0 -1
  84. package/dist/realtime/index.js.map +0 -1
  85. package/dist/relations/index.d.ts.map +0 -1
  86. package/dist/relations/index.js.map +0 -1
  87. package/dist/templates/classic-note.template.d.ts +0 -9
  88. package/dist/templates/classic-note.template.d.ts.map +0 -1
  89. package/dist/templates/classic-note.template.js +0 -103
  90. package/dist/templates/classic-note.template.js.map +0 -1
  91. package/dist/templates/index.d.ts +0 -14
  92. package/dist/templates/index.d.ts.map +0 -1
  93. package/dist/templates/index.js +0 -29
  94. package/dist/templates/index.js.map +0 -1
  95. package/dist/templates/notion-like.template.d.ts +0 -9
  96. package/dist/templates/notion-like.template.d.ts.map +0 -1
  97. package/dist/templates/notion-like.template.js +0 -131
  98. package/dist/templates/notion-like.template.js.map +0 -1
  99. package/dist/templates/schemas.d.ts +0 -4665
  100. package/dist/templates/schemas.d.ts.map +0 -1
  101. package/dist/templates/schemas.js +0 -197
  102. package/dist/templates/schemas.js.map +0 -1
  103. package/dist/templates/types.d.ts +0 -174
  104. package/dist/templates/types.d.ts.map +0 -1
  105. package/dist/templates/types.js +0 -2
  106. package/dist/templates/types.js.map +0 -1
  107. package/dist/templates/wiki-reference.template.d.ts +0 -9
  108. package/dist/templates/wiki-reference.template.d.ts.map +0 -1
  109. package/dist/templates/wiki-reference.template.js +0 -115
  110. package/dist/templates/wiki-reference.template.js.map +0 -1
  111. package/dist/users/index.d.ts.map +0 -1
  112. package/dist/users/index.js.map +0 -1
  113. package/dist/views/config.d.ts +0 -84
  114. package/dist/views/config.d.ts.map +0 -1
  115. package/dist/views/config.js +0 -7
  116. package/dist/views/config.js.map +0 -1
  117. package/dist/views/index.d.ts.map +0 -1
  118. package/dist/views/index.js.map +0 -1
  119. package/dist/views/query.d.ts +0 -47
  120. package/dist/views/query.d.ts.map +0 -1
  121. package/dist/views/query.js +0 -7
  122. package/dist/views/query.js.map +0 -1
  123. package/dist/views/schema.d.ts +0 -27
  124. package/dist/views/schema.d.ts.map +0 -1
  125. package/dist/views/schema.js +0 -8
  126. package/dist/views/schema.js.map +0 -1
  127. package/dist/views/schemas.d.ts +0 -1316
  128. package/dist/views/schemas.d.ts.map +0 -1
  129. package/dist/views/schemas.js +0 -179
  130. package/dist/views/schemas.js.map +0 -1
  131. package/dist/views/types.d.ts +0 -116
  132. package/dist/views/types.d.ts.map +0 -1
  133. package/dist/views/types.js +0 -55
  134. package/dist/views/types.js.map +0 -1
  135. package/dist/workspaces/index.d.ts.map +0 -1
  136. package/dist/workspaces/index.js.map +0 -1
@@ -0,0 +1,49 @@
1
+
2
+ > @synap-core/types@1.2.6 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/events/index.ts, src/inbox/index.ts, src/preferences/index.ts, src/proposals/index.ts, src/realtime/index.ts, src/relations/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-2N5ZC5EB.js 0 B
13
+ ESM dist/chunk-QAWJ6GM3.js 0 B
14
+ ESM dist/chunk-IZA3UKBT.js 0 B
15
+ ESM dist/chunk-GX24H4PF.js 0 B
16
+ ESM dist/users/index.js 31.00 B
17
+ ESM dist/relations/index.js 31.00 B
18
+ ESM dist/chunk-X5L3VJJZ.js 0 B
19
+ ESM dist/views/index.js 642.00 B
20
+ ESM dist/workspaces/index.js 31.00 B
21
+ ESM dist/index.js 19.07 KB
22
+ ESM dist/chunk-E4TRCFI3.js 3.94 KB
23
+ ESM dist/documents/index.js 298.00 B
24
+ ESM dist/chunk-ES7GZ7IQ.js 327.00 B
25
+ ESM dist/chunk-HFVZISQ7.js 4.14 KB
26
+ ESM dist/events/index.js 405.00 B
27
+ ESM dist/entities/index.js 372.00 B
28
+ ESM dist/inbox/index.js 31.00 B
29
+ ESM dist/chunk-MUAPS3OD.js 2.45 KB
30
+ ESM dist/proposals/index.js 146.00 B
31
+ ESM dist/realtime/index.js 31.00 B
32
+ ESM dist/preferences/index.js 374.00 B
33
+ ESM dist/chunk-II4ANI46.js 175.00 B
34
+ ESM ⚡️ Build success in 74ms
35
+ DTS Build start
36
+ DTS ⚡️ Build success in 15351ms
37
+ DTS dist/documents/index.d.ts 224.00 B
38
+ DTS dist/events/index.d.ts 4.12 KB
39
+ DTS dist/proposals/index.d.ts 1.23 KB
40
+ DTS dist/realtime/index.d.ts 1.54 KB
41
+ DTS dist/relations/index.d.ts 896.00 B
42
+ DTS dist/workspaces/index.d.ts 882.00 B
43
+ DTS dist/preferences/index.d.ts 20.10 KB
44
+ DTS dist/views/index.d.ts 60.75 KB
45
+ DTS dist/index.d.ts 233.26 KB
46
+ DTS dist/entities/index.d.ts 1.20 KB
47
+ DTS dist/users/index.d.ts 195.00 B
48
+ DTS dist/inbox/index.d.ts 13.00 B
49
+ DTS dist/types-O93mCz6a.d.ts 31.09 KB
@@ -1,7 +1 @@
1
- /**
2
- * Document Types
3
- * Re-exports from database schema for frontend usage
4
- */
5
- export type { Document, NewDocumentVersion, DocumentSession, NewDocumentSession, } from "@synap/database/schema";
6
- export { insertDocumentVersionSchema, selectDocumentVersionSchema, insertDocumentSessionSchema, selectDocumentSessionSchema, } from "@synap/database/schema";
7
- //# sourceMappingURL=index.d.ts.map
1
+ export { Document, DocumentSession, NewDocumentSession, NewDocumentVersion, insertDocumentSessionSchema, insertDocumentVersionSchema, selectDocumentSessionSchema, selectDocumentVersionSchema } from '@synap/database/schema';
@@ -1,7 +1,12 @@
1
- /**
2
- * Document Types
3
- * Re-exports from database schema for frontend usage
4
- */
5
- // Re-export Zod schemas for runtime validation
6
- export { insertDocumentVersionSchema, selectDocumentVersionSchema, insertDocumentSessionSchema, selectDocumentSessionSchema, } from "@synap/database/schema";
7
- //# sourceMappingURL=index.js.map
1
+ import {
2
+ insertDocumentSessionSchema,
3
+ insertDocumentVersionSchema,
4
+ selectDocumentSessionSchema,
5
+ selectDocumentVersionSchema
6
+ } from "../chunk-ES7GZ7IQ.js";
7
+ export {
8
+ insertDocumentSessionSchema,
9
+ insertDocumentVersionSchema,
10
+ selectDocumentSessionSchema,
11
+ selectDocumentVersionSchema
12
+ };
@@ -1,9 +1,38 @@
1
+ import { E as Entity, T as Task, N as Note, P as Person, e as Event, F as File } from '../types-O93mCz6a.js';
2
+ export { B as BaseEntity, a as ENTITY_SCHEMAS, c as EntityMetadata, d as EntitySchema, b as EntityType, f as NewEntity, U as UpdateEntity, s as safeValidateEntityMetadata, v as validateEntityMetadata } from '../types-O93mCz6a.js';
3
+ import 'zod';
4
+
1
5
  /**
2
- * Entity Types - Main Export
6
+ * Entity Type Guards
3
7
  *
4
- * Re-exports all entity-related types, schemas, and helpers.
8
+ * Type guard functions for narrowing entity types.
5
9
  */
6
- export * from "./schemas.js";
7
- export * from "./types.js";
8
- export * from "./guards.js";
9
- //# sourceMappingURL=index.d.ts.map
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 };
@@ -1,12 +1,24 @@
1
- /**
2
- * Entity Types - Main Export
3
- *
4
- * Re-exports all entity-related types, schemas, and helpers.
5
- */
6
- // Schemas and validation
7
- export * from "./schemas.js";
8
- // TypeScript types
9
- export * from "./types.js";
10
- // Type guards
11
- export * from "./guards.js";
12
- //# sourceMappingURL=index.js.map
1
+ import {
2
+ ENTITY_SCHEMAS,
3
+ EntitySchema,
4
+ isEntityOfType,
5
+ isEvent,
6
+ isFile,
7
+ isNote,
8
+ isPerson,
9
+ isTask,
10
+ safeValidateEntityMetadata,
11
+ validateEntityMetadata
12
+ } from "../chunk-HFVZISQ7.js";
13
+ export {
14
+ ENTITY_SCHEMAS,
15
+ EntitySchema,
16
+ isEntityOfType,
17
+ isEvent,
18
+ isFile,
19
+ isNote,
20
+ isPerson,
21
+ isTask,
22
+ safeValidateEntityMetadata,
23
+ validateEntityMetadata
24
+ };
@@ -1,3 +1,6 @@
1
+ import { E as Entity } from '../types-O93mCz6a.js';
2
+ import 'zod';
3
+
1
4
  /**
2
5
  * Domain Event Types
3
6
  *
@@ -7,8 +10,8 @@
7
10
  *
8
11
  * SINGLE SOURCE OF TRUTH - Frontend imports from here.
9
12
  */
10
- import type { Entity } from "../index.js";
11
- export interface EntityCreatedEvent {
13
+
14
+ interface EntityCreatedEvent {
12
15
  entityId: string;
13
16
  workspaceId: string;
14
17
  type: string;
@@ -17,7 +20,7 @@ export interface EntityCreatedEvent {
17
20
  createdBy: string;
18
21
  createdAt: string;
19
22
  }
20
- export interface EntityUpdatedEvent {
23
+ interface EntityUpdatedEvent {
21
24
  entityId: string;
22
25
  workspaceId: string;
23
26
  changes: Record<string, unknown>;
@@ -25,13 +28,13 @@ export interface EntityUpdatedEvent {
25
28
  updatedBy: string;
26
29
  updatedAt: string;
27
30
  }
28
- export interface EntityDeletedEvent {
31
+ interface EntityDeletedEvent {
29
32
  entityId: string;
30
33
  workspaceId: string;
31
34
  deletedBy: string;
32
35
  deletedAt: string;
33
36
  }
34
- export interface EntityApprovalEvent {
37
+ interface EntityApprovalEvent {
35
38
  requestId: string;
36
39
  entityId?: string;
37
40
  workspaceId: string;
@@ -41,14 +44,14 @@ export interface EntityApprovalEvent {
41
44
  createdBy: string;
42
45
  timestamp: string;
43
46
  }
44
- export interface DocumentUpdatedEvent {
47
+ interface DocumentUpdatedEvent {
45
48
  documentId: string;
46
49
  workspaceId: string;
47
50
  version: number;
48
51
  updatedBy: string;
49
52
  updatedAt: string;
50
53
  }
51
- export interface DocumentVersionCreatedEvent {
54
+ interface DocumentVersionCreatedEvent {
52
55
  documentId: string;
53
56
  workspaceId: string;
54
57
  version: number;
@@ -56,7 +59,7 @@ export interface DocumentVersionCreatedEvent {
56
59
  createdBy: string;
57
60
  createdAt: string;
58
61
  }
59
- export interface AIProposalEvent {
62
+ interface AIProposalEvent {
60
63
  proposalId: string;
61
64
  workspaceId: string;
62
65
  targetType: "entity" | "document";
@@ -67,14 +70,14 @@ export interface AIProposalEvent {
67
70
  confidence: number;
68
71
  createdAt: string;
69
72
  }
70
- export interface AIProposalStatusEvent {
73
+ interface AIProposalStatusEvent {
71
74
  proposalId: string;
72
75
  workspaceId: string;
73
76
  status: "approved" | "rejected";
74
77
  processedBy: string;
75
78
  processedAt: string;
76
79
  }
77
- export interface ChatMessageEvent {
80
+ interface ChatMessageEvent {
78
81
  threadId: string;
79
82
  messageId: string;
80
83
  workspaceId: string;
@@ -82,7 +85,7 @@ export interface ChatMessageEvent {
82
85
  content: string;
83
86
  createdAt: string;
84
87
  }
85
- export interface ChatStreamEvent {
88
+ interface ChatStreamEvent {
86
89
  threadId: string;
87
90
  messageId: string;
88
91
  chunk: string;
@@ -92,7 +95,7 @@ export interface ChatStreamEvent {
92
95
  * All domain events emitted from server to client.
93
96
  * Use this for typed Socket.IO client setup.
94
97
  */
95
- export interface DomainServerToClientEvents {
98
+ interface DomainServerToClientEvents {
96
99
  "entity:created": (data: EntityCreatedEvent) => void;
97
100
  "entity:updated": (data: EntityUpdatedEvent) => void;
98
101
  "entity:deleted": (data: EntityDeletedEvent) => void;
@@ -111,7 +114,7 @@ export interface DomainServerToClientEvents {
111
114
  /**
112
115
  * Events clients can send to server.
113
116
  */
114
- export interface DomainClientToServerEvents {
117
+ interface DomainClientToServerEvents {
115
118
  "join-workspace": (workspaceId: string) => void;
116
119
  "leave-workspace": (workspaceId: string) => void;
117
120
  "join-document": (documentId: string) => void;
@@ -120,7 +123,7 @@ export interface DomainClientToServerEvents {
120
123
  /**
121
124
  * All domain event names for type checking
122
125
  */
123
- export declare const DomainEventNames: {
126
+ declare const DomainEventNames: {
124
127
  readonly ENTITY_CREATED: "entity:created";
125
128
  readonly ENTITY_UPDATED: "entity:updated";
126
129
  readonly ENTITY_DELETED: "entity:deleted";
@@ -131,5 +134,6 @@ export declare const DomainEventNames: {
131
134
  readonly CHAT_MESSAGE: "chat:message";
132
135
  readonly CHAT_STREAM: "chat:stream";
133
136
  };
134
- export type DomainEventName = (typeof DomainEventNames)[keyof typeof DomainEventNames];
135
- //# sourceMappingURL=index.d.ts.map
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 };
@@ -1,27 +1,15 @@
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
- // =============================================================================
11
- // Event Names
12
- // =============================================================================
13
- /**
14
- * All domain event names for type checking
15
- */
16
- export const DomainEventNames = {
17
- ENTITY_CREATED: "entity:created",
18
- ENTITY_UPDATED: "entity:updated",
19
- ENTITY_DELETED: "entity:deleted",
20
- DOCUMENT_UPDATED: "document:updated",
21
- DOCUMENT_VERSION: "document:version",
22
- AI_PROPOSAL: "ai:proposal",
23
- AI_PROPOSAL_STATUS: "ai:proposal:status",
24
- CHAT_MESSAGE: "chat:message",
25
- CHAT_STREAM: "chat:stream",
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
+ export {
14
+ DomainEventNames
26
15
  };
27
- //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
1
+
2
+ export { }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
1
+ import "../chunk-GX24H4PF.js";