@sendoracloud/sdk-react-native 1.26.0 → 1.27.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.
package/dist/index.cjs CHANGED
@@ -202,7 +202,7 @@ var Storage = class {
202
202
  // package.json
203
203
  var package_default = {
204
204
  name: "@sendoracloud/sdk-react-native",
205
- version: "1.26.0",
205
+ version: "1.27.0",
206
206
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth (incl. Game Center / Play Games), deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push-token registration and the no-arg Game Center / Play Games sign-in require a Dev Client (EAS Build or `npx expo prebuild`).",
207
207
  type: "module",
208
208
  main: "./dist/index.cjs",
@@ -984,6 +984,36 @@ var Auth = class {
984
984
  this.user = user;
985
985
  this.hooks.storage.set(USER_KEY, JSON.stringify(user));
986
986
  }
987
+ /**
988
+ * List the auth methods/identities linked to the current account (ADR-030
989
+ * read side, s58.270). Returns every social/gaming identity on this account
990
+ * plus a `hasPassword` flag — the cross-device / reinstall-durable source of
991
+ * truth for a "Connected: Game Center · Google" UI (an on-device tracker
992
+ * misses a link made on another device). Bearer-gated network read (NOT a
993
+ * cache read — `getUserSync()` only holds the primary `signupMethod`/
994
+ * `lastLoginMethod`). Resolves a FRESH access token first (mirrors
995
+ * `deleteAccount`). Firebase `user.providerData` / Supabase `user.identities`.
996
+ */
997
+ async listLinkedIdentities() {
998
+ const token = await this.getAccessToken();
999
+ if (!token) throw new AuthError("NOT_SIGNED_IN", "Sign in before listing linked identities");
1000
+ const res = await getJson(
1001
+ { apiUrl: this.hooks.apiUrl, publicKey: this.hooks.publicKey, debug: this.hooks.debug },
1002
+ "/api/v1/auth-service/me/identities",
1003
+ { Authorization: `Bearer ${token}` }
1004
+ );
1005
+ if (!res || !res.ok) throw new AuthError("NETWORK_ERROR", "Failed to list linked identities");
1006
+ let parsed;
1007
+ try {
1008
+ parsed = await res.json();
1009
+ } catch {
1010
+ throw new AuthError("PARSE_ERROR", `HTTP ${res.status}`);
1011
+ }
1012
+ if (!parsed.success || !parsed.data) {
1013
+ throw new AuthError(parsed.error?.code ?? "IDENTITIES_FAILED", parsed.error?.message ?? "Failed to list linked identities");
1014
+ }
1015
+ return { identities: parsed.data.identities ?? [], hasPassword: Boolean(parsed.data.hasPassword) };
1016
+ }
987
1017
  /**
988
1018
  * Shared gaming-identity sign-in. Mirrors `loginSocial`'s anon-takeover +
989
1019
  * ADR-025 link-in-place handling: reads the anon refresh BEFORE wiping local
package/dist/index.d.cts CHANGED
@@ -310,6 +310,17 @@ declare class AlreadyIdentifiedError extends Error {
310
310
  declare class CredentialInUseError extends Error {
311
311
  constructor(message?: string);
312
312
  }
313
+ /** One credential linked to an account (ADR-030 read side, s58.270). */
314
+ type LinkedIdentity = {
315
+ provider: string;
316
+ email: string | null;
317
+ linkedAt: string;
318
+ };
319
+ /** Response of `auth.listLinkedIdentities()` — the full connected-account set. */
320
+ type LinkedIdentitiesResponse = {
321
+ identities: LinkedIdentity[];
322
+ hasPassword: boolean;
323
+ };
313
324
  declare class AuthError extends Error {
314
325
  code: string;
315
326
  constructor(code: string, message: string);
@@ -676,6 +687,17 @@ declare class Auth {
676
687
  * user object + its storage copy are updated (no token/identity rotation).
677
688
  */
678
689
  private updateLocalUser;
690
+ /**
691
+ * List the auth methods/identities linked to the current account (ADR-030
692
+ * read side, s58.270). Returns every social/gaming identity on this account
693
+ * plus a `hasPassword` flag — the cross-device / reinstall-durable source of
694
+ * truth for a "Connected: Game Center · Google" UI (an on-device tracker
695
+ * misses a link made on another device). Bearer-gated network read (NOT a
696
+ * cache read — `getUserSync()` only holds the primary `signupMethod`/
697
+ * `lastLoginMethod`). Resolves a FRESH access token first (mirrors
698
+ * `deleteAccount`). Firebase `user.providerData` / Supabase `user.identities`.
699
+ */
700
+ listLinkedIdentities(): Promise<LinkedIdentitiesResponse>;
679
701
  /**
680
702
  * Shared gaming-identity sign-in. Mirrors `loginSocial`'s anon-takeover +
681
703
  * ADR-025 link-in-place handling: reads the anon refresh BEFORE wiping local
@@ -1651,4 +1673,4 @@ declare class SendoraSDK {
1651
1673
  }
1652
1674
  declare const SendoraCloud: SendoraSDK;
1653
1675
 
1654
- export { AlreadyIdentifiedError, type AttachLinkingApiOptions, Auth, AuthError, type AuthTokens, type AuthUser, CredentialInUseError, EmailAlreadyTakenError, type IdentifyTraits, type LinkCreateInput, type LinkCreateResult, type LinkData, LinkError, type LinkErrorCode, type LinkMatchInput, type LinkOpenedEvent, type LinkOpenedHandler, type LinkStats, Links, type PushTokenReceipt, type PushTokenRegistration, SendoraCloud, type SendoraConfig, type TrackProperties, computeDeviceFingerprint, SendoraCloud as default, extractShortcodeFromUrl, getPlayInstallReferrer };
1676
+ export { AlreadyIdentifiedError, type AttachLinkingApiOptions, Auth, AuthError, type AuthTokens, type AuthUser, CredentialInUseError, EmailAlreadyTakenError, type IdentifyTraits, type LinkCreateInput, type LinkCreateResult, type LinkData, LinkError, type LinkErrorCode, type LinkMatchInput, type LinkOpenedEvent, type LinkOpenedHandler, type LinkStats, type LinkedIdentitiesResponse, type LinkedIdentity, Links, type PushTokenReceipt, type PushTokenRegistration, SendoraCloud, type SendoraConfig, type TrackProperties, computeDeviceFingerprint, SendoraCloud as default, extractShortcodeFromUrl, getPlayInstallReferrer };
package/dist/index.d.ts CHANGED
@@ -310,6 +310,17 @@ declare class AlreadyIdentifiedError extends Error {
310
310
  declare class CredentialInUseError extends Error {
311
311
  constructor(message?: string);
312
312
  }
313
+ /** One credential linked to an account (ADR-030 read side, s58.270). */
314
+ type LinkedIdentity = {
315
+ provider: string;
316
+ email: string | null;
317
+ linkedAt: string;
318
+ };
319
+ /** Response of `auth.listLinkedIdentities()` — the full connected-account set. */
320
+ type LinkedIdentitiesResponse = {
321
+ identities: LinkedIdentity[];
322
+ hasPassword: boolean;
323
+ };
313
324
  declare class AuthError extends Error {
314
325
  code: string;
315
326
  constructor(code: string, message: string);
@@ -676,6 +687,17 @@ declare class Auth {
676
687
  * user object + its storage copy are updated (no token/identity rotation).
677
688
  */
678
689
  private updateLocalUser;
690
+ /**
691
+ * List the auth methods/identities linked to the current account (ADR-030
692
+ * read side, s58.270). Returns every social/gaming identity on this account
693
+ * plus a `hasPassword` flag — the cross-device / reinstall-durable source of
694
+ * truth for a "Connected: Game Center · Google" UI (an on-device tracker
695
+ * misses a link made on another device). Bearer-gated network read (NOT a
696
+ * cache read — `getUserSync()` only holds the primary `signupMethod`/
697
+ * `lastLoginMethod`). Resolves a FRESH access token first (mirrors
698
+ * `deleteAccount`). Firebase `user.providerData` / Supabase `user.identities`.
699
+ */
700
+ listLinkedIdentities(): Promise<LinkedIdentitiesResponse>;
679
701
  /**
680
702
  * Shared gaming-identity sign-in. Mirrors `loginSocial`'s anon-takeover +
681
703
  * ADR-025 link-in-place handling: reads the anon refresh BEFORE wiping local
@@ -1651,4 +1673,4 @@ declare class SendoraSDK {
1651
1673
  }
1652
1674
  declare const SendoraCloud: SendoraSDK;
1653
1675
 
1654
- export { AlreadyIdentifiedError, type AttachLinkingApiOptions, Auth, AuthError, type AuthTokens, type AuthUser, CredentialInUseError, EmailAlreadyTakenError, type IdentifyTraits, type LinkCreateInput, type LinkCreateResult, type LinkData, LinkError, type LinkErrorCode, type LinkMatchInput, type LinkOpenedEvent, type LinkOpenedHandler, type LinkStats, Links, type PushTokenReceipt, type PushTokenRegistration, SendoraCloud, type SendoraConfig, type TrackProperties, computeDeviceFingerprint, SendoraCloud as default, extractShortcodeFromUrl, getPlayInstallReferrer };
1676
+ export { AlreadyIdentifiedError, type AttachLinkingApiOptions, Auth, AuthError, type AuthTokens, type AuthUser, CredentialInUseError, EmailAlreadyTakenError, type IdentifyTraits, type LinkCreateInput, type LinkCreateResult, type LinkData, LinkError, type LinkErrorCode, type LinkMatchInput, type LinkOpenedEvent, type LinkOpenedHandler, type LinkStats, type LinkedIdentitiesResponse, type LinkedIdentity, Links, type PushTokenReceipt, type PushTokenRegistration, SendoraCloud, type SendoraConfig, type TrackProperties, computeDeviceFingerprint, SendoraCloud as default, extractShortcodeFromUrl, getPlayInstallReferrer };
package/dist/index.js CHANGED
@@ -157,7 +157,7 @@ var Storage = class {
157
157
  // package.json
158
158
  var package_default = {
159
159
  name: "@sendoracloud/sdk-react-native",
160
- version: "1.26.0",
160
+ version: "1.27.0",
161
161
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth (incl. Game Center / Play Games), deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push-token registration and the no-arg Game Center / Play Games sign-in require a Dev Client (EAS Build or `npx expo prebuild`).",
162
162
  type: "module",
163
163
  main: "./dist/index.cjs",
@@ -939,6 +939,36 @@ var Auth = class {
939
939
  this.user = user;
940
940
  this.hooks.storage.set(USER_KEY, JSON.stringify(user));
941
941
  }
942
+ /**
943
+ * List the auth methods/identities linked to the current account (ADR-030
944
+ * read side, s58.270). Returns every social/gaming identity on this account
945
+ * plus a `hasPassword` flag — the cross-device / reinstall-durable source of
946
+ * truth for a "Connected: Game Center · Google" UI (an on-device tracker
947
+ * misses a link made on another device). Bearer-gated network read (NOT a
948
+ * cache read — `getUserSync()` only holds the primary `signupMethod`/
949
+ * `lastLoginMethod`). Resolves a FRESH access token first (mirrors
950
+ * `deleteAccount`). Firebase `user.providerData` / Supabase `user.identities`.
951
+ */
952
+ async listLinkedIdentities() {
953
+ const token = await this.getAccessToken();
954
+ if (!token) throw new AuthError("NOT_SIGNED_IN", "Sign in before listing linked identities");
955
+ const res = await getJson(
956
+ { apiUrl: this.hooks.apiUrl, publicKey: this.hooks.publicKey, debug: this.hooks.debug },
957
+ "/api/v1/auth-service/me/identities",
958
+ { Authorization: `Bearer ${token}` }
959
+ );
960
+ if (!res || !res.ok) throw new AuthError("NETWORK_ERROR", "Failed to list linked identities");
961
+ let parsed;
962
+ try {
963
+ parsed = await res.json();
964
+ } catch {
965
+ throw new AuthError("PARSE_ERROR", `HTTP ${res.status}`);
966
+ }
967
+ if (!parsed.success || !parsed.data) {
968
+ throw new AuthError(parsed.error?.code ?? "IDENTITIES_FAILED", parsed.error?.message ?? "Failed to list linked identities");
969
+ }
970
+ return { identities: parsed.data.identities ?? [], hasPassword: Boolean(parsed.data.hasPassword) };
971
+ }
942
972
  /**
943
973
  * Shared gaming-identity sign-in. Mirrors `loginSocial`'s anon-takeover +
944
974
  * ADR-025 link-in-place handling: reads the anon refresh BEFORE wiping local
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoracloud/sdk-react-native",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "description": "Sendora Cloud React Native + Expo SDK — analytics, identity, push-token registration, auth (incl. Game Center / Play Games), deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push-token registration and the no-arg Game Center / Play Games sign-in require a Dev Client (EAS Build or `npx expo prebuild`).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",