@tinycloud/sdk-core 2.10.0 → 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 +1 -1
|
@@ -4655,6 +4655,33 @@ function createError2(code3, message, cause, meta) {
|
|
|
4655
4655
|
meta
|
|
4656
4656
|
};
|
|
4657
4657
|
}
|
|
4658
|
+
function rootDelegationSigningError(err) {
|
|
4659
|
+
const cause = err instanceof Error ? err : void 0;
|
|
4660
|
+
const code3 = err && typeof err === "object" && "code" in err ? String(err.code ?? "") : "";
|
|
4661
|
+
const name2 = err instanceof Error ? err.name : "";
|
|
4662
|
+
const message = err instanceof Error ? err.message : String(err ?? "");
|
|
4663
|
+
const aborted = code3 === DelegationErrorCodes.ABORTED || name2 === "AbortError" || /\bcancell?ed\b|\brejected\b|user denied/i.test(message);
|
|
4664
|
+
if (aborted) {
|
|
4665
|
+
return createError2(
|
|
4666
|
+
DelegationErrorCodes.ABORTED,
|
|
4667
|
+
"The signature that authorizes this sharing link was cancelled. Approve the signing prompt to finish creating the link.",
|
|
4668
|
+
cause
|
|
4669
|
+
);
|
|
4670
|
+
}
|
|
4671
|
+
const timedOut = code3 === DelegationErrorCodes.TIMEOUT || name2 === "TimeoutError" || /timed out|timeout/i.test(message);
|
|
4672
|
+
if (timedOut) {
|
|
4673
|
+
return createError2(
|
|
4674
|
+
DelegationErrorCodes.TIMEOUT,
|
|
4675
|
+
"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.",
|
|
4676
|
+
cause
|
|
4677
|
+
);
|
|
4678
|
+
}
|
|
4679
|
+
return createError2(
|
|
4680
|
+
DelegationErrorCodes.PERMISSION_DENIED,
|
|
4681
|
+
"The active session ReCap does not authorize this sharing delegation.",
|
|
4682
|
+
cause
|
|
4683
|
+
);
|
|
4684
|
+
}
|
|
4658
4685
|
function base64UrlEncode(data) {
|
|
4659
4686
|
let base642;
|
|
4660
4687
|
if (typeof btoa !== "undefined") {
|
|
@@ -4873,14 +4900,7 @@ var SharingService = class {
|
|
|
4873
4900
|
};
|
|
4874
4901
|
}
|
|
4875
4902
|
} catch (err) {
|
|
4876
|
-
return {
|
|
4877
|
-
ok: false,
|
|
4878
|
-
error: createError2(
|
|
4879
|
-
DelegationErrorCodes.PERMISSION_DENIED,
|
|
4880
|
-
"The active session ReCap does not authorize this sharing delegation.",
|
|
4881
|
-
err instanceof Error ? err : void 0
|
|
4882
|
-
)
|
|
4883
|
-
};
|
|
4903
|
+
return { ok: false, error: rootDelegationSigningError(err) };
|
|
4884
4904
|
}
|
|
4885
4905
|
} else {
|
|
4886
4906
|
return {
|