@excali-boards/boards-api-client 1.1.65 → 1.1.67

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.
@@ -2,13 +2,17 @@ import { AccessLevel, AllRooms, NameInput, SingleOutput } from '../external/type
2
2
  import { BoardsManager } from '../core/manager.js';
3
3
  import { BoardType } from '../external/types.js';
4
4
  import { WithHeaders } from '../types.js';
5
+ import type { PersonalFunctionsInput } from './personal.js';
5
6
  export declare class APIBoards {
6
7
  private web;
7
8
  constructor(web: BoardsManager);
8
9
  getBoards({ auth, categoryId, groupId, ...rest }: BoardsFunctionsInput['getBoards']): Promise<import("../types.js").WebResponse<GetBoardOutput[]>>;
9
- getPersonalBoards({ auth, ...rest }: BoardsFunctionsInput['getPersonalBoards']): Promise<import("../types.js").WebResponse<PersonalBoardsAdminOutput | PersonalBoardsOutput | null>>;
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>>;
10
+ /** @deprecated Use manager.personal for personal-board endpoints. */
11
+ getPersonalBoards(input: PersonalFunctionsInput['getPersonalBoards']): Promise<import("../types.js").WebResponse<import("./personal.js").PersonalBoardsAdminOutput | import("./personal.js").PersonalBoardsOutput | null>>;
12
+ /** @deprecated Use manager.personal for personal-board endpoints. */
13
+ createPersonalBoard(input: PersonalFunctionsInput['createPersonalBoard']): Promise<import("../types.js").WebResponse<import("./personal.js").CreatePersonalBoardOutput>>;
14
+ /** @deprecated Use manager.personal for personal-board endpoints. */
15
+ createPersonalCategory(input: PersonalFunctionsInput['createPersonalCategory']): Promise<import("../types.js").WebResponse<import("./personal.js").CreatePersonalCategoryOutput>>;
12
16
  getBoard({ auth, categoryId, groupId, boardId, ...rest }: BoardsFunctionsInput['getBoard']): Promise<import("../types.js").WebResponse<GetBoardOutput>>;
13
17
  updateBoard({ auth, categoryId, groupId, boardId, body, ...rest }: BoardsFunctionsInput['updateBoard']): Promise<import("../types.js").WebResponse<string>>;
14
18
  moveBoard({ auth, categoryId, groupId, boardId, body, ...rest }: BoardsFunctionsInput['moveBoard']): Promise<import("../types.js").WebResponse<MoveBoardOutput>>;
@@ -24,20 +28,6 @@ export type BoardsFunctionsInput = WithHeaders<{
24
28
  categoryId: string;
25
29
  groupId: string;
26
30
  };
27
- 'getPersonalBoards': {
28
- auth: string;
29
- };
30
- 'createPersonalBoard': {
31
- auth: string;
32
- body: NameInput & {
33
- type: BoardType;
34
- categoryId?: string;
35
- };
36
- };
37
- 'createPersonalCategory': {
38
- auth: string;
39
- body: NameInput;
40
- };
41
31
  'getBoard': {
42
32
  auth: string;
43
33
  categoryId: string;
@@ -104,45 +94,6 @@ export type GetBoardOutput = {
104
94
  };
105
95
  };
106
96
  export type GetFileOutput = ReadableStream | Blob;
107
- export type CreatePersonalBoardOutput = {
108
- groupId: string;
109
- categoryId: string;
110
- boardId: string;
111
- };
112
- export type CreatePersonalCategoryOutput = {
113
- categoryId: string;
114
- name: string;
115
- backingCategoryId: string;
116
- };
117
- export type PersonalBoardsOutput = {
118
- id: string;
119
- owner: PersonalBoardOwnerOutput;
120
- boards: PersonalBoardOutput[];
121
- categories: PersonalCategoryOutput[];
122
- };
123
- export type PersonalBoardsAdminOutput = {
124
- owners: PersonalBoardsOutput[];
125
- };
126
- export type PersonalBoardOwnerOutput = {
127
- userId: string;
128
- displayName: string;
129
- email: string;
130
- avatarUrl: string | null;
131
- };
132
- export type PersonalCategoryOutput = {
133
- id: string;
134
- name: string;
135
- boards: PersonalBoardOutput[];
136
- };
137
- export type PersonalBoardOutput = {
138
- id: string;
139
- categoryId: string;
140
- name: string;
141
- type: BoardType;
142
- index: number;
143
- totalSizeBytes: number;
144
- scheduledForDeletion: Date | null;
145
- };
146
97
  export type MoveBoardInput = {
147
98
  targetCategoryId: string;
148
99
  targetIndex?: number;
@@ -9,24 +9,12 @@ export class APIBoards {
9
9
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
10
10
  });
11
11
  }
12
- async getPersonalBoards({ auth, ...rest }) {
13
- return await this.web.request({
14
- method: 'GET', auth, ...rest,
15
- endpoint: this.web.qp('/personal'),
16
- });
17
- }
18
- async createPersonalBoard({ auth, body, ...rest }) {
19
- return await this.web.request({
20
- method: 'POST', auth, body, ...rest,
21
- endpoint: this.web.qp('/personal'),
22
- });
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
- }
12
+ /** @deprecated Use manager.personal for personal-board endpoints. */
13
+ getPersonalBoards(input) { return this.web.personal.getPersonalBoards(input); }
14
+ /** @deprecated Use manager.personal for personal-board endpoints. */
15
+ createPersonalBoard(input) { return this.web.personal.createPersonalBoard(input); }
16
+ /** @deprecated Use manager.personal for personal-board endpoints. */
17
+ createPersonalCategory(input) { return this.web.personal.createPersonalCategory(input); }
30
18
  async getBoard({ auth, categoryId, groupId, boardId, ...rest }) {
31
19
  return await this.web.request({
32
20
  method: 'GET', auth, ...rest,
@@ -0,0 +1,102 @@
1
+ import { BoardType, NameInput } from '../external/types.js';
2
+ import type { GetBoardOutput } from './boards.js';
3
+ import { BoardsManager } from '../core/manager.js';
4
+ import { WithHeaders } from '../types.js';
5
+ export declare class APIPersonal {
6
+ private web;
7
+ constructor(web: BoardsManager);
8
+ getPersonalBoards({ auth, ...rest }: PersonalFunctionsInput['getPersonalBoards']): Promise<import("../types.js").WebResponse<PersonalBoardsAdminOutput | PersonalBoardsOutput | null>>;
9
+ getAllPersonalBoards({ auth, ...rest }: PersonalFunctionsInput['getAllPersonalBoards']): Promise<import("../types.js").WebResponse<PersonalWorkspaceOutput[]>>;
10
+ getPersonalWorkspace({ auth, userId, ...rest }: PersonalFunctionsInput['getPersonalWorkspace']): Promise<import("../types.js").WebResponse<PersonalWorkspaceOutput>>;
11
+ getPersonalCategoryBoards({ auth, userId, categoryId, ...rest }: PersonalFunctionsInput['getPersonalCategoryBoards']): Promise<import("../types.js").WebResponse<PersonalBoardOutput[]>>;
12
+ createPersonalBoard({ auth, body, ...rest }: PersonalFunctionsInput['createPersonalBoard']): Promise<import("../types.js").WebResponse<CreatePersonalBoardOutput>>;
13
+ createPersonalBoardInCategory({ auth, userId, categoryId, body, ...rest }: PersonalFunctionsInput['createPersonalBoardInCategory']): Promise<import("../types.js").WebResponse<CreatePersonalBoardOutput>>;
14
+ createPersonalCategory({ auth, body, ...rest }: PersonalFunctionsInput['createPersonalCategory']): Promise<import("../types.js").WebResponse<CreatePersonalCategoryOutput>>;
15
+ getPersonalBoard({ auth, userId, categoryId, boardId, ...rest }: PersonalFunctionsInput['getPersonalBoard']): Promise<import("../types.js").WebResponse<GetBoardOutput>>;
16
+ }
17
+ export type PersonalFunctionsInput = WithHeaders<{
18
+ getPersonalBoards: {
19
+ auth: string;
20
+ };
21
+ getAllPersonalBoards: {
22
+ auth: string;
23
+ };
24
+ getPersonalWorkspace: {
25
+ auth: string;
26
+ userId: string;
27
+ };
28
+ getPersonalCategoryBoards: {
29
+ auth: string;
30
+ userId: string;
31
+ categoryId: string;
32
+ };
33
+ createPersonalBoard: {
34
+ auth: string;
35
+ body: NameInput & {
36
+ type: BoardType;
37
+ categoryId?: string;
38
+ };
39
+ };
40
+ createPersonalBoardInCategory: {
41
+ auth: string;
42
+ userId: string;
43
+ categoryId: string;
44
+ body: NameInput & {
45
+ type: BoardType;
46
+ };
47
+ };
48
+ createPersonalCategory: {
49
+ auth: string;
50
+ body: NameInput;
51
+ };
52
+ getPersonalBoard: {
53
+ auth: string;
54
+ userId: string;
55
+ categoryId: string;
56
+ boardId: string;
57
+ };
58
+ }>;
59
+ export type CreatePersonalBoardOutput = {
60
+ groupId: string;
61
+ categoryId: string;
62
+ boardId: string;
63
+ };
64
+ export type CreatePersonalCategoryOutput = {
65
+ categoryId: string;
66
+ name: string;
67
+ backingCategoryId: string;
68
+ };
69
+ export type PersonalBoardsOutput = {
70
+ id: string;
71
+ owner: PersonalBoardOwnerOutput;
72
+ boards: PersonalBoardOutput[];
73
+ categories: PersonalCategoryOutput[];
74
+ };
75
+ export type PersonalWorkspaceOutput = {
76
+ id: string;
77
+ owner: PersonalBoardOwnerOutput;
78
+ categories: PersonalCategoryOutput[];
79
+ };
80
+ export type PersonalBoardsAdminOutput = {
81
+ owners: PersonalBoardsOutput[];
82
+ };
83
+ export type PersonalBoardOwnerOutput = {
84
+ userId: string;
85
+ displayName: string;
86
+ email: string;
87
+ avatarUrl: string | null;
88
+ };
89
+ export type PersonalCategoryOutput = {
90
+ id: string;
91
+ name: string;
92
+ boards: PersonalBoardOutput[];
93
+ };
94
+ export type PersonalBoardOutput = {
95
+ id: string;
96
+ categoryId: string;
97
+ name: string;
98
+ type: BoardType;
99
+ index: number;
100
+ totalSizeBytes: number;
101
+ scheduledForDeletion: Date | null;
102
+ };
@@ -0,0 +1,30 @@
1
+ export class APIPersonal {
2
+ web;
3
+ constructor(web) {
4
+ this.web = web;
5
+ }
6
+ async getPersonalBoards({ auth, ...rest }) {
7
+ return await this.web.request({ method: 'GET', auth, ...rest, endpoint: this.web.qp('/personal') });
8
+ }
9
+ async getAllPersonalBoards({ auth, ...rest }) {
10
+ return await this.web.request({ method: 'GET', auth, ...rest, endpoint: this.web.qp('/all/personal') });
11
+ }
12
+ async getPersonalWorkspace({ auth, userId, ...rest }) {
13
+ return await this.web.request({ method: 'GET', auth, ...rest, endpoint: this.web.qp(`/personal/${userId}`) });
14
+ }
15
+ async getPersonalCategoryBoards({ auth, userId, categoryId, ...rest }) {
16
+ return await this.web.request({ method: 'GET', auth, ...rest, endpoint: this.web.qp(`/personal/${userId}/categories/${categoryId}/boards`) });
17
+ }
18
+ async createPersonalBoard({ auth, body, ...rest }) {
19
+ return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/personal') });
20
+ }
21
+ async createPersonalBoardInCategory({ auth, userId, categoryId, body, ...rest }) {
22
+ return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp(`/personal/${userId}/categories/${categoryId}/boards`) });
23
+ }
24
+ async createPersonalCategory({ auth, body, ...rest }) {
25
+ return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/personal/categories') });
26
+ }
27
+ async getPersonalBoard({ auth, userId, categoryId, boardId, ...rest }) {
28
+ return await this.web.request({ method: 'GET', auth, ...rest, endpoint: this.web.qp(`/personal/${userId}/categories/${categoryId}/boards/${boardId}`) });
29
+ }
30
+ }
@@ -29,6 +29,7 @@ export type UsersFunctionsInput = WithHeaders<{
29
29
  }>;
30
30
  export type GetUsersOutput = DBUserPartialType & {
31
31
  isDev: boolean;
32
+ personalBoardsEnabled: boolean;
32
33
  };
33
34
  export type UserInput = {
34
35
  mainGroupId?: string | null;
@@ -8,6 +8,7 @@ import { APIMetrics } from '../classes/metrics.js';
8
8
  import { APIInvites } from '../classes/invites.js';
9
9
  import { APIGroups } from '../classes/groups.js';
10
10
  import { APIBoards } from '../classes/boards.js';
11
+ import { APIPersonal } from '../classes/personal.js';
11
12
  import { APIUtils } from '../classes/utils.js';
12
13
  import { APIUsers } from '../classes/users.js';
13
14
  import { APIFiles } from '../classes/files.js';
@@ -26,6 +27,7 @@ export declare class BoardsManager {
26
27
  readonly metrics: APIMetrics;
27
28
  readonly groups: APIGroups;
28
29
  readonly boards: APIBoards;
30
+ readonly personal: APIPersonal;
29
31
  readonly admin: APIAdmin;
30
32
  readonly users: APIUsers;
31
33
  readonly utils: APIUtils;
@@ -8,6 +8,7 @@ import { APIMetrics } from '../classes/metrics.js';
8
8
  import { APIInvites } from '../classes/invites.js';
9
9
  import { APIGroups } from '../classes/groups.js';
10
10
  import { APIBoards } from '../classes/boards.js';
11
+ import { APIPersonal } from '../classes/personal.js';
11
12
  import { APIUtils } from '../classes/utils.js';
12
13
  import { APIUsers } from '../classes/users.js';
13
14
  import { APIFiles } from '../classes/files.js';
@@ -27,6 +28,7 @@ export class BoardsManager {
27
28
  metrics = new APIMetrics(this);
28
29
  groups = new APIGroups(this);
29
30
  boards = new APIBoards(this);
31
+ personal = new APIPersonal(this);
30
32
  admin = new APIAdmin(this);
31
33
  users = new APIUsers(this);
32
34
  utils = new APIUtils(this);
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from './classes/invites.js';
13
13
  export * from './classes/metrics.js';
14
14
  export * from './classes/groups.js';
15
15
  export * from './classes/boards.js';
16
+ export * from './classes/personal.js';
16
17
  export * from './classes/utils.js';
17
18
  export * from './classes/admin.js';
18
19
  export * from './classes/users.js';
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ export * from './classes/invites.js';
13
13
  export * from './classes/metrics.js';
14
14
  export * from './classes/groups.js';
15
15
  export * from './classes/boards.js';
16
+ export * from './classes/personal.js';
16
17
  export * from './classes/utils.js';
17
18
  export * from './classes/admin.js';
18
19
  export * from './classes/users.js';
package/package.json CHANGED
@@ -1,42 +1,43 @@
1
1
  {
2
- "version": "1.1.65",
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/generated",
14
- "prisma.config.ts",
15
- "README.md",
16
- "LICENSE"
17
- ],
18
- "devDependencies": {
19
- "@types/node": "20.14.13",
20
- "@typescript-eslint/eslint-plugin": "6.18.0",
21
- "@typescript-eslint/parser": "6.18.0",
22
- "eslint": "8.56.0",
23
- "typescript": "7.0.2"
24
- },
25
- "engines": {
26
- "node": ">=20.2.0"
27
- },
28
- "dependencies": {
29
- "@prisma/client": "6.16.2",
30
- "axios": "1.12.2",
31
- "prisma": "6.16.2",
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
- "updates": "pnpm npm-check-updates -i --format group"
41
- }
42
- }
2
+ "version": "1.1.67",
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
+ "postinstall": "prisma generate",
12
+ "watch": "tsc --watch",
13
+ "lint": "eslint . --ext .ts",
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/generated",
23
+ "prisma.config.ts",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "devDependencies": {
28
+ "@types/node": "20.14.13",
29
+ "@typescript-eslint/eslint-plugin": "6.18.0",
30
+ "@typescript-eslint/parser": "6.18.0",
31
+ "eslint": "8.56.0",
32
+ "typescript": "7.0.2"
33
+ },
34
+ "engines": {
35
+ "node": ">=20.2.0"
36
+ },
37
+ "dependencies": {
38
+ "@prisma/client": "6.16.2",
39
+ "axios": "1.12.2",
40
+ "prisma": "6.16.2",
41
+ "zod": "4.1.9"
42
+ }
43
+ }
@@ -31,11 +31,11 @@ model PersonalBoard {
31
31
  dbId String @id @default(uuid())
32
32
  boardId String @unique
33
33
  workspaceId String
34
- categoryId String?
34
+ categoryId String
35
35
 
36
36
  board Board @relation(fields: [boardId], references: [boardId], onDelete: Cascade)
37
37
  workspace PersonalWorkspace @relation(fields: [workspaceId], references: [dbId], onDelete: Cascade)
38
- category PersonalCategory? @relation(fields: [categoryId], references: [dbId], onDelete: SetNull)
38
+ category PersonalCategory @relation(fields: [categoryId], references: [dbId], onDelete: Cascade)
39
39
 
40
40
  @@index([workspaceId])
41
41
  @@index([categoryId])
package/prisma.config.ts CHANGED
File without changes