@xylex-group/athena 2.8.2 → 2.9.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 (52) hide show
  1. package/README.md +154 -64
  2. package/dist/browser.cjs +636 -21
  3. package/dist/browser.cjs.map +1 -1
  4. package/dist/browser.d.cts +8 -7
  5. package/dist/browser.d.ts +8 -7
  6. package/dist/browser.js +630 -22
  7. package/dist/browser.js.map +1 -1
  8. package/dist/cli/index.cjs +591 -29
  9. package/dist/cli/index.cjs.map +1 -1
  10. package/dist/cli/index.d.cts +3 -3
  11. package/dist/cli/index.d.ts +3 -3
  12. package/dist/cli/index.js +591 -29
  13. package/dist/cli/index.js.map +1 -1
  14. package/dist/{model-form-Cx3wtvi8.d.ts → client-CfAE_QOj.d.cts} +101 -97
  15. package/dist/{model-form-_ugfOXao.d.cts → client-D6EIJdQS.d.ts} +101 -97
  16. package/dist/index.cjs +714 -41
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +8 -7
  19. package/dist/index.d.ts +8 -7
  20. package/dist/index.js +708 -42
  21. package/dist/index.js.map +1 -1
  22. package/dist/model-form-ByvyyvxB.d.ts +96 -0
  23. package/dist/model-form-DACdBLYG.d.cts +96 -0
  24. package/dist/next/client.cjs +7875 -0
  25. package/dist/next/client.cjs.map +1 -0
  26. package/dist/next/client.d.cts +25 -0
  27. package/dist/next/client.d.ts +25 -0
  28. package/dist/next/client.js +7873 -0
  29. package/dist/next/client.js.map +1 -0
  30. package/dist/next/server.cjs +7993 -0
  31. package/dist/next/server.cjs.map +1 -0
  32. package/dist/next/server.d.cts +52 -0
  33. package/dist/next/server.d.ts +52 -0
  34. package/dist/next/server.js +7990 -0
  35. package/dist/next/server.js.map +1 -0
  36. package/dist/{pipeline-BtD-Uo5X.d.cts → pipeline-CmUZsXsi.d.cts} +1 -1
  37. package/dist/{pipeline-yCIZNJHE.d.ts → pipeline-DZMsPxUg.d.ts} +1 -1
  38. package/dist/{react-email-CiiSVa9F.d.cts → react-email-BvJ3fj_F.d.cts} +35 -5
  39. package/dist/{react-email-WN8UU3AL.d.ts → react-email-PLAJuZuO.d.ts} +35 -5
  40. package/dist/react.cjs +30 -1
  41. package/dist/react.cjs.map +1 -1
  42. package/dist/react.d.cts +39 -10
  43. package/dist/react.d.ts +39 -10
  44. package/dist/react.js +30 -2
  45. package/dist/react.js.map +1 -1
  46. package/dist/shared-BW6hoLBY.d.cts +33 -0
  47. package/dist/shared-BiJvoURI.d.ts +33 -0
  48. package/dist/{types-g8G6J0xE.d.cts → types-BeZIHduP.d.cts} +2 -1
  49. package/dist/{types-g8G6J0xE.d.ts → types-BeZIHduP.d.ts} +2 -1
  50. package/dist/{types-C2kiTt6-.d.ts → types-C-YvfgYh.d.cts} +26 -2
  51. package/dist/{types-89EfjLjV.d.cts → types-CRjDwmtJ.d.ts} +26 -2
  52. package/package.json +32 -14
package/dist/browser.cjs CHANGED
@@ -802,7 +802,7 @@ var getCookieCache = async (request, config) => {
802
802
 
803
803
  // package.json
804
804
  var package_default = {
805
- version: "2.8.2"
805
+ version: "2.9.0"
806
806
  };
807
807
 
808
808
  // src/sdk-version.ts
@@ -815,6 +815,7 @@ function buildSdkHeaderValue(sdkName) {
815
815
  var DEFAULT_CLIENT = "railway_direct";
816
816
  var SDK_NAME = "xylex-group/athena";
817
817
  var SDK_HEADER_VALUE = buildSdkHeaderValue(SDK_NAME);
818
+ var NO_CACHE_HEADER_VALUE = "no-cache";
818
819
  function parseResponseBody(rawText, contentType) {
819
820
  if (!rawText) {
820
821
  return { parsed: null, parseFailed: false };
@@ -833,6 +834,9 @@ function parseResponseBody(rawText, contentType) {
833
834
  function normalizeHeaderValue(value) {
834
835
  return value ? value : void 0;
835
836
  }
837
+ function isCacheControlHeaderName(name) {
838
+ return name.toLowerCase() === "cache-control";
839
+ }
836
840
  function resolveHeaderValue(headers, candidates) {
837
841
  for (const candidate of candidates) {
838
842
  const direct = normalizeHeaderValue(headers[candidate]);
@@ -991,6 +995,7 @@ function buildRpcGetEndpoint(payload) {
991
995
  }
992
996
  function buildHeaders(config, options) {
993
997
  const mergedStripNulls = options?.stripNulls ?? true;
998
+ const forceNoCache = Boolean(config.forceNoCache || options?.forceNoCache);
994
999
  const extraHeaders = {
995
1000
  ...config.headers ?? {},
996
1001
  ...options?.headers ?? {}
@@ -1044,11 +1049,15 @@ function buildHeaders(config, options) {
1044
1049
  const athenaClientKeys = ["x-athena-client", "X-Athena-Client"];
1045
1050
  Object.entries(extraHeaders).forEach(([key, value]) => {
1046
1051
  if (athenaClientKeys.includes(key)) return;
1052
+ if (forceNoCache && isCacheControlHeaderName(key)) return;
1047
1053
  const normalized = normalizeHeaderValue(value);
1048
1054
  if (normalized) {
1049
1055
  headers[key] = normalized;
1050
1056
  }
1051
1057
  });
1058
+ if (forceNoCache) {
1059
+ headers["Cache-Control"] = NO_CACHE_HEADER_VALUE;
1060
+ }
1052
1061
  return headers;
1053
1062
  }
1054
1063
  function toInvalidUrlResponse(error, endpoint, method) {
@@ -1509,6 +1518,45 @@ function identifier(...segments) {
1509
1518
  return new SqlIdentifierPath(expandedSegments);
1510
1519
  }
1511
1520
 
1521
+ // src/auth/limits.ts
1522
+ var ATHENA_AUTH_MAX_ADMIN_JSON_BYTES = 32 * 1024;
1523
+ var ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH = 8;
1524
+ var ATHENA_AUTH_MAX_TEMPLATE_VARIABLES = 64;
1525
+ var ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH = 128;
1526
+ var ATHENA_AUTH_ADMIN_LIMITS = {
1527
+ maxAdminJsonBytes: ATHENA_AUTH_MAX_ADMIN_JSON_BYTES,
1528
+ maxAdminJsonDepth: ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH,
1529
+ maxTemplateVariables: ATHENA_AUTH_MAX_TEMPLATE_VARIABLES,
1530
+ maxTemplateVariableLength: ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH
1531
+ };
1532
+ function describeTemplateVariableTarget(target) {
1533
+ const normalized = target?.trim();
1534
+ return normalized && normalized.length > 0 ? normalized : "Athena auth admin email template variables";
1535
+ }
1536
+ function assertAthenaAuthTemplateVariables(variables, target) {
1537
+ const label = describeTemplateVariableTarget(target);
1538
+ if (!Array.isArray(variables)) {
1539
+ throw new Error(`${label} must be an array of strings.`);
1540
+ }
1541
+ if (variables.length > ATHENA_AUTH_MAX_TEMPLATE_VARIABLES) {
1542
+ throw new Error(
1543
+ `${label} cannot contain more than ${ATHENA_AUTH_MAX_TEMPLATE_VARIABLES} entries.`
1544
+ );
1545
+ }
1546
+ variables.forEach((variable, index) => {
1547
+ if (typeof variable !== "string") {
1548
+ throw new Error(
1549
+ `${label} must contain only strings. Received ${typeof variable} at index ${index}.`
1550
+ );
1551
+ }
1552
+ if (variable.length > ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH) {
1553
+ throw new Error(
1554
+ `${label} cannot contain entries longer than ${ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH} characters. Received ${variable.length} characters at index ${index}.`
1555
+ );
1556
+ }
1557
+ });
1558
+ }
1559
+
1512
1560
  // src/auth/react-email.ts
1513
1561
  var reactEmailRenderModulePromise;
1514
1562
  function isRecord2(value) {
@@ -1738,6 +1786,7 @@ async function resolveReactEmailPayloadFields(input, fields, options) {
1738
1786
  var DEFAULT_AUTH_BASE_URL = "http://localhost:3001/api/auth";
1739
1787
  var SDK_NAME2 = "xylex-group/athena-auth";
1740
1788
  var SDK_HEADER_VALUE2 = buildSdkHeaderValue(SDK_NAME2);
1789
+ var NO_CACHE_HEADER_VALUE2 = "no-cache";
1741
1790
  function normalizeBaseUrl(baseUrl) {
1742
1791
  return (baseUrl ?? DEFAULT_AUTH_BASE_URL).replace(/\/$/, "");
1743
1792
  }
@@ -1747,6 +1796,9 @@ function isRecord3(value) {
1747
1796
  function normalizeHeaderValue2(value) {
1748
1797
  return value ? value : void 0;
1749
1798
  }
1799
+ function isCacheControlHeaderName2(name) {
1800
+ return name.toLowerCase() === "cache-control";
1801
+ }
1750
1802
  function parseResponseBody2(rawText, contentType) {
1751
1803
  if (!rawText) {
1752
1804
  return { parsed: null, parseFailed: false };
@@ -1802,6 +1854,54 @@ function mergeCallOptions(base, override) {
1802
1854
  }
1803
1855
  };
1804
1856
  }
1857
+ function toSessionGuardFailure(sessionResult) {
1858
+ if (sessionResult.status === 401 || sessionResult.data == null) {
1859
+ return {
1860
+ ok: false,
1861
+ reason: "unauthorized",
1862
+ status: 401,
1863
+ error: sessionResult.error ?? "Unauthorized",
1864
+ sessionResult
1865
+ };
1866
+ }
1867
+ return {
1868
+ ok: false,
1869
+ reason: "upstream_error",
1870
+ status: sessionResult.status,
1871
+ error: sessionResult.error ?? "Failed to resolve current session",
1872
+ sessionResult
1873
+ };
1874
+ }
1875
+ function toPermissionGuardFailure(permissionResult, sessionResult) {
1876
+ if (permissionResult.status === 401) {
1877
+ return {
1878
+ ok: false,
1879
+ reason: "unauthorized",
1880
+ status: 401,
1881
+ error: permissionResult.error ?? "Unauthorized",
1882
+ sessionResult,
1883
+ permissionResult
1884
+ };
1885
+ }
1886
+ if (permissionResult.status === 403) {
1887
+ return {
1888
+ ok: false,
1889
+ reason: "forbidden",
1890
+ status: 403,
1891
+ error: permissionResult.error ?? "Forbidden",
1892
+ sessionResult,
1893
+ permissionResult
1894
+ };
1895
+ }
1896
+ return {
1897
+ ok: false,
1898
+ reason: "upstream_error",
1899
+ status: permissionResult.status,
1900
+ error: permissionResult.error ?? "Failed to resolve permission check",
1901
+ sessionResult,
1902
+ permissionResult
1903
+ };
1904
+ }
1805
1905
  function extractFetchOptions(input) {
1806
1906
  if (!input) {
1807
1907
  return {
@@ -1817,6 +1917,7 @@ function extractFetchOptions(input) {
1817
1917
  };
1818
1918
  }
1819
1919
  function buildHeaders2(config, options) {
1920
+ const forceNoCache = Boolean(config.forceNoCache || options?.forceNoCache);
1820
1921
  const headers = {
1821
1922
  "Content-Type": "application/json",
1822
1923
  "X-Athena-Sdk": SDK_HEADER_VALUE2
@@ -1830,16 +1931,30 @@ function buildHeaders2(config, options) {
1830
1931
  if (bearerToken) {
1831
1932
  headers.Authorization = `Bearer ${bearerToken}`;
1832
1933
  }
1934
+ const cookie = options?.cookie ?? config.cookie;
1935
+ if (cookie) {
1936
+ headers.Cookie = cookie;
1937
+ }
1938
+ const sessionToken = options?.sessionToken ?? config.sessionToken;
1939
+ if (sessionToken) {
1940
+ headers["X-Athena-Auth-Session-Token"] = sessionToken;
1941
+ }
1833
1942
  const mergedExtraHeaders = {
1834
1943
  ...config.headers ?? {},
1835
1944
  ...options?.headers ?? {}
1836
1945
  };
1837
1946
  Object.entries(mergedExtraHeaders).forEach(([key, value]) => {
1947
+ if (forceNoCache && isCacheControlHeaderName2(key)) {
1948
+ return;
1949
+ }
1838
1950
  const normalized = normalizeHeaderValue2(value);
1839
1951
  if (normalized) {
1840
1952
  headers[key] = normalized;
1841
1953
  }
1842
1954
  });
1955
+ if (forceNoCache) {
1956
+ headers["Cache-Control"] = NO_CACHE_HEADER_VALUE2;
1957
+ }
1843
1958
  return headers;
1844
1959
  }
1845
1960
  function appendQueryParam(searchParams, key, value) {
@@ -2104,7 +2219,91 @@ function createAuthClient(config = {}) {
2104
2219
  htmlField: "htmlTemplate",
2105
2220
  textField: "textTemplate",
2106
2221
  variablesField: "variables"
2107
- }, withReactEmailRoute(route));
2222
+ }, withReactEmailRoute(route)).then((payload) => {
2223
+ if ("variables" in payload && payload.variables !== void 0 && payload.variables !== null) {
2224
+ assertAthenaAuthTemplateVariables(
2225
+ payload.variables,
2226
+ `${route} variables`
2227
+ );
2228
+ }
2229
+ return payload;
2230
+ });
2231
+ const requireSession = async (input, options) => {
2232
+ const sessionInput = input?.fetchOptions ? { fetchOptions: input.fetchOptions } : void 0;
2233
+ const sessionResult = await getGeneric(
2234
+ "/get-session",
2235
+ sessionInput,
2236
+ options
2237
+ );
2238
+ if (!sessionResult.ok || sessionResult.data == null) {
2239
+ return toSessionGuardFailure(sessionResult);
2240
+ }
2241
+ return {
2242
+ ok: true,
2243
+ session: sessionResult.data
2244
+ };
2245
+ };
2246
+ const getUser = async (input, options) => {
2247
+ const sessionResult = await getGeneric(
2248
+ "/get-session",
2249
+ input,
2250
+ options
2251
+ );
2252
+ if (!sessionResult.ok) {
2253
+ return {
2254
+ ...sessionResult,
2255
+ data: null
2256
+ };
2257
+ }
2258
+ return {
2259
+ ...sessionResult,
2260
+ data: {
2261
+ user: sessionResult.data?.user ?? null
2262
+ }
2263
+ };
2264
+ };
2265
+ const requirePermission = async (endpoint, input, options) => {
2266
+ const sessionGuard = await requireSession(
2267
+ input?.fetchOptions ? { fetchOptions: input.fetchOptions } : void 0,
2268
+ options
2269
+ );
2270
+ if (!sessionGuard.ok) {
2271
+ return sessionGuard;
2272
+ }
2273
+ const permissionResult = await postGeneric(
2274
+ endpoint,
2275
+ input,
2276
+ options
2277
+ );
2278
+ if (!permissionResult.ok) {
2279
+ return toPermissionGuardFailure(permissionResult, {
2280
+ ok: true,
2281
+ status: 200,
2282
+ data: sessionGuard.session,
2283
+ error: null,
2284
+ errorDetails: null,
2285
+ raw: sessionGuard.session
2286
+ });
2287
+ }
2288
+ if (!permissionResult.data?.success) {
2289
+ return {
2290
+ ok: false,
2291
+ reason: "forbidden",
2292
+ status: 403,
2293
+ error: permissionResult.data?.error ?? "Forbidden",
2294
+ sessionResult: {
2295
+ ok: true,
2296
+ status: 200,
2297
+ data: sessionGuard.session,
2298
+ error: null,
2299
+ errorDetails: null,
2300
+ raw: sessionGuard.session
2301
+ },
2302
+ permissionResult
2303
+ };
2304
+ }
2305
+ return sessionGuard;
2306
+ };
2108
2307
  const listUserEmailsWithFallback = async (input, options) => {
2109
2308
  const primary = await getWithQuery(
2110
2309
  "/email/list",
@@ -2266,6 +2465,7 @@ function createAuthClient(config = {}) {
2266
2465
  input,
2267
2466
  options
2268
2467
  ),
2468
+ requirePermission: (input, options) => requirePermission("/organization/has-permission", input, options),
2269
2469
  invitation: {
2270
2470
  cancel: (input, options) => executePostWithCompatibleInput(
2271
2471
  resolvedConfig,
@@ -2461,6 +2661,8 @@ function createAuthClient(config = {}) {
2461
2661
  };
2462
2662
  const auth = {
2463
2663
  getSession: (input, options) => getGeneric("/get-session", input, options),
2664
+ getUser,
2665
+ requireSession,
2464
2666
  signOut,
2465
2667
  forgetPassword: (input, options) => postGeneric("/forget-password", input, options),
2466
2668
  resetPassword: authResetPassword,
@@ -2555,6 +2757,7 @@ function createAuthClient(config = {}) {
2555
2757
  }
2556
2758
  },
2557
2759
  hasPermission: (input, options) => postGeneric("/admin/has-permission", input, options),
2760
+ requirePermission: (input, options) => requirePermission("/admin/has-permission", input, options),
2558
2761
  apiKey: {
2559
2762
  create: (input, options) => postGeneric("/admin/api-key/create", input, options)
2560
2763
  },
@@ -2706,6 +2909,8 @@ function createAuthClient(config = {}) {
2706
2909
  input,
2707
2910
  options
2708
2911
  ),
2912
+ getUser,
2913
+ requireSession,
2709
2914
  listSessions: (input, options) => executeGetWithCompatibleInput(
2710
2915
  resolvedConfig,
2711
2916
  { endpoint: "/list-sessions", method: "GET" },
@@ -5461,6 +5666,9 @@ var AthenaClientBuilderImpl = class {
5461
5666
  apiKey;
5462
5667
  backendConfig = DEFAULT_BACKEND;
5463
5668
  clientName;
5669
+ defaultUserId;
5670
+ defaultOrganizationId;
5671
+ forceNoCacheEnabled = false;
5464
5672
  defaultHeaders;
5465
5673
  authConfig;
5466
5674
  dbUrlOverride;
@@ -5509,6 +5717,15 @@ var AthenaClientBuilderImpl = class {
5509
5717
  if (options.client !== void 0) {
5510
5718
  this.clientName = options.client;
5511
5719
  }
5720
+ if (options.userId !== void 0) {
5721
+ this.defaultUserId = options.userId;
5722
+ }
5723
+ if (options.organizationId !== void 0) {
5724
+ this.defaultOrganizationId = options.organizationId;
5725
+ }
5726
+ if (options.forceNoCache !== void 0) {
5727
+ this.forceNoCacheEnabled = options.forceNoCache;
5728
+ }
5512
5729
  if (options.backend !== void 0) {
5513
5730
  this.backendConfig = toBackendConfig(options.backend);
5514
5731
  }
@@ -5563,6 +5780,9 @@ var AthenaClientBuilderImpl = class {
5563
5780
  url: this.rootUrl,
5564
5781
  key: this.apiKey,
5565
5782
  client: this.clientName,
5783
+ userId: this.defaultUserId,
5784
+ organizationId: this.defaultOrganizationId,
5785
+ forceNoCache: this.forceNoCacheEnabled,
5566
5786
  backend: this.backendConfig,
5567
5787
  headers: this.defaultHeaders,
5568
5788
  db: this.dbUrlOverride ? { url: this.dbUrlOverride } : void 0,
@@ -8105,6 +8325,83 @@ function createQueryBuilder(client, formatGatewayResult, experimental, tracer) {
8105
8325
  );
8106
8326
  };
8107
8327
  }
8328
+ var ATHENA_ENV_URL_KEYS = ["ATHENA_URL", "NEXT_PUBLIC_ATHENA_URL"];
8329
+ var ATHENA_ENV_GATEWAY_URL_KEYS = [
8330
+ "ATHENA_DB_URL",
8331
+ "ATHENA_GATEWAY_URL",
8332
+ "NEXT_PUBLIC_ATHENA_DB_API_URL"
8333
+ ];
8334
+ var ATHENA_ENV_AUTH_URL_KEYS = ["ATHENA_AUTH_URL", "NEXT_PUBLIC_ATHENA_AUTH_URL"];
8335
+ var ATHENA_ENV_STORAGE_URL_KEYS = ["ATHENA_STORAGE_URL", "NEXT_PUBLIC_ATHENA_STORAGE_URL"];
8336
+ var ATHENA_ENV_KEY_KEYS = [
8337
+ "ATHENA_API_KEY",
8338
+ "NEXT_PUBLIC_ATHENA_API_KEY",
8339
+ "ATHENA_GATEWAY_API_KEY",
8340
+ "X_API_KEY"
8341
+ ];
8342
+ var ATHENA_ENV_CLIENT_KEYS = ["ATHENA_CLIENT", "NEXT_PUBLIC_ATHENA_CLIENT"];
8343
+ function normalizeOptionalString(value) {
8344
+ if (typeof value !== "string") {
8345
+ return void 0;
8346
+ }
8347
+ const normalizedValue = value.trim();
8348
+ return normalizedValue ? normalizedValue : void 0;
8349
+ }
8350
+ function readFirstEnvValue(env, keys) {
8351
+ for (const key of keys) {
8352
+ const value = normalizeOptionalString(env[key]);
8353
+ if (value) {
8354
+ return value;
8355
+ }
8356
+ }
8357
+ return void 0;
8358
+ }
8359
+ function readHeaderBagValue(headers, targetKey) {
8360
+ if (!headers) {
8361
+ return void 0;
8362
+ }
8363
+ if (typeof headers.get === "function") {
8364
+ return normalizeOptionalString(headers.get(targetKey));
8365
+ }
8366
+ const normalizedTargetKey = targetKey.toLowerCase();
8367
+ for (const [key, value] of Object.entries(headers)) {
8368
+ if (key.toLowerCase() !== normalizedTargetKey) {
8369
+ continue;
8370
+ }
8371
+ if (typeof value === "string") {
8372
+ return normalizeOptionalString(value);
8373
+ }
8374
+ return void 0;
8375
+ }
8376
+ return void 0;
8377
+ }
8378
+ function resolveSessionContextOptions(session, options) {
8379
+ const sessionToken = normalizeOptionalString(session?.session?.token);
8380
+ const requestCookie = readHeaderBagValue(options?.requestHeaders, "cookie") ?? readHeaderBagValue(options?.headers, "cookie");
8381
+ const authInput = options?.auth;
8382
+ const resolvedUserId = options?.userId !== void 0 ? options.userId : session?.user?.id;
8383
+ const resolvedOrganizationId = options?.organizationId !== void 0 ? options.organizationId : session?.session?.activeOrganizationId;
8384
+ const resolvedBearerToken = authInput?.bearerToken !== void 0 ? authInput.bearerToken : sessionToken;
8385
+ const resolvedSessionToken = authInput?.sessionToken !== void 0 ? authInput.sessionToken : sessionToken;
8386
+ const resolvedCookie = authInput?.cookie !== void 0 ? authInput.cookie : requestCookie;
8387
+ const auth = authInput !== void 0 || resolvedBearerToken !== void 0 || resolvedSessionToken !== void 0 || resolvedCookie !== void 0 ? {
8388
+ ...authInput ?? {},
8389
+ ...resolvedBearerToken !== void 0 ? { bearerToken: resolvedBearerToken } : {},
8390
+ ...resolvedSessionToken !== void 0 ? { sessionToken: resolvedSessionToken } : {},
8391
+ ...resolvedCookie !== void 0 ? { cookie: resolvedCookie } : {},
8392
+ headers: authInput?.headers ? { ...authInput.headers } : void 0
8393
+ } : void 0;
8394
+ if (resolvedUserId === void 0 && resolvedOrganizationId === void 0 && options?.forceNoCache === void 0 && !options?.headers && !auth) {
8395
+ return void 0;
8396
+ }
8397
+ return {
8398
+ userId: resolvedUserId,
8399
+ organizationId: resolvedOrganizationId,
8400
+ forceNoCache: options?.forceNoCache,
8401
+ headers: options?.headers ? { ...options.headers } : void 0,
8402
+ auth
8403
+ };
8404
+ }
8108
8405
  function resolveClientServiceBaseUrl(value, label) {
8109
8406
  if (value === void 0 || value === null) {
8110
8407
  return void 0;
@@ -8147,6 +8444,87 @@ function resolveRequiredClientApiKey(value) {
8147
8444
  }
8148
8445
  return normalizedValue;
8149
8446
  }
8447
+ function hasHeaderIgnoreCase(headers, targetKey) {
8448
+ const normalizedTargetKey = targetKey.toLowerCase();
8449
+ return Object.keys(headers).some((key) => key.toLowerCase() === normalizedTargetKey);
8450
+ }
8451
+ function mergeClientHeaders(current, next) {
8452
+ if (!current && !next) {
8453
+ return void 0;
8454
+ }
8455
+ return {
8456
+ ...current ?? {},
8457
+ ...next ?? {}
8458
+ };
8459
+ }
8460
+ function mergeDefinedObject(current, next) {
8461
+ if (!current && !next) {
8462
+ return void 0;
8463
+ }
8464
+ const merged = {
8465
+ ...current ?? {}
8466
+ };
8467
+ const mutableMerged = merged;
8468
+ for (const [key, value] of Object.entries(next ?? {})) {
8469
+ if (value !== void 0) {
8470
+ mutableMerged[key] = value;
8471
+ }
8472
+ }
8473
+ return merged;
8474
+ }
8475
+ function mergeAuthClientOptions(current, next) {
8476
+ const merged = mergeDefinedObject(current, next);
8477
+ if (!merged) {
8478
+ return void 0;
8479
+ }
8480
+ const mergedHeaders = mergeClientHeaders(current?.headers, next?.headers);
8481
+ if (mergedHeaders) {
8482
+ merged.headers = mergedHeaders;
8483
+ }
8484
+ return merged;
8485
+ }
8486
+ function mergeServiceUrlOverrides(current, next) {
8487
+ return mergeDefinedObject(current, next);
8488
+ }
8489
+ function toClientContextOverrides(context) {
8490
+ if (!context) {
8491
+ return void 0;
8492
+ }
8493
+ return {
8494
+ userId: context.userId,
8495
+ organizationId: context.organizationId,
8496
+ forceNoCache: context.forceNoCache,
8497
+ headers: context.headers,
8498
+ auth: context.auth ? {
8499
+ ...context.auth,
8500
+ headers: context.auth.headers ? { ...context.auth.headers } : void 0
8501
+ } : void 0
8502
+ };
8503
+ }
8504
+ function mergeClientOverrideOptions(base, overrides) {
8505
+ if (!overrides) {
8506
+ return {
8507
+ ...base,
8508
+ headers: base.headers ? { ...base.headers } : void 0,
8509
+ auth: base.auth ? {
8510
+ ...base.auth,
8511
+ headers: base.auth.headers ? { ...base.auth.headers } : void 0
8512
+ } : void 0,
8513
+ db: base.db ? { ...base.db } : void 0,
8514
+ gateway: base.gateway ? { ...base.gateway } : void 0,
8515
+ storage: base.storage ? { ...base.storage } : void 0
8516
+ };
8517
+ }
8518
+ const merged = mergeDefinedObject(base, overrides) ?? { ...base };
8519
+ return {
8520
+ ...merged,
8521
+ headers: mergeClientHeaders(base.headers, overrides.headers),
8522
+ auth: mergeAuthClientOptions(base.auth, overrides.auth),
8523
+ db: mergeServiceUrlOverrides(base.db, overrides.db),
8524
+ gateway: mergeServiceUrlOverrides(base.gateway, overrides.gateway),
8525
+ storage: mergeServiceUrlOverrides(base.storage, overrides.storage)
8526
+ };
8527
+ }
8150
8528
  function normalizeAuthClientConfig(auth, defaultBaseUrl) {
8151
8529
  if (!auth && defaultBaseUrl === void 0) {
8152
8530
  return void 0;
@@ -8156,6 +8534,8 @@ function normalizeAuthClientConfig(auth, defaultBaseUrl) {
8156
8534
  baseUrl,
8157
8535
  apiKey,
8158
8536
  bearerToken,
8537
+ cookie,
8538
+ sessionToken,
8159
8539
  ...rest
8160
8540
  } = auth ?? {};
8161
8541
  const normalized = {
@@ -8174,6 +8554,12 @@ function normalizeAuthClientConfig(auth, defaultBaseUrl) {
8174
8554
  if (typeof bearerToken === "string") {
8175
8555
  normalized.bearerToken = bearerToken;
8176
8556
  }
8557
+ if (typeof cookie === "string") {
8558
+ normalized.cookie = cookie;
8559
+ }
8560
+ if (typeof sessionToken === "string") {
8561
+ normalized.sessionToken = sessionToken;
8562
+ }
8177
8563
  return normalized;
8178
8564
  }
8179
8565
  function resolveCreateClientConfig(config) {
@@ -8187,6 +8573,9 @@ function resolveCreateClientConfig(config) {
8187
8573
  baseUrl: resolvedUrls.dbUrl,
8188
8574
  apiKey: resolveRequiredClientApiKey(config.key),
8189
8575
  client: resolveOptionalClientName(config.client),
8576
+ userId: config.userId,
8577
+ organizationId: config.organizationId,
8578
+ forceNoCache: config.forceNoCache,
8190
8579
  backend: toBackendConfig(config.backend),
8191
8580
  headers: config.headers,
8192
8581
  auth: config.auth,
@@ -8195,23 +8584,39 @@ function resolveCreateClientConfig(config) {
8195
8584
  experimental: config.experimental
8196
8585
  };
8197
8586
  }
8198
- function createClientFromConfig(config) {
8587
+ function createClientFromInput(sourceConfig) {
8588
+ return createClientFromConfig(resolveCreateClientConfig(sourceConfig), sourceConfig);
8589
+ }
8590
+ function createClientFromConfig(config, sourceConfig) {
8591
+ const normalizedAuthConfig = normalizeAuthClientConfig(config.auth, config.authUrl);
8199
8592
  const gatewayHeaders = {
8200
8593
  ...config.headers ?? {}
8201
8594
  };
8202
- if (config.auth?.bearerToken && gatewayHeaders["X-Athena-Auth-Bearer-Token"] === void 0 && gatewayHeaders["x-athena-auth-bearer-token"] === void 0) {
8203
- gatewayHeaders["X-Athena-Auth-Bearer-Token"] = config.auth.bearerToken;
8595
+ if (normalizedAuthConfig?.bearerToken && !hasHeaderIgnoreCase(gatewayHeaders, "X-Athena-Auth-Bearer-Token")) {
8596
+ gatewayHeaders["X-Athena-Auth-Bearer-Token"] = normalizedAuthConfig.bearerToken;
8597
+ }
8598
+ if (normalizedAuthConfig?.cookie && !hasHeaderIgnoreCase(gatewayHeaders, "Cookie")) {
8599
+ gatewayHeaders.Cookie = normalizedAuthConfig.cookie;
8600
+ }
8601
+ if (normalizedAuthConfig?.sessionToken && !hasHeaderIgnoreCase(gatewayHeaders, "X-Athena-Auth-Session-Token")) {
8602
+ gatewayHeaders["X-Athena-Auth-Session-Token"] = normalizedAuthConfig.sessionToken;
8204
8603
  }
8205
8604
  const gateway = createAthenaGatewayClient({
8206
8605
  baseUrl: config.baseUrl,
8207
8606
  apiKey: config.apiKey,
8208
8607
  client: config.client,
8608
+ userId: config.userId,
8609
+ organizationId: config.organizationId,
8610
+ forceNoCache: config.forceNoCache,
8209
8611
  backend: config.backend,
8210
8612
  headers: gatewayHeaders
8211
8613
  });
8212
8614
  const formatGatewayResult = createResultFormatter(config.experimental);
8213
8615
  const queryTracer = createQueryTracer(config.experimental);
8214
- const auth = createAuthClient(normalizeAuthClientConfig(config.auth, config.authUrl));
8616
+ const auth = createAuthClient({
8617
+ ...normalizedAuthConfig ?? {},
8618
+ ...config.forceNoCache ? { forceNoCache: true } : {}
8619
+ });
8215
8620
  function from(tableOrModel, options) {
8216
8621
  if (isAthenaModelTarget(tableOrModel)) {
8217
8622
  if (options?.schema !== void 0) {
@@ -8259,17 +8664,45 @@ function createClientFromConfig(config) {
8259
8664
  queryTracer
8260
8665
  );
8261
8666
  const db = createDbModule({ from, rpc, query });
8667
+ const withContext = (context) => createClientFromInput(
8668
+ mergeClientOverrideOptions(sourceConfig, toClientContextOverrides(context))
8669
+ );
8670
+ const withSession = (session, options) => createClientFromInput(
8671
+ mergeClientOverrideOptions(
8672
+ sourceConfig,
8673
+ toClientContextOverrides(resolveSessionContextOptions(session, options))
8674
+ )
8675
+ );
8676
+ const authWithOptions = (options) => createClientFromInput(mergeClientOverrideOptions(sourceConfig, options));
8262
8677
  const sdkClient = {
8263
8678
  from,
8264
8679
  db,
8265
8680
  rpc,
8266
8681
  query,
8267
8682
  verifyConnection: gateway.verifyConnection,
8268
- auth: auth.auth
8683
+ auth: auth.auth,
8684
+ withContext,
8685
+ withSession,
8686
+ withOptions: authWithOptions
8269
8687
  };
8270
8688
  if (config.experimental?.athenaStorageBackend) {
8689
+ const storageWithContext = (context) => createClientFromInput(
8690
+ mergeClientOverrideOptions(sourceConfig, toClientContextOverrides(context))
8691
+ );
8692
+ const storageWithSession = (session, options) => createClientFromInput(
8693
+ mergeClientOverrideOptions(
8694
+ sourceConfig,
8695
+ toClientContextOverrides(resolveSessionContextOptions(session, options))
8696
+ )
8697
+ );
8698
+ const storageWithOptions = (options) => createClientFromInput(
8699
+ mergeClientOverrideOptions(sourceConfig, options)
8700
+ );
8271
8701
  const storageClient = {
8272
8702
  ...sdkClient,
8703
+ withContext: storageWithContext,
8704
+ withSession: storageWithSession,
8705
+ withOptions: storageWithOptions,
8273
8706
  storage: createStorageModule(gateway, {
8274
8707
  ...config.experimental.storage,
8275
8708
  ...config.storageUrl ? {
@@ -8285,38 +8718,42 @@ function createClientFromConfig(config) {
8285
8718
  var AthenaClient = class {
8286
8719
  /** Create a fluent builder for a strongly-typed Athena SDK client. */
8287
8720
  static builder() {
8288
- return createAthenaClientBuilder((config) => createClientFromConfig(resolveCreateClientConfig(config)));
8289
- }
8290
- /** Build a client from process environment variables. */
8291
- static fromEnvironment() {
8292
- const url = process.env.ATHENA_URL;
8293
- const gatewayUrl = process.env.ATHENA_DB_URL ?? process.env.ATHENA_GATEWAY_URL;
8294
- const authUrl = process.env.ATHENA_AUTH_URL;
8295
- const storageUrl = process.env.ATHENA_STORAGE_URL;
8296
- const key = process.env.ATHENA_API_KEY ?? process.env.ATHENA_GATEWAY_API_KEY;
8721
+ return createAthenaClientBuilder((config) => createClientFromInput(config));
8722
+ }
8723
+ static fromEnvironment(options = {}) {
8724
+ const env = options.env ?? process.env;
8725
+ const url = options.url ?? readFirstEnvValue(env, ATHENA_ENV_URL_KEYS);
8726
+ const gatewayUrl = options.gatewayUrl ?? readFirstEnvValue(env, ATHENA_ENV_GATEWAY_URL_KEYS);
8727
+ const authUrl = options.authUrl ?? readFirstEnvValue(env, ATHENA_ENV_AUTH_URL_KEYS);
8728
+ const storageUrl = options.storageUrl ?? readFirstEnvValue(env, ATHENA_ENV_STORAGE_URL_KEYS);
8729
+ const key = options.key ?? readFirstEnvValue(env, ATHENA_ENV_KEY_KEYS);
8730
+ const client = options.client ?? readFirstEnvValue(env, ATHENA_ENV_CLIENT_KEYS);
8297
8731
  if (!url && !gatewayUrl || !key) {
8298
8732
  throw new Error(
8299
- "ATHENA_API_KEY plus ATHENA_URL or ATHENA_GATEWAY_URL (optionally ATHENA_DB_URL, ATHENA_AUTH_URL, ATHENA_STORAGE_URL) are required"
8733
+ "AthenaClient.fromEnvironment() requires an API key plus a public or gateway URL. Supported aliases include ATHENA_API_KEY, NEXT_PUBLIC_ATHENA_API_KEY, ATHENA_GATEWAY_API_KEY, X_API_KEY, ATHENA_URL, NEXT_PUBLIC_ATHENA_URL, ATHENA_GATEWAY_URL, and ATHENA_DB_URL."
8300
8734
  );
8301
8735
  }
8736
+ const { env: _env, ...clientOptions } = options;
8302
8737
  return createClient({
8738
+ ...clientOptions,
8303
8739
  url,
8304
8740
  gatewayUrl,
8305
8741
  authUrl,
8306
8742
  storageUrl,
8307
- key
8743
+ key,
8744
+ client
8308
8745
  });
8309
8746
  }
8310
8747
  };
8311
8748
  function createClient(configOrUrl, apiKey, options) {
8312
8749
  if (typeof configOrUrl === "string" || configOrUrl === null || configOrUrl === void 0) {
8313
- return createClientFromConfig(resolveCreateClientConfig({
8750
+ return createClientFromInput({
8314
8751
  url: configOrUrl,
8315
8752
  key: apiKey ?? "",
8316
8753
  ...options
8317
- }));
8754
+ });
8318
8755
  }
8319
- return createClientFromConfig(resolveCreateClientConfig(configOrUrl));
8756
+ return createClientFromInput(configOrUrl);
8320
8757
  }
8321
8758
 
8322
8759
  // src/gateway/types.ts
@@ -8682,6 +9119,9 @@ function createColumnsBuilder(name, mappedName, schemaName, columns) {
8682
9119
  resolveTableTarget(name, mappedName, normalizedSchemaName);
8683
9120
  return createColumnsBuilder(name, mappedName, normalizedSchemaName, columns);
8684
9121
  },
9122
+ withoutPrimaryKey() {
9123
+ return finalizeTable(name, mappedName, schemaName, columns, []);
9124
+ },
8685
9125
  primaryKey(...keys) {
8686
9126
  return finalizeTable(name, mappedName, schemaName, columns, keys);
8687
9127
  }
@@ -8733,6 +9173,59 @@ var TenantHeaderMapper = class {
8733
9173
  return Object.keys(headers).length > 0 ? headers : void 0;
8734
9174
  }
8735
9175
  };
9176
+ function normalizeOptionalString2(value) {
9177
+ if (typeof value !== "string") {
9178
+ return void 0;
9179
+ }
9180
+ const normalizedValue = value.trim();
9181
+ return normalizedValue ? normalizedValue : void 0;
9182
+ }
9183
+ function readHeaderBagValue2(headers, targetKey) {
9184
+ if (!headers) {
9185
+ return void 0;
9186
+ }
9187
+ if (typeof headers.get === "function") {
9188
+ return normalizeOptionalString2(headers.get(targetKey));
9189
+ }
9190
+ const normalizedTargetKey = targetKey.toLowerCase();
9191
+ for (const [key, value] of Object.entries(headers)) {
9192
+ if (key.toLowerCase() !== normalizedTargetKey) {
9193
+ continue;
9194
+ }
9195
+ if (typeof value === "string") {
9196
+ return normalizeOptionalString2(value);
9197
+ }
9198
+ return void 0;
9199
+ }
9200
+ return void 0;
9201
+ }
9202
+ function resolveSessionContextOptions2(session, options) {
9203
+ const sessionToken = normalizeOptionalString2(session?.session?.token);
9204
+ const requestCookie = readHeaderBagValue2(options?.requestHeaders, "cookie") ?? readHeaderBagValue2(options?.headers, "cookie");
9205
+ const authInput = options?.auth;
9206
+ const resolvedUserId = options?.userId !== void 0 ? options.userId : session?.user?.id;
9207
+ const resolvedOrganizationId = options?.organizationId !== void 0 ? options.organizationId : session?.session?.activeOrganizationId;
9208
+ const resolvedBearerToken = authInput?.bearerToken !== void 0 ? authInput.bearerToken : sessionToken;
9209
+ const resolvedSessionToken = authInput?.sessionToken !== void 0 ? authInput.sessionToken : sessionToken;
9210
+ const resolvedCookie = authInput?.cookie !== void 0 ? authInput.cookie : requestCookie;
9211
+ const auth = authInput !== void 0 || resolvedBearerToken !== void 0 || resolvedSessionToken !== void 0 || resolvedCookie !== void 0 ? {
9212
+ ...authInput ?? {},
9213
+ ...resolvedBearerToken !== void 0 ? { bearerToken: resolvedBearerToken } : {},
9214
+ ...resolvedSessionToken !== void 0 ? { sessionToken: resolvedSessionToken } : {},
9215
+ ...resolvedCookie !== void 0 ? { cookie: resolvedCookie } : {},
9216
+ headers: authInput?.headers ? { ...authInput.headers } : void 0
9217
+ } : void 0;
9218
+ if (resolvedUserId === void 0 && resolvedOrganizationId === void 0 && options?.forceNoCache === void 0 && !options?.headers && !auth) {
9219
+ return void 0;
9220
+ }
9221
+ return {
9222
+ userId: resolvedUserId,
9223
+ organizationId: resolvedOrganizationId,
9224
+ forceNoCache: options?.forceNoCache,
9225
+ headers: options?.headers ? { ...options.headers } : void 0,
9226
+ auth
9227
+ };
9228
+ }
8736
9229
  var RegistryNavigator = class {
8737
9230
  constructor(registry) {
8738
9231
  this.registry = registry;
@@ -8784,12 +9277,22 @@ var TypedAthenaClientImpl = class _TypedAthenaClientImpl {
8784
9277
  backend: input.options?.backend,
8785
9278
  client: input.options?.client,
8786
9279
  headers: input.options?.headers,
9280
+ forceNoCache: input.options?.forceNoCache,
9281
+ userId: input.options?.userId,
9282
+ organizationId: input.options?.organizationId,
9283
+ auth: input.options?.auth,
9284
+ tenantKeyMap,
9285
+ tenantContext,
8787
9286
  experimental: input.options?.experimental
8788
9287
  };
8789
9288
  this.baseClient = createClient(this.url, this.apiKey, {
8790
9289
  backend: this.clientOptions.backend,
8791
9290
  client: this.clientOptions.client,
8792
9291
  headers: this.tenantHeaderMapper.apply(this.clientOptions.headers, tenantContext),
9292
+ forceNoCache: this.clientOptions.forceNoCache,
9293
+ userId: this.clientOptions.userId,
9294
+ organizationId: this.clientOptions.organizationId,
9295
+ auth: this.clientOptions.auth,
8793
9296
  experimental: this.clientOptions.experimental
8794
9297
  });
8795
9298
  this.db = this.baseClient.db;
@@ -8807,6 +9310,40 @@ var TypedAthenaClientImpl = class _TypedAthenaClientImpl {
8807
9310
  verifyConnection(options) {
8808
9311
  return this.baseClient.verifyConnection(options);
8809
9312
  }
9313
+ withContext(context) {
9314
+ const headers = {
9315
+ ...this.clientOptions.headers ?? {},
9316
+ ...context?.headers ?? {}
9317
+ };
9318
+ const auth = this.clientOptions.auth || context?.auth ? {
9319
+ ...this.clientOptions.auth ?? {},
9320
+ ...context?.auth ?? {},
9321
+ headers: this.clientOptions.auth?.headers || context?.auth?.headers ? {
9322
+ ...this.clientOptions.auth?.headers ?? {},
9323
+ ...context?.auth?.headers ?? {}
9324
+ } : void 0
9325
+ } : void 0;
9326
+ return new _TypedAthenaClientImpl({
9327
+ registry: this.registry,
9328
+ url: this.url,
9329
+ apiKey: this.apiKey,
9330
+ options: {
9331
+ ...this.clientOptions,
9332
+ headers: Object.keys(headers).length > 0 ? headers : void 0,
9333
+ auth,
9334
+ tenantKeyMap: this.tenantKeyMap,
9335
+ tenantContext: {
9336
+ ...this.tenantContext
9337
+ },
9338
+ ...context?.userId !== void 0 ? { userId: context.userId } : {},
9339
+ ...context?.organizationId !== void 0 ? { organizationId: context.organizationId } : {},
9340
+ ...context?.forceNoCache !== void 0 ? { forceNoCache: context.forceNoCache } : {}
9341
+ }
9342
+ });
9343
+ }
9344
+ withSession(session, options) {
9345
+ return this.withContext(resolveSessionContextOptions2(session, options));
9346
+ }
8810
9347
  withTenantContext(context) {
8811
9348
  return new _TypedAthenaClientImpl({
8812
9349
  registry: this.registry,
@@ -8867,6 +9404,77 @@ function resolveProviderSchemas(providerConfig) {
8867
9404
  return [...DEFAULT_POSTGRES_SCHEMAS];
8868
9405
  }
8869
9406
 
9407
+ // src/generator/table-selection.ts
9408
+ function normalizeTableSelector(value) {
9409
+ const trimmed = value.trim();
9410
+ return trimmed.length > 0 ? trimmed : void 0;
9411
+ }
9412
+ function normalizeTableSelection(value) {
9413
+ if (typeof value === "string") {
9414
+ return Array.from(
9415
+ new Set(
9416
+ value.split(",").map(normalizeTableSelector).filter((entry) => Boolean(entry))
9417
+ )
9418
+ );
9419
+ }
9420
+ if (Array.isArray(value)) {
9421
+ return Array.from(
9422
+ new Set(
9423
+ value.map((entry) => typeof entry === "string" ? normalizeTableSelector(entry) : void 0).filter((entry) => Boolean(entry))
9424
+ )
9425
+ );
9426
+ }
9427
+ return [];
9428
+ }
9429
+ function matchesTableSelector(schemaName, tableName, selector) {
9430
+ const separatorIndex = selector.indexOf(".");
9431
+ if (separatorIndex < 0) {
9432
+ return tableName === selector;
9433
+ }
9434
+ const selectorSchema = selector.slice(0, separatorIndex).trim();
9435
+ const selectorTable = selector.slice(separatorIndex + 1).trim();
9436
+ return selectorSchema === schemaName && selectorTable === tableName;
9437
+ }
9438
+ function shouldKeepTable(schemaName, tableName, filter) {
9439
+ const included = filter.includeTables.length === 0 || filter.includeTables.some((selector) => matchesTableSelector(schemaName, tableName, selector));
9440
+ if (!included) {
9441
+ return false;
9442
+ }
9443
+ return !filter.excludeTables.some((selector) => matchesTableSelector(schemaName, tableName, selector));
9444
+ }
9445
+ function hasTableFilters(filter) {
9446
+ return filter.includeTables.length > 0 || filter.excludeTables.length > 0;
9447
+ }
9448
+ function filterIntrospectionSnapshot(snapshot, filter) {
9449
+ if (!hasTableFilters(filter)) {
9450
+ return snapshot;
9451
+ }
9452
+ const schemas = {};
9453
+ for (const [schemaName, schema] of Object.entries(snapshot.schemas)) {
9454
+ const tables = Object.fromEntries(
9455
+ Object.entries(schema.tables).filter(([tableName]) => shouldKeepTable(schemaName, tableName, filter))
9456
+ );
9457
+ if (Object.keys(tables).length === 0) {
9458
+ continue;
9459
+ }
9460
+ schemas[schemaName] = {
9461
+ ...schema,
9462
+ tables
9463
+ };
9464
+ }
9465
+ if (Object.keys(schemas).length === 0) {
9466
+ const includeLabel = filter.includeTables.length > 0 ? ` includeTables=${filter.includeTables.join(", ")}` : "";
9467
+ const excludeLabel = filter.excludeTables.length > 0 ? ` excludeTables=${filter.excludeTables.join(", ")}` : "";
9468
+ throw new Error(
9469
+ `Generator table filters matched no tables after schema selection.${includeLabel}${excludeLabel}`
9470
+ );
9471
+ }
9472
+ return {
9473
+ ...snapshot,
9474
+ schemas
9475
+ };
9476
+ }
9477
+
8870
9478
  // src/generator/env.ts
8871
9479
  function readEnvStringValue(key) {
8872
9480
  if (typeof process === "undefined" || !process.env) {
@@ -9525,7 +10133,12 @@ async function runSchemaGenerator(options = {}) {
9525
10133
  return throwBrowserUnsupported("runSchemaGenerator");
9526
10134
  }
9527
10135
 
10136
+ exports.ATHENA_AUTH_ADMIN_LIMITS = ATHENA_AUTH_ADMIN_LIMITS;
9528
10137
  exports.ATHENA_AUTH_BASE_ERROR_CODES = ATHENA_AUTH_BASE_ERROR_CODES;
10138
+ exports.ATHENA_AUTH_MAX_ADMIN_JSON_BYTES = ATHENA_AUTH_MAX_ADMIN_JSON_BYTES;
10139
+ exports.ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH = ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH;
10140
+ exports.ATHENA_AUTH_MAX_TEMPLATE_VARIABLES = ATHENA_AUTH_MAX_TEMPLATE_VARIABLES;
10141
+ exports.ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH = ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH;
9529
10142
  exports.AthenaClient = AthenaClient;
9530
10143
  exports.AthenaError = AthenaError;
9531
10144
  exports.AthenaErrorCategory = AthenaErrorCategory;
@@ -9555,6 +10168,7 @@ exports.defineModel = defineModel;
9555
10168
  exports.defineRegistry = defineRegistry;
9556
10169
  exports.defineSchema = defineSchema;
9557
10170
  exports.enumeration = enumeration;
10171
+ exports.filterIntrospectionSnapshot = filterIntrospectionSnapshot;
9558
10172
  exports.findGeneratorConfigPath = findGeneratorConfigPath;
9559
10173
  exports.generateArtifactsFromSnapshot = generateArtifactsFromSnapshot;
9560
10174
  exports.generatorEnv = generatorEnv;
@@ -9568,6 +10182,7 @@ exports.normalizeAthenaError = normalizeAthenaError;
9568
10182
  exports.normalizeAthenaGatewayBaseUrl = normalizeAthenaGatewayBaseUrl;
9569
10183
  exports.normalizeGeneratorConfig = normalizeGeneratorConfig;
9570
10184
  exports.normalizeSchemaSelection = normalizeSchemaSelection;
10185
+ exports.normalizeTableSelection = normalizeTableSelection;
9571
10186
  exports.number = number;
9572
10187
  exports.parseBooleanFlag = parseBooleanFlag2;
9573
10188
  exports.renderAthenaReactEmail = renderAthenaReactEmail;