@synap-core/types 1.2.4 → 1.2.7
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 +49 -50
- package/dist/{chunk-5MS6TR4O.js → chunk-E4TRCFI3.js} +22 -2
- package/dist/{chunk-3FSI6SVS.js → chunk-ES7GZ7IQ.js} +4 -6
- package/dist/{chunk-E57ULMXU.js → chunk-HFVZISQ7.js} +32 -8
- package/dist/{chunk-75HLKBPD.js → chunk-MUAPS3OD.js} +6 -4
- package/dist/documents/index.d.ts +1 -1
- package/dist/documents/index.js +3 -5
- package/dist/entities/index.d.ts +3 -3
- package/dist/entities/index.js +1 -1
- package/dist/events/index.d.ts +22 -22
- package/dist/index.d.ts +21 -21
- package/dist/index.js +51 -23
- package/dist/preferences/index.d.ts +1 -1
- package/dist/preferences/index.js +1 -1
- package/dist/proposals/index.d.ts +3 -3
- package/dist/realtime/index.d.ts +1 -1
- package/dist/relations/index.d.ts +1 -1
- package/dist/{types-nhCcewMV.d.ts → types-O93mCz6a.d.ts} +50 -34
- package/dist/views/index.d.ts +18 -18
- package/dist/views/index.js +1 -1
- package/dist/workspaces/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/approvals/index.ts +12 -12
- package/src/chat/index.ts +11 -11
- package/src/documents/index.ts +3 -7
- package/src/entities/guards.ts +8 -8
- package/src/entities/index.ts +4 -4
- package/src/entities/schemas.ts +16 -15
- package/src/entities/types.ts +47 -23
- package/src/errors/index.ts +64 -46
- package/src/events/index.ts +38 -37
- package/src/hub-protocol/index.ts +38 -38
- package/src/index.ts +20 -20
- package/src/preferences/index.ts +7 -8
- package/src/preferences/schemas.ts +80 -56
- package/src/proposals/index.ts +16 -19
- package/src/realtime/index.ts +8 -3
- package/src/relations/index.ts +10 -13
- package/src/templates/classic-note.template.ts +37 -37
- package/src/templates/index.ts +11 -14
- package/src/templates/notion-like.template.ts +48 -48
- package/src/templates/schemas.ts +84 -42
- package/src/templates/types.ts +43 -32
- package/src/templates/wiki-reference.template.ts +39 -39
- package/src/users/index.ts +4 -4
- package/src/views/config.ts +31 -21
- package/src/views/index.ts +20 -23
- package/src/views/query.ts +22 -23
- package/src/views/schema.ts +6 -6
- package/src/views/schemas.ts +68 -38
- package/src/views/types.ts +56 -54
- package/src/workspaces/index.ts +7 -7
- package/tsconfig.json +4 -10
- package/tsconfig.tsbuildinfo +1 -0
- package/tsup.config.ts +15 -15
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,50 +1,49 @@
|
|
|
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 Build
|
|
37
|
-
DTS
|
|
38
|
-
DTS dist/
|
|
39
|
-
DTS dist/
|
|
40
|
-
DTS dist/
|
|
41
|
-
DTS dist/
|
|
42
|
-
DTS dist/
|
|
43
|
-
DTS dist/
|
|
44
|
-
DTS dist/
|
|
45
|
-
DTS dist/
|
|
46
|
-
DTS dist/index.d.ts
|
|
47
|
-
DTS dist/
|
|
48
|
-
DTS dist/
|
|
49
|
-
DTS dist/
|
|
50
|
-
DTS dist/types-nhCcewMV.d.ts 30.52 KB
|
|
1
|
+
|
|
2
|
+
> @synap-core/types@1.2.6 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/proposals/index.ts, src/realtime/index.ts, src/relations/index.ts, src/users/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-2N5ZC5EB.js 0 B
|
|
13
|
+
ESM dist/chunk-QAWJ6GM3.js 0 B
|
|
14
|
+
ESM dist/chunk-IZA3UKBT.js 0 B
|
|
15
|
+
ESM dist/chunk-GX24H4PF.js 0 B
|
|
16
|
+
ESM dist/users/index.js 31.00 B
|
|
17
|
+
ESM dist/relations/index.js 31.00 B
|
|
18
|
+
ESM dist/chunk-X5L3VJJZ.js 0 B
|
|
19
|
+
ESM dist/views/index.js 642.00 B
|
|
20
|
+
ESM dist/workspaces/index.js 31.00 B
|
|
21
|
+
ESM dist/index.js 19.07 KB
|
|
22
|
+
ESM dist/chunk-E4TRCFI3.js 3.94 KB
|
|
23
|
+
ESM dist/documents/index.js 298.00 B
|
|
24
|
+
ESM dist/chunk-ES7GZ7IQ.js 327.00 B
|
|
25
|
+
ESM dist/chunk-HFVZISQ7.js 4.14 KB
|
|
26
|
+
ESM dist/events/index.js 405.00 B
|
|
27
|
+
ESM dist/entities/index.js 372.00 B
|
|
28
|
+
ESM dist/inbox/index.js 31.00 B
|
|
29
|
+
ESM dist/chunk-MUAPS3OD.js 2.45 KB
|
|
30
|
+
ESM dist/proposals/index.js 146.00 B
|
|
31
|
+
ESM dist/realtime/index.js 31.00 B
|
|
32
|
+
ESM dist/preferences/index.js 374.00 B
|
|
33
|
+
ESM dist/chunk-II4ANI46.js 175.00 B
|
|
34
|
+
ESM ⚡️ Build success in 74ms
|
|
35
|
+
DTS Build start
|
|
36
|
+
DTS ⚡️ Build success in 15351ms
|
|
37
|
+
DTS dist/documents/index.d.ts 224.00 B
|
|
38
|
+
DTS dist/events/index.d.ts 4.12 KB
|
|
39
|
+
DTS dist/proposals/index.d.ts 1.23 KB
|
|
40
|
+
DTS dist/realtime/index.d.ts 1.54 KB
|
|
41
|
+
DTS dist/relations/index.d.ts 896.00 B
|
|
42
|
+
DTS dist/workspaces/index.d.ts 882.00 B
|
|
43
|
+
DTS dist/preferences/index.d.ts 20.10 KB
|
|
44
|
+
DTS dist/views/index.d.ts 60.75 KB
|
|
45
|
+
DTS dist/index.d.ts 233.26 KB
|
|
46
|
+
DTS dist/entities/index.d.ts 1.20 KB
|
|
47
|
+
DTS dist/users/index.d.ts 195.00 B
|
|
48
|
+
DTS dist/inbox/index.d.ts 13.00 B
|
|
49
|
+
DTS dist/types-O93mCz6a.d.ts 31.09 KB
|
|
@@ -32,7 +32,17 @@ function getContentCategoryForViewType(type) {
|
|
|
32
32
|
import { z } from "zod";
|
|
33
33
|
var EntityFilterSchema = z.object({
|
|
34
34
|
field: z.string(),
|
|
35
|
-
operator: z.enum([
|
|
35
|
+
operator: z.enum([
|
|
36
|
+
"equals",
|
|
37
|
+
"contains",
|
|
38
|
+
"gt",
|
|
39
|
+
"gte",
|
|
40
|
+
"lt",
|
|
41
|
+
"lte",
|
|
42
|
+
"in",
|
|
43
|
+
"notIn",
|
|
44
|
+
"between"
|
|
45
|
+
]),
|
|
36
46
|
value: z.unknown()
|
|
37
47
|
});
|
|
38
48
|
var SortRuleSchema = z.object({
|
|
@@ -58,7 +68,17 @@ var KanbanColumnSchema = z.object({
|
|
|
58
68
|
limit: z.number().optional()
|
|
59
69
|
});
|
|
60
70
|
var RenderSettingsSchema = z.object({
|
|
61
|
-
layout: z.enum([
|
|
71
|
+
layout: z.enum([
|
|
72
|
+
"table",
|
|
73
|
+
"kanban",
|
|
74
|
+
"list",
|
|
75
|
+
"grid",
|
|
76
|
+
"gallery",
|
|
77
|
+
"calendar",
|
|
78
|
+
"gantt",
|
|
79
|
+
"timeline",
|
|
80
|
+
"graph"
|
|
81
|
+
]).optional(),
|
|
62
82
|
// Common fields (flexible to allow frontend-specific structures)
|
|
63
83
|
columns: z.array(z.any()).optional(),
|
|
64
84
|
filters: z.array(z.any()).optional(),
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
// src/documents/index.ts
|
|
2
2
|
import {
|
|
3
|
-
insertDocumentSchema,
|
|
4
|
-
selectDocumentSchema,
|
|
5
3
|
insertDocumentVersionSchema,
|
|
6
4
|
selectDocumentVersionSchema,
|
|
7
|
-
insertDocumentSessionSchema
|
|
5
|
+
insertDocumentSessionSchema,
|
|
6
|
+
selectDocumentSessionSchema
|
|
8
7
|
} from "@synap/database/schema";
|
|
9
8
|
|
|
10
9
|
export {
|
|
11
|
-
insertDocumentSchema,
|
|
12
|
-
selectDocumentSchema,
|
|
13
10
|
insertDocumentVersionSchema,
|
|
14
11
|
selectDocumentVersionSchema,
|
|
15
|
-
insertDocumentSessionSchema
|
|
12
|
+
insertDocumentSessionSchema,
|
|
13
|
+
selectDocumentSessionSchema
|
|
16
14
|
};
|
|
@@ -86,14 +86,38 @@ var baseEntitySchema = z2.object({
|
|
|
86
86
|
deletedAt: z2.date().nullable()
|
|
87
87
|
});
|
|
88
88
|
var EntitySchema = z2.discriminatedUnion("type", [
|
|
89
|
-
baseEntitySchema.extend({
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
baseEntitySchema.extend({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
baseEntitySchema.extend({
|
|
90
|
+
type: z2.literal("task"),
|
|
91
|
+
metadata: ENTITY_SCHEMAS.task
|
|
92
|
+
}),
|
|
93
|
+
baseEntitySchema.extend({
|
|
94
|
+
type: z2.literal("note"),
|
|
95
|
+
metadata: ENTITY_SCHEMAS.note
|
|
96
|
+
}),
|
|
97
|
+
baseEntitySchema.extend({
|
|
98
|
+
type: z2.literal("person"),
|
|
99
|
+
metadata: ENTITY_SCHEMAS.person
|
|
100
|
+
}),
|
|
101
|
+
baseEntitySchema.extend({
|
|
102
|
+
type: z2.literal("event"),
|
|
103
|
+
metadata: ENTITY_SCHEMAS.event
|
|
104
|
+
}),
|
|
105
|
+
baseEntitySchema.extend({
|
|
106
|
+
type: z2.literal("file"),
|
|
107
|
+
metadata: ENTITY_SCHEMAS.file
|
|
108
|
+
}),
|
|
109
|
+
baseEntitySchema.extend({
|
|
110
|
+
type: z2.literal("code"),
|
|
111
|
+
metadata: ENTITY_SCHEMAS.code
|
|
112
|
+
}),
|
|
113
|
+
baseEntitySchema.extend({
|
|
114
|
+
type: z2.literal("bookmark"),
|
|
115
|
+
metadata: ENTITY_SCHEMAS.bookmark
|
|
116
|
+
}),
|
|
117
|
+
baseEntitySchema.extend({
|
|
118
|
+
type: z2.literal("company"),
|
|
119
|
+
metadata: ENTITY_SCHEMAS.company
|
|
120
|
+
})
|
|
97
121
|
]);
|
|
98
122
|
|
|
99
123
|
// src/entities/guards.ts
|
|
@@ -31,10 +31,12 @@ var CustomThemeSchema = z.object({
|
|
|
31
31
|
}).optional();
|
|
32
32
|
var UIPreferencesSchema = z.object({
|
|
33
33
|
sidebarCollapsed: z.boolean().optional(),
|
|
34
|
-
panelPositions: z.record(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
panelPositions: z.record(
|
|
35
|
+
z.object({
|
|
36
|
+
x: z.number(),
|
|
37
|
+
y: z.number()
|
|
38
|
+
})
|
|
39
|
+
).optional(),
|
|
38
40
|
lastActiveView: z.string().optional(),
|
|
39
41
|
compactMode: z.boolean().optional(),
|
|
40
42
|
fontSize: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Document, DocumentSession,
|
|
1
|
+
export { Document, DocumentSession, NewDocumentSession, NewDocumentVersion, insertDocumentSessionSchema, insertDocumentVersionSchema, selectDocumentSessionSchema, selectDocumentVersionSchema } from '@synap/database/schema';
|
package/dist/documents/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
insertDocumentSchema,
|
|
3
2
|
insertDocumentSessionSchema,
|
|
4
3
|
insertDocumentVersionSchema,
|
|
5
|
-
|
|
4
|
+
selectDocumentSessionSchema,
|
|
6
5
|
selectDocumentVersionSchema
|
|
7
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-ES7GZ7IQ.js";
|
|
8
7
|
export {
|
|
9
|
-
insertDocumentSchema,
|
|
10
8
|
insertDocumentSessionSchema,
|
|
11
9
|
insertDocumentVersionSchema,
|
|
12
|
-
|
|
10
|
+
selectDocumentSessionSchema,
|
|
13
11
|
selectDocumentVersionSchema
|
|
14
12
|
};
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as Entity, T as Task, N as Note, P as Person, e as Event, F as File } from '../types-
|
|
2
|
-
export { B as BaseEntity, a as ENTITY_SCHEMAS, c as EntityMetadata, d as EntitySchema, b as EntityType, f as NewEntity, U as UpdateEntity, s as safeValidateEntityMetadata, v as validateEntityMetadata } from '../types-
|
|
1
|
+
import { E as Entity, T as Task, N as Note, P as Person, e as Event, F as File } from '../types-O93mCz6a.js';
|
|
2
|
+
export { B as BaseEntity, a as ENTITY_SCHEMAS, c as EntityMetadata, d as EntitySchema, b as EntityType, f as NewEntity, U as UpdateEntity, s as safeValidateEntityMetadata, v as validateEntityMetadata } from '../types-O93mCz6a.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -31,7 +31,7 @@ declare function isFile(entity: Entity): entity is File;
|
|
|
31
31
|
/**
|
|
32
32
|
* Generic type guard for any entity type
|
|
33
33
|
*/
|
|
34
|
-
declare function isEntityOfType<T extends Entity[
|
|
34
|
+
declare function isEntityOfType<T extends Entity["type"]>(entity: Entity, type: T): entity is Extract<Entity, {
|
|
35
35
|
type: T;
|
|
36
36
|
}>;
|
|
37
37
|
|
package/dist/entities/index.js
CHANGED
package/dist/events/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Entity } from '../types-
|
|
1
|
+
import { E as Entity } from '../types-O93mCz6a.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -39,7 +39,7 @@ interface EntityApprovalEvent {
|
|
|
39
39
|
entityId?: string;
|
|
40
40
|
workspaceId: string;
|
|
41
41
|
entityType: string;
|
|
42
|
-
status:
|
|
42
|
+
status: "pending" | "approved" | "rejected" | "created";
|
|
43
43
|
reason?: string;
|
|
44
44
|
createdBy: string;
|
|
45
45
|
timestamp: string;
|
|
@@ -62,9 +62,9 @@ interface DocumentVersionCreatedEvent {
|
|
|
62
62
|
interface AIProposalEvent {
|
|
63
63
|
proposalId: string;
|
|
64
64
|
workspaceId: string;
|
|
65
|
-
targetType:
|
|
65
|
+
targetType: "entity" | "document";
|
|
66
66
|
targetId?: string;
|
|
67
|
-
operation:
|
|
67
|
+
operation: "create" | "update" | "delete";
|
|
68
68
|
data: unknown;
|
|
69
69
|
reasoning: string;
|
|
70
70
|
confidence: number;
|
|
@@ -73,7 +73,7 @@ interface AIProposalEvent {
|
|
|
73
73
|
interface AIProposalStatusEvent {
|
|
74
74
|
proposalId: string;
|
|
75
75
|
workspaceId: string;
|
|
76
|
-
status:
|
|
76
|
+
status: "approved" | "rejected";
|
|
77
77
|
processedBy: string;
|
|
78
78
|
processedAt: string;
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ interface ChatMessageEvent {
|
|
|
81
81
|
threadId: string;
|
|
82
82
|
messageId: string;
|
|
83
83
|
workspaceId: string;
|
|
84
|
-
role:
|
|
84
|
+
role: "user" | "assistant";
|
|
85
85
|
content: string;
|
|
86
86
|
createdAt: string;
|
|
87
87
|
}
|
|
@@ -96,17 +96,17 @@ interface ChatStreamEvent {
|
|
|
96
96
|
* Use this for typed Socket.IO client setup.
|
|
97
97
|
*/
|
|
98
98
|
interface DomainServerToClientEvents {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
99
|
+
"entity:created": (data: EntityCreatedEvent) => void;
|
|
100
|
+
"entity:updated": (data: EntityUpdatedEvent) => void;
|
|
101
|
+
"entity:deleted": (data: EntityDeletedEvent) => void;
|
|
102
|
+
"entity:approval": (data: EntityApprovalEvent) => void;
|
|
103
|
+
"document:updated": (data: DocumentUpdatedEvent) => void;
|
|
104
|
+
"document:version": (data: DocumentVersionCreatedEvent) => void;
|
|
105
|
+
"ai:proposal": (data: AIProposalEvent) => void;
|
|
106
|
+
"ai:proposal:status": (data: AIProposalStatusEvent) => void;
|
|
107
|
+
"chat:message": (data: ChatMessageEvent) => void;
|
|
108
|
+
"chat:stream": (data: ChatStreamEvent) => void;
|
|
109
|
+
error: (data: {
|
|
110
110
|
code: string;
|
|
111
111
|
message: string;
|
|
112
112
|
}) => void;
|
|
@@ -115,10 +115,10 @@ interface DomainServerToClientEvents {
|
|
|
115
115
|
* Events clients can send to server.
|
|
116
116
|
*/
|
|
117
117
|
interface DomainClientToServerEvents {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
"join-workspace": (workspaceId: string) => void;
|
|
119
|
+
"leave-workspace": (workspaceId: string) => void;
|
|
120
|
+
"join-document": (documentId: string) => void;
|
|
121
|
+
"leave-document": (documentId: string) => void;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* All domain event names for type checking
|
|
@@ -134,6 +134,6 @@ declare const DomainEventNames: {
|
|
|
134
134
|
readonly CHAT_MESSAGE: "chat:message";
|
|
135
135
|
readonly CHAT_STREAM: "chat:stream";
|
|
136
136
|
};
|
|
137
|
-
type DomainEventName = typeof DomainEventNames[keyof typeof DomainEventNames];
|
|
137
|
+
type DomainEventName = (typeof DomainEventNames)[keyof typeof DomainEventNames];
|
|
138
138
|
|
|
139
139
|
export { type AIProposalEvent, type AIProposalStatusEvent, type ChatMessageEvent, type ChatStreamEvent, type DocumentUpdatedEvent, type DocumentVersionCreatedEvent, type DomainClientToServerEvents, type DomainEventName, DomainEventNames, type DomainServerToClientEvents, type EntityApprovalEvent, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-O93mCz6a.js';
|
|
2
2
|
export { isEntityOfType, isEvent, isFile, isNote, isPerson, isTask } from './entities/index.js';
|
|
3
|
-
export { ConversationMessageRow as ChatMessage, ChatThread, CustomEntityType, CustomTheme, DefaultTemplates, Document, DocumentSession,
|
|
3
|
+
export { ConversationMessageRow as ChatMessage, ChatThread, CustomEntityType, CustomTheme, DefaultTemplates, Document, DocumentSession, EntityEnrichment, EntityMetadataSchemas, EntityRelationship, GraphPreferences, NewConversationMessageRow as NewChatMessage, NewChatThread, NewDocumentSession, NewDocumentVersion, NewEntityEnrichment, NewEntityRelationship, NewProposal, NewReasoningTrace, NewRelation, NewUserEntityState, NewUserPreference, NewWorkspace, NewWorkspaceInvite, NewWorkspaceMember, Proposal, ReasoningTrace, Relation, UIPreferences, UserEntityState, UserPreference, Workspace, WorkspaceInvite, WorkspaceMember, insertDocumentSessionSchema, insertDocumentVersionSchema, insertProposalSchema, insertUserPreferenceSchema, 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';
|
|
@@ -10,19 +10,19 @@ export { CollaborationEvent, CursorUpdate, PresenceInit, PresenceStatus, UserJoi
|
|
|
10
10
|
export { UpdateRequest } from './proposals/index.js';
|
|
11
11
|
export { Array as YArray, Doc as YDoc, Map as YMap, Text as YText } from 'yjs';
|
|
12
12
|
|
|
13
|
-
type TemplateTargetType =
|
|
14
|
-
type LayoutZone =
|
|
15
|
-
type FieldRendererType =
|
|
13
|
+
type TemplateTargetType = "entity" | "document" | "project" | "inbox_item";
|
|
14
|
+
type LayoutZone = "banner" | "header" | "sidebar" | "contentBefore" | "content" | "contentAfter" | "footer";
|
|
15
|
+
type FieldRendererType = "text" | "badge" | "icon" | "avatar" | "avatarGroup" | "date" | "progress" | "checkbox" | "link" | "number" | "currency" | "relations" | "tags" | "code" | "image" | "timeline" | "backlinks" | "links" | "toc" | "embeddedView";
|
|
16
16
|
interface ZoneConfig {
|
|
17
17
|
enabled: boolean;
|
|
18
18
|
slots?: string[];
|
|
19
|
-
position?:
|
|
19
|
+
position?: "left" | "right";
|
|
20
20
|
width?: string;
|
|
21
|
-
layout?:
|
|
22
|
-
align?:
|
|
21
|
+
layout?: "horizontal" | "vertical";
|
|
22
|
+
align?: "left" | "center" | "right";
|
|
23
23
|
}
|
|
24
24
|
interface HeaderConfig extends ZoneConfig {
|
|
25
|
-
metadataPosition?:
|
|
25
|
+
metadataPosition?: "inline" | "above" | "below";
|
|
26
26
|
showIcon?: boolean;
|
|
27
27
|
}
|
|
28
28
|
interface LayoutStructure {
|
|
@@ -39,8 +39,8 @@ interface FieldRendererConfig {
|
|
|
39
39
|
variant?: string;
|
|
40
40
|
size?: string;
|
|
41
41
|
format?: string;
|
|
42
|
-
appearance?:
|
|
43
|
-
aspect?:
|
|
42
|
+
appearance?: "compact" | "detailed" | "cards";
|
|
43
|
+
aspect?: "wide" | "square" | "tall";
|
|
44
44
|
}
|
|
45
45
|
interface FieldSlotMapping {
|
|
46
46
|
slot: string;
|
|
@@ -5282,11 +5282,11 @@ interface ToolCapability {
|
|
|
5282
5282
|
/**
|
|
5283
5283
|
* Approval request status
|
|
5284
5284
|
*/
|
|
5285
|
-
type ApprovalStatus =
|
|
5285
|
+
type ApprovalStatus = "pending" | "approved" | "rejected";
|
|
5286
5286
|
/**
|
|
5287
5287
|
* Approval request type
|
|
5288
5288
|
*/
|
|
5289
|
-
type ApprovalType =
|
|
5289
|
+
type ApprovalType = "entity" | "document" | "action" | "branch";
|
|
5290
5290
|
/**
|
|
5291
5291
|
* Base approval request interface
|
|
5292
5292
|
*/
|
|
@@ -5305,7 +5305,7 @@ interface BaseApprovalRequest {
|
|
|
5305
5305
|
* Entity approval request
|
|
5306
5306
|
*/
|
|
5307
5307
|
interface EntityApprovalRequest extends BaseApprovalRequest {
|
|
5308
|
-
type:
|
|
5308
|
+
type: "entity";
|
|
5309
5309
|
entityType: string;
|
|
5310
5310
|
title: string;
|
|
5311
5311
|
description?: string;
|
|
@@ -5315,8 +5315,8 @@ interface EntityApprovalRequest extends BaseApprovalRequest {
|
|
|
5315
5315
|
* Document approval request
|
|
5316
5316
|
*/
|
|
5317
5317
|
interface DocumentApprovalRequest extends BaseApprovalRequest {
|
|
5318
|
-
type:
|
|
5319
|
-
operation:
|
|
5318
|
+
type: "document";
|
|
5319
|
+
operation: "create" | "update" | "delete";
|
|
5320
5320
|
documentId?: string;
|
|
5321
5321
|
title?: string;
|
|
5322
5322
|
content?: string;
|
|
@@ -5326,7 +5326,7 @@ interface DocumentApprovalRequest extends BaseApprovalRequest {
|
|
|
5326
5326
|
* Action approval request
|
|
5327
5327
|
*/
|
|
5328
5328
|
interface ActionApprovalRequest extends BaseApprovalRequest {
|
|
5329
|
-
type:
|
|
5329
|
+
type: "action";
|
|
5330
5330
|
action: string;
|
|
5331
5331
|
description: string;
|
|
5332
5332
|
args: Record<string, unknown>;
|
|
@@ -5335,7 +5335,7 @@ interface ActionApprovalRequest extends BaseApprovalRequest {
|
|
|
5335
5335
|
* Branch approval request
|
|
5336
5336
|
*/
|
|
5337
5337
|
interface BranchApprovalRequest extends BaseApprovalRequest {
|
|
5338
|
-
type:
|
|
5338
|
+
type: "branch";
|
|
5339
5339
|
agentType: AgentTypeString;
|
|
5340
5340
|
title: string;
|
|
5341
5341
|
purpose: string;
|
|
@@ -5375,8 +5375,8 @@ interface ApprovalQuery {
|
|
|
5375
5375
|
filter?: ApprovalFilter;
|
|
5376
5376
|
limit?: number;
|
|
5377
5377
|
offset?: number;
|
|
5378
|
-
sortBy?:
|
|
5379
|
-
sortOrder?:
|
|
5378
|
+
sortBy?: "createdAt" | "status" | "type";
|
|
5379
|
+
sortOrder?: "asc" | "desc";
|
|
5380
5380
|
}
|
|
5381
5381
|
|
|
5382
5382
|
/**
|
|
@@ -5396,7 +5396,7 @@ interface BranchNode {
|
|
|
5396
5396
|
children: string[];
|
|
5397
5397
|
depth: number;
|
|
5398
5398
|
agentType: AgentTypeString;
|
|
5399
|
-
status:
|
|
5399
|
+
status: "active" | "archived" | "merged";
|
|
5400
5400
|
title?: string;
|
|
5401
5401
|
branchPurpose?: string;
|
|
5402
5402
|
createdAt: string;
|
package/dist/index.js
CHANGED
|
@@ -13,15 +13,23 @@ import {
|
|
|
13
13
|
parseViewContent,
|
|
14
14
|
safeParseViewContent,
|
|
15
15
|
validateContentCategoryForViewType
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-E4TRCFI3.js";
|
|
17
17
|
import "./chunk-IZA3UKBT.js";
|
|
18
|
+
import "./chunk-GX24H4PF.js";
|
|
19
|
+
import {
|
|
20
|
+
CustomThemeSchema,
|
|
21
|
+
GraphPreferencesSchema,
|
|
22
|
+
UIPreferencesSchema,
|
|
23
|
+
UpdatePreferencesInputSchema,
|
|
24
|
+
insertUserPreferenceSchema,
|
|
25
|
+
selectUserPreferenceSchema
|
|
26
|
+
} from "./chunk-MUAPS3OD.js";
|
|
18
27
|
import {
|
|
19
|
-
insertDocumentSchema,
|
|
20
28
|
insertDocumentSessionSchema,
|
|
21
29
|
insertDocumentVersionSchema,
|
|
22
|
-
|
|
30
|
+
selectDocumentSessionSchema,
|
|
23
31
|
selectDocumentVersionSchema
|
|
24
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-ES7GZ7IQ.js";
|
|
25
33
|
import {
|
|
26
34
|
ENTITY_SCHEMAS,
|
|
27
35
|
EntitySchema,
|
|
@@ -33,16 +41,7 @@ import {
|
|
|
33
41
|
isTask,
|
|
34
42
|
safeValidateEntityMetadata,
|
|
35
43
|
validateEntityMetadata
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-GX24H4PF.js";
|
|
38
|
-
import {
|
|
39
|
-
CustomThemeSchema,
|
|
40
|
-
GraphPreferencesSchema,
|
|
41
|
-
UIPreferencesSchema,
|
|
42
|
-
UpdatePreferencesInputSchema,
|
|
43
|
-
insertUserPreferenceSchema,
|
|
44
|
-
selectUserPreferenceSchema
|
|
45
|
-
} from "./chunk-75HLKBPD.js";
|
|
44
|
+
} from "./chunk-HFVZISQ7.js";
|
|
46
45
|
import {
|
|
47
46
|
insertProposalSchema,
|
|
48
47
|
selectProposalSchema
|
|
@@ -51,9 +50,32 @@ import "./chunk-X5L3VJJZ.js";
|
|
|
51
50
|
|
|
52
51
|
// src/templates/schemas.ts
|
|
53
52
|
import { z } from "zod";
|
|
54
|
-
var TemplateTargetTypeSchema = z.enum([
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
var TemplateTargetTypeSchema = z.enum([
|
|
54
|
+
"entity",
|
|
55
|
+
"document",
|
|
56
|
+
"project",
|
|
57
|
+
"inbox_item"
|
|
58
|
+
]);
|
|
59
|
+
var SectionTypeSchema = z.enum([
|
|
60
|
+
"header",
|
|
61
|
+
"relations",
|
|
62
|
+
"content",
|
|
63
|
+
"metadata",
|
|
64
|
+
"footer",
|
|
65
|
+
"banner",
|
|
66
|
+
"sidebar",
|
|
67
|
+
"contentBefore",
|
|
68
|
+
"contentAfter"
|
|
69
|
+
]);
|
|
70
|
+
var LayoutZoneSchema = z.enum([
|
|
71
|
+
"banner",
|
|
72
|
+
"header",
|
|
73
|
+
"sidebar",
|
|
74
|
+
"contentBefore",
|
|
75
|
+
"content",
|
|
76
|
+
"contentAfter",
|
|
77
|
+
"footer"
|
|
78
|
+
]);
|
|
57
79
|
var ZoneConfigSchema = z.object({
|
|
58
80
|
enabled: z.boolean(),
|
|
59
81
|
slots: z.array(z.string()).optional(),
|
|
@@ -145,8 +167,10 @@ var EntityTemplateSchema = z.object({
|
|
|
145
167
|
(data) => {
|
|
146
168
|
if (data.targetType === "entity" && !data.entityType) return false;
|
|
147
169
|
if (data.targetType === "inbox_item" && !data.inboxItemType) return false;
|
|
148
|
-
if (data.targetType === "document" && (data.entityType || data.inboxItemType))
|
|
149
|
-
|
|
170
|
+
if (data.targetType === "document" && (data.entityType || data.inboxItemType))
|
|
171
|
+
return false;
|
|
172
|
+
if (data.targetType === "project" && (data.entityType || data.inboxItemType))
|
|
173
|
+
return false;
|
|
150
174
|
if (data.userId && data.workspaceId) return false;
|
|
151
175
|
if (!data.userId && !data.workspaceId) return false;
|
|
152
176
|
return true;
|
|
@@ -278,9 +302,14 @@ function toSynapError(error, defaultMessage = "An error occurred") {
|
|
|
278
302
|
return error;
|
|
279
303
|
}
|
|
280
304
|
if (error instanceof Error) {
|
|
281
|
-
return new InternalServerError(defaultMessage, {
|
|
305
|
+
return new InternalServerError(defaultMessage, {
|
|
306
|
+
originalError: error.message,
|
|
307
|
+
stack: error.stack
|
|
308
|
+
});
|
|
282
309
|
}
|
|
283
|
-
return new InternalServerError(defaultMessage, {
|
|
310
|
+
return new InternalServerError(defaultMessage, {
|
|
311
|
+
originalError: String(error)
|
|
312
|
+
});
|
|
284
313
|
}
|
|
285
314
|
|
|
286
315
|
// src/templates/notion-like.template.ts
|
|
@@ -703,7 +732,6 @@ export {
|
|
|
703
732
|
classicNoteTemplate,
|
|
704
733
|
getContentCategoryForViewType,
|
|
705
734
|
getViewCategory,
|
|
706
|
-
insertDocumentSchema,
|
|
707
735
|
insertDocumentSessionSchema,
|
|
708
736
|
insertDocumentVersionSchema,
|
|
709
737
|
insertProposalSchema,
|
|
@@ -721,7 +749,7 @@ export {
|
|
|
721
749
|
parseViewContent,
|
|
722
750
|
safeParseViewContent,
|
|
723
751
|
safeValidateEntityMetadata,
|
|
724
|
-
|
|
752
|
+
selectDocumentSessionSchema,
|
|
725
753
|
selectDocumentVersionSchema,
|
|
726
754
|
selectProposalSchema,
|
|
727
755
|
selectUserPreferenceSchema,
|
|
@@ -574,6 +574,6 @@ declare const UpdatePreferencesInputSchema: z.ZodObject<{
|
|
|
574
574
|
* remain in this package for validation.
|
|
575
575
|
*/
|
|
576
576
|
|
|
577
|
-
type Theme =
|
|
577
|
+
type Theme = "light" | "dark" | "system";
|
|
578
578
|
|
|
579
579
|
export { CustomThemeSchema, GraphPreferencesSchema, type Theme, UIPreferencesSchema, UpdatePreferencesInputSchema };
|