@synap-core/types 1.2.1 → 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.
- package/.turbo/turbo-build.log +47 -46
- package/dist/chunk-II4ANI46.js +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +17 -11
- package/dist/proposals/index.d.ts +47 -0
- package/dist/proposals/index.js +8 -0
- package/package.json +2 -2
- package/src/index.ts +3 -0
- package/src/proposals/index.ts +62 -0
- package/tsup.config.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
DTS
|
|
35
|
-
DTS
|
|
36
|
-
DTS dist/
|
|
37
|
-
DTS dist/
|
|
38
|
-
DTS dist/
|
|
39
|
-
DTS dist/
|
|
40
|
-
DTS dist/
|
|
41
|
-
DTS dist/
|
|
42
|
-
DTS dist/index.d.ts
|
|
43
|
-
DTS dist/
|
|
44
|
-
DTS dist/
|
|
45
|
-
DTS dist/
|
|
46
|
-
DTS dist/
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @synap-core/types@1.2.2 build /Users/antoine/Documents/Code/synap/synap-backend/packages/types
|
|
4
|
+
> tsup
|
|
5
|
+
|
|
6
|
+
[34mCLI[39m 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
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.1
|
|
9
|
+
[34mCLI[39m Using tsup config: /Users/antoine/Documents/Code/synap/synap-backend/packages/types/tsup.config.ts
|
|
10
|
+
[34mCLI[39m Target: es2022
|
|
11
|
+
[34mCLI[39m Cleaning output folder
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/chunk-2N5ZC5EB.js [22m[32m0 B[39m
|
|
14
|
+
[32mESM[39m [1mdist/chunk-IZA3UKBT.js [22m[32m0 B[39m
|
|
15
|
+
[32mESM[39m [1mdist/chunk-GX24H4PF.js [22m[32m0 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/chunk-X5L3VJJZ.js [22m[32m0 B[39m
|
|
17
|
+
[32mESM[39m [1mdist/workspaces/index.js [22m[32m31.00 B[39m
|
|
18
|
+
[32mESM[39m [1mdist/users/index.js [22m[32m31.00 B[39m
|
|
19
|
+
[32mESM[39m [1mdist/index.js [22m[32m19.08 KB[39m
|
|
20
|
+
[32mESM[39m [1mdist/chunk-QAWJ6GM3.js [22m[32m0 B[39m
|
|
21
|
+
[32mESM[39m [1mdist/views/index.js [22m[32m642.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist/chunk-5MS6TR4O.js [22m[32m3.86 KB[39m
|
|
23
|
+
[32mESM[39m [1mdist/documents/index.js [22m[32m522.00 B[39m
|
|
24
|
+
[32mESM[39m [1mdist/entities/index.js [22m[32m372.00 B[39m
|
|
25
|
+
[32mESM[39m [1mdist/events/index.js [22m[32m405.00 B[39m
|
|
26
|
+
[32mESM[39m [1mdist/chunk-E57ULMXU.js [22m[32m4.07 KB[39m
|
|
27
|
+
[32mESM[39m [1mdist/realtime/index.js [22m[32m31.00 B[39m
|
|
28
|
+
[32mESM[39m [1mdist/relations/index.js [22m[32m31.00 B[39m
|
|
29
|
+
[32mESM[39m [1mdist/inbox/index.js [22m[32m31.00 B[39m
|
|
30
|
+
[32mESM[39m [1mdist/chunk-75HLKBPD.js [22m[32m2.44 KB[39m
|
|
31
|
+
[32mESM[39m [1mdist/preferences/index.js [22m[32m374.00 B[39m
|
|
32
|
+
[32mESM[39m [1mdist/chunk-WXJ4PQR7.js [22m[32m551.00 B[39m
|
|
33
|
+
[32mESM[39m ⚡️ 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
|
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,5 @@
|
|
|
1
|
+
import "./chunk-QAWJ6GM3.js";
|
|
2
|
+
import "./chunk-2N5ZC5EB.js";
|
|
1
3
|
import {
|
|
2
4
|
EntityQuerySchema,
|
|
3
5
|
RenderSettingsSchema,
|
|
@@ -12,14 +14,7 @@ import {
|
|
|
12
14
|
safeParseViewContent,
|
|
13
15
|
validateContentCategoryForViewType
|
|
14
16
|
} from "./chunk-5MS6TR4O.js";
|
|
15
|
-
import
|
|
16
|
-
CustomThemeSchema,
|
|
17
|
-
GraphPreferencesSchema,
|
|
18
|
-
UIPreferencesSchema,
|
|
19
|
-
UpdatePreferencesInputSchema,
|
|
20
|
-
insertUserPreferenceSchema,
|
|
21
|
-
selectUserPreferenceSchema
|
|
22
|
-
} from "./chunk-75HLKBPD.js";
|
|
17
|
+
import "./chunk-IZA3UKBT.js";
|
|
23
18
|
import {
|
|
24
19
|
insertDocumentProposalSchema,
|
|
25
20
|
insertDocumentSchema,
|
|
@@ -43,10 +38,19 @@ import {
|
|
|
43
38
|
validateEntityMetadata
|
|
44
39
|
} from "./chunk-E57ULMXU.js";
|
|
45
40
|
import "./chunk-GX24H4PF.js";
|
|
46
|
-
import
|
|
47
|
-
|
|
41
|
+
import {
|
|
42
|
+
CustomThemeSchema,
|
|
43
|
+
GraphPreferencesSchema,
|
|
44
|
+
UIPreferencesSchema,
|
|
45
|
+
UpdatePreferencesInputSchema,
|
|
46
|
+
insertUserPreferenceSchema,
|
|
47
|
+
selectUserPreferenceSchema
|
|
48
|
+
} from "./chunk-75HLKBPD.js";
|
|
48
49
|
import "./chunk-X5L3VJJZ.js";
|
|
49
|
-
import
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synap-core/types",
|
|
3
|
-
"version": "1.2.
|
|
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
|
@@ -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
|
+
}
|