@authsome/client 0.0.4 → 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 (69) hide show
  1. package/dist/client.d.ts +49 -45
  2. package/dist/client.js +35 -21
  3. package/dist/index.d.ts +21 -21
  4. package/dist/index.js +65 -65
  5. package/dist/plugins/admin.d.ts +5 -5
  6. package/dist/plugins/admin.js +10 -20
  7. package/dist/plugins/anonymous.d.ts +1 -1
  8. package/dist/plugins/anonymous.js +4 -2
  9. package/dist/plugins/apikey.d.ts +7 -7
  10. package/dist/plugins/apikey.js +28 -14
  11. package/dist/plugins/backupauth.d.ts +28 -28
  12. package/dist/plugins/cms.d.ts +11 -11
  13. package/dist/plugins/cms.js +38 -28
  14. package/dist/plugins/compliance.d.ts +33 -33
  15. package/dist/plugins/compliance.js +4 -2
  16. package/dist/plugins/consent.d.ts +18 -18
  17. package/dist/plugins/emailverification.d.ts +2 -2
  18. package/dist/plugins/emailverification.js +4 -2
  19. package/dist/plugins/idverification.d.ts +11 -11
  20. package/dist/plugins/impersonation.d.ts +6 -6
  21. package/dist/plugins/impersonation.js +4 -8
  22. package/dist/plugins/jwt.d.ts +6 -5
  23. package/dist/plugins/jwt.js +16 -8
  24. package/dist/plugins/mfa.d.ts +9 -9
  25. package/dist/plugins/mfa.js +4 -8
  26. package/dist/plugins/multiapp.d.ts +19 -19
  27. package/dist/plugins/multiapp.js +16 -8
  28. package/dist/plugins/multisession.d.ts +5 -5
  29. package/dist/plugins/multisession.js +4 -2
  30. package/dist/plugins/notification.d.ts +15 -15
  31. package/dist/plugins/notification.js +12 -6
  32. package/dist/plugins/oidcprovider.d.ts +11 -11
  33. package/dist/plugins/oidcprovider.js +12 -6
  34. package/dist/plugins/organization.d.ts +5 -5
  35. package/dist/plugins/secrets.d.ts +10 -10
  36. package/dist/plugins/secrets.js +32 -16
  37. package/dist/plugins/social.js +1 -1
  38. package/dist/plugins/stepup.d.ts +13 -13
  39. package/dist/plugins/twofa.d.ts +6 -6
  40. package/dist/plugins/twofa.js +12 -24
  41. package/dist/plugins/username.d.ts +2 -2
  42. package/dist/plugins/username.js +8 -4
  43. package/dist/types.d.ts +3336 -2788
  44. package/package.json +1 -1
  45. package/src/client.ts +60 -45
  46. package/src/index.ts +21 -21
  47. package/src/plugins/admin.ts +10 -20
  48. package/src/plugins/anonymous.ts +4 -2
  49. package/src/plugins/apikey.ts +28 -14
  50. package/src/plugins/backupauth.ts +56 -56
  51. package/src/plugins/cms.ts +38 -28
  52. package/src/plugins/compliance.ts +68 -66
  53. package/src/plugins/consent.ts +36 -36
  54. package/src/plugins/emailverification.ts +6 -4
  55. package/src/plugins/idverification.ts +22 -22
  56. package/src/plugins/impersonation.ts +12 -16
  57. package/src/plugins/jwt.ts +18 -10
  58. package/src/plugins/mfa.ts +18 -22
  59. package/src/plugins/multiapp.ts +46 -38
  60. package/src/plugins/multisession.ts +11 -9
  61. package/src/plugins/notification.ts +36 -30
  62. package/src/plugins/oidcprovider.ts +28 -22
  63. package/src/plugins/organization.ts +10 -10
  64. package/src/plugins/secrets.ts +36 -20
  65. package/src/plugins/social.ts +1 -1
  66. package/src/plugins/stepup.ts +26 -26
  67. package/src/plugins/twofa.ts +12 -24
  68. package/src/plugins/username.ts +8 -4
  69. package/src/types.ts +3581 -2856
package/dist/client.d.ts CHANGED
@@ -1,33 +1,33 @@
1
1
  import { ClientPlugin } from './plugin';
2
2
  import * as types from './types';
3
- import { AdminPlugin } from './plugins/admin';
4
- import { CmsPlugin } from './plugins/cms';
5
- import { CompliancePlugin } from './plugins/compliance';
6
- import { StepupPlugin } from './plugins/stepup';
7
- import { PasskeyPlugin } from './plugins/passkey';
8
- import { ApikeyPlugin } from './plugins/apikey';
3
+ import { SsoPlugin } from './plugins/sso';
4
+ import { UsernamePlugin } from './plugins/username';
5
+ import { WebhookPlugin } from './plugins/webhook';
9
6
  import { EmailverificationPlugin } from './plugins/emailverification';
7
+ import { BackupauthPlugin } from './plugins/backupauth';
8
+ import { JwtPlugin } from './plugins/jwt';
9
+ import { SecretsPlugin } from './plugins/secrets';
10
+ import { EmailotpPlugin } from './plugins/emailotp';
11
+ import { IdverificationPlugin } from './plugins/idverification';
10
12
  import { MultisessionPlugin } from './plugins/multisession';
11
13
  import { OidcproviderPlugin } from './plugins/oidcprovider';
12
- import { OrganizationPlugin } from './plugins/organization';
13
- import { WebhookPlugin } from './plugins/webhook';
14
- import { ImpersonationPlugin } from './plugins/impersonation';
15
- import { MagiclinkPlugin } from './plugins/magiclink';
16
- import { SecretsPlugin } from './plugins/secrets';
17
- import { SsoPlugin } from './plugins/sso';
18
14
  import { AnonymousPlugin } from './plugins/anonymous';
19
- import { BackupauthPlugin } from './plugins/backupauth';
20
- import { IdverificationPlugin } from './plugins/idverification';
15
+ import { MfaPlugin } from './plugins/mfa';
21
16
  import { TwofaPlugin } from './plugins/twofa';
22
- import { EmailotpPlugin } from './plugins/emailotp';
23
- import { NotificationPlugin } from './plugins/notification';
24
- import { PermissionsPlugin } from './plugins/permissions';
25
- import { UsernamePlugin } from './plugins/username';
17
+ import { AdminPlugin } from './plugins/admin';
18
+ import { ApikeyPlugin } from './plugins/apikey';
19
+ import { CompliancePlugin } from './plugins/compliance';
26
20
  import { ConsentPlugin } from './plugins/consent';
27
- import { MfaPlugin } from './plugins/mfa';
28
- import { SocialPlugin } from './plugins/social';
29
- import { JwtPlugin } from './plugins/jwt';
21
+ import { MagiclinkPlugin } from './plugins/magiclink';
22
+ import { CmsPlugin } from './plugins/cms';
23
+ import { PermissionsPlugin } from './plugins/permissions';
24
+ import { StepupPlugin } from './plugins/stepup';
25
+ import { ImpersonationPlugin } from './plugins/impersonation';
30
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
31
  import { PhonePlugin } from './plugins/phone';
32
32
  /**
33
33
  * AuthSome client configuration
@@ -78,6 +78,10 @@ export declare class AuthsomeClient {
78
78
  */
79
79
  setSecretKey(secretKey: string): void;
80
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;
81
85
  /**
82
86
  * Set global headers for all requests
83
87
  * @param headers - Headers to set
@@ -86,34 +90,34 @@ export declare class AuthsomeClient {
86
90
  setGlobalHeaders(headers: Record<string, string>, replace?: boolean): void;
87
91
  getPlugin<T extends ClientPlugin>(id: string): T | undefined;
88
92
  readonly $plugins: {
89
- admin: () => AdminPlugin | undefined;
90
- cms: () => CmsPlugin | undefined;
91
- compliance: () => CompliancePlugin | undefined;
92
- stepup: () => StepupPlugin | undefined;
93
- passkey: () => PasskeyPlugin | undefined;
94
- apikey: () => ApikeyPlugin | undefined;
93
+ sso: () => SsoPlugin | undefined;
94
+ username: () => UsernamePlugin | undefined;
95
+ webhook: () => WebhookPlugin | undefined;
95
96
  emailverification: () => EmailverificationPlugin | undefined;
97
+ backupauth: () => BackupauthPlugin | undefined;
98
+ jwt: () => JwtPlugin | undefined;
99
+ secrets: () => SecretsPlugin | undefined;
100
+ emailotp: () => EmailotpPlugin | undefined;
101
+ idverification: () => IdverificationPlugin | undefined;
96
102
  multisession: () => MultisessionPlugin | undefined;
97
103
  oidcprovider: () => OidcproviderPlugin | undefined;
98
- organization: () => OrganizationPlugin | undefined;
99
- webhook: () => WebhookPlugin | undefined;
100
- impersonation: () => ImpersonationPlugin | undefined;
101
- magiclink: () => MagiclinkPlugin | undefined;
102
- secrets: () => SecretsPlugin | undefined;
103
- sso: () => SsoPlugin | undefined;
104
104
  anonymous: () => AnonymousPlugin | undefined;
105
- backupauth: () => BackupauthPlugin | undefined;
106
- idverification: () => IdverificationPlugin | undefined;
105
+ mfa: () => MfaPlugin | undefined;
107
106
  twofa: () => TwofaPlugin | undefined;
108
- emailotp: () => EmailotpPlugin | undefined;
109
- notification: () => NotificationPlugin | undefined;
110
- permissions: () => PermissionsPlugin | undefined;
111
- username: () => UsernamePlugin | undefined;
107
+ admin: () => AdminPlugin | undefined;
108
+ apikey: () => ApikeyPlugin | undefined;
109
+ compliance: () => CompliancePlugin | undefined;
112
110
  consent: () => ConsentPlugin | undefined;
113
- mfa: () => MfaPlugin | undefined;
114
- social: () => SocialPlugin | undefined;
115
- jwt: () => JwtPlugin | undefined;
111
+ magiclink: () => MagiclinkPlugin | undefined;
112
+ cms: () => CmsPlugin | undefined;
113
+ permissions: () => PermissionsPlugin | undefined;
114
+ stepup: () => StepupPlugin | undefined;
115
+ impersonation: () => ImpersonationPlugin | undefined;
116
116
  multiapp: () => MultiappPlugin | undefined;
117
+ passkey: () => PasskeyPlugin | undefined;
118
+ social: () => SocialPlugin | undefined;
119
+ notification: () => NotificationPlugin | undefined;
120
+ organization: () => OrganizationPlugin | undefined;
117
121
  phone: () => PhonePlugin | undefined;
118
122
  };
119
123
  request<T>(method: string, path: string, options?: {
@@ -133,9 +137,9 @@ export declare class AuthsomeClient {
133
137
  email: string;
134
138
  password: string;
135
139
  }): Promise<{
140
+ user: types.User;
136
141
  session: types.Session;
137
142
  requiresTwoFactor: boolean;
138
- user: types.User;
139
143
  }>;
140
144
  signOut(): Promise<{
141
145
  success: boolean;
@@ -145,8 +149,8 @@ export declare class AuthsomeClient {
145
149
  session: types.Session;
146
150
  }>;
147
151
  updateUser(request: {
148
- email?: string;
149
152
  name?: string;
153
+ email?: string;
150
154
  }): Promise<{
151
155
  user: types.User;
152
156
  }>;
@@ -161,11 +165,11 @@ export declare class AuthsomeClient {
161
165
  refreshSession(request: {
162
166
  refreshToken: string;
163
167
  }): Promise<{
164
- expiresAt: string;
165
168
  refreshExpiresAt: string;
166
169
  session: any;
167
170
  accessToken: string;
168
171
  refreshToken: string;
172
+ expiresAt: string;
169
173
  }>;
170
174
  requestPasswordReset(request: {
171
175
  email: string;
package/dist/client.js CHANGED
@@ -6,34 +6,34 @@ const errors_1 = require("./errors");
6
6
  class AuthsomeClient {
7
7
  constructor(config) {
8
8
  this.$plugins = {
9
- admin: () => this.getPlugin('admin'),
10
- cms: () => this.getPlugin('cms'),
11
- compliance: () => this.getPlugin('compliance'),
12
- stepup: () => this.getPlugin('stepup'),
13
- passkey: () => this.getPlugin('passkey'),
14
- apikey: () => this.getPlugin('apikey'),
9
+ sso: () => this.getPlugin('sso'),
10
+ username: () => this.getPlugin('username'),
11
+ webhook: () => this.getPlugin('webhook'),
15
12
  emailverification: () => this.getPlugin('emailverification'),
13
+ backupauth: () => this.getPlugin('backupauth'),
14
+ jwt: () => this.getPlugin('jwt'),
15
+ secrets: () => this.getPlugin('secrets'),
16
+ emailotp: () => this.getPlugin('emailotp'),
17
+ idverification: () => this.getPlugin('idverification'),
16
18
  multisession: () => this.getPlugin('multisession'),
17
19
  oidcprovider: () => this.getPlugin('oidcprovider'),
18
- organization: () => this.getPlugin('organization'),
19
- webhook: () => this.getPlugin('webhook'),
20
- impersonation: () => this.getPlugin('impersonation'),
21
- magiclink: () => this.getPlugin('magiclink'),
22
- secrets: () => this.getPlugin('secrets'),
23
- sso: () => this.getPlugin('sso'),
24
20
  anonymous: () => this.getPlugin('anonymous'),
25
- backupauth: () => this.getPlugin('backupauth'),
26
- idverification: () => this.getPlugin('idverification'),
21
+ mfa: () => this.getPlugin('mfa'),
27
22
  twofa: () => this.getPlugin('twofa'),
28
- emailotp: () => this.getPlugin('emailotp'),
29
- notification: () => this.getPlugin('notification'),
30
- permissions: () => this.getPlugin('permissions'),
31
- username: () => this.getPlugin('username'),
23
+ admin: () => this.getPlugin('admin'),
24
+ apikey: () => this.getPlugin('apikey'),
25
+ compliance: () => this.getPlugin('compliance'),
32
26
  consent: () => this.getPlugin('consent'),
33
- mfa: () => this.getPlugin('mfa'),
34
- social: () => this.getPlugin('social'),
35
- jwt: () => this.getPlugin('jwt'),
27
+ magiclink: () => this.getPlugin('magiclink'),
28
+ cms: () => this.getPlugin('cms'),
29
+ permissions: () => this.getPlugin('permissions'),
30
+ stepup: () => this.getPlugin('stepup'),
31
+ impersonation: () => this.getPlugin('impersonation'),
36
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
37
  phone: () => this.getPlugin('phone'),
38
38
  };
39
39
  this.baseURL = config.baseURL;
@@ -84,6 +84,20 @@ class AuthsomeClient {
84
84
  setBasePath(basePath) {
85
85
  this.basePath = basePath;
86
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
+ }
87
101
  /**
88
102
  * Set global headers for all requests
89
103
  * @param headers - Headers to set
package/dist/index.d.ts CHANGED
@@ -2,32 +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 { AdminPlugin, adminClient } from './plugins/admin';
6
- export { CmsPlugin, cmsClient } from './plugins/cms';
7
- export { CompliancePlugin, complianceClient } from './plugins/compliance';
8
- export { StepupPlugin, stepupClient } from './plugins/stepup';
9
- export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
10
- export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
5
+ export { SsoPlugin, ssoClient } from './plugins/sso';
6
+ export { UsernamePlugin, usernameClient } from './plugins/username';
7
+ export { WebhookPlugin, webhookClient } from './plugins/webhook';
11
8
  export { EmailverificationPlugin, emailverificationClient } from './plugins/emailverification';
9
+ export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
10
+ export { JwtPlugin, jwtClient } from './plugins/jwt';
11
+ export { SecretsPlugin, secretsClient } from './plugins/secrets';
12
+ export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
13
+ export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
12
14
  export { MultisessionPlugin, multisessionClient } from './plugins/multisession';
13
15
  export { OidcproviderPlugin, oidcproviderClient } from './plugins/oidcprovider';
14
- export { OrganizationPlugin, organizationClient } from './plugins/organization';
15
- export { WebhookPlugin, webhookClient } from './plugins/webhook';
16
- export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
17
- export { MagiclinkPlugin, magiclinkClient } from './plugins/magiclink';
18
- export { SecretsPlugin, secretsClient } from './plugins/secrets';
19
- export { SsoPlugin, ssoClient } from './plugins/sso';
20
16
  export { AnonymousPlugin, anonymousClient } from './plugins/anonymous';
21
- export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
22
- export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
17
+ export { MfaPlugin, mfaClient } from './plugins/mfa';
23
18
  export { TwofaPlugin, twofaClient } from './plugins/twofa';
24
- export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
25
- export { NotificationPlugin, notificationClient } from './plugins/notification';
26
- export { PermissionsPlugin, permissionsClient } from './plugins/permissions';
27
- export { UsernamePlugin, usernameClient } from './plugins/username';
19
+ export { AdminPlugin, adminClient } from './plugins/admin';
20
+ export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
21
+ export { CompliancePlugin, complianceClient } from './plugins/compliance';
28
22
  export { ConsentPlugin, consentClient } from './plugins/consent';
29
- export { MfaPlugin, mfaClient } from './plugins/mfa';
30
- export { SocialPlugin, socialClient } from './plugins/social';
31
- export { JwtPlugin, jwtClient } from './plugins/jwt';
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';
27
+ export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
32
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
33
  export { PhonePlugin, phoneClient } from './plugins/phone';
package/dist/index.js CHANGED
@@ -15,97 +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.MfaPlugin = exports.consentClient = exports.ConsentPlugin = exports.usernameClient = exports.UsernamePlugin = exports.permissionsClient = exports.PermissionsPlugin = exports.notificationClient = exports.NotificationPlugin = exports.emailotpClient = exports.EmailotpPlugin = exports.twofaClient = exports.TwofaPlugin = exports.idverificationClient = exports.IdverificationPlugin = exports.backupauthClient = exports.BackupauthPlugin = exports.anonymousClient = exports.AnonymousPlugin = exports.ssoClient = exports.SsoPlugin = exports.secretsClient = exports.SecretsPlugin = exports.magiclinkClient = exports.MagiclinkPlugin = exports.impersonationClient = exports.ImpersonationPlugin = exports.webhookClient = exports.WebhookPlugin = exports.organizationClient = exports.OrganizationPlugin = exports.oidcproviderClient = exports.OidcproviderPlugin = exports.multisessionClient = exports.MultisessionPlugin = exports.emailverificationClient = exports.EmailverificationPlugin = exports.apikeyClient = exports.ApikeyPlugin = exports.passkeyClient = exports.PasskeyPlugin = exports.stepupClient = exports.StepupPlugin = exports.complianceClient = exports.CompliancePlugin = exports.cmsClient = exports.CmsPlugin = exports.adminClient = exports.AdminPlugin = exports.AuthsomeClient = void 0;
19
- exports.phoneClient = exports.PhonePlugin = exports.multiappClient = exports.MultiappPlugin = exports.jwtClient = exports.JwtPlugin = exports.socialClient = exports.SocialPlugin = exports.mfaClient = void 0;
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 admin_1 = require("./plugins/admin");
26
- Object.defineProperty(exports, "AdminPlugin", { enumerable: true, get: function () { return admin_1.AdminPlugin; } });
27
- Object.defineProperty(exports, "adminClient", { enumerable: true, get: function () { return admin_1.adminClient; } });
28
- var cms_1 = require("./plugins/cms");
29
- Object.defineProperty(exports, "CmsPlugin", { enumerable: true, get: function () { return cms_1.CmsPlugin; } });
30
- Object.defineProperty(exports, "cmsClient", { enumerable: true, get: function () { return cms_1.cmsClient; } });
31
- var compliance_1 = require("./plugins/compliance");
32
- Object.defineProperty(exports, "CompliancePlugin", { enumerable: true, get: function () { return compliance_1.CompliancePlugin; } });
33
- Object.defineProperty(exports, "complianceClient", { enumerable: true, get: function () { return compliance_1.complianceClient; } });
34
- var stepup_1 = require("./plugins/stepup");
35
- Object.defineProperty(exports, "StepupPlugin", { enumerable: true, get: function () { return stepup_1.StepupPlugin; } });
36
- Object.defineProperty(exports, "stepupClient", { enumerable: true, get: function () { return stepup_1.stepupClient; } });
37
- var passkey_1 = require("./plugins/passkey");
38
- Object.defineProperty(exports, "PasskeyPlugin", { enumerable: true, get: function () { return passkey_1.PasskeyPlugin; } });
39
- Object.defineProperty(exports, "passkeyClient", { enumerable: true, get: function () { return passkey_1.passkeyClient; } });
40
- var apikey_1 = require("./plugins/apikey");
41
- Object.defineProperty(exports, "ApikeyPlugin", { enumerable: true, get: function () { return apikey_1.ApikeyPlugin; } });
42
- Object.defineProperty(exports, "apikeyClient", { enumerable: true, get: function () { return apikey_1.apikeyClient; } });
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; } });
28
+ var username_1 = require("./plugins/username");
29
+ Object.defineProperty(exports, "UsernamePlugin", { enumerable: true, get: function () { return username_1.UsernamePlugin; } });
30
+ Object.defineProperty(exports, "usernameClient", { enumerable: true, get: function () { return username_1.usernameClient; } });
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; } });
43
34
  var emailverification_1 = require("./plugins/emailverification");
44
35
  Object.defineProperty(exports, "EmailverificationPlugin", { enumerable: true, get: function () { return emailverification_1.EmailverificationPlugin; } });
45
36
  Object.defineProperty(exports, "emailverificationClient", { enumerable: true, get: function () { return emailverification_1.emailverificationClient; } });
37
+ var backupauth_1 = require("./plugins/backupauth");
38
+ Object.defineProperty(exports, "BackupauthPlugin", { enumerable: true, get: function () { return backupauth_1.BackupauthPlugin; } });
39
+ Object.defineProperty(exports, "backupauthClient", { enumerable: true, get: function () { return backupauth_1.backupauthClient; } });
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; } });
49
+ var idverification_1 = require("./plugins/idverification");
50
+ Object.defineProperty(exports, "IdverificationPlugin", { enumerable: true, get: function () { return idverification_1.IdverificationPlugin; } });
51
+ Object.defineProperty(exports, "idverificationClient", { enumerable: true, get: function () { return idverification_1.idverificationClient; } });
46
52
  var multisession_1 = require("./plugins/multisession");
47
53
  Object.defineProperty(exports, "MultisessionPlugin", { enumerable: true, get: function () { return multisession_1.MultisessionPlugin; } });
48
54
  Object.defineProperty(exports, "multisessionClient", { enumerable: true, get: function () { return multisession_1.multisessionClient; } });
49
55
  var oidcprovider_1 = require("./plugins/oidcprovider");
50
56
  Object.defineProperty(exports, "OidcproviderPlugin", { enumerable: true, get: function () { return oidcprovider_1.OidcproviderPlugin; } });
51
57
  Object.defineProperty(exports, "oidcproviderClient", { enumerable: true, get: function () { return oidcprovider_1.oidcproviderClient; } });
52
- var organization_1 = require("./plugins/organization");
53
- Object.defineProperty(exports, "OrganizationPlugin", { enumerable: true, get: function () { return organization_1.OrganizationPlugin; } });
54
- Object.defineProperty(exports, "organizationClient", { enumerable: true, get: function () { return organization_1.organizationClient; } });
55
- var webhook_1 = require("./plugins/webhook");
56
- Object.defineProperty(exports, "WebhookPlugin", { enumerable: true, get: function () { return webhook_1.WebhookPlugin; } });
57
- Object.defineProperty(exports, "webhookClient", { enumerable: true, get: function () { return webhook_1.webhookClient; } });
58
- var impersonation_1 = require("./plugins/impersonation");
59
- Object.defineProperty(exports, "ImpersonationPlugin", { enumerable: true, get: function () { return impersonation_1.ImpersonationPlugin; } });
60
- Object.defineProperty(exports, "impersonationClient", { enumerable: true, get: function () { return impersonation_1.impersonationClient; } });
61
- var magiclink_1 = require("./plugins/magiclink");
62
- Object.defineProperty(exports, "MagiclinkPlugin", { enumerable: true, get: function () { return magiclink_1.MagiclinkPlugin; } });
63
- Object.defineProperty(exports, "magiclinkClient", { enumerable: true, get: function () { return magiclink_1.magiclinkClient; } });
64
- var secrets_1 = require("./plugins/secrets");
65
- Object.defineProperty(exports, "SecretsPlugin", { enumerable: true, get: function () { return secrets_1.SecretsPlugin; } });
66
- Object.defineProperty(exports, "secretsClient", { enumerable: true, get: function () { return secrets_1.secretsClient; } });
67
- var sso_1 = require("./plugins/sso");
68
- Object.defineProperty(exports, "SsoPlugin", { enumerable: true, get: function () { return sso_1.SsoPlugin; } });
69
- Object.defineProperty(exports, "ssoClient", { enumerable: true, get: function () { return sso_1.ssoClient; } });
70
58
  var anonymous_1 = require("./plugins/anonymous");
71
59
  Object.defineProperty(exports, "AnonymousPlugin", { enumerable: true, get: function () { return anonymous_1.AnonymousPlugin; } });
72
60
  Object.defineProperty(exports, "anonymousClient", { enumerable: true, get: function () { return anonymous_1.anonymousClient; } });
73
- var backupauth_1 = require("./plugins/backupauth");
74
- Object.defineProperty(exports, "BackupauthPlugin", { enumerable: true, get: function () { return backupauth_1.BackupauthPlugin; } });
75
- Object.defineProperty(exports, "backupauthClient", { enumerable: true, get: function () { return backupauth_1.backupauthClient; } });
76
- var idverification_1 = require("./plugins/idverification");
77
- Object.defineProperty(exports, "IdverificationPlugin", { enumerable: true, get: function () { return idverification_1.IdverificationPlugin; } });
78
- Object.defineProperty(exports, "idverificationClient", { enumerable: true, get: function () { return idverification_1.idverificationClient; } });
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; } });
79
64
  var twofa_1 = require("./plugins/twofa");
80
65
  Object.defineProperty(exports, "TwofaPlugin", { enumerable: true, get: function () { return twofa_1.TwofaPlugin; } });
81
66
  Object.defineProperty(exports, "twofaClient", { enumerable: true, get: function () { return twofa_1.twofaClient; } });
82
- var emailotp_1 = require("./plugins/emailotp");
83
- Object.defineProperty(exports, "EmailotpPlugin", { enumerable: true, get: function () { return emailotp_1.EmailotpPlugin; } });
84
- Object.defineProperty(exports, "emailotpClient", { enumerable: true, get: function () { return emailotp_1.emailotpClient; } });
85
- var notification_1 = require("./plugins/notification");
86
- Object.defineProperty(exports, "NotificationPlugin", { enumerable: true, get: function () { return notification_1.NotificationPlugin; } });
87
- Object.defineProperty(exports, "notificationClient", { enumerable: true, get: function () { return notification_1.notificationClient; } });
88
- var permissions_1 = require("./plugins/permissions");
89
- Object.defineProperty(exports, "PermissionsPlugin", { enumerable: true, get: function () { return permissions_1.PermissionsPlugin; } });
90
- Object.defineProperty(exports, "permissionsClient", { enumerable: true, get: function () { return permissions_1.permissionsClient; } });
91
- var username_1 = require("./plugins/username");
92
- Object.defineProperty(exports, "UsernamePlugin", { enumerable: true, get: function () { return username_1.UsernamePlugin; } });
93
- Object.defineProperty(exports, "usernameClient", { enumerable: true, get: function () { return username_1.usernameClient; } });
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; } });
73
+ var compliance_1 = require("./plugins/compliance");
74
+ Object.defineProperty(exports, "CompliancePlugin", { enumerable: true, get: function () { return compliance_1.CompliancePlugin; } });
75
+ Object.defineProperty(exports, "complianceClient", { enumerable: true, get: function () { return compliance_1.complianceClient; } });
94
76
  var consent_1 = require("./plugins/consent");
95
77
  Object.defineProperty(exports, "ConsentPlugin", { enumerable: true, get: function () { return consent_1.ConsentPlugin; } });
96
78
  Object.defineProperty(exports, "consentClient", { enumerable: true, get: function () { return consent_1.consentClient; } });
97
- var mfa_1 = require("./plugins/mfa");
98
- Object.defineProperty(exports, "MfaPlugin", { enumerable: true, get: function () { return mfa_1.MfaPlugin; } });
99
- Object.defineProperty(exports, "mfaClient", { enumerable: true, get: function () { return mfa_1.mfaClient; } });
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 jwt_1 = require("./plugins/jwt");
104
- Object.defineProperty(exports, "JwtPlugin", { enumerable: true, get: function () { return jwt_1.JwtPlugin; } });
105
- Object.defineProperty(exports, "jwtClient", { enumerable: true, get: function () { return jwt_1.jwtClient; } });
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; } });
91
+ var impersonation_1 = require("./plugins/impersonation");
92
+ Object.defineProperty(exports, "ImpersonationPlugin", { enumerable: true, get: function () { return impersonation_1.ImpersonationPlugin; } });
93
+ Object.defineProperty(exports, "impersonationClient", { enumerable: true, get: function () { return impersonation_1.impersonationClient; } });
106
94
  var multiapp_1 = require("./plugins/multiapp");
107
95
  Object.defineProperty(exports, "MultiappPlugin", { enumerable: true, get: function () { return multiapp_1.MultiappPlugin; } });
108
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
109
  var phone_1 = require("./plugins/phone");
110
110
  Object.defineProperty(exports, "PhonePlugin", { enumerable: true, get: function () { return phone_1.PhonePlugin; } });
111
111
  Object.defineProperty(exports, "phoneClient", { enumerable: true, get: function () { return phone_1.phoneClient; } });
@@ -5,23 +5,23 @@ export declare class AdminPlugin implements ClientPlugin {
5
5
  readonly id = "admin";
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
- createUser(request: types.CreateUser_reqBody): Promise<void>;
8
+ createUser(): Promise<void>;
9
9
  listUsers(): Promise<void>;
10
10
  deleteUser(params: {
11
11
  id: string;
12
12
  }): Promise<types.MessageResponse>;
13
13
  banUser(params: {
14
14
  id: string;
15
- }, request: types.BanUser_reqBody): Promise<types.MessageResponse>;
15
+ }): Promise<types.MessageResponse>;
16
16
  unbanUser(params: {
17
17
  id: string;
18
- }, request: types.UnbanUser_reqBody): Promise<types.MessageResponse>;
18
+ }): Promise<types.MessageResponse>;
19
19
  impersonateUser(params: {
20
20
  id: string;
21
- }, request: types.ImpersonateUser_reqBody): Promise<void>;
21
+ }): Promise<void>;
22
22
  setUserRole(params: {
23
23
  id: string;
24
- }, request: types.SetUserRole_reqBody): Promise<types.MessageResponse>;
24
+ }): Promise<types.MessageResponse>;
25
25
  listSessions(): Promise<void>;
26
26
  revokeSession(params: {
27
27
  id: string;
@@ -10,11 +10,9 @@ class AdminPlugin {
10
10
  init(client) {
11
11
  this.client = client;
12
12
  }
13
- async createUser(request) {
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';
@@ -24,29 +22,21 @@ class AdminPlugin {
24
22
  const path = `/users/${params.id}`;
25
23
  return this.client.request('DELETE', path);
26
24
  }
27
- async banUser(params, request) {
25
+ async banUser(params) {
28
26
  const path = `/users/${params.id}/ban`;
29
- return this.client.request('POST', path, {
30
- body: request,
31
- });
27
+ return this.client.request('POST', path);
32
28
  }
33
- async unbanUser(params, request) {
29
+ async unbanUser(params) {
34
30
  const path = `/users/${params.id}/unban`;
35
- return this.client.request('POST', path, {
36
- body: request,
37
- });
31
+ return this.client.request('POST', path);
38
32
  }
39
- async impersonateUser(params, request) {
33
+ async impersonateUser(params) {
40
34
  const path = `/users/${params.id}/impersonate`;
41
- return this.client.request('POST', path, {
42
- body: request,
43
- });
35
+ return this.client.request('POST', path);
44
36
  }
45
- async setUserRole(params, request) {
37
+ async setUserRole(params) {
46
38
  const path = `/users/${params.id}/role`;
47
- return this.client.request('POST', path, {
48
- body: request,
49
- });
39
+ return this.client.request('POST', path);
50
40
  }
51
41
  async listSessions() {
52
42
  const path = '/sessions';
@@ -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;
@@ -10,9 +10,11 @@ class AnonymousPlugin {
10
10
  init(client) {
11
11
  this.client = client;
12
12
  }
13
- async signIn() {
13
+ async signIn(request) {
14
14
  const path = '/anonymous/signin';
15
- return this.client.request('POST', path);
15
+ return this.client.request('POST', path, {
16
+ body: request,
17
+ });
16
18
  }
17
19
  async link(request) {
18
20
  const path = '/anonymous/link';
@@ -5,20 +5,20 @@ export declare class ApikeyPlugin implements ClientPlugin {
5
5
  readonly id = "apikey";
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
- createAPIKey(): Promise<void>;
8
+ createAPIKey(request: types.CreateAPIKeyRequest): Promise<types.CreateAPIKeyResponse>;
9
9
  rotateAPIKey(params: {
10
10
  id: string;
11
- }): Promise<void>;
12
- listAPIKeys(): Promise<void>;
11
+ }, request: types.RotateAPIKeyRequest): Promise<types.RotateAPIKeyResponse>;
12
+ listAPIKeys(request?: types.ListAPIKeysRequest): Promise<types.ListAPIKeysResponse>;
13
13
  getAPIKey(params: {
14
14
  id: string;
15
- }): Promise<void>;
15
+ }, request?: types.GetAPIKeyRequest): Promise<types.APIKey>;
16
16
  updateAPIKey(params: {
17
17
  id: string;
18
- }): Promise<void>;
18
+ }, request: types.UpdateAPIKeyRequest): Promise<types.APIKey>;
19
19
  deleteAPIKey(params: {
20
20
  id: string;
21
- }): Promise<types.MessageResponse>;
22
- verifyAPIKey(): Promise<void>;
21
+ }, request?: types.DeleteAPIKeyRequest): Promise<types.MessageResponse>;
22
+ verifyAPIKey(request: types.VerifyAPIKeyRequest): Promise<types.VerifyAPIKeyResponse>;
23
23
  }
24
24
  export declare function apikeyClient(): ApikeyPlugin;