@authsome/client 0.0.7 → 0.0.8

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 (46) hide show
  1. package/dist/client.d.ts +48 -48
  2. package/dist/client.js +22 -22
  3. package/dist/index.d.ts +22 -22
  4. package/dist/index.js +68 -68
  5. package/dist/plugins/admin.js +11 -11
  6. package/dist/plugins/apikey.js +7 -7
  7. package/dist/plugins/backupauth.js +6 -6
  8. package/dist/plugins/cms.d.ts +69 -18
  9. package/dist/plugins/cms.js +47 -47
  10. package/dist/plugins/idverification.js +11 -11
  11. package/dist/plugins/impersonation.js +6 -6
  12. package/dist/plugins/jwt.js +5 -5
  13. package/dist/plugins/multiapp.d.ts +19 -4
  14. package/dist/plugins/multiapp.js +23 -23
  15. package/dist/plugins/multisession.js +9 -9
  16. package/dist/plugins/notification.js +14 -14
  17. package/dist/plugins/oidcprovider.js +17 -17
  18. package/dist/plugins/organization.d.ts +16 -4
  19. package/dist/plugins/organization.js +20 -20
  20. package/dist/plugins/permissions.js +3 -3
  21. package/dist/plugins/secrets.js +11 -11
  22. package/dist/plugins/sso.js +6 -6
  23. package/dist/plugins/stepup.js +14 -14
  24. package/dist/plugins/webhook.d.ts +1 -1
  25. package/dist/types.d.ts +3854 -3813
  26. package/package.json +1 -2
  27. package/src/client.ts +49 -49
  28. package/src/index.ts +22 -22
  29. package/src/plugins/admin.ts +11 -11
  30. package/src/plugins/apikey.ts +7 -7
  31. package/src/plugins/backupauth.ts +6 -6
  32. package/src/plugins/cms.ts +52 -52
  33. package/src/plugins/idverification.ts +11 -11
  34. package/src/plugins/impersonation.ts +6 -6
  35. package/src/plugins/jwt.ts +5 -5
  36. package/src/plugins/multiapp.ts +30 -30
  37. package/src/plugins/multisession.ts +9 -9
  38. package/src/plugins/notification.ts +14 -14
  39. package/src/plugins/oidcprovider.ts +17 -17
  40. package/src/plugins/organization.ts +24 -24
  41. package/src/plugins/permissions.ts +3 -3
  42. package/src/plugins/secrets.ts +11 -11
  43. package/src/plugins/sso.ts +6 -6
  44. package/src/plugins/stepup.ts +14 -14
  45. package/src/plugins/webhook.ts +1 -1
  46. package/src/types.ts +3899 -3856
@@ -13,82 +13,82 @@ export class OrganizationPlugin implements ClientPlugin {
13
13
  }
14
14
 
15
15
  async createOrganization(): Promise<types.Organization> {
16
- const path = '/createorganization';
16
+ const path = '/organizations';
17
17
  return this.client.request<types.Organization>('POST', path);
18
18
  }
19
19
 
20
20
  async getOrganization(params: { id: string }): Promise<types.Organization> {
21
- const path = `/${params.id}`;
21
+ const path = `/organizations/${params.id}`;
22
22
  return this.client.request<types.Organization>('GET', path);
23
23
  }
24
24
 
25
25
  async listOrganizations(): Promise<types.Organization> {
26
- const path = '/listorganizations';
26
+ const path = '/organizations';
27
27
  return this.client.request<types.Organization>('GET', path);
28
28
  }
29
29
 
30
30
  async updateOrganization(params: { id: string }): Promise<types.Organization> {
31
- const path = `/${params.id}`;
31
+ const path = `/organizations/${params.id}`;
32
32
  return this.client.request<types.Organization>('PATCH', path);
33
33
  }
34
34
 
35
35
  async deleteOrganization(params: { id: string }): Promise<void> {
36
- const path = `/${params.id}`;
36
+ const path = `/organizations/${params.id}`;
37
37
  return this.client.request<void>('DELETE', path);
38
38
  }
39
39
 
40
40
  async getOrganizationBySlug(params: { slug: string }): Promise<types.Organization> {
41
- const path = `/slug/${params.slug}`;
41
+ const path = `/organizations/slug/${params.slug}`;
42
42
  return this.client.request<types.Organization>('GET', path);
43
43
  }
44
44
 
45
- async listMembers(): Promise<void> {
46
- const path = '/listmembers';
45
+ async listMembers(params: { id: string }): Promise<void> {
46
+ const path = `/organizations/${params.id}/members`;
47
47
  return this.client.request<void>('GET', path);
48
48
  }
49
49
 
50
- async inviteMember(): Promise<void> {
51
- const path = '/invite';
50
+ async inviteMember(params: { id: string }): Promise<void> {
51
+ const path = `/organizations/${params.id}/members/invite`;
52
52
  return this.client.request<void>('POST', path);
53
53
  }
54
54
 
55
- async updateMember(params: { memberId: string }): Promise<void> {
56
- const path = `/${params.memberId}`;
55
+ async updateMember(params: { id: string; memberId: string }): Promise<void> {
56
+ const path = `/organizations/${params.id}/members/${params.memberId}`;
57
57
  return this.client.request<void>('PATCH', path);
58
58
  }
59
59
 
60
- async removeMember(params: { memberId: string }): Promise<void> {
61
- const path = `/${params.memberId}`;
60
+ async removeMember(params: { id: string; memberId: string }): Promise<void> {
61
+ const path = `/organizations/${params.id}/members/${params.memberId}`;
62
62
  return this.client.request<void>('DELETE', path);
63
63
  }
64
64
 
65
65
  async acceptInvitation(params: { token: string }): Promise<void> {
66
- const path = `/${params.token}/accept`;
66
+ const path = `/organization-invitations/${params.token}/accept`;
67
67
  return this.client.request<void>('POST', path);
68
68
  }
69
69
 
70
70
  async declineInvitation(params: { token: string }): Promise<types.StatusResponse> {
71
- const path = `/${params.token}/decline`;
71
+ const path = `/organization-invitations/${params.token}/decline`;
72
72
  return this.client.request<types.StatusResponse>('POST', path);
73
73
  }
74
74
 
75
- async listTeams(): Promise<void> {
76
- const path = '/listteams';
75
+ async listTeams(params: { id: string }): Promise<void> {
76
+ const path = `/organizations/${params.id}/teams`;
77
77
  return this.client.request<void>('GET', path);
78
78
  }
79
79
 
80
- async createTeam(): Promise<void> {
81
- const path = '/createteam';
80
+ async createTeam(params: { id: string }): Promise<void> {
81
+ const path = `/organizations/${params.id}/teams`;
82
82
  return this.client.request<void>('POST', path);
83
83
  }
84
84
 
85
- async updateTeam(params: { teamId: string }): Promise<void> {
86
- const path = `/${params.teamId}`;
85
+ async updateTeam(params: { id: string; teamId: string }): Promise<void> {
86
+ const path = `/organizations/${params.id}/teams/${params.teamId}`;
87
87
  return this.client.request<void>('PATCH', path);
88
88
  }
89
89
 
90
- async deleteTeam(params: { teamId: string }): Promise<void> {
91
- const path = `/${params.teamId}`;
90
+ async deleteTeam(params: { id: string; teamId: string }): Promise<void> {
91
+ const path = `/organizations/${params.id}/teams/${params.teamId}`;
92
92
  return this.client.request<void>('DELETE', path);
93
93
  }
94
94
 
@@ -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 = '/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 = '/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 = '/permissions/migrate/preview';
29
29
  return this.client.request<types.ErrorResponse>('POST', path, {
30
30
  body: request,
31
31
  });
@@ -13,73 +13,73 @@ export class SecretsPlugin implements ClientPlugin {
13
13
  }
14
14
 
15
15
  async list(request?: types.ListSecretsRequest): Promise<types.ListSecretsResponse> {
16
- const path = '/list';
16
+ const path = '/secrets';
17
17
  return this.client.request<types.ListSecretsResponse>('GET', path, {
18
18
  query: this.client.toQueryParams(request),
19
19
  });
20
20
  }
21
21
 
22
22
  async create(request: types.CreateSecretRequest): Promise<types.SecretDTO> {
23
- const path = '/create';
23
+ const path = '/secrets';
24
24
  return this.client.request<types.SecretDTO>('POST', path, {
25
25
  body: request,
26
26
  });
27
27
  }
28
28
 
29
29
  async get(params: { id: string }, request?: types.GetSecretRequest): Promise<types.SecretDTO> {
30
- const path = `/${params.id}`;
30
+ const path = `/secrets/${params.id}`;
31
31
  return this.client.request<types.SecretDTO>('GET', path, {
32
32
  query: this.client.toQueryParams(request),
33
33
  });
34
34
  }
35
35
 
36
36
  async getValue(params: { id: string }, request?: types.GetValueRequest): Promise<types.RevealValueResponse> {
37
- const path = `/${params.id}/value`;
37
+ const path = `/secrets/${params.id}/value`;
38
38
  return this.client.request<types.RevealValueResponse>('GET', path, {
39
39
  query: this.client.toQueryParams(request),
40
40
  });
41
41
  }
42
42
 
43
43
  async update(params: { id: string }, request: types.UpdateSecretRequest): Promise<types.SecretDTO> {
44
- const path = `/${params.id}`;
44
+ const path = `/secrets/${params.id}`;
45
45
  return this.client.request<types.SecretDTO>('PUT', path, {
46
46
  body: request,
47
47
  });
48
48
  }
49
49
 
50
50
  async delete(params: { id: string }, request?: types.DeleteSecretRequest): Promise<types.SuccessResponse> {
51
- const path = `/${params.id}`;
51
+ const path = `/secrets/${params.id}`;
52
52
  return this.client.request<types.SuccessResponse>('DELETE', path, {
53
53
  query: this.client.toQueryParams(request),
54
54
  });
55
55
  }
56
56
 
57
57
  async getByPath(): Promise<types.ErrorResponse> {
58
- const path = '/path/*path';
58
+ const path = '/secrets/path/*path';
59
59
  return this.client.request<types.ErrorResponse>('GET', path);
60
60
  }
61
61
 
62
62
  async getVersions(params: { id: string }, request?: types.GetVersionsRequest): Promise<types.ListVersionsResponse> {
63
- const path = `/${params.id}/versions`;
63
+ const path = `/secrets/${params.id}/versions`;
64
64
  return this.client.request<types.ListVersionsResponse>('GET', path, {
65
65
  query: this.client.toQueryParams(request),
66
66
  });
67
67
  }
68
68
 
69
69
  async rollback(params: { id: string; version: number }, request: types.RollbackRequest): Promise<types.SecretDTO> {
70
- const path = `/${params.id}/rollback/${params.version}`;
70
+ const path = `/secrets/${params.id}/rollback/${params.version}`;
71
71
  return this.client.request<types.SecretDTO>('POST', path, {
72
72
  body: request,
73
73
  });
74
74
  }
75
75
 
76
76
  async getStats(): Promise<types.StatsDTO> {
77
- const path = '/stats';
77
+ const path = '/secrets/stats';
78
78
  return this.client.request<types.StatsDTO>('GET', path);
79
79
  }
80
80
 
81
81
  async getTree(request?: types.GetTreeRequest): Promise<types.SecretTreeNode> {
82
- const path = '/tree';
82
+ const path = '/secrets/tree';
83
83
  return this.client.request<types.SecretTreeNode>('GET', path, {
84
84
  query: this.client.toQueryParams(request),
85
85
  });
@@ -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
 
@@ -13,80 +13,80 @@ export class StepupPlugin implements ClientPlugin {
13
13
  }
14
14
 
15
15
  async evaluate(request: types.EvaluateRequest): Promise<types.StepUpEvaluationResponse> {
16
- const path = '/evaluate';
16
+ const path = '/stepup/evaluate';
17
17
  return this.client.request<types.StepUpEvaluationResponse>('POST', path, {
18
18
  body: request,
19
19
  });
20
20
  }
21
21
 
22
22
  async verify(request: types.VerifyRequest): Promise<types.StepUpVerificationResponse> {
23
- const path = '/verify';
23
+ const path = '/stepup/verify';
24
24
  return this.client.request<types.StepUpVerificationResponse>('POST', path, {
25
25
  body: request,
26
26
  });
27
27
  }
28
28
 
29
29
  async getRequirement(params: { id: string }): Promise<types.StepUpRequirementResponse> {
30
- const path = `/requirements/${params.id}`;
30
+ const path = `/stepup/requirements/${params.id}`;
31
31
  return this.client.request<types.StepUpRequirementResponse>('GET', path);
32
32
  }
33
33
 
34
34
  async listPendingRequirements(): Promise<types.StepUpRequirementsResponse> {
35
- const path = '/requirements/pending';
35
+ const path = '/stepup/requirements/pending';
36
36
  return this.client.request<types.StepUpRequirementsResponse>('GET', path);
37
37
  }
38
38
 
39
39
  async listVerifications(): Promise<types.StepUpVerificationsResponse> {
40
- const path = '/verifications';
40
+ const path = '/stepup/verifications';
41
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
49
  async forgetDevice(params: { id: string }): Promise<types.StepUpStatusResponse> {
50
- const path = `/devices/${params.id}`;
50
+ const path = `/stepup/devices/${params.id}`;
51
51
  return this.client.request<types.StepUpStatusResponse>('DELETE', path);
52
52
  }
53
53
 
54
54
  async createPolicy(request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse> {
55
- const path = '/policies';
55
+ const path = '/stepup/policies';
56
56
  return this.client.request<types.StepUpPolicyResponse>('POST', path, {
57
57
  body: request,
58
58
  });
59
59
  }
60
60
 
61
61
  async listPolicies(): Promise<types.StepUpPoliciesResponse> {
62
- const path = '/policies';
62
+ const path = '/stepup/policies';
63
63
  return this.client.request<types.StepUpPoliciesResponse>('GET', path);
64
64
  }
65
65
 
66
66
  async getPolicy(params: { id: string }): Promise<types.StepUpPolicyResponse> {
67
- const path = `/policies/${params.id}`;
67
+ const path = `/stepup/policies/${params.id}`;
68
68
  return this.client.request<types.StepUpPolicyResponse>('GET', path);
69
69
  }
70
70
 
71
71
  async updatePolicy(params: { id: string }, request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse> {
72
- const path = `/policies/${params.id}`;
72
+ const path = `/stepup/policies/${params.id}`;
73
73
  return this.client.request<types.StepUpPolicyResponse>('PUT', path, {
74
74
  body: request,
75
75
  });
76
76
  }
77
77
 
78
78
  async deletePolicy(params: { id: string }): Promise<types.StepUpStatusResponse> {
79
- const path = `/policies/${params.id}`;
79
+ const path = `/stepup/policies/${params.id}`;
80
80
  return this.client.request<types.StepUpStatusResponse>('DELETE', path);
81
81
  }
82
82
 
83
83
  async getAuditLogs(): Promise<types.StepUpAuditLogsResponse> {
84
- const path = '/audit';
84
+ const path = '/stepup/audit';
85
85
  return this.client.request<types.StepUpAuditLogsResponse>('GET', path);
86
86
  }
87
87
 
88
88
  async status(): Promise<types.StepUpStatusResponse> {
89
- const path = '/status';
89
+ const path = '/stepup/status';
90
90
  return this.client.request<types.StepUpStatusResponse>('GET', path);
91
91
  }
92
92
 
@@ -12,7 +12,7 @@ export class WebhookPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async create(request: { url: string; events: string[]; secret?: string }): Promise<{ webhook: types.Webhook }> {
15
+ async create(request: { secret?: string; url: string; events: string[] }): Promise<{ webhook: types.Webhook }> {
16
16
  const path = '/api/auth/webhooks';
17
17
  return this.client.request<{ webhook: types.Webhook }>('POST', path, {
18
18
  body: request,