@authsome/client 0.0.2 → 0.0.4

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