@synap-core/types 0.3.2 → 0.3.4

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,12 +1,12 @@
1
- import { Document } from '@synap/database/schema';
2
- export { Document, DocumentSession, DocumentVersion, NewDocument, NewDocumentSession, NewDocumentVersion } from '@synap/database/schema';
1
+ import { Document } from '@synap-core/database/schema';
2
+ export { Document, DocumentSession, DocumentVersion, NewDocument, NewDocumentSession, NewDocumentVersion } from '@synap-core/database/schema';
3
3
 
4
4
  /**
5
5
  * Document Types
6
6
  *
7
7
  * Re-exports document types from database schema (single source of truth).
8
8
  *
9
- * @see {@link file:///.../packages/database/src/schema/documents.ts}
9
+ * @see {@link @synap-core/database/schema}
10
10
  */
11
11
 
12
12
  type UpdateDocument = Partial<Omit<Document, 'id' | 'userId' | 'createdAt' | 'updatedAt'>>;
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- export { Entity as DBEntity, NewEntity as NewEntityDB } from '@synap/database/schema';
3
2
 
4
3
  /**
5
4
  * Entity Metadata Schemas
@@ -225,9 +224,8 @@ declare function safeValidateEntityMetadata<T extends EntityType>(type: T, metad
225
224
  /**
226
225
  * Entity Types
227
226
  *
228
- * Re-exports base entity types from database and adds discriminated unions.
229
- *
230
- * @see {@link file:///.../packages/database/src/schema/entities.ts}
227
+ * TypeScript types for entities with discriminated unions.
228
+ * Types are automatically generated from Zod schemas.
231
229
  */
232
230
 
233
231
  /**
@@ -1,6 +1,15 @@
1
- import {
2
- DomainEventNames
3
- } from "../chunk-6OHYLFUB.js";
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
+ };
4
13
  export {
5
14
  DomainEventNames
6
15
  };
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
- export { InboxItem as DBInboxItem, NewInboxItem } from '@synap/database/schema';
2
+ export { InboxItem as DBInboxItem, NewInboxItem } from '@synap-core/database/schema';
3
3
 
4
4
  /**
5
5
  * Inbox Item Schemas & Types
6
6
  *
7
7
  * Re-exports inbox types from database and adds provider-specific schemas.
8
8
  *
9
- * @see {@link file:///.../packages/database/src/schema/inbox-items.ts}
9
+ * @see {@link @synap-core/database/schema}
10
10
  */
11
11
 
12
12
  /**
package/dist/index.d.ts CHANGED
@@ -1,11 +1,5 @@
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
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';
3
+ export { InboxItem as DBInboxItem, Document, DocumentSession, DocumentVersion, EntityEnrichment, EntityRelationship, NewDocument, NewDocumentSession, NewDocumentVersion, NewEntityEnrichment, NewEntityRelationship, NewInboxItem, NewReasoningTrace, NewUserEntityState, ReasoningTrace, UserEntityState } from '@synap-core/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, UserJoinedEvent, UserLeftEvent, 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';
11
5
  import 'zod';
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
- import "./chunk-ZTGPGYVX.js";
2
- import "./chunk-IZA3UKBT.js";
1
+ import "./chunk-2N5ZC5EB.js";
3
2
  import "./chunk-7LKCNZXD.js";
4
3
  import {
5
4
  ENTITY_SCHEMAS,
@@ -12,20 +11,13 @@ import {
12
11
  safeValidateEntityMetadata,
13
12
  validateEntityMetadata
14
13
  } from "./chunk-OPLFDITK.js";
15
- import {
16
- DomainEventNames
17
- } from "./chunk-6OHYLFUB.js";
18
14
  import {
19
15
  INBOX_SCHEMAS,
20
16
  isCalendarInboxItem,
21
17
  isEmailInboxItem,
22
18
  isSlackInboxItem
23
19
  } from "./chunk-ZFFMXKF2.js";
24
- import "./chunk-2BEUWD3P.js";
25
- import "./chunk-X5L3VJJZ.js";
26
- import "./chunk-2N5ZC5EB.js";
27
20
  export {
28
- DomainEventNames,
29
21
  ENTITY_SCHEMAS,
30
22
  INBOX_SCHEMAS,
31
23
  isCalendarInboxItem,
@@ -1,14 +1,12 @@
1
- import { UserPreference } from '@synap/database/schema';
2
- export { NewUserPreference as NewUserPreferences, UserPreference as UserPreferences } from '@synap/database/schema';
1
+ import { UserPreference } from '@synap-core/database/schema';
2
+ export { NewUserPreference as NewUserPreferences, UserPreference as UserPreferences } from '@synap-core/database/schema';
3
3
 
4
4
  /**
5
5
  * User Preferences Types
6
6
  *
7
7
  * Re-exports user preferences types from database schema (single source of truth).
8
8
  *
9
- * Note: Database exports `UserPreference` (singular), we alias to `UserPreferences` for API consistency.
10
- *
11
- * @see {@link file:///.../packages/database/src/schema/user-preferences.ts}
9
+ * @see {@link @synap-core/database/schema}
12
10
  */
13
11
 
14
12
  type Theme = UserPreference['theme'];
@@ -1 +0,0 @@
1
- import "../chunk-2BEUWD3P.js";
@@ -1 +0,0 @@
1
- import "../chunk-X5L3VJJZ.js";
@@ -0,0 +1,36 @@
1
+ export { NewRelation, Relation } from '@synap-core/database/schema';
2
+
3
+ /**
4
+ * Relation Types
5
+ *
6
+ * Re-exports relation types from database schema (single source of truth).
7
+ *
8
+ * @see {@link @synap-core/database/schema}
9
+ */
10
+
11
+ type RelationType = 'related_to' | 'parent_of' | 'child_of' | 'blocks' | 'mentioned_in' | 'linked_to';
12
+ interface CreateRelationInput {
13
+ sourceEntityId: string;
14
+ targetEntityId: string;
15
+ type: RelationType;
16
+ metadata?: Record<string, unknown>;
17
+ }
18
+ interface RelationWithEntities {
19
+ id: string;
20
+ sourceEntityId: string;
21
+ targetEntityId: string;
22
+ type: RelationType;
23
+ createdAt: Date;
24
+ sourceEntity?: {
25
+ id: string;
26
+ title: string | null;
27
+ type: string;
28
+ };
29
+ targetEntity?: {
30
+ id: string;
31
+ title: string | null;
32
+ type: string;
33
+ };
34
+ }
35
+
36
+ export type { CreateRelationInput, RelationType, RelationWithEntities };
@@ -1 +1 @@
1
- export { EntityEnrichment, EntityRelationship, NewEntityEnrichment, NewEntityRelationship, NewReasoningTrace, NewUserEntityState, ReasoningTrace, UserEntityState } from '@synap/database/schema';
1
+ export { EntityEnrichment, EntityRelationship, NewEntityEnrichment, NewEntityRelationship, NewReasoningTrace, NewUserEntityState, ReasoningTrace, UserEntityState } from '@synap-core/database/schema';
@@ -1,31 +1,57 @@
1
- import { View } from '@synap/database/schema';
2
- export { NewView, View } from '@synap/database/schema';
1
+ export { NewView, View } from '@synap-core/database/schema';
3
2
 
4
3
  /**
5
4
  * View Types
6
5
  *
7
6
  * Re-exports view types from database schema (single source of truth).
7
+ * Extended with Table Inversion System configuration types.
8
8
  *
9
- * @see {@link file:///.../packages/database/src/schema/views.ts}
9
+ * @see {@link @synap-core/database/schema}
10
10
  */
11
11
 
12
- type ViewType = View['type'];
12
+ /**
13
+ * View types - categorized by rendering approach
14
+ */
15
+ type ViewType = 'whiteboard' | 'table' | 'kanban' | 'list' | 'grid' | 'gallery' | 'calendar' | 'gantt' | 'timeline' | 'mindmap' | 'graph';
16
+ interface ColumnDefinition {
17
+ id: string;
18
+ name: string;
19
+ type: 'text' | 'number' | 'date' | 'select' | 'multi-select' | 'checkbox' | 'url' | 'email' | 'phone' | 'person' | 'relation' | 'formula' | 'rollup';
20
+ options?: string[];
21
+ relationTableId?: string;
22
+ formula?: string;
23
+ width?: number;
24
+ isHidden?: boolean;
25
+ }
26
+ interface FilterRule {
27
+ columnId: string;
28
+ operator: 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'is_empty' | 'is_not_empty' | 'greater_than' | 'less_than' | 'date_is' | 'date_before' | 'date_after';
29
+ value?: unknown;
30
+ }
31
+ interface SortRule {
32
+ columnId: string;
33
+ direction: 'asc' | 'desc';
34
+ }
35
+ interface TableViewConfig {
36
+ layout: 'table' | 'kanban' | 'list' | 'grid' | 'gallery' | 'calendar' | 'gantt' | 'timeline';
37
+ columns: ColumnDefinition[];
38
+ filters?: FilterRule[];
39
+ sorts?: SortRule[];
40
+ groupByColumnId?: string;
41
+ }
13
42
  interface CreateViewInput {
14
43
  workspaceId?: string;
15
44
  type: ViewType;
16
45
  name: string;
17
46
  description?: string;
18
47
  initialContent?: unknown;
48
+ tableConfig?: TableViewConfig;
19
49
  }
20
50
  interface UpdateViewInput {
21
51
  name?: string;
22
52
  description?: string;
23
53
  metadata?: Record<string, unknown>;
24
- }
25
- interface SaveViewInput {
26
- viewId: string;
27
- content: unknown;
28
- saveType?: 'auto' | 'manual' | 'publish';
54
+ tableConfig?: Partial<TableViewConfig>;
29
55
  }
30
56
 
31
- export type { CreateViewInput, SaveViewInput, UpdateViewInput, ViewType };
57
+ export type { ColumnDefinition, CreateViewInput, FilterRule, SortRule, TableViewConfig, UpdateViewInput, ViewType };
@@ -1 +0,0 @@
1
- import "../chunk-ZTGPGYVX.js";
@@ -1,12 +1,12 @@
1
- import { Workspace, WorkspaceMember } from '@synap/database/schema';
2
- export { NewWorkspace, NewWorkspaceInvite, NewWorkspaceMember, Workspace, WorkspaceInvite, WorkspaceMember } from '@synap/database/schema';
1
+ import { Workspace, WorkspaceMember } from '@synap-core/database/schema';
2
+ export { NewWorkspace, NewWorkspaceInvite, NewWorkspaceMember, Workspace, WorkspaceInvite, WorkspaceMember } from '@synap-core/database/schema';
3
3
 
4
4
  /**
5
5
  * Workspace Types
6
6
  *
7
7
  * Re-exports workspace types from database schema (single source of truth).
8
8
  *
9
- * @see {@link file:///.../packages/database/src/schema/workspaces.ts}
9
+ * @see {@link @synap-core/database/schema}
10
10
  */
11
11
 
12
12
  type WorkspaceType = Workspace['type'];
@@ -1 +0,0 @@
1
- import "../chunk-IZA3UKBT.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synap-core/types",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/views/index.d.ts",
37
37
  "import": "./dist/views/index.js"
38
38
  },
39
+ "./relations": {
40
+ "types": "./dist/relations/index.d.ts",
41
+ "import": "./dist/relations/index.js"
42
+ },
39
43
  "./preferences": {
40
44
  "types": "./dist/preferences/index.d.ts",
41
45
  "import": "./dist/preferences/index.js"
@@ -49,7 +53,13 @@
49
53
  "import": "./dist/events/index.js"
50
54
  }
51
55
  },
56
+ "scripts": {
57
+ "build": "tsup",
58
+ "dev": "tsup --watch",
59
+ "type-check": "tsc --noEmit"
60
+ },
52
61
  "dependencies": {
62
+ "@synap-core/database": "^0.1.0",
53
63
  "zod": "^3.25.0",
54
64
  "yjs": "^13.6.11"
55
65
  },
@@ -57,18 +67,5 @@
57
67
  "@types/node": "^20.0.0",
58
68
  "tsup": "^8.0.0",
59
69
  "typescript": "^5.6.0"
60
- },
61
- "peerDependencies": {
62
- "@synap/database": "1.0.0"
63
- },
64
- "peerDependenciesMeta": {
65
- "@synap/database": {
66
- "optional": true
67
- }
68
- },
69
- "scripts": {
70
- "build": "tsup",
71
- "dev": "tsup --watch",
72
- "type-check": "tsc --noEmit"
73
70
  }
74
71
  }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Re-exports document types from database schema (single source of truth).
5
5
  *
6
- * @see {@link file:///.../packages/database/src/schema/documents.ts}
6
+ * @see {@link @synap-core/database/schema}
7
7
  */
8
8
 
9
9
  // Direct re-exports from database
@@ -14,9 +14,9 @@ export type {
14
14
  NewDocumentVersion,
15
15
  DocumentSession,
16
16
  NewDocumentSession,
17
- } from '@synap/database/schema';
17
+ } from '@synap-core/database/schema';
18
18
 
19
19
  // Derived/helper types for API operations
20
- import type { Document } from '@synap/database/schema';
20
+ import type { Document } from '@synap-core/database/schema';
21
21
 
22
22
  export type UpdateDocument = Partial<Omit<Document, 'id' | 'userId' | 'createdAt' | 'updatedAt'>>;
@@ -1,17 +1,10 @@
1
1
  /**
2
2
  * Entity Types
3
3
  *
4
- * Re-exports base entity types from database and adds discriminated unions.
5
- *
6
- * @see {@link file:///.../packages/database/src/schema/entities.ts}
4
+ * TypeScript types for entities with discriminated unions.
5
+ * Types are automatically generated from Zod schemas.
7
6
  */
8
7
 
9
- // Direct re-exports from database
10
- export type {
11
- Entity as DBEntity, // Alias to avoid conflict with our discriminated union
12
- NewEntity as NewEntityDB,
13
- } from '@synap/database/schema';
14
-
15
8
  import type { EntityType, EntityMetadata } from './schemas.js';
16
9
 
17
10
  /**
@@ -3,16 +3,16 @@
3
3
  *
4
4
  * Re-exports inbox types from database and adds provider-specific schemas.
5
5
  *
6
- * @see {@link file:///.../packages/database/src/schema/inbox-items.ts}
6
+ * @see {@link @synap-core/database/schema}
7
7
  */
8
8
 
9
9
  import { z } from 'zod';
10
10
 
11
11
  // Direct re-exports from database
12
12
  export type {
13
- InboxItem as DBInboxItem, // Base DB type
13
+ InboxItem as DBInboxItem,
14
14
  NewInboxItem,
15
- } from '@synap/database/schema';
15
+ } from '@synap-core/database/schema';
16
16
 
17
17
  /**
18
18
  * Inbox item data schemas - provider-specific
@@ -63,28 +63,18 @@ type InboxItemData = {
63
63
  interface BaseInboxItem {
64
64
  id: string;
65
65
  userId: string;
66
-
67
- // Source tracking
68
66
  provider: 'gmail' | 'google_calendar' | 'slack';
69
- account: string; // 'user@gmail.com'
70
- externalId: string; // ID in external system
71
- deepLink?: string; // 'googlegmail://message?id=...'
72
-
73
- // Content
67
+ account: string;
68
+ externalId: string;
69
+ deepLink?: string;
74
70
  type: InboxItemType;
75
71
  title: string;
76
72
  preview?: string;
77
73
  timestamp: Date;
78
-
79
- // State
80
74
  status: 'unread' | 'read' | 'archived' | 'snoozed';
81
75
  snoozedUntil?: Date;
82
-
83
- // AI enhancements
84
76
  priority?: 'urgent' | 'high' | 'normal' | 'low';
85
77
  tags: string[];
86
-
87
- // Lifecycle
88
78
  processedAt?: Date;
89
79
  createdAt: Date;
90
80
  updatedAt: Date;
package/src/index.ts CHANGED
@@ -3,8 +3,6 @@
3
3
  *
4
4
  * Core type definitions for the Synap ecosystem.
5
5
  * Used by frontend, backend, and Intelligence Hub.
6
- *
7
- * All types re-export from database schemas to maintain single source of truth.
8
6
  */
9
7
 
10
8
  // Entity types
@@ -16,20 +14,5 @@ export * from './documents/index.js';
16
14
  // User and context types
17
15
  export * from './users/index.js';
18
16
 
19
- // Inbox types
17
+ // Inbox types
20
18
  export * from './inbox/index.js';
21
-
22
- // Workspace types (V3.0)
23
- export * from './workspaces/index.js';
24
-
25
- // View types (V3.0)
26
- export * from './views/index.js';
27
-
28
- // Preferences types (V3.0)
29
- export * from './preferences/index.js';
30
-
31
- // Real-time collaboration types (V3.0)
32
- export * from './realtime/index.js';
33
-
34
- // Domain event types for Socket.IO (V3.0)
35
- export * from './events/index.js';
@@ -3,19 +3,17 @@
3
3
  *
4
4
  * Re-exports user preferences types from database schema (single source of truth).
5
5
  *
6
- * Note: Database exports `UserPreference` (singular), we alias to `UserPreferences` for API consistency.
7
- *
8
- * @see {@link file:///.../packages/database/src/schema/user-preferences.ts}
6
+ * @see {@link @synap-core/database/schema}
9
7
  */
10
8
 
11
- // Direct re-exports from database (with alias for consistency)
9
+ // Direct re-exports from database
12
10
  export type {
13
11
  UserPreference as UserPreferences,
14
12
  NewUserPreference as NewUserPreferences,
15
- } from '@synap/database/schema';
13
+ } from '@synap-core/database/schema';
16
14
 
17
15
  // Derived types
18
- import type { UserPreference } from '@synap/database/schema';
16
+ import type { UserPreference } from '@synap-core/database/schema';
19
17
 
20
18
  export type Theme = UserPreference['theme'];
21
19
 
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Relation Types
3
+ *
4
+ * Re-exports relation types from database schema (single source of truth).
5
+ *
6
+ * @see {@link @synap-core/database/schema}
7
+ */
8
+
9
+ // Direct re-exports from database
10
+ export type {
11
+ Relation,
12
+ NewRelation,
13
+ } from '@synap-core/database/schema';
14
+
15
+ // Relation type definitions
16
+ export type RelationType =
17
+ | 'related_to' // Generic relationship
18
+ | 'parent_of' // Hierarchy (parent → child)
19
+ | 'child_of' // Inverse hierarchy (child → parent)
20
+ | 'blocks' // Dependencies (X blocks Y)
21
+ | 'mentioned_in' // Content references
22
+ | 'linked_to'; // User-created links
23
+
24
+ // Input types for API operations
25
+ export interface CreateRelationInput {
26
+ sourceEntityId: string;
27
+ targetEntityId: string;
28
+ type: RelationType;
29
+ metadata?: Record<string, unknown>;
30
+ }
31
+
32
+ export interface RelationWithEntities {
33
+ id: string;
34
+ sourceEntityId: string;
35
+ targetEntityId: string;
36
+ type: RelationType;
37
+ createdAt: Date;
38
+ // Populated fields
39
+ sourceEntity?: {
40
+ id: string;
41
+ title: string | null;
42
+ type: string;
43
+ };
44
+ targetEntity?: {
45
+ id: string;
46
+ title: string | null;
47
+ type: string;
48
+ };
49
+ }
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * User Types
3
3
  *
4
- * Re-exports user-related types from database and adds custom types.
4
+ * Re-exports user-related types from database schema.
5
5
  *
6
- * @see {@link file:///.../packages/database/src/schema/user-entity-state.ts}
7
- * @see {@link file:///.../packages/database/src/schema/enrichments.ts}
6
+ * @see {@link @synap-core/database/schema}
8
7
  */
9
8
 
10
9
  // Direct re-exports from database
@@ -17,4 +16,4 @@ export type {
17
16
  NewEntityRelationship,
18
17
  ReasoningTrace,
19
18
  NewReasoningTrace,
20
- } from '@synap/database/schema';
19
+ } from '@synap-core/database/schema';
@@ -2,38 +2,90 @@
2
2
  * View Types
3
3
  *
4
4
  * Re-exports view types from database schema (single source of truth).
5
+ * Extended with Table Inversion System configuration types.
5
6
  *
6
- * @see {@link file:///.../packages/database/src/schema/views.ts}
7
+ * @see {@link @synap-core/database/schema}
7
8
  */
8
9
 
9
10
  // Direct re-exports from database
10
11
  export type {
11
12
  View,
12
13
  NewView,
13
- } from '@synap/database/schema';
14
+ } from '@synap-core/database/schema';
14
15
 
15
- // Derived types
16
- import type { View } from '@synap/database/schema';
16
+ // =============================================================================
17
+ // View Type Enum
18
+ // =============================================================================
17
19
 
18
- export type ViewType = View['type'];
20
+ /**
21
+ * View types - categorized by rendering approach
22
+ */
23
+ export type ViewType =
24
+ // Canvas-based (freeform)
25
+ | 'whiteboard'
26
+ // Table-based (Table Inversion System)
27
+ | 'table'
28
+ | 'kanban'
29
+ | 'list'
30
+ | 'grid'
31
+ | 'gallery'
32
+ | 'calendar'
33
+ | 'gantt'
34
+ | 'timeline'
35
+ // Specialized
36
+ | 'mindmap'
37
+ | 'graph';
38
+
39
+ // =============================================================================
40
+ // Table Inversion System Configuration
41
+ // =============================================================================
42
+
43
+ export interface ColumnDefinition {
44
+ id: string;
45
+ name: string;
46
+ type: 'text' | 'number' | 'date' | 'select' | 'multi-select' | 'checkbox' | 'url' | 'email' | 'phone' | 'person' | 'relation' | 'formula' | 'rollup';
47
+ options?: string[];
48
+ relationTableId?: string;
49
+ formula?: string;
50
+ width?: number;
51
+ isHidden?: boolean;
52
+ }
53
+
54
+ export interface FilterRule {
55
+ columnId: string;
56
+ operator: 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'is_empty' | 'is_not_empty' | 'greater_than' | 'less_than' | 'date_is' | 'date_before' | 'date_after';
57
+ value?: unknown;
58
+ }
59
+
60
+ export interface SortRule {
61
+ columnId: string;
62
+ direction: 'asc' | 'desc';
63
+ }
64
+
65
+ export interface TableViewConfig {
66
+ layout: 'table' | 'kanban' | 'list' | 'grid' | 'gallery' | 'calendar' | 'gantt' | 'timeline';
67
+ columns: ColumnDefinition[];
68
+ filters?: FilterRule[];
69
+ sorts?: SortRule[];
70
+ groupByColumnId?: string;
71
+ }
72
+
73
+ // =============================================================================
74
+ // API Input Types
75
+ // =============================================================================
19
76
 
20
- // Input types for API operations
21
77
  export interface CreateViewInput {
22
78
  workspaceId?: string;
23
79
  type: ViewType;
24
80
  name: string;
25
81
  description?: string;
26
82
  initialContent?: unknown;
83
+ tableConfig?: TableViewConfig;
27
84
  }
28
85
 
29
86
  export interface UpdateViewInput {
30
87
  name?: string;
31
88
  description?: string;
32
89
  metadata?: Record<string, unknown>;
33
- }
34
-
35
- export interface SaveViewInput {
36
- viewId: string;
37
- content: unknown;
38
- saveType?: 'auto' | 'manual' | 'publish';
90
+ tableConfig?: Partial<TableViewConfig>;
39
91
  }
@@ -3,10 +3,10 @@
3
3
  *
4
4
  * Re-exports workspace types from database schema (single source of truth).
5
5
  *
6
- * @see {@link file:///.../packages/database/src/schema/workspaces.ts}
6
+ * @see {@link @synap-core/database/schema}
7
7
  */
8
8
 
9
- // Direct re-exports from database (automatic sync, no manual maintenance needed)
9
+ // Direct re-exports from database
10
10
  export type {
11
11
  Workspace,
12
12
  NewWorkspace,
@@ -14,10 +14,10 @@ export type {
14
14
  NewWorkspaceMember,
15
15
  WorkspaceInvite,
16
16
  NewWorkspaceInvite,
17
- } from '@synap/database/schema';
17
+ } from '@synap-core/database/schema';
18
18
 
19
19
  // Derived types for API convenience
20
- import type { Workspace, WorkspaceMember } from '@synap/database/schema';
20
+ import type { Workspace, WorkspaceMember } from '@synap-core/database/schema';
21
21
 
22
22
  export type WorkspaceType = Workspace['type'];
23
23
  export type WorkspaceRole = WorkspaceMember['role'];
package/tsup.config.ts CHANGED
@@ -9,6 +9,7 @@ export default defineConfig({
9
9
  'src/inbox/index.ts',
10
10
  'src/workspaces/index.ts',
11
11
  'src/views/index.ts',
12
+ 'src/relations/index.ts', // NEW: Knowledge graph edges
12
13
  'src/preferences/index.ts',
13
14
  'src/realtime/index.ts',
14
15
  'src/events/index.ts',
@@ -1,16 +0,0 @@
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
File without changes
File without changes