@seedprotocol/feed 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/consume/parseRss.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +187 -166
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -184,7 +184,24 @@ function Fe(e) {
|
|
|
184
184
|
return { ...e };
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
var Ie =
|
|
187
|
+
var Ie = ["creatorList", "authorList"];
|
|
188
|
+
function Le(e) {
|
|
189
|
+
let t = e && typeof e == "object" ? e.name : e, n = Array.isArray(t) ? t[0] : t;
|
|
190
|
+
return typeof n == "string" && n.trim() ? n.normalize("NFC").replace(/\s+/g, " ").trim() : void 0;
|
|
191
|
+
}
|
|
192
|
+
function Re(e) {
|
|
193
|
+
let t = /* @__PURE__ */ new Map();
|
|
194
|
+
for (let n of e) {
|
|
195
|
+
let e = Le(n), r = e?.toUpperCase().toLowerCase();
|
|
196
|
+
e && r && !t.has(r) && t.set(r, e);
|
|
197
|
+
}
|
|
198
|
+
return [...t.values()];
|
|
199
|
+
}
|
|
200
|
+
function ze(e) {
|
|
201
|
+
for (let t of Ie) Array.isArray(e[t]) && (e[t] = Re(e[t]));
|
|
202
|
+
return e;
|
|
203
|
+
}
|
|
204
|
+
var Be = new ge({ customFields: { item: [
|
|
188
205
|
"featureImage",
|
|
189
206
|
"feature_image",
|
|
190
207
|
"content:encoded",
|
|
@@ -201,21 +218,21 @@ var Ie = new ge({ customFields: { item: [
|
|
|
201
218
|
{ keepArray: !0 }
|
|
202
219
|
]
|
|
203
220
|
] } });
|
|
204
|
-
async function
|
|
205
|
-
let t = await
|
|
221
|
+
async function Ve(e) {
|
|
222
|
+
let t = await Be.parseString(e);
|
|
206
223
|
return {
|
|
207
224
|
title: t.title,
|
|
208
225
|
link: t.link,
|
|
209
226
|
description: t.description,
|
|
210
|
-
items: (t.items ?? []).map(Fe)
|
|
227
|
+
items: (t.items ?? []).map((e) => ze(Fe(e)))
|
|
211
228
|
};
|
|
212
229
|
}
|
|
213
230
|
//#endregion
|
|
214
231
|
//#region src/rss/generateRssXml.ts
|
|
215
|
-
var j = "http://purl.org/dc/elements/1.1/", M = "http://purl.org/rss/1.0/modules/content/", N = "http://search.yahoo.com/mrss/",
|
|
232
|
+
var j = "http://purl.org/dc/elements/1.1/", M = "http://purl.org/rss/1.0/modules/content/", N = "http://search.yahoo.com/mrss/", He = { publication: {
|
|
216
233
|
prefix: "publication",
|
|
217
234
|
uri: "https://seedprotocol.io/ns/publication/1.0"
|
|
218
|
-
} },
|
|
235
|
+
} }, Ue = "https://seedprotocol.io/ns/relations", We = /* @__PURE__ */ new Set([
|
|
219
236
|
"xml",
|
|
220
237
|
"xmlns",
|
|
221
238
|
"dc",
|
|
@@ -223,15 +240,15 @@ var j = "http://purl.org/dc/elements/1.1/", M = "http://purl.org/rss/1.0/modules
|
|
|
223
240
|
"content",
|
|
224
241
|
"atom",
|
|
225
242
|
"fh"
|
|
226
|
-
]),
|
|
243
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
227
244
|
"Title",
|
|
228
245
|
"Link",
|
|
229
246
|
"Guid",
|
|
230
247
|
"PubDate",
|
|
231
248
|
"SeedUid"
|
|
232
249
|
]);
|
|
233
|
-
function
|
|
234
|
-
return
|
|
250
|
+
function Ke(e, t) {
|
|
251
|
+
return Ge.has(e) ? e.charAt(0).toLowerCase() + e.slice(1) in t : !1;
|
|
235
252
|
}
|
|
236
253
|
var P = [
|
|
237
254
|
"title",
|
|
@@ -265,13 +282,13 @@ function F(e) {
|
|
|
265
282
|
}
|
|
266
283
|
return String(e);
|
|
267
284
|
}
|
|
268
|
-
function
|
|
285
|
+
function qe(e) {
|
|
269
286
|
return /[<>&]|]]>/.test(e);
|
|
270
287
|
}
|
|
271
288
|
function I(e, t) {
|
|
272
289
|
let n = String(t);
|
|
273
290
|
if (n !== "") {
|
|
274
|
-
if (
|
|
291
|
+
if (qe(n)) {
|
|
275
292
|
if (n.includes("]]>")) {
|
|
276
293
|
let t = n.split("]]>");
|
|
277
294
|
for (let n = 0; n < t.length; n++) e.dat(t[n]), n < t.length - 1 && e.txt("]]>");
|
|
@@ -282,7 +299,7 @@ function I(e, t) {
|
|
|
282
299
|
function L(e) {
|
|
283
300
|
return typeof e == "object" && !!e && !Array.isArray(e) && !(e instanceof Date);
|
|
284
301
|
}
|
|
285
|
-
var
|
|
302
|
+
var Je = 4, Ye = /* @__PURE__ */ new Set([
|
|
286
303
|
...P,
|
|
287
304
|
"guid",
|
|
288
305
|
"source",
|
|
@@ -291,34 +308,34 @@ var We = 4, Ge = /* @__PURE__ */ new Set([
|
|
|
291
308
|
"content:encoded",
|
|
292
309
|
"items"
|
|
293
310
|
]);
|
|
294
|
-
function
|
|
311
|
+
function Xe(e) {
|
|
295
312
|
return e.endsWith("s") && e.length > 1 ? e.slice(0, -1) : e;
|
|
296
313
|
}
|
|
297
|
-
function
|
|
314
|
+
function Ze(e) {
|
|
298
315
|
return e.trim().replace(/[^A-Za-z0-9_.-]+/g, "_").replace(/^[^A-Za-z_]+/, "").replace(/^$/, "rel").toLowerCase();
|
|
299
316
|
}
|
|
300
|
-
function
|
|
301
|
-
if (!t.has(e) && !
|
|
317
|
+
function Qe(e, t) {
|
|
318
|
+
if (!t.has(e) && !We.has(e)) return t.add(e), e;
|
|
302
319
|
let n = 2;
|
|
303
320
|
for (;;) {
|
|
304
321
|
let r = `${e}${n}`;
|
|
305
|
-
if (!t.has(r) && !
|
|
322
|
+
if (!t.has(r) && !We.has(r)) return t.add(r), r;
|
|
306
323
|
n += 1;
|
|
307
324
|
}
|
|
308
325
|
}
|
|
309
|
-
function
|
|
326
|
+
function $e(e) {
|
|
310
327
|
return Array.isArray(e) && e.length > 0 && e.every((e) => L(e));
|
|
311
328
|
}
|
|
312
|
-
function
|
|
313
|
-
let t = { ...
|
|
329
|
+
function et(e) {
|
|
330
|
+
let t = { ...He }, n = new Set(Object.values(t).map((e) => e.prefix)), r = /* @__PURE__ */ new Set();
|
|
314
331
|
for (let t of e) for (let [e, n] of Object.entries(t)) {
|
|
315
|
-
let t = e === "author" && L(n) || e === "authors" &&
|
|
316
|
-
e.startsWith("_") || (!
|
|
332
|
+
let t = e === "author" && L(n) || e === "authors" && $e(n);
|
|
333
|
+
e.startsWith("_") || (!Ye.has(e) || t) && (L(n) || $e(n)) && r.add(Xe(e));
|
|
317
334
|
}
|
|
318
335
|
let i = [...r].sort();
|
|
319
336
|
for (let e of i) t[e] || (t[e] = {
|
|
320
|
-
prefix:
|
|
321
|
-
uri: `${
|
|
337
|
+
prefix: Qe(Ze(e), n),
|
|
338
|
+
uri: `${Ue}/${e}/1.0`
|
|
322
339
|
});
|
|
323
340
|
return t;
|
|
324
341
|
}
|
|
@@ -329,26 +346,26 @@ function R(e, t) {
|
|
|
329
346
|
if (n in t) return t[n];
|
|
330
347
|
}
|
|
331
348
|
}
|
|
332
|
-
function
|
|
349
|
+
function z(e, t) {
|
|
333
350
|
return t ? `${t.prefix}:${e}` : e;
|
|
334
351
|
}
|
|
335
|
-
function
|
|
352
|
+
function B(e, t, n, r, i = 0, a) {
|
|
336
353
|
let o = e.ele(n);
|
|
337
354
|
for (let [e, n] of Object.entries(t)) {
|
|
338
355
|
if (n == null || e.startsWith("_") || e === "items") continue;
|
|
339
|
-
let t =
|
|
340
|
-
if (i >=
|
|
356
|
+
let t = z(e, a);
|
|
357
|
+
if (i >= Je) I(o.ele(t), typeof n == "object" ? JSON.stringify(n) : String(n));
|
|
341
358
|
else if (Array.isArray(n)) {
|
|
342
|
-
let t =
|
|
343
|
-
for (let e of n) e != null && (L(e) ?
|
|
344
|
-
} else L(n) ?
|
|
359
|
+
let t = z(e.endsWith("s") && e.length > 1 ? e.slice(0, -1) : e, a);
|
|
360
|
+
for (let e of n) e != null && (L(e) ? B(o, e, t, !1, i + 1, a) : I(o.ele(t), String(e)));
|
|
361
|
+
} else L(n) ? B(o, n, t, !1, i + 1, a) : I(o.ele(t), String(n));
|
|
345
362
|
}
|
|
346
363
|
if (r) {
|
|
347
364
|
let n = t.name ?? t.seedUid;
|
|
348
365
|
n && e.ele(j, "creator").txt(String(n));
|
|
349
366
|
}
|
|
350
367
|
}
|
|
351
|
-
function
|
|
368
|
+
function tt(e, t, n, r, i) {
|
|
352
369
|
if (!(n == null || t.startsWith("_")) && t !== "items") {
|
|
353
370
|
if (t === "guid") {
|
|
354
371
|
let t = n, r = t?.value ?? String(n);
|
|
@@ -410,10 +427,10 @@ function Qe(e, t, n, r, i) {
|
|
|
410
427
|
let r = t.slice(6);
|
|
411
428
|
I(e.ele(N, r), n);
|
|
412
429
|
} else if (n instanceof Date) e.ele(t).txt(F(n));
|
|
413
|
-
else if (t === "author" && L(n))
|
|
430
|
+
else if (t === "author" && L(n)) B(e, n, "author", !0, 0, R(t, i));
|
|
414
431
|
else if (t === "authors" && Array.isArray(n)) {
|
|
415
432
|
let r = R(t, i);
|
|
416
|
-
for (let t of n) if (t && L(t))
|
|
433
|
+
for (let t of n) if (t && L(t)) B(e, t, "author", !0, 0, r);
|
|
417
434
|
else {
|
|
418
435
|
let n = typeof t == "string" ? t : t && typeof t == "object" && "name" in t ? `${t.email ?? ""} (${t.name ?? ""})`.trim() || t.name : String(t);
|
|
419
436
|
n && e.ele("author").txt(n);
|
|
@@ -427,27 +444,27 @@ function Qe(e, t, n, r, i) {
|
|
|
427
444
|
}
|
|
428
445
|
else if (Array.isArray(n) && n.length > 0 && n.every((e) => L(e))) {
|
|
429
446
|
let r = t.endsWith("s") ? t.slice(0, -1) : t, a = R(t, i);
|
|
430
|
-
for (let t of n) t &&
|
|
447
|
+
for (let t of n) t && B(e, t, r, !1, 0, a);
|
|
431
448
|
} else if (Array.isArray(n) && n.every((e) => typeof e == "string")) {
|
|
432
449
|
let r = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
433
450
|
for (let t of n) t && I(e.ele(r), t);
|
|
434
|
-
} else L(n) ?
|
|
451
|
+
} else L(n) ? B(e, n, t, !1, 0, R(t, i)) : I(e.ele(t), String(n));
|
|
435
452
|
}
|
|
436
453
|
}
|
|
437
454
|
}
|
|
438
|
-
var
|
|
439
|
-
function
|
|
455
|
+
var nt = "http://www.w3.org/2005/Atom", rt = "http://purl.org/syndication/history/1.0";
|
|
456
|
+
function it(e) {
|
|
440
457
|
let t = ye({
|
|
441
458
|
version: "1.0",
|
|
442
459
|
encoding: "UTF-8"
|
|
443
|
-
}), n =
|
|
460
|
+
}), n = et(e.items), r = {
|
|
444
461
|
"xmlns:dc": j,
|
|
445
462
|
"xmlns:content": M,
|
|
446
463
|
"xmlns:media": N,
|
|
447
|
-
"xmlns:atom":
|
|
464
|
+
"xmlns:atom": nt,
|
|
448
465
|
...Object.values(n).reduce((e, t) => (e[`xmlns:${t.prefix}`] = t.uri, e), {})
|
|
449
466
|
};
|
|
450
|
-
e.isArchive && (r["xmlns:fh"] =
|
|
467
|
+
e.isArchive && (r["xmlns:fh"] = rt);
|
|
451
468
|
let i = t.ele("rss", {
|
|
452
469
|
version: "2.0",
|
|
453
470
|
...r
|
|
@@ -461,26 +478,26 @@ function tt(e) {
|
|
|
461
478
|
rel: t.rel,
|
|
462
479
|
href: t.href
|
|
463
480
|
};
|
|
464
|
-
t.type && (e.type = t.type), i.ele(
|
|
481
|
+
t.type && (e.type = t.type), i.ele(nt, "link", e);
|
|
465
482
|
}
|
|
466
|
-
e.isArchive && i.ele(
|
|
483
|
+
e.isArchive && i.ele(rt, "archive");
|
|
467
484
|
let a = new Set(P);
|
|
468
485
|
for (let t of e.items) {
|
|
469
486
|
let e = i.ele("item"), r = /* @__PURE__ */ new Set();
|
|
470
|
-
for (let i of P) i in t && (
|
|
471
|
-
let o = Object.keys(t).filter((e) => !r.has(e) && !a.has(e) && !e.startsWith("_") && !
|
|
472
|
-
for (let r of o)
|
|
487
|
+
for (let i of P) i in t && (tt(e, i, t[i], t, n), r.add(i));
|
|
488
|
+
let o = Object.keys(t).filter((e) => !r.has(e) && !a.has(e) && !e.startsWith("_") && !Ke(e, t)).sort();
|
|
489
|
+
for (let r of o) tt(e, r, t[r], t, n);
|
|
473
490
|
}
|
|
474
491
|
return t.end({ prettyPrint: !0 });
|
|
475
492
|
}
|
|
476
493
|
//#endregion
|
|
477
494
|
//#region src/cache/types.ts
|
|
478
|
-
function
|
|
495
|
+
function V(e, t, n) {
|
|
479
496
|
return n?.archive ? `${e}:${t}:archive-${n.archive.year}-${n.archive.month}` : n?.page != null && n.page > 1 ? `${e}:${t}:page-${n.page}` : `${e}:${t}`;
|
|
480
497
|
}
|
|
481
498
|
//#endregion
|
|
482
499
|
//#region src/cache/MemoryCache.ts
|
|
483
|
-
var
|
|
500
|
+
var at = class {
|
|
484
501
|
feedContentCache = /* @__PURE__ */ new Map();
|
|
485
502
|
imageMetadataCache = /* @__PURE__ */ new Map();
|
|
486
503
|
config;
|
|
@@ -488,11 +505,11 @@ var nt = class {
|
|
|
488
505
|
this.config = e;
|
|
489
506
|
}
|
|
490
507
|
getFeedContent(e, t, n) {
|
|
491
|
-
let r =
|
|
508
|
+
let r = V(e, t, n), i = this.feedContentCache.get(r);
|
|
492
509
|
return i ? Math.floor(Date.now() / 1e3) > i.expiresAt ? (this.feedContentCache.delete(r), null) : i : null;
|
|
493
510
|
}
|
|
494
511
|
putFeedContent(e, t, n, r) {
|
|
495
|
-
this.feedContentCache.set(
|
|
512
|
+
this.feedContentCache.set(V(e, t, r), n);
|
|
496
513
|
}
|
|
497
514
|
getImageMetadata(e) {
|
|
498
515
|
let t = this.imageMetadataCache.get(e);
|
|
@@ -506,7 +523,7 @@ var nt = class {
|
|
|
506
523
|
};
|
|
507
524
|
this.imageMetadataCache.set(e, r);
|
|
508
525
|
}
|
|
509
|
-
},
|
|
526
|
+
}, ot = class {
|
|
510
527
|
cacheDir;
|
|
511
528
|
config;
|
|
512
529
|
constructor(e) {
|
|
@@ -522,7 +539,7 @@ var nt = class {
|
|
|
522
539
|
}
|
|
523
540
|
}
|
|
524
541
|
getFeedContentPath(e, t, n) {
|
|
525
|
-
let r =
|
|
542
|
+
let r = V(e, t, n).replace(/:/g, "-");
|
|
526
543
|
return b(this.cacheDir, `${r}.json`);
|
|
527
544
|
}
|
|
528
545
|
getImageMetadataPath(e) {
|
|
@@ -591,12 +608,12 @@ var nt = class {
|
|
|
591
608
|
t.code !== "ENOENT" && console.error(`Error clearing image metadata cache for ${e}:`, t);
|
|
592
609
|
}
|
|
593
610
|
}
|
|
594
|
-
},
|
|
611
|
+
}, st = class {
|
|
595
612
|
memoryCache;
|
|
596
613
|
fileCache;
|
|
597
614
|
config;
|
|
598
615
|
constructor(e) {
|
|
599
|
-
this.config = e, this.memoryCache = new
|
|
616
|
+
this.config = e, this.memoryCache = new at(e), this.fileCache = new ot(e);
|
|
600
617
|
}
|
|
601
618
|
getConfig() {
|
|
602
619
|
return this.config;
|
|
@@ -644,7 +661,7 @@ var nt = class {
|
|
|
644
661
|
};
|
|
645
662
|
//#endregion
|
|
646
663
|
//#region src/cache/config.ts
|
|
647
|
-
function
|
|
664
|
+
function ct() {
|
|
648
665
|
let e = parseInt(process.env.CACHE_TTL || "3600", 10), t = process.env.CACHE_DIR || "./cache", n = process.env.CACHE_ENABLED === "false" || process.env.CACHE_ENABLED === "0" || process.env.CACHE_ENABLED === "no" || process.env.CACHE_ENABLED === "off", r = process.env.CACHE_ENABLED === "true" || process.env.CACHE_ENABLED === "1" || process.env.CACHE_ENABLED === "yes", i = process.env.NODE_ENV === "development", a;
|
|
649
666
|
a = n ? !1 : r ? !0 : !i, a || console.log(`⚠️ Cache is DISABLED (${n ? "CACHE_ENABLED=false" : i ? "NODE_ENV=development" : "CACHE_ENABLED=false"})`);
|
|
650
667
|
let o = {
|
|
@@ -664,23 +681,23 @@ function at() {
|
|
|
664
681
|
}
|
|
665
682
|
//#endregion
|
|
666
683
|
//#region src/utils/etag.ts
|
|
667
|
-
function
|
|
684
|
+
function H(e) {
|
|
668
685
|
return `"${be("md5").update(e).digest("hex").substring(0, 16)}"`;
|
|
669
686
|
}
|
|
670
|
-
function
|
|
687
|
+
function lt(e, t) {
|
|
671
688
|
let n = (e) => e.replace(/^W\//, "").replace(/^"|"$/g, "");
|
|
672
689
|
return n(e) === n(t);
|
|
673
690
|
}
|
|
674
|
-
function
|
|
691
|
+
function ut(e) {
|
|
675
692
|
return e ? e.split(",").map((e) => e.trim()).filter((e) => e.length > 0) : [];
|
|
676
693
|
}
|
|
677
|
-
function
|
|
678
|
-
let n =
|
|
679
|
-
return n.length === 0 ? !1 : n.includes("*") ? !0 : n.some((e) =>
|
|
694
|
+
function dt(e, t) {
|
|
695
|
+
let n = ut(e);
|
|
696
|
+
return n.length === 0 ? !1 : n.includes("*") ? !0 : n.some((e) => lt(e, t));
|
|
680
697
|
}
|
|
681
698
|
//#endregion
|
|
682
699
|
//#region src/services/arweaveImageService.ts
|
|
683
|
-
var
|
|
700
|
+
var ft = class {
|
|
684
701
|
config;
|
|
685
702
|
constructor(e) {
|
|
686
703
|
this.config = e;
|
|
@@ -803,31 +820,31 @@ var lt = class {
|
|
|
803
820
|
throw clearTimeout(r), e instanceof Error && e.name === "AbortError" ? Error(`Request timeout after ${this.config.timeout}ms`) : e;
|
|
804
821
|
}
|
|
805
822
|
}
|
|
806
|
-
},
|
|
823
|
+
}, U = Se("seedFeed");
|
|
807
824
|
//#endregion
|
|
808
825
|
//#region src/pickFeedItemRichText.ts
|
|
809
|
-
function
|
|
826
|
+
function W(e, t) {
|
|
810
827
|
for (let n of t) {
|
|
811
828
|
let t = e[n];
|
|
812
829
|
if (typeof t == "string" && t.trim() !== "") return t;
|
|
813
830
|
}
|
|
814
831
|
return "";
|
|
815
832
|
}
|
|
816
|
-
var
|
|
833
|
+
var pt = [
|
|
817
834
|
"summary",
|
|
818
835
|
"Summary",
|
|
819
836
|
"description",
|
|
820
837
|
"Description",
|
|
821
838
|
"text",
|
|
822
839
|
"Text"
|
|
823
|
-
],
|
|
840
|
+
], mt = [
|
|
824
841
|
"html",
|
|
825
842
|
"Html",
|
|
826
843
|
"body",
|
|
827
844
|
"Body",
|
|
828
845
|
"content",
|
|
829
846
|
"Content"
|
|
830
|
-
],
|
|
847
|
+
], ht = [
|
|
831
848
|
"summary",
|
|
832
849
|
"Summary",
|
|
833
850
|
"description",
|
|
@@ -835,13 +852,13 @@ var ut = [
|
|
|
835
852
|
"text",
|
|
836
853
|
"Text"
|
|
837
854
|
];
|
|
838
|
-
function
|
|
855
|
+
function gt(e, t) {
|
|
839
856
|
let n = c(e.model) - c(t.model);
|
|
840
857
|
if (n !== 0) return n;
|
|
841
858
|
let r = e.key.localeCompare(t.key);
|
|
842
859
|
return r === 0 ? e.index - t.index : r;
|
|
843
860
|
}
|
|
844
|
-
function
|
|
861
|
+
function _t(n) {
|
|
845
862
|
let r = e(n), i = t(n), o = null;
|
|
846
863
|
if (r) for (let [e, t] of Object.entries(r)) {
|
|
847
864
|
if (!a(t)) continue;
|
|
@@ -853,7 +870,7 @@ function mt(n) {
|
|
|
853
870
|
index: 0,
|
|
854
871
|
value: r
|
|
855
872
|
};
|
|
856
|
-
(!o ||
|
|
873
|
+
(!o || gt(i, o) < 0) && (o = i);
|
|
857
874
|
}
|
|
858
875
|
if (i) for (let [e, t] of Object.entries(i)) {
|
|
859
876
|
let r = n[e];
|
|
@@ -870,83 +887,83 @@ function mt(n) {
|
|
|
870
887
|
index: n,
|
|
871
888
|
value: s
|
|
872
889
|
};
|
|
873
|
-
(!o ||
|
|
890
|
+
(!o || gt(c, o) < 0) && (o = c);
|
|
874
891
|
}
|
|
875
892
|
}
|
|
876
893
|
return o?.value ?? "";
|
|
877
894
|
}
|
|
878
|
-
function
|
|
879
|
-
return
|
|
895
|
+
function vt(e) {
|
|
896
|
+
return W(e, pt);
|
|
880
897
|
}
|
|
881
|
-
function
|
|
882
|
-
let t =
|
|
898
|
+
function yt(e) {
|
|
899
|
+
let t = _t(e);
|
|
883
900
|
if (t !== "") return t;
|
|
884
|
-
let n =
|
|
885
|
-
return n === "" ?
|
|
901
|
+
let n = W(e, mt);
|
|
902
|
+
return n === "" ? W(e, ht) : n;
|
|
886
903
|
}
|
|
887
|
-
function
|
|
904
|
+
function G(e) {
|
|
888
905
|
return typeof e == "string" && e.includes("data:image/") && e.includes(";base64,");
|
|
889
906
|
}
|
|
890
|
-
function
|
|
907
|
+
function bt(n) {
|
|
891
908
|
let r = e(n);
|
|
892
909
|
if (r) {
|
|
893
|
-
for (let [e, t] of Object.entries(r)) if (a(t) &&
|
|
910
|
+
for (let [e, t] of Object.entries(r)) if (a(t) && G(n[e])) return !0;
|
|
894
911
|
}
|
|
895
912
|
let i = t(n);
|
|
896
913
|
if (i) for (let [e, t] of Object.entries(i)) {
|
|
897
914
|
let r = n[e];
|
|
898
915
|
if (!Array.isArray(r)) continue;
|
|
899
916
|
let i = Math.min(t.length, r.length);
|
|
900
|
-
for (let e = 0; e < i; e++) if (a(t[e]) &&
|
|
917
|
+
for (let e = 0; e < i; e++) if (a(t[e]) && G(r[e])) return !0;
|
|
901
918
|
}
|
|
902
919
|
return !1;
|
|
903
920
|
}
|
|
904
|
-
function
|
|
905
|
-
if (
|
|
906
|
-
for (let t of
|
|
907
|
-
for (let t of
|
|
921
|
+
function xt(e) {
|
|
922
|
+
if (bt(e)) return !0;
|
|
923
|
+
for (let t of mt) if (G(e[t])) return !0;
|
|
924
|
+
for (let t of pt) if (G(e[t])) return !0;
|
|
908
925
|
return !1;
|
|
909
926
|
}
|
|
910
|
-
function
|
|
911
|
-
return t === "include_items" ? [...e] : e.filter((e) => !
|
|
927
|
+
function St(e, t = "omit_items") {
|
|
928
|
+
return t === "include_items" ? [...e] : e.filter((e) => !xt(e));
|
|
912
929
|
}
|
|
913
930
|
//#endregion
|
|
914
931
|
//#region src/index.ts
|
|
915
|
-
function
|
|
932
|
+
function Ct(e) {
|
|
916
933
|
return pe(e)?.mediaUrl;
|
|
917
934
|
}
|
|
918
|
-
function
|
|
935
|
+
function K(e) {
|
|
919
936
|
if (typeof e == "number" && Number.isFinite(e) && e > 0) return e;
|
|
920
937
|
if (typeof e == "string") {
|
|
921
938
|
let t = Number(e);
|
|
922
939
|
if (Number.isFinite(t) && t > 0) return t;
|
|
923
940
|
}
|
|
924
941
|
}
|
|
925
|
-
function
|
|
942
|
+
function wt(e) {
|
|
926
943
|
if (Array.isArray(e)) {
|
|
927
944
|
for (let t of e) {
|
|
928
|
-
let e =
|
|
945
|
+
let e = wt(t);
|
|
929
946
|
if (e) return e;
|
|
930
947
|
}
|
|
931
948
|
return;
|
|
932
949
|
}
|
|
933
|
-
let t =
|
|
950
|
+
let t = Ct(e);
|
|
934
951
|
if (t) {
|
|
935
952
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
936
953
|
let n = e;
|
|
937
954
|
return {
|
|
938
955
|
url: t,
|
|
939
956
|
mimeType: typeof n.mimeType == "string" && n.mimeType || typeof n.type == "string" && n.type || typeof n.contentType == "string" && n.contentType || void 0,
|
|
940
|
-
width:
|
|
941
|
-
height:
|
|
942
|
-
size:
|
|
957
|
+
width: K(n.width),
|
|
958
|
+
height: K(n.height),
|
|
959
|
+
size: K(n.size ?? n.fileSize),
|
|
943
960
|
format: typeof n.format == "string" ? n.format : void 0
|
|
944
961
|
};
|
|
945
962
|
}
|
|
946
963
|
return { url: t };
|
|
947
964
|
}
|
|
948
965
|
}
|
|
949
|
-
function
|
|
966
|
+
function q(e) {
|
|
950
967
|
if (e._hasImage && e._imageMetadata && typeof e._imageMetadata == "object") {
|
|
951
968
|
let t = e._imageMetadata;
|
|
952
969
|
if (t.url) return {
|
|
@@ -970,11 +987,11 @@ function K(e) {
|
|
|
970
987
|
"thumbnailImage"
|
|
971
988
|
]) {
|
|
972
989
|
if (!(t in e)) continue;
|
|
973
|
-
let n =
|
|
990
|
+
let n = wt(e[t]);
|
|
974
991
|
if (n) return n;
|
|
975
992
|
}
|
|
976
993
|
}
|
|
977
|
-
function
|
|
994
|
+
function Tt(e, t, n, r, i, a) {
|
|
978
995
|
let o = n.mimeType || "image/jpeg";
|
|
979
996
|
e.enclosures = [{
|
|
980
997
|
url: n.url,
|
|
@@ -1010,15 +1027,15 @@ function St(e, t, n, r, i, a) {
|
|
|
1010
1027
|
"media:description": l
|
|
1011
1028
|
}], n.url && typeof t.content == "string" && t.content.trim() !== "" && !t.content.includes(n.url) && (e["content:encoded"] = `${`<img src="${n.url}" alt="${t.title || ""}"${n.width ? ` width="${n.width}"` : ""}${n.height ? ` height="${n.height}"` : ""} />`}\n${t.content}`);
|
|
1012
1029
|
}
|
|
1013
|
-
var
|
|
1014
|
-
function
|
|
1015
|
-
return
|
|
1030
|
+
var J = null;
|
|
1031
|
+
function Y() {
|
|
1032
|
+
return J ||= new st(ct()), J;
|
|
1016
1033
|
}
|
|
1017
|
-
function
|
|
1018
|
-
|
|
1034
|
+
function Et() {
|
|
1035
|
+
J = null;
|
|
1019
1036
|
}
|
|
1020
|
-
var
|
|
1021
|
-
async function
|
|
1037
|
+
var Dt = 8;
|
|
1038
|
+
async function Ot(e, t) {
|
|
1022
1039
|
let n = 0;
|
|
1023
1040
|
await Promise.all(Array.from({ length: Math.min(t, e.length) }, async () => {
|
|
1024
1041
|
for (; n < e.length;) {
|
|
@@ -1027,28 +1044,28 @@ async function Tt(e, t) {
|
|
|
1027
1044
|
}
|
|
1028
1045
|
}));
|
|
1029
1046
|
}
|
|
1030
|
-
async function
|
|
1047
|
+
async function kt(e, t, n) {
|
|
1031
1048
|
let r = await n.getImageMetadata(e);
|
|
1032
1049
|
if (r) return r;
|
|
1033
|
-
|
|
1050
|
+
U("detecting image for transaction %s", e);
|
|
1034
1051
|
let i = await t.detectImage(e);
|
|
1035
1052
|
return i && await n.setImageMetadata(e, i), i;
|
|
1036
1053
|
}
|
|
1037
|
-
function
|
|
1054
|
+
function At(e) {
|
|
1038
1055
|
if (i(e)) return new URL(e).pathname.replace(/^\//, "");
|
|
1039
1056
|
}
|
|
1040
|
-
function
|
|
1057
|
+
function jt(e, t) {
|
|
1041
1058
|
let n = e;
|
|
1042
1059
|
if (t === "image") return n.storageTransactionId || n.storage_transaction_id;
|
|
1043
|
-
let r =
|
|
1044
|
-
if (!(!r || r.width && r.height && r.mimeType)) return
|
|
1060
|
+
let r = q(n);
|
|
1061
|
+
if (!(!r || r.width && r.height && r.mimeType)) return At(r.url);
|
|
1045
1062
|
}
|
|
1046
|
-
async function
|
|
1047
|
-
let i = e, a =
|
|
1063
|
+
async function Mt(e, t, n, r) {
|
|
1064
|
+
let i = e, a = jt(e, t);
|
|
1048
1065
|
if (a) try {
|
|
1049
|
-
let e = await
|
|
1066
|
+
let e = await kt(a, n, r);
|
|
1050
1067
|
if (!e?.isImage) return;
|
|
1051
|
-
let o = t === "image" ? void 0 :
|
|
1068
|
+
let o = t === "image" ? void 0 : q(i);
|
|
1052
1069
|
i._imageMetadata = o ? {
|
|
1053
1070
|
...e,
|
|
1054
1071
|
url: o.url
|
|
@@ -1057,20 +1074,20 @@ async function kt(e, t, n, r) {
|
|
|
1057
1074
|
console.warn(`Error enriching item with transaction ${a}:`, e);
|
|
1058
1075
|
}
|
|
1059
1076
|
}
|
|
1060
|
-
async function
|
|
1061
|
-
let i = e.filter((e) =>
|
|
1062
|
-
return
|
|
1077
|
+
async function Nt(e, t, n, r) {
|
|
1078
|
+
let i = e.filter((e) => jt(e, t));
|
|
1079
|
+
return U("enriching %d items with image metadata", i.length), await Ot(i.map((e) => () => Mt(e, t, n, r)), Dt), e;
|
|
1063
1080
|
}
|
|
1064
|
-
async function
|
|
1081
|
+
async function Pt(e, t, n) {
|
|
1065
1082
|
let r = n.getConfig().imageMetadata;
|
|
1066
|
-
return r?.enabled ?
|
|
1083
|
+
return r?.enabled ? Nt(e, t, new ft({
|
|
1067
1084
|
gateways: r.gateways,
|
|
1068
1085
|
timeout: r.timeout
|
|
1069
1086
|
}), n) : e;
|
|
1070
1087
|
}
|
|
1071
|
-
function
|
|
1088
|
+
function Ft(e, t) {
|
|
1072
1089
|
let { itemUrlBase: n, itemUrlPath: r, richTextDataUriImages: i = "omit_items" } = t;
|
|
1073
|
-
return
|
|
1090
|
+
return St(e, i).map((e) => {
|
|
1074
1091
|
let t = e.id || e.seedUid || e.SeedUid || e.storageTransactionId || e.storage_transaction_id, i = `${n.replace(/\/$/, "")}/${r.replace(/^\//, "")}/${t}`, a = e.link || e.Link || e.import_url || e.importUrl || i, o;
|
|
1075
1092
|
if (e.pubDate || e.PubDate) {
|
|
1076
1093
|
let t = e.pubDate || e.PubDate;
|
|
@@ -1080,7 +1097,7 @@ function jt(e, t) {
|
|
|
1080
1097
|
let t = e.publishedAt || e.createdAt || e.updatedAt;
|
|
1081
1098
|
o = t && typeof t == "object" && t.constructor === Date ? t : new Date(t);
|
|
1082
1099
|
} else o = /* @__PURE__ */ new Date();
|
|
1083
|
-
let s =
|
|
1100
|
+
let s = vt(e), c = yt(e), l = {
|
|
1084
1101
|
...e,
|
|
1085
1102
|
id: t,
|
|
1086
1103
|
title: e.title || e.Title || "Untitled",
|
|
@@ -1100,8 +1117,12 @@ function jt(e, t) {
|
|
|
1100
1117
|
}), l;
|
|
1101
1118
|
});
|
|
1102
1119
|
}
|
|
1103
|
-
|
|
1104
|
-
let
|
|
1120
|
+
function X(e) {
|
|
1121
|
+
let t = e instanceof Date ? e : typeof e == "string" && e.trim() ? new Date(e) : void 0;
|
|
1122
|
+
return t && Number.isFinite(t.getTime()) ? t : void 0;
|
|
1123
|
+
}
|
|
1124
|
+
var Z = (e, t, n, r, i, a, o, s, c) => {
|
|
1125
|
+
let l = T(c), u = v(t), d = `${l.feedUrl}/${u}/${n}`, f = r ? `${d}?v=${r}` : d, p = `${l.title} - ${Rt(u)}`, m = /* @__PURE__ */ new Date(), h = E(), g = [];
|
|
1105
1126
|
if (i) {
|
|
1106
1127
|
let e = i.baseUrl.replace(/\?.*$/, ""), t = e.includes("?") ? "&" : "?";
|
|
1107
1128
|
i.hasNext && g.push({
|
|
@@ -1119,7 +1140,7 @@ var X = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1119
1140
|
rel: e.rel,
|
|
1120
1141
|
href: e.href
|
|
1121
1142
|
});
|
|
1122
|
-
let _ =
|
|
1143
|
+
let _ = Ft(e, {
|
|
1123
1144
|
schemaName: t,
|
|
1124
1145
|
itemUrlBase: h.itemUrlBase,
|
|
1125
1146
|
itemUrlPath: h.itemUrlPath,
|
|
@@ -1151,7 +1172,7 @@ var X = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1151
1172
|
entries: _.map((e) => {
|
|
1152
1173
|
let t = {
|
|
1153
1174
|
...e,
|
|
1154
|
-
updated: e.updated ?? (e.date
|
|
1175
|
+
updated: X(e.updated) ?? X(e.date) ?? X(e.pubDate) ?? m,
|
|
1155
1176
|
links: e.links ?? (e.link ? [{ href: e.link }] : []),
|
|
1156
1177
|
id: e.guid || e.id || e.link
|
|
1157
1178
|
};
|
|
@@ -1234,8 +1255,8 @@ var X = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1234
1255
|
value: e.id,
|
|
1235
1256
|
isPermaLink: typeof e.id == "string" && (e.id.startsWith("http://") || e.id.startsWith("https://"))
|
|
1236
1257
|
});
|
|
1237
|
-
let r =
|
|
1238
|
-
r &&
|
|
1258
|
+
let r = q(e);
|
|
1259
|
+
r && Tt(n, e, r, t, l.author, l.copyright), typeof e.content == "string" && e.content.trim() !== "" && n["content:encoded"] === void 0 && (n["content:encoded"] = e.content);
|
|
1239
1260
|
let i = {};
|
|
1240
1261
|
if (n.dc = i, (e.date || e.pubDate) && (i.date = e.date || e.pubDate), e.timeCreated) {
|
|
1241
1262
|
let t = /* @__PURE__ */ new Date(Number(e.timeCreated) * 1e3);
|
|
@@ -1244,18 +1265,18 @@ var X = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1244
1265
|
return (e.seedUid || e.SeedUid) && (i.identifier ||= [], i.identifier.push(e.seedUid || e.SeedUid)), (e.storageTransactionId || e.storage_transaction_id) && (i.identifier ||= [], i.identifier.push(e.storageTransactionId || e.storage_transaction_id)), (e.import_url || e.importUrl) && (i.source = e.import_url || e.importUrl), (e.seedUid || e.SeedUid) && (n.seedUid = e.seedUid || e.SeedUid), (e.storageTransactionId || e.storage_transaction_id) && (n.storageTransactionId = e.storageTransactionId || e.storage_transaction_id), e.timeCreated && (n.timeCreated = e.timeCreated), n;
|
|
1245
1266
|
})
|
|
1246
1267
|
};
|
|
1247
|
-
return Promise.resolve(
|
|
1268
|
+
return Promise.resolve(it(e));
|
|
1248
1269
|
}
|
|
1249
1270
|
}
|
|
1250
1271
|
};
|
|
1251
|
-
function
|
|
1272
|
+
function It(e) {
|
|
1252
1273
|
switch (e) {
|
|
1253
1274
|
case "atom": return "application/atom+xml; charset=utf-8";
|
|
1254
1275
|
case "json": return "application/feed+json; charset=utf-8";
|
|
1255
1276
|
default: return "application/rss+xml; charset=utf-8";
|
|
1256
1277
|
}
|
|
1257
1278
|
}
|
|
1258
|
-
function
|
|
1279
|
+
function Lt(e) {
|
|
1259
1280
|
let t = e.toLowerCase();
|
|
1260
1281
|
return [
|
|
1261
1282
|
"rss",
|
|
@@ -1263,63 +1284,63 @@ function Nt(e) {
|
|
|
1263
1284
|
"json"
|
|
1264
1285
|
].includes(t) ? t : null;
|
|
1265
1286
|
}
|
|
1266
|
-
function
|
|
1287
|
+
function Rt(e) {
|
|
1267
1288
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1268
1289
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return
|
|
1290
|
+
function zt(e) {
|
|
1291
|
+
return H(JSON.stringify(e));
|
|
1271
1292
|
}
|
|
1272
|
-
function
|
|
1273
|
-
return
|
|
1293
|
+
function Bt(e) {
|
|
1294
|
+
return H(JSON.stringify([
|
|
1274
1295
|
e.sourceEtag ?? null,
|
|
1275
1296
|
e.siteConfig,
|
|
1276
1297
|
e.cacheBust ?? null
|
|
1277
1298
|
]));
|
|
1278
1299
|
}
|
|
1279
|
-
function
|
|
1300
|
+
function Q(e, t, n, r = {}) {
|
|
1280
1301
|
let i = {
|
|
1281
1302
|
ETag: t.etag,
|
|
1282
1303
|
"Last-Modified": (/* @__PURE__ */ new Date(t.lastModified * 1e3)).toUTCString(),
|
|
1283
1304
|
"Cache-Control": `public, max-age=${e.maxAge}, s-maxage=${e.maxAge}, must-revalidate`,
|
|
1284
1305
|
...r
|
|
1285
1306
|
};
|
|
1286
|
-
return n !== 304 && (i["Content-Type"] = t.contentType ??
|
|
1307
|
+
return n !== 304 && (i["Content-Type"] = t.contentType ?? It(e.format), i["X-Feed-Schema"] = e.schemaName, i["X-Feed-Format"] = e.format), new Response(n === 304 ? null : t.content, {
|
|
1287
1308
|
status: n,
|
|
1288
1309
|
headers: i
|
|
1289
1310
|
});
|
|
1290
1311
|
}
|
|
1291
|
-
function
|
|
1292
|
-
return e.ifNoneMatch &&
|
|
1312
|
+
function $(e, t, n, r) {
|
|
1313
|
+
return e.ifNoneMatch && dt(e.ifNoneMatch, t.etag) ? (U("%s for %s:%s, 304", n, e.schemaName, e.format), Q(e, {
|
|
1293
1314
|
...t,
|
|
1294
1315
|
content: null
|
|
1295
|
-
}, 304)) : (
|
|
1316
|
+
}, 304)) : (U("%s for %s:%s", n, e.schemaName, e.format), Q(e, t, 200, {
|
|
1296
1317
|
"X-Cache": n,
|
|
1297
1318
|
...r
|
|
1298
1319
|
}));
|
|
1299
1320
|
}
|
|
1300
|
-
async function
|
|
1301
|
-
let { schemaName: t, format: n, contentKeyOptions: r } = e, i =
|
|
1321
|
+
async function Vt(e) {
|
|
1322
|
+
let { schemaName: t, format: n, contentKeyOptions: r } = e, i = Y(), a = i.getConfig().enabled;
|
|
1302
1323
|
try {
|
|
1303
1324
|
let o;
|
|
1304
1325
|
e.revalidate && (o = await e.fetchItems());
|
|
1305
|
-
let s =
|
|
1326
|
+
let s = Bt({
|
|
1306
1327
|
sourceEtag: o?.sourceEtag,
|
|
1307
1328
|
siteConfig: e.siteConfig,
|
|
1308
1329
|
cacheBust: e.cacheBust
|
|
1309
1330
|
});
|
|
1310
1331
|
if (a) {
|
|
1311
1332
|
let a = await i.getFeedContent(t, n, r, { fingerprint: s });
|
|
1312
|
-
if (a) return
|
|
1333
|
+
if (a) return $(e, a, "HIT");
|
|
1313
1334
|
}
|
|
1314
|
-
o ??= await e.fetchItems(),
|
|
1315
|
-
let c = await e.render(o.items), l =
|
|
1335
|
+
o ??= await e.fetchItems(), U("building %s:%s from %d items", t, n, o.items.length);
|
|
1336
|
+
let c = await e.render(o.items), l = It(n), u = o.sourceEtag ? H(`${s}:${V(t, n, r)}`) : H(c), d = a ? await i.setFeedContent(t, n, {
|
|
1316
1337
|
content: c,
|
|
1317
1338
|
contentType: l,
|
|
1318
1339
|
etag: u,
|
|
1319
1340
|
fingerprint: s,
|
|
1320
|
-
siteFingerprint:
|
|
1341
|
+
siteFingerprint: zt(e.siteConfig)
|
|
1321
1342
|
}, r) : null;
|
|
1322
|
-
return d ?
|
|
1343
|
+
return d ? $(e, d, "MISS") : Q(e, {
|
|
1323
1344
|
content: c,
|
|
1324
1345
|
contentType: l,
|
|
1325
1346
|
etag: u,
|
|
@@ -1327,8 +1348,8 @@ async function Lt(e) {
|
|
|
1327
1348
|
}, 200);
|
|
1328
1349
|
} catch (o) {
|
|
1329
1350
|
if (console.error(`Feed generation error for ${t}:${n}:`, o), a) {
|
|
1330
|
-
let a = await i.getFeedContent(t, n, r, { siteFingerprint:
|
|
1331
|
-
if (a) return
|
|
1351
|
+
let a = await i.getFeedContent(t, n, r, { siteFingerprint: zt(e.siteConfig) });
|
|
1352
|
+
if (a) return $(e, a, "STALE", { Warning: "110 - \"Response is stale\"" });
|
|
1332
1353
|
}
|
|
1333
1354
|
return new Response(JSON.stringify({
|
|
1334
1355
|
error: "Failed to generate feed",
|
|
@@ -1339,17 +1360,17 @@ async function Lt(e) {
|
|
|
1339
1360
|
});
|
|
1340
1361
|
}
|
|
1341
1362
|
}
|
|
1342
|
-
function
|
|
1363
|
+
function Ht(e) {
|
|
1343
1364
|
return new Response(JSON.stringify({ error: `Invalid feed format: ${e}` }), {
|
|
1344
1365
|
status: 400,
|
|
1345
1366
|
headers: { "Content-Type": "application/json" }
|
|
1346
1367
|
});
|
|
1347
1368
|
}
|
|
1348
|
-
async function
|
|
1349
|
-
let s =
|
|
1350
|
-
if (!s) return
|
|
1351
|
-
let c = v.singular(e.toLowerCase()), l = v(c), u = T(o), d = Math.max(1, a ?? 1), f = E().pageSize, p =
|
|
1352
|
-
return
|
|
1369
|
+
async function Ut(e, t, r, i, a, o) {
|
|
1370
|
+
let s = Lt(t);
|
|
1371
|
+
if (!s) return Ht(t);
|
|
1372
|
+
let c = v.singular(e.toLowerCase()), l = v(c), u = T(o), d = Math.max(1, a ?? 1), f = E().pageSize, p = Y(), m = !1;
|
|
1373
|
+
return Vt({
|
|
1353
1374
|
schemaName: c,
|
|
1354
1375
|
format: s,
|
|
1355
1376
|
contentKeyOptions: d > 1 ? { page: d } : void 0,
|
|
@@ -1377,7 +1398,7 @@ async function Rt(e, t, r, i, a, o) {
|
|
|
1377
1398
|
href: `${u.feedUrl}/${l}/archive/${n.getUTCFullYear()}/${n.getUTCMonth() + 1}/${s}`
|
|
1378
1399
|
});
|
|
1379
1400
|
}
|
|
1380
|
-
return
|
|
1401
|
+
return Z(await Pt(e, c, p), c, s, i, {
|
|
1381
1402
|
page: d,
|
|
1382
1403
|
pageSize: f,
|
|
1383
1404
|
hasNext: m,
|
|
@@ -1386,7 +1407,7 @@ async function Rt(e, t, r, i, a, o) {
|
|
|
1386
1407
|
}
|
|
1387
1408
|
});
|
|
1388
1409
|
}
|
|
1389
|
-
async function
|
|
1410
|
+
async function Wt(e, t, n, r, i, a, o) {
|
|
1390
1411
|
if (!Number.isInteger(t) || t < 1970 || t > 2100) return new Response(JSON.stringify({ error: `Invalid year: ${t}` }), {
|
|
1391
1412
|
status: 400,
|
|
1392
1413
|
headers: { "Content-Type": "application/json" }
|
|
@@ -1395,10 +1416,10 @@ async function zt(e, t, n, r, i, a, o) {
|
|
|
1395
1416
|
status: 400,
|
|
1396
1417
|
headers: { "Content-Type": "application/json" }
|
|
1397
1418
|
});
|
|
1398
|
-
let s =
|
|
1399
|
-
if (!s) return
|
|
1400
|
-
let c = v.singular(e.toLowerCase()), l = v(c), u = T(o), d =
|
|
1401
|
-
return
|
|
1419
|
+
let s = Lt(r);
|
|
1420
|
+
if (!s) return Ht(r);
|
|
1421
|
+
let c = v.singular(e.toLowerCase()), l = v(c), u = T(o), d = Y();
|
|
1422
|
+
return Vt({
|
|
1402
1423
|
schemaName: c,
|
|
1403
1424
|
format: s,
|
|
1404
1425
|
contentKeyOptions: { archive: {
|
|
@@ -1422,11 +1443,11 @@ async function zt(e, t, n, r, i, a, o) {
|
|
|
1422
1443
|
return (p < h.getUTCFullYear() || p === h.getUTCFullYear() && m <= h.getUTCMonth() + 1) && f.push({
|
|
1423
1444
|
rel: "next-archive",
|
|
1424
1445
|
href: `${i}/${p}/${m}/${s}`
|
|
1425
|
-
}),
|
|
1446
|
+
}), Z(await Pt(e, c, d), c, s, a, void 0, f, !0, void 0, o);
|
|
1426
1447
|
}
|
|
1427
1448
|
});
|
|
1428
1449
|
}
|
|
1429
1450
|
//#endregion
|
|
1430
|
-
export { d as DEFAULT_ARWEAVE_HOST, S as DEFAULT_SITE_CONFIG, f as SEED_RSS_IMAGE_RELATION_FIELD_KEYS, m as classifyMediaRef,
|
|
1451
|
+
export { d as DEFAULT_ARWEAVE_HOST, S as DEFAULT_SITE_CONFIG, f as SEED_RSS_IMAGE_RELATION_FIELD_KEYS, m as classifyMediaRef, Z as createFeed, xt as feedItemRichTextContainsDataUriImage, A as fetchFeedItemsBySchemaName, St as filterItemsByRichTextDataUriImagePolicy, ee as getFeedItemStringField, Ne as getFeedItemsBySchemaName, Pe as getFeedItemsBySchemaNameForMonth, we as getSiteConfig, Wt as handleArchiveFeedRequest, Ut as handleFeedRequest, x as initializeFeedPlatform, re as isEasAttestationExplorerUrl, E as loadFeedConfig, ae as normalizeFeedItemFields, Ve as parseRssString, yt as pickFeedItemContent, vt as pickFeedItemDescription, Et as resetCacheManager, Ee as resetSiteConfig, de as resolveSeedRssImageRelationFromItem, fe as resolveSeedRssImageRelationRef, T as resolveSiteConfig, Te as setSiteConfig, Ce as teardownFeedPlatform };
|
|
1431
1452
|
|
|
1432
1453
|
//# sourceMappingURL=index.js.map
|