@tinycloud/sdk-core 2.10.0-beta.1 → 2.11.0-beta.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/delegations/index.cjs +28 -8
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.js +28 -8
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +28 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8576,6 +8576,33 @@ function createError2(code3, message, cause, meta) {
|
|
|
8576
8576
|
meta
|
|
8577
8577
|
};
|
|
8578
8578
|
}
|
|
8579
|
+
function rootDelegationSigningError(err6) {
|
|
8580
|
+
const cause = err6 instanceof Error ? err6 : void 0;
|
|
8581
|
+
const code3 = err6 && typeof err6 === "object" && "code" in err6 ? String(err6.code ?? "") : "";
|
|
8582
|
+
const name2 = err6 instanceof Error ? err6.name : "";
|
|
8583
|
+
const message = err6 instanceof Error ? err6.message : String(err6 ?? "");
|
|
8584
|
+
const aborted = code3 === DelegationErrorCodes.ABORTED || name2 === "AbortError" || /\bcancell?ed\b|\brejected\b|user denied/i.test(message);
|
|
8585
|
+
if (aborted) {
|
|
8586
|
+
return createError2(
|
|
8587
|
+
DelegationErrorCodes.ABORTED,
|
|
8588
|
+
"The signature that authorizes this sharing link was cancelled. Approve the signing prompt to finish creating the link.",
|
|
8589
|
+
cause
|
|
8590
|
+
);
|
|
8591
|
+
}
|
|
8592
|
+
const timedOut = code3 === DelegationErrorCodes.TIMEOUT || name2 === "TimeoutError" || /timed out|timeout/i.test(message);
|
|
8593
|
+
if (timedOut) {
|
|
8594
|
+
return createError2(
|
|
8595
|
+
DelegationErrorCodes.TIMEOUT,
|
|
8596
|
+
"Timed out waiting for the signature that authorizes this sharing link. Creating a long-lived link re-opens the signing prompt after sign-in; if you did not see one, check for a blocked popup or a hidden signing frame, then try again.",
|
|
8597
|
+
cause
|
|
8598
|
+
);
|
|
8599
|
+
}
|
|
8600
|
+
return createError2(
|
|
8601
|
+
DelegationErrorCodes.PERMISSION_DENIED,
|
|
8602
|
+
"The active session ReCap does not authorize this sharing delegation.",
|
|
8603
|
+
cause
|
|
8604
|
+
);
|
|
8605
|
+
}
|
|
8579
8606
|
function base64UrlEncode2(data) {
|
|
8580
8607
|
let base642;
|
|
8581
8608
|
if (typeof btoa !== "undefined") {
|
|
@@ -8794,14 +8821,7 @@ var SharingService = class {
|
|
|
8794
8821
|
};
|
|
8795
8822
|
}
|
|
8796
8823
|
} catch (err6) {
|
|
8797
|
-
return {
|
|
8798
|
-
ok: false,
|
|
8799
|
-
error: createError2(
|
|
8800
|
-
DelegationErrorCodes.PERMISSION_DENIED,
|
|
8801
|
-
"The active session ReCap does not authorize this sharing delegation.",
|
|
8802
|
-
err6 instanceof Error ? err6 : void 0
|
|
8803
|
-
)
|
|
8804
|
-
};
|
|
8824
|
+
return { ok: false, error: rootDelegationSigningError(err6) };
|
|
8805
8825
|
}
|
|
8806
8826
|
} else {
|
|
8807
8827
|
return {
|