@xylex-group/athena 3.1.0 → 3.3.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.
Files changed (82) hide show
  1. package/README.md +1 -1
  2. package/dist/admin.cjs +55 -1
  3. package/dist/admin.cjs.map +1 -1
  4. package/dist/admin.d.cts +32 -8
  5. package/dist/admin.d.ts +32 -8
  6. package/dist/admin.js +54 -2
  7. package/dist/admin.js.map +1 -1
  8. package/dist/athena-auth-url-C1FbVmN6.d.cts +200 -0
  9. package/dist/athena-auth-url-C1FbVmN6.d.ts +200 -0
  10. package/dist/{athena-request-headers-C7Jy-c_D.d.ts → athena-request-headers-DzimbvOA.d.ts} +48 -200
  11. package/dist/{athena-request-headers-DujFFyMU.d.cts → athena-request-headers-Lr_m8xCV.d.cts} +48 -200
  12. package/dist/billing.cjs +1 -1
  13. package/dist/billing.cjs.map +1 -1
  14. package/dist/billing.js +1 -1
  15. package/dist/billing.js.map +1 -1
  16. package/dist/browser.cjs +602 -16
  17. package/dist/browser.cjs.map +1 -1
  18. package/dist/browser.d.cts +8 -7
  19. package/dist/browser.d.ts +8 -7
  20. package/dist/browser.js +593 -17
  21. package/dist/browser.js.map +1 -1
  22. package/dist/cli/index.cjs +141 -6
  23. package/dist/cli/index.cjs.map +1 -1
  24. package/dist/cli/index.d.cts +2 -2
  25. package/dist/cli/index.d.ts +2 -2
  26. package/dist/cli/index.js +141 -6
  27. package/dist/cli/index.js.map +1 -1
  28. package/dist/env.cjs +130 -0
  29. package/dist/env.cjs.map +1 -0
  30. package/dist/env.d.cts +70 -0
  31. package/dist/env.d.ts +70 -0
  32. package/dist/env.js +122 -0
  33. package/dist/env.js.map +1 -0
  34. package/dist/index.cjs +624 -19
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +8 -7
  37. package/dist/index.d.ts +8 -7
  38. package/dist/index.js +615 -20
  39. package/dist/index.js.map +1 -1
  40. package/dist/{model-form-BhWWsA-7.d.cts → model-form-3Gr8rkdT.d.cts} +24 -2
  41. package/dist/{model-form-BbdzJ9Uh.d.ts → model-form-CotpEL7z.d.ts} +24 -2
  42. package/dist/{module-xFd7_Igv.d.cts → module-CQmOaDzP.d.cts} +4 -4
  43. package/dist/{module-DKkJKOuJ.d.ts → module-CWkUTcUc.d.ts} +4 -4
  44. package/dist/next/client.cjs +123 -7
  45. package/dist/next/client.cjs.map +1 -1
  46. package/dist/next/client.d.cts +4 -3
  47. package/dist/next/client.d.ts +4 -3
  48. package/dist/next/client.js +123 -7
  49. package/dist/next/client.js.map +1 -1
  50. package/dist/next/server.cjs +1130 -364
  51. package/dist/next/server.cjs.map +1 -1
  52. package/dist/next/server.d.cts +121 -8
  53. package/dist/next/server.d.ts +121 -8
  54. package/dist/next/server.js +1120 -365
  55. package/dist/next/server.js.map +1 -1
  56. package/dist/{pipeline-DuKzYGia.d.cts → pipeline-BnRKO_Pd.d.cts} +1 -1
  57. package/dist/{pipeline-wer2G9xW.d.ts → pipeline-sWCmlFqu.d.ts} +1 -1
  58. package/dist/{proxy-request-headers-m4D2Tduy.d.ts → proxy-request-headers-CttlcuRb.d.ts} +1 -1
  59. package/dist/{proxy-request-headers-DGxdoyA0.d.cts → proxy-request-headers-pIBSn1Fw.d.cts} +1 -1
  60. package/dist/react.cjs +290 -31
  61. package/dist/react.cjs.map +1 -1
  62. package/dist/react.d.cts +59 -9
  63. package/dist/react.d.ts +59 -9
  64. package/dist/react.js +290 -32
  65. package/dist/react.js.map +1 -1
  66. package/dist/schema-handlers-BtT_IQFi.d.cts +138 -0
  67. package/dist/schema-handlers-VjFDhIMw.d.ts +138 -0
  68. package/dist/social-providers.d.cts +1 -1
  69. package/dist/social-providers.d.ts +1 -1
  70. package/dist/{types-CccOiXPo.d.ts → types-BDX8zS7w.d.ts} +12 -0
  71. package/dist/{types-AOY-GLu8.d.cts → types-BVKpQmfY.d.cts} +11 -0
  72. package/dist/{types-AOY-GLu8.d.ts → types-BVKpQmfY.d.ts} +11 -0
  73. package/dist/{types-1ztXDgPa.d.cts → types-D-Am7YSd.d.cts} +12 -0
  74. package/dist/utils.cjs +30 -0
  75. package/dist/utils.cjs.map +1 -1
  76. package/dist/utils.d.cts +3 -2
  77. package/dist/utils.d.ts +3 -2
  78. package/dist/utils.js +30 -1
  79. package/dist/utils.js.map +1 -1
  80. package/dist/{v3-client-CWfZHcKL.d.cts → v3-client-G1SLeHRa.d.cts} +23 -1
  81. package/dist/{v3-client-DZp2NEhK.d.ts → v3-client-ao8BWQ8v.d.ts} +23 -1
  82. package/package.json +16 -2
@@ -1,5 +1,5 @@
1
1
  import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-Bltx6iL6.cjs';
2
- import { ag as AthenaClient, av as AthenaQueryDebugAst } from './v3-client-CWfZHcKL.cjs';
2
+ import { ag as AthenaClient, av as AthenaQueryDebugAst } from './v3-client-G1SLeHRa.cjs';
3
3
  import { s as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-CgCv5o6R.cjs';
4
4
 
5
5
  interface AthenaGatewayErrorInput {
@@ -75,6 +75,12 @@ interface AthenaReadQueryDefinition {
75
75
  columns: readonly AthenaReadQueryColumn[];
76
76
  countColumn: string;
77
77
  filters?: readonly AthenaReadQueryFilter[];
78
+ /**
79
+ * Optional max total rows to expose from the result set.
80
+ * Caps reported `totalItems` and shortens the last page under that window.
81
+ * Does **not** replace `pageSize` for per-request page sizing — those fight
82
+ * when both are applied as SQL LIMIT.
83
+ */
78
84
  limit?: number;
79
85
  mode?: AthenaReadQueryMode;
80
86
  /** Single order or multi-column order list. */
@@ -179,6 +185,22 @@ declare const applyAthenaTableSelectLimit: typeof applyAthenaReadQuerySelectLimi
179
185
  declare function clampAthenaReadQueryTotalItems(totalItems: number, limit: number | undefined): number;
180
186
  /** @deprecated Prefer {@link clampAthenaReadQueryTotalItems}. */
181
187
  declare const clampAthenaTableTotalItems: typeof clampAthenaReadQueryTotalItems;
188
+ /**
189
+ * Resolves the page window for a paged read under an optional total-row cap.
190
+ *
191
+ * - `pageSize` owns the per-request fetch size.
192
+ * - `query.limit` (when set) is a max total window, not a second LIMIT that
193
+ * overrides pageSize (which previously made the two controls fight).
194
+ */
195
+ declare function resolveAthenaReadQueryPageFetch({ page, pageSize, limit, }: {
196
+ page: number;
197
+ pageSize: number;
198
+ limit?: number;
199
+ }): {
200
+ page: number;
201
+ pageSize: number;
202
+ shouldFetch: boolean;
203
+ };
182
204
  /**
183
205
  * Execute a portable {@link AthenaReadQueryDefinition} against a v3 Athena client.
184
206
  *
@@ -256,4 +278,4 @@ interface ModelFormAdapter<TModel extends AnyModelDef> {
256
278
  */
257
279
  declare function createModelFormAdapter<TModel extends AnyModelDef>(model: TModel): ModelFormAdapter<TModel>;
258
280
 
259
- export { executeAthenaReadQuery as $, AthenaGatewayError as A, type AthenaTableQueryMode as B, type AthenaTableRelationRef as C, type ModelFormDefaults as D, type ModelFormNullishMode as E, type FormValuesOf as F, type ModelFormValues as G, type ToModelPayloadOptions as H, applyAthenaReadQueryFilters as I, applyAthenaReadQuerySelectLimit as J, applyAthenaReadQuerySelectOrder as K, applyAthenaTableFilters as L, type ModelFormAdapter as M, applyAthenaTableSelectLimit as N, applyAthenaTableSelectOrder as O, buildAthenaReadQueryFindManyOrderBy as P, buildAthenaReadQueryFindManySelect as Q, buildAthenaReadQueryFindManyWhere as R, buildAthenaReadQuerySelectString as S, type ToModelFormDefaultsOptions as T, buildAthenaTableFindManyOrderBy as U, buildAthenaTableFindManySelect as V, buildAthenaTableFindManyWhere as W, buildAthenaTableSelectString as X, clampAthenaReadQueryTotalItems as Y, clampAthenaTableTotalItems as Z, createModelFormAdapter as _, type AthenaReadQueryClient as a, executeAthenaTableQuery as a0, flattenAthenaReadQueryRows as a1, flattenAthenaRows as a2, isAthenaGatewayError as a3, normalizeAthenaReadQueryOrderBy as a4, normalizeAthenaTableOrderBy as a5, toModelFormDefaults as a6, toModelPayload as a7, type AthenaReadQueryColumn as b, type AthenaReadQueryDefinition as c, type AthenaReadQueryExecutionInput as d, type AthenaReadQueryExecutionResult as e, type AthenaReadQueryFilter as f, type AthenaReadQueryFilterOperator as g, type AthenaReadQueryFilterValue as h, type AthenaReadQueryFlatRow as i, type AthenaReadQueryMode as j, type AthenaReadQueryOrder as k, type AthenaReadQueryOrderByInput as l, type AthenaReadQueryOrderDirection as m, type AthenaReadQueryRelationRef as n, type AthenaTableFilter as o, type AthenaTableFilterOperator as p, type AthenaTableFilterValue as q, type AthenaTableFlatRow as r, type AthenaTableOrder as s, type AthenaTableOrderByInput as t, type AthenaTableOrderDirection as u, type AthenaTableQueryClient as v, type AthenaTableQueryColumn as w, type AthenaTableQueryDefinition as x, type AthenaTableQueryExecutionInput as y, type AthenaTableQueryExecutionResult as z };
281
+ export { executeAthenaReadQuery as $, AthenaGatewayError as A, type AthenaTableQueryMode as B, type AthenaTableRelationRef as C, type ModelFormDefaults as D, type ModelFormNullishMode as E, type FormValuesOf as F, type ModelFormValues as G, type ToModelPayloadOptions as H, applyAthenaReadQueryFilters as I, applyAthenaReadQuerySelectLimit as J, applyAthenaReadQuerySelectOrder as K, applyAthenaTableFilters as L, type ModelFormAdapter as M, applyAthenaTableSelectLimit as N, applyAthenaTableSelectOrder as O, buildAthenaReadQueryFindManyOrderBy as P, buildAthenaReadQueryFindManySelect as Q, buildAthenaReadQueryFindManyWhere as R, buildAthenaReadQuerySelectString as S, type ToModelFormDefaultsOptions as T, buildAthenaTableFindManyOrderBy as U, buildAthenaTableFindManySelect as V, buildAthenaTableFindManyWhere as W, buildAthenaTableSelectString as X, clampAthenaReadQueryTotalItems as Y, clampAthenaTableTotalItems as Z, createModelFormAdapter as _, type AthenaReadQueryClient as a, executeAthenaTableQuery as a0, flattenAthenaReadQueryRows as a1, flattenAthenaRows as a2, isAthenaGatewayError as a3, normalizeAthenaReadQueryOrderBy as a4, normalizeAthenaTableOrderBy as a5, resolveAthenaReadQueryPageFetch as a6, toModelFormDefaults as a7, toModelPayload as a8, type AthenaReadQueryColumn as b, type AthenaReadQueryDefinition as c, type AthenaReadQueryExecutionInput as d, type AthenaReadQueryExecutionResult as e, type AthenaReadQueryFilter as f, type AthenaReadQueryFilterOperator as g, type AthenaReadQueryFilterValue as h, type AthenaReadQueryFlatRow as i, type AthenaReadQueryMode as j, type AthenaReadQueryOrder as k, type AthenaReadQueryOrderByInput as l, type AthenaReadQueryOrderDirection as m, type AthenaReadQueryRelationRef as n, type AthenaTableFilter as o, type AthenaTableFilterOperator as p, type AthenaTableFilterValue as q, type AthenaTableFlatRow as r, type AthenaTableOrder as s, type AthenaTableOrderByInput as t, type AthenaTableOrderDirection as u, type AthenaTableQueryClient as v, type AthenaTableQueryColumn as w, type AthenaTableQueryDefinition as x, type AthenaTableQueryExecutionInput as y, type AthenaTableQueryExecutionResult as z };
@@ -1,5 +1,5 @@
1
1
  import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-Bltx6iL6.js';
2
- import { ag as AthenaClient, av as AthenaQueryDebugAst } from './v3-client-DZp2NEhK.js';
2
+ import { ag as AthenaClient, av as AthenaQueryDebugAst } from './v3-client-ao8BWQ8v.js';
3
3
  import { s as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-B75PdABb.js';
4
4
 
5
5
  interface AthenaGatewayErrorInput {
@@ -75,6 +75,12 @@ interface AthenaReadQueryDefinition {
75
75
  columns: readonly AthenaReadQueryColumn[];
76
76
  countColumn: string;
77
77
  filters?: readonly AthenaReadQueryFilter[];
78
+ /**
79
+ * Optional max total rows to expose from the result set.
80
+ * Caps reported `totalItems` and shortens the last page under that window.
81
+ * Does **not** replace `pageSize` for per-request page sizing — those fight
82
+ * when both are applied as SQL LIMIT.
83
+ */
78
84
  limit?: number;
79
85
  mode?: AthenaReadQueryMode;
80
86
  /** Single order or multi-column order list. */
@@ -179,6 +185,22 @@ declare const applyAthenaTableSelectLimit: typeof applyAthenaReadQuerySelectLimi
179
185
  declare function clampAthenaReadQueryTotalItems(totalItems: number, limit: number | undefined): number;
180
186
  /** @deprecated Prefer {@link clampAthenaReadQueryTotalItems}. */
181
187
  declare const clampAthenaTableTotalItems: typeof clampAthenaReadQueryTotalItems;
188
+ /**
189
+ * Resolves the page window for a paged read under an optional total-row cap.
190
+ *
191
+ * - `pageSize` owns the per-request fetch size.
192
+ * - `query.limit` (when set) is a max total window, not a second LIMIT that
193
+ * overrides pageSize (which previously made the two controls fight).
194
+ */
195
+ declare function resolveAthenaReadQueryPageFetch({ page, pageSize, limit, }: {
196
+ page: number;
197
+ pageSize: number;
198
+ limit?: number;
199
+ }): {
200
+ page: number;
201
+ pageSize: number;
202
+ shouldFetch: boolean;
203
+ };
182
204
  /**
183
205
  * Execute a portable {@link AthenaReadQueryDefinition} against a v3 Athena client.
184
206
  *
@@ -256,4 +278,4 @@ interface ModelFormAdapter<TModel extends AnyModelDef> {
256
278
  */
257
279
  declare function createModelFormAdapter<TModel extends AnyModelDef>(model: TModel): ModelFormAdapter<TModel>;
258
280
 
259
- export { executeAthenaReadQuery as $, AthenaGatewayError as A, type AthenaTableQueryMode as B, type AthenaTableRelationRef as C, type ModelFormDefaults as D, type ModelFormNullishMode as E, type FormValuesOf as F, type ModelFormValues as G, type ToModelPayloadOptions as H, applyAthenaReadQueryFilters as I, applyAthenaReadQuerySelectLimit as J, applyAthenaReadQuerySelectOrder as K, applyAthenaTableFilters as L, type ModelFormAdapter as M, applyAthenaTableSelectLimit as N, applyAthenaTableSelectOrder as O, buildAthenaReadQueryFindManyOrderBy as P, buildAthenaReadQueryFindManySelect as Q, buildAthenaReadQueryFindManyWhere as R, buildAthenaReadQuerySelectString as S, type ToModelFormDefaultsOptions as T, buildAthenaTableFindManyOrderBy as U, buildAthenaTableFindManySelect as V, buildAthenaTableFindManyWhere as W, buildAthenaTableSelectString as X, clampAthenaReadQueryTotalItems as Y, clampAthenaTableTotalItems as Z, createModelFormAdapter as _, type AthenaReadQueryClient as a, executeAthenaTableQuery as a0, flattenAthenaReadQueryRows as a1, flattenAthenaRows as a2, isAthenaGatewayError as a3, normalizeAthenaReadQueryOrderBy as a4, normalizeAthenaTableOrderBy as a5, toModelFormDefaults as a6, toModelPayload as a7, type AthenaReadQueryColumn as b, type AthenaReadQueryDefinition as c, type AthenaReadQueryExecutionInput as d, type AthenaReadQueryExecutionResult as e, type AthenaReadQueryFilter as f, type AthenaReadQueryFilterOperator as g, type AthenaReadQueryFilterValue as h, type AthenaReadQueryFlatRow as i, type AthenaReadQueryMode as j, type AthenaReadQueryOrder as k, type AthenaReadQueryOrderByInput as l, type AthenaReadQueryOrderDirection as m, type AthenaReadQueryRelationRef as n, type AthenaTableFilter as o, type AthenaTableFilterOperator as p, type AthenaTableFilterValue as q, type AthenaTableFlatRow as r, type AthenaTableOrder as s, type AthenaTableOrderByInput as t, type AthenaTableOrderDirection as u, type AthenaTableQueryClient as v, type AthenaTableQueryColumn as w, type AthenaTableQueryDefinition as x, type AthenaTableQueryExecutionInput as y, type AthenaTableQueryExecutionResult as z };
281
+ export { executeAthenaReadQuery as $, AthenaGatewayError as A, type AthenaTableQueryMode as B, type AthenaTableRelationRef as C, type ModelFormDefaults as D, type ModelFormNullishMode as E, type FormValuesOf as F, type ModelFormValues as G, type ToModelPayloadOptions as H, applyAthenaReadQueryFilters as I, applyAthenaReadQuerySelectLimit as J, applyAthenaReadQuerySelectOrder as K, applyAthenaTableFilters as L, type ModelFormAdapter as M, applyAthenaTableSelectLimit as N, applyAthenaTableSelectOrder as O, buildAthenaReadQueryFindManyOrderBy as P, buildAthenaReadQueryFindManySelect as Q, buildAthenaReadQueryFindManyWhere as R, buildAthenaReadQuerySelectString as S, type ToModelFormDefaultsOptions as T, buildAthenaTableFindManyOrderBy as U, buildAthenaTableFindManySelect as V, buildAthenaTableFindManyWhere as W, buildAthenaTableSelectString as X, clampAthenaReadQueryTotalItems as Y, clampAthenaTableTotalItems as Z, createModelFormAdapter as _, type AthenaReadQueryClient as a, executeAthenaTableQuery as a0, flattenAthenaReadQueryRows as a1, flattenAthenaRows as a2, isAthenaGatewayError as a3, normalizeAthenaReadQueryOrderBy as a4, normalizeAthenaTableOrderBy as a5, resolveAthenaReadQueryPageFetch as a6, toModelFormDefaults as a7, toModelPayload as a8, type AthenaReadQueryColumn as b, type AthenaReadQueryDefinition as c, type AthenaReadQueryExecutionInput as d, type AthenaReadQueryExecutionResult as e, type AthenaReadQueryFilter as f, type AthenaReadQueryFilterOperator as g, type AthenaReadQueryFilterValue as h, type AthenaReadQueryFlatRow as i, type AthenaReadQueryMode as j, type AthenaReadQueryOrder as k, type AthenaReadQueryOrderByInput as l, type AthenaReadQueryOrderDirection as m, type AthenaReadQueryRelationRef as n, type AthenaTableFilter as o, type AthenaTableFilterOperator as p, type AthenaTableFilterValue as q, type AthenaTableFlatRow as r, type AthenaTableOrder as s, type AthenaTableOrderByInput as t, type AthenaTableOrderDirection as u, type AthenaTableQueryClient as v, type AthenaTableQueryColumn as w, type AthenaTableQueryDefinition as x, type AthenaTableQueryExecutionInput as y, type AthenaTableQueryExecutionResult as z };
@@ -1,10 +1,10 @@
1
1
  import { o as SchemaDef, s as AnyModelDef, D as DatabaseDef, k as ModelMetadata, j as ModelDef, R as RegistryDef, h as ModelColumnKind, S as SchemaIntrospectionProvider, b as IntrospectionColumn, I as IntrospectionSnapshot } from './types-CgCv5o6R.cjs';
2
- import { E as ModelFormNullishMode, G as ModelFormValues } from './model-form-BhWWsA-7.cjs';
2
+ import { E as ModelFormNullishMode, G as ModelFormValues } from './model-form-3Gr8rkdT.cjs';
3
3
  import { ZodType } from 'zod';
4
- import { o as GeneratorSchemaSelection, b as GeneratorProviderConfig, r as NormalizedGeneratorFilterConfig, p as GeneratorTableSelection } from './types-1ztXDgPa.cjs';
4
+ import { o as GeneratorSchemaSelection, b as GeneratorProviderConfig, r as NormalizedGeneratorFilterConfig, p as GeneratorTableSelection } from './types-D-Am7YSd.cjs';
5
5
  import { A as AthenaCookiesOptions, a as AthenaSessionPair, b as AthenaCookieOptions, c as AthenaAuthCookies, g as getCookieCache, d as getSessionCookie, e as AthenaCookieContextRuntime } from './index-CFL9xbFR.cjs';
6
- import { aQ as AuthSocialProvider, a4 as AthenaAuthReactEmailProps, a1 as AthenaAuthReactEmailComponent, a6 as AthenaAuthReactEmailRenderInput, L as AthenaAuthEmailTemplateDefinition, J as AthenaAuthEmailTemplateBuilder, a7 as AthenaAuthReactEmailRenderOptions, a5 as AthenaAuthReactEmailRenderEvent, a2 as AthenaAuthReactEmailConfig } from './types-AOY-GLu8.cjs';
7
- import { r as AthenaChatMessageCreatedResponse, q as AthenaChatMessage, F as AthenaChatRoomCreatedResponse, E as AthenaChatRoom } from './v3-client-CWfZHcKL.cjs';
6
+ import { aQ as AuthSocialProvider, a4 as AthenaAuthReactEmailProps, a1 as AthenaAuthReactEmailComponent, a6 as AthenaAuthReactEmailRenderInput, L as AthenaAuthEmailTemplateDefinition, J as AthenaAuthEmailTemplateBuilder, a7 as AthenaAuthReactEmailRenderOptions, a5 as AthenaAuthReactEmailRenderEvent, a2 as AthenaAuthReactEmailConfig } from './types-BVKpQmfY.cjs';
7
+ import { r as AthenaChatMessageCreatedResponse, q as AthenaChatMessage, F as AthenaChatRoomCreatedResponse, E as AthenaChatRoom } from './v3-client-G1SLeHRa.cjs';
8
8
 
9
9
  type AthenaService = 'db' | 'auth' | 'chat' | 'storage' | 'billing';
10
10
  type AthenaConfigurationErrorCode = 'ATHENA_NO_SERVICE_CONFIGURED' | 'ATHENA_SERVICE_NOT_CONFIGURED' | 'ATHENA_API_KEY_REQUIRED' | 'ATHENA_INVALID_URL' | 'ATHENA_NEXT_SERVER_RUNTIME_REQUIRED';
@@ -1,10 +1,10 @@
1
1
  import { o as SchemaDef, s as AnyModelDef, D as DatabaseDef, k as ModelMetadata, j as ModelDef, R as RegistryDef, h as ModelColumnKind, S as SchemaIntrospectionProvider, b as IntrospectionColumn, I as IntrospectionSnapshot } from './types-B75PdABb.js';
2
- import { E as ModelFormNullishMode, G as ModelFormValues } from './model-form-BbdzJ9Uh.js';
2
+ import { E as ModelFormNullishMode, G as ModelFormValues } from './model-form-CotpEL7z.js';
3
3
  import { ZodType } from 'zod';
4
- import { o as GeneratorSchemaSelection, b as GeneratorProviderConfig, r as NormalizedGeneratorFilterConfig, p as GeneratorTableSelection } from './types-CccOiXPo.js';
4
+ import { o as GeneratorSchemaSelection, b as GeneratorProviderConfig, r as NormalizedGeneratorFilterConfig, p as GeneratorTableSelection } from './types-BDX8zS7w.js';
5
5
  import { A as AthenaCookiesOptions, a as AthenaSessionPair, b as AthenaCookieOptions, c as AthenaAuthCookies, g as getCookieCache, d as getSessionCookie, e as AthenaCookieContextRuntime } from './index-UKJpunc6.js';
6
- import { aQ as AuthSocialProvider, a4 as AthenaAuthReactEmailProps, a1 as AthenaAuthReactEmailComponent, a6 as AthenaAuthReactEmailRenderInput, L as AthenaAuthEmailTemplateDefinition, J as AthenaAuthEmailTemplateBuilder, a7 as AthenaAuthReactEmailRenderOptions, a5 as AthenaAuthReactEmailRenderEvent, a2 as AthenaAuthReactEmailConfig } from './types-AOY-GLu8.js';
7
- import { r as AthenaChatMessageCreatedResponse, q as AthenaChatMessage, F as AthenaChatRoomCreatedResponse, E as AthenaChatRoom } from './v3-client-DZp2NEhK.js';
6
+ import { aQ as AuthSocialProvider, a4 as AthenaAuthReactEmailProps, a1 as AthenaAuthReactEmailComponent, a6 as AthenaAuthReactEmailRenderInput, L as AthenaAuthEmailTemplateDefinition, J as AthenaAuthEmailTemplateBuilder, a7 as AthenaAuthReactEmailRenderOptions, a5 as AthenaAuthReactEmailRenderEvent, a2 as AthenaAuthReactEmailConfig } from './types-BVKpQmfY.js';
7
+ import { r as AthenaChatMessageCreatedResponse, q as AthenaChatMessage, F as AthenaChatRoomCreatedResponse, E as AthenaChatRoom } from './v3-client-ao8BWQ8v.js';
8
8
 
9
9
  type AthenaService = 'db' | 'auth' | 'chat' | 'storage' | 'billing';
10
10
  type AthenaConfigurationErrorCode = 'ATHENA_NO_SERVICE_CONFIGURED' | 'ATHENA_SERVICE_NOT_CONFIGURED' | 'ATHENA_API_KEY_REQUIRED' | 'ATHENA_INVALID_URL' | 'ATHENA_NEXT_SERVER_RUNTIME_REQUIRED';
@@ -1784,7 +1784,7 @@ function buildAthenaGatewayUrl(baseUrl, path) {
1784
1784
 
1785
1785
  // package.json
1786
1786
  var package_default = {
1787
- version: "3.1.0"
1787
+ version: "3.3.0"
1788
1788
  };
1789
1789
 
1790
1790
  // src/sdk-version.ts
@@ -3870,6 +3870,14 @@ function createAuthModule(config = {}, runtimeOptions = {}) {
3870
3870
  changeEmailVerify: (input, options) => getWithQuery("/change-email/verify", input, options),
3871
3871
  deleteUserVerify: (input, options) => getWithQuery("/delete-user/verify", input, options),
3872
3872
  changePassword: (input, options) => postGeneric("/change-password", input, options),
3873
+ // Better Auth UI flat method aliases (also nested under session/account/social/user).
3874
+ listSessions: (input, options) => getGeneric("/list-sessions", input, options),
3875
+ revokeSession: sessionRevokeBinding,
3876
+ revokeOtherSessions,
3877
+ listAccounts: (input, options) => getGeneric("/list-accounts", input, options),
3878
+ unlinkAccount: (input, options) => postGeneric("/unlink-account", input, options),
3879
+ linkSocial: (input, options) => postGeneric("/link-social", input, options),
3880
+ updateUser: (input, options) => postGeneric("/update-user", input, options),
3873
3881
  user: {
3874
3882
  update: (input, options) => postGeneric("/update-user", input, options),
3875
3883
  delete: (input, options) => postGeneric("/delete-user", input, options),
@@ -9532,6 +9540,82 @@ function mergeAthenaRequestContexts(base, override) {
9532
9540
  };
9533
9541
  }
9534
9542
 
9543
+ // src/diagnostics.ts
9544
+ function readProcessEnv2() {
9545
+ try {
9546
+ return globalThis.process?.env ?? {};
9547
+ } catch {
9548
+ return {};
9549
+ }
9550
+ }
9551
+ function isTruthyEnv(value) {
9552
+ if (!value) return false;
9553
+ const normalized = value.trim().toLowerCase();
9554
+ return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "on";
9555
+ }
9556
+ function isQuietAthenaDiagnosticsEnvironment(env = readProcessEnv2()) {
9557
+ const nodeEnv = env.NODE_ENV?.trim().toLowerCase();
9558
+ if (nodeEnv === "production") {
9559
+ return true;
9560
+ }
9561
+ if (isTruthyEnv(env.OPENNEXT_BUILD)) {
9562
+ return true;
9563
+ }
9564
+ const nextPhase = env.NEXT_PHASE?.trim();
9565
+ if (nextPhase === "phase-production-build") {
9566
+ return true;
9567
+ }
9568
+ if (isTruthyEnv(env.CI) && nodeEnv !== "test") {
9569
+ if (nodeEnv === "production" || isTruthyEnv(env.OPENNEXT_BUILD)) {
9570
+ return true;
9571
+ }
9572
+ }
9573
+ return false;
9574
+ }
9575
+ function resolveBooleanFlag(explicit, mode, quiet) {
9576
+ if (typeof explicit === "boolean") {
9577
+ return explicit;
9578
+ }
9579
+ if (mode === true) {
9580
+ return true;
9581
+ }
9582
+ if (mode === false) {
9583
+ return false;
9584
+ }
9585
+ if (mode === "auto") {
9586
+ return false;
9587
+ }
9588
+ return false;
9589
+ }
9590
+ function resolveAthenaClientDiagnostics(input) {
9591
+ const env = input.env ?? readProcessEnv2();
9592
+ const quiet = isQuietAthenaDiagnosticsEnvironment(env);
9593
+ const mode = input.diagnostics;
9594
+ const effectiveMode = mode === "auto" && quiet ? false : mode;
9595
+ const debugAst = resolveBooleanFlag(input.debugAst, effectiveMode);
9596
+ const findManyAst = resolveBooleanFlag(input.findManyAst, effectiveMode);
9597
+ let traceQueries;
9598
+ if (input.traceQueries !== void 0) {
9599
+ if (typeof input.traceQueries === "boolean") {
9600
+ traceQueries = input.traceQueries;
9601
+ } else if (effectiveMode === false || mode === "auto" && quiet) {
9602
+ const enabled = input.traceQueries.enabled;
9603
+ traceQueries = typeof enabled === "boolean" ? enabled ? input.traceQueries : false : false;
9604
+ } else {
9605
+ traceQueries = input.traceQueries;
9606
+ }
9607
+ } else if (effectiveMode === true) {
9608
+ traceQueries = true;
9609
+ } else {
9610
+ traceQueries = false;
9611
+ }
9612
+ return {
9613
+ debugAst,
9614
+ findManyAst,
9615
+ traceQueries
9616
+ };
9617
+ }
9618
+
9535
9619
  // src/v3-client.ts
9536
9620
  var ENV_URL_KEYS = ["ATHENA_URL", "NEXT_PUBLIC_ATHENA_URL"];
9537
9621
  var ENV_DB_URL_KEYS = ["ATHENA_DB_URL", "ATHENA_GATEWAY_URL", "NEXT_PUBLIC_ATHENA_DB_API_URL"];
@@ -9540,7 +9624,13 @@ var ENV_CHAT_URL_KEYS = ["ATHENA_CHAT_URL", "NEXT_PUBLIC_ATHENA_CHAT_URL"];
9540
9624
  var ENV_CHAT_WS_URL_KEYS = ["ATHENA_CHAT_WS_URL", "NEXT_PUBLIC_ATHENA_CHAT_WS_URL"];
9541
9625
  var ENV_STORAGE_URL_KEYS = ["ATHENA_STORAGE_URL", "NEXT_PUBLIC_ATHENA_STORAGE_URL"];
9542
9626
  var ENV_KEY_KEYS = ["ATHENA_API_KEY", "NEXT_PUBLIC_ATHENA_API_KEY", "ATHENA_GATEWAY_API_KEY", "X_API_KEY"];
9543
- var ENV_CLIENT_KEYS = ["ATHENA_CLIENT", "NEXT_PUBLIC_ATHENA_CLIENT"];
9627
+ var ENV_CLIENT_KEYS = [
9628
+ "ATHENA_CLIENT",
9629
+ "ATHENA_GATEWAY_CLIENT",
9630
+ "ATHENA_GENERATOR_CLIENT",
9631
+ "NEXT_PUBLIC_ATHENA_CLIENT",
9632
+ "NEXT_PUBLIC_ATHENA_GATEWAY_CLIENT"
9633
+ ];
9544
9634
  var MISSING_DB_SENTINEL = "https://athena.invalid/db";
9545
9635
  function readFirstEnv(env, keys) {
9546
9636
  for (const key of keys) {
@@ -9615,6 +9705,13 @@ function createInternalConfig(core) {
9615
9705
  const { config, urls } = core;
9616
9706
  const { url: _authUrl, ...authOptions } = config.auth ?? {};
9617
9707
  const { url: _storageUrl, directUpload, ...storageOptions } = config.storage ?? {};
9708
+ const diagnostics = resolveAthenaClientDiagnostics({
9709
+ diagnostics: config.diagnostics,
9710
+ debugAst: config.debugAst,
9711
+ findManyAst: config.findManyAst,
9712
+ traceQueries: config.traceQueries,
9713
+ env: config.env
9714
+ });
9618
9715
  return {
9619
9716
  baseUrl: urls.db ?? MISSING_DB_SENTINEL,
9620
9717
  apiKey: core.key,
@@ -9631,9 +9728,9 @@ function createInternalConfig(core) {
9631
9728
  models: config.models,
9632
9729
  behavior: {
9633
9730
  retryReads: config.retryReads,
9634
- traceQueries: config.traceQueries,
9635
- debugAst: config.debugAst,
9636
- findManyAst: config.findManyAst
9731
+ traceQueries: diagnostics.traceQueries,
9732
+ debugAst: diagnostics.debugAst,
9733
+ findManyAst: diagnostics.findManyAst
9637
9734
  },
9638
9735
  storage: {
9639
9736
  ...storageOptions,
@@ -9707,11 +9804,30 @@ function createClientView(core, viewContext) {
9707
9804
  return resolved.verifyConnection(options);
9708
9805
  },
9709
9806
  withContext(context) {
9807
+ warnIfEmptyRequestContext(context);
9710
9808
  return createClientView(core, mergeAthenaRequestContexts(viewContext, context));
9711
9809
  }
9712
9810
  };
9713
9811
  return Object.freeze(client);
9714
9812
  }
9813
+ function isEmptyAthenaRequestContext(context) {
9814
+ if (!context) return true;
9815
+ const hasHeaders = context.headers != null && Object.keys(context.headers).length > 0;
9816
+ return context.userId == null && context.organizationId == null && !normalizeOptionalContextString(context.cookie) && !normalizeOptionalContextString(context.bearerToken) && !normalizeOptionalContextString(context.sessionToken) && !context.forceNoCache && !hasHeaders;
9817
+ }
9818
+ function normalizeOptionalContextString(value) {
9819
+ const trimmed = value?.trim();
9820
+ return trimmed || void 0;
9821
+ }
9822
+ function warnIfEmptyRequestContext(context) {
9823
+ if (!isEmptyAthenaRequestContext(context)) return;
9824
+ if (typeof process !== "undefined" && process.env?.NODE_ENV === "production") {
9825
+ return;
9826
+ }
9827
+ console.warn(
9828
+ "[athena] withContext({}) has no userId, organizationId, cookie, bearerToken, sessionToken, headers, or forceNoCache. Gateway scope headers will not change. Pass identity fields, or use createAthenaServerClient({ session, scope })."
9829
+ );
9830
+ }
9715
9831
  function createClient(config) {
9716
9832
  return createClientView(resolveCore(config));
9717
9833
  }
@@ -10004,7 +10120,7 @@ function stripAthenaAuthPath(pathname) {
10004
10120
  }
10005
10121
  return normalizedPath;
10006
10122
  }
10007
- function readProcessEnv2() {
10123
+ function readProcessEnv3() {
10008
10124
  try {
10009
10125
  const maybeProcess = globalThis.process;
10010
10126
  return maybeProcess?.env;
@@ -10041,7 +10157,7 @@ function resolveConfiguredAthenaAuthUpstreamUrl(rawUpstreamUrl) {
10041
10157
  if (rawUpstreamUrl) {
10042
10158
  return readAthenaAuthUpstreamUrlFromEnv(rawUpstreamUrl);
10043
10159
  }
10044
- const processEnv = readProcessEnv2();
10160
+ const processEnv = readProcessEnv3();
10045
10161
  return processEnv ? readAthenaAuthUpstreamUrlFromEnv(processEnv) : void 0;
10046
10162
  }
10047
10163
  function normalizeAthenaAuthBaseUrl(urlOrPath) {