@absolutejs/auth 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.
Files changed (32) hide show
  1. package/dist/example/components/AuthOptions.d.ts +1 -0
  2. package/dist/example/components/Example.d.ts +1 -0
  3. package/dist/example/components/Head.d.ts +6 -0
  4. package/dist/example/components/Modal.d.ts +8 -0
  5. package/dist/example/components/Navbar.d.ts +10 -0
  6. package/dist/example/components/NotAuthorized.d.ts +1 -0
  7. package/dist/example/components/Protected.d.ts +1 -0
  8. package/dist/example/db/migrate.d.ts +1 -0
  9. package/dist/example/db/schema.d.ts +248 -0
  10. package/dist/example/hooks/useAuthStatus.d.ts +18 -0
  11. package/dist/example/indexes/ExampleIndex.d.ts +1 -0
  12. package/dist/example/indexes/NotAuthorizedIndex.d.ts +1 -0
  13. package/dist/example/indexes/ProtectedIndex.d.ts +1 -0
  14. package/dist/example/server.d.ts +1 -0
  15. package/dist/example/utils/networking.d.ts +1 -0
  16. package/dist/example/utils/pageUtils.d.ts +2 -0
  17. package/dist/example/utils/styles.d.ts +15 -0
  18. package/dist/example/utils/userUtils.d.ts +19 -0
  19. package/dist/index.js +230 -222
  20. package/dist/{callback.d.ts → src/callback.d.ts} +2 -2
  21. package/dist/{index.d.ts → src/index.d.ts} +6 -6
  22. package/dist/{logout.d.ts → src/logout.d.ts} +1 -1
  23. package/dist/{protectRoute.d.ts → src/protectRoute.d.ts} +3 -3
  24. package/dist/{refresh.d.ts → src/refresh.d.ts} +1 -1
  25. package/dist/{status.d.ts → src/status.d.ts} +3 -3
  26. package/package.json +15 -16
  27. /package/dist/{authorize.d.ts → src/authorize.d.ts} +0 -0
  28. /package/dist/{providers.d.ts → src/providers.d.ts} +0 -0
  29. /package/dist/{revoke.d.ts → src/revoke.d.ts} +0 -0
  30. /package/dist/{sessionStore.d.ts → src/sessionStore.d.ts} +0 -0
  31. /package/dist/{typeGuards.d.ts → src/typeGuards.d.ts} +0 -0
  32. /package/dist/{types.d.ts → src/types.d.ts} +0 -0
@@ -10,13 +10,13 @@ type CallbackProps<UserType> = {
10
10
  export declare const callback: <UserType>({ clientProviders, callbackRoute, onCallback, getUser, createUser }: CallbackProps<UserType>) => Elysia<"", {
11
11
  decorator: {};
12
12
  store: {
13
- session: import("./types").SessionRecord<UserType_1>;
13
+ session: import("./types").SessionRecord<UserType>;
14
14
  };
15
15
  derive: {};
16
16
  resolve: {};
17
17
  }, {
18
18
  error: {};
19
- typebox: import("elysia/dist/types").MergeTypeModule<import("@sinclair/typebox").TModule<{}, {}>, import("@sinclair/typebox").TModule<{}, {}>>;
19
+ typebox: import("@sinclair/typebox").TModule<{}, {}>;
20
20
  }, {
21
21
  schema: {};
22
22
  macro: {};
@@ -4,7 +4,7 @@ import type { AbsoluteAuthProps } from './types';
4
4
  export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callbackRoute, logoutRoute, statusRoute, refreshRoute, revokeRoute, onAuthorize, onCallback, onStatus, onRefresh, onLogout, onRevoke, createUser, getUser }: AbsoluteAuthProps) => Elysia<"", {
5
5
  decorator: {};
6
6
  store: {
7
- session: import("./types").SessionRecord<UserType_1>;
7
+ session: import("./types").SessionRecord<UserType>;
8
8
  };
9
9
  derive: {};
10
10
  resolve: {};
@@ -13,7 +13,7 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
13
13
  OAUTH2_REQUEST_ERROR: OAuth2RequestError;
14
14
  ARCTIC_FETCH_ERROR: ArcticFetchError;
15
15
  };
16
- typebox: import("elysia/dist/types").MergeTypeModule<import("elysia/dist/types").MergeTypeModule<import("elysia/dist/types").MergeTypeModule<import("elysia/dist/types").MergeTypeModule<import("elysia/dist/types").MergeTypeModule<import("elysia/dist/types").MergeTypeModule<import("elysia/dist/types").MergeTypeModule<import("@sinclair/typebox").TModule<{}, {}>, import("@sinclair/typebox").TModule<{}, {}>>, import("@sinclair/typebox").TModule<{}, {}>>, import("elysia/dist/types").MergeTypeModule<import("@sinclair/typebox").TModule<{}, {}>, import("@sinclair/typebox").TModule<{}, {}>>>, import("@sinclair/typebox").TModule<{}, {}>>, import("@sinclair/typebox").TModule<{}, {}>>, import("elysia/dist/types").MergeTypeModule<import("@sinclair/typebox").TModule<{}, {}>, import("@sinclair/typebox").TModule<{}, {}>>>, import("elysia/dist/types").MergeTypeModule<import("@sinclair/typebox").TModule<{}, {}>, import("@sinclair/typebox").TModule<{}, {}>>>;
16
+ typebox: import("@sinclair/typebox").TModule<{}, {}>;
17
17
  }, {
18
18
  schema: {};
19
19
  macro: {};
@@ -27,7 +27,7 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
27
27
  query: unknown;
28
28
  headers: unknown;
29
29
  response: {
30
- 200: import("undici-types").Response;
30
+ 200: Response;
31
31
  500: "Internal Server Error";
32
32
  401: "No auth provider found";
33
33
  };
@@ -57,7 +57,7 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
57
57
  query: unknown;
58
58
  headers: unknown;
59
59
  response: {
60
- 200: import("undici-types").Response;
60
+ 200: Response;
61
61
  500: "Internal Server Error";
62
62
  };
63
63
  };
@@ -70,7 +70,7 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
70
70
  query: unknown;
71
71
  headers: unknown;
72
72
  response: {
73
- 200: import("undici-types").Response;
73
+ 200: Response;
74
74
  500: "Internal Server Error";
75
75
  401: "No auth provider found" | "No refresh token found" | "Provider is not refreshable";
76
76
  };
@@ -120,7 +120,7 @@ export declare const absoluteAuth: <UserType>({ config, authorizeRoute, callback
120
120
  };
121
121
  }, {
122
122
  derive: {
123
- readonly protectRoute: (onAuth: () => Promise<Response>, onAuthFail?: (() => Promise<Response>) | undefined) => Promise<Response | import("elysia/dist/error").ElysiaCustomStatusResponse<401, "No session ID found", 401> | import("elysia/dist/error").ElysiaCustomStatusResponse<401, "No session found", 401>>;
123
+ readonly protectRoute: (onAuth: () => Promise<Response>, onAuthFail?: (() => Promise<Response>) | undefined) => Promise<Response | import("elysia/error").ElysiaCustomStatusResponse<401, "No session ID found", 401> | import("elysia/error").ElysiaCustomStatusResponse<401, "No session found", 401>>;
124
124
  };
125
125
  resolve: {};
126
126
  schema: import("elysia").MergeSchema<{
@@ -25,7 +25,7 @@ export declare const logout: ({ logoutRoute, onLogout }: LogoutProps) => Elysia<
25
25
  query: unknown;
26
26
  headers: unknown;
27
27
  response: {
28
- 200: import("undici-types").Response;
28
+ 200: Response;
29
29
  500: "Internal Server Error";
30
30
  401: "No auth provider found";
31
31
  };
@@ -2,13 +2,13 @@ import Elysia from 'elysia';
2
2
  export declare const protectRoute: <UserType>() => Elysia<"", {
3
3
  decorator: {};
4
4
  store: {
5
- session: import("./types").SessionRecord<UserType_1>;
5
+ session: import("./types").SessionRecord<UserType>;
6
6
  };
7
7
  derive: {};
8
8
  resolve: {};
9
9
  }, {
10
10
  error: {};
11
- typebox: import("elysia/dist/types").MergeTypeModule<import("@sinclair/typebox").TModule<{}, {}>, import("@sinclair/typebox").TModule<{}, {}>>;
11
+ typebox: import("@sinclair/typebox").TModule<{}, {}>;
12
12
  }, {
13
13
  schema: {};
14
14
  macro: {};
@@ -16,7 +16,7 @@ export declare const protectRoute: <UserType>() => Elysia<"", {
16
16
  parser: {};
17
17
  }, {}, {
18
18
  derive: {
19
- readonly protectRoute: (onAuth: () => Promise<Response>, onAuthFail?: () => Promise<Response>) => Promise<Response | import("elysia/dist/error").ElysiaCustomStatusResponse<401, "No session ID found", 401> | import("elysia/dist/error").ElysiaCustomStatusResponse<401, "No session found", 401>>;
19
+ readonly protectRoute: (onAuth: () => Promise<Response>, onAuthFail?: () => Promise<Response>) => Promise<Response | import("elysia/error").ElysiaCustomStatusResponse<401, "No session ID found", 401> | import("elysia/error").ElysiaCustomStatusResponse<401, "No session found", 401>>;
20
20
  };
21
21
  resolve: {};
22
22
  schema: import("elysia").MergeSchema<{}, {}, "">;
@@ -26,7 +26,7 @@ export declare const refresh: ({ clientProviders, refreshRoute, onRefresh }: Ref
26
26
  query: unknown;
27
27
  headers: unknown;
28
28
  response: {
29
- 200: import("undici-types").Response;
29
+ 200: Response;
30
30
  500: "Internal Server Error";
31
31
  401: "No auth provider found" | "No refresh token found" | "Provider is not refreshable";
32
32
  };
@@ -7,13 +7,13 @@ type StatusProps = {
7
7
  export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps) => Elysia<"", {
8
8
  decorator: {};
9
9
  store: {
10
- session: import("./types").SessionRecord<UserType_1>;
10
+ session: import("./types").SessionRecord<UserType>;
11
11
  };
12
12
  derive: {};
13
13
  resolve: {};
14
14
  }, {
15
15
  error: {};
16
- typebox: import("elysia/dist/types").MergeTypeModule<import("@sinclair/typebox").TModule<{}, {}>, import("@sinclair/typebox").TModule<{}, {}>>;
16
+ typebox: import("@sinclair/typebox").TModule<{}, {}>;
17
17
  }, {
18
18
  schema: {};
19
19
  macro: {};
@@ -27,7 +27,7 @@ export declare const status: <UserType>({ statusRoute, onStatus }: StatusProps)
27
27
  query: unknown;
28
28
  headers: unknown;
29
29
  response: {
30
- 200: import("undici-types").Response;
30
+ 200: Response;
31
31
  500: "Internal Server Error";
32
32
  };
33
33
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.1",
2
+ "version": "0.0.3",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {
@@ -10,7 +10,7 @@
10
10
  "license": "CC BY-NC 4.0",
11
11
  "author": "Alex Kahn",
12
12
  "scripts": {
13
- "build": "bun build src/index.ts --outdir dist --minify --splitting && tsc --emitDeclarationOnly --project tsconfig.dts.json",
13
+ "build": "rm -rf dist && bun build src/index.ts --outdir dist --minify --splitting --target=bun && tsc --emitDeclarationOnly --project tsconfig.json",
14
14
  "test": "echo \"Error: no test specified\" && exit 1",
15
15
  "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json}\"",
16
16
  "dev": "bun run --watch example/server.ts",
@@ -25,24 +25,23 @@
25
25
  "elysia",
26
26
  "oauth"
27
27
  ],
28
- "types": "dist/index.d.ts",
28
+ "types": "dist/src/index.d.ts",
29
29
  "dependencies": {
30
- "arctic": "3.0.0",
31
- "elysia": "1.2.9"
30
+ "arctic": "3.6.0",
31
+ "elysia": "1.2.25"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@elysiajs/static": "1.2.0",
35
- "@neondatabase/serverless": "0.10.4",
36
- "@types/bun": "1.1.14",
37
- "@types/react": "19.0.2",
38
- "@types/react-dom": "19.0.2",
39
- "drizzle-kit": "0.28.0",
40
- "drizzle-orm": "0.36.1",
41
- "prettier": "3.4.2",
42
- "react": "19.0.0",
43
- "react-dom": "19.0.0",
44
- "tsup": "8.3.5",
45
- "typescript": "^5.7.2"
35
+ "@neondatabase/serverless": "1.0.0",
36
+ "@types/bun": "1.2.9",
37
+ "@types/react": "19.1.1",
38
+ "@types/react-dom": "19.1.2",
39
+ "drizzle-kit": "0.30.6",
40
+ "drizzle-orm": "0.41.0",
41
+ "prettier": "3.5.3",
42
+ "react": "19.1.0",
43
+ "react-dom": "19.1.0",
44
+ "typescript": "5.8.3"
46
45
  },
47
46
  "module": "dist/index.js",
48
47
  "files": [
File without changes
File without changes
File without changes
File without changes
File without changes