@excali-boards/boards-api-client 1.1.59 → 1.1.61

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.
@@ -0,0 +1,415 @@
1
+ model Group {
2
+ dbId String @id @default(uuid())
3
+ groupId String @unique
4
+
5
+ name String
6
+ index Int
7
+
8
+ calCode String?
9
+ events Event[]
10
+
11
+ categories Category[]
12
+ permissions GroupPermission[]
13
+ personalWorkspace PersonalWorkspace?
14
+ }
15
+
16
+ model Category {
17
+ dbId String @id @default(uuid())
18
+ categoryId String @unique
19
+
20
+ name String
21
+ index Int
22
+
23
+ groupId String
24
+ group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
25
+
26
+ boards Board[]
27
+ permissions CategoryPermission[]
28
+ personalCategory PersonalCategory?
29
+ }
30
+
31
+ model Board {
32
+ dbId String @id @default(uuid())
33
+ boardId String @unique
34
+
35
+ name String
36
+ index Int
37
+
38
+ version Int @default(0)
39
+ updatedAt DateTime @default(now())
40
+ type BoardType @default(Excalidraw)
41
+
42
+ scheduledForDeletion DateTime?
43
+ totalSizeBytes Int @default(0)
44
+
45
+ categoryId String
46
+ category Category @relation(fields: [categoryId], references: [categoryId], onDelete: Cascade)
47
+
48
+ flashcardDeck FlashcardDeck?
49
+ personalBoard PersonalBoard?
50
+
51
+ files File[]
52
+ boardPermission BoardPermission[]
53
+ userActivities UserBoardActivity[]
54
+
55
+ @@index([categoryId])
56
+ @@index([index])
57
+ }
58
+
59
+ model UserBoardActivity {
60
+ dbId String @id @default(uuid())
61
+
62
+ userId String
63
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
64
+
65
+ boardId String
66
+ board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
67
+
68
+ totalSessions Int @default(0)
69
+ totalActiveSeconds Int @default(0)
70
+ lastActivityAt DateTime @default(now())
71
+
72
+ createdAt DateTime @default(now())
73
+ updatedAt DateTime @updatedAt
74
+
75
+ @@unique([userId, boardId])
76
+ @@index([boardId])
77
+ @@index([lastActivityAt])
78
+ }
79
+
80
+ model File {
81
+ dbId String @id @default(uuid())
82
+ fileId String @unique
83
+
84
+ mimeType String
85
+ createdAt DateTime
86
+ sizeBytes Int
87
+
88
+ boardId String
89
+ board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
90
+
91
+ @@index([boardId])
92
+ }
93
+
94
+ model Event {
95
+ dbId String @id @default(uuid())
96
+ eventId String @unique
97
+
98
+ title String
99
+ start DateTime
100
+ end DateTime
101
+ color String @default("#9676ca")
102
+
103
+ where String?
104
+ description String?
105
+
106
+ createdAt DateTime @default(now())
107
+ updatedAt DateTime @updatedAt
108
+
109
+ groupId String
110
+ group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
111
+
112
+ createdBy String
113
+ creator User @relation(fields: [createdBy], references: [userId], onDelete: Cascade)
114
+
115
+ @@index([createdBy])
116
+ @@index([groupId])
117
+ @@index([start])
118
+ @@index([end])
119
+ }
120
+
121
+ model FlashcardDeck {
122
+ dbId String @id @default(uuid())
123
+ deckId String @unique
124
+
125
+ createdAt DateTime @default(now())
126
+ updatedAt DateTime @updatedAt
127
+
128
+ boardId String @unique
129
+ board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
130
+
131
+ cards FlashcardCard[]
132
+ progress DeckProgress[]
133
+
134
+ @@index([boardId])
135
+ }
136
+
137
+ model FlashcardCard {
138
+ dbId String @id @default(uuid())
139
+ cardId String @unique
140
+
141
+ front String
142
+ back String
143
+ index Int
144
+
145
+ createdAt DateTime @default(now())
146
+ updatedAt DateTime @updatedAt
147
+
148
+ deckId String
149
+ deck FlashcardDeck @relation(fields: [deckId], references: [deckId], onDelete: Cascade)
150
+
151
+ @@index([deckId])
152
+ }
153
+
154
+ model DeckProgress {
155
+ dbId String @id @default(uuid())
156
+
157
+ deckId String
158
+ userId String
159
+
160
+ currentIndex Int @default(0)
161
+ completed Boolean @default(false)
162
+ lastStudied DateTime @default(now())
163
+
164
+ deck FlashcardDeck @relation(fields: [deckId], references: [deckId], onDelete: Cascade)
165
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
166
+
167
+ @@unique([deckId, userId])
168
+ @@index([userId])
169
+ }
170
+
171
+ model GroupPermission {
172
+ dbId String @id @default(uuid())
173
+
174
+ groupId String
175
+ userId String
176
+ role GroupRole
177
+
178
+ grantedAt DateTime @default(now())
179
+ grantedBy String
180
+
181
+ group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
182
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
183
+
184
+ @@unique([groupId, userId])
185
+ }
186
+
187
+ model CategoryPermission {
188
+ dbId String @id @default(uuid())
189
+
190
+ categoryId String
191
+ userId String
192
+ role CategoryRole
193
+
194
+ grantedAt DateTime @default(now())
195
+ grantedBy String
196
+
197
+ category Category @relation(fields: [categoryId], references: [categoryId], onDelete: Cascade)
198
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
199
+
200
+ @@unique([categoryId, userId])
201
+ }
202
+
203
+ model BoardPermission {
204
+ dbId String @id @default(uuid())
205
+
206
+ boardId String
207
+ userId String
208
+ role BoardRole
209
+
210
+ grantedAt DateTime @default(now())
211
+ grantedBy String
212
+
213
+ board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
214
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
215
+
216
+ @@unique([boardId, userId])
217
+ }
218
+
219
+ model Invite {
220
+ dbId String @id @default(uuid())
221
+
222
+ code String @unique
223
+
224
+ // Allow invites to multiple groups, categories, or boards.
225
+ // If multiple are specified, the invite grants access to all of them.
226
+ groupIds String[]
227
+ groupRole GroupRole?
228
+
229
+ categoryIds String[]
230
+ categoryRole CategoryRole?
231
+
232
+ boardIds String[]
233
+ boardRole BoardRole?
234
+
235
+ createdBy String
236
+ createdAt DateTime @default(now())
237
+ expiresAt DateTime
238
+
239
+ maxUses Int @default(1)
240
+ currentUses Int @default(0)
241
+
242
+ creator User @relation(fields: [createdBy], references: [userId])
243
+ }
244
+
245
+ model PersonalWorkspace {
246
+ dbId String @id @default(uuid())
247
+ userId String @unique
248
+ groupId String @unique
249
+
250
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
251
+ group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
252
+ categories PersonalCategory[]
253
+ boards PersonalBoard[]
254
+
255
+ createdAt DateTime @default(now())
256
+ updatedAt DateTime @updatedAt
257
+ }
258
+
259
+ model PersonalCategory {
260
+ dbId String @id @default(uuid())
261
+ categoryId String @unique
262
+ workspaceId String
263
+ backingCategoryId String @unique
264
+ name String
265
+ index Int
266
+
267
+ workspace PersonalWorkspace @relation(fields: [workspaceId], references: [dbId], onDelete: Cascade)
268
+ backingCategory Category @relation(fields: [backingCategoryId], references: [categoryId], onDelete: Cascade)
269
+ boards PersonalBoard[]
270
+
271
+ @@index([workspaceId, index])
272
+ }
273
+
274
+ model PersonalBoard {
275
+ dbId String @id @default(uuid())
276
+ boardId String @unique
277
+ workspaceId String
278
+ categoryId String?
279
+
280
+ board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
281
+ workspace PersonalWorkspace @relation(fields: [workspaceId], references: [dbId], onDelete: Cascade)
282
+ category PersonalCategory? @relation(fields: [categoryId], references: [dbId], onDelete: SetNull)
283
+
284
+ @@index([workspaceId])
285
+ @@index([categoryId])
286
+ }
287
+
288
+ generator client {
289
+ provider = "prisma-client-js"
290
+ output = "../generated"
291
+ }
292
+
293
+ datasource db {
294
+ provider = "postgresql"
295
+ url = env("DATABASE_URL")
296
+ }
297
+
298
+ enum Platforms {
299
+ Microsoft
300
+ Discord
301
+ Google
302
+ GitHub
303
+ }
304
+
305
+ enum Device {
306
+ Desktop
307
+ Mobile
308
+ Tablet
309
+ Other
310
+ }
311
+
312
+ enum BoardType {
313
+ Excalidraw
314
+ Tldraw
315
+ }
316
+
317
+ // Separate role enums for each resource type
318
+ enum BoardRole {
319
+ BoardViewer // read-only to specific board
320
+ BoardCollaborator // BoardViewer + write to specific board
321
+ }
322
+
323
+ enum CategoryRole {
324
+ CategoryViewer // read-only to all boards in category
325
+ CategoryCollaborator // CategoryViewer + write to all boards in category
326
+ CategoryManager // CategoryCollaborator + create/delete boards in category
327
+ CategoryAdmin // CategoryManager + user/invite management
328
+ }
329
+
330
+ enum GroupRole {
331
+ GroupViewer // read-only to all categories and boards in group
332
+ GroupCollaborator // GroupViewer + write to all categories and boards in group
333
+ GroupManager // GroupCollaborator + create/delete categories and boards in group
334
+ GroupAdmin // GroupManager + user/invite management
335
+ }
336
+
337
+ enum RegistrationMethod {
338
+ direct
339
+ invite
340
+ oauth
341
+ }
342
+
343
+ model AllEnumsModel {
344
+ dbId String @id @default(uuid())
345
+
346
+ platformEnum Platforms
347
+ deviceEnum Device
348
+ boardTypeEnum BoardType
349
+
350
+ boardRoleEnum BoardRole
351
+ categoryRoleEnum CategoryRole
352
+ groupRoleEnum GroupRole
353
+
354
+ registrationMethodEnum RegistrationMethod
355
+ }
356
+
357
+ model User {
358
+ dbId String @id @default(uuid())
359
+ userId String @unique
360
+ email String @unique
361
+
362
+ avatarUrl String?
363
+ displayName String
364
+
365
+ mainGroupId String?
366
+
367
+ mainLoginType Platforms
368
+ loginMethods LoginMethod[]
369
+
370
+ invitedBy String?
371
+ registrationMethod RegistrationMethod @default(direct)
372
+
373
+ groupPermissions GroupPermission[]
374
+ categoryPermissions CategoryPermission[]
375
+ boardPermissions BoardPermission[]
376
+
377
+ flashcardProgress DeckProgress[]
378
+
379
+ sessions Session[]
380
+ createdEvents Event[]
381
+ createdInvites Invite[]
382
+ boardActivities UserBoardActivity[]
383
+ personalWorkspace PersonalWorkspace?
384
+ }
385
+
386
+ model Session {
387
+ dbId String @id @default(uuid())
388
+
389
+ token String @unique
390
+
391
+ device Device?
392
+ locationEncrypted String?
393
+
394
+ userId String
395
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
396
+
397
+ createdAt DateTime @default(now())
398
+ expiresAt DateTime
399
+ lastUsed DateTime @default(now())
400
+
401
+ @@index([userId])
402
+ @@index([expiresAt])
403
+ }
404
+
405
+ model LoginMethod {
406
+ dbId String @id @default(uuid())
407
+
408
+ platform Platforms
409
+ platformEmail String
410
+
411
+ userId String
412
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
413
+
414
+ @@unique([platform, platformEmail])
415
+ }
@@ -0,0 +1,4 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ export default import('./query_engine_bg.wasm?module')
@@ -0,0 +1,4 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ export default import('./query_engine_bg.wasm')
@@ -0,0 +1 @@
1
+ export * from "./default"