@excali-boards/boards-api-client 1.1.72 → 1.1.74
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/dist/classes/admin.d.ts +1 -1
- package/dist/classes/auth.d.ts +20 -17
- package/dist/classes/boards.d.ts +2 -3
- package/dist/classes/personal.d.ts +1 -1
- package/dist/classes/sessions.d.ts +3 -0
- package/dist/classes/users.d.ts +1 -0
- package/dist/external/vars.d.ts +8 -1
- package/dist/external/vars.js +3 -1
- package/package.json +18 -7
- package/prisma/generated/edge.js +11 -6
- package/prisma/generated/index-browser.js +5 -1
- package/prisma/generated/index.d.ts +153 -4
- package/prisma/generated/index.js +11 -6
- package/prisma/generated/package.json +1 -1
- package/prisma/generated/schema.prisma +7 -0
- package/prisma/generated/wasm.js +11 -6
- package/prisma/schema/schema.prisma +1 -0
- package/prisma/schema/user.prisma +6 -0
- package/dist/src/classes/admin.d.ts +0 -23
- package/dist/src/classes/admin.js +0 -20
- package/dist/src/classes/analytics.d.ts +0 -62
- package/dist/src/classes/analytics.js +0 -38
- package/dist/src/classes/auth.d.ts +0 -48
- package/dist/src/classes/auth.js +0 -12
- package/dist/src/classes/boards.d.ts +0 -99
- package/dist/src/classes/boards.js +0 -62
- package/dist/src/classes/calendar.d.ts +0 -84
- package/dist/src/classes/calendar.js +0 -45
- package/dist/src/classes/categories.d.ts +0 -75
- package/dist/src/classes/categories.js +0 -50
- package/dist/src/classes/files.d.ts +0 -45
- package/dist/src/classes/files.js +0 -31
- package/dist/src/classes/flashcards.d.ts +0 -120
- package/dist/src/classes/flashcards.js +0 -68
- package/dist/src/classes/groups.d.ts +0 -80
- package/dist/src/classes/groups.js +0 -62
- package/dist/src/classes/invites.d.ts +0 -116
- package/dist/src/classes/invites.js +0 -50
- package/dist/src/classes/metrics.d.ts +0 -31
- package/dist/src/classes/metrics.js +0 -20
- package/dist/src/classes/permissions.d.ts +0 -48
- package/dist/src/classes/permissions.js +0 -32
- package/dist/src/classes/sessions.d.ts +0 -61
- package/dist/src/classes/sessions.js +0 -38
- package/dist/src/classes/users.d.ts +0 -37
- package/dist/src/classes/users.js +0 -26
- package/dist/src/classes/utils.d.ts +0 -19
- package/dist/src/classes/utils.js +0 -16
- package/dist/src/core/manager.d.ts +0 -44
- package/dist/src/core/manager.js +0 -92
- package/dist/src/core/utils.d.ts +0 -9
- package/dist/src/core/utils.js +0 -52
- package/dist/src/external/types.d.ts +0 -87
- package/dist/src/external/types.js +0 -4
- package/dist/src/external/vars.d.ts +0 -99
- package/dist/src/external/vars.js +0 -65
- package/dist/src/index.d.ts +0 -20
- package/dist/src/index.js +0 -20
- package/dist/src/types.d.ts +0 -61
- package/dist/src/types.js +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { SingleOutput } from '../external/types';
|
|
2
|
-
import { BoardsManager } from '../core/manager';
|
|
3
|
-
import { WithHeaders } from '../types';
|
|
4
|
-
export declare class APICalendar {
|
|
5
|
-
private web;
|
|
6
|
-
constructor(web: BoardsManager);
|
|
7
|
-
getCalendar({ auth, groupId, ...rest }: CalendarFunctionsInput['getCalendar']): Promise<import("..").WebResponse<GetCalendarResponse>>;
|
|
8
|
-
getHolidays({ auth, countryCode, year, ...rest }: CalendarFunctionsInput['getHolidays']): Promise<import("..").WebResponse<FormattedHoliday[]>>;
|
|
9
|
-
updateGroupCalendarCode({ auth, groupId, calCode, ...rest }: CalendarFunctionsInput['updateGroupCalendarCode']): Promise<import("..").WebResponse<string>>;
|
|
10
|
-
createEvent({ auth, groupId, event, ...rest }: CalendarFunctionsInput['createEvent']): Promise<import("..").WebResponse<string>>;
|
|
11
|
-
updateEvent({ auth, groupId, eventId, event, ...rest }: CalendarFunctionsInput['updateEvent']): Promise<import("..").WebResponse<string>>;
|
|
12
|
-
deleteEvent({ auth, groupId, eventId, ...rest }: CalendarFunctionsInput['deleteEvent']): Promise<import("..").WebResponse<string>>;
|
|
13
|
-
}
|
|
14
|
-
export type CalendarFunctionsInput = WithHeaders<{
|
|
15
|
-
'getCalendar': {
|
|
16
|
-
auth: string;
|
|
17
|
-
groupId: string;
|
|
18
|
-
};
|
|
19
|
-
'getHolidays': {
|
|
20
|
-
auth: string;
|
|
21
|
-
countryCode: string;
|
|
22
|
-
year: number;
|
|
23
|
-
};
|
|
24
|
-
'createEvent': {
|
|
25
|
-
auth: string;
|
|
26
|
-
groupId: string;
|
|
27
|
-
event: EventObject;
|
|
28
|
-
};
|
|
29
|
-
'updateGroupCalendarCode': {
|
|
30
|
-
auth: string;
|
|
31
|
-
groupId: string;
|
|
32
|
-
calCode: string | null;
|
|
33
|
-
};
|
|
34
|
-
'updateEvent': {
|
|
35
|
-
auth: string;
|
|
36
|
-
groupId: string;
|
|
37
|
-
eventId: string;
|
|
38
|
-
event: Partial<EventObject>;
|
|
39
|
-
};
|
|
40
|
-
'deleteEvent': {
|
|
41
|
-
auth: string;
|
|
42
|
-
groupId: string;
|
|
43
|
-
eventId: string;
|
|
44
|
-
};
|
|
45
|
-
}>;
|
|
46
|
-
export type EventObject = {
|
|
47
|
-
title: string;
|
|
48
|
-
start: Date;
|
|
49
|
-
end: Date;
|
|
50
|
-
color: string;
|
|
51
|
-
description?: string;
|
|
52
|
-
where?: string;
|
|
53
|
-
};
|
|
54
|
-
export type GetCalendarResponse = {
|
|
55
|
-
group: SingleOutput & {
|
|
56
|
-
calendarCode: string | null;
|
|
57
|
-
};
|
|
58
|
-
events: CalendarEvent[];
|
|
59
|
-
};
|
|
60
|
-
export type CalendarEvent = {
|
|
61
|
-
id: string;
|
|
62
|
-
title: string;
|
|
63
|
-
color: string;
|
|
64
|
-
description: string | null;
|
|
65
|
-
where: string | null;
|
|
66
|
-
start: Date;
|
|
67
|
-
end: Date;
|
|
68
|
-
createdAt: Date;
|
|
69
|
-
updatedAt: Date;
|
|
70
|
-
createdBy: {
|
|
71
|
-
displayName: string;
|
|
72
|
-
avatarUrl: string | null;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
export type ClosedStatus = 'Public' | 'Bank' | 'School' | 'Authorities' | 'Optional' | 'Observance';
|
|
76
|
-
export type FormattedHoliday = {
|
|
77
|
-
id: string;
|
|
78
|
-
title: string;
|
|
79
|
-
start: Date;
|
|
80
|
-
end: Date;
|
|
81
|
-
color: string;
|
|
82
|
-
description: string;
|
|
83
|
-
types: ClosedStatus[];
|
|
84
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export class APICalendar {
|
|
2
|
-
web;
|
|
3
|
-
constructor(web) {
|
|
4
|
-
this.web = web;
|
|
5
|
-
}
|
|
6
|
-
async getCalendar({ auth, groupId, ...rest }) {
|
|
7
|
-
return await this.web.request({
|
|
8
|
-
method: 'GET', auth, ...rest,
|
|
9
|
-
endpoint: `/groups/${groupId}/calendar`,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
async getHolidays({ auth, countryCode, year, ...rest }) {
|
|
13
|
-
return await this.web.request({
|
|
14
|
-
method: 'GET', auth, ...rest,
|
|
15
|
-
endpoint: `/holidays/${countryCode}/${year}`,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
async updateGroupCalendarCode({ auth, groupId, calCode, ...rest }) {
|
|
19
|
-
return await this.web.request({
|
|
20
|
-
method: 'PATCH', auth, ...rest,
|
|
21
|
-
endpoint: `/groups/${groupId}/calendar`,
|
|
22
|
-
body: { calCode },
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
async createEvent({ auth, groupId, event, ...rest }) {
|
|
26
|
-
return await this.web.request({
|
|
27
|
-
method: 'POST', auth, ...rest,
|
|
28
|
-
endpoint: `/groups/${groupId}/calendar`,
|
|
29
|
-
body: event,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async updateEvent({ auth, groupId, eventId, event, ...rest }) {
|
|
33
|
-
return await this.web.request({
|
|
34
|
-
method: 'PATCH', auth, ...rest,
|
|
35
|
-
endpoint: `/groups/${groupId}/calendar/${eventId}`,
|
|
36
|
-
body: event,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async deleteEvent({ auth, groupId, eventId, ...rest }) {
|
|
40
|
-
return await this.web.request({
|
|
41
|
-
method: 'DELETE', auth, ...rest,
|
|
42
|
-
endpoint: `/groups/${groupId}/calendar/${eventId}`,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { BoardInput, NameInput, SingleOutput } from '../external/types';
|
|
2
|
-
import { BoardsManager } from '../core/manager';
|
|
3
|
-
import { GetBoardOutput } from './boards';
|
|
4
|
-
import { WithHeaders } from '../types';
|
|
5
|
-
export declare class APICategories {
|
|
6
|
-
private web;
|
|
7
|
-
constructor(web: BoardsManager);
|
|
8
|
-
getCategories({ auth, groupId, ...rest }: CategoriesFunctionsInput['getCategories']): Promise<import("..").WebResponse<GetCategoriesOutput>>;
|
|
9
|
-
getCategory({ auth, groupId, categoryId, ...rest }: CategoriesFunctionsInput['getCategory']): Promise<import("..").WebResponse<GetCategoryOutput>>;
|
|
10
|
-
createBoardInCategory({ auth, groupId, categoryId, body, ...rest }: CategoriesFunctionsInput['createBoardInCategory']): Promise<import("..").WebResponse<string>>;
|
|
11
|
-
updateCategory({ auth, groupId, categoryId, body, ...rest }: CategoriesFunctionsInput['updateCategory']): Promise<import("..").WebResponse<string>>;
|
|
12
|
-
moveCategory({ auth, groupId, categoryId, body, ...rest }: CategoriesFunctionsInput['moveCategory']): Promise<import("..").WebResponse<MoveCategoryOutput>>;
|
|
13
|
-
reorderBoardsInCategory({ auth, groupId, categoryId, body, ...rest }: CategoriesFunctionsInput['reorderBoards']): Promise<import("..").WebResponse<string>>;
|
|
14
|
-
deleteCategory({ auth, groupId, categoryId, ...rest }: CategoriesFunctionsInput['deleteCategory']): Promise<import("..").WebResponse<string>>;
|
|
15
|
-
}
|
|
16
|
-
export type CategoriesFunctionsInput = WithHeaders<{
|
|
17
|
-
'getCategories': {
|
|
18
|
-
auth: string;
|
|
19
|
-
groupId: string;
|
|
20
|
-
};
|
|
21
|
-
'getCategory': {
|
|
22
|
-
auth: string;
|
|
23
|
-
groupId: string;
|
|
24
|
-
categoryId: string;
|
|
25
|
-
};
|
|
26
|
-
'createBoardInCategory': {
|
|
27
|
-
auth: string;
|
|
28
|
-
groupId: string;
|
|
29
|
-
categoryId: string;
|
|
30
|
-
body: BoardInput & {
|
|
31
|
-
copyPermissionsFromBoardId?: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
'updateCategory': {
|
|
35
|
-
auth: string;
|
|
36
|
-
groupId: string;
|
|
37
|
-
categoryId: string;
|
|
38
|
-
body: NameInput;
|
|
39
|
-
};
|
|
40
|
-
'moveCategory': {
|
|
41
|
-
auth: string;
|
|
42
|
-
groupId: string;
|
|
43
|
-
categoryId: string;
|
|
44
|
-
body: MoveCategoryInput;
|
|
45
|
-
};
|
|
46
|
-
'reorderBoards': {
|
|
47
|
-
auth: string;
|
|
48
|
-
groupId: string;
|
|
49
|
-
categoryId: string;
|
|
50
|
-
body: string[];
|
|
51
|
-
};
|
|
52
|
-
'deleteCategory': {
|
|
53
|
-
auth: string;
|
|
54
|
-
groupId: string;
|
|
55
|
-
categoryId: string;
|
|
56
|
-
};
|
|
57
|
-
}>;
|
|
58
|
-
export type GetCategoriesOutput = (SingleOutput & {
|
|
59
|
-
boards: number;
|
|
60
|
-
group: SingleOutput;
|
|
61
|
-
})[];
|
|
62
|
-
export type GetCategoryOutput = {
|
|
63
|
-
group: SingleOutput;
|
|
64
|
-
category: SingleOutput;
|
|
65
|
-
boards: Omit<GetBoardOutput['board'], 'files'>[];
|
|
66
|
-
};
|
|
67
|
-
export type MoveCategoryInput = {
|
|
68
|
-
targetGroupId: string;
|
|
69
|
-
targetIndex?: number;
|
|
70
|
-
};
|
|
71
|
-
export type MoveCategoryOutput = {
|
|
72
|
-
categoryId: string;
|
|
73
|
-
groupId: string;
|
|
74
|
-
index: number;
|
|
75
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Data.
|
|
2
|
-
export class APICategories {
|
|
3
|
-
web;
|
|
4
|
-
constructor(web) {
|
|
5
|
-
this.web = web;
|
|
6
|
-
}
|
|
7
|
-
// Methods.
|
|
8
|
-
async getCategories({ auth, groupId, ...rest }) {
|
|
9
|
-
return await this.web.request({
|
|
10
|
-
method: 'GET', auth, ...rest,
|
|
11
|
-
endpoint: this.web.qp(`/groups/${groupId}`),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
async getCategory({ auth, groupId, categoryId, ...rest }) {
|
|
15
|
-
return await this.web.request({
|
|
16
|
-
method: 'GET', auth, ...rest,
|
|
17
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
async createBoardInCategory({ auth, groupId, categoryId, body, ...rest }) {
|
|
21
|
-
return await this.web.request({
|
|
22
|
-
method: 'POST', auth, body, ...rest,
|
|
23
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards`),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async updateCategory({ auth, groupId, categoryId, body, ...rest }) {
|
|
27
|
-
return await this.web.request({
|
|
28
|
-
method: 'PATCH', auth, body, ...rest,
|
|
29
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async moveCategory({ auth, groupId, categoryId, body, ...rest }) {
|
|
33
|
-
return await this.web.request({
|
|
34
|
-
method: 'POST', auth, body, ...rest,
|
|
35
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/move`),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
async reorderBoardsInCategory({ auth, groupId, categoryId, body, ...rest }) {
|
|
39
|
-
return await this.web.request({
|
|
40
|
-
method: 'PUT', auth, body, ...rest,
|
|
41
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards`),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
async deleteCategory({ auth, groupId, categoryId, ...rest }) {
|
|
45
|
-
return await this.web.request({
|
|
46
|
-
method: 'DELETE', auth, ...rest,
|
|
47
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}`),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { BoardsManager } from '../core/manager';
|
|
2
|
-
import { WithHeaders } from '../types';
|
|
3
|
-
export declare class APIFiles {
|
|
4
|
-
private web;
|
|
5
|
-
constructor(web: BoardsManager);
|
|
6
|
-
uploadBase64Files({ auth, boardId, files, ...rest }: FilesFunctionsInput['uploadBase64Files']): Promise<import("..").WebResponse<FileUploadResponse>>;
|
|
7
|
-
uploadRawFiles({ auth, boardId, files, ...rest }: FilesFunctionsInput['uploadRawFiles']): Promise<import("..").WebResponse<FileUploadResponse>>;
|
|
8
|
-
deleteFiles({ auth, boardId, fileIds, ...rest }: FilesFunctionsInput['deleteFiles']): Promise<import("..").WebResponse<string>>;
|
|
9
|
-
}
|
|
10
|
-
export type FilesFunctionsInput = WithHeaders<{
|
|
11
|
-
'uploadBase64Files': {
|
|
12
|
-
auth: string;
|
|
13
|
-
boardId: string;
|
|
14
|
-
files: Base64FileInput;
|
|
15
|
-
};
|
|
16
|
-
'uploadRawFiles': {
|
|
17
|
-
auth: string;
|
|
18
|
-
boardId: string;
|
|
19
|
-
files: RawFileInput[];
|
|
20
|
-
};
|
|
21
|
-
'deleteFiles': {
|
|
22
|
-
auth: string;
|
|
23
|
-
boardId: string;
|
|
24
|
-
fileIds: string[];
|
|
25
|
-
};
|
|
26
|
-
}>;
|
|
27
|
-
export type Base64FileInput = {
|
|
28
|
-
id: string;
|
|
29
|
-
data: string;
|
|
30
|
-
mimeType: string;
|
|
31
|
-
}[];
|
|
32
|
-
export type RawFileInput = {
|
|
33
|
-
file: File;
|
|
34
|
-
clientId: string;
|
|
35
|
-
};
|
|
36
|
-
export type FileUploadResponse = {
|
|
37
|
-
success: number;
|
|
38
|
-
failed: number;
|
|
39
|
-
files: FileUrlMapping[];
|
|
40
|
-
};
|
|
41
|
-
export type FileUrlMapping = {
|
|
42
|
-
clientId: string;
|
|
43
|
-
serverId: string;
|
|
44
|
-
url: string;
|
|
45
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export class APIFiles {
|
|
2
|
-
web;
|
|
3
|
-
constructor(web) {
|
|
4
|
-
this.web = web;
|
|
5
|
-
}
|
|
6
|
-
async uploadBase64Files({ auth, boardId, files, ...rest }) {
|
|
7
|
-
return await this.web.request({
|
|
8
|
-
method: 'POST', auth, ...rest,
|
|
9
|
-
endpoint: `/files/${boardId}/base64`,
|
|
10
|
-
body: files,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
async uploadRawFiles({ auth, boardId, files, ...rest }) {
|
|
14
|
-
const formData = new FormData();
|
|
15
|
-
for (const file of files) {
|
|
16
|
-
formData.append(`file-${file.clientId}`, file.file);
|
|
17
|
-
}
|
|
18
|
-
return await this.web.request({
|
|
19
|
-
method: 'POST', auth, ...rest,
|
|
20
|
-
endpoint: `/files/${boardId}/raw`,
|
|
21
|
-
body: formData,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
async deleteFiles({ auth, boardId, fileIds, ...rest }) {
|
|
25
|
-
return await this.web.request({
|
|
26
|
-
method: 'DELETE', auth, ...rest,
|
|
27
|
-
endpoint: `/files/${boardId}/delete`,
|
|
28
|
-
body: fileIds,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { SingleOutput } from '../external/types';
|
|
2
|
-
import { BoardsManager } from '../core/manager';
|
|
3
|
-
import { WithHeaders } from '../types';
|
|
4
|
-
export declare class APIFlashcards {
|
|
5
|
-
private web;
|
|
6
|
-
constructor(web: BoardsManager);
|
|
7
|
-
getDeck({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['getDeck']): Promise<import("..").WebResponse<FlashcardDeckResponse>>;
|
|
8
|
-
initializeDeck({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['initializeDeck']): Promise<import("..").WebResponse<string>>;
|
|
9
|
-
destroyDeck({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['destroyDeck']): Promise<import("..").WebResponse<string>>;
|
|
10
|
-
createCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['createCards']): Promise<import("..").WebResponse<string>>;
|
|
11
|
-
updateCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['updateCards']): Promise<import("..").WebResponse<string>>;
|
|
12
|
-
deleteCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['deleteCards']): Promise<import("..").WebResponse<string>>;
|
|
13
|
-
overrideCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['overrideCards']): Promise<import("..").WebResponse<string>>;
|
|
14
|
-
updateProgress({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['updateProgress']): Promise<import("..").WebResponse<string>>;
|
|
15
|
-
resetProgress({ auth, groupId, categoryId, boardId, ...rest }: FlashcardsFunctionsInput['resetProgress']): Promise<import("..").WebResponse<string>>;
|
|
16
|
-
reorderCards({ auth, groupId, categoryId, boardId, body, ...rest }: FlashcardsFunctionsInput['reorderCards']): Promise<import("..").WebResponse<string>>;
|
|
17
|
-
}
|
|
18
|
-
export type FlashcardsFunctionsInput = WithHeaders<{
|
|
19
|
-
getDeck: {
|
|
20
|
-
auth: string;
|
|
21
|
-
groupId: string;
|
|
22
|
-
categoryId: string;
|
|
23
|
-
boardId: string;
|
|
24
|
-
};
|
|
25
|
-
initializeDeck: {
|
|
26
|
-
auth: string;
|
|
27
|
-
groupId: string;
|
|
28
|
-
categoryId: string;
|
|
29
|
-
boardId: string;
|
|
30
|
-
};
|
|
31
|
-
destroyDeck: {
|
|
32
|
-
auth: string;
|
|
33
|
-
groupId: string;
|
|
34
|
-
categoryId: string;
|
|
35
|
-
boardId: string;
|
|
36
|
-
};
|
|
37
|
-
createCards: {
|
|
38
|
-
auth: string;
|
|
39
|
-
groupId: string;
|
|
40
|
-
categoryId: string;
|
|
41
|
-
boardId: string;
|
|
42
|
-
body: CardInput[];
|
|
43
|
-
};
|
|
44
|
-
updateCards: {
|
|
45
|
-
auth: string;
|
|
46
|
-
groupId: string;
|
|
47
|
-
categoryId: string;
|
|
48
|
-
boardId: string;
|
|
49
|
-
body: CardUpdateInput[];
|
|
50
|
-
};
|
|
51
|
-
deleteCards: {
|
|
52
|
-
auth: string;
|
|
53
|
-
groupId: string;
|
|
54
|
-
categoryId: string;
|
|
55
|
-
boardId: string;
|
|
56
|
-
body: string[];
|
|
57
|
-
};
|
|
58
|
-
overrideCards: {
|
|
59
|
-
auth: string;
|
|
60
|
-
groupId: string;
|
|
61
|
-
categoryId: string;
|
|
62
|
-
boardId: string;
|
|
63
|
-
body: CardInput[];
|
|
64
|
-
};
|
|
65
|
-
updateProgress: {
|
|
66
|
-
auth: string;
|
|
67
|
-
groupId: string;
|
|
68
|
-
categoryId: string;
|
|
69
|
-
boardId: string;
|
|
70
|
-
body: ProgressInput;
|
|
71
|
-
};
|
|
72
|
-
resetProgress: {
|
|
73
|
-
auth: string;
|
|
74
|
-
groupId: string;
|
|
75
|
-
categoryId: string;
|
|
76
|
-
boardId: string;
|
|
77
|
-
};
|
|
78
|
-
reorderCards: {
|
|
79
|
-
auth: string;
|
|
80
|
-
groupId: string;
|
|
81
|
-
categoryId: string;
|
|
82
|
-
boardId: string;
|
|
83
|
-
body: string[];
|
|
84
|
-
};
|
|
85
|
-
}>;
|
|
86
|
-
export type CardInput = {
|
|
87
|
-
front: string;
|
|
88
|
-
back: string;
|
|
89
|
-
};
|
|
90
|
-
export type CardUpdateInput = {
|
|
91
|
-
id: string;
|
|
92
|
-
front?: string;
|
|
93
|
-
back?: string;
|
|
94
|
-
};
|
|
95
|
-
export type ProgressInput = {
|
|
96
|
-
currentIndex: number;
|
|
97
|
-
completed?: boolean;
|
|
98
|
-
};
|
|
99
|
-
export type FlashcardDeckResponse = {
|
|
100
|
-
board: SingleOutput;
|
|
101
|
-
deck: {
|
|
102
|
-
id: string;
|
|
103
|
-
createdAt: Date;
|
|
104
|
-
updatedAt: Date;
|
|
105
|
-
};
|
|
106
|
-
cards: FlashcardCard[];
|
|
107
|
-
progress: {
|
|
108
|
-
completed: boolean;
|
|
109
|
-
lastStudied: Date;
|
|
110
|
-
currentIndex: number;
|
|
111
|
-
} | null;
|
|
112
|
-
};
|
|
113
|
-
export type FlashcardCard = {
|
|
114
|
-
id: string;
|
|
115
|
-
front: string;
|
|
116
|
-
back: string;
|
|
117
|
-
index: number;
|
|
118
|
-
createdAt: Date;
|
|
119
|
-
updatedAt: Date;
|
|
120
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// Data.
|
|
2
|
-
export class APIFlashcards {
|
|
3
|
-
web;
|
|
4
|
-
constructor(web) {
|
|
5
|
-
this.web = web;
|
|
6
|
-
}
|
|
7
|
-
// Methods.
|
|
8
|
-
async getDeck({ auth, groupId, categoryId, boardId, ...rest }) {
|
|
9
|
-
return await this.web.request({
|
|
10
|
-
method: 'GET', auth, ...rest,
|
|
11
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
async initializeDeck({ auth, groupId, categoryId, boardId, ...rest }) {
|
|
15
|
-
return await this.web.request({
|
|
16
|
-
method: 'POST', auth, ...rest,
|
|
17
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/initialize`),
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
async destroyDeck({ auth, groupId, categoryId, boardId, ...rest }) {
|
|
21
|
-
return await this.web.request({
|
|
22
|
-
method: 'POST', auth, ...rest,
|
|
23
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/destroy`),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async createCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
|
|
27
|
-
return await this.web.request({
|
|
28
|
-
method: 'POST', auth, body, ...rest,
|
|
29
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async updateCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
|
|
33
|
-
return await this.web.request({
|
|
34
|
-
method: 'PATCH', auth, body, ...rest,
|
|
35
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
async deleteCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
|
|
39
|
-
return await this.web.request({
|
|
40
|
-
method: 'DELETE', auth, body, ...rest,
|
|
41
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards`),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
async overrideCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
|
|
45
|
-
return await this.web.request({
|
|
46
|
-
method: 'PUT', auth, body, ...rest,
|
|
47
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/override`),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
async updateProgress({ auth, groupId, categoryId, boardId, body, ...rest }) {
|
|
51
|
-
return await this.web.request({
|
|
52
|
-
method: 'PATCH', auth, body, ...rest,
|
|
53
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/progress`),
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
async resetProgress({ auth, groupId, categoryId, boardId, ...rest }) {
|
|
57
|
-
return await this.web.request({
|
|
58
|
-
method: 'DELETE', auth, ...rest,
|
|
59
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/progress`),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
async reorderCards({ auth, groupId, categoryId, boardId, body, ...rest }) {
|
|
63
|
-
return await this.web.request({
|
|
64
|
-
method: 'PUT', auth, body, ...rest,
|
|
65
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories/${categoryId}/boards/${boardId}/flashcards/reorder`),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { NameInput, SingleOutput } from '../external/types';
|
|
2
|
-
import { BoardsManager } from '../core/manager';
|
|
3
|
-
import { WithHeaders } from '../types';
|
|
4
|
-
export declare class APIGroups {
|
|
5
|
-
private web;
|
|
6
|
-
constructor(web: BoardsManager);
|
|
7
|
-
getAllSorted({ auth, ...rest }: GroupsFunctionsInput['getAllSorted']): Promise<import("..").WebResponse<GetAllSortedOutput>>;
|
|
8
|
-
getGroups({ auth, ...rest }: GroupsFunctionsInput['getGroups']): Promise<import("..").WebResponse<GetGroupsOutput>>;
|
|
9
|
-
getGroup({ auth, groupId, ...rest }: GroupsFunctionsInput['getGroup']): Promise<import("..").WebResponse<GetGroupOutput>>;
|
|
10
|
-
createGroup({ auth, body, ...rest }: GroupsFunctionsInput['createGroup']): Promise<import("..").WebResponse<string>>;
|
|
11
|
-
createCategoryInGroup({ auth, groupId, body, ...rest }: GroupsFunctionsInput['createCategoryInGroup']): Promise<import("..").WebResponse<string>>;
|
|
12
|
-
updateGroup({ auth, groupId, body, ...rest }: GroupsFunctionsInput['updateGroup']): Promise<import("..").WebResponse<string>>;
|
|
13
|
-
reorderGroups({ auth, body, ...rest }: GroupsFunctionsInput['reorderGroups']): Promise<import("..").WebResponse<string>>;
|
|
14
|
-
reorderCategoriesInGroup({ auth, groupId, body, ...rest }: GroupsFunctionsInput['reorderCategoriesInGroup']): Promise<import("..").WebResponse<string>>;
|
|
15
|
-
deleteGroup({ auth, groupId, ...rest }: GroupsFunctionsInput['deleteGroup']): Promise<import("..").WebResponse<string>>;
|
|
16
|
-
}
|
|
17
|
-
export type GroupsFunctionsInput = WithHeaders<{
|
|
18
|
-
'getAllSorted': {
|
|
19
|
-
auth: string;
|
|
20
|
-
};
|
|
21
|
-
'getGroups': {
|
|
22
|
-
auth: string;
|
|
23
|
-
};
|
|
24
|
-
'getGroup': {
|
|
25
|
-
auth: string;
|
|
26
|
-
groupId: string;
|
|
27
|
-
};
|
|
28
|
-
'createGroup': {
|
|
29
|
-
auth: string;
|
|
30
|
-
body: NameInput & {
|
|
31
|
-
copyPermissionsFromGroupId?: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
'createCategoryInGroup': {
|
|
35
|
-
auth: string;
|
|
36
|
-
groupId: string;
|
|
37
|
-
body: NameInput & {
|
|
38
|
-
copyPermissionsFromCategoryId?: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
'updateGroup': {
|
|
42
|
-
auth: string;
|
|
43
|
-
groupId: string;
|
|
44
|
-
body: NameInput;
|
|
45
|
-
};
|
|
46
|
-
'reorderGroups': {
|
|
47
|
-
auth: string;
|
|
48
|
-
body: string[];
|
|
49
|
-
};
|
|
50
|
-
'reorderCategoriesInGroup': {
|
|
51
|
-
auth: string;
|
|
52
|
-
groupId: string;
|
|
53
|
-
body: string[];
|
|
54
|
-
};
|
|
55
|
-
'deleteGroup': {
|
|
56
|
-
auth: string;
|
|
57
|
-
groupId: string;
|
|
58
|
-
};
|
|
59
|
-
}>;
|
|
60
|
-
export type GetGroupsOutput = (SingleOutput & {
|
|
61
|
-
categories: number;
|
|
62
|
-
isDefault: boolean;
|
|
63
|
-
sizeBytes: number;
|
|
64
|
-
})[];
|
|
65
|
-
export type GetGroupOutput = {
|
|
66
|
-
group: SingleOutput;
|
|
67
|
-
categories: (SingleOutput & {
|
|
68
|
-
boards: number;
|
|
69
|
-
totalSizeBytes: number;
|
|
70
|
-
})[];
|
|
71
|
-
};
|
|
72
|
-
export type GetAllSortedOutput = (SingleOutput & {
|
|
73
|
-
categories: (SingleOutput & {
|
|
74
|
-
boards: (SingleOutput & {
|
|
75
|
-
hasFlashcards: boolean;
|
|
76
|
-
totalSizeBytes: number;
|
|
77
|
-
scheduledForDeletion: Date | null;
|
|
78
|
-
})[];
|
|
79
|
-
})[];
|
|
80
|
-
})[];
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// Data.
|
|
2
|
-
export class APIGroups {
|
|
3
|
-
web;
|
|
4
|
-
constructor(web) {
|
|
5
|
-
this.web = web;
|
|
6
|
-
}
|
|
7
|
-
// Methods.
|
|
8
|
-
async getAllSorted({ auth, ...rest }) {
|
|
9
|
-
return await this.web.request({
|
|
10
|
-
method: 'GET', auth, ...rest,
|
|
11
|
-
endpoint: this.web.qp('/all'),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
async getGroups({ auth, ...rest }) {
|
|
15
|
-
return await this.web.request({
|
|
16
|
-
method: 'GET', auth, ...rest,
|
|
17
|
-
endpoint: this.web.qp('/groups'),
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
async getGroup({ auth, groupId, ...rest }) {
|
|
21
|
-
return await this.web.request({
|
|
22
|
-
method: 'GET', auth, ...rest,
|
|
23
|
-
endpoint: this.web.qp(`/groups/${groupId}`),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async createGroup({ auth, body, ...rest }) {
|
|
27
|
-
return await this.web.request({
|
|
28
|
-
method: 'POST', auth, body, ...rest,
|
|
29
|
-
endpoint: this.web.qp('/groups'),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async createCategoryInGroup({ auth, groupId, body, ...rest }) {
|
|
33
|
-
return await this.web.request({
|
|
34
|
-
method: 'POST', auth, body, ...rest,
|
|
35
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories`),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
async updateGroup({ auth, groupId, body, ...rest }) {
|
|
39
|
-
return await this.web.request({
|
|
40
|
-
method: 'PATCH', auth, body, ...rest,
|
|
41
|
-
endpoint: this.web.qp(`/groups/${groupId}`),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
async reorderGroups({ auth, body, ...rest }) {
|
|
45
|
-
return await this.web.request({
|
|
46
|
-
method: 'PUT', auth, body, ...rest,
|
|
47
|
-
endpoint: this.web.qp('/groups'),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
async reorderCategoriesInGroup({ auth, groupId, body, ...rest }) {
|
|
51
|
-
return await this.web.request({
|
|
52
|
-
method: 'PUT', auth, body, ...rest,
|
|
53
|
-
endpoint: this.web.qp(`/groups/${groupId}/categories`),
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
async deleteGroup({ auth, groupId, ...rest }) {
|
|
57
|
-
return await this.web.request({
|
|
58
|
-
method: 'DELETE', auth, ...rest,
|
|
59
|
-
endpoint: this.web.qp(`/groups/${groupId}`),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|