@aura-stack/auth 0.1.0-rc.6 → 0.1.0-rc.7

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.
@@ -1,9 +1,7 @@
1
1
  import 'zod/v4';
2
- import '../jose.js';
2
+ import '@aura-stack/jose/jose';
3
3
  import '../schemas.js';
4
- import '@aura-stack/router';
5
4
  import 'cookie';
6
5
  export { LiteralUnion, Prettify } from './utility.js';
7
- export { w as AccessTokenError, c as AuthConfig, A as AuthRuntimeConfig, v as AuthorizationError, C as CookieConfig, a as CookieConfigInternal, b as CookieName, t as CookieStrategyOptions, E as ErrorType, H as HostCookie, p as JWTStandardClaims, J as JoseInstance, u as OAuthError, O as OAuthProvider, d as OAuthProviderConfig, e as OAuthProviderCredentials, R as RouterGlobalContext, q as SecureCookie, S as Session, r as StandardCookie, T as TokenRevocationError, U as User } from '../index-CKVRbv5V.js';
8
- import '@aura-stack/jose/jose';
6
+ export { y as AccessTokenError, c as AuthConfig, d as AuthInstance, A as AuthRuntimeConfig, w as AuthorizationError, C as CookieConfig, a as CookieConfigInternal, b as CookieName, u as CookieStrategyOptions, E as ErrorType, H as HostCookie, q as JWTStandardClaims, J as JoseInstance, v as OAuthError, O as OAuthProvider, e as OAuthProviderConfig, f as OAuthProviderCredentials, R as RouterGlobalContext, r as SecureCookie, S as Session, t as StandardCookie, T as TokenRevocationError, U as User } from '../index-DpfbvTZ_.js';
9
7
  import 'zod/v4/core';
@@ -1,10 +1,8 @@
1
- import { R as RouterGlobalContext } from '../index-CKVRbv5V.js';
1
+ import { R as RouterGlobalContext } from '../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import './utility.js';
10
8
 
@@ -1,6 +1,10 @@
1
1
  type Prettify<T> = {
2
2
  [K in keyof T]: T[K];
3
- } & {};
4
- type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
3
+ } & {
4
+ __aura_auth_prettify_brand?: never;
5
+ };
6
+ type LiteralUnion<T extends U, U = string> = (T | (U & Record<never, never>)) & {
7
+ __aura_auth_literal_union_brand?: never;
8
+ };
5
9
 
6
10
  export type { LiteralUnion, Prettify };
@@ -1,10 +1,8 @@
1
- import { e as OAuthProviderCredentials } from '../../index-CKVRbv5V.js';
1
+ import { f as OAuthProviderCredentials } from '../../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../../@types/utility.js';
10
8
 
@@ -1,7 +1,6 @@
1
1
  import * as _aura_stack_router from '@aura-stack/router';
2
- import { A as AuthRuntimeConfig } from '../../index-CKVRbv5V.js';
2
+ import { A as AuthRuntimeConfig } from '../../index-DpfbvTZ_.js';
3
3
  import 'zod/v4';
4
- import '../../jose.js';
5
4
  import '@aura-stack/jose/jose';
6
5
  import '../../schemas.js';
7
6
  import 'zod/v4/core';
@@ -1,10 +1,8 @@
1
- import { e as OAuthProviderCredentials, U as User } from '../../index-CKVRbv5V.js';
1
+ import { f as OAuthProviderCredentials, U as User } from '../../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../../@types/utility.js';
10
8
 
@@ -4,9 +4,8 @@ export { sessionAction } from './session/session.js';
4
4
  export { signOutAction } from './signOut/signOut.js';
5
5
  export { csrfTokenAction } from './csrfToken/csrfToken.js';
6
6
  import '@aura-stack/router';
7
- import '../index-CKVRbv5V.js';
7
+ import '../index-DpfbvTZ_.js';
8
8
  import 'zod/v4';
9
- import '../jose.js';
10
9
  import '@aura-stack/jose/jose';
11
10
  import '../schemas.js';
12
11
  import 'zod/v4/core';
@@ -1,10 +1,8 @@
1
- import { e as OAuthProviderCredentials } from '../../index-CKVRbv5V.js';
1
+ import { f as OAuthProviderCredentials } from '../../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../../@types/utility.js';
10
8
 
@@ -1,7 +1,6 @@
1
1
  import * as _aura_stack_router from '@aura-stack/router';
2
- import { A as AuthRuntimeConfig } from '../../index-CKVRbv5V.js';
2
+ import { A as AuthRuntimeConfig } from '../../index-DpfbvTZ_.js';
3
3
  import 'zod/v4';
4
- import '../../jose.js';
5
4
  import '@aura-stack/jose/jose';
6
5
  import '../../schemas.js';
7
6
  import 'zod/v4/core';
package/dist/cookie.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  import { SerializeOptions } from 'cookie';
2
2
  export { parse } from 'cookie';
3
3
  import { JWTPayload } from '@aura-stack/jose/jose';
4
- import { C as CookieConfig, a as CookieConfigInternal, b as CookieName, A as AuthRuntimeConfig } from './index-CKVRbv5V.js';
4
+ import { C as CookieConfig, a as CookieConfigInternal, b as CookieName, A as AuthRuntimeConfig } from './index-DpfbvTZ_.js';
5
5
  import { LiteralUnion } from './@types/utility.js';
6
6
  import 'zod/v4';
7
- import './jose.js';
8
7
  import './schemas.js';
9
8
  import 'zod/v4/core';
10
- import '@aura-stack/router';
11
9
 
12
10
  /**
13
11
  * Prefix for all cookies set by Aura Auth.
package/dist/error.d.ts CHANGED
@@ -1,11 +1,9 @@
1
- import { E as ErrorType } from './index-CKVRbv5V.js';
1
+ import { E as ErrorType } from './index-DpfbvTZ_.js';
2
2
  import { LiteralUnion } from './@types/utility.js';
3
3
  import 'zod/v4';
4
- import './jose.js';
5
4
  import '@aura-stack/jose/jose';
6
5
  import './schemas.js';
7
6
  import 'zod/v4/core';
8
- import '@aura-stack/router';
9
7
  import 'cookie';
10
8
 
11
9
  /**
@@ -1,10 +1,8 @@
1
1
  import { z } from 'zod/v4';
2
- import { createJoseInstance } from './jose.js';
2
+ import { JWTPayload } from '@aura-stack/jose/jose';
3
3
  import { OAuthAuthorizationErrorResponse, OAuthAccessTokenErrorResponse } from './schemas.js';
4
- import { Prettify, RoutePattern } from '@aura-stack/router';
5
4
  import { SerializeOptions } from 'cookie';
6
- import { LiteralUnion } from './@types/utility.js';
7
- import { JWTPayload } from '@aura-stack/jose/jose';
5
+ import { LiteralUnion, Prettify } from './@types/utility.js';
8
6
 
9
7
  /**
10
8
  * @see [X - Get my User](https://docs.x.com/x-api/users/get-my-user)
@@ -474,7 +472,7 @@ interface AuthConfig {
474
472
  /**
475
473
  * Base path for all authentication routes. Default is `/auth`.
476
474
  */
477
- basePath?: RoutePattern;
475
+ basePath?: `/${string}`;
478
476
  /**
479
477
  * Enable trusted proxy headers for scenarios where the application is behind a reverse proxy or load balancer.
480
478
  * This setting allows Aura Auth to correctly interpret headers like `X-Forwarded-For` and `X-Forwarded-Proto`
@@ -491,11 +489,17 @@ interface AuthConfig {
491
489
  */
492
490
  trustedProxyHeaders?: boolean;
493
491
  }
494
- type JoseInstance = ReturnType<typeof createJoseInstance>;
492
+ interface JoseInstance {
493
+ decodeJWT: (token: string) => Promise<JWTPayload>;
494
+ encodeJWT: (payload: JWTPayload) => Promise<string>;
495
+ signJWS: (payload: JWTPayload) => Promise<string>;
496
+ verifyJWS: (payload: string) => Promise<JWTPayload>;
497
+ }
495
498
  /**
496
499
  * Internal runtime configuration used within Aura Auth after initialization.
497
500
  * All optional fields from AuthConfig are resolved to their default values.
498
501
  * @internal
502
+ * @todo: is this needed?
499
503
  */
500
504
  interface AuthRuntimeConfig {
501
505
  oauth: Record<LiteralUnion<BuiltInOAuthProvider>, OAuthProviderCredentials>;
@@ -505,11 +509,18 @@ interface AuthRuntimeConfig {
505
509
  }
506
510
  interface RouterGlobalContext {
507
511
  oauth: Record<LiteralUnion<BuiltInOAuthProvider>, OAuthProviderCredentials>;
512
+ cookies: CookieConfigInternal;
508
513
  jose: JoseInstance;
509
514
  basePath: string;
510
- cookies: CookieConfig;
511
515
  trustedProxyHeaders: boolean;
512
516
  }
517
+ interface AuthInstance {
518
+ handlers: {
519
+ GET: (request: Request) => Response | Promise<Response>;
520
+ POST: (request: Request) => Response | Promise<Response>;
521
+ };
522
+ jose: JoseInstance;
523
+ }
513
524
  /**
514
525
  * Base OAuth error response structure.
515
526
  */
@@ -534,4 +545,4 @@ type AccessTokenError = OAuthError<z.infer<typeof OAuthAccessTokenErrorResponse>
534
545
  type TokenRevocationError = OAuthError<"invalid_session_token" | "invalid_csrf_token" | "invalid_redirect_to">;
535
546
  type ErrorType = AuthorizationError["error"] | AccessTokenError["error"] | TokenRevocationError["error"];
536
547
 
537
- export { type AuthRuntimeConfig as A, type BitbucketProfile as B, type CookieConfig as C, type DiscordProfile as D, type ErrorType as E, type FigmaProfile as F, type GitLabProfile as G, type HostCookie as H, type JoseInstance as J, type Nameplate as N, type OAuthProvider as O, type RouterGlobalContext as R, type Session as S, type TokenRevocationError as T, type User as U, type XProfile as X, type CookieConfigInternal as a, type CookieName as b, type AuthConfig as c, type OAuthProviderConfig as d, type OAuthProviderCredentials as e, type SpotifyProfile as f, gitlab as g, discord as h, figma as i, bitbucket as j, type GitHubProfile as k, github as l, builtInOAuthProviders as m, createBuiltInOAuthProviders as n, type BuiltInOAuthProvider as o, type JWTStandardClaims as p, type SecureCookie as q, type StandardCookie as r, spotify as s, type CookieStrategyOptions as t, type OAuthError as u, type AuthorizationError as v, type AccessTokenError as w, x };
548
+ export { type AuthRuntimeConfig as A, type BitbucketProfile as B, type CookieConfig as C, type DiscordProfile as D, type ErrorType as E, type FigmaProfile as F, type GitLabProfile as G, type HostCookie as H, type JoseInstance as J, type Nameplate as N, type OAuthProvider as O, type RouterGlobalContext as R, type Session as S, type TokenRevocationError as T, type User as U, type XProfile as X, type CookieConfigInternal as a, type CookieName as b, type AuthConfig as c, type AuthInstance as d, type OAuthProviderConfig as e, type OAuthProviderCredentials as f, type SpotifyProfile as g, gitlab as h, discord as i, figma as j, bitbucket as k, type GitHubProfile as l, github as m, builtInOAuthProviders as n, createBuiltInOAuthProviders as o, type BuiltInOAuthProvider as p, type JWTStandardClaims as q, type SecureCookie as r, spotify as s, type StandardCookie as t, type CookieStrategyOptions as u, type OAuthError as v, type AuthorizationError as w, x, type AccessTokenError as y };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,7 @@
1
- import { JWTPayload } from '@aura-stack/jose/jose';
2
- import * as _aura_stack_router from '@aura-stack/router';
3
- import { c as AuthConfig } from './index-CKVRbv5V.js';
4
- export { C as CookieConfig, E as ErrorType, J as JoseInstance, O as OAuthProvider, d as OAuthProviderConfig, e as OAuthProviderCredentials, S as Session, U as User } from './index-CKVRbv5V.js';
1
+ import { c as AuthConfig, d as AuthInstance } from './index-DpfbvTZ_.js';
2
+ export { C as CookieConfig, E as ErrorType, J as JoseInstance, O as OAuthProvider, e as OAuthProviderConfig, f as OAuthProviderCredentials, S as Session, U as User } from './index-DpfbvTZ_.js';
5
3
  import 'zod/v4';
6
- import './jose.js';
4
+ import '@aura-stack/jose/jose';
7
5
  import './schemas.js';
8
6
  import 'zod/v4/core';
9
7
  import 'cookie';
@@ -31,14 +29,6 @@ import './@types/utility.js';
31
29
  * }]
32
30
  * })
33
31
  */
34
- declare const createAuth: (authConfig: AuthConfig) => {
35
- handlers: _aura_stack_router.GetHttpHandlers<[_aura_stack_router.RouteEndpoint<"GET", "/signIn/:oauth", {}>, _aura_stack_router.RouteEndpoint<"GET", "/callback/:oauth", {}>, _aura_stack_router.RouteEndpoint<"GET", "/session", {}>, _aura_stack_router.RouteEndpoint<"POST", "/signOut", {}>, _aura_stack_router.RouteEndpoint<"GET", "/csrfToken", {}>]>;
36
- jose: {
37
- decodeJWT: (token: string) => Promise<JWTPayload>;
38
- encodeJWT: (payload: JWTPayload) => Promise<string>;
39
- signJWS: (payload: JWTPayload) => Promise<string>;
40
- verifyJWS: (payload: string) => Promise<JWTPayload>;
41
- };
42
- };
32
+ declare const createAuth: (authConfig: AuthConfig) => AuthInstance;
43
33
 
44
- export { AuthConfig, createAuth };
34
+ export { AuthConfig, AuthInstance, createAuth };
@@ -1,9 +1,7 @@
1
- export { B as BitbucketProfile, j as bitbucket } from '../index-CKVRbv5V.js';
1
+ export { B as BitbucketProfile, k as bitbucket } from '../index-DpfbvTZ_.js';
2
2
  import '../@types/utility.js';
3
3
  import 'zod/v4';
4
- import '../jose.js';
5
4
  import '@aura-stack/jose/jose';
6
5
  import '../schemas.js';
7
6
  import 'zod/v4/core';
8
- import '@aura-stack/router';
9
7
  import 'cookie';
@@ -1,9 +1,7 @@
1
- export { D as DiscordProfile, N as Nameplate, h as discord } from '../index-CKVRbv5V.js';
1
+ export { D as DiscordProfile, N as Nameplate, i as discord } from '../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../@types/utility.js';
@@ -1,9 +1,7 @@
1
- export { F as FigmaProfile, i as figma } from '../index-CKVRbv5V.js';
1
+ export { F as FigmaProfile, j as figma } from '../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../@types/utility.js';
@@ -1,9 +1,7 @@
1
- export { k as GitHubProfile, l as github } from '../index-CKVRbv5V.js';
1
+ export { l as GitHubProfile, m as github } from '../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../@types/utility.js';
@@ -1,9 +1,7 @@
1
- export { G as GitLabProfile, g as gitlab } from '../index-CKVRbv5V.js';
1
+ export { G as GitLabProfile, h as gitlab } from '../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../@types/utility.js';
@@ -1,9 +1,7 @@
1
- export { B as BitbucketProfile, o as BuiltInOAuthProvider, D as DiscordProfile, F as FigmaProfile, k as GitHubProfile, G as GitLabProfile, N as Nameplate, f as SpotifyProfile, X as XProfile, j as bitbucket, m as builtInOAuthProviders, n as createBuiltInOAuthProviders, h as discord, i as figma, l as github, g as gitlab, s as spotify, x } from '../index-CKVRbv5V.js';
1
+ export { B as BitbucketProfile, p as BuiltInOAuthProvider, D as DiscordProfile, F as FigmaProfile, l as GitHubProfile, G as GitLabProfile, N as Nameplate, g as SpotifyProfile, X as XProfile, k as bitbucket, n as builtInOAuthProviders, o as createBuiltInOAuthProviders, i as discord, j as figma, m as github, h as gitlab, s as spotify, x } from '../index-DpfbvTZ_.js';
2
2
  import '../@types/utility.js';
3
3
  import 'zod/v4';
4
- import '../jose.js';
5
4
  import '@aura-stack/jose/jose';
6
5
  import '../schemas.js';
7
6
  import 'zod/v4/core';
8
- import '@aura-stack/router';
9
7
  import 'cookie';
@@ -1,9 +1,7 @@
1
- export { f as SpotifyProfile, s as spotify } from '../index-CKVRbv5V.js';
1
+ export { g as SpotifyProfile, s as spotify } from '../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../@types/utility.js';
package/dist/oauth/x.d.ts CHANGED
@@ -1,9 +1,7 @@
1
- export { X as XProfile, x } from '../index-CKVRbv5V.js';
1
+ export { X as XProfile, x } from '../index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import '../jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import '../schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import '../@types/utility.js';
package/dist/secure.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import { A as AuthRuntimeConfig } from './index-CKVRbv5V.js';
1
+ import { A as AuthRuntimeConfig } from './index-DpfbvTZ_.js';
2
2
  import 'zod/v4';
3
- import './jose.js';
4
3
  import '@aura-stack/jose/jose';
5
4
  import './schemas.js';
6
5
  import 'zod/v4/core';
7
- import '@aura-stack/router';
8
6
  import 'cookie';
9
7
  import './@types/utility.js';
10
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aura-stack/auth",
3
- "version": "0.1.0-rc.6",
3
+ "version": "0.1.0-rc.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Core auth for @aura-stack/auth",