@authsome/client 0.0.4 → 0.0.6
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 +41 -37
- package/dist/client.js +32 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +56 -56
- package/dist/plugins/admin.d.ts +5 -5
- package/dist/plugins/admin.js +21 -31
- package/dist/plugins/anonymous.d.ts +1 -1
- package/dist/plugins/anonymous.js +4 -2
- package/dist/plugins/apikey.d.ts +7 -7
- package/dist/plugins/apikey.js +41 -27
- package/dist/plugins/backupauth.d.ts +28 -28
- package/dist/plugins/backupauth.js +29 -29
- package/dist/plugins/cms.d.ts +11 -11
- package/dist/plugins/cms.js +67 -57
- package/dist/plugins/compliance.d.ts +33 -33
- package/dist/plugins/compliance.js +4 -2
- package/dist/plugins/consent.d.ts +18 -18
- package/dist/plugins/emailverification.d.ts +2 -2
- package/dist/plugins/emailverification.js +4 -2
- package/dist/plugins/idverification.d.ts +11 -11
- package/dist/plugins/idverification.js +11 -11
- package/dist/plugins/impersonation.d.ts +6 -6
- package/dist/plugins/impersonation.js +11 -15
- package/dist/plugins/jwt.d.ts +6 -5
- package/dist/plugins/jwt.js +21 -13
- package/dist/plugins/mfa.d.ts +9 -9
- package/dist/plugins/mfa.js +4 -8
- package/dist/plugins/multiapp.d.ts +19 -19
- package/dist/plugins/multiapp.js +35 -27
- package/dist/plugins/multisession.d.ts +5 -5
- package/dist/plugins/multisession.js +13 -11
- package/dist/plugins/notification.d.ts +15 -15
- package/dist/plugins/notification.js +12 -6
- package/dist/plugins/oidcprovider.d.ts +11 -11
- package/dist/plugins/oidcprovider.js +25 -19
- package/dist/plugins/organization.d.ts +5 -5
- package/dist/plugins/organization.js +16 -16
- package/dist/plugins/passkey.js +7 -7
- package/dist/plugins/permissions.js +3 -3
- package/dist/plugins/secrets.d.ts +10 -10
- package/dist/plugins/secrets.js +43 -27
- package/dist/plugins/social.js +1 -1
- package/dist/plugins/sso.js +6 -6
- package/dist/plugins/stepup.d.ts +13 -13
- package/dist/plugins/stepup.js +14 -14
- package/dist/plugins/twofa.d.ts +6 -6
- package/dist/plugins/twofa.js +12 -24
- package/dist/plugins/username.d.ts +2 -2
- package/dist/plugins/username.js +8 -4
- package/dist/plugins/webhook.js +4 -4
- package/dist/types.d.ts +3316 -2791
- package/package.json +3 -3
- package/src/client.ts +52 -37
- package/src/index.ts +18 -18
- package/src/plugins/admin.ts +21 -31
- package/src/plugins/anonymous.ts +4 -2
- package/src/plugins/apikey.ts +35 -21
- package/src/plugins/backupauth.ts +85 -85
- package/src/plugins/cms.ts +67 -57
- package/src/plugins/compliance.ts +68 -66
- package/src/plugins/consent.ts +36 -36
- package/src/plugins/emailverification.ts +6 -4
- package/src/plugins/idverification.ts +33 -33
- package/src/plugins/impersonation.ts +18 -22
- package/src/plugins/jwt.ts +23 -15
- package/src/plugins/mfa.ts +18 -22
- package/src/plugins/multiapp.ts +65 -57
- package/src/plugins/multisession.ts +20 -18
- package/src/plugins/notification.ts +36 -30
- package/src/plugins/oidcprovider.ts +41 -35
- package/src/plugins/organization.ts +26 -26
- package/src/plugins/passkey.ts +7 -7
- package/src/plugins/permissions.ts +3 -3
- package/src/plugins/secrets.ts +47 -31
- package/src/plugins/social.ts +1 -1
- package/src/plugins/sso.ts +6 -6
- package/src/plugins/stepup.ts +40 -40
- package/src/plugins/twofa.ts +12 -24
- package/src/plugins/username.ts +8 -4
- package/src/plugins/webhook.ts +4 -4
- package/src/types.ts +3576 -2874
package/dist/plugins/secrets.js
CHANGED
|
@@ -10,51 +10,67 @@ class SecretsPlugin {
|
|
|
10
10
|
init(client) {
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
|
-
async list() {
|
|
14
|
-
const path = '/list';
|
|
15
|
-
return this.client.request('GET', path
|
|
13
|
+
async list(request) {
|
|
14
|
+
const path = '/secrets/list';
|
|
15
|
+
return this.client.request('GET', path, {
|
|
16
|
+
query: this.client.toQueryParams(request),
|
|
17
|
+
});
|
|
16
18
|
}
|
|
17
|
-
async create() {
|
|
18
|
-
const path = '/create';
|
|
19
|
-
return this.client.request('POST', path
|
|
19
|
+
async create(request) {
|
|
20
|
+
const path = '/secrets/create';
|
|
21
|
+
return this.client.request('POST', path, {
|
|
22
|
+
body: request,
|
|
23
|
+
});
|
|
20
24
|
}
|
|
21
|
-
async get(params) {
|
|
22
|
-
const path =
|
|
23
|
-
return this.client.request('GET', path
|
|
25
|
+
async get(params, request) {
|
|
26
|
+
const path = `/secrets/${params.id}`;
|
|
27
|
+
return this.client.request('GET', path, {
|
|
28
|
+
query: this.client.toQueryParams(request),
|
|
29
|
+
});
|
|
24
30
|
}
|
|
25
|
-
async getValue(params) {
|
|
26
|
-
const path =
|
|
27
|
-
return this.client.request('GET', path
|
|
31
|
+
async getValue(params, request) {
|
|
32
|
+
const path = `/secrets/${params.id}/value`;
|
|
33
|
+
return this.client.request('GET', path, {
|
|
34
|
+
query: this.client.toQueryParams(request),
|
|
35
|
+
});
|
|
28
36
|
}
|
|
29
|
-
async update(params) {
|
|
30
|
-
const path =
|
|
31
|
-
return this.client.request('PUT', path
|
|
37
|
+
async update(params, request) {
|
|
38
|
+
const path = `/secrets/${params.id}`;
|
|
39
|
+
return this.client.request('PUT', path, {
|
|
40
|
+
body: request,
|
|
41
|
+
});
|
|
32
42
|
}
|
|
33
|
-
async delete(params) {
|
|
34
|
-
const path =
|
|
35
|
-
return this.client.request('DELETE', path
|
|
43
|
+
async delete(params, request) {
|
|
44
|
+
const path = `/secrets/${params.id}`;
|
|
45
|
+
return this.client.request('DELETE', path, {
|
|
46
|
+
query: this.client.toQueryParams(request),
|
|
47
|
+
});
|
|
36
48
|
}
|
|
37
49
|
async getByPath() {
|
|
38
|
-
const path = '/path/*path';
|
|
50
|
+
const path = '/secrets/path/*path';
|
|
39
51
|
return this.client.request('GET', path);
|
|
40
52
|
}
|
|
41
|
-
async getVersions(params) {
|
|
42
|
-
const path =
|
|
43
|
-
return this.client.request('GET', path
|
|
53
|
+
async getVersions(params, request) {
|
|
54
|
+
const path = `/secrets/${params.id}/versions`;
|
|
55
|
+
return this.client.request('GET', path, {
|
|
56
|
+
query: this.client.toQueryParams(request),
|
|
57
|
+
});
|
|
44
58
|
}
|
|
45
59
|
async rollback(params, request) {
|
|
46
|
-
const path =
|
|
60
|
+
const path = `/secrets/${params.id}/rollback/${params.version}`;
|
|
47
61
|
return this.client.request('POST', path, {
|
|
48
62
|
body: request,
|
|
49
63
|
});
|
|
50
64
|
}
|
|
51
65
|
async getStats() {
|
|
52
|
-
const path = '/stats';
|
|
66
|
+
const path = '/secrets/stats';
|
|
53
67
|
return this.client.request('GET', path);
|
|
54
68
|
}
|
|
55
|
-
async getTree() {
|
|
56
|
-
const path = '/tree';
|
|
57
|
-
return this.client.request('GET', path
|
|
69
|
+
async getTree(request) {
|
|
70
|
+
const path = '/secrets/tree';
|
|
71
|
+
return this.client.request('GET', path, {
|
|
72
|
+
query: this.client.toQueryParams(request),
|
|
73
|
+
});
|
|
58
74
|
}
|
|
59
75
|
}
|
|
60
76
|
exports.SecretsPlugin = SecretsPlugin;
|
package/dist/plugins/social.js
CHANGED
package/dist/plugins/sso.js
CHANGED
|
@@ -11,33 +11,33 @@ class SsoPlugin {
|
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
13
|
async registerProvider(request) {
|
|
14
|
-
const path = '/provider/register';
|
|
14
|
+
const path = '/sso/provider/register';
|
|
15
15
|
return this.client.request('POST', path, {
|
|
16
16
|
body: request,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
async sAMLSPMetadata() {
|
|
20
|
-
const path = '/saml2/sp/metadata';
|
|
20
|
+
const path = '/sso/saml2/sp/metadata';
|
|
21
21
|
return this.client.request('GET', path);
|
|
22
22
|
}
|
|
23
23
|
async sAMLLogin(params, request) {
|
|
24
|
-
const path = `/saml2/login/${params.providerId}`;
|
|
24
|
+
const path = `/sso/saml2/login/${params.providerId}`;
|
|
25
25
|
return this.client.request('POST', path, {
|
|
26
26
|
body: request,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
async sAMLCallback(params) {
|
|
30
|
-
const path = `/saml2/callback/${params.providerId}`;
|
|
30
|
+
const path = `/sso/saml2/callback/${params.providerId}`;
|
|
31
31
|
return this.client.request('POST', path);
|
|
32
32
|
}
|
|
33
33
|
async oIDCLogin(params, request) {
|
|
34
|
-
const path = `/oidc/login/${params.providerId}`;
|
|
34
|
+
const path = `/sso/oidc/login/${params.providerId}`;
|
|
35
35
|
return this.client.request('POST', path, {
|
|
36
36
|
body: request,
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
async oIDCCallback(params) {
|
|
40
|
-
const path = `/oidc/callback/${params.providerId}`;
|
|
40
|
+
const path = `/sso/oidc/callback/${params.providerId}`;
|
|
41
41
|
return this.client.request('GET', path);
|
|
42
42
|
}
|
|
43
43
|
}
|
package/dist/plugins/stepup.d.ts
CHANGED
|
@@ -5,29 +5,29 @@ export declare class StepupPlugin implements ClientPlugin {
|
|
|
5
5
|
readonly id = "stepup";
|
|
6
6
|
private client;
|
|
7
7
|
init(client: AuthsomeClient): void;
|
|
8
|
-
evaluate(request: types.EvaluateRequest): Promise<
|
|
9
|
-
verify(request: types.VerifyRequest): Promise<
|
|
8
|
+
evaluate(request: types.EvaluateRequest): Promise<types.StepUpEvaluationResponse>;
|
|
9
|
+
verify(request: types.VerifyRequest): Promise<types.StepUpVerificationResponse>;
|
|
10
10
|
getRequirement(params: {
|
|
11
11
|
id: string;
|
|
12
|
-
}): Promise<
|
|
13
|
-
listPendingRequirements(): Promise<types.
|
|
14
|
-
listVerifications(): Promise<
|
|
12
|
+
}): Promise<types.StepUpRequirementResponse>;
|
|
13
|
+
listPendingRequirements(): Promise<types.StepUpRequirementsResponse>;
|
|
14
|
+
listVerifications(): Promise<types.StepUpVerificationsResponse>;
|
|
15
15
|
listRememberedDevices(): Promise<types.StepUpDevicesResponse>;
|
|
16
16
|
forgetDevice(params: {
|
|
17
17
|
id: string;
|
|
18
|
-
}): Promise<types.
|
|
19
|
-
createPolicy(request: types.StepUpPolicy): Promise<types.
|
|
20
|
-
listPolicies(): Promise<
|
|
18
|
+
}): Promise<types.StepUpStatusResponse>;
|
|
19
|
+
createPolicy(request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse>;
|
|
20
|
+
listPolicies(): Promise<types.StepUpPoliciesResponse>;
|
|
21
21
|
getPolicy(params: {
|
|
22
22
|
id: string;
|
|
23
|
-
}): Promise<
|
|
23
|
+
}): Promise<types.StepUpPolicyResponse>;
|
|
24
24
|
updatePolicy(params: {
|
|
25
25
|
id: string;
|
|
26
|
-
}, request: types.StepUpPolicy): Promise<types.
|
|
26
|
+
}, request: types.StepUpPolicy): Promise<types.StepUpPolicyResponse>;
|
|
27
27
|
deletePolicy(params: {
|
|
28
28
|
id: string;
|
|
29
|
-
}): Promise<
|
|
30
|
-
getAuditLogs(): Promise<
|
|
31
|
-
status(): Promise<
|
|
29
|
+
}): Promise<types.StepUpStatusResponse>;
|
|
30
|
+
getAuditLogs(): Promise<types.StepUpAuditLogsResponse>;
|
|
31
|
+
status(): Promise<types.StepUpStatusResponse>;
|
|
32
32
|
}
|
|
33
33
|
export declare function stepupClient(): StepupPlugin;
|
package/dist/plugins/stepup.js
CHANGED
|
@@ -11,67 +11,67 @@ class StepupPlugin {
|
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
13
|
async evaluate(request) {
|
|
14
|
-
const path = '/evaluate';
|
|
14
|
+
const path = '/stepup/evaluate';
|
|
15
15
|
return this.client.request('POST', path, {
|
|
16
16
|
body: request,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
async verify(request) {
|
|
20
|
-
const path = '/verify';
|
|
20
|
+
const path = '/stepup/verify';
|
|
21
21
|
return this.client.request('POST', path, {
|
|
22
22
|
body: request,
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
async getRequirement(params) {
|
|
26
|
-
const path = `/requirements/${params.id}`;
|
|
26
|
+
const path = `/stepup/requirements/${params.id}`;
|
|
27
27
|
return this.client.request('GET', path);
|
|
28
28
|
}
|
|
29
29
|
async listPendingRequirements() {
|
|
30
|
-
const path = '/requirements/pending';
|
|
30
|
+
const path = '/stepup/requirements/pending';
|
|
31
31
|
return this.client.request('GET', path);
|
|
32
32
|
}
|
|
33
33
|
async listVerifications() {
|
|
34
|
-
const path = '/verifications';
|
|
34
|
+
const path = '/stepup/verifications';
|
|
35
35
|
return this.client.request('GET', path);
|
|
36
36
|
}
|
|
37
37
|
async listRememberedDevices() {
|
|
38
|
-
const path = '/devices';
|
|
38
|
+
const path = '/stepup/devices';
|
|
39
39
|
return this.client.request('GET', path);
|
|
40
40
|
}
|
|
41
41
|
async forgetDevice(params) {
|
|
42
|
-
const path = `/devices/${params.id}`;
|
|
42
|
+
const path = `/stepup/devices/${params.id}`;
|
|
43
43
|
return this.client.request('DELETE', path);
|
|
44
44
|
}
|
|
45
45
|
async createPolicy(request) {
|
|
46
|
-
const path = '/policies';
|
|
46
|
+
const path = '/stepup/policies';
|
|
47
47
|
return this.client.request('POST', path, {
|
|
48
48
|
body: request,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
async listPolicies() {
|
|
52
|
-
const path = '/policies';
|
|
52
|
+
const path = '/stepup/policies';
|
|
53
53
|
return this.client.request('GET', path);
|
|
54
54
|
}
|
|
55
55
|
async getPolicy(params) {
|
|
56
|
-
const path = `/policies/${params.id}`;
|
|
56
|
+
const path = `/stepup/policies/${params.id}`;
|
|
57
57
|
return this.client.request('GET', path);
|
|
58
58
|
}
|
|
59
59
|
async updatePolicy(params, request) {
|
|
60
|
-
const path = `/policies/${params.id}`;
|
|
60
|
+
const path = `/stepup/policies/${params.id}`;
|
|
61
61
|
return this.client.request('PUT', path, {
|
|
62
62
|
body: request,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
async deletePolicy(params) {
|
|
66
|
-
const path = `/policies/${params.id}`;
|
|
66
|
+
const path = `/stepup/policies/${params.id}`;
|
|
67
67
|
return this.client.request('DELETE', path);
|
|
68
68
|
}
|
|
69
69
|
async getAuditLogs() {
|
|
70
|
-
const path = '/audit';
|
|
70
|
+
const path = '/stepup/audit';
|
|
71
71
|
return this.client.request('GET', path);
|
|
72
72
|
}
|
|
73
73
|
async status() {
|
|
74
|
-
const path = '/status';
|
|
74
|
+
const path = '/stepup/status';
|
|
75
75
|
return this.client.request('GET', path);
|
|
76
76
|
}
|
|
77
77
|
}
|
package/dist/plugins/twofa.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ export declare class TwofaPlugin implements ClientPlugin {
|
|
|
5
5
|
readonly id = "twofa";
|
|
6
6
|
private client;
|
|
7
7
|
init(client: AuthsomeClient): void;
|
|
8
|
-
enable(
|
|
9
|
-
verify(
|
|
10
|
-
disable(
|
|
11
|
-
generateBackupCodes(
|
|
12
|
-
sendOTP(
|
|
13
|
-
status(
|
|
8
|
+
enable(): Promise<void>;
|
|
9
|
+
verify(): Promise<types.StatusResponse>;
|
|
10
|
+
disable(): Promise<types.StatusResponse>;
|
|
11
|
+
generateBackupCodes(): Promise<types.CodesResponse>;
|
|
12
|
+
sendOTP(): Promise<types.OTPSentResponse>;
|
|
13
|
+
status(): Promise<types.TwoFAStatusResponse>;
|
|
14
14
|
}
|
|
15
15
|
export declare function twofaClient(): TwofaPlugin;
|
package/dist/plugins/twofa.js
CHANGED
|
@@ -10,41 +10,29 @@ class TwofaPlugin {
|
|
|
10
10
|
init(client) {
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
|
-
async enable(
|
|
13
|
+
async enable() {
|
|
14
14
|
const path = '/2fa/enable';
|
|
15
|
-
return this.client.request('POST', path
|
|
16
|
-
body: request,
|
|
17
|
-
});
|
|
15
|
+
return this.client.request('POST', path);
|
|
18
16
|
}
|
|
19
|
-
async verify(
|
|
17
|
+
async verify() {
|
|
20
18
|
const path = '/2fa/verify';
|
|
21
|
-
return this.client.request('POST', path
|
|
22
|
-
body: request,
|
|
23
|
-
});
|
|
19
|
+
return this.client.request('POST', path);
|
|
24
20
|
}
|
|
25
|
-
async disable(
|
|
21
|
+
async disable() {
|
|
26
22
|
const path = '/2fa/disable';
|
|
27
|
-
return this.client.request('POST', path
|
|
28
|
-
body: request,
|
|
29
|
-
});
|
|
23
|
+
return this.client.request('POST', path);
|
|
30
24
|
}
|
|
31
|
-
async generateBackupCodes(
|
|
25
|
+
async generateBackupCodes() {
|
|
32
26
|
const path = '/2fa/generate-backup-codes';
|
|
33
|
-
return this.client.request('POST', path
|
|
34
|
-
body: request,
|
|
35
|
-
});
|
|
27
|
+
return this.client.request('POST', path);
|
|
36
28
|
}
|
|
37
|
-
async sendOTP(
|
|
29
|
+
async sendOTP() {
|
|
38
30
|
const path = '/2fa/send-otp';
|
|
39
|
-
return this.client.request('POST', path
|
|
40
|
-
body: request,
|
|
41
|
-
});
|
|
31
|
+
return this.client.request('POST', path);
|
|
42
32
|
}
|
|
43
|
-
async status(
|
|
33
|
+
async status() {
|
|
44
34
|
const path = '/2fa/status';
|
|
45
|
-
return this.client.request('POST', path
|
|
46
|
-
body: request,
|
|
47
|
-
});
|
|
35
|
+
return this.client.request('POST', path);
|
|
48
36
|
}
|
|
49
37
|
}
|
|
50
38
|
exports.TwofaPlugin = TwofaPlugin;
|
|
@@ -5,7 +5,7 @@ export declare class UsernamePlugin implements ClientPlugin {
|
|
|
5
5
|
readonly id = "username";
|
|
6
6
|
private client;
|
|
7
7
|
init(client: AuthsomeClient): void;
|
|
8
|
-
signUp(): Promise<types.SignUpResponse>;
|
|
9
|
-
signIn(): Promise<types.
|
|
8
|
+
signUp(request: types.SignUpRequest): Promise<types.SignUpResponse>;
|
|
9
|
+
signIn(request: types.SignInRequest): Promise<types.TwoFARequiredResponse>;
|
|
10
10
|
}
|
|
11
11
|
export declare function usernameClient(): UsernamePlugin;
|
package/dist/plugins/username.js
CHANGED
|
@@ -10,13 +10,17 @@ class UsernamePlugin {
|
|
|
10
10
|
init(client) {
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
|
-
async signUp() {
|
|
13
|
+
async signUp(request) {
|
|
14
14
|
const path = '/username/signup';
|
|
15
|
-
return this.client.request('POST', path
|
|
15
|
+
return this.client.request('POST', path, {
|
|
16
|
+
body: request,
|
|
17
|
+
});
|
|
16
18
|
}
|
|
17
|
-
async signIn() {
|
|
19
|
+
async signIn(request) {
|
|
18
20
|
const path = '/username/signin';
|
|
19
|
-
return this.client.request('POST', path
|
|
21
|
+
return this.client.request('POST', path, {
|
|
22
|
+
body: request,
|
|
23
|
+
});
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
exports.UsernamePlugin = UsernamePlugin;
|
package/dist/plugins/webhook.js
CHANGED
|
@@ -11,27 +11,27 @@ class WebhookPlugin {
|
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
13
|
async create(request) {
|
|
14
|
-
const path = '/webhooks';
|
|
14
|
+
const path = '/api/auth/webhooks';
|
|
15
15
|
return this.client.request('POST', path, {
|
|
16
16
|
body: request,
|
|
17
17
|
auth: true,
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
async list() {
|
|
21
|
-
const path = '/webhooks';
|
|
21
|
+
const path = '/api/auth/webhooks';
|
|
22
22
|
return this.client.request('GET', path, {
|
|
23
23
|
auth: true,
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
async update(request) {
|
|
27
|
-
const path = '/webhooks/update';
|
|
27
|
+
const path = '/api/auth/webhooks/update';
|
|
28
28
|
return this.client.request('POST', path, {
|
|
29
29
|
body: request,
|
|
30
30
|
auth: true,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
async delete(request) {
|
|
34
|
-
const path = '/webhooks/delete';
|
|
34
|
+
const path = '/api/auth/webhooks/delete';
|
|
35
35
|
return this.client.request('POST', path, {
|
|
36
36
|
body: request,
|
|
37
37
|
auth: true,
|