@authsome/client 0.0.1 → 0.0.3
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/CHANGELOG.md +38 -0
- package/README.md +392 -0
- package/RELEASE_CHECKLIST.md +162 -0
- package/RELEASE_v0.0.2.md +126 -0
- package/authsome-client-0.0.2.tgz +0 -0
- package/dist/client.d.ts +65 -3
- package/dist/client.js +52 -8
- package/dist/index.d.ts +25 -25
- package/dist/index.js +78 -26
- package/dist/plugins/oidcprovider.d.ts +1 -1
- package/dist/plugins/webhook.d.ts +1 -1
- package/dist/plugins/webhook.js +4 -4
- package/dist/types.d.ts +2465 -2500
- package/package.json +3 -24
- package/src/client.ts +270 -0
- package/src/errors.ts +92 -0
- package/src/index.ts +33 -0
- package/src/plugin.ts +13 -0
- package/src/plugins/admin.ts +84 -0
- package/src/plugins/anonymous.ts +31 -0
- package/src/plugins/apikey.ts +56 -0
- package/src/plugins/backupauth.ts +208 -0
- package/src/plugins/compliance.ts +204 -0
- package/src/plugins/consent.ts +125 -0
- package/src/plugins/emailotp.ts +33 -0
- package/src/plugins/idverification.ts +80 -0
- package/src/plugins/impersonation.ts +53 -0
- package/src/plugins/jwt.ts +44 -0
- package/src/plugins/magiclink.ts +31 -0
- package/src/plugins/mfa.ts +111 -0
- package/src/plugins/multiapp.ts +116 -0
- package/src/plugins/multisession.ts +36 -0
- package/src/plugins/notification.ts +98 -0
- package/src/plugins/oidcprovider.ts +90 -0
- package/src/plugins/organization.ts +99 -0
- package/src/plugins/passkey.ts +54 -0
- package/src/plugins/phone.ts +40 -0
- package/src/plugins/social.ts +48 -0
- package/src/plugins/sso.ts +55 -0
- package/src/plugins/stepup.ts +97 -0
- package/src/plugins/twofa.ts +61 -0
- package/src/plugins/username.ts +29 -0
- package/src/plugins/webhook.ts +50 -0
- package/src/types.ts +3702 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Auto-generated jwt plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class JwtPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'jwt';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async createJWTKey(): Promise<void> {
|
|
16
|
+
const path = '/createjwtkey';
|
|
17
|
+
return this.client.request<void>('POST', path);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async listJWTKeys(): Promise<void> {
|
|
21
|
+
const path = '/listjwtkeys';
|
|
22
|
+
return this.client.request<void>('GET', path);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async getJWKS(): Promise<void> {
|
|
26
|
+
const path = '/jwks';
|
|
27
|
+
return this.client.request<void>('GET', path);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async generateToken(): Promise<void> {
|
|
31
|
+
const path = '/generate';
|
|
32
|
+
return this.client.request<void>('POST', path);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async verifyToken(): Promise<void> {
|
|
36
|
+
const path = '/verify';
|
|
37
|
+
return this.client.request<void>('POST', path);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function jwtClient(): JwtPlugin {
|
|
43
|
+
return new JwtPlugin();
|
|
44
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Auto-generated magiclink plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class MagiclinkPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'magiclink';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async send(request: types.SendRequest): Promise<void> {
|
|
16
|
+
const path = '/magic-link/send';
|
|
17
|
+
return this.client.request<void>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async verify(): Promise<types.VerifyResponse> {
|
|
23
|
+
const path = '/magic-link/verify';
|
|
24
|
+
return this.client.request<types.VerifyResponse>('GET', path);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function magiclinkClient(): MagiclinkPlugin {
|
|
30
|
+
return new MagiclinkPlugin();
|
|
31
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Auto-generated mfa plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class MfaPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'mfa';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async enrollFactor(request: types.FactorEnrollmentRequest): Promise<void> {
|
|
16
|
+
const path = '/mfa/factors/enroll';
|
|
17
|
+
return this.client.request<void>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async listFactors(): Promise<types.FactorsResponse> {
|
|
23
|
+
const path = '/mfa/factors';
|
|
24
|
+
return this.client.request<types.FactorsResponse>('GET', path);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async getFactor(): Promise<void> {
|
|
28
|
+
const path = '/mfa/factors/:id';
|
|
29
|
+
return this.client.request<void>('GET', path);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async updateFactor(): Promise<types.MessageResponse> {
|
|
33
|
+
const path = '/mfa/factors/:id';
|
|
34
|
+
return this.client.request<types.MessageResponse>('PUT', path);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async deleteFactor(): Promise<types.MessageResponse> {
|
|
38
|
+
const path = '/mfa/factors/:id';
|
|
39
|
+
return this.client.request<types.MessageResponse>('DELETE', path);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async verifyFactor(request: types.VerifyFactor_req): Promise<types.MessageResponse> {
|
|
43
|
+
const path = '/mfa/factors/:id/verify';
|
|
44
|
+
return this.client.request<types.MessageResponse>('POST', path, {
|
|
45
|
+
body: request,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async initiateChallenge(request: types.ChallengeRequest): Promise<void> {
|
|
50
|
+
const path = '/mfa/challenge';
|
|
51
|
+
return this.client.request<void>('POST', path, {
|
|
52
|
+
body: request,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async verifyChallenge(request: types.VerificationRequest): Promise<void> {
|
|
57
|
+
const path = '/mfa/verify';
|
|
58
|
+
return this.client.request<void>('POST', path, {
|
|
59
|
+
body: request,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async getChallengeStatus(): Promise<void> {
|
|
64
|
+
const path = '/mfa/challenge/:id';
|
|
65
|
+
return this.client.request<void>('GET', path);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async trustDevice(request: types.DeviceInfo): Promise<types.MessageResponse> {
|
|
69
|
+
const path = '/mfa/devices/trust';
|
|
70
|
+
return this.client.request<types.MessageResponse>('POST', path, {
|
|
71
|
+
body: request,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async listTrustedDevices(): Promise<types.DevicesResponse> {
|
|
76
|
+
const path = '/mfa/devices';
|
|
77
|
+
return this.client.request<types.DevicesResponse>('GET', path);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async revokeTrustedDevice(): Promise<types.MessageResponse> {
|
|
81
|
+
const path = '/mfa/devices/:id';
|
|
82
|
+
return this.client.request<types.MessageResponse>('DELETE', path);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async getStatus(): Promise<void> {
|
|
86
|
+
const path = '/mfa/status';
|
|
87
|
+
return this.client.request<void>('GET', path);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async getPolicy(): Promise<types.MFAConfigResponse> {
|
|
91
|
+
const path = '/mfa/policy';
|
|
92
|
+
return this.client.request<types.MFAConfigResponse>('GET', path);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async adminUpdatePolicy(request: types.AdminPolicyRequest): Promise<void> {
|
|
96
|
+
const path = '/mfa/policy';
|
|
97
|
+
return this.client.request<void>('PUT', path, {
|
|
98
|
+
body: request,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async adminResetUserMFA(): Promise<void> {
|
|
103
|
+
const path = '/mfa/users/:id/reset';
|
|
104
|
+
return this.client.request<void>('POST', path);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function mfaClient(): MfaPlugin {
|
|
110
|
+
return new MfaPlugin();
|
|
111
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Auto-generated multiapp plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class MultiappPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'multiapp';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async createApp(): Promise<void> {
|
|
16
|
+
const path = '/createapp';
|
|
17
|
+
return this.client.request<void>('POST', path);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async getApp(): Promise<void> {
|
|
21
|
+
const path = '/:appId';
|
|
22
|
+
return this.client.request<void>('GET', path);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async updateApp(): Promise<void> {
|
|
26
|
+
const path = '/:appId';
|
|
27
|
+
return this.client.request<void>('PUT', path);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async deleteApp(): Promise<void> {
|
|
31
|
+
const path = '/:appId';
|
|
32
|
+
return this.client.request<void>('DELETE', path);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async listApps(): Promise<void> {
|
|
36
|
+
const path = '/listapps';
|
|
37
|
+
return this.client.request<void>('GET', path);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async removeMember(): Promise<void> {
|
|
41
|
+
const path = '/:memberId';
|
|
42
|
+
return this.client.request<void>('DELETE', path);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async listMembers(): Promise<void> {
|
|
46
|
+
const path = '/listmembers';
|
|
47
|
+
return this.client.request<void>('GET', path);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async inviteMember(): Promise<void> {
|
|
51
|
+
const path = '/invite';
|
|
52
|
+
return this.client.request<void>('POST', path);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async updateMember(): Promise<void> {
|
|
56
|
+
const path = '/:memberId';
|
|
57
|
+
return this.client.request<void>('PUT', path);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async getInvitation(): Promise<void> {
|
|
61
|
+
const path = '/:token';
|
|
62
|
+
return this.client.request<void>('GET', path);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async acceptInvitation(): Promise<void> {
|
|
66
|
+
const path = '/:token/accept';
|
|
67
|
+
return this.client.request<void>('POST', path);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async declineInvitation(): Promise<void> {
|
|
71
|
+
const path = '/:token/decline';
|
|
72
|
+
return this.client.request<void>('POST', path);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async createTeam(): Promise<void> {
|
|
76
|
+
const path = '/createteam';
|
|
77
|
+
return this.client.request<void>('POST', path);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async getTeam(): Promise<void> {
|
|
81
|
+
const path = '/:teamId';
|
|
82
|
+
return this.client.request<void>('GET', path);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async updateTeam(): Promise<void> {
|
|
86
|
+
const path = '/:teamId';
|
|
87
|
+
return this.client.request<void>('PUT', path);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async deleteTeam(): Promise<void> {
|
|
91
|
+
const path = '/:teamId';
|
|
92
|
+
return this.client.request<void>('DELETE', path);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async listTeams(): Promise<void> {
|
|
96
|
+
const path = '/listteams';
|
|
97
|
+
return this.client.request<void>('GET', path);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async addTeamMember(request: types.AddTeamMember_req): Promise<void> {
|
|
101
|
+
const path = '/:teamId/members';
|
|
102
|
+
return this.client.request<void>('POST', path, {
|
|
103
|
+
body: request,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async removeTeamMember(): Promise<void> {
|
|
108
|
+
const path = '/:teamId/members/:memberId';
|
|
109
|
+
return this.client.request<void>('DELETE', path);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function multiappClient(): MultiappPlugin {
|
|
115
|
+
return new MultiappPlugin();
|
|
116
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Auto-generated multisession plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class MultisessionPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'multisession';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async list(): Promise<types.SessionsResponse> {
|
|
16
|
+
const path = '/list';
|
|
17
|
+
return this.client.request<types.SessionsResponse>('GET', path);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async setActive(request: types.SetActive_body): Promise<types.SessionTokenResponse> {
|
|
21
|
+
const path = '/set-active';
|
|
22
|
+
return this.client.request<types.SessionTokenResponse>('POST', path, {
|
|
23
|
+
body: request,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async delete(): Promise<types.StatusResponse> {
|
|
28
|
+
const path = '/delete/{id}';
|
|
29
|
+
return this.client.request<types.StatusResponse>('POST', path);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function multisessionClient(): MultisessionPlugin {
|
|
35
|
+
return new MultisessionPlugin();
|
|
36
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Auto-generated notification plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class NotificationPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'notification';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async previewTemplate(request: types.PreviewTemplate_req): Promise<void> {
|
|
16
|
+
const path = '/:id/preview';
|
|
17
|
+
return this.client.request<void>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async createTemplate(): Promise<void> {
|
|
23
|
+
const path = '/createtemplate';
|
|
24
|
+
return this.client.request<void>('POST', path);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async getTemplate(): Promise<void> {
|
|
28
|
+
const path = '/:id';
|
|
29
|
+
return this.client.request<void>('GET', path);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async listTemplates(): Promise<void> {
|
|
33
|
+
const path = '/listtemplates';
|
|
34
|
+
return this.client.request<void>('GET', path);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async updateTemplate(): Promise<types.MessageResponse> {
|
|
38
|
+
const path = '/:id';
|
|
39
|
+
return this.client.request<types.MessageResponse>('PUT', path);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async deleteTemplate(): Promise<types.MessageResponse> {
|
|
43
|
+
const path = '/:id';
|
|
44
|
+
return this.client.request<types.MessageResponse>('DELETE', path);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async resetTemplate(): Promise<types.MessageResponse> {
|
|
48
|
+
const path = '/:id/reset';
|
|
49
|
+
return this.client.request<types.MessageResponse>('POST', path);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async resetAllTemplates(): Promise<types.MessageResponse> {
|
|
53
|
+
const path = '/reset-all';
|
|
54
|
+
return this.client.request<types.MessageResponse>('POST', path);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async getTemplateDefaults(): Promise<void> {
|
|
58
|
+
const path = '/defaults';
|
|
59
|
+
return this.client.request<void>('GET', path);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async renderTemplate(request: types.RenderTemplate_req): Promise<void> {
|
|
63
|
+
const path = '/render';
|
|
64
|
+
return this.client.request<void>('POST', path, {
|
|
65
|
+
body: request,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async sendNotification(): Promise<void> {
|
|
70
|
+
const path = '/send';
|
|
71
|
+
return this.client.request<void>('POST', path);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async getNotification(): Promise<void> {
|
|
75
|
+
const path = '/:id';
|
|
76
|
+
return this.client.request<void>('GET', path);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async listNotifications(): Promise<void> {
|
|
80
|
+
const path = '/listnotifications';
|
|
81
|
+
return this.client.request<void>('GET', path);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async resendNotification(): Promise<void> {
|
|
85
|
+
const path = '/:id/resend';
|
|
86
|
+
return this.client.request<void>('POST', path);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async handleWebhook(): Promise<types.StatusResponse> {
|
|
90
|
+
const path = '/notifications/webhook/:provider';
|
|
91
|
+
return this.client.request<types.StatusResponse>('POST', path);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function notificationClient(): NotificationPlugin {
|
|
97
|
+
return new NotificationPlugin();
|
|
98
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Auto-generated oidcprovider plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class OidcproviderPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'oidcprovider';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async registerClient(request: types.ClientRegistrationRequest): Promise<void> {
|
|
16
|
+
const path = '/register';
|
|
17
|
+
return this.client.request<void>('POST', path, {
|
|
18
|
+
body: request,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async listClients(): Promise<void> {
|
|
23
|
+
const path = '/listclients';
|
|
24
|
+
return this.client.request<void>('GET', path);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async getClient(): Promise<void> {
|
|
28
|
+
const path = '/:clientId';
|
|
29
|
+
return this.client.request<void>('GET', path);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async updateClient(request: types.ClientUpdateRequest): Promise<void> {
|
|
33
|
+
const path = '/:clientId';
|
|
34
|
+
return this.client.request<void>('PUT', path, {
|
|
35
|
+
body: request,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async deleteClient(): Promise<void> {
|
|
40
|
+
const path = '/:clientId';
|
|
41
|
+
return this.client.request<void>('DELETE', path);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async discovery(): Promise<void> {
|
|
45
|
+
const path = '/.well-known/openid-configuration';
|
|
46
|
+
return this.client.request<void>('GET', path);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async jWKS(): Promise<void> {
|
|
50
|
+
const path = '/jwks';
|
|
51
|
+
return this.client.request<void>('GET', path);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async authorize(): Promise<void> {
|
|
55
|
+
const path = '/authorize';
|
|
56
|
+
return this.client.request<void>('GET', path);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async handleConsent(): Promise<void> {
|
|
60
|
+
const path = '/consent';
|
|
61
|
+
return this.client.request<void>('POST', path);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async token(request: types.TokenRequest): Promise<void> {
|
|
65
|
+
const path = '/token';
|
|
66
|
+
return this.client.request<void>('POST', path, {
|
|
67
|
+
body: request,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async userInfo(): Promise<void> {
|
|
72
|
+
const path = '/userinfo';
|
|
73
|
+
return this.client.request<void>('GET', path);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async introspectToken(): Promise<void> {
|
|
77
|
+
const path = '/introspect';
|
|
78
|
+
return this.client.request<void>('POST', path);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async revokeToken(): Promise<types.StatusResponse> {
|
|
82
|
+
const path = '/revoke';
|
|
83
|
+
return this.client.request<types.StatusResponse>('POST', path);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function oidcproviderClient(): OidcproviderPlugin {
|
|
89
|
+
return new OidcproviderPlugin();
|
|
90
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Auto-generated organization plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class OrganizationPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'organization';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async createOrganization(): Promise<void> {
|
|
16
|
+
const path = '/createorganization';
|
|
17
|
+
return this.client.request<void>('POST', path);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async updateOrganization(): Promise<void> {
|
|
21
|
+
const path = '/:id';
|
|
22
|
+
return this.client.request<void>('PATCH', path);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async deleteOrganization(): Promise<void> {
|
|
26
|
+
const path = '/: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(): Promise<void> {
|
|
36
|
+
const path = '/: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(): Promise<void> {
|
|
46
|
+
const path = '/:teamId';
|
|
47
|
+
return this.client.request<void>('PATCH', path);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async deleteTeam(): Promise<void> {
|
|
51
|
+
const path = '/:teamId';
|
|
52
|
+
return this.client.request<void>('DELETE', path);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async getOrganization(): Promise<void> {
|
|
56
|
+
const path = '/:id';
|
|
57
|
+
return this.client.request<void>('GET', path);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async listOrganizations(): Promise<void> {
|
|
61
|
+
const path = '/listorganizations';
|
|
62
|
+
return this.client.request<void>('GET', path);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async getOrganizationBySlug(): Promise<void> {
|
|
66
|
+
const path = '/slug/:slug';
|
|
67
|
+
return this.client.request<void>('GET', path);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async listMembers(): Promise<void> {
|
|
71
|
+
const path = '/listmembers';
|
|
72
|
+
return this.client.request<void>('GET', path);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async updateMember(): Promise<void> {
|
|
76
|
+
const path = '/:memberId';
|
|
77
|
+
return this.client.request<void>('PATCH', path);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async acceptInvitation(): Promise<void> {
|
|
81
|
+
const path = '/:token/accept';
|
|
82
|
+
return this.client.request<void>('POST', path);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async declineInvitation(): Promise<types.StatusResponse> {
|
|
86
|
+
const path = '/:token/decline';
|
|
87
|
+
return this.client.request<types.StatusResponse>('POST', path);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async listTeams(): Promise<void> {
|
|
91
|
+
const path = '/listteams';
|
|
92
|
+
return this.client.request<void>('GET', path);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function organizationClient(): OrganizationPlugin {
|
|
98
|
+
return new OrganizationPlugin();
|
|
99
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Auto-generated passkey plugin
|
|
2
|
+
|
|
3
|
+
import { ClientPlugin } from '../plugin';
|
|
4
|
+
import { AuthsomeClient } from '../client';
|
|
5
|
+
import * as types from '../types';
|
|
6
|
+
|
|
7
|
+
export class PasskeyPlugin implements ClientPlugin {
|
|
8
|
+
readonly id = 'passkey';
|
|
9
|
+
private client!: AuthsomeClient;
|
|
10
|
+
|
|
11
|
+
init(client: AuthsomeClient): void {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async beginRegister(): Promise<void> {
|
|
16
|
+
const path = '/register/begin';
|
|
17
|
+
return this.client.request<void>('POST', path);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async finishRegister(): Promise<void> {
|
|
21
|
+
const path = '/register/finish';
|
|
22
|
+
return this.client.request<void>('POST', path);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async beginLogin(): Promise<void> {
|
|
26
|
+
const path = '/login/begin';
|
|
27
|
+
return this.client.request<void>('POST', path);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async finishLogin(): Promise<void> {
|
|
31
|
+
const path = '/login/finish';
|
|
32
|
+
return this.client.request<void>('POST', path);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async list(): Promise<void> {
|
|
36
|
+
const path = '/list';
|
|
37
|
+
return this.client.request<void>('GET', path);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async update(): Promise<void> {
|
|
41
|
+
const path = '/:id';
|
|
42
|
+
return this.client.request<void>('PUT', path);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async delete(): Promise<types.StatusResponse> {
|
|
46
|
+
const path = '/:id';
|
|
47
|
+
return this.client.request<types.StatusResponse>('DELETE', path);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function passkeyClient(): PasskeyPlugin {
|
|
53
|
+
return new PasskeyPlugin();
|
|
54
|
+
}
|