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