@geekity/cms 0.15.0 → 0.17.0

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.
Files changed (147) hide show
  1. package/README.md +108 -0
  2. package/admin/pages/documents/editor.njk +51 -0
  3. package/admin/pages/documents/syndication.njk +110 -0
  4. package/admin/pages/federation/followers.njk +7 -0
  5. package/admin/pages/users/activity-entry.njk +58 -0
  6. package/admin/pages/users/activity.njk +66 -0
  7. package/admin/static/admin.css +11 -0
  8. package/dist/admin/documents.d.ts +101 -0
  9. package/dist/admin/documents.d.ts.map +1 -1
  10. package/dist/admin/documents.js +199 -67
  11. package/dist/admin/documents.js.map +1 -1
  12. package/dist/admin/federation.d.ts +15 -0
  13. package/dist/admin/federation.d.ts.map +1 -1
  14. package/dist/admin/federation.js +19 -0
  15. package/dist/admin/federation.js.map +1 -1
  16. package/dist/admin/menu.d.ts.map +1 -1
  17. package/dist/admin/menu.js +7 -1
  18. package/dist/admin/menu.js.map +1 -1
  19. package/dist/admin/photo-field.d.ts +39 -0
  20. package/dist/admin/photo-field.d.ts.map +1 -0
  21. package/dist/admin/photo-field.js +91 -0
  22. package/dist/admin/photo-field.js.map +1 -0
  23. package/dist/admin/preview.d.ts.map +1 -1
  24. package/dist/admin/preview.js +6 -1
  25. package/dist/admin/preview.js.map +1 -1
  26. package/dist/admin/routes.d.ts.map +1 -1
  27. package/dist/admin/routes.js +8 -0
  28. package/dist/admin/routes.js.map +1 -1
  29. package/dist/admin/syndication-targets.d.ts +57 -0
  30. package/dist/admin/syndication-targets.d.ts.map +1 -0
  31. package/dist/admin/syndication-targets.js +266 -0
  32. package/dist/admin/syndication-targets.js.map +1 -0
  33. package/dist/admin/templates.d.ts +3 -0
  34. package/dist/admin/templates.d.ts.map +1 -1
  35. package/dist/admin/templates.js +3 -0
  36. package/dist/admin/templates.js.map +1 -1
  37. package/dist/admin/uploads.d.ts +6 -0
  38. package/dist/admin/uploads.d.ts.map +1 -1
  39. package/dist/admin/uploads.js +1 -1
  40. package/dist/admin/uploads.js.map +1 -1
  41. package/dist/admin/users.d.ts +8 -0
  42. package/dist/admin/users.d.ts.map +1 -1
  43. package/dist/admin/users.js +8 -0
  44. package/dist/admin/users.js.map +1 -1
  45. package/dist/content/citation.d.ts +36 -0
  46. package/dist/content/citation.d.ts.map +1 -0
  47. package/dist/content/citation.js +31 -0
  48. package/dist/content/citation.js.map +1 -0
  49. package/dist/content/index.d.ts +2 -0
  50. package/dist/content/index.d.ts.map +1 -1
  51. package/dist/content/index.js +1 -0
  52. package/dist/content/index.js.map +1 -1
  53. package/dist/content/photo.d.ts +45 -0
  54. package/dist/content/photo.d.ts.map +1 -0
  55. package/dist/content/photo.js +55 -0
  56. package/dist/content/photo.js.map +1 -0
  57. package/dist/content/post-type.d.ts +20 -8
  58. package/dist/content/post-type.d.ts.map +1 -1
  59. package/dist/content/post-type.js +17 -0
  60. package/dist/content/post-type.js.map +1 -1
  61. package/dist/env.d.ts +7 -0
  62. package/dist/env.d.ts.map +1 -1
  63. package/dist/federation/article.d.ts.map +1 -1
  64. package/dist/federation/article.js +59 -5
  65. package/dist/federation/article.js.map +1 -1
  66. package/dist/federation/citations.d.ts +38 -0
  67. package/dist/federation/citations.d.ts.map +1 -0
  68. package/dist/federation/citations.js +98 -0
  69. package/dist/federation/citations.js.map +1 -0
  70. package/dist/federation/delivery.d.ts.map +1 -1
  71. package/dist/federation/delivery.js +79 -31
  72. package/dist/federation/delivery.js.map +1 -1
  73. package/dist/images/alt-text.d.ts +6 -0
  74. package/dist/images/alt-text.d.ts.map +1 -1
  75. package/dist/images/alt-text.js +10 -0
  76. package/dist/images/alt-text.js.map +1 -1
  77. package/dist/index.d.ts +4 -4
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +25 -2
  80. package/dist/index.js.map +1 -1
  81. package/dist/indieauth/activity-log.d.ts +112 -0
  82. package/dist/indieauth/activity-log.d.ts.map +1 -0
  83. package/dist/indieauth/activity-log.js +325 -0
  84. package/dist/indieauth/activity-log.js.map +1 -0
  85. package/dist/indieauth/app-activity.d.ts +14 -0
  86. package/dist/indieauth/app-activity.d.ts.map +1 -0
  87. package/dist/indieauth/app-activity.js +106 -0
  88. package/dist/indieauth/app-activity.js.map +1 -0
  89. package/dist/indieauth/bearer.d.ts +6 -1
  90. package/dist/indieauth/bearer.d.ts.map +1 -1
  91. package/dist/indieauth/bearer.js +40 -12
  92. package/dist/indieauth/bearer.js.map +1 -1
  93. package/dist/indieauth/consent.d.ts.map +1 -1
  94. package/dist/indieauth/consent.js +5 -2
  95. package/dist/indieauth/consent.js.map +1 -1
  96. package/dist/indieauth/discovery.d.ts +10 -4
  97. package/dist/indieauth/discovery.d.ts.map +1 -1
  98. package/dist/indieauth/discovery.js +22 -7
  99. package/dist/indieauth/discovery.js.map +1 -1
  100. package/dist/indieauth/token.d.ts.map +1 -1
  101. package/dist/indieauth/token.js +3 -1
  102. package/dist/indieauth/token.js.map +1 -1
  103. package/dist/micropub/create.d.ts +56 -0
  104. package/dist/micropub/create.d.ts.map +1 -0
  105. package/dist/micropub/create.js +200 -0
  106. package/dist/micropub/create.js.map +1 -0
  107. package/dist/micropub/endpoint.d.ts +21 -0
  108. package/dist/micropub/endpoint.d.ts.map +1 -0
  109. package/dist/micropub/endpoint.js +354 -0
  110. package/dist/micropub/endpoint.js.map +1 -0
  111. package/dist/micropub/media.d.ts +14 -0
  112. package/dist/micropub/media.d.ts.map +1 -0
  113. package/dist/micropub/media.js +94 -0
  114. package/dist/micropub/media.js.map +1 -0
  115. package/dist/micropub/update.d.ts +44 -0
  116. package/dist/micropub/update.d.ts.map +1 -0
  117. package/dist/micropub/update.js +133 -0
  118. package/dist/micropub/update.js.map +1 -0
  119. package/dist/web/context.d.ts +42 -3
  120. package/dist/web/context.d.ts.map +1 -1
  121. package/dist/web/context.js +41 -1
  122. package/dist/web/context.js.map +1 -1
  123. package/dist/web/render.d.ts +15 -0
  124. package/dist/web/render.d.ts.map +1 -1
  125. package/dist/web/render.js +16 -0
  126. package/dist/web/render.js.map +1 -1
  127. package/dist/web/routes.js +2 -2
  128. package/dist/webmention/index.d.ts +2 -0
  129. package/dist/webmention/index.d.ts.map +1 -1
  130. package/dist/webmention/index.js +1 -0
  131. package/dist/webmention/index.js.map +1 -1
  132. package/dist/webmention/service.d.ts.map +1 -1
  133. package/dist/webmention/service.js +96 -18
  134. package/dist/webmention/service.js.map +1 -1
  135. package/dist/webmention/syndication.d.ts +135 -0
  136. package/dist/webmention/syndication.d.ts.map +1 -0
  137. package/dist/webmention/syndication.js +337 -0
  138. package/dist/webmention/syndication.js.map +1 -0
  139. package/package.json +1 -1
  140. package/themes/default/README.md +40 -9
  141. package/themes/default/layouts/post.njk +19 -6
  142. package/themes/default/partials/citations.njk +17 -0
  143. package/themes/default/partials/jsonld.njk +12 -1
  144. package/themes/default/partials/photos.njk +10 -0
  145. package/themes/default/partials/post-list.njk +7 -0
  146. package/themes/default/src/style.css +9 -0
  147. package/themes/default/static/style.css +16 -0
@@ -1,10 +1,12 @@
1
1
  import { readSiteSettings } from '../admin/settings.js';
2
+ import { citationsOf } from '../content/citation.js';
2
3
  import { replyTarget } from '../content/post-type.js';
3
4
  import { isFederatedDocument } from '../federation/article.js';
4
5
  import { absoluteUrl } from '../web/negotiate.js';
5
6
  import { discoverEndpoint, WEBMENTION_USER_AGENT } from './discovery.js';
6
7
  import { externalLinks, externalTarget } from './links.js';
7
8
  import { verifyWebmention } from './receive.js';
9
+ import { selectedTargets, syndicationCopies, syndicationTargetsReader } from './syndication.js';
8
10
  /**
9
11
  * Telling the pages a post links to that it links to them.
10
12
  *
@@ -51,13 +53,22 @@ export function createWebmentionService(options) {
51
53
  function sending() {
52
54
  return readSiteSettings(config.contentDir).webmentionsSend;
53
55
  }
54
- /** Tell one page about one post, and answer with what happened. */
56
+ const targets = syndicationTargetsReader(config.contentDir);
57
+ const copies = syndicationCopies(config.contentDir);
58
+ /** The language a post that names none is in, as the file says now. */
59
+ function siteLanguage() {
60
+ return readSiteSettings(config.contentDir).language;
61
+ }
62
+ /**
63
+ * Tell one page about one post, and answer with what happened and, when the
64
+ * page made a copy of the post, where the copy is.
65
+ */
55
66
  async function tell(slug, source, target) {
56
67
  const endpoint = await discoverEndpoint(target);
57
68
  if (endpoint === undefined) {
58
69
  // Not a failure: most of the web takes no webmentions, and recording it
59
70
  // is what tells a person why nothing went.
60
- return record(slug, source, target, null, 'none', null);
71
+ return { sent: record(slug, source, target, null, 'none', null) };
61
72
  }
62
73
  try {
63
74
  const response = await fetch(endpoint, {
@@ -73,27 +84,55 @@ export function createWebmentionService(options) {
73
84
  if (!response.ok) {
74
85
  const error = `${endpoint} answered ${String(response.status)}`;
75
86
  logger.warn(`Could not send a webmention for ${source}: ${error}`);
76
- return record(slug, source, target, endpoint, 'failed', error);
87
+ return { sent: record(slug, source, target, endpoint, 'failed', error) };
77
88
  }
78
- return record(slug, source, target, endpoint, 'sent', null);
89
+ return {
90
+ sent: record(slug, source, target, endpoint, 'sent', null),
91
+ copy: copyOf(response, endpoint),
92
+ };
79
93
  }
80
94
  catch (thrown) {
81
95
  const error = messageOf(thrown);
82
96
  logger.warn(`Could not send a webmention for ${source}: ${error}`);
83
- return record(slug, source, target, endpoint, 'failed', error);
97
+ return { sent: record(slug, source, target, endpoint, 'failed', error) };
84
98
  }
85
99
  }
86
100
  /** Write one outcome down. */
87
101
  function record(slug, source, target, endpoint, status, error) {
88
102
  return admin.recordSentWebmention({ slug, source, target, endpoint, status, error });
89
103
  }
104
+ /** The URLs of the targets a version of a post selects. */
105
+ function selectedUrls(document) {
106
+ if (document === undefined)
107
+ return [];
108
+ return selectedTargets(document, targets(), siteLanguage()).map((target) => target.url);
109
+ }
90
110
  /** Tell every one of a post's targets, one after another. */
91
- async function tellAll(slug, source, targets) {
111
+ async function tellAll(slug, source, links) {
92
112
  const outcomes = [];
93
- for (const target of targets)
113
+ for (const target of links)
94
114
  outcomes.push(await tell(slug, source, target));
95
115
  return outcomes;
96
116
  }
117
+ /**
118
+ * Bring the post's recorded copies in line with what was just sent
119
+ * (decision-26): a target the post selects keeps the copy it answered with,
120
+ * and one only an earlier version selected, or any of a post nobody can
121
+ * read, claims none. A target's URL is the one it had for the version that
122
+ * selected it, since it can follow the post's language (TASK-156).
123
+ */
124
+ async function keepCopies(permalink, versions, current, outcomes) {
125
+ const targeted = new Set(versions.flatMap((version) => selectedUrls(version)));
126
+ const selected = new Set(selectedUrls(current));
127
+ for (const { sent, copy } of outcomes) {
128
+ if (!targeted.has(sent.target))
129
+ continue;
130
+ if (!selected.has(sent.target))
131
+ await copies.write(permalink, sent.target, undefined);
132
+ else if (copy !== undefined)
133
+ await copies.write(permalink, sent.target, copy);
134
+ }
135
+ }
97
136
  return {
98
137
  handle(change) {
99
138
  // A full scan is a rebuild of the index, not news about the site.
@@ -116,10 +155,22 @@ export function createWebmentionService(options) {
116
155
  // it was showing. That is how a webmention is withdrawn — there is no
117
156
  // other way to say it.
118
157
  const source = absoluteUrl(document.permalink, config.baseUrl);
119
- const targets = targetsOf([change.previous, change.next], config.baseUrl);
120
- if (targets.length === 0)
158
+ const links = targetsOf([change.previous, change.next], targets(), config.baseUrl, siteLanguage());
159
+ if (links.length === 0)
121
160
  return;
122
- enqueue(() => tellAll(document.slug, source, targets)).catch((thrown) => {
161
+ // A post that moved is a new source to its targets, which answer with
162
+ // their copies of it under its new permalink.
163
+ const moved = change.previous !== undefined &&
164
+ change.next !== undefined &&
165
+ change.previous.permalink !== change.next.permalink
166
+ ? change.previous.permalink
167
+ : undefined;
168
+ const current = isNowPublic ? change.next : undefined;
169
+ enqueue(async () => {
170
+ if (moved !== undefined)
171
+ await copies.forget(moved);
172
+ await keepCopies(document.permalink, [change.previous, change.next], current, await tellAll(document.slug, source, links));
173
+ }).catch((thrown) => {
123
174
  logger.warn(`A webmention failed: ${messageOf(thrown)}`);
124
175
  });
125
176
  },
@@ -130,12 +181,13 @@ export function createWebmentionService(options) {
130
181
  const source = absoluteUrl(document.permalink, config.baseUrl);
131
182
  if (!sending())
132
183
  return { slug, source, sent: [] };
133
- const targets = targetsOf([document], config.baseUrl);
134
- return await enqueue(async () => ({
135
- slug,
136
- source,
137
- sent: await tellAll(slug, source, targets),
138
- }));
184
+ const links = targetsOf([document], targets(), config.baseUrl, siteLanguage());
185
+ return await enqueue(async () => {
186
+ const outcomes = await tellAll(slug, source, links);
187
+ const current = isPublic(document, config.now()) ? document : undefined;
188
+ await keepCopies(document.permalink, [document], current, outcomes);
189
+ return { slug, source, sent: outcomes.map((one) => one.sent) };
190
+ });
139
191
  },
140
192
  receive(incoming) {
141
193
  const checked = checking.then(async () => {
@@ -175,9 +227,10 @@ export function createWebmentionService(options) {
175
227
  }
176
228
  /**
177
229
  * Every external page any of these versions of a post links to, in order: the
178
- * post it replies to first, then the links in its body.
230
+ * post it replies to first, then what it reposts, likes or bookmarks, then the links in its body, then the syndication
231
+ * targets it selects, which the theme links to inside its h-entry.
179
232
  */
180
- function targetsOf(documents, baseUrl) {
233
+ function targetsOf(documents, declared, baseUrl, siteLanguage) {
181
234
  const targets = new Set();
182
235
  for (const document of documents) {
183
236
  if (document === undefined)
@@ -185,11 +238,36 @@ function targetsOf(documents, baseUrl) {
185
238
  const reply = externalTarget(replyTarget(document), baseUrl);
186
239
  if (reply !== undefined)
187
240
  targets.add(reply);
241
+ for (const { url } of citationsOf(document.extra)) {
242
+ const cited = externalTarget(url, baseUrl);
243
+ if (cited !== undefined)
244
+ targets.add(cited);
245
+ }
188
246
  for (const target of externalLinks(document.html, baseUrl))
189
247
  targets.add(target);
248
+ for (const target of selectedTargets(document, declared, siteLanguage))
249
+ targets.add(target.url);
190
250
  }
191
251
  return [...targets];
192
252
  }
253
+ /**
254
+ * Where a target says its copy of the post is: the `Location` of a 201 or 202,
255
+ * as IndieNews and Bridgy Publish answer, resolved against the endpoint.
256
+ */
257
+ function copyOf(response, endpoint) {
258
+ if (response.status !== 201 && response.status !== 202)
259
+ return undefined;
260
+ const location = response.headers.get('location');
261
+ if (location === null || location === '')
262
+ return undefined;
263
+ try {
264
+ const url = new URL(location, endpoint);
265
+ return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : undefined;
266
+ }
267
+ catch {
268
+ return undefined;
269
+ }
270
+ }
193
271
  /** Whether a version of a document was one a stranger could read. */
194
272
  function isPublic(document, now) {
195
273
  return document !== undefined && isFederatedDocument(document, now);
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/webmention/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAKxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD;;;;;;;;;;;;;;;;;GAiBG;AAEH,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AAuEtC,iDAAiD;AACjD,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC;IAEzC,gEAAgE;IAChE,MAAM,OAAO,GAAmB;QAC9B,KAAK;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;IAEF,4EAA4E;IAC5E,4EAA4E;IAC5E,qDAAqD;IACrD,IAAI,QAAQ,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;IAEn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MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,MAAM;IACb,sEAAsE;IACtE,sDAAsD;AACxD,CAAC"}
@@ -0,0 +1,135 @@
1
+ import type { Document } from '../content/document.ts';
2
+ /**
3
+ * Syndication targets (TASK-155): services such as IndieNews and Bridgy
4
+ * Publish that take a copy of a post when it links to them and sends them a
5
+ * webmention, and answer with the URL of the copy they made.
6
+ *
7
+ * Nothing here names a service. A site declares its targets in
8
+ * {@link SYNDICATION_TARGETS_FILE}; a post selects some with its
9
+ * `syndicate-to` list or by carrying a target's tag; the theme links to each
10
+ * one inside the post's h-entry; the sender notifies them as it notifies any
11
+ * linked page; and the URL each one answers with is kept in
12
+ * {@link SYNDICATION_FILE} (decision-26) and printed as `u-syndication`.
13
+ */
14
+ /** Where a site declares its targets, relative to the content directory. */
15
+ export declare const SYNDICATION_TARGETS_FILE = "_data/syndicationTargets.json";
16
+ /**
17
+ * Where the copies targets answered with are kept, relative to the content
18
+ * directory: one object keyed by a post's permalink, each mapping a target's
19
+ * URL to the copy it made (decision-26). Eleventy reads it as `syndication`.
20
+ */
21
+ export declare const SYNDICATION_FILE = "_data/syndication.json";
22
+ /** The front matter key a post lists the ids of its targets under. */
23
+ export declare const SYNDICATE_TO_FRONT_MATTER_KEY = "syndicate-to";
24
+ /** The front matter key, and mf2 property, for the URLs of a post's copies. */
25
+ export declare const SYNDICATION_FRONT_MATTER_KEY = "syndication";
26
+ /** What a target's `url` may hold to follow the post's language (TASK-156). */
27
+ export declare const LANGUAGE_PLACEHOLDER = "{lang}";
28
+ /** One place a post can be syndicated to. */
29
+ export interface SyndicationTarget {
30
+ /** What `syndicate-to` names it by, and its Micropub uid. */
31
+ readonly id: string;
32
+ /** What the editor's checkbox and the post's link say. */
33
+ readonly name: string;
34
+ /**
35
+ * The page the post links to and the webmention is sent to. As declared it
36
+ * may hold {@link LANGUAGE_PLACEHOLDER}; a target {@link selectedTargets}
37
+ * answers with has it filled for the post.
38
+ */
39
+ readonly url: string;
40
+ /** A tag that selects this target without the post listing it. */
41
+ readonly tag?: string | undefined;
42
+ /**
43
+ * The languages, as canonical BCP 47 tags, the target takes posts in. A post
44
+ * in any other language does not select it. Absent means every language.
45
+ */
46
+ readonly languages?: readonly string[] | undefined;
47
+ }
48
+ /** The declared targets, and a sentence for each entry that was not one. */
49
+ export interface ParsedSyndicationTargets {
50
+ readonly targets: readonly SyndicationTarget[];
51
+ readonly problems: readonly string[];
52
+ }
53
+ /** The keys a target is declared with, in the order a form or a file lists them. */
54
+ export type SyndicationTargetField = 'id' | 'name' | 'url' | 'tag' | 'languages';
55
+ /** A sentence for each key of one entry that is wrong. */
56
+ export type SyndicationTargetProblems = Partial<Record<SyndicationTargetField, string>>;
57
+ /** One entry checked: the target it declares, or what is wrong with each key. */
58
+ export type CheckedSyndicationTarget = {
59
+ readonly target: SyndicationTarget;
60
+ } | {
61
+ readonly problems: SyndicationTargetProblems;
62
+ };
63
+ /** One entry of the file as written, and what it declares or why it declares nothing. */
64
+ export type SyndicationEntry = {
65
+ readonly raw: unknown;
66
+ readonly target: SyndicationTarget;
67
+ } | {
68
+ readonly raw: unknown;
69
+ readonly problems: readonly string[];
70
+ };
71
+ /** The file's text read as a list of entries, or the one reason it is not a list. */
72
+ export type SyndicationEntries = {
73
+ readonly entries: readonly SyndicationEntry[];
74
+ } | {
75
+ readonly problem: string;
76
+ };
77
+ /** Read the targets file's text. An entry that is not a target is reported and left out. */
78
+ export declare function parseSyndicationTargets(text: string): ParsedSyndicationTargets;
79
+ /**
80
+ * Every entry of the targets file's text, each with the target it declares or
81
+ * its problems, in file order. A later entry repeating an earlier one's id
82
+ * declares nothing, so the first one wins.
83
+ */
84
+ export declare function syndicationEntries(text: string): SyndicationEntries;
85
+ /** What an id another target already has is told. */
86
+ export declare function repeatedIdProblem(id: string): string;
87
+ /**
88
+ * One entry as a target, or a sentence for each key that is wrong. The one
89
+ * rule a target is read by, whether it comes from the file or from the admin's
90
+ * form; whether its id is unique depends on the other entries, so that is the
91
+ * caller's.
92
+ */
93
+ export declare function checkSyndicationTarget(entry: Readonly<Record<string, unknown>>): CheckedSyndicationTarget;
94
+ /**
95
+ * The targets a site declares, read from its content directory.
96
+ *
97
+ * Read on every call and parsed again only when the bytes change, the way the
98
+ * reply contexts are, so a target added by hand is offered on the next page.
99
+ */
100
+ export interface SyndicationTargetsReader {
101
+ (): readonly SyndicationTarget[];
102
+ }
103
+ /** A reader over one content directory's targets file. A missing file declares none. */
104
+ export declare function syndicationTargetsReader(contentDir: string): SyndicationTargetsReader;
105
+ /** What is wrong with a content directory's targets file, for the boot log. */
106
+ export declare function syndicationTargetProblems(contentDir: string): readonly string[];
107
+ /**
108
+ * The declared targets a post selects, in the order the site declares them,
109
+ * each with its `url` filled for the post: those its `syndicate-to` names, and
110
+ * those whose tag it carries. An id nobody declared selects nothing.
111
+ *
112
+ * The post's language is its own `lang`, else `siteLanguage` (TASK-156). A
113
+ * target that lists `languages` is selected only for a post in one of them or
114
+ * in a regional form of one, so `de-AT` goes to a target that lists `de`, and
115
+ * {@link LANGUAGE_PLACEHOLDER} takes the listed tag; without a list it takes
116
+ * the post's. The one place the URL is decided, so the theme's link, the
117
+ * webmention and the stored copy's key cannot disagree.
118
+ */
119
+ export declare function selectedTargets(document: Pick<Document, 'tags' | 'extra'>, targets: readonly SyndicationTarget[], siteLanguage: string): SyndicationTarget[];
120
+ /** The ids a post's `syndicate-to` lists, as written. */
121
+ export declare function syndicateToOf(extra: Record<string, unknown>): string[];
122
+ /** The copies an author listed by hand under `syndication`, each an http or https URL. */
123
+ export declare function handSyndicationOf(extra: Record<string, unknown>): string[];
124
+ /** The copies targets answered with, kept in {@link SYNDICATION_FILE}. */
125
+ export interface SyndicationCopies {
126
+ /** The copies one post has, by the target URL that made each. Never touches the network. */
127
+ read(permalink: string): Readonly<Record<string, string>>;
128
+ /** Set or, with `undefined`, remove one target's copy of one post. */
129
+ write(permalink: string, target: string, copy: string | undefined): Promise<void>;
130
+ /** Forget every copy of a post, as when it moves to another permalink. */
131
+ forget(permalink: string): Promise<void>;
132
+ }
133
+ /** The copies file of one content directory. */
134
+ export declare function syndicationCopies(contentDir: string): SyndicationCopies;
135
+ //# sourceMappingURL=syndication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syndication.d.ts","sourceRoot":"","sources":["../../src/webmention/syndication.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;;;;;;;;;GAWG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAEzD,sEAAsE;AACtE,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAE5D,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAK1D,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC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