authhero 0.283.0 → 0.285.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.
@@ -17312,10 +17312,11 @@ export interface GeoInfo {
17312
17312
  }
17313
17313
  export interface GeoAdapter {
17314
17314
  /**
17315
- * Get geo information from the current request
17315
+ * Get geo information from request headers
17316
+ * @param headers - Record of HTTP headers (lowercase keys)
17316
17317
  * @returns Geo information or null if not available
17317
17318
  */
17318
- getGeoInfo(): Promise<GeoInfo | null>;
17319
+ getGeoInfo(headers: Record<string, string>): Promise<GeoInfo | null>;
17319
17320
  }
17320
17321
  export interface DataAdapters {
17321
17322
  branding: BrandingAdapter;
package/dist/authhero.mjs CHANGED
@@ -1104,7 +1104,7 @@ class Yi extends $a {
1104
1104
  }, this.options.interpolation = {
1105
1105
  ...r.interpolation,
1106
1106
  ...this.options.interpolation
1107
- }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator);
1107
+ }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = r.overloadTranslationOptionHandler);
1108
1108
  const i = (d) => d ? typeof d == "function" ? new d() : d : null;
1109
1109
  if (!this.options.isClone) {
1110
1110
  this.modules.logger ? zt.init(i(this.modules.logger), this.options) : zt.init(null, this.options);
@@ -4837,15 +4837,19 @@ function fb(t, e) {
4837
4837
  H0() === "workerd" && t.executionCtx.waitUntil(e);
4838
4838
  }
4839
4839
  async function ie(t, e, n) {
4840
- const r = async () => {
4841
- let i;
4840
+ const r = {};
4841
+ t.req.raw?.headers && t.req.raw.headers.forEach((s, a) => {
4842
+ r[a.toLowerCase()] = s;
4843
+ });
4844
+ const i = async () => {
4845
+ let s;
4842
4846
  if (t.env.data.geo)
4843
4847
  try {
4844
- i = await t.env.data.geo.getGeoInfo() || void 0;
4845
- } catch (a) {
4846
- console.warn("Failed to get geo information:", a);
4848
+ s = await t.env.data.geo.getGeoInfo(r) || void 0;
4849
+ } catch (c) {
4850
+ console.warn("Failed to get geo information:", c);
4847
4851
  }
4848
- const s = {
4852
+ const a = {
4849
4853
  type: n.type,
4850
4854
  description: n.description || "",
4851
4855
  ip: t.var.ip,
@@ -4875,11 +4879,11 @@ async function ie(t, e, n) {
4875
4879
  strategy_type: n.strategy_type || "",
4876
4880
  audience: n.audience || "",
4877
4881
  scope: n.scope || "",
4878
- location_info: i
4882
+ location_info: s
4879
4883
  };
4880
- await t.env.data.logs.create(e, s);
4884
+ await t.env.data.logs.create(e, a);
4881
4885
  };
4882
- n.waitForCompletion ? await r() : fb(t, r());
4886
+ n.waitForCompletion ? await i() : fb(t, i());
4883
4887
  }
4884
4888
  class Ps {
4885
4889
  constructor(e, n) {
@@ -21691,6 +21695,8 @@ const j4 = new J().openapi(
21691
21695
  function Sc(t, e) {
21692
21696
  const n = {};
21693
21697
  for (const [r, i] of Object.entries(e)) {
21698
+ if (i == null)
21699
+ continue;
21694
21700
  const s = {};
21695
21701
  for (const [a, c] of Object.entries(
21696
21702
  i
@@ -21779,6 +21785,8 @@ function Cc(t, e) {
21779
21785
  keyPrefix: c
21780
21786
  } = e, l = new Set(s), d = a.length === 0, p = new Set(a), f = {};
21781
21787
  for (const [g, _] of Object.entries(t)) {
21788
+ if (_ == null)
21789
+ continue;
21782
21790
  const w = d || p.has(g), k = {};
21783
21791
  for (const [A, O] of Object.entries(
21784
21792
  _