@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.
Files changed (85) hide show
  1. package/dist/client.d.ts +90 -37
  2. package/dist/client.js +79 -17
  3. package/dist/index.d.ts +21 -17
  4. package/dist/index.js +65 -53
  5. package/dist/plugins/admin.d.ts +19 -7
  6. package/dist/plugins/admin.js +18 -28
  7. package/dist/plugins/anonymous.d.ts +1 -1
  8. package/dist/plugins/anonymous.js +4 -2
  9. package/dist/plugins/apikey.d.ts +15 -7
  10. package/dist/plugins/apikey.js +29 -17
  11. package/dist/plugins/backupauth.d.ts +38 -28
  12. package/dist/plugins/backupauth.js +10 -10
  13. package/dist/plugins/cms.d.ts +54 -0
  14. package/dist/plugins/cms.js +149 -0
  15. package/dist/plugins/compliance.d.ts +93 -33
  16. package/dist/plugins/compliance.js +63 -61
  17. package/dist/plugins/consent.d.ts +34 -18
  18. package/dist/plugins/consent.js +16 -16
  19. package/dist/plugins/emailverification.d.ts +12 -0
  20. package/dist/plugins/emailverification.js +35 -0
  21. package/dist/plugins/idverification.d.ts +25 -11
  22. package/dist/plugins/idverification.js +14 -14
  23. package/dist/plugins/impersonation.d.ts +8 -6
  24. package/dist/plugins/impersonation.js +6 -10
  25. package/dist/plugins/jwt.d.ts +6 -5
  26. package/dist/plugins/jwt.js +16 -8
  27. package/dist/plugins/mfa.d.ts +26 -12
  28. package/dist/plugins/mfa.js +17 -21
  29. package/dist/plugins/multiapp.d.ts +46 -19
  30. package/dist/plugins/multiapp.js +40 -32
  31. package/dist/plugins/multisession.d.ts +13 -3
  32. package/dist/plugins/multisession.js +32 -4
  33. package/dist/plugins/notification.d.ts +31 -15
  34. package/dist/plugins/notification.js +27 -21
  35. package/dist/plugins/oidcprovider.d.ts +18 -12
  36. package/dist/plugins/oidcprovider.js +18 -12
  37. package/dist/plugins/organization.d.ts +32 -12
  38. package/dist/plugins/organization.js +20 -20
  39. package/dist/plugins/passkey.d.ts +6 -2
  40. package/dist/plugins/passkey.js +4 -4
  41. package/dist/plugins/permissions.d.ts +12 -0
  42. package/dist/plugins/permissions.js +33 -0
  43. package/dist/plugins/secrets.d.ts +33 -0
  44. package/dist/plugins/secrets.js +79 -0
  45. package/dist/plugins/social.d.ts +11 -2
  46. package/dist/plugins/social.js +7 -5
  47. package/dist/plugins/sso.d.ts +12 -4
  48. package/dist/plugins/sso.js +8 -8
  49. package/dist/plugins/stepup.d.ts +23 -13
  50. package/dist/plugins/stepup.js +10 -10
  51. package/dist/plugins/twofa.d.ts +6 -6
  52. package/dist/plugins/twofa.js +12 -24
  53. package/dist/plugins/username.d.ts +2 -2
  54. package/dist/plugins/username.js +8 -4
  55. package/dist/types.d.ts +3443 -2470
  56. package/package.json +2 -1
  57. package/src/client.ts +111 -37
  58. package/src/index.ts +21 -17
  59. package/src/plugins/admin.ts +18 -28
  60. package/src/plugins/anonymous.ts +4 -2
  61. package/src/plugins/apikey.ts +30 -18
  62. package/src/plugins/backupauth.ts +61 -61
  63. package/src/plugins/cms.ts +180 -0
  64. package/src/plugins/compliance.ts +98 -96
  65. package/src/plugins/consent.ts +44 -44
  66. package/src/plugins/emailverification.ts +40 -0
  67. package/src/plugins/idverification.ts +29 -29
  68. package/src/plugins/impersonation.ts +13 -17
  69. package/src/plugins/jwt.ts +18 -10
  70. package/src/plugins/mfa.ts +28 -32
  71. package/src/plugins/multiapp.ts +59 -51
  72. package/src/plugins/multisession.ts +39 -5
  73. package/src/plugins/notification.ts +44 -38
  74. package/src/plugins/oidcprovider.ts +32 -26
  75. package/src/plugins/organization.ts +27 -27
  76. package/src/plugins/passkey.ts +4 -4
  77. package/src/plugins/permissions.ts +38 -0
  78. package/src/plugins/secrets.ts +92 -0
  79. package/src/plugins/social.ts +7 -5
  80. package/src/plugins/sso.ts +8 -8
  81. package/src/plugins/stepup.ts +31 -31
  82. package/src/plugins/twofa.ts +12 -24
  83. package/src/plugins/username.ts +8 -4
  84. package/src/types.ts +3773 -2545
  85. package/authsome-client-0.0.2.tgz +0 -0
@@ -12,29 +12,37 @@ export class JwtPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async createJWTKey(): Promise<void> {
15
+ async createJWTKey(request: types.CreateJWTKeyRequest): Promise<types.JWTKey> {
16
16
  const path = '/createjwtkey';
17
- return this.client.request<void>('POST', path);
17
+ return this.client.request<types.JWTKey>('POST', path, {
18
+ body: request,
19
+ });
18
20
  }
19
21
 
20
- async listJWTKeys(): Promise<void> {
22
+ async listJWTKeys(request?: types.ListJWTKeysRequest): Promise<types.ListJWTKeysResponse> {
21
23
  const path = '/listjwtkeys';
22
- return this.client.request<void>('GET', path);
24
+ return this.client.request<types.ListJWTKeysResponse>('GET', path, {
25
+ query: this.client.toQueryParams(request),
26
+ });
23
27
  }
24
28
 
25
- async getJWKS(): Promise<void> {
29
+ async getJWKS(): Promise<types.JWKSResponse> {
26
30
  const path = '/jwks';
27
- return this.client.request<void>('GET', path);
31
+ return this.client.request<types.JWKSResponse>('GET', path);
28
32
  }
29
33
 
30
- async generateToken(): Promise<void> {
34
+ async generateToken(request: types.GenerateTokenRequest): Promise<types.GenerateTokenResponse> {
31
35
  const path = '/generate';
32
- return this.client.request<void>('POST', path);
36
+ return this.client.request<types.GenerateTokenResponse>('POST', path, {
37
+ body: request,
38
+ });
33
39
  }
34
40
 
35
- async verifyToken(): Promise<void> {
41
+ async verifyToken(request: types.VerifyTokenRequest): Promise<types.VerifyTokenResponse> {
36
42
  const path = '/verify';
37
- return this.client.request<void>('POST', path);
43
+ return this.client.request<types.VerifyTokenResponse>('POST', path, {
44
+ body: request,
45
+ });
38
46
  }
39
47
 
40
48
  }
@@ -12,9 +12,9 @@ export class MfaPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async enrollFactor(request: types.FactorEnrollmentRequest): Promise<void> {
15
+ async enrollFactor(request: types.FactorEnrollmentRequest): Promise<types.FactorEnrollmentResponse> {
16
16
  const path = '/mfa/factors/enroll';
17
- return this.client.request<void>('POST', path, {
17
+ return this.client.request<types.FactorEnrollmentResponse>('POST', path, {
18
18
  body: request,
19
19
  });
20
20
  }
@@ -24,45 +24,43 @@ export class MfaPlugin implements ClientPlugin {
24
24
  return this.client.request<types.FactorsResponse>('GET', path);
25
25
  }
26
26
 
27
- async getFactor(): Promise<void> {
28
- const path = '/mfa/factors/:id';
29
- return this.client.request<void>('GET', path);
27
+ async getFactor(params: { id: string }): Promise<types.Factor> {
28
+ const path = `/mfa/factors/${params.id}`;
29
+ return this.client.request<types.Factor>('GET', path);
30
30
  }
31
31
 
32
- async updateFactor(): Promise<types.MessageResponse> {
33
- const path = '/mfa/factors/:id';
32
+ async updateFactor(params: { id: string }): Promise<types.MessageResponse> {
33
+ const path = `/mfa/factors/${params.id}`;
34
34
  return this.client.request<types.MessageResponse>('PUT', path);
35
35
  }
36
36
 
37
- async deleteFactor(): Promise<types.MessageResponse> {
38
- const path = '/mfa/factors/:id';
37
+ async deleteFactor(params: { id: string }): Promise<types.MessageResponse> {
38
+ const path = `/mfa/factors/${params.id}`;
39
39
  return this.client.request<types.MessageResponse>('DELETE', path);
40
40
  }
41
41
 
42
- async verifyFactor(request: types.VerifyFactor_req): Promise<types.MessageResponse> {
43
- const path = '/mfa/factors/:id/verify';
44
- return this.client.request<types.MessageResponse>('POST', path, {
45
- body: request,
46
- });
42
+ async verifyFactor(params: { id: string }): Promise<types.MessageResponse> {
43
+ const path = `/mfa/factors/${params.id}/verify`;
44
+ return this.client.request<types.MessageResponse>('POST', path);
47
45
  }
48
46
 
49
- async initiateChallenge(request: types.ChallengeRequest): Promise<void> {
47
+ async initiateChallenge(request: types.ChallengeRequest): Promise<types.ChallengeResponse> {
50
48
  const path = '/mfa/challenge';
51
- return this.client.request<void>('POST', path, {
49
+ return this.client.request<types.ChallengeResponse>('POST', path, {
52
50
  body: request,
53
51
  });
54
52
  }
55
53
 
56
- async verifyChallenge(request: types.VerificationRequest): Promise<void> {
54
+ async verifyChallenge(request: types.VerificationRequest): Promise<types.VerificationResponse> {
57
55
  const path = '/mfa/verify';
58
- return this.client.request<void>('POST', path, {
56
+ return this.client.request<types.VerificationResponse>('POST', path, {
59
57
  body: request,
60
58
  });
61
59
  }
62
60
 
63
- async getChallengeStatus(): Promise<void> {
64
- const path = '/mfa/challenge/:id';
65
- return this.client.request<void>('GET', path);
61
+ async getChallengeStatus(params: { id: string }): Promise<types.ChallengeStatusResponse> {
62
+ const path = `/mfa/challenge/${params.id}`;
63
+ return this.client.request<types.ChallengeStatusResponse>('GET', path);
66
64
  }
67
65
 
68
66
  async trustDevice(request: types.DeviceInfo): Promise<types.MessageResponse> {
@@ -77,14 +75,14 @@ export class MfaPlugin implements ClientPlugin {
77
75
  return this.client.request<types.DevicesResponse>('GET', path);
78
76
  }
79
77
 
80
- async revokeTrustedDevice(): Promise<types.MessageResponse> {
81
- const path = '/mfa/devices/:id';
78
+ async revokeTrustedDevice(params: { id: string }): Promise<types.MessageResponse> {
79
+ const path = `/mfa/devices/${params.id}`;
82
80
  return this.client.request<types.MessageResponse>('DELETE', path);
83
81
  }
84
82
 
85
- async getStatus(): Promise<void> {
83
+ async getStatus(): Promise<types.MFAStatus> {
86
84
  const path = '/mfa/status';
87
- return this.client.request<void>('GET', path);
85
+ return this.client.request<types.MFAStatus>('GET', path);
88
86
  }
89
87
 
90
88
  async getPolicy(): Promise<types.MFAConfigResponse> {
@@ -92,16 +90,14 @@ export class MfaPlugin implements ClientPlugin {
92
90
  return this.client.request<types.MFAConfigResponse>('GET', path);
93
91
  }
94
92
 
95
- async adminUpdatePolicy(request: types.AdminPolicyRequest): Promise<void> {
93
+ async adminUpdatePolicy(): Promise<types.StatusResponse> {
96
94
  const path = '/mfa/policy';
97
- return this.client.request<void>('PUT', path, {
98
- body: request,
99
- });
95
+ return this.client.request<types.StatusResponse>('PUT', path);
100
96
  }
101
97
 
102
- async adminResetUserMFA(): Promise<void> {
103
- const path = '/mfa/users/:id/reset';
104
- return this.client.request<void>('POST', path);
98
+ async adminResetUserMFA(params: { id: string }): Promise<types.MessageResponse> {
99
+ const path = `/mfa/users/${params.id}/reset`;
100
+ return this.client.request<types.MessageResponse>('POST', path);
105
101
  }
106
102
 
107
103
  }
@@ -12,101 +12,109 @@ export class MultiappPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async createApp(): Promise<void> {
15
+ async createApp(): Promise<types.App> {
16
16
  const path = '/createapp';
17
- return this.client.request<void>('POST', path);
17
+ return this.client.request<types.App>('POST', path);
18
18
  }
19
19
 
20
- async getApp(): Promise<void> {
21
- const path = '/:appId';
22
- return this.client.request<void>('GET', path);
20
+ async getApp(params: { appId: string }): Promise<types.App> {
21
+ const path = `/${params.appId}`;
22
+ return this.client.request<types.App>('GET', path);
23
23
  }
24
24
 
25
- async updateApp(): Promise<void> {
26
- const path = '/:appId';
27
- return this.client.request<void>('PUT', path);
25
+ async updateApp(params: { appId: string }): Promise<types.App> {
26
+ const path = `/${params.appId}`;
27
+ return this.client.request<types.App>('PUT', path);
28
28
  }
29
29
 
30
- async deleteApp(): Promise<void> {
31
- const path = '/:appId';
32
- return this.client.request<void>('DELETE', path);
30
+ async deleteApp(params: { appId: string }): Promise<types.MultitenancyStatusResponse> {
31
+ const path = `/${params.appId}`;
32
+ return this.client.request<types.MultitenancyStatusResponse>('DELETE', path);
33
33
  }
34
34
 
35
- async listApps(): Promise<void> {
35
+ async listApps(): Promise<types.AppsListResponse> {
36
36
  const path = '/listapps';
37
- return this.client.request<void>('GET', path);
37
+ return this.client.request<types.AppsListResponse>('GET', path);
38
38
  }
39
39
 
40
- async removeMember(): Promise<void> {
41
- const path = '/:memberId';
42
- return this.client.request<void>('DELETE', path);
40
+ async removeMember(params: { memberId: string }): Promise<types.MultitenancyStatusResponse> {
41
+ const path = `/${params.memberId}`;
42
+ return this.client.request<types.MultitenancyStatusResponse>('DELETE', path);
43
43
  }
44
44
 
45
- async listMembers(): Promise<void> {
45
+ async listMembers(): Promise<types.MembersListResponse> {
46
46
  const path = '/listmembers';
47
- return this.client.request<void>('GET', path);
47
+ return this.client.request<types.MembersListResponse>('GET', path);
48
48
  }
49
49
 
50
- async inviteMember(): Promise<void> {
50
+ async inviteMember(request: types.InviteMemberRequest): Promise<types.Invitation> {
51
51
  const path = '/invite';
52
- return this.client.request<void>('POST', path);
52
+ return this.client.request<types.Invitation>('POST', path, {
53
+ body: request,
54
+ });
53
55
  }
54
56
 
55
- async updateMember(): Promise<void> {
56
- const path = '/:memberId';
57
- return this.client.request<void>('PUT', path);
57
+ async updateMember(params: { memberId: string }, request: types.UpdateMemberRequest): Promise<types.Member> {
58
+ const path = `/${params.memberId}`;
59
+ return this.client.request<types.Member>('PUT', path, {
60
+ body: request,
61
+ });
58
62
  }
59
63
 
60
- async getInvitation(): Promise<void> {
61
- const path = '/:token';
62
- return this.client.request<void>('GET', path);
64
+ async getInvitation(params: { token: string }): Promise<types.Invitation> {
65
+ const path = `/${params.token}`;
66
+ return this.client.request<types.Invitation>('GET', path);
63
67
  }
64
68
 
65
- async acceptInvitation(): Promise<void> {
66
- const path = '/:token/accept';
67
- return this.client.request<void>('POST', path);
69
+ async acceptInvitation(params: { token: string }): Promise<types.MultitenancyStatusResponse> {
70
+ const path = `/${params.token}/accept`;
71
+ return this.client.request<types.MultitenancyStatusResponse>('POST', path);
68
72
  }
69
73
 
70
- async declineInvitation(): Promise<void> {
71
- const path = '/:token/decline';
72
- return this.client.request<void>('POST', path);
74
+ async declineInvitation(params: { token: string }): Promise<types.MultitenancyStatusResponse> {
75
+ const path = `/${params.token}/decline`;
76
+ return this.client.request<types.MultitenancyStatusResponse>('POST', path);
73
77
  }
74
78
 
75
- async createTeam(): Promise<void> {
79
+ async createTeam(request: types.CreateTeamRequest): Promise<types.Team> {
76
80
  const path = '/createteam';
77
- return this.client.request<void>('POST', path);
81
+ return this.client.request<types.Team>('POST', path, {
82
+ body: request,
83
+ });
78
84
  }
79
85
 
80
- async getTeam(): Promise<void> {
81
- const path = '/:teamId';
82
- return this.client.request<void>('GET', path);
86
+ async getTeam(params: { teamId: string }): Promise<types.Team> {
87
+ const path = `/${params.teamId}`;
88
+ return this.client.request<types.Team>('GET', path);
83
89
  }
84
90
 
85
- async updateTeam(): Promise<void> {
86
- const path = '/:teamId';
87
- return this.client.request<void>('PUT', path);
91
+ async updateTeam(params: { teamId: string }, request: types.UpdateTeamRequest): Promise<types.Team> {
92
+ const path = `/${params.teamId}`;
93
+ return this.client.request<types.Team>('PUT', path, {
94
+ body: request,
95
+ });
88
96
  }
89
97
 
90
- async deleteTeam(): Promise<void> {
91
- const path = '/:teamId';
92
- return this.client.request<void>('DELETE', path);
98
+ async deleteTeam(params: { teamId: string }): Promise<types.MultitenancyStatusResponse> {
99
+ const path = `/${params.teamId}`;
100
+ return this.client.request<types.MultitenancyStatusResponse>('DELETE', path);
93
101
  }
94
102
 
95
- async listTeams(): Promise<void> {
103
+ async listTeams(): Promise<types.TeamsListResponse> {
96
104
  const path = '/listteams';
97
- return this.client.request<void>('GET', path);
105
+ return this.client.request<types.TeamsListResponse>('GET', path);
98
106
  }
99
107
 
100
- async addTeamMember(request: types.AddTeamMember_req): Promise<void> {
101
- const path = '/:teamId/members';
102
- return this.client.request<void>('POST', path, {
108
+ async addTeamMember(params: { teamId: string }, request: types.AddTeamMember_req): Promise<types.MultitenancyStatusResponse> {
109
+ const path = `/${params.teamId}/members`;
110
+ return this.client.request<types.MultitenancyStatusResponse>('POST', path, {
103
111
  body: request,
104
112
  });
105
113
  }
106
114
 
107
- async removeTeamMember(): Promise<void> {
108
- const path = '/:teamId/members/:memberId';
109
- return this.client.request<void>('DELETE', path);
115
+ async removeTeamMember(params: { teamId: string; memberId: string }): Promise<types.MultitenancyStatusResponse> {
116
+ const path = `/${params.teamId}/members/${params.memberId}`;
117
+ return this.client.request<types.MultitenancyStatusResponse>('DELETE', path);
110
118
  }
111
119
 
112
120
  }
@@ -12,23 +12,57 @@ export class MultisessionPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async list(): Promise<types.SessionsResponse> {
15
+ async list(request?: types.ListSessionsRequest): Promise<types.ListSessionsResponse> {
16
16
  const path = '/list';
17
- return this.client.request<types.SessionsResponse>('GET', path);
17
+ return this.client.request<types.ListSessionsResponse>('GET', path, {
18
+ query: this.client.toQueryParams(request),
19
+ });
18
20
  }
19
21
 
20
- async setActive(request: types.SetActive_body): Promise<types.SessionTokenResponse> {
22
+ async setActive(request: types.SetActiveRequest): Promise<types.SessionTokenResponse> {
21
23
  const path = '/set-active';
22
24
  return this.client.request<types.SessionTokenResponse>('POST', path, {
23
25
  body: request,
24
26
  });
25
27
  }
26
28
 
27
- async delete(): Promise<types.StatusResponse> {
28
- const path = '/delete/{id}';
29
+ async delete(params: { id: string }): Promise<types.StatusResponse> {
30
+ const path = `/delete/${params.id}`;
29
31
  return this.client.request<types.StatusResponse>('POST', path);
30
32
  }
31
33
 
34
+ async getCurrent(): Promise<types.SessionTokenResponse> {
35
+ const path = '/current';
36
+ return this.client.request<types.SessionTokenResponse>('GET', path);
37
+ }
38
+
39
+ async getByID(params: { id: string }): Promise<types.SessionTokenResponse> {
40
+ const path = `/${params.id}`;
41
+ return this.client.request<types.SessionTokenResponse>('GET', path);
42
+ }
43
+
44
+ async revokeAll(request: types.RevokeAllRequest): Promise<types.RevokeResponse> {
45
+ const path = '/revoke-all';
46
+ return this.client.request<types.RevokeResponse>('POST', path, {
47
+ body: request,
48
+ });
49
+ }
50
+
51
+ async revokeOthers(): Promise<types.RevokeResponse> {
52
+ const path = '/revoke-others';
53
+ return this.client.request<types.RevokeResponse>('POST', path);
54
+ }
55
+
56
+ async refresh(): Promise<types.SessionTokenResponse> {
57
+ const path = '/refresh';
58
+ return this.client.request<types.SessionTokenResponse>('POST', path);
59
+ }
60
+
61
+ async getStats(): Promise<types.SessionStatsResponse> {
62
+ const path = '/stats';
63
+ return this.client.request<types.SessionStatsResponse>('GET', path);
64
+ }
65
+
32
66
  }
33
67
 
34
68
  export function multisessionClient(): MultisessionPlugin {
@@ -12,83 +12,89 @@ export class NotificationPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async previewTemplate(request: types.PreviewTemplate_req): Promise<void> {
16
- const path = '/:id/preview';
17
- return this.client.request<void>('POST', path, {
15
+ async previewTemplate(params: { id: string }, request: types.PreviewTemplate_req): Promise<types.NotificationPreviewResponse> {
16
+ const path = `/${params.id}/preview`;
17
+ return this.client.request<types.NotificationPreviewResponse>('POST', path, {
18
18
  body: request,
19
19
  });
20
20
  }
21
21
 
22
- async createTemplate(): Promise<void> {
22
+ async createTemplate(request: types.CreateTemplateRequest): Promise<types.NotificationTemplateResponse> {
23
23
  const path = '/createtemplate';
24
- return this.client.request<void>('POST', path);
24
+ return this.client.request<types.NotificationTemplateResponse>('POST', path, {
25
+ body: request,
26
+ });
25
27
  }
26
28
 
27
- async getTemplate(): Promise<void> {
28
- const path = '/:id';
29
- return this.client.request<void>('GET', path);
29
+ async getTemplate(params: { id: string }): Promise<types.NotificationTemplateResponse> {
30
+ const path = `/${params.id}`;
31
+ return this.client.request<types.NotificationTemplateResponse>('GET', path);
30
32
  }
31
33
 
32
- async listTemplates(): Promise<void> {
34
+ async listTemplates(): Promise<types.NotificationTemplateListResponse> {
33
35
  const path = '/listtemplates';
34
- return this.client.request<void>('GET', path);
36
+ return this.client.request<types.NotificationTemplateListResponse>('GET', path);
35
37
  }
36
38
 
37
- async updateTemplate(): Promise<types.MessageResponse> {
38
- const path = '/:id';
39
- return this.client.request<types.MessageResponse>('PUT', path);
39
+ async updateTemplate(params: { id: string }, request: types.UpdateTemplateRequest): Promise<types.NotificationTemplateResponse> {
40
+ const path = `/${params.id}`;
41
+ return this.client.request<types.NotificationTemplateResponse>('PUT', path, {
42
+ body: request,
43
+ });
40
44
  }
41
45
 
42
- async deleteTemplate(): Promise<types.MessageResponse> {
43
- const path = '/:id';
44
- return this.client.request<types.MessageResponse>('DELETE', path);
46
+ async deleteTemplate(params: { id: string }): Promise<types.NotificationStatusResponse> {
47
+ const path = `/${params.id}`;
48
+ return this.client.request<types.NotificationStatusResponse>('DELETE', path);
45
49
  }
46
50
 
47
- async resetTemplate(): Promise<types.MessageResponse> {
48
- const path = '/:id/reset';
49
- return this.client.request<types.MessageResponse>('POST', path);
51
+ async resetTemplate(params: { id: string }): Promise<types.NotificationStatusResponse> {
52
+ const path = `/${params.id}/reset`;
53
+ return this.client.request<types.NotificationStatusResponse>('POST', path);
50
54
  }
51
55
 
52
- async resetAllTemplates(): Promise<types.MessageResponse> {
56
+ async resetAllTemplates(): Promise<types.NotificationStatusResponse> {
53
57
  const path = '/reset-all';
54
- return this.client.request<types.MessageResponse>('POST', path);
58
+ return this.client.request<types.NotificationStatusResponse>('POST', path);
55
59
  }
56
60
 
57
- async getTemplateDefaults(): Promise<void> {
61
+ async getTemplateDefaults(): Promise<types.NotificationTemplateListResponse> {
58
62
  const path = '/defaults';
59
- return this.client.request<void>('GET', path);
63
+ return this.client.request<types.NotificationTemplateListResponse>('GET', path);
60
64
  }
61
65
 
62
- async renderTemplate(request: types.RenderTemplate_req): Promise<void> {
66
+ async renderTemplate(request: types.RenderTemplate_req): Promise<types.NotificationPreviewResponse> {
63
67
  const path = '/render';
64
- return this.client.request<void>('POST', path, {
68
+ return this.client.request<types.NotificationPreviewResponse>('POST', path, {
65
69
  body: request,
66
70
  });
67
71
  }
68
72
 
69
- async sendNotification(): Promise<void> {
73
+ async sendNotification(request: types.SendRequest): Promise<types.NotificationResponse> {
70
74
  const path = '/send';
71
- return this.client.request<void>('POST', path);
75
+ return this.client.request<types.NotificationResponse>('POST', path, {
76
+ body: request,
77
+ });
72
78
  }
73
79
 
74
- async getNotification(): Promise<void> {
75
- const path = '/:id';
76
- return this.client.request<void>('GET', path);
80
+ async getNotification(params: { id: string }): Promise<types.NotificationResponse> {
81
+ const path = `/${params.id}`;
82
+ return this.client.request<types.NotificationResponse>('GET', path);
77
83
  }
78
84
 
79
- async listNotifications(): Promise<void> {
85
+ async listNotifications(): Promise<types.NotificationListResponse> {
80
86
  const path = '/listnotifications';
81
- return this.client.request<void>('GET', path);
87
+ return this.client.request<types.NotificationListResponse>('GET', path);
82
88
  }
83
89
 
84
- async resendNotification(): Promise<void> {
85
- const path = '/:id/resend';
86
- return this.client.request<void>('POST', path);
90
+ async resendNotification(params: { id: string }): Promise<types.NotificationResponse> {
91
+ const path = `/${params.id}/resend`;
92
+ return this.client.request<types.NotificationResponse>('POST', path);
87
93
  }
88
94
 
89
- async handleWebhook(): Promise<types.StatusResponse> {
90
- const path = '/notifications/webhook/:provider';
91
- return this.client.request<types.StatusResponse>('POST', path);
95
+ async handleWebhook(params: { provider: string }): Promise<types.NotificationWebhookResponse> {
96
+ const path = `/notifications/webhook/${params.provider}`;
97
+ return this.client.request<types.NotificationWebhookResponse>('POST', path);
92
98
  }
93
99
 
94
100
  }
@@ -12,43 +12,43 @@ export class OidcproviderPlugin implements ClientPlugin {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async registerClient(request: types.ClientRegistrationRequest): Promise<void> {
15
+ async registerClient(request: types.ClientRegistrationRequest): Promise<types.ClientRegistrationResponse> {
16
16
  const path = '/register';
17
- return this.client.request<void>('POST', path, {
17
+ return this.client.request<types.ClientRegistrationResponse>('POST', path, {
18
18
  body: request,
19
19
  });
20
20
  }
21
21
 
22
- async listClients(): Promise<void> {
22
+ async listClients(): Promise<types.ClientsListResponse> {
23
23
  const path = '/listclients';
24
- return this.client.request<void>('GET', path);
24
+ return this.client.request<types.ClientsListResponse>('GET', path);
25
25
  }
26
26
 
27
- async getClient(): Promise<void> {
28
- const path = '/:clientId';
29
- return this.client.request<void>('GET', path);
27
+ async getClient(params: { clientId: string }): Promise<types.ClientDetailsResponse> {
28
+ const path = `/${params.clientId}`;
29
+ return this.client.request<types.ClientDetailsResponse>('GET', path);
30
30
  }
31
31
 
32
- async updateClient(request: types.ClientUpdateRequest): Promise<void> {
33
- const path = '/:clientId';
34
- return this.client.request<void>('PUT', path, {
32
+ async updateClient(params: { clientId: string }, request: types.ClientUpdateRequest): Promise<types.ClientDetailsResponse> {
33
+ const path = `/${params.clientId}`;
34
+ return this.client.request<types.ClientDetailsResponse>('PUT', path, {
35
35
  body: request,
36
36
  });
37
37
  }
38
38
 
39
- async deleteClient(): Promise<void> {
40
- const path = '/:clientId';
39
+ async deleteClient(params: { clientId: string }): Promise<void> {
40
+ const path = `/${params.clientId}`;
41
41
  return this.client.request<void>('DELETE', path);
42
42
  }
43
43
 
44
- async discovery(): Promise<void> {
44
+ async discovery(): Promise<types.DiscoveryResponse> {
45
45
  const path = '/.well-known/openid-configuration';
46
- return this.client.request<void>('GET', path);
46
+ return this.client.request<types.DiscoveryResponse>('GET', path);
47
47
  }
48
48
 
49
- async jWKS(): Promise<void> {
49
+ async jWKS(): Promise<types.JWKSResponse> {
50
50
  const path = '/jwks';
51
- return this.client.request<void>('GET', path);
51
+ return this.client.request<types.JWKSResponse>('GET', path);
52
52
  }
53
53
 
54
54
  async authorize(): Promise<void> {
@@ -56,31 +56,37 @@ export class OidcproviderPlugin implements ClientPlugin {
56
56
  return this.client.request<void>('GET', path);
57
57
  }
58
58
 
59
- async handleConsent(): Promise<void> {
59
+ async handleConsent(request: types.ConsentRequest): Promise<void> {
60
60
  const path = '/consent';
61
- return this.client.request<void>('POST', path);
61
+ return this.client.request<void>('POST', path, {
62
+ body: request,
63
+ });
62
64
  }
63
65
 
64
- async token(request: types.TokenRequest): Promise<void> {
66
+ async token(request: types.TokenRequest): Promise<types.TokenResponse> {
65
67
  const path = '/token';
66
- return this.client.request<void>('POST', path, {
68
+ return this.client.request<types.TokenResponse>('POST', path, {
67
69
  body: request,
68
70
  });
69
71
  }
70
72
 
71
- async userInfo(): Promise<void> {
73
+ async userInfo(): Promise<types.UserInfoResponse> {
72
74
  const path = '/userinfo';
73
- return this.client.request<void>('GET', path);
75
+ return this.client.request<types.UserInfoResponse>('GET', path);
74
76
  }
75
77
 
76
- async introspectToken(): Promise<void> {
78
+ async introspectToken(request: types.TokenIntrospectionRequest): Promise<types.TokenIntrospectionResponse> {
77
79
  const path = '/introspect';
78
- return this.client.request<void>('POST', path);
80
+ return this.client.request<types.TokenIntrospectionResponse>('POST', path, {
81
+ body: request,
82
+ });
79
83
  }
80
84
 
81
- async revokeToken(): Promise<types.StatusResponse> {
85
+ async revokeToken(request: types.TokenRevocationRequest): Promise<types.StatusResponse> {
82
86
  const path = '/revoke';
83
- return this.client.request<types.StatusResponse>('POST', path);
87
+ return this.client.request<types.StatusResponse>('POST', path, {
88
+ body: request,
89
+ });
84
90
  }
85
91
 
86
92
  }