@excali-boards/boards-api-client 1.1.45 → 1.1.47

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.
@@ -1,14 +1,14 @@
1
+ import { Paginated, WithHeaders } from '../types';
1
2
  import { BoardsManager } from '../core/manager';
2
3
  import { AllRooms } from '../external/types';
3
4
  import { GetUsersOutput } from './users';
4
- import { Paginated } from '../types';
5
5
  export declare class APIAdmin {
6
6
  private web;
7
7
  constructor(web: BoardsManager);
8
- getUsers({ auth, page, limit }: AdminFunctionsInput['getUsers']): Promise<import("../types").WebResponse<Paginated<GetUsersOutput>>>;
9
- getActiveRooms({ auth }: AdminFunctionsInput['getActiveRooms']): Promise<import("../types").WebResponse<AllRooms>>;
8
+ getUsers({ auth, page, limit, ...rest }: AdminFunctionsInput['getUsers']): Promise<import("../types").WebResponse<Paginated<GetUsersOutput>>>;
9
+ getActiveRooms({ auth, ...rest }: AdminFunctionsInput['getActiveRooms']): Promise<import("../types").WebResponse<AllRooms>>;
10
10
  }
11
- export type AdminFunctionsInput = {
11
+ export type AdminFunctionsInput = WithHeaders<{
12
12
  'getUsers': {
13
13
  auth: string;
14
14
  page?: number;
@@ -17,4 +17,4 @@ export type AdminFunctionsInput = {
17
17
  'getActiveRooms': {
18
18
  auth: string;
19
19
  };
20
- };
20
+ }>;
@@ -8,15 +8,15 @@ class APIAdmin {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getUsers({ auth, page, limit }) {
11
+ async getUsers({ auth, page, limit, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp('/admin/users', { page, limit }),
15
15
  });
16
16
  }
17
- async getActiveRooms({ auth }) {
17
+ async getActiveRooms({ auth, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'GET', auth,
19
+ method: 'GET', auth, ...rest,
20
20
  endpoint: this.web.qp('/admin/rooms'),
21
21
  });
22
22
  }
@@ -1,13 +1,18 @@
1
1
  import { BoardsManager } from '../core/manager';
2
+ import { WithHeaders } from '../types';
2
3
  export declare class APIAnalytics {
3
4
  private web;
4
5
  constructor(web: BoardsManager);
5
- getUserAnalytics({ auth }: AnalyticsFunctionsInput['getUserAnalytics']): Promise<import("..").WebResponse<UserBoardActivityWithBoard[]>>;
6
- getBoardAnalytics({ auth, boardId, categoryId, groupId }: AnalyticsFunctionsInput['getBoardAnalytics']): Promise<import("..").WebResponse<UserBoardActivityWithUser[]>>;
7
- getCategoryAnalytics({ auth, categoryId, groupId }: AnalyticsFunctionsInput['getCategoryAnalytics']): Promise<import("..").WebResponse<UserBoardActivityWithUser[]>>;
8
- getGroupAnalytics({ auth, groupId }: AnalyticsFunctionsInput['getGroupAnalytics']): Promise<import("..").WebResponse<UserBoardActivityWithUser[]>>;
6
+ getGlobalAnalytics({ auth, ...rest }: AnalyticsFunctionsInput['getGlobalAnalytics']): Promise<import("../types").WebResponse<UserBoardActivityWithUser[]>>;
7
+ getUserAnalytics({ auth, ...rest }: AnalyticsFunctionsInput['getUserAnalytics']): Promise<import("../types").WebResponse<UserBoardActivityWithBoard[]>>;
8
+ getBoardAnalytics({ auth, boardId, categoryId, groupId, ...rest }: AnalyticsFunctionsInput['getBoardAnalytics']): Promise<import("../types").WebResponse<UserBoardActivityWithUser[]>>;
9
+ getCategoryAnalytics({ auth, categoryId, groupId, ...rest }: AnalyticsFunctionsInput['getCategoryAnalytics']): Promise<import("../types").WebResponse<UserBoardActivityWithUser[]>>;
10
+ getGroupAnalytics({ auth, groupId, ...rest }: AnalyticsFunctionsInput['getGroupAnalytics']): Promise<import("../types").WebResponse<UserBoardActivityWithUser[]>>;
9
11
  }
10
- export type AnalyticsFunctionsInput = {
12
+ export type AnalyticsFunctionsInput = WithHeaders<{
13
+ 'getGlobalAnalytics': {
14
+ auth: string;
15
+ };
11
16
  'getUserAnalytics': {
12
17
  auth: string;
13
18
  };
@@ -26,7 +31,7 @@ export type AnalyticsFunctionsInput = {
26
31
  auth: string;
27
32
  groupId: string;
28
33
  };
29
- };
34
+ }>;
30
35
  export type ActivityAnalytics = {
31
36
  totalSessions: number;
32
37
  totalActiveSeconds: number;
@@ -8,27 +8,33 @@ class APIAnalytics {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getUserAnalytics({ auth }) {
11
+ async getGlobalAnalytics({ auth, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
+ endpoint: this.web.qp('/analytics'),
15
+ });
16
+ }
17
+ async getUserAnalytics({ auth, ...rest }) {
18
+ return await this.web.request({
19
+ method: 'GET', auth, ...rest,
14
20
  endpoint: this.web.qp('/analytics/user'),
15
21
  });
16
22
  }
17
- async getBoardAnalytics({ auth, boardId, categoryId, groupId }) {
23
+ async getBoardAnalytics({ auth, boardId, categoryId, groupId, ...rest }) {
18
24
  return await this.web.request({
19
- method: 'GET', auth,
25
+ method: 'GET', auth, ...rest,
20
26
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/analytics`),
21
27
  });
22
28
  }
23
- async getCategoryAnalytics({ auth, categoryId, groupId }) {
29
+ async getCategoryAnalytics({ auth, categoryId, groupId, ...rest }) {
24
30
  return await this.web.request({
25
- method: 'GET', auth,
31
+ method: 'GET', auth, ...rest,
26
32
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/analytics`),
27
33
  });
28
34
  }
29
- async getGroupAnalytics({ auth, groupId }) {
35
+ async getGroupAnalytics({ auth, groupId, ...rest }) {
30
36
  return await this.web.request({
31
- method: 'GET', auth,
37
+ method: 'GET', auth, ...rest,
32
38
  endpoint: this.web.qp(`/groups/${groupId}/analytics`),
33
39
  });
34
40
  }
@@ -1,19 +1,20 @@
1
1
  import { AccessLevel, AllRooms, NameInput, SingleOutput } from '../external/types';
2
2
  import { BoardType } from '../../prisma/generated/default';
3
3
  import { BoardsManager } from '../core/manager';
4
+ import { WithHeaders } from '../types';
4
5
  export declare class APIBoards {
5
6
  private web;
6
7
  constructor(web: BoardsManager);
7
- getBoards({ auth, categoryId, groupId }: BoardsFunctionsInput['getBoards']): Promise<import("..").WebResponse<GetBoardOutput[]>>;
8
- getBoard({ auth, categoryId, groupId, boardId }: BoardsFunctionsInput['getBoard']): Promise<import("..").WebResponse<GetBoardOutput>>;
9
- updateBoard({ auth, categoryId, groupId, boardId, body }: BoardsFunctionsInput['updateBoard']): Promise<import("..").WebResponse<string>>;
10
- scheduleBoardDeletion({ auth, categoryId, groupId, boardId }: BoardsFunctionsInput['scheduleBoardDeletion']): Promise<import("..").WebResponse<string>>;
11
- forceDeleteBoard({ auth, categoryId, groupId, boardId }: BoardsFunctionsInput['scheduleBoardDeletion']): Promise<import("..").WebResponse<string>>;
12
- cancelBoardDeletion({ auth, categoryId, groupId, boardId }: BoardsFunctionsInput['cancelBoardDeletion']): Promise<import("..").WebResponse<string>>;
13
- getBoardRoomData({ auth, categoryId, groupId, boardId }: BoardsFunctionsInput['getRoomData']): Promise<import("..").WebResponse<AllRooms>>;
14
- kickUserFromRoom({ auth, categoryId, groupId, boardId, userId }: BoardsFunctionsInput['kickUserFromRoom']): Promise<import("..").WebResponse<string>>;
8
+ getBoards({ auth, categoryId, groupId, ...rest }: BoardsFunctionsInput['getBoards']): Promise<import("../types").WebResponse<GetBoardOutput[]>>;
9
+ getBoard({ auth, categoryId, groupId, boardId, ...rest }: BoardsFunctionsInput['getBoard']): Promise<import("../types").WebResponse<GetBoardOutput>>;
10
+ updateBoard({ auth, categoryId, groupId, boardId, body, ...rest }: BoardsFunctionsInput['updateBoard']): Promise<import("../types").WebResponse<string>>;
11
+ scheduleBoardDeletion({ auth, categoryId, groupId, boardId, ...rest }: BoardsFunctionsInput['scheduleBoardDeletion']): Promise<import("../types").WebResponse<string>>;
12
+ forceDeleteBoard({ auth, categoryId, groupId, boardId, ...rest }: BoardsFunctionsInput['scheduleBoardDeletion']): Promise<import("../types").WebResponse<string>>;
13
+ cancelBoardDeletion({ auth, categoryId, groupId, boardId, ...rest }: BoardsFunctionsInput['cancelBoardDeletion']): Promise<import("../types").WebResponse<string>>;
14
+ getBoardRoomData({ auth, categoryId, groupId, boardId, ...rest }: BoardsFunctionsInput['getRoomData']): Promise<import("../types").WebResponse<AllRooms>>;
15
+ kickUserFromRoom({ auth, categoryId, groupId, boardId, userId, ...rest }: BoardsFunctionsInput['kickUserFromRoom']): Promise<import("../types").WebResponse<string>>;
15
16
  }
16
- export type BoardsFunctionsInput = {
17
+ export type BoardsFunctionsInput = WithHeaders<{
17
18
  'getBoards': {
18
19
  auth: string;
19
20
  categoryId: string;
@@ -57,7 +58,7 @@ export type BoardsFunctionsInput = {
57
58
  boardId: string;
58
59
  userId: string;
59
60
  };
60
- };
61
+ }>;
61
62
  export type GetBoardOutput = {
62
63
  group: SingleOutput;
63
64
  category: SingleOutput;
@@ -6,51 +6,51 @@ class APIBoards {
6
6
  constructor(web) {
7
7
  this.web = web;
8
8
  }
9
- async getBoards({ auth, categoryId, groupId }) {
9
+ async getBoards({ auth, categoryId, groupId, ...rest }) {
10
10
  return await this.web.request({
11
- method: 'GET', auth,
11
+ method: 'GET', auth, ...rest,
12
12
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
13
13
  });
14
14
  }
15
- async getBoard({ auth, categoryId, groupId, boardId }) {
15
+ async getBoard({ auth, categoryId, groupId, boardId, ...rest }) {
16
16
  return await this.web.request({
17
- method: 'GET', auth,
17
+ method: 'GET', auth, ...rest,
18
18
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}`),
19
19
  });
20
20
  }
21
- async updateBoard({ auth, categoryId, groupId, boardId, body }) {
21
+ async updateBoard({ auth, categoryId, groupId, boardId, body, ...rest }) {
22
22
  return await this.web.request({
23
- method: 'PATCH', auth, body,
23
+ method: 'PATCH', auth, body, ...rest,
24
24
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}`),
25
25
  });
26
26
  }
27
- async scheduleBoardDeletion({ auth, categoryId, groupId, boardId }) {
27
+ async scheduleBoardDeletion({ auth, categoryId, groupId, boardId, ...rest }) {
28
28
  return await this.web.request({
29
- method: 'DELETE', auth,
29
+ method: 'DELETE', auth, ...rest,
30
30
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}`),
31
31
  });
32
32
  }
33
- async forceDeleteBoard({ auth, categoryId, groupId, boardId }) {
33
+ async forceDeleteBoard({ auth, categoryId, groupId, boardId, ...rest }) {
34
34
  return await this.web.request({
35
- method: 'DELETE', auth,
35
+ method: 'DELETE', auth, ...rest,
36
36
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}?force=true`),
37
37
  });
38
38
  }
39
- async cancelBoardDeletion({ auth, categoryId, groupId, boardId }) {
39
+ async cancelBoardDeletion({ auth, categoryId, groupId, boardId, ...rest }) {
40
40
  return await this.web.request({
41
- method: 'POST', auth,
41
+ method: 'POST', auth, ...rest,
42
42
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/cancel-deletion`),
43
43
  });
44
44
  }
45
- async getBoardRoomData({ auth, categoryId, groupId, boardId }) {
45
+ async getBoardRoomData({ auth, categoryId, groupId, boardId, ...rest }) {
46
46
  return await this.web.request({
47
- method: 'GET', auth,
47
+ method: 'GET', auth, ...rest,
48
48
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/room`),
49
49
  });
50
50
  }
51
- async kickUserFromRoom({ auth, categoryId, groupId, boardId, userId }) {
51
+ async kickUserFromRoom({ auth, categoryId, groupId, boardId, userId, ...rest }) {
52
52
  return await this.web.request({
53
- method: 'POST', auth,
53
+ method: 'POST', auth, ...rest,
54
54
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/room-kick`, {
55
55
  userId,
56
56
  }),
@@ -1,16 +1,17 @@
1
1
  import { SingleOutput } from '../external/types';
2
2
  import { BoardsManager } from '../core/manager';
3
+ import { WithHeaders } from '../types';
3
4
  export declare class APICalendar {
4
5
  private web;
5
6
  constructor(web: BoardsManager);
6
- getCalendar({ auth, groupId }: CalendarFunctionsInput['getCalendar']): Promise<import("..").WebResponse<GetCalendarResponse>>;
7
- getHolidays({ auth, countryCode, year }: CalendarFunctionsInput['getHolidays']): Promise<import("..").WebResponse<FormattedHoliday[]>>;
8
- updateGroupCalendarCode({ auth, groupId, calCode }: CalendarFunctionsInput['updateGroupCalendarCode']): Promise<import("..").WebResponse<string>>;
9
- createEvent({ auth, groupId, event }: CalendarFunctionsInput['createEvent']): Promise<import("..").WebResponse<string>>;
10
- updateEvent({ auth, groupId, eventId, event }: CalendarFunctionsInput['updateEvent']): Promise<import("..").WebResponse<string>>;
11
- deleteEvent({ auth, groupId, eventId }: CalendarFunctionsInput['deleteEvent']): Promise<import("..").WebResponse<string>>;
7
+ getCalendar({ auth, groupId, ...rest }: CalendarFunctionsInput['getCalendar']): Promise<import("../types").WebResponse<GetCalendarResponse>>;
8
+ getHolidays({ auth, countryCode, year, ...rest }: CalendarFunctionsInput['getHolidays']): Promise<import("../types").WebResponse<FormattedHoliday[]>>;
9
+ updateGroupCalendarCode({ auth, groupId, calCode, ...rest }: CalendarFunctionsInput['updateGroupCalendarCode']): Promise<import("../types").WebResponse<string>>;
10
+ createEvent({ auth, groupId, event, ...rest }: CalendarFunctionsInput['createEvent']): Promise<import("../types").WebResponse<string>>;
11
+ updateEvent({ auth, groupId, eventId, event, ...rest }: CalendarFunctionsInput['updateEvent']): Promise<import("../types").WebResponse<string>>;
12
+ deleteEvent({ auth, groupId, eventId, ...rest }: CalendarFunctionsInput['deleteEvent']): Promise<import("../types").WebResponse<string>>;
12
13
  }
13
- export type CalendarFunctionsInput = {
14
+ export type CalendarFunctionsInput = WithHeaders<{
14
15
  'getCalendar': {
15
16
  auth: string;
16
17
  groupId: string;
@@ -41,7 +42,7 @@ export type CalendarFunctionsInput = {
41
42
  groupId: string;
42
43
  eventId: string;
43
44
  };
44
- };
45
+ }>;
45
46
  export type EventObject = {
46
47
  title: string;
47
48
  start: Date;
@@ -6,42 +6,42 @@ class APICalendar {
6
6
  constructor(web) {
7
7
  this.web = web;
8
8
  }
9
- async getCalendar({ auth, groupId }) {
9
+ async getCalendar({ auth, groupId, ...rest }) {
10
10
  return await this.web.request({
11
- method: 'GET', auth,
11
+ method: 'GET', auth, ...rest,
12
12
  endpoint: `/groups/${groupId}/calendar`,
13
13
  });
14
14
  }
15
- async getHolidays({ auth, countryCode, year }) {
15
+ async getHolidays({ auth, countryCode, year, ...rest }) {
16
16
  return await this.web.request({
17
- method: 'GET', auth,
17
+ method: 'GET', auth, ...rest,
18
18
  endpoint: `/holidays/${countryCode}/${year}`,
19
19
  });
20
20
  }
21
- async updateGroupCalendarCode({ auth, groupId, calCode }) {
21
+ async updateGroupCalendarCode({ auth, groupId, calCode, ...rest }) {
22
22
  return await this.web.request({
23
- method: 'PATCH', auth,
23
+ method: 'PATCH', auth, ...rest,
24
24
  endpoint: `/groups/${groupId}/calendar`,
25
25
  body: { calCode },
26
26
  });
27
27
  }
28
- async createEvent({ auth, groupId, event }) {
28
+ async createEvent({ auth, groupId, event, ...rest }) {
29
29
  return await this.web.request({
30
- method: 'POST', auth,
30
+ method: 'POST', auth, ...rest,
31
31
  endpoint: `/groups/${groupId}/calendar`,
32
32
  body: event,
33
33
  });
34
34
  }
35
- async updateEvent({ auth, groupId, eventId, event }) {
35
+ async updateEvent({ auth, groupId, eventId, event, ...rest }) {
36
36
  return await this.web.request({
37
- method: 'PATCH', auth,
37
+ method: 'PATCH', auth, ...rest,
38
38
  endpoint: `/groups/${groupId}/calendar/${eventId}`,
39
39
  body: event,
40
40
  });
41
41
  }
42
- async deleteEvent({ auth, groupId, eventId }) {
42
+ async deleteEvent({ auth, groupId, eventId, ...rest }) {
43
43
  return await this.web.request({
44
- method: 'DELETE', auth,
44
+ method: 'DELETE', auth, ...rest,
45
45
  endpoint: `/groups/${groupId}/calendar/${eventId}`,
46
46
  });
47
47
  }
@@ -1,17 +1,18 @@
1
1
  import { BoardInput, NameInput, SingleOutput } from '../external/types';
2
2
  import { BoardsManager } from '../core/manager';
3
3
  import { GetBoardOutput } from './boards';
4
+ import { WithHeaders } from '../types';
4
5
  export declare class APICategories {
5
6
  private web;
6
7
  constructor(web: BoardsManager);
7
- getCategories({ auth, groupId }: CategoriesFunctionsInput['getCategories']): Promise<import("..").WebResponse<GetCategoriesOutput>>;
8
- getCategory({ auth, groupId, categoryId }: CategoriesFunctionsInput['getCategory']): Promise<import("..").WebResponse<GetCategoryOutput>>;
9
- createBoardInCategory({ auth, groupId, categoryId, body }: CategoriesFunctionsInput['createBoardInCategory']): Promise<import("..").WebResponse<string>>;
10
- updateCategory({ auth, groupId, categoryId, body }: CategoriesFunctionsInput['updateCategory']): Promise<import("..").WebResponse<string>>;
11
- reorderBoardsInCategory({ auth, groupId, categoryId, body }: CategoriesFunctionsInput['reorderBoards']): Promise<import("..").WebResponse<string>>;
12
- deleteCategory({ auth, groupId, categoryId }: CategoriesFunctionsInput['deleteCategory']): Promise<import("..").WebResponse<string>>;
8
+ getCategories({ auth, groupId, ...rest }: CategoriesFunctionsInput['getCategories']): Promise<import("../types").WebResponse<GetCategoriesOutput>>;
9
+ getCategory({ auth, groupId, categoryId, ...rest }: CategoriesFunctionsInput['getCategory']): Promise<import("../types").WebResponse<GetCategoryOutput>>;
10
+ createBoardInCategory({ auth, groupId, categoryId, body, ...rest }: CategoriesFunctionsInput['createBoardInCategory']): Promise<import("../types").WebResponse<string>>;
11
+ updateCategory({ auth, groupId, categoryId, body, ...rest }: CategoriesFunctionsInput['updateCategory']): Promise<import("../types").WebResponse<string>>;
12
+ reorderBoardsInCategory({ auth, groupId, categoryId, body, ...rest }: CategoriesFunctionsInput['reorderBoards']): Promise<import("../types").WebResponse<string>>;
13
+ deleteCategory({ auth, groupId, categoryId, ...rest }: CategoriesFunctionsInput['deleteCategory']): Promise<import("../types").WebResponse<string>>;
13
14
  }
14
- export type CategoriesFunctionsInput = {
15
+ export type CategoriesFunctionsInput = WithHeaders<{
15
16
  'getCategories': {
16
17
  auth: string;
17
18
  groupId: string;
@@ -44,7 +45,7 @@ export type CategoriesFunctionsInput = {
44
45
  groupId: string;
45
46
  categoryId: string;
46
47
  };
47
- };
48
+ }>;
48
49
  export type GetCategoriesOutput = (SingleOutput & {
49
50
  boards: number;
50
51
  group: SingleOutput;
@@ -8,39 +8,39 @@ class APICategories {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getCategories({ auth, groupId }) {
11
+ async getCategories({ auth, groupId, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp(`/groups/${groupId}`),
15
15
  });
16
16
  }
17
- async getCategory({ auth, groupId, categoryId }) {
17
+ async getCategory({ auth, groupId, categoryId, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'GET', auth,
19
+ method: 'GET', auth, ...rest,
20
20
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
21
21
  });
22
22
  }
23
- async createBoardInCategory({ auth, groupId, categoryId, body }) {
23
+ async createBoardInCategory({ auth, groupId, categoryId, body, ...rest }) {
24
24
  return await this.web.request({
25
- method: 'POST', auth, body,
25
+ method: 'POST', auth, body, ...rest,
26
26
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards`),
27
27
  });
28
28
  }
29
- async updateCategory({ auth, groupId, categoryId, body }) {
29
+ async updateCategory({ auth, groupId, categoryId, body, ...rest }) {
30
30
  return await this.web.request({
31
- method: 'PATCH', auth, body,
31
+ method: 'PATCH', auth, body, ...rest,
32
32
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
33
33
  });
34
34
  }
35
- async reorderBoardsInCategory({ auth, groupId, categoryId, body }) {
35
+ async reorderBoardsInCategory({ auth, groupId, categoryId, body, ...rest }) {
36
36
  return await this.web.request({
37
- method: 'PUT', auth, body,
37
+ method: 'PUT', auth, body, ...rest,
38
38
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards`),
39
39
  });
40
40
  }
41
- async deleteCategory({ auth, groupId, categoryId }) {
41
+ async deleteCategory({ auth, groupId, categoryId, ...rest }) {
42
42
  return await this.web.request({
43
- method: 'DELETE', auth,
43
+ method: 'DELETE', auth, ...rest,
44
44
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
45
45
  });
46
46
  }
@@ -1,12 +1,13 @@
1
1
  import { BoardsManager } from '../core/manager';
2
+ import { WithHeaders } from '../types';
2
3
  export declare class APIFiles {
3
4
  private web;
4
5
  constructor(web: BoardsManager);
5
- uploadBase64Files({ auth, boardId, files }: FilesFunctionsInput['uploadBase64Files']): Promise<import("..").WebResponse<FileUploadResponse>>;
6
- uploadRawFiles({ auth, boardId, files }: FilesFunctionsInput['uploadRawFiles']): Promise<import("..").WebResponse<FileUploadResponse>>;
7
- deleteFiles({ auth, boardId, fileIds }: FilesFunctionsInput['deleteFiles']): Promise<import("..").WebResponse<string>>;
6
+ uploadBase64Files({ auth, boardId, files, ...rest }: FilesFunctionsInput['uploadBase64Files']): Promise<import("../types").WebResponse<FileUploadResponse>>;
7
+ uploadRawFiles({ auth, boardId, files, ...rest }: FilesFunctionsInput['uploadRawFiles']): Promise<import("../types").WebResponse<FileUploadResponse>>;
8
+ deleteFiles({ auth, boardId, fileIds, ...rest }: FilesFunctionsInput['deleteFiles']): Promise<import("../types").WebResponse<string>>;
8
9
  }
9
- export type FilesFunctionsInput = {
10
+ export type FilesFunctionsInput = WithHeaders<{
10
11
  'uploadBase64Files': {
11
12
  auth: string;
12
13
  boardId: string;
@@ -22,7 +23,7 @@ export type FilesFunctionsInput = {
22
23
  boardId: string;
23
24
  fileIds: string[];
24
25
  };
25
- };
26
+ }>;
26
27
  export type Base64FileInput = {
27
28
  id: string;
28
29
  data: string;
@@ -6,27 +6,27 @@ class APIFiles {
6
6
  constructor(web) {
7
7
  this.web = web;
8
8
  }
9
- async uploadBase64Files({ auth, boardId, files }) {
9
+ async uploadBase64Files({ auth, boardId, files, ...rest }) {
10
10
  return await this.web.request({
11
- method: 'POST', auth,
11
+ method: 'POST', auth, ...rest,
12
12
  endpoint: `/files/${boardId}/base64`,
13
13
  body: files,
14
14
  });
15
15
  }
16
- async uploadRawFiles({ auth, boardId, files }) {
16
+ async uploadRawFiles({ auth, boardId, files, ...rest }) {
17
17
  const formData = new FormData();
18
18
  for (const file of files) {
19
19
  formData.append(`file-${file.clientId}`, file.file);
20
20
  }
21
21
  return await this.web.request({
22
- method: 'POST', auth,
22
+ method: 'POST', auth, ...rest,
23
23
  endpoint: `/files/${boardId}/raw`,
24
24
  body: formData,
25
25
  });
26
26
  }
27
- async deleteFiles({ auth, boardId, fileIds }) {
27
+ async deleteFiles({ auth, boardId, fileIds, ...rest }) {
28
28
  return await this.web.request({
29
- method: 'DELETE', auth,
29
+ method: 'DELETE', auth, ...rest,
30
30
  endpoint: `/files/${boardId}/delete`,
31
31
  body: fileIds,
32
32
  });
@@ -1,20 +1,21 @@
1
1
  import { SingleOutput } from '../external/types';
2
2
  import { BoardsManager } from '../core/manager';
3
+ import { WithHeaders } from '../types';
3
4
  export declare class APIFlashcards {
4
5
  private web;
5
6
  constructor(web: BoardsManager);
6
- getDeck({ auth, groupId, categoryId, boardId }: FlashcardsFunctionsInput['getDeck']): Promise<import("..").WebResponse<FlashcardDeckResponse>>;
7
- initializeDeck({ auth, groupId, categoryId, boardId }: FlashcardsFunctionsInput['initializeDeck']): Promise<import("..").WebResponse<string>>;
8
- destroyDeck({ auth, groupId, categoryId, boardId }: FlashcardsFunctionsInput['destroyDeck']): Promise<import("..").WebResponse<string>>;
9
- createCards({ auth, groupId, categoryId, boardId, body }: FlashcardsFunctionsInput['createCards']): Promise<import("..").WebResponse<string>>;
10
- updateCards({ auth, groupId, categoryId, boardId, body }: FlashcardsFunctionsInput['updateCards']): Promise<import("..").WebResponse<string>>;
11
- deleteCards({ auth, groupId, categoryId, boardId, body }: FlashcardsFunctionsInput['deleteCards']): Promise<import("..").WebResponse<string>>;
12
- overrideCards({ auth, groupId, categoryId, boardId, body }: FlashcardsFunctionsInput['overrideCards']): Promise<import("..").WebResponse<string>>;
13
- updateProgress({ auth, groupId, categoryId, boardId, body }: FlashcardsFunctionsInput['updateProgress']): Promise<import("..").WebResponse<string>>;
14
- resetProgress({ auth, groupId, categoryId, boardId }: FlashcardsFunctionsInput['resetProgress']): Promise<import("..").WebResponse<string>>;
15
- reorderCards({ auth, groupId, categoryId, boardId, body }: FlashcardsFunctionsInput['reorderCards']): Promise<import("..").WebResponse<string>>;
7
+ getDeck({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['getDeck']): Promise<import("../types").WebResponse<FlashcardDeckResponse>>;
8
+ initializeDeck({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['initializeDeck']): Promise<import("../types").WebResponse<string>>;
9
+ destroyDeck({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['destroyDeck']): Promise<import("../types").WebResponse<string>>;
10
+ createCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['createCards']): Promise<import("../types").WebResponse<string>>;
11
+ updateCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['updateCards']): Promise<import("../types").WebResponse<string>>;
12
+ deleteCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['deleteCards']): Promise<import("../types").WebResponse<string>>;
13
+ overrideCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['overrideCards']): Promise<import("../types").WebResponse<string>>;
14
+ updateProgress({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['updateProgress']): Promise<import("../types").WebResponse<string>>;
15
+ resetProgress({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['resetProgress']): Promise<import("../types").WebResponse<string>>;
16
+ reorderCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['reorderCards']): Promise<import("../types").WebResponse<string>>;
16
17
  }
17
- export type FlashcardsFunctionsInput = {
18
+ export type FlashcardsFunctionsInput = WithHeaders<{
18
19
  getDeck: {
19
20
  auth: string;
20
21
  groupId: string;
@@ -81,7 +82,7 @@ export type FlashcardsFunctionsInput = {
81
82
  boardId: string;
82
83
  body: string[];
83
84
  };
84
- };
85
+ }>;
85
86
  export type CardInput = {
86
87
  front: string;
87
88
  back: string;
@@ -8,63 +8,63 @@ class APIFlashcards {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getDeck({ auth, groupId, categoryId, boardId }) {
11
+ async getDeck({ auth, groupId, categoryId, boardId, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
15
15
  });
16
16
  }
17
- async initializeDeck({ auth, groupId, categoryId, boardId }) {
17
+ async initializeDeck({ auth, groupId, categoryId, boardId, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'POST', auth,
19
+ method: 'POST', auth, ...rest,
20
20
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/initialize`),
21
21
  });
22
22
  }
23
- async destroyDeck({ auth, groupId, categoryId, boardId }) {
23
+ async destroyDeck({ auth, groupId, categoryId, boardId, ...rest }) {
24
24
  return await this.web.request({
25
- method: 'POST', auth,
25
+ method: 'POST', auth, ...rest,
26
26
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/destroy`),
27
27
  });
28
28
  }
29
- async createCards({ auth, groupId, categoryId, boardId, body }) {
29
+ async createCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
30
30
  return await this.web.request({
31
- method: 'POST', auth, body,
31
+ method: 'POST', auth, body, ...rest,
32
32
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
33
33
  });
34
34
  }
35
- async updateCards({ auth, groupId, categoryId, boardId, body }) {
35
+ async updateCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
36
36
  return await this.web.request({
37
- method: 'PATCH', auth, body,
37
+ method: 'PATCH', auth, body, ...rest,
38
38
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
39
39
  });
40
40
  }
41
- async deleteCards({ auth, groupId, categoryId, boardId, body }) {
41
+ async deleteCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
42
42
  return await this.web.request({
43
- method: 'DELETE', auth, body,
43
+ method: 'DELETE', auth, body, ...rest,
44
44
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
45
45
  });
46
46
  }
47
- async overrideCards({ auth, groupId, categoryId, boardId, body }) {
47
+ async overrideCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
48
48
  return await this.web.request({
49
- method: 'PUT', auth, body,
49
+ method: 'PUT', auth, body, ...rest,
50
50
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/override`),
51
51
  });
52
52
  }
53
- async updateProgress({ auth, groupId, categoryId, boardId, body }) {
53
+ async updateProgress({ auth, groupId, categoryId, boardId, body, ...rest }) {
54
54
  return await this.web.request({
55
- method: 'PATCH', auth, body,
55
+ method: 'PATCH', auth, body, ...rest,
56
56
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/progress`),
57
57
  });
58
58
  }
59
- async resetProgress({ auth, groupId, categoryId, boardId }) {
59
+ async resetProgress({ auth, groupId, categoryId, boardId, ...rest }) {
60
60
  return await this.web.request({
61
- method: 'DELETE', auth,
61
+ method: 'DELETE', auth, ...rest,
62
62
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/progress`),
63
63
  });
64
64
  }
65
- async reorderCards({ auth, groupId, categoryId, boardId, body }) {
65
+ async reorderCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
66
66
  return await this.web.request({
67
- method: 'PUT', auth, body,
67
+ method: 'PUT', auth, body, ...rest,
68
68
  endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/reorder`),
69
69
  });
70
70
  }
@@ -1,19 +1,20 @@
1
1
  import { NameInput, SingleOutput } from '../external/types';
2
2
  import { BoardsManager } from '../core/manager';
3
+ import { WithHeaders } from '../types';
3
4
  export declare class APIGroups {
4
5
  private web;
5
6
  constructor(web: BoardsManager);
6
- getAllSorted({ auth }: GroupsFunctionsInput['getAllSorted']): Promise<import("..").WebResponse<GetAllSortedOutput>>;
7
- getGroups({ auth }: GroupsFunctionsInput['getGroups']): Promise<import("..").WebResponse<GetGroupsOutput>>;
8
- getGroup({ auth, groupId }: GroupsFunctionsInput['getGroup']): Promise<import("..").WebResponse<GetGroupOutput>>;
9
- createGroup({ auth, body }: GroupsFunctionsInput['createGroup']): Promise<import("..").WebResponse<string>>;
10
- createCategoryInGroup({ auth, groupId, body }: GroupsFunctionsInput['createCategoryInGroup']): Promise<import("..").WebResponse<string>>;
11
- updateGroup({ auth, groupId, body }: GroupsFunctionsInput['updateGroup']): Promise<import("..").WebResponse<string>>;
12
- reorderGroups({ auth, body }: GroupsFunctionsInput['reorderGroups']): Promise<import("..").WebResponse<string>>;
13
- reorderCategoriesInGroup({ auth, groupId, body }: GroupsFunctionsInput['reorderCategoriesInGroup']): Promise<import("..").WebResponse<string>>;
14
- deleteGroup({ auth, groupId }: GroupsFunctionsInput['deleteGroup']): Promise<import("..").WebResponse<string>>;
7
+ getAllSorted({ auth, ...rest }: GroupsFunctionsInput['getAllSorted']): Promise<import("../types").WebResponse<GetAllSortedOutput>>;
8
+ getGroups({ auth, ...rest }: GroupsFunctionsInput['getGroups']): Promise<import("../types").WebResponse<GetGroupsOutput>>;
9
+ getGroup({ auth, groupId, ...rest }: GroupsFunctionsInput['getGroup']): Promise<import("../types").WebResponse<GetGroupOutput>>;
10
+ createGroup({ auth, body, ...rest }: GroupsFunctionsInput['createGroup']): Promise<import("../types").WebResponse<string>>;
11
+ createCategoryInGroup({ auth, groupId, body, ...rest }: GroupsFunctionsInput['createCategoryInGroup']): Promise<import("../types").WebResponse<string>>;
12
+ updateGroup({ auth, groupId, body, ...rest }: GroupsFunctionsInput['updateGroup']): Promise<import("../types").WebResponse<string>>;
13
+ reorderGroups({ auth, body, ...rest }: GroupsFunctionsInput['reorderGroups']): Promise<import("../types").WebResponse<string>>;
14
+ reorderCategoriesInGroup({ auth, groupId, body, ...rest }: GroupsFunctionsInput['reorderCategoriesInGroup']): Promise<import("../types").WebResponse<string>>;
15
+ deleteGroup({ auth, groupId, ...rest }: GroupsFunctionsInput['deleteGroup']): Promise<import("../types").WebResponse<string>>;
15
16
  }
16
- export type GroupsFunctionsInput = {
17
+ export type GroupsFunctionsInput = WithHeaders<{
17
18
  'getAllSorted': {
18
19
  auth: string;
19
20
  };
@@ -51,7 +52,7 @@ export type GroupsFunctionsInput = {
51
52
  auth: string;
52
53
  groupId: string;
53
54
  };
54
- };
55
+ }>;
55
56
  export type GetGroupsOutput = (SingleOutput & {
56
57
  categories: number;
57
58
  isDefault: boolean;
@@ -8,57 +8,57 @@ class APIGroups {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getAllSorted({ auth }) {
11
+ async getAllSorted({ auth, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp('/all'),
15
15
  });
16
16
  }
17
- async getGroups({ auth }) {
17
+ async getGroups({ auth, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'GET', auth,
19
+ method: 'GET', auth, ...rest,
20
20
  endpoint: this.web.qp('/groups'),
21
21
  });
22
22
  }
23
- async getGroup({ auth, groupId }) {
23
+ async getGroup({ auth, groupId, ...rest }) {
24
24
  return await this.web.request({
25
- method: 'GET', auth,
25
+ method: 'GET', auth, ...rest,
26
26
  endpoint: this.web.qp(`/groups/${groupId}`),
27
27
  });
28
28
  }
29
- async createGroup({ auth, body }) {
29
+ async createGroup({ auth, body, ...rest }) {
30
30
  return await this.web.request({
31
- method: 'POST', auth, body,
31
+ method: 'POST', auth, body, ...rest,
32
32
  endpoint: this.web.qp('/groups'),
33
33
  });
34
34
  }
35
- async createCategoryInGroup({ auth, groupId, body }) {
35
+ async createCategoryInGroup({ auth, groupId, body, ...rest }) {
36
36
  return await this.web.request({
37
- method: 'POST', auth, body,
37
+ method: 'POST', auth, body, ...rest,
38
38
  endpoint: this.web.qp(`/groups/${groupId}/categories`),
39
39
  });
40
40
  }
41
- async updateGroup({ auth, groupId, body }) {
41
+ async updateGroup({ auth, groupId, body, ...rest }) {
42
42
  return await this.web.request({
43
- method: 'PATCH', auth, body,
43
+ method: 'PATCH', auth, body, ...rest,
44
44
  endpoint: this.web.qp(`/groups/${groupId}`),
45
45
  });
46
46
  }
47
- async reorderGroups({ auth, body }) {
47
+ async reorderGroups({ auth, body, ...rest }) {
48
48
  return await this.web.request({
49
- method: 'PUT', auth, body,
49
+ method: 'PUT', auth, body, ...rest,
50
50
  endpoint: this.web.qp('/groups'),
51
51
  });
52
52
  }
53
- async reorderCategoriesInGroup({ auth, groupId, body }) {
53
+ async reorderCategoriesInGroup({ auth, groupId, body, ...rest }) {
54
54
  return await this.web.request({
55
- method: 'PUT', auth, body,
55
+ method: 'PUT', auth, body, ...rest,
56
56
  endpoint: this.web.qp(`/groups/${groupId}/categories`),
57
57
  });
58
58
  }
59
- async deleteGroup({ auth, groupId }) {
59
+ async deleteGroup({ auth, groupId, ...rest }) {
60
60
  return await this.web.request({
61
- method: 'DELETE', auth,
61
+ method: 'DELETE', auth, ...rest,
62
62
  endpoint: this.web.qp(`/groups/${groupId}`),
63
63
  });
64
64
  }
@@ -2,18 +2,19 @@ import { BoardRole, CategoryRole, GroupRole } from '../external/vars';
2
2
  import { GrantedRoles, ResourceType } from '../external/types';
3
3
  import { Invite } from '../../prisma/generated';
4
4
  import { BoardsManager } from '../core/manager';
5
+ import { WithHeaders } from '../types';
5
6
  export declare class APIInvites {
6
7
  private web;
7
8
  constructor(web: BoardsManager);
8
- getUserInvites({ auth }: InvitesFunctionsInput['getUserInvites']): Promise<import("..").WebResponse<GetUserInvitesOutput>>;
9
- getResourceInvites({ auth, query }: InvitesFunctionsInput['getResourceInvites']): Promise<import("..").WebResponse<GetResourceInvitesOutput>>;
10
- getInviteDetails({ auth, code }: InvitesFunctionsInput['getInviteDetails']): Promise<import("..").WebResponse<InviteDetails>>;
11
- createInvite({ auth, body }: InvitesFunctionsInput['createInvite']): Promise<import("..").WebResponse<CreateInviteOutput>>;
12
- useInvite({ auth, code }: InvitesFunctionsInput['useInvite']): Promise<import("..").WebResponse<UseInviteOutput>>;
13
- renewInvite({ auth, code }: InvitesFunctionsInput['renewInvite']): Promise<import("..").WebResponse<RenewInviteOutput>>;
14
- revokeInvite({ auth, code }: InvitesFunctionsInput['revokeInvite']): Promise<import("..").WebResponse<string>>;
9
+ getUserInvites({ auth, ...rest }: InvitesFunctionsInput['getUserInvites']): Promise<import("../types").WebResponse<GetUserInvitesOutput>>;
10
+ getResourceInvites({ auth, query, ...rest }: InvitesFunctionsInput['getResourceInvites']): Promise<import("../types").WebResponse<GetResourceInvitesOutput>>;
11
+ getInviteDetails({ auth, code, ...rest }: InvitesFunctionsInput['getInviteDetails']): Promise<import("../types").WebResponse<InviteDetails>>;
12
+ createInvite({ auth, body, ...rest }: InvitesFunctionsInput['createInvite']): Promise<import("../types").WebResponse<CreateInviteOutput>>;
13
+ useInvite({ auth, code, ...rest }: InvitesFunctionsInput['useInvite']): Promise<import("../types").WebResponse<UseInviteOutput>>;
14
+ renewInvite({ auth, code, ...rest }: InvitesFunctionsInput['renewInvite']): Promise<import("../types").WebResponse<RenewInviteOutput>>;
15
+ revokeInvite({ auth, code, ...rest }: InvitesFunctionsInput['revokeInvite']): Promise<import("../types").WebResponse<string>>;
15
16
  }
16
- export type InvitesFunctionsInput = {
17
+ export type InvitesFunctionsInput = WithHeaders<{
17
18
  'getUserInvites': {
18
19
  auth: string;
19
20
  };
@@ -41,7 +42,7 @@ export type InvitesFunctionsInput = {
41
42
  auth: string;
42
43
  code: string;
43
44
  };
44
- };
45
+ }>;
45
46
  export type ViewInvitesQuery = {
46
47
  type: ResourceType;
47
48
  groupId?: string;
@@ -8,45 +8,45 @@ class APIInvites {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getUserInvites({ auth }) {
11
+ async getUserInvites({ auth, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp('/invites'),
15
15
  });
16
16
  }
17
- async getResourceInvites({ auth, query }) {
17
+ async getResourceInvites({ auth, query, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'GET', auth,
19
+ method: 'GET', auth, ...rest,
20
20
  endpoint: this.web.qp('/resources/invites', query),
21
21
  });
22
22
  }
23
- async getInviteDetails({ auth, code }) {
23
+ async getInviteDetails({ auth, code, ...rest }) {
24
24
  return await this.web.request({
25
- method: 'GET', auth,
25
+ method: 'GET', auth, ...rest,
26
26
  endpoint: this.web.qp(`/invites/${code}`),
27
27
  });
28
28
  }
29
- async createInvite({ auth, body }) {
29
+ async createInvite({ auth, body, ...rest }) {
30
30
  return await this.web.request({
31
- method: 'POST', auth, body,
31
+ method: 'POST', auth, body, ...rest,
32
32
  endpoint: this.web.qp('/invites'),
33
33
  });
34
34
  }
35
- async useInvite({ auth, code }) {
35
+ async useInvite({ auth, code, ...rest }) {
36
36
  return await this.web.request({
37
- method: 'POST', auth,
37
+ method: 'POST', auth, ...rest,
38
38
  endpoint: this.web.qp(`/invites/${code}`),
39
39
  });
40
40
  }
41
- async renewInvite({ auth, code }) {
41
+ async renewInvite({ auth, code, ...rest }) {
42
42
  return await this.web.request({
43
- method: 'PATCH', auth,
43
+ method: 'PATCH', auth, ...rest,
44
44
  endpoint: this.web.qp(`/invites/${code}`),
45
45
  });
46
46
  }
47
- async revokeInvite({ auth, code }) {
47
+ async revokeInvite({ auth, code, ...rest }) {
48
48
  return await this.web.request({
49
- method: 'DELETE', auth,
49
+ method: 'DELETE', auth, ...rest,
50
50
  endpoint: this.web.qp(`/invites/${code}`),
51
51
  });
52
52
  }
@@ -1,21 +1,23 @@
1
1
  import { BoardsManager } from '../core/manager';
2
+ import { WithHeaders } from '../types';
2
3
  export declare class APIMetrics {
3
4
  private web;
4
5
  constructor(web: BoardsManager);
5
- getMetrics({ auth }: MetricsFunctionsInput['getMetrics']): Promise<import("..").WebResponse<string>>;
6
- getStatus({ auth }: MetricsFunctionsInput['getStatus']): Promise<import("..").WebResponse<SystemStatus>>;
6
+ getMetrics({ auth, ...rest }: MetricsFunctionsInput['getMetrics']): Promise<import("../types").WebResponse<string>>;
7
+ getStatus({ auth, ...rest }: MetricsFunctionsInput['getStatus']): Promise<import("../types").WebResponse<SystemStatus>>;
7
8
  }
8
- export type MetricsFunctionsInput = {
9
+ export type MetricsFunctionsInput = WithHeaders<{
9
10
  'getMetrics': {
10
11
  auth: string;
11
12
  };
12
13
  'getStatus': {
13
14
  auth: string;
14
15
  };
15
- };
16
+ }>;
16
17
  export type SystemStatus = {
17
18
  cpuUsage: number;
18
- memoryUsage: string;
19
+ memoryUsageMb: number;
20
+ uptimeSeconds: number;
19
21
  activeRooms: number;
20
22
  socketConnections: number;
21
23
  queuedFiles: number;
@@ -24,4 +26,6 @@ export type SystemStatus = {
24
26
  totalBoards: number;
25
27
  totalCategories: number;
26
28
  totalGroups: number;
29
+ totalFiles: number;
30
+ storageSizeMb: number;
27
31
  };
@@ -8,15 +8,15 @@ class APIMetrics {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getMetrics({ auth }) {
11
+ async getMetrics({ auth, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp('/metrics'),
15
15
  });
16
16
  }
17
- async getStatus({ auth }) {
17
+ async getStatus({ auth, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'GET', auth,
19
+ method: 'GET', auth, ...rest,
20
20
  endpoint: this.web.qp('/metrics/status'),
21
21
  });
22
22
  }
@@ -1,15 +1,16 @@
1
1
  import { BoardRole, CategoryRole, GroupRole } from '../external/vars';
2
2
  import { PermUser, ResourceType } from '../external/types';
3
3
  import { BoardsManager } from '../core/manager';
4
+ import { WithHeaders } from '../types';
4
5
  export declare class APIPermissions {
5
6
  private web;
6
7
  constructor(web: BoardsManager);
7
- viewPermissions({ auth, query }: PermissionsFunctionsInput['viewPermissions']): Promise<import("..").WebResponse<PermUser[]>>;
8
- viewAllPermissions({ auth, userIds }: PermissionsFunctionsInput['viewAllPermissions']): Promise<import("..").WebResponse<Record<string, PermUser>>>;
9
- grantPermissions({ auth, body }: PermissionsFunctionsInput['grantPermissions']): Promise<import("..").WebResponse<string>>;
10
- revokePermissions({ auth, body }: PermissionsFunctionsInput['revokePermissions']): Promise<import("..").WebResponse<string>>;
8
+ viewPermissions({ auth, query, ...rest }: PermissionsFunctionsInput['viewPermissions']): Promise<import("../types").WebResponse<PermUser[]>>;
9
+ viewAllPermissions({ auth, userIds, ...rest }: PermissionsFunctionsInput['viewAllPermissions']): Promise<import("../types").WebResponse<Record<string, PermUser>>>;
10
+ grantPermissions({ auth, body, ...rest }: PermissionsFunctionsInput['grantPermissions']): Promise<import("../types").WebResponse<string>>;
11
+ revokePermissions({ auth, body, ...rest }: PermissionsFunctionsInput['revokePermissions']): Promise<import("../types").WebResponse<string>>;
11
12
  }
12
- export type PermissionsFunctionsInput = {
13
+ export type PermissionsFunctionsInput = WithHeaders<{
13
14
  'viewPermissions': {
14
15
  auth: string;
15
16
  query: ViewPermissionsQuery;
@@ -26,7 +27,7 @@ export type PermissionsFunctionsInput = {
26
27
  auth: string;
27
28
  body: RevokePermissionsInput;
28
29
  };
29
- };
30
+ }>;
30
31
  export type ViewPermissionsQuery = {
31
32
  type: ResourceType;
32
33
  id: string;
@@ -8,27 +8,27 @@ class APIPermissions {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async viewPermissions({ auth, query }) {
11
+ async viewPermissions({ auth, query, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp('/permissions/view', query),
15
15
  });
16
16
  }
17
- async viewAllPermissions({ auth, userIds }) {
17
+ async viewAllPermissions({ auth, userIds, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'POST', auth, body: { userIds },
19
+ method: 'POST', auth, body: { userIds }, ...rest,
20
20
  endpoint: this.web.qp('/permissions/view-all'),
21
21
  });
22
22
  }
23
- async grantPermissions({ auth, body }) {
23
+ async grantPermissions({ auth, body, ...rest }) {
24
24
  return await this.web.request({
25
- method: 'POST', auth, body,
25
+ method: 'POST', auth, body, ...rest,
26
26
  endpoint: this.web.qp('/permissions/grant'),
27
27
  });
28
28
  }
29
- async revokePermissions({ auth, body }) {
29
+ async revokePermissions({ auth, body, ...rest }) {
30
30
  return await this.web.request({
31
- method: 'POST', auth, body,
31
+ method: 'POST', auth, body, ...rest,
32
32
  endpoint: this.web.qp('/permissions/revoke'),
33
33
  });
34
34
  }
@@ -1,14 +1,15 @@
1
1
  import { Device, Platforms } from '../../prisma/generated/default';
2
2
  import { BoardsManager } from '../core/manager';
3
+ import { WithHeaders } from '../types';
3
4
  export declare class APISessions {
4
5
  private web;
5
6
  constructor(web: BoardsManager);
6
- createSession({ auth, body }: SessionsFunctionsInput['createSession']): Promise<import("..").WebResponse<CreateSessionOutput>>;
7
- getAllSessions({ auth }: SessionsFunctionsInput['getAllSessions']): Promise<import("..").WebResponse<SessionsOutput>>;
8
- deleteSession({ auth, dbId }: SessionsFunctionsInput['deleteSession']): Promise<import("..").WebResponse<string>>;
9
- deleteAllSessions({ auth }: SessionsFunctionsInput['deleteAllSessions']): Promise<import("..").WebResponse<string>>;
7
+ createSession({ auth, body, ...rest }: SessionsFunctionsInput['createSession']): Promise<import("../types").WebResponse<CreateSessionOutput>>;
8
+ getAllSessions({ auth, ...rest }: SessionsFunctionsInput['getAllSessions']): Promise<import("../types").WebResponse<SessionsOutput>>;
9
+ deleteSession({ auth, dbId, ...rest }: SessionsFunctionsInput['deleteSession']): Promise<import("../types").WebResponse<string>>;
10
+ deleteAllSessions({ auth, ...rest }: SessionsFunctionsInput['deleteAllSessions']): Promise<import("../types").WebResponse<string>>;
10
11
  }
11
- export type SessionsFunctionsInput = {
12
+ export type SessionsFunctionsInput = WithHeaders<{
12
13
  'createSession': {
13
14
  auth: string;
14
15
  body: CreateSessionInput;
@@ -23,7 +24,7 @@ export type SessionsFunctionsInput = {
23
24
  'deleteAllSessions': {
24
25
  auth: string;
25
26
  };
26
- };
27
+ }>;
27
28
  export type CreateSessionInput = {
28
29
  ip?: string;
29
30
  email: string;
@@ -8,27 +8,27 @@ class APISessions {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async createSession({ auth, body }) {
11
+ async createSession({ auth, body, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'POST', auth, body,
13
+ method: 'POST', auth, body, ...rest,
14
14
  endpoint: this.web.qp('/sessions'),
15
15
  });
16
16
  }
17
- async getAllSessions({ auth }) {
17
+ async getAllSessions({ auth, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'GET', auth,
19
+ method: 'GET', auth, ...rest,
20
20
  endpoint: this.web.qp('/sessions'),
21
21
  });
22
22
  }
23
- async deleteSession({ auth, dbId }) {
23
+ async deleteSession({ auth, dbId, ...rest }) {
24
24
  return await this.web.request({
25
- method: 'DELETE', auth, body: { dbId },
25
+ method: 'DELETE', auth, body: { dbId }, ...rest,
26
26
  endpoint: this.web.qp('/sessions'),
27
27
  });
28
28
  }
29
- async deleteAllSessions({ auth }) {
29
+ async deleteAllSessions({ auth, ...rest }) {
30
30
  return await this.web.request({
31
- method: 'DELETE', auth,
31
+ method: 'DELETE', auth, ...rest,
32
32
  endpoint: this.web.qp('/sessions/all'),
33
33
  });
34
34
  }
@@ -1,14 +1,15 @@
1
1
  import { Platforms } from '../../prisma/generated/default';
2
2
  import { DBUserPartialType } from '../external/vars';
3
3
  import { BoardsManager } from '../core/manager';
4
+ import { WithHeaders } from '../types';
4
5
  export declare class APIUsers {
5
6
  private web;
6
7
  constructor(web: BoardsManager);
7
- getUser({ auth, userId }: UsersFunctionsInput['getCurrentUser']): Promise<import("..").WebResponse<GetUsersOutput>>;
8
- updateUser({ auth, userId, body }: UsersFunctionsInput['updateUser']): Promise<import("..").WebResponse<string>>;
9
- deleteAccount({ auth, userId }: UsersFunctionsInput['deleteAccount']): Promise<import("..").WebResponse<void>>;
8
+ getUser({ auth, userId, ...rest }: UsersFunctionsInput['getCurrentUser']): Promise<import("../types").WebResponse<GetUsersOutput>>;
9
+ updateUser({ auth, userId, body, ...rest }: UsersFunctionsInput['updateUser']): Promise<import("../types").WebResponse<string>>;
10
+ deleteAccount({ auth, userId, ...rest }: UsersFunctionsInput['deleteAccount']): Promise<import("../types").WebResponse<void>>;
10
11
  }
11
- export type UsersFunctionsInput = {
12
+ export type UsersFunctionsInput = WithHeaders<{
12
13
  'getCurrentUser': {
13
14
  auth: string;
14
15
  userId?: string;
@@ -25,7 +26,7 @@ export type UsersFunctionsInput = {
25
26
  'isCurrentUserDev': {
26
27
  auth: string;
27
28
  };
28
- };
29
+ }>;
29
30
  export type GetUsersOutput = DBUserPartialType & {
30
31
  isDev: boolean;
31
32
  };
@@ -8,21 +8,21 @@ class APIUsers {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async getUser({ auth, userId }) {
11
+ async getUser({ auth, userId, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp('/users' + (userId ? `/${userId}` : '')),
15
15
  });
16
16
  }
17
- async updateUser({ auth, userId, body }) {
17
+ async updateUser({ auth, userId, body, ...rest }) {
18
18
  return await this.web.request({
19
- method: 'PATCH', auth, body,
19
+ method: 'PATCH', auth, body, ...rest,
20
20
  endpoint: this.web.qp('/users' + (userId ? `/${userId}` : '')),
21
21
  });
22
22
  }
23
- async deleteAccount({ auth, userId }) {
23
+ async deleteAccount({ auth, userId, ...rest }) {
24
24
  return await this.web.request({
25
- method: 'DELETE', auth,
25
+ method: 'DELETE', auth, ...rest,
26
26
  endpoint: this.web.qp('/users' + (userId ? `/${userId}` : '')),
27
27
  });
28
28
  }
@@ -1,15 +1,16 @@
1
1
  import { BoardsManager } from '../core/manager';
2
+ import { WithHeaders } from '../types';
2
3
  export declare class APIUtils {
3
4
  private web;
4
5
  constructor(web: BoardsManager);
5
- unfurlUrl({ auth, url }: UtilsFunctionsInput['unfurlUrl']): Promise<import("..").WebResponse<Partial<UnfurlOutput>>>;
6
+ unfurlUrl({ auth, url, ...rest }: UtilsFunctionsInput['unfurlUrl']): Promise<import("../types").WebResponse<Partial<UnfurlOutput>>>;
6
7
  }
7
- export type UtilsFunctionsInput = {
8
+ export type UtilsFunctionsInput = WithHeaders<{
8
9
  'unfurlUrl': {
9
10
  auth: string;
10
11
  url: string;
11
12
  };
12
- };
13
+ }>;
13
14
  export type UnfurlOutput = {
14
15
  title: string;
15
16
  description: string;
@@ -8,9 +8,9 @@ class APIUtils {
8
8
  this.web = web;
9
9
  }
10
10
  // Methods.
11
- async unfurlUrl({ auth, url }) {
11
+ async unfurlUrl({ auth, url, ...rest }) {
12
12
  return await this.web.request({
13
- method: 'GET', auth,
13
+ method: 'GET', auth, ...rest,
14
14
  endpoint: this.web.qp('/utils/unfurl', {
15
15
  url,
16
16
  }),
package/dist/types.d.ts CHANGED
@@ -15,6 +15,11 @@ export type Paginated<T> = {
15
15
  hasMore: boolean;
16
16
  };
17
17
  };
18
+ export type WithHeaders<T> = {
19
+ [P in keyof T]: T[P] & {
20
+ headers?: Record<string, string>;
21
+ };
22
+ };
18
23
  export type PaginatedWebResponse<T, S extends StatusWebCode = StatusWebCode> = WebResponse<Paginated<T>, S>;
19
24
  export type SuccessWithId<T extends string> = {
20
25
  [x in T]: string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.45",
2
+ "version": "1.1.47",
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",