@xylex-group/athena 2.13.0 → 3.0.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 (79) hide show
  1. package/README.md +91 -1398
  2. package/bin/athena-js.js +0 -0
  3. package/dist/admin.d.cts +1 -1
  4. package/dist/admin.d.ts +1 -1
  5. package/dist/billing.cjs +1199 -0
  6. package/dist/billing.cjs.map +1 -0
  7. package/dist/billing.d.cts +230 -0
  8. package/dist/billing.d.ts +230 -0
  9. package/dist/billing.js +1194 -0
  10. package/dist/billing.js.map +1 -0
  11. package/dist/browser.cjs +8934 -8075
  12. package/dist/browser.cjs.map +1 -1
  13. package/dist/browser.d.cts +11 -10
  14. package/dist/browser.d.ts +11 -10
  15. package/dist/browser.js +8931 -8073
  16. package/dist/browser.js.map +1 -1
  17. package/dist/cli/index.cjs +8328 -7062
  18. package/dist/cli/index.cjs.map +1 -1
  19. package/dist/cli/index.d.cts +4 -4
  20. package/dist/cli/index.d.ts +4 -4
  21. package/dist/cli/index.js +8328 -7062
  22. package/dist/cli/index.js.map +1 -1
  23. package/dist/index.cjs +9391 -8526
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +11 -10
  26. package/dist/index.d.ts +11 -10
  27. package/dist/index.js +9384 -8524
  28. package/dist/index.js.map +1 -1
  29. package/dist/{model-form-Dw4zEL5a.d.cts → model-form-BEfCGB5b.d.cts} +2 -2
  30. package/dist/{model-form-yRg71q3H.d.ts → model-form-BKetpu6Q.d.ts} +2 -2
  31. package/dist/module-8dSMcy0K.d.cts +326 -0
  32. package/dist/module-8dSMcy0K.d.ts +326 -0
  33. package/dist/{module-DBteUIob.d.ts → module-Bef_MAPO.d.ts} +6 -52
  34. package/dist/{module-yoX49uQC.d.cts → module-CrrSmpML.d.cts} +6 -52
  35. package/dist/next/client.cjs +2 -8668
  36. package/dist/next/client.cjs.map +1 -1
  37. package/dist/next/client.d.cts +1 -27
  38. package/dist/next/client.d.ts +1 -27
  39. package/dist/next/client.js +3 -8668
  40. package/dist/next/client.js.map +1 -1
  41. package/dist/next/server.cjs +79 -8779
  42. package/dist/next/server.cjs.map +1 -1
  43. package/dist/next/server.d.cts +30 -46
  44. package/dist/next/server.d.ts +30 -46
  45. package/dist/next/server.js +79 -8779
  46. package/dist/next/server.js.map +1 -1
  47. package/dist/{payload-DEOWN_oo.d.ts → payload-DWI1rw-e.d.cts} +1 -35
  48. package/dist/{payload-BzVbUgY_.d.cts → payload-DWI1rw-e.d.ts} +1 -35
  49. package/dist/{pipeline-Bj6RWt1A.d.ts → pipeline-BXFQbsUW.d.ts} +1 -1
  50. package/dist/{pipeline-Dwck-wZO.d.cts → pipeline-Dfsed4VD.d.cts} +1 -1
  51. package/dist/react.cjs +114 -13
  52. package/dist/react.cjs.map +1 -1
  53. package/dist/react.d.cts +46 -16
  54. package/dist/react.d.ts +46 -16
  55. package/dist/react.js +113 -14
  56. package/dist/react.js.map +1 -1
  57. package/dist/social-providers.cjs +33 -24
  58. package/dist/social-providers.cjs.map +1 -1
  59. package/dist/social-providers.d.cts +79 -82
  60. package/dist/social-providers.d.ts +79 -82
  61. package/dist/social-providers.js +33 -24
  62. package/dist/social-providers.js.map +1 -1
  63. package/dist/{types-eAKAh71s.d.cts → types-AOY-GLu8.d.cts} +27 -54
  64. package/dist/{types-eAKAh71s.d.ts → types-AOY-GLu8.d.ts} +27 -54
  65. package/dist/{types-CH78O90i.d.cts → types-Bltx6iL6.d.cts} +4 -6
  66. package/dist/{types-CH78O90i.d.ts → types-Bltx6iL6.d.ts} +4 -6
  67. package/dist/{types-DPgejxYC.d.ts → types-CK7cBQbC.d.ts} +2 -2
  68. package/dist/{types-CjC9_5ZQ.d.cts → types-Z3-rsiM3.d.cts} +2 -2
  69. package/dist/{types-BRP7sfSF.d.ts → types-jClgDy1J.d.ts} +2 -2
  70. package/dist/{types-BU8uJH_b.d.cts → types-kO_Ut5wU.d.cts} +2 -2
  71. package/dist/utils.cjs +7 -8
  72. package/dist/utils.cjs.map +1 -1
  73. package/dist/utils.d.cts +2 -5
  74. package/dist/utils.d.ts +2 -5
  75. package/dist/utils.js +7 -8
  76. package/dist/utils.js.map +1 -1
  77. package/dist/{client-DVOKSYDI.d.ts → v3-client-CuCNy-JJ.d.ts} +532 -470
  78. package/dist/{client-BJjUwDSg.d.cts → v3-client-G8JMOilK.d.cts} +532 -470
  79. package/package.json +31 -21
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { E as EnvLike } from './athena-auth-url-oLux_57a.js';
2
2
  export { A as ATHENA_AUTH_COOKIE_PREFIXES, o as ATHENA_AUTH_DISABLE_COOKIE_CACHE_QUERY_PARAM, p as ATHENA_AUTH_DISABLE_COOKIE_CACHE_QUERY_VALUE, q as ATHENA_AUTH_GET_SESSION_ABSOLUTE_PATH, t as ATHENA_AUTH_GET_SESSION_PATH, a as ATHENA_AUTH_PATH, b as ATHENA_AUTH_UPSTREAM_ENV_KEYS, c as ATHENA_AUTH_UPSTREAM_URL_ENV_NAMES, u as ATHENA_AUTH_VERIFY_EMAIL_PATH, v as ATHENA_SESSION_DATA_HEADER, w as AUTHENTICATED_REDIRECT_MODE_SET, x as AUTHENTICATED_REDIRECT_VIEW_SET, d as AUTH_DEFAULT_VIEW, y as AUTH_MODE_REDIRECTS, z as AUTH_MODE_SET, e as AUTH_ROUTES, B as AUTH_SESSION_PATH, F as AUTH_TWO_FACTOR_SEGMENT, f as AUTH_VIEW_BY_SEGMENT, G as AthenaAuthClientBaseUrlOptions, H as AthenaAuthUpstreamEnv, I as AthenaAuthUpstreamEnvKey, J as AuthMode, K as AuthModeRedirects, L as AuthRoutes, g as AuthView, C as ClearAuthCookiesOptions, D as DEFAULT_ATHENA_AUTH_ORIGIN, M as DEFAULT_ATHENA_AUTH_UPSTREAM_URL, N as DEFAULT_AUTH_COOKIE_PREFIXES, O as DISABLE_COOKIE_CACHE_QUERY_PARAM, P as DISABLE_COOKIE_CACHE_QUERY_VALUE, Q as LOCAL_DEV_ORIGIN, S as SESSION_DATA_HEADER, h as clearAuthCookies, R as createAuthModeRedirects, T as createAuthRoutes, U as createFreshSessionLookupUrl, i as isAbsoluteUrl, V as isAuthMode, n as normalizeAthenaAuthBaseUrl, W as readAthenaAuthUpstreamUrlFromEnv, r as resolveAthenaAuthClientBaseUrl, j as resolveAthenaAuthRequestUrl, k as resolveAthenaAuthUpstreamUrl, X as resolveAuthModeRedirect, l as resolveAuthViewFromSegment, m as resolveEmailVerificationCallbackUrl, Y as shouldRedirectAuthenticatedAuthMode, s as shouldRedirectAuthenticatedAuthView } from './athena-auth-url-oLux_57a.js';
3
3
  export { S as SESSION_COOKIE_PATTERNS, h as hasAuthSessionCookie } from './session-cookie-detection-BqOp9mO6.js';
4
- import { z as BackendOption } from './types-CH78O90i.js';
4
+ import { t as BackendOption } from './types-Bltx6iL6.js';
5
5
 
6
6
  declare function slugify(input: string): string;
7
7
 
@@ -90,8 +90,6 @@ interface BuildAthenaRequestHeadersInput {
90
90
  profile: AthenaRequestHeaderProfile;
91
91
  sdkHeaderValue: string;
92
92
  apiKey?: string | null;
93
- /** Overrides the canonical `X-Athena-Key` header value. */
94
- athenaKey?: string | null;
95
93
  client?: string | null;
96
94
  userId?: string | null;
97
95
  organizationId?: string | null;
@@ -112,7 +110,6 @@ interface BuildAthenaRequestHeadersInput {
112
110
  /** Shared config/call fields consumed by gateway, chat, auth, and `client.request(...)`. */
113
111
  interface AthenaRequestHeaderOverrideFields {
114
112
  apiKey?: string | null;
115
- athenaKey?: string | null;
116
113
  client?: string | null;
117
114
  userId?: string | null;
118
115
  organizationId?: string | null;
@@ -135,7 +132,7 @@ declare function buildServiceRequestHeaders(profile: Exclude<AthenaRequestHeader
135
132
  client?: string | null;
136
133
  stripNulls?: boolean;
137
134
  }): Record<string, string>;
138
- declare function applyAthenaApiKeyHeaders(headers: Record<string, string>, apiKey?: string | null, athenaKey?: string | null): void;
135
+ declare function applyAthenaApiKeyHeaders(headers: Record<string, string>, apiKey?: string | null): void;
139
136
  declare function applyAthenaAuthContextHeaders(headers: Record<string, string>, input: Pick<BuildAthenaRequestHeadersInput, 'bearerToken' | 'cookie' | 'sessionToken' | 'profile' | 'configHeaders' | 'callHeaders'>): void;
140
137
  declare function applyAthenaPgUriHeaders(headers: Record<string, string>, input: Pick<BuildAthenaRequestHeadersInput, 'pgUri' | 'jdbcUrl' | 'configHeaders' | 'callHeaders'>): void;
141
138
  /**
package/dist/utils.js CHANGED
@@ -626,7 +626,7 @@ var PROFILE_RULES = {
626
626
  gateway: { apiKeys: true, routing: true, authMirror: true, authBearer: false, contentType: true, stripNullsDefault: true },
627
627
  chat: { apiKeys: true, routing: true, authMirror: true, authBearer: true, accept: true },
628
628
  storage: { apiKeys: true, routing: true, authMirror: true, authBearer: false, contentType: true },
629
- auth: { apiKeys: true, routing: false, authMirror: false, authBearer: true, contentType: true },
629
+ auth: { apiKeys: true, routing: true, authMirror: false, authBearer: true, contentType: true },
630
630
  minimal: { apiKeys: false, routing: false, authMirror: false, authBearer: false }
631
631
  };
632
632
  function normalizeHeaderValue(value) {
@@ -686,7 +686,6 @@ function resolveBackendType(backend) {
686
686
  function resolveRequestHeaderOverrides(config, options, defaults) {
687
687
  return {
688
688
  apiKey: options?.apiKey ?? config.apiKey,
689
- athenaKey: options?.athenaKey ?? config.athenaKey,
690
689
  client: options?.client ?? config.client ?? defaults?.client,
691
690
  userId: options?.userId ?? config.userId,
692
691
  organizationId: options?.organizationId ?? config.organizationId,
@@ -716,10 +715,10 @@ function buildServiceRequestHeaders(profile, sdkHeaderValue, config, options, ex
716
715
  accept: extras?.accept ?? (rules.accept ? "application/json" : void 0)
717
716
  });
718
717
  }
719
- function applyAthenaApiKeyHeaders(headers, apiKey, athenaKey) {
720
- const resolvedAthenaKey = normalizeHeaderValue(athenaKey) ?? normalizeHeaderValue(apiKey);
721
- if (resolvedAthenaKey && !hasHeaderIgnoreCase(headers, "X-Athena-Key")) {
722
- headers["X-Athena-Key"] = resolvedAthenaKey;
718
+ function applyAthenaApiKeyHeaders(headers, apiKey) {
719
+ const resolvedApiKey = normalizeHeaderValue(apiKey);
720
+ if (resolvedApiKey && !hasHeaderIgnoreCase(headers, "X-Athena-Key")) {
721
+ headers["X-Athena-Key"] = resolvedApiKey;
723
722
  }
724
723
  }
725
724
  function applyAthenaAuthContextHeaders(headers, input) {
@@ -802,7 +801,7 @@ function buildAthenaRequestHeaders(input) {
802
801
  const headerClient = resolveHeaderValue(mergedExtraHeaders, CLIENT_HEADER_CANDIDATES);
803
802
  const finalClient = normalizeHeaderValue(input.client) ?? headerClient;
804
803
  const finalApiKey = normalizeHeaderValue(input.apiKey) ?? resolveHeaderValue(mergedExtraHeaders, API_KEY_HEADER_CANDIDATES);
805
- const finalAthenaKey = normalizeHeaderValue(input.athenaKey) ?? resolveHeaderValue(mergedExtraHeaders, ATHENA_KEY_HEADER_CANDIDATES) ?? finalApiKey;
804
+ const finalAthenaKey = resolveHeaderValue(mergedExtraHeaders, ATHENA_KEY_HEADER_CANDIDATES) ?? finalApiKey;
806
805
  const headers = {
807
806
  "X-Athena-Sdk": input.sdkHeaderValue
808
807
  };
@@ -836,7 +835,7 @@ function buildAthenaRequestHeaders(input) {
836
835
  }
837
836
  }
838
837
  if (rules.apiKeys && (finalApiKey || finalAthenaKey)) {
839
- applyAthenaApiKeyHeaders(headers, finalApiKey, finalAthenaKey);
838
+ applyAthenaApiKeyHeaders(headers, finalAthenaKey);
840
839
  }
841
840
  applyAthenaAuthContextHeaders(headers, input);
842
841
  applyAthenaPgUriHeaders(headers, input);