@authsome/client 0.0.5 → 0.0.7
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 +43 -43
- package/dist/client.js +20 -20
- package/dist/index.d.ts +20 -20
- package/dist/index.js +62 -62
- package/dist/plugins/apikey.d.ts +3 -3
- package/dist/plugins/apikey.js +6 -6
- package/dist/plugins/notification.d.ts +3 -3
- package/dist/plugins/notification.js +6 -6
- package/dist/plugins/oidcprovider.d.ts +4 -0
- package/dist/plugins/oidcprovider.js +22 -0
- package/dist/plugins/organization.d.ts +15 -15
- package/dist/plugins/organization.js +28 -28
- package/dist/plugins/passkey.js +7 -7
- package/dist/plugins/webhook.js +4 -4
- package/dist/types.d.ts +3912 -3148
- package/package.json +2 -2
- package/src/client.ts +43 -43
- package/src/index.ts +20 -20
- package/src/plugins/apikey.ts +7 -7
- package/src/plugins/notification.ts +7 -7
- package/src/plugins/oidcprovider.ts +26 -0
- package/src/plugins/organization.ts +35 -35
- package/src/plugins/passkey.ts +7 -7
- package/src/plugins/webhook.ts +4 -4
- package/src/types.ts +4098 -3201
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authsome/client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "TypeScript client for AuthSome authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"
|
|
9
|
+
"pub": "npm publish --access public",
|
|
10
10
|
"prepublishOnly": "npm run build"
|
|
11
11
|
},
|
|
12
12
|
"keywords": ["authsome", "authentication", "client"],
|
package/src/client.ts
CHANGED
|
@@ -3,35 +3,35 @@
|
|
|
3
3
|
import { ClientPlugin } from './plugin';
|
|
4
4
|
import { createErrorFromResponse } from './errors';
|
|
5
5
|
import * as types from './types';
|
|
6
|
-
import {
|
|
7
|
-
import { UsernamePlugin } from './plugins/username';
|
|
8
|
-
import { WebhookPlugin } from './plugins/webhook';
|
|
6
|
+
import { AnonymousPlugin } from './plugins/anonymous';
|
|
9
7
|
import { EmailverificationPlugin } from './plugins/emailverification';
|
|
10
|
-
import { BackupauthPlugin } from './plugins/backupauth';
|
|
11
|
-
import { JwtPlugin } from './plugins/jwt';
|
|
12
|
-
import { SecretsPlugin } from './plugins/secrets';
|
|
13
|
-
import { EmailotpPlugin } from './plugins/emailotp';
|
|
14
8
|
import { IdverificationPlugin } from './plugins/idverification';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { AnonymousPlugin } from './plugins/anonymous';
|
|
9
|
+
import { PasskeyPlugin } from './plugins/passkey';
|
|
10
|
+
import { PermissionsPlugin } from './plugins/permissions';
|
|
18
11
|
import { MfaPlugin } from './plugins/mfa';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { ApikeyPlugin } from './plugins/apikey';
|
|
12
|
+
import { MultiappPlugin } from './plugins/multiapp';
|
|
13
|
+
import { SsoPlugin } from './plugins/sso';
|
|
22
14
|
import { CompliancePlugin } from './plugins/compliance';
|
|
23
|
-
import { ConsentPlugin } from './plugins/consent';
|
|
24
15
|
import { MagiclinkPlugin } from './plugins/magiclink';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
16
|
+
import { PhonePlugin } from './plugins/phone';
|
|
17
|
+
import { WebhookPlugin } from './plugins/webhook';
|
|
18
|
+
import { AdminPlugin } from './plugins/admin';
|
|
27
19
|
import { StepupPlugin } from './plugins/stepup';
|
|
28
20
|
import { ImpersonationPlugin } from './plugins/impersonation';
|
|
29
|
-
import {
|
|
30
|
-
import { PasskeyPlugin } from './plugins/passkey';
|
|
31
|
-
import { SocialPlugin } from './plugins/social';
|
|
21
|
+
import { JwtPlugin } from './plugins/jwt';
|
|
32
22
|
import { NotificationPlugin } from './plugins/notification';
|
|
23
|
+
import { UsernamePlugin } from './plugins/username';
|
|
24
|
+
import { ConsentPlugin } from './plugins/consent';
|
|
25
|
+
import { MultisessionPlugin } from './plugins/multisession';
|
|
26
|
+
import { OidcproviderPlugin } from './plugins/oidcprovider';
|
|
27
|
+
import { ApikeyPlugin } from './plugins/apikey';
|
|
28
|
+
import { CmsPlugin } from './plugins/cms';
|
|
29
|
+
import { BackupauthPlugin } from './plugins/backupauth';
|
|
33
30
|
import { OrganizationPlugin } from './plugins/organization';
|
|
34
|
-
import {
|
|
31
|
+
import { TwofaPlugin } from './plugins/twofa';
|
|
32
|
+
import { EmailotpPlugin } from './plugins/emailotp';
|
|
33
|
+
import { SecretsPlugin } from './plugins/secrets';
|
|
34
|
+
import { SocialPlugin } from './plugins/social';
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* AuthSome client configuration
|
|
@@ -163,35 +163,35 @@ export class AuthsomeClient {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
public readonly $plugins = {
|
|
166
|
-
|
|
167
|
-
username: (): UsernamePlugin | undefined => this.getPlugin<UsernamePlugin>('username'),
|
|
168
|
-
webhook: (): WebhookPlugin | undefined => this.getPlugin<WebhookPlugin>('webhook'),
|
|
166
|
+
anonymous: (): AnonymousPlugin | undefined => this.getPlugin<AnonymousPlugin>('anonymous'),
|
|
169
167
|
emailverification: (): EmailverificationPlugin | undefined => this.getPlugin<EmailverificationPlugin>('emailverification'),
|
|
170
|
-
backupauth: (): BackupauthPlugin | undefined => this.getPlugin<BackupauthPlugin>('backupauth'),
|
|
171
|
-
jwt: (): JwtPlugin | undefined => this.getPlugin<JwtPlugin>('jwt'),
|
|
172
|
-
secrets: (): SecretsPlugin | undefined => this.getPlugin<SecretsPlugin>('secrets'),
|
|
173
|
-
emailotp: (): EmailotpPlugin | undefined => this.getPlugin<EmailotpPlugin>('emailotp'),
|
|
174
168
|
idverification: (): IdverificationPlugin | undefined => this.getPlugin<IdverificationPlugin>('idverification'),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
anonymous: (): AnonymousPlugin | undefined => this.getPlugin<AnonymousPlugin>('anonymous'),
|
|
169
|
+
passkey: (): PasskeyPlugin | undefined => this.getPlugin<PasskeyPlugin>('passkey'),
|
|
170
|
+
permissions: (): PermissionsPlugin | undefined => this.getPlugin<PermissionsPlugin>('permissions'),
|
|
178
171
|
mfa: (): MfaPlugin | undefined => this.getPlugin<MfaPlugin>('mfa'),
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
apikey: (): ApikeyPlugin | undefined => this.getPlugin<ApikeyPlugin>('apikey'),
|
|
172
|
+
multiapp: (): MultiappPlugin | undefined => this.getPlugin<MultiappPlugin>('multiapp'),
|
|
173
|
+
sso: (): SsoPlugin | undefined => this.getPlugin<SsoPlugin>('sso'),
|
|
182
174
|
compliance: (): CompliancePlugin | undefined => this.getPlugin<CompliancePlugin>('compliance'),
|
|
183
|
-
consent: (): ConsentPlugin | undefined => this.getPlugin<ConsentPlugin>('consent'),
|
|
184
175
|
magiclink: (): MagiclinkPlugin | undefined => this.getPlugin<MagiclinkPlugin>('magiclink'),
|
|
185
|
-
|
|
186
|
-
|
|
176
|
+
phone: (): PhonePlugin | undefined => this.getPlugin<PhonePlugin>('phone'),
|
|
177
|
+
webhook: (): WebhookPlugin | undefined => this.getPlugin<WebhookPlugin>('webhook'),
|
|
178
|
+
admin: (): AdminPlugin | undefined => this.getPlugin<AdminPlugin>('admin'),
|
|
187
179
|
stepup: (): StepupPlugin | undefined => this.getPlugin<StepupPlugin>('stepup'),
|
|
188
180
|
impersonation: (): ImpersonationPlugin | undefined => this.getPlugin<ImpersonationPlugin>('impersonation'),
|
|
189
|
-
|
|
190
|
-
passkey: (): PasskeyPlugin | undefined => this.getPlugin<PasskeyPlugin>('passkey'),
|
|
191
|
-
social: (): SocialPlugin | undefined => this.getPlugin<SocialPlugin>('social'),
|
|
181
|
+
jwt: (): JwtPlugin | undefined => this.getPlugin<JwtPlugin>('jwt'),
|
|
192
182
|
notification: (): NotificationPlugin | undefined => this.getPlugin<NotificationPlugin>('notification'),
|
|
183
|
+
username: (): UsernamePlugin | undefined => this.getPlugin<UsernamePlugin>('username'),
|
|
184
|
+
consent: (): ConsentPlugin | undefined => this.getPlugin<ConsentPlugin>('consent'),
|
|
185
|
+
multisession: (): MultisessionPlugin | undefined => this.getPlugin<MultisessionPlugin>('multisession'),
|
|
186
|
+
oidcprovider: (): OidcproviderPlugin | undefined => this.getPlugin<OidcproviderPlugin>('oidcprovider'),
|
|
187
|
+
apikey: (): ApikeyPlugin | undefined => this.getPlugin<ApikeyPlugin>('apikey'),
|
|
188
|
+
cms: (): CmsPlugin | undefined => this.getPlugin<CmsPlugin>('cms'),
|
|
189
|
+
backupauth: (): BackupauthPlugin | undefined => this.getPlugin<BackupauthPlugin>('backupauth'),
|
|
193
190
|
organization: (): OrganizationPlugin | undefined => this.getPlugin<OrganizationPlugin>('organization'),
|
|
194
|
-
|
|
191
|
+
twofa: (): TwofaPlugin | undefined => this.getPlugin<TwofaPlugin>('twofa'),
|
|
192
|
+
emailotp: (): EmailotpPlugin | undefined => this.getPlugin<EmailotpPlugin>('emailotp'),
|
|
193
|
+
secrets: (): SecretsPlugin | undefined => this.getPlugin<SecretsPlugin>('secrets'),
|
|
194
|
+
social: (): SocialPlugin | undefined => this.getPlugin<SocialPlugin>('social'),
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
public async request<T>(
|
|
@@ -239,7 +239,7 @@ export class AuthsomeClient {
|
|
|
239
239
|
return response.json();
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
async signUp(request: {
|
|
242
|
+
async signUp(request: { name?: string; email: string; password: string }): Promise<{ user: types.User; session: types.Session }> {
|
|
243
243
|
const path = '/signup';
|
|
244
244
|
return this.request<{ user: types.User; session: types.Session }>('POST', path, {
|
|
245
245
|
body: request,
|
|
@@ -290,9 +290,9 @@ export class AuthsomeClient {
|
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
async refreshSession(request: { refreshToken: string }): Promise<{
|
|
293
|
+
async refreshSession(request: { refreshToken: string }): Promise<{ refreshToken: string; expiresAt: string; refreshExpiresAt: string; session: any; accessToken: string }> {
|
|
294
294
|
const path = '/refresh';
|
|
295
|
-
return this.request<{
|
|
295
|
+
return this.request<{ expiresAt: string; refreshExpiresAt: string; session: any; accessToken: string; refreshToken: string }>('POST', path, {
|
|
296
296
|
body: request,
|
|
297
297
|
});
|
|
298
298
|
}
|
package/src/index.ts
CHANGED
|
@@ -6,32 +6,32 @@ export * from './types';
|
|
|
6
6
|
export * from './errors';
|
|
7
7
|
|
|
8
8
|
// Plugin exports
|
|
9
|
-
export {
|
|
10
|
-
export { UsernamePlugin, usernameClient } from './plugins/username';
|
|
11
|
-
export { WebhookPlugin, webhookClient } from './plugins/webhook';
|
|
9
|
+
export { AnonymousPlugin, anonymousClient } from './plugins/anonymous';
|
|
12
10
|
export { EmailverificationPlugin, emailverificationClient } from './plugins/emailverification';
|
|
13
|
-
export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
|
|
14
|
-
export { JwtPlugin, jwtClient } from './plugins/jwt';
|
|
15
|
-
export { SecretsPlugin, secretsClient } from './plugins/secrets';
|
|
16
|
-
export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
|
|
17
11
|
export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export { AnonymousPlugin, anonymousClient } from './plugins/anonymous';
|
|
12
|
+
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
13
|
+
export { PermissionsPlugin, permissionsClient } from './plugins/permissions';
|
|
21
14
|
export { MfaPlugin, mfaClient } from './plugins/mfa';
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
|
|
15
|
+
export { MultiappPlugin, multiappClient } from './plugins/multiapp';
|
|
16
|
+
export { SsoPlugin, ssoClient } from './plugins/sso';
|
|
25
17
|
export { CompliancePlugin, complianceClient } from './plugins/compliance';
|
|
26
|
-
export { ConsentPlugin, consentClient } from './plugins/consent';
|
|
27
18
|
export { MagiclinkPlugin, magiclinkClient } from './plugins/magiclink';
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
19
|
+
export { PhonePlugin, phoneClient } from './plugins/phone';
|
|
20
|
+
export { WebhookPlugin, webhookClient } from './plugins/webhook';
|
|
21
|
+
export { AdminPlugin, adminClient } from './plugins/admin';
|
|
30
22
|
export { StepupPlugin, stepupClient } from './plugins/stepup';
|
|
31
23
|
export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
|
|
32
|
-
export {
|
|
33
|
-
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
34
|
-
export { SocialPlugin, socialClient } from './plugins/social';
|
|
24
|
+
export { JwtPlugin, jwtClient } from './plugins/jwt';
|
|
35
25
|
export { NotificationPlugin, notificationClient } from './plugins/notification';
|
|
26
|
+
export { UsernamePlugin, usernameClient } from './plugins/username';
|
|
27
|
+
export { ConsentPlugin, consentClient } from './plugins/consent';
|
|
28
|
+
export { MultisessionPlugin, multisessionClient } from './plugins/multisession';
|
|
29
|
+
export { OidcproviderPlugin, oidcproviderClient } from './plugins/oidcprovider';
|
|
30
|
+
export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
|
|
31
|
+
export { CmsPlugin, cmsClient } from './plugins/cms';
|
|
32
|
+
export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
|
|
36
33
|
export { OrganizationPlugin, organizationClient } from './plugins/organization';
|
|
37
|
-
export {
|
|
34
|
+
export { TwofaPlugin, twofaClient } from './plugins/twofa';
|
|
35
|
+
export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
|
|
36
|
+
export { SecretsPlugin, secretsClient } from './plugins/secrets';
|
|
37
|
+
export { SocialPlugin, socialClient } from './plugins/social';
|
package/src/plugins/apikey.ts
CHANGED
|
@@ -19,13 +19,6 @@ export class ApikeyPlugin implements ClientPlugin {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
async rotateAPIKey(params: { id: string }, request: types.RotateAPIKeyRequest): Promise<types.RotateAPIKeyResponse> {
|
|
23
|
-
const path = `/${params.id}/rotate`;
|
|
24
|
-
return this.client.request<types.RotateAPIKeyResponse>('POST', path, {
|
|
25
|
-
body: request,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
22
|
async listAPIKeys(request?: types.ListAPIKeysRequest): Promise<types.ListAPIKeysResponse> {
|
|
30
23
|
const path = '/listapikeys';
|
|
31
24
|
return this.client.request<types.ListAPIKeysResponse>('GET', path, {
|
|
@@ -54,6 +47,13 @@ export class ApikeyPlugin implements ClientPlugin {
|
|
|
54
47
|
});
|
|
55
48
|
}
|
|
56
49
|
|
|
50
|
+
async rotateAPIKey(params: { id: string }, request: types.RotateAPIKeyRequest): Promise<types.RotateAPIKeyResponse> {
|
|
51
|
+
const path = `/${params.id}/rotate`;
|
|
52
|
+
return this.client.request<types.RotateAPIKeyResponse>('POST', path, {
|
|
53
|
+
body: request,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
57
|
async verifyAPIKey(request: types.VerifyAPIKeyRequest): Promise<types.VerifyAPIKeyResponse> {
|
|
58
58
|
const path = '/verify';
|
|
59
59
|
return this.client.request<types.VerifyAPIKeyResponse>('POST', path, {
|
|
@@ -12,13 +12,6 @@ export class NotificationPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async previewTemplate(params: { id: string }, request: types.PreviewTemplate_req): Promise<types.NotificationPreviewResponse> {
|
|
16
|
-
const path = `/${params.id}/preview`;
|
|
17
|
-
return this.client.request<types.NotificationPreviewResponse>('POST', path, {
|
|
18
|
-
body: request,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
15
|
async createTemplate(request: types.CreateTemplateRequest): Promise<types.NotificationTemplateResponse> {
|
|
23
16
|
const path = '/createtemplate';
|
|
24
17
|
return this.client.request<types.NotificationTemplateResponse>('POST', path, {
|
|
@@ -63,6 +56,13 @@ export class NotificationPlugin implements ClientPlugin {
|
|
|
63
56
|
return this.client.request<types.NotificationTemplateListResponse>('GET', path);
|
|
64
57
|
}
|
|
65
58
|
|
|
59
|
+
async previewTemplate(params: { id: string }, request: types.PreviewTemplate_req): Promise<types.NotificationPreviewResponse> {
|
|
60
|
+
const path = `/${params.id}/preview`;
|
|
61
|
+
return this.client.request<types.NotificationPreviewResponse>('POST', path, {
|
|
62
|
+
body: request,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
66
|
async renderTemplate(request: types.RenderTemplate_req): Promise<types.NotificationPreviewResponse> {
|
|
67
67
|
const path = '/render';
|
|
68
68
|
return this.client.request<types.NotificationPreviewResponse>('POST', path, {
|
|
@@ -89,6 +89,32 @@ export class OidcproviderPlugin implements ClientPlugin {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
async deviceAuthorize(request: types.DeviceAuthorizationRequest): Promise<types.DeviceAuthorizationResponse> {
|
|
93
|
+
const path = '/device_authorization';
|
|
94
|
+
return this.client.request<types.DeviceAuthorizationResponse>('POST', path, {
|
|
95
|
+
body: request,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async deviceCodeEntry(): Promise<void> {
|
|
100
|
+
const path = '/devicecodeentry';
|
|
101
|
+
return this.client.request<void>('GET', path);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async deviceVerify(request: types.DeviceVerificationRequest): Promise<void> {
|
|
105
|
+
const path = '/verify';
|
|
106
|
+
return this.client.request<void>('POST', path, {
|
|
107
|
+
body: request,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async deviceAuthorizeDecision(request: types.DeviceAuthorizationDecisionRequest): Promise<void> {
|
|
112
|
+
const path = '/authorize';
|
|
113
|
+
return this.client.request<void>('POST', path, {
|
|
114
|
+
body: request,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
92
118
|
}
|
|
93
119
|
|
|
94
120
|
export function oidcproviderClient(): OidcproviderPlugin {
|
|
@@ -17,41 +17,6 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
17
17
|
return this.client.request<types.Organization>('POST', path);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
async updateOrganization(params: { id: string }): Promise<types.Organization> {
|
|
21
|
-
const path = `/${params.id}`;
|
|
22
|
-
return this.client.request<types.Organization>('PATCH', path);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async deleteOrganization(params: { id: string }): Promise<void> {
|
|
26
|
-
const path = `/${params.id}`;
|
|
27
|
-
return this.client.request<void>('DELETE', path);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async inviteMember(): Promise<void> {
|
|
31
|
-
const path = '/invite';
|
|
32
|
-
return this.client.request<void>('POST', path);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async removeMember(params: { memberId: string }): Promise<void> {
|
|
36
|
-
const path = `/${params.memberId}`;
|
|
37
|
-
return this.client.request<void>('DELETE', path);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async createTeam(): Promise<void> {
|
|
41
|
-
const path = '/createteam';
|
|
42
|
-
return this.client.request<void>('POST', path);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async updateTeam(params: { teamId: string }): Promise<void> {
|
|
46
|
-
const path = `/${params.teamId}`;
|
|
47
|
-
return this.client.request<void>('PATCH', path);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async deleteTeam(params: { teamId: string }): Promise<void> {
|
|
51
|
-
const path = `/${params.teamId}`;
|
|
52
|
-
return this.client.request<void>('DELETE', path);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
20
|
async getOrganization(params: { id: string }): Promise<types.Organization> {
|
|
56
21
|
const path = `/${params.id}`;
|
|
57
22
|
return this.client.request<types.Organization>('GET', path);
|
|
@@ -62,6 +27,16 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
62
27
|
return this.client.request<types.Organization>('GET', path);
|
|
63
28
|
}
|
|
64
29
|
|
|
30
|
+
async updateOrganization(params: { id: string }): Promise<types.Organization> {
|
|
31
|
+
const path = `/${params.id}`;
|
|
32
|
+
return this.client.request<types.Organization>('PATCH', path);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async deleteOrganization(params: { id: string }): Promise<void> {
|
|
36
|
+
const path = `/${params.id}`;
|
|
37
|
+
return this.client.request<void>('DELETE', path);
|
|
38
|
+
}
|
|
39
|
+
|
|
65
40
|
async getOrganizationBySlug(params: { slug: string }): Promise<types.Organization> {
|
|
66
41
|
const path = `/slug/${params.slug}`;
|
|
67
42
|
return this.client.request<types.Organization>('GET', path);
|
|
@@ -72,11 +47,21 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
72
47
|
return this.client.request<void>('GET', path);
|
|
73
48
|
}
|
|
74
49
|
|
|
50
|
+
async inviteMember(): Promise<void> {
|
|
51
|
+
const path = '/invite';
|
|
52
|
+
return this.client.request<void>('POST', path);
|
|
53
|
+
}
|
|
54
|
+
|
|
75
55
|
async updateMember(params: { memberId: string }): Promise<void> {
|
|
76
56
|
const path = `/${params.memberId}`;
|
|
77
57
|
return this.client.request<void>('PATCH', path);
|
|
78
58
|
}
|
|
79
59
|
|
|
60
|
+
async removeMember(params: { memberId: string }): Promise<void> {
|
|
61
|
+
const path = `/${params.memberId}`;
|
|
62
|
+
return this.client.request<void>('DELETE', path);
|
|
63
|
+
}
|
|
64
|
+
|
|
80
65
|
async acceptInvitation(params: { token: string }): Promise<void> {
|
|
81
66
|
const path = `/${params.token}/accept`;
|
|
82
67
|
return this.client.request<void>('POST', path);
|
|
@@ -92,6 +77,21 @@ export class OrganizationPlugin implements ClientPlugin {
|
|
|
92
77
|
return this.client.request<void>('GET', path);
|
|
93
78
|
}
|
|
94
79
|
|
|
80
|
+
async createTeam(): Promise<void> {
|
|
81
|
+
const path = '/createteam';
|
|
82
|
+
return this.client.request<void>('POST', path);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async updateTeam(params: { teamId: string }): Promise<void> {
|
|
86
|
+
const path = `/${params.teamId}`;
|
|
87
|
+
return this.client.request<void>('PATCH', path);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async deleteTeam(params: { teamId: string }): Promise<void> {
|
|
91
|
+
const path = `/${params.teamId}`;
|
|
92
|
+
return this.client.request<void>('DELETE', path);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
export function organizationClient(): OrganizationPlugin {
|
package/src/plugins/passkey.ts
CHANGED
|
@@ -13,37 +13,37 @@ export class PasskeyPlugin implements ClientPlugin {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async beginRegister(): Promise<void> {
|
|
16
|
-
const path = '/register/begin';
|
|
16
|
+
const path = '/passkey/register/begin';
|
|
17
17
|
return this.client.request<void>('POST', path);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
async finishRegister(): Promise<void> {
|
|
21
|
-
const path = '/register/finish';
|
|
21
|
+
const path = '/passkey/register/finish';
|
|
22
22
|
return this.client.request<void>('POST', path);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
async beginLogin(): Promise<void> {
|
|
26
|
-
const path = '/login/begin';
|
|
26
|
+
const path = '/passkey/login/begin';
|
|
27
27
|
return this.client.request<void>('POST', path);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async finishLogin(): Promise<void> {
|
|
31
|
-
const path = '/login/finish';
|
|
31
|
+
const path = '/passkey/login/finish';
|
|
32
32
|
return this.client.request<void>('POST', path);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
async list(): Promise<void> {
|
|
36
|
-
const path = '/list';
|
|
36
|
+
const path = '/passkey/list';
|
|
37
37
|
return this.client.request<void>('GET', path);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
async update(params: { id: string }): Promise<void> {
|
|
41
|
-
const path =
|
|
41
|
+
const path = `/passkey/${params.id}`;
|
|
42
42
|
return this.client.request<void>('PUT', path);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
async delete(params: { id: string }): Promise<types.StatusResponse> {
|
|
46
|
-
const path =
|
|
46
|
+
const path = `/passkey/${params.id}`;
|
|
47
47
|
return this.client.request<types.StatusResponse>('DELETE', path);
|
|
48
48
|
}
|
|
49
49
|
|
package/src/plugins/webhook.ts
CHANGED
|
@@ -13,7 +13,7 @@ export class WebhookPlugin implements ClientPlugin {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async create(request: { url: string; events: string[]; secret?: string }): Promise<{ webhook: types.Webhook }> {
|
|
16
|
-
const path = '/webhooks';
|
|
16
|
+
const path = '/api/auth/webhooks';
|
|
17
17
|
return this.client.request<{ webhook: types.Webhook }>('POST', path, {
|
|
18
18
|
body: request,
|
|
19
19
|
auth: true,
|
|
@@ -21,14 +21,14 @@ export class WebhookPlugin implements ClientPlugin {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
async list(): Promise<{ webhooks: types.Webhook[] }> {
|
|
24
|
-
const path = '/webhooks';
|
|
24
|
+
const path = '/api/auth/webhooks';
|
|
25
25
|
return this.client.request<{ webhooks: types.Webhook[] }>('GET', path, {
|
|
26
26
|
auth: true,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async update(request: { id: string; url?: string; events?: string[]; enabled?: boolean }): Promise<{ webhook: types.Webhook }> {
|
|
31
|
-
const path = '/webhooks/update';
|
|
31
|
+
const path = '/api/auth/webhooks/update';
|
|
32
32
|
return this.client.request<{ webhook: types.Webhook }>('POST', path, {
|
|
33
33
|
body: request,
|
|
34
34
|
auth: true,
|
|
@@ -36,7 +36,7 @@ export class WebhookPlugin implements ClientPlugin {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
async delete(request: { id: string }): Promise<{ success: boolean }> {
|
|
39
|
-
const path = '/webhooks/delete';
|
|
39
|
+
const path = '/api/auth/webhooks/delete';
|
|
40
40
|
return this.client.request<{ success: boolean }>('POST', path, {
|
|
41
41
|
body: request,
|
|
42
42
|
auth: true,
|