@seedprotocol/arweave 0.8.1 → 0.8.2-next.1774.gc97b5ba
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-BhqiFB9a.js → ArweaveClient-BsqZ1E90.js} +237 -231
- package/dist/ArweaveClient-BsqZ1E90.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 +4 -2
- package/dist/gateway/readBaseUrls.d.ts.map +1 -1
- package/dist/index.js +85 -85
- 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
|
|
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 u, Q as oe, R as se, S as ce, T as le, U as ue, V as de, W as fe, X as pe, Y as me, Z as he, _ as d, a as ge, at as _e, b as ve, c as ye, ct as f, d as be, dt as p, et as xe, f as Se, g as Ce, h as we, i as Te, it as Ee, j as De, k as m, l as Oe, lt as h, m as g, n as ke, nt as Ae, o as _, ot as v, p as y, q as b, r as x, rt as S, s as C, st as w, t as je, tt as Me, u as Ne, ut as Pe, v as Fe, w as Ie, x as Le, y as Re, z as ze } from "./ArweaveClient-BsqZ1E90.js";
|
|
2
|
+
import { parseFragment as Be } from "parse5";
|
|
3
3
|
//#region src/easAttestationUrl.ts
|
|
4
|
-
var
|
|
4
|
+
var Ve = /(^|\.)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 Ve.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 He(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 Ue = /^[a-zA-Z0-9_-]{10,21}$/;
|
|
38
38
|
function D(e) {
|
|
39
|
-
let t =
|
|
39
|
+
let t = He(e);
|
|
40
40
|
return t.localId || t.uid ? {
|
|
41
41
|
seedLocalId: t.localId,
|
|
42
42
|
seedUid: t.uid
|
|
43
|
-
} :
|
|
43
|
+
} : Ue.test(e) && !e.startsWith("0x") ? { seedLocalId: e } : {};
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/mediaRef.ts
|
|
47
|
-
var
|
|
48
|
-
function
|
|
47
|
+
var We = /^[a-zA-Z0-9_-]{43}$/;
|
|
48
|
+
function Ge(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 Ke(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 = Ge(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 = Ke(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
|
+
} : We.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 qe(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
|
|
154
|
+
function Je(e) {
|
|
155
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 Ye(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 = d()?.publicArweaveBaseUrl;
|
|
169
169
|
if (e) return e;
|
|
170
170
|
let t = c.getBaseUrl();
|
|
171
|
-
return
|
|
171
|
+
return Ye(t) ? `https://${p() || "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 Xe(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 Ze(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 Qe(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 = Xe({
|
|
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 Ze(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 Qe(e);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function $e(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 et = 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 tt(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
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 {
|
|
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 nt = 45e3;
|
|
312
|
+
async function rt(e, t, n) {
|
|
313
|
+
let r = B(e, t), i = n?.timeoutMs ?? nt, 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 it = "\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 at(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 ot(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: it,
|
|
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 r =
|
|
389
|
+
async function st(e, t, n) {
|
|
390
|
+
let r = f(), 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 ? w(o) : [...r], c = n?.signal;
|
|
398
398
|
for (let e of s) {
|
|
399
399
|
let r = `${a}://${e}`;
|
|
400
|
-
if (!await
|
|
401
|
-
let i = await
|
|
400
|
+
if (!await m(r, { signal: c ?? void 0 })) continue;
|
|
401
|
+
let i = await H(`${a}://${e}/graphql`, t, n);
|
|
402
402
|
if (i !== null) return i;
|
|
403
403
|
}
|
|
404
404
|
return null;
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
407
|
//#region src/gateway/seedGatewayConfig.ts
|
|
408
|
-
function
|
|
408
|
+
function ct(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 lt(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}", ut = RegExp(`^ar://(${U})([/?#].*)?$`), W = 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 dt(e, t) {
|
|
474
474
|
let n = e.toLowerCase();
|
|
475
|
-
if (
|
|
475
|
+
if (h(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), ...v]) 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 = ut.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 = W.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 ?? g(), c = J(i, s), l = c && G.exec(c.path) || (
|
|
500
|
+
let s = t?.baseUrls ?? g(), c = J(i, s), l = c && G.exec(c.path) || (dt(i.host, s) ? G.exec(i.pathname) : null);
|
|
501
501
|
if (l) return {
|
|
502
502
|
transactionId: l[1],
|
|
503
503
|
form: "bare",
|
|
@@ -507,7 +507,7 @@ 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
|
|
510
|
+
function ft(e, t) {
|
|
511
511
|
let n = t?.baseUrls ?? g(), r = Y(e, { baseUrls: n });
|
|
512
512
|
if (!r) return;
|
|
513
513
|
let i = -1;
|
|
@@ -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 pt(e) {
|
|
521
521
|
return e.replace(/&/g, "&").replace(/"/g, """);
|
|
522
522
|
}
|
|
523
523
|
function Z(e, t) {
|
|
524
|
-
let n =
|
|
524
|
+
let n = Be(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}="${pt(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 mt = /* @__PURE__ */ new Set([
|
|
547
547
|
"src",
|
|
548
548
|
"href",
|
|
549
549
|
"poster"
|
|
550
550
|
]);
|
|
551
|
-
function
|
|
551
|
+
function ht(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 ht(t, n);
|
|
562
|
+
if (!mt.has(e)) return;
|
|
563
563
|
let r = n(t.trim());
|
|
564
564
|
return r === void 0 || r === t ? void 0 : r;
|
|
565
565
|
}
|
|
@@ -567,10 +567,10 @@ 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), ...v]) if (e && n.includes(e)) return !0;
|
|
571
571
|
return !1;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function gt(e, t) {
|
|
574
574
|
let n = t?.baseUrls ?? g(), r = n[0];
|
|
575
575
|
if (!r || !e || !$(e, n)) return e;
|
|
576
576
|
let i = (e) => {
|
|
@@ -581,7 +581,7 @@ function ht(e, t) {
|
|
|
581
581
|
};
|
|
582
582
|
return Z(e, (e, t, n) => Q(t, n, i));
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function _t(e, { to: t = "gateway", publicBaseUrl: n, baseUrls: r }) {
|
|
585
585
|
let i = [n, ...r ?? g()];
|
|
586
586
|
if (!e || !$(e, i)) return e;
|
|
587
587
|
let a = (e) => {
|
|
@@ -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 { je as ARWEAVE_GRAPHQL_TIMEOUT_MS,
|
|
596
|
+
export { je as ARWEAVE_GRAPHQL_TIMEOUT_MS, oe as ARWEAVE_HOST_ENV_KEYS, c as ArweaveClient, c as BaseArweaveClient, e as DEFAULT_ARWEAVE_GATEWAYS, xe as DEFAULT_ARWEAVE_GRAPHQL_URL, Me as DEFAULT_ARWEAVE_HOST, Oe as DEFAULT_ARWEAVE_RAW_READ_TIMEOUT_MS, Ae as DEFAULT_GATEWAY_SIDECAR_HOST, S as DEFAULT_GATEWAY_SIDECAR_PORT, Ee as DEFAULT_SEED_FEED_HYPER_KEY, _e as DEFAULT_SEED_GATEWAY_HYPER_KEY, x as DEFAULT_TRANSACTION_STATUS_TIMEOUT_MS, Te as DEFAULT_TRANSACTION_STATUS_TOTAL_TIMEOUT_MS, ke as DefaultArweaveClient, ue as DuplicateArweaveModuleError, C as GET_ARWEAVE_TRANSACTIONS, R as GET_TRANSACTIONS_TAGS_BY_IDS, ye as GET_TRANSACTION_TAGS, v as KNOWN_ARWEAVE_GATEWAYS, ge as MIN_TRANSACTION_STATUS_ATTEMPT_MS, N as SEED_RSS_IMAGE_RELATION_FIELD_KEYS, et as TRANSACTION_TAGS_BATCH_SIZE, fe as assertSingleArweaveModule, re as beginGatewayHostHalfOpenProbe, X as buildArweaveTransactionLink, ie as cancelGatewayHostHalfOpenProbe, k as classifyMediaRef, u as configureGatewayCircuitBreaker, Ne as ensureArweaveReadGatewayForFallback, le as ensureReadGatewaySelected, be as fetchArweaveRawBytesAcrossGateways, Se as fetchArweaveRawFromBaseUrl, y as fetchArweaveRawTextAcrossGateways, _ as fetchTransactionStatusAcrossGateways, g as getArweaveReadBaseUrls, w as getArweaveReadGatewayHostsForPrimary, ot as getArweaveUploadStatus, Je as getArweaveUrlForTransaction, f as getDefaultArweaveReadGatewayHostsOrdered, A as getFeedItemStringField, o as getGatewayHostCircuitState, a as getLastHealthyReadGatewayHost, Ce as getPreferredArweaveReadBaseUrls, j as getPublicArweaveBaseUrl, M as getPublicArweaveRawUrl, ve as getReadGatewayHostsForConfig, we as getResolvedArweaveReadBaseUrls, d as getResolvedSeedGatewayEndpoints, te as getResponseMediaType, tt as getTransactionTagsByIds, B as getUploadApiArweaveDataUrl, V as getUploadApiArweaveStatusUrl, rt as getUploadPipelineTransactionStatus, b as hasArweaveContentReadTransform, i as invalidateReadGatewayCache, Le as invalidateSidecarProbeCache, at as isArweaveL1AnchoringComplete, T as isEasAttestationExplorerUrl, ee as isEncryptedArweaveContent, l as isGatewayHostCircuitOpen, h as isKnownArweaveGatewayHostname, ae as isReadGatewayKnownHealthy, ne as listOpenGatewayCircuitHosts, Q as mapUrlAttribute, Pe as mergePrimaryHostWithDefaults, ft as nextArweaveGatewayUrl, qe as normalizeFeedItemFields, se as normalizeGatewayHostKey, E as normalizeRelationPropertyValue, z as normalizeUploadApiBaseUrl, Y as parseArweaveTransactionLink, m as probeGateway, _t as publishedArweaveLinksInHtml, H as queryArweaveGatewayTransaction, st as queryArweaveGatewayTransactionWithFallback, me as readArweaveContentResponse, ze as recordGatewayHostFailure, n as recordGatewayHostSuccess, gt as rehostArweaveLinksInHtml, s as resetArweaveClientOwnerForTests, t as resetArweaveReadGatewayForTests, de as resetGatewayCircuitBreakerForTests, p as resolveArweaveHostFromEnv, ce as resolveProxyBaseUrl, r as resolveSeedGatewayEndpoints, D as resolveSeedIdsFromRefString, $e as resolveSeedRssImageRelationFromItem, L as resolveSeedRssImageRelationRef, Ie as resolveSidecarOrigin, Z as rewriteHtmlAttributes, lt as seedGatewayConfigFromClientContext, ct as seedGatewayConfigFromSeedConfig, De as selectFirstHealthyReadGateway, pe as setArweaveContentReadTransform, Fe as setPreferredArweaveReadBaseUrls, Re as setResolvedSeedGatewayEndpoints, he as transformArweaveContent };
|
|
597
597
|
|
|
598
598
|
//# sourceMappingURL=index.js.map
|