@fonderie/auth 7.10.0 → 7.11.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.
@@ -175,6 +175,7 @@ interface IRequestLocation {
175
175
  latitude?: number | null;
176
176
  longitude?: number | null;
177
177
  accuracyRadius?: number | null;
178
+ geonameId?: number | null;
178
179
  isp?: string | null;
179
180
  org?: string | null;
180
181
  asn?: string | null;
package/dist/index.cjs CHANGED
@@ -907,6 +907,10 @@ function radius(v) {
907
907
  if (typeof v !== "number" || !Number.isFinite(v) || v <= 0 || v > 2e4) return null;
908
908
  return Math.round(v);
909
909
  }
910
+ function placeId(v) {
911
+ const n = typeof v === "string" && /^\d{1,10}$/.test(v) ? Number(v) : v;
912
+ return typeof n === "number" && Number.isInteger(n) && n > 0 && n <= 2147483647 ? n : null;
913
+ }
910
914
  function sanitizeLocation(input) {
911
915
  if (!input || typeof input !== "object") return null;
912
916
  const i = input;
@@ -922,6 +926,7 @@ function sanitizeLocation(input) {
922
926
  latitude: coord(i["latitude"], 90),
923
927
  longitude: coord(i["longitude"], 180),
924
928
  accuracyRadius: radius(i["accuracyRadius"]),
929
+ geonameId: placeId(i["geonameId"]),
925
930
  isp: str(i["isp"]),
926
931
  org: str(i["org"]),
927
932
  asn: upperCode(i["asn"], /^AS\d{1,10}$/i),
@@ -3508,7 +3513,7 @@ var AuthModule = class {
3508
3513
  name = "@fonderie/auth";
3509
3514
  // Baked in at build time by tsup.base, so the operator's Modules page can
3510
3515
  // say what is actually deployed rather than 'not reported'.
3511
- version = "7.10.0";
3516
+ version = "7.11.1";
3512
3517
  // Users, sessions, login history, suspend — only through @fonderie/admin.
3513
3518
  describeAdmin() {
3514
3519
  return { routes: describeAuthAdminRoutes(this.store) };