@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/index.cjs CHANGED
@@ -8914,6 +8914,33 @@ function createError2(code3, message, cause, meta) {
8914
8914
  meta
8915
8915
  };
8916
8916
  }
8917
+ function rootDelegationSigningError(err6) {
8918
+ const cause = err6 instanceof Error ? err6 : void 0;
8919
+ const code3 = err6 && typeof err6 === "object" && "code" in err6 ? String(err6.code ?? "") : "";
8920
+ const name2 = err6 instanceof Error ? err6.name : "";
8921
+ const message = err6 instanceof Error ? err6.message : String(err6 ?? "");
8922
+ const aborted = code3 === DelegationErrorCodes.ABORTED || name2 === "AbortError" || /\bcancell?ed\b|\brejected\b|user denied/i.test(message);
8923
+ if (aborted) {
8924
+ return createError2(
8925
+ DelegationErrorCodes.ABORTED,
8926
+ "The signature that authorizes this sharing link was cancelled. Approve the signing prompt to finish creating the link.",
8927
+ cause
8928
+ );
8929
+ }
8930
+ const timedOut = code3 === DelegationErrorCodes.TIMEOUT || name2 === "TimeoutError" || /timed out|timeout/i.test(message);
8931
+ if (timedOut) {
8932
+ return createError2(
8933
+ DelegationErrorCodes.TIMEOUT,
8934
+ "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.",
8935
+ cause
8936
+ );
8937
+ }
8938
+ return createError2(
8939
+ DelegationErrorCodes.PERMISSION_DENIED,
8940
+ "The active session ReCap does not authorize this sharing delegation.",
8941
+ cause
8942
+ );
8943
+ }
8917
8944
  function base64UrlEncode2(data) {
8918
8945
  let base642;
8919
8946
  if (typeof btoa !== "undefined") {
@@ -9132,14 +9159,7 @@ var SharingService = class {
9132
9159
  };
9133
9160
  }
9134
9161
  } catch (err6) {
9135
- return {
9136
- ok: false,
9137
- error: createError2(
9138
- DelegationErrorCodes.PERMISSION_DENIED,
9139
- "The active session ReCap does not authorize this sharing delegation.",
9140
- err6 instanceof Error ? err6 : void 0
9141
- )
9142
- };
9162
+ return { ok: false, error: rootDelegationSigningError(err6) };
9143
9163
  }
9144
9164
  } else {
9145
9165
  return {