@fonderie/client 1.0.1 → 1.2.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.
@@ -688,9 +688,31 @@ interface ILoginEventDTO {
688
688
  failureReason: string | null;
689
689
  ipAddress: string | null;
690
690
  userAgent: string | null;
691
+ location: IRequestLocationDTO | null;
691
692
  createdAt: string;
692
693
  }
693
694
 
695
+ interface IRequestLocationDTO {
696
+ country?: string;
697
+ countryName?: string;
698
+ subdivision?: string;
699
+ subdivisionName?: string;
700
+ city?: string;
701
+ postalCode?: string;
702
+ continent?: string;
703
+ timeZone?: string;
704
+ latitude?: number;
705
+ longitude?: number;
706
+ accuracyRadius?: number;
707
+ geonameId?: number;
708
+ isp?: string;
709
+ org?: string;
710
+ asn?: string;
711
+ mobile?: boolean;
712
+ proxy?: boolean;
713
+ hosting?: boolean;
714
+ }
715
+
694
716
  interface IAdminUserPageResult {
695
717
  users: IAdminUserDTO[];
696
718
  nextCursor: string | null;
@@ -706,6 +728,7 @@ interface ISessionDTO {
706
728
  current: boolean;
707
729
  ipAddress: string | null;
708
730
  userAgent: string | null;
731
+ location: IRequestLocationDTO | null;
709
732
  createdAt: string;
710
733
  expiresAt: string;
711
734
  }
@@ -1567,4 +1590,6 @@ interface IWorkspaceSettingsResult {
1567
1590
  type SubscriberType = 'user' | 'workspace';
1568
1591
 
1569
1592
  function isMfaRequired(result: ILoginResult | IMfaRequiredResult): result is IMfaRequiredResult
1593
+
1594
+ function describeLocation(loc: IRequestLocationDTO | null | undefined, countryName?: ((code: string) => string | undefined) | undefined): string | null
1570
1595
  ```
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ __export(index_exports, {
36
36
  WebhooksClient: () => WebhooksClient,
37
37
  WorkspacesClient: () => WorkspacesClient,
38
38
  createMemoryCache: () => createMemoryCache,
39
+ describeLocation: () => describeLocation,
39
40
  isMfaRequired: () => isMfaRequired
40
41
  });
41
42
  module.exports = __toCommonJS(index_exports);
@@ -2115,6 +2116,14 @@ var CourierAdminClient = class {
2115
2116
  function isMfaRequired(result) {
2116
2117
  return !("tokens" in result);
2117
2118
  }
2119
+ function describeLocation(loc, countryName) {
2120
+ if (!loc) return null;
2121
+ const country = loc.country ? countryName?.(loc.country) ?? loc.country : loc.countryName ?? void 0;
2122
+ const parts = [loc.city, loc.subdivision ?? loc.subdivisionName, country].filter(
2123
+ (p) => typeof p === "string" && p.length > 0
2124
+ );
2125
+ return parts.length > 0 ? parts.join(", ") : null;
2126
+ }
2118
2127
  // Annotate the CommonJS export names for ESM import in node:
2119
2128
  0 && (module.exports = {
2120
2129
  AdminClient,
@@ -2133,6 +2142,7 @@ function isMfaRequired(result) {
2133
2142
  WebhooksClient,
2134
2143
  WorkspacesClient,
2135
2144
  createMemoryCache,
2145
+ describeLocation,
2136
2146
  isMfaRequired
2137
2147
  });
2138
2148
  //# sourceMappingURL=index.cjs.map