@excali-boards/boards-api-client 1.1.70 → 1.1.71

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.
@@ -9,6 +9,10 @@ export declare class APISessions {
9
9
  deleteSession({ auth, dbId, ...rest }: SessionsFunctionsInput['deleteSession']): Promise<import("../types.js").WebResponse<string>>;
10
10
  deleteAllSessions({ auth, ...rest }: SessionsFunctionsInput['deleteAllSessions']): Promise<import("../types.js").WebResponse<string>>;
11
11
  rotateLinkedSession({ auth, body, ...rest }: SessionsFunctionsInput['rotateLinkedSession']): Promise<import("../types.js").WebResponse<string>>;
12
+ createQrLoginChallenge({ auth, ...rest }: SessionsFunctionsInput['createQrLoginChallenge']): Promise<import("../types.js").WebResponse<QrLoginChallengeOutput>>;
13
+ getQrLoginChallengeStatus({ auth, body, ...rest }: SessionsFunctionsInput['getQrLoginChallengeStatus']): Promise<import("../types.js").WebResponse<QrLoginChallengeStatusOutput>>;
14
+ approveQrLogin({ auth, body, ...rest }: SessionsFunctionsInput['approveQrLogin']): Promise<import("../types.js").WebResponse<QrLoginApprovalOutput>>;
15
+ completeQrLogin({ auth, body, ...rest }: SessionsFunctionsInput['completeQrLogin']): Promise<import("../types.js").WebResponse<QrLoginCompletionOutput>>;
12
16
  }
13
17
  export type SessionsFunctionsInput = WithHeaders<{
14
18
  'createSession': {
@@ -29,6 +33,21 @@ export type SessionsFunctionsInput = WithHeaders<{
29
33
  auth: string;
30
34
  body: UnlinkLoginMethodInput;
31
35
  };
36
+ 'createQrLoginChallenge': {
37
+ auth: string;
38
+ };
39
+ 'getQrLoginChallengeStatus': {
40
+ auth: string;
41
+ body: QrLoginChallengeInput;
42
+ };
43
+ 'approveQrLogin': {
44
+ auth: string;
45
+ body: QrLoginApprovalInput;
46
+ };
47
+ 'completeQrLogin': {
48
+ auth: string;
49
+ body: QrLoginCompletionInput;
50
+ };
32
51
  }>;
33
52
  export type CreateSessionInput = {
34
53
  ip?: string;
@@ -54,8 +73,35 @@ export type SessionsOutput = {
54
73
  expiresAt: Date;
55
74
  createdAt: Date;
56
75
  lastUsed: Date;
76
+ isQrLogin: boolean;
57
77
  }[];
58
78
  };
79
+ export type QrLoginChallengeInput = {
80
+ challengeId: string;
81
+ secret: string;
82
+ };
83
+ export type QrLoginChallengeOutput = QrLoginChallengeInput & {
84
+ expiresAt: Date;
85
+ };
86
+ export type QrLoginChallengeStatusOutput = {
87
+ status: 'pending' | 'approved' | 'consumed' | 'expired';
88
+ expiresAt?: Date;
89
+ };
90
+ export type QrLoginApprovalInput = QrLoginChallengeInput & {
91
+ expiresInSeconds: number;
92
+ };
93
+ export type QrLoginApprovalOutput = {
94
+ status: 'approved';
95
+ expiresAt: Date;
96
+ };
97
+ export type QrLoginCompletionInput = QrLoginChallengeInput & {
98
+ device?: Device;
99
+ ip?: string;
100
+ };
101
+ export type QrLoginCompletionOutput = {
102
+ token: string;
103
+ expiresAt: Date;
104
+ };
59
105
  export type UnlinkLoginMethodInput = {
60
106
  platform: Platforms;
61
107
  };
@@ -35,4 +35,28 @@ export class APISessions {
35
35
  endpoint: this.web.qp('/sessions/rotate'),
36
36
  });
37
37
  }
38
+ async createQrLoginChallenge({ auth, ...rest }) {
39
+ return await this.web.request({
40
+ method: 'POST', auth, ...rest,
41
+ endpoint: this.web.qp('/auth/qr/challenges'),
42
+ });
43
+ }
44
+ async getQrLoginChallengeStatus({ auth, body, ...rest }) {
45
+ return await this.web.request({
46
+ method: 'POST', auth, body, ...rest,
47
+ endpoint: this.web.qp('/auth/qr/challenges/status'),
48
+ });
49
+ }
50
+ async approveQrLogin({ auth, body, ...rest }) {
51
+ return await this.web.request({
52
+ method: 'POST', auth, body, ...rest,
53
+ endpoint: this.web.qp('/auth/qr/challenges/approve'),
54
+ });
55
+ }
56
+ async completeQrLogin({ auth, body, ...rest }) {
57
+ return await this.web.request({
58
+ method: 'POST', auth, body, ...rest,
59
+ endpoint: this.web.qp('/auth/qr/challenges/complete'),
60
+ });
61
+ }
38
62
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.70",
2
+ "version": "1.1.71",
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",