@unifold/core 0.1.50 → 0.1.52

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.
package/dist/index.d.mts CHANGED
@@ -991,7 +991,9 @@ interface UserIpInfo {
991
991
  alpha2: string;
992
992
  alpha3?: string;
993
993
  country?: string;
994
+ /** @deprecated Use subdivisionCode instead */
994
995
  state?: string | null;
996
+ subdivisionCode?: string | null;
995
997
  ipAddress?: string;
996
998
  }
997
999
  /**
package/dist/index.d.ts CHANGED
@@ -991,7 +991,9 @@ interface UserIpInfo {
991
991
  alpha2: string;
992
992
  alpha3?: string;
993
993
  country?: string;
994
+ /** @deprecated Use subdivisionCode instead */
994
995
  state?: string | null;
996
+ subdivisionCode?: string | null;
995
997
  ipAddress?: string;
996
998
  }
997
999
  /**
package/dist/index.js CHANGED
@@ -803,11 +803,13 @@ function useUserIp() {
803
803
  queryKey: ["unifold", "userIpInfo"],
804
804
  queryFn: async () => {
805
805
  const data = await getIpAddress();
806
+ const subdivision = (data.subdivision_code || data.state || "").toLowerCase() || null;
806
807
  return {
807
808
  alpha2: data.alpha2.toLowerCase(),
808
809
  alpha3: data.alpha3?.toLowerCase(),
809
810
  country: data.country,
810
- state: data.state?.toLowerCase() ?? null,
811
+ state: subdivision,
812
+ subdivisionCode: subdivision,
811
813
  ipAddress: data.ip_address
812
814
  };
813
815
  },
package/dist/index.mjs CHANGED
@@ -735,11 +735,13 @@ function useUserIp() {
735
735
  queryKey: ["unifold", "userIpInfo"],
736
736
  queryFn: async () => {
737
737
  const data = await getIpAddress();
738
+ const subdivision = (data.subdivision_code || data.state || "").toLowerCase() || null;
738
739
  return {
739
740
  alpha2: data.alpha2.toLowerCase(),
740
741
  alpha3: data.alpha3?.toLowerCase(),
741
742
  country: data.country,
742
- state: data.state?.toLowerCase() ?? null,
743
+ state: subdivision,
744
+ subdivisionCode: subdivision,
743
745
  ipAddress: data.ip_address
744
746
  };
745
747
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifold/core",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
4
4
  "description": "Unifold Core SDK - Core types, API client, and business logic",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",