@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
|
@@ -4742,6 +4742,33 @@ function createError2(code3, message, cause, meta) {
|
|
|
4742
4742
|
meta
|
|
4743
4743
|
};
|
|
4744
4744
|
}
|
|
4745
|
+
function rootDelegationSigningError(err) {
|
|
4746
|
+
const cause = err instanceof Error ? err : void 0;
|
|
4747
|
+
const code3 = err && typeof err === "object" && "code" in err ? String(err.code ?? "") : "";
|
|
4748
|
+
const name2 = err instanceof Error ? err.name : "";
|
|
4749
|
+
const message = err instanceof Error ? err.message : String(err ?? "");
|
|
4750
|
+
const aborted = code3 === DelegationErrorCodes.ABORTED || name2 === "AbortError" || /\bcancell?ed\b|\brejected\b|user denied/i.test(message);
|
|
4751
|
+
if (aborted) {
|
|
4752
|
+
return createError2(
|
|
4753
|
+
DelegationErrorCodes.ABORTED,
|
|
4754
|
+
"The signature that authorizes this sharing link was cancelled. Approve the signing prompt to finish creating the link.",
|
|
4755
|
+
cause
|
|
4756
|
+
);
|
|
4757
|
+
}
|
|
4758
|
+
const timedOut = code3 === DelegationErrorCodes.TIMEOUT || name2 === "TimeoutError" || /timed out|timeout/i.test(message);
|
|
4759
|
+
if (timedOut) {
|
|
4760
|
+
return createError2(
|
|
4761
|
+
DelegationErrorCodes.TIMEOUT,
|
|
4762
|
+
"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.",
|
|
4763
|
+
cause
|
|
4764
|
+
);
|
|
4765
|
+
}
|
|
4766
|
+
return createError2(
|
|
4767
|
+
DelegationErrorCodes.PERMISSION_DENIED,
|
|
4768
|
+
"The active session ReCap does not authorize this sharing delegation.",
|
|
4769
|
+
cause
|
|
4770
|
+
);
|
|
4771
|
+
}
|
|
4745
4772
|
function base64UrlEncode(data) {
|
|
4746
4773
|
let base642;
|
|
4747
4774
|
if (typeof btoa !== "undefined") {
|
|
@@ -4960,14 +4987,7 @@ var SharingService = class {
|
|
|
4960
4987
|
};
|
|
4961
4988
|
}
|
|
4962
4989
|
} catch (err) {
|
|
4963
|
-
return {
|
|
4964
|
-
ok: false,
|
|
4965
|
-
error: createError2(
|
|
4966
|
-
DelegationErrorCodes.PERMISSION_DENIED,
|
|
4967
|
-
"The active session ReCap does not authorize this sharing delegation.",
|
|
4968
|
-
err instanceof Error ? err : void 0
|
|
4969
|
-
)
|
|
4970
|
-
};
|
|
4990
|
+
return { ok: false, error: rootDelegationSigningError(err) };
|
|
4971
4991
|
}
|
|
4972
4992
|
} else {
|
|
4973
4993
|
return {
|