@excali-boards/boards-api-client 1.1.0 → 1.1.1-dev.0
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/package.json +2 -6
- package/prisma/schema/boards.prisma +56 -0
- package/prisma/schema/permissions.prisma +73 -0
- package/prisma/schema/schema.prisma +50 -0
- package/prisma/schema/user.prisma +31 -0
- package/prisma.config.ts +6 -0
- package/tsconfig.esm.json +9 -0
- package/prisma/generated/client.d.ts +0 -1
- package/prisma/generated/client.js +0 -4
- package/prisma/generated/default.d.ts +0 -2
- package/prisma/generated/default.js +0 -4
- package/prisma/generated/edge.d.ts +0 -1
- package/prisma/generated/edge.js +0 -323
- package/prisma/generated/index-browser.js +0 -68497
- package/prisma/generated/index.d.ts +0 -19470
- package/prisma/generated/index.js +0 -68531
- package/prisma/generated/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
- package/prisma/generated/package.json +0 -183
- package/prisma/generated/query_engine_bg.js +0 -2
- package/prisma/generated/query_engine_bg.wasm +0 -0
- package/prisma/generated/runtime/edge-esm.js +0 -34
- package/prisma/generated/runtime/edge.js +0 -34
- package/prisma/generated/runtime/index-browser.d.ts +0 -370
- package/prisma/generated/runtime/index-browser.js +0 -16
- package/prisma/generated/runtime/library.d.ts +0 -3976
- package/prisma/generated/runtime/library.js +0 -146
- package/prisma/generated/runtime/react-native.js +0 -83
- package/prisma/generated/runtime/wasm-compiler-edge.js +0 -84
- package/prisma/generated/runtime/wasm-engine-edge.js +0 -36
- package/prisma/generated/schema.prisma +0 -213
- package/prisma/generated/ts-prisma.d.ts +0 -68471
- package/prisma/generated/wasm-edge-light-loader.mjs +0 -4
- package/prisma/generated/wasm-worker-loader.mjs +0 -4
- package/prisma/generated/wasm.d.ts +0 -1
- package/prisma/generated/wasm.js +0 -330
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.0",
|
|
2
|
+
"version": "1.1.1-dev.0",
|
|
3
3
|
"name": "@excali-boards/boards-api-client",
|
|
4
4
|
"description": "A simple API client for the Boards API.",
|
|
5
5
|
"repository": "https://github.com/Excali-Boards/boards-api-client",
|
|
@@ -34,10 +34,6 @@
|
|
|
34
34
|
"types": "./prisma/generated/default.d.ts"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist",
|
|
39
|
-
"prisma/generated"
|
|
40
|
-
],
|
|
41
37
|
"pnpm": {
|
|
42
38
|
"onlyBuiltDependencies": [
|
|
43
39
|
"@prisma/client",
|
|
@@ -62,4 +58,4 @@
|
|
|
62
58
|
"ts-prisma": "1.3.3",
|
|
63
59
|
"zod": "4.1.9"
|
|
64
60
|
}
|
|
65
|
-
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
model Group {
|
|
2
|
+
dbId String @id @default(uuid())
|
|
3
|
+
groupId String @unique
|
|
4
|
+
|
|
5
|
+
name String
|
|
6
|
+
index Int
|
|
7
|
+
|
|
8
|
+
categories Category[]
|
|
9
|
+
permissions GroupPermission[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
model Category {
|
|
13
|
+
dbId String @id @default(uuid())
|
|
14
|
+
categoryId String @unique
|
|
15
|
+
|
|
16
|
+
name String
|
|
17
|
+
index Int
|
|
18
|
+
|
|
19
|
+
groupId String
|
|
20
|
+
group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
|
|
21
|
+
|
|
22
|
+
boards Board[]
|
|
23
|
+
permissions CategoryPermission[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model Board {
|
|
27
|
+
dbId String @id @default(uuid())
|
|
28
|
+
boardId String @unique
|
|
29
|
+
|
|
30
|
+
name String
|
|
31
|
+
index Int
|
|
32
|
+
|
|
33
|
+
version Int @default(0)
|
|
34
|
+
updatedAt DateTime @default(now())
|
|
35
|
+
|
|
36
|
+
scheduledForDeletion DateTime?
|
|
37
|
+
totalSizeBytes Int @default(0)
|
|
38
|
+
|
|
39
|
+
categoryId String
|
|
40
|
+
category Category @relation(fields: [categoryId], references: [categoryId], onDelete: Cascade)
|
|
41
|
+
|
|
42
|
+
files File[]
|
|
43
|
+
boardPermission BoardPermission[]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
model File {
|
|
47
|
+
dbId String @id @default(uuid())
|
|
48
|
+
fileId String @unique
|
|
49
|
+
|
|
50
|
+
mimeType String
|
|
51
|
+
createdAt DateTime
|
|
52
|
+
sizeBytes Int
|
|
53
|
+
|
|
54
|
+
boardId String
|
|
55
|
+
board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
|
|
56
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
model GroupPermission {
|
|
2
|
+
dbId String @id @default(uuid())
|
|
3
|
+
|
|
4
|
+
groupId String
|
|
5
|
+
userId String
|
|
6
|
+
role GroupRole
|
|
7
|
+
|
|
8
|
+
grantedAt DateTime @default(now())
|
|
9
|
+
grantedBy String
|
|
10
|
+
|
|
11
|
+
group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
|
|
12
|
+
user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
|
|
13
|
+
|
|
14
|
+
@@unique([groupId, userId])
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
model CategoryPermission {
|
|
18
|
+
dbId String @id @default(uuid())
|
|
19
|
+
|
|
20
|
+
categoryId String
|
|
21
|
+
userId String
|
|
22
|
+
role CategoryRole
|
|
23
|
+
|
|
24
|
+
grantedAt DateTime @default(now())
|
|
25
|
+
grantedBy String
|
|
26
|
+
|
|
27
|
+
category Category @relation(fields: [categoryId], references: [categoryId], onDelete: Cascade)
|
|
28
|
+
user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
|
|
29
|
+
|
|
30
|
+
@@unique([categoryId, userId])
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
model BoardPermission {
|
|
34
|
+
dbId String @id @default(uuid())
|
|
35
|
+
|
|
36
|
+
boardId String
|
|
37
|
+
userId String
|
|
38
|
+
role BoardRole
|
|
39
|
+
|
|
40
|
+
grantedAt DateTime @default(now())
|
|
41
|
+
grantedBy String
|
|
42
|
+
|
|
43
|
+
board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
|
|
44
|
+
user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
|
|
45
|
+
|
|
46
|
+
@@unique([boardId, userId])
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
model Invite {
|
|
50
|
+
dbId String @id @default(uuid())
|
|
51
|
+
|
|
52
|
+
code String @unique
|
|
53
|
+
|
|
54
|
+
// Allow invites to multiple groups, categories, or boards
|
|
55
|
+
// If multiple are specified, the invite grants access to all of them
|
|
56
|
+
groupIds String[]
|
|
57
|
+
groupRole GroupRole?
|
|
58
|
+
|
|
59
|
+
categoryIds String[]
|
|
60
|
+
categoryRole CategoryRole?
|
|
61
|
+
|
|
62
|
+
boardIds String[]
|
|
63
|
+
boardRole BoardRole?
|
|
64
|
+
|
|
65
|
+
createdBy String
|
|
66
|
+
createdAt DateTime @default(now())
|
|
67
|
+
expiresAt DateTime
|
|
68
|
+
|
|
69
|
+
maxUses Int @default(1)
|
|
70
|
+
currentUses Int @default(0)
|
|
71
|
+
|
|
72
|
+
creator User @relation(fields: [createdBy], references: [userId])
|
|
73
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
generator client {
|
|
2
|
+
provider = "prisma-client-js"
|
|
3
|
+
output = "../generated"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
datasource db {
|
|
7
|
+
provider = "postgresql"
|
|
8
|
+
url = env("DATABASE_URL")
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
generator tsPrisma {
|
|
12
|
+
provider = "ts-prisma-generator"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
enum Platforms {
|
|
16
|
+
Microsoft
|
|
17
|
+
Discord
|
|
18
|
+
Google
|
|
19
|
+
GitHub
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Separate role enums for each resource type
|
|
23
|
+
enum BoardRole {
|
|
24
|
+
BoardViewer // read-only to specific board
|
|
25
|
+
BoardCollaborator // read/write to specific board
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
enum CategoryRole {
|
|
29
|
+
CategoryViewer // read-only to all boards in category
|
|
30
|
+
CategoryCollaborator // read/write to all boards in category
|
|
31
|
+
CategoryManager // read/write/create/delete boards in category
|
|
32
|
+
CategoryAdmin // full category control + user management
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
enum GroupRole {
|
|
36
|
+
GroupViewer // read-only to all categories and boards in group
|
|
37
|
+
GroupCollaborator // read/write to all categories and boards in group
|
|
38
|
+
GroupManager // read/write/create/delete categories and boards in group
|
|
39
|
+
GroupAdmin // full group control + user management
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
model AllEnumsModel {
|
|
43
|
+
dbId String @id @default(uuid())
|
|
44
|
+
|
|
45
|
+
platformEnum Platforms
|
|
46
|
+
|
|
47
|
+
boardRoleEnum BoardRole
|
|
48
|
+
categoryRoleEnum CategoryRole
|
|
49
|
+
groupRoleEnum GroupRole
|
|
50
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
model User {
|
|
2
|
+
dbId String @id @default(uuid())
|
|
3
|
+
userId String @unique
|
|
4
|
+
email String @unique
|
|
5
|
+
|
|
6
|
+
avatarUrl String?
|
|
7
|
+
displayName String
|
|
8
|
+
|
|
9
|
+
mainGroupId String?
|
|
10
|
+
|
|
11
|
+
mainLoginType Platforms
|
|
12
|
+
loginMethods LoginMethod[]
|
|
13
|
+
|
|
14
|
+
groupPermissions GroupPermission[]
|
|
15
|
+
categoryPermissions CategoryPermission[]
|
|
16
|
+
boardPermissions BoardPermission[]
|
|
17
|
+
|
|
18
|
+
createdInvites Invite[]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
model LoginMethod {
|
|
22
|
+
dbId String @id @default(uuid())
|
|
23
|
+
|
|
24
|
+
platform Platforms
|
|
25
|
+
platformEmail String
|
|
26
|
+
|
|
27
|
+
userId String
|
|
28
|
+
user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
|
|
29
|
+
|
|
30
|
+
@@unique([platform, platformEmail])
|
|
31
|
+
}
|
package/prisma.config.ts
ADDED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./index"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./default"
|