@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.
- package/dist/client.d.ts +90 -37
- package/dist/client.js +79 -17
- package/dist/index.d.ts +21 -17
- package/dist/index.js +65 -53
- package/dist/plugins/admin.d.ts +19 -7
- package/dist/plugins/admin.js +18 -28
- package/dist/plugins/anonymous.d.ts +1 -1
- package/dist/plugins/anonymous.js +4 -2
- package/dist/plugins/apikey.d.ts +15 -7
- package/dist/plugins/apikey.js +29 -17
- package/dist/plugins/backupauth.d.ts +38 -28
- package/dist/plugins/backupauth.js +10 -10
- package/dist/plugins/cms.d.ts +54 -0
- package/dist/plugins/cms.js +149 -0
- package/dist/plugins/compliance.d.ts +93 -33
- package/dist/plugins/compliance.js +63 -61
- package/dist/plugins/consent.d.ts +34 -18
- package/dist/plugins/consent.js +16 -16
- package/dist/plugins/emailverification.d.ts +12 -0
- package/dist/plugins/emailverification.js +35 -0
- package/dist/plugins/idverification.d.ts +25 -11
- package/dist/plugins/idverification.js +14 -14
- package/dist/plugins/impersonation.d.ts +8 -6
- package/dist/plugins/impersonation.js +6 -10
- package/dist/plugins/jwt.d.ts +6 -5
- package/dist/plugins/jwt.js +16 -8
- package/dist/plugins/mfa.d.ts +26 -12
- package/dist/plugins/mfa.js +17 -21
- package/dist/plugins/multiapp.d.ts +46 -19
- package/dist/plugins/multiapp.js +40 -32
- package/dist/plugins/multisession.d.ts +13 -3
- package/dist/plugins/multisession.js +32 -4
- package/dist/plugins/notification.d.ts +31 -15
- package/dist/plugins/notification.js +27 -21
- package/dist/plugins/oidcprovider.d.ts +18 -12
- package/dist/plugins/oidcprovider.js +18 -12
- package/dist/plugins/organization.d.ts +32 -12
- package/dist/plugins/organization.js +20 -20
- package/dist/plugins/passkey.d.ts +6 -2
- package/dist/plugins/passkey.js +4 -4
- package/dist/plugins/permissions.d.ts +12 -0
- package/dist/plugins/permissions.js +33 -0
- package/dist/plugins/secrets.d.ts +33 -0
- package/dist/plugins/secrets.js +79 -0
- package/dist/plugins/social.d.ts +11 -2
- package/dist/plugins/social.js +7 -5
- package/dist/plugins/sso.d.ts +12 -4
- package/dist/plugins/sso.js +8 -8
- package/dist/plugins/stepup.d.ts +23 -13
- package/dist/plugins/stepup.js +10 -10
- 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/types.d.ts +3443 -2470
- package/package.json +2 -1
- package/src/client.ts +111 -37
- package/src/index.ts +21 -17
- package/src/plugins/admin.ts +18 -28
- package/src/plugins/anonymous.ts +4 -2
- package/src/plugins/apikey.ts +30 -18
- package/src/plugins/backupauth.ts +61 -61
- package/src/plugins/cms.ts +180 -0
- package/src/plugins/compliance.ts +98 -96
- package/src/plugins/consent.ts +44 -44
- package/src/plugins/emailverification.ts +40 -0
- package/src/plugins/idverification.ts +29 -29
- package/src/plugins/impersonation.ts +13 -17
- package/src/plugins/jwt.ts +18 -10
- package/src/plugins/mfa.ts +28 -32
- package/src/plugins/multiapp.ts +59 -51
- package/src/plugins/multisession.ts +39 -5
- package/src/plugins/notification.ts +44 -38
- package/src/plugins/oidcprovider.ts +32 -26
- package/src/plugins/organization.ts +27 -27
- package/src/plugins/passkey.ts +4 -4
- package/src/plugins/permissions.ts +38 -0
- package/src/plugins/secrets.ts +92 -0
- package/src/plugins/social.ts +7 -5
- package/src/plugins/sso.ts +8 -8
- package/src/plugins/stepup.ts +31 -31
- package/src/plugins/twofa.ts +12 -24
- package/src/plugins/username.ts +8 -4
- package/src/types.ts +3773 -2545
- package/authsome-client-0.0.2.tgz +0 -0
package/dist/client.d.ts
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { ClientPlugin } from './plugin';
|
|
2
2
|
import * as types from './types';
|
|
3
|
-
import {
|
|
4
|
-
import { NotificationPlugin } from './plugins/notification';
|
|
5
|
-
import { PasskeyPlugin } from './plugins/passkey';
|
|
3
|
+
import { SsoPlugin } from './plugins/sso';
|
|
6
4
|
import { UsernamePlugin } from './plugins/username';
|
|
7
|
-
import {
|
|
5
|
+
import { WebhookPlugin } from './plugins/webhook';
|
|
6
|
+
import { EmailverificationPlugin } from './plugins/emailverification';
|
|
8
7
|
import { BackupauthPlugin } from './plugins/backupauth';
|
|
9
|
-
import {
|
|
8
|
+
import { JwtPlugin } from './plugins/jwt';
|
|
9
|
+
import { SecretsPlugin } from './plugins/secrets';
|
|
10
|
+
import { EmailotpPlugin } from './plugins/emailotp';
|
|
10
11
|
import { IdverificationPlugin } from './plugins/idverification';
|
|
11
|
-
import {
|
|
12
|
+
import { MultisessionPlugin } from './plugins/multisession';
|
|
12
13
|
import { OidcproviderPlugin } from './plugins/oidcprovider';
|
|
13
|
-
import { PhonePlugin } from './plugins/phone';
|
|
14
|
-
import { AdminPlugin } from './plugins/admin';
|
|
15
|
-
import { EmailotpPlugin } from './plugins/emailotp';
|
|
16
|
-
import { MfaPlugin } from './plugins/mfa';
|
|
17
|
-
import { OrganizationPlugin } from './plugins/organization';
|
|
18
|
-
import { SocialPlugin } from './plugins/social';
|
|
19
|
-
import { SsoPlugin } from './plugins/sso';
|
|
20
14
|
import { AnonymousPlugin } from './plugins/anonymous';
|
|
21
|
-
import {
|
|
22
|
-
import { JwtPlugin } from './plugins/jwt';
|
|
23
|
-
import { MultisessionPlugin } from './plugins/multisession';
|
|
15
|
+
import { MfaPlugin } from './plugins/mfa';
|
|
24
16
|
import { TwofaPlugin } from './plugins/twofa';
|
|
25
|
-
import {
|
|
17
|
+
import { AdminPlugin } from './plugins/admin';
|
|
18
|
+
import { ApikeyPlugin } from './plugins/apikey';
|
|
26
19
|
import { CompliancePlugin } from './plugins/compliance';
|
|
20
|
+
import { ConsentPlugin } from './plugins/consent';
|
|
21
|
+
import { MagiclinkPlugin } from './plugins/magiclink';
|
|
22
|
+
import { CmsPlugin } from './plugins/cms';
|
|
23
|
+
import { PermissionsPlugin } from './plugins/permissions';
|
|
24
|
+
import { StepupPlugin } from './plugins/stepup';
|
|
27
25
|
import { ImpersonationPlugin } from './plugins/impersonation';
|
|
26
|
+
import { MultiappPlugin } from './plugins/multiapp';
|
|
27
|
+
import { PasskeyPlugin } from './plugins/passkey';
|
|
28
|
+
import { SocialPlugin } from './plugins/social';
|
|
29
|
+
import { NotificationPlugin } from './plugins/notification';
|
|
30
|
+
import { OrganizationPlugin } from './plugins/organization';
|
|
31
|
+
import { PhonePlugin } from './plugins/phone';
|
|
28
32
|
/**
|
|
29
33
|
* AuthSome client configuration
|
|
30
34
|
* Supports multiple authentication methods that can be used simultaneously:
|
|
@@ -74,6 +78,10 @@ export declare class AuthsomeClient {
|
|
|
74
78
|
*/
|
|
75
79
|
setSecretKey(secretKey: string): void;
|
|
76
80
|
setBasePath(basePath: string): void;
|
|
81
|
+
/**
|
|
82
|
+
* Convert an object to query parameters, handling optional values and type conversion
|
|
83
|
+
*/
|
|
84
|
+
toQueryParams(obj?: Record<string, any>): Record<string, string> | undefined;
|
|
77
85
|
/**
|
|
78
86
|
* Set global headers for all requests
|
|
79
87
|
* @param headers - Headers to set
|
|
@@ -82,31 +90,35 @@ export declare class AuthsomeClient {
|
|
|
82
90
|
setGlobalHeaders(headers: Record<string, string>, replace?: boolean): void;
|
|
83
91
|
getPlugin<T extends ClientPlugin>(id: string): T | undefined;
|
|
84
92
|
readonly $plugins: {
|
|
85
|
-
|
|
86
|
-
notification: () => NotificationPlugin | undefined;
|
|
87
|
-
passkey: () => PasskeyPlugin | undefined;
|
|
93
|
+
sso: () => SsoPlugin | undefined;
|
|
88
94
|
username: () => UsernamePlugin | undefined;
|
|
89
|
-
|
|
95
|
+
webhook: () => WebhookPlugin | undefined;
|
|
96
|
+
emailverification: () => EmailverificationPlugin | undefined;
|
|
90
97
|
backupauth: () => BackupauthPlugin | undefined;
|
|
91
|
-
|
|
98
|
+
jwt: () => JwtPlugin | undefined;
|
|
99
|
+
secrets: () => SecretsPlugin | undefined;
|
|
100
|
+
emailotp: () => EmailotpPlugin | undefined;
|
|
92
101
|
idverification: () => IdverificationPlugin | undefined;
|
|
93
|
-
|
|
102
|
+
multisession: () => MultisessionPlugin | undefined;
|
|
94
103
|
oidcprovider: () => OidcproviderPlugin | undefined;
|
|
95
|
-
phone: () => PhonePlugin | undefined;
|
|
96
|
-
admin: () => AdminPlugin | undefined;
|
|
97
|
-
emailotp: () => EmailotpPlugin | undefined;
|
|
98
|
-
mfa: () => MfaPlugin | undefined;
|
|
99
|
-
organization: () => OrganizationPlugin | undefined;
|
|
100
|
-
social: () => SocialPlugin | undefined;
|
|
101
|
-
sso: () => SsoPlugin | undefined;
|
|
102
104
|
anonymous: () => AnonymousPlugin | undefined;
|
|
103
|
-
|
|
104
|
-
jwt: () => JwtPlugin | undefined;
|
|
105
|
-
multisession: () => MultisessionPlugin | undefined;
|
|
105
|
+
mfa: () => MfaPlugin | undefined;
|
|
106
106
|
twofa: () => TwofaPlugin | undefined;
|
|
107
|
-
|
|
107
|
+
admin: () => AdminPlugin | undefined;
|
|
108
|
+
apikey: () => ApikeyPlugin | undefined;
|
|
108
109
|
compliance: () => CompliancePlugin | undefined;
|
|
110
|
+
consent: () => ConsentPlugin | undefined;
|
|
111
|
+
magiclink: () => MagiclinkPlugin | undefined;
|
|
112
|
+
cms: () => CmsPlugin | undefined;
|
|
113
|
+
permissions: () => PermissionsPlugin | undefined;
|
|
114
|
+
stepup: () => StepupPlugin | undefined;
|
|
109
115
|
impersonation: () => ImpersonationPlugin | undefined;
|
|
116
|
+
multiapp: () => MultiappPlugin | undefined;
|
|
117
|
+
passkey: () => PasskeyPlugin | undefined;
|
|
118
|
+
social: () => SocialPlugin | undefined;
|
|
119
|
+
notification: () => NotificationPlugin | undefined;
|
|
120
|
+
organization: () => OrganizationPlugin | undefined;
|
|
121
|
+
phone: () => PhonePlugin | undefined;
|
|
110
122
|
};
|
|
111
123
|
request<T>(method: string, path: string, options?: {
|
|
112
124
|
body?: any;
|
|
@@ -137,8 +149,8 @@ export declare class AuthsomeClient {
|
|
|
137
149
|
session: types.Session;
|
|
138
150
|
}>;
|
|
139
151
|
updateUser(request: {
|
|
140
|
-
email?: string;
|
|
141
152
|
name?: string;
|
|
153
|
+
email?: string;
|
|
142
154
|
}): Promise<{
|
|
143
155
|
user: types.User;
|
|
144
156
|
}>;
|
|
@@ -146,8 +158,49 @@ export declare class AuthsomeClient {
|
|
|
146
158
|
devices: types.Device[];
|
|
147
159
|
}>;
|
|
148
160
|
revokeDevice(request: {
|
|
149
|
-
|
|
161
|
+
fingerprint: string;
|
|
150
162
|
}): Promise<{
|
|
151
|
-
|
|
163
|
+
status: string;
|
|
164
|
+
}>;
|
|
165
|
+
refreshSession(request: {
|
|
166
|
+
refreshToken: string;
|
|
167
|
+
}): Promise<{
|
|
168
|
+
refreshExpiresAt: string;
|
|
169
|
+
session: any;
|
|
170
|
+
accessToken: string;
|
|
171
|
+
refreshToken: string;
|
|
172
|
+
expiresAt: string;
|
|
173
|
+
}>;
|
|
174
|
+
requestPasswordReset(request: {
|
|
175
|
+
email: string;
|
|
176
|
+
}): Promise<{
|
|
177
|
+
message: string;
|
|
178
|
+
}>;
|
|
179
|
+
resetPassword(request: {
|
|
180
|
+
token: string;
|
|
181
|
+
newPassword: string;
|
|
182
|
+
}): Promise<{
|
|
183
|
+
message: string;
|
|
184
|
+
}>;
|
|
185
|
+
validateResetToken(query?: {
|
|
186
|
+
token?: string;
|
|
187
|
+
}): Promise<{
|
|
188
|
+
valid: boolean;
|
|
189
|
+
}>;
|
|
190
|
+
changePassword(request: {
|
|
191
|
+
oldPassword: string;
|
|
192
|
+
newPassword: string;
|
|
193
|
+
}): Promise<{
|
|
194
|
+
message: string;
|
|
195
|
+
}>;
|
|
196
|
+
requestEmailChange(request: {
|
|
197
|
+
newEmail: string;
|
|
198
|
+
}): Promise<{
|
|
199
|
+
message: string;
|
|
200
|
+
}>;
|
|
201
|
+
confirmEmailChange(request: {
|
|
202
|
+
token: string;
|
|
203
|
+
}): Promise<{
|
|
204
|
+
message: string;
|
|
152
205
|
}>;
|
|
153
206
|
}
|
package/dist/client.js
CHANGED
|
@@ -6,31 +6,35 @@ const errors_1 = require("./errors");
|
|
|
6
6
|
class AuthsomeClient {
|
|
7
7
|
constructor(config) {
|
|
8
8
|
this.$plugins = {
|
|
9
|
-
|
|
10
|
-
notification: () => this.getPlugin('notification'),
|
|
11
|
-
passkey: () => this.getPlugin('passkey'),
|
|
9
|
+
sso: () => this.getPlugin('sso'),
|
|
12
10
|
username: () => this.getPlugin('username'),
|
|
13
|
-
|
|
11
|
+
webhook: () => this.getPlugin('webhook'),
|
|
12
|
+
emailverification: () => this.getPlugin('emailverification'),
|
|
14
13
|
backupauth: () => this.getPlugin('backupauth'),
|
|
15
|
-
|
|
14
|
+
jwt: () => this.getPlugin('jwt'),
|
|
15
|
+
secrets: () => this.getPlugin('secrets'),
|
|
16
|
+
emailotp: () => this.getPlugin('emailotp'),
|
|
16
17
|
idverification: () => this.getPlugin('idverification'),
|
|
17
|
-
|
|
18
|
+
multisession: () => this.getPlugin('multisession'),
|
|
18
19
|
oidcprovider: () => this.getPlugin('oidcprovider'),
|
|
19
|
-
phone: () => this.getPlugin('phone'),
|
|
20
|
-
admin: () => this.getPlugin('admin'),
|
|
21
|
-
emailotp: () => this.getPlugin('emailotp'),
|
|
22
|
-
mfa: () => this.getPlugin('mfa'),
|
|
23
|
-
organization: () => this.getPlugin('organization'),
|
|
24
|
-
social: () => this.getPlugin('social'),
|
|
25
|
-
sso: () => this.getPlugin('sso'),
|
|
26
20
|
anonymous: () => this.getPlugin('anonymous'),
|
|
27
|
-
|
|
28
|
-
jwt: () => this.getPlugin('jwt'),
|
|
29
|
-
multisession: () => this.getPlugin('multisession'),
|
|
21
|
+
mfa: () => this.getPlugin('mfa'),
|
|
30
22
|
twofa: () => this.getPlugin('twofa'),
|
|
31
|
-
|
|
23
|
+
admin: () => this.getPlugin('admin'),
|
|
24
|
+
apikey: () => this.getPlugin('apikey'),
|
|
32
25
|
compliance: () => this.getPlugin('compliance'),
|
|
26
|
+
consent: () => this.getPlugin('consent'),
|
|
27
|
+
magiclink: () => this.getPlugin('magiclink'),
|
|
28
|
+
cms: () => this.getPlugin('cms'),
|
|
29
|
+
permissions: () => this.getPlugin('permissions'),
|
|
30
|
+
stepup: () => this.getPlugin('stepup'),
|
|
33
31
|
impersonation: () => this.getPlugin('impersonation'),
|
|
32
|
+
multiapp: () => this.getPlugin('multiapp'),
|
|
33
|
+
passkey: () => this.getPlugin('passkey'),
|
|
34
|
+
social: () => this.getPlugin('social'),
|
|
35
|
+
notification: () => this.getPlugin('notification'),
|
|
36
|
+
organization: () => this.getPlugin('organization'),
|
|
37
|
+
phone: () => this.getPlugin('phone'),
|
|
34
38
|
};
|
|
35
39
|
this.baseURL = config.baseURL;
|
|
36
40
|
this.basePath = config.basePath || '';
|
|
@@ -80,6 +84,20 @@ class AuthsomeClient {
|
|
|
80
84
|
setBasePath(basePath) {
|
|
81
85
|
this.basePath = basePath;
|
|
82
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Convert an object to query parameters, handling optional values and type conversion
|
|
89
|
+
*/
|
|
90
|
+
toQueryParams(obj) {
|
|
91
|
+
if (!obj)
|
|
92
|
+
return undefined;
|
|
93
|
+
const params = {};
|
|
94
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
95
|
+
if (value !== undefined && value !== null) {
|
|
96
|
+
params[key] = String(value);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return Object.keys(params).length > 0 ? params : undefined;
|
|
100
|
+
}
|
|
83
101
|
/**
|
|
84
102
|
* Set global headers for all requests
|
|
85
103
|
* @param headers - Headers to set
|
|
@@ -169,5 +187,49 @@ class AuthsomeClient {
|
|
|
169
187
|
auth: true,
|
|
170
188
|
});
|
|
171
189
|
}
|
|
190
|
+
async refreshSession(request) {
|
|
191
|
+
const path = '/refresh';
|
|
192
|
+
return this.request('POST', path, {
|
|
193
|
+
body: request,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
async requestPasswordReset(request) {
|
|
197
|
+
const path = '/password/reset/request';
|
|
198
|
+
return this.request('POST', path, {
|
|
199
|
+
body: request,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
async resetPassword(request) {
|
|
203
|
+
const path = '/password/reset/confirm';
|
|
204
|
+
return this.request('POST', path, {
|
|
205
|
+
body: request,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
async validateResetToken(query) {
|
|
209
|
+
const path = '/password/reset/validate';
|
|
210
|
+
return this.request('GET', path, {
|
|
211
|
+
query,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
async changePassword(request) {
|
|
215
|
+
const path = '/password/change';
|
|
216
|
+
return this.request('POST', path, {
|
|
217
|
+
body: request,
|
|
218
|
+
auth: true,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
async requestEmailChange(request) {
|
|
222
|
+
const path = '/email/change/request';
|
|
223
|
+
return this.request('POST', path, {
|
|
224
|
+
body: request,
|
|
225
|
+
auth: true,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
async confirmEmailChange(request) {
|
|
229
|
+
const path = '/email/change/confirm';
|
|
230
|
+
return this.request('POST', path, {
|
|
231
|
+
body: request,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
172
234
|
}
|
|
173
235
|
exports.AuthsomeClient = AuthsomeClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,28 +2,32 @@ export { AuthsomeClient, AuthsomeClientConfig } from './client';
|
|
|
2
2
|
export { ClientPlugin } from './plugin';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export * from './errors';
|
|
5
|
-
export {
|
|
6
|
-
export { NotificationPlugin, notificationClient } from './plugins/notification';
|
|
7
|
-
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
5
|
+
export { SsoPlugin, ssoClient } from './plugins/sso';
|
|
8
6
|
export { UsernamePlugin, usernameClient } from './plugins/username';
|
|
9
|
-
export {
|
|
7
|
+
export { WebhookPlugin, webhookClient } from './plugins/webhook';
|
|
8
|
+
export { EmailverificationPlugin, emailverificationClient } from './plugins/emailverification';
|
|
10
9
|
export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
|
|
11
|
-
export {
|
|
10
|
+
export { JwtPlugin, jwtClient } from './plugins/jwt';
|
|
11
|
+
export { SecretsPlugin, secretsClient } from './plugins/secrets';
|
|
12
|
+
export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
|
|
12
13
|
export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
|
|
13
|
-
export {
|
|
14
|
+
export { MultisessionPlugin, multisessionClient } from './plugins/multisession';
|
|
14
15
|
export { OidcproviderPlugin, oidcproviderClient } from './plugins/oidcprovider';
|
|
15
|
-
export { PhonePlugin, phoneClient } from './plugins/phone';
|
|
16
|
-
export { AdminPlugin, adminClient } from './plugins/admin';
|
|
17
|
-
export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
|
|
18
|
-
export { MfaPlugin, mfaClient } from './plugins/mfa';
|
|
19
|
-
export { OrganizationPlugin, organizationClient } from './plugins/organization';
|
|
20
|
-
export { SocialPlugin, socialClient } from './plugins/social';
|
|
21
|
-
export { SsoPlugin, ssoClient } from './plugins/sso';
|
|
22
16
|
export { AnonymousPlugin, anonymousClient } from './plugins/anonymous';
|
|
23
|
-
export {
|
|
24
|
-
export { JwtPlugin, jwtClient } from './plugins/jwt';
|
|
25
|
-
export { MultisessionPlugin, multisessionClient } from './plugins/multisession';
|
|
17
|
+
export { MfaPlugin, mfaClient } from './plugins/mfa';
|
|
26
18
|
export { TwofaPlugin, twofaClient } from './plugins/twofa';
|
|
27
|
-
export {
|
|
19
|
+
export { AdminPlugin, adminClient } from './plugins/admin';
|
|
20
|
+
export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
|
|
28
21
|
export { CompliancePlugin, complianceClient } from './plugins/compliance';
|
|
22
|
+
export { ConsentPlugin, consentClient } from './plugins/consent';
|
|
23
|
+
export { MagiclinkPlugin, magiclinkClient } from './plugins/magiclink';
|
|
24
|
+
export { CmsPlugin, cmsClient } from './plugins/cms';
|
|
25
|
+
export { PermissionsPlugin, permissionsClient } from './plugins/permissions';
|
|
26
|
+
export { StepupPlugin, stepupClient } from './plugins/stepup';
|
|
29
27
|
export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
|
|
28
|
+
export { MultiappPlugin, multiappClient } from './plugins/multiapp';
|
|
29
|
+
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
30
|
+
export { SocialPlugin, socialClient } from './plugins/social';
|
|
31
|
+
export { NotificationPlugin, notificationClient } from './plugins/notification';
|
|
32
|
+
export { OrganizationPlugin, organizationClient } from './plugins/organization';
|
|
33
|
+
export { PhonePlugin, phoneClient } from './plugins/phone';
|
package/dist/index.js
CHANGED
|
@@ -15,85 +15,97 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
18
|
+
exports.PasskeyPlugin = exports.multiappClient = exports.MultiappPlugin = exports.impersonationClient = exports.ImpersonationPlugin = exports.stepupClient = exports.StepupPlugin = exports.permissionsClient = exports.PermissionsPlugin = exports.cmsClient = exports.CmsPlugin = exports.magiclinkClient = exports.MagiclinkPlugin = exports.consentClient = exports.ConsentPlugin = exports.complianceClient = exports.CompliancePlugin = exports.apikeyClient = exports.ApikeyPlugin = exports.adminClient = exports.AdminPlugin = exports.twofaClient = exports.TwofaPlugin = exports.mfaClient = exports.MfaPlugin = exports.anonymousClient = exports.AnonymousPlugin = exports.oidcproviderClient = exports.OidcproviderPlugin = exports.multisessionClient = exports.MultisessionPlugin = exports.idverificationClient = exports.IdverificationPlugin = exports.emailotpClient = exports.EmailotpPlugin = exports.secretsClient = exports.SecretsPlugin = exports.jwtClient = exports.JwtPlugin = exports.backupauthClient = exports.BackupauthPlugin = exports.emailverificationClient = exports.EmailverificationPlugin = exports.webhookClient = exports.WebhookPlugin = exports.usernameClient = exports.UsernamePlugin = exports.ssoClient = exports.SsoPlugin = exports.AuthsomeClient = void 0;
|
|
19
|
+
exports.phoneClient = exports.PhonePlugin = exports.organizationClient = exports.OrganizationPlugin = exports.notificationClient = exports.NotificationPlugin = exports.socialClient = exports.SocialPlugin = exports.passkeyClient = void 0;
|
|
20
20
|
var client_1 = require("./client");
|
|
21
21
|
Object.defineProperty(exports, "AuthsomeClient", { enumerable: true, get: function () { return client_1.AuthsomeClient; } });
|
|
22
22
|
__exportStar(require("./types"), exports);
|
|
23
23
|
__exportStar(require("./errors"), exports);
|
|
24
24
|
// Plugin exports
|
|
25
|
-
var
|
|
26
|
-
Object.defineProperty(exports, "
|
|
27
|
-
Object.defineProperty(exports, "
|
|
28
|
-
var notification_1 = require("./plugins/notification");
|
|
29
|
-
Object.defineProperty(exports, "NotificationPlugin", { enumerable: true, get: function () { return notification_1.NotificationPlugin; } });
|
|
30
|
-
Object.defineProperty(exports, "notificationClient", { enumerable: true, get: function () { return notification_1.notificationClient; } });
|
|
31
|
-
var passkey_1 = require("./plugins/passkey");
|
|
32
|
-
Object.defineProperty(exports, "PasskeyPlugin", { enumerable: true, get: function () { return passkey_1.PasskeyPlugin; } });
|
|
33
|
-
Object.defineProperty(exports, "passkeyClient", { enumerable: true, get: function () { return passkey_1.passkeyClient; } });
|
|
25
|
+
var sso_1 = require("./plugins/sso");
|
|
26
|
+
Object.defineProperty(exports, "SsoPlugin", { enumerable: true, get: function () { return sso_1.SsoPlugin; } });
|
|
27
|
+
Object.defineProperty(exports, "ssoClient", { enumerable: true, get: function () { return sso_1.ssoClient; } });
|
|
34
28
|
var username_1 = require("./plugins/username");
|
|
35
29
|
Object.defineProperty(exports, "UsernamePlugin", { enumerable: true, get: function () { return username_1.UsernamePlugin; } });
|
|
36
30
|
Object.defineProperty(exports, "usernameClient", { enumerable: true, get: function () { return username_1.usernameClient; } });
|
|
37
|
-
var
|
|
38
|
-
Object.defineProperty(exports, "
|
|
39
|
-
Object.defineProperty(exports, "
|
|
31
|
+
var webhook_1 = require("./plugins/webhook");
|
|
32
|
+
Object.defineProperty(exports, "WebhookPlugin", { enumerable: true, get: function () { return webhook_1.WebhookPlugin; } });
|
|
33
|
+
Object.defineProperty(exports, "webhookClient", { enumerable: true, get: function () { return webhook_1.webhookClient; } });
|
|
34
|
+
var emailverification_1 = require("./plugins/emailverification");
|
|
35
|
+
Object.defineProperty(exports, "EmailverificationPlugin", { enumerable: true, get: function () { return emailverification_1.EmailverificationPlugin; } });
|
|
36
|
+
Object.defineProperty(exports, "emailverificationClient", { enumerable: true, get: function () { return emailverification_1.emailverificationClient; } });
|
|
40
37
|
var backupauth_1 = require("./plugins/backupauth");
|
|
41
38
|
Object.defineProperty(exports, "BackupauthPlugin", { enumerable: true, get: function () { return backupauth_1.BackupauthPlugin; } });
|
|
42
39
|
Object.defineProperty(exports, "backupauthClient", { enumerable: true, get: function () { return backupauth_1.backupauthClient; } });
|
|
43
|
-
var
|
|
44
|
-
Object.defineProperty(exports, "
|
|
45
|
-
Object.defineProperty(exports, "
|
|
40
|
+
var jwt_1 = require("./plugins/jwt");
|
|
41
|
+
Object.defineProperty(exports, "JwtPlugin", { enumerable: true, get: function () { return jwt_1.JwtPlugin; } });
|
|
42
|
+
Object.defineProperty(exports, "jwtClient", { enumerable: true, get: function () { return jwt_1.jwtClient; } });
|
|
43
|
+
var secrets_1 = require("./plugins/secrets");
|
|
44
|
+
Object.defineProperty(exports, "SecretsPlugin", { enumerable: true, get: function () { return secrets_1.SecretsPlugin; } });
|
|
45
|
+
Object.defineProperty(exports, "secretsClient", { enumerable: true, get: function () { return secrets_1.secretsClient; } });
|
|
46
|
+
var emailotp_1 = require("./plugins/emailotp");
|
|
47
|
+
Object.defineProperty(exports, "EmailotpPlugin", { enumerable: true, get: function () { return emailotp_1.EmailotpPlugin; } });
|
|
48
|
+
Object.defineProperty(exports, "emailotpClient", { enumerable: true, get: function () { return emailotp_1.emailotpClient; } });
|
|
46
49
|
var idverification_1 = require("./plugins/idverification");
|
|
47
50
|
Object.defineProperty(exports, "IdverificationPlugin", { enumerable: true, get: function () { return idverification_1.IdverificationPlugin; } });
|
|
48
51
|
Object.defineProperty(exports, "idverificationClient", { enumerable: true, get: function () { return idverification_1.idverificationClient; } });
|
|
49
|
-
var
|
|
50
|
-
Object.defineProperty(exports, "
|
|
51
|
-
Object.defineProperty(exports, "
|
|
52
|
+
var multisession_1 = require("./plugins/multisession");
|
|
53
|
+
Object.defineProperty(exports, "MultisessionPlugin", { enumerable: true, get: function () { return multisession_1.MultisessionPlugin; } });
|
|
54
|
+
Object.defineProperty(exports, "multisessionClient", { enumerable: true, get: function () { return multisession_1.multisessionClient; } });
|
|
52
55
|
var oidcprovider_1 = require("./plugins/oidcprovider");
|
|
53
56
|
Object.defineProperty(exports, "OidcproviderPlugin", { enumerable: true, get: function () { return oidcprovider_1.OidcproviderPlugin; } });
|
|
54
57
|
Object.defineProperty(exports, "oidcproviderClient", { enumerable: true, get: function () { return oidcprovider_1.oidcproviderClient; } });
|
|
55
|
-
var phone_1 = require("./plugins/phone");
|
|
56
|
-
Object.defineProperty(exports, "PhonePlugin", { enumerable: true, get: function () { return phone_1.PhonePlugin; } });
|
|
57
|
-
Object.defineProperty(exports, "phoneClient", { enumerable: true, get: function () { return phone_1.phoneClient; } });
|
|
58
|
-
var admin_1 = require("./plugins/admin");
|
|
59
|
-
Object.defineProperty(exports, "AdminPlugin", { enumerable: true, get: function () { return admin_1.AdminPlugin; } });
|
|
60
|
-
Object.defineProperty(exports, "adminClient", { enumerable: true, get: function () { return admin_1.adminClient; } });
|
|
61
|
-
var emailotp_1 = require("./plugins/emailotp");
|
|
62
|
-
Object.defineProperty(exports, "EmailotpPlugin", { enumerable: true, get: function () { return emailotp_1.EmailotpPlugin; } });
|
|
63
|
-
Object.defineProperty(exports, "emailotpClient", { enumerable: true, get: function () { return emailotp_1.emailotpClient; } });
|
|
64
|
-
var mfa_1 = require("./plugins/mfa");
|
|
65
|
-
Object.defineProperty(exports, "MfaPlugin", { enumerable: true, get: function () { return mfa_1.MfaPlugin; } });
|
|
66
|
-
Object.defineProperty(exports, "mfaClient", { enumerable: true, get: function () { return mfa_1.mfaClient; } });
|
|
67
|
-
var organization_1 = require("./plugins/organization");
|
|
68
|
-
Object.defineProperty(exports, "OrganizationPlugin", { enumerable: true, get: function () { return organization_1.OrganizationPlugin; } });
|
|
69
|
-
Object.defineProperty(exports, "organizationClient", { enumerable: true, get: function () { return organization_1.organizationClient; } });
|
|
70
|
-
var social_1 = require("./plugins/social");
|
|
71
|
-
Object.defineProperty(exports, "SocialPlugin", { enumerable: true, get: function () { return social_1.SocialPlugin; } });
|
|
72
|
-
Object.defineProperty(exports, "socialClient", { enumerable: true, get: function () { return social_1.socialClient; } });
|
|
73
|
-
var sso_1 = require("./plugins/sso");
|
|
74
|
-
Object.defineProperty(exports, "SsoPlugin", { enumerable: true, get: function () { return sso_1.SsoPlugin; } });
|
|
75
|
-
Object.defineProperty(exports, "ssoClient", { enumerable: true, get: function () { return sso_1.ssoClient; } });
|
|
76
58
|
var anonymous_1 = require("./plugins/anonymous");
|
|
77
59
|
Object.defineProperty(exports, "AnonymousPlugin", { enumerable: true, get: function () { return anonymous_1.AnonymousPlugin; } });
|
|
78
60
|
Object.defineProperty(exports, "anonymousClient", { enumerable: true, get: function () { return anonymous_1.anonymousClient; } });
|
|
79
|
-
var
|
|
80
|
-
Object.defineProperty(exports, "
|
|
81
|
-
Object.defineProperty(exports, "
|
|
82
|
-
var jwt_1 = require("./plugins/jwt");
|
|
83
|
-
Object.defineProperty(exports, "JwtPlugin", { enumerable: true, get: function () { return jwt_1.JwtPlugin; } });
|
|
84
|
-
Object.defineProperty(exports, "jwtClient", { enumerable: true, get: function () { return jwt_1.jwtClient; } });
|
|
85
|
-
var multisession_1 = require("./plugins/multisession");
|
|
86
|
-
Object.defineProperty(exports, "MultisessionPlugin", { enumerable: true, get: function () { return multisession_1.MultisessionPlugin; } });
|
|
87
|
-
Object.defineProperty(exports, "multisessionClient", { enumerable: true, get: function () { return multisession_1.multisessionClient; } });
|
|
61
|
+
var mfa_1 = require("./plugins/mfa");
|
|
62
|
+
Object.defineProperty(exports, "MfaPlugin", { enumerable: true, get: function () { return mfa_1.MfaPlugin; } });
|
|
63
|
+
Object.defineProperty(exports, "mfaClient", { enumerable: true, get: function () { return mfa_1.mfaClient; } });
|
|
88
64
|
var twofa_1 = require("./plugins/twofa");
|
|
89
65
|
Object.defineProperty(exports, "TwofaPlugin", { enumerable: true, get: function () { return twofa_1.TwofaPlugin; } });
|
|
90
66
|
Object.defineProperty(exports, "twofaClient", { enumerable: true, get: function () { return twofa_1.twofaClient; } });
|
|
91
|
-
var
|
|
92
|
-
Object.defineProperty(exports, "
|
|
93
|
-
Object.defineProperty(exports, "
|
|
67
|
+
var admin_1 = require("./plugins/admin");
|
|
68
|
+
Object.defineProperty(exports, "AdminPlugin", { enumerable: true, get: function () { return admin_1.AdminPlugin; } });
|
|
69
|
+
Object.defineProperty(exports, "adminClient", { enumerable: true, get: function () { return admin_1.adminClient; } });
|
|
70
|
+
var apikey_1 = require("./plugins/apikey");
|
|
71
|
+
Object.defineProperty(exports, "ApikeyPlugin", { enumerable: true, get: function () { return apikey_1.ApikeyPlugin; } });
|
|
72
|
+
Object.defineProperty(exports, "apikeyClient", { enumerable: true, get: function () { return apikey_1.apikeyClient; } });
|
|
94
73
|
var compliance_1 = require("./plugins/compliance");
|
|
95
74
|
Object.defineProperty(exports, "CompliancePlugin", { enumerable: true, get: function () { return compliance_1.CompliancePlugin; } });
|
|
96
75
|
Object.defineProperty(exports, "complianceClient", { enumerable: true, get: function () { return compliance_1.complianceClient; } });
|
|
76
|
+
var consent_1 = require("./plugins/consent");
|
|
77
|
+
Object.defineProperty(exports, "ConsentPlugin", { enumerable: true, get: function () { return consent_1.ConsentPlugin; } });
|
|
78
|
+
Object.defineProperty(exports, "consentClient", { enumerable: true, get: function () { return consent_1.consentClient; } });
|
|
79
|
+
var magiclink_1 = require("./plugins/magiclink");
|
|
80
|
+
Object.defineProperty(exports, "MagiclinkPlugin", { enumerable: true, get: function () { return magiclink_1.MagiclinkPlugin; } });
|
|
81
|
+
Object.defineProperty(exports, "magiclinkClient", { enumerable: true, get: function () { return magiclink_1.magiclinkClient; } });
|
|
82
|
+
var cms_1 = require("./plugins/cms");
|
|
83
|
+
Object.defineProperty(exports, "CmsPlugin", { enumerable: true, get: function () { return cms_1.CmsPlugin; } });
|
|
84
|
+
Object.defineProperty(exports, "cmsClient", { enumerable: true, get: function () { return cms_1.cmsClient; } });
|
|
85
|
+
var permissions_1 = require("./plugins/permissions");
|
|
86
|
+
Object.defineProperty(exports, "PermissionsPlugin", { enumerable: true, get: function () { return permissions_1.PermissionsPlugin; } });
|
|
87
|
+
Object.defineProperty(exports, "permissionsClient", { enumerable: true, get: function () { return permissions_1.permissionsClient; } });
|
|
88
|
+
var stepup_1 = require("./plugins/stepup");
|
|
89
|
+
Object.defineProperty(exports, "StepupPlugin", { enumerable: true, get: function () { return stepup_1.StepupPlugin; } });
|
|
90
|
+
Object.defineProperty(exports, "stepupClient", { enumerable: true, get: function () { return stepup_1.stepupClient; } });
|
|
97
91
|
var impersonation_1 = require("./plugins/impersonation");
|
|
98
92
|
Object.defineProperty(exports, "ImpersonationPlugin", { enumerable: true, get: function () { return impersonation_1.ImpersonationPlugin; } });
|
|
99
93
|
Object.defineProperty(exports, "impersonationClient", { enumerable: true, get: function () { return impersonation_1.impersonationClient; } });
|
|
94
|
+
var multiapp_1 = require("./plugins/multiapp");
|
|
95
|
+
Object.defineProperty(exports, "MultiappPlugin", { enumerable: true, get: function () { return multiapp_1.MultiappPlugin; } });
|
|
96
|
+
Object.defineProperty(exports, "multiappClient", { enumerable: true, get: function () { return multiapp_1.multiappClient; } });
|
|
97
|
+
var passkey_1 = require("./plugins/passkey");
|
|
98
|
+
Object.defineProperty(exports, "PasskeyPlugin", { enumerable: true, get: function () { return passkey_1.PasskeyPlugin; } });
|
|
99
|
+
Object.defineProperty(exports, "passkeyClient", { enumerable: true, get: function () { return passkey_1.passkeyClient; } });
|
|
100
|
+
var social_1 = require("./plugins/social");
|
|
101
|
+
Object.defineProperty(exports, "SocialPlugin", { enumerable: true, get: function () { return social_1.SocialPlugin; } });
|
|
102
|
+
Object.defineProperty(exports, "socialClient", { enumerable: true, get: function () { return social_1.socialClient; } });
|
|
103
|
+
var notification_1 = require("./plugins/notification");
|
|
104
|
+
Object.defineProperty(exports, "NotificationPlugin", { enumerable: true, get: function () { return notification_1.NotificationPlugin; } });
|
|
105
|
+
Object.defineProperty(exports, "notificationClient", { enumerable: true, get: function () { return notification_1.notificationClient; } });
|
|
106
|
+
var organization_1 = require("./plugins/organization");
|
|
107
|
+
Object.defineProperty(exports, "OrganizationPlugin", { enumerable: true, get: function () { return organization_1.OrganizationPlugin; } });
|
|
108
|
+
Object.defineProperty(exports, "organizationClient", { enumerable: true, get: function () { return organization_1.organizationClient; } });
|
|
109
|
+
var phone_1 = require("./plugins/phone");
|
|
110
|
+
Object.defineProperty(exports, "PhonePlugin", { enumerable: true, get: function () { return phone_1.PhonePlugin; } });
|
|
111
|
+
Object.defineProperty(exports, "phoneClient", { enumerable: true, get: function () { return phone_1.phoneClient; } });
|
package/dist/plugins/admin.d.ts
CHANGED
|
@@ -5,15 +5,27 @@ export declare class AdminPlugin implements ClientPlugin {
|
|
|
5
5
|
readonly id = "admin";
|
|
6
6
|
private client;
|
|
7
7
|
init(client: AuthsomeClient): void;
|
|
8
|
-
createUser(
|
|
8
|
+
createUser(): Promise<void>;
|
|
9
9
|
listUsers(): Promise<void>;
|
|
10
|
-
deleteUser(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
deleteUser(params: {
|
|
11
|
+
id: string;
|
|
12
|
+
}): Promise<types.MessageResponse>;
|
|
13
|
+
banUser(params: {
|
|
14
|
+
id: string;
|
|
15
|
+
}): Promise<types.MessageResponse>;
|
|
16
|
+
unbanUser(params: {
|
|
17
|
+
id: string;
|
|
18
|
+
}): Promise<types.MessageResponse>;
|
|
19
|
+
impersonateUser(params: {
|
|
20
|
+
id: string;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
setUserRole(params: {
|
|
23
|
+
id: string;
|
|
24
|
+
}): Promise<types.MessageResponse>;
|
|
15
25
|
listSessions(): Promise<void>;
|
|
16
|
-
revokeSession(
|
|
26
|
+
revokeSession(params: {
|
|
27
|
+
id: string;
|
|
28
|
+
}): Promise<types.MessageResponse>;
|
|
17
29
|
getStats(): Promise<void>;
|
|
18
30
|
getAuditLogs(): Promise<void>;
|
|
19
31
|
}
|
package/dist/plugins/admin.js
CHANGED
|
@@ -10,50 +10,40 @@ class AdminPlugin {
|
|
|
10
10
|
init(client) {
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
|
-
async createUser(
|
|
13
|
+
async createUser() {
|
|
14
14
|
const path = '/users';
|
|
15
|
-
return this.client.request('POST', path
|
|
16
|
-
body: request,
|
|
17
|
-
});
|
|
15
|
+
return this.client.request('POST', path);
|
|
18
16
|
}
|
|
19
17
|
async listUsers() {
|
|
20
18
|
const path = '/users';
|
|
21
19
|
return this.client.request('GET', path);
|
|
22
20
|
}
|
|
23
|
-
async deleteUser() {
|
|
24
|
-
const path =
|
|
21
|
+
async deleteUser(params) {
|
|
22
|
+
const path = `/users/${params.id}`;
|
|
25
23
|
return this.client.request('DELETE', path);
|
|
26
24
|
}
|
|
27
|
-
async banUser(
|
|
28
|
-
const path =
|
|
29
|
-
return this.client.request('POST', path
|
|
30
|
-
body: request,
|
|
31
|
-
});
|
|
25
|
+
async banUser(params) {
|
|
26
|
+
const path = `/users/${params.id}/ban`;
|
|
27
|
+
return this.client.request('POST', path);
|
|
32
28
|
}
|
|
33
|
-
async unbanUser(
|
|
34
|
-
const path =
|
|
35
|
-
return this.client.request('POST', path
|
|
36
|
-
body: request,
|
|
37
|
-
});
|
|
29
|
+
async unbanUser(params) {
|
|
30
|
+
const path = `/users/${params.id}/unban`;
|
|
31
|
+
return this.client.request('POST', path);
|
|
38
32
|
}
|
|
39
|
-
async impersonateUser(
|
|
40
|
-
const path =
|
|
41
|
-
return this.client.request('POST', path
|
|
42
|
-
body: request,
|
|
43
|
-
});
|
|
33
|
+
async impersonateUser(params) {
|
|
34
|
+
const path = `/users/${params.id}/impersonate`;
|
|
35
|
+
return this.client.request('POST', path);
|
|
44
36
|
}
|
|
45
|
-
async setUserRole(
|
|
46
|
-
const path =
|
|
47
|
-
return this.client.request('POST', path
|
|
48
|
-
body: request,
|
|
49
|
-
});
|
|
37
|
+
async setUserRole(params) {
|
|
38
|
+
const path = `/users/${params.id}/role`;
|
|
39
|
+
return this.client.request('POST', path);
|
|
50
40
|
}
|
|
51
41
|
async listSessions() {
|
|
52
42
|
const path = '/sessions';
|
|
53
43
|
return this.client.request('GET', path);
|
|
54
44
|
}
|
|
55
|
-
async revokeSession() {
|
|
56
|
-
const path =
|
|
45
|
+
async revokeSession(params) {
|
|
46
|
+
const path = `/sessions/${params.id}`;
|
|
57
47
|
return this.client.request('DELETE', path);
|
|
58
48
|
}
|
|
59
49
|
async getStats() {
|
|
@@ -5,7 +5,7 @@ export declare class AnonymousPlugin implements ClientPlugin {
|
|
|
5
5
|
readonly id = "anonymous";
|
|
6
6
|
private client;
|
|
7
7
|
init(client: AuthsomeClient): void;
|
|
8
|
-
signIn(): Promise<types.SignInResponse>;
|
|
8
|
+
signIn(request: types.SignInRequest): Promise<types.SignInResponse>;
|
|
9
9
|
link(request: types.LinkRequest): Promise<types.LinkResponse>;
|
|
10
10
|
}
|
|
11
11
|
export declare function anonymousClient(): AnonymousPlugin;
|