@anuma/sdk 11.3.0 → 11.3.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/react/index.cjs +52 -22
- package/dist/react/index.mjs +52 -22
- package/package.json +1 -1
package/dist/react/index.cjs
CHANGED
|
@@ -37238,30 +37238,60 @@ async function authenticateICloud() {
|
|
|
37238
37238
|
ensureAuthElements();
|
|
37239
37239
|
return container.setUpAuth();
|
|
37240
37240
|
}
|
|
37241
|
-
async function requestICloudSignIn(
|
|
37242
|
-
|
|
37243
|
-
|
|
37244
|
-
|
|
37245
|
-
|
|
37246
|
-
|
|
37247
|
-
|
|
37248
|
-
|
|
37249
|
-
|
|
37250
|
-
const
|
|
37251
|
-
|
|
37252
|
-
|
|
37253
|
-
|
|
37254
|
-
|
|
37255
|
-
|
|
37256
|
-
|
|
37257
|
-
|
|
37258
|
-
|
|
37259
|
-
|
|
37260
|
-
|
|
37261
|
-
|
|
37241
|
+
async function requestICloudSignIn({
|
|
37242
|
+
signal
|
|
37243
|
+
} = {}) {
|
|
37244
|
+
if (signal?.aborted) {
|
|
37245
|
+
throw new Error("Sign-in was cancelled");
|
|
37246
|
+
}
|
|
37247
|
+
let cancellationError;
|
|
37248
|
+
let timer;
|
|
37249
|
+
let onAbort;
|
|
37250
|
+
const cancellation = new Promise((_resolve, reject) => {
|
|
37251
|
+
const cancel = (error) => {
|
|
37252
|
+
cancellationError = error;
|
|
37253
|
+
reject(error);
|
|
37254
|
+
};
|
|
37255
|
+
onAbort = () => cancel(new Error("Sign-in was cancelled"));
|
|
37256
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
37257
|
+
timer = setTimeout(() => cancel(new Error("iCloud sign-in timed out")), 6e4);
|
|
37258
|
+
});
|
|
37259
|
+
const throwIfCancelled = () => {
|
|
37260
|
+
if (cancellationError) throw cancellationError;
|
|
37261
|
+
};
|
|
37262
|
+
const signInRequest = async () => {
|
|
37263
|
+
const container = await getContainer();
|
|
37264
|
+
throwIfCancelled();
|
|
37265
|
+
const { signIn } = ensureAuthElements();
|
|
37266
|
+
const existingUser = await container.setUpAuth();
|
|
37267
|
+
throwIfCancelled();
|
|
37268
|
+
if (existingUser) {
|
|
37269
|
+
return existingUser;
|
|
37270
|
+
}
|
|
37271
|
+
getLogger().debug("[CloudKit] Sign-in container innerHTML:", signIn.innerHTML);
|
|
37272
|
+
getLogger().debug("[CloudKit] Sign-in container children:", signIn.children.length);
|
|
37273
|
+
const appleButton = signIn.querySelector(
|
|
37274
|
+
"a, button, [role='button'], div[id*='apple']"
|
|
37275
|
+
);
|
|
37276
|
+
getLogger().debug("[CloudKit] Found button element:", appleButton);
|
|
37277
|
+
if (appleButton) {
|
|
37278
|
+
getLogger().debug("[CloudKit] Clicking button...");
|
|
37279
|
+
appleButton.click();
|
|
37280
|
+
} else {
|
|
37281
|
+
const anyClickable = signIn.firstElementChild;
|
|
37282
|
+
if (anyClickable) {
|
|
37283
|
+
getLogger().debug("[CloudKit] Clicking first child element:", anyClickable);
|
|
37284
|
+
anyClickable.click();
|
|
37285
|
+
}
|
|
37262
37286
|
}
|
|
37287
|
+
return container.whenUserSignsIn();
|
|
37288
|
+
};
|
|
37289
|
+
try {
|
|
37290
|
+
return await Promise.race([signInRequest(), cancellation]);
|
|
37291
|
+
} finally {
|
|
37292
|
+
clearTimeout(timer);
|
|
37293
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
37263
37294
|
}
|
|
37264
|
-
return container.whenUserSignsIn();
|
|
37265
37295
|
}
|
|
37266
37296
|
async function uploadFileToICloud(filename, content, backupRevision) {
|
|
37267
37297
|
const container = await getContainer();
|
package/dist/react/index.mjs
CHANGED
|
@@ -35291,30 +35291,60 @@ async function authenticateICloud() {
|
|
|
35291
35291
|
ensureAuthElements();
|
|
35292
35292
|
return container.setUpAuth();
|
|
35293
35293
|
}
|
|
35294
|
-
async function requestICloudSignIn(
|
|
35295
|
-
|
|
35296
|
-
|
|
35297
|
-
|
|
35298
|
-
|
|
35299
|
-
|
|
35300
|
-
|
|
35301
|
-
|
|
35302
|
-
|
|
35303
|
-
const
|
|
35304
|
-
|
|
35305
|
-
|
|
35306
|
-
|
|
35307
|
-
|
|
35308
|
-
|
|
35309
|
-
|
|
35310
|
-
|
|
35311
|
-
|
|
35312
|
-
|
|
35313
|
-
|
|
35314
|
-
|
|
35294
|
+
async function requestICloudSignIn({
|
|
35295
|
+
signal
|
|
35296
|
+
} = {}) {
|
|
35297
|
+
if (signal?.aborted) {
|
|
35298
|
+
throw new Error("Sign-in was cancelled");
|
|
35299
|
+
}
|
|
35300
|
+
let cancellationError;
|
|
35301
|
+
let timer;
|
|
35302
|
+
let onAbort;
|
|
35303
|
+
const cancellation = new Promise((_resolve, reject) => {
|
|
35304
|
+
const cancel = (error) => {
|
|
35305
|
+
cancellationError = error;
|
|
35306
|
+
reject(error);
|
|
35307
|
+
};
|
|
35308
|
+
onAbort = () => cancel(new Error("Sign-in was cancelled"));
|
|
35309
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
35310
|
+
timer = setTimeout(() => cancel(new Error("iCloud sign-in timed out")), 6e4);
|
|
35311
|
+
});
|
|
35312
|
+
const throwIfCancelled = () => {
|
|
35313
|
+
if (cancellationError) throw cancellationError;
|
|
35314
|
+
};
|
|
35315
|
+
const signInRequest = async () => {
|
|
35316
|
+
const container = await getContainer();
|
|
35317
|
+
throwIfCancelled();
|
|
35318
|
+
const { signIn } = ensureAuthElements();
|
|
35319
|
+
const existingUser = await container.setUpAuth();
|
|
35320
|
+
throwIfCancelled();
|
|
35321
|
+
if (existingUser) {
|
|
35322
|
+
return existingUser;
|
|
35323
|
+
}
|
|
35324
|
+
getLogger().debug("[CloudKit] Sign-in container innerHTML:", signIn.innerHTML);
|
|
35325
|
+
getLogger().debug("[CloudKit] Sign-in container children:", signIn.children.length);
|
|
35326
|
+
const appleButton = signIn.querySelector(
|
|
35327
|
+
"a, button, [role='button'], div[id*='apple']"
|
|
35328
|
+
);
|
|
35329
|
+
getLogger().debug("[CloudKit] Found button element:", appleButton);
|
|
35330
|
+
if (appleButton) {
|
|
35331
|
+
getLogger().debug("[CloudKit] Clicking button...");
|
|
35332
|
+
appleButton.click();
|
|
35333
|
+
} else {
|
|
35334
|
+
const anyClickable = signIn.firstElementChild;
|
|
35335
|
+
if (anyClickable) {
|
|
35336
|
+
getLogger().debug("[CloudKit] Clicking first child element:", anyClickable);
|
|
35337
|
+
anyClickable.click();
|
|
35338
|
+
}
|
|
35315
35339
|
}
|
|
35340
|
+
return container.whenUserSignsIn();
|
|
35341
|
+
};
|
|
35342
|
+
try {
|
|
35343
|
+
return await Promise.race([signInRequest(), cancellation]);
|
|
35344
|
+
} finally {
|
|
35345
|
+
clearTimeout(timer);
|
|
35346
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
35316
35347
|
}
|
|
35317
|
-
return container.whenUserSignsIn();
|
|
35318
35348
|
}
|
|
35319
35349
|
async function uploadFileToICloud(filename, content, backupRevision) {
|
|
35320
35350
|
const container = await getContainer();
|