@authsome/client 0.0.4 → 0.0.5
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/client.d.ts +49 -45
- package/dist/client.js +35 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +65 -65
- package/dist/plugins/admin.d.ts +5 -5
- package/dist/plugins/admin.js +10 -20
- package/dist/plugins/anonymous.d.ts +1 -1
- package/dist/plugins/anonymous.js +4 -2
- package/dist/plugins/apikey.d.ts +7 -7
- package/dist/plugins/apikey.js +28 -14
- package/dist/plugins/backupauth.d.ts +28 -28
- package/dist/plugins/cms.d.ts +11 -11
- package/dist/plugins/cms.js +38 -28
- package/dist/plugins/compliance.d.ts +33 -33
- package/dist/plugins/compliance.js +4 -2
- package/dist/plugins/consent.d.ts +18 -18
- package/dist/plugins/emailverification.d.ts +2 -2
- package/dist/plugins/emailverification.js +4 -2
- package/dist/plugins/idverification.d.ts +11 -11
- package/dist/plugins/impersonation.d.ts +6 -6
- package/dist/plugins/impersonation.js +4 -8
- package/dist/plugins/jwt.d.ts +6 -5
- package/dist/plugins/jwt.js +16 -8
- package/dist/plugins/mfa.d.ts +9 -9
- package/dist/plugins/mfa.js +4 -8
- package/dist/plugins/multiapp.d.ts +19 -19
- package/dist/plugins/multiapp.js +16 -8
- package/dist/plugins/multisession.d.ts +5 -5
- package/dist/plugins/multisession.js +4 -2
- package/dist/plugins/notification.d.ts +15 -15
- package/dist/plugins/notification.js +12 -6
- package/dist/plugins/oidcprovider.d.ts +11 -11
- package/dist/plugins/oidcprovider.js +12 -6
- package/dist/plugins/organization.d.ts +5 -5
- package/dist/plugins/secrets.d.ts +10 -10
- package/dist/plugins/secrets.js +32 -16
- package/dist/plugins/social.js +1 -1
- package/dist/plugins/stepup.d.ts +13 -13
- package/dist/plugins/twofa.d.ts +6 -6
- package/dist/plugins/twofa.js +12 -24
- package/dist/plugins/username.d.ts +2 -2
- package/dist/plugins/username.js +8 -4
- package/dist/types.d.ts +3336 -2788
- package/package.json +1 -1
- package/src/client.ts +60 -45
- package/src/index.ts +21 -21
- package/src/plugins/admin.ts +10 -20
- package/src/plugins/anonymous.ts +4 -2
- package/src/plugins/apikey.ts +28 -14
- package/src/plugins/backupauth.ts +56 -56
- package/src/plugins/cms.ts +38 -28
- package/src/plugins/compliance.ts +68 -66
- package/src/plugins/consent.ts +36 -36
- package/src/plugins/emailverification.ts +6 -4
- package/src/plugins/idverification.ts +22 -22
- package/src/plugins/impersonation.ts +12 -16
- package/src/plugins/jwt.ts +18 -10
- package/src/plugins/mfa.ts +18 -22
- package/src/plugins/multiapp.ts +46 -38
- package/src/plugins/multisession.ts +11 -9
- package/src/plugins/notification.ts +36 -30
- package/src/plugins/oidcprovider.ts +28 -22
- package/src/plugins/organization.ts +10 -10
- package/src/plugins/secrets.ts +36 -20
- package/src/plugins/social.ts +1 -1
- package/src/plugins/stepup.ts +26 -26
- package/src/plugins/twofa.ts +12 -24
- package/src/plugins/username.ts +8 -4
- package/src/types.ts +3581 -2856
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -3,34 +3,34 @@
|
|
|
3
3
|
import { ClientPlugin } from './plugin';
|
|
4
4
|
import { createErrorFromResponse } from './errors';
|
|
5
5
|
import * as types from './types';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { StepupPlugin } from './plugins/stepup';
|
|
10
|
-
import { PasskeyPlugin } from './plugins/passkey';
|
|
11
|
-
import { ApikeyPlugin } from './plugins/apikey';
|
|
6
|
+
import { SsoPlugin } from './plugins/sso';
|
|
7
|
+
import { UsernamePlugin } from './plugins/username';
|
|
8
|
+
import { WebhookPlugin } from './plugins/webhook';
|
|
12
9
|
import { EmailverificationPlugin } from './plugins/emailverification';
|
|
10
|
+
import { BackupauthPlugin } from './plugins/backupauth';
|
|
11
|
+
import { JwtPlugin } from './plugins/jwt';
|
|
12
|
+
import { SecretsPlugin } from './plugins/secrets';
|
|
13
|
+
import { EmailotpPlugin } from './plugins/emailotp';
|
|
14
|
+
import { IdverificationPlugin } from './plugins/idverification';
|
|
13
15
|
import { MultisessionPlugin } from './plugins/multisession';
|
|
14
16
|
import { OidcproviderPlugin } from './plugins/oidcprovider';
|
|
15
|
-
import { OrganizationPlugin } from './plugins/organization';
|
|
16
|
-
import { WebhookPlugin } from './plugins/webhook';
|
|
17
|
-
import { ImpersonationPlugin } from './plugins/impersonation';
|
|
18
|
-
import { MagiclinkPlugin } from './plugins/magiclink';
|
|
19
|
-
import { SecretsPlugin } from './plugins/secrets';
|
|
20
|
-
import { SsoPlugin } from './plugins/sso';
|
|
21
17
|
import { AnonymousPlugin } from './plugins/anonymous';
|
|
22
|
-
import {
|
|
23
|
-
import { IdverificationPlugin } from './plugins/idverification';
|
|
18
|
+
import { MfaPlugin } from './plugins/mfa';
|
|
24
19
|
import { TwofaPlugin } from './plugins/twofa';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { UsernamePlugin } from './plugins/username';
|
|
20
|
+
import { AdminPlugin } from './plugins/admin';
|
|
21
|
+
import { ApikeyPlugin } from './plugins/apikey';
|
|
22
|
+
import { CompliancePlugin } from './plugins/compliance';
|
|
29
23
|
import { ConsentPlugin } from './plugins/consent';
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
24
|
+
import { MagiclinkPlugin } from './plugins/magiclink';
|
|
25
|
+
import { CmsPlugin } from './plugins/cms';
|
|
26
|
+
import { PermissionsPlugin } from './plugins/permissions';
|
|
27
|
+
import { StepupPlugin } from './plugins/stepup';
|
|
28
|
+
import { ImpersonationPlugin } from './plugins/impersonation';
|
|
33
29
|
import { MultiappPlugin } from './plugins/multiapp';
|
|
30
|
+
import { PasskeyPlugin } from './plugins/passkey';
|
|
31
|
+
import { SocialPlugin } from './plugins/social';
|
|
32
|
+
import { NotificationPlugin } from './plugins/notification';
|
|
33
|
+
import { OrganizationPlugin } from './plugins/organization';
|
|
34
34
|
import { PhonePlugin } from './plugins/phone';
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -130,6 +130,21 @@ export class AuthsomeClient {
|
|
|
130
130
|
this.basePath = basePath;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Convert an object to query parameters, handling optional values and type conversion
|
|
135
|
+
*/
|
|
136
|
+
public toQueryParams(obj?: Record<string, any>): Record<string, string> | undefined {
|
|
137
|
+
if (!obj) return undefined;
|
|
138
|
+
|
|
139
|
+
const params: Record<string, string> = {};
|
|
140
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
141
|
+
if (value !== undefined && value !== null) {
|
|
142
|
+
params[key] = String(value);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return Object.keys(params).length > 0 ? params : undefined;
|
|
146
|
+
}
|
|
147
|
+
|
|
133
148
|
/**
|
|
134
149
|
* Set global headers for all requests
|
|
135
150
|
* @param headers - Headers to set
|
|
@@ -148,34 +163,34 @@ export class AuthsomeClient {
|
|
|
148
163
|
}
|
|
149
164
|
|
|
150
165
|
public readonly $plugins = {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
stepup: (): StepupPlugin | undefined => this.getPlugin<StepupPlugin>('stepup'),
|
|
155
|
-
passkey: (): PasskeyPlugin | undefined => this.getPlugin<PasskeyPlugin>('passkey'),
|
|
156
|
-
apikey: (): ApikeyPlugin | undefined => this.getPlugin<ApikeyPlugin>('apikey'),
|
|
166
|
+
sso: (): SsoPlugin | undefined => this.getPlugin<SsoPlugin>('sso'),
|
|
167
|
+
username: (): UsernamePlugin | undefined => this.getPlugin<UsernamePlugin>('username'),
|
|
168
|
+
webhook: (): WebhookPlugin | undefined => this.getPlugin<WebhookPlugin>('webhook'),
|
|
157
169
|
emailverification: (): EmailverificationPlugin | undefined => this.getPlugin<EmailverificationPlugin>('emailverification'),
|
|
170
|
+
backupauth: (): BackupauthPlugin | undefined => this.getPlugin<BackupauthPlugin>('backupauth'),
|
|
171
|
+
jwt: (): JwtPlugin | undefined => this.getPlugin<JwtPlugin>('jwt'),
|
|
172
|
+
secrets: (): SecretsPlugin | undefined => this.getPlugin<SecretsPlugin>('secrets'),
|
|
173
|
+
emailotp: (): EmailotpPlugin | undefined => this.getPlugin<EmailotpPlugin>('emailotp'),
|
|
174
|
+
idverification: (): IdverificationPlugin | undefined => this.getPlugin<IdverificationPlugin>('idverification'),
|
|
158
175
|
multisession: (): MultisessionPlugin | undefined => this.getPlugin<MultisessionPlugin>('multisession'),
|
|
159
176
|
oidcprovider: (): OidcproviderPlugin | undefined => this.getPlugin<OidcproviderPlugin>('oidcprovider'),
|
|
160
|
-
organization: (): OrganizationPlugin | undefined => this.getPlugin<OrganizationPlugin>('organization'),
|
|
161
|
-
webhook: (): WebhookPlugin | undefined => this.getPlugin<WebhookPlugin>('webhook'),
|
|
162
|
-
impersonation: (): ImpersonationPlugin | undefined => this.getPlugin<ImpersonationPlugin>('impersonation'),
|
|
163
|
-
magiclink: (): MagiclinkPlugin | undefined => this.getPlugin<MagiclinkPlugin>('magiclink'),
|
|
164
|
-
secrets: (): SecretsPlugin | undefined => this.getPlugin<SecretsPlugin>('secrets'),
|
|
165
|
-
sso: (): SsoPlugin | undefined => this.getPlugin<SsoPlugin>('sso'),
|
|
166
177
|
anonymous: (): AnonymousPlugin | undefined => this.getPlugin<AnonymousPlugin>('anonymous'),
|
|
167
|
-
|
|
168
|
-
idverification: (): IdverificationPlugin | undefined => this.getPlugin<IdverificationPlugin>('idverification'),
|
|
178
|
+
mfa: (): MfaPlugin | undefined => this.getPlugin<MfaPlugin>('mfa'),
|
|
169
179
|
twofa: (): TwofaPlugin | undefined => this.getPlugin<TwofaPlugin>('twofa'),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
username: (): UsernamePlugin | undefined => this.getPlugin<UsernamePlugin>('username'),
|
|
180
|
+
admin: (): AdminPlugin | undefined => this.getPlugin<AdminPlugin>('admin'),
|
|
181
|
+
apikey: (): ApikeyPlugin | undefined => this.getPlugin<ApikeyPlugin>('apikey'),
|
|
182
|
+
compliance: (): CompliancePlugin | undefined => this.getPlugin<CompliancePlugin>('compliance'),
|
|
174
183
|
consent: (): ConsentPlugin | undefined => this.getPlugin<ConsentPlugin>('consent'),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
184
|
+
magiclink: (): MagiclinkPlugin | undefined => this.getPlugin<MagiclinkPlugin>('magiclink'),
|
|
185
|
+
cms: (): CmsPlugin | undefined => this.getPlugin<CmsPlugin>('cms'),
|
|
186
|
+
permissions: (): PermissionsPlugin | undefined => this.getPlugin<PermissionsPlugin>('permissions'),
|
|
187
|
+
stepup: (): StepupPlugin | undefined => this.getPlugin<StepupPlugin>('stepup'),
|
|
188
|
+
impersonation: (): ImpersonationPlugin | undefined => this.getPlugin<ImpersonationPlugin>('impersonation'),
|
|
178
189
|
multiapp: (): MultiappPlugin | undefined => this.getPlugin<MultiappPlugin>('multiapp'),
|
|
190
|
+
passkey: (): PasskeyPlugin | undefined => this.getPlugin<PasskeyPlugin>('passkey'),
|
|
191
|
+
social: (): SocialPlugin | undefined => this.getPlugin<SocialPlugin>('social'),
|
|
192
|
+
notification: (): NotificationPlugin | undefined => this.getPlugin<NotificationPlugin>('notification'),
|
|
193
|
+
organization: (): OrganizationPlugin | undefined => this.getPlugin<OrganizationPlugin>('organization'),
|
|
179
194
|
phone: (): PhonePlugin | undefined => this.getPlugin<PhonePlugin>('phone'),
|
|
180
195
|
};
|
|
181
196
|
|
|
@@ -231,7 +246,7 @@ export class AuthsomeClient {
|
|
|
231
246
|
});
|
|
232
247
|
}
|
|
233
248
|
|
|
234
|
-
async signIn(request: { email: string; password: string }): Promise<{ session: types.Session; requiresTwoFactor: boolean
|
|
249
|
+
async signIn(request: { email: string; password: string }): Promise<{ user: types.User; session: types.Session; requiresTwoFactor: boolean }> {
|
|
235
250
|
const path = '/signin';
|
|
236
251
|
return this.request<{ user: types.User; session: types.Session; requiresTwoFactor: boolean }>('POST', path, {
|
|
237
252
|
body: request,
|
|
@@ -252,7 +267,7 @@ export class AuthsomeClient {
|
|
|
252
267
|
});
|
|
253
268
|
}
|
|
254
269
|
|
|
255
|
-
async updateUser(request: {
|
|
270
|
+
async updateUser(request: { name?: string; email?: string }): Promise<{ user: types.User }> {
|
|
256
271
|
const path = '/user/update';
|
|
257
272
|
return this.request<{ user: types.User }>('POST', path, {
|
|
258
273
|
body: request,
|
|
@@ -275,7 +290,7 @@ export class AuthsomeClient {
|
|
|
275
290
|
});
|
|
276
291
|
}
|
|
277
292
|
|
|
278
|
-
async refreshSession(request: { refreshToken: string }): Promise<{
|
|
293
|
+
async refreshSession(request: { refreshToken: string }): Promise<{ refreshExpiresAt: string; session: any; accessToken: string; refreshToken: string; expiresAt: string }> {
|
|
279
294
|
const path = '/refresh';
|
|
280
295
|
return this.request<{ session: any; accessToken: string; refreshToken: string; expiresAt: string; refreshExpiresAt: string }>('POST', path, {
|
|
281
296
|
body: request,
|
package/src/index.ts
CHANGED
|
@@ -6,32 +6,32 @@ export * from './types';
|
|
|
6
6
|
export * from './errors';
|
|
7
7
|
|
|
8
8
|
// Plugin exports
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { StepupPlugin, stepupClient } from './plugins/stepup';
|
|
13
|
-
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
14
|
-
export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
|
|
9
|
+
export { SsoPlugin, ssoClient } from './plugins/sso';
|
|
10
|
+
export { UsernamePlugin, usernameClient } from './plugins/username';
|
|
11
|
+
export { WebhookPlugin, webhookClient } from './plugins/webhook';
|
|
15
12
|
export { EmailverificationPlugin, emailverificationClient } from './plugins/emailverification';
|
|
13
|
+
export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
|
|
14
|
+
export { JwtPlugin, jwtClient } from './plugins/jwt';
|
|
15
|
+
export { SecretsPlugin, secretsClient } from './plugins/secrets';
|
|
16
|
+
export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
|
|
17
|
+
export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
|
|
16
18
|
export { MultisessionPlugin, multisessionClient } from './plugins/multisession';
|
|
17
19
|
export { OidcproviderPlugin, oidcproviderClient } from './plugins/oidcprovider';
|
|
18
|
-
export { OrganizationPlugin, organizationClient } from './plugins/organization';
|
|
19
|
-
export { WebhookPlugin, webhookClient } from './plugins/webhook';
|
|
20
|
-
export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
|
|
21
|
-
export { MagiclinkPlugin, magiclinkClient } from './plugins/magiclink';
|
|
22
|
-
export { SecretsPlugin, secretsClient } from './plugins/secrets';
|
|
23
|
-
export { SsoPlugin, ssoClient } from './plugins/sso';
|
|
24
20
|
export { AnonymousPlugin, anonymousClient } from './plugins/anonymous';
|
|
25
|
-
export {
|
|
26
|
-
export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
|
|
21
|
+
export { MfaPlugin, mfaClient } from './plugins/mfa';
|
|
27
22
|
export { TwofaPlugin, twofaClient } from './plugins/twofa';
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export { UsernamePlugin, usernameClient } from './plugins/username';
|
|
23
|
+
export { AdminPlugin, adminClient } from './plugins/admin';
|
|
24
|
+
export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
|
|
25
|
+
export { CompliancePlugin, complianceClient } from './plugins/compliance';
|
|
32
26
|
export { ConsentPlugin, consentClient } from './plugins/consent';
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
27
|
+
export { MagiclinkPlugin, magiclinkClient } from './plugins/magiclink';
|
|
28
|
+
export { CmsPlugin, cmsClient } from './plugins/cms';
|
|
29
|
+
export { PermissionsPlugin, permissionsClient } from './plugins/permissions';
|
|
30
|
+
export { StepupPlugin, stepupClient } from './plugins/stepup';
|
|
31
|
+
export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
|
|
36
32
|
export { MultiappPlugin, multiappClient } from './plugins/multiapp';
|
|
33
|
+
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
34
|
+
export { SocialPlugin, socialClient } from './plugins/social';
|
|
35
|
+
export { NotificationPlugin, notificationClient } from './plugins/notification';
|
|
36
|
+
export { OrganizationPlugin, organizationClient } from './plugins/organization';
|
|
37
37
|
export { PhonePlugin, phoneClient } from './plugins/phone';
|
package/src/plugins/admin.ts
CHANGED
|
@@ -12,11 +12,9 @@ export class AdminPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async createUser(
|
|
15
|
+
async createUser(): Promise<void> {
|
|
16
16
|
const path = '/users';
|
|
17
|
-
return this.client.request<void>('POST', path
|
|
18
|
-
body: request,
|
|
19
|
-
});
|
|
17
|
+
return this.client.request<void>('POST', path);
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
async listUsers(): Promise<void> {
|
|
@@ -29,32 +27,24 @@ export class AdminPlugin implements ClientPlugin {
|
|
|
29
27
|
return this.client.request<types.MessageResponse>('DELETE', path);
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
async banUser(params: { id: string }
|
|
30
|
+
async banUser(params: { id: string }): Promise<types.MessageResponse> {
|
|
33
31
|
const path = `/users/${params.id}/ban`;
|
|
34
|
-
return this.client.request<types.MessageResponse>('POST', path
|
|
35
|
-
body: request,
|
|
36
|
-
});
|
|
32
|
+
return this.client.request<types.MessageResponse>('POST', path);
|
|
37
33
|
}
|
|
38
34
|
|
|
39
|
-
async unbanUser(params: { id: string }
|
|
35
|
+
async unbanUser(params: { id: string }): Promise<types.MessageResponse> {
|
|
40
36
|
const path = `/users/${params.id}/unban`;
|
|
41
|
-
return this.client.request<types.MessageResponse>('POST', path
|
|
42
|
-
body: request,
|
|
43
|
-
});
|
|
37
|
+
return this.client.request<types.MessageResponse>('POST', path);
|
|
44
38
|
}
|
|
45
39
|
|
|
46
|
-
async impersonateUser(params: { id: string }
|
|
40
|
+
async impersonateUser(params: { id: string }): Promise<void> {
|
|
47
41
|
const path = `/users/${params.id}/impersonate`;
|
|
48
|
-
return this.client.request<void>('POST', path
|
|
49
|
-
body: request,
|
|
50
|
-
});
|
|
42
|
+
return this.client.request<void>('POST', path);
|
|
51
43
|
}
|
|
52
44
|
|
|
53
|
-
async setUserRole(params: { id: string }
|
|
45
|
+
async setUserRole(params: { id: string }): Promise<types.MessageResponse> {
|
|
54
46
|
const path = `/users/${params.id}/role`;
|
|
55
|
-
return this.client.request<types.MessageResponse>('POST', path
|
|
56
|
-
body: request,
|
|
57
|
-
});
|
|
47
|
+
return this.client.request<types.MessageResponse>('POST', path);
|
|
58
48
|
}
|
|
59
49
|
|
|
60
50
|
async listSessions(): Promise<void> {
|
package/src/plugins/anonymous.ts
CHANGED
|
@@ -12,9 +12,11 @@ export class AnonymousPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async signIn(): Promise<types.SignInResponse> {
|
|
15
|
+
async signIn(request: types.SignInRequest): Promise<types.SignInResponse> {
|
|
16
16
|
const path = '/anonymous/signin';
|
|
17
|
-
return this.client.request<types.SignInResponse>('POST', path
|
|
17
|
+
return this.client.request<types.SignInResponse>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
async link(request: types.LinkRequest): Promise<types.LinkResponse> {
|
package/src/plugins/apikey.ts
CHANGED
|
@@ -12,39 +12,53 @@ export class ApikeyPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async createAPIKey(): Promise<
|
|
15
|
+
async createAPIKey(request: types.CreateAPIKeyRequest): Promise<types.CreateAPIKeyResponse> {
|
|
16
16
|
const path = '/createapikey';
|
|
17
|
-
return this.client.request<
|
|
17
|
+
return this.client.request<types.CreateAPIKeyResponse>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
async rotateAPIKey(params: { id: string }): Promise<
|
|
22
|
+
async rotateAPIKey(params: { id: string }, request: types.RotateAPIKeyRequest): Promise<types.RotateAPIKeyResponse> {
|
|
21
23
|
const path = `/${params.id}/rotate`;
|
|
22
|
-
return this.client.request<
|
|
24
|
+
return this.client.request<types.RotateAPIKeyResponse>('POST', path, {
|
|
25
|
+
body: request,
|
|
26
|
+
});
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
async listAPIKeys(): Promise<
|
|
29
|
+
async listAPIKeys(request?: types.ListAPIKeysRequest): Promise<types.ListAPIKeysResponse> {
|
|
26
30
|
const path = '/listapikeys';
|
|
27
|
-
return this.client.request<
|
|
31
|
+
return this.client.request<types.ListAPIKeysResponse>('GET', path, {
|
|
32
|
+
query: this.client.toQueryParams(request),
|
|
33
|
+
});
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
async getAPIKey(params: { id: string }): Promise<
|
|
36
|
+
async getAPIKey(params: { id: string }, request?: types.GetAPIKeyRequest): Promise<types.APIKey> {
|
|
31
37
|
const path = `/${params.id}`;
|
|
32
|
-
return this.client.request<
|
|
38
|
+
return this.client.request<types.APIKey>('GET', path, {
|
|
39
|
+
query: this.client.toQueryParams(request),
|
|
40
|
+
});
|
|
33
41
|
}
|
|
34
42
|
|
|
35
|
-
async updateAPIKey(params: { id: string }): Promise<
|
|
43
|
+
async updateAPIKey(params: { id: string }, request: types.UpdateAPIKeyRequest): Promise<types.APIKey> {
|
|
36
44
|
const path = `/${params.id}`;
|
|
37
|
-
return this.client.request<
|
|
45
|
+
return this.client.request<types.APIKey>('PUT', path, {
|
|
46
|
+
body: request,
|
|
47
|
+
});
|
|
38
48
|
}
|
|
39
49
|
|
|
40
|
-
async deleteAPIKey(params: { id: string }): Promise<types.MessageResponse> {
|
|
50
|
+
async deleteAPIKey(params: { id: string }, request?: types.DeleteAPIKeyRequest): Promise<types.MessageResponse> {
|
|
41
51
|
const path = `/${params.id}`;
|
|
42
|
-
return this.client.request<types.MessageResponse>('DELETE', path
|
|
52
|
+
return this.client.request<types.MessageResponse>('DELETE', path, {
|
|
53
|
+
query: this.client.toQueryParams(request),
|
|
54
|
+
});
|
|
43
55
|
}
|
|
44
56
|
|
|
45
|
-
async verifyAPIKey(): Promise<
|
|
57
|
+
async verifyAPIKey(request: types.VerifyAPIKeyRequest): Promise<types.VerifyAPIKeyResponse> {
|
|
46
58
|
const path = '/verify';
|
|
47
|
-
return this.client.request<
|
|
59
|
+
return this.client.request<types.VerifyAPIKeyResponse>('POST', path, {
|
|
60
|
+
body: request,
|
|
61
|
+
});
|
|
48
62
|
}
|
|
49
63
|
|
|
50
64
|
}
|
|
@@ -12,186 +12,186 @@ export class BackupauthPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async startRecovery(request: types.StartRecoveryRequest): Promise<types.
|
|
15
|
+
async startRecovery(request: types.StartRecoveryRequest): Promise<types.BackupAuthRecoveryResponse> {
|
|
16
16
|
const path = '/recovery/start';
|
|
17
|
-
return this.client.request<types.
|
|
17
|
+
return this.client.request<types.BackupAuthRecoveryResponse>('POST', path, {
|
|
18
18
|
body: request,
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
async continueRecovery(request: types.ContinueRecoveryRequest): Promise<types.
|
|
22
|
+
async continueRecovery(request: types.ContinueRecoveryRequest): Promise<types.BackupAuthRecoveryResponse> {
|
|
23
23
|
const path = '/recovery/continue';
|
|
24
|
-
return this.client.request<types.
|
|
24
|
+
return this.client.request<types.BackupAuthRecoveryResponse>('POST', path, {
|
|
25
25
|
body: request,
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
async completeRecovery(request: types.CompleteRecoveryRequest): Promise<types.
|
|
29
|
+
async completeRecovery(request: types.CompleteRecoveryRequest): Promise<types.BackupAuthStatusResponse> {
|
|
30
30
|
const path = '/recovery/complete';
|
|
31
|
-
return this.client.request<types.
|
|
31
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
32
32
|
body: request,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
async cancelRecovery(request: types.CancelRecoveryRequest): Promise<types.
|
|
36
|
+
async cancelRecovery(request: types.CancelRecoveryRequest): Promise<types.BackupAuthStatusResponse> {
|
|
37
37
|
const path = '/recovery/cancel';
|
|
38
|
-
return this.client.request<types.
|
|
38
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
39
39
|
body: request,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
async generateRecoveryCodes(request: types.GenerateRecoveryCodesRequest): Promise<types.
|
|
43
|
+
async generateRecoveryCodes(request: types.GenerateRecoveryCodesRequest): Promise<types.BackupAuthCodesResponse> {
|
|
44
44
|
const path = '/recovery-codes/generate';
|
|
45
|
-
return this.client.request<types.
|
|
45
|
+
return this.client.request<types.BackupAuthCodesResponse>('POST', path, {
|
|
46
46
|
body: request,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
async verifyRecoveryCode(request: types.VerifyRecoveryCodeRequest): Promise<types.
|
|
50
|
+
async verifyRecoveryCode(request: types.VerifyRecoveryCodeRequest): Promise<types.BackupAuthStatusResponse> {
|
|
51
51
|
const path = '/recovery-codes/verify';
|
|
52
|
-
return this.client.request<types.
|
|
52
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
53
53
|
body: request,
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
async setupSecurityQuestions(request: types.SetupSecurityQuestionsRequest): Promise<types.
|
|
57
|
+
async setupSecurityQuestions(request: types.SetupSecurityQuestionsRequest): Promise<types.BackupAuthStatusResponse> {
|
|
58
58
|
const path = '/security-questions/setup';
|
|
59
|
-
return this.client.request<types.
|
|
59
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
60
60
|
body: request,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
async getSecurityQuestions(request: types.GetSecurityQuestionsRequest): Promise<types.
|
|
64
|
+
async getSecurityQuestions(request: types.GetSecurityQuestionsRequest): Promise<types.BackupAuthQuestionsResponse> {
|
|
65
65
|
const path = '/security-questions/get';
|
|
66
|
-
return this.client.request<types.
|
|
66
|
+
return this.client.request<types.BackupAuthQuestionsResponse>('POST', path, {
|
|
67
67
|
body: request,
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
async verifySecurityAnswers(request: types.VerifySecurityAnswersRequest): Promise<types.
|
|
71
|
+
async verifySecurityAnswers(request: types.VerifySecurityAnswersRequest): Promise<types.BackupAuthStatusResponse> {
|
|
72
72
|
const path = '/security-questions/verify';
|
|
73
|
-
return this.client.request<types.
|
|
73
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
74
74
|
body: request,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
async addTrustedContact(request: types.AddTrustedContactRequest): Promise<types.
|
|
78
|
+
async addTrustedContact(request: types.AddTrustedContactRequest): Promise<types.BackupAuthContactResponse> {
|
|
79
79
|
const path = '/trusted-contacts/add';
|
|
80
|
-
return this.client.request<types.
|
|
80
|
+
return this.client.request<types.BackupAuthContactResponse>('POST', path, {
|
|
81
81
|
body: request,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
async listTrustedContacts(): Promise<types.
|
|
85
|
+
async listTrustedContacts(): Promise<types.BackupAuthContactsResponse> {
|
|
86
86
|
const path = '/trusted-contacts';
|
|
87
|
-
return this.client.request<types.
|
|
87
|
+
return this.client.request<types.BackupAuthContactsResponse>('GET', path);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
async verifyTrustedContact(request: types.VerifyTrustedContactRequest): Promise<types.
|
|
90
|
+
async verifyTrustedContact(request: types.VerifyTrustedContactRequest): Promise<types.BackupAuthStatusResponse> {
|
|
91
91
|
const path = '/trusted-contacts/verify';
|
|
92
|
-
return this.client.request<types.
|
|
92
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
93
93
|
body: request,
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
async requestTrustedContactVerification(request: types.RequestTrustedContactVerificationRequest): Promise<types.
|
|
97
|
+
async requestTrustedContactVerification(request: types.RequestTrustedContactVerificationRequest): Promise<types.BackupAuthStatusResponse> {
|
|
98
98
|
const path = '/trusted-contacts/request-verification';
|
|
99
|
-
return this.client.request<types.
|
|
99
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
100
100
|
body: request,
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
async removeTrustedContact(params: { id: string }): Promise<types.
|
|
104
|
+
async removeTrustedContact(params: { id: string }): Promise<types.BackupAuthStatusResponse> {
|
|
105
105
|
const path = `/trusted-contacts/${params.id}`;
|
|
106
|
-
return this.client.request<types.
|
|
106
|
+
return this.client.request<types.BackupAuthStatusResponse>('DELETE', path);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
async sendVerificationCode(request: types.SendVerificationCodeRequest): Promise<types.
|
|
109
|
+
async sendVerificationCode(request: types.SendVerificationCodeRequest): Promise<types.BackupAuthStatusResponse> {
|
|
110
110
|
const path = '/verification/send';
|
|
111
|
-
return this.client.request<types.
|
|
111
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
112
112
|
body: request,
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
async verifyCode(request: types.VerifyCodeRequest): Promise<types.
|
|
116
|
+
async verifyCode(request: types.VerifyCodeRequest): Promise<types.BackupAuthStatusResponse> {
|
|
117
117
|
const path = '/verification/verify';
|
|
118
|
-
return this.client.request<types.
|
|
118
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
119
119
|
body: request,
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
async scheduleVideoSession(request: types.ScheduleVideoSessionRequest): Promise<types.
|
|
123
|
+
async scheduleVideoSession(request: types.ScheduleVideoSessionRequest): Promise<types.BackupAuthVideoResponse> {
|
|
124
124
|
const path = '/video/schedule';
|
|
125
|
-
return this.client.request<types.
|
|
125
|
+
return this.client.request<types.BackupAuthVideoResponse>('POST', path, {
|
|
126
126
|
body: request,
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
async startVideoSession(request: types.StartVideoSessionRequest): Promise<types.
|
|
130
|
+
async startVideoSession(request: types.StartVideoSessionRequest): Promise<types.BackupAuthVideoResponse> {
|
|
131
131
|
const path = '/video/start';
|
|
132
|
-
return this.client.request<types.
|
|
132
|
+
return this.client.request<types.BackupAuthVideoResponse>('POST', path, {
|
|
133
133
|
body: request,
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
async completeVideoSession(request: types.CompleteVideoSessionRequest): Promise<types.
|
|
137
|
+
async completeVideoSession(request: types.CompleteVideoSessionRequest): Promise<types.BackupAuthStatusResponse> {
|
|
138
138
|
const path = '/video/complete';
|
|
139
|
-
return this.client.request<types.
|
|
139
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
140
140
|
body: request,
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
async uploadDocument(request: types.UploadDocumentRequest): Promise<types.
|
|
144
|
+
async uploadDocument(request: types.UploadDocumentRequest): Promise<types.BackupAuthDocumentResponse> {
|
|
145
145
|
const path = '/documents/upload';
|
|
146
|
-
return this.client.request<types.
|
|
146
|
+
return this.client.request<types.BackupAuthDocumentResponse>('POST', path, {
|
|
147
147
|
body: request,
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
async getDocumentVerification(params: { id: string }): Promise<types.
|
|
151
|
+
async getDocumentVerification(params: { id: string }): Promise<types.BackupAuthDocumentResponse> {
|
|
152
152
|
const path = `/documents/${params.id}`;
|
|
153
|
-
return this.client.request<types.
|
|
153
|
+
return this.client.request<types.BackupAuthDocumentResponse>('GET', path);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
async reviewDocument(params: { id: string }, request: types.ReviewDocumentRequest): Promise<types.
|
|
156
|
+
async reviewDocument(params: { id: string }, request: types.ReviewDocumentRequest): Promise<types.BackupAuthStatusResponse> {
|
|
157
157
|
const path = `/documents/${params.id}/review`;
|
|
158
|
-
return this.client.request<types.
|
|
158
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
159
159
|
body: request,
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
async listRecoverySessions(): Promise<
|
|
163
|
+
async listRecoverySessions(): Promise<types.BackupAuthSessionsResponse> {
|
|
164
164
|
const path = '/sessions';
|
|
165
|
-
return this.client.request<
|
|
165
|
+
return this.client.request<types.BackupAuthSessionsResponse>('GET', path);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
async approveRecovery(params: { id: string }, request: types.ApproveRecoveryRequest): Promise<types.
|
|
168
|
+
async approveRecovery(params: { id: string }, request: types.ApproveRecoveryRequest): Promise<types.BackupAuthStatusResponse> {
|
|
169
169
|
const path = `/sessions/${params.id}/approve`;
|
|
170
|
-
return this.client.request<types.
|
|
170
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
171
171
|
body: request,
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
async rejectRecovery(params: { id: string }, request: types.RejectRecoveryRequest): Promise<types.
|
|
175
|
+
async rejectRecovery(params: { id: string }, request: types.RejectRecoveryRequest): Promise<types.BackupAuthStatusResponse> {
|
|
176
176
|
const path = `/sessions/${params.id}/reject`;
|
|
177
|
-
return this.client.request<types.
|
|
177
|
+
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
178
178
|
body: request,
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
async getRecoveryStats(): Promise<
|
|
182
|
+
async getRecoveryStats(): Promise<types.BackupAuthStatsResponse> {
|
|
183
183
|
const path = '/stats';
|
|
184
|
-
return this.client.request<
|
|
184
|
+
return this.client.request<types.BackupAuthStatsResponse>('GET', path);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
async getRecoveryConfig(): Promise<
|
|
187
|
+
async getRecoveryConfig(): Promise<types.BackupAuthConfigResponse> {
|
|
188
188
|
const path = '/config';
|
|
189
|
-
return this.client.request<
|
|
189
|
+
return this.client.request<types.BackupAuthConfigResponse>('GET', path);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
async updateRecoveryConfig(request: types.UpdateRecoveryConfigRequest): Promise<types.
|
|
192
|
+
async updateRecoveryConfig(request: types.UpdateRecoveryConfigRequest): Promise<types.BackupAuthConfigResponse> {
|
|
193
193
|
const path = '/config';
|
|
194
|
-
return this.client.request<types.
|
|
194
|
+
return this.client.request<types.BackupAuthConfigResponse>('PUT', path, {
|
|
195
195
|
body: request,
|
|
196
196
|
});
|
|
197
197
|
}
|