@authsome/client 0.0.4 → 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.
Files changed (81) hide show
  1. package/dist/client.d.ts +41 -37
  2. package/dist/client.js +32 -18
  3. package/dist/index.d.ts +18 -18
  4. package/dist/index.js +56 -56
  5. package/dist/plugins/admin.d.ts +5 -5
  6. package/dist/plugins/admin.js +21 -31
  7. package/dist/plugins/anonymous.d.ts +1 -1
  8. package/dist/plugins/anonymous.js +4 -2
  9. package/dist/plugins/apikey.d.ts +7 -7
  10. package/dist/plugins/apikey.js +41 -27
  11. package/dist/plugins/backupauth.d.ts +28 -28
  12. package/dist/plugins/backupauth.js +29 -29
  13. package/dist/plugins/cms.d.ts +11 -11
  14. package/dist/plugins/cms.js +67 -57
  15. package/dist/plugins/compliance.d.ts +33 -33
  16. package/dist/plugins/compliance.js +4 -2
  17. package/dist/plugins/consent.d.ts +18 -18
  18. package/dist/plugins/emailverification.d.ts +2 -2
  19. package/dist/plugins/emailverification.js +4 -2
  20. package/dist/plugins/idverification.d.ts +11 -11
  21. package/dist/plugins/idverification.js +11 -11
  22. package/dist/plugins/impersonation.d.ts +6 -6
  23. package/dist/plugins/impersonation.js +11 -15
  24. package/dist/plugins/jwt.d.ts +6 -5
  25. package/dist/plugins/jwt.js +21 -13
  26. package/dist/plugins/mfa.d.ts +9 -9
  27. package/dist/plugins/mfa.js +4 -8
  28. package/dist/plugins/multiapp.d.ts +19 -19
  29. package/dist/plugins/multiapp.js +35 -27
  30. package/dist/plugins/multisession.d.ts +5 -5
  31. package/dist/plugins/multisession.js +13 -11
  32. package/dist/plugins/notification.d.ts +15 -15
  33. package/dist/plugins/notification.js +12 -6
  34. package/dist/plugins/oidcprovider.d.ts +11 -11
  35. package/dist/plugins/oidcprovider.js +25 -19
  36. package/dist/plugins/organization.d.ts +5 -5
  37. package/dist/plugins/organization.js +16 -16
  38. package/dist/plugins/passkey.js +7 -7
  39. package/dist/plugins/permissions.js +3 -3
  40. package/dist/plugins/secrets.d.ts +10 -10
  41. package/dist/plugins/secrets.js +43 -27
  42. package/dist/plugins/social.js +1 -1
  43. package/dist/plugins/sso.js +6 -6
  44. package/dist/plugins/stepup.d.ts +13 -13
  45. package/dist/plugins/stepup.js +14 -14
  46. package/dist/plugins/twofa.d.ts +6 -6
  47. package/dist/plugins/twofa.js +12 -24
  48. package/dist/plugins/username.d.ts +2 -2
  49. package/dist/plugins/username.js +8 -4
  50. package/dist/plugins/webhook.js +4 -4
  51. package/dist/types.d.ts +3316 -2791
  52. package/package.json +3 -3
  53. package/src/client.ts +52 -37
  54. package/src/index.ts +18 -18
  55. package/src/plugins/admin.ts +21 -31
  56. package/src/plugins/anonymous.ts +4 -2
  57. package/src/plugins/apikey.ts +35 -21
  58. package/src/plugins/backupauth.ts +85 -85
  59. package/src/plugins/cms.ts +67 -57
  60. package/src/plugins/compliance.ts +68 -66
  61. package/src/plugins/consent.ts +36 -36
  62. package/src/plugins/emailverification.ts +6 -4
  63. package/src/plugins/idverification.ts +33 -33
  64. package/src/plugins/impersonation.ts +18 -22
  65. package/src/plugins/jwt.ts +23 -15
  66. package/src/plugins/mfa.ts +18 -22
  67. package/src/plugins/multiapp.ts +65 -57
  68. package/src/plugins/multisession.ts +20 -18
  69. package/src/plugins/notification.ts +36 -30
  70. package/src/plugins/oidcprovider.ts +41 -35
  71. package/src/plugins/organization.ts +26 -26
  72. package/src/plugins/passkey.ts +7 -7
  73. package/src/plugins/permissions.ts +3 -3
  74. package/src/plugins/secrets.ts +47 -31
  75. package/src/plugins/social.ts +1 -1
  76. package/src/plugins/sso.ts +6 -6
  77. package/src/plugins/stepup.ts +40 -40
  78. package/src/plugins/twofa.ts +12 -24
  79. package/src/plugins/username.ts +8 -4
  80. package/src/plugins/webhook.ts +4 -4
  81. package/src/types.ts +3576 -2874
@@ -12,83 +12,83 @@ export class OrganizationPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async createOrganization(): Promise<void> {
16
- const path = '/createorganization';
17
- return this.client.request<void>('POST', path);
15
+ async createOrganization(): Promise<types.Organization> {
16
+ const path = '/organizations/createorganization';
17
+ return this.client.request<types.Organization>('POST', path);
18
18
  }
19
19
 
20
- async updateOrganization(params: { id: string }): Promise<void> {
21
- const path = `/${params.id}`;
22
- return this.client.request<void>('PATCH', path);
20
+ async updateOrganization(params: { id: string }): Promise<types.Organization> {
21
+ const path = `/organizations/${params.id}`;
22
+ return this.client.request<types.Organization>('PATCH', path);
23
23
  }
24
24
 
25
25
  async deleteOrganization(params: { id: string }): Promise<void> {
26
- const path = `/${params.id}`;
26
+ const path = `/organizations/${params.id}`;
27
27
  return this.client.request<void>('DELETE', path);
28
28
  }
29
29
 
30
30
  async inviteMember(): Promise<void> {
31
- const path = '/invite';
31
+ const path = '/organizations/invite';
32
32
  return this.client.request<void>('POST', path);
33
33
  }
34
34
 
35
35
  async removeMember(params: { memberId: string }): Promise<void> {
36
- const path = `/${params.memberId}`;
36
+ const path = `/organizations/${params.memberId}`;
37
37
  return this.client.request<void>('DELETE', path);
38
38
  }
39
39
 
40
40
  async createTeam(): Promise<void> {
41
- const path = '/createteam';
41
+ const path = '/organizations/createteam';
42
42
  return this.client.request<void>('POST', path);
43
43
  }
44
44
 
45
45
  async updateTeam(params: { teamId: string }): Promise<void> {
46
- const path = `/${params.teamId}`;
46
+ const path = `/organizations/${params.teamId}`;
47
47
  return this.client.request<void>('PATCH', path);
48
48
  }
49
49
 
50
50
  async deleteTeam(params: { teamId: string }): Promise<void> {
51
- const path = `/${params.teamId}`;
51
+ const path = `/organizations/${params.teamId}`;
52
52
  return this.client.request<void>('DELETE', path);
53
53
  }
54
54
 
55
- async getOrganization(params: { id: string }): Promise<void> {
56
- const path = `/${params.id}`;
57
- return this.client.request<void>('GET', path);
55
+ async getOrganization(params: { id: string }): Promise<types.Organization> {
56
+ const path = `/organizations/${params.id}`;
57
+ return this.client.request<types.Organization>('GET', path);
58
58
  }
59
59
 
60
- async listOrganizations(): Promise<void> {
61
- const path = '/listorganizations';
62
- return this.client.request<void>('GET', path);
60
+ async listOrganizations(): Promise<types.Organization> {
61
+ const path = '/organizations/listorganizations';
62
+ return this.client.request<types.Organization>('GET', path);
63
63
  }
64
64
 
65
- async getOrganizationBySlug(params: { slug: string }): Promise<void> {
66
- const path = `/slug/${params.slug}`;
67
- return this.client.request<void>('GET', path);
65
+ async getOrganizationBySlug(params: { slug: string }): Promise<types.Organization> {
66
+ const path = `/organizations/slug/${params.slug}`;
67
+ return this.client.request<types.Organization>('GET', path);
68
68
  }
69
69
 
70
70
  async listMembers(): Promise<void> {
71
- const path = '/listmembers';
71
+ const path = '/organizations/listmembers';
72
72
  return this.client.request<void>('GET', path);
73
73
  }
74
74
 
75
75
  async updateMember(params: { memberId: string }): Promise<void> {
76
- const path = `/${params.memberId}`;
76
+ const path = `/organizations/${params.memberId}`;
77
77
  return this.client.request<void>('PATCH', path);
78
78
  }
79
79
 
80
80
  async acceptInvitation(params: { token: string }): Promise<void> {
81
- const path = `/${params.token}/accept`;
81
+ const path = `/organizations/${params.token}/accept`;
82
82
  return this.client.request<void>('POST', path);
83
83
  }
84
84
 
85
85
  async declineInvitation(params: { token: string }): Promise<types.StatusResponse> {
86
- const path = `/${params.token}/decline`;
86
+ const path = `/organizations/${params.token}/decline`;
87
87
  return this.client.request<types.StatusResponse>('POST', path);
88
88
  }
89
89
 
90
90
  async listTeams(): Promise<void> {
91
- const path = '/listteams';
91
+ const path = '/organizations/listteams';
92
92
  return this.client.request<void>('GET', path);
93
93
  }
94
94
 
@@ -13,37 +13,37 @@ export class PasskeyPlugin implements ClientPlugin {
13
13
  }
14
14
 
15
15
  async beginRegister(): Promise<void> {
16
- const path = '/register/begin';
16
+ const path = '/passkey/register/begin';
17
17
  return this.client.request<void>('POST', path);
18
18
  }
19
19
 
20
20
  async finishRegister(): Promise<void> {
21
- const path = '/register/finish';
21
+ const path = '/passkey/register/finish';
22
22
  return this.client.request<void>('POST', path);
23
23
  }
24
24
 
25
25
  async beginLogin(): Promise<void> {
26
- const path = '/login/begin';
26
+ const path = '/passkey/login/begin';
27
27
  return this.client.request<void>('POST', path);
28
28
  }
29
29
 
30
30
  async finishLogin(): Promise<void> {
31
- const path = '/login/finish';
31
+ const path = '/passkey/login/finish';
32
32
  return this.client.request<void>('POST', path);
33
33
  }
34
34
 
35
35
  async list(): Promise<void> {
36
- const path = '/list';
36
+ const path = '/passkey/list';
37
37
  return this.client.request<void>('GET', path);
38
38
  }
39
39
 
40
40
  async update(params: { id: string }): Promise<void> {
41
- const path = `/${params.id}`;
41
+ const path = `/passkey/${params.id}`;
42
42
  return this.client.request<void>('PUT', path);
43
43
  }
44
44
 
45
45
  async delete(params: { id: string }): Promise<types.StatusResponse> {
46
- const path = `/${params.id}`;
46
+ const path = `/passkey/${params.id}`;
47
47
  return this.client.request<types.StatusResponse>('DELETE', path);
48
48
  }
49
49
 
@@ -13,19 +13,19 @@ export class PermissionsPlugin implements ClientPlugin {
13
13
  }
14
14
 
15
15
  async migrateAll(request: types.MigrateAllRequest): Promise<types.ErrorResponse> {
16
- const path = '/migrate/all';
16
+ const path = '/api/permissions/migrate/all';
17
17
  return this.client.request<types.ErrorResponse>('POST', path, {
18
18
  body: request,
19
19
  });
20
20
  }
21
21
 
22
22
  async migrateRoles(): Promise<types.ErrorResponse> {
23
- const path = '/migrate/roles';
23
+ const path = '/api/permissions/migrate/roles';
24
24
  return this.client.request<types.ErrorResponse>('POST', path);
25
25
  }
26
26
 
27
27
  async previewConversion(request: types.PreviewConversionRequest): Promise<types.ErrorResponse> {
28
- const path = '/migrate/preview';
28
+ const path = '/api/permissions/migrate/preview';
29
29
  return this.client.request<types.ErrorResponse>('POST', path, {
30
30
  body: request,
31
31
  });
@@ -12,61 +12,77 @@ export class SecretsPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async list(): Promise<types.ListSecretsResponse> {
16
- const path = '/list';
17
- return this.client.request<types.ListSecretsResponse>('GET', path);
15
+ async list(request?: types.ListSecretsRequest): Promise<types.ListSecretsResponse> {
16
+ const path = '/secrets/list';
17
+ return this.client.request<types.ListSecretsResponse>('GET', path, {
18
+ query: this.client.toQueryParams(request),
19
+ });
18
20
  }
19
21
 
20
- async create(): Promise<types.ErrorResponse> {
21
- const path = '/create';
22
- return this.client.request<types.ErrorResponse>('POST', path);
22
+ async create(request: types.CreateSecretRequest): Promise<types.SecretDTO> {
23
+ const path = '/secrets/create';
24
+ return this.client.request<types.SecretDTO>('POST', path, {
25
+ body: request,
26
+ });
23
27
  }
24
28
 
25
- async get(params: { id: string }): Promise<types.ErrorResponse> {
26
- const path = `/${params.id}`;
27
- return this.client.request<types.ErrorResponse>('GET', path);
29
+ async get(params: { id: string }, request?: types.GetSecretRequest): Promise<types.SecretDTO> {
30
+ const path = `/secrets/${params.id}`;
31
+ return this.client.request<types.SecretDTO>('GET', path, {
32
+ query: this.client.toQueryParams(request),
33
+ });
28
34
  }
29
35
 
30
- async getValue(params: { id: string }): Promise<types.RevealValueResponse> {
31
- const path = `/${params.id}/value`;
32
- return this.client.request<types.RevealValueResponse>('GET', path);
36
+ async getValue(params: { id: string }, request?: types.GetValueRequest): Promise<types.RevealValueResponse> {
37
+ const path = `/secrets/${params.id}/value`;
38
+ return this.client.request<types.RevealValueResponse>('GET', path, {
39
+ query: this.client.toQueryParams(request),
40
+ });
33
41
  }
34
42
 
35
- async update(params: { id: string }): Promise<types.ErrorResponse> {
36
- const path = `/${params.id}`;
37
- return this.client.request<types.ErrorResponse>('PUT', path);
43
+ async update(params: { id: string }, request: types.UpdateSecretRequest): Promise<types.SecretDTO> {
44
+ const path = `/secrets/${params.id}`;
45
+ return this.client.request<types.SecretDTO>('PUT', path, {
46
+ body: request,
47
+ });
38
48
  }
39
49
 
40
- async delete(params: { id: string }): Promise<types.SuccessResponse> {
41
- const path = `/${params.id}`;
42
- return this.client.request<types.SuccessResponse>('DELETE', path);
50
+ async delete(params: { id: string }, request?: types.DeleteSecretRequest): Promise<types.SuccessResponse> {
51
+ const path = `/secrets/${params.id}`;
52
+ return this.client.request<types.SuccessResponse>('DELETE', path, {
53
+ query: this.client.toQueryParams(request),
54
+ });
43
55
  }
44
56
 
45
57
  async getByPath(): Promise<types.ErrorResponse> {
46
- const path = '/path/*path';
58
+ const path = '/secrets/path/*path';
47
59
  return this.client.request<types.ErrorResponse>('GET', path);
48
60
  }
49
61
 
50
- async getVersions(params: { id: string }): Promise<types.ListVersionsResponse> {
51
- const path = `/${params.id}/versions`;
52
- return this.client.request<types.ListVersionsResponse>('GET', path);
62
+ async getVersions(params: { id: string }, request?: types.GetVersionsRequest): Promise<types.ListVersionsResponse> {
63
+ const path = `/secrets/${params.id}/versions`;
64
+ return this.client.request<types.ListVersionsResponse>('GET', path, {
65
+ query: this.client.toQueryParams(request),
66
+ });
53
67
  }
54
68
 
55
- async rollback(params: { id: string; version: number }, request: types.Rollback_req): Promise<types.ErrorResponse> {
56
- const path = `/${params.id}/rollback/${params.version}`;
57
- return this.client.request<types.ErrorResponse>('POST', path, {
69
+ async rollback(params: { id: string; version: number }, request: types.RollbackRequest): Promise<types.SecretDTO> {
70
+ const path = `/secrets/${params.id}/rollback/${params.version}`;
71
+ return this.client.request<types.SecretDTO>('POST', path, {
58
72
  body: request,
59
73
  });
60
74
  }
61
75
 
62
- async getStats(): Promise<void> {
63
- const path = '/stats';
64
- return this.client.request<void>('GET', path);
76
+ async getStats(): Promise<types.StatsDTO> {
77
+ const path = '/secrets/stats';
78
+ return this.client.request<types.StatsDTO>('GET', path);
65
79
  }
66
80
 
67
- async getTree(): Promise<void> {
68
- const path = '/tree';
69
- return this.client.request<void>('GET', path);
81
+ async getTree(request?: types.GetTreeRequest): Promise<types.SecretTreeNode> {
82
+ const path = '/secrets/tree';
83
+ return this.client.request<types.SecretTreeNode>('GET', path, {
84
+ query: this.client.toQueryParams(request),
85
+ });
70
86
  }
71
87
 
72
88
  }
@@ -22,7 +22,7 @@ export class SocialPlugin implements ClientPlugin {
22
22
  async callback(params: { provider: string }, query?: { state?: string; code?: string; error?: string; errorDescription?: string }): Promise<types.CallbackDataResponse> {
23
23
  const path = `/callback/${params.provider}`;
24
24
  return this.client.request<types.CallbackDataResponse>('GET', path, {
25
- query,
25
+ query: this.client.toQueryParams(query),
26
26
  });
27
27
  }
28
28
 
@@ -13,38 +13,38 @@ export class SsoPlugin implements ClientPlugin {
13
13
  }
14
14
 
15
15
  async registerProvider(request: types.RegisterProviderRequest): Promise<types.ProviderRegisteredResponse> {
16
- const path = '/provider/register';
16
+ const path = '/sso/provider/register';
17
17
  return this.client.request<types.ProviderRegisteredResponse>('POST', path, {
18
18
  body: request,
19
19
  });
20
20
  }
21
21
 
22
22
  async sAMLSPMetadata(): Promise<types.MetadataResponse> {
23
- const path = '/saml2/sp/metadata';
23
+ const path = '/sso/saml2/sp/metadata';
24
24
  return this.client.request<types.MetadataResponse>('GET', path);
25
25
  }
26
26
 
27
27
  async sAMLLogin(params: { providerId: string }, request: types.SAMLLoginRequest): Promise<types.SAMLLoginResponse> {
28
- const path = `/saml2/login/${params.providerId}`;
28
+ const path = `/sso/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
34
  async sAMLCallback(params: { providerId: string }): Promise<types.SSOAuthResponse> {
35
- const path = `/saml2/callback/${params.providerId}`;
35
+ const path = `/sso/saml2/callback/${params.providerId}`;
36
36
  return this.client.request<types.SSOAuthResponse>('POST', path);
37
37
  }
38
38
 
39
39
  async oIDCLogin(params: { providerId: string }, request: types.OIDCLoginRequest): Promise<types.OIDCLoginResponse> {
40
- const path = `/oidc/login/${params.providerId}`;
40
+ const path = `/sso/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
46
  async oIDCCallback(params: { providerId: string }): Promise<types.SSOAuthResponse> {
47
- const path = `/oidc/callback/${params.providerId}`;
47
+ const path = `/sso/oidc/callback/${params.providerId}`;
48
48
  return this.client.request<types.SSOAuthResponse>('GET', path);
49
49
  }
50
50
 
@@ -12,82 +12,82 @@ export class StepupPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async evaluate(request: types.EvaluateRequest): Promise<void> {
16
- const path = '/evaluate';
17
- return this.client.request<void>('POST', path, {
15
+ async evaluate(request: types.EvaluateRequest): Promise<types.StepUpEvaluationResponse> {
16
+ const path = '/stepup/evaluate';
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<void> {
23
- const path = '/verify';
24
- return this.client.request<void>('POST', path, {
22
+ async verify(request: types.VerifyRequest): Promise<types.StepUpVerificationResponse> {
23
+ const path = '/stepup/verify';
24
+ return this.client.request<types.StepUpVerificationResponse>('POST', path, {
25
25
  body: request,
26
26
  });
27
27
  }
28
28
 
29
- async getRequirement(params: { id: string }): Promise<void> {
30
- const path = `/requirements/${params.id}`;
31
- return this.client.request<void>('GET', path);
29
+ async getRequirement(params: { id: string }): Promise<types.StepUpRequirementResponse> {
30
+ const path = `/stepup/requirements/${params.id}`;
31
+ return this.client.request<types.StepUpRequirementResponse>('GET', path);
32
32
  }
33
33
 
34
- async listPendingRequirements(): Promise<types.RequirementsResponse> {
35
- const path = '/requirements/pending';
36
- return this.client.request<types.RequirementsResponse>('GET', path);
34
+ async listPendingRequirements(): Promise<types.StepUpRequirementsResponse> {
35
+ const path = '/stepup/requirements/pending';
36
+ return this.client.request<types.StepUpRequirementsResponse>('GET', path);
37
37
  }
38
38
 
39
- async listVerifications(): Promise<void> {
40
- const path = '/verifications';
41
- return this.client.request<void>('GET', path);
39
+ async listVerifications(): Promise<types.StepUpVerificationsResponse> {
40
+ const path = '/stepup/verifications';
41
+ return this.client.request<types.StepUpVerificationsResponse>('GET', path);
42
42
  }
43
43
 
44
44
  async listRememberedDevices(): Promise<types.StepUpDevicesResponse> {
45
- const path = '/devices';
45
+ const path = '/stepup/devices';
46
46
  return this.client.request<types.StepUpDevicesResponse>('GET', path);
47
47
  }
48
48
 
49
- async forgetDevice(params: { id: string }): Promise<types.ForgetDeviceResponse> {
50
- const path = `/devices/${params.id}`;
51
- return this.client.request<types.ForgetDeviceResponse>('DELETE', path);
49
+ async forgetDevice(params: { id: string }): Promise<types.StepUpStatusResponse> {
50
+ const path = `/stepup/devices/${params.id}`;
51
+ return this.client.request<types.StepUpStatusResponse>('DELETE', path);
52
52
  }
53
53
 
54
- async createPolicy(request: types.StepUpPolicy): Promise<types.StepUpPolicy> {
55
- const path = '/policies';
56
- return this.client.request<types.StepUpPolicy>('POST', path, {
54
+ async createPolicy(request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse> {
55
+ const path = '/stepup/policies';
56
+ return this.client.request<types.StepUpPolicyResponse>('POST', path, {
57
57
  body: request,
58
58
  });
59
59
  }
60
60
 
61
- async listPolicies(): Promise<void> {
62
- const path = '/policies';
63
- return this.client.request<void>('GET', path);
61
+ async listPolicies(): Promise<types.StepUpPoliciesResponse> {
62
+ const path = '/stepup/policies';
63
+ return this.client.request<types.StepUpPoliciesResponse>('GET', path);
64
64
  }
65
65
 
66
- async getPolicy(params: { id: string }): Promise<void> {
67
- const path = `/policies/${params.id}`;
68
- return this.client.request<void>('GET', path);
66
+ async getPolicy(params: { id: string }): Promise<types.StepUpPolicyResponse> {
67
+ const path = `/stepup/policies/${params.id}`;
68
+ return this.client.request<types.StepUpPolicyResponse>('GET', path);
69
69
  }
70
70
 
71
- async updatePolicy(params: { id: string }, request: types.StepUpPolicy): Promise<types.StepUpPolicy> {
72
- const path = `/policies/${params.id}`;
73
- return this.client.request<types.StepUpPolicy>('PUT', path, {
71
+ async updatePolicy(params: { id: string }, request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse> {
72
+ const path = `/stepup/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(params: { id: string }): Promise<void> {
79
- const path = `/policies/${params.id}`;
80
- return this.client.request<void>('DELETE', path);
78
+ async deletePolicy(params: { id: string }): Promise<types.StepUpStatusResponse> {
79
+ const path = `/stepup/policies/${params.id}`;
80
+ return this.client.request<types.StepUpStatusResponse>('DELETE', path);
81
81
  }
82
82
 
83
- async getAuditLogs(): Promise<void> {
84
- const path = '/audit';
85
- return this.client.request<void>('GET', path);
83
+ async getAuditLogs(): Promise<types.StepUpAuditLogsResponse> {
84
+ const path = '/stepup/audit';
85
+ return this.client.request<types.StepUpAuditLogsResponse>('GET', path);
86
86
  }
87
87
 
88
- async status(): Promise<void> {
89
- const path = '/status';
90
- return this.client.request<void>('GET', path);
88
+ async status(): Promise<types.StepUpStatusResponse> {
89
+ const path = '/stepup/status';
90
+ return this.client.request<types.StepUpStatusResponse>('GET', path);
91
91
  }
92
92
 
93
93
  }
@@ -12,46 +12,34 @@ export class TwofaPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async enable(request: types.Enable_body): Promise<void> {
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(request: types.Verify_body): Promise<types.StatusResponse> {
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(request: types.Disable_body): Promise<types.StatusResponse> {
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(request: types.GenerateBackupCodes_body): Promise<types.CodesResponse> {
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(request: types.SendOTP_body): Promise<types.OTPSentResponse> {
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(request: types.Status_body): Promise<types.TwoFAStatusResponse> {
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
  }
@@ -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.SignInResponse> {
22
+ async signIn(request: types.SignInRequest): Promise<types.TwoFARequiredResponse> {
21
23
  const path = '/username/signin';
22
- return this.client.request<types.SignInResponse>('POST', path);
24
+ return this.client.request<types.TwoFARequiredResponse>('POST', path, {
25
+ body: request,
26
+ });
23
27
  }
24
28
 
25
29
  }
@@ -13,7 +13,7 @@ export class WebhookPlugin implements ClientPlugin {
13
13
  }
14
14
 
15
15
  async create(request: { url: string; events: string[]; secret?: string }): Promise<{ webhook: types.Webhook }> {
16
- const path = '/webhooks';
16
+ const path = '/api/auth/webhooks';
17
17
  return this.client.request<{ webhook: types.Webhook }>('POST', path, {
18
18
  body: request,
19
19
  auth: true,
@@ -21,14 +21,14 @@ export class WebhookPlugin implements ClientPlugin {
21
21
  }
22
22
 
23
23
  async list(): Promise<{ webhooks: types.Webhook[] }> {
24
- const path = '/webhooks';
24
+ const path = '/api/auth/webhooks';
25
25
  return this.client.request<{ webhooks: types.Webhook[] }>('GET', path, {
26
26
  auth: true,
27
27
  });
28
28
  }
29
29
 
30
30
  async update(request: { id: string; url?: string; events?: string[]; enabled?: boolean }): Promise<{ webhook: types.Webhook }> {
31
- const path = '/webhooks/update';
31
+ const path = '/api/auth/webhooks/update';
32
32
  return this.client.request<{ webhook: types.Webhook }>('POST', path, {
33
33
  body: request,
34
34
  auth: true,
@@ -36,7 +36,7 @@ export class WebhookPlugin implements ClientPlugin {
36
36
  }
37
37
 
38
38
  async delete(request: { id: string }): Promise<{ success: boolean }> {
39
- const path = '/webhooks/delete';
39
+ const path = '/api/auth/webhooks/delete';
40
40
  return this.client.request<{ success: boolean }>('POST', path, {
41
41
  body: request,
42
42
  auth: true,