@authsome/client 0.0.1 → 0.0.2

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 (45) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +392 -0
  3. package/RELEASE_CHECKLIST.md +162 -0
  4. package/RELEASE_v0.0.2.md +126 -0
  5. package/authsome-client-0.0.2.tgz +0 -0
  6. package/dist/client.d.ts +57 -1
  7. package/dist/client.js +39 -8
  8. package/dist/index.d.ts +25 -25
  9. package/dist/index.js +78 -26
  10. package/dist/plugins/oidcprovider.d.ts +1 -1
  11. package/dist/plugins/webhook.d.ts +3 -3
  12. package/dist/plugins/webhook.js +4 -4
  13. package/dist/types.d.ts +2471 -2531
  14. package/package.json +3 -24
  15. package/src/client.ts +257 -0
  16. package/src/errors.ts +92 -0
  17. package/src/index.ts +33 -0
  18. package/src/plugin.ts +13 -0
  19. package/src/plugins/admin.ts +84 -0
  20. package/src/plugins/anonymous.ts +31 -0
  21. package/src/plugins/apikey.ts +56 -0
  22. package/src/plugins/backupauth.ts +208 -0
  23. package/src/plugins/compliance.ts +204 -0
  24. package/src/plugins/consent.ts +125 -0
  25. package/src/plugins/emailotp.ts +33 -0
  26. package/src/plugins/idverification.ts +80 -0
  27. package/src/plugins/impersonation.ts +53 -0
  28. package/src/plugins/jwt.ts +44 -0
  29. package/src/plugins/magiclink.ts +31 -0
  30. package/src/plugins/mfa.ts +111 -0
  31. package/src/plugins/multiapp.ts +116 -0
  32. package/src/plugins/multisession.ts +36 -0
  33. package/src/plugins/notification.ts +98 -0
  34. package/src/plugins/oidcprovider.ts +90 -0
  35. package/src/plugins/organization.ts +99 -0
  36. package/src/plugins/passkey.ts +54 -0
  37. package/src/plugins/phone.ts +40 -0
  38. package/src/plugins/social.ts +48 -0
  39. package/src/plugins/sso.ts +55 -0
  40. package/src/plugins/stepup.ts +97 -0
  41. package/src/plugins/twofa.ts +61 -0
  42. package/src/plugins/username.ts +29 -0
  43. package/src/plugins/webhook.ts +50 -0
  44. package/src/types.ts +3677 -0
  45. package/tsconfig.json +16 -0
@@ -0,0 +1,208 @@
1
+ // Auto-generated backupauth plugin
2
+
3
+ import { ClientPlugin } from '../plugin';
4
+ import { AuthsomeClient } from '../client';
5
+ import * as types from '../types';
6
+
7
+ export class BackupauthPlugin implements ClientPlugin {
8
+ readonly id = 'backupauth';
9
+ private client!: AuthsomeClient;
10
+
11
+ init(client: AuthsomeClient): void {
12
+ this.client = client;
13
+ }
14
+
15
+ async startRecovery(request: types.StartRecoveryRequest): Promise<types.ErrorResponse> {
16
+ const path = '/recovery/start';
17
+ return this.client.request<types.ErrorResponse>('POST', path, {
18
+ body: request,
19
+ });
20
+ }
21
+
22
+ async continueRecovery(request: types.ContinueRecoveryRequest): Promise<types.ErrorResponse> {
23
+ const path = '/recovery/continue';
24
+ return this.client.request<types.ErrorResponse>('POST', path, {
25
+ body: request,
26
+ });
27
+ }
28
+
29
+ async completeRecovery(request: types.CompleteRecoveryRequest): Promise<types.ErrorResponse> {
30
+ const path = '/recovery/complete';
31
+ return this.client.request<types.ErrorResponse>('POST', path, {
32
+ body: request,
33
+ });
34
+ }
35
+
36
+ async cancelRecovery(request: types.CancelRecoveryRequest): Promise<types.SuccessResponse> {
37
+ const path = '/recovery/cancel';
38
+ return this.client.request<types.SuccessResponse>('POST', path, {
39
+ body: request,
40
+ });
41
+ }
42
+
43
+ async generateRecoveryCodes(request: types.GenerateRecoveryCodesRequest): Promise<types.ErrorResponse> {
44
+ const path = '/recovery-codes/generate';
45
+ return this.client.request<types.ErrorResponse>('POST', path, {
46
+ body: request,
47
+ });
48
+ }
49
+
50
+ async verifyRecoveryCode(request: types.VerifyRecoveryCodeRequest): Promise<types.ErrorResponse> {
51
+ const path = '/recovery-codes/verify';
52
+ return this.client.request<types.ErrorResponse>('POST', path, {
53
+ body: request,
54
+ });
55
+ }
56
+
57
+ async setupSecurityQuestions(request: types.SetupSecurityQuestionsRequest): Promise<types.ErrorResponse> {
58
+ const path = '/security-questions/setup';
59
+ return this.client.request<types.ErrorResponse>('POST', path, {
60
+ body: request,
61
+ });
62
+ }
63
+
64
+ async getSecurityQuestions(request: types.GetSecurityQuestionsRequest): Promise<types.ErrorResponse> {
65
+ const path = '/security-questions/get';
66
+ return this.client.request<types.ErrorResponse>('POST', path, {
67
+ body: request,
68
+ });
69
+ }
70
+
71
+ async verifySecurityAnswers(request: types.VerifySecurityAnswersRequest): Promise<types.ErrorResponse> {
72
+ const path = '/security-questions/verify';
73
+ return this.client.request<types.ErrorResponse>('POST', path, {
74
+ body: request,
75
+ });
76
+ }
77
+
78
+ async addTrustedContact(request: types.AddTrustedContactRequest): Promise<types.ErrorResponse> {
79
+ const path = '/trusted-contacts/add';
80
+ return this.client.request<types.ErrorResponse>('POST', path, {
81
+ body: request,
82
+ });
83
+ }
84
+
85
+ async listTrustedContacts(): Promise<types.ErrorResponse> {
86
+ const path = '/trusted-contacts';
87
+ return this.client.request<types.ErrorResponse>('GET', path);
88
+ }
89
+
90
+ async verifyTrustedContact(request: types.VerifyTrustedContactRequest): Promise<types.ErrorResponse> {
91
+ const path = '/trusted-contacts/verify';
92
+ return this.client.request<types.ErrorResponse>('POST', path, {
93
+ body: request,
94
+ });
95
+ }
96
+
97
+ async requestTrustedContactVerification(request: types.RequestTrustedContactVerificationRequest): Promise<types.ErrorResponse> {
98
+ const path = '/trusted-contacts/request-verification';
99
+ return this.client.request<types.ErrorResponse>('POST', path, {
100
+ body: request,
101
+ });
102
+ }
103
+
104
+ async removeTrustedContact(): Promise<types.SuccessResponse> {
105
+ const path = '/trusted-contacts/:id';
106
+ return this.client.request<types.SuccessResponse>('DELETE', path);
107
+ }
108
+
109
+ async sendVerificationCode(request: types.SendVerificationCodeRequest): Promise<types.ErrorResponse> {
110
+ const path = '/verification/send';
111
+ return this.client.request<types.ErrorResponse>('POST', path, {
112
+ body: request,
113
+ });
114
+ }
115
+
116
+ async verifyCode(request: types.VerifyCodeRequest): Promise<types.ErrorResponse> {
117
+ const path = '/verification/verify';
118
+ return this.client.request<types.ErrorResponse>('POST', path, {
119
+ body: request,
120
+ });
121
+ }
122
+
123
+ async scheduleVideoSession(request: types.ScheduleVideoSessionRequest): Promise<types.ErrorResponse> {
124
+ const path = '/video/schedule';
125
+ return this.client.request<types.ErrorResponse>('POST', path, {
126
+ body: request,
127
+ });
128
+ }
129
+
130
+ async startVideoSession(request: types.StartVideoSessionRequest): Promise<types.ErrorResponse> {
131
+ const path = '/video/start';
132
+ return this.client.request<types.ErrorResponse>('POST', path, {
133
+ body: request,
134
+ });
135
+ }
136
+
137
+ async completeVideoSession(request: types.CompleteVideoSessionRequest): Promise<types.ErrorResponse> {
138
+ const path = '/video/complete';
139
+ return this.client.request<types.ErrorResponse>('POST', path, {
140
+ body: request,
141
+ });
142
+ }
143
+
144
+ async uploadDocument(request: types.UploadDocumentRequest): Promise<types.ErrorResponse> {
145
+ const path = '/documents/upload';
146
+ return this.client.request<types.ErrorResponse>('POST', path, {
147
+ body: request,
148
+ });
149
+ }
150
+
151
+ async getDocumentVerification(): Promise<types.ErrorResponse> {
152
+ const path = '/documents/:id';
153
+ return this.client.request<types.ErrorResponse>('GET', path);
154
+ }
155
+
156
+ async reviewDocument(request: types.ReviewDocumentRequest): Promise<types.SuccessResponse> {
157
+ const path = '/documents/:id/review';
158
+ return this.client.request<types.SuccessResponse>('POST', path, {
159
+ body: request,
160
+ });
161
+ }
162
+
163
+ async listRecoverySessions(): Promise<void> {
164
+ const path = '/sessions';
165
+ return this.client.request<void>('GET', path);
166
+ }
167
+
168
+ async approveRecovery(request: types.ApproveRecoveryRequest): Promise<types.ErrorResponse> {
169
+ const path = '/sessions/:id/approve';
170
+ return this.client.request<types.ErrorResponse>('POST', path, {
171
+ body: request,
172
+ });
173
+ }
174
+
175
+ async rejectRecovery(request: types.RejectRecoveryRequest): Promise<types.ErrorResponse> {
176
+ const path = '/sessions/:id/reject';
177
+ return this.client.request<types.ErrorResponse>('POST', path, {
178
+ body: request,
179
+ });
180
+ }
181
+
182
+ async getRecoveryStats(): Promise<void> {
183
+ const path = '/stats';
184
+ return this.client.request<void>('GET', path);
185
+ }
186
+
187
+ async getRecoveryConfig(): Promise<void> {
188
+ const path = '/config';
189
+ return this.client.request<void>('GET', path);
190
+ }
191
+
192
+ async updateRecoveryConfig(request: types.UpdateRecoveryConfigRequest): Promise<types.SuccessResponse> {
193
+ const path = '/config';
194
+ return this.client.request<types.SuccessResponse>('PUT', path, {
195
+ body: request,
196
+ });
197
+ }
198
+
199
+ async healthCheck(): Promise<void> {
200
+ const path = '/health';
201
+ return this.client.request<void>('GET', path);
202
+ }
203
+
204
+ }
205
+
206
+ export function backupauthClient(): BackupauthPlugin {
207
+ return new BackupauthPlugin();
208
+ }
@@ -0,0 +1,204 @@
1
+ // Auto-generated compliance plugin
2
+
3
+ import { ClientPlugin } from '../plugin';
4
+ import { AuthsomeClient } from '../client';
5
+ import * as types from '../types';
6
+
7
+ export class CompliancePlugin implements ClientPlugin {
8
+ readonly id = 'compliance';
9
+ private client!: AuthsomeClient;
10
+
11
+ init(client: AuthsomeClient): void {
12
+ this.client = client;
13
+ }
14
+
15
+ async createProfile(request: types.CreateProfileRequest): Promise<void> {
16
+ const path = '/profiles';
17
+ return this.client.request<void>('POST', path, {
18
+ body: request,
19
+ });
20
+ }
21
+
22
+ async createProfileFromTemplate(request: types.CreateProfileFromTemplate_req): Promise<void> {
23
+ const path = '/profiles/from-template';
24
+ return this.client.request<void>('POST', path, {
25
+ body: request,
26
+ });
27
+ }
28
+
29
+ async getProfile(): Promise<void> {
30
+ const path = '/profiles/:id';
31
+ return this.client.request<void>('GET', path);
32
+ }
33
+
34
+ async getAppProfile(): Promise<void> {
35
+ const path = '/apps/:appId/profile';
36
+ return this.client.request<void>('GET', path);
37
+ }
38
+
39
+ async updateProfile(request: types.UpdateProfileRequest): Promise<void> {
40
+ const path = '/profiles/:id';
41
+ return this.client.request<void>('PUT', path, {
42
+ body: request,
43
+ });
44
+ }
45
+
46
+ async deleteProfile(): Promise<void> {
47
+ const path = '/profiles/:id';
48
+ return this.client.request<void>('DELETE', path);
49
+ }
50
+
51
+ async getComplianceStatus(): Promise<void> {
52
+ const path = '/apps/:appId/status';
53
+ return this.client.request<void>('GET', path);
54
+ }
55
+
56
+ async getDashboard(): Promise<void> {
57
+ const path = '/apps/:appId/dashboard';
58
+ return this.client.request<void>('GET', path);
59
+ }
60
+
61
+ async runCheck(request: types.RunCheck_req): Promise<void> {
62
+ const path = '/profiles/:profileId/checks';
63
+ return this.client.request<void>('POST', path, {
64
+ body: request,
65
+ });
66
+ }
67
+
68
+ async listChecks(): Promise<void> {
69
+ const path = '/profiles/:profileId/checks';
70
+ return this.client.request<void>('GET', path);
71
+ }
72
+
73
+ async getCheck(): Promise<void> {
74
+ const path = '/checks/:id';
75
+ return this.client.request<void>('GET', path);
76
+ }
77
+
78
+ async listViolations(): Promise<void> {
79
+ const path = '/apps/:appId/violations';
80
+ return this.client.request<void>('GET', path);
81
+ }
82
+
83
+ async getViolation(): Promise<void> {
84
+ const path = '/violations/:id';
85
+ return this.client.request<void>('GET', path);
86
+ }
87
+
88
+ async resolveViolation(): Promise<void> {
89
+ const path = '/violations/:id/resolve';
90
+ return this.client.request<void>('PUT', path);
91
+ }
92
+
93
+ async generateReport(request: types.GenerateReport_req): Promise<void> {
94
+ const path = '/apps/:appId/reports';
95
+ return this.client.request<void>('POST', path, {
96
+ body: request,
97
+ });
98
+ }
99
+
100
+ async listReports(): Promise<void> {
101
+ const path = '/apps/:appId/reports';
102
+ return this.client.request<void>('GET', path);
103
+ }
104
+
105
+ async getReport(): Promise<void> {
106
+ const path = '/reports/:id';
107
+ return this.client.request<void>('GET', path);
108
+ }
109
+
110
+ async downloadReport(): Promise<void> {
111
+ const path = '/reports/:id/download';
112
+ return this.client.request<void>('GET', path);
113
+ }
114
+
115
+ async createEvidence(request: types.CreateEvidence_req): Promise<void> {
116
+ const path = '/apps/:appId/evidence';
117
+ return this.client.request<void>('POST', path, {
118
+ body: request,
119
+ });
120
+ }
121
+
122
+ async listEvidence(): Promise<void> {
123
+ const path = '/apps/:appId/evidence';
124
+ return this.client.request<void>('GET', path);
125
+ }
126
+
127
+ async getEvidence(): Promise<void> {
128
+ const path = '/evidence/:id';
129
+ return this.client.request<void>('GET', path);
130
+ }
131
+
132
+ async deleteEvidence(): Promise<void> {
133
+ const path = '/evidence/:id';
134
+ return this.client.request<void>('DELETE', path);
135
+ }
136
+
137
+ async createPolicy(request: types.CreatePolicy_req): Promise<void> {
138
+ const path = '/apps/:appId/policies';
139
+ return this.client.request<void>('POST', path, {
140
+ body: request,
141
+ });
142
+ }
143
+
144
+ async listPolicies(): Promise<void> {
145
+ const path = '/apps/:appId/policies';
146
+ return this.client.request<void>('GET', path);
147
+ }
148
+
149
+ async getPolicy(): Promise<void> {
150
+ const path = '/policies/:id';
151
+ return this.client.request<void>('GET', path);
152
+ }
153
+
154
+ async updatePolicy(request: types.UpdatePolicy_req): Promise<void> {
155
+ const path = '/policies/:id';
156
+ return this.client.request<void>('PUT', path, {
157
+ body: request,
158
+ });
159
+ }
160
+
161
+ async deletePolicy(): Promise<void> {
162
+ const path = '/policies/:id';
163
+ return this.client.request<void>('DELETE', path);
164
+ }
165
+
166
+ async createTraining(request: types.CreateTraining_req): Promise<void> {
167
+ const path = '/apps/:appId/training';
168
+ return this.client.request<void>('POST', path, {
169
+ body: request,
170
+ });
171
+ }
172
+
173
+ async listTraining(): Promise<void> {
174
+ const path = '/apps/:appId/training';
175
+ return this.client.request<void>('GET', path);
176
+ }
177
+
178
+ async getUserTraining(): Promise<void> {
179
+ const path = '/users/:userId/training';
180
+ return this.client.request<void>('GET', path);
181
+ }
182
+
183
+ async completeTraining(request: types.CompleteTraining_req): Promise<void> {
184
+ const path = '/training/:id/complete';
185
+ return this.client.request<void>('PUT', path, {
186
+ body: request,
187
+ });
188
+ }
189
+
190
+ async listTemplates(): Promise<void> {
191
+ const path = '/templates';
192
+ return this.client.request<void>('GET', path);
193
+ }
194
+
195
+ async getTemplate(): Promise<void> {
196
+ const path = '/templates/:standard';
197
+ return this.client.request<void>('GET', path);
198
+ }
199
+
200
+ }
201
+
202
+ export function complianceClient(): CompliancePlugin {
203
+ return new CompliancePlugin();
204
+ }
@@ -0,0 +1,125 @@
1
+ // Auto-generated consent plugin
2
+
3
+ import { ClientPlugin } from '../plugin';
4
+ import { AuthsomeClient } from '../client';
5
+ import * as types from '../types';
6
+
7
+ export class ConsentPlugin implements ClientPlugin {
8
+ readonly id = 'consent';
9
+ private client!: AuthsomeClient;
10
+
11
+ init(client: AuthsomeClient): void {
12
+ this.client = client;
13
+ }
14
+
15
+ async createConsent(request: types.CreateConsentRequest): Promise<void> {
16
+ const path = '/records';
17
+ return this.client.request<void>('POST', path, {
18
+ body: request,
19
+ });
20
+ }
21
+
22
+ async getConsent(): Promise<void> {
23
+ const path = '/records/:id';
24
+ return this.client.request<void>('GET', path);
25
+ }
26
+
27
+ async updateConsent(request: types.UpdateConsentRequest): Promise<void> {
28
+ const path = '/records/:id';
29
+ return this.client.request<void>('PUT', path, {
30
+ body: request,
31
+ });
32
+ }
33
+
34
+ async revokeConsent(request: types.UpdateConsentRequest): Promise<types.MessageResponse> {
35
+ const path = '/revoke/:id';
36
+ return this.client.request<types.MessageResponse>('POST', path, {
37
+ body: request,
38
+ });
39
+ }
40
+
41
+ async createConsentPolicy(request: types.CreatePolicyRequest): Promise<void> {
42
+ const path = '/policies';
43
+ return this.client.request<void>('POST', path, {
44
+ body: request,
45
+ });
46
+ }
47
+
48
+ async getConsentPolicy(): Promise<void> {
49
+ const path = '/policies/:id';
50
+ return this.client.request<void>('GET', path);
51
+ }
52
+
53
+ async recordCookieConsent(request: types.CookieConsentRequest): Promise<void> {
54
+ const path = '/cookies';
55
+ return this.client.request<void>('POST', path, {
56
+ body: request,
57
+ });
58
+ }
59
+
60
+ async getCookieConsent(): Promise<void> {
61
+ const path = '/cookies';
62
+ return this.client.request<void>('GET', path);
63
+ }
64
+
65
+ async requestDataExport(request: types.DataExportRequestInput): Promise<void> {
66
+ const path = '/export';
67
+ return this.client.request<void>('POST', path, {
68
+ body: request,
69
+ });
70
+ }
71
+
72
+ async getDataExport(): Promise<void> {
73
+ const path = '/export/:id';
74
+ return this.client.request<void>('GET', path);
75
+ }
76
+
77
+ async downloadDataExport(): Promise<void> {
78
+ const path = '/export/:id/download';
79
+ return this.client.request<void>('GET', path);
80
+ }
81
+
82
+ async requestDataDeletion(request: types.DataDeletionRequestInput): Promise<void> {
83
+ const path = '/deletion';
84
+ return this.client.request<void>('POST', path, {
85
+ body: request,
86
+ });
87
+ }
88
+
89
+ async getDataDeletion(): Promise<void> {
90
+ const path = '/deletion/:id';
91
+ return this.client.request<void>('GET', path);
92
+ }
93
+
94
+ async approveDeletionRequest(): Promise<types.MessageResponse> {
95
+ const path = '/deletion/:id/approve';
96
+ return this.client.request<types.MessageResponse>('POST', path);
97
+ }
98
+
99
+ async getPrivacySettings(): Promise<void> {
100
+ const path = '/settings';
101
+ return this.client.request<void>('GET', path);
102
+ }
103
+
104
+ async updatePrivacySettings(request: types.PrivacySettingsRequest): Promise<void> {
105
+ const path = '/settings';
106
+ return this.client.request<void>('PUT', path, {
107
+ body: request,
108
+ });
109
+ }
110
+
111
+ async getConsentAuditLogs(): Promise<void> {
112
+ const path = '/audit';
113
+ return this.client.request<void>('GET', path);
114
+ }
115
+
116
+ async generateConsentReport(): Promise<void> {
117
+ const path = '/reports';
118
+ return this.client.request<void>('POST', path);
119
+ }
120
+
121
+ }
122
+
123
+ export function consentClient(): ConsentPlugin {
124
+ return new ConsentPlugin();
125
+ }
@@ -0,0 +1,33 @@
1
+ // Auto-generated emailotp plugin
2
+
3
+ import { ClientPlugin } from '../plugin';
4
+ import { AuthsomeClient } from '../client';
5
+ import * as types from '../types';
6
+
7
+ export class EmailotpPlugin implements ClientPlugin {
8
+ readonly id = 'emailotp';
9
+ private client!: AuthsomeClient;
10
+
11
+ init(client: AuthsomeClient): void {
12
+ this.client = client;
13
+ }
14
+
15
+ async send(request: types.SendRequest): Promise<void> {
16
+ const path = '/email-otp/send';
17
+ return this.client.request<void>('POST', path, {
18
+ body: request,
19
+ });
20
+ }
21
+
22
+ async verify(request: types.VerifyRequest): Promise<types.VerifyResponse> {
23
+ const path = '/email-otp/verify';
24
+ return this.client.request<types.VerifyResponse>('POST', path, {
25
+ body: request,
26
+ });
27
+ }
28
+
29
+ }
30
+
31
+ export function emailotpClient(): EmailotpPlugin {
32
+ return new EmailotpPlugin();
33
+ }
@@ -0,0 +1,80 @@
1
+ // Auto-generated idverification plugin
2
+
3
+ import { ClientPlugin } from '../plugin';
4
+ import { AuthsomeClient } from '../client';
5
+ import * as types from '../types';
6
+
7
+ export class IdverificationPlugin implements ClientPlugin {
8
+ readonly id = 'idverification';
9
+ private client!: AuthsomeClient;
10
+
11
+ init(client: AuthsomeClient): void {
12
+ this.client = client;
13
+ }
14
+
15
+ async createVerificationSession(request: types.CreateVerificationSession_req): Promise<types.VerificationSessionResponse> {
16
+ const path = '/sessions';
17
+ return this.client.request<types.VerificationSessionResponse>('POST', path, {
18
+ body: request,
19
+ });
20
+ }
21
+
22
+ async getVerificationSession(): Promise<types.VerificationSessionResponse> {
23
+ const path = '/sessions/:id';
24
+ return this.client.request<types.VerificationSessionResponse>('GET', path);
25
+ }
26
+
27
+ async getVerification(): Promise<types.VerificationResponse> {
28
+ const path = '/:id';
29
+ return this.client.request<types.VerificationResponse>('GET', path);
30
+ }
31
+
32
+ async getUserVerifications(): Promise<types.VerificationListResponse> {
33
+ const path = '/me';
34
+ return this.client.request<types.VerificationListResponse>('GET', path);
35
+ }
36
+
37
+ async getUserVerificationStatus(): Promise<types.UserVerificationStatusResponse> {
38
+ const path = '/me/status';
39
+ return this.client.request<types.UserVerificationStatusResponse>('GET', path);
40
+ }
41
+
42
+ async requestReverification(request: types.RequestReverification_req): Promise<types.MessageResponse> {
43
+ const path = '/me/reverify';
44
+ return this.client.request<types.MessageResponse>('POST', path, {
45
+ body: request,
46
+ });
47
+ }
48
+
49
+ async handleWebhook(): Promise<void> {
50
+ const path = '/webhook/:provider';
51
+ return this.client.request<void>('POST', path);
52
+ }
53
+
54
+ async adminBlockUser(request: types.AdminBlockUser_req): Promise<types.MessageResponse> {
55
+ const path = '/users/:userId/block';
56
+ return this.client.request<types.MessageResponse>('POST', path, {
57
+ body: request,
58
+ });
59
+ }
60
+
61
+ async adminUnblockUser(): Promise<types.MessageResponse> {
62
+ const path = '/users/:userId/unblock';
63
+ return this.client.request<types.MessageResponse>('POST', path);
64
+ }
65
+
66
+ async adminGetUserVerificationStatus(): Promise<types.UserVerificationStatusResponse> {
67
+ const path = '/users/:userId/status';
68
+ return this.client.request<types.UserVerificationStatusResponse>('GET', path);
69
+ }
70
+
71
+ async adminGetUserVerifications(): Promise<types.VerificationListResponse> {
72
+ const path = '/users/:userId/verifications';
73
+ return this.client.request<types.VerificationListResponse>('GET', path);
74
+ }
75
+
76
+ }
77
+
78
+ export function idverificationClient(): IdverificationPlugin {
79
+ return new IdverificationPlugin();
80
+ }
@@ -0,0 +1,53 @@
1
+ // Auto-generated impersonation plugin
2
+
3
+ import { ClientPlugin } from '../plugin';
4
+ import { AuthsomeClient } from '../client';
5
+ import * as types from '../types';
6
+
7
+ export class ImpersonationPlugin implements ClientPlugin {
8
+ readonly id = 'impersonation';
9
+ private client!: AuthsomeClient;
10
+
11
+ init(client: AuthsomeClient): void {
12
+ this.client = client;
13
+ }
14
+
15
+ async startImpersonation(request: types.StartImpersonation_reqBody): Promise<void> {
16
+ const path = '/start';
17
+ return this.client.request<void>('POST', path, {
18
+ body: request,
19
+ });
20
+ }
21
+
22
+ async endImpersonation(request: types.EndImpersonation_reqBody): Promise<void> {
23
+ const path = '/end';
24
+ return this.client.request<void>('POST', path, {
25
+ body: request,
26
+ });
27
+ }
28
+
29
+ async getImpersonation(): Promise<void> {
30
+ const path = '/:id';
31
+ return this.client.request<void>('GET', path);
32
+ }
33
+
34
+ async listImpersonations(): Promise<void> {
35
+ const path = '/';
36
+ return this.client.request<void>('GET', path);
37
+ }
38
+
39
+ async listAuditEvents(): Promise<void> {
40
+ const path = '/audit';
41
+ return this.client.request<void>('GET', path);
42
+ }
43
+
44
+ async verifyImpersonation(): Promise<void> {
45
+ const path = '/verify';
46
+ return this.client.request<void>('POST', path);
47
+ }
48
+
49
+ }
50
+
51
+ export function impersonationClient(): ImpersonationPlugin {
52
+ return new ImpersonationPlugin();
53
+ }