@anuma/sdk 11.3.0 → 11.3.2
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/client/index.cjs +4 -1
- package/dist/client/index.mjs +4 -1
- package/dist/expo/index.cjs +25 -9
- package/dist/expo/index.mjs +25 -9
- package/dist/index.cjs +4 -1
- package/dist/index.mjs +4 -1
- package/dist/react/index.cjs +56 -23
- package/dist/react/index.mjs +56 -23
- package/dist/server/index.cjs +4 -1
- package/dist/server/index.mjs +4 -1
- package/dist/tools/selection/index.cjs +4 -1
- package/dist/tools/selection/index.mjs +4 -1
- package/package.json +1 -1
package/dist/client/index.cjs
CHANGED
|
@@ -302,7 +302,8 @@ function createSseClient({
|
|
|
302
302
|
let buffer = "";
|
|
303
303
|
const abortHandler = () => {
|
|
304
304
|
try {
|
|
305
|
-
reader.cancel()
|
|
305
|
+
void reader.cancel().catch(() => {
|
|
306
|
+
});
|
|
306
307
|
} catch {
|
|
307
308
|
}
|
|
308
309
|
};
|
|
@@ -365,6 +366,8 @@ function createSseClient({
|
|
|
365
366
|
}
|
|
366
367
|
} finally {
|
|
367
368
|
signal.removeEventListener("abort", abortHandler);
|
|
369
|
+
await reader.cancel().catch(() => {
|
|
370
|
+
});
|
|
368
371
|
reader.releaseLock();
|
|
369
372
|
}
|
|
370
373
|
break;
|
package/dist/client/index.mjs
CHANGED
|
@@ -76,7 +76,8 @@ function createSseClient({
|
|
|
76
76
|
let buffer = "";
|
|
77
77
|
const abortHandler = () => {
|
|
78
78
|
try {
|
|
79
|
-
reader.cancel()
|
|
79
|
+
void reader.cancel().catch(() => {
|
|
80
|
+
});
|
|
80
81
|
} catch {
|
|
81
82
|
}
|
|
82
83
|
};
|
|
@@ -139,6 +140,8 @@ function createSseClient({
|
|
|
139
140
|
}
|
|
140
141
|
} finally {
|
|
141
142
|
signal.removeEventListener("abort", abortHandler);
|
|
143
|
+
await reader.cancel().catch(() => {
|
|
144
|
+
});
|
|
142
145
|
reader.releaseLock();
|
|
143
146
|
}
|
|
144
147
|
break;
|
package/dist/expo/index.cjs
CHANGED
|
@@ -5369,7 +5369,8 @@ function createSseClient({
|
|
|
5369
5369
|
let buffer = "";
|
|
5370
5370
|
const abortHandler = () => {
|
|
5371
5371
|
try {
|
|
5372
|
-
reader.cancel()
|
|
5372
|
+
void reader.cancel().catch(() => {
|
|
5373
|
+
});
|
|
5373
5374
|
} catch {
|
|
5374
5375
|
}
|
|
5375
5376
|
};
|
|
@@ -5432,6 +5433,8 @@ function createSseClient({
|
|
|
5432
5433
|
}
|
|
5433
5434
|
} finally {
|
|
5434
5435
|
signal.removeEventListener("abort", abortHandler);
|
|
5436
|
+
await reader.cancel().catch(() => {
|
|
5437
|
+
});
|
|
5435
5438
|
reader.releaseLock();
|
|
5436
5439
|
}
|
|
5437
5440
|
break;
|
|
@@ -13041,14 +13044,27 @@ var xhrTransport = (options) => {
|
|
|
13041
13044
|
xhr.send(options.body !== void 0 ? JSON.stringify(options.body) : void 0);
|
|
13042
13045
|
}
|
|
13043
13046
|
async function* createStream() {
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13047
|
+
try {
|
|
13048
|
+
if (options.signal?.aborted) throw makeAbortError();
|
|
13049
|
+
while (true) {
|
|
13050
|
+
await waitForItem();
|
|
13051
|
+
while (queue.length > 0) {
|
|
13052
|
+
const item = queue.shift();
|
|
13053
|
+
if (item.type === "done") return;
|
|
13054
|
+
if (item.type === "error") throw item.error;
|
|
13055
|
+
yield item.value;
|
|
13056
|
+
}
|
|
13057
|
+
}
|
|
13058
|
+
} finally {
|
|
13059
|
+
options.signal?.removeEventListener("abort", abortHandler);
|
|
13060
|
+
xhr.onprogress = null;
|
|
13061
|
+
xhr.onload = null;
|
|
13062
|
+
xhr.onerror = null;
|
|
13063
|
+
xhr.onabort = null;
|
|
13064
|
+
xhr.onreadystatechange = null;
|
|
13065
|
+
if (!finished) {
|
|
13066
|
+
finished = true;
|
|
13067
|
+
xhr.abort();
|
|
13052
13068
|
}
|
|
13053
13069
|
}
|
|
13054
13070
|
}
|
package/dist/expo/index.mjs
CHANGED
|
@@ -3710,7 +3710,8 @@ function createSseClient({
|
|
|
3710
3710
|
let buffer = "";
|
|
3711
3711
|
const abortHandler = () => {
|
|
3712
3712
|
try {
|
|
3713
|
-
reader.cancel()
|
|
3713
|
+
void reader.cancel().catch(() => {
|
|
3714
|
+
});
|
|
3714
3715
|
} catch {
|
|
3715
3716
|
}
|
|
3716
3717
|
};
|
|
@@ -3773,6 +3774,8 @@ function createSseClient({
|
|
|
3773
3774
|
}
|
|
3774
3775
|
} finally {
|
|
3775
3776
|
signal.removeEventListener("abort", abortHandler);
|
|
3777
|
+
await reader.cancel().catch(() => {
|
|
3778
|
+
});
|
|
3776
3779
|
reader.releaseLock();
|
|
3777
3780
|
}
|
|
3778
3781
|
break;
|
|
@@ -11354,14 +11357,27 @@ var xhrTransport = (options) => {
|
|
|
11354
11357
|
xhr.send(options.body !== void 0 ? JSON.stringify(options.body) : void 0);
|
|
11355
11358
|
}
|
|
11356
11359
|
async function* createStream() {
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11360
|
+
try {
|
|
11361
|
+
if (options.signal?.aborted) throw makeAbortError();
|
|
11362
|
+
while (true) {
|
|
11363
|
+
await waitForItem();
|
|
11364
|
+
while (queue.length > 0) {
|
|
11365
|
+
const item = queue.shift();
|
|
11366
|
+
if (item.type === "done") return;
|
|
11367
|
+
if (item.type === "error") throw item.error;
|
|
11368
|
+
yield item.value;
|
|
11369
|
+
}
|
|
11370
|
+
}
|
|
11371
|
+
} finally {
|
|
11372
|
+
options.signal?.removeEventListener("abort", abortHandler);
|
|
11373
|
+
xhr.onprogress = null;
|
|
11374
|
+
xhr.onload = null;
|
|
11375
|
+
xhr.onerror = null;
|
|
11376
|
+
xhr.onabort = null;
|
|
11377
|
+
xhr.onreadystatechange = null;
|
|
11378
|
+
if (!finished) {
|
|
11379
|
+
finished = true;
|
|
11380
|
+
xhr.abort();
|
|
11365
11381
|
}
|
|
11366
11382
|
}
|
|
11367
11383
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -269,7 +269,8 @@ function createSseClient({
|
|
|
269
269
|
let buffer = "";
|
|
270
270
|
const abortHandler = () => {
|
|
271
271
|
try {
|
|
272
|
-
reader.cancel()
|
|
272
|
+
void reader.cancel().catch(() => {
|
|
273
|
+
});
|
|
273
274
|
} catch {
|
|
274
275
|
}
|
|
275
276
|
};
|
|
@@ -332,6 +333,8 @@ function createSseClient({
|
|
|
332
333
|
}
|
|
333
334
|
} finally {
|
|
334
335
|
signal.removeEventListener("abort", abortHandler);
|
|
336
|
+
await reader.cancel().catch(() => {
|
|
337
|
+
});
|
|
335
338
|
reader.releaseLock();
|
|
336
339
|
}
|
|
337
340
|
break;
|
package/dist/index.mjs
CHANGED
|
@@ -58,7 +58,8 @@ function createSseClient({
|
|
|
58
58
|
let buffer = "";
|
|
59
59
|
const abortHandler = () => {
|
|
60
60
|
try {
|
|
61
|
-
reader.cancel()
|
|
61
|
+
void reader.cancel().catch(() => {
|
|
62
|
+
});
|
|
62
63
|
} catch {
|
|
63
64
|
}
|
|
64
65
|
};
|
|
@@ -121,6 +122,8 @@ function createSseClient({
|
|
|
121
122
|
}
|
|
122
123
|
} finally {
|
|
123
124
|
signal.removeEventListener("abort", abortHandler);
|
|
125
|
+
await reader.cancel().catch(() => {
|
|
126
|
+
});
|
|
124
127
|
reader.releaseLock();
|
|
125
128
|
}
|
|
126
129
|
break;
|
package/dist/react/index.cjs
CHANGED
|
@@ -6109,7 +6109,8 @@ function createSseClient({
|
|
|
6109
6109
|
let buffer = "";
|
|
6110
6110
|
const abortHandler = () => {
|
|
6111
6111
|
try {
|
|
6112
|
-
reader.cancel()
|
|
6112
|
+
void reader.cancel().catch(() => {
|
|
6113
|
+
});
|
|
6113
6114
|
} catch {
|
|
6114
6115
|
}
|
|
6115
6116
|
};
|
|
@@ -6172,6 +6173,8 @@ function createSseClient({
|
|
|
6172
6173
|
}
|
|
6173
6174
|
} finally {
|
|
6174
6175
|
signal.removeEventListener("abort", abortHandler);
|
|
6176
|
+
await reader.cancel().catch(() => {
|
|
6177
|
+
});
|
|
6175
6178
|
reader.releaseLock();
|
|
6176
6179
|
}
|
|
6177
6180
|
break;
|
|
@@ -37238,30 +37241,60 @@ async function authenticateICloud() {
|
|
|
37238
37241
|
ensureAuthElements();
|
|
37239
37242
|
return container.setUpAuth();
|
|
37240
37243
|
}
|
|
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
|
-
|
|
37244
|
+
async function requestICloudSignIn({
|
|
37245
|
+
signal
|
|
37246
|
+
} = {}) {
|
|
37247
|
+
if (signal?.aborted) {
|
|
37248
|
+
throw new Error("Sign-in was cancelled");
|
|
37249
|
+
}
|
|
37250
|
+
let cancellationError;
|
|
37251
|
+
let timer;
|
|
37252
|
+
let onAbort;
|
|
37253
|
+
const cancellation = new Promise((_resolve, reject) => {
|
|
37254
|
+
const cancel = (error) => {
|
|
37255
|
+
cancellationError = error;
|
|
37256
|
+
reject(error);
|
|
37257
|
+
};
|
|
37258
|
+
onAbort = () => cancel(new Error("Sign-in was cancelled"));
|
|
37259
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
37260
|
+
timer = setTimeout(() => cancel(new Error("iCloud sign-in timed out")), 6e4);
|
|
37261
|
+
});
|
|
37262
|
+
const throwIfCancelled = () => {
|
|
37263
|
+
if (cancellationError) throw cancellationError;
|
|
37264
|
+
};
|
|
37265
|
+
const signInRequest = async () => {
|
|
37266
|
+
const container = await getContainer();
|
|
37267
|
+
throwIfCancelled();
|
|
37268
|
+
const { signIn } = ensureAuthElements();
|
|
37269
|
+
const existingUser = await container.setUpAuth();
|
|
37270
|
+
throwIfCancelled();
|
|
37271
|
+
if (existingUser) {
|
|
37272
|
+
return existingUser;
|
|
37273
|
+
}
|
|
37274
|
+
getLogger().debug("[CloudKit] Sign-in container innerHTML:", signIn.innerHTML);
|
|
37275
|
+
getLogger().debug("[CloudKit] Sign-in container children:", signIn.children.length);
|
|
37276
|
+
const appleButton = signIn.querySelector(
|
|
37277
|
+
"a, button, [role='button'], div[id*='apple']"
|
|
37278
|
+
);
|
|
37279
|
+
getLogger().debug("[CloudKit] Found button element:", appleButton);
|
|
37280
|
+
if (appleButton) {
|
|
37281
|
+
getLogger().debug("[CloudKit] Clicking button...");
|
|
37282
|
+
appleButton.click();
|
|
37283
|
+
} else {
|
|
37284
|
+
const anyClickable = signIn.firstElementChild;
|
|
37285
|
+
if (anyClickable) {
|
|
37286
|
+
getLogger().debug("[CloudKit] Clicking first child element:", anyClickable);
|
|
37287
|
+
anyClickable.click();
|
|
37288
|
+
}
|
|
37262
37289
|
}
|
|
37290
|
+
return container.whenUserSignsIn();
|
|
37291
|
+
};
|
|
37292
|
+
try {
|
|
37293
|
+
return await Promise.race([signInRequest(), cancellation]);
|
|
37294
|
+
} finally {
|
|
37295
|
+
clearTimeout(timer);
|
|
37296
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
37263
37297
|
}
|
|
37264
|
-
return container.whenUserSignsIn();
|
|
37265
37298
|
}
|
|
37266
37299
|
async function uploadFileToICloud(filename, content, backupRevision) {
|
|
37267
37300
|
const container = await getContainer();
|
package/dist/react/index.mjs
CHANGED
|
@@ -4249,7 +4249,8 @@ function createSseClient({
|
|
|
4249
4249
|
let buffer = "";
|
|
4250
4250
|
const abortHandler = () => {
|
|
4251
4251
|
try {
|
|
4252
|
-
reader.cancel()
|
|
4252
|
+
void reader.cancel().catch(() => {
|
|
4253
|
+
});
|
|
4253
4254
|
} catch {
|
|
4254
4255
|
}
|
|
4255
4256
|
};
|
|
@@ -4312,6 +4313,8 @@ function createSseClient({
|
|
|
4312
4313
|
}
|
|
4313
4314
|
} finally {
|
|
4314
4315
|
signal.removeEventListener("abort", abortHandler);
|
|
4316
|
+
await reader.cancel().catch(() => {
|
|
4317
|
+
});
|
|
4315
4318
|
reader.releaseLock();
|
|
4316
4319
|
}
|
|
4317
4320
|
break;
|
|
@@ -35291,30 +35294,60 @@ async function authenticateICloud() {
|
|
|
35291
35294
|
ensureAuthElements();
|
|
35292
35295
|
return container.setUpAuth();
|
|
35293
35296
|
}
|
|
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
|
-
|
|
35297
|
+
async function requestICloudSignIn({
|
|
35298
|
+
signal
|
|
35299
|
+
} = {}) {
|
|
35300
|
+
if (signal?.aborted) {
|
|
35301
|
+
throw new Error("Sign-in was cancelled");
|
|
35302
|
+
}
|
|
35303
|
+
let cancellationError;
|
|
35304
|
+
let timer;
|
|
35305
|
+
let onAbort;
|
|
35306
|
+
const cancellation = new Promise((_resolve, reject) => {
|
|
35307
|
+
const cancel = (error) => {
|
|
35308
|
+
cancellationError = error;
|
|
35309
|
+
reject(error);
|
|
35310
|
+
};
|
|
35311
|
+
onAbort = () => cancel(new Error("Sign-in was cancelled"));
|
|
35312
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
35313
|
+
timer = setTimeout(() => cancel(new Error("iCloud sign-in timed out")), 6e4);
|
|
35314
|
+
});
|
|
35315
|
+
const throwIfCancelled = () => {
|
|
35316
|
+
if (cancellationError) throw cancellationError;
|
|
35317
|
+
};
|
|
35318
|
+
const signInRequest = async () => {
|
|
35319
|
+
const container = await getContainer();
|
|
35320
|
+
throwIfCancelled();
|
|
35321
|
+
const { signIn } = ensureAuthElements();
|
|
35322
|
+
const existingUser = await container.setUpAuth();
|
|
35323
|
+
throwIfCancelled();
|
|
35324
|
+
if (existingUser) {
|
|
35325
|
+
return existingUser;
|
|
35326
|
+
}
|
|
35327
|
+
getLogger().debug("[CloudKit] Sign-in container innerHTML:", signIn.innerHTML);
|
|
35328
|
+
getLogger().debug("[CloudKit] Sign-in container children:", signIn.children.length);
|
|
35329
|
+
const appleButton = signIn.querySelector(
|
|
35330
|
+
"a, button, [role='button'], div[id*='apple']"
|
|
35331
|
+
);
|
|
35332
|
+
getLogger().debug("[CloudKit] Found button element:", appleButton);
|
|
35333
|
+
if (appleButton) {
|
|
35334
|
+
getLogger().debug("[CloudKit] Clicking button...");
|
|
35335
|
+
appleButton.click();
|
|
35336
|
+
} else {
|
|
35337
|
+
const anyClickable = signIn.firstElementChild;
|
|
35338
|
+
if (anyClickable) {
|
|
35339
|
+
getLogger().debug("[CloudKit] Clicking first child element:", anyClickable);
|
|
35340
|
+
anyClickable.click();
|
|
35341
|
+
}
|
|
35315
35342
|
}
|
|
35343
|
+
return container.whenUserSignsIn();
|
|
35344
|
+
};
|
|
35345
|
+
try {
|
|
35346
|
+
return await Promise.race([signInRequest(), cancellation]);
|
|
35347
|
+
} finally {
|
|
35348
|
+
clearTimeout(timer);
|
|
35349
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
35316
35350
|
}
|
|
35317
|
-
return container.whenUserSignsIn();
|
|
35318
35351
|
}
|
|
35319
35352
|
async function uploadFileToICloud(filename, content, backupRevision) {
|
|
35320
35353
|
const container = await getContainer();
|
package/dist/server/index.cjs
CHANGED
|
@@ -19789,7 +19789,8 @@ function createSseClient({
|
|
|
19789
19789
|
let buffer = "";
|
|
19790
19790
|
const abortHandler = () => {
|
|
19791
19791
|
try {
|
|
19792
|
-
reader.cancel()
|
|
19792
|
+
void reader.cancel().catch(() => {
|
|
19793
|
+
});
|
|
19793
19794
|
} catch {
|
|
19794
19795
|
}
|
|
19795
19796
|
};
|
|
@@ -19852,6 +19853,8 @@ function createSseClient({
|
|
|
19852
19853
|
}
|
|
19853
19854
|
} finally {
|
|
19854
19855
|
signal.removeEventListener("abort", abortHandler);
|
|
19856
|
+
await reader.cancel().catch(() => {
|
|
19857
|
+
});
|
|
19855
19858
|
reader.releaseLock();
|
|
19856
19859
|
}
|
|
19857
19860
|
break;
|
package/dist/server/index.mjs
CHANGED
|
@@ -18078,7 +18078,8 @@ function createSseClient({
|
|
|
18078
18078
|
let buffer = "";
|
|
18079
18079
|
const abortHandler = () => {
|
|
18080
18080
|
try {
|
|
18081
|
-
reader.cancel()
|
|
18081
|
+
void reader.cancel().catch(() => {
|
|
18082
|
+
});
|
|
18082
18083
|
} catch {
|
|
18083
18084
|
}
|
|
18084
18085
|
};
|
|
@@ -18141,6 +18142,8 @@ function createSseClient({
|
|
|
18141
18142
|
}
|
|
18142
18143
|
} finally {
|
|
18143
18144
|
signal.removeEventListener("abort", abortHandler);
|
|
18145
|
+
await reader.cancel().catch(() => {
|
|
18146
|
+
});
|
|
18144
18147
|
reader.releaseLock();
|
|
18145
18148
|
}
|
|
18146
18149
|
break;
|
|
@@ -190,7 +190,8 @@ function createSseClient({
|
|
|
190
190
|
let buffer = "";
|
|
191
191
|
const abortHandler = () => {
|
|
192
192
|
try {
|
|
193
|
-
reader.cancel()
|
|
193
|
+
void reader.cancel().catch(() => {
|
|
194
|
+
});
|
|
194
195
|
} catch {
|
|
195
196
|
}
|
|
196
197
|
};
|
|
@@ -253,6 +254,8 @@ function createSseClient({
|
|
|
253
254
|
}
|
|
254
255
|
} finally {
|
|
255
256
|
signal.removeEventListener("abort", abortHandler);
|
|
257
|
+
await reader.cancel().catch(() => {
|
|
258
|
+
});
|
|
256
259
|
reader.releaseLock();
|
|
257
260
|
}
|
|
258
261
|
break;
|
|
@@ -72,7 +72,8 @@ function createSseClient({
|
|
|
72
72
|
let buffer = "";
|
|
73
73
|
const abortHandler = () => {
|
|
74
74
|
try {
|
|
75
|
-
reader.cancel()
|
|
75
|
+
void reader.cancel().catch(() => {
|
|
76
|
+
});
|
|
76
77
|
} catch {
|
|
77
78
|
}
|
|
78
79
|
};
|
|
@@ -135,6 +136,8 @@ function createSseClient({
|
|
|
135
136
|
}
|
|
136
137
|
} finally {
|
|
137
138
|
signal.removeEventListener("abort", abortHandler);
|
|
139
|
+
await reader.cancel().catch(() => {
|
|
140
|
+
});
|
|
138
141
|
reader.releaseLock();
|
|
139
142
|
}
|
|
140
143
|
break;
|