@palbase/web 7.3.2 → 7.3.3
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/{chunk-HKZVA3I3.js → chunk-43BGZCNU.js} +7 -4
- package/dist/chunk-43BGZCNU.js.map +1 -0
- package/dist/{chunk-OZLTH7YB.js → chunk-IRPS637F.js} +2 -2
- package/dist/{chunk-TQAQR3OP.js → chunk-XF7NM6HF.js} +3 -3
- package/dist/{chunk-TQAQR3OP.js.map → chunk-XF7NM6HF.js.map} +1 -1
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/internal.cjs +7 -4
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/next/client.cjs +7 -4
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +2 -2
- package/dist/next/index.cjs +7 -4
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +3 -3
- package/dist/next/proxy.js +2 -2
- package/dist/react/index.cjs +5 -2
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-HKZVA3I3.js.map +0 -1
- /package/dist/{chunk-OZLTH7YB.js.map → chunk-IRPS637F.js.map} +0 -0
package/dist/next/client.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
__configure,
|
|
8
8
|
getRuntime
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-XF7NM6HF.js";
|
|
10
|
+
import "../chunk-43BGZCNU.js";
|
|
11
11
|
import {
|
|
12
12
|
environmentRefFromPublishableApiKey
|
|
13
13
|
} from "../chunk-CFDU23TB.js";
|
package/dist/next/index.cjs
CHANGED
|
@@ -195,13 +195,16 @@ var MAX_POW_DIFFICULTY = 24;
|
|
|
195
195
|
function powBudget(difficulty) {
|
|
196
196
|
return 8 * 2 ** difficulty;
|
|
197
197
|
}
|
|
198
|
-
async function solvePowChallenge(challenge, maxIterations = powBudget(challenge.difficulty)) {
|
|
198
|
+
async function solvePowChallenge(challenge, maxIterations = powBudget(challenge.difficulty), signal) {
|
|
199
199
|
if (challenge.difficulty > MAX_POW_DIFFICULTY) {
|
|
200
200
|
throw new Error(
|
|
201
201
|
`proof-of-work: refusing difficulty ${challenge.difficulty}; this client attempts at most ${MAX_POW_DIFFICULTY}, which is the highest a Palbase stack issues`
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
204
|
for (let nonce = 0; nonce < maxIterations; nonce++) {
|
|
205
|
+
if ((nonce & 1023) === 0 && signal?.aborted) {
|
|
206
|
+
throw new DOMException("proof-of-work solve aborted", "AbortError");
|
|
207
|
+
}
|
|
205
208
|
const digest = await crypto.subtle.digest("SHA-256", encoder.encode(challenge.prefix + nonce));
|
|
206
209
|
if (leadingZeroBits(new Uint8Array(digest)) >= challenge.difficulty) {
|
|
207
210
|
return {
|
|
@@ -371,7 +374,7 @@ var HttpClient = class _HttpClient {
|
|
|
371
374
|
if (attempt < MAX_RETRIES - 1) {
|
|
372
375
|
const backoff = INITIAL_BACKOFF_MS * 2 ** attempt;
|
|
373
376
|
await this.delay(backoff);
|
|
374
|
-
return this.executeWithRetry(method, path, options, attempt + 1
|
|
377
|
+
return this.executeWithRetry(method, path, options, attempt + 1);
|
|
375
378
|
}
|
|
376
379
|
throw new PalbaseError(
|
|
377
380
|
"network_error",
|
|
@@ -407,7 +410,7 @@ var HttpClient = class _HttpClient {
|
|
|
407
410
|
path,
|
|
408
411
|
options,
|
|
409
412
|
attempt,
|
|
410
|
-
await solvePowChallenge(challenge)
|
|
413
|
+
await solvePowChallenge(challenge, void 0, options?.signal)
|
|
411
414
|
);
|
|
412
415
|
}
|
|
413
416
|
}
|
|
@@ -9373,7 +9376,7 @@ function defaultSessionStorage(key) {
|
|
|
9373
9376
|
}
|
|
9374
9377
|
|
|
9375
9378
|
// src/version.ts
|
|
9376
|
-
var VERSION = "7.3.
|
|
9379
|
+
var VERSION = "7.3.3";
|
|
9377
9380
|
|
|
9378
9381
|
// src/runtime.ts
|
|
9379
9382
|
function buildRuntime(config) {
|