@le-space/ui 0.6.3 → 0.6.4
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/package.json +3 -3
- package/react/index.js +13 -3
- package/shared/index.d.ts +1 -1
- package/shared/index.js +13 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/ui",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Floating Aleph sponsor relay UI components for Svelte and React.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"url": "https://github.com/NiKrause/relay-button/issues"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@le-space/browser": "0.6.
|
|
48
|
-
"@le-space/core": "0.6.
|
|
47
|
+
"@le-space/browser": "0.6.4",
|
|
48
|
+
"@le-space/core": "0.6.4",
|
|
49
49
|
"viem": "^2.38.5"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
package/react/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
|
|
|
43
43
|
var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
|
|
44
44
|
|
|
45
45
|
// src/shared/package-version.ts
|
|
46
|
-
var UI_PACKAGE_VERSION = "0.6.
|
|
46
|
+
var UI_PACKAGE_VERSION = "0.6.4";
|
|
47
47
|
|
|
48
48
|
// src/shared/format.ts
|
|
49
49
|
function shortHash(value, head = 8, tail = 6) {
|
|
@@ -1298,7 +1298,9 @@ async function postBroadcastPayload2(body, options) {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
async function broadcastAlephMessage2(message, options) {
|
|
1300
1300
|
const requestBody = { sync: options.sync ?? false, message };
|
|
1301
|
-
const maxAttempts = 3;
|
|
1301
|
+
const maxAttempts = Math.max(1, Number(options.attempts ?? 3));
|
|
1302
|
+
const retryDelayMs = Math.max(0, Number(options.retryDelayMs ?? 0));
|
|
1303
|
+
const sleep2 = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
1302
1304
|
for (let index = 0; index < maxAttempts; index += 1) {
|
|
1303
1305
|
const result = await postBroadcastPayload2(requestBody, {
|
|
1304
1306
|
apiHost: options.apiHost,
|
|
@@ -1311,6 +1313,9 @@ async function broadcastAlephMessage2(message, options) {
|
|
|
1311
1313
|
if (!canRetry) {
|
|
1312
1314
|
throw new Error(`Broadcast failed: ${result.httpStatus} ${JSON.stringify(result.response ?? {})}`);
|
|
1313
1315
|
}
|
|
1316
|
+
if (retryDelayMs > 0) {
|
|
1317
|
+
await sleep2(retryDelayMs);
|
|
1318
|
+
}
|
|
1314
1319
|
}
|
|
1315
1320
|
throw new Error("Broadcast failed: retry budget exhausted");
|
|
1316
1321
|
}
|
|
@@ -2118,7 +2123,10 @@ async function deployInstance(args) {
|
|
|
2118
2123
|
const { response, httpStatus } = await broadcastAlephMessage2(message, {
|
|
2119
2124
|
apiHost: args.apiHost,
|
|
2120
2125
|
sync: args.sync,
|
|
2121
|
-
fetch: args.fetch
|
|
2126
|
+
fetch: args.fetch,
|
|
2127
|
+
attempts: args.broadcastAttempts,
|
|
2128
|
+
retryDelayMs: args.broadcastRetryDelayMs,
|
|
2129
|
+
sleep: args.broadcastSleep
|
|
2122
2130
|
});
|
|
2123
2131
|
const status = httpStatus === 202 ? "pending" : typeof response.message_status === "string" ? response.message_status : "unknown";
|
|
2124
2132
|
args.onProgress?.({
|
|
@@ -2323,6 +2331,8 @@ async function configureUcanStore(args) {
|
|
|
2323
2331
|
public_ipv4: args.hostIpv4,
|
|
2324
2332
|
public_ipv6: args.publicIpv6 ?? void 0,
|
|
2325
2333
|
proxy_url: args.proxyUrl ?? void 0,
|
|
2334
|
+
service_did: args.serviceDid ?? void 0,
|
|
2335
|
+
service_origin: args.serviceOrigin ?? void 0,
|
|
2326
2336
|
webauthn_origin: args.webauthnOrigin ?? void 0,
|
|
2327
2337
|
webauthn_origin_fallbacks: args.webauthnOriginFallbacks ?? void 0,
|
|
2328
2338
|
admin_did: args.adminDid ?? void 0,
|
package/shared/index.d.ts
CHANGED
|
@@ -330,7 +330,7 @@ declare const STALE_INSTANCE_ALLOCATION_COOLDOWN_MS: number;
|
|
|
330
330
|
declare const RECENT_INSTANCE_RUNTIME_GRACE_MS: number;
|
|
331
331
|
declare const DEPLOYMENT_PENDING_WARNING_MS: number;
|
|
332
332
|
|
|
333
|
-
declare const UI_PACKAGE_VERSION = "0.6.
|
|
333
|
+
declare const UI_PACKAGE_VERSION = "0.6.4";
|
|
334
334
|
|
|
335
335
|
interface RootfsRequiredPortForward {
|
|
336
336
|
port: number;
|
package/shared/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
|
|
|
42
42
|
var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
|
|
43
43
|
|
|
44
44
|
// src/shared/package-version.ts
|
|
45
|
-
var UI_PACKAGE_VERSION = "0.6.
|
|
45
|
+
var UI_PACKAGE_VERSION = "0.6.4";
|
|
46
46
|
|
|
47
47
|
// src/shared/format.ts
|
|
48
48
|
function shortHash(value, head = 8, tail = 6) {
|
|
@@ -1297,7 +1297,9 @@ async function postBroadcastPayload2(body, options) {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
async function broadcastAlephMessage2(message, options) {
|
|
1299
1299
|
const requestBody = { sync: options.sync ?? false, message };
|
|
1300
|
-
const maxAttempts = 3;
|
|
1300
|
+
const maxAttempts = Math.max(1, Number(options.attempts ?? 3));
|
|
1301
|
+
const retryDelayMs = Math.max(0, Number(options.retryDelayMs ?? 0));
|
|
1302
|
+
const sleep2 = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
1301
1303
|
for (let index = 0; index < maxAttempts; index += 1) {
|
|
1302
1304
|
const result = await postBroadcastPayload2(requestBody, {
|
|
1303
1305
|
apiHost: options.apiHost,
|
|
@@ -1310,6 +1312,9 @@ async function broadcastAlephMessage2(message, options) {
|
|
|
1310
1312
|
if (!canRetry) {
|
|
1311
1313
|
throw new Error(`Broadcast failed: ${result.httpStatus} ${JSON.stringify(result.response ?? {})}`);
|
|
1312
1314
|
}
|
|
1315
|
+
if (retryDelayMs > 0) {
|
|
1316
|
+
await sleep2(retryDelayMs);
|
|
1317
|
+
}
|
|
1313
1318
|
}
|
|
1314
1319
|
throw new Error("Broadcast failed: retry budget exhausted");
|
|
1315
1320
|
}
|
|
@@ -2117,7 +2122,10 @@ async function deployInstance(args) {
|
|
|
2117
2122
|
const { response, httpStatus } = await broadcastAlephMessage2(message, {
|
|
2118
2123
|
apiHost: args.apiHost,
|
|
2119
2124
|
sync: args.sync,
|
|
2120
|
-
fetch: args.fetch
|
|
2125
|
+
fetch: args.fetch,
|
|
2126
|
+
attempts: args.broadcastAttempts,
|
|
2127
|
+
retryDelayMs: args.broadcastRetryDelayMs,
|
|
2128
|
+
sleep: args.broadcastSleep
|
|
2121
2129
|
});
|
|
2122
2130
|
const status = httpStatus === 202 ? "pending" : typeof response.message_status === "string" ? response.message_status : "unknown";
|
|
2123
2131
|
args.onProgress?.({
|
|
@@ -2322,6 +2330,8 @@ async function configureUcanStore(args) {
|
|
|
2322
2330
|
public_ipv4: args.hostIpv4,
|
|
2323
2331
|
public_ipv6: args.publicIpv6 ?? void 0,
|
|
2324
2332
|
proxy_url: args.proxyUrl ?? void 0,
|
|
2333
|
+
service_did: args.serviceDid ?? void 0,
|
|
2334
|
+
service_origin: args.serviceOrigin ?? void 0,
|
|
2325
2335
|
webauthn_origin: args.webauthnOrigin ?? void 0,
|
|
2326
2336
|
webauthn_origin_fallbacks: args.webauthnOriginFallbacks ?? void 0,
|
|
2327
2337
|
admin_did: args.adminDid ?? void 0,
|