@excali-boards/boards-api-client 1.1.1-dev.16 → 1.1.1-dev.18

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.
@@ -5,29 +5,28 @@ export declare class APIUsers {
5
5
  private web;
6
6
  constructor(web: BoardsManager);
7
7
  getCurrentUser({ auth }: UsersFunctionsInput['getCurrentUser']): Promise<import("..").WebResponse<GetUsersOutput>>;
8
- changeMainPlatform({ auth, newMainPlatform }: UsersFunctionsInput['changeMainPlatform']): Promise<import("..").WebResponse<string>>;
9
- changeMainGroup({ auth, newMainGroupId }: UsersFunctionsInput['changeMainGroup']): Promise<import("..").WebResponse<string>>;
8
+ updateUser({ auth, body }: UsersFunctionsInput['updateUser']): Promise<import("..").WebResponse<string>>;
10
9
  deleteAccount({ auth }: UsersFunctionsInput['deleteAccount']): Promise<import("..").WebResponse<void>>;
11
10
  }
12
11
  export type UsersFunctionsInput = {
13
12
  'getCurrentUser': {
14
13
  auth: string;
15
14
  };
16
- 'deleteAccount': {
17
- auth: string;
18
- };
19
- 'isCurrentUserDev': {
15
+ 'updateUser': {
20
16
  auth: string;
17
+ body: UserInput;
21
18
  };
22
- 'changeMainPlatform': {
19
+ 'deleteAccount': {
23
20
  auth: string;
24
- newMainPlatform: Platforms;
25
21
  };
26
- 'changeMainGroup': {
22
+ 'isCurrentUserDev': {
27
23
  auth: string;
28
- newMainGroupId: string | null;
29
24
  };
30
25
  };
31
26
  export type GetUsersOutput = DBUserPartialType & {
32
27
  isDev: boolean;
33
28
  };
29
+ export type UserInput = {
30
+ mainGroupId?: string | null;
31
+ platform?: Platforms;
32
+ };
@@ -14,18 +14,10 @@ class APIUsers {
14
14
  endpoint: this.web.qp('/users'),
15
15
  });
16
16
  }
17
- async changeMainPlatform({ auth, newMainPlatform }) {
17
+ async updateUser({ auth, body }) {
18
18
  return await this.web.request({
19
- method: 'PATCH', auth,
20
- endpoint: this.web.qp('/users/platform'),
21
- body: { name: newMainPlatform },
22
- });
23
- }
24
- async changeMainGroup({ auth, newMainGroupId }) {
25
- return await this.web.request({
26
- method: 'PATCH', auth,
27
- endpoint: this.web.qp('/users/group'),
28
- body: { groupId: newMainGroupId },
19
+ method: 'PATCH', auth, body,
20
+ endpoint: this.web.qp('/users'),
29
21
  });
30
22
  }
31
23
  async deleteAccount({ auth }) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.1-dev.16",
2
+ "version": "1.1.1-dev.18",
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",
@@ -16,6 +16,26 @@ model User {
16
16
  boardPermissions BoardPermission[]
17
17
 
18
18
  createdInvites Invite[]
19
+ sessions Session[]
20
+ }
21
+
22
+ model Session {
23
+ dbId String @id @default(uuid())
24
+
25
+ token String @unique
26
+
27
+ locationEncrypted String?
28
+ deviceEncrypted String?
29
+
30
+ userId String
31
+ user User @relation(fields: [userId], references: [userId], onDelete: Cascade)
32
+
33
+ createdAt DateTime @default(now())
34
+ expiresAt DateTime
35
+ lastUsed DateTime @default(now())
36
+
37
+ @@index([userId])
38
+ @@index([expiresAt])
19
39
  }
20
40
 
21
41
  model LoginMethod {