@absolutejs/auth 0.13.0 → 0.13.2
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/index.js +91 -71
- package/dist/index.js.map +11 -11
- package/dist/src/authorize.d.ts +2 -2
- package/dist/src/callback.d.ts +2 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/profile.d.ts +2 -2
- package/dist/src/refresh.d.ts +2 -2
- package/dist/src/revoke.d.ts +3 -3
- package/dist/src/signout.d.ts +1 -1
- package/dist/src/status.d.ts +1 -1
- package/dist/src/types.d.ts +24 -24
- package/package.json +2 -2
package/dist/src/authorize.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { AuthorizeRoute, ClientProviders, OnAuthorizeError, OnAuthorizeSuccess }
|
|
|
3
3
|
type AuthorizeProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
authorizeRoute?: AuthorizeRoute;
|
|
6
|
-
onAuthorizeSuccess
|
|
7
|
-
onAuthorizeError
|
|
6
|
+
onAuthorizeSuccess: OnAuthorizeSuccess;
|
|
7
|
+
onAuthorizeError: OnAuthorizeError;
|
|
8
8
|
};
|
|
9
9
|
export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorizeSuccess, onAuthorizeError }: AuthorizeProps) => Elysia<"", {
|
|
10
10
|
decorator: {};
|
package/dist/src/callback.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ClientProviders, OnCallbackError, OnCallbackSuccess, RouteString } from
|
|
|
3
3
|
type CallbackProps<UserType> = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
callbackRoute?: RouteString;
|
|
6
|
-
onCallbackSuccess
|
|
7
|
-
onCallbackError
|
|
6
|
+
onCallbackSuccess: OnCallbackSuccess<UserType>;
|
|
7
|
+
onCallbackError: OnCallbackError;
|
|
8
8
|
};
|
|
9
9
|
export declare const callback: <UserType>({ clientProviders, callbackRoute, onCallbackSuccess, onCallbackError }: CallbackProps<UserType>) => Elysia<"", {
|
|
10
10
|
decorator: {};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import { AbsoluteAuthProps } from './types';
|
|
3
|
-
export declare const absoluteAuth: <UserType>({ providersConfiguration, authorizeRoute, callbackRoute, profileRoute, signoutRoute, statusRoute, refreshRoute, revokeRoute, onAuthorizeSuccess, onProfileSuccess, onCallbackSuccess, onStatus, onRefreshSuccess, onSignOut, onRevocationSuccess }: AbsoluteAuthProps<UserType>) => Promise<Elysia<"", {
|
|
3
|
+
export declare const absoluteAuth: <UserType>({ providersConfiguration, authorizeRoute, callbackRoute, profileRoute, signoutRoute, statusRoute, refreshRoute, revokeRoute, onAuthorizeSuccess, onAuthorizeError, onProfileSuccess, onProfileError, onCallbackSuccess, onCallbackError, onStatus, onRefreshSuccess, onRefreshError, onSignOut, onRevocationSuccess, onRevocationError }: AbsoluteAuthProps<UserType>) => Promise<Elysia<"", {
|
|
4
4
|
decorator: {};
|
|
5
5
|
store: {
|
|
6
6
|
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
package/dist/src/profile.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ClientProviders, OnProfileError, OnProfileSuccess, RouteString } from '
|
|
|
3
3
|
type ProfileProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
profileRoute?: RouteString;
|
|
6
|
-
onProfileSuccess
|
|
7
|
-
onProfileError
|
|
6
|
+
onProfileSuccess: OnProfileSuccess;
|
|
7
|
+
onProfileError: OnProfileError;
|
|
8
8
|
};
|
|
9
9
|
export declare const profile: <UserType>({ clientProviders, profileRoute, onProfileSuccess, onProfileError }: ProfileProps) => Elysia<"", {
|
|
10
10
|
decorator: {};
|
package/dist/src/refresh.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ClientProviders, OnRefreshError, OnRefreshSuccess, RouteString } from '
|
|
|
3
3
|
type RefreshProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
refreshRoute?: RouteString;
|
|
6
|
-
onRefreshSuccess
|
|
7
|
-
onRefreshError
|
|
6
|
+
onRefreshSuccess: OnRefreshSuccess;
|
|
7
|
+
onRefreshError: OnRefreshError;
|
|
8
8
|
};
|
|
9
9
|
export declare const refresh: <UserType>({ clientProviders, refreshRoute, onRefreshSuccess, onRefreshError }: RefreshProps) => Elysia<"", {
|
|
10
10
|
decorator: {};
|
package/dist/src/revoke.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import { ClientProviders,
|
|
2
|
+
import { ClientProviders, OnRevocationError, OnRevocationSuccess, RouteString } from './types';
|
|
3
3
|
type RevokeProps = {
|
|
4
4
|
clientProviders: ClientProviders;
|
|
5
5
|
revokeRoute?: RouteString;
|
|
6
|
-
onRevocationSuccess
|
|
7
|
-
onRevocationError
|
|
6
|
+
onRevocationSuccess: OnRevocationSuccess;
|
|
7
|
+
onRevocationError: OnRevocationError;
|
|
8
8
|
};
|
|
9
9
|
export declare const revoke: <UserType>({ clientProviders, revokeRoute, onRevocationSuccess, onRevocationError }: RevokeProps) => Elysia<"", {
|
|
10
10
|
decorator: {};
|
package/dist/src/signout.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Elysia } from 'elysia';
|
|
|
2
2
|
import { OnSignOut, RouteString } from './types';
|
|
3
3
|
type SignOutProps<UserType> = {
|
|
4
4
|
signoutRoute?: RouteString;
|
|
5
|
-
onSignOut
|
|
5
|
+
onSignOut: OnSignOut<UserType>;
|
|
6
6
|
};
|
|
7
7
|
export declare const signout: <UserType>({ signoutRoute, onSignOut }: SignOutProps<UserType>) => Elysia<"", {
|
|
8
8
|
decorator: {};
|
package/dist/src/status.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Elysia } from 'elysia';
|
|
|
2
2
|
import { OnStatus, RouteString } from './types';
|
|
3
3
|
type StatusProps<UserType> = {
|
|
4
4
|
statusRoute?: RouteString;
|
|
5
|
-
onStatus
|
|
5
|
+
onStatus: OnStatus<UserType>;
|
|
6
6
|
};
|
|
7
7
|
export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps<UserType>) => Elysia<"", {
|
|
8
8
|
decorator: {};
|
package/dist/src/types.d.ts
CHANGED
|
@@ -18,59 +18,59 @@ export type OAuth2ConfigurationOptions = {
|
|
|
18
18
|
export type SessionRecord<UserType> = Record<string, SessionData<UserType> | undefined>;
|
|
19
19
|
export type CreateUser<UserType> = (userIdentity: Record<string, unknown>) => UserType | Promise<UserType>;
|
|
20
20
|
export type GetUser<UserType> = (userIdentity: Record<string, unknown>) => UserType | null | undefined | Promise<UserType | null | undefined>;
|
|
21
|
-
export type OnCallbackSuccess<UserType> = ({ authProvider, tokenResponse, providerInstance, session, userSessionId, originUrl }: {
|
|
21
|
+
export type OnCallbackSuccess<UserType> = (({ authProvider, tokenResponse, providerInstance, session, userSessionId, originUrl }: {
|
|
22
22
|
providerInstance: OAuth2Client<ProviderOption>;
|
|
23
23
|
authProvider: string;
|
|
24
24
|
tokenResponse: OAuth2TokenResponse;
|
|
25
25
|
session: SessionRecord<UserType>;
|
|
26
26
|
userSessionId: `${string}-${string}-${string}-${string}-${string}`;
|
|
27
27
|
originUrl: string;
|
|
28
|
-
}) => void | Promise<void
|
|
29
|
-
export type OnCallbackError = ({ error, authProvider, originUrl }: {
|
|
28
|
+
}) => void | Promise<void>) | undefined;
|
|
29
|
+
export type OnCallbackError = (({ error, authProvider, originUrl }: {
|
|
30
30
|
authProvider: string;
|
|
31
31
|
error: unknown;
|
|
32
32
|
originUrl: string;
|
|
33
|
-
}) => void | Promise<void
|
|
34
|
-
export type OnAuthorizeSuccess = ({ authProvider, authorizationUrl }: {
|
|
33
|
+
}) => void | Promise<void>) | undefined;
|
|
34
|
+
export type OnAuthorizeSuccess = (({ authProvider, authorizationUrl }: {
|
|
35
35
|
authProvider: string;
|
|
36
36
|
authorizationUrl: URL;
|
|
37
|
-
}) => void | Promise<void
|
|
38
|
-
export type OnAuthorizeError = ({ error, authProvider }: {
|
|
37
|
+
}) => void | Promise<void>) | undefined;
|
|
38
|
+
export type OnAuthorizeError = (({ error, authProvider }: {
|
|
39
39
|
authProvider: string;
|
|
40
40
|
error: unknown;
|
|
41
|
-
}) => void | Promise<void
|
|
42
|
-
export type OnRefreshSuccess = ({ tokenResponse, authProvider }: {
|
|
41
|
+
}) => void | Promise<void>) | undefined;
|
|
42
|
+
export type OnRefreshSuccess = (({ tokenResponse, authProvider }: {
|
|
43
43
|
tokenResponse: OAuth2TokenResponse;
|
|
44
44
|
authProvider: string;
|
|
45
|
-
}) => void | Promise<void
|
|
46
|
-
export type OnRefreshError = ({ error, authProvider }: {
|
|
45
|
+
}) => void | Promise<void>) | undefined;
|
|
46
|
+
export type OnRefreshError = (({ error, authProvider }: {
|
|
47
47
|
authProvider: string;
|
|
48
48
|
error: unknown;
|
|
49
|
-
}) => void | Promise<void
|
|
50
|
-
export type OnProfileSuccess = ({ userProfile, authProvider }: {
|
|
49
|
+
}) => void | Promise<void>) | undefined;
|
|
50
|
+
export type OnProfileSuccess = (({ userProfile, authProvider }: {
|
|
51
51
|
userProfile: Record<string, unknown>;
|
|
52
52
|
authProvider: string;
|
|
53
|
-
}) => void | Promise<void
|
|
54
|
-
export type OnProfileError = ({ error, authProvider }: {
|
|
53
|
+
}) => void | Promise<void>) | undefined;
|
|
54
|
+
export type OnProfileError = (({ error, authProvider }: {
|
|
55
55
|
authProvider: string;
|
|
56
56
|
error: unknown;
|
|
57
|
-
}) => void | Promise<void
|
|
58
|
-
export type OnRevocationSuccess = ({ tokenToRevoke, authProvider }: {
|
|
57
|
+
}) => void | Promise<void>) | undefined;
|
|
58
|
+
export type OnRevocationSuccess = (({ tokenToRevoke, authProvider }: {
|
|
59
59
|
tokenToRevoke: string;
|
|
60
60
|
authProvider: string;
|
|
61
|
-
}) => void | Promise<void
|
|
62
|
-
export type OnRevocationError = ({ error, authProvider }: {
|
|
61
|
+
}) => void | Promise<void>) | undefined;
|
|
62
|
+
export type OnRevocationError = (({ error, authProvider }: {
|
|
63
63
|
authProvider: string;
|
|
64
64
|
error: unknown;
|
|
65
|
-
}) => void | Promise<void
|
|
66
|
-
export type OnStatus<UserType> = ({ user }: {
|
|
65
|
+
}) => void | Promise<void>) | undefined;
|
|
66
|
+
export type OnStatus<UserType> = (({ user }: {
|
|
67
67
|
user: UserType | null;
|
|
68
|
-
}) => void | Promise<void
|
|
69
|
-
export type OnSignOut<UserType> = ({ authProvider, userSessionId }: {
|
|
68
|
+
}) => void | Promise<void>) | undefined;
|
|
69
|
+
export type OnSignOut<UserType> = (({ authProvider, userSessionId, session }: {
|
|
70
70
|
authProvider: string;
|
|
71
71
|
userSessionId: `${string}-${string}-${string}-${string}-${string}`;
|
|
72
72
|
session: SessionRecord<UserType>;
|
|
73
|
-
}) => void | Promise<void
|
|
73
|
+
}) => void | Promise<void>) | undefined;
|
|
74
74
|
export type RouteString = `/${string}`;
|
|
75
75
|
export type AuthorizeRoute = `${string}/:provider${'' | `/${string}`}`;
|
|
76
76
|
export type AbsoluteAuthProps<UserType> = {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.13.
|
|
2
|
+
"version": "0.13.2",
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"description": "An authorization library for absolutejs",
|
|
5
5
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"elysia": ">= 1.2.25"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"citra": "0.22.
|
|
36
|
+
"citra": "0.22.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@absolutejs/absolute": "0.4.0",
|