@seedprotocol/feed 0.7.1 → 0.7.2-next.593.gd5bd4ea
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/getFeedItems.d.ts.map +1 -1
- package/dist/index.js +255 -260
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
package/dist/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { BaseArweaveClient as e, DEFAULT_ARWEAVE_HOST as t, DEFAULT_ARWEAVE_HOST as n, SEED_RSS_IMAGE_RELATION_FIELD_KEYS as r, classifyMediaRef as i, ensureArweaveReadGatewayForFallback as a, getArweaveReadBaseUrls as o, getArweaveReadGatewayHostsForPrimary as s, getFeedItemStringField as c, isEasAttestationExplorerUrl as l, isGatewayHostCircuitOpen as u, normalizeFeedItemFields as d, recordGatewayHostFailure as f, recordGatewayHostSuccess as p, resolveArweaveHostFromEnv as m, resolveSeedRssImageRelationFromItem as h, resolveSeedRssImageRelationRef as g, resolveSeedRssImageRelationRef as _ } from "@seedprotocol/arweave";
|
|
2
|
-
import { FEED_RICH_BODY_STORAGE_SCHEMAS as v, enrichImageSeedCloneForFeed as y, feedRichBodyModelPriority as b, getArweaveUrlForTransaction as ee, getFeedFieldStorageModels as
|
|
3
|
-
import { getEasChainDeployment as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { generateAtomFeed as
|
|
7
|
-
import { create as
|
|
8
|
-
import { createHash as
|
|
9
|
-
import { promises as
|
|
10
|
-
import { join as
|
|
11
|
-
import
|
|
2
|
+
import { FEED_RICH_BODY_STORAGE_SCHEMAS as v, enrichImageSeedCloneForFeed as y, feedRichBodyModelPriority as b, getArweaveUrlForTransaction as ee, getFeedFieldStorageModels as te, getFeedListElementStorageModels as ne, isFeedRichBodyStorageSchema as x, queryBySchema as re, queryBySchemaForMonth as ie } from "@seedprotocol/query";
|
|
3
|
+
import { getEasChainDeployment as ae, getEasReadChainId as oe } from "@seedprotocol/eas";
|
|
4
|
+
import se from "rss-parser";
|
|
5
|
+
import S from "pluralize";
|
|
6
|
+
import { generateAtomFeed as ce, generateJsonFeed as le } from "feedsmith";
|
|
7
|
+
import { create as ue } from "xmlbuilder2";
|
|
8
|
+
import { createHash as de } from "crypto";
|
|
9
|
+
import { promises as C } from "fs";
|
|
10
|
+
import { join as w } from "path";
|
|
11
|
+
import fe from "image-size";
|
|
12
12
|
//#region src/bootstrap.ts
|
|
13
|
-
var
|
|
14
|
-
function
|
|
13
|
+
var T = !1;
|
|
14
|
+
function pe(e) {
|
|
15
15
|
return e ?? m() ?? n;
|
|
16
16
|
}
|
|
17
|
-
async function
|
|
18
|
-
if (
|
|
17
|
+
async function E(e) {
|
|
18
|
+
if (T) return;
|
|
19
19
|
let [{ registerNodeEasPlatform: t }, { registerNodeArweavePlatform: n }] = await Promise.all([import("@seedprotocol/eas/node"), import("@seedprotocol/arweave/node")]);
|
|
20
|
-
if (t(), n({ arweaveDomain:
|
|
20
|
+
if (t(), n({ arweaveDomain: pe(e?.arweaveDomain) }), e?.arweaveDomain) {
|
|
21
21
|
let { BaseArweaveClient: t } = await import("@seedprotocol/arweave");
|
|
22
22
|
t.setHost(e.arweaveDomain);
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
T = !0;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
async function
|
|
28
|
-
return await
|
|
26
|
+
var me = E;
|
|
27
|
+
async function he() {
|
|
28
|
+
return await E(), { isInitialized: () => T };
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
31
|
-
|
|
30
|
+
async function ge() {
|
|
31
|
+
T = !1;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/config.ts
|
|
35
|
-
var
|
|
35
|
+
var D = {
|
|
36
36
|
title: "Seed Protocol",
|
|
37
37
|
description: "Content published via Seed Protocol",
|
|
38
38
|
siteUrl: "https://seedprotocol.io",
|
|
@@ -45,15 +45,15 @@ var k = {
|
|
|
45
45
|
link: "https://seedprotocol.io"
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
function
|
|
48
|
+
function O(e) {
|
|
49
49
|
return {
|
|
50
50
|
...e,
|
|
51
51
|
author: e.author ? { ...e.author } : void 0
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
function
|
|
56
|
-
if (!e) return
|
|
54
|
+
var k = O(D);
|
|
55
|
+
function A(e, t = k) {
|
|
56
|
+
if (!e) return O(t);
|
|
57
57
|
let n = {
|
|
58
58
|
...t,
|
|
59
59
|
...e,
|
|
@@ -65,18 +65,18 @@ function M(e, t = j) {
|
|
|
65
65
|
name: e.author.name ?? n.author?.name ?? ""
|
|
66
66
|
}), n;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function _e() {
|
|
69
|
+
return O(k);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
71
|
+
function ve(e) {
|
|
72
|
+
return k = A(e, D), _e();
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
74
|
+
function ye() {
|
|
75
|
+
k = O(D);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function j() {
|
|
78
78
|
return {
|
|
79
|
-
itemUrlBase: process.env.FEED_ITEM_URL_BASE?.trim() ||
|
|
79
|
+
itemUrlBase: process.env.FEED_ITEM_URL_BASE?.trim() || ae(oe())?.explorerUrl || "https://easscan.org",
|
|
80
80
|
itemUrlPath: process.env.FEED_ITEM_URL_PATH?.trim() || "attestation/view",
|
|
81
81
|
siteUrl: process.env.FEED_SITE_URL?.trim() || "https://seedprotocol.io",
|
|
82
82
|
expandRelations: process.env.FEED_EXPAND_RELATIONS?.toLowerCase() !== "false",
|
|
@@ -86,7 +86,7 @@ function N() {
|
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/getFeedItems.ts
|
|
89
|
-
var
|
|
89
|
+
var M = (e) => {
|
|
90
90
|
let t = /* @__PURE__ */ new Date(e * 1e3), n = [
|
|
91
91
|
"Sun",
|
|
92
92
|
"Mon",
|
|
@@ -110,10 +110,10 @@ var P = (e) => {
|
|
|
110
110
|
"Dec"
|
|
111
111
|
], i = n[t.getUTCDay()], a = r[t.getUTCMonth()], o = t.getUTCFullYear();
|
|
112
112
|
return `${i}, ${t.getUTCDate().toString().padStart(2, "0")} ${a} ${o} ${t.getUTCHours().toString().padStart(2, "0")}:${t.getUTCMinutes().toString().padStart(2, "0")}:${t.getUTCSeconds().toString().padStart(2, "0")} GMT`;
|
|
113
|
-
},
|
|
113
|
+
}, be = (e) => e === "image" ? "images" : e === "post" ? "posts" : e.toLowerCase() + "s", N = (e, t, n, r) => {
|
|
114
114
|
let { itemUrlBase: i, itemUrlPath: a, siteUrl: o } = r;
|
|
115
115
|
!e.title && !e.Title ? (e.title = t, e.Title = t) : e.title && !e.Title ? e.Title = e.title : e.Title && !e.title && (e.title = e.Title);
|
|
116
|
-
let s = e.storage_transaction_id && typeof e.storage_transaction_id == "string" && e.storage_transaction_id.trim() !== "" && e.storage_transaction_id !== "undefined" && e.storage_transaction_id !== t ? e.storage_transaction_id.trim() : null, c = e.storageTransactionId && typeof e.storageTransactionId == "string" && e.storageTransactionId.trim() !== "" && e.storageTransactionId !== "undefined" && e.storageTransactionId !== t ? e.storageTransactionId.trim() : null, l = s || c, u =
|
|
116
|
+
let s = e.storage_transaction_id && typeof e.storage_transaction_id == "string" && e.storage_transaction_id.trim() !== "" && e.storage_transaction_id !== "undefined" && e.storage_transaction_id !== t ? e.storage_transaction_id.trim() : null, c = e.storageTransactionId && typeof e.storageTransactionId == "string" && e.storageTransactionId.trim() !== "" && e.storageTransactionId !== "undefined" && e.storageTransactionId !== t ? e.storageTransactionId.trim() : null, l = s || c, u = be(n), d = t && typeof t == "string" && t.trim() !== "" ? t : "unknown", f;
|
|
117
117
|
if (l && l !== t && l.length > 0) try {
|
|
118
118
|
f = ee(l);
|
|
119
119
|
} catch (e) {
|
|
@@ -124,13 +124,13 @@ var P = (e) => {
|
|
|
124
124
|
!p || p === "undefined" || typeof p == "string" && p.trim() === "" ? (e.link = f, e.Link = f) : ((!e.link || e.link === "undefined") && (e.link = p), (!e.Link || e.Link === "undefined") && (e.Link = p));
|
|
125
125
|
let m = e.guid || e.Guid;
|
|
126
126
|
if (!m || m === "undefined" || typeof m == "string" && m.trim() === "" ? (e.guid = e.link || f, e.Guid = e.guid) : ((!e.guid || e.guid === "undefined") && (e.guid = m), (!e.Guid || e.Guid === "undefined") && (e.Guid = m)), e.timeCreated && !e.pubDate && !e.PubDate) {
|
|
127
|
-
let t =
|
|
127
|
+
let t = M(e.timeCreated);
|
|
128
128
|
e.pubDate = t, e.PubDate = t;
|
|
129
129
|
} else e.pubDate && !e.PubDate ? e.PubDate = e.pubDate : e.PubDate && !e.pubDate && (e.pubDate = e.PubDate);
|
|
130
130
|
!e.seedUid && !e.SeedUid ? (e.seedUid = t, e.SeedUid = t) : e.seedUid && !e.SeedUid ? e.SeedUid = e.seedUid : e.SeedUid && !e.seedUid && (e.seedUid = e.SeedUid), e.attester && !e.Attester ? e.Attester = e.attester : e.Attester && !e.attester && (e.attester = e.Attester);
|
|
131
|
-
},
|
|
131
|
+
}, xe = (e, t) => {
|
|
132
132
|
if (!e.title && !e.Title ? (e.title = t, e.Title = t) : e.title && !e.Title ? e.Title = e.title : e.Title && !e.title && (e.title = e.Title), e.timeCreated && !e.pubDate && !e.PubDate) {
|
|
133
|
-
let t =
|
|
133
|
+
let t = M(e.timeCreated);
|
|
134
134
|
e.pubDate = t, e.PubDate = t;
|
|
135
135
|
} else e.pubDate && !e.PubDate ? e.PubDate = e.pubDate : e.PubDate && !e.pubDate && (e.pubDate = e.PubDate);
|
|
136
136
|
!e.seedUid && !e.SeedUid ? (e.seedUid = t, e.SeedUid = t) : e.seedUid && !e.SeedUid ? e.SeedUid = e.seedUid : e.SeedUid && !e.seedUid && (e.seedUid = e.SeedUid), e.attester && !e.Attester ? e.Attester = e.attester : e.Attester && !e.attester && (e.attester = e.Attester);
|
|
@@ -140,86 +140,81 @@ var P = (e) => {
|
|
|
140
140
|
e.link = t, e.Link = t;
|
|
141
141
|
} catch {}
|
|
142
142
|
};
|
|
143
|
-
function
|
|
143
|
+
function P(e) {
|
|
144
144
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
145
145
|
let t = e;
|
|
146
146
|
return typeof t.seedUid == "string" || typeof t.SeedUid == "string";
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}
|
|
148
|
+
function F(e, t, n) {
|
|
149
|
+
let r = { ...e }, i = r.seedUid || r.SeedUid || "", a = typeof r.schemaName == "string" ? r.schemaName : t;
|
|
150
|
+
return a === "image" ? xe(r, i) : N(r, i, a, n), r;
|
|
151
|
+
}
|
|
152
|
+
function Se(e, t, n) {
|
|
153
|
+
let r = { ...e };
|
|
154
|
+
N(r, r.seedUid || r.SeedUid || "", t, n);
|
|
155
|
+
for (let e of Object.keys(r)) {
|
|
156
|
+
if (e.startsWith("_")) continue;
|
|
157
|
+
let i = r[e];
|
|
158
|
+
Array.isArray(i) ? i.some(P) && (r[e] = i.map((e) => P(e) ? F(e, t, n) : e)) : P(i) && (r[e] = F(i, t, n));
|
|
159
|
+
}
|
|
160
|
+
return r;
|
|
163
161
|
}
|
|
164
|
-
function
|
|
165
|
-
let n =
|
|
162
|
+
function Ce(e, t) {
|
|
163
|
+
let n = j(), r = {
|
|
166
164
|
itemUrlBase: n.itemUrlBase,
|
|
167
165
|
itemUrlPath: n.itemUrlPath,
|
|
168
166
|
siteUrl: n.siteUrl
|
|
169
167
|
};
|
|
170
|
-
return t.map((t) =>
|
|
171
|
-
let n = t.data;
|
|
172
|
-
return xe(n, e, r), n;
|
|
173
|
-
});
|
|
168
|
+
return t.map((t) => Se(t.data, e, r));
|
|
174
169
|
}
|
|
175
|
-
var
|
|
176
|
-
await
|
|
177
|
-
let n =
|
|
170
|
+
var we = async (e, t) => {
|
|
171
|
+
await E();
|
|
172
|
+
let n = j(), r = t?.limit ?? 100, i = t?.skip ?? 0, { items: a } = await re(e, {
|
|
178
173
|
limit: r,
|
|
179
174
|
skip: i,
|
|
180
175
|
expandRelations: n.expandRelations !== !1,
|
|
181
176
|
hydrateStorage: !0
|
|
182
177
|
});
|
|
183
|
-
return
|
|
184
|
-
},
|
|
185
|
-
await
|
|
186
|
-
let r =
|
|
187
|
-
return
|
|
178
|
+
return Ce(e, a);
|
|
179
|
+
}, Te = async (e, t, n) => {
|
|
180
|
+
await E();
|
|
181
|
+
let r = j();
|
|
182
|
+
return Ce(e, await ie(e, t, n, {
|
|
188
183
|
expandRelations: r.expandRelations !== !1,
|
|
189
184
|
hydrateStorage: !0
|
|
190
185
|
}));
|
|
191
186
|
};
|
|
192
187
|
//#endregion
|
|
193
188
|
//#region src/consume/parseRss.ts
|
|
194
|
-
function
|
|
189
|
+
function Ee(e) {
|
|
195
190
|
try {
|
|
196
191
|
return JSON.parse(JSON.stringify(e));
|
|
197
192
|
} catch {
|
|
198
193
|
return { ...e };
|
|
199
194
|
}
|
|
200
195
|
}
|
|
201
|
-
var
|
|
196
|
+
var De = new se({ customFields: { item: [
|
|
202
197
|
"featureImage",
|
|
203
198
|
"feature_image",
|
|
204
199
|
"content:encoded",
|
|
205
200
|
"seedUid",
|
|
206
201
|
"SeedUid"
|
|
207
202
|
] } });
|
|
208
|
-
async function
|
|
209
|
-
let t = await
|
|
203
|
+
async function Oe(e) {
|
|
204
|
+
let t = await De.parseString(e);
|
|
210
205
|
return {
|
|
211
206
|
title: t.title,
|
|
212
207
|
link: t.link,
|
|
213
208
|
description: t.description,
|
|
214
|
-
items: (t.items ?? []).map(
|
|
209
|
+
items: (t.items ?? []).map(Ee)
|
|
215
210
|
};
|
|
216
211
|
}
|
|
217
212
|
//#endregion
|
|
218
213
|
//#region src/rss/generateRssXml.ts
|
|
219
|
-
var I = "http://purl.org/dc/elements/1.1/", L = "http://purl.org/rss/1.0/modules/content/", R = "http://search.yahoo.com/mrss/",
|
|
214
|
+
var I = "http://purl.org/dc/elements/1.1/", L = "http://purl.org/rss/1.0/modules/content/", R = "http://search.yahoo.com/mrss/", ke = { publication: {
|
|
220
215
|
prefix: "publication",
|
|
221
216
|
uri: "https://seedprotocol.io/ns/publication/1.0"
|
|
222
|
-
} },
|
|
217
|
+
} }, Ae = "https://seedprotocol.io/ns/relations", je = /* @__PURE__ */ new Set([
|
|
223
218
|
"xml",
|
|
224
219
|
"xmlns",
|
|
225
220
|
"dc",
|
|
@@ -227,17 +222,17 @@ var I = "http://purl.org/dc/elements/1.1/", L = "http://purl.org/rss/1.0/modules
|
|
|
227
222
|
"content",
|
|
228
223
|
"atom",
|
|
229
224
|
"fh"
|
|
230
|
-
]),
|
|
225
|
+
]), Me = /* @__PURE__ */ new Set([
|
|
231
226
|
"Title",
|
|
232
227
|
"Link",
|
|
233
228
|
"Guid",
|
|
234
229
|
"PubDate",
|
|
235
230
|
"SeedUid"
|
|
236
231
|
]);
|
|
237
|
-
function
|
|
238
|
-
return
|
|
232
|
+
function Ne(e, t) {
|
|
233
|
+
return Me.has(e) ? e.charAt(0).toLowerCase() + e.slice(1) in t : !1;
|
|
239
234
|
}
|
|
240
|
-
var
|
|
235
|
+
var z = [
|
|
241
236
|
"title",
|
|
242
237
|
"link",
|
|
243
238
|
"description",
|
|
@@ -261,7 +256,7 @@ var B = [
|
|
|
261
256
|
"media:category",
|
|
262
257
|
"media:group"
|
|
263
258
|
];
|
|
264
|
-
function
|
|
259
|
+
function B(e) {
|
|
265
260
|
if (e instanceof Date) return e.toUTCString();
|
|
266
261
|
if (typeof e == "string") {
|
|
267
262
|
let t = new Date(e);
|
|
@@ -269,13 +264,13 @@ function V(e) {
|
|
|
269
264
|
}
|
|
270
265
|
return String(e);
|
|
271
266
|
}
|
|
272
|
-
function
|
|
267
|
+
function Pe(e) {
|
|
273
268
|
return /[<>&]|]]>/.test(e);
|
|
274
269
|
}
|
|
275
|
-
function
|
|
270
|
+
function V(e, t) {
|
|
276
271
|
let n = String(t);
|
|
277
272
|
if (n !== "") {
|
|
278
|
-
if (
|
|
273
|
+
if (Pe(n)) {
|
|
279
274
|
if (n.includes("]]>")) {
|
|
280
275
|
let t = n.split("]]>");
|
|
281
276
|
for (let n = 0; n < t.length; n++) e.dat(t[n]), n < t.length - 1 && e.txt("]]>");
|
|
@@ -283,11 +278,11 @@ function H(e, t) {
|
|
|
283
278
|
} else e.txt(n);
|
|
284
279
|
}
|
|
285
280
|
}
|
|
286
|
-
function
|
|
281
|
+
function H(e) {
|
|
287
282
|
return typeof e == "object" && !!e && !Array.isArray(e) && !(e instanceof Date);
|
|
288
283
|
}
|
|
289
|
-
var
|
|
290
|
-
...
|
|
284
|
+
var Fe = 4, Ie = /* @__PURE__ */ new Set([
|
|
285
|
+
...z,
|
|
291
286
|
"guid",
|
|
292
287
|
"source",
|
|
293
288
|
"dc",
|
|
@@ -295,70 +290,70 @@ var Ne = 4, Pe = /* @__PURE__ */ new Set([
|
|
|
295
290
|
"content:encoded",
|
|
296
291
|
"items"
|
|
297
292
|
]);
|
|
298
|
-
function
|
|
293
|
+
function Le(e) {
|
|
299
294
|
return e.endsWith("s") && e.length > 1 ? e.slice(0, -1) : e;
|
|
300
295
|
}
|
|
301
|
-
function
|
|
296
|
+
function Re(e) {
|
|
302
297
|
return e.trim().replace(/[^A-Za-z0-9_.-]+/g, "_").replace(/^[^A-Za-z_]+/, "").replace(/^$/, "rel").toLowerCase();
|
|
303
298
|
}
|
|
304
|
-
function
|
|
305
|
-
if (!t.has(e) && !
|
|
299
|
+
function ze(e, t) {
|
|
300
|
+
if (!t.has(e) && !je.has(e)) return t.add(e), e;
|
|
306
301
|
let n = 2;
|
|
307
302
|
for (;;) {
|
|
308
303
|
let r = `${e}${n}`;
|
|
309
|
-
if (!t.has(r) && !
|
|
304
|
+
if (!t.has(r) && !je.has(r)) return t.add(r), r;
|
|
310
305
|
n += 1;
|
|
311
306
|
}
|
|
312
307
|
}
|
|
313
|
-
function
|
|
314
|
-
return Array.isArray(e) && e.length > 0 && e.every((e) =>
|
|
308
|
+
function Be(e) {
|
|
309
|
+
return Array.isArray(e) && e.length > 0 && e.every((e) => H(e));
|
|
315
310
|
}
|
|
316
|
-
function
|
|
317
|
-
let t = { ...
|
|
311
|
+
function Ve(e) {
|
|
312
|
+
let t = { ...ke }, n = new Set(Object.values(t).map((e) => e.prefix)), r = /* @__PURE__ */ new Set();
|
|
318
313
|
for (let t of e) for (let [e, n] of Object.entries(t)) {
|
|
319
|
-
let t = e === "author" &&
|
|
320
|
-
e.startsWith("_") || (!
|
|
314
|
+
let t = e === "author" && H(n) || e === "authors" && Be(n);
|
|
315
|
+
e.startsWith("_") || (!Ie.has(e) || t) && (H(n) || Be(n)) && r.add(Le(e));
|
|
321
316
|
}
|
|
322
317
|
let i = [...r].sort();
|
|
323
318
|
for (let e of i) t[e] || (t[e] = {
|
|
324
|
-
prefix:
|
|
325
|
-
uri: `${
|
|
319
|
+
prefix: ze(Re(e), n),
|
|
320
|
+
uri: `${Ae}/${e}/1.0`
|
|
326
321
|
});
|
|
327
322
|
return t;
|
|
328
323
|
}
|
|
329
|
-
function
|
|
324
|
+
function U(e, t) {
|
|
330
325
|
if (e in t) return t[e];
|
|
331
326
|
if (e.endsWith("s") && e.length > 1) {
|
|
332
327
|
let n = e.slice(0, -1);
|
|
333
328
|
if (n in t) return t[n];
|
|
334
329
|
}
|
|
335
330
|
}
|
|
336
|
-
function
|
|
331
|
+
function He(e, t) {
|
|
337
332
|
return t ? `${t.prefix}:${e}` : e;
|
|
338
333
|
}
|
|
339
|
-
function
|
|
334
|
+
function W(e, t, n, r, i = 0, a) {
|
|
340
335
|
let o = e.ele(n);
|
|
341
336
|
for (let [e, n] of Object.entries(t)) {
|
|
342
337
|
if (n == null || e.startsWith("_") || e === "items") continue;
|
|
343
|
-
let t =
|
|
344
|
-
if (i >=
|
|
338
|
+
let t = He(e, a);
|
|
339
|
+
if (i >= Fe) V(o.ele(t), typeof n == "object" ? JSON.stringify(n) : String(n));
|
|
345
340
|
else if (Array.isArray(n)) {
|
|
346
|
-
let t =
|
|
347
|
-
for (let e of n) e != null && (
|
|
348
|
-
} else
|
|
341
|
+
let t = He(e.endsWith("s") && e.length > 1 ? e.slice(0, -1) : e, a);
|
|
342
|
+
for (let e of n) e != null && (H(e) ? W(o, e, t, !1, i + 1, a) : V(o.ele(t), String(e)));
|
|
343
|
+
} else H(n) ? W(o, n, t, !1, i + 1, a) : V(o.ele(t), String(n));
|
|
349
344
|
}
|
|
350
345
|
if (r) {
|
|
351
346
|
let n = t.name ?? t.seedUid;
|
|
352
347
|
n && e.ele(I, "creator").txt(String(n));
|
|
353
348
|
}
|
|
354
349
|
}
|
|
355
|
-
function
|
|
350
|
+
function Ue(e, t, n, r, i) {
|
|
356
351
|
if (!(n == null || t.startsWith("_")) && t !== "items") {
|
|
357
352
|
if (t === "guid") {
|
|
358
353
|
let t = n, r = t?.value ?? String(n);
|
|
359
354
|
if (!r) return;
|
|
360
355
|
let i = {};
|
|
361
|
-
typeof t?.isPermaLink == "boolean" && (i.isPermaLink = t.isPermaLink ? "true" : "false"),
|
|
356
|
+
typeof t?.isPermaLink == "boolean" && (i.isPermaLink = t.isPermaLink ? "true" : "false"), V(e.ele("guid", i), r);
|
|
362
357
|
} else if (t === "source" && typeof n == "object" && n) {
|
|
363
358
|
let t = n, r = t.title ?? String(n);
|
|
364
359
|
if (!r) return;
|
|
@@ -378,15 +373,15 @@ function Be(e, t, n, r, i) {
|
|
|
378
373
|
if (Array.isArray(r)) {
|
|
379
374
|
for (let t of r) if (t != null) {
|
|
380
375
|
let r = e.ele(I, n);
|
|
381
|
-
t instanceof Date ? r.txt(t.toISOString()) :
|
|
376
|
+
t instanceof Date ? r.txt(t.toISOString()) : V(r, String(t));
|
|
382
377
|
}
|
|
383
378
|
} else {
|
|
384
379
|
let t = e.ele(I, n);
|
|
385
|
-
r instanceof Date ? t.txt(r.toISOString()) :
|
|
380
|
+
r instanceof Date ? t.txt(r.toISOString()) : V(t, String(r));
|
|
386
381
|
}
|
|
387
382
|
}
|
|
388
|
-
} else if (t === "content:encoded")
|
|
389
|
-
else if (t === "content" && typeof n == "string" && !("content:encoded" in r))
|
|
383
|
+
} else if (t === "content:encoded") V(e.ele(L, "encoded"), String(n));
|
|
384
|
+
else if (t === "content" && typeof n == "string" && !("content:encoded" in r)) V(e.ele(L, "encoded"), String(n));
|
|
390
385
|
else if (t !== "content") {
|
|
391
386
|
if (t === "media:group" && Array.isArray(n)) {
|
|
392
387
|
for (let t of n) if (t && typeof t == "object") {
|
|
@@ -396,9 +391,9 @@ function Be(e, t, n, r, i) {
|
|
|
396
391
|
if (Array.isArray(r)) {
|
|
397
392
|
for (let e of r) if (e && typeof e == "object") {
|
|
398
393
|
let r = n.ele(R, t);
|
|
399
|
-
for (let [t, n] of Object.entries(e)) n != null && (t === "url" || t === "value" ?
|
|
394
|
+
for (let [t, n] of Object.entries(e)) n != null && (t === "url" || t === "value" ? V(r, String(n)) : r.att(t, String(n)));
|
|
400
395
|
}
|
|
401
|
-
} else typeof r == "string" &&
|
|
396
|
+
} else typeof r == "string" && V(n.ele(R, t), r);
|
|
402
397
|
}
|
|
403
398
|
}
|
|
404
399
|
} else if (t.startsWith("media:") && Array.isArray(n)) {
|
|
@@ -408,16 +403,16 @@ function Be(e, t, n, r, i) {
|
|
|
408
403
|
let n = {}, i = null;
|
|
409
404
|
for (let [e, r] of Object.entries(t)) r != null && (e === "value" ? i = String(r) : n[e] = String(r));
|
|
410
405
|
let a = e.ele(R, r, n);
|
|
411
|
-
i !== null &&
|
|
406
|
+
i !== null && V(a, i);
|
|
412
407
|
}
|
|
413
408
|
} else if (t.startsWith("media:") && typeof n == "string") {
|
|
414
409
|
let r = t.slice(6);
|
|
415
|
-
|
|
416
|
-
} else if (n instanceof Date) e.ele(t).txt(
|
|
417
|
-
else if (t === "author" &&
|
|
410
|
+
V(e.ele(R, r), n);
|
|
411
|
+
} else if (n instanceof Date) e.ele(t).txt(B(n));
|
|
412
|
+
else if (t === "author" && H(n)) W(e, n, "author", !0, 0, U(t, i));
|
|
418
413
|
else if (t === "authors" && Array.isArray(n)) {
|
|
419
|
-
let r =
|
|
420
|
-
for (let t of n) if (t &&
|
|
414
|
+
let r = U(t, i);
|
|
415
|
+
for (let t of n) if (t && H(t)) W(e, t, "author", !0, 0, r);
|
|
421
416
|
else {
|
|
422
417
|
let n = typeof t == "string" ? t : t && typeof t == "object" && "name" in t ? `${t.email ?? ""} (${t.name ?? ""})`.trim() || t.name : String(t);
|
|
423
418
|
n && e.ele("author").txt(n);
|
|
@@ -429,29 +424,29 @@ function Be(e, t, n, r, i) {
|
|
|
429
424
|
e.ele("category", r).txt(n);
|
|
430
425
|
}
|
|
431
426
|
}
|
|
432
|
-
else if (Array.isArray(n) && n.length > 0 && n.every((e) =>
|
|
433
|
-
let r = t.endsWith("s") ? t.slice(0, -1) : t, a =
|
|
434
|
-
for (let t of n) t &&
|
|
427
|
+
else if (Array.isArray(n) && n.length > 0 && n.every((e) => H(e))) {
|
|
428
|
+
let r = t.endsWith("s") ? t.slice(0, -1) : t, a = U(t, i);
|
|
429
|
+
for (let t of n) t && W(e, t, r, !1, 0, a);
|
|
435
430
|
} else if (Array.isArray(n) && n.every((e) => typeof e == "string")) {
|
|
436
431
|
let r = t.endsWith("s") ? t.slice(0, -1) : t;
|
|
437
|
-
for (let t of n) t &&
|
|
438
|
-
} else
|
|
432
|
+
for (let t of n) t && V(e.ele(r), t);
|
|
433
|
+
} else H(n) ? W(e, n, t, !1, 0, U(t, i)) : V(e.ele(t), String(n));
|
|
439
434
|
}
|
|
440
435
|
}
|
|
441
436
|
}
|
|
442
|
-
var
|
|
443
|
-
function
|
|
444
|
-
let t =
|
|
437
|
+
var We = "http://www.w3.org/2005/Atom", Ge = "http://purl.org/syndication/history/1.0";
|
|
438
|
+
function Ke(e) {
|
|
439
|
+
let t = ue({
|
|
445
440
|
version: "1.0",
|
|
446
441
|
encoding: "UTF-8"
|
|
447
|
-
}), n =
|
|
442
|
+
}), n = Ve(e.items), r = {
|
|
448
443
|
"xmlns:dc": I,
|
|
449
444
|
"xmlns:content": L,
|
|
450
445
|
"xmlns:media": R,
|
|
451
|
-
"xmlns:atom":
|
|
446
|
+
"xmlns:atom": We,
|
|
452
447
|
...Object.values(n).reduce((e, t) => (e[`xmlns:${t.prefix}`] = t.uri, e), {})
|
|
453
448
|
};
|
|
454
|
-
e.isArchive && (r["xmlns:fh"] =
|
|
449
|
+
e.isArchive && (r["xmlns:fh"] = Ge);
|
|
455
450
|
let i = t.ele("rss", {
|
|
456
451
|
version: "2.0",
|
|
457
452
|
...r
|
|
@@ -460,50 +455,50 @@ function Ue(e) {
|
|
|
460
455
|
"xmlns:content": L,
|
|
461
456
|
"xmlns:media": R
|
|
462
457
|
});
|
|
463
|
-
if (i.ele("title").txt(e.title), e.link && i.ele("link").txt(e.link), i.ele("description").txt(e.description), e.language && i.ele("language").txt(e.language), e.copyright && i.ele("copyright").txt(e.copyright), e.webMaster && i.ele("webMaster").txt(e.webMaster), e.pubDate && i.ele("pubDate").txt(
|
|
458
|
+
if (i.ele("title").txt(e.title), e.link && i.ele("link").txt(e.link), i.ele("description").txt(e.description), e.language && i.ele("language").txt(e.language), e.copyright && i.ele("copyright").txt(e.copyright), e.webMaster && i.ele("webMaster").txt(e.webMaster), e.pubDate && i.ele("pubDate").txt(B(e.pubDate)), e.lastBuildDate && i.ele("lastBuildDate").txt(B(e.lastBuildDate)), e.links?.length) for (let t of e.links) {
|
|
464
459
|
let e = {
|
|
465
460
|
rel: t.rel,
|
|
466
461
|
href: t.href
|
|
467
462
|
};
|
|
468
|
-
t.type && (e.type = t.type), i.ele(
|
|
463
|
+
t.type && (e.type = t.type), i.ele(We, "link", e);
|
|
469
464
|
}
|
|
470
|
-
e.isArchive && i.ele(
|
|
471
|
-
let a = new Set(
|
|
465
|
+
e.isArchive && i.ele(Ge, "archive");
|
|
466
|
+
let a = new Set(z);
|
|
472
467
|
for (let t of e.items) {
|
|
473
468
|
let e = i.ele("item"), r = /* @__PURE__ */ new Set();
|
|
474
|
-
for (let i of
|
|
475
|
-
let o = Object.keys(t).filter((e) => !r.has(e) && !a.has(e) && !e.startsWith("_") && !
|
|
476
|
-
for (let r of o)
|
|
469
|
+
for (let i of z) i in t && (Ue(e, i, t[i], t, n), r.add(i));
|
|
470
|
+
let o = Object.keys(t).filter((e) => !r.has(e) && !a.has(e) && !e.startsWith("_") && !Ne(e, t)).sort();
|
|
471
|
+
for (let r of o) Ue(e, r, t[r], t, n);
|
|
477
472
|
}
|
|
478
473
|
return t.end({ prettyPrint: !0 });
|
|
479
474
|
}
|
|
480
475
|
//#endregion
|
|
481
476
|
//#region src/cache/types.ts
|
|
482
|
-
function
|
|
477
|
+
function G(e, t, n) {
|
|
483
478
|
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}`;
|
|
484
479
|
}
|
|
485
480
|
//#endregion
|
|
486
481
|
//#region src/utils/etag.ts
|
|
487
|
-
function
|
|
488
|
-
return `"${
|
|
482
|
+
function qe(e) {
|
|
483
|
+
return `"${de("md5").update(e).digest("hex").substring(0, 16)}"`;
|
|
489
484
|
}
|
|
490
|
-
function
|
|
491
|
-
return
|
|
485
|
+
function Je(e, t, n, r) {
|
|
486
|
+
return qe(`${e}-${t}-${n}-${r}`);
|
|
492
487
|
}
|
|
493
|
-
function
|
|
488
|
+
function Ye(e, t) {
|
|
494
489
|
let n = (e) => e.replace(/^"|"$/g, "");
|
|
495
490
|
return n(e) === n(t);
|
|
496
491
|
}
|
|
497
|
-
function
|
|
492
|
+
function Xe(e) {
|
|
498
493
|
return e ? e.split(",").map((e) => e.trim()).filter((e) => e.length > 0) : [];
|
|
499
494
|
}
|
|
500
|
-
function
|
|
501
|
-
let n =
|
|
502
|
-
return n.length === 0 ? !1 : n.includes("*") ? !0 : n.some((e) =>
|
|
495
|
+
function Ze(e, t) {
|
|
496
|
+
let n = Xe(e);
|
|
497
|
+
return n.length === 0 ? !1 : n.includes("*") ? !0 : n.some((e) => Ye(e, t));
|
|
503
498
|
}
|
|
504
499
|
//#endregion
|
|
505
500
|
//#region src/cache/MemoryCache.ts
|
|
506
|
-
var
|
|
501
|
+
var Qe = class {
|
|
507
502
|
feedContentCache = /* @__PURE__ */ new Map();
|
|
508
503
|
imageMetadataCache = /* @__PURE__ */ new Map();
|
|
509
504
|
config;
|
|
@@ -511,14 +506,14 @@ var Ye = class {
|
|
|
511
506
|
this.config = e;
|
|
512
507
|
}
|
|
513
508
|
getFeedContent(e, t, n) {
|
|
514
|
-
let r =
|
|
509
|
+
let r = G(e, t, n), i = this.feedContentCache.get(r);
|
|
515
510
|
return i ? Math.floor(Date.now() / 1e3) > i.expiresAt ? (this.feedContentCache.delete(r), null) : i : null;
|
|
516
511
|
}
|
|
517
512
|
setFeedContent(e, t, n, r, i, a) {
|
|
518
|
-
let o =
|
|
513
|
+
let o = G(e, t, i), s = Math.floor(Date.now() / 1e3), c = s + (a ?? this.config.ttl), l = {
|
|
519
514
|
content: n,
|
|
520
515
|
contentType: r,
|
|
521
|
-
etag:
|
|
516
|
+
etag: Je(e, t, s, n.length),
|
|
522
517
|
lastModified: s,
|
|
523
518
|
expiresAt: c
|
|
524
519
|
};
|
|
@@ -556,7 +551,7 @@ var Ye = class {
|
|
|
556
551
|
imageMetadataCount: this.imageMetadataCache.size
|
|
557
552
|
};
|
|
558
553
|
}
|
|
559
|
-
},
|
|
554
|
+
}, $e = class {
|
|
560
555
|
cacheDir;
|
|
561
556
|
config;
|
|
562
557
|
constructor(e) {
|
|
@@ -566,30 +561,30 @@ var Ye = class {
|
|
|
566
561
|
}
|
|
567
562
|
async ensureCacheDir() {
|
|
568
563
|
try {
|
|
569
|
-
await
|
|
564
|
+
await C.mkdir(this.cacheDir, { recursive: !0 });
|
|
570
565
|
} catch (e) {
|
|
571
566
|
if (e.code !== "EEXIST") throw e;
|
|
572
567
|
}
|
|
573
568
|
}
|
|
574
569
|
getFeedContentPath(e, t, n) {
|
|
575
|
-
let r =
|
|
576
|
-
return
|
|
570
|
+
let r = G(e, t, n).replace(/:/g, "-");
|
|
571
|
+
return w(this.cacheDir, `${r}.json`);
|
|
577
572
|
}
|
|
578
573
|
getImageMetadataPath(e) {
|
|
579
|
-
let t =
|
|
580
|
-
return
|
|
574
|
+
let t = w(this.cacheDir, "image-metadata");
|
|
575
|
+
return w(t, `${e}.json`);
|
|
581
576
|
}
|
|
582
577
|
async ensureImageMetadataDir() {
|
|
583
578
|
try {
|
|
584
|
-
let e =
|
|
585
|
-
await
|
|
579
|
+
let e = w(this.cacheDir, "image-metadata");
|
|
580
|
+
await C.mkdir(e, { recursive: !0 });
|
|
586
581
|
} catch (e) {
|
|
587
582
|
if (e.code !== "EEXIST") throw e;
|
|
588
583
|
}
|
|
589
584
|
}
|
|
590
585
|
async getFeedContent(e, t, n) {
|
|
591
586
|
try {
|
|
592
|
-
let r = this.getFeedContentPath(e, t, n), i = await
|
|
587
|
+
let r = this.getFeedContentPath(e, t, n), i = await C.readFile(r, "utf-8"), a = JSON.parse(i);
|
|
593
588
|
return Math.floor(Date.now() / 1e3) > a.expiresAt ? (await this.clearFeedContent(e, t, n), null) : a;
|
|
594
589
|
} catch (n) {
|
|
595
590
|
return n.code === "ENOENT" || console.error(`Error reading feed content cache for ${e}:${t}:`, n), null;
|
|
@@ -599,7 +594,7 @@ var Ye = class {
|
|
|
599
594
|
try {
|
|
600
595
|
await this.ensureCacheDir();
|
|
601
596
|
let i = this.getFeedContentPath(e, t, r);
|
|
602
|
-
await
|
|
597
|
+
await C.writeFile(i, JSON.stringify(n, null, 2), "utf-8");
|
|
603
598
|
} catch (n) {
|
|
604
599
|
console.error(`Error writing feed content cache for ${e}:${t}:`, n);
|
|
605
600
|
}
|
|
@@ -607,22 +602,22 @@ var Ye = class {
|
|
|
607
602
|
async clearFeedContent(e, t, n) {
|
|
608
603
|
try {
|
|
609
604
|
let r = this.getFeedContentPath(e, t, n);
|
|
610
|
-
await
|
|
605
|
+
await C.unlink(r);
|
|
611
606
|
} catch (n) {
|
|
612
607
|
n.code !== "ENOENT" && console.error(`Error clearing feed content cache for ${e}:${t}:`, n);
|
|
613
608
|
}
|
|
614
609
|
}
|
|
615
610
|
async clearAllContentCache(e) {
|
|
616
611
|
try {
|
|
617
|
-
let t = await
|
|
618
|
-
for (let r of t) r.startsWith(n) && r.endsWith(".json") && r !== `${e}.json` && await
|
|
612
|
+
let t = await C.readdir(this.cacheDir), n = `${e}-`;
|
|
613
|
+
for (let r of t) r.startsWith(n) && r.endsWith(".json") && r !== `${e}.json` && await C.unlink(w(this.cacheDir, r));
|
|
619
614
|
} catch (t) {
|
|
620
615
|
console.error(`Error clearing all content cache for ${e}:`, t);
|
|
621
616
|
}
|
|
622
617
|
}
|
|
623
618
|
async getImageMetadata(e) {
|
|
624
619
|
try {
|
|
625
|
-
let t = this.getImageMetadataPath(e), n = await
|
|
620
|
+
let t = this.getImageMetadataPath(e), n = await C.readFile(t, "utf-8"), r = JSON.parse(n);
|
|
626
621
|
return Math.floor(Date.now() / 1e3) > r.expiresAt ? (await this.clearImageMetadata(e), null) : r.metadata;
|
|
627
622
|
} catch (t) {
|
|
628
623
|
return t.code === "ENOENT" || console.error(`Error reading image metadata cache for ${e}:`, t), null;
|
|
@@ -636,7 +631,7 @@ var Ye = class {
|
|
|
636
631
|
cachedAt: r,
|
|
637
632
|
expiresAt: r + (this.config.imageMetadata?.ttl || 604800)
|
|
638
633
|
};
|
|
639
|
-
await
|
|
634
|
+
await C.writeFile(n, JSON.stringify(i, null, 2), "utf-8");
|
|
640
635
|
} catch (t) {
|
|
641
636
|
console.error(`Error writing image metadata cache for ${e}:`, t);
|
|
642
637
|
}
|
|
@@ -644,25 +639,25 @@ var Ye = class {
|
|
|
644
639
|
async clearImageMetadata(e) {
|
|
645
640
|
try {
|
|
646
641
|
let t = this.getImageMetadataPath(e);
|
|
647
|
-
await
|
|
642
|
+
await C.unlink(t);
|
|
648
643
|
} catch (t) {
|
|
649
644
|
t.code !== "ENOENT" && console.error(`Error clearing image metadata cache for ${e}:`, t);
|
|
650
645
|
}
|
|
651
646
|
}
|
|
652
647
|
async clearAll() {
|
|
653
648
|
try {
|
|
654
|
-
let e = await
|
|
655
|
-
for (let t of e) t.endsWith(".json") && t.includes("-") && await
|
|
656
|
-
let t =
|
|
649
|
+
let e = await C.readdir(this.cacheDir);
|
|
650
|
+
for (let t of e) t.endsWith(".json") && t.includes("-") && await C.unlink(w(this.cacheDir, t));
|
|
651
|
+
let t = w(this.cacheDir, "image-metadata");
|
|
657
652
|
try {
|
|
658
|
-
let e = await
|
|
659
|
-
for (let n of e) n.endsWith(".json") && await
|
|
653
|
+
let e = await C.readdir(t);
|
|
654
|
+
for (let n of e) n.endsWith(".json") && await C.unlink(w(t, n));
|
|
660
655
|
} catch {}
|
|
661
656
|
} catch (e) {
|
|
662
657
|
console.error("Error clearing all caches:", e);
|
|
663
658
|
}
|
|
664
659
|
}
|
|
665
|
-
},
|
|
660
|
+
}, et = class {
|
|
666
661
|
memoryCache;
|
|
667
662
|
fileCache;
|
|
668
663
|
config;
|
|
@@ -673,7 +668,7 @@ var Ye = class {
|
|
|
673
668
|
errors: 0
|
|
674
669
|
};
|
|
675
670
|
constructor(e) {
|
|
676
|
-
this.config = e, this.memoryCache = new
|
|
671
|
+
this.config = e, this.memoryCache = new Qe(e), this.fileCache = new $e(e);
|
|
677
672
|
}
|
|
678
673
|
async getFeedContent(e, t, n) {
|
|
679
674
|
if (!this.config.enabled) return null;
|
|
@@ -739,7 +734,7 @@ var Ye = class {
|
|
|
739
734
|
};
|
|
740
735
|
//#endregion
|
|
741
736
|
//#region src/cache/config.ts
|
|
742
|
-
function
|
|
737
|
+
function K() {
|
|
743
738
|
let t = parseInt(process.env.CACHE_TTL || "3600", 10), n = process.env.CACHE_DIR || "./cache", r = process.env.CACHE_ENABLED === "false" || process.env.CACHE_ENABLED === "0" || process.env.CACHE_ENABLED === "no" || process.env.CACHE_ENABLED === "off", i = process.env.CACHE_ENABLED === "true" || process.env.CACHE_ENABLED === "1" || process.env.CACHE_ENABLED === "yes", a = process.env.NODE_ENV === "development", o;
|
|
744
739
|
o = r ? !1 : i ? !0 : !a;
|
|
745
740
|
let c = process.env.CACHE_BACKGROUND_REFRESH === "true", l = parseInt(process.env.CACHE_REFRESH_INTERVAL || "300", 10);
|
|
@@ -763,7 +758,7 @@ function J() {
|
|
|
763
758
|
}
|
|
764
759
|
//#endregion
|
|
765
760
|
//#region src/services/arweaveImageService.ts
|
|
766
|
-
var
|
|
761
|
+
var tt = class {
|
|
767
762
|
config;
|
|
768
763
|
constructor(e) {
|
|
769
764
|
this.config = e;
|
|
@@ -853,7 +848,7 @@ var Qe = class {
|
|
|
853
848
|
}
|
|
854
849
|
extractImageDimensions(e, t) {
|
|
855
850
|
try {
|
|
856
|
-
let t =
|
|
851
|
+
let t = fe(e);
|
|
857
852
|
if (t.width && t.height) return {
|
|
858
853
|
width: t.width,
|
|
859
854
|
height: t.height
|
|
@@ -875,7 +870,7 @@ var Qe = class {
|
|
|
875
870
|
}
|
|
876
871
|
}
|
|
877
872
|
try {
|
|
878
|
-
let e =
|
|
873
|
+
let e = fe(t);
|
|
879
874
|
if (e.type) return e.type.toLowerCase();
|
|
880
875
|
} catch {}
|
|
881
876
|
}
|
|
@@ -894,28 +889,28 @@ var Qe = class {
|
|
|
894
889
|
};
|
|
895
890
|
//#endregion
|
|
896
891
|
//#region src/pickFeedItemRichText.ts
|
|
897
|
-
function
|
|
892
|
+
function q(e, t) {
|
|
898
893
|
for (let n of t) {
|
|
899
894
|
let t = e[n];
|
|
900
895
|
if (typeof t == "string" && t.trim() !== "") return t;
|
|
901
896
|
}
|
|
902
897
|
return "";
|
|
903
898
|
}
|
|
904
|
-
var
|
|
899
|
+
var nt = [
|
|
905
900
|
"summary",
|
|
906
901
|
"Summary",
|
|
907
902
|
"description",
|
|
908
903
|
"Description",
|
|
909
904
|
"text",
|
|
910
905
|
"Text"
|
|
911
|
-
],
|
|
906
|
+
], rt = [
|
|
912
907
|
"html",
|
|
913
908
|
"Html",
|
|
914
909
|
"body",
|
|
915
910
|
"Body",
|
|
916
911
|
"content",
|
|
917
912
|
"Content"
|
|
918
|
-
],
|
|
913
|
+
], it = [
|
|
919
914
|
"summary",
|
|
920
915
|
"Summary",
|
|
921
916
|
"description",
|
|
@@ -923,16 +918,16 @@ var $e = [
|
|
|
923
918
|
"text",
|
|
924
919
|
"Text"
|
|
925
920
|
];
|
|
926
|
-
function
|
|
921
|
+
function at(e, t) {
|
|
927
922
|
let n = b(e.model) - b(t.model);
|
|
928
923
|
if (n !== 0) return n;
|
|
929
924
|
let r = e.key.localeCompare(t.key);
|
|
930
925
|
return r === 0 ? e.index - t.index : r;
|
|
931
926
|
}
|
|
932
|
-
function
|
|
933
|
-
let t =
|
|
927
|
+
function ot(e) {
|
|
928
|
+
let t = te(e), n = ne(e), r = null;
|
|
934
929
|
if (t) for (let [n, i] of Object.entries(t)) {
|
|
935
|
-
if (!
|
|
930
|
+
if (!x(i)) continue;
|
|
936
931
|
let t = e[n];
|
|
937
932
|
if (typeof t != "string" || t.trim() === "") continue;
|
|
938
933
|
let a = {
|
|
@@ -941,7 +936,7 @@ function rt(e) {
|
|
|
941
936
|
index: 0,
|
|
942
937
|
value: t
|
|
943
938
|
};
|
|
944
|
-
(!r ||
|
|
939
|
+
(!r || at(a, r) < 0) && (r = a);
|
|
945
940
|
}
|
|
946
941
|
if (n) for (let [t, i] of Object.entries(n)) {
|
|
947
942
|
let n = e[t];
|
|
@@ -949,7 +944,7 @@ function rt(e) {
|
|
|
949
944
|
let a = Math.min(i.length, n.length);
|
|
950
945
|
for (let e = 0; e < a; e++) {
|
|
951
946
|
let a = i[e];
|
|
952
|
-
if (!
|
|
947
|
+
if (!x(a)) continue;
|
|
953
948
|
let o = n[e];
|
|
954
949
|
if (typeof o != "string" || o.trim() === "") continue;
|
|
955
950
|
let s = {
|
|
@@ -958,83 +953,83 @@ function rt(e) {
|
|
|
958
953
|
index: e,
|
|
959
954
|
value: o
|
|
960
955
|
};
|
|
961
|
-
(!r ||
|
|
956
|
+
(!r || at(s, r) < 0) && (r = s);
|
|
962
957
|
}
|
|
963
958
|
}
|
|
964
959
|
return r?.value ?? "";
|
|
965
960
|
}
|
|
966
|
-
function
|
|
967
|
-
return
|
|
961
|
+
function st(e) {
|
|
962
|
+
return q(e, nt);
|
|
968
963
|
}
|
|
969
|
-
function
|
|
970
|
-
let t =
|
|
964
|
+
function ct(e) {
|
|
965
|
+
let t = ot(e);
|
|
971
966
|
if (t !== "") return t;
|
|
972
|
-
let n =
|
|
973
|
-
return n === "" ?
|
|
967
|
+
let n = q(e, rt);
|
|
968
|
+
return n === "" ? q(e, it) : n;
|
|
974
969
|
}
|
|
975
|
-
function
|
|
970
|
+
function J(e) {
|
|
976
971
|
return typeof e == "string" && e.includes("data:image/") && e.includes(";base64,");
|
|
977
972
|
}
|
|
978
|
-
function
|
|
979
|
-
let t =
|
|
973
|
+
function lt(e) {
|
|
974
|
+
let t = te(e);
|
|
980
975
|
if (t) {
|
|
981
|
-
for (let [n, r] of Object.entries(t)) if (
|
|
976
|
+
for (let [n, r] of Object.entries(t)) if (x(r) && J(e[n])) return !0;
|
|
982
977
|
}
|
|
983
|
-
let n =
|
|
978
|
+
let n = ne(e);
|
|
984
979
|
if (n) for (let [t, r] of Object.entries(n)) {
|
|
985
980
|
let n = e[t];
|
|
986
981
|
if (!Array.isArray(n)) continue;
|
|
987
982
|
let i = Math.min(r.length, n.length);
|
|
988
|
-
for (let e = 0; e < i; e++) if (
|
|
983
|
+
for (let e = 0; e < i; e++) if (x(r[e]) && J(n[e])) return !0;
|
|
989
984
|
}
|
|
990
985
|
return !1;
|
|
991
986
|
}
|
|
992
|
-
function
|
|
993
|
-
if (
|
|
994
|
-
for (let t of
|
|
995
|
-
for (let t of
|
|
987
|
+
function ut(e) {
|
|
988
|
+
if (lt(e)) return !0;
|
|
989
|
+
for (let t of rt) if (J(e[t])) return !0;
|
|
990
|
+
for (let t of nt) if (J(e[t])) return !0;
|
|
996
991
|
return !1;
|
|
997
992
|
}
|
|
998
|
-
function
|
|
999
|
-
return t === "include_items" ? [...e] : e.filter((e) => !
|
|
993
|
+
function dt(e, t = "omit_items") {
|
|
994
|
+
return t === "include_items" ? [...e] : e.filter((e) => !ut(e));
|
|
1000
995
|
}
|
|
1001
996
|
//#endregion
|
|
1002
997
|
//#region src/index.ts
|
|
1003
|
-
function
|
|
998
|
+
function ft(e) {
|
|
1004
999
|
return _(e)?.mediaUrl;
|
|
1005
1000
|
}
|
|
1006
|
-
function
|
|
1001
|
+
function Y(e) {
|
|
1007
1002
|
if (typeof e == "number" && Number.isFinite(e) && e > 0) return e;
|
|
1008
1003
|
if (typeof e == "string") {
|
|
1009
1004
|
let t = Number(e);
|
|
1010
1005
|
if (Number.isFinite(t) && t > 0) return t;
|
|
1011
1006
|
}
|
|
1012
1007
|
}
|
|
1013
|
-
function
|
|
1008
|
+
function pt(e) {
|
|
1014
1009
|
if (Array.isArray(e)) {
|
|
1015
1010
|
for (let t of e) {
|
|
1016
|
-
let e =
|
|
1011
|
+
let e = pt(t);
|
|
1017
1012
|
if (e) return e;
|
|
1018
1013
|
}
|
|
1019
1014
|
return;
|
|
1020
1015
|
}
|
|
1021
|
-
let t =
|
|
1016
|
+
let t = ft(e);
|
|
1022
1017
|
if (t) {
|
|
1023
1018
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
1024
1019
|
let n = e;
|
|
1025
1020
|
return {
|
|
1026
1021
|
url: t,
|
|
1027
1022
|
mimeType: typeof n.mimeType == "string" && n.mimeType || typeof n.type == "string" && n.type || typeof n.contentType == "string" && n.contentType || void 0,
|
|
1028
|
-
width:
|
|
1029
|
-
height:
|
|
1030
|
-
size:
|
|
1023
|
+
width: Y(n.width),
|
|
1024
|
+
height: Y(n.height),
|
|
1025
|
+
size: Y(n.size ?? n.fileSize),
|
|
1031
1026
|
format: typeof n.format == "string" ? n.format : void 0
|
|
1032
1027
|
};
|
|
1033
1028
|
}
|
|
1034
1029
|
return { url: t };
|
|
1035
1030
|
}
|
|
1036
1031
|
}
|
|
1037
|
-
function
|
|
1032
|
+
function mt(e) {
|
|
1038
1033
|
if (e._hasImage && e._imageMetadata && typeof e._imageMetadata == "object") {
|
|
1039
1034
|
let t = e._imageMetadata;
|
|
1040
1035
|
if (t.url) return {
|
|
@@ -1058,11 +1053,11 @@ function dt(e) {
|
|
|
1058
1053
|
"thumbnailImage"
|
|
1059
1054
|
]) {
|
|
1060
1055
|
if (!(t in e)) continue;
|
|
1061
|
-
let n =
|
|
1056
|
+
let n = pt(e[t]);
|
|
1062
1057
|
if (n) return n;
|
|
1063
1058
|
}
|
|
1064
1059
|
}
|
|
1065
|
-
function
|
|
1060
|
+
function ht(e, t, n, r, i, a) {
|
|
1066
1061
|
let o = n.mimeType || "image/jpeg";
|
|
1067
1062
|
e.enclosures = [{
|
|
1068
1063
|
url: n.url,
|
|
@@ -1098,14 +1093,14 @@ function ft(e, t, n, r, i, a) {
|
|
|
1098
1093
|
"media:description": l
|
|
1099
1094
|
}], 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}`);
|
|
1100
1095
|
}
|
|
1101
|
-
var
|
|
1102
|
-
function
|
|
1103
|
-
return
|
|
1096
|
+
var X = null;
|
|
1097
|
+
function gt() {
|
|
1098
|
+
return X ||= new et(K()), X;
|
|
1104
1099
|
}
|
|
1105
|
-
function
|
|
1106
|
-
|
|
1100
|
+
function _t() {
|
|
1101
|
+
X = null;
|
|
1107
1102
|
}
|
|
1108
|
-
async function
|
|
1103
|
+
async function vt(e, t, n) {
|
|
1109
1104
|
let r = e.filter((e) => e.storageTransactionId || e.storage_transaction_id);
|
|
1110
1105
|
if (r.length === 0) return e;
|
|
1111
1106
|
console.log(`Enriching ${r.length} items with image metadata`);
|
|
@@ -1127,10 +1122,10 @@ async function ht(e, t, n) {
|
|
|
1127
1122
|
return o.get(t) || e;
|
|
1128
1123
|
});
|
|
1129
1124
|
}
|
|
1130
|
-
function
|
|
1125
|
+
function yt(e, t) {
|
|
1131
1126
|
let { schemaName: n, siteUrl: r, itemUrlBase: i, itemUrlPath: a, richTextDataUriImages: o = "omit_items" } = t;
|
|
1132
|
-
return
|
|
1133
|
-
let t = e.id || e.seedUid || e.SeedUid || e.storageTransactionId || e.storage_transaction_id, o = i == null ? `${r}/${
|
|
1127
|
+
return dt(e, o).map((e) => {
|
|
1128
|
+
let t = e.id || e.seedUid || e.SeedUid || e.storageTransactionId || e.storage_transaction_id, o = i == null ? `${r}/${S(n)}/${t}` : `${i.replace(/\/$/, "")}/${(a ?? "attestation/view").replace(/^\//, "")}/${t}`, s = e.link || e.Link || e.import_url || e.importUrl || o, c;
|
|
1134
1129
|
if (e.pubDate || e.PubDate) {
|
|
1135
1130
|
let t = e.pubDate || e.PubDate;
|
|
1136
1131
|
c = new Date(t);
|
|
@@ -1139,7 +1134,7 @@ function gt(e, t) {
|
|
|
1139
1134
|
let t = e.publishedAt || e.createdAt || e.updatedAt;
|
|
1140
1135
|
c = t && typeof t == "object" && t.constructor === Date ? t : new Date(t);
|
|
1141
1136
|
} else c = /* @__PURE__ */ new Date();
|
|
1142
|
-
let l =
|
|
1137
|
+
let l = st(e), u = ct(e), d = {
|
|
1143
1138
|
...e,
|
|
1144
1139
|
id: t,
|
|
1145
1140
|
title: e.title || e.Title || "Untitled",
|
|
@@ -1159,8 +1154,8 @@ function gt(e, t) {
|
|
|
1159
1154
|
}), d;
|
|
1160
1155
|
});
|
|
1161
1156
|
}
|
|
1162
|
-
var
|
|
1163
|
-
let l =
|
|
1157
|
+
var Z = (e, t, n, r, i, a, o, s, c) => {
|
|
1158
|
+
let l = A(c), u = S(t), d = `${l.feedUrl}/${u}/${n}`, f = r ? `${d}?v=${r}` : d, p = `${l.title} - ${bt(u)}`, m = /* @__PURE__ */ new Date(), h = j(), g = [];
|
|
1164
1159
|
if (i) {
|
|
1165
1160
|
let e = i.baseUrl.replace(/\?.*$/, ""), t = e.includes("?") ? "&" : "?";
|
|
1166
1161
|
i.hasNext && g.push({
|
|
@@ -1178,7 +1173,7 @@ var $ = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1178
1173
|
rel: e.rel,
|
|
1179
1174
|
href: e.href
|
|
1180
1175
|
});
|
|
1181
|
-
let _ =
|
|
1176
|
+
let _ = yt(e, {
|
|
1182
1177
|
schemaName: t,
|
|
1183
1178
|
siteUrl: l.siteUrl,
|
|
1184
1179
|
itemUrlBase: h.itemUrlBase,
|
|
@@ -1234,7 +1229,7 @@ var $ = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1234
1229
|
return t;
|
|
1235
1230
|
})
|
|
1236
1231
|
};
|
|
1237
|
-
return Promise.resolve(
|
|
1232
|
+
return Promise.resolve(ce(t));
|
|
1238
1233
|
}
|
|
1239
1234
|
case "json": {
|
|
1240
1235
|
let e = i?.hasNext ? `${i.baseUrl.replace(/\?.*$/, "")}?page=${i.page + 1}` : void 0, t = {
|
|
@@ -1263,7 +1258,7 @@ var $ = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1263
1258
|
}
|
|
1264
1259
|
return t;
|
|
1265
1260
|
})
|
|
1266
|
-
}, n =
|
|
1261
|
+
}, n = le(t);
|
|
1267
1262
|
return Promise.resolve(typeof n == "string" ? n : JSON.stringify(n));
|
|
1268
1263
|
}
|
|
1269
1264
|
default: {
|
|
@@ -1291,26 +1286,26 @@ var $ = (e, t, n, r, i, a, o, s, c) => {
|
|
|
1291
1286
|
value: e.id,
|
|
1292
1287
|
isPermaLink: typeof e.id == "string" && (e.id.startsWith("http://") || e.id.startsWith("https://"))
|
|
1293
1288
|
});
|
|
1294
|
-
let r =
|
|
1295
|
-
if (r &&
|
|
1289
|
+
let r = mt(e);
|
|
1290
|
+
if (r && ht(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), n.dc = {}, (e.date || e.pubDate) && (n.dc.date = e.date || e.pubDate), e.timeCreated) {
|
|
1296
1291
|
let t = /* @__PURE__ */ new Date(e.timeCreated * 1e3);
|
|
1297
1292
|
n.dc.dates || (n.dc.dates = []), n.dc.dates.push(t);
|
|
1298
1293
|
}
|
|
1299
1294
|
return (e.seedUid || e.SeedUid) && (n.dc.identifier || (n.dc.identifier = []), n.dc.identifier.push(e.seedUid || e.SeedUid)), (e.storageTransactionId || e.storage_transaction_id) && (n.dc.identifier || (n.dc.identifier = []), n.dc.identifier.push(e.storageTransactionId || e.storage_transaction_id)), (e.import_url || e.importUrl) && (n.dc.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;
|
|
1300
1295
|
})
|
|
1301
1296
|
};
|
|
1302
|
-
return Promise.resolve(
|
|
1297
|
+
return Promise.resolve(Ke(e));
|
|
1303
1298
|
}
|
|
1304
1299
|
}
|
|
1305
1300
|
};
|
|
1306
|
-
function
|
|
1301
|
+
function Q(e) {
|
|
1307
1302
|
switch (e) {
|
|
1308
1303
|
case "atom": return "application/atom+xml; charset=utf-8";
|
|
1309
1304
|
case "json": return "application/feed+json; charset=utf-8";
|
|
1310
1305
|
default: return "application/rss+xml; charset=utf-8";
|
|
1311
1306
|
}
|
|
1312
1307
|
}
|
|
1313
|
-
function
|
|
1308
|
+
function $(e) {
|
|
1314
1309
|
let t = e.toLowerCase();
|
|
1315
1310
|
return [
|
|
1316
1311
|
"rss",
|
|
@@ -1318,22 +1313,22 @@ function vt(e) {
|
|
|
1318
1313
|
"json"
|
|
1319
1314
|
].includes(t) ? t : null;
|
|
1320
1315
|
}
|
|
1321
|
-
function
|
|
1316
|
+
function bt(e) {
|
|
1322
1317
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1323
1318
|
}
|
|
1324
|
-
async function
|
|
1325
|
-
let o =
|
|
1319
|
+
async function xt(e, t, n, r, i, a) {
|
|
1320
|
+
let o = $(t);
|
|
1326
1321
|
if (!o) return new Response(JSON.stringify({ error: `Invalid feed format: ${t}` }), {
|
|
1327
1322
|
status: 400,
|
|
1328
1323
|
headers: { "Content-Type": "application/json" }
|
|
1329
1324
|
});
|
|
1330
|
-
let s =
|
|
1325
|
+
let s = S.singular(e.toLowerCase()), c = S(s), l = A(a), u = j(), d = Math.max(1, i ?? 1), f = u.pageSize, p = (d - 1) * f, m = d > 1 ? { page: d } : void 0;
|
|
1331
1326
|
console.log(`Schema name: ${s}`), console.log(`Collection name: ${c}`);
|
|
1332
|
-
let h =
|
|
1327
|
+
let h = gt(), g = K();
|
|
1333
1328
|
try {
|
|
1334
1329
|
if (g.enabled) {
|
|
1335
1330
|
let e = await h.getFeedContent(s, o, m);
|
|
1336
|
-
if (e) return n &&
|
|
1331
|
+
if (e) return n && Ze(n, e.etag) ? (console.log(`Cache hit with ETag match for ${s}:${o} - returning 304`), new Response(null, {
|
|
1337
1332
|
status: 304,
|
|
1338
1333
|
headers: {
|
|
1339
1334
|
ETag: e.etag,
|
|
@@ -1355,11 +1350,11 @@ async function bt(e, t, n, r, i, a) {
|
|
|
1355
1350
|
}
|
|
1356
1351
|
console.log(`Cache miss for ${s}:${o} - fetching items`);
|
|
1357
1352
|
let e = await (async () => {
|
|
1358
|
-
let e = await
|
|
1353
|
+
let e = await we(s, {
|
|
1359
1354
|
limit: f,
|
|
1360
1355
|
skip: p
|
|
1361
1356
|
});
|
|
1362
|
-
return console.log(`Found ${e.length} feed items for schema ${s}`), g.imageMetadata?.enabled ?
|
|
1357
|
+
return console.log(`Found ${e.length} feed items for schema ${s}`), g.imageMetadata?.enabled ? vt(e, new tt({
|
|
1363
1358
|
gateways: g.imageMetadata.gateways,
|
|
1364
1359
|
timeout: g.imageMetadata.timeout
|
|
1365
1360
|
}), h) : e;
|
|
@@ -1371,12 +1366,12 @@ async function bt(e, t, n, r, i, a) {
|
|
|
1371
1366
|
href: `${l.feedUrl}/${c}/archive/${t.getFullYear()}/${t.getMonth() + 1}/${o}`
|
|
1372
1367
|
});
|
|
1373
1368
|
}
|
|
1374
|
-
let _ = await
|
|
1369
|
+
let _ = await Z(e, s, o, r, {
|
|
1375
1370
|
page: d,
|
|
1376
1371
|
pageSize: f,
|
|
1377
1372
|
hasNext: i,
|
|
1378
1373
|
baseUrl: t
|
|
1379
|
-
}, u.length ? u : void 0, !1, void 0, a), v =
|
|
1374
|
+
}, u.length ? u : void 0, !1, void 0, a), v = Q(o);
|
|
1380
1375
|
if (g.enabled) {
|
|
1381
1376
|
await h.setFeedContent(s, o, _, v, m);
|
|
1382
1377
|
let e = await h.getFeedContent(s, o, m), t = e?.etag || "", n = e?.lastModified || Math.floor(Date.now() / 1e3);
|
|
@@ -1427,7 +1422,7 @@ async function bt(e, t, n, r, i, a) {
|
|
|
1427
1422
|
});
|
|
1428
1423
|
}
|
|
1429
1424
|
}
|
|
1430
|
-
async function
|
|
1425
|
+
async function St(e, t, n, r, i, a, o) {
|
|
1431
1426
|
if (t < 1970 || t > 2100) return new Response(JSON.stringify({ error: `Invalid year: ${t}` }), {
|
|
1432
1427
|
status: 400,
|
|
1433
1428
|
headers: { "Content-Type": "application/json" }
|
|
@@ -1436,19 +1431,19 @@ async function xt(e, t, n, r, i, a, o) {
|
|
|
1436
1431
|
status: 400,
|
|
1437
1432
|
headers: { "Content-Type": "application/json" }
|
|
1438
1433
|
});
|
|
1439
|
-
let s =
|
|
1434
|
+
let s = $(r);
|
|
1440
1435
|
if (!s) return new Response(JSON.stringify({ error: `Invalid feed format: ${r}` }), {
|
|
1441
1436
|
status: 400,
|
|
1442
1437
|
headers: { "Content-Type": "application/json" }
|
|
1443
1438
|
});
|
|
1444
|
-
let c =
|
|
1439
|
+
let c = S.singular(e.toLowerCase()), l = S(c), u = A(o), d = { archive: {
|
|
1445
1440
|
year: t,
|
|
1446
1441
|
month: n
|
|
1447
|
-
} }, f =
|
|
1442
|
+
} }, f = gt(), p = K();
|
|
1448
1443
|
try {
|
|
1449
1444
|
if (p.enabled) {
|
|
1450
1445
|
let e = await f.getFeedContent(c, s, d);
|
|
1451
|
-
if (e) return i &&
|
|
1446
|
+
if (e) return i && Ze(i, e.etag) ? new Response(null, {
|
|
1452
1447
|
status: 304,
|
|
1453
1448
|
headers: {
|
|
1454
1449
|
ETag: e.etag,
|
|
@@ -1468,7 +1463,7 @@ async function xt(e, t, n, r, i, a, o) {
|
|
|
1468
1463
|
}
|
|
1469
1464
|
});
|
|
1470
1465
|
}
|
|
1471
|
-
let e = await
|
|
1466
|
+
let e = await Te(c, t, n), r = `${u.feedUrl}/${l}/${s}`, m = `${u.feedUrl}/${l}/archive`, h = [{
|
|
1472
1467
|
rel: "prev-archive",
|
|
1473
1468
|
href: `${m}/${n === 1 ? t - 1 : t}/${n === 1 ? 12 : n - 1}/${s}`
|
|
1474
1469
|
}, {
|
|
@@ -1479,7 +1474,7 @@ async function xt(e, t, n, r, i, a, o) {
|
|
|
1479
1474
|
rel: "next-archive",
|
|
1480
1475
|
href: `${m}/${g}/${_}/${s}`
|
|
1481
1476
|
});
|
|
1482
|
-
let y = await
|
|
1477
|
+
let y = await Z(e, c, s, a, void 0, h, !0, void 0, o), b = Q(s);
|
|
1483
1478
|
if (p.enabled) {
|
|
1484
1479
|
await f.setFeedContent(c, s, y, b, d);
|
|
1485
1480
|
let e = await f.getFeedContent(c, s, d), t = e?.etag || "", n = e?.lastModified || Math.floor(Date.now() / 1e3);
|
|
@@ -1516,6 +1511,6 @@ async function xt(e, t, n, r, i, a, o) {
|
|
|
1516
1511
|
}
|
|
1517
1512
|
}
|
|
1518
1513
|
//#endregion
|
|
1519
|
-
export { t as DEFAULT_ARWEAVE_HOST,
|
|
1514
|
+
export { t as DEFAULT_ARWEAVE_HOST, D as DEFAULT_SITE_CONFIG, v as FEED_RICH_BODY_STORAGE_SCHEMAS, r as SEED_RSS_IMAGE_RELATION_FIELD_KEYS, i as classifyMediaRef, Z as createFeed, y as enrichImageSeedCloneForFeed, ut as feedItemRichTextContainsDataUriImage, dt as filterItemsByRichTextDataUriImagePolicy, he as getClient, c as getFeedItemStringField, we as getFeedItemsBySchemaName, Te as getFeedItemsBySchemaNameForMonth, _e as getSiteConfig, St as handleArchiveFeedRequest, xt as handleFeedRequest, E as initializeFeedPlatform, me as initializeSeedClient, l as isEasAttestationExplorerUrl, x as isFeedRichBodyStorageSchema, j as loadFeedConfig, d as normalizeFeedItemFields, Oe as parseRssString, ct as pickFeedItemContent, st as pickFeedItemDescription, _t as resetCacheManager, ye as resetSiteConfig, h as resolveSeedRssImageRelationFromItem, g as resolveSeedRssImageRelationRef, A as resolveSiteConfig, ve as setSiteConfig, ge as teardownSeedClient };
|
|
1520
1515
|
|
|
1521
1516
|
//# sourceMappingURL=index.js.map
|