@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
@@ -22,134 +22,136 @@ class CompliancePlugin {
22
22
  body: request,
23
23
  });
24
24
  }
25
- async getProfile() {
26
- const path = '/profiles/:id';
25
+ async getProfile(params) {
26
+ const path = `/profiles/${params.id}`;
27
27
  return this.client.request('GET', path);
28
28
  }
29
- async getAppProfile() {
30
- const path = '/apps/:appId/profile';
29
+ async getAppProfile(params) {
30
+ const path = `/apps/${params.appId}/profile`;
31
31
  return this.client.request('GET', path);
32
32
  }
33
- async updateProfile(request) {
34
- const path = '/profiles/:id';
33
+ async updateProfile(params, request) {
34
+ const path = `/profiles/${params.id}`;
35
35
  return this.client.request('PUT', path, {
36
36
  body: request,
37
37
  });
38
38
  }
39
- async deleteProfile() {
40
- const path = '/profiles/:id';
39
+ async deleteProfile(params) {
40
+ const path = `/profiles/${params.id}`;
41
41
  return this.client.request('DELETE', path);
42
42
  }
43
- async getComplianceStatus() {
44
- const path = '/apps/:appId/status';
43
+ async getComplianceStatus(params) {
44
+ const path = `/apps/${params.appId}/status`;
45
45
  return this.client.request('GET', path);
46
46
  }
47
- async getDashboard() {
48
- const path = '/apps/:appId/dashboard';
47
+ async getDashboard(params) {
48
+ const path = `/apps/${params.appId}/dashboard`;
49
49
  return this.client.request('GET', path);
50
50
  }
51
- async runCheck(request) {
52
- const path = '/profiles/:profileId/checks';
51
+ async runCheck(params, request) {
52
+ const path = `/profiles/${params.profileId}/checks`;
53
53
  return this.client.request('POST', path, {
54
54
  body: request,
55
55
  });
56
56
  }
57
- async listChecks() {
58
- const path = '/profiles/:profileId/checks';
57
+ async listChecks(params) {
58
+ const path = `/profiles/${params.profileId}/checks`;
59
59
  return this.client.request('GET', path);
60
60
  }
61
- async getCheck() {
62
- const path = '/checks/:id';
61
+ async getCheck(params) {
62
+ const path = `/checks/${params.id}`;
63
63
  return this.client.request('GET', path);
64
64
  }
65
- async listViolations() {
66
- const path = '/apps/:appId/violations';
65
+ async listViolations(params) {
66
+ const path = `/apps/${params.appId}/violations`;
67
67
  return this.client.request('GET', path);
68
68
  }
69
- async getViolation() {
70
- const path = '/violations/:id';
69
+ async getViolation(params) {
70
+ const path = `/violations/${params.id}`;
71
71
  return this.client.request('GET', path);
72
72
  }
73
- async resolveViolation() {
74
- const path = '/violations/:id/resolve';
75
- return this.client.request('PUT', path);
73
+ async resolveViolation(params, request) {
74
+ const path = `/violations/${params.id}/resolve`;
75
+ return this.client.request('PUT', path, {
76
+ body: request,
77
+ });
76
78
  }
77
- async generateReport(request) {
78
- const path = '/apps/:appId/reports';
79
+ async generateReport(params, request) {
80
+ const path = `/apps/${params.appId}/reports`;
79
81
  return this.client.request('POST', path, {
80
82
  body: request,
81
83
  });
82
84
  }
83
- async listReports() {
84
- const path = '/apps/:appId/reports';
85
+ async listReports(params) {
86
+ const path = `/apps/${params.appId}/reports`;
85
87
  return this.client.request('GET', path);
86
88
  }
87
- async getReport() {
88
- const path = '/reports/:id';
89
+ async getReport(params) {
90
+ const path = `/reports/${params.id}`;
89
91
  return this.client.request('GET', path);
90
92
  }
91
- async downloadReport() {
92
- const path = '/reports/:id/download';
93
+ async downloadReport(params) {
94
+ const path = `/reports/${params.id}/download`;
93
95
  return this.client.request('GET', path);
94
96
  }
95
- async createEvidence(request) {
96
- const path = '/apps/:appId/evidence';
97
+ async createEvidence(params, request) {
98
+ const path = `/apps/${params.appId}/evidence`;
97
99
  return this.client.request('POST', path, {
98
100
  body: request,
99
101
  });
100
102
  }
101
- async listEvidence() {
102
- const path = '/apps/:appId/evidence';
103
+ async listEvidence(params) {
104
+ const path = `/apps/${params.appId}/evidence`;
103
105
  return this.client.request('GET', path);
104
106
  }
105
- async getEvidence() {
106
- const path = '/evidence/:id';
107
+ async getEvidence(params) {
108
+ const path = `/evidence/${params.id}`;
107
109
  return this.client.request('GET', path);
108
110
  }
109
- async deleteEvidence() {
110
- const path = '/evidence/:id';
111
+ async deleteEvidence(params) {
112
+ const path = `/evidence/${params.id}`;
111
113
  return this.client.request('DELETE', path);
112
114
  }
113
- async createPolicy(request) {
114
- const path = '/apps/:appId/policies';
115
+ async createPolicy(params, request) {
116
+ const path = `/apps/${params.appId}/policies`;
115
117
  return this.client.request('POST', path, {
116
118
  body: request,
117
119
  });
118
120
  }
119
- async listPolicies() {
120
- const path = '/apps/:appId/policies';
121
+ async listPolicies(params) {
122
+ const path = `/apps/${params.appId}/policies`;
121
123
  return this.client.request('GET', path);
122
124
  }
123
- async getPolicy() {
124
- const path = '/policies/:id';
125
+ async getPolicy(params) {
126
+ const path = `/policies/${params.id}`;
125
127
  return this.client.request('GET', path);
126
128
  }
127
- async updatePolicy(request) {
128
- const path = '/policies/:id';
129
+ async updatePolicy(params, request) {
130
+ const path = `/policies/${params.id}`;
129
131
  return this.client.request('PUT', path, {
130
132
  body: request,
131
133
  });
132
134
  }
133
- async deletePolicy() {
134
- const path = '/policies/:id';
135
+ async deletePolicy(params) {
136
+ const path = `/policies/${params.id}`;
135
137
  return this.client.request('DELETE', path);
136
138
  }
137
- async createTraining(request) {
138
- const path = '/apps/:appId/training';
139
+ async createTraining(params, request) {
140
+ const path = `/apps/${params.appId}/training`;
139
141
  return this.client.request('POST', path, {
140
142
  body: request,
141
143
  });
142
144
  }
143
- async listTraining() {
144
- const path = '/apps/:appId/training';
145
+ async listTraining(params) {
146
+ const path = `/apps/${params.appId}/training`;
145
147
  return this.client.request('GET', path);
146
148
  }
147
- async getUserTraining() {
148
- const path = '/users/:userId/training';
149
+ async getUserTraining(params) {
150
+ const path = `/users/${params.userId}/training`;
149
151
  return this.client.request('GET', path);
150
152
  }
151
- async completeTraining(request) {
152
- const path = '/training/:id/complete';
153
+ async completeTraining(params, request) {
154
+ const path = `/training/${params.id}/complete`;
153
155
  return this.client.request('PUT', path, {
154
156
  body: request,
155
157
  });
@@ -158,8 +160,8 @@ class CompliancePlugin {
158
160
  const path = '/templates';
159
161
  return this.client.request('GET', path);
160
162
  }
161
- async getTemplate() {
162
- const path = '/templates/:standard';
163
+ async getTemplate(params) {
164
+ const path = `/templates/${params.standard}`;
163
165
  return this.client.request('GET', path);
164
166
  }
165
167
  }
@@ -5,23 +5,39 @@ export declare class ConsentPlugin implements ClientPlugin {
5
5
  readonly id = "consent";
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
- createConsent(request: types.CreateConsentRequest): Promise<void>;
9
- getConsent(): Promise<void>;
10
- updateConsent(request: types.UpdateConsentRequest): Promise<void>;
11
- revokeConsent(request: types.UpdateConsentRequest): Promise<types.MessageResponse>;
12
- createConsentPolicy(request: types.CreatePolicyRequest): Promise<void>;
13
- getConsentPolicy(): Promise<void>;
14
- recordCookieConsent(request: types.CookieConsentRequest): Promise<void>;
15
- getCookieConsent(): Promise<void>;
16
- requestDataExport(request: types.DataExportRequestInput): Promise<void>;
17
- getDataExport(): Promise<void>;
18
- downloadDataExport(): Promise<void>;
19
- requestDataDeletion(request: types.DataDeletionRequestInput): Promise<void>;
20
- getDataDeletion(): Promise<void>;
21
- approveDeletionRequest(): Promise<types.MessageResponse>;
22
- getPrivacySettings(): Promise<void>;
23
- updatePrivacySettings(request: types.PrivacySettingsRequest): Promise<void>;
24
- getConsentAuditLogs(): Promise<void>;
25
- generateConsentReport(): Promise<void>;
8
+ createConsent(request: types.CreateConsentRequest): Promise<types.ConsentRecordResponse>;
9
+ getConsent(params: {
10
+ id: string;
11
+ }): Promise<types.ConsentRecordResponse>;
12
+ updateConsent(params: {
13
+ id: string;
14
+ }, request: types.UpdateConsentRequest): Promise<types.ConsentRecordResponse>;
15
+ revokeConsent(params: {
16
+ id: string;
17
+ }, request: types.UpdateConsentRequest): Promise<types.ConsentStatusResponse>;
18
+ createConsentPolicy(request: types.CreatePolicyRequest): Promise<types.ConsentPolicyResponse>;
19
+ getConsentPolicy(params: {
20
+ id: string;
21
+ }): Promise<types.ConsentPolicyResponse>;
22
+ recordCookieConsent(request: types.CookieConsentRequest): Promise<types.ConsentCookieResponse>;
23
+ getCookieConsent(): Promise<types.ConsentCookieResponse>;
24
+ requestDataExport(request: types.DataExportRequestInput): Promise<types.ConsentExportResponse>;
25
+ getDataExport(params: {
26
+ id: string;
27
+ }): Promise<types.ConsentExportResponse>;
28
+ downloadDataExport(params: {
29
+ id: string;
30
+ }): Promise<types.ConsentExportFileResponse>;
31
+ requestDataDeletion(request: types.DataDeletionRequestInput): Promise<types.ConsentDeletionResponse>;
32
+ getDataDeletion(params: {
33
+ id: string;
34
+ }): Promise<types.ConsentDeletionResponse>;
35
+ approveDeletionRequest(params: {
36
+ id: string;
37
+ }): Promise<types.ConsentStatusResponse>;
38
+ getPrivacySettings(): Promise<types.ConsentSettingsResponse>;
39
+ updatePrivacySettings(request: types.PrivacySettingsRequest): Promise<types.ConsentSettingsResponse>;
40
+ getConsentAuditLogs(): Promise<types.ConsentAuditLogsResponse>;
41
+ generateConsentReport(): Promise<types.ConsentReportResponse>;
26
42
  }
27
43
  export declare function consentClient(): ConsentPlugin;
@@ -16,18 +16,18 @@ class ConsentPlugin {
16
16
  body: request,
17
17
  });
18
18
  }
19
- async getConsent() {
20
- const path = '/records/:id';
19
+ async getConsent(params) {
20
+ const path = `/records/${params.id}`;
21
21
  return this.client.request('GET', path);
22
22
  }
23
- async updateConsent(request) {
24
- const path = '/records/:id';
23
+ async updateConsent(params, request) {
24
+ const path = `/records/${params.id}`;
25
25
  return this.client.request('PUT', path, {
26
26
  body: request,
27
27
  });
28
28
  }
29
- async revokeConsent(request) {
30
- const path = '/revoke/:id';
29
+ async revokeConsent(params, request) {
30
+ const path = `/revoke/${params.id}`;
31
31
  return this.client.request('POST', path, {
32
32
  body: request,
33
33
  });
@@ -38,8 +38,8 @@ class ConsentPlugin {
38
38
  body: request,
39
39
  });
40
40
  }
41
- async getConsentPolicy() {
42
- const path = '/policies/:id';
41
+ async getConsentPolicy(params) {
42
+ const path = `/policies/${params.id}`;
43
43
  return this.client.request('GET', path);
44
44
  }
45
45
  async recordCookieConsent(request) {
@@ -58,12 +58,12 @@ class ConsentPlugin {
58
58
  body: request,
59
59
  });
60
60
  }
61
- async getDataExport() {
62
- const path = '/export/:id';
61
+ async getDataExport(params) {
62
+ const path = `/export/${params.id}`;
63
63
  return this.client.request('GET', path);
64
64
  }
65
- async downloadDataExport() {
66
- const path = '/export/:id/download';
65
+ async downloadDataExport(params) {
66
+ const path = `/export/${params.id}/download`;
67
67
  return this.client.request('GET', path);
68
68
  }
69
69
  async requestDataDeletion(request) {
@@ -72,12 +72,12 @@ class ConsentPlugin {
72
72
  body: request,
73
73
  });
74
74
  }
75
- async getDataDeletion() {
76
- const path = '/deletion/:id';
75
+ async getDataDeletion(params) {
76
+ const path = `/deletion/${params.id}`;
77
77
  return this.client.request('GET', path);
78
78
  }
79
- async approveDeletionRequest() {
80
- const path = '/deletion/:id/approve';
79
+ async approveDeletionRequest(params) {
80
+ const path = `/deletion/${params.id}/approve`;
81
81
  return this.client.request('POST', path);
82
82
  }
83
83
  async getPrivacySettings() {
@@ -0,0 +1,12 @@
1
+ import { ClientPlugin } from '../plugin';
2
+ import { AuthsomeClient } from '../client';
3
+ import * as types from '../types';
4
+ export declare class EmailverificationPlugin implements ClientPlugin {
5
+ readonly id = "emailverification";
6
+ private client;
7
+ init(client: AuthsomeClient): void;
8
+ send(request: types.SendRequest): Promise<types.SendResponse>;
9
+ verify(request?: types.VerifyRequest): Promise<types.VerifyResponse>;
10
+ resend(request: types.ResendRequest): Promise<types.ResendResponse>;
11
+ }
12
+ export declare function emailverificationClient(): EmailverificationPlugin;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Auto-generated emailverification plugin
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EmailverificationPlugin = void 0;
5
+ exports.emailverificationClient = emailverificationClient;
6
+ class EmailverificationPlugin {
7
+ constructor() {
8
+ this.id = 'emailverification';
9
+ }
10
+ init(client) {
11
+ this.client = client;
12
+ }
13
+ async send(request) {
14
+ const path = '/email-verification/send';
15
+ return this.client.request('POST', path, {
16
+ body: request,
17
+ });
18
+ }
19
+ async verify(request) {
20
+ const path = '/email-verification/verify';
21
+ return this.client.request('GET', path, {
22
+ query: this.client.toQueryParams(request),
23
+ });
24
+ }
25
+ async resend(request) {
26
+ const path = '/email-verification/resend';
27
+ return this.client.request('POST', path, {
28
+ body: request,
29
+ });
30
+ }
31
+ }
32
+ exports.EmailverificationPlugin = EmailverificationPlugin;
33
+ function emailverificationClient() {
34
+ return new EmailverificationPlugin();
35
+ }
@@ -5,16 +5,30 @@ export declare class IdverificationPlugin implements ClientPlugin {
5
5
  readonly id = "idverification";
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
- createVerificationSession(request: types.CreateVerificationSession_req): Promise<types.VerificationSessionResponse>;
9
- getVerificationSession(): Promise<types.VerificationSessionResponse>;
10
- getVerification(): Promise<types.VerificationResponse>;
11
- getUserVerifications(): Promise<types.VerificationListResponse>;
12
- getUserVerificationStatus(): Promise<types.UserVerificationStatusResponse>;
13
- requestReverification(request: types.RequestReverification_req): Promise<types.MessageResponse>;
14
- handleWebhook(): Promise<void>;
15
- adminBlockUser(request: types.AdminBlockUser_req): Promise<types.MessageResponse>;
16
- adminUnblockUser(): Promise<types.MessageResponse>;
17
- adminGetUserVerificationStatus(): Promise<types.UserVerificationStatusResponse>;
18
- adminGetUserVerifications(): Promise<types.VerificationListResponse>;
8
+ createVerificationSession(request: types.CreateVerificationSession_req): Promise<types.IDVerificationSessionResponse>;
9
+ getVerificationSession(params: {
10
+ id: string;
11
+ }): Promise<types.IDVerificationSessionResponse>;
12
+ getVerification(params: {
13
+ id: string;
14
+ }): Promise<types.IDVerificationResponse>;
15
+ getUserVerifications(): Promise<types.IDVerificationListResponse>;
16
+ getUserVerificationStatus(): Promise<types.IDVerificationStatusResponse>;
17
+ requestReverification(request: types.RequestReverification_req): Promise<types.IDVerificationSessionResponse>;
18
+ handleWebhook(params: {
19
+ provider: string;
20
+ }): Promise<types.IDVerificationWebhookResponse>;
21
+ adminBlockUser(params: {
22
+ userId: string;
23
+ }, request: types.AdminBlockUser_req): Promise<types.IDVerificationStatusResponse>;
24
+ adminUnblockUser(params: {
25
+ userId: string;
26
+ }): Promise<types.IDVerificationStatusResponse>;
27
+ adminGetUserVerificationStatus(params: {
28
+ userId: string;
29
+ }): Promise<types.IDVerificationStatusResponse>;
30
+ adminGetUserVerifications(params: {
31
+ userId: string;
32
+ }): Promise<types.IDVerificationListResponse>;
19
33
  }
20
34
  export declare function idverificationClient(): IdverificationPlugin;
@@ -16,12 +16,12 @@ class IdverificationPlugin {
16
16
  body: request,
17
17
  });
18
18
  }
19
- async getVerificationSession() {
20
- const path = '/sessions/:id';
19
+ async getVerificationSession(params) {
20
+ const path = `/sessions/${params.id}`;
21
21
  return this.client.request('GET', path);
22
22
  }
23
- async getVerification() {
24
- const path = '/:id';
23
+ async getVerification(params) {
24
+ const path = `/${params.id}`;
25
25
  return this.client.request('GET', path);
26
26
  }
27
27
  async getUserVerifications() {
@@ -38,26 +38,26 @@ class IdverificationPlugin {
38
38
  body: request,
39
39
  });
40
40
  }
41
- async handleWebhook() {
42
- const path = '/webhook/:provider';
41
+ async handleWebhook(params) {
42
+ const path = `/webhook/${params.provider}`;
43
43
  return this.client.request('POST', path);
44
44
  }
45
- async adminBlockUser(request) {
46
- const path = '/users/:userId/block';
45
+ async adminBlockUser(params, request) {
46
+ const path = `/users/${params.userId}/block`;
47
47
  return this.client.request('POST', path, {
48
48
  body: request,
49
49
  });
50
50
  }
51
- async adminUnblockUser() {
52
- const path = '/users/:userId/unblock';
51
+ async adminUnblockUser(params) {
52
+ const path = `/users/${params.userId}/unblock`;
53
53
  return this.client.request('POST', path);
54
54
  }
55
- async adminGetUserVerificationStatus() {
56
- const path = '/users/:userId/status';
55
+ async adminGetUserVerificationStatus(params) {
56
+ const path = `/users/${params.userId}/status`;
57
57
  return this.client.request('GET', path);
58
58
  }
59
- async adminGetUserVerifications() {
60
- const path = '/users/:userId/verifications';
59
+ async adminGetUserVerifications(params) {
60
+ const path = `/users/${params.userId}/verifications`;
61
61
  return this.client.request('GET', path);
62
62
  }
63
63
  }
@@ -5,11 +5,13 @@ export declare class ImpersonationPlugin implements ClientPlugin {
5
5
  readonly id = "impersonation";
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
- startImpersonation(request: types.StartImpersonation_reqBody): Promise<void>;
9
- endImpersonation(request: types.EndImpersonation_reqBody): Promise<void>;
10
- getImpersonation(): Promise<void>;
11
- listImpersonations(): Promise<void>;
12
- listAuditEvents(): Promise<void>;
13
- verifyImpersonation(): Promise<void>;
8
+ startImpersonation(): Promise<types.ImpersonationStartResponse>;
9
+ endImpersonation(): Promise<types.ImpersonationEndResponse>;
10
+ getImpersonation(params: {
11
+ id: string;
12
+ }): Promise<types.ImpersonationSession>;
13
+ listImpersonations(): Promise<types.ImpersonationListResponse>;
14
+ listAuditEvents(): Promise<types.ImpersonationAuditResponse>;
15
+ verifyImpersonation(): Promise<types.ImpersonationVerifyResponse>;
14
16
  }
15
17
  export declare function impersonationClient(): ImpersonationPlugin;
@@ -10,20 +10,16 @@ class ImpersonationPlugin {
10
10
  init(client) {
11
11
  this.client = client;
12
12
  }
13
- async startImpersonation(request) {
13
+ async startImpersonation() {
14
14
  const path = '/start';
15
- return this.client.request('POST', path, {
16
- body: request,
17
- });
15
+ return this.client.request('POST', path);
18
16
  }
19
- async endImpersonation(request) {
17
+ async endImpersonation() {
20
18
  const path = '/end';
21
- return this.client.request('POST', path, {
22
- body: request,
23
- });
19
+ return this.client.request('POST', path);
24
20
  }
25
- async getImpersonation() {
26
- const path = '/:id';
21
+ async getImpersonation(params) {
22
+ const path = `/${params.id}`;
27
23
  return this.client.request('GET', path);
28
24
  }
29
25
  async listImpersonations() {
@@ -1,13 +1,14 @@
1
1
  import { ClientPlugin } from '../plugin';
2
2
  import { AuthsomeClient } from '../client';
3
+ import * as types from '../types';
3
4
  export declare class JwtPlugin implements ClientPlugin {
4
5
  readonly id = "jwt";
5
6
  private client;
6
7
  init(client: AuthsomeClient): void;
7
- createJWTKey(): Promise<void>;
8
- listJWTKeys(): Promise<void>;
9
- getJWKS(): Promise<void>;
10
- generateToken(): Promise<void>;
11
- verifyToken(): Promise<void>;
8
+ createJWTKey(request: types.CreateJWTKeyRequest): Promise<types.JWTKey>;
9
+ listJWTKeys(request?: types.ListJWTKeysRequest): Promise<types.ListJWTKeysResponse>;
10
+ getJWKS(): Promise<types.JWKSResponse>;
11
+ generateToken(request: types.GenerateTokenRequest): Promise<types.GenerateTokenResponse>;
12
+ verifyToken(request: types.VerifyTokenRequest): Promise<types.VerifyTokenResponse>;
12
13
  }
13
14
  export declare function jwtClient(): JwtPlugin;
@@ -10,25 +10,33 @@ class JwtPlugin {
10
10
  init(client) {
11
11
  this.client = client;
12
12
  }
13
- async createJWTKey() {
13
+ async createJWTKey(request) {
14
14
  const path = '/createjwtkey';
15
- return this.client.request('POST', path);
15
+ return this.client.request('POST', path, {
16
+ body: request,
17
+ });
16
18
  }
17
- async listJWTKeys() {
19
+ async listJWTKeys(request) {
18
20
  const path = '/listjwtkeys';
19
- return this.client.request('GET', path);
21
+ return this.client.request('GET', path, {
22
+ query: this.client.toQueryParams(request),
23
+ });
20
24
  }
21
25
  async getJWKS() {
22
26
  const path = '/jwks';
23
27
  return this.client.request('GET', path);
24
28
  }
25
- async generateToken() {
29
+ async generateToken(request) {
26
30
  const path = '/generate';
27
- return this.client.request('POST', path);
31
+ return this.client.request('POST', path, {
32
+ body: request,
33
+ });
28
34
  }
29
- async verifyToken() {
35
+ async verifyToken(request) {
30
36
  const path = '/verify';
31
- return this.client.request('POST', path);
37
+ return this.client.request('POST', path, {
38
+ body: request,
39
+ });
32
40
  }
33
41
  }
34
42
  exports.JwtPlugin = JwtPlugin;
@@ -5,21 +5,35 @@ export declare class MfaPlugin implements ClientPlugin {
5
5
  readonly id = "mfa";
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
- enrollFactor(request: types.FactorEnrollmentRequest): Promise<void>;
8
+ enrollFactor(request: types.FactorEnrollmentRequest): Promise<types.FactorEnrollmentResponse>;
9
9
  listFactors(): Promise<types.FactorsResponse>;
10
- getFactor(): Promise<void>;
11
- updateFactor(): Promise<types.MessageResponse>;
12
- deleteFactor(): Promise<types.MessageResponse>;
13
- verifyFactor(request: types.VerifyFactor_req): Promise<types.MessageResponse>;
14
- initiateChallenge(request: types.ChallengeRequest): Promise<void>;
15
- verifyChallenge(request: types.VerificationRequest): Promise<void>;
16
- getChallengeStatus(): Promise<void>;
10
+ getFactor(params: {
11
+ id: string;
12
+ }): Promise<types.Factor>;
13
+ updateFactor(params: {
14
+ id: string;
15
+ }): Promise<types.MessageResponse>;
16
+ deleteFactor(params: {
17
+ id: string;
18
+ }): Promise<types.MessageResponse>;
19
+ verifyFactor(params: {
20
+ id: string;
21
+ }): Promise<types.MessageResponse>;
22
+ initiateChallenge(request: types.ChallengeRequest): Promise<types.ChallengeResponse>;
23
+ verifyChallenge(request: types.VerificationRequest): Promise<types.VerificationResponse>;
24
+ getChallengeStatus(params: {
25
+ id: string;
26
+ }): Promise<types.ChallengeStatusResponse>;
17
27
  trustDevice(request: types.DeviceInfo): Promise<types.MessageResponse>;
18
28
  listTrustedDevices(): Promise<types.DevicesResponse>;
19
- revokeTrustedDevice(): Promise<types.MessageResponse>;
20
- getStatus(): Promise<void>;
29
+ revokeTrustedDevice(params: {
30
+ id: string;
31
+ }): Promise<types.MessageResponse>;
32
+ getStatus(): Promise<types.MFAStatus>;
21
33
  getPolicy(): Promise<types.MFAConfigResponse>;
22
- adminUpdatePolicy(request: types.AdminPolicyRequest): Promise<void>;
23
- adminResetUserMFA(): Promise<void>;
34
+ adminUpdatePolicy(): Promise<types.StatusResponse>;
35
+ adminResetUserMFA(params: {
36
+ id: string;
37
+ }): Promise<types.MessageResponse>;
24
38
  }
25
39
  export declare function mfaClient(): MfaPlugin;