@fonderie/client 1.0.1 → 1.1.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,30 @@ 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
+ isp?: string;
708
+ org?: string;
709
+ asn?: string;
710
+ mobile?: boolean;
711
+ proxy?: boolean;
712
+ hosting?: boolean;
713
+ }
714
+
694
715
  interface IAdminUserPageResult {
695
716
  users: IAdminUserDTO[];
696
717
  nextCursor: string | null;
@@ -706,6 +727,7 @@ interface ISessionDTO {
706
727
  current: boolean;
707
728
  ipAddress: string | null;
708
729
  userAgent: string | null;
730
+ location: IRequestLocationDTO | null;
709
731
  createdAt: string;
710
732
  expiresAt: string;
711
733
  }
@@ -1567,4 +1589,6 @@ interface IWorkspaceSettingsResult {
1567
1589
  type SubscriberType = 'user' | 'workspace';
1568
1590
 
1569
1591
  function isMfaRequired(result: ILoginResult | IMfaRequiredResult): result is IMfaRequiredResult
1592
+
1593
+ function describeLocation(loc: IRequestLocationDTO | null | undefined, countryName?: ((code: string) => string | undefined) | undefined): string | null
1570
1594
  ```
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