@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.
- package/.turbo/turbo-build.log +50 -46
- package/dist/{chunk-WXJ4PQR7.js → chunk-3FSI6SVS.js} +2 -8
- package/dist/chunk-II4ANI46.js +10 -0
- package/dist/documents/index.d.ts +1 -1
- package/dist/documents/index.js +1 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.js +18 -18
- package/dist/proposals/index.d.ts +47 -0
- package/dist/proposals/index.js +8 -0
- package/package.json +1 -1
- package/src/documents/index.ts +1 -5
- 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,50 @@
|
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
DTS
|
|
37
|
-
DTS
|
|
38
|
-
DTS dist/
|
|
39
|
-
DTS dist/events/index.d.ts 4.12 KB
|
|
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.3 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/proposals/index.ts, src/realtime/index.ts, src/relations/index.ts, src/users/index.ts, src/views/index.ts, src/workspaces/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-QAWJ6GM3.js [22m[32m0 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/chunk-X5L3VJJZ.js [22m[32m0 B[39m
|
|
17
|
+
[32mESM[39m [1mdist/users/index.js [22m[32m31.00 B[39m
|
|
18
|
+
[32mESM[39m [1mdist/chunk-GX24H4PF.js [22m[32m0 B[39m
|
|
19
|
+
[32mESM[39m [1mdist/views/index.js [22m[32m642.00 B[39m
|
|
20
|
+
[32mESM[39m [1mdist/workspaces/index.js [22m[32m31.00 B[39m
|
|
21
|
+
[32mESM[39m [1mdist/chunk-5MS6TR4O.js [22m[32m3.86 KB[39m
|
|
22
|
+
[32mESM[39m [1mdist/index.js [22m[32m19.02 KB[39m
|
|
23
|
+
[32mESM[39m [1mdist/events/index.js [22m[32m405.00 B[39m
|
|
24
|
+
[32mESM[39m [1mdist/documents/index.js [22m[32m332.00 B[39m
|
|
25
|
+
[32mESM[39m [1mdist/inbox/index.js [22m[32m31.00 B[39m
|
|
26
|
+
[32mESM[39m [1mdist/preferences/index.js [22m[32m374.00 B[39m
|
|
27
|
+
[32mESM[39m [1mdist/proposals/index.js [22m[32m146.00 B[39m
|
|
28
|
+
[32mESM[39m [1mdist/entities/index.js [22m[32m372.00 B[39m
|
|
29
|
+
[32mESM[39m [1mdist/relations/index.js [22m[32m31.00 B[39m
|
|
30
|
+
[32mESM[39m [1mdist/realtime/index.js [22m[32m31.00 B[39m
|
|
31
|
+
[32mESM[39m [1mdist/chunk-75HLKBPD.js [22m[32m2.44 KB[39m
|
|
32
|
+
[32mESM[39m [1mdist/chunk-E57ULMXU.js [22m[32m4.07 KB[39m
|
|
33
|
+
[32mESM[39m [1mdist/chunk-3FSI6SVS.js [22m[32m361.00 B[39m
|
|
34
|
+
[32mESM[39m [1mdist/chunk-II4ANI46.js [22m[32m175.00 B[39m
|
|
35
|
+
[32mESM[39m ⚡️ 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
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Document,
|
|
1
|
+
export { Document, DocumentSession, DocumentVersion, NewDocument, NewDocumentSession, NewDocumentVersion, insertDocumentSchema, insertDocumentSessionSchema, insertDocumentVersionSchema, selectDocumentSchema, selectDocumentVersionSchema } from '@synap/database/schema';
|
package/dist/documents/index.js
CHANGED
|
@@ -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-
|
|
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,
|
|
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-
|
|
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
|
|
47
|
-
|
|
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 };
|
package/package.json
CHANGED
package/src/documents/index.ts
CHANGED
|
@@ -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
|
-
|
|
26
|
-
insertDocumentProposalSchema,
|
|
27
|
-
selectDocumentProposalSchema,
|
|
23
|
+
|
|
28
24
|
} from '@synap/database/schema';
|
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
|
+
}
|