@absolutejs/auth 0.14.8 → 0.15.0

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.
@@ -12,10 +12,11 @@ export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorizeS
12
12
  derive: {};
13
13
  resolve: {};
14
14
  }, {
15
- typebox: import("@sinclair/typebox").TModule<{}>;
15
+ typebox: {};
16
16
  error: {};
17
17
  }, {
18
18
  schema: {};
19
+ standaloneSchema: {};
19
20
  macro: {};
20
21
  macroFn: {};
21
22
  parser: {};
@@ -30,10 +31,10 @@ export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorizeS
30
31
  query: unknown;
31
32
  headers: unknown;
32
33
  response: {
33
- 200: import("undici-types").Response;
34
+ 200: Response;
34
35
  400: "Cookies are missing" | "Provider is required" | "Invalid provider";
35
36
  401: "Client provider not found";
36
- 500: `${string} - ${string}` | `Unknown error: ${string}`;
37
+ 500: `${string} - ${string}` | `Unknown status: ${string}`;
37
38
  422: {
38
39
  type: "validation";
39
40
  on: string;
@@ -59,10 +60,10 @@ export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorizeS
59
60
  query: unknown;
60
61
  headers: unknown;
61
62
  response: {
62
- 200: import("undici-types").Response;
63
+ 200: Response;
63
64
  400: "Cookies are missing" | "Provider is required" | "Invalid provider";
64
65
  401: "Client provider not found";
65
- 500: `${string} - ${string}` | `Unknown error: ${string}`;
66
+ 500: `${string} - ${string}` | `Unknown status: ${string}`;
66
67
  422: {
67
68
  type: "validation";
68
69
  on: string;
@@ -81,9 +82,11 @@ export declare const authorize: ({ clientProviders, authorizeRoute, onAuthorizeS
81
82
  derive: {};
82
83
  resolve: {};
83
84
  schema: {};
85
+ standaloneSchema: {};
84
86
  }, {
85
87
  derive: {};
86
88
  resolve: {};
87
89
  schema: {};
90
+ standaloneSchema: {};
88
91
  }>;
89
92
  export {};
@@ -14,10 +14,11 @@ export declare const callback: <UserType>({ clientProviders, callbackRoute, onCa
14
14
  derive: {};
15
15
  resolve: {};
16
16
  }, {
17
+ typebox: {};
17
18
  error: {};
18
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
19
19
  }, {
20
20
  schema: {};
21
+ standaloneSchema: {};
21
22
  macro: {};
22
23
  macroFn: {};
23
24
  parser: {};
@@ -29,10 +30,10 @@ export declare const callback: <UserType>({ clientProviders, callbackRoute, onCa
29
30
  query: unknown;
30
31
  headers: unknown;
31
32
  response: {
32
- 200: import("undici-types").Response;
33
+ 200: Response;
33
34
  400: "Cookies are missing" | "Invalid callback request" | "Invalid state mismatch" | "Code verifier not found and is required";
34
35
  401: "Invalid provider" | "Client provider not found" | "No auth provider found";
35
- 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown error: ${string}`;
36
+ 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown status: ${string}`;
36
37
  422: {
37
38
  type: "validation";
38
39
  on: string;
@@ -49,9 +50,11 @@ export declare const callback: <UserType>({ clientProviders, callbackRoute, onCa
49
50
  derive: {};
50
51
  resolve: {};
51
52
  schema: {};
53
+ standaloneSchema: {};
52
54
  }, {
53
55
  derive: {};
54
56
  resolve: {};
55
57
  schema: {};
58
+ standaloneSchema: {};
56
59
  }>;
57
60
  export {};
@@ -0,0 +1,10 @@
1
+ import { Cookie, status as elysiaStatus } from 'elysia';
2
+ import { OnStatus, SessionRecord } from './types';
3
+ type GetStatusProps<UserType> = {
4
+ user_session_id: Cookie<string | undefined> | undefined;
5
+ status: typeof elysiaStatus;
6
+ session: SessionRecord<UserType>;
7
+ onStatus: OnStatus<UserType>;
8
+ };
9
+ export declare const getStatus: <UserType>({ user_session_id, status, session, onStatus }: GetStatusProps<UserType>) => Promise<Response | import("elysia/error").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia/error").ElysiaCustomStatusResponse<"Internal Server Error", `Error: ${string} - ${string}`, 500> | import("elysia/error").ElysiaCustomStatusResponse<"Internal Server Error", `Unknown Error: ${string}`, 500>>;
10
+ export {};
@@ -10,8 +10,8 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
10
10
  };
11
11
  resolve: {};
12
12
  }, {
13
+ typebox: {};
13
14
  error: {};
14
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
15
15
  }, {
16
16
  schema: {
17
17
  body: unknown;
@@ -21,6 +21,7 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
21
21
  cookie: unknown;
22
22
  response: {};
23
23
  };
24
+ standaloneSchema: {};
24
25
  macro: {};
25
26
  macroFn: {};
26
27
  parser: {};
@@ -60,7 +61,7 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
60
61
  400: "Cookies are missing" | "Invalid provider";
61
62
  401: "Client provider not found" | "No auth provider found" | "No user session found";
62
63
  501: "Provider does not support revocation";
63
- 500: `Failed to revoke token: ${string}`;
64
+ 500: `Failed to revoke token: ${string}` | `Failed to revoke token: Unknown status: ${string}`;
64
65
  };
65
66
  };
66
67
  };
@@ -90,7 +91,7 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
90
91
  400: "Cookies are missing" | "Invalid provider" | "No refresh token found";
91
92
  401: "Client provider not found" | "No auth provider found" | "No user session found";
92
93
  501: "Provider is not refreshable";
93
- 500: `Failed to refresh token: ${string}`;
94
+ 500: `Failed to refresh token: ${string}` | `Failed to refresh token: Unknown status: ${string}`;
94
95
  };
95
96
  };
96
97
  };
@@ -105,10 +106,10 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
105
106
  query: unknown;
106
107
  headers: unknown;
107
108
  response: {
108
- 200: import("undici-types").Response;
109
+ 200: Response;
109
110
  400: "Cookies are missing" | "Provider is required" | "Invalid provider";
110
111
  401: "Client provider not found";
111
- 500: `${string} - ${string}` | `Unknown error: ${string}`;
112
+ 500: `${string} - ${string}` | `Unknown status: ${string}`;
112
113
  422: {
113
114
  type: "validation";
114
115
  on: string;
@@ -134,10 +135,10 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
134
135
  query: unknown;
135
136
  headers: unknown;
136
137
  response: {
137
- 200: import("undici-types").Response;
138
+ 200: Response;
138
139
  400: "Cookies are missing" | "Provider is required" | "Invalid provider";
139
140
  401: "Client provider not found";
140
- 500: `${string} - ${string}` | `Unknown error: ${string}`;
141
+ 500: `${string} - ${string}` | `Unknown status: ${string}`;
141
142
  422: {
142
143
  type: "validation";
143
144
  on: string;
@@ -160,10 +161,10 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
160
161
  query: unknown;
161
162
  headers: unknown;
162
163
  response: {
163
- 200: import("undici-types").Response;
164
+ 200: Response;
164
165
  400: "Cookies are missing" | "Invalid callback request" | "Invalid state mismatch" | "Code verifier not found and is required";
165
166
  401: "Invalid provider" | "Client provider not found" | "No auth provider found";
166
- 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown error: ${string}`;
167
+ 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown status: ${string}`;
167
168
  422: {
168
169
  type: "validation";
169
170
  on: string;
@@ -187,7 +188,7 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
187
188
  200: Response;
188
189
  400: "Cookies are missing";
189
190
  401: "Invalid provider" | "Client provider not found" | "No auth provider found" | "No user session found";
190
- 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown error: ${string}`;
191
+ 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown status: ${string}`;
191
192
  };
192
193
  };
193
194
  };
@@ -195,10 +196,12 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
195
196
  derive: {};
196
197
  resolve: {};
197
198
  schema: {};
199
+ standaloneSchema: {};
198
200
  }, {
199
201
  derive: {};
200
202
  resolve: {};
201
203
  schema: {};
204
+ standaloneSchema: {};
202
205
  }>>;
203
206
  export * from './types';
204
207
  export { isValidUser } from './typeGuards';
@@ -14,10 +14,11 @@ export declare const profile: <UserType>({ clientProviders, profileRoute, onProf
14
14
  derive: {};
15
15
  resolve: {};
16
16
  }, {
17
+ typebox: {};
17
18
  error: {};
18
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
19
19
  }, {
20
20
  schema: {};
21
+ standaloneSchema: {};
21
22
  macro: {};
22
23
  macroFn: {};
23
24
  parser: {};
@@ -32,7 +33,7 @@ export declare const profile: <UserType>({ clientProviders, profileRoute, onProf
32
33
  200: Response;
33
34
  400: "Cookies are missing";
34
35
  401: "Invalid provider" | "Client provider not found" | "No auth provider found" | "No user session found";
35
- 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown error: ${string}`;
36
+ 500: `${string} - ${string}` | `Failed to validate authorization code: Unknown status: ${string}`;
36
37
  };
37
38
  };
38
39
  };
@@ -40,9 +41,11 @@ export declare const profile: <UserType>({ clientProviders, profileRoute, onProf
40
41
  derive: {};
41
42
  resolve: {};
42
43
  schema: {};
44
+ standaloneSchema: {};
43
45
  }, {
44
46
  derive: {};
45
47
  resolve: {};
46
48
  schema: {};
49
+ standaloneSchema: {};
47
50
  }>;
48
51
  export {};
@@ -9,10 +9,11 @@ export declare const protectRoute: <UserType>() => Elysia<"", {
9
9
  };
10
10
  resolve: {};
11
11
  }, {
12
+ typebox: {};
12
13
  error: {};
13
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
14
14
  }, {
15
15
  schema: import("elysia").MergeSchema<import("elysia").MergeSchema<{}, {}, "">, {}, "">;
16
+ standaloneSchema: {};
16
17
  macro: {};
17
18
  macroFn: {};
18
19
  parser: {};
@@ -20,8 +21,10 @@ export declare const protectRoute: <UserType>() => Elysia<"", {
20
21
  derive: {};
21
22
  resolve: {};
22
23
  schema: {};
24
+ standaloneSchema: {};
23
25
  }, {
24
26
  derive: {};
25
27
  resolve: {};
26
28
  schema: {};
29
+ standaloneSchema: {};
27
30
  }>;
@@ -14,10 +14,11 @@ export declare const refresh: <UserType>({ clientProviders, refreshRoute, onRefr
14
14
  derive: {};
15
15
  resolve: {};
16
16
  }, {
17
+ typebox: {};
17
18
  error: {};
18
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
19
19
  }, {
20
20
  schema: {};
21
+ standaloneSchema: {};
21
22
  macro: {};
22
23
  macroFn: {};
23
24
  parser: {};
@@ -33,7 +34,7 @@ export declare const refresh: <UserType>({ clientProviders, refreshRoute, onRefr
33
34
  400: "Cookies are missing" | "Invalid provider" | "No refresh token found";
34
35
  401: "Client provider not found" | "No auth provider found" | "No user session found";
35
36
  501: "Provider is not refreshable";
36
- 500: `Failed to refresh token: ${string}`;
37
+ 500: `Failed to refresh token: ${string}` | `Failed to refresh token: Unknown status: ${string}`;
37
38
  };
38
39
  };
39
40
  };
@@ -41,9 +42,11 @@ export declare const refresh: <UserType>({ clientProviders, refreshRoute, onRefr
41
42
  derive: {};
42
43
  resolve: {};
43
44
  schema: {};
45
+ standaloneSchema: {};
44
46
  }, {
45
47
  derive: {};
46
48
  resolve: {};
47
49
  schema: {};
50
+ standaloneSchema: {};
48
51
  }>;
49
52
  export {};
@@ -14,10 +14,11 @@ export declare const revoke: <UserType>({ clientProviders, revokeRoute, onRevoca
14
14
  derive: {};
15
15
  resolve: {};
16
16
  }, {
17
+ typebox: {};
17
18
  error: {};
18
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
19
19
  }, {
20
20
  schema: {};
21
+ standaloneSchema: {};
21
22
  macro: {};
22
23
  macroFn: {};
23
24
  parser: {};
@@ -33,7 +34,7 @@ export declare const revoke: <UserType>({ clientProviders, revokeRoute, onRevoca
33
34
  400: "Cookies are missing" | "Invalid provider";
34
35
  401: "Client provider not found" | "No auth provider found" | "No user session found";
35
36
  501: "Provider does not support revocation";
36
- 500: `Failed to revoke token: ${string}`;
37
+ 500: `Failed to revoke token: ${string}` | `Failed to revoke token: Unknown status: ${string}`;
37
38
  };
38
39
  };
39
40
  };
@@ -41,9 +42,11 @@ export declare const revoke: <UserType>({ clientProviders, revokeRoute, onRevoca
41
42
  derive: {};
42
43
  resolve: {};
43
44
  schema: {};
45
+ standaloneSchema: {};
44
46
  }, {
45
47
  derive: {};
46
48
  resolve: {};
47
49
  schema: {};
50
+ standaloneSchema: {};
48
51
  }>;
49
52
  export {};
@@ -8,10 +8,11 @@ export declare const sessionStore: <UserType>() => Elysia<"", {
8
8
  derive: {};
9
9
  resolve: {};
10
10
  }, {
11
- typebox: import("@sinclair/typebox").TModule<{}>;
11
+ typebox: {};
12
12
  error: {};
13
13
  }, {
14
14
  schema: {};
15
+ standaloneSchema: {};
15
16
  macro: {};
16
17
  macroFn: {};
17
18
  parser: {};
@@ -19,8 +20,10 @@ export declare const sessionStore: <UserType>() => Elysia<"", {
19
20
  derive: {};
20
21
  resolve: {};
21
22
  schema: {};
23
+ standaloneSchema: {};
22
24
  }, {
23
25
  derive: {};
24
26
  resolve: {};
25
27
  schema: {};
28
+ standaloneSchema: {};
26
29
  }>;
@@ -12,10 +12,11 @@ export declare const signout: <UserType>({ signoutRoute, onSignOut }: SignOutPro
12
12
  derive: {};
13
13
  resolve: {};
14
14
  }, {
15
+ typebox: {};
15
16
  error: {};
16
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
17
17
  }, {
18
18
  schema: {};
19
+ standaloneSchema: {};
19
20
  macro: {};
20
21
  macroFn: {};
21
22
  parser: {};
@@ -47,9 +48,11 @@ export declare const signout: <UserType>({ signoutRoute, onSignOut }: SignOutPro
47
48
  derive: {};
48
49
  resolve: {};
49
50
  schema: {};
51
+ standaloneSchema: {};
50
52
  }, {
51
53
  derive: {};
52
54
  resolve: {};
53
55
  schema: {};
56
+ standaloneSchema: {};
54
57
  }>;
55
58
  export {};
@@ -4,7 +4,7 @@ type StatusProps<UserType> = {
4
4
  statusRoute?: RouteString;
5
5
  onStatus: OnStatus<UserType>;
6
6
  };
7
- export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps<UserType>) => Elysia<"", {
7
+ export declare const userStatus: <UserType>({ statusRoute, onStatus }: StatusProps<UserType>) => Elysia<"", {
8
8
  decorator: {};
9
9
  store: {
10
10
  session: import("./types").SessionRecord<UserType>;
@@ -12,10 +12,11 @@ export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps<U
12
12
  derive: {};
13
13
  resolve: {};
14
14
  }, {
15
+ typebox: {};
15
16
  error: {};
16
- typebox: import("@sinclair/typebox").TModule<{}, {}>;
17
17
  }, {
18
18
  schema: {};
19
+ standaloneSchema: {};
19
20
  macro: {};
20
21
  macroFn: {};
21
22
  parser: {};
@@ -37,9 +38,11 @@ export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps<U
37
38
  derive: {};
38
39
  resolve: {};
39
40
  schema: {};
41
+ standaloneSchema: {};
40
42
  }, {
41
43
  derive: {};
42
44
  resolve: {};
43
45
  schema: {};
46
+ standaloneSchema: {};
44
47
  }>;
45
48
  export {};
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.14.8",
2
+ "version": "0.15.0",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {
@@ -19,7 +19,7 @@
19
19
  "db:studio": "drizzle-kit studio",
20
20
  "lint": "eslint ./src ./example ./eslint.config.mjs",
21
21
  "typecheck": "bun run tsc --noEmit",
22
- "release": "bun run format && bun run build && bun publish"
22
+ "release": "bun lint --fix && bun run format && bun run build && bun publish"
23
23
  },
24
24
  "keywords": [
25
25
  "authorization",
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "types": "dist/src/index.d.ts",
32
32
  "peerDependencies": {
33
- "elysia": ">= 1.2.25"
33
+ "elysia": ">= 1.3.8"
34
34
  },
35
35
  "dependencies": {
36
36
  "citra": "0.25.7"
@@ -48,7 +48,7 @@
48
48
  "@types/react-dom": "19.1.2",
49
49
  "drizzle-kit": "0.30.6",
50
50
  "drizzle-orm": "0.41.0",
51
- "elysia": "1.2.25",
51
+ "elysia": "1.3.8",
52
52
  "eslint": "9.26.0",
53
53
  "eslint-plugin-absolute": "0.0.3",
54
54
  "eslint-plugin-import": "2.31.0",