@authsome/client 0.0.3 → 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 +90 -37
- package/dist/client.js +79 -17
- package/dist/index.d.ts +21 -17
- package/dist/index.js +65 -53
- package/dist/plugins/admin.d.ts +19 -7
- package/dist/plugins/admin.js +18 -28
- package/dist/plugins/anonymous.d.ts +1 -1
- package/dist/plugins/anonymous.js +4 -2
- package/dist/plugins/apikey.d.ts +15 -7
- package/dist/plugins/apikey.js +29 -17
- package/dist/plugins/backupauth.d.ts +38 -28
- package/dist/plugins/backupauth.js +10 -10
- package/dist/plugins/cms.d.ts +54 -0
- package/dist/plugins/cms.js +149 -0
- package/dist/plugins/compliance.d.ts +93 -33
- package/dist/plugins/compliance.js +63 -61
- package/dist/plugins/consent.d.ts +34 -18
- package/dist/plugins/consent.js +16 -16
- package/dist/plugins/emailverification.d.ts +12 -0
- package/dist/plugins/emailverification.js +35 -0
- package/dist/plugins/idverification.d.ts +25 -11
- package/dist/plugins/idverification.js +14 -14
- package/dist/plugins/impersonation.d.ts +8 -6
- package/dist/plugins/impersonation.js +6 -10
- package/dist/plugins/jwt.d.ts +6 -5
- package/dist/plugins/jwt.js +16 -8
- package/dist/plugins/mfa.d.ts +26 -12
- package/dist/plugins/mfa.js +17 -21
- package/dist/plugins/multiapp.d.ts +46 -19
- package/dist/plugins/multiapp.js +40 -32
- package/dist/plugins/multisession.d.ts +13 -3
- package/dist/plugins/multisession.js +32 -4
- package/dist/plugins/notification.d.ts +31 -15
- package/dist/plugins/notification.js +27 -21
- package/dist/plugins/oidcprovider.d.ts +18 -12
- package/dist/plugins/oidcprovider.js +18 -12
- package/dist/plugins/organization.d.ts +32 -12
- package/dist/plugins/organization.js +20 -20
- package/dist/plugins/passkey.d.ts +6 -2
- package/dist/plugins/passkey.js +4 -4
- package/dist/plugins/permissions.d.ts +12 -0
- package/dist/plugins/permissions.js +33 -0
- package/dist/plugins/secrets.d.ts +33 -0
- package/dist/plugins/secrets.js +79 -0
- package/dist/plugins/social.d.ts +11 -2
- package/dist/plugins/social.js +7 -5
- package/dist/plugins/sso.d.ts +12 -4
- package/dist/plugins/sso.js +8 -8
- package/dist/plugins/stepup.d.ts +23 -13
- package/dist/plugins/stepup.js +10 -10
- 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 +3443 -2470
- package/package.json +2 -1
- package/src/client.ts +111 -37
- package/src/index.ts +21 -17
- package/src/plugins/admin.ts +18 -28
- package/src/plugins/anonymous.ts +4 -2
- package/src/plugins/apikey.ts +30 -18
- package/src/plugins/backupauth.ts +61 -61
- package/src/plugins/cms.ts +180 -0
- package/src/plugins/compliance.ts +98 -96
- package/src/plugins/consent.ts +44 -44
- package/src/plugins/emailverification.ts +40 -0
- package/src/plugins/idverification.ts +29 -29
- package/src/plugins/impersonation.ts +13 -17
- package/src/plugins/jwt.ts +18 -10
- package/src/plugins/mfa.ts +28 -32
- package/src/plugins/multiapp.ts +59 -51
- package/src/plugins/multisession.ts +39 -5
- package/src/plugins/notification.ts +44 -38
- package/src/plugins/oidcprovider.ts +32 -26
- package/src/plugins/organization.ts +27 -27
- package/src/plugins/passkey.ts +4 -4
- package/src/plugins/permissions.ts +38 -0
- package/src/plugins/secrets.ts +92 -0
- package/src/plugins/social.ts +7 -5
- package/src/plugins/sso.ts +8 -8
- package/src/plugins/stepup.ts +31 -31
- package/src/plugins/twofa.ts +12 -24
- package/src/plugins/username.ts +8 -4
- package/src/types.ts +3773 -2545
- package/authsome-client-0.0.2.tgz +0 -0
|
@@ -12,18 +12,18 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async createOrganization(): Promise<
|
|
15
|
+
async createOrganization(): Promise<types.Organization> {
|
|
16
16
|
const path = '/createorganization';
|
|
17
|
-
return this.client.request<
|
|
17
|
+
return this.client.request<types.Organization>('POST', path);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
async updateOrganization(): Promise<
|
|
21
|
-
const path =
|
|
22
|
-
return this.client.request<
|
|
20
|
+
async updateOrganization(params: { id: string }): Promise<types.Organization> {
|
|
21
|
+
const path = `/${params.id}`;
|
|
22
|
+
return this.client.request<types.Organization>('PATCH', path);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async deleteOrganization(): Promise<void> {
|
|
26
|
-
const path =
|
|
25
|
+
async deleteOrganization(params: { id: string }): Promise<void> {
|
|
26
|
+
const path = `/${params.id}`;
|
|
27
27
|
return this.client.request<void>('DELETE', path);
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -32,8 +32,8 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
32
32
|
return this.client.request<void>('POST', path);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async removeMember(): Promise<void> {
|
|
36
|
-
const path =
|
|
35
|
+
async removeMember(params: { memberId: string }): Promise<void> {
|
|
36
|
+
const path = `/${params.memberId}`;
|
|
37
37
|
return this.client.request<void>('DELETE', path);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -42,29 +42,29 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
42
42
|
return this.client.request<void>('POST', path);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async updateTeam(): Promise<void> {
|
|
46
|
-
const path =
|
|
45
|
+
async updateTeam(params: { teamId: string }): Promise<void> {
|
|
46
|
+
const path = `/${params.teamId}`;
|
|
47
47
|
return this.client.request<void>('PATCH', path);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
async deleteTeam(): Promise<void> {
|
|
51
|
-
const path =
|
|
50
|
+
async deleteTeam(params: { teamId: string }): Promise<void> {
|
|
51
|
+
const path = `/${params.teamId}`;
|
|
52
52
|
return this.client.request<void>('DELETE', path);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
async getOrganization(): Promise<
|
|
56
|
-
const path =
|
|
57
|
-
return this.client.request<
|
|
55
|
+
async getOrganization(params: { id: string }): Promise<types.Organization> {
|
|
56
|
+
const path = `/${params.id}`;
|
|
57
|
+
return this.client.request<types.Organization>('GET', path);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
async listOrganizations(): Promise<
|
|
60
|
+
async listOrganizations(): Promise<types.Organization> {
|
|
61
61
|
const path = '/listorganizations';
|
|
62
|
-
return this.client.request<
|
|
62
|
+
return this.client.request<types.Organization>('GET', path);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
async getOrganizationBySlug(): Promise<
|
|
66
|
-
const path =
|
|
67
|
-
return this.client.request<
|
|
65
|
+
async getOrganizationBySlug(params: { slug: string }): Promise<types.Organization> {
|
|
66
|
+
const path = `/slug/${params.slug}`;
|
|
67
|
+
return this.client.request<types.Organization>('GET', path);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
async listMembers(): Promise<void> {
|
|
@@ -72,18 +72,18 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
72
72
|
return this.client.request<void>('GET', path);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
async updateMember(): Promise<void> {
|
|
76
|
-
const path =
|
|
75
|
+
async updateMember(params: { memberId: string }): Promise<void> {
|
|
76
|
+
const path = `/${params.memberId}`;
|
|
77
77
|
return this.client.request<void>('PATCH', path);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
async acceptInvitation(): Promise<void> {
|
|
81
|
-
const path =
|
|
80
|
+
async acceptInvitation(params: { token: string }): Promise<void> {
|
|
81
|
+
const path = `/${params.token}/accept`;
|
|
82
82
|
return this.client.request<void>('POST', path);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
async declineInvitation(): Promise<types.StatusResponse> {
|
|
86
|
-
const path =
|
|
85
|
+
async declineInvitation(params: { token: string }): Promise<types.StatusResponse> {
|
|
86
|
+
const path = `/${params.token}/decline`;
|
|
87
87
|
return this.client.request<types.StatusResponse>('POST', path);
|
|
88
88
|
}
|
|
89
89
|
|
package/src/plugins/passkey.ts
CHANGED
|
@@ -37,13 +37,13 @@ export class PasskeyPlugin implements ClientPlugin {
|
|
|
37
37
|
return this.client.request<void>('GET', path);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
async update(): Promise<void> {
|
|
41
|
-
const path =
|
|
40
|
+
async update(params: { id: string }): Promise<void> {
|
|
41
|
+
const path = `/${params.id}`;
|
|
42
42
|
return this.client.request<void>('PUT', path);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async delete(): Promise<types.StatusResponse> {
|
|
46
|
-
const path =
|
|
45
|
+
async delete(params: { id: string }): Promise<types.StatusResponse> {
|
|
46
|
+
const path = `/${params.id}`;
|
|
47
47
|
return this.client.request<types.StatusResponse>('DELETE', path);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Auto-generated permissions plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class PermissionsPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'permissions';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async migrateAll(request: types.MigrateAllRequest): Promise<types.ErrorResponse> {
|
|
16
|
+
const path = '/migrate/all';
|
|
17
|
+
return this.client.request<types.ErrorResponse>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async migrateRoles(): Promise<types.ErrorResponse> {
|
|
23
|
+
const path = '/migrate/roles';
|
|
24
|
+
return this.client.request<types.ErrorResponse>('POST', path);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async previewConversion(request: types.PreviewConversionRequest): Promise<types.ErrorResponse> {
|
|
28
|
+
const path = '/migrate/preview';
|
|
29
|
+
return this.client.request<types.ErrorResponse>('POST', path, {
|
|
30
|
+
body: request,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function permissionsClient(): PermissionsPlugin {
|
|
37
|
+
return new PermissionsPlugin();
|
|
38
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Auto-generated secrets plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class SecretsPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'secrets';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async list(request?: types.ListSecretsRequest): Promise<types.ListSecretsResponse> {
|
|
16
|
+
const path = '/list';
|
|
17
|
+
return this.client.request<types.ListSecretsResponse>('GET', path, {
|
|
18
|
+
query: this.client.toQueryParams(request),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async create(request: types.CreateSecretRequest): Promise<types.SecretDTO> {
|
|
23
|
+
const path = '/create';
|
|
24
|
+
return this.client.request<types.SecretDTO>('POST', path, {
|
|
25
|
+
body: request,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async get(params: { id: string }, request?: types.GetSecretRequest): Promise<types.SecretDTO> {
|
|
30
|
+
const path = `/${params.id}`;
|
|
31
|
+
return this.client.request<types.SecretDTO>('GET', path, {
|
|
32
|
+
query: this.client.toQueryParams(request),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async getValue(params: { id: string }, request?: types.GetValueRequest): Promise<types.RevealValueResponse> {
|
|
37
|
+
const path = `/${params.id}/value`;
|
|
38
|
+
return this.client.request<types.RevealValueResponse>('GET', path, {
|
|
39
|
+
query: this.client.toQueryParams(request),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async update(params: { id: string }, request: types.UpdateSecretRequest): Promise<types.SecretDTO> {
|
|
44
|
+
const path = `/${params.id}`;
|
|
45
|
+
return this.client.request<types.SecretDTO>('PUT', path, {
|
|
46
|
+
body: request,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async delete(params: { id: string }, request?: types.DeleteSecretRequest): Promise<types.SuccessResponse> {
|
|
51
|
+
const path = `/${params.id}`;
|
|
52
|
+
return this.client.request<types.SuccessResponse>('DELETE', path, {
|
|
53
|
+
query: this.client.toQueryParams(request),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async getByPath(): Promise<types.ErrorResponse> {
|
|
58
|
+
const path = '/path/*path';
|
|
59
|
+
return this.client.request<types.ErrorResponse>('GET', path);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async getVersions(params: { id: string }, request?: types.GetVersionsRequest): Promise<types.ListVersionsResponse> {
|
|
63
|
+
const path = `/${params.id}/versions`;
|
|
64
|
+
return this.client.request<types.ListVersionsResponse>('GET', path, {
|
|
65
|
+
query: this.client.toQueryParams(request),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async rollback(params: { id: string; version: number }, request: types.RollbackRequest): Promise<types.SecretDTO> {
|
|
70
|
+
const path = `/${params.id}/rollback/${params.version}`;
|
|
71
|
+
return this.client.request<types.SecretDTO>('POST', path, {
|
|
72
|
+
body: request,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async getStats(): Promise<types.StatsDTO> {
|
|
77
|
+
const path = '/stats';
|
|
78
|
+
return this.client.request<types.StatsDTO>('GET', path);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async getTree(request?: types.GetTreeRequest): Promise<types.SecretTreeNode> {
|
|
82
|
+
const path = '/tree';
|
|
83
|
+
return this.client.request<types.SecretTreeNode>('GET', path, {
|
|
84
|
+
query: this.client.toQueryParams(request),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function secretsClient(): SecretsPlugin {
|
|
91
|
+
return new SecretsPlugin();
|
|
92
|
+
}
|
package/src/plugins/social.ts
CHANGED
|
@@ -19,9 +19,11 @@ export class SocialPlugin implements ClientPlugin {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
async callback(): Promise<types.CallbackDataResponse> {
|
|
23
|
-
const path =
|
|
24
|
-
return this.client.request<types.CallbackDataResponse>('GET', path
|
|
22
|
+
async callback(params: { provider: string }, query?: { state?: string; code?: string; error?: string; errorDescription?: string }): Promise<types.CallbackDataResponse> {
|
|
23
|
+
const path = `/callback/${params.provider}`;
|
|
24
|
+
return this.client.request<types.CallbackDataResponse>('GET', path, {
|
|
25
|
+
query: this.client.toQueryParams(query),
|
|
26
|
+
});
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
async linkAccount(request: types.LinkAccountRequest): Promise<types.AuthURLResponse> {
|
|
@@ -31,8 +33,8 @@ export class SocialPlugin implements ClientPlugin {
|
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
async unlinkAccount(): Promise<types.MessageResponse> {
|
|
35
|
-
const path =
|
|
36
|
+
async unlinkAccount(params: { provider: string }): Promise<types.MessageResponse> {
|
|
37
|
+
const path = `/account/unlink/${params.provider}`;
|
|
36
38
|
return this.client.request<types.MessageResponse>('DELETE', path);
|
|
37
39
|
}
|
|
38
40
|
|
package/src/plugins/sso.ts
CHANGED
|
@@ -24,27 +24,27 @@ export class SsoPlugin implements ClientPlugin {
|
|
|
24
24
|
return this.client.request<types.MetadataResponse>('GET', path);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
async sAMLLogin(request: types.SAMLLoginRequest): Promise<types.SAMLLoginResponse> {
|
|
28
|
-
const path =
|
|
27
|
+
async sAMLLogin(params: { providerId: string }, request: types.SAMLLoginRequest): Promise<types.SAMLLoginResponse> {
|
|
28
|
+
const path = `/saml2/login/${params.providerId}`;
|
|
29
29
|
return this.client.request<types.SAMLLoginResponse>('POST', path, {
|
|
30
30
|
body: request,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
async sAMLCallback(): Promise<types.SSOAuthResponse> {
|
|
35
|
-
const path =
|
|
34
|
+
async sAMLCallback(params: { providerId: string }): Promise<types.SSOAuthResponse> {
|
|
35
|
+
const path = `/saml2/callback/${params.providerId}`;
|
|
36
36
|
return this.client.request<types.SSOAuthResponse>('POST', path);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
async oIDCLogin(request: types.OIDCLoginRequest): Promise<types.OIDCLoginResponse> {
|
|
40
|
-
const path =
|
|
39
|
+
async oIDCLogin(params: { providerId: string }, request: types.OIDCLoginRequest): Promise<types.OIDCLoginResponse> {
|
|
40
|
+
const path = `/oidc/login/${params.providerId}`;
|
|
41
41
|
return this.client.request<types.OIDCLoginResponse>('POST', path, {
|
|
42
42
|
body: request,
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
async oIDCCallback(): Promise<types.SSOAuthResponse> {
|
|
47
|
-
const path =
|
|
46
|
+
async oIDCCallback(params: { providerId: string }): Promise<types.SSOAuthResponse> {
|
|
47
|
+
const path = `/oidc/callback/${params.providerId}`;
|
|
48
48
|
return this.client.request<types.SSOAuthResponse>('GET', path);
|
|
49
49
|
}
|
|
50
50
|
|
package/src/plugins/stepup.ts
CHANGED
|
@@ -12,33 +12,33 @@ export class StepupPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async evaluate(request: types.EvaluateRequest): Promise<
|
|
15
|
+
async evaluate(request: types.EvaluateRequest): Promise<types.StepUpEvaluationResponse> {
|
|
16
16
|
const path = '/evaluate';
|
|
17
|
-
return this.client.request<
|
|
17
|
+
return this.client.request<types.StepUpEvaluationResponse>('POST', path, {
|
|
18
18
|
body: request,
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
async verify(request: types.VerifyRequest): Promise<
|
|
22
|
+
async verify(request: types.VerifyRequest): Promise<types.StepUpVerificationResponse> {
|
|
23
23
|
const path = '/verify';
|
|
24
|
-
return this.client.request<
|
|
24
|
+
return this.client.request<types.StepUpVerificationResponse>('POST', path, {
|
|
25
25
|
body: request,
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
async getRequirement(): Promise<
|
|
30
|
-
const path =
|
|
31
|
-
return this.client.request<
|
|
29
|
+
async getRequirement(params: { id: string }): Promise<types.StepUpRequirementResponse> {
|
|
30
|
+
const path = `/requirements/${params.id}`;
|
|
31
|
+
return this.client.request<types.StepUpRequirementResponse>('GET', path);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
async listPendingRequirements(): Promise<types.
|
|
34
|
+
async listPendingRequirements(): Promise<types.StepUpRequirementsResponse> {
|
|
35
35
|
const path = '/requirements/pending';
|
|
36
|
-
return this.client.request<types.
|
|
36
|
+
return this.client.request<types.StepUpRequirementsResponse>('GET', path);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
async listVerifications(): Promise<
|
|
39
|
+
async listVerifications(): Promise<types.StepUpVerificationsResponse> {
|
|
40
40
|
const path = '/verifications';
|
|
41
|
-
return this.client.request<
|
|
41
|
+
return this.client.request<types.StepUpVerificationsResponse>('GET', path);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
async listRememberedDevices(): Promise<types.StepUpDevicesResponse> {
|
|
@@ -46,48 +46,48 @@ export class StepupPlugin implements ClientPlugin {
|
|
|
46
46
|
return this.client.request<types.StepUpDevicesResponse>('GET', path);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
async forgetDevice(): Promise<types.
|
|
50
|
-
const path =
|
|
51
|
-
return this.client.request<types.
|
|
49
|
+
async forgetDevice(params: { id: string }): Promise<types.StepUpStatusResponse> {
|
|
50
|
+
const path = `/devices/${params.id}`;
|
|
51
|
+
return this.client.request<types.StepUpStatusResponse>('DELETE', path);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
async createPolicy(request: types.StepUpPolicy): Promise<types.
|
|
54
|
+
async createPolicy(request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse> {
|
|
55
55
|
const path = '/policies';
|
|
56
|
-
return this.client.request<types.
|
|
56
|
+
return this.client.request<types.StepUpPolicyResponse>('POST', path, {
|
|
57
57
|
body: request,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async listPolicies(): Promise<
|
|
61
|
+
async listPolicies(): Promise<types.StepUpPoliciesResponse> {
|
|
62
62
|
const path = '/policies';
|
|
63
|
-
return this.client.request<
|
|
63
|
+
return this.client.request<types.StepUpPoliciesResponse>('GET', path);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
async getPolicy(): Promise<
|
|
67
|
-
const path =
|
|
68
|
-
return this.client.request<
|
|
66
|
+
async getPolicy(params: { id: string }): Promise<types.StepUpPolicyResponse> {
|
|
67
|
+
const path = `/policies/${params.id}`;
|
|
68
|
+
return this.client.request<types.StepUpPolicyResponse>('GET', path);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
async updatePolicy(request: types.StepUpPolicy): Promise<types.
|
|
72
|
-
const path =
|
|
73
|
-
return this.client.request<types.
|
|
71
|
+
async updatePolicy(params: { id: string }, request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse> {
|
|
72
|
+
const path = `/policies/${params.id}`;
|
|
73
|
+
return this.client.request<types.StepUpPolicyResponse>('PUT', path, {
|
|
74
74
|
body: request,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
async deletePolicy(): Promise<
|
|
79
|
-
const path =
|
|
80
|
-
return this.client.request<
|
|
78
|
+
async deletePolicy(params: { id: string }): Promise<types.StepUpStatusResponse> {
|
|
79
|
+
const path = `/policies/${params.id}`;
|
|
80
|
+
return this.client.request<types.StepUpStatusResponse>('DELETE', path);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
async getAuditLogs(): Promise<
|
|
83
|
+
async getAuditLogs(): Promise<types.StepUpAuditLogsResponse> {
|
|
84
84
|
const path = '/audit';
|
|
85
|
-
return this.client.request<
|
|
85
|
+
return this.client.request<types.StepUpAuditLogsResponse>('GET', path);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
async status(): Promise<
|
|
88
|
+
async status(): Promise<types.StepUpStatusResponse> {
|
|
89
89
|
const path = '/status';
|
|
90
|
-
return this.client.request<
|
|
90
|
+
return this.client.request<types.StepUpStatusResponse>('GET', path);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
}
|
package/src/plugins/twofa.ts
CHANGED
|
@@ -12,46 +12,34 @@ export class TwofaPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async enable(
|
|
15
|
+
async enable(): Promise<void> {
|
|
16
16
|
const path = '/2fa/enable';
|
|
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
|
-
async verify(
|
|
20
|
+
async verify(): Promise<types.StatusResponse> {
|
|
23
21
|
const path = '/2fa/verify';
|
|
24
|
-
return this.client.request<types.StatusResponse>('POST', path
|
|
25
|
-
body: request,
|
|
26
|
-
});
|
|
22
|
+
return this.client.request<types.StatusResponse>('POST', path);
|
|
27
23
|
}
|
|
28
24
|
|
|
29
|
-
async disable(
|
|
25
|
+
async disable(): Promise<types.StatusResponse> {
|
|
30
26
|
const path = '/2fa/disable';
|
|
31
|
-
return this.client.request<types.StatusResponse>('POST', path
|
|
32
|
-
body: request,
|
|
33
|
-
});
|
|
27
|
+
return this.client.request<types.StatusResponse>('POST', path);
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
async generateBackupCodes(
|
|
30
|
+
async generateBackupCodes(): Promise<types.CodesResponse> {
|
|
37
31
|
const path = '/2fa/generate-backup-codes';
|
|
38
|
-
return this.client.request<types.CodesResponse>('POST', path
|
|
39
|
-
body: request,
|
|
40
|
-
});
|
|
32
|
+
return this.client.request<types.CodesResponse>('POST', path);
|
|
41
33
|
}
|
|
42
34
|
|
|
43
|
-
async sendOTP(
|
|
35
|
+
async sendOTP(): Promise<types.OTPSentResponse> {
|
|
44
36
|
const path = '/2fa/send-otp';
|
|
45
|
-
return this.client.request<types.OTPSentResponse>('POST', path
|
|
46
|
-
body: request,
|
|
47
|
-
});
|
|
37
|
+
return this.client.request<types.OTPSentResponse>('POST', path);
|
|
48
38
|
}
|
|
49
39
|
|
|
50
|
-
async status(
|
|
40
|
+
async status(): Promise<types.TwoFAStatusResponse> {
|
|
51
41
|
const path = '/2fa/status';
|
|
52
|
-
return this.client.request<types.TwoFAStatusResponse>('POST', path
|
|
53
|
-
body: request,
|
|
54
|
-
});
|
|
42
|
+
return this.client.request<types.TwoFAStatusResponse>('POST', path);
|
|
55
43
|
}
|
|
56
44
|
|
|
57
45
|
}
|
package/src/plugins/username.ts
CHANGED
|
@@ -12,14 +12,18 @@ export class UsernamePlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async signUp(): Promise<types.SignUpResponse> {
|
|
15
|
+
async signUp(request: types.SignUpRequest): Promise<types.SignUpResponse> {
|
|
16
16
|
const path = '/username/signup';
|
|
17
|
-
return this.client.request<types.SignUpResponse>('POST', path
|
|
17
|
+
return this.client.request<types.SignUpResponse>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
async signIn(): Promise<types.
|
|
22
|
+
async signIn(request: types.SignInRequest): Promise<types.TwoFARequiredResponse> {
|
|
21
23
|
const path = '/username/signin';
|
|
22
|
-
return this.client.request<types.
|
|
24
|
+
return this.client.request<types.TwoFARequiredResponse>('POST', path, {
|
|
25
|
+
body: request,
|
|
26
|
+
});
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
}
|