@sendoracloud/sdk-react-native 1.6.2 → 1.8.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
@@ -222,7 +222,7 @@ async function request(opts, method, path, body, extraHeaders, reqOpts) {
222
222
  // package.json
223
223
  var package_default = {
224
224
  name: "@sendoracloud/sdk-react-native",
225
- version: "1.6.2",
225
+ version: "1.8.0",
226
226
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
227
227
  type: "module",
228
228
  main: "./dist/index.cjs",
@@ -857,6 +857,43 @@ var Auth = class {
857
857
  this.bearerHeaders()
858
858
  );
859
859
  }
860
+ /**
861
+ * Delete the signed-in user's account (Apple App Store Guideline 5.1.1(v)).
862
+ * Honors the project's configured grace period:
863
+ * - `"purged"` — hard-deleted immediately (grace = 0).
864
+ * - `"pending"` — deactivated + all sessions revoked now; hard-deleted at
865
+ * `scheduledPurgeAt`. The user can CANCEL by signing back in before then.
866
+ * Either outcome wipes local identity (the server has already revoked the
867
+ * session). Requires a signed-in user. Throws on a non-2xx response.
868
+ */
869
+ async deleteAccount() {
870
+ const res = await del(
871
+ { apiUrl: this.hooks.apiUrl, publicKey: this.hooks.publicKey, debug: this.hooks.debug },
872
+ "/api/v1/auth-service/me",
873
+ this.bearerHeaders()
874
+ );
875
+ if (!res || !res.ok) {
876
+ throw new Error(`deleteAccount failed${res ? ` (HTTP ${res.status})` : " (network error)"}`);
877
+ }
878
+ let out = {
879
+ status: "pending",
880
+ scheduledPurgeAt: null,
881
+ graceDays: 0
882
+ };
883
+ try {
884
+ const parsed = await res.json();
885
+ if (parsed.data?.status) {
886
+ out = {
887
+ status: parsed.data.status,
888
+ scheduledPurgeAt: parsed.data.scheduledPurgeAt ?? null,
889
+ graceDays: parsed.data.graceDays ?? 0
890
+ };
891
+ }
892
+ } catch {
893
+ }
894
+ await this.wipeLocalIdentity();
895
+ return out;
896
+ }
860
897
  // ============================================================
861
898
  // OIDC SSO
862
899
  // ============================================================
@@ -1635,6 +1672,7 @@ var Links = class {
1635
1672
  async doCreate(input) {
1636
1673
  const body = { title: input.title };
1637
1674
  if (input.fallbackUrl) body.fallbackUrl = input.fallbackUrl;
1675
+ if (input.noAppMode) body.noAppMode = input.noAppMode;
1638
1676
  if (input.iosDeepLinkPath) body.iosDeepLinkPath = input.iosDeepLinkPath;
1639
1677
  if (input.androidDeepLinkPath) body.androidDeepLinkPath = input.androidDeepLinkPath;
1640
1678
  if (input.linkData) body.linkData = input.linkData;
package/dist/index.d.cts CHANGED
@@ -345,6 +345,20 @@ declare class Auth {
345
345
  }>>;
346
346
  revokeSession(sessionId: string): Promise<void>;
347
347
  revokeAllSessions(): Promise<void>;
348
+ /**
349
+ * Delete the signed-in user's account (Apple App Store Guideline 5.1.1(v)).
350
+ * Honors the project's configured grace period:
351
+ * - `"purged"` — hard-deleted immediately (grace = 0).
352
+ * - `"pending"` — deactivated + all sessions revoked now; hard-deleted at
353
+ * `scheduledPurgeAt`. The user can CANCEL by signing back in before then.
354
+ * Either outcome wipes local identity (the server has already revoked the
355
+ * session). Requires a signed-in user. Throws on a non-2xx response.
356
+ */
357
+ deleteAccount(): Promise<{
358
+ status: "purged" | "pending";
359
+ scheduledPurgeAt: string | null;
360
+ graceDays: number;
361
+ }>;
348
362
  /**
349
363
  * Start OIDC sign-in. Returns the IdP's authorization URL — caller
350
364
  * opens it via React Native's `Linking.openURL()` (or
@@ -518,6 +532,14 @@ interface LinkCreateInput<T extends LinkData = LinkData> {
518
532
  * Play Store URL). Pass explicitly for per-link override.
519
533
  */
520
534
  fallbackUrl?: string;
535
+ /**
536
+ * How a **mobile visitor without the app installed** is routed (Adjust /
537
+ * Branch parity). `"auto"` (default) = open the app store when one is
538
+ * registered for the platform, else the web `fallbackUrl`. `"store"` =
539
+ * prefer the store. `"web"` = force the web `fallbackUrl` even when a
540
+ * store URL exists. Omit to inherit the project default. Desktop is
541
+ * always web. */
542
+ noAppMode?: "auto" | "store" | "web";
521
543
  /** Custom typed JSON delivered to onLinkOpened. Max 2KB serialized. */
522
544
  linkData?: T;
523
545
  /** Optional OG preview overrides for richer share cards. */
package/dist/index.d.ts CHANGED
@@ -345,6 +345,20 @@ declare class Auth {
345
345
  }>>;
346
346
  revokeSession(sessionId: string): Promise<void>;
347
347
  revokeAllSessions(): Promise<void>;
348
+ /**
349
+ * Delete the signed-in user's account (Apple App Store Guideline 5.1.1(v)).
350
+ * Honors the project's configured grace period:
351
+ * - `"purged"` — hard-deleted immediately (grace = 0).
352
+ * - `"pending"` — deactivated + all sessions revoked now; hard-deleted at
353
+ * `scheduledPurgeAt`. The user can CANCEL by signing back in before then.
354
+ * Either outcome wipes local identity (the server has already revoked the
355
+ * session). Requires a signed-in user. Throws on a non-2xx response.
356
+ */
357
+ deleteAccount(): Promise<{
358
+ status: "purged" | "pending";
359
+ scheduledPurgeAt: string | null;
360
+ graceDays: number;
361
+ }>;
348
362
  /**
349
363
  * Start OIDC sign-in. Returns the IdP's authorization URL — caller
350
364
  * opens it via React Native's `Linking.openURL()` (or
@@ -518,6 +532,14 @@ interface LinkCreateInput<T extends LinkData = LinkData> {
518
532
  * Play Store URL). Pass explicitly for per-link override.
519
533
  */
520
534
  fallbackUrl?: string;
535
+ /**
536
+ * How a **mobile visitor without the app installed** is routed (Adjust /
537
+ * Branch parity). `"auto"` (default) = open the app store when one is
538
+ * registered for the platform, else the web `fallbackUrl`. `"store"` =
539
+ * prefer the store. `"web"` = force the web `fallbackUrl` even when a
540
+ * store URL exists. Omit to inherit the project default. Desktop is
541
+ * always web. */
542
+ noAppMode?: "auto" | "store" | "web";
521
543
  /** Custom typed JSON delivered to onLinkOpened. Max 2KB serialized. */
522
544
  linkData?: T;
523
545
  /** Optional OG preview overrides for richer share cards. */
package/dist/index.js CHANGED
@@ -179,7 +179,7 @@ async function request(opts, method, path, body, extraHeaders, reqOpts) {
179
179
  // package.json
180
180
  var package_default = {
181
181
  name: "@sendoracloud/sdk-react-native",
182
- version: "1.6.2",
182
+ version: "1.8.0",
183
183
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
184
184
  type: "module",
185
185
  main: "./dist/index.cjs",
@@ -814,6 +814,43 @@ var Auth = class {
814
814
  this.bearerHeaders()
815
815
  );
816
816
  }
817
+ /**
818
+ * Delete the signed-in user's account (Apple App Store Guideline 5.1.1(v)).
819
+ * Honors the project's configured grace period:
820
+ * - `"purged"` — hard-deleted immediately (grace = 0).
821
+ * - `"pending"` — deactivated + all sessions revoked now; hard-deleted at
822
+ * `scheduledPurgeAt`. The user can CANCEL by signing back in before then.
823
+ * Either outcome wipes local identity (the server has already revoked the
824
+ * session). Requires a signed-in user. Throws on a non-2xx response.
825
+ */
826
+ async deleteAccount() {
827
+ const res = await del(
828
+ { apiUrl: this.hooks.apiUrl, publicKey: this.hooks.publicKey, debug: this.hooks.debug },
829
+ "/api/v1/auth-service/me",
830
+ this.bearerHeaders()
831
+ );
832
+ if (!res || !res.ok) {
833
+ throw new Error(`deleteAccount failed${res ? ` (HTTP ${res.status})` : " (network error)"}`);
834
+ }
835
+ let out = {
836
+ status: "pending",
837
+ scheduledPurgeAt: null,
838
+ graceDays: 0
839
+ };
840
+ try {
841
+ const parsed = await res.json();
842
+ if (parsed.data?.status) {
843
+ out = {
844
+ status: parsed.data.status,
845
+ scheduledPurgeAt: parsed.data.scheduledPurgeAt ?? null,
846
+ graceDays: parsed.data.graceDays ?? 0
847
+ };
848
+ }
849
+ } catch {
850
+ }
851
+ await this.wipeLocalIdentity();
852
+ return out;
853
+ }
817
854
  // ============================================================
818
855
  // OIDC SSO
819
856
  // ============================================================
@@ -1597,6 +1634,7 @@ var Links = class {
1597
1634
  async doCreate(input) {
1598
1635
  const body = { title: input.title };
1599
1636
  if (input.fallbackUrl) body.fallbackUrl = input.fallbackUrl;
1637
+ if (input.noAppMode) body.noAppMode = input.noAppMode;
1600
1638
  if (input.iosDeepLinkPath) body.iosDeepLinkPath = input.iosDeepLinkPath;
1601
1639
  if (input.androidDeepLinkPath) body.androidDeepLinkPath = input.androidDeepLinkPath;
1602
1640
  if (input.linkData) body.linkData = input.linkData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoracloud/sdk-react-native",
3
- "version": "1.6.2",
3
+ "version": "1.8.0",
4
4
  "description": "Sendora Cloud React Native + Expo SDK — analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",