@excali-boards/boards-api-client 1.1.1-dev.23 → 1.1.1-dev.25

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,6 +1,5 @@
1
- import { BulkViewPermissionsQuery, ViewPermissionsQuery } from './permissions';
2
1
  import { BoardRole, CategoryRole, GroupRole } from '../external/vars';
3
- import { GrantedRoles } from '../external/types';
2
+ import { GrantedRoles, ResourceType } from '../external/types';
4
3
  import { Invite } from '../../prisma/generated';
5
4
  import { BoardsManager } from '../core/manager';
6
5
  export declare class APIInvites {
@@ -8,7 +7,6 @@ export declare class APIInvites {
8
7
  constructor(web: BoardsManager);
9
8
  getUserInvites({ auth }: InvitesFunctionsInput['getUserInvites']): Promise<import("..").WebResponse<GetUserInvitesOutput>>;
10
9
  getResourceInvites({ auth, query }: InvitesFunctionsInput['getResourceInvites']): Promise<import("..").WebResponse<GetResourceInvitesOutput>>;
11
- bulkGetResourceInvites({ auth, query }: InvitesFunctionsInput['bulkGetResourceInvites']): Promise<import("..").WebResponse<GetResourceInvitesOutput>>;
12
10
  getInviteDetails({ auth, code }: InvitesFunctionsInput['getInviteDetails']): Promise<import("..").WebResponse<InviteDetails>>;
13
11
  createInvite({ auth, body }: InvitesFunctionsInput['createInvite']): Promise<import("..").WebResponse<CreateInviteOutput>>;
14
12
  useInvite({ auth, code }: InvitesFunctionsInput['useInvite']): Promise<import("..").WebResponse<UseInviteOutput>>;
@@ -20,11 +18,7 @@ export type InvitesFunctionsInput = {
20
18
  };
21
19
  'getResourceInvites': {
22
20
  auth: string;
23
- query: ViewPermissionsQuery;
24
- };
25
- 'bulkGetResourceInvites': {
26
- auth: string;
27
- query: BulkViewPermissionsQuery;
21
+ query: ViewInvitesQuery;
28
22
  };
29
23
  'getInviteDetails': {
30
24
  auth: string;
@@ -43,6 +37,12 @@ export type InvitesFunctionsInput = {
43
37
  code: string;
44
38
  };
45
39
  };
40
+ export type ViewInvitesQuery = {
41
+ type: ResourceType;
42
+ groupId?: string;
43
+ categoryId?: string;
44
+ boardId?: string;
45
+ };
46
46
  export type CreateInviteInput = {
47
47
  groupIds?: string[];
48
48
  categoryIds?: string[];
@@ -20,12 +20,6 @@ class APIInvites {
20
20
  endpoint: this.web.qp('/resources/invites', query),
21
21
  });
22
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
23
  async getInviteDetails({ auth, code }) {
30
24
  return await this.web.request({
31
25
  method: 'GET', auth,
@@ -1,11 +1,10 @@
1
- import { BulkPermissions, GrantedRoles, ResourceType } from '../external/types';
2
1
  import { BoardRole, CategoryRole, GroupRole } from '../external/vars';
2
+ import { GrantedEntry, 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>>;
9
8
  grantPermissions({ auth, body }: PermissionsFunctionsInput['grantPermissions']): Promise<import("..").WebResponse<string>>;
10
9
  revokePermissions({ auth, body }: PermissionsFunctionsInput['revokePermissions']): Promise<import("..").WebResponse<string>>;
11
10
  }
@@ -14,10 +13,6 @@ export type PermissionsFunctionsInput = {
14
13
  auth: string;
15
14
  query: ViewPermissionsQuery;
16
15
  };
17
- 'bulkViewPermissions': {
18
- auth: string;
19
- query: BulkViewPermissionsQuery;
20
- };
21
16
  'grantPermissions': {
22
17
  auth: string;
23
18
  body: GrantPermissionsInput;
@@ -29,21 +24,14 @@ export type PermissionsFunctionsInput = {
29
24
  };
30
25
  export type ViewPermissionsQuery = {
31
26
  type: ResourceType;
32
- groupId?: string;
33
- categoryId?: string;
34
- boardId?: string;
35
- };
36
- export type BulkViewPermissionsQuery = {
37
- mode: BulkPermissions;
38
- groupId?: string;
39
- categoryId?: string;
27
+ id: string;
40
28
  };
41
29
  export type ViewPermissionsOutput = {
42
30
  userId: string;
43
31
  email: string;
44
32
  displayName: string;
45
33
  avatarUrl: string | null;
46
- permissions: GrantedRoles;
34
+ permissions: GrantedEntry[];
47
35
  }[];
48
36
  export type GrantPermissionsInput = {
49
37
  userId: string;
@@ -14,12 +14,6 @@ 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
- }
23
17
  async grantPermissions({ auth, body }) {
24
18
  return await this.web.request({
25
19
  method: 'POST', auth, body,
@@ -17,7 +17,6 @@ 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
20
  export type GrantedRoles = GrantedRole[];
22
21
  export type GrantedRole = {
23
22
  type: ResourceType;
@@ -33,3 +32,10 @@ export type SingleOutput = {
33
32
  export type NameInput = {
34
33
  name: string;
35
34
  };
35
+ export type GrantedEntry = {
36
+ type: ResourceType;
37
+ role: UserRole;
38
+ resourceId: string;
39
+ basedOnType: ResourceType;
40
+ basedOnResourceId: string;
41
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.1-dev.23",
2
+ "version": "1.1.1-dev.25",
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",