@seedprotocol/arweave 0.8.1 → 0.8.2-next.1818.gac40edf
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/README.md +6 -1
- package/dist/{ArweaveClient-BhqiFB9a.js → ArweaveClient-wX1uYRvQ.js} +280 -244
- package/dist/ArweaveClient-wX1uYRvQ.js.map +1 -0
- package/dist/content/arweaveContent.d.ts +10 -1
- package/dist/content/arweaveContent.d.ts.map +1 -1
- package/dist/gateway/readBaseUrls.d.ts +31 -7
- package/dist/gateway/readBaseUrls.d.ts.map +1 -1
- package/dist/index.js +98 -98
- package/dist/index.js.map +1 -1
- package/dist/node.js +1 -1
- package/package.json +2 -2
- package/dist/ArweaveClient-BhqiFB9a.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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
|
|
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 u, V as de, W as fe, X as pe, Y as me, Z as he, _ as ge, a as _e, at as ve, b as ye, c as be, ct as d, d as xe, dt as Se, et as Ce, f as we, ft as f, g as Te, h as Ee, i as De, it as Oe, j as ke, k as Ae, l as je, lt as p, m, n as Me, nt as h, o as g, ot as _, p as v, q as y, r as b, rt as x, s as Ne, st as S, t as Pe, tt as Fe, u as Ie, ut as C, v as w, w as Le, x as Re, y as ze, z as Be } from "./ArweaveClient-wX1uYRvQ.js";
|
|
2
|
+
import { parseFragment as Ve } from "parse5";
|
|
3
3
|
//#region src/easAttestationUrl.ts
|
|
4
|
-
var
|
|
4
|
+
var He = /(^|\.)easscan\.(org|xyz)$/i;
|
|
5
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 He.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 Ue(e) {
|
|
18
18
|
let t = {
|
|
19
19
|
localId: void 0,
|
|
20
20
|
uid: void 0
|
|
@@ -34,25 +34,25 @@ function E(e) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var We = /^[a-zA-Z0-9_-]{10,21}$/;
|
|
38
38
|
function D(e) {
|
|
39
|
-
let t =
|
|
39
|
+
let t = Ue(e);
|
|
40
40
|
return t.localId || t.uid ? {
|
|
41
41
|
seedLocalId: t.localId,
|
|
42
42
|
seedUid: t.uid
|
|
43
|
-
} :
|
|
43
|
+
} : We.test(e) && !e.startsWith("0x") ? { seedLocalId: e } : {};
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/mediaRef.ts
|
|
47
|
-
var
|
|
48
|
-
function
|
|
47
|
+
var Ge = /^[a-zA-Z0-9_-]{43}$/;
|
|
48
|
+
function Ke(e) {
|
|
49
49
|
return e == null ? "" : typeof e == "string" ? e.trim() : String(e).trim();
|
|
50
50
|
}
|
|
51
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 qe(e) {
|
|
56
56
|
let t = e.trim();
|
|
57
57
|
if (!t) return t;
|
|
58
58
|
try {
|
|
@@ -62,7 +62,7 @@ function Ge(e) {
|
|
|
62
62
|
return t;
|
|
63
63
|
}
|
|
64
64
|
function k(e, t) {
|
|
65
|
-
let n =
|
|
65
|
+
let n = Ke(e);
|
|
66
66
|
if (!n) return { kind: "empty" };
|
|
67
67
|
let r = t?.treatAs;
|
|
68
68
|
if (r === "url") return {
|
|
@@ -87,7 +87,7 @@ function k(e, t) {
|
|
|
87
87
|
kind: "url",
|
|
88
88
|
href: n
|
|
89
89
|
};
|
|
90
|
-
let i =
|
|
90
|
+
let i = qe(n), a = D(i);
|
|
91
91
|
return a.seedUid ? {
|
|
92
92
|
kind: "seedUid",
|
|
93
93
|
uid: a.seedUid
|
|
@@ -97,7 +97,7 @@ function k(e, t) {
|
|
|
97
97
|
} : i.startsWith("0x") && i.length === 66 ? {
|
|
98
98
|
kind: "seedUid",
|
|
99
99
|
uid: i
|
|
100
|
-
} :
|
|
100
|
+
} : Ge.test(i) && !i.startsWith("0x") ? {
|
|
101
101
|
kind: "arweaveTxId",
|
|
102
102
|
txId: i
|
|
103
103
|
} : {
|
|
@@ -120,7 +120,7 @@ function A(e, t) {
|
|
|
120
120
|
}
|
|
121
121
|
return "";
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Je(e, t) {
|
|
124
124
|
let n = {};
|
|
125
125
|
for (let [r, i] of Object.entries(t)) {
|
|
126
126
|
let t = A(e, r);
|
|
@@ -151,12 +151,12 @@ function j(e, t) {
|
|
|
151
151
|
}
|
|
152
152
|
return n;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
return `${(
|
|
154
|
+
function Ye(e) {
|
|
155
|
+
return `${(m()[0] ?? u.getBaseUrl()).replace(/\/+$/, "")}/raw/${e}`;
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/gateway/publicUrl.ts
|
|
159
|
-
function
|
|
159
|
+
function Xe(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(/\/+$/, "") !== "";
|
|
@@ -164,18 +164,18 @@ function qe(e) {
|
|
|
164
164
|
return !0;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
let e =
|
|
167
|
+
function j() {
|
|
168
|
+
let e = w()?.publicArweaveBaseUrl;
|
|
169
169
|
if (e) return e;
|
|
170
|
-
let t =
|
|
171
|
-
return
|
|
170
|
+
let t = u.getBaseUrl();
|
|
171
|
+
return Xe(t) ? `https://${f() || "arweave.net"}` : t;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
return `${
|
|
173
|
+
function M(e) {
|
|
174
|
+
return `${j()}/raw/${e}`;
|
|
175
175
|
}
|
|
176
176
|
//#endregion
|
|
177
177
|
//#region src/resolveSeedRssImageRelationRef.ts
|
|
178
|
-
var
|
|
178
|
+
var N = [
|
|
179
179
|
"featureImage",
|
|
180
180
|
"feature_image",
|
|
181
181
|
"image",
|
|
@@ -186,49 +186,49 @@ var P = [
|
|
|
186
186
|
"thumbnail_image",
|
|
187
187
|
"thumbnailImage"
|
|
188
188
|
];
|
|
189
|
-
function
|
|
189
|
+
function P(e) {
|
|
190
190
|
return e == null ? "" : typeof e == "string" ? e.trim() : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function F(e, ...t) {
|
|
193
193
|
for (let n of t) {
|
|
194
|
-
let t =
|
|
194
|
+
let t = P(e[n]);
|
|
195
195
|
if (t) return t;
|
|
196
196
|
}
|
|
197
197
|
let n = t.map((e) => e.split(":").pop().toLowerCase());
|
|
198
198
|
for (let [t, r] of Object.entries(e)) {
|
|
199
199
|
let e = (t.includes(":") ? t.split(":").pop() : t).toLowerCase();
|
|
200
200
|
if (n.some((t) => e === t.toLowerCase())) {
|
|
201
|
-
let e =
|
|
201
|
+
let e = P(r);
|
|
202
202
|
if (e) return e;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
return "";
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function I(e) {
|
|
208
208
|
let t = e.trim();
|
|
209
209
|
if (t && !t.startsWith("0x")) try {
|
|
210
|
-
return
|
|
210
|
+
return M(t);
|
|
211
211
|
} catch {
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Ze(e) {
|
|
216
216
|
let t = e.storageTransactionId?.trim();
|
|
217
217
|
if (t) {
|
|
218
|
-
let e =
|
|
218
|
+
let e = I(t);
|
|
219
219
|
if (e) return e;
|
|
220
220
|
}
|
|
221
221
|
let n = e.arweaveUrl?.trim();
|
|
222
222
|
if (n && !T(n)) return n;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Qe(e) {
|
|
225
225
|
let t = e.trim();
|
|
226
226
|
if (!t || T(t)) return;
|
|
227
227
|
let n = k(t);
|
|
228
228
|
switch (n.kind) {
|
|
229
229
|
case "url": return { mediaUrl: n.href };
|
|
230
230
|
case "arweaveTxId": {
|
|
231
|
-
let e =
|
|
231
|
+
let e = I(n.txId);
|
|
232
232
|
return {
|
|
233
233
|
storageTransactionId: n.txId,
|
|
234
234
|
...e ? { mediaUrl: e } : {}
|
|
@@ -236,7 +236,7 @@ function Ye(e) {
|
|
|
236
236
|
}
|
|
237
237
|
case "seedUid": return { seedUid: n.uid };
|
|
238
238
|
default: {
|
|
239
|
-
let e =
|
|
239
|
+
let e = I(t);
|
|
240
240
|
return e ? {
|
|
241
241
|
storageTransactionId: t,
|
|
242
242
|
mediaUrl: e
|
|
@@ -244,8 +244,8 @@ function Ye(e) {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
let t =
|
|
247
|
+
function $e(e) {
|
|
248
|
+
let t = F(e, "storageTransactionId", "storage_transaction_id"), n = F(e, "arweaveUrl", "arweave_url"), r = F(e, "seedUid", "SeedUid", "seed_uid"), i = F(e, "link", "Link"), a = Ze({
|
|
249
249
|
storageTransactionId: t,
|
|
250
250
|
arweaveUrl: n
|
|
251
251
|
}) ?? (i && !T(i) ? i : void 0);
|
|
@@ -256,34 +256,34 @@ function Xe(e) {
|
|
|
256
256
|
...a ? { mediaUrl: a } : {}
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function L(e) {
|
|
260
260
|
if (e != null) {
|
|
261
|
-
if (typeof e == "string") return
|
|
261
|
+
if (typeof e == "string") return Qe(e);
|
|
262
262
|
if (Array.isArray(e)) for (let t of e) {
|
|
263
|
-
let e =
|
|
263
|
+
let e = L(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 $e(e);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function et(e, t = N) {
|
|
270
270
|
for (let n of t) {
|
|
271
271
|
if (!(n in e)) continue;
|
|
272
|
-
let t =
|
|
272
|
+
let t = L(e[n]);
|
|
273
273
|
if (t) return t;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
//#endregion
|
|
277
277
|
//#region src/ArweaveClient/transactionTagsByIds.ts
|
|
278
|
-
var
|
|
279
|
-
async function
|
|
278
|
+
var tt = 100, R = "\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 nt(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 ?? u.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 {
|
|
286
|
-
let e = await i.request(
|
|
286
|
+
let e = await i.request(R, {
|
|
287
287
|
ids: o,
|
|
288
288
|
first: o.length
|
|
289
289
|
});
|
|
@@ -302,15 +302,15 @@ async function $e(e, t) {
|
|
|
302
302
|
}
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/ArweaveClient/uploadApiVerification.ts
|
|
305
|
-
function
|
|
305
|
+
function z(e) {
|
|
306
306
|
return e.trim().replace(/\/+$/, "");
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
return `${
|
|
308
|
+
function B(e, t) {
|
|
309
|
+
return `${z(e)}/api/upload/arweave/data/${encodeURIComponent(t)}`;
|
|
310
310
|
}
|
|
311
|
-
var
|
|
312
|
-
async function
|
|
313
|
-
let r =
|
|
311
|
+
var rt = 45e3;
|
|
312
|
+
async function it(e, t, n) {
|
|
313
|
+
let r = B(e, t), i = n?.timeoutMs ?? rt, 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,16 +335,16 @@ async function tt(e, t, n) {
|
|
|
335
335
|
}
|
|
336
336
|
//#endregion
|
|
337
337
|
//#region src/ArweaveClient/arweaveL1UploadApi.ts
|
|
338
|
-
var
|
|
339
|
-
function
|
|
340
|
-
return `${
|
|
338
|
+
var at = "\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
|
+
function V(e, t) {
|
|
340
|
+
return `${z(e)}/api/upload/arweave/status/${encodeURIComponent(t)}`;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function ot(e) {
|
|
343
343
|
let t = e.l1;
|
|
344
344
|
return t ? t.meetsMinConfirmations === !0 || t.confirmed === !0 : !1;
|
|
345
345
|
}
|
|
346
|
-
async function
|
|
347
|
-
let n =
|
|
346
|
+
async function st(e, t) {
|
|
347
|
+
let n = V(e, t);
|
|
348
348
|
try {
|
|
349
349
|
let e = await fetch(n);
|
|
350
350
|
if (!e.ok) return null;
|
|
@@ -354,7 +354,7 @@ async function it(e, t) {
|
|
|
354
354
|
return null;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
async function
|
|
357
|
+
async function H(e, t, n) {
|
|
358
358
|
let r = e.trim();
|
|
359
359
|
if (!r) return null;
|
|
360
360
|
try {
|
|
@@ -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: at,
|
|
366
366
|
variables: { id: t }
|
|
367
367
|
}),
|
|
368
368
|
signal: n?.signal
|
|
@@ -386,26 +386,26 @@ async function U(e, t, n) {
|
|
|
386
386
|
return null;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
async function
|
|
390
|
-
let
|
|
391
|
-
if (
|
|
392
|
-
let e = new URL(
|
|
393
|
-
|
|
389
|
+
async function ct(e, n, r) {
|
|
390
|
+
let i = p(), a = e?.trim(), o = "https", s = null;
|
|
391
|
+
if (a) try {
|
|
392
|
+
let e = new URL(a);
|
|
393
|
+
o = e.protocol === "http:" ? "http" : "https", s = e.hostname || null;
|
|
394
394
|
} catch {
|
|
395
|
-
|
|
395
|
+
s = null;
|
|
396
396
|
}
|
|
397
|
-
let
|
|
398
|
-
for (let e of
|
|
399
|
-
let
|
|
400
|
-
if (!await
|
|
401
|
-
let
|
|
402
|
-
if (
|
|
397
|
+
let c = s && s.length > 0 ? d(s) : [...i], l = r?.signal;
|
|
398
|
+
for (let e of c) {
|
|
399
|
+
let i = `${o}://${e}`;
|
|
400
|
+
if (!await t(i, { signal: l ?? void 0 })) continue;
|
|
401
|
+
let a = await H(`${o}://${e}/graphql`, n, r);
|
|
402
|
+
if (a !== null) return a;
|
|
403
403
|
}
|
|
404
404
|
return null;
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
407
|
//#region src/gateway/seedGatewayConfig.ts
|
|
408
|
-
function
|
|
408
|
+
function lt(e) {
|
|
409
409
|
let t = e.gateway ?? {};
|
|
410
410
|
return {
|
|
411
411
|
transport: t.transport,
|
|
@@ -423,7 +423,7 @@ function ot(e) {
|
|
|
423
423
|
}
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function ut(e) {
|
|
427
427
|
return {
|
|
428
428
|
transport: e.gatewayTransport,
|
|
429
429
|
arweaveDomain: e.arweaveDomain,
|
|
@@ -438,7 +438,7 @@ function st(e) {
|
|
|
438
438
|
}
|
|
439
439
|
//#endregion
|
|
440
440
|
//#region src/htmlLinks.ts
|
|
441
|
-
var
|
|
441
|
+
var U = "[A-Za-z0-9_-]{43}", W = RegExp(`^ar://(${U})([/?#].*)?$`), dt = RegExp(`/raw/(${U})(/.*)?$`), G = RegExp(`^/(${U})(/.*)?$`), 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 ft(e, t) {
|
|
474
474
|
let n = e.toLowerCase();
|
|
475
|
-
if (
|
|
475
|
+
if (C(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), ...S]) 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 = W.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 = dt.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 ?? m(), c = J(i, s), l = c && G.exec(c.path) || (ft(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 pt(e, t) {
|
|
511
|
+
let n = t?.baseUrls ?? m(), r = Y(e, { baseUrls: n });
|
|
512
512
|
if (!r) return;
|
|
513
513
|
let i = -1;
|
|
514
514
|
try {
|
|
@@ -517,11 +517,11 @@ function dt(e, t) {
|
|
|
517
517
|
let a = n[i + 1];
|
|
518
518
|
return a ? X(r, a) : void 0;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function mt(e) {
|
|
521
521
|
return e.replace(/&/g, "&").replace(/"/g, """);
|
|
522
522
|
}
|
|
523
523
|
function Z(e, t) {
|
|
524
|
-
let n =
|
|
524
|
+
let n = Ve(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}="${mt(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 ht = /* @__PURE__ */ new Set([
|
|
547
547
|
"src",
|
|
548
548
|
"href",
|
|
549
549
|
"poster"
|
|
550
550
|
]);
|
|
551
|
-
function
|
|
551
|
+
function gt(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 mt(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 gt(t, n);
|
|
562
|
+
if (!ht.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), ...S]) if (e && n.includes(e)) return !0;
|
|
571
571
|
return !1;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
let n = t?.baseUrls ??
|
|
573
|
+
function _t(e, t) {
|
|
574
|
+
let n = t?.baseUrls ?? m(), 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 ht(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 vt(e, { to: t = "gateway", publicBaseUrl: n, baseUrls: r }) {
|
|
585
|
+
let i = [n, ...r ?? m()];
|
|
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 gt(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 { Pe as ARWEAVE_GRAPHQL_TIMEOUT_MS, e as ARWEAVE_HOST_ENV_KEYS, u as ArweaveClient, u as BaseArweaveClient, Ce as DEFAULT_ARWEAVE_GATEWAYS, Fe as DEFAULT_ARWEAVE_GRAPHQL_URL, h as DEFAULT_ARWEAVE_HOST, je as DEFAULT_ARWEAVE_RAW_READ_TIMEOUT_MS, x as DEFAULT_GATEWAY_SIDECAR_HOST, Oe as DEFAULT_GATEWAY_SIDECAR_PORT, ve as DEFAULT_SEED_FEED_HYPER_KEY, _ as DEFAULT_SEED_GATEWAY_HYPER_KEY, b as DEFAULT_TRANSACTION_STATUS_TIMEOUT_MS, De as DEFAULT_TRANSACTION_STATUS_TOTAL_TIMEOUT_MS, Me as DefaultArweaveClient, fe as DuplicateArweaveModuleError, Ne as GET_ARWEAVE_TRANSACTIONS, R as GET_TRANSACTIONS_TAGS_BY_IDS, be as GET_TRANSACTION_TAGS, S as KNOWN_ARWEAVE_GATEWAYS, _e as MIN_TRANSACTION_STATUS_ATTEMPT_MS, N as SEED_RSS_IMAGE_RELATION_FIELD_KEYS, tt as TRANSACTION_TAGS_BATCH_SIZE, s as assertSingleArweaveModule, ie as beginGatewayHostHalfOpenProbe, X as buildArweaveTransactionLink, oe as cancelGatewayHostHalfOpenProbe, k as classifyMediaRef, o as configureGatewayCircuitBreaker, Ie as ensureArweaveReadGatewayForFallback, a as ensureReadGatewaySelected, xe as fetchArweaveRawBytesAcrossGateways, we as fetchArweaveRawFromBaseUrl, v as fetchArweaveRawTextAcrossGateways, g as fetchTransactionStatusAcrossGateways, m as getArweaveReadBaseUrls, d as getArweaveReadGatewayHostsForPrimary, st as getArweaveUploadStatus, Ye as getArweaveUrlForTransaction, p as getDefaultArweaveReadGatewayHostsOrdered, A as getFeedItemStringField, l as getGatewayHostCircuitState, i as getLastHealthyReadGatewayHost, ge as getPreferredArweaveReadBaseUrls, j as getPublicArweaveBaseUrl, M as getPublicArweaveRawUrl, Re as getReadGatewayHostsForConfig, Ee as getResolvedArweaveReadBaseUrls, w as getResolvedSeedGatewayEndpoints, y as getResponseMediaType, nt as getTransactionTagsByIds, B as getUploadApiArweaveDataUrl, V as getUploadApiArweaveStatusUrl, it as getUploadPipelineTransactionStatus, ee as hasArweaveContentReadTransform, ae as invalidateReadGatewayCache, le as invalidateSidecarProbeCache, ot as isArweaveL1AnchoringComplete, T as isEasAttestationExplorerUrl, me as isEncryptedArweaveContent, ne as isGatewayHostCircuitOpen, C as isKnownArweaveGatewayHostname, Ae as isReadGatewayKnownHealthy, ce as listOpenGatewayCircuitHosts, Q as mapUrlAttribute, Se as mergePrimaryHostWithDefaults, pt as nextArweaveGatewayUrl, Je as normalizeFeedItemFields, Be as normalizeGatewayHostKey, E as normalizeRelationPropertyValue, z as normalizeUploadApiBaseUrl, Y as parseArweaveTransactionLink, t as probeGateway, vt as publishedArweaveLinksInHtml, H as queryArweaveGatewayTransaction, ct as queryArweaveGatewayTransactionWithFallback, pe as readArweaveContentResponse, Te as readArweaveRawAcrossGateways, n as recordGatewayHostFailure, de as recordGatewayHostSuccess, _t as rehostArweaveLinksInHtml, te as resetArweaveClientOwnerForTests, ke as resetArweaveReadGatewayForTests, c as resetGatewayCircuitBreakerForTests, f as resolveArweaveHostFromEnv, r as resolveProxyBaseUrl, Le as resolveSeedGatewayEndpoints, D as resolveSeedIdsFromRefString, et as resolveSeedRssImageRelationFromItem, L as resolveSeedRssImageRelationRef, ue as resolveSidecarOrigin, Z as rewriteHtmlAttributes, ut as seedGatewayConfigFromClientContext, lt as seedGatewayConfigFromSeedConfig, re as selectFirstHealthyReadGateway, he as setArweaveContentReadTransform, ze as setPreferredArweaveReadBaseUrls, ye as setResolvedSeedGatewayEndpoints, se as transformArweaveContent };
|
|
597
597
|
|
|
598
598
|
//# sourceMappingURL=index.js.map
|