@sendoracloud/sdk-react-native 1.7.0 → 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 +38 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +38 -1
- package/package.json +1 -1
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.
|
|
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
|
// ============================================================
|
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
|
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
|
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.
|
|
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
|
// ============================================================
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendoracloud/sdk-react-native",
|
|
3
|
-
"version": "1.
|
|
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",
|