@excali-boards/boards-api-client 1.1.1-dev.0 → 1.1.1-dev.10
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/{cjs/classes → classes}/admin.js +1 -1
- package/dist/classes/invites.d.ts +98 -0
- package/dist/{cjs/classes → classes}/invites.js +19 -1
- package/dist/{cjs/classes → classes}/permissions.d.ts +14 -3
- package/dist/{cjs/classes → classes}/permissions.js +6 -0
- package/dist/{esm/external → external}/types.d.ts +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +12 -23
- package/dist/cjs/classes/invites.d.ts +0 -82
- package/dist/cjs/external/types.d.ts +0 -28
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/classes/admin.d.ts +0 -26
- package/dist/esm/classes/admin.js +0 -20
- package/dist/esm/classes/auth.d.ts +0 -26
- package/dist/esm/classes/auth.js +0 -14
- package/dist/esm/classes/boards.d.ts +0 -77
- package/dist/esm/classes/boards.js +0 -50
- package/dist/esm/classes/categories.d.ts +0 -56
- package/dist/esm/classes/categories.js +0 -44
- package/dist/esm/classes/groups.d.ts +0 -74
- package/dist/esm/classes/groups.js +0 -62
- package/dist/esm/classes/invites.d.ts +0 -82
- package/dist/esm/classes/invites.js +0 -32
- package/dist/esm/classes/metrics.d.ts +0 -28
- package/dist/esm/classes/metrics.js +0 -20
- package/dist/esm/classes/permissions.d.ts +0 -50
- package/dist/esm/classes/permissions.js +0 -26
- package/dist/esm/classes/users.d.ts +0 -26
- package/dist/esm/classes/users.js +0 -28
- package/dist/esm/core/manager.d.ts +0 -34
- package/dist/esm/core/manager.js +0 -67
- package/dist/esm/core/utils.d.ts +0 -4
- package/dist/esm/core/utils.js +0 -21
- package/dist/esm/external/types.js +0 -4
- package/dist/esm/external/vars.d.ts +0 -92
- package/dist/esm/external/vars.js +0 -42
- package/dist/esm/index.d.ts +0 -13
- package/dist/esm/index.js +0 -13
- package/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/esm/types.d.ts +0 -54
- package/dist/esm/types.js +0 -1
- package/tsconfig.esm.json +0 -9
- /package/dist/{cjs/classes → classes}/admin.d.ts +0 -0
- /package/dist/{cjs/classes → classes}/auth.d.ts +0 -0
- /package/dist/{cjs/classes → classes}/auth.js +0 -0
- /package/dist/{cjs/classes → classes}/boards.d.ts +0 -0
- /package/dist/{cjs/classes → classes}/boards.js +0 -0
- /package/dist/{cjs/classes → classes}/categories.d.ts +0 -0
- /package/dist/{cjs/classes → classes}/categories.js +0 -0
- /package/dist/{cjs/classes → classes}/groups.d.ts +0 -0
- /package/dist/{cjs/classes → classes}/groups.js +0 -0
- /package/dist/{cjs/classes → classes}/metrics.d.ts +0 -0
- /package/dist/{cjs/classes → classes}/metrics.js +0 -0
- /package/dist/{cjs/classes → classes}/users.d.ts +0 -0
- /package/dist/{cjs/classes → classes}/users.js +0 -0
- /package/dist/{cjs/core → core}/manager.d.ts +0 -0
- /package/dist/{cjs/core → core}/manager.js +0 -0
- /package/dist/{cjs/core → core}/utils.d.ts +0 -0
- /package/dist/{cjs/core → core}/utils.js +0 -0
- /package/dist/{cjs/external → external}/types.js +0 -0
- /package/dist/{cjs/external → external}/vars.d.ts +0 -0
- /package/dist/{cjs/external → external}/vars.js +0 -0
- /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/index.js → index.js} +0 -0
- /package/dist/{cjs/types.d.ts → types.d.ts} +0 -0
- /package/dist/{cjs/types.js → types.js} +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { BulkViewPermissionsQuery, ViewPermissionsQuery } from './permissions';
|
|
2
|
+
import { BoardRole, CategoryRole, GroupRole } from '../external/vars';
|
|
3
|
+
import { GrantedRoles } from '../external/types';
|
|
4
|
+
import { Invite } from '../../prisma/generated';
|
|
5
|
+
import { BoardsManager } from '../core/manager';
|
|
6
|
+
export declare class APIInvites {
|
|
7
|
+
private web;
|
|
8
|
+
constructor(web: BoardsManager);
|
|
9
|
+
getUserInvites({ auth }: InvitesFunctionsInput['getUserInvites']): Promise<import("..").WebResponse<GetUserInvitesOutput>>;
|
|
10
|
+
getResourceInvites({ auth, query }: InvitesFunctionsInput['getResourceInvites']): Promise<import("..").WebResponse<GetResourceInvitesOutput>>;
|
|
11
|
+
bulkGetResourceInvites({ auth, query }: InvitesFunctionsInput['bulkGetResourceInvites']): Promise<import("..").WebResponse<GetResourceInvitesOutput>>;
|
|
12
|
+
getInviteDetails({ auth, code }: InvitesFunctionsInput['getInviteDetails']): Promise<import("..").WebResponse<InviteDetails>>;
|
|
13
|
+
createInvite({ auth, body }: InvitesFunctionsInput['createInvite']): Promise<import("..").WebResponse<CreateInviteOutput>>;
|
|
14
|
+
useInvite({ auth, code }: InvitesFunctionsInput['useInvite']): Promise<import("..").WebResponse<UseInviteOutput>>;
|
|
15
|
+
revokeInvite({ auth, code }: InvitesFunctionsInput['revokeInvite']): Promise<import("..").WebResponse<string>>;
|
|
16
|
+
}
|
|
17
|
+
export type InvitesFunctionsInput = {
|
|
18
|
+
'getUserInvites': {
|
|
19
|
+
auth: string;
|
|
20
|
+
};
|
|
21
|
+
'getResourceInvites': {
|
|
22
|
+
auth: string;
|
|
23
|
+
query: ViewPermissionsQuery;
|
|
24
|
+
};
|
|
25
|
+
'bulkGetResourceInvites': {
|
|
26
|
+
auth: string;
|
|
27
|
+
query: BulkViewPermissionsQuery;
|
|
28
|
+
};
|
|
29
|
+
'getInviteDetails': {
|
|
30
|
+
auth: string;
|
|
31
|
+
code: string;
|
|
32
|
+
};
|
|
33
|
+
'createInvite': {
|
|
34
|
+
auth: string;
|
|
35
|
+
body: CreateInviteInput;
|
|
36
|
+
};
|
|
37
|
+
'useInvite': {
|
|
38
|
+
auth: string;
|
|
39
|
+
code: string;
|
|
40
|
+
};
|
|
41
|
+
'revokeInvite': {
|
|
42
|
+
auth: string;
|
|
43
|
+
code: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export type CreateInviteInput = {
|
|
47
|
+
groupIds?: string[];
|
|
48
|
+
categoryIds?: string[];
|
|
49
|
+
boardIds?: string[];
|
|
50
|
+
groupRole?: GroupRole;
|
|
51
|
+
categoryRole?: CategoryRole;
|
|
52
|
+
boardRole?: BoardRole;
|
|
53
|
+
expiresIn?: number;
|
|
54
|
+
maxUses?: number;
|
|
55
|
+
};
|
|
56
|
+
export type CreateInviteOutput = {
|
|
57
|
+
code: string;
|
|
58
|
+
expiresAt: string;
|
|
59
|
+
maxUses: number;
|
|
60
|
+
};
|
|
61
|
+
export type GetUserInvitesOutput = Invite[];
|
|
62
|
+
export type GetResourceInvitesOutput = InviteData[];
|
|
63
|
+
export type UseInviteOutput = {
|
|
64
|
+
granted: GrantedRoles;
|
|
65
|
+
details: {
|
|
66
|
+
groups: {
|
|
67
|
+
groupId: string;
|
|
68
|
+
name: string;
|
|
69
|
+
}[];
|
|
70
|
+
categories: {
|
|
71
|
+
categoryId: string;
|
|
72
|
+
name: string;
|
|
73
|
+
groupId: string;
|
|
74
|
+
}[];
|
|
75
|
+
boards: {
|
|
76
|
+
boardId: string;
|
|
77
|
+
name: string;
|
|
78
|
+
categoryId: string;
|
|
79
|
+
}[];
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export type InviteDetails = Pick<Invite, 'code' | 'expiresAt' | 'maxUses' | 'currentUses'>;
|
|
83
|
+
export type InviteData = Pick<Invite, 'code' | 'expiresAt' | 'maxUses' | 'currentUses' | 'boardRole' | 'categoryRole' | 'groupRole'> & {
|
|
84
|
+
groups: {
|
|
85
|
+
groupId: string;
|
|
86
|
+
name: string;
|
|
87
|
+
}[];
|
|
88
|
+
categories: {
|
|
89
|
+
categoryId: string;
|
|
90
|
+
name: string;
|
|
91
|
+
groupId: string;
|
|
92
|
+
}[];
|
|
93
|
+
boards: {
|
|
94
|
+
boardId: string;
|
|
95
|
+
name: string;
|
|
96
|
+
categoryId: string;
|
|
97
|
+
}[];
|
|
98
|
+
};
|
|
@@ -8,12 +8,30 @@ class APIInvites {
|
|
|
8
8
|
this.web = web;
|
|
9
9
|
}
|
|
10
10
|
// Methods.
|
|
11
|
-
async
|
|
11
|
+
async getUserInvites({ auth }) {
|
|
12
12
|
return await this.web.request({
|
|
13
13
|
method: 'GET', auth,
|
|
14
14
|
endpoint: this.web.qp('/invites'),
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
async getResourceInvites({ auth, query }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'GET', auth,
|
|
20
|
+
endpoint: this.web.qp('/resources/invites', query),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async bulkGetResourceInvites({ auth, query }) {
|
|
24
|
+
return await this.web.request({
|
|
25
|
+
method: 'GET', auth,
|
|
26
|
+
endpoint: this.web.qp('/resources/invites/bulk', query),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async getInviteDetails({ auth, code }) {
|
|
30
|
+
return await this.web.request({
|
|
31
|
+
method: 'GET', auth,
|
|
32
|
+
endpoint: this.web.qp(`/invites/${code}`),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
17
35
|
async createInvite({ auth, body }) {
|
|
18
36
|
return await this.web.request({
|
|
19
37
|
method: 'POST', auth, body,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { BulkPermissions, GrantedRoles, ResourceType } from '../external/types';
|
|
1
2
|
import { BoardRole, CategoryRole, GroupRole } from '../external/vars';
|
|
2
|
-
import { ResourceType } from '../external/types';
|
|
3
3
|
import { BoardsManager } from '../core/manager';
|
|
4
4
|
export declare class APIPermissions {
|
|
5
5
|
private web;
|
|
6
6
|
constructor(web: BoardsManager);
|
|
7
7
|
viewPermissions({ auth, query }: PermissionsFunctionsInput['viewPermissions']): Promise<import("..").WebResponse<ViewPermissionsOutput>>;
|
|
8
|
+
bulkViewPermissions({ auth, query }: PermissionsFunctionsInput['bulkViewPermissions']): Promise<import("..").WebResponse<ViewPermissionsOutput>>;
|
|
8
9
|
grantPermissions({ auth, body }: PermissionsFunctionsInput['grantPermissions']): Promise<import("..").WebResponse<string>>;
|
|
9
10
|
revokePermissions({ auth, body }: PermissionsFunctionsInput['revokePermissions']): Promise<import("..").WebResponse<string>>;
|
|
10
11
|
}
|
|
@@ -13,6 +14,10 @@ export type PermissionsFunctionsInput = {
|
|
|
13
14
|
auth: string;
|
|
14
15
|
query: ViewPermissionsQuery;
|
|
15
16
|
};
|
|
17
|
+
'bulkViewPermissions': {
|
|
18
|
+
auth: string;
|
|
19
|
+
query: BulkViewPermissionsQuery;
|
|
20
|
+
};
|
|
16
21
|
'grantPermissions': {
|
|
17
22
|
auth: string;
|
|
18
23
|
body: GrantPermissionsInput;
|
|
@@ -28,19 +33,25 @@ export type ViewPermissionsQuery = {
|
|
|
28
33
|
categoryId?: string;
|
|
29
34
|
boardId?: string;
|
|
30
35
|
};
|
|
36
|
+
export type BulkViewPermissionsQuery = {
|
|
37
|
+
mode: BulkPermissions;
|
|
38
|
+
groupId?: string;
|
|
39
|
+
categoryId?: string;
|
|
40
|
+
};
|
|
31
41
|
export type ViewPermissionsOutput = {
|
|
32
42
|
userId: string;
|
|
33
43
|
email: string;
|
|
34
44
|
displayName: string;
|
|
35
45
|
avatarUrl: string | null;
|
|
46
|
+
permissions: GrantedRoles;
|
|
36
47
|
}[];
|
|
37
48
|
export type GrantPermissionsInput = {
|
|
38
49
|
userId: string;
|
|
39
50
|
groupIds?: string[];
|
|
40
|
-
categoryIds?: string[];
|
|
41
|
-
boardIds?: string[];
|
|
42
51
|
groupRole?: GroupRole;
|
|
52
|
+
categoryIds?: string[];
|
|
43
53
|
categoryRole?: CategoryRole;
|
|
54
|
+
boardIds?: string[];
|
|
44
55
|
boardRole?: BoardRole;
|
|
45
56
|
};
|
|
46
57
|
export type RevokePermissionsInput = {
|
|
@@ -14,6 +14,12 @@ class APIPermissions {
|
|
|
14
14
|
endpoint: this.web.qp('/permissions/view', query),
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
async bulkViewPermissions({ auth, query }) {
|
|
18
|
+
return await this.web.request({
|
|
19
|
+
method: 'GET', auth,
|
|
20
|
+
endpoint: this.web.qp('/permissions/view-bulk', query),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
17
23
|
async grantPermissions({ auth, body }) {
|
|
18
24
|
return await this.web.request({
|
|
19
25
|
method: 'POST', auth, body,
|
|
@@ -17,6 +17,13 @@ export declare enum GlobalRole {
|
|
|
17
17
|
export type AccessLevel = 'read' | 'write' | 'manage' | 'admin';
|
|
18
18
|
export type ResourceType = 'group' | 'category' | 'board';
|
|
19
19
|
export type GlobalResourceType = ResourceType | 'global';
|
|
20
|
+
export type BulkPermissions = 'all-groups' | 'group-categories' | 'category-boards';
|
|
21
|
+
export type GrantedRoles = GrantedRole[];
|
|
22
|
+
export type GrantedRole = {
|
|
23
|
+
type: ResourceType;
|
|
24
|
+
resourceId: string;
|
|
25
|
+
role: UserRole;
|
|
26
|
+
};
|
|
20
27
|
export type SingleOutput = {
|
|
21
28
|
id: string;
|
|
22
29
|
name: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/index.ts","../src/types.ts","../src/classes/admin.ts","../src/classes/auth.ts","../src/classes/boards.ts","../src/classes/categories.ts","../src/classes/groups.ts","../src/classes/invites.ts","../src/classes/metrics.ts","../src/classes/permissions.ts","../src/classes/users.ts","../src/core/manager.ts","../src/core/utils.ts","../src/external/types.ts","../src/external/vars.ts"],"version":"5.9.2"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.1-dev.
|
|
2
|
+
"version": "1.1.1-dev.10",
|
|
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",
|
|
@@ -7,33 +7,22 @@
|
|
|
7
7
|
"scripts": {
|
|
8
8
|
"ts": "pnpm install typescript --save-dev -g",
|
|
9
9
|
"init": "pnpm install && pnpm run build",
|
|
10
|
-
"build": "tsc --build
|
|
10
|
+
"build": "tsc --build",
|
|
11
11
|
"watch": "tsc --watch",
|
|
12
12
|
"lint": "eslint . --ext .ts",
|
|
13
13
|
"postinstall": "prisma generate",
|
|
14
14
|
"updates": "pnpm npm-check-updates -i --format group"
|
|
15
15
|
},
|
|
16
|
-
"main": "dist/
|
|
17
|
-
"
|
|
18
|
-
"types": "dist/cjs/index.d.ts",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
19
18
|
"license": "GPL-3.0",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"import": "./dist/esm/external/vars.js",
|
|
28
|
-
"require": "./dist/cjs/external/vars.js",
|
|
29
|
-
"types": "./dist/cjs/external/vars.d.ts"
|
|
30
|
-
},
|
|
31
|
-
"./prisma/generated/default": {
|
|
32
|
-
"import": "./prisma/generated/default.js",
|
|
33
|
-
"require": "./prisma/generated/default.js",
|
|
34
|
-
"types": "./prisma/generated/default.d.ts"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"prisma/schema",
|
|
22
|
+
"prisma.config.ts",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
37
26
|
"pnpm": {
|
|
38
27
|
"onlyBuiltDependencies": [
|
|
39
28
|
"@prisma/client",
|
|
@@ -58,4 +47,4 @@
|
|
|
58
47
|
"ts-prisma": "1.3.3",
|
|
59
48
|
"zod": "4.1.9"
|
|
60
49
|
}
|
|
61
|
-
}
|
|
50
|
+
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { BoardRole, CategoryRole, GroupRole } from '../external/vars';
|
|
2
|
-
import { ResourceType } from '../external/types';
|
|
3
|
-
import { BoardsManager } from '../core/manager';
|
|
4
|
-
export declare class APIInvites {
|
|
5
|
-
private web;
|
|
6
|
-
constructor(web: BoardsManager);
|
|
7
|
-
getInvites({ auth }: InvitesFunctionsInput['getInvites']): Promise<import("..").WebResponse<GetInvitesOutput>>;
|
|
8
|
-
createInvite({ auth, body }: InvitesFunctionsInput['createInvite']): Promise<import("..").WebResponse<CreateInviteOutput>>;
|
|
9
|
-
useInvite({ auth, code }: InvitesFunctionsInput['useInvite']): Promise<import("..").WebResponse<UseInviteOutput>>;
|
|
10
|
-
revokeInvite({ auth, code }: InvitesFunctionsInput['revokeInvite']): Promise<import("..").WebResponse<string>>;
|
|
11
|
-
}
|
|
12
|
-
export type InvitesFunctionsInput = {
|
|
13
|
-
'getInvites': {
|
|
14
|
-
auth: string;
|
|
15
|
-
};
|
|
16
|
-
'createInvite': {
|
|
17
|
-
auth: string;
|
|
18
|
-
body: CreateInviteInput;
|
|
19
|
-
};
|
|
20
|
-
'useInvite': {
|
|
21
|
-
auth: string;
|
|
22
|
-
code: string;
|
|
23
|
-
};
|
|
24
|
-
'revokeInvite': {
|
|
25
|
-
auth: string;
|
|
26
|
-
code: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type CreateInviteInput = {
|
|
30
|
-
groupIds?: string[];
|
|
31
|
-
categoryIds?: string[];
|
|
32
|
-
boardIds?: string[];
|
|
33
|
-
groupRole?: GroupRole;
|
|
34
|
-
categoryRole?: CategoryRole;
|
|
35
|
-
boardRole?: BoardRole;
|
|
36
|
-
expiresIn?: number;
|
|
37
|
-
maxUses?: number;
|
|
38
|
-
};
|
|
39
|
-
export type CreateInviteOutput = {
|
|
40
|
-
code: string;
|
|
41
|
-
expiresAt: string;
|
|
42
|
-
maxUses: number;
|
|
43
|
-
};
|
|
44
|
-
export type GetInvitesOutput = {
|
|
45
|
-
dbId: string;
|
|
46
|
-
code: string;
|
|
47
|
-
createdBy: string;
|
|
48
|
-
expiresAt: string | null;
|
|
49
|
-
maxUses: number | null;
|
|
50
|
-
currentUses: number;
|
|
51
|
-
groupIds: string[];
|
|
52
|
-
categoryIds: string[];
|
|
53
|
-
boardIds: string[];
|
|
54
|
-
groupRole: GroupRole | null;
|
|
55
|
-
categoryRole: CategoryRole | null;
|
|
56
|
-
boardRole: BoardRole | null;
|
|
57
|
-
createdAt: string;
|
|
58
|
-
}[];
|
|
59
|
-
export type GrantedRole = {
|
|
60
|
-
type: ResourceType;
|
|
61
|
-
resourceId: string;
|
|
62
|
-
role: BoardRole | CategoryRole | GroupRole;
|
|
63
|
-
};
|
|
64
|
-
export type UseInviteOutput = {
|
|
65
|
-
granted: GrantedRole[];
|
|
66
|
-
details: {
|
|
67
|
-
groups: {
|
|
68
|
-
groupId: string;
|
|
69
|
-
name: string;
|
|
70
|
-
}[];
|
|
71
|
-
categories: {
|
|
72
|
-
categoryId: string;
|
|
73
|
-
name: string;
|
|
74
|
-
groupId: string;
|
|
75
|
-
}[];
|
|
76
|
-
boards: {
|
|
77
|
-
boardId: string;
|
|
78
|
-
name: string;
|
|
79
|
-
categoryId: string;
|
|
80
|
-
}[];
|
|
81
|
-
};
|
|
82
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BoardRole, CategoryRole, GroupRole } from './vars';
|
|
2
|
-
import { TSPrisma } from '../../prisma/generated/default';
|
|
3
|
-
export type User = TSPrisma.TSPrismaModelsFull['User'];
|
|
4
|
-
export type Group = TSPrisma.TSPrismaModelsFull['Group'];
|
|
5
|
-
export type Category = TSPrisma.TSPrismaModelsFull['Category'];
|
|
6
|
-
export type Board = TSPrisma.TSPrismaModelsFull['Board'];
|
|
7
|
-
export type File = TSPrisma.TSPrismaModelsFull['File'];
|
|
8
|
-
export type LoginMethod = TSPrisma.TSPrismaModelsFull['LoginMethod'];
|
|
9
|
-
export type GroupPermission = TSPrisma.TSPrismaModelsFull['GroupPermission'];
|
|
10
|
-
export type CategoryPermission = TSPrisma.TSPrismaModelsFull['CategoryPermission'];
|
|
11
|
-
export type BoardPermission = TSPrisma.TSPrismaModelsFull['BoardPermission'];
|
|
12
|
-
export type Invite = TSPrisma.TSPrismaModelsFull['Invite'];
|
|
13
|
-
export type UserRole = BoardRole | CategoryRole | GroupRole | GlobalRole;
|
|
14
|
-
export declare enum GlobalRole {
|
|
15
|
-
Developer = "Developer"
|
|
16
|
-
}
|
|
17
|
-
export type AccessLevel = 'read' | 'write' | 'manage' | 'admin';
|
|
18
|
-
export type ResourceType = 'group' | 'category' | 'board';
|
|
19
|
-
export type GlobalResourceType = ResourceType | 'global';
|
|
20
|
-
export type SingleOutput = {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
index: number;
|
|
24
|
-
accessLevel: AccessLevel;
|
|
25
|
-
};
|
|
26
|
-
export type NameInput = {
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["../../src/index.ts","../../src/types.ts","../../src/classes/admin.ts","../../src/classes/auth.ts","../../src/classes/boards.ts","../../src/classes/categories.ts","../../src/classes/groups.ts","../../src/classes/invites.ts","../../src/classes/metrics.ts","../../src/classes/permissions.ts","../../src/classes/users.ts","../../src/core/manager.ts","../../src/core/utils.ts","../../src/external/types.ts","../../src/external/vars.ts"],"version":"5.9.2"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BoardsManager } from '../core/manager';
|
|
2
|
-
import { GetUsersOutput } from './users';
|
|
3
|
-
export declare class APIAdmin {
|
|
4
|
-
private web;
|
|
5
|
-
constructor(web: BoardsManager);
|
|
6
|
-
getUsers({ auth }: AdminFunctionsInput['getUsers']): Promise<import("..").WebResponse<GetUsersOutput[]>>;
|
|
7
|
-
getActiveRooms({ auth }: AdminFunctionsInput['getActiveRooms']): Promise<import("..").WebResponse<GetRoomsOutput<number>[]>>;
|
|
8
|
-
}
|
|
9
|
-
export type AdminFunctionsInput = {
|
|
10
|
-
'getUsers': {
|
|
11
|
-
auth: string;
|
|
12
|
-
};
|
|
13
|
-
'getActiveRooms': {
|
|
14
|
-
auth: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type GetRoomsOutput<T> = {
|
|
18
|
-
boardId: string;
|
|
19
|
-
elements: T;
|
|
20
|
-
collaborators: {
|
|
21
|
-
id: string;
|
|
22
|
-
socketId: string;
|
|
23
|
-
username: string;
|
|
24
|
-
avatarUrl: string | null;
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Data.
|
|
2
|
-
export class APIAdmin {
|
|
3
|
-
web;
|
|
4
|
-
constructor(web) {
|
|
5
|
-
this.web = web;
|
|
6
|
-
}
|
|
7
|
-
// Methods.
|
|
8
|
-
async getUsers({ auth }) {
|
|
9
|
-
return await this.web.request({
|
|
10
|
-
method: 'GET', auth,
|
|
11
|
-
endpoint: this.web.qp('/users'),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
async getActiveRooms({ auth }) {
|
|
15
|
-
return await this.web.request({
|
|
16
|
-
method: 'GET', auth,
|
|
17
|
-
endpoint: this.web.qp('/admin/rooms'),
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Platforms } from '../../prisma/generated/default';
|
|
2
|
-
import { BoardsManager } from '../core/manager';
|
|
3
|
-
export declare class APIAuth {
|
|
4
|
-
private web;
|
|
5
|
-
constructor(web: BoardsManager);
|
|
6
|
-
authenticate({ auth, body }: AuthFunctionsInput['authenticate']): Promise<import("..").WebResponse<AuthenticateOutput>>;
|
|
7
|
-
}
|
|
8
|
-
export type AuthFunctionsInput = {
|
|
9
|
-
'authenticate': {
|
|
10
|
-
auth: string;
|
|
11
|
-
body: AuthenticateInput;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type AuthenticateInput = {
|
|
15
|
-
platform: Platforms;
|
|
16
|
-
email: string;
|
|
17
|
-
displayName: string;
|
|
18
|
-
avatarUrl?: string | null;
|
|
19
|
-
currentUserId?: string;
|
|
20
|
-
};
|
|
21
|
-
export type AuthenticateOutput = {
|
|
22
|
-
email: string;
|
|
23
|
-
displayName: string | null;
|
|
24
|
-
avatarUrl: string | null;
|
|
25
|
-
platform: Platforms;
|
|
26
|
-
};
|
package/dist/esm/classes/auth.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Data.
|
|
2
|
-
export class APIAuth {
|
|
3
|
-
web;
|
|
4
|
-
constructor(web) {
|
|
5
|
-
this.web = web;
|
|
6
|
-
}
|
|
7
|
-
// Methods.
|
|
8
|
-
async authenticate({ auth, body }) {
|
|
9
|
-
return await this.web.request({
|
|
10
|
-
method: 'POST', auth, body,
|
|
11
|
-
endpoint: this.web.qp('/auth'),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { AccessLevel, NameInput, SingleOutput } from '../external/types';
|
|
2
|
-
import { BoardsManager } from '../core/manager';
|
|
3
|
-
import { GetRoomsOutput } from './admin';
|
|
4
|
-
export declare class APIBoards {
|
|
5
|
-
private web;
|
|
6
|
-
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
|
-
cancelBoardDeletion({ auth, categoryId, groupId, boardId }: BoardsFunctionsInput['cancelBoardDeletion']): Promise<import("..").WebResponse<string>>;
|
|
12
|
-
getBoardRoomData<T>({ auth, categoryId, groupId, boardId }: BoardsFunctionsInput['getRoomData']): Promise<import("..").WebResponse<GetRoomsOutput<T>>>;
|
|
13
|
-
kickUserFromRoom({ auth, categoryId, groupId, boardId, userId }: BoardsFunctionsInput['kickUserFromRoom']): Promise<import("..").WebResponse<string>>;
|
|
14
|
-
}
|
|
15
|
-
export type BoardsFunctionsInput = {
|
|
16
|
-
'getBoards': {
|
|
17
|
-
auth: string;
|
|
18
|
-
categoryId: string;
|
|
19
|
-
groupId: string;
|
|
20
|
-
};
|
|
21
|
-
'getBoard': {
|
|
22
|
-
auth: string;
|
|
23
|
-
categoryId: string;
|
|
24
|
-
groupId: string;
|
|
25
|
-
boardId: string;
|
|
26
|
-
};
|
|
27
|
-
'updateBoard': {
|
|
28
|
-
auth: string;
|
|
29
|
-
categoryId: string;
|
|
30
|
-
groupId: string;
|
|
31
|
-
boardId: string;
|
|
32
|
-
body: NameInput;
|
|
33
|
-
};
|
|
34
|
-
'scheduleBoardDeletion': {
|
|
35
|
-
auth: string;
|
|
36
|
-
categoryId: string;
|
|
37
|
-
groupId: string;
|
|
38
|
-
boardId: string;
|
|
39
|
-
};
|
|
40
|
-
'cancelBoardDeletion': {
|
|
41
|
-
auth: string;
|
|
42
|
-
categoryId: string;
|
|
43
|
-
groupId: string;
|
|
44
|
-
boardId: string;
|
|
45
|
-
};
|
|
46
|
-
'getRoomData': {
|
|
47
|
-
auth: string;
|
|
48
|
-
categoryId: string;
|
|
49
|
-
groupId: string;
|
|
50
|
-
boardId: string;
|
|
51
|
-
};
|
|
52
|
-
'kickUserFromRoom': {
|
|
53
|
-
auth: string;
|
|
54
|
-
categoryId: string;
|
|
55
|
-
groupId: string;
|
|
56
|
-
boardId: string;
|
|
57
|
-
userId: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export type GetBoardOutput = {
|
|
61
|
-
group: SingleOutput;
|
|
62
|
-
category: SingleOutput;
|
|
63
|
-
board: SingleOutput & {
|
|
64
|
-
dataUrl: string;
|
|
65
|
-
totalSizeBytes: number;
|
|
66
|
-
accessLevel: AccessLevel;
|
|
67
|
-
scheduledForDeletion: Date | null;
|
|
68
|
-
files: {
|
|
69
|
-
fileId: string;
|
|
70
|
-
mimeType: string;
|
|
71
|
-
createdAt: Date;
|
|
72
|
-
sizeBytes: number;
|
|
73
|
-
fileUrl: string;
|
|
74
|
-
}[];
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
export type GetFileOutput = ReadableStream | Blob;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export class APIBoards {
|
|
2
|
-
web;
|
|
3
|
-
constructor(web) {
|
|
4
|
-
this.web = web;
|
|
5
|
-
}
|
|
6
|
-
async getBoards({ auth, categoryId, groupId }) {
|
|
7
|
-
return await this.web.request({
|
|
8
|
-
method: 'GET', auth,
|
|
9
|
-
endpoint: this.web.qp(`/data/groups/${groupId}/categories/${categoryId}`),
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
async getBoard({ auth, categoryId, groupId, boardId }) {
|
|
13
|
-
return await this.web.request({
|
|
14
|
-
method: 'GET', auth,
|
|
15
|
-
endpoint: this.web.qp(`/data/groups/${groupId}/categories/${categoryId}/boards/${boardId}`),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
async updateBoard({ auth, categoryId, groupId, boardId, body }) {
|
|
19
|
-
return await this.web.request({
|
|
20
|
-
method: 'PATCH', auth, body,
|
|
21
|
-
endpoint: this.web.qp(`/data/groups/${groupId}/categories/${categoryId}/boards/${boardId}`),
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
async scheduleBoardDeletion({ auth, categoryId, groupId, boardId }) {
|
|
25
|
-
return await this.web.request({
|
|
26
|
-
method: 'DELETE', auth,
|
|
27
|
-
endpoint: this.web.qp(`/data/groups/${groupId}/categories/${categoryId}/boards/${boardId}`),
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
async cancelBoardDeletion({ auth, categoryId, groupId, boardId }) {
|
|
31
|
-
return await this.web.request({
|
|
32
|
-
method: 'POST', auth,
|
|
33
|
-
endpoint: this.web.qp(`/data/groups/${groupId}/categories/${categoryId}/boards/${boardId}/cancel-deletion`),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
async getBoardRoomData({ auth, categoryId, groupId, boardId }) {
|
|
37
|
-
return await this.web.request({
|
|
38
|
-
method: 'GET', auth,
|
|
39
|
-
endpoint: this.web.qp(`/data/groups/${groupId}/categories/${categoryId}/boards/${boardId}/room`),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
async kickUserFromRoom({ auth, categoryId, groupId, boardId, userId }) {
|
|
43
|
-
return await this.web.request({
|
|
44
|
-
method: 'POST', auth,
|
|
45
|
-
endpoint: this.web.qp(`/data/groups/${groupId}/categories/${categoryId}/boards/${boardId}/room`, {
|
|
46
|
-
userId,
|
|
47
|
-
}),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { NameInput, SingleOutput } from '../external/types';
|
|
2
|
-
import { BoardsManager } from '../core/manager';
|
|
3
|
-
import { GetBoardOutput } from './boards';
|
|
4
|
-
export declare class APICategories {
|
|
5
|
-
private web;
|
|
6
|
-
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>>;
|
|
13
|
-
}
|
|
14
|
-
export type CategoriesFunctionsInput = {
|
|
15
|
-
'getCategories': {
|
|
16
|
-
auth: string;
|
|
17
|
-
groupId: string;
|
|
18
|
-
};
|
|
19
|
-
'getCategory': {
|
|
20
|
-
auth: string;
|
|
21
|
-
groupId: string;
|
|
22
|
-
categoryId: string;
|
|
23
|
-
};
|
|
24
|
-
'createBoardInCategory': {
|
|
25
|
-
auth: string;
|
|
26
|
-
groupId: string;
|
|
27
|
-
categoryId: string;
|
|
28
|
-
body: NameInput;
|
|
29
|
-
};
|
|
30
|
-
'updateCategory': {
|
|
31
|
-
auth: string;
|
|
32
|
-
groupId: string;
|
|
33
|
-
categoryId: string;
|
|
34
|
-
body: NameInput;
|
|
35
|
-
};
|
|
36
|
-
'reorderBoards': {
|
|
37
|
-
auth: string;
|
|
38
|
-
groupId: string;
|
|
39
|
-
categoryId: string;
|
|
40
|
-
body: string[];
|
|
41
|
-
};
|
|
42
|
-
'deleteCategory': {
|
|
43
|
-
auth: string;
|
|
44
|
-
groupId: string;
|
|
45
|
-
categoryId: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export type GetCategoriesOutput = (SingleOutput & {
|
|
49
|
-
boards: number;
|
|
50
|
-
group: SingleOutput;
|
|
51
|
-
})[];
|
|
52
|
-
export type GetCategoryOutput = {
|
|
53
|
-
group: SingleOutput;
|
|
54
|
-
category: SingleOutput;
|
|
55
|
-
boards: Omit<GetBoardOutput['board'], 'files'>[];
|
|
56
|
-
};
|