@synap-core/types 1.2.1 → 1.2.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,46 +1,50 @@
1
-
2
- > @synap-core/types@1.2.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/relations/index.ts, src/users/index.ts, src/realtime/index.ts, src/workspaces/index.ts, src/views/index.ts, src/events/index.ts, src/preferences/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-GX24H4PF.js 0 B
13
- ESM dist/chunk-QAWJ6GM3.js 0 B
14
- ESM dist/chunk-2N5ZC5EB.js 0 B
15
- ESM dist/chunk-IZA3UKBT.js 0 B
16
- ESM dist/chunk-X5L3VJJZ.js 0 B
17
- ESM dist/preferences/index.js 374.00 B
18
- ESM dist/chunk-5MS6TR4O.js 3.86 KB
19
- ESM dist/chunk-75HLKBPD.js 2.44 KB
20
- ESM dist/documents/index.js 522.00 B
21
- ESM dist/chunk-WXJ4PQR7.js 551.00 B
22
- ESM dist/entities/index.js 372.00 B
23
- ESM dist/chunk-E57ULMXU.js 4.07 KB
24
- ESM dist/inbox/index.js 31.00 B
25
- ESM dist/relations/index.js 31.00 B
26
- ESM dist/users/index.js 31.00 B
27
- ESM dist/realtime/index.js 31.00 B
28
- ESM dist/workspaces/index.js 31.00 B
29
- ESM dist/views/index.js 642.00 B
30
- ESM dist/events/index.js 405.00 B
31
- ESM dist/index.js 19.08 KB
32
- ESM ⚡️ Build success in 455ms
33
- DTS Build start
34
- DTS ⚡️ Build success in 18481ms
35
- DTS dist/documents/index.d.ts 397.00 B
36
- DTS dist/relations/index.d.ts 896.00 B
37
- DTS dist/realtime/index.d.ts 1.54 KB
38
- DTS dist/workspaces/index.d.ts 882.00 B
39
- DTS dist/events/index.d.ts 4.12 KB
40
- DTS dist/preferences/index.d.ts 20.10 KB
41
- DTS dist/views/index.d.ts 60.75 KB
42
- DTS dist/index.d.ts 233.31 KB
43
- DTS dist/entities/index.d.ts 1.20 KB
44
- DTS dist/users/index.d.ts 195.00 B
45
- DTS dist/inbox/index.d.ts 13.00 B
46
- DTS dist/types-nhCcewMV.d.ts 30.52 KB
1
+
2
+ 
3
+ > @synap-core/types@1.2.3 build /Users/antoine/Documents/Code/synap/synap-backend/packages/types
4
+ > tsup
5
+
6
+ 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
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/chunk-2N5ZC5EB.js 0 B
14
+ ESM dist/chunk-IZA3UKBT.js 0 B
15
+ ESM dist/chunk-QAWJ6GM3.js 0 B
16
+ ESM dist/chunk-X5L3VJJZ.js 0 B
17
+ ESM dist/users/index.js 31.00 B
18
+ ESM dist/chunk-GX24H4PF.js 0 B
19
+ ESM dist/views/index.js 642.00 B
20
+ ESM dist/workspaces/index.js 31.00 B
21
+ ESM dist/chunk-5MS6TR4O.js 3.86 KB
22
+ ESM dist/index.js 19.02 KB
23
+ ESM dist/events/index.js 405.00 B
24
+ ESM dist/documents/index.js 332.00 B
25
+ ESM dist/inbox/index.js 31.00 B
26
+ ESM dist/preferences/index.js 374.00 B
27
+ ESM dist/proposals/index.js 146.00 B
28
+ ESM dist/entities/index.js 372.00 B
29
+ ESM dist/relations/index.js 31.00 B
30
+ ESM dist/realtime/index.js 31.00 B
31
+ ESM dist/chunk-75HLKBPD.js 2.44 KB
32
+ ESM dist/chunk-E57ULMXU.js 4.07 KB
33
+ ESM dist/chunk-3FSI6SVS.js 361.00 B
34
+ ESM dist/chunk-II4ANI46.js 175.00 B
35
+ ESM ⚡️ Build success in 19ms
36
+ DTS Build start
37
+ DTS ⚡️ Build success in 5827ms
38
+ DTS dist/documents/index.d.ts 269.00 B
39
+ DTS dist/events/index.d.ts 4.12 KB
40
+ DTS dist/proposals/index.d.ts 1.23 KB
41
+ DTS dist/realtime/index.d.ts 1.54 KB
42
+ DTS dist/relations/index.d.ts 896.00 B
43
+ DTS dist/workspaces/index.d.ts 882.00 B
44
+ DTS dist/preferences/index.d.ts 20.10 KB
45
+ DTS dist/views/index.d.ts 60.75 KB
46
+ DTS dist/index.d.ts 233.30 KB
47
+ DTS dist/entities/index.d.ts 1.20 KB
48
+ DTS dist/users/index.d.ts 195.00 B
49
+ DTS dist/inbox/index.d.ts 13.00 B
50
+ DTS dist/types-nhCcewMV.d.ts 30.52 KB
@@ -4,10 +4,7 @@ import {
4
4
  selectDocumentSchema,
5
5
  insertDocumentVersionSchema,
6
6
  selectDocumentVersionSchema,
7
- insertDocumentSessionSchema,
8
- selectDocumentSessionSchema,
9
- insertDocumentProposalSchema,
10
- selectDocumentProposalSchema
7
+ insertDocumentSessionSchema
11
8
  } from "@synap/database/schema";
12
9
 
13
10
  export {
@@ -15,8 +12,5 @@ export {
15
12
  selectDocumentSchema,
16
13
  insertDocumentVersionSchema,
17
14
  selectDocumentVersionSchema,
18
- insertDocumentSessionSchema,
19
- selectDocumentSessionSchema,
20
- insertDocumentProposalSchema,
21
- selectDocumentProposalSchema
15
+ insertDocumentSessionSchema
22
16
  };
@@ -0,0 +1,10 @@
1
+ // src/proposals/index.ts
2
+ import {
3
+ insertProposalSchema,
4
+ selectProposalSchema
5
+ } from "@synap/database/schema";
6
+
7
+ export {
8
+ insertProposalSchema,
9
+ selectProposalSchema
10
+ };
@@ -1 +1 @@
1
- export { Document, DocumentProposal, DocumentSession, DocumentVersion, NewDocument, NewDocumentProposal, NewDocumentSession, NewDocumentVersion, insertDocumentProposalSchema, insertDocumentSchema, insertDocumentSessionSchema, insertDocumentVersionSchema, selectDocumentProposalSchema, selectDocumentSchema, selectDocumentSessionSchema, selectDocumentVersionSchema } from '@synap/database/schema';
1
+ export { Document, DocumentSession, DocumentVersion, NewDocument, NewDocumentSession, NewDocumentVersion, insertDocumentSchema, insertDocumentSessionSchema, insertDocumentVersionSchema, selectDocumentSchema, selectDocumentVersionSchema } from '@synap/database/schema';
@@ -1,20 +1,14 @@
1
1
  import {
2
- insertDocumentProposalSchema,
3
2
  insertDocumentSchema,
4
3
  insertDocumentSessionSchema,
5
4
  insertDocumentVersionSchema,
6
- selectDocumentProposalSchema,
7
5
  selectDocumentSchema,
8
- selectDocumentSessionSchema,
9
6
  selectDocumentVersionSchema
10
- } from "../chunk-WXJ4PQR7.js";
7
+ } from "../chunk-3FSI6SVS.js";
11
8
  export {
12
- insertDocumentProposalSchema,
13
9
  insertDocumentSchema,
14
10
  insertDocumentSessionSchema,
15
11
  insertDocumentVersionSchema,
16
- selectDocumentProposalSchema,
17
12
  selectDocumentSchema,
18
- selectDocumentSessionSchema,
19
13
  selectDocumentVersionSchema
20
14
  };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  export { B as BaseEntity, a as ENTITY_SCHEMAS, E as Entity, c as EntityMetadata, d as EntitySchema, b as EntityType, e as Event, F as File, f as NewEntity, N as Note, P as Person, T as Task, U as UpdateEntity, s as safeValidateEntityMetadata, v as validateEntityMetadata } from './types-nhCcewMV.js';
2
2
  export { isEntityOfType, isEvent, isFile, isNote, isPerson, isTask } from './entities/index.js';
3
- export { ConversationMessageRow as ChatMessage, ChatThread, CustomEntityType, CustomTheme, DefaultTemplates, Document, DocumentProposal, DocumentSession, DocumentVersion, EntityEnrichment, EntityMetadataSchemas, EntityRelationship, GraphPreferences, NewConversationMessageRow as NewChatMessage, NewChatThread, NewDocument, NewDocumentProposal, NewDocumentSession, NewDocumentVersion, NewEntityEnrichment, NewEntityRelationship, NewReasoningTrace, NewRelation, NewUserEntityState, NewUserPreference, NewWorkspace, NewWorkspaceInvite, NewWorkspaceMember, ReasoningTrace, Relation, UIPreferences, UserEntityState, UserPreference, Workspace, WorkspaceInvite, WorkspaceMember, insertDocumentProposalSchema, insertDocumentSchema, insertDocumentSessionSchema, insertDocumentVersionSchema, insertUserPreferenceSchema, selectDocumentProposalSchema, selectDocumentSchema, selectDocumentSessionSchema, selectDocumentVersionSchema, selectUserPreferenceSchema } from '@synap/database/schema';
3
+ export { ConversationMessageRow as ChatMessage, ChatThread, CustomEntityType, CustomTheme, DefaultTemplates, Document, DocumentSession, DocumentVersion, EntityEnrichment, EntityMetadataSchemas, EntityRelationship, GraphPreferences, NewConversationMessageRow as NewChatMessage, NewChatThread, NewDocument, NewDocumentSession, NewDocumentVersion, NewEntityEnrichment, NewEntityRelationship, NewProposal, NewReasoningTrace, NewRelation, NewUserEntityState, NewUserPreference, NewWorkspace, NewWorkspaceInvite, NewWorkspaceMember, Proposal, ReasoningTrace, Relation, UIPreferences, UserEntityState, UserPreference, Workspace, WorkspaceInvite, WorkspaceMember, insertDocumentSchema, insertDocumentSessionSchema, insertDocumentVersionSchema, insertProposalSchema, insertUserPreferenceSchema, selectDocumentSchema, selectDocumentVersionSchema, selectProposalSchema, selectUserPreferenceSchema } from '@synap/database/schema';
4
4
  import { z } from 'zod';
5
5
  export { CreateWorkspaceInput, InviteMemberInput, UpdateWorkspaceInput, WorkspaceRole, WorkspaceType } from './workspaces/index.js';
6
6
  export { CanvasViewConfig, CanvasViewContent, ColumnConfig, ColumnDisplayConfig, CreateViewInput, EntityFilter, EntityQuery, EntityQuerySchema, FilterOperator, FormattingRule, KanbanColumn, NewView, RenderSettings, RenderSettingsSchema, SortRule, StructuredLayout, StructuredViewConfig, StructuredViewConfigSchema, StructuredViewContent, UpdateViewInput, VIEW_TYPE_CATEGORIES, View, ViewCategory, ViewConfig, ViewContent, ViewContentSchema, ViewMetadata, ViewRenderConfig, ViewType, getContentCategoryForViewType, getViewCategory, isCanvasContent, isStructuredContent, parseViewContent, safeParseViewContent, validateContentCategoryForViewType } from './views/index.js';
7
7
  export { CreateRelationInput, RelationType, RelationWithEntities } from './relations/index.js';
8
8
  export { CustomThemeSchema, GraphPreferencesSchema, Theme, UIPreferencesSchema, UpdatePreferencesInputSchema } from './preferences/index.js';
9
9
  export { CollaborationEvent, CursorUpdate, PresenceInit, PresenceStatus, UserJoinedEvent, UserLeftEvent, UserPresence } from './realtime/index.js';
10
+ export { UpdateRequest } from './proposals/index.js';
10
11
  export { Array as YArray, Doc as YDoc, Map as YMap, Text as YText } from 'yjs';
11
12
 
12
13
  type TemplateTargetType = 'entity' | 'document' | 'project' | 'inbox_item';
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import "./chunk-QAWJ6GM3.js";
2
+ import "./chunk-2N5ZC5EB.js";
1
3
  import {
2
4
  EntityQuerySchema,
3
5
  RenderSettingsSchema,
@@ -12,24 +14,14 @@ import {
12
14
  safeParseViewContent,
13
15
  validateContentCategoryForViewType
14
16
  } from "./chunk-5MS6TR4O.js";
17
+ import "./chunk-IZA3UKBT.js";
15
18
  import {
16
- CustomThemeSchema,
17
- GraphPreferencesSchema,
18
- UIPreferencesSchema,
19
- UpdatePreferencesInputSchema,
20
- insertUserPreferenceSchema,
21
- selectUserPreferenceSchema
22
- } from "./chunk-75HLKBPD.js";
23
- import {
24
- insertDocumentProposalSchema,
25
19
  insertDocumentSchema,
26
20
  insertDocumentSessionSchema,
27
21
  insertDocumentVersionSchema,
28
- selectDocumentProposalSchema,
29
22
  selectDocumentSchema,
30
- selectDocumentSessionSchema,
31
23
  selectDocumentVersionSchema
32
- } from "./chunk-WXJ4PQR7.js";
24
+ } from "./chunk-3FSI6SVS.js";
33
25
  import {
34
26
  ENTITY_SCHEMAS,
35
27
  EntitySchema,
@@ -43,10 +35,19 @@ import {
43
35
  validateEntityMetadata
44
36
  } from "./chunk-E57ULMXU.js";
45
37
  import "./chunk-GX24H4PF.js";
46
- import "./chunk-QAWJ6GM3.js";
47
- import "./chunk-2N5ZC5EB.js";
38
+ import {
39
+ CustomThemeSchema,
40
+ GraphPreferencesSchema,
41
+ UIPreferencesSchema,
42
+ UpdatePreferencesInputSchema,
43
+ insertUserPreferenceSchema,
44
+ selectUserPreferenceSchema
45
+ } from "./chunk-75HLKBPD.js";
46
+ import {
47
+ insertProposalSchema,
48
+ selectProposalSchema
49
+ } from "./chunk-II4ANI46.js";
48
50
  import "./chunk-X5L3VJJZ.js";
49
- import "./chunk-IZA3UKBT.js";
50
51
 
51
52
  // src/templates/schemas.ts
52
53
  import { z } from "zod";
@@ -702,10 +703,10 @@ export {
702
703
  classicNoteTemplate,
703
704
  getContentCategoryForViewType,
704
705
  getViewCategory,
705
- insertDocumentProposalSchema,
706
706
  insertDocumentSchema,
707
707
  insertDocumentSessionSchema,
708
708
  insertDocumentVersionSchema,
709
+ insertProposalSchema,
709
710
  insertUserPreferenceSchema,
710
711
  isCanvasContent,
711
712
  isEntityOfType,
@@ -720,10 +721,9 @@ export {
720
721
  parseViewContent,
721
722
  safeParseViewContent,
722
723
  safeValidateEntityMetadata,
723
- selectDocumentProposalSchema,
724
724
  selectDocumentSchema,
725
- selectDocumentSessionSchema,
726
725
  selectDocumentVersionSchema,
726
+ selectProposalSchema,
727
727
  selectUserPreferenceSchema,
728
728
  toSynapError,
729
729
  validateContentCategoryForViewType,
@@ -0,0 +1,47 @@
1
+ export { NewProposal, Proposal, insertProposalSchema, selectProposalSchema } from '@synap/database/schema';
2
+
3
+ /**
4
+ * Universal Proposal Types
5
+ *
6
+ * Defines the contract for all data mutations in the system.
7
+ */
8
+
9
+ /**
10
+ * Universal Update Request
11
+ *
12
+ * The standard envelope for all change requests in the system.
13
+ * This object is stored in the `proposals` table and passed in events.
14
+ */
15
+ interface UpdateRequest {
16
+ /** Unique ID for this specific request */
17
+ requestId: string;
18
+ /** Who initiated the change? */
19
+ source: 'user' | 'ai' | 'system';
20
+ sourceId: string;
21
+ /** Context */
22
+ workspaceId: string;
23
+ /** Target Entity */
24
+ targetType: 'document' | 'entity' | 'whiteboard' | 'view';
25
+ targetId: string;
26
+ /** What kind of change? */
27
+ changeType: 'create' | 'update' | 'delete';
28
+ /**
29
+ * lightweight Metadata Changes
30
+ * (e.g. title rename, status change)
31
+ */
32
+ data?: Record<string, any>;
33
+ /**
34
+ * Heavy Content Reference (S3/MinIO)
35
+ * Used for Documents, Whiteboards, etc.
36
+ */
37
+ contentRef?: {
38
+ storageKey: string;
39
+ mimeType: string;
40
+ size: number;
41
+ checksum?: string;
42
+ };
43
+ /** AI Reasoning / Context */
44
+ reasoning?: string;
45
+ }
46
+
47
+ export type { UpdateRequest };
@@ -0,0 +1,8 @@
1
+ import {
2
+ insertProposalSchema,
3
+ selectProposalSchema
4
+ } from "../chunk-II4ANI46.js";
5
+ export {
6
+ insertProposalSchema,
7
+ selectProposalSchema
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synap-core/types",
3
- "version": "1.2.1",
3
+ "version": "1.2.4",
4
4
  "description": "Shared TypeScript types and Zod schemas for the Synap platform",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -11,8 +11,6 @@ export type {
11
11
  NewDocumentVersion,
12
12
  DocumentSession,
13
13
  NewDocumentSession,
14
- DocumentProposal,
15
- NewDocumentProposal,
16
14
  } from '@synap/database/schema';
17
15
 
18
16
  // Re-export Zod schemas for runtime validation
@@ -22,7 +20,5 @@ export {
22
20
  insertDocumentVersionSchema,
23
21
  selectDocumentVersionSchema,
24
22
  insertDocumentSessionSchema,
25
- selectDocumentSessionSchema,
26
- insertDocumentProposalSchema,
27
- selectDocumentProposalSchema,
23
+
28
24
  } from '@synap/database/schema';
package/src/index.ts CHANGED
@@ -52,3 +52,6 @@ export * from './approvals/index.js';
52
52
 
53
53
  // Chat domain types
54
54
  export * from './chat/index.js';
55
+
56
+ // Universal Proposals
57
+ export * from './proposals/index.js';
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Universal Proposal Types
3
+ *
4
+ * Defines the contract for all data mutations in the system.
5
+ */
6
+
7
+ // Re-export database types for proposals
8
+ export type {
9
+ Proposal,
10
+ NewProposal,
11
+ } from '@synap/database/schema';
12
+
13
+ export {
14
+ insertProposalSchema,
15
+ selectProposalSchema,
16
+ } from '@synap/database/schema';
17
+
18
+ /**
19
+ * Universal Update Request
20
+ *
21
+ * The standard envelope for all change requests in the system.
22
+ * This object is stored in the `proposals` table and passed in events.
23
+ */
24
+ export interface UpdateRequest {
25
+ /** Unique ID for this specific request */
26
+ requestId: string;
27
+
28
+ /** Who initiated the change? */
29
+ source: 'user' | 'ai' | 'system';
30
+ sourceId: string;
31
+
32
+ /** Context */
33
+ workspaceId: string;
34
+
35
+ /** Target Entity */
36
+ targetType: 'document' | 'entity' | 'whiteboard' | 'view';
37
+ targetId: string;
38
+
39
+ /** What kind of change? */
40
+ changeType: 'create' | 'update' | 'delete';
41
+
42
+ /**
43
+ * lightweight Metadata Changes
44
+ * (e.g. title rename, status change)
45
+ */
46
+ data?: Record<string, any>;
47
+
48
+ /**
49
+ * Heavy Content Reference (S3/MinIO)
50
+ * Used for Documents, Whiteboards, etc.
51
+ */
52
+ contentRef?: {
53
+ storageKey: string;
54
+ mimeType: string;
55
+ size: number;
56
+ // Optional hash for integrity
57
+ checksum?: string;
58
+ };
59
+
60
+ /** AI Reasoning / Context */
61
+ reasoning?: string;
62
+ }
package/tsup.config.ts CHANGED
@@ -13,6 +13,7 @@ export default defineConfig({
13
13
  'src/preferences/index.ts',
14
14
  'src/realtime/index.ts',
15
15
  'src/events/index.ts',
16
+ 'src/proposals/index.ts', // NEW: Universal Proposals
16
17
  ],
17
18
  format: ['esm'],
18
19
  dts: true,