@xylex-group/athena 2.12.1 → 2.14.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.
- package/LICENSE +21 -21
- package/README.md +1190 -1184
- package/bin/athena-js.js +104 -76
- package/dist/admin.cjs +45 -0
- package/dist/admin.cjs.map +1 -0
- package/dist/admin.d.cts +64 -0
- package/dist/admin.d.ts +64 -0
- package/dist/admin.js +41 -0
- package/dist/admin.js.map +1 -0
- package/dist/athena-auth-url-oLux_57a.d.cts +377 -0
- package/dist/athena-auth-url-oLux_57a.d.ts +377 -0
- package/dist/browser.cjs +580 -96
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +12 -10
- package/dist/browser.d.ts +12 -10
- package/dist/browser.js +580 -96
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +690 -91
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +14 -5
- package/dist/cli/index.d.ts +14 -5
- package/dist/cli/index.js +690 -92
- package/dist/cli/index.js.map +1 -1
- package/dist/{client-CMtx5P4D.d.cts → client-uthENhaf.d.ts} +346 -1488
- package/dist/{client-Dre8H24u.d.ts → client-wU2J9yqb.d.cts} +346 -1488
- package/dist/cookies.cjs +18 -0
- package/dist/cookies.cjs.map +1 -1
- package/dist/cookies.d.cts +2 -1
- package/dist/cookies.d.ts +2 -1
- package/dist/cookies.js +17 -1
- package/dist/cookies.js.map +1 -1
- package/dist/{index-CVcQCGyG.d.ts → index-CFL9xbFR.d.cts} +2 -0
- package/dist/{index-CVcQCGyG.d.cts → index-UKJpunc6.d.ts} +2 -0
- package/dist/index.cjs +648 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.js +648 -97
- package/dist/index.js.map +1 -1
- package/dist/{model-form-DfTi8-D1.d.cts → model-form-BE1_Bmdd.d.cts} +2 -2
- package/dist/{model-form-CU0mWrF9.d.ts → model-form-DcH3R7WD.d.ts} +2 -2
- package/dist/{module-DBGmbIuh.d.ts → module-Ca3_OQqR.d.ts} +12 -9
- package/dist/{module-GoijrBXV.d.cts → module-DFGZXCtt.d.cts} +12 -9
- package/dist/next/client.cjs +992 -89
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.d.cts +7 -4
- package/dist/next/client.d.ts +7 -4
- package/dist/next/client.js +970 -90
- package/dist/next/client.js.map +1 -1
- package/dist/next/server.cjs +832 -89
- package/dist/next/server.cjs.map +1 -1
- package/dist/next/server.d.cts +81 -5
- package/dist/next/server.d.ts +81 -5
- package/dist/next/server.js +820 -90
- package/dist/next/server.js.map +1 -1
- package/dist/organization.cjs +72 -0
- package/dist/organization.cjs.map +1 -0
- package/dist/organization.d.cts +43 -0
- package/dist/organization.d.ts +43 -0
- package/dist/organization.js +70 -0
- package/dist/organization.js.map +1 -0
- package/dist/payload-BbSCmILD.d.ts +219 -0
- package/dist/payload-zXIwKTQf.d.cts +219 -0
- package/dist/{pipeline-c7Gdm0qv.d.cts → pipeline-CwQoD5G9.d.cts} +1 -1
- package/dist/{pipeline-DrjU2vNA.d.ts → pipeline-DqwehoQV.d.ts} +1 -1
- package/dist/react.cjs +2 -13
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +26 -7
- package/dist/react.d.ts +26 -7
- package/dist/react.js +2 -13
- package/dist/react.js.map +1 -1
- package/dist/session-cookie-detection-BqOp9mO6.d.cts +46 -0
- package/dist/session-cookie-detection-BqOp9mO6.d.ts +46 -0
- package/dist/social-providers.cjs +4198 -0
- package/dist/social-providers.cjs.map +1 -0
- package/dist/social-providers.d.cts +4948 -0
- package/dist/social-providers.d.ts +4948 -0
- package/dist/social-providers.js +4126 -0
- package/dist/social-providers.js.map +1 -0
- package/dist/{types-kPaHUqUa.d.ts → types-6H575ITc.d.cts} +50 -2
- package/dist/{types-DRRb0Fd0.d.ts → types-C1swabT5.d.ts} +3 -3
- package/dist/{types-Bez4HSbI.d.cts → types-CD6K05JQ.d.ts} +50 -2
- package/dist/{types-BRUHGXo2.d.ts → types-YQUR7wu0.d.cts} +3 -3
- package/dist/{types-BRUHGXo2.d.cts → types-YQUR7wu0.d.ts} +3 -3
- package/dist/{types-BLizCLd1.d.cts → types-dHnjluBC.d.cts} +3 -3
- package/dist/types-eAKAh71s.d.cts +1476 -0
- package/dist/types-eAKAh71s.d.ts +1476 -0
- package/dist/utils.cjs +438 -15
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +76 -11
- package/dist/utils.d.ts +76 -11
- package/dist/utils.js +390 -16
- package/dist/utils.js.map +1 -1
- package/package.json +29 -1
- package/dist/shared-DZSGAmXs.d.cts +0 -35
- package/dist/shared-MMnVBBfy.d.ts +0 -35
package/dist/next/server.d.cts
CHANGED
|
@@ -1,7 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import '../
|
|
4
|
-
|
|
1
|
+
import { al as AthenaClientSessionLike, aX as AthenaSdkClientWithStorage, aW as AthenaSdkClientWithAuth } from '../client-wU2J9yqb.cjs';
|
|
2
|
+
import { ae as AthenaAuthSessionResponse } from '../types-eAKAh71s.cjs';
|
|
3
|
+
import { i as AthenaAuthSessionBridgeOptions, j as AthenaAuthSessionBridgePathOptions, A as AthenaAdapterBaseOptions, k as AthenaServerRequestOptions, a as AthenaAdapterExperimentalOptions } from '../payload-zXIwKTQf.cjs';
|
|
4
|
+
export { b as ATHENA_AUTH_SESSION_BRIDGE_ROUTE, c as ATHENA_AUTH_SESSION_COOKIE_NAME, d as ATHENA_AUTH_SESSION_COOKIE_NAMES, e as AthenaAuthSessionBridgeClientOptions, f as AthenaAuthSessionBridgePayload, g as AthenaAuthSessionBridgeSource, h as clearAthenaAuthSessionOnAppHost, p as persistAthenaAuthSessionOnAppHost, r as resolveSessionBridgePayload } from '../payload-zXIwKTQf.cjs';
|
|
5
|
+
export { S as SESSION_COOKIE_PATTERNS, h as hasAuthSessionCookie } from '../session-cookie-detection-BqOp9mO6.cjs';
|
|
6
|
+
import '../types-YQUR7wu0.cjs';
|
|
7
|
+
import '../types-6H575ITc.cjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Handle bridge `POST` — set an httpOnly session cookie from JSON body.
|
|
11
|
+
*
|
|
12
|
+
* Expected body: `{ "token": string, "expiresAt"?: string }`.
|
|
13
|
+
*
|
|
14
|
+
* @param request - Incoming request (JSON body)
|
|
15
|
+
* @param options - Cookie / route configuration
|
|
16
|
+
* @returns `200` on success, `400` when token is missing
|
|
17
|
+
*/
|
|
18
|
+
declare function handleAthenaAuthSessionBridgePost(request: Request, options?: AthenaAuthSessionBridgeOptions): Promise<Response>;
|
|
19
|
+
/**
|
|
20
|
+
* Handle bridge `DELETE` — clear bridged session cookie name variants.
|
|
21
|
+
*
|
|
22
|
+
* @param request - Incoming request (used for Secure detection)
|
|
23
|
+
* @param options - Cookie / route configuration
|
|
24
|
+
* @returns `200` with clear `Set-Cookie` headers
|
|
25
|
+
*/
|
|
26
|
+
declare function handleAthenaAuthSessionBridgeDelete(request: Request, options?: AthenaAuthSessionBridgeOptions): Response;
|
|
27
|
+
/**
|
|
28
|
+
* Create dedicated App Router handlers for the session bridge.
|
|
29
|
+
*
|
|
30
|
+
* Drop into a route file with no additional wiring:
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* // app/api/athena-auth/session/route.ts
|
|
35
|
+
* import { createAthenaAuthSessionBridgeHandlers } from '@xylex-group/athena/next/server'
|
|
36
|
+
*
|
|
37
|
+
* export const { POST, DELETE } = createAthenaAuthSessionBridgeHandlers()
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param options - Optional cookie name, path, SameSite, Secure overrides
|
|
41
|
+
* @returns Object with `POST` and `DELETE` route handlers
|
|
42
|
+
*/
|
|
43
|
+
declare function createAthenaAuthSessionBridgeHandlers(options?: AthenaAuthSessionBridgeOptions): {
|
|
44
|
+
POST: (request: Request) => Promise<Response>;
|
|
45
|
+
DELETE: (request: Request) => Response;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Whether this request should be handled as a session bridge call.
|
|
49
|
+
*
|
|
50
|
+
* Returns true when:
|
|
51
|
+
* - the pathname equals the configured `route`, or
|
|
52
|
+
* - the final path segment is listed in `matchPaths` (default `session`)
|
|
53
|
+
*
|
|
54
|
+
* @param request - Incoming request
|
|
55
|
+
* @param options - Route + matchPaths configuration
|
|
56
|
+
*/
|
|
57
|
+
declare function isAthenaAuthSessionBridgePath(request: Request, options?: AthenaAuthSessionBridgePathOptions): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Create catch-all / `[path]` handlers that only service session-bridge paths.
|
|
60
|
+
*
|
|
61
|
+
* Non-matching paths return `404` with `{ error: 'Not found' }` so you can
|
|
62
|
+
* mount under `/api/auth/[...path]` without implementing a full auth proxy.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* // app/api/auth/[...path]/route.ts
|
|
67
|
+
* import { createAthenaAuthSessionBridgePathHandlers } from '@xylex-group/athena/next/server'
|
|
68
|
+
*
|
|
69
|
+
* export const { POST, DELETE } = createAthenaAuthSessionBridgePathHandlers({
|
|
70
|
+
* route: '/api/auth/session',
|
|
71
|
+
* })
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @param options - Bridge options plus `matchPaths`
|
|
75
|
+
* @returns Object with `POST` and `DELETE` route handlers
|
|
76
|
+
*/
|
|
77
|
+
declare function createAthenaAuthSessionBridgePathHandlers(options?: AthenaAuthSessionBridgePathOptions): {
|
|
78
|
+
POST: (request: Request) => Promise<Response>;
|
|
79
|
+
DELETE: (request: Request) => Response;
|
|
80
|
+
};
|
|
5
81
|
|
|
6
82
|
interface AthenaServerClientOptions extends AthenaAdapterBaseOptions, AthenaServerRequestOptions {
|
|
7
83
|
session?: AthenaClientSessionLike | AthenaAuthSessionResponse | null;
|
|
@@ -50,4 +126,4 @@ declare function resolveAthenaServerContext(options: AthenaServerContextOptionsW
|
|
|
50
126
|
declare function resolveAthenaServerContext(options: AthenaServerContextOptionsWithTypecheckedColumns): Promise<AthenaResolvedServerContext<AthenaSdkClientWithAuth<true>>>;
|
|
51
127
|
declare function resolveAthenaServerContext(options?: AthenaServerContextOptions): Promise<AthenaResolvedServerContext<AthenaSdkClientWithAuth<false>>>;
|
|
52
128
|
|
|
53
|
-
export { type AthenaResolvedServerContext, type AthenaServerClientOptions, type AthenaServerContextOptions, createAthenaServerClient, resolveAthenaServerContext };
|
|
129
|
+
export { AthenaAuthSessionBridgeOptions, AthenaAuthSessionBridgePathOptions, type AthenaResolvedServerContext, type AthenaServerClientOptions, type AthenaServerContextOptions, createAthenaAuthSessionBridgeHandlers, createAthenaAuthSessionBridgePathHandlers, createAthenaServerClient, handleAthenaAuthSessionBridgeDelete, handleAthenaAuthSessionBridgePost, isAthenaAuthSessionBridgePath, resolveAthenaServerContext };
|
package/dist/next/server.d.ts
CHANGED
|
@@ -1,7 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import '../
|
|
4
|
-
|
|
1
|
+
import { al as AthenaClientSessionLike, aX as AthenaSdkClientWithStorage, aW as AthenaSdkClientWithAuth } from '../client-uthENhaf.js';
|
|
2
|
+
import { ae as AthenaAuthSessionResponse } from '../types-eAKAh71s.js';
|
|
3
|
+
import { i as AthenaAuthSessionBridgeOptions, j as AthenaAuthSessionBridgePathOptions, A as AthenaAdapterBaseOptions, k as AthenaServerRequestOptions, a as AthenaAdapterExperimentalOptions } from '../payload-BbSCmILD.js';
|
|
4
|
+
export { b as ATHENA_AUTH_SESSION_BRIDGE_ROUTE, c as ATHENA_AUTH_SESSION_COOKIE_NAME, d as ATHENA_AUTH_SESSION_COOKIE_NAMES, e as AthenaAuthSessionBridgeClientOptions, f as AthenaAuthSessionBridgePayload, g as AthenaAuthSessionBridgeSource, h as clearAthenaAuthSessionOnAppHost, p as persistAthenaAuthSessionOnAppHost, r as resolveSessionBridgePayload } from '../payload-BbSCmILD.js';
|
|
5
|
+
export { S as SESSION_COOKIE_PATTERNS, h as hasAuthSessionCookie } from '../session-cookie-detection-BqOp9mO6.js';
|
|
6
|
+
import '../types-YQUR7wu0.js';
|
|
7
|
+
import '../types-CD6K05JQ.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Handle bridge `POST` — set an httpOnly session cookie from JSON body.
|
|
11
|
+
*
|
|
12
|
+
* Expected body: `{ "token": string, "expiresAt"?: string }`.
|
|
13
|
+
*
|
|
14
|
+
* @param request - Incoming request (JSON body)
|
|
15
|
+
* @param options - Cookie / route configuration
|
|
16
|
+
* @returns `200` on success, `400` when token is missing
|
|
17
|
+
*/
|
|
18
|
+
declare function handleAthenaAuthSessionBridgePost(request: Request, options?: AthenaAuthSessionBridgeOptions): Promise<Response>;
|
|
19
|
+
/**
|
|
20
|
+
* Handle bridge `DELETE` — clear bridged session cookie name variants.
|
|
21
|
+
*
|
|
22
|
+
* @param request - Incoming request (used for Secure detection)
|
|
23
|
+
* @param options - Cookie / route configuration
|
|
24
|
+
* @returns `200` with clear `Set-Cookie` headers
|
|
25
|
+
*/
|
|
26
|
+
declare function handleAthenaAuthSessionBridgeDelete(request: Request, options?: AthenaAuthSessionBridgeOptions): Response;
|
|
27
|
+
/**
|
|
28
|
+
* Create dedicated App Router handlers for the session bridge.
|
|
29
|
+
*
|
|
30
|
+
* Drop into a route file with no additional wiring:
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* // app/api/athena-auth/session/route.ts
|
|
35
|
+
* import { createAthenaAuthSessionBridgeHandlers } from '@xylex-group/athena/next/server'
|
|
36
|
+
*
|
|
37
|
+
* export const { POST, DELETE } = createAthenaAuthSessionBridgeHandlers()
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param options - Optional cookie name, path, SameSite, Secure overrides
|
|
41
|
+
* @returns Object with `POST` and `DELETE` route handlers
|
|
42
|
+
*/
|
|
43
|
+
declare function createAthenaAuthSessionBridgeHandlers(options?: AthenaAuthSessionBridgeOptions): {
|
|
44
|
+
POST: (request: Request) => Promise<Response>;
|
|
45
|
+
DELETE: (request: Request) => Response;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Whether this request should be handled as a session bridge call.
|
|
49
|
+
*
|
|
50
|
+
* Returns true when:
|
|
51
|
+
* - the pathname equals the configured `route`, or
|
|
52
|
+
* - the final path segment is listed in `matchPaths` (default `session`)
|
|
53
|
+
*
|
|
54
|
+
* @param request - Incoming request
|
|
55
|
+
* @param options - Route + matchPaths configuration
|
|
56
|
+
*/
|
|
57
|
+
declare function isAthenaAuthSessionBridgePath(request: Request, options?: AthenaAuthSessionBridgePathOptions): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Create catch-all / `[path]` handlers that only service session-bridge paths.
|
|
60
|
+
*
|
|
61
|
+
* Non-matching paths return `404` with `{ error: 'Not found' }` so you can
|
|
62
|
+
* mount under `/api/auth/[...path]` without implementing a full auth proxy.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* // app/api/auth/[...path]/route.ts
|
|
67
|
+
* import { createAthenaAuthSessionBridgePathHandlers } from '@xylex-group/athena/next/server'
|
|
68
|
+
*
|
|
69
|
+
* export const { POST, DELETE } = createAthenaAuthSessionBridgePathHandlers({
|
|
70
|
+
* route: '/api/auth/session',
|
|
71
|
+
* })
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @param options - Bridge options plus `matchPaths`
|
|
75
|
+
* @returns Object with `POST` and `DELETE` route handlers
|
|
76
|
+
*/
|
|
77
|
+
declare function createAthenaAuthSessionBridgePathHandlers(options?: AthenaAuthSessionBridgePathOptions): {
|
|
78
|
+
POST: (request: Request) => Promise<Response>;
|
|
79
|
+
DELETE: (request: Request) => Response;
|
|
80
|
+
};
|
|
5
81
|
|
|
6
82
|
interface AthenaServerClientOptions extends AthenaAdapterBaseOptions, AthenaServerRequestOptions {
|
|
7
83
|
session?: AthenaClientSessionLike | AthenaAuthSessionResponse | null;
|
|
@@ -50,4 +126,4 @@ declare function resolveAthenaServerContext(options: AthenaServerContextOptionsW
|
|
|
50
126
|
declare function resolveAthenaServerContext(options: AthenaServerContextOptionsWithTypecheckedColumns): Promise<AthenaResolvedServerContext<AthenaSdkClientWithAuth<true>>>;
|
|
51
127
|
declare function resolveAthenaServerContext(options?: AthenaServerContextOptions): Promise<AthenaResolvedServerContext<AthenaSdkClientWithAuth<false>>>;
|
|
52
128
|
|
|
53
|
-
export { type AthenaResolvedServerContext, type AthenaServerClientOptions, type AthenaServerContextOptions, createAthenaServerClient, resolveAthenaServerContext };
|
|
129
|
+
export { AthenaAuthSessionBridgeOptions, AthenaAuthSessionBridgePathOptions, type AthenaResolvedServerContext, type AthenaServerClientOptions, type AthenaServerContextOptions, createAthenaAuthSessionBridgeHandlers, createAthenaAuthSessionBridgePathHandlers, createAthenaServerClient, handleAthenaAuthSessionBridgeDelete, handleAthenaAuthSessionBridgePost, isAthenaAuthSessionBridgePath, resolveAthenaServerContext };
|