deepspace 0.10.0 → 0.10.2
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/CHANGELOG.md +15 -0
- package/dist/{chunk-DQ4G6VL6.js → chunk-T7V4GUIN.js} +283 -180
- package/dist/chunk-T7V4GUIN.js.map +1 -0
- package/dist/cli.js +1010 -6123
- package/dist/cli.js.map +1 -1
- package/dist/documentation-client-core.d.ts +18 -0
- package/dist/{docs-client-core.js → documentation-client-core.js} +60 -51
- package/dist/documentation-client-core.js.map +1 -0
- package/dist/documentation-default-renderer.cjs +124 -0
- package/dist/documentation-react.d.ts +2 -0
- package/dist/{docs-react.js → documentation-react.js} +8 -8
- package/dist/documentation-runtime.js +71 -0
- package/dist/documentation-server-core.d.ts +11 -0
- package/dist/{docs-server-core.js → documentation-server-core.js} +13 -13
- package/dist/documentation-server-core.js.map +1 -0
- package/dist/documentation.d.ts +366 -0
- package/dist/documentation.js +3953 -0
- package/dist/documentation.js.map +1 -0
- package/dist/feature-installer.js +145 -0
- package/dist/feature-installer.js.map +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/index.js +5 -15
- package/dist/index.js.map +1 -1
- package/dist/public-BGRX_Cjd.d.ts +234 -0
- package/dist/schema.d.ts +186 -0
- package/dist/schema.js +610 -0
- package/dist/schema.js.map +1 -0
- package/dist/server.d.ts +19 -167
- package/dist/server.js +76 -1069
- package/dist/server.js.map +1 -1
- package/dist/testing.d.ts +5 -8
- package/dist/testing.js +48 -14
- package/dist/testing.js.map +1 -1
- package/dist/worker.d.ts +52 -173
- package/dist/worker.js +563 -492
- package/dist/worker.js.map +1 -1
- package/features/admin-page/src/admin-schema.ts +1 -1
- package/features/ai-chat/feature.json +2 -2
- package/features/ai-chat/src/ChatPanel.tsx +0 -1
- package/features/ai-chat/src/ai-chat-schema.ts +1 -2
- package/features/canvas/src/canvas-schema.ts +1 -1
- package/features/documentation/content/index.mdx +14 -0
- package/features/documentation/content/quickstart.mdx +12 -0
- package/features/documentation/documentation.json +18 -0
- package/features/documentation/feature.json +68 -0
- package/features/{docs → documents}/feature.json +27 -27
- package/features/{docs/src/DocsEditorPage.tsx → documents/src/DocumentsEditorPage.tsx} +74 -74
- package/features/{docs/src/DocsListPage.tsx → documents/src/DocumentsListPage.tsx} +102 -102
- package/features/{docs/src/DocsOutlinePanel.tsx → documents/src/DocumentsOutlinePanel.tsx} +9 -9
- package/features/{docs/src/DocsPresence.tsx → documents/src/DocumentsPresence.tsx} +18 -18
- package/features/{docs → documents}/src/InviteDialog.tsx +21 -21
- package/features/{docs → documents}/src/LibrarySidebar.tsx +25 -25
- package/features/documents/src/__tests__/documents-presence-access.test.ts +71 -0
- package/features/{docs/src/docs-library-types.ts → documents/src/documents-library-types.ts} +3 -3
- package/features/{docs/src/docs-schema.ts → documents/src/documents-schema.ts} +6 -6
- package/features/{docs/src/docs-ui.css → documents/src/documents-ui.css} +89 -89
- package/features/{docs → documents}/src/editor/DocEditorSurface.tsx +11 -11
- package/features/{docs/src/editor/DocsTiptapToolbar.tsx → documents/src/editor/DocumentsTiptapToolbar.tsx} +21 -21
- package/features/{docs → documents}/src/editor/useDocEditor.ts +4 -4
- package/features/{docs/src/use-docs-presence-access.ts → documents/src/use-documents-presence-access.ts} +51 -51
- package/features/file-attachments/src/attachments-schema.ts +1 -1
- package/features/items/src/items-schema.ts +1 -1
- package/features/leaderboard/src/leaderboard-schema.ts +1 -1
- package/features/messaging/src/ChatMultiPage.tsx +1 -1
- package/features/messaging/src/ChatPage.tsx +1 -1
- package/features/messaging/src/messaging-schema.ts +2 -2
- package/features/tasks/src/tasks-schema.ts +1 -1
- package/features/testing/src/test-schema.ts +2 -2
- package/package.json +12 -7
- package/dist/chunk-DQ4G6VL6.js.map +0 -1
- package/dist/docs-client-core.d.ts +0 -18
- package/dist/docs-client-core.js.map +0 -1
- package/dist/docs-react.d.ts +0 -2
- package/dist/docs-runtime.js +0 -71
- package/dist/docs-server-core.d.ts +0 -11
- package/dist/docs-server-core.js.map +0 -1
- package/dist/docs.d.ts +0 -350
- package/dist/docs.js +0 -5139
- package/dist/docs.js.map +0 -1
- package/dist/public-Cp1X8ZQ3.d.ts +0 -230
- package/features/docs/src/__tests__/docs-presence-access.test.ts +0 -71
- /package/dist/{docs-react.js.map → documentation-react.js.map} +0 -0
package/dist/schema.js
ADDED
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
// src/server/schemas/registry.ts
|
|
2
|
+
var USERS_COLUMNS = [
|
|
3
|
+
{ name: "email", storage: "text", interpretation: "plain" },
|
|
4
|
+
{ name: "name", storage: "text", interpretation: "plain" },
|
|
5
|
+
{ name: "imageUrl", storage: "text", interpretation: "plain" },
|
|
6
|
+
{ name: "role", storage: "text", interpretation: "plain" },
|
|
7
|
+
{ name: "createdAt", storage: "text", interpretation: { kind: "datetime" } },
|
|
8
|
+
{ name: "lastSeenAt", storage: "text", interpretation: { kind: "datetime" } }
|
|
9
|
+
];
|
|
10
|
+
var BASE_USERS_SCHEMA = {
|
|
11
|
+
name: "users",
|
|
12
|
+
columns: [...USERS_COLUMNS],
|
|
13
|
+
permissions: {
|
|
14
|
+
"*": { read: "own", create: false, update: false, delete: false },
|
|
15
|
+
admin: { read: true, create: false, update: true, delete: true }
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// src/server/schemas/ai-chat.ts
|
|
20
|
+
var AI_CHATS_SCHEMA = {
|
|
21
|
+
name: "ai-chats",
|
|
22
|
+
columns: [
|
|
23
|
+
{ name: "userId", storage: "text", interpretation: "plain", userBound: true, immutable: true, required: true },
|
|
24
|
+
{ name: "title", storage: "text", interpretation: "plain" },
|
|
25
|
+
{ name: "model", storage: "text", interpretation: "plain" },
|
|
26
|
+
{ name: "compactedSummary", storage: "text", interpretation: "plain" },
|
|
27
|
+
{ name: "compactedThroughId", storage: "text", interpretation: "plain" }
|
|
28
|
+
],
|
|
29
|
+
ownerField: "userId",
|
|
30
|
+
permissions: {
|
|
31
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
32
|
+
member: { read: "own", create: false, update: "own", delete: "own" },
|
|
33
|
+
viewer: { read: "own", create: false, update: false, delete: false }
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var AI_MESSAGES_SCHEMA = {
|
|
37
|
+
name: "ai-messages",
|
|
38
|
+
columns: [
|
|
39
|
+
{ name: "chatId", storage: "text", interpretation: "plain", immutable: true, required: true },
|
|
40
|
+
{ name: "userId", storage: "text", interpretation: "plain", userBound: true, immutable: true, required: true },
|
|
41
|
+
{ name: "role", storage: "text", interpretation: "plain", required: true },
|
|
42
|
+
{ name: "content", storage: "text", interpretation: "plain" },
|
|
43
|
+
{ name: "parts", storage: "text", interpretation: { kind: "json" } }
|
|
44
|
+
],
|
|
45
|
+
ownerField: "userId",
|
|
46
|
+
permissions: {
|
|
47
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
48
|
+
member: { read: "own", create: false, update: "own", delete: "own" },
|
|
49
|
+
viewer: { read: "own", create: false, update: false, delete: false }
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/server/schemas/messaging.ts
|
|
54
|
+
var CHANNELS_SCHEMA = {
|
|
55
|
+
name: "channels",
|
|
56
|
+
columns: [
|
|
57
|
+
{ name: "name", storage: "text", interpretation: "plain" },
|
|
58
|
+
{ name: "description", storage: "text", interpretation: "plain" },
|
|
59
|
+
{
|
|
60
|
+
name: "type",
|
|
61
|
+
storage: "text",
|
|
62
|
+
interpretation: { kind: "select", options: ["public", "private", "dm"] }
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "createdBy",
|
|
66
|
+
storage: "text",
|
|
67
|
+
interpretation: "plain",
|
|
68
|
+
userBound: true,
|
|
69
|
+
immutable: true
|
|
70
|
+
},
|
|
71
|
+
{ name: "archived", storage: "number", interpretation: { kind: "boolean" } }
|
|
72
|
+
],
|
|
73
|
+
ownerField: "createdBy",
|
|
74
|
+
permissions: {
|
|
75
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
76
|
+
member: { read: true, create: true, update: "own", delete: false },
|
|
77
|
+
viewer: { read: true, create: false, update: false, delete: false }
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var MESSAGES_SCHEMA = {
|
|
81
|
+
name: "messages",
|
|
82
|
+
columns: [
|
|
83
|
+
{ name: "channelId", storage: "text", interpretation: "plain" },
|
|
84
|
+
{ name: "content", storage: "text", interpretation: "plain" },
|
|
85
|
+
{
|
|
86
|
+
name: "authorId",
|
|
87
|
+
storage: "text",
|
|
88
|
+
interpretation: "plain",
|
|
89
|
+
userBound: true,
|
|
90
|
+
immutable: true
|
|
91
|
+
},
|
|
92
|
+
{ name: "parentMessageId", storage: "text", interpretation: "plain" },
|
|
93
|
+
{ name: "edited", storage: "number", interpretation: { kind: "boolean" } },
|
|
94
|
+
{ name: "editedAt", storage: "text", interpretation: { kind: "datetime" } },
|
|
95
|
+
// Soft-delete flag. Slack-style messaging keeps the row + parent IDs
|
|
96
|
+
// intact (so threads remain coherent) and renders a tombstone instead.
|
|
97
|
+
// Hard-delete via remove() still works if an app wants it.
|
|
98
|
+
{ name: "deleted", storage: "number", interpretation: { kind: "boolean" } }
|
|
99
|
+
],
|
|
100
|
+
ownerField: "authorId",
|
|
101
|
+
permissions: {
|
|
102
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
103
|
+
member: { read: true, create: true, update: "own", delete: "own" },
|
|
104
|
+
viewer: { read: true, create: false, update: false, delete: false }
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var REACTIONS_SCHEMA = {
|
|
108
|
+
name: "reactions",
|
|
109
|
+
columns: [
|
|
110
|
+
{ name: "messageId", storage: "text", interpretation: "plain" },
|
|
111
|
+
{ name: "channelId", storage: "text", interpretation: "plain" },
|
|
112
|
+
{ name: "emoji", storage: "text", interpretation: "plain" },
|
|
113
|
+
{ name: "userId", storage: "text", interpretation: "plain", userBound: true, immutable: true }
|
|
114
|
+
],
|
|
115
|
+
ownerField: "userId",
|
|
116
|
+
uniqueOn: ["messageId", "emoji", "userId"],
|
|
117
|
+
permissions: {
|
|
118
|
+
admin: { read: true, create: true, update: false, delete: true },
|
|
119
|
+
member: { read: true, create: true, update: false, delete: "own" },
|
|
120
|
+
viewer: { read: true, create: false, update: false, delete: false }
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var CHANNEL_MEMBERS_SCHEMA = {
|
|
124
|
+
name: "channel-members",
|
|
125
|
+
columns: [
|
|
126
|
+
{ name: "channelId", storage: "text", interpretation: "plain" },
|
|
127
|
+
{ name: "userId", storage: "text", interpretation: "plain", userBound: true, immutable: true },
|
|
128
|
+
{ name: "joinedAt", storage: "text", interpretation: { kind: "datetime" } }
|
|
129
|
+
],
|
|
130
|
+
ownerField: "userId",
|
|
131
|
+
uniqueOn: ["channelId", "userId"],
|
|
132
|
+
permissions: {
|
|
133
|
+
admin: { read: true, create: true, update: false, delete: true },
|
|
134
|
+
member: { read: true, create: true, update: false, delete: "own" },
|
|
135
|
+
viewer: { read: true, create: false, update: false, delete: false }
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
var CHANNEL_INVITATIONS_SCHEMA = {
|
|
139
|
+
name: "channel-invitations",
|
|
140
|
+
columns: [
|
|
141
|
+
{
|
|
142
|
+
name: "channelId",
|
|
143
|
+
storage: "text",
|
|
144
|
+
interpretation: "plain",
|
|
145
|
+
required: true,
|
|
146
|
+
immutable: true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "invitedUserId",
|
|
150
|
+
storage: "text",
|
|
151
|
+
interpretation: "plain",
|
|
152
|
+
required: true,
|
|
153
|
+
immutable: true
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "invitedBy",
|
|
157
|
+
storage: "text",
|
|
158
|
+
interpretation: "plain",
|
|
159
|
+
userBound: true,
|
|
160
|
+
immutable: true
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "status",
|
|
164
|
+
storage: "text",
|
|
165
|
+
interpretation: { kind: "select", options: ["pending", "accepted", "declined"] },
|
|
166
|
+
required: true
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
uniqueOn: ["channelId", "invitedUserId"],
|
|
170
|
+
permissions: {
|
|
171
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
172
|
+
member: { read: true, create: true, update: true, delete: false },
|
|
173
|
+
viewer: { read: true, create: false, update: false, delete: false }
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var READ_RECEIPTS_SCHEMA = {
|
|
177
|
+
name: "read-receipts",
|
|
178
|
+
columns: [
|
|
179
|
+
{ name: "channelId", storage: "text", interpretation: "plain" },
|
|
180
|
+
{ name: "userId", storage: "text", interpretation: "plain", userBound: true, immutable: true },
|
|
181
|
+
{ name: "lastReadAt", storage: "text", interpretation: { kind: "datetime" } }
|
|
182
|
+
],
|
|
183
|
+
ownerField: "userId",
|
|
184
|
+
uniqueOn: ["channelId", "userId"],
|
|
185
|
+
permissions: {
|
|
186
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
187
|
+
member: { read: true, create: true, update: "own", delete: "own" },
|
|
188
|
+
viewer: { read: false, create: false, update: false, delete: false }
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/server/schemas/conversation.ts
|
|
193
|
+
var CONVERSATION_SCHEMAS = [
|
|
194
|
+
{
|
|
195
|
+
name: "conv_messages",
|
|
196
|
+
columns: [
|
|
197
|
+
{ name: "Content", storage: "text", interpretation: "plain" },
|
|
198
|
+
{ name: "AuthorId", storage: "text", interpretation: "plain" },
|
|
199
|
+
{ name: "ParentId", storage: "text", interpretation: "plain" },
|
|
200
|
+
{ name: "Edited", storage: "number", interpretation: "boolean" },
|
|
201
|
+
{ name: "MessageType", storage: "text", interpretation: "plain" },
|
|
202
|
+
{ name: "Metadata", storage: "text", interpretation: "json" }
|
|
203
|
+
],
|
|
204
|
+
permissions: {
|
|
205
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
206
|
+
member: { read: true, create: true, update: "own", delete: "own" },
|
|
207
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
208
|
+
},
|
|
209
|
+
ownerField: "AuthorId"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "conv_reactions",
|
|
213
|
+
columns: [
|
|
214
|
+
{ name: "MessageId", storage: "text", interpretation: "plain" },
|
|
215
|
+
{ name: "Emoji", storage: "text", interpretation: "plain" },
|
|
216
|
+
{ name: "UserId", storage: "text", interpretation: "plain" }
|
|
217
|
+
],
|
|
218
|
+
uniqueOn: ["MessageId", "Emoji", "UserId"],
|
|
219
|
+
permissions: {
|
|
220
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
221
|
+
member: { read: true, create: true, update: false, delete: "own" },
|
|
222
|
+
admin: { read: true, create: true, update: false, delete: true }
|
|
223
|
+
},
|
|
224
|
+
ownerField: "UserId"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: "conv_members",
|
|
228
|
+
columns: [
|
|
229
|
+
{ name: "UserId", storage: "text", interpretation: "plain" },
|
|
230
|
+
{ name: "UserName", storage: "text", interpretation: "plain" },
|
|
231
|
+
{ name: "Role", storage: "text", interpretation: "plain" }
|
|
232
|
+
],
|
|
233
|
+
uniqueOn: ["UserId"],
|
|
234
|
+
permissions: {
|
|
235
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
236
|
+
member: { read: true, create: true, update: "own", delete: false },
|
|
237
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
238
|
+
},
|
|
239
|
+
ownerField: "UserId"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "conv_read_cursors",
|
|
243
|
+
columns: [
|
|
244
|
+
{ name: "UserId", storage: "text", interpretation: "plain" },
|
|
245
|
+
{ name: "LastReadAt", storage: "text", interpretation: "plain" }
|
|
246
|
+
],
|
|
247
|
+
uniqueOn: ["UserId"],
|
|
248
|
+
permissions: {
|
|
249
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
250
|
+
member: { read: true, create: true, update: "own", delete: false },
|
|
251
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
252
|
+
},
|
|
253
|
+
ownerField: "UserId"
|
|
254
|
+
}
|
|
255
|
+
];
|
|
256
|
+
var VOTING_SCHEMAS = [
|
|
257
|
+
{
|
|
258
|
+
name: "conv_votes",
|
|
259
|
+
columns: [
|
|
260
|
+
{ name: "TargetId", storage: "text", interpretation: "plain" },
|
|
261
|
+
{ name: "UserId", storage: "text", interpretation: "plain" },
|
|
262
|
+
{ name: "Direction", storage: "number", interpretation: "plain" }
|
|
263
|
+
],
|
|
264
|
+
uniqueOn: ["TargetId", "UserId"],
|
|
265
|
+
permissions: {
|
|
266
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
267
|
+
member: { read: true, create: true, update: "own", delete: "own" },
|
|
268
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
269
|
+
},
|
|
270
|
+
ownerField: "UserId"
|
|
271
|
+
}
|
|
272
|
+
];
|
|
273
|
+
|
|
274
|
+
// src/server/schemas/directory.ts
|
|
275
|
+
var conversationsSchema = {
|
|
276
|
+
name: "conversations",
|
|
277
|
+
columns: [
|
|
278
|
+
{ name: "Name", storage: "text", interpretation: "plain" },
|
|
279
|
+
{ name: "Description", storage: "text", interpretation: "plain" },
|
|
280
|
+
{ name: "Type", storage: "text", interpretation: { kind: "select", options: ["public", "private", "dm", "group", "email", "outbound-email", "support", "announcement"] } },
|
|
281
|
+
{ name: "Visibility", storage: "text", interpretation: { kind: "select", options: ["public", "private", "restricted"] } },
|
|
282
|
+
{ name: "CreatedBy", storage: "text", interpretation: "plain" },
|
|
283
|
+
{ name: "ParticipantHash", storage: "text", interpretation: "plain" },
|
|
284
|
+
{ name: "ParticipantIds", storage: "text", interpretation: "json" },
|
|
285
|
+
{ name: "Status", storage: "text", interpretation: { kind: "select", options: ["active", "archived", "resolved", "closed"] } },
|
|
286
|
+
{ name: "AssigneeId", storage: "text", interpretation: "plain" },
|
|
287
|
+
{ name: "LinkedRef", storage: "text", interpretation: "json" },
|
|
288
|
+
{ name: "LastMessageAt", storage: "text", interpretation: { kind: "datetime" } },
|
|
289
|
+
{ name: "LastMessagePreview", storage: "text", interpretation: "plain" },
|
|
290
|
+
{ name: "LastMessageAuthor", storage: "text", interpretation: "plain" },
|
|
291
|
+
{ name: "MessageCount", storage: "number", interpretation: "plain" }
|
|
292
|
+
],
|
|
293
|
+
collaboratorsField: "ParticipantIds",
|
|
294
|
+
visibilityField: "Visibility",
|
|
295
|
+
permissions: {
|
|
296
|
+
viewer: { read: "shared", create: false, update: false, delete: false },
|
|
297
|
+
member: { read: "shared", create: true, update: true, delete: "own" },
|
|
298
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
299
|
+
},
|
|
300
|
+
ownerField: "CreatedBy"
|
|
301
|
+
};
|
|
302
|
+
var conversationStateSchema = {
|
|
303
|
+
name: "conversation_state",
|
|
304
|
+
columns: [
|
|
305
|
+
{ name: "ConversationId", storage: "text", interpretation: "plain" },
|
|
306
|
+
{ name: "UserId", storage: "text", interpretation: "plain" },
|
|
307
|
+
{ name: "LastReadAt", storage: "text", interpretation: { kind: "datetime" } },
|
|
308
|
+
{ name: "LastReadMessageCount", storage: "number", interpretation: "plain" },
|
|
309
|
+
{ name: "Starred", storage: "number", interpretation: "boolean" },
|
|
310
|
+
{ name: "Archived", storage: "number", interpretation: "boolean" },
|
|
311
|
+
{ name: "Trashed", storage: "number", interpretation: "boolean" },
|
|
312
|
+
{ name: "Labels", storage: "text", interpretation: "json" },
|
|
313
|
+
{ name: "Folder", storage: "text", interpretation: "plain" }
|
|
314
|
+
],
|
|
315
|
+
uniqueOn: ["ConversationId", "UserId"],
|
|
316
|
+
ownerField: "UserId",
|
|
317
|
+
permissions: {
|
|
318
|
+
viewer: { read: false, create: false, update: false, delete: false },
|
|
319
|
+
member: { read: "own", create: true, update: "own", delete: false },
|
|
320
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
var communitiesSchema = {
|
|
324
|
+
name: "communities",
|
|
325
|
+
columns: [
|
|
326
|
+
{ name: "Name", storage: "text", interpretation: "plain" },
|
|
327
|
+
{ name: "Description", storage: "text", interpretation: "plain" },
|
|
328
|
+
{ name: "CreatedBy", storage: "text", interpretation: "plain" },
|
|
329
|
+
{ name: "Type", storage: "text", interpretation: { kind: "select", options: ["community", "forum", "board", "project", "server"] } },
|
|
330
|
+
{ name: "Visibility", storage: "text", interpretation: { kind: "select", options: ["public", "private", "restricted"] } },
|
|
331
|
+
{ name: "MemberCount", storage: "number", interpretation: "plain" },
|
|
332
|
+
{ name: "Rules", storage: "text", interpretation: "json" },
|
|
333
|
+
{ name: "IconUrl", storage: "text", interpretation: "plain" },
|
|
334
|
+
{ name: "CoverUrl", storage: "text", interpretation: "plain" }
|
|
335
|
+
],
|
|
336
|
+
uniqueOn: ["Name"],
|
|
337
|
+
permissions: {
|
|
338
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
339
|
+
member: { read: true, create: true, update: "own", delete: false },
|
|
340
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
341
|
+
},
|
|
342
|
+
ownerField: "CreatedBy"
|
|
343
|
+
};
|
|
344
|
+
var membershipsSchema = {
|
|
345
|
+
name: "memberships",
|
|
346
|
+
columns: [
|
|
347
|
+
{ name: "CommunityId", storage: "text", interpretation: "plain" },
|
|
348
|
+
{ name: "UserId", storage: "text", interpretation: "plain" },
|
|
349
|
+
{ name: "UserName", storage: "text", interpretation: "plain" },
|
|
350
|
+
{ name: "Role", storage: "text", interpretation: { kind: "select", options: ["member", "moderator", "admin"] } },
|
|
351
|
+
{ name: "JoinedAt", storage: "text", interpretation: { kind: "datetime" } }
|
|
352
|
+
],
|
|
353
|
+
uniqueOn: ["CommunityId", "UserId"],
|
|
354
|
+
permissions: {
|
|
355
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
356
|
+
member: { read: true, create: true, update: "own", delete: "own" },
|
|
357
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
358
|
+
},
|
|
359
|
+
ownerField: "UserId"
|
|
360
|
+
};
|
|
361
|
+
var postsSchema = {
|
|
362
|
+
name: "posts",
|
|
363
|
+
columns: [
|
|
364
|
+
{ name: "Title", storage: "text", interpretation: "plain" },
|
|
365
|
+
{ name: "Content", storage: "text", interpretation: "plain" },
|
|
366
|
+
{ name: "AuthorId", storage: "text", interpretation: "plain" },
|
|
367
|
+
{ name: "Type", storage: "text", interpretation: { kind: "select", options: ["post", "question", "answer", "tweet", "announcement", "link"] } },
|
|
368
|
+
{ name: "CommunityId", storage: "text", interpretation: "plain" },
|
|
369
|
+
{ name: "ParentId", storage: "text", interpretation: "plain" },
|
|
370
|
+
{ name: "ConversationId", storage: "text", interpretation: "plain" },
|
|
371
|
+
{ name: "Status", storage: "text", interpretation: { kind: "select", options: ["draft", "published", "pinned", "archived", "accepted"] } },
|
|
372
|
+
{ name: "Tags", storage: "text", interpretation: "json" },
|
|
373
|
+
{ name: "LinkUrl", storage: "text", interpretation: "plain" }
|
|
374
|
+
],
|
|
375
|
+
permissions: {
|
|
376
|
+
viewer: { read: true, create: false, update: false, delete: false },
|
|
377
|
+
member: { read: true, create: true, update: "own", delete: "own" },
|
|
378
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
379
|
+
},
|
|
380
|
+
ownerField: "AuthorId"
|
|
381
|
+
};
|
|
382
|
+
var DIRECTORY_SCHEMAS = [
|
|
383
|
+
conversationsSchema,
|
|
384
|
+
conversationStateSchema,
|
|
385
|
+
communitiesSchema,
|
|
386
|
+
membershipsSchema,
|
|
387
|
+
postsSchema
|
|
388
|
+
];
|
|
389
|
+
|
|
390
|
+
// src/server/schemas/workspace.ts
|
|
391
|
+
var workspaceTeamsSchema = {
|
|
392
|
+
name: "teams",
|
|
393
|
+
columns: [
|
|
394
|
+
{ name: "Name", storage: "text", interpretation: "plain" },
|
|
395
|
+
{ name: "CreatedBy", storage: "text", interpretation: "plain" },
|
|
396
|
+
{ name: "IsOpen", storage: "number", interpretation: { kind: "boolean" } }
|
|
397
|
+
],
|
|
398
|
+
teamField: "_rowId",
|
|
399
|
+
permissions: {
|
|
400
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
401
|
+
member: { read: "team", create: true, update: "team", delete: "own" }
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
var workspaceTeamMembersSchema = {
|
|
405
|
+
name: "team_members",
|
|
406
|
+
columns: [
|
|
407
|
+
{ name: "TeamId", storage: "text", interpretation: "plain" },
|
|
408
|
+
{ name: "UserId", storage: "text", interpretation: "plain" },
|
|
409
|
+
{ name: "RoleInTeam", storage: "text", interpretation: { kind: "select", options: ["admin", "member"] } },
|
|
410
|
+
{ name: "JoinedAt", storage: "text", interpretation: { kind: "datetime" } },
|
|
411
|
+
{ name: "Email", storage: "text", interpretation: { kind: "email" } },
|
|
412
|
+
{ name: "Status", storage: "text", interpretation: { kind: "select", options: ["active", "invited"] } }
|
|
413
|
+
],
|
|
414
|
+
teamField: "TeamId",
|
|
415
|
+
permissions: {
|
|
416
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
417
|
+
member: { read: "team", create: true, update: "team", delete: "team" }
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
var workspaceTasksSchema = {
|
|
421
|
+
name: "tasks",
|
|
422
|
+
columns: [
|
|
423
|
+
{ name: "TeamId", storage: "text", interpretation: "plain" },
|
|
424
|
+
{ name: "Title", storage: "text", interpretation: "plain" },
|
|
425
|
+
{ name: "Notes", storage: "text", interpretation: "plain" },
|
|
426
|
+
{ name: "Completed", storage: "number", interpretation: { kind: "boolean" } },
|
|
427
|
+
{ name: "CompletedAt", storage: "number", interpretation: "plain" },
|
|
428
|
+
{ name: "Deleted", storage: "number", interpretation: { kind: "boolean" } },
|
|
429
|
+
{ name: "DeletedAt", storage: "number", interpretation: "plain" },
|
|
430
|
+
{ name: "Priority", storage: "text", interpretation: { kind: "select", options: ["none", "low", "medium", "high"] } },
|
|
431
|
+
{ name: "DueDate", storage: "text", interpretation: "plain" },
|
|
432
|
+
{ name: "ProjectId", storage: "text", interpretation: "plain" },
|
|
433
|
+
{ name: "KanbanStatus", storage: "text", interpretation: { kind: "select", options: ["backlog", "ready", "in_progress", "review", "done"] } },
|
|
434
|
+
{ name: "Order", storage: "number", interpretation: "plain" },
|
|
435
|
+
{ name: "AssignedUser", storage: "text", interpretation: { kind: "json" } },
|
|
436
|
+
{ name: "AssignedBy", storage: "text", interpretation: { kind: "json" } },
|
|
437
|
+
{ name: "TagIds", storage: "text", interpretation: { kind: "json" } },
|
|
438
|
+
{ name: "CreatedAt", storage: "number", interpretation: "plain" }
|
|
439
|
+
],
|
|
440
|
+
teamField: "TeamId",
|
|
441
|
+
permissions: {
|
|
442
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
443
|
+
member: { read: "team", create: true, update: "team", delete: "team" },
|
|
444
|
+
viewer: { read: false, create: false, update: false, delete: false }
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
var workspaceProjectsSchema = {
|
|
448
|
+
name: "projects",
|
|
449
|
+
columns: [
|
|
450
|
+
{ name: "TeamId", storage: "text", interpretation: "plain" },
|
|
451
|
+
{ name: "Title", storage: "text", interpretation: "plain" },
|
|
452
|
+
{ name: "Notes", storage: "text", interpretation: "plain" },
|
|
453
|
+
{ name: "Color", storage: "text", interpretation: "plain" },
|
|
454
|
+
{ name: "ParentId", storage: "text", interpretation: "plain" },
|
|
455
|
+
{ name: "Order", storage: "number", interpretation: "plain" },
|
|
456
|
+
{ name: "CreatedAt", storage: "number", interpretation: "plain" }
|
|
457
|
+
],
|
|
458
|
+
teamField: "TeamId",
|
|
459
|
+
permissions: {
|
|
460
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
461
|
+
member: { read: "team", create: true, update: "team", delete: "team" },
|
|
462
|
+
viewer: { read: false, create: false, update: false, delete: false }
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
var workspaceTagsSchema = {
|
|
466
|
+
name: "tags",
|
|
467
|
+
columns: [
|
|
468
|
+
{ name: "TeamId", storage: "text", interpretation: "plain" },
|
|
469
|
+
{ name: "Name", storage: "text", interpretation: "plain" },
|
|
470
|
+
{ name: "Color", storage: "text", interpretation: "plain" },
|
|
471
|
+
{ name: "CreatedAt", storage: "number", interpretation: "plain" }
|
|
472
|
+
],
|
|
473
|
+
teamField: "TeamId",
|
|
474
|
+
permissions: {
|
|
475
|
+
admin: { read: true, create: true, update: true, delete: true },
|
|
476
|
+
member: { read: "team", create: true, update: "team", delete: "team" },
|
|
477
|
+
viewer: { read: false, create: false, update: false, delete: false }
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
var workspacePeopleSchema = {
|
|
481
|
+
name: "people",
|
|
482
|
+
columns: [
|
|
483
|
+
{ name: "Name", storage: "text", interpretation: "plain" },
|
|
484
|
+
{ name: "Email", storage: "text", interpretation: { kind: "email" } },
|
|
485
|
+
{ name: "Type", storage: "text", interpretation: { kind: "select", options: ["employee", "customer", "vendor", "contact"] } },
|
|
486
|
+
{ name: "Status", storage: "text", interpretation: { kind: "select", options: ["active", "inactive", "archived"] } },
|
|
487
|
+
{ name: "CompanyId", storage: "text", interpretation: "plain" },
|
|
488
|
+
{ name: "Department", storage: "text", interpretation: "plain" },
|
|
489
|
+
{ name: "Title", storage: "text", interpretation: "plain" },
|
|
490
|
+
{ name: "LastContactedAt", storage: "text", interpretation: { kind: "datetime" } },
|
|
491
|
+
{ name: "Metadata", storage: "text", interpretation: { kind: "json" } }
|
|
492
|
+
],
|
|
493
|
+
permissions: {
|
|
494
|
+
"*": { read: true, create: true, update: true, delete: false },
|
|
495
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
var workspaceTransactionsSchema = {
|
|
499
|
+
name: "transactions",
|
|
500
|
+
columns: [
|
|
501
|
+
{ name: "Type", storage: "text", interpretation: { kind: "select", options: ["revenue", "expense", "payment", "transfer", "invoice", "refund"] } },
|
|
502
|
+
{ name: "Amount", storage: "number", interpretation: { kind: "currency", symbol: "$", decimals: 2 } },
|
|
503
|
+
{ name: "Currency", storage: "text", interpretation: "plain" },
|
|
504
|
+
{ name: "Description", storage: "text", interpretation: "plain" },
|
|
505
|
+
{ name: "Category", storage: "text", interpretation: "plain" },
|
|
506
|
+
{ name: "CounterpartyRef", storage: "text", interpretation: "plain" },
|
|
507
|
+
{ name: "OrderRef", storage: "text", interpretation: "plain" },
|
|
508
|
+
{ name: "Account", storage: "text", interpretation: "plain" }
|
|
509
|
+
],
|
|
510
|
+
permissions: {
|
|
511
|
+
"*": { read: true, create: true, update: true, delete: false },
|
|
512
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
var workspaceAccountsSchema = {
|
|
516
|
+
name: "accounts",
|
|
517
|
+
columns: [
|
|
518
|
+
{ name: "Name", storage: "text", interpretation: "plain" },
|
|
519
|
+
{ name: "Balance", storage: "number", interpretation: { kind: "currency", symbol: "$", decimals: 2 } },
|
|
520
|
+
{ name: "Currency", storage: "text", interpretation: "plain" }
|
|
521
|
+
],
|
|
522
|
+
permissions: {
|
|
523
|
+
"*": { read: true, create: true, update: true, delete: false },
|
|
524
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
var workspaceContentSharesSchema = {
|
|
528
|
+
name: "content_shares",
|
|
529
|
+
ownerField: "OwnerId",
|
|
530
|
+
columns: [
|
|
531
|
+
{ name: "ContentType", storage: "text", interpretation: { kind: "select", options: ["document", "slide", "spreadsheet"] } },
|
|
532
|
+
{ name: "ContentId", storage: "text", interpretation: "plain" },
|
|
533
|
+
{ name: "OwnerId", storage: "text", interpretation: "plain" },
|
|
534
|
+
{ name: "OwnerName", storage: "text", interpretation: "plain" },
|
|
535
|
+
{ name: "Title", storage: "text", interpretation: "plain" },
|
|
536
|
+
{ name: "ShareType", storage: "text", interpretation: { kind: "select", options: ["self", "channel", "team", "direct", "link", "org"] } },
|
|
537
|
+
{ name: "ShareTarget", storage: "text", interpretation: "plain" },
|
|
538
|
+
{ name: "Permission", storage: "text", interpretation: { kind: "select", options: ["view", "edit"] } },
|
|
539
|
+
{ name: "SharedAt", storage: "text", interpretation: { kind: "datetime" } },
|
|
540
|
+
{ name: "SharedBy", storage: "text", interpretation: "plain" },
|
|
541
|
+
{ name: "SourceApp", storage: "text", interpretation: "plain" },
|
|
542
|
+
{ name: "WordCount", storage: "number", interpretation: "plain" },
|
|
543
|
+
{ name: "LastEditedAt", storage: "text", interpretation: { kind: "datetime" } }
|
|
544
|
+
],
|
|
545
|
+
permissions: {
|
|
546
|
+
"*": { read: true, create: true, update: true, delete: "own" },
|
|
547
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
var workspaceFormResponsesSchema = {
|
|
551
|
+
name: "form_responses",
|
|
552
|
+
columns: [
|
|
553
|
+
{ name: "FormId", storage: "text", interpretation: "plain" },
|
|
554
|
+
{ name: "FormTitle", storage: "text", interpretation: "plain" },
|
|
555
|
+
{ name: "RespondentId", storage: "text", interpretation: "plain" },
|
|
556
|
+
{ name: "RespondentEmail", storage: "text", interpretation: { kind: "email" } },
|
|
557
|
+
{ name: "RespondentName", storage: "text", interpretation: "plain" },
|
|
558
|
+
{ name: "Data", storage: "text", interpretation: { kind: "json" } },
|
|
559
|
+
{ name: "SubmittedAt", storage: "text", interpretation: { kind: "datetime" } }
|
|
560
|
+
],
|
|
561
|
+
permissions: {
|
|
562
|
+
"*": { read: true, create: true, update: false, delete: false },
|
|
563
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
var workspaceEmailHandlesSchema = {
|
|
567
|
+
name: "email_handles",
|
|
568
|
+
columns: [
|
|
569
|
+
{ name: "UserId", storage: "text", interpretation: "plain" },
|
|
570
|
+
{ name: "Handle", storage: "text", interpretation: "plain" },
|
|
571
|
+
{ name: "EmailAddress", storage: "text", interpretation: { kind: "email" } },
|
|
572
|
+
{ name: "Status", storage: "text", interpretation: { kind: "select", options: ["active", "disabled"] } }
|
|
573
|
+
],
|
|
574
|
+
uniqueOn: ["Handle"],
|
|
575
|
+
ownerField: "UserId",
|
|
576
|
+
permissions: {
|
|
577
|
+
"*": { read: true, create: true, update: "own", delete: false },
|
|
578
|
+
admin: { read: true, create: true, update: true, delete: true }
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
var WORKSPACE_SCHEMAS = [
|
|
582
|
+
workspaceTeamsSchema,
|
|
583
|
+
workspaceTeamMembersSchema,
|
|
584
|
+
workspaceTasksSchema,
|
|
585
|
+
workspaceProjectsSchema,
|
|
586
|
+
workspaceTagsSchema,
|
|
587
|
+
workspacePeopleSchema,
|
|
588
|
+
workspaceTransactionsSchema,
|
|
589
|
+
workspaceAccountsSchema,
|
|
590
|
+
workspaceContentSharesSchema,
|
|
591
|
+
workspaceFormResponsesSchema,
|
|
592
|
+
workspaceEmailHandlesSchema
|
|
593
|
+
];
|
|
594
|
+
export {
|
|
595
|
+
AI_CHATS_SCHEMA,
|
|
596
|
+
AI_MESSAGES_SCHEMA,
|
|
597
|
+
BASE_USERS_SCHEMA,
|
|
598
|
+
CHANNELS_SCHEMA,
|
|
599
|
+
CHANNEL_INVITATIONS_SCHEMA,
|
|
600
|
+
CHANNEL_MEMBERS_SCHEMA,
|
|
601
|
+
CONVERSATION_SCHEMAS,
|
|
602
|
+
DIRECTORY_SCHEMAS,
|
|
603
|
+
MESSAGES_SCHEMA,
|
|
604
|
+
REACTIONS_SCHEMA,
|
|
605
|
+
READ_RECEIPTS_SCHEMA,
|
|
606
|
+
USERS_COLUMNS,
|
|
607
|
+
VOTING_SCHEMAS,
|
|
608
|
+
WORKSPACE_SCHEMAS
|
|
609
|
+
};
|
|
610
|
+
//# sourceMappingURL=schema.js.map
|