@xylex-group/athena 3.3.0 → 3.5.1

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 (82) hide show
  1. package/README.md +17 -1
  2. package/dist/{athena-request-headers-Lr_m8xCV.d.cts → athena-request-headers-BnFN2mbd.d.cts} +1 -1
  3. package/dist/{athena-request-headers-DzimbvOA.d.ts → athena-request-headers-Dwdkq2WR.d.ts} +1 -1
  4. package/dist/billing.cjs +1 -1
  5. package/dist/billing.cjs.map +1 -1
  6. package/dist/billing.js +1 -1
  7. package/dist/billing.js.map +1 -1
  8. package/dist/browser.cjs +3064 -163
  9. package/dist/browser.cjs.map +1 -1
  10. package/dist/browser.d.cts +10 -10
  11. package/dist/browser.d.ts +10 -10
  12. package/dist/browser.js +3064 -163
  13. package/dist/browser.js.map +1 -1
  14. package/dist/cli/index.cjs +2990 -83
  15. package/dist/cli/index.cjs.map +1 -1
  16. package/dist/cli/index.d.cts +4 -4
  17. package/dist/cli/index.d.ts +4 -4
  18. package/dist/cli/index.js +2990 -83
  19. package/dist/cli/index.js.map +1 -1
  20. package/dist/cloudflare.cjs +12914 -0
  21. package/dist/cloudflare.cjs.map +1 -0
  22. package/dist/cloudflare.d.cts +368 -0
  23. package/dist/cloudflare.d.ts +368 -0
  24. package/dist/cloudflare.js +12885 -0
  25. package/dist/cloudflare.js.map +1 -0
  26. package/dist/cookies.cjs +4 -3
  27. package/dist/cookies.cjs.map +1 -1
  28. package/dist/cookies.js +4 -3
  29. package/dist/cookies.js.map +1 -1
  30. package/dist/env.cjs +1 -1
  31. package/dist/env.cjs.map +1 -1
  32. package/dist/env.js +1 -1
  33. package/dist/env.js.map +1 -1
  34. package/dist/index.cjs +2989 -86
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +10 -10
  37. package/dist/index.d.ts +10 -10
  38. package/dist/index.js +2989 -87
  39. package/dist/index.js.map +1 -1
  40. package/dist/{model-form-3Gr8rkdT.d.cts → model-form-D0ykVVOs.d.cts} +3 -3
  41. package/dist/{model-form-CotpEL7z.d.ts → model-form-U8NVtfSA.d.ts} +3 -3
  42. package/dist/{module-CQmOaDzP.d.cts → module-CMWlJ1z3.d.cts} +4 -4
  43. package/dist/{module-CWkUTcUc.d.ts → module-CZ-wPcf2.d.ts} +4 -4
  44. package/dist/next/client.cjs +3025 -125
  45. package/dist/next/client.cjs.map +1 -1
  46. package/dist/next/client.d.cts +4 -4
  47. package/dist/next/client.d.ts +4 -4
  48. package/dist/next/client.js +3025 -125
  49. package/dist/next/client.js.map +1 -1
  50. package/dist/next/server.cjs +3108 -194
  51. package/dist/next/server.cjs.map +1 -1
  52. package/dist/next/server.d.cts +22 -9
  53. package/dist/next/server.d.ts +22 -9
  54. package/dist/next/server.js +3108 -194
  55. package/dist/next/server.js.map +1 -1
  56. package/dist/{pipeline-BnRKO_Pd.d.cts → pipeline-BCpb4BX1.d.cts} +1 -1
  57. package/dist/{pipeline-sWCmlFqu.d.ts → pipeline-CgmXwMeX.d.ts} +1 -1
  58. package/dist/react.cjs +1 -1
  59. package/dist/react.cjs.map +1 -1
  60. package/dist/react.d.cts +6 -6
  61. package/dist/react.d.ts +6 -6
  62. package/dist/react.js +1 -1
  63. package/dist/react.js.map +1 -1
  64. package/dist/{schema-handlers-VjFDhIMw.d.ts → schema-handlers-CvWqF-dW.d.ts} +1 -1
  65. package/dist/{schema-handlers-BtT_IQFi.d.cts → schema-handlers-Dr8h9Jg-.d.cts} +1 -1
  66. package/dist/social-providers.cjs +1 -1
  67. package/dist/social-providers.cjs.map +1 -1
  68. package/dist/social-providers.js +1 -1
  69. package/dist/social-providers.js.map +1 -1
  70. package/dist/{types-Bltx6iL6.d.cts → types-B2RZPivM.d.cts} +8 -1
  71. package/dist/{types-Bltx6iL6.d.ts → types-B2RZPivM.d.ts} +8 -1
  72. package/dist/{types-BDX8zS7w.d.ts → types-BKklrX4J.d.ts} +2 -2
  73. package/dist/{types-CgCv5o6R.d.cts → types-D5dj1v5Z.d.cts} +1 -1
  74. package/dist/{types-D-Am7YSd.d.cts → types-DqBFwfhn.d.cts} +2 -2
  75. package/dist/{types-B75PdABb.d.ts → types-S-bTMPiM.d.ts} +1 -1
  76. package/dist/utils.cjs.map +1 -1
  77. package/dist/utils.d.cts +2 -2
  78. package/dist/utils.d.ts +2 -2
  79. package/dist/utils.js.map +1 -1
  80. package/dist/{v3-client-G1SLeHRa.d.cts → v3-client-DP-qg82X.d.cts} +300 -4
  81. package/dist/{v3-client-ao8BWQ8v.d.ts → v3-client-OAai_JNs.d.ts} +300 -4
  82. package/package.json +10 -3
@@ -1,16 +1,16 @@
1
1
  import { ad as AthenaAuthSessionResponse } from '../types-BVKpQmfY.cjs';
2
- import { r as AthenaClientModelsInput } from '../types-CgCv5o6R.cjs';
3
- import { ax as AthenaRequestContext, ah as AthenaClientConfig, ag as AthenaClient } from '../v3-client-G1SLeHRa.cjs';
2
+ import { r as AthenaClientModelsInput } from '../types-D5dj1v5Z.cjs';
3
+ import { aA as AthenaRequestContext, ai as AthenaClientConfig, ag as AthenaClient } from '../v3-client-DP-qg82X.cjs';
4
4
  import { OrganizationLike } from '../organization.cjs';
5
5
  export { ActiveOrganizationSessionLike, EnsureActiveOrganizationOptions, EnsureActiveOrganizationResult, ensureActiveOrganization } from '../organization.cjs';
6
6
  import { g as AthenaAuthSessionBridgeOptions, h as AthenaAuthSessionBridgePathOptions } from '../payload-DWI1rw-e.cjs';
7
7
  export { A as ATHENA_AUTH_SESSION_BRIDGE_ROUTE, a as ATHENA_AUTH_SESSION_COOKIE_NAME, b as ATHENA_AUTH_SESSION_COOKIE_NAMES, c as AthenaAuthSessionBridgeClientOptions, d as AthenaAuthSessionBridgePayload, e as AthenaAuthSessionBridgeSource, f as clearAthenaAuthSessionOnAppHost, p as persistAthenaAuthSessionOnAppHost, r as resolveSessionBridgePayload } from '../payload-DWI1rw-e.cjs';
8
8
  export { S as SESSION_COOKIE_PATTERNS, h as hasAuthSessionCookie } from '../session-cookie-detection-BqOp9mO6.cjs';
9
9
  export { A as ATHENA_AUTH_DISABLE_COOKIE_CACHE_QUERY_PARAM, a as ATHENA_AUTH_DISABLE_COOKIE_CACHE_QUERY_VALUE, b as ATHENA_AUTH_GET_SESSION_ABSOLUTE_PATH, c as ATHENA_AUTH_GET_SESSION_PATH, d as ATHENA_AUTH_PATH, e as ATHENA_AUTH_UPSTREAM_ENV_KEYS, f as ATHENA_AUTH_UPSTREAM_URL_ENV_NAMES, g as ATHENA_AUTH_VERIFY_EMAIL_PATH, h as ATHENA_SESSION_DATA_HEADER, i as AUTH_SESSION_PATH, j as AthenaAuthClientBaseUrlOptions, k as AthenaAuthUpstreamEnv, l as AthenaAuthUpstreamEnvKey, D as DEFAULT_ATHENA_AUTH_ORIGIN, m as DEFAULT_ATHENA_AUTH_UPSTREAM_URL, n as DISABLE_COOKIE_CACHE_QUERY_PARAM, o as DISABLE_COOKIE_CACHE_QUERY_VALUE, E as EnvLike, L as LOCAL_DEV_ORIGIN, S as SESSION_DATA_HEADER, p as createFreshSessionLookupUrl, q as isAbsoluteUrl, r as normalizeAthenaAuthBaseUrl, s as readAthenaAuthUpstreamUrlFromEnv, t as resolveAthenaAuthClientBaseUrl, u as resolveAthenaAuthRequestUrl, v as resolveAthenaAuthUpstreamUrl, w as resolveEmailVerificationCallbackUrl } from '../athena-auth-url-C1FbVmN6.cjs';
10
- export { A as ATHENA_AUTH_COOKIE_PREFIXES, a as AUTHENTICATED_REDIRECT_MODE_SET, b as AUTHENTICATED_REDIRECT_VIEW_SET, c as AUTH_DEFAULT_VIEW, d as AUTH_MODE_REDIRECTS, e as AUTH_MODE_SET, f as AUTH_ROUTES, g as AUTH_TWO_FACTOR_SEGMENT, h as AUTH_VIEW_BY_SEGMENT, i as AthenaRequestHeaderOverrideFields, j as AthenaRequestHeaderProfile, k as AuthMode, l as AuthModeRedirects, m as AuthRoutes, n as AuthView, B as BuildAthenaRequestHeadersInput, C as ClearAuthCookiesOptions, R as ResolvedRequestHeaderOverrides, E as applyAthenaApiKeyHeaders, F as applyAthenaAuthContextHeaders, G as applyAthenaPgUriHeaders, o as asNonEmptyString, p as asString, q as buildAthenaGatewayHeaders, r as buildAthenaRequestHeaders, H as buildServiceRequestHeaders, s as clearAuthCookies, t as createAuthModeRedirects, u as createAuthRoutes, I as hasHeaderIgnoreCase, v as isAuthMode, w as readTrimmedString, x as resolveAuthModeRedirect, y as resolveAuthViewFromSegment, J as resolveHeaderValue, K as resolveRequestHeaderOverrides, z as shouldRedirectAuthenticatedAuthMode, D as shouldRedirectAuthenticatedAuthView } from '../athena-request-headers-Lr_m8xCV.cjs';
10
+ export { A as ATHENA_AUTH_COOKIE_PREFIXES, a as AUTHENTICATED_REDIRECT_MODE_SET, b as AUTHENTICATED_REDIRECT_VIEW_SET, c as AUTH_DEFAULT_VIEW, d as AUTH_MODE_REDIRECTS, e as AUTH_MODE_SET, f as AUTH_ROUTES, g as AUTH_TWO_FACTOR_SEGMENT, h as AUTH_VIEW_BY_SEGMENT, i as AthenaRequestHeaderOverrideFields, j as AthenaRequestHeaderProfile, k as AuthMode, l as AuthModeRedirects, m as AuthRoutes, n as AuthView, B as BuildAthenaRequestHeadersInput, C as ClearAuthCookiesOptions, R as ResolvedRequestHeaderOverrides, E as applyAthenaApiKeyHeaders, F as applyAthenaAuthContextHeaders, G as applyAthenaPgUriHeaders, o as asNonEmptyString, p as asString, q as buildAthenaGatewayHeaders, r as buildAthenaRequestHeaders, H as buildServiceRequestHeaders, s as clearAuthCookies, t as createAuthModeRedirects, u as createAuthRoutes, I as hasHeaderIgnoreCase, v as isAuthMode, w as readTrimmedString, x as resolveAuthModeRedirect, y as resolveAuthViewFromSegment, J as resolveHeaderValue, K as resolveRequestHeaderOverrides, z as shouldRedirectAuthenticatedAuthMode, D as shouldRedirectAuthenticatedAuthView } from '../athena-request-headers-BnFN2mbd.cjs';
11
11
  export { G as GetOriginFromHeadersOptions, g as getOriginFromHeaders, i as isDynamicServerUsageError, p as proxyRequestHeaders, r as readEnv, a as requireEnv } from '../proxy-request-headers-pIBSn1Fw.cjs';
12
- export { A as ATHENA_TABLE_SCHEMA_ROUTE, a as AthenaTableCatalogColumn, b as AthenaTableCatalogQueryClient, c as AthenaTableCatalogRelation, d as AthenaTableCatalogResponse, e as AthenaTableCatalogTable, f as AthenaTableSchemaConfig, g as AthenaTableSchemaHandlerOptions, h as AthenaTableShowcaseConfig, F as FetchAthenaTableCatalogOptions, T as TableCatalogColumn, i as TableCatalogRelation, j as TableCatalogResponse, k as TableCatalogTable, l as buildAthenaTableCatalogQueries, m as createAthenaTableSchemaHandlers, n as fetchAthenaTableCatalog, o as fetchTableCatalog, p as handleAthenaTableSchemaPost, q as hasAthenaTableSchemaCredentials, r as isAthenaTableSchemaConfig, s as parseAthenaTableSchemaScope } from '../schema-handlers-BtT_IQFi.cjs';
13
- import '../types-Bltx6iL6.cjs';
12
+ export { A as ATHENA_TABLE_SCHEMA_ROUTE, a as AthenaTableCatalogColumn, b as AthenaTableCatalogQueryClient, c as AthenaTableCatalogRelation, d as AthenaTableCatalogResponse, e as AthenaTableCatalogTable, f as AthenaTableSchemaConfig, g as AthenaTableSchemaHandlerOptions, h as AthenaTableShowcaseConfig, F as FetchAthenaTableCatalogOptions, T as TableCatalogColumn, i as TableCatalogRelation, j as TableCatalogResponse, k as TableCatalogTable, l as buildAthenaTableCatalogQueries, m as createAthenaTableSchemaHandlers, n as fetchAthenaTableCatalog, o as fetchTableCatalog, p as handleAthenaTableSchemaPost, q as hasAthenaTableSchemaCredentials, r as isAthenaTableSchemaConfig, s as parseAthenaTableSchemaScope } from '../schema-handlers-Dr8h9Jg-.cjs';
13
+ import '../types-B2RZPivM.cjs';
14
14
  import '../module-C_ab-MM1.cjs';
15
15
 
16
16
  /**
@@ -195,6 +195,19 @@ declare function parseAthenaSessionDataHeader(raw: string | null | undefined): A
195
195
  */
196
196
  declare function getServerSession(options?: GetServerSessionOptions): Promise<GetServerSessionResult>;
197
197
 
198
+ /**
199
+ * Minimal session shape used to derive gateway identity headers.
200
+ * Accepts full {@link AthenaAuthSessionResponse} or a partial getSession payload.
201
+ */
202
+ type AthenaServerSessionInput = {
203
+ user?: {
204
+ id?: string | null;
205
+ } | null;
206
+ session?: {
207
+ id?: string | null;
208
+ activeOrganizationId?: string | null;
209
+ } | null;
210
+ } | null;
198
211
  /**
199
212
  * Explicit gateway identity for request-scoped server clients.
200
213
  *
@@ -207,7 +220,7 @@ interface AthenaServerScope {
207
220
  organizationId?: string | null;
208
221
  }
209
222
  interface AthenaServerContextOptions extends AthenaServerRequestOptions {
210
- session?: AthenaAuthSessionResponse | null;
223
+ session?: AthenaAuthSessionResponse | AthenaServerSessionInput | null;
211
224
  /**
212
225
  * First-class identity scope. Prefer this over a second `withContext(...)`
213
226
  * call when you already know user/org for the request.
@@ -216,13 +229,13 @@ interface AthenaServerContextOptions extends AthenaServerRequestOptions {
216
229
  }
217
230
  interface AthenaResolvedServerContext {
218
231
  request: AthenaRequestContext;
219
- session: AthenaAuthSessionResponse | null;
232
+ session: AthenaAuthSessionResponse | AthenaServerSessionInput | null;
220
233
  userId: string | null;
221
234
  organizationId: string | null;
222
235
  }
223
236
  declare function resolveAthenaServerContext(options?: AthenaServerContextOptions): Promise<AthenaResolvedServerContext>;
224
237
  type AthenaBaseServerOptions = AthenaServerRequestOptions & {
225
- session?: AthenaAuthSessionResponse | null;
238
+ session?: AthenaAuthSessionResponse | AthenaServerSessionInput | null;
226
239
  scope?: AthenaServerScope;
227
240
  };
228
241
  /**
@@ -258,4 +271,4 @@ type AthenaServerClientConfig<TModels extends AthenaClientModelsInput | undefine
258
271
  */
259
272
  declare function createAthenaServerClient<const TModels extends AthenaClientModelsInput | undefined = undefined>(options: AthenaServerClientConfig<TModels>): Promise<AthenaClient<TModels>>;
260
273
 
261
- export { AthenaAuthSessionBridgeOptions, AthenaAuthSessionBridgePathOptions, type AthenaEnvironmentServerConfig, type AthenaExplicitServerConfig, type AthenaRequestCookiesBag, type AthenaRequestCookiesInput, type AthenaRequestHeadersBag, type AthenaRequestHeadersInput, type AthenaResolvedServerContext, type AthenaServerClientConfig, type AthenaServerContextOptions, type AthenaServerRequestOptions, type AthenaServerScope, type GetServerSessionEnsureActiveOptions, type GetServerSessionOptions, type GetServerSessionResult, OrganizationLike, type ResolveActiveOrganizationIdArgs, createAthenaAuthSessionBridgeHandlers, createAthenaAuthSessionBridgePathHandlers, createAthenaServerClient, getServerSession, handleAthenaAuthSessionBridgeDelete, handleAthenaAuthSessionBridgePost, isAthenaAuthSessionBridgePath, parseAthenaSessionDataHeader, resolveAthenaServerContext, resolveNextRequestContext };
274
+ export { AthenaAuthSessionBridgeOptions, AthenaAuthSessionBridgePathOptions, type AthenaEnvironmentServerConfig, type AthenaExplicitServerConfig, type AthenaRequestCookiesBag, type AthenaRequestCookiesInput, type AthenaRequestHeadersBag, type AthenaRequestHeadersInput, type AthenaResolvedServerContext, type AthenaServerClientConfig, type AthenaServerContextOptions, type AthenaServerRequestOptions, type AthenaServerScope, type AthenaServerSessionInput, type GetServerSessionEnsureActiveOptions, type GetServerSessionOptions, type GetServerSessionResult, OrganizationLike, type ResolveActiveOrganizationIdArgs, createAthenaAuthSessionBridgeHandlers, createAthenaAuthSessionBridgePathHandlers, createAthenaServerClient, getServerSession, handleAthenaAuthSessionBridgeDelete, handleAthenaAuthSessionBridgePost, isAthenaAuthSessionBridgePath, parseAthenaSessionDataHeader, resolveAthenaServerContext, resolveNextRequestContext };
@@ -1,16 +1,16 @@
1
1
  import { ad as AthenaAuthSessionResponse } from '../types-BVKpQmfY.js';
2
- import { r as AthenaClientModelsInput } from '../types-B75PdABb.js';
3
- import { ax as AthenaRequestContext, ah as AthenaClientConfig, ag as AthenaClient } from '../v3-client-ao8BWQ8v.js';
2
+ import { r as AthenaClientModelsInput } from '../types-S-bTMPiM.js';
3
+ import { aA as AthenaRequestContext, ai as AthenaClientConfig, ag as AthenaClient } from '../v3-client-OAai_JNs.js';
4
4
  import { OrganizationLike } from '../organization.js';
5
5
  export { ActiveOrganizationSessionLike, EnsureActiveOrganizationOptions, EnsureActiveOrganizationResult, ensureActiveOrganization } from '../organization.js';
6
6
  import { g as AthenaAuthSessionBridgeOptions, h as AthenaAuthSessionBridgePathOptions } from '../payload-DWI1rw-e.js';
7
7
  export { A as ATHENA_AUTH_SESSION_BRIDGE_ROUTE, a as ATHENA_AUTH_SESSION_COOKIE_NAME, b as ATHENA_AUTH_SESSION_COOKIE_NAMES, c as AthenaAuthSessionBridgeClientOptions, d as AthenaAuthSessionBridgePayload, e as AthenaAuthSessionBridgeSource, f as clearAthenaAuthSessionOnAppHost, p as persistAthenaAuthSessionOnAppHost, r as resolveSessionBridgePayload } from '../payload-DWI1rw-e.js';
8
8
  export { S as SESSION_COOKIE_PATTERNS, h as hasAuthSessionCookie } from '../session-cookie-detection-BqOp9mO6.js';
9
9
  export { A as ATHENA_AUTH_DISABLE_COOKIE_CACHE_QUERY_PARAM, a as ATHENA_AUTH_DISABLE_COOKIE_CACHE_QUERY_VALUE, b as ATHENA_AUTH_GET_SESSION_ABSOLUTE_PATH, c as ATHENA_AUTH_GET_SESSION_PATH, d as ATHENA_AUTH_PATH, e as ATHENA_AUTH_UPSTREAM_ENV_KEYS, f as ATHENA_AUTH_UPSTREAM_URL_ENV_NAMES, g as ATHENA_AUTH_VERIFY_EMAIL_PATH, h as ATHENA_SESSION_DATA_HEADER, i as AUTH_SESSION_PATH, j as AthenaAuthClientBaseUrlOptions, k as AthenaAuthUpstreamEnv, l as AthenaAuthUpstreamEnvKey, D as DEFAULT_ATHENA_AUTH_ORIGIN, m as DEFAULT_ATHENA_AUTH_UPSTREAM_URL, n as DISABLE_COOKIE_CACHE_QUERY_PARAM, o as DISABLE_COOKIE_CACHE_QUERY_VALUE, E as EnvLike, L as LOCAL_DEV_ORIGIN, S as SESSION_DATA_HEADER, p as createFreshSessionLookupUrl, q as isAbsoluteUrl, r as normalizeAthenaAuthBaseUrl, s as readAthenaAuthUpstreamUrlFromEnv, t as resolveAthenaAuthClientBaseUrl, u as resolveAthenaAuthRequestUrl, v as resolveAthenaAuthUpstreamUrl, w as resolveEmailVerificationCallbackUrl } from '../athena-auth-url-C1FbVmN6.js';
10
- export { A as ATHENA_AUTH_COOKIE_PREFIXES, a as AUTHENTICATED_REDIRECT_MODE_SET, b as AUTHENTICATED_REDIRECT_VIEW_SET, c as AUTH_DEFAULT_VIEW, d as AUTH_MODE_REDIRECTS, e as AUTH_MODE_SET, f as AUTH_ROUTES, g as AUTH_TWO_FACTOR_SEGMENT, h as AUTH_VIEW_BY_SEGMENT, i as AthenaRequestHeaderOverrideFields, j as AthenaRequestHeaderProfile, k as AuthMode, l as AuthModeRedirects, m as AuthRoutes, n as AuthView, B as BuildAthenaRequestHeadersInput, C as ClearAuthCookiesOptions, R as ResolvedRequestHeaderOverrides, E as applyAthenaApiKeyHeaders, F as applyAthenaAuthContextHeaders, G as applyAthenaPgUriHeaders, o as asNonEmptyString, p as asString, q as buildAthenaGatewayHeaders, r as buildAthenaRequestHeaders, H as buildServiceRequestHeaders, s as clearAuthCookies, t as createAuthModeRedirects, u as createAuthRoutes, I as hasHeaderIgnoreCase, v as isAuthMode, w as readTrimmedString, x as resolveAuthModeRedirect, y as resolveAuthViewFromSegment, J as resolveHeaderValue, K as resolveRequestHeaderOverrides, z as shouldRedirectAuthenticatedAuthMode, D as shouldRedirectAuthenticatedAuthView } from '../athena-request-headers-DzimbvOA.js';
10
+ export { A as ATHENA_AUTH_COOKIE_PREFIXES, a as AUTHENTICATED_REDIRECT_MODE_SET, b as AUTHENTICATED_REDIRECT_VIEW_SET, c as AUTH_DEFAULT_VIEW, d as AUTH_MODE_REDIRECTS, e as AUTH_MODE_SET, f as AUTH_ROUTES, g as AUTH_TWO_FACTOR_SEGMENT, h as AUTH_VIEW_BY_SEGMENT, i as AthenaRequestHeaderOverrideFields, j as AthenaRequestHeaderProfile, k as AuthMode, l as AuthModeRedirects, m as AuthRoutes, n as AuthView, B as BuildAthenaRequestHeadersInput, C as ClearAuthCookiesOptions, R as ResolvedRequestHeaderOverrides, E as applyAthenaApiKeyHeaders, F as applyAthenaAuthContextHeaders, G as applyAthenaPgUriHeaders, o as asNonEmptyString, p as asString, q as buildAthenaGatewayHeaders, r as buildAthenaRequestHeaders, H as buildServiceRequestHeaders, s as clearAuthCookies, t as createAuthModeRedirects, u as createAuthRoutes, I as hasHeaderIgnoreCase, v as isAuthMode, w as readTrimmedString, x as resolveAuthModeRedirect, y as resolveAuthViewFromSegment, J as resolveHeaderValue, K as resolveRequestHeaderOverrides, z as shouldRedirectAuthenticatedAuthMode, D as shouldRedirectAuthenticatedAuthView } from '../athena-request-headers-Dwdkq2WR.js';
11
11
  export { G as GetOriginFromHeadersOptions, g as getOriginFromHeaders, i as isDynamicServerUsageError, p as proxyRequestHeaders, r as readEnv, a as requireEnv } from '../proxy-request-headers-CttlcuRb.js';
12
- export { A as ATHENA_TABLE_SCHEMA_ROUTE, a as AthenaTableCatalogColumn, b as AthenaTableCatalogQueryClient, c as AthenaTableCatalogRelation, d as AthenaTableCatalogResponse, e as AthenaTableCatalogTable, f as AthenaTableSchemaConfig, g as AthenaTableSchemaHandlerOptions, h as AthenaTableShowcaseConfig, F as FetchAthenaTableCatalogOptions, T as TableCatalogColumn, i as TableCatalogRelation, j as TableCatalogResponse, k as TableCatalogTable, l as buildAthenaTableCatalogQueries, m as createAthenaTableSchemaHandlers, n as fetchAthenaTableCatalog, o as fetchTableCatalog, p as handleAthenaTableSchemaPost, q as hasAthenaTableSchemaCredentials, r as isAthenaTableSchemaConfig, s as parseAthenaTableSchemaScope } from '../schema-handlers-VjFDhIMw.js';
13
- import '../types-Bltx6iL6.js';
12
+ export { A as ATHENA_TABLE_SCHEMA_ROUTE, a as AthenaTableCatalogColumn, b as AthenaTableCatalogQueryClient, c as AthenaTableCatalogRelation, d as AthenaTableCatalogResponse, e as AthenaTableCatalogTable, f as AthenaTableSchemaConfig, g as AthenaTableSchemaHandlerOptions, h as AthenaTableShowcaseConfig, F as FetchAthenaTableCatalogOptions, T as TableCatalogColumn, i as TableCatalogRelation, j as TableCatalogResponse, k as TableCatalogTable, l as buildAthenaTableCatalogQueries, m as createAthenaTableSchemaHandlers, n as fetchAthenaTableCatalog, o as fetchTableCatalog, p as handleAthenaTableSchemaPost, q as hasAthenaTableSchemaCredentials, r as isAthenaTableSchemaConfig, s as parseAthenaTableSchemaScope } from '../schema-handlers-CvWqF-dW.js';
13
+ import '../types-B2RZPivM.js';
14
14
  import '../module-C_ab-MM1.js';
15
15
 
16
16
  /**
@@ -195,6 +195,19 @@ declare function parseAthenaSessionDataHeader(raw: string | null | undefined): A
195
195
  */
196
196
  declare function getServerSession(options?: GetServerSessionOptions): Promise<GetServerSessionResult>;
197
197
 
198
+ /**
199
+ * Minimal session shape used to derive gateway identity headers.
200
+ * Accepts full {@link AthenaAuthSessionResponse} or a partial getSession payload.
201
+ */
202
+ type AthenaServerSessionInput = {
203
+ user?: {
204
+ id?: string | null;
205
+ } | null;
206
+ session?: {
207
+ id?: string | null;
208
+ activeOrganizationId?: string | null;
209
+ } | null;
210
+ } | null;
198
211
  /**
199
212
  * Explicit gateway identity for request-scoped server clients.
200
213
  *
@@ -207,7 +220,7 @@ interface AthenaServerScope {
207
220
  organizationId?: string | null;
208
221
  }
209
222
  interface AthenaServerContextOptions extends AthenaServerRequestOptions {
210
- session?: AthenaAuthSessionResponse | null;
223
+ session?: AthenaAuthSessionResponse | AthenaServerSessionInput | null;
211
224
  /**
212
225
  * First-class identity scope. Prefer this over a second `withContext(...)`
213
226
  * call when you already know user/org for the request.
@@ -216,13 +229,13 @@ interface AthenaServerContextOptions extends AthenaServerRequestOptions {
216
229
  }
217
230
  interface AthenaResolvedServerContext {
218
231
  request: AthenaRequestContext;
219
- session: AthenaAuthSessionResponse | null;
232
+ session: AthenaAuthSessionResponse | AthenaServerSessionInput | null;
220
233
  userId: string | null;
221
234
  organizationId: string | null;
222
235
  }
223
236
  declare function resolveAthenaServerContext(options?: AthenaServerContextOptions): Promise<AthenaResolvedServerContext>;
224
237
  type AthenaBaseServerOptions = AthenaServerRequestOptions & {
225
- session?: AthenaAuthSessionResponse | null;
238
+ session?: AthenaAuthSessionResponse | AthenaServerSessionInput | null;
226
239
  scope?: AthenaServerScope;
227
240
  };
228
241
  /**
@@ -258,4 +271,4 @@ type AthenaServerClientConfig<TModels extends AthenaClientModelsInput | undefine
258
271
  */
259
272
  declare function createAthenaServerClient<const TModels extends AthenaClientModelsInput | undefined = undefined>(options: AthenaServerClientConfig<TModels>): Promise<AthenaClient<TModels>>;
260
273
 
261
- export { AthenaAuthSessionBridgeOptions, AthenaAuthSessionBridgePathOptions, type AthenaEnvironmentServerConfig, type AthenaExplicitServerConfig, type AthenaRequestCookiesBag, type AthenaRequestCookiesInput, type AthenaRequestHeadersBag, type AthenaRequestHeadersInput, type AthenaResolvedServerContext, type AthenaServerClientConfig, type AthenaServerContextOptions, type AthenaServerRequestOptions, type AthenaServerScope, type GetServerSessionEnsureActiveOptions, type GetServerSessionOptions, type GetServerSessionResult, OrganizationLike, type ResolveActiveOrganizationIdArgs, createAthenaAuthSessionBridgeHandlers, createAthenaAuthSessionBridgePathHandlers, createAthenaServerClient, getServerSession, handleAthenaAuthSessionBridgeDelete, handleAthenaAuthSessionBridgePost, isAthenaAuthSessionBridgePath, parseAthenaSessionDataHeader, resolveAthenaServerContext, resolveNextRequestContext };
274
+ export { AthenaAuthSessionBridgeOptions, AthenaAuthSessionBridgePathOptions, type AthenaEnvironmentServerConfig, type AthenaExplicitServerConfig, type AthenaRequestCookiesBag, type AthenaRequestCookiesInput, type AthenaRequestHeadersBag, type AthenaRequestHeadersInput, type AthenaResolvedServerContext, type AthenaServerClientConfig, type AthenaServerContextOptions, type AthenaServerRequestOptions, type AthenaServerScope, type AthenaServerSessionInput, type GetServerSessionEnsureActiveOptions, type GetServerSessionOptions, type GetServerSessionResult, OrganizationLike, type ResolveActiveOrganizationIdArgs, createAthenaAuthSessionBridgeHandlers, createAthenaAuthSessionBridgePathHandlers, createAthenaServerClient, getServerSession, handleAthenaAuthSessionBridgeDelete, handleAthenaAuthSessionBridgePost, isAthenaAuthSessionBridgePath, parseAthenaSessionDataHeader, resolveAthenaServerContext, resolveNextRequestContext };