@synap-core/types 1.2.0 → 1.2.3

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,47 @@
1
-
2
- > @synap-core/types@1.0.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/events/index.ts, src/inbox/index.ts, src/preferences/index.ts, src/relations/index.ts, src/users/index.ts, src/realtime/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-X5L3VJJZ.js 0 B
13
- ESM dist/chunk-IZA3UKBT.js 0 B
14
- ESM dist/chunk-QAWJ6GM3.js 0 B
15
- ESM dist/chunk-GX24H4PF.js 0 B
16
- ESM dist/realtime/index.js 31.00 B
17
- ESM dist/views/index.js 642.00 B
18
- ESM dist/chunk-2N5ZC5EB.js 0 B
19
- ESM dist/workspaces/index.js 31.00 B
20
- ESM dist/chunk-5MS6TR4O.js 3.86 KB
21
- ESM dist/index.js 19.08 KB
22
- ESM dist/events/index.js 405.00 B
23
- ESM dist/documents/index.js 522.00 B
24
- ESM dist/preferences/index.js 374.00 B
25
- ESM dist/chunk-E57ULMXU.js 4.07 KB
26
- ESM dist/chunk-WXJ4PQR7.js 551.00 B
27
- ESM dist/relations/index.js 31.00 B
28
- ESM dist/entities/index.js 372.00 B
29
- ESM dist/chunk-75HLKBPD.js 2.44 KB
30
- ESM dist/users/index.js 31.00 B
31
- ESM dist/inbox/index.js 31.00 B
32
- ESM ⚡️ Build success in 24ms
33
- DTS Build start
34
- DTS ⚡️ Build success in 10302ms
35
- DTS dist/documents/index.d.ts 397.00 B
36
- DTS dist/events/index.d.ts 4.12 KB
37
- DTS dist/relations/index.d.ts 896.00 B
38
- DTS dist/realtime/index.d.ts 1.54 KB
39
- DTS dist/workspaces/index.d.ts 882.00 B
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.2 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/realtime/index.ts, src/relations/index.ts, src/users/index.ts, src/workspaces/index.ts, src/views/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-GX24H4PF.js 0 B
16
+ ESM dist/chunk-X5L3VJJZ.js 0 B
17
+ ESM dist/workspaces/index.js 31.00 B
18
+ ESM dist/users/index.js 31.00 B
19
+ ESM dist/index.js 19.08 KB
20
+ ESM dist/chunk-QAWJ6GM3.js 0 B
21
+ ESM dist/views/index.js 642.00 B
22
+ ESM dist/chunk-5MS6TR4O.js 3.86 KB
23
+ ESM dist/documents/index.js 522.00 B
24
+ ESM dist/entities/index.js 372.00 B
25
+ ESM dist/events/index.js 405.00 B
26
+ ESM dist/chunk-E57ULMXU.js 4.07 KB
27
+ ESM dist/realtime/index.js 31.00 B
28
+ ESM dist/relations/index.js 31.00 B
29
+ ESM dist/inbox/index.js 31.00 B
30
+ ESM dist/chunk-75HLKBPD.js 2.44 KB
31
+ ESM dist/preferences/index.js 374.00 B
32
+ ESM dist/chunk-WXJ4PQR7.js 551.00 B
33
+ ESM ⚡️ Build success in 683ms
34
+ DTS Build start
35
+ DTS ⚡️ Build success in 21537ms
36
+ DTS dist/documents/index.d.ts 397.00 B
37
+ DTS dist/events/index.d.ts 4.12 KB
38
+ DTS dist/realtime/index.d.ts 1.54 KB
39
+ DTS dist/relations/index.d.ts 896.00 B
40
+ DTS dist/workspaces/index.d.ts 882.00 B
41
+ DTS dist/preferences/index.d.ts 20.10 KB
42
+ DTS dist/views/index.d.ts 60.75 KB
43
+ DTS dist/index.d.ts 233.31 KB
44
+ DTS dist/entities/index.d.ts 1.20 KB
45
+ DTS dist/users/index.d.ts 195.00 B
46
+ DTS dist/inbox/index.d.ts 13.00 B
47
+ DTS dist/types-nhCcewMV.d.ts 30.52 KB
@@ -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
+ };
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, DocumentProposal, DocumentSession, DocumentVersion, EntityEnrichment, EntityMetadataSchemas, EntityRelationship, GraphPreferences, NewConversationMessageRow as NewChatMessage, NewChatThread, NewDocument, NewDocumentProposal, NewDocumentSession, NewDocumentVersion, NewEntityEnrichment, NewEntityRelationship, NewProposal, NewReasoningTrace, NewRelation, NewUserEntityState, NewUserPreference, NewWorkspace, NewWorkspaceInvite, NewWorkspaceMember, Proposal, ReasoningTrace, Relation, UIPreferences, UserEntityState, UserPreference, Workspace, WorkspaceInvite, WorkspaceMember, insertDocumentProposalSchema, insertDocumentSchema, insertDocumentSessionSchema, insertDocumentVersionSchema, insertProposalSchema, insertUserPreferenceSchema, selectDocumentProposalSchema, selectDocumentSchema, selectDocumentSessionSchema, 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,4 @@
1
+ import "./chunk-QAWJ6GM3.js";
1
2
  import "./chunk-2N5ZC5EB.js";
2
3
  import {
3
4
  EntityQuerySchema,
@@ -46,7 +47,10 @@ import {
46
47
  selectUserPreferenceSchema
47
48
  } from "./chunk-75HLKBPD.js";
48
49
  import "./chunk-X5L3VJJZ.js";
49
- import "./chunk-QAWJ6GM3.js";
50
+ import {
51
+ insertProposalSchema,
52
+ selectProposalSchema
53
+ } from "./chunk-II4ANI46.js";
50
54
 
51
55
  // src/templates/schemas.ts
52
56
  import { z } from "zod";
@@ -706,6 +710,7 @@ export {
706
710
  insertDocumentSchema,
707
711
  insertDocumentSessionSchema,
708
712
  insertDocumentVersionSchema,
713
+ insertProposalSchema,
709
714
  insertUserPreferenceSchema,
710
715
  isCanvasContent,
711
716
  isEntityOfType,
@@ -724,6 +729,7 @@ export {
724
729
  selectDocumentSchema,
725
730
  selectDocumentSessionSchema,
726
731
  selectDocumentVersionSchema,
732
+ selectProposalSchema,
727
733
  selectUserPreferenceSchema,
728
734
  toSynapError,
729
735
  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.0",
3
+ "version": "1.2.3",
4
4
  "description": "Shared TypeScript types and Zod schemas for the Synap platform",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -88,4 +88,4 @@
88
88
  "tsup": "^8.0.0",
89
89
  "typescript": "^5.6.0"
90
90
  }
91
- }
91
+ }
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,