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

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.
@@ -6,8 +6,9 @@ export declare class APIBoards {
6
6
  private web;
7
7
  constructor(web: BoardsManager);
8
8
  getBoards({ auth, categoryId, groupId, ...rest }: BoardsFunctionsInput['getBoards']): Promise<import("../types.js").WebResponse<GetBoardOutput[]>>;
9
- getPersonalBoards({ auth, ...rest }: BoardsFunctionsInput['getPersonalBoards']): Promise<import("../types.js").WebResponse<PersonalBoardsOutput | null>>;
9
+ getPersonalBoards({ auth, ...rest }: BoardsFunctionsInput['getPersonalBoards']): Promise<import("../types.js").WebResponse<PersonalBoardsAdminOutput | PersonalBoardsOutput | null>>;
10
10
  createPersonalBoard({ auth, body, ...rest }: BoardsFunctionsInput['createPersonalBoard']): Promise<import("../types.js").WebResponse<CreatePersonalBoardOutput>>;
11
+ createPersonalCategory({ auth, body, ...rest }: BoardsFunctionsInput['createPersonalCategory']): Promise<import("../types.js").WebResponse<CreatePersonalCategoryOutput>>;
11
12
  getBoard({ auth, categoryId, groupId, boardId, ...rest }: BoardsFunctionsInput['getBoard']): Promise<import("../types.js").WebResponse<GetBoardOutput>>;
12
13
  updateBoard({ auth, categoryId, groupId, boardId, body, ...rest }: BoardsFunctionsInput['updateBoard']): Promise<import("../types.js").WebResponse<string>>;
13
14
  moveBoard({ auth, categoryId, groupId, boardId, body, ...rest }: BoardsFunctionsInput['moveBoard']): Promise<import("../types.js").WebResponse<MoveBoardOutput>>;
@@ -33,6 +34,10 @@ export type BoardsFunctionsInput = WithHeaders<{
33
34
  categoryId?: string;
34
35
  };
35
36
  };
37
+ 'createPersonalCategory': {
38
+ auth: string;
39
+ body: NameInput;
40
+ };
36
41
  'getBoard': {
37
42
  auth: string;
38
43
  categoryId: string;
@@ -104,13 +109,30 @@ export type CreatePersonalBoardOutput = {
104
109
  categoryId: string;
105
110
  boardId: string;
106
111
  };
112
+ export type CreatePersonalCategoryOutput = {
113
+ categoryId: string;
114
+ name: string;
115
+ backingCategoryId: string;
116
+ };
107
117
  export type PersonalBoardsOutput = {
108
118
  id: string;
109
119
  name: string;
120
+ rootCategoryId: string | null;
121
+ owner: PersonalBoardOwnerOutput | null;
122
+ boards: PersonalBoardOutput[];
110
123
  categories: PersonalCategoryOutput[];
111
124
  };
125
+ export type PersonalBoardsAdminOutput = {
126
+ owners: PersonalBoardsOutput[];
127
+ };
128
+ export type PersonalBoardOwnerOutput = {
129
+ userId: string;
130
+ displayName: string;
131
+ avatarUrl: string | null;
132
+ };
112
133
  export type PersonalCategoryOutput = {
113
134
  id: string;
135
+ personalCategoryId?: string;
114
136
  name: string;
115
137
  boards: PersonalBoardOutput[];
116
138
  };
@@ -21,6 +21,12 @@ export class APIBoards {
21
21
  endpoint: this.web.qp('/personal'),
22
22
  });
23
23
  }
24
+ async createPersonalCategory({ auth, body, ...rest }) {
25
+ return await this.web.request({
26
+ method: 'POST', auth, body, ...rest,
27
+ endpoint: this.web.qp('/personal/categories'),
28
+ });
29
+ }
24
30
  async getBoard({ auth, categoryId, groupId, boardId, ...rest }) {
25
31
  return await this.web.request({
26
32
  method: 'GET', auth, ...rest,
@@ -70,6 +70,7 @@ export type GetGroupOutput = {
70
70
  })[];
71
71
  };
72
72
  export type GetAllSortedOutput = (SingleOutput & {
73
+ isPersonal: boolean;
73
74
  categories: (SingleOutput & {
74
75
  boards: (SingleOutput & {
75
76
  hasFlashcards: boolean;
package/package.json CHANGED
@@ -1,43 +1,42 @@
1
1
  {
2
- "version": "1.1.57",
3
- "name": "@excali-boards/boards-api-client",
4
- "description": "A simple API client for the Boards API.",
5
- "repository": "https://github.com/Excali-Boards/boards-api-client",
6
- "author": "Digital39999",
7
- "main": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "license": "GPL-3.0",
10
- "files": [
11
- "dist",
12
- "prisma/schema",
13
- "prisma.config.ts",
14
- "README.md",
15
- "LICENSE"
16
- ],
17
- "devDependencies": {
18
- "@types/node": "20.14.13",
19
- "@typescript-eslint/eslint-plugin": "6.18.0",
20
- "@typescript-eslint/parser": "6.18.0",
21
- "eslint": "8.56.0",
22
- "typescript": "7.0.2"
23
- },
24
- "engines": {
25
- "node": ">=20.2.0"
26
- },
27
- "dependencies": {
28
- "@prisma/client": "6.16.2",
29
- "axios": "1.12.2",
30
- "prisma": "6.16.2",
31
- "ts-prisma": "1.3.3",
32
- "zod": "4.1.9"
33
- },
34
- "scripts": {
35
- "ts": "pnpm install typescript --save-dev -g",
36
- "init": "pnpm install && pnpm run build",
37
- "build": "tsc --build",
38
- "watch": "tsc --watch",
39
- "lint": "eslint . --ext .ts",
40
- "postinstall": "prisma generate",
41
- "updates": "pnpm npm-check-updates -i --format group"
42
- }
43
- }
2
+ "version": "1.1.59",
3
+ "name": "@excali-boards/boards-api-client",
4
+ "description": "A simple API client for the Boards API.",
5
+ "repository": "https://github.com/Excali-Boards/boards-api-client",
6
+ "author": "Digital39999",
7
+ "scripts": {
8
+ "ts": "pnpm install typescript --save-dev -g",
9
+ "init": "pnpm install && pnpm run build",
10
+ "build": "tsc --build",
11
+ "watch": "tsc --watch",
12
+ "lint": "eslint . --ext .ts",
13
+ "postinstall": "prisma generate",
14
+ "updates": "pnpm npm-check-updates -i --format group"
15
+ },
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "license": "GPL-3.0",
19
+ "files": [
20
+ "dist",
21
+ "prisma/schema",
22
+ "prisma.config.ts",
23
+ "README.md",
24
+ "LICENSE"
25
+ ],
26
+ "devDependencies": {
27
+ "@types/node": "20.14.13",
28
+ "@typescript-eslint/eslint-plugin": "6.18.0",
29
+ "@typescript-eslint/parser": "6.18.0",
30
+ "eslint": "8.56.0",
31
+ "typescript": "7.0.2"
32
+ },
33
+ "engines": {
34
+ "node": ">=20.2.0"
35
+ },
36
+ "dependencies": {
37
+ "@prisma/client": "6.16.2",
38
+ "axios": "1.12.2",
39
+ "prisma": "6.16.2",
40
+ "zod": "4.1.9"
41
+ }
42
+ }
@@ -2,32 +2,32 @@ model Group {
2
2
  dbId String @id @default(uuid())
3
3
  groupId String @unique
4
4
 
5
- name String
6
- index Int
7
-
8
- personalOwnerId String?
5
+ name String
6
+ index Int
9
7
 
10
8
  calCode String?
11
9
  events Event[]
12
10
 
13
11
  categories Category[]
14
- permissions GroupPermission[]
12
+ permissions GroupPermission[]
13
+ personalWorkspace PersonalWorkspace?
15
14
 
16
- @@index([personalOwnerId])
17
15
  }
18
16
 
19
17
  model Category {
20
18
  dbId String @id @default(uuid())
21
19
  categoryId String @unique
22
20
 
23
- name String
24
- index Int
21
+ name String
22
+ index Int
25
23
 
26
24
  groupId String
27
25
  group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
28
26
 
29
27
  boards Board[]
30
- permissions CategoryPermission[]
28
+ permissions CategoryPermission[]
29
+ personalCategory PersonalCategory?
30
+
31
31
  }
32
32
 
33
33
  model Board {
@@ -48,6 +48,7 @@ model Board {
48
48
  category Category @relation(fields: [categoryId], references: [categoryId], onDelete: Cascade)
49
49
 
50
50
  flashcardDeck FlashcardDeck?
51
+ personalBoard PersonalBoard?
51
52
 
52
53
  files File[]
53
54
  boardPermission BoardPermission[]
@@ -0,0 +1,42 @@
1
+ model PersonalWorkspace {
2
+ dbId String @id @default(uuid())
3
+ userId String @unique
4
+ groupId String @unique
5
+
6
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
7
+ group Group @relation(fields: [groupId], references: [groupId], onDelete: Cascade)
8
+ categories PersonalCategory[]
9
+ boards PersonalBoard[]
10
+
11
+ createdAt DateTime @default(now())
12
+ updatedAt DateTime @updatedAt
13
+ }
14
+
15
+ model PersonalCategory {
16
+ dbId String @id @default(uuid())
17
+ categoryId String @unique
18
+ workspaceId String
19
+ backingCategoryId String @unique
20
+ name String
21
+ index Int
22
+
23
+ workspace PersonalWorkspace @relation(fields: [workspaceId], references: [dbId], onDelete: Cascade)
24
+ backingCategory Category @relation(fields: [backingCategoryId], references: [categoryId], onDelete: Cascade)
25
+ boards PersonalBoard[]
26
+
27
+ @@index([workspaceId, index])
28
+ }
29
+
30
+ model PersonalBoard {
31
+ dbId String @id @default(uuid())
32
+ boardId String @unique
33
+ workspaceId String
34
+ categoryId String?
35
+
36
+ board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
37
+ workspace PersonalWorkspace @relation(fields: [workspaceId], references: [dbId], onDelete: Cascade)
38
+ category PersonalCategory? @relation(fields: [categoryId], references: [dbId], onDelete: SetNull)
39
+
40
+ @@index([workspaceId])
41
+ @@index([categoryId])
42
+ }
@@ -8,10 +8,6 @@ datasource db {
8
8
  url = env("DATABASE_URL")
9
9
  }
10
10
 
11
- generator tsPrisma {
12
- provider = "ts-prisma-generator"
13
- }
14
-
15
11
  enum Platforms {
16
12
  Microsoft
17
13
  Discord
@@ -24,6 +24,7 @@ model User {
24
24
  createdEvents Event[]
25
25
  createdInvites Invite[]
26
26
  boardActivities UserBoardActivity[]
27
+ personalWorkspace PersonalWorkspace?
27
28
  }
28
29
 
29
30
  model Session {
package/prisma.config.ts CHANGED
File without changes