@sparkvault/sdk-js 16.2.0 → 16.2.1
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 +37 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.mjs +37 -23
- package/dist/index.mjs.map +1 -1
- package/dist/products/identity/dialog-launcher.d.ts +4 -1
- package/dist/products/identity/index.d.ts +11 -6
- package/dist/products/identity/pending-signin.d.ts +3 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -620,14 +620,19 @@ declare class IdentityModule {
|
|
|
620
620
|
* 'redirect'`, or a popup whose handle COOP severed. Plain sign-in carries
|
|
621
621
|
* redirect_uri + state + PKCE challenge and returns via the fragment code;
|
|
622
622
|
* OIDC/simple modes navigate without them (their server-rendered pages drive
|
|
623
|
-
* the server-validated redirect back). Either carries
|
|
624
|
-
*
|
|
623
|
+
* the server-validated redirect back). Either carries the severed popup's
|
|
624
|
+
* reference; a redirect draws none of its own.
|
|
625
625
|
*
|
|
626
|
-
*
|
|
627
|
-
*
|
|
626
|
+
* The return leg is armed first: the check that the sign-in still runs and
|
|
627
|
+
* the pending marker's removal then share one turn with the navigation, so
|
|
628
|
+
* no sign-in can start or end between them.
|
|
629
|
+
*
|
|
630
|
+
* @param severed - The popup sign-in whose severed popup this continues,
|
|
631
|
+
* with the reference its marker holds for that popup (null for none), or
|
|
632
|
+
* null for an explicit redirect, which carries none
|
|
628
633
|
* @returns false when the return leg cannot be armed (no session storage or
|
|
629
|
-
* WebCrypto)
|
|
630
|
-
* silent dead-end.
|
|
634
|
+
* WebCrypto), so the caller surfaces an actionable error instead of a
|
|
635
|
+
* silent dead-end, or when the severed popup's sign-in ended meanwhile.
|
|
631
636
|
*/
|
|
632
637
|
private startRedirectFlow;
|
|
633
638
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -11608,7 +11608,7 @@ class PendingSignIn {
|
|
|
11608
11608
|
constructor(hint) {
|
|
11609
11609
|
this.hint = hint;
|
|
11610
11610
|
this.at = 0;
|
|
11611
|
-
this.
|
|
11611
|
+
this.ended = false;
|
|
11612
11612
|
// Counts the opens and the ends of their popups, so a draw that lands after
|
|
11613
11613
|
// its popup ended or was replaced is recognised and dropped.
|
|
11614
11614
|
this.opens = 0;
|
|
@@ -11624,6 +11624,10 @@ class PendingSignIn {
|
|
|
11624
11624
|
get reference() {
|
|
11625
11625
|
return this.current;
|
|
11626
11626
|
}
|
|
11627
|
+
/** False once the sign-in ended: it settled, was closed, or another replaced it. */
|
|
11628
|
+
get live() {
|
|
11629
|
+
return !this.ended;
|
|
11630
|
+
}
|
|
11627
11631
|
/**
|
|
11628
11632
|
* A popup opened, or the current one asked again for the reference it
|
|
11629
11633
|
* lacks: arm the marker holding no reference, and draw this open's own.
|
|
@@ -11633,7 +11637,7 @@ class PendingSignIn {
|
|
|
11633
11637
|
* rejects.
|
|
11634
11638
|
*/
|
|
11635
11639
|
open(draw) {
|
|
11636
|
-
if (
|
|
11640
|
+
if (this.ended)
|
|
11637
11641
|
return Promise.resolve(false);
|
|
11638
11642
|
const open = ++this.opens;
|
|
11639
11643
|
this.at = Date.now();
|
|
@@ -11642,7 +11646,7 @@ class PendingSignIn {
|
|
|
11642
11646
|
if (!this.write(null))
|
|
11643
11647
|
removePendingMarker();
|
|
11644
11648
|
const decided = signinReferenceInTime(draw()).then((reference) => {
|
|
11645
|
-
if (
|
|
11649
|
+
if (this.ended || open !== this.opens)
|
|
11646
11650
|
return false;
|
|
11647
11651
|
this.current = reference !== null && this.write(reference) ? reference : null;
|
|
11648
11652
|
return true;
|
|
@@ -11657,7 +11661,7 @@ class PendingSignIn {
|
|
|
11657
11661
|
* should it land, is dropped.
|
|
11658
11662
|
*/
|
|
11659
11663
|
retire() {
|
|
11660
|
-
if (
|
|
11664
|
+
if (this.ended)
|
|
11661
11665
|
return;
|
|
11662
11666
|
this.opens += 1;
|
|
11663
11667
|
this.current = null;
|
|
@@ -11666,7 +11670,7 @@ class PendingSignIn {
|
|
|
11666
11670
|
/** The sign-in settled, or another replaced it: retire the marker, and nothing this sign-in does later touches it. */
|
|
11667
11671
|
end() {
|
|
11668
11672
|
this.retire();
|
|
11669
|
-
this.
|
|
11673
|
+
this.ended = true;
|
|
11670
11674
|
}
|
|
11671
11675
|
/**
|
|
11672
11676
|
* The current popup's reference, waiting at most `waitMs` for an open still
|
|
@@ -12061,7 +12065,7 @@ class IdentityModule {
|
|
|
12061
12065
|
const signinRef = await pending.referenceWithin(SIGNIN_REFERENCE.redirectWaitMs);
|
|
12062
12066
|
if (signinRef === null)
|
|
12063
12067
|
pending.retire();
|
|
12064
|
-
return this.startRedirectFlow(mergedOptions, signinRef);
|
|
12068
|
+
return this.startRedirectFlow(mergedOptions, { signIn: pending, signinRef });
|
|
12065
12069
|
},
|
|
12066
12070
|
signinReference: () => pending.reference,
|
|
12067
12071
|
});
|
|
@@ -12319,31 +12323,41 @@ class IdentityModule {
|
|
|
12319
12323
|
* 'redirect'`, or a popup whose handle COOP severed. Plain sign-in carries
|
|
12320
12324
|
* redirect_uri + state + PKCE challenge and returns via the fragment code;
|
|
12321
12325
|
* OIDC/simple modes navigate without them (their server-rendered pages drive
|
|
12322
|
-
* the server-validated redirect back). Either carries
|
|
12323
|
-
*
|
|
12326
|
+
* the server-validated redirect back). Either carries the severed popup's
|
|
12327
|
+
* reference; a redirect draws none of its own.
|
|
12328
|
+
*
|
|
12329
|
+
* The return leg is armed first: the check that the sign-in still runs and
|
|
12330
|
+
* the pending marker's removal then share one turn with the navigation, so
|
|
12331
|
+
* no sign-in can start or end between them.
|
|
12324
12332
|
*
|
|
12325
|
-
* @param
|
|
12326
|
-
*
|
|
12333
|
+
* @param severed - The popup sign-in whose severed popup this continues,
|
|
12334
|
+
* with the reference its marker holds for that popup (null for none), or
|
|
12335
|
+
* null for an explicit redirect, which carries none
|
|
12327
12336
|
* @returns false when the return leg cannot be armed (no session storage or
|
|
12328
|
-
* WebCrypto)
|
|
12329
|
-
* silent dead-end.
|
|
12337
|
+
* WebCrypto), so the caller surfaces an actionable error instead of a
|
|
12338
|
+
* silent dead-end, or when the severed popup's sign-in ended meanwhile.
|
|
12330
12339
|
*/
|
|
12331
|
-
async startRedirectFlow(options,
|
|
12340
|
+
async startRedirectFlow(options, severed) {
|
|
12341
|
+
const signinRef = severed?.signinRef ?? null;
|
|
12342
|
+
const authContext = options.authContext;
|
|
12343
|
+
const handoff = authContext?.authRequestId || authContext?.simpleMode?.sessionId
|
|
12344
|
+
? undefined
|
|
12345
|
+
: await this.armHandoffReturn();
|
|
12346
|
+
if (handoff === null) {
|
|
12347
|
+
return false;
|
|
12348
|
+
}
|
|
12349
|
+
// A popup sign-in that ended meanwhile (the bridge's ✕, close(), or a
|
|
12350
|
+
// signIn() that replaced it) leaves this tab where it is, and leaves
|
|
12351
|
+
// alone the marker of any sign-in that now runs here.
|
|
12352
|
+
if (severed && !severed.signIn.live) {
|
|
12353
|
+
return false;
|
|
12354
|
+
}
|
|
12332
12355
|
if (signinRef === null) {
|
|
12333
12356
|
// With no marker, no recovery can stand in for this page's result, so
|
|
12334
12357
|
// the page needs no reference. A marker left from an earlier sign-in
|
|
12335
12358
|
// would otherwise bounce on the next load in place of this one.
|
|
12336
12359
|
removePendingMarker();
|
|
12337
12360
|
}
|
|
12338
|
-
const authContext = options.authContext;
|
|
12339
|
-
if (authContext?.authRequestId || authContext?.simpleMode?.sessionId) {
|
|
12340
|
-
window.location.assign(buildSigninUrl(this.config, options, { kind: 'redirect', signinRef }));
|
|
12341
|
-
return true;
|
|
12342
|
-
}
|
|
12343
|
-
const handoff = await this.armHandoffReturn();
|
|
12344
|
-
if (!handoff) {
|
|
12345
|
-
return false;
|
|
12346
|
-
}
|
|
12347
12361
|
window.location.assign(buildSigninUrl(this.config, options, { kind: 'redirect', signinRef, handoff }));
|
|
12348
12362
|
return true;
|
|
12349
12363
|
}
|
|
@@ -29529,7 +29543,7 @@ class SparkVault {
|
|
|
29529
29543
|
}
|
|
29530
29544
|
/** Get the SDK version */
|
|
29531
29545
|
static get version() {
|
|
29532
|
-
return '16.2.
|
|
29546
|
+
return '16.2.1';
|
|
29533
29547
|
}
|
|
29534
29548
|
}
|
|
29535
29549
|
if (typeof window !== 'undefined') {
|