@seedprotocol/arweave 0.8.0 → 0.8.1-next.1665.g4ece1f4
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/{ArweaveClient-Cy1laqZ-.js → ArweaveClient-BhqiFB9a.js} +114 -110
- package/dist/ArweaveClient-BhqiFB9a.js.map +1 -0
- package/dist/gateway/readBaseUrls.d.ts +7 -3
- package/dist/gateway/readBaseUrls.d.ts.map +1 -1
- package/dist/index.js +84 -84
- package/dist/index.js.map +1 -1
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/dist/ArweaveClient-Cy1laqZ-.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as ee, K as te, L as
|
|
2
|
-
import { parseFragment as
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as ee, K as te, L as ne, M as re, N as ie, O as ae, P as oe, Q as se, R as ce, S as le, T as ue, U as de, V as fe, W as pe, X as me, Y as he, Z as ge, _ as u, a as _e, at as d, b as f, c as p, ct as m, d as ve, et as ye, f as be, g as xe, h as Se, i as Ce, it as we, j as Te, k as h, l as Ee, lt as De, m as g, n as Oe, nt as ke, o as Ae, ot as _, p as v, q as y, r as b, rt as x, s as S, st as C, t as je, tt as Me, u as Ne, ut as w, v as Pe, w as Fe, x as Ie, y as Le, z as Re } from "./ArweaveClient-BhqiFB9a.js";
|
|
2
|
+
import { parseFragment as ze } from "parse5";
|
|
3
3
|
//#region src/easAttestationUrl.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
4
|
+
var Be = /(^|\.)easscan\.(org|xyz)$/i;
|
|
5
|
+
function T(e) {
|
|
6
6
|
let t = e.trim();
|
|
7
7
|
if (!t) return !1;
|
|
8
8
|
try {
|
|
9
9
|
let e = new URL(t);
|
|
10
|
-
return
|
|
10
|
+
return Be.test(e.hostname) ? /\/attestation\/view\//i.test(e.pathname) : !1;
|
|
11
11
|
} catch {
|
|
12
12
|
return !1;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/relationSeedRef.ts
|
|
17
|
-
function
|
|
17
|
+
function Ve(e) {
|
|
18
18
|
let t = {
|
|
19
19
|
localId: void 0,
|
|
20
20
|
uid: void 0
|
|
21
21
|
};
|
|
22
22
|
return e && (e.length === 10 && (t.localId = e), e.startsWith("0x") && e.length === 66 && (t.uid = e)), t;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function E(e) {
|
|
25
25
|
if (e != null) {
|
|
26
26
|
if (typeof e == "string") {
|
|
27
27
|
let t = e.trim();
|
|
@@ -34,35 +34,35 @@ function D(e) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
let t =
|
|
37
|
+
var He = /^[a-zA-Z0-9_-]{10,21}$/;
|
|
38
|
+
function D(e) {
|
|
39
|
+
let t = Ve(e);
|
|
40
40
|
return t.localId || t.uid ? {
|
|
41
41
|
seedLocalId: t.localId,
|
|
42
42
|
seedUid: t.uid
|
|
43
|
-
} :
|
|
43
|
+
} : He.test(e) && !e.startsWith("0x") ? { seedLocalId: e } : {};
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/mediaRef.ts
|
|
47
|
-
var
|
|
48
|
-
function
|
|
47
|
+
var Ue = /^[a-zA-Z0-9_-]{43}$/;
|
|
48
|
+
function We(e) {
|
|
49
49
|
return e == null ? "" : typeof e == "string" ? e.trim() : String(e).trim();
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function O(e, t) {
|
|
52
52
|
let n = e[t];
|
|
53
53
|
return n == null ? "" : typeof n == "string" ? n.trim() : typeof n == "number" || typeof n == "boolean" ? String(n) : "";
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Ge(e) {
|
|
56
56
|
let t = e.trim();
|
|
57
57
|
if (!t) return t;
|
|
58
58
|
try {
|
|
59
|
-
let e =
|
|
59
|
+
let e = E(JSON.parse(t));
|
|
60
60
|
if (e) return e;
|
|
61
61
|
} catch {}
|
|
62
62
|
return t;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
let n =
|
|
64
|
+
function k(e, t) {
|
|
65
|
+
let n = We(e);
|
|
66
66
|
if (!n) return { kind: "empty" };
|
|
67
67
|
let r = t?.treatAs;
|
|
68
68
|
if (r === "url") return {
|
|
@@ -80,14 +80,14 @@ function A(e, t) {
|
|
|
80
80
|
kind: "unknown",
|
|
81
81
|
raw: n
|
|
82
82
|
};
|
|
83
|
-
if (n.startsWith("http://") || n.startsWith("https://") || n.startsWith("blob:") || n.startsWith("data:")) return
|
|
83
|
+
if (n.startsWith("http://") || n.startsWith("https://") || n.startsWith("blob:") || n.startsWith("data:")) return T(n) ? {
|
|
84
84
|
kind: "nonMediaUrl",
|
|
85
85
|
href: n
|
|
86
86
|
} : {
|
|
87
87
|
kind: "url",
|
|
88
88
|
href: n
|
|
89
89
|
};
|
|
90
|
-
let i =
|
|
90
|
+
let i = Ge(n), a = D(i);
|
|
91
91
|
return a.seedUid ? {
|
|
92
92
|
kind: "seedUid",
|
|
93
93
|
uid: a.seedUid
|
|
@@ -97,7 +97,7 @@ function A(e, t) {
|
|
|
97
97
|
} : i.startsWith("0x") && i.length === 66 ? {
|
|
98
98
|
kind: "seedUid",
|
|
99
99
|
uid: i
|
|
100
|
-
} :
|
|
100
|
+
} : Ue.test(i) && !i.startsWith("0x") ? {
|
|
101
101
|
kind: "arweaveTxId",
|
|
102
102
|
txId: i
|
|
103
103
|
} : {
|
|
@@ -105,25 +105,25 @@ function A(e, t) {
|
|
|
105
105
|
raw: n
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
let n =
|
|
108
|
+
function A(e, t) {
|
|
109
|
+
let n = O(e, t);
|
|
110
110
|
if (n) return n;
|
|
111
111
|
let r = t.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`);
|
|
112
112
|
if (r !== t) {
|
|
113
|
-
let t =
|
|
113
|
+
let t = O(e, r);
|
|
114
114
|
if (t) return t;
|
|
115
115
|
}
|
|
116
116
|
let i = t.split("_");
|
|
117
117
|
if (i.length > 1) {
|
|
118
|
-
let t =
|
|
118
|
+
let t = O(e, i[0] + i.slice(1).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(""));
|
|
119
119
|
if (t) return t;
|
|
120
120
|
}
|
|
121
121
|
return "";
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function j(e, t) {
|
|
124
124
|
let n = {};
|
|
125
125
|
for (let [r, i] of Object.entries(t)) {
|
|
126
|
-
let t =
|
|
126
|
+
let t = A(e, r);
|
|
127
127
|
if (!t) {
|
|
128
128
|
n[r] = void 0;
|
|
129
129
|
continue;
|
|
@@ -142,7 +142,7 @@ function We(e, t) {
|
|
|
142
142
|
};
|
|
143
143
|
continue;
|
|
144
144
|
}
|
|
145
|
-
let a =
|
|
145
|
+
let a = k(t, { treatAs: i.treatAs });
|
|
146
146
|
n[r] = {
|
|
147
147
|
role: i.role,
|
|
148
148
|
raw: t,
|
|
@@ -151,12 +151,12 @@ function We(e, t) {
|
|
|
151
151
|
}
|
|
152
152
|
return n;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
return `${(
|
|
154
|
+
function Ke(e) {
|
|
155
|
+
return `${(g()[0] ?? c.getBaseUrl()).replace(/\/+$/, "")}/raw/${e}`;
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/gateway/publicUrl.ts
|
|
159
|
-
function
|
|
159
|
+
function qe(e) {
|
|
160
160
|
try {
|
|
161
161
|
let t = new URL(e), n = t.hostname.toLowerCase();
|
|
162
162
|
return n === "localhost" || n.endsWith(".localhost") || n === "[::1]" || /^127\./.test(n) ? !0 : t.pathname.replace(/\/+$/, "") !== "";
|
|
@@ -165,10 +165,10 @@ function Ke(e) {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
function M() {
|
|
168
|
-
let e =
|
|
168
|
+
let e = u()?.publicArweaveBaseUrl;
|
|
169
169
|
if (e) return e;
|
|
170
|
-
let t =
|
|
171
|
-
return
|
|
170
|
+
let t = c.getBaseUrl();
|
|
171
|
+
return qe(t) ? `https://${w() || "arweave.net"}` : t;
|
|
172
172
|
}
|
|
173
173
|
function N(e) {
|
|
174
174
|
return `${M()}/raw/${e}`;
|
|
@@ -212,19 +212,19 @@ function L(e) {
|
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Je(e) {
|
|
216
216
|
let t = e.storageTransactionId?.trim();
|
|
217
217
|
if (t) {
|
|
218
218
|
let e = L(t);
|
|
219
219
|
if (e) return e;
|
|
220
220
|
}
|
|
221
221
|
let n = e.arweaveUrl?.trim();
|
|
222
|
-
if (n && !
|
|
222
|
+
if (n && !T(n)) return n;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Ye(e) {
|
|
225
225
|
let t = e.trim();
|
|
226
|
-
if (!t ||
|
|
227
|
-
let n =
|
|
226
|
+
if (!t || T(t)) return;
|
|
227
|
+
let n = k(t);
|
|
228
228
|
switch (n.kind) {
|
|
229
229
|
case "url": return { mediaUrl: n.href };
|
|
230
230
|
case "arweaveTxId": {
|
|
@@ -244,29 +244,29 @@ function Je(e) {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
let t = I(e, "storageTransactionId", "storage_transaction_id"), n = I(e, "arweaveUrl", "arweave_url"), r = I(e, "seedUid", "SeedUid", "seed_uid"), i = I(e, "link", "Link"), a =
|
|
247
|
+
function Xe(e) {
|
|
248
|
+
let t = I(e, "storageTransactionId", "storage_transaction_id"), n = I(e, "arweaveUrl", "arweave_url"), r = I(e, "seedUid", "SeedUid", "seed_uid"), i = I(e, "link", "Link"), a = Je({
|
|
249
249
|
storageTransactionId: t,
|
|
250
250
|
arweaveUrl: n
|
|
251
|
-
}) ?? (i && !
|
|
251
|
+
}) ?? (i && !T(i) ? i : void 0);
|
|
252
252
|
if (t || n || r || a) return {
|
|
253
253
|
...t ? { storageTransactionId: t } : {},
|
|
254
|
-
...n && !
|
|
254
|
+
...n && !T(n) ? { arweaveUrl: n } : {},
|
|
255
255
|
...r ? { seedUid: r } : {},
|
|
256
256
|
...a ? { mediaUrl: a } : {}
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
function R(e) {
|
|
260
260
|
if (e != null) {
|
|
261
|
-
if (typeof e == "string") return
|
|
261
|
+
if (typeof e == "string") return Ye(e);
|
|
262
262
|
if (Array.isArray(e)) for (let t of e) {
|
|
263
263
|
let e = R(t);
|
|
264
264
|
if (e?.mediaUrl || e?.storageTransactionId || e?.seedUid) return e;
|
|
265
265
|
}
|
|
266
|
-
else if (typeof e == "object") return
|
|
266
|
+
else if (typeof e == "object") return Xe(e);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Ze(e, t = P) {
|
|
270
270
|
for (let n of t) {
|
|
271
271
|
if (!(n in e)) continue;
|
|
272
272
|
let t = R(e[n]);
|
|
@@ -275,11 +275,11 @@ function Xe(e, t = P) {
|
|
|
275
275
|
}
|
|
276
276
|
//#endregion
|
|
277
277
|
//#region src/ArweaveClient/transactionTagsByIds.ts
|
|
278
|
-
var
|
|
279
|
-
async function
|
|
278
|
+
var Qe = 100, z = "\n query GetTransactionsTagsByIds($ids: [ID!], $first: Int) {\n transactions(ids: $ids, first: $first) {\n edges {\n node {\n id\n tags {\n name\n value\n }\n }\n }\n }\n }\n";
|
|
279
|
+
async function $e(e, t) {
|
|
280
280
|
let n = /* @__PURE__ */ new Map(), r = Array.from(new Set(e.filter((e) => typeof e == "string" && e.trim())));
|
|
281
281
|
if (r.length === 0) return n;
|
|
282
|
-
let i = t?.client ??
|
|
282
|
+
let i = t?.client ?? c.getArweaveClient(), a = Math.max(1, Math.min(t?.batchSize ?? 100, 100));
|
|
283
283
|
for (let e = 0; e < r.length; e += a) {
|
|
284
284
|
let o = r.slice(e, e + a);
|
|
285
285
|
try {
|
|
@@ -308,9 +308,9 @@ function B(e) {
|
|
|
308
308
|
function V(e, t) {
|
|
309
309
|
return `${B(e)}/api/upload/arweave/data/${encodeURIComponent(t)}`;
|
|
310
310
|
}
|
|
311
|
-
var
|
|
312
|
-
async function
|
|
313
|
-
let r = V(e, t), i = n?.timeoutMs ??
|
|
311
|
+
var et = 45e3;
|
|
312
|
+
async function tt(e, t, n) {
|
|
313
|
+
let r = V(e, t), i = n?.timeoutMs ?? et, a = new AbortController(), o = setTimeout(() => a.abort(), i);
|
|
314
314
|
try {
|
|
315
315
|
let e = await fetch(r, { signal: a.signal });
|
|
316
316
|
return clearTimeout(o), e.status === 404 ? {
|
|
@@ -335,15 +335,15 @@ async function et(e, t, n) {
|
|
|
335
335
|
}
|
|
336
336
|
//#endregion
|
|
337
337
|
//#region src/ArweaveClient/arweaveL1UploadApi.ts
|
|
338
|
-
var
|
|
338
|
+
var nt = "\n query ArweaveGatewayTransaction($id: String!) {\n transaction(id: $id) {\n id\n bundledIn {\n id\n }\n block {\n height\n timestamp\n }\n }\n }\n";
|
|
339
339
|
function H(e, t) {
|
|
340
340
|
return `${B(e)}/api/upload/arweave/status/${encodeURIComponent(t)}`;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function rt(e) {
|
|
343
343
|
let t = e.l1;
|
|
344
344
|
return t ? t.meetsMinConfirmations === !0 || t.confirmed === !0 : !1;
|
|
345
345
|
}
|
|
346
|
-
async function
|
|
346
|
+
async function it(e, t) {
|
|
347
347
|
let n = H(e, t);
|
|
348
348
|
try {
|
|
349
349
|
let e = await fetch(n);
|
|
@@ -362,7 +362,7 @@ async function U(e, t, n) {
|
|
|
362
362
|
method: "POST",
|
|
363
363
|
headers: { "Content-Type": "application/json" },
|
|
364
364
|
body: JSON.stringify({
|
|
365
|
-
query:
|
|
365
|
+
query: nt,
|
|
366
366
|
variables: { id: t }
|
|
367
367
|
}),
|
|
368
368
|
signal: n?.signal
|
|
@@ -386,18 +386,18 @@ async function U(e, t, n) {
|
|
|
386
386
|
return null;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
async function
|
|
390
|
-
let r =
|
|
389
|
+
async function at(e, t, n) {
|
|
390
|
+
let r = C(), i = e?.trim(), a = "https", o = null;
|
|
391
391
|
if (i) try {
|
|
392
392
|
let e = new URL(i);
|
|
393
393
|
a = e.protocol === "http:" ? "http" : "https", o = e.hostname || null;
|
|
394
394
|
} catch {
|
|
395
395
|
o = null;
|
|
396
396
|
}
|
|
397
|
-
let s = o && o.length > 0 ?
|
|
397
|
+
let s = o && o.length > 0 ? _(o) : [...r], c = n?.signal;
|
|
398
398
|
for (let e of s) {
|
|
399
399
|
let r = `${a}://${e}`;
|
|
400
|
-
if (!await
|
|
400
|
+
if (!await h(r, { signal: c ?? void 0 })) continue;
|
|
401
401
|
let i = await U(`${a}://${e}/graphql`, t, n);
|
|
402
402
|
if (i !== null) return i;
|
|
403
403
|
}
|
|
@@ -405,7 +405,7 @@ async function it(e, t, n) {
|
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
407
|
//#region src/gateway/seedGatewayConfig.ts
|
|
408
|
-
function
|
|
408
|
+
function ot(e) {
|
|
409
409
|
let t = e.gateway ?? {};
|
|
410
410
|
return {
|
|
411
411
|
transport: t.transport,
|
|
@@ -423,7 +423,7 @@ function at(e) {
|
|
|
423
423
|
}
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function st(e) {
|
|
427
427
|
return {
|
|
428
428
|
transport: e.gatewayTransport,
|
|
429
429
|
arweaveDomain: e.arweaveDomain,
|
|
@@ -438,7 +438,7 @@ function ot(e) {
|
|
|
438
438
|
}
|
|
439
439
|
//#endregion
|
|
440
440
|
//#region src/htmlLinks.ts
|
|
441
|
-
var W = "[A-Za-z0-9_-]{43}",
|
|
441
|
+
var W = "[A-Za-z0-9_-]{43}", ct = RegExp(`^ar://(${W})([/?#].*)?$`), lt = RegExp(`/raw/(${W})(/.*)?$`), G = RegExp(`^/(${W})(/.*)?$`), K = (e) => {
|
|
442
442
|
try {
|
|
443
443
|
return new URL(e).host.toLowerCase();
|
|
444
444
|
} catch {
|
|
@@ -470,15 +470,15 @@ function J(e, t) {
|
|
|
470
470
|
path: n.path
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function ut(e, t) {
|
|
474
474
|
let n = e.toLowerCase();
|
|
475
|
-
if (
|
|
475
|
+
if (m(n.replace(/:\d+$/, ""))) return !0;
|
|
476
476
|
let r = t.filter((e) => q(e)?.path === "");
|
|
477
|
-
for (let e of [...r.map(K), ...
|
|
477
|
+
for (let e of [...r.map(K), ...d]) if (e && (n === e || n.endsWith(`.${e}`))) return !0;
|
|
478
478
|
return !1;
|
|
479
479
|
}
|
|
480
480
|
function Y(e, t) {
|
|
481
|
-
let n = e.trim(), r =
|
|
481
|
+
let n = e.trim(), r = ct.exec(n);
|
|
482
482
|
if (r) return {
|
|
483
483
|
transactionId: r[1],
|
|
484
484
|
form: "raw",
|
|
@@ -491,13 +491,13 @@ function Y(e, t) {
|
|
|
491
491
|
} catch {
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
494
|
-
let a = i.search + i.hash, o =
|
|
494
|
+
let a = i.search + i.hash, o = lt.exec(i.pathname);
|
|
495
495
|
if (o) return {
|
|
496
496
|
transactionId: o[1],
|
|
497
497
|
form: "raw",
|
|
498
498
|
rest: (o[2] ?? "") + a
|
|
499
499
|
};
|
|
500
|
-
let s = t?.baseUrls ??
|
|
500
|
+
let s = t?.baseUrls ?? g(), c = J(i, s), l = c && G.exec(c.path) || (ut(i.host, s) ? G.exec(i.pathname) : null);
|
|
501
501
|
if (l) return {
|
|
502
502
|
transactionId: l[1],
|
|
503
503
|
form: "bare",
|
|
@@ -507,8 +507,8 @@ function Y(e, t) {
|
|
|
507
507
|
function X(e, t) {
|
|
508
508
|
return `${t.replace(/\/+$/, "")}${e.form === "raw" ? "/raw/" : "/"}${e.transactionId}${e.rest}`;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
let n = t?.baseUrls ??
|
|
510
|
+
function dt(e, t) {
|
|
511
|
+
let n = t?.baseUrls ?? g(), r = Y(e, { baseUrls: n });
|
|
512
512
|
if (!r) return;
|
|
513
513
|
let i = -1;
|
|
514
514
|
try {
|
|
@@ -517,11 +517,11 @@ function ut(e, t) {
|
|
|
517
517
|
let a = n[i + 1];
|
|
518
518
|
return a ? X(r, a) : void 0;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function ft(e) {
|
|
521
521
|
return e.replace(/&/g, "&").replace(/"/g, """);
|
|
522
522
|
}
|
|
523
523
|
function Z(e, t) {
|
|
524
|
-
let n =
|
|
524
|
+
let n = ze(e, { sourceCodeLocationInfo: !0 }), r = [], i = (e) => {
|
|
525
525
|
if (e.nodeName === "#text" || e.nodeName === "#comment") return;
|
|
526
526
|
let n = e;
|
|
527
527
|
if (n.attrs?.length) for (let e of n.attrs) {
|
|
@@ -530,7 +530,7 @@ function Z(e, t) {
|
|
|
530
530
|
i !== void 0 && a && r.push({
|
|
531
531
|
start: a.startOffset,
|
|
532
532
|
end: a.endOffset,
|
|
533
|
-
text: `${e.name}="${
|
|
533
|
+
text: `${e.name}="${ft(i)}"`
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
let a = n;
|
|
@@ -543,12 +543,12 @@ function Z(e, t) {
|
|
|
543
543
|
for (let e of r.sort((e, t) => t.start - e.start)) a = a.slice(0, e.start) + e.text + a.slice(e.end);
|
|
544
544
|
return a;
|
|
545
545
|
}
|
|
546
|
-
var
|
|
546
|
+
var pt = /* @__PURE__ */ new Set([
|
|
547
547
|
"src",
|
|
548
548
|
"href",
|
|
549
549
|
"poster"
|
|
550
550
|
]);
|
|
551
|
-
function
|
|
551
|
+
function mt(e, t) {
|
|
552
552
|
let n = !1, r = e.split(",").map((e) => {
|
|
553
553
|
let r = /^(\s*)(\S+)(.*)$/s.exec(e);
|
|
554
554
|
if (!r) return e;
|
|
@@ -558,8 +558,8 @@ function pt(e, t) {
|
|
|
558
558
|
return n ? r.join(",") : void 0;
|
|
559
559
|
}
|
|
560
560
|
function Q(e, t, n) {
|
|
561
|
-
if (e === "srcset") return
|
|
562
|
-
if (!
|
|
561
|
+
if (e === "srcset") return mt(t, n);
|
|
562
|
+
if (!pt.has(e)) return;
|
|
563
563
|
let r = n(t.trim());
|
|
564
564
|
return r === void 0 || r === t ? void 0 : r;
|
|
565
565
|
}
|
|
@@ -567,11 +567,11 @@ function $(e, t) {
|
|
|
567
567
|
if (e.includes("ar://") || e.includes("/raw/")) return !0;
|
|
568
568
|
let n = e.toLowerCase();
|
|
569
569
|
if (n.includes("arweave.net") || n.includes("ar-io.net")) return !0;
|
|
570
|
-
for (let e of [...t.map(K), ...
|
|
570
|
+
for (let e of [...t.map(K), ...d]) if (e && n.includes(e)) return !0;
|
|
571
571
|
return !1;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
let n = t?.baseUrls ??
|
|
573
|
+
function ht(e, t) {
|
|
574
|
+
let n = t?.baseUrls ?? g(), r = n[0];
|
|
575
575
|
if (!r || !e || !$(e, n)) return e;
|
|
576
576
|
let i = (e) => {
|
|
577
577
|
let t = Y(e, { baseUrls: n });
|
|
@@ -581,8 +581,8 @@ function mt(e, t) {
|
|
|
581
581
|
};
|
|
582
582
|
return Z(e, (e, t, n) => Q(t, n, i));
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
let i = [n, ...r ??
|
|
584
|
+
function gt(e, { to: t = "gateway", publicBaseUrl: n, baseUrls: r }) {
|
|
585
|
+
let i = [n, ...r ?? g()];
|
|
586
586
|
if (!e || !$(e, i)) return e;
|
|
587
587
|
let a = (e) => {
|
|
588
588
|
let r = Y(e, { baseUrls: i });
|
|
@@ -593,6 +593,6 @@ function ht(e, { to: t = "gateway", publicBaseUrl: n, baseUrls: r }) {
|
|
|
593
593
|
return Z(e, (e, t, n) => Q(t, n, a));
|
|
594
594
|
}
|
|
595
595
|
//#endregion
|
|
596
|
-
export {
|
|
596
|
+
export { je as ARWEAVE_GRAPHQL_TIMEOUT_MS, ge as ARWEAVE_HOST_ENV_KEYS, c as ArweaveClient, c as BaseArweaveClient, se as DEFAULT_ARWEAVE_GATEWAYS, e as DEFAULT_ARWEAVE_GRAPHQL_URL, ye as DEFAULT_ARWEAVE_HOST, Ee as DEFAULT_ARWEAVE_RAW_READ_TIMEOUT_MS, Me as DEFAULT_GATEWAY_SIDECAR_HOST, ke as DEFAULT_GATEWAY_SIDECAR_PORT, x as DEFAULT_SEED_FEED_HYPER_KEY, we as DEFAULT_SEED_GATEWAY_HYPER_KEY, b as DEFAULT_TRANSACTION_STATUS_TIMEOUT_MS, Ce as DEFAULT_TRANSACTION_STATUS_TOTAL_TIMEOUT_MS, Oe as DefaultArweaveClient, de as DuplicateArweaveModuleError, S as GET_ARWEAVE_TRANSACTIONS, z as GET_TRANSACTIONS_TAGS_BY_IDS, p as GET_TRANSACTION_TAGS, d as KNOWN_ARWEAVE_GATEWAYS, _e as MIN_TRANSACTION_STATUS_ATTEMPT_MS, P as SEED_RSS_IMAGE_RELATION_FIELD_KEYS, Qe as TRANSACTION_TAGS_BATCH_SIZE, pe as assertSingleArweaveModule, re as beginGatewayHostHalfOpenProbe, X as buildArweaveTransactionLink, ie as cancelGatewayHostHalfOpenProbe, k as classifyMediaRef, oe as configureGatewayCircuitBreaker, Ne as ensureArweaveReadGatewayForFallback, ue as ensureReadGatewaySelected, ve as fetchArweaveRawBytesAcrossGateways, be as fetchArweaveRawFromBaseUrl, v as fetchArweaveRawTextAcrossGateways, Ae as fetchTransactionStatusAcrossGateways, g as getArweaveReadBaseUrls, _ as getArweaveReadGatewayHostsForPrimary, it as getArweaveUploadStatus, Ke as getArweaveUrlForTransaction, C as getDefaultArweaveReadGatewayHostsOrdered, A as getFeedItemStringField, o as getGatewayHostCircuitState, a as getLastHealthyReadGatewayHost, xe as getPreferredArweaveReadBaseUrls, M as getPublicArweaveBaseUrl, N as getPublicArweaveRawUrl, f as getReadGatewayHostsForConfig, Se as getResolvedArweaveReadBaseUrls, u as getResolvedSeedGatewayEndpoints, te as getResponseMediaType, $e as getTransactionTagsByIds, V as getUploadApiArweaveDataUrl, H as getUploadApiArweaveStatusUrl, tt as getUploadPipelineTransactionStatus, y as hasArweaveContentReadTransform, i as invalidateReadGatewayCache, Ie as invalidateSidecarProbeCache, rt as isArweaveL1AnchoringComplete, T as isEasAttestationExplorerUrl, l as isGatewayHostCircuitOpen, m as isKnownArweaveGatewayHostname, ae as isReadGatewayKnownHealthy, ne as listOpenGatewayCircuitHosts, Q as mapUrlAttribute, De as mergePrimaryHostWithDefaults, dt as nextArweaveGatewayUrl, j as normalizeFeedItemFields, ce as normalizeGatewayHostKey, E as normalizeRelationPropertyValue, B as normalizeUploadApiBaseUrl, Y as parseArweaveTransactionLink, h as probeGateway, gt as publishedArweaveLinksInHtml, U as queryArweaveGatewayTransaction, at as queryArweaveGatewayTransactionWithFallback, ee as readArweaveContentResponse, Re as recordGatewayHostFailure, n as recordGatewayHostSuccess, ht as rehostArweaveLinksInHtml, s as resetArweaveClientOwnerForTests, t as resetArweaveReadGatewayForTests, fe as resetGatewayCircuitBreakerForTests, w as resolveArweaveHostFromEnv, le as resolveProxyBaseUrl, r as resolveSeedGatewayEndpoints, D as resolveSeedIdsFromRefString, Ze as resolveSeedRssImageRelationFromItem, R as resolveSeedRssImageRelationRef, Fe as resolveSidecarOrigin, Z as rewriteHtmlAttributes, st as seedGatewayConfigFromClientContext, ot as seedGatewayConfigFromSeedConfig, Te as selectFirstHealthyReadGateway, he as setArweaveContentReadTransform, Pe as setPreferredArweaveReadBaseUrls, Le as setResolvedSeedGatewayEndpoints, me as transformArweaveContent };
|
|
597
597
|
|
|
598
598
|
//# sourceMappingURL=index.js.map
|