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