@excali-boards/boards-api-client 1.1.70 → 1.1.72
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/sessions.d.ts +63 -0
- package/dist/classes/sessions.js +17 -20
- package/package.json +2 -2
- package/prisma/generated/edge.js +4 -3
- package/prisma/generated/index-browser.js +1 -0
- package/prisma/generated/index.d.ts +37 -1
- package/prisma/generated/index.js +4 -3
- package/prisma/generated/package.json +1 -1
- package/prisma/generated/schema.prisma +1 -0
- package/prisma/generated/wasm.js +4 -3
- package/prisma/schema/user.prisma +1 -0
|
@@ -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, body, ...rest }: SessionsFunctionsInput['createQrLoginChallenge']): Promise<import("../types.js").WebResponse<QrLoginChallengeOutput>>;
|
|
13
|
+
lookupQrLoginChallenge({ auth, body, ...rest }: SessionsFunctionsInput['lookupQrLoginChallenge']): Promise<import("../types.js").WebResponse<QrLoginChallengeLookupOutput>>;
|
|
14
|
+
decideQrLogin({ auth, body, ...rest }: SessionsFunctionsInput['decideQrLogin']): Promise<import("../types.js").WebResponse<QrLoginDecisionOutput>>;
|
|
15
|
+
redeemQrLogin({ auth, body, ...rest }: SessionsFunctionsInput['redeemQrLogin']): Promise<import("../types.js").WebResponse<QrLoginRedeemOutput>>;
|
|
12
16
|
}
|
|
13
17
|
export type SessionsFunctionsInput = WithHeaders<{
|
|
14
18
|
'createSession': {
|
|
@@ -29,6 +33,22 @@ export type SessionsFunctionsInput = WithHeaders<{
|
|
|
29
33
|
auth: string;
|
|
30
34
|
body: UnlinkLoginMethodInput;
|
|
31
35
|
};
|
|
36
|
+
'createQrLoginChallenge': {
|
|
37
|
+
auth: string;
|
|
38
|
+
body: QrLoginChallengeCreateInput;
|
|
39
|
+
};
|
|
40
|
+
'lookupQrLoginChallenge': {
|
|
41
|
+
auth: string;
|
|
42
|
+
body: QrLoginCodeInput;
|
|
43
|
+
};
|
|
44
|
+
'decideQrLogin': {
|
|
45
|
+
auth: string;
|
|
46
|
+
body: QrLoginDecisionInput;
|
|
47
|
+
};
|
|
48
|
+
'redeemQrLogin': {
|
|
49
|
+
auth: string;
|
|
50
|
+
body: QrLoginRedeemInput;
|
|
51
|
+
};
|
|
32
52
|
}>;
|
|
33
53
|
export type CreateSessionInput = {
|
|
34
54
|
ip?: string;
|
|
@@ -54,8 +74,51 @@ export type SessionsOutput = {
|
|
|
54
74
|
expiresAt: Date;
|
|
55
75
|
createdAt: Date;
|
|
56
76
|
lastUsed: Date;
|
|
77
|
+
isQrLogin: boolean;
|
|
57
78
|
}[];
|
|
58
79
|
};
|
|
80
|
+
export type QrLoginChallengeCreateInput = {
|
|
81
|
+
requestDevice?: string;
|
|
82
|
+
};
|
|
83
|
+
export type QrLoginChallengeOutput = {
|
|
84
|
+
deviceCode: string;
|
|
85
|
+
userCode: string;
|
|
86
|
+
expiresAt: Date;
|
|
87
|
+
requestDevice: string | null;
|
|
88
|
+
};
|
|
89
|
+
export type QrLoginCodeInput = {
|
|
90
|
+
userCode: string;
|
|
91
|
+
};
|
|
92
|
+
export type QrLoginStatus = 'pending' | 'approved' | 'denied';
|
|
93
|
+
export type QrLoginChallengeLookupOutput = {
|
|
94
|
+
status: QrLoginStatus;
|
|
95
|
+
userCode: string;
|
|
96
|
+
expiresAt: Date;
|
|
97
|
+
requestDevice: string | null;
|
|
98
|
+
};
|
|
99
|
+
export type QrLoginDecisionInput = QrLoginCodeInput & {
|
|
100
|
+
decision: 'approve' | 'deny';
|
|
101
|
+
expiresInSeconds?: number;
|
|
102
|
+
};
|
|
103
|
+
export type QrLoginDecisionOutput = {
|
|
104
|
+
status: 'approved';
|
|
105
|
+
expiresAt: Date;
|
|
106
|
+
} | {
|
|
107
|
+
status: 'denied';
|
|
108
|
+
};
|
|
109
|
+
export type QrLoginRedeemInput = {
|
|
110
|
+
deviceCode: string;
|
|
111
|
+
device?: Device;
|
|
112
|
+
};
|
|
113
|
+
export type QrLoginRedeemOutput = {
|
|
114
|
+
status: 'pending' | 'denied' | 'expired';
|
|
115
|
+
token?: undefined;
|
|
116
|
+
expiresAt?: undefined;
|
|
117
|
+
} | {
|
|
118
|
+
status: 'approved';
|
|
119
|
+
token: string;
|
|
120
|
+
expiresAt: Date;
|
|
121
|
+
};
|
|
59
122
|
export type UnlinkLoginMethodInput = {
|
|
60
123
|
platform: Platforms;
|
|
61
124
|
};
|
package/dist/classes/sessions.js
CHANGED
|
@@ -6,33 +6,30 @@ export class APISessions {
|
|
|
6
6
|
}
|
|
7
7
|
// Methods.
|
|
8
8
|
async createSession({ auth, body, ...rest }) {
|
|
9
|
-
return await this.web.request({
|
|
10
|
-
method: 'POST', auth, body, ...rest,
|
|
11
|
-
endpoint: this.web.qp('/sessions'),
|
|
12
|
-
});
|
|
9
|
+
return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/sessions') });
|
|
13
10
|
}
|
|
14
11
|
async getAllSessions({ auth, ...rest }) {
|
|
15
|
-
return await this.web.request({
|
|
16
|
-
method: 'GET', auth, ...rest,
|
|
17
|
-
endpoint: this.web.qp('/sessions'),
|
|
18
|
-
});
|
|
12
|
+
return await this.web.request({ method: 'GET', auth, ...rest, endpoint: this.web.qp('/sessions') });
|
|
19
13
|
}
|
|
20
14
|
async deleteSession({ auth, dbId, ...rest }) {
|
|
21
|
-
return await this.web.request({
|
|
22
|
-
method: 'DELETE', auth, body: { dbId }, ...rest,
|
|
23
|
-
endpoint: this.web.qp('/sessions'),
|
|
24
|
-
});
|
|
15
|
+
return await this.web.request({ method: 'DELETE', auth, body: { dbId }, ...rest, endpoint: this.web.qp('/sessions') });
|
|
25
16
|
}
|
|
26
17
|
async deleteAllSessions({ auth, ...rest }) {
|
|
27
|
-
return await this.web.request({
|
|
28
|
-
method: 'DELETE', auth, ...rest,
|
|
29
|
-
endpoint: this.web.qp('/sessions/all'),
|
|
30
|
-
});
|
|
18
|
+
return await this.web.request({ method: 'DELETE', auth, ...rest, endpoint: this.web.qp('/sessions/all') });
|
|
31
19
|
}
|
|
32
20
|
async rotateLinkedSession({ auth, body, ...rest }) {
|
|
33
|
-
return await this.web.request({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
21
|
+
return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/sessions/rotate') });
|
|
22
|
+
}
|
|
23
|
+
async createQrLoginChallenge({ auth, body, ...rest }) {
|
|
24
|
+
return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/auth/qr/challenges') });
|
|
25
|
+
}
|
|
26
|
+
async lookupQrLoginChallenge({ auth, body, ...rest }) {
|
|
27
|
+
return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/auth/qr/challenges/lookup') });
|
|
28
|
+
}
|
|
29
|
+
async decideQrLogin({ auth, body, ...rest }) {
|
|
30
|
+
return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/auth/qr/challenges/decision') });
|
|
31
|
+
}
|
|
32
|
+
async redeemQrLogin({ auth, body, ...rest }) {
|
|
33
|
+
return await this.web.request({ method: 'POST', auth, body, ...rest, endpoint: this.web.qp('/auth/qr/challenges/redeem') });
|
|
37
34
|
}
|
|
38
35
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.
|
|
2
|
+
"version": "1.1.72",
|
|
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,7 +7,7 @@
|
|
|
7
7
|
"scripts": {
|
|
8
8
|
"ts": "pnpm install typescript --save-dev -g",
|
|
9
9
|
"init": "pnpm install && pnpm run build",
|
|
10
|
-
"build": "tsc
|
|
10
|
+
"build": "tsc",
|
|
11
11
|
"postinstall": "prisma generate",
|
|
12
12
|
"watch": "tsc --watch",
|
|
13
13
|
"lint": "eslint . --ext .ts",
|