@geekity/cms 0.5.0 → 0.7.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.
- package/README.md +78 -24
- package/admin/pages/documents/editor.njk +13 -1
- package/admin/pages/navigation/menus.njk +8 -5
- package/admin/pages/users/edit.njk +25 -2
- package/admin/static/admin.css +18 -3
- package/dist/admin/accounts.d.ts +10 -0
- package/dist/admin/accounts.d.ts.map +1 -1
- package/dist/admin/accounts.js +15 -3
- package/dist/admin/accounts.js.map +1 -1
- package/dist/admin/comments.d.ts.map +1 -1
- package/dist/admin/comments.js +2 -1
- package/dist/admin/comments.js.map +1 -1
- package/dist/admin/documents.d.ts +3 -0
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +51 -11
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +3 -2
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/preview.js +3 -0
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +2 -1
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/users.d.ts +24 -0
- package/dist/admin/users.d.ts.map +1 -1
- package/dist/admin/users.js +102 -30
- package/dist/admin/users.js.map +1 -1
- package/dist/comments/submission.d.ts.map +1 -1
- package/dist/comments/submission.js +2 -1
- package/dist/comments/submission.js.map +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/content/document.d.ts +18 -7
- package/dist/content/document.d.ts.map +1 -1
- package/dist/content/document.js +1 -0
- package/dist/content/document.js.map +1 -1
- package/dist/content/index.d.ts +2 -0
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +1 -0
- package/dist/content/index.js.map +1 -1
- package/dist/content/parser.d.ts.map +1 -1
- package/dist/content/parser.js +19 -1
- package/dist/content/parser.js.map +1 -1
- package/dist/content/post-type.d.ts +48 -0
- package/dist/content/post-type.d.ts.map +1 -0
- package/dist/content/post-type.js +79 -0
- package/dist/content/post-type.js.map +1 -0
- package/dist/content/store.d.ts.map +1 -1
- package/dist/content/store.js +17 -2
- package/dist/content/store.js.map +1 -1
- package/dist/content/sync.d.ts.map +1 -1
- package/dist/content/sync.js +6 -0
- package/dist/content/sync.js.map +1 -1
- package/dist/content/writer.d.ts +1 -1
- package/dist/content/writer.d.ts.map +1 -1
- package/dist/content/writer.js +9 -2
- package/dist/content/writer.js.map +1 -1
- package/dist/federation/article.d.ts +18 -9
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +87 -17
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/index.d.ts +1 -1
- package/dist/federation/index.d.ts.map +1 -1
- package/dist/federation/index.js +1 -1
- package/dist/federation/index.js.map +1 -1
- package/dist/federation/mount.d.ts.map +1 -1
- package/dist/federation/mount.js +19 -6
- package/dist/federation/mount.js.map +1 -1
- package/dist/index.d.ts +13 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -4
- package/dist/index.js.map +1 -1
- package/dist/notifications/comments.d.ts.map +1 -1
- package/dist/notifications/comments.js +2 -1
- package/dist/notifications/comments.js.map +1 -1
- package/dist/notifications/digest.d.ts.map +1 -1
- package/dist/notifications/digest.js +2 -1
- package/dist/notifications/digest.js.map +1 -1
- package/dist/web/archive.d.ts +1 -1
- package/dist/web/archive.d.ts.map +1 -1
- package/dist/web/archive.js +2 -1
- package/dist/web/archive.js.map +1 -1
- package/dist/web/authors.d.ts +15 -1
- package/dist/web/authors.d.ts.map +1 -1
- package/dist/web/authors.js +9 -1
- package/dist/web/authors.js.map +1 -1
- package/dist/web/context.d.ts +22 -2
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +5 -0
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts.map +1 -1
- package/dist/web/conversation.js +2 -1
- package/dist/web/conversation.js.map +1 -1
- package/dist/web/feed-atom.d.ts.map +1 -1
- package/dist/web/feed-atom.js +14 -2
- package/dist/web/feed-atom.js.map +1 -1
- package/dist/web/feed-item.d.ts +21 -7
- package/dist/web/feed-item.d.ts.map +1 -1
- package/dist/web/feed-item.js +13 -6
- package/dist/web/feed-item.js.map +1 -1
- package/dist/web/feed-json.d.ts +13 -2
- package/dist/web/feed-json.d.ts.map +1 -1
- package/dist/web/feed-json.js +3 -1
- package/dist/web/feed-json.js.map +1 -1
- package/dist/web/feed-rss.d.ts.map +1 -1
- package/dist/web/feed-rss.js +2 -2
- package/dist/web/feed-rss.js.map +1 -1
- package/dist/web/feed-xml.d.ts +2 -0
- package/dist/web/feed-xml.d.ts.map +1 -1
- package/dist/web/feed-xml.js +2 -0
- package/dist/web/feed-xml.js.map +1 -1
- package/dist/web/feeds.d.ts +1 -1
- package/dist/web/feeds.d.ts.map +1 -1
- package/dist/web/feeds.js.map +1 -1
- package/dist/web/index.d.ts +4 -4
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +1 -1
- package/dist/web/index.js.map +1 -1
- package/dist/web/navigation.d.ts +106 -28
- package/dist/web/navigation.d.ts.map +1 -1
- package/dist/web/navigation.js +135 -49
- package/dist/web/navigation.js.map +1 -1
- package/dist/web/render.d.ts +9 -0
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +19 -1
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +2 -1
- package/dist/web/routes.js.map +1 -1
- package/dist/webmention/index.d.ts +6 -0
- package/dist/webmention/index.d.ts.map +1 -1
- package/dist/webmention/index.js +3 -0
- package/dist/webmention/index.js.map +1 -1
- package/dist/webmention/links.d.ts +5 -0
- package/dist/webmention/links.d.ts.map +1 -1
- package/dist/webmention/links.js +14 -7
- package/dist/webmention/links.js.map +1 -1
- package/dist/webmention/microformats.d.ts +21 -0
- package/dist/webmention/microformats.d.ts.map +1 -1
- package/dist/webmention/microformats.js +35 -5
- package/dist/webmention/microformats.js.map +1 -1
- package/dist/webmention/public-address.d.ts +30 -0
- package/dist/webmention/public-address.d.ts.map +1 -0
- package/dist/webmention/public-address.js +71 -0
- package/dist/webmention/public-address.js.map +1 -0
- package/dist/webmention/receive.d.ts.map +1 -1
- package/dist/webmention/receive.js +1 -23
- package/dist/webmention/receive.js.map +1 -1
- package/dist/webmention/reply-context.d.ts +67 -0
- package/dist/webmention/reply-context.d.ts.map +1 -0
- package/dist/webmention/reply-context.js +189 -0
- package/dist/webmention/reply-context.js.map +1 -0
- package/dist/webmention/reply-contexts.d.ts +50 -0
- package/dist/webmention/reply-contexts.d.ts.map +1 -0
- package/dist/webmention/reply-contexts.js +163 -0
- package/dist/webmention/reply-contexts.js.map +1 -0
- package/dist/webmention/service.d.ts.map +1 -1
- package/dist/webmention/service.js +9 -2
- package/dist/webmention/service.js.map +1 -1
- package/package.json +10 -10
- package/themes/default/README.md +25 -10
- package/themes/default/layouts/base.njk +5 -3
- package/themes/default/layouts/post.njk +8 -0
- package/themes/default/layouts/search.njk +4 -2
- package/themes/default/partials/bio.njk +5 -1
- package/themes/default/partials/menu.njk +6 -4
- package/themes/default/partials/post-list.njk +17 -5
- package/themes/default/partials/reply-context.njk +29 -0
- package/themes/default/static/style.css +28 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@fedify/fedify';
|
|
2
|
-
import { Article, Create, Delete, Update } from '@fedify/vocab';
|
|
2
|
+
import { Article, Create, Delete, Note, Update } from '@fedify/vocab';
|
|
3
3
|
import type { User } from '../admin/accounts.ts';
|
|
4
4
|
import type { Document } from '../content/document.ts';
|
|
5
5
|
import type { FederationContextData } from './federation.ts';
|
|
@@ -32,7 +32,8 @@ export declare const SOURCE_MEDIA_TYPE = "text/markdown";
|
|
|
32
32
|
*/
|
|
33
33
|
export declare function isFederatedDocument(document: Document, now?: Date): boolean;
|
|
34
34
|
/**
|
|
35
|
-
* One post as the `Article` doc-4 describes
|
|
35
|
+
* One post as the `Note` or `Article` doc-4 describes, whichever
|
|
36
|
+
* {@link postObjectType} says it is.
|
|
36
37
|
*
|
|
37
38
|
* Its `id` and its `url` are the same URL — the permalink — because
|
|
38
39
|
* decision-13 gives a post one name for both audiences: a browser asking for
|
|
@@ -40,6 +41,14 @@ export declare function isFederatedDocument(document: Document, now?: Date): boo
|
|
|
40
41
|
* exception is a post whose file already names an `activitypub.id`, which
|
|
41
42
|
* keeps it; see {@link articleObjectId}.
|
|
42
43
|
*
|
|
44
|
+
* The two types are not one object with two labels, because Mastodon reads
|
|
45
|
+
* them differently. An `Article`'s status is built from `name`, `summary` and
|
|
46
|
+
* `url`, and `content` is dropped, so it carries the excerpt the feeds print
|
|
47
|
+
* ({@link feedExcerpt}) as its `summary`. A `Note`'s status is its `content`,
|
|
48
|
+
* `name` is never read and `summary` is shown as a content warning, so a note
|
|
49
|
+
* sends neither and carries its title, when its text does not already start
|
|
50
|
+
* with it, at the top of its `content`.
|
|
51
|
+
*
|
|
43
52
|
* `source` carries the Markdown the file holds, so a peer that wants to quote
|
|
44
53
|
* or re-render the post has the text rather than only the rendering of it.
|
|
45
54
|
*
|
|
@@ -47,20 +56,20 @@ export declare function isFederatedDocument(document: Document, now?: Date): boo
|
|
|
47
56
|
* (decision-14), and `cc` is that user's followers: a post belongs to a person
|
|
48
57
|
* on this site, not to the site.
|
|
49
58
|
*/
|
|
50
|
-
export declare function
|
|
59
|
+
export declare function postObject(context: Context<FederationContextData>, document: Document): Article | Note;
|
|
51
60
|
/**
|
|
52
61
|
* The `Create` that announces a post: what the outbox lists, and what delivery
|
|
53
62
|
* sends.
|
|
54
63
|
*
|
|
55
|
-
* Its addressing is the
|
|
64
|
+
* Its addressing is the object's, because an activity a follower cannot see
|
|
56
65
|
* is an object it will never learn about. The id is a fragment of the
|
|
57
|
-
*
|
|
66
|
+
* object's, so the same post always produces the same activity id.
|
|
58
67
|
*/
|
|
59
68
|
export declare function postCreateActivity(context: Context<FederationContextData>, document: Document): Create;
|
|
60
69
|
/**
|
|
61
70
|
* The `Update` that announces an edit to a post followers already hold.
|
|
62
71
|
*
|
|
63
|
-
* The whole
|
|
72
|
+
* The whole object goes with it rather than a diff, because that is all
|
|
64
73
|
* ActivityPub offers and all a peer can apply. Its id carries the document's
|
|
65
74
|
* hash, so two edits are two activities and the same edit delivered twice is
|
|
66
75
|
* one; see {@link updateActivityId}.
|
|
@@ -73,13 +82,13 @@ export declare function postCreateActivity(context: Context<FederationContextDat
|
|
|
73
82
|
*/
|
|
74
83
|
export declare function postUpdateActivity(context: Context<FederationContextData>, document: Document, revision?: string): Update;
|
|
75
84
|
/**
|
|
76
|
-
* The `Delete` that withdraws a post: a `Tombstone` where
|
|
85
|
+
* The `Delete` that withdraws a post: a `Tombstone` where its object was.
|
|
77
86
|
*
|
|
78
87
|
* doc-4 sends this when a post becomes a draft, is trashed or is deleted, and
|
|
79
88
|
* all three look the same from outside — the object is gone and the copy every
|
|
80
89
|
* follower holds should go with it. The `Tombstone` keeps the object's id and
|
|
81
90
|
* says what it used to be, which is what lets a peer that never held the
|
|
82
|
-
*
|
|
91
|
+
* object recognise what it is being told about.
|
|
83
92
|
*
|
|
84
93
|
* The document is the one as it was before it went, because after a delete
|
|
85
94
|
* there is no other.
|
|
@@ -90,7 +99,7 @@ export declare function postDeleteActivity(context: Context<FederationContextDat
|
|
|
90
99
|
* or the id its file already names (decision-13).
|
|
91
100
|
*
|
|
92
101
|
* A thin wrapper over {@link postObjectId} so everything in this module reads
|
|
93
|
-
* the id the same way and off the same base URL the
|
|
102
|
+
* the id the same way and off the same base URL the object's `url` is built
|
|
94
103
|
* on. The rule itself lives in `web/documents.ts`, because the page, the feed
|
|
95
104
|
* item and the object are one identity now rather than three.
|
|
96
105
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article.d.ts","sourceRoot":"","sources":["../../src/federation/article.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,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tC,MAAM,CAYR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,EACvC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GACd,MAAM,CAeR;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAEhG;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,OAAO,GAAG,SAAS,CAOjF"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Article, Create, Delete, Hashtag, PUBLIC_COLLECTION, Source, Tombstone, Update, } from '@fedify/vocab';
|
|
1
|
+
import { Article, Create, Delete, Hashtag, Note, PUBLIC_COLLECTION, Source, Tombstone, Update, } from '@fedify/vocab';
|
|
2
2
|
import { Temporal as TemporalPolyfill } from '@js-temporal/polyfill';
|
|
3
3
|
import { listUsers, primaryUser } from '../admin/accounts.js';
|
|
4
4
|
import { readSiteSettings, taxonomyBasesFromSettings } from '../admin/settings.js';
|
|
5
|
+
import { postTypeOf, replyTarget } from '../content/post-type.js';
|
|
6
|
+
import { htmlToText } from '../content/search.js';
|
|
5
7
|
import { userForAuthor } from '../web/authors.js';
|
|
6
8
|
import { isPublicDocument, postObjectId } from '../web/documents.js';
|
|
9
|
+
import { feedExcerpt } from '../web/feed-item.js';
|
|
7
10
|
import { absoluteUrl } from '../web/negotiate.js';
|
|
8
11
|
import { categoryHref, tagHref } from '../web/taxonomy.js';
|
|
9
12
|
import { actorId } from './actor.js';
|
|
@@ -57,8 +60,41 @@ export const SOURCE_MEDIA_TYPE = 'text/markdown';
|
|
|
57
60
|
export function isFederatedDocument(document, now = new Date()) {
|
|
58
61
|
return document.type === 'post' && isPublicDocument(document, now);
|
|
59
62
|
}
|
|
63
|
+
/** The ActivityStreams object types a post can federate as, by name. */
|
|
64
|
+
const OBJECT_TYPES = { Note, Article };
|
|
60
65
|
/**
|
|
61
|
-
*
|
|
66
|
+
* The object type each discovered post type federates as: the rows of Post
|
|
67
|
+
* Type Discovery's own AS2 mapping (section 6) that this site has post types
|
|
68
|
+
* for. A reply is a `Note` even with a title of its own (decision-18).
|
|
69
|
+
*/
|
|
70
|
+
const OBJECT_TYPE_OF = {
|
|
71
|
+
reply: 'Note',
|
|
72
|
+
note: 'Note',
|
|
73
|
+
article: 'Article',
|
|
74
|
+
};
|
|
75
|
+
function isPostObjectType(value) {
|
|
76
|
+
return Object.hasOwn(OBJECT_TYPES, value);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The ActivityStreams type a post federates as: the one its front matter
|
|
80
|
+
* names in `activitypub.type`, else the one its discovered post type maps to.
|
|
81
|
+
*
|
|
82
|
+
* A name this site cannot send is logged and ignored rather than refused, as
|
|
83
|
+
* an unusable theme choice is: a typo in one file should not stop the post
|
|
84
|
+
* reaching anybody.
|
|
85
|
+
*/
|
|
86
|
+
function postObjectType(document) {
|
|
87
|
+
const derived = OBJECT_TYPE_OF[postTypeOf(document)];
|
|
88
|
+
const chosen = document.activitypub?.type;
|
|
89
|
+
if (chosen === undefined || isPostObjectType(chosen))
|
|
90
|
+
return chosen ?? derived;
|
|
91
|
+
console.warn(`${document.path} names activitypub.type "${chosen}", which is not one of ` +
|
|
92
|
+
`${Object.keys(OBJECT_TYPES).join(', ')}. It is federated as ${derived} instead.`);
|
|
93
|
+
return derived;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* One post as the `Note` or `Article` doc-4 describes, whichever
|
|
97
|
+
* {@link postObjectType} says it is.
|
|
62
98
|
*
|
|
63
99
|
* Its `id` and its `url` are the same URL — the permalink — because
|
|
64
100
|
* decision-13 gives a post one name for both audiences: a browser asking for
|
|
@@ -66,6 +102,14 @@ export function isFederatedDocument(document, now = new Date()) {
|
|
|
66
102
|
* exception is a post whose file already names an `activitypub.id`, which
|
|
67
103
|
* keeps it; see {@link articleObjectId}.
|
|
68
104
|
*
|
|
105
|
+
* The two types are not one object with two labels, because Mastodon reads
|
|
106
|
+
* them differently. An `Article`'s status is built from `name`, `summary` and
|
|
107
|
+
* `url`, and `content` is dropped, so it carries the excerpt the feeds print
|
|
108
|
+
* ({@link feedExcerpt}) as its `summary`. A `Note`'s status is its `content`,
|
|
109
|
+
* `name` is never read and `summary` is shown as a content warning, so a note
|
|
110
|
+
* sends neither and carries its title, when its text does not already start
|
|
111
|
+
* with it, at the top of its `content`.
|
|
112
|
+
*
|
|
69
113
|
* `source` carries the Markdown the file holds, so a peer that wants to quote
|
|
70
114
|
* or re-render the post has the text rather than only the rendering of it.
|
|
71
115
|
*
|
|
@@ -73,17 +117,18 @@ export function isFederatedDocument(document, now = new Date()) {
|
|
|
73
117
|
* (decision-14), and `cc` is that user's followers: a post belongs to a person
|
|
74
118
|
* on this site, not to the site.
|
|
75
119
|
*/
|
|
76
|
-
export function
|
|
120
|
+
export function postObject(context, document) {
|
|
77
121
|
const { baseUrl } = context.data.config;
|
|
78
122
|
const { actor, followers } = attribution(context, document);
|
|
79
123
|
// The archives an activity points at are wherever the site currently serves
|
|
80
124
|
// them, which is a setting rather than a constant (TASK-36).
|
|
81
125
|
const bases = taxonomyBasesFromSettings(readSiteSettings(context.data.config.contentDir));
|
|
82
|
-
|
|
126
|
+
const inReplyTo = replyTarget(document);
|
|
127
|
+
const common = {
|
|
83
128
|
id: articleObjectId(context, document),
|
|
129
|
+
// On either type, so an activitypub.type override never breaks a thread.
|
|
130
|
+
replyTarget: inReplyTo === undefined ? null : new URL(inReplyTo),
|
|
84
131
|
url: new URL(absoluteUrl(document.permalink, baseUrl)),
|
|
85
|
-
name: document.title,
|
|
86
|
-
content: document.html,
|
|
87
132
|
source: new Source({ content: document.body, mediaType: SOURCE_MEDIA_TYPE }),
|
|
88
133
|
published: toInstant(document.date) ?? null,
|
|
89
134
|
updated: toInstant(document.updated) ?? null,
|
|
@@ -99,8 +144,33 @@ export function postArticle(context, document) {
|
|
|
99
144
|
...document.tags.map((tag) => hashtag(tag, tagHref(tag, 0, bases), baseUrl)),
|
|
100
145
|
...document.categories.map((category) => hashtag(category, categoryHref(category, 0, bases), baseUrl)),
|
|
101
146
|
],
|
|
147
|
+
};
|
|
148
|
+
if (postObjectType(document) === 'Note') {
|
|
149
|
+
return new Note({ ...common, content: noteContent(document) });
|
|
150
|
+
}
|
|
151
|
+
const summary = feedExcerpt(document);
|
|
152
|
+
return new Article({
|
|
153
|
+
...common,
|
|
154
|
+
name: document.title === '' ? null : document.title,
|
|
155
|
+
summary: summary === '' ? null : summary,
|
|
156
|
+
content: document.html,
|
|
102
157
|
});
|
|
103
158
|
}
|
|
159
|
+
/** A note's HTML: its title first when its text does not already open with it. */
|
|
160
|
+
function noteContent(document) {
|
|
161
|
+
const title = document.title.trim();
|
|
162
|
+
if (title === '' || collapse(htmlToText(document.html)).startsWith(collapse(title))) {
|
|
163
|
+
return document.html;
|
|
164
|
+
}
|
|
165
|
+
const heading = `<p>${escapeHtml(title)}</p>`;
|
|
166
|
+
return document.html === '' ? heading : `${heading}\n${document.html}`;
|
|
167
|
+
}
|
|
168
|
+
function collapse(value) {
|
|
169
|
+
return value.trim().replace(/\s+/g, ' ');
|
|
170
|
+
}
|
|
171
|
+
function escapeHtml(value) {
|
|
172
|
+
return value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>');
|
|
173
|
+
}
|
|
104
174
|
/** One taxonomy term as a `Hashtag` pointing at its archive. */
|
|
105
175
|
function hashtag(term, href, baseUrl) {
|
|
106
176
|
return new Hashtag({ name: `#${term}`, href: new URL(absoluteUrl(href, baseUrl)) });
|
|
@@ -109,17 +179,17 @@ function hashtag(term, href, baseUrl) {
|
|
|
109
179
|
* The `Create` that announces a post: what the outbox lists, and what delivery
|
|
110
180
|
* sends.
|
|
111
181
|
*
|
|
112
|
-
* Its addressing is the
|
|
182
|
+
* Its addressing is the object's, because an activity a follower cannot see
|
|
113
183
|
* is an object it will never learn about. The id is a fragment of the
|
|
114
|
-
*
|
|
184
|
+
* object's, so the same post always produces the same activity id.
|
|
115
185
|
*/
|
|
116
186
|
export function postCreateActivity(context, document) {
|
|
117
|
-
const
|
|
187
|
+
const object = postObject(context, document);
|
|
118
188
|
const { actor, followers } = attribution(context, document);
|
|
119
189
|
return new Create({
|
|
120
190
|
id: createActivityId(articleObjectId(context, document)),
|
|
121
191
|
actor,
|
|
122
|
-
object
|
|
192
|
+
object,
|
|
123
193
|
published: toInstant(document.date) ?? null,
|
|
124
194
|
to: PUBLIC_COLLECTION,
|
|
125
195
|
cc: followers,
|
|
@@ -128,7 +198,7 @@ export function postCreateActivity(context, document) {
|
|
|
128
198
|
/**
|
|
129
199
|
* The `Update` that announces an edit to a post followers already hold.
|
|
130
200
|
*
|
|
131
|
-
* The whole
|
|
201
|
+
* The whole object goes with it rather than a diff, because that is all
|
|
132
202
|
* ActivityPub offers and all a peer can apply. Its id carries the document's
|
|
133
203
|
* hash, so two edits are two activities and the same edit delivered twice is
|
|
134
204
|
* one; see {@link updateActivityId}.
|
|
@@ -140,25 +210,25 @@ export function postCreateActivity(context, document) {
|
|
|
140
210
|
* which is what makes a resent `Update` and a saved one the same shape.
|
|
141
211
|
*/
|
|
142
212
|
export function postUpdateActivity(context, document, revision = revisionOf(document)) {
|
|
143
|
-
const
|
|
213
|
+
const object = postObject(context, document);
|
|
144
214
|
const { actor, followers } = attribution(context, document);
|
|
145
215
|
return new Update({
|
|
146
216
|
id: updateActivityId(articleObjectId(context, document), revision),
|
|
147
217
|
actor,
|
|
148
|
-
object
|
|
218
|
+
object,
|
|
149
219
|
published: toInstant(document.updated ?? document.date) ?? null,
|
|
150
220
|
to: PUBLIC_COLLECTION,
|
|
151
221
|
cc: followers,
|
|
152
222
|
});
|
|
153
223
|
}
|
|
154
224
|
/**
|
|
155
|
-
* The `Delete` that withdraws a post: a `Tombstone` where
|
|
225
|
+
* The `Delete` that withdraws a post: a `Tombstone` where its object was.
|
|
156
226
|
*
|
|
157
227
|
* doc-4 sends this when a post becomes a draft, is trashed or is deleted, and
|
|
158
228
|
* all three look the same from outside — the object is gone and the copy every
|
|
159
229
|
* follower holds should go with it. The `Tombstone` keeps the object's id and
|
|
160
230
|
* says what it used to be, which is what lets a peer that never held the
|
|
161
|
-
*
|
|
231
|
+
* object recognise what it is being told about.
|
|
162
232
|
*
|
|
163
233
|
* The document is the one as it was before it went, because after a delete
|
|
164
234
|
* there is no other.
|
|
@@ -171,7 +241,7 @@ export function postDeleteActivity(context, document, deleted) {
|
|
|
171
241
|
actor,
|
|
172
242
|
object: new Tombstone({
|
|
173
243
|
id: objectId,
|
|
174
|
-
formerType:
|
|
244
|
+
formerType: OBJECT_TYPES[postObjectType(document)],
|
|
175
245
|
deleted: toInstant(deleted) ?? null,
|
|
176
246
|
}),
|
|
177
247
|
to: PUBLIC_COLLECTION,
|
|
@@ -183,7 +253,7 @@ export function postDeleteActivity(context, document, deleted) {
|
|
|
183
253
|
* or the id its file already names (decision-13).
|
|
184
254
|
*
|
|
185
255
|
* A thin wrapper over {@link postObjectId} so everything in this module reads
|
|
186
|
-
* the id the same way and off the same base URL the
|
|
256
|
+
* the id the same way and off the same base URL the object's `url` is built
|
|
187
257
|
* on. The rule itself lives in `web/documents.ts`, because the page, the feed
|
|
188
258
|
* item and the object are one identity now rather than three.
|
|
189
259
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article.js","sourceRoot":"","sources":["../../src/federation/article.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,SAAS,EACT,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MA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.ts';
|
|
2
2
|
export type { UserActorOptions } from './actor.ts';
|
|
3
|
-
export { articleObjectId, documentAuthor, isFederatedDocument,
|
|
3
|
+
export { articleObjectId, documentAuthor, isFederatedDocument, postCreateActivity, postDeleteActivity, postObject, postUpdateActivity, SOURCE_MEDIA_TYPE, toInstant, } from './article.ts';
|
|
4
4
|
export { createDeliveryService, deliveryTargets, groupByInbox } from './delivery.ts';
|
|
5
5
|
export type { CreateDeliveryServiceOptions, DeliveryLogger, DeliveryReport, DeliveryService, DeliveryTarget, } from './delivery.ts';
|
|
6
6
|
export { createSiteFederation, federatedPost, outboxPage, OUTBOX_PAGE_SIZE, SOFTWARE_NAME, } from './federation.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/federation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/federation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,YAAY,EAA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AAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvF,YAAY,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,UAAU,EACV,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,yBAAyB,EACzB,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC1F,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,gCAAgC,EAChC,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/federation/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { actorAliases, actorId, avatarUrl, keyIdFor, mainKeyId, multikeyId, senderKeyPairs, userActor, userByUsername, } from './actor.js';
|
|
2
|
-
export { articleObjectId, documentAuthor, isFederatedDocument,
|
|
2
|
+
export { articleObjectId, documentAuthor, isFederatedDocument, postCreateActivity, postDeleteActivity, postObject, postUpdateActivity, SOURCE_MEDIA_TYPE, toInstant, } from './article.js';
|
|
3
3
|
export { createDeliveryService, deliveryTargets, groupByInbox } from './delivery.js';
|
|
4
4
|
export { createSiteFederation, federatedPost, outboxPage, OUTBOX_PAGE_SIZE, SOFTWARE_NAME, } from './federation.js';
|
|
5
5
|
export { ExistingKeyPairError, importWordPressActor, UnusableKeyPemError, } from './import-wordpress.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/federation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/federation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQrF,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB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,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/federation/mount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAqB,MAAM,MAAM,CAAC;AAG7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAO5C,OAAO,KAAK,EAAyB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQ7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,EACrB,UAAU,EAAE,cAAc,EAC1B,OAAO,GAAE,sBAA2B,GACnC,IAAI,
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/federation/mount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAqB,MAAM,MAAM,CAAC;AAG7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAO5C,OAAO,KAAK,EAAyB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQ7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,EACrB,UAAU,EAAE,cAAc,EAC1B,OAAO,GAAE,sBAA2B,GACnC,IAAI,CA8GN;AAED,2EAA2E;AAC3E,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,cAAc,CAAC,GAAG,SAAS,CAAC;CAChD;AA8KD,oFAAoF;AACpF,eAAO,MAAM,cAAc,2BAA2B,CAAC;AAEvD,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAa3F"}
|
package/dist/federation/mount.js
CHANGED
|
@@ -7,7 +7,7 @@ import { publicDocumentAt } from '../web/documents.js';
|
|
|
7
7
|
import { absoluteUrl, prefersActivityStreams } from '../web/negotiate.js';
|
|
8
8
|
import { requestPath } from '../web/routes.js';
|
|
9
9
|
import { actorAliases, actorId, userActor } from './actor.js';
|
|
10
|
-
import { isFederatedDocument,
|
|
10
|
+
import { isFederatedDocument, postObject } from './article.js';
|
|
11
11
|
import { federationOrigin, handleHref } from './paths.js';
|
|
12
12
|
import { recordWordPressRequest, userByWordPressActorId, wordPressRequestTarget, } from './wordpress.js';
|
|
13
13
|
/**
|
|
@@ -71,11 +71,24 @@ export function mountFederation(app, federation, options = {}) {
|
|
|
71
71
|
// `/@ada`, the short URL WordPress publishes beside the author archive and
|
|
72
72
|
// the one a person is most likely to type. It is an alias rather than a
|
|
73
73
|
// second identity, so it goes where the identity is.
|
|
74
|
-
app.get('/:handle{@.+}', (c) => {
|
|
74
|
+
app.get('/:handle{@.+}', async (c, next) => {
|
|
75
75
|
// The pattern is a regex rather than `/@:username`, because Hono's path
|
|
76
76
|
// parameters are whole segments: the `@` has to be matched inside one.
|
|
77
|
-
const handle = c.req.param('handle') ?? '';
|
|
78
|
-
|
|
77
|
+
const handle = (c.req.param('handle') ?? '').slice(1);
|
|
78
|
+
// An alias is only an alias of somebody. The route used to send every
|
|
79
|
+
// handle to `/author/<whatever was typed>/`, so a profile link with a
|
|
80
|
+
// menu item's flag on the end of it — `https://shll.me/@a | me` — landed a
|
|
81
|
+
// reader on `/author/a%20%7C%20me/` instead of saying there is no such
|
|
82
|
+
// person (TASK-112). Spelled exactly, the way WebFinger matches: `Ada` and
|
|
83
|
+
// `ada` are two accounts on a screen that can tell them apart, and only
|
|
84
|
+
// one of them exists.
|
|
85
|
+
const user = listUsers(c.var.config.dataDir).find((account) => account.username === handle);
|
|
86
|
+
// The site's own not-found handler answers rather than a bare 404 here, so
|
|
87
|
+
// a handle nobody has gets the theme's 404 page like any other URL that is
|
|
88
|
+
// not there.
|
|
89
|
+
if (user === undefined)
|
|
90
|
+
return await next();
|
|
91
|
+
return c.redirect(authorHref(user.username), 301);
|
|
79
92
|
});
|
|
80
93
|
// `@fedify/hono` types its context as the two properties it actually reads,
|
|
81
94
|
// which is looser than Hono's own; the cast is what puts `c.var` back.
|
|
@@ -259,13 +272,13 @@ function storedObjectAt(c) {
|
|
|
259
272
|
/**
|
|
260
273
|
* One post as the ActivityStreams response a peer asked for.
|
|
261
274
|
*
|
|
262
|
-
* The
|
|
275
|
+
* The object is built through the same {@link postObject} the outbox uses,
|
|
263
276
|
* off a context Fedify makes for this request, so the object a peer fetches
|
|
264
277
|
* and the one it is delivered cannot drift apart.
|
|
265
278
|
*/
|
|
266
279
|
async function article(c, federation, document) {
|
|
267
280
|
const context = federation.createContext(c.req.raw, contextData(c));
|
|
268
|
-
return await respondWithObject(
|
|
281
|
+
return await respondWithObject(postObject(context, document), {
|
|
269
282
|
contextLoader: context.contextLoader,
|
|
270
283
|
});
|
|
271
284
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../../src/federation/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAm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AC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;AAC7E,CAAC;AAED,6DAA6D;AAC7D,SAAS,WAAW,CAAC,CAAsB;IACzC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;AAC1E,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { MailService } from './mail/index.ts';
|
|
|
7
7
|
import type { CommentDigest, CommentNotifier } from './notifications/index.ts';
|
|
8
8
|
import type { DeliveryService, RelayService, SiteFederation } from './federation/index.ts';
|
|
9
9
|
import type { FeedNotifier, NotifyReport } from './notify.ts';
|
|
10
|
-
import type { WebmentionService } from './webmention/index.ts';
|
|
10
|
+
import type { ReplyContextService, WebmentionService } from './webmention/index.ts';
|
|
11
11
|
export { createFeedNotifier, NOTIFY_TIMEOUT_MS } from './notify.ts';
|
|
12
12
|
export type { CreateFeedNotifierOptions, FeedNotifier, NotifyLogger, NotifyPing, NotifyReport, } from './notify.ts';
|
|
13
13
|
export { LANGUAGE_TAG_PATTERN, COMMENT_ACTIONS, COMMENT_ADMIN_FIELDS, COMMENT_KINDS, COMMENT_SOURCES, COMMENT_STATUSES, COMMENT_TABS, COMMENTS_MODERATE_PATH, COMMENTS_PATH, COMMENTS_PER_PAGE, COMMENTS_REPLY_PATH, COMMENTS_SECTION, commentListUrl, mountCommentsScreen, pendingComments, MESSAGE_FIELDS, MESSAGE_TABS, MESSAGES_DELETE_PATH, MESSAGES_PATH, MESSAGES_PER_PAGE, MESSAGES_READ_PATH, MESSAGES_SECTION, messageListUrl, mountMessagesScreen, unreadMessages, DELIVERY_STATUSES, RELAY_STATES, ADMIN_ASSET_MAX_AGE, ADMIN_ASSET_PREFIX, ADMIN_PREFIX, ADMIN_SECTIONS, ADMIN_STATIC_DIR, ADMIN_TEMPLATES, actorSummary, addUserProblems, adminAssetResponse, adminContentSecurityPolicy, adminSecurityHeaders, akismetPanel, AKISMET_FIELDS, AKISMET_PATH, AKISMET_REMOVE, EMAIL_PATTERN, MAIL_FIELDS, MAIL_PATH, MAIL_REMOVE, MAIL_TEST_FIELDS, MAIL_TEST_PATH, MAIL_TEST_TEMPLATE, mailPanel, ARGON2_PARAMETERS, baselineSecurityHeaders, blankForm, CHANGE_PASSWORD_PATH, changePasswordProblems, clearSessionCookie, createAdminTemplateEnvironment, createLoginThrottle, createNonce, credentialProblem, clientAddress, countUsers, createUser, CSRF_FIELD, csrfTokenMatches, DASHBOARD_RECENT_POSTS, describeWait, DEFAULT_SITE_SETTINGS, DELETE_USER_PATH, deleteUser, deleteUserRefusal, deliveryRows, DOCUMENT_FILTERS, documentFilter, DOCUMENTS_PER_PAGE, editorPath, effectiveBaseUrl, EXCLUDE_KEY, DuplicateUsernameError, emailProblem, FEDERATION_FIELDS, FEDERATION_PATH, FEDERATION_RECENT, FEDERATION_SETTINGS_PATH, findAdminAsset, findBySlug, findUser, findUserById, findUserByIdentifier, followerRow, FORGOT_PATH, formatInTimezone, formFor, applyTermChange, CATEGORY_KIND, deletePath, formFromSettings, flash, GENERATED_PASSWORD_ALPHABET, GENERATED_PASSWORD_LENGTH, generatePassword, guard, hashPassword, HSTS_MAX_AGE, HSTS_VALUE, INBOX_INTERACTIONS, inboxRows, LOCKOUT_GROWTH_LIMIT, LOGIN_PATH, LOGOUT_PATH, listingUrl, listOptionsFor, listUsers, localPosts, loginKeys, MAXIMUM_USERNAME_LENGTH, migrateSettingsToFile, migrateUsersToFile, MINIMUM_PASSWORD_LENGTH, mountAdmin, mountDocumentScreens, mountFederationScreen, mountPreview, mountRecovery, mountSettings, mountTaxonomyScreens, mountUploads, mountUsers, newEditorPath, newPasswordProblem, NONCE_BYTES, openAdminStore, PAGE_KIND, PACKAGED_ADMIN_DIR, PASSWORD_CHANGED_TEMPLATE, passwordProblem, postEditorPath, POST_KIND, primaryUser, PREVIEW_PATH, readSiteSettings, RECOVERY_ANSWER, RECOVERY_FIELDS, RELAY_RETRY_PATH, RELAY_STATE_LABELS, relayList, relayRow, renamePath, renameProblem, RESEND_PATH, resendMessage, RESET_PATH, RESET_TEMPLATE, RESET_TOKEN_LIFETIME_SECONDS, resetLink, rewriteTerm, MEDIA_DELETE_PATH, MEDIA_FIELDS, MEDIA_PATH, MEDIA_PER_PAGE, MEDIA_SECTION, MEDIA_UPLOAD_PATH, mediaPageUrl, mentionsUpload, mountMediaScreen, deleteUpload, describeUpload, listUploads, referencesTo, resolveUpload, uploadMarkdown, normalizeRelayInbox, refusedUpload, refuseOversizedUpload, returnPath, SESSION_COOKIE, SESSION_ID_BYTES, sessionIdFrom, setSessionCookie, SETTINGS_FIELDS, SETTINGS_PATH, settingsFromForm, settingsFromSiteJson, settingsProblems, SETUP_PATH, siteDataPath, siteJsonFor, splitTags, storeUpload, TAG_KIND, takeFlash, TAXONOMY_FIELDS, TAXONOMY_KINDS, tooLargeMessage, updateSiteSettings, UPLOAD_ENVELOPE_BYTES, UPLOAD_FIELD, UPLOADS_PATH, setUserEmail, setUserPassword, setUserProfile, setUserWordPressActor, ConflictingActorIdError, UnknownUserError, USER_EMAIL_PATH, USER_FIELDS, USERNAME_PATTERN, usernameProblem, USERS_FILE, USERS_FILE_MODE, usersFile, USERS_PATH, usesSecureCookies, verifyPasswordHash, verifyUserPassword, writeSiteJson, } from './admin/index.ts';
|
|
@@ -34,12 +34,12 @@ export { addCommentOptOut, COMMENT_DIGEST_TEMPLATE, COMMENT_OPTOUTS_FILE, COMMEN
|
|
|
34
34
|
export type { CommentDigest, CommentNotifier, CreateCommentDigestOptions, CreateCommentNotifierOptions, DigestLogger, LinkContext, NewNotificationToken, NotificationClaim, NotificationDeliveryMode, NotificationEvent, NotificationSwitch, NotificationTimers, } from './notifications/index.ts';
|
|
35
35
|
export { BREVO_ENDPOINT, BREVO_TIMEOUT_MS, createBrevoProvider, createMailService, createMailTemplates, createMemoryMailProvider, createSmtpProvider, DEFAULT_MAIL_ATTEMPTS, defaultMailBackoffMs, MAIL_CREDENTIALS_FILE, MAIL_PROVIDERS, mailCredentialsPath, mailTemplateFiles, readMailCredentials, removeMailCredentials, SMTP_TIMEOUT_MS, writeMailCredentials, } from './mail/index.ts';
|
|
36
36
|
export type { BrevoCredential, BrevoProviderOptions, CreateMailServiceOptions, CreateMailTemplatesOptions, MailAddress, MailCredentials, MailDelivery, MailLogger, MailProvider, MailProviderName, MailRecipient, MailResult, MailService, MailTemplateFiles, MailTemplates, MemoryMailProvider, OutgoingMail, RawMail, RenderedMail, SmtpCredential, SmtpProviderOptions, TemplateMail, } from './mail/index.ts';
|
|
37
|
-
export { acceptedRelays, acceptRelay, addFollower, appendInboxActivity, ACTOR_KEY_ALGORITHMS, ACTOR_PATH, assertActorKeysUsable, actorKeyFile, actorKeysDir, articleObjectId, actorAliases, actorId, avatarUrl, keyIdFor, mainKeyId, multikeyId, senderKeyPairs, userActor, userByUsername, createActivityId, createDeliveryService, createRelayService, createSiteFederation, deleteActivityId, deliveryTargets, documentAuthor, federatedPost, federatedUsernames, FEDERATION_DATA_DIRECTORY, federationOrigin, acctOf, handleHref, userDirectory, webFingerSubject, WEBFINGER_PATH, followerFrom, followerRecipient, FOLLOWERS_FILE, FOLLOWERS_PAGE_SIZE, FOLLOWERS_PATH, actorHandle, followersFile, followersPage, FOLLOWING_PATH, groupByInbox, handleAccept, handleDelete, handleFollow, handleLoggedActivity, handleReject, handleUndo, INBOX_PATH, isFederatedDocument, lastFollowersCursor, inboxDirectory, inboxFile, inboxMonth, INBOX_DIRECTORY, inboxRowFrom, loadActorKeyPairs, logActivity, migrateActorKeysToFiles, migrateFederationToFiles, mountFederation, NODEINFO_PATH, OUTBOX_PAGE_SIZE, OUTBOX_PATH,
|
|
37
|
+
export { acceptedRelays, acceptRelay, addFollower, appendInboxActivity, ACTOR_KEY_ALGORITHMS, ACTOR_PATH, assertActorKeysUsable, actorKeyFile, actorKeysDir, articleObjectId, actorAliases, actorId, avatarUrl, keyIdFor, mainKeyId, multikeyId, senderKeyPairs, userActor, userByUsername, createActivityId, createDeliveryService, createRelayService, createSiteFederation, deleteActivityId, deliveryTargets, documentAuthor, federatedPost, federatedUsernames, FEDERATION_DATA_DIRECTORY, federationOrigin, acctOf, handleHref, userDirectory, webFingerSubject, WEBFINGER_PATH, followerFrom, followerRecipient, FOLLOWERS_FILE, FOLLOWERS_PAGE_SIZE, FOLLOWERS_PATH, actorHandle, followersFile, followersPage, FOLLOWING_PATH, groupByInbox, handleAccept, handleDelete, handleFollow, handleLoggedActivity, handleReject, handleUndo, INBOX_PATH, isFederatedDocument, lastFollowersCursor, inboxDirectory, inboxFile, inboxMonth, INBOX_DIRECTORY, inboxRowFrom, loadActorKeyPairs, logActivity, migrateActorKeysToFiles, migrateFederationToFiles, mountFederation, NODEINFO_PATH, OUTBOX_PAGE_SIZE, OUTBOX_PATH, postCreateActivity, postDeleteActivity, postObject, postUpdateActivity, readFollowers, readInboxLog, rebuildFederationIndexes, rejectRelay, relayAnswering, relayRecipient, REPLY_ACTIVITY_TYPE, replyFrom, replyTargetOf, SHARED_INBOX_PATH, SOFTWARE_NAME, SOURCE_MEDIA_TYPE, toInstant, updateActivityId, } from './federation/index.ts';
|
|
38
38
|
export type { ActorKeyAlgorithm, CreateDeliveryServiceOptions, FederationIndexReport, FederationRecords, UserActorOptions, InboxLine, CreateRelayServiceOptions, CreateSiteFederationOptions, DeliveryLogger, DeliveryReport, DeliveryService, DeliveryTarget, FederationContextData, RelayLogger, RelayService, RelaySyncReport, SiteFederation, Reply, SiteInboxContext, } from './federation/index.ts';
|
|
39
|
-
export { absoluteUrl, ACTIVITY_STREAMS_MEDIA_TYPES, activityStreamsId, alternateLinks, archiveMonths, ARCHIVE_FRONT_MATTER_KEY, archiveOpen, assetNotModified, assetResponse, atomEntry, atomFeed, AUTHOR_BASE, authorContext, authorFeedHref, authorHref, authorNames, categoryHref, commentAnchor, commentsFeedHref, commentsFeedPath, commentsFeedResponse, commentsRssFeed, COMMENTS_ROOT, COMMENTS_TITLE_PREFIX, contentEtag, createConversation, createRenderer, createSiteDataSource, createTemplateEnvironment, DEFAULT_FEED_SIZE, DEFAULT_MENU_NAME, DEFAULT_TAXONOMY_BASES, DEFAULT_POSTS_PER_PAGE, DOCUMENT_REPRESENTATIONS, documentContext, cdata, contentTypeOf, DC_NAMESPACE, DEFAULT_FEED_LANGUAGE, DEFAULT_NOTIFY_SERVER, documentJson, escapeXml, excerptFromHtml, EXCERPT_WORDS, FEED_ALIASES, FEED_CONTENT_TYPES, FEED_FORMATS, FEED_GENERATOR, FEED_GENERATOR_URI, FEED_ITEM_REVISION, FEED_SEGMENT, FEED_SEGMENTS, feedComments, feedExcerpt, feedHref, feedItem, feedItems, feedLanguage, feedLinkHeader, feedPathUnder, feedResponse, feedSize, findAsset, findThemeAsset, findThemeFile, findUpload, forgetTerm, formatDate, frontPageSlugs, homeHref, INBOX_BASE, isNotModified, isPublicDocument, JSON_FEED_VERSION, JSON_SCHEMA_VERSION, jsonFeed, jsonFeedItem, lastModifiedOf, latestModified, listingPageHref, LISTING_REPRESENTATIONS, matchesEtag, MAXIMUM_QUERY_LENGTH, MEDIA_TYPES,
|
|
40
|
-
export type { AcceptRange, AssetResponseOptions, AuthorContext, AuthorRequest, ConditionalHeaders, CreateRendererOptions, CommentFeedSource, Conversation, ConversationContext, ConversationReader, CreateTemplateEnvironmentOptions, DateFormat, DocumentContext, DocumentJson, DocumentJsonOptions, FeedComment, FeedFormat, FeedIdentity, FeedItem, FeedItemComments, FeedItemContext, FeedPath, FeedResponseOptions, FeedSource, FrontPageSlugs, JsonFeed, JsonFeedAuthor, JsonFeedHub, Interaction, InteractionAuthor, InteractionCounts, InteractionKind, InteractionSource, InteractionStatus, JsonFeedItem, SiteInteraction, NotifyServer, Listing, MenuItem,
|
|
41
|
-
export { classesOf, createWebmentionService, discoverEndpoint, DISCOVERY_MAX_BYTES, DISCOVERY_TIMEOUT_MS, elementsIn, endpointInHeader, endpointInHtml, externalLinks, innerHtmlOf, isElement, itemsIn, linksTo, parseHtml, rawTextOf, readCapped, SEND_TIMEOUT_MS, sourceEntry, textOf, WEBMENTION_USER_AGENT, } from './webmention/index.ts';
|
|
42
|
-
export type { CreateWebmentionServiceOptions, HtmlElement, HtmlNode, HtmlText, MicroformatItem, MicroformatValue, SourceEntry, WebmentionKind, WebmentionLogger, WebmentionReport, } from './webmention/index.ts';
|
|
39
|
+
export { absoluteUrl, ACTIVITY_STREAMS_MEDIA_TYPES, activityStreamsId, alternateLinks, archiveMonths, ARCHIVE_FRONT_MATTER_KEY, archiveOpen, assetNotModified, assetResponse, atomEntry, atomFeed, AUTHOR_BASE, authorContext, authorFeedHref, authorHref, authorNames, categoryHref, commentAnchor, commentsFeedHref, commentsFeedPath, commentsFeedResponse, commentsRssFeed, COMMENTS_ROOT, COMMENTS_TITLE_PREFIX, contentEtag, createConversation, createRenderer, createSiteDataSource, createTemplateEnvironment, DEFAULT_FEED_SIZE, DEFAULT_MENU_NAME, DEFAULT_TAXONOMY_BASES, DEFAULT_POSTS_PER_PAGE, DOCUMENT_REPRESENTATIONS, documentContext, cdata, contentTypeOf, DC_NAMESPACE, DEFAULT_FEED_LANGUAGE, DEFAULT_NOTIFY_SERVER, documentJson, escapeXml, excerptFromHtml, EXCERPT_WORDS, FEED_ALIASES, FEED_CONTENT_TYPES, FEED_FORMATS, FEED_GENERATOR, FEED_GENERATOR_URI, FEED_ITEM_REVISION, FEED_SEGMENT, FEED_SEGMENTS, feedComments, feedExcerpt, feedHref, feedItem, feedItems, feedLanguage, feedLinkHeader, feedPathUnder, feedResponse, feedSize, findAsset, findThemeAsset, findThemeFile, findUpload, forgetTerm, formatDate, frontPageSlugs, homeHref, INBOX_BASE, isLinkUrl, isNotModified, isPublicDocument, JSON_FEED_VERSION, JSON_SCHEMA_VERSION, jsonFeed, jsonFeedItem, lastModifiedOf, latestModified, LINK_REL_RULE, LINK_URL_RULE, listingPageHref, LISTING_REPRESENTATIONS, matchesEtag, MAXIMUM_QUERY_LENGTH, MEDIA_TYPES, MENU_NAME_MAX_LENGTH, MENU_NAME_PATTERN, menuItemLineProblem, menuItemOf, menuItemsFromText, menuItemsText, menuNameProblem, menusOf, mountPublicSite, navigationItems, navigationItemsOf, navigationMenu, navigationMenus, notAcceptableResponse, NOTIFY_CLOUD_PORT, NOTIFY_CLOUD_PROTOCOL, NOTIFY_PATHS, notifyEndpoints, notifyServerOf, offsetForPage, PACKAGED_THEME_DIR, PAGE_SEGMENT, paginate, parseAccept, parseAuthorPath, postObjectId, postsPerPage, prefersActivityStreams, profileContext, publicDocumentAt, recentPosts, RECENT_POSTS, recordTermRename, redirectedTerm, REPRESENTATION_EXTENSIONS, representationEtag, REL_VALUE_PATTERN, relText, relValuesOf, representationHref, representationResponse, RESERVED_TOP_LEVEL_PATHS, rfc822, spokenIn, robotsResponse, robotsTxt, ROBOTS_CONTENT_TYPE, ROBOTS_PATH, rssFeed, rssItem, readTheme, sanitizeCommentHtml, searchHref, searchJson, searchPageIndex, searchQuery, SEARCH_PAGE_PARAM, SEARCH_PATH, SEARCH_QUERY_PARAM, selectRepresentation, SITE_DATA_FILE, SITE_THEME_KIND, sitemapChildPath, sitemapDate, sitemapIndexXml, sitemapResponse, sitemapXml, SITEMAP_CHILD_ROUTE, SITEMAP_CONTENT_TYPE, SITEMAP_MAX_URLS, SITEMAP_NAMESPACE, SITEMAP_PATH, snippetHtml, SOURCE_NAMESPACE, siteAuthorContext, siteMenus, siteTimezone, splitFeedPath, splitLinkRel, splitRepresentationExtension, startOfMonth, tagHref, TAXONOMIES, userForAuthor, TAXONOMY_BASE_PATTERN, TAXONOMY_LABELS, taxonomyBaseProblems, taxonomyBases, taxonomyBasesOrDefault, taxonomyForSegment, taxonomyRedirectsOf, OPTIONAL_TEMPLATES, TEMPLATES, termHref, termRedirects, themeAssetNotModified, themeAssetResponse, THEME_ASSET_MAX_AGE, THEME_ASSET_PREFIX, THEME_STATIC_DIR, THEME_MANIFEST_FILE, themeSearchPath, UPLOAD_ASSET_MAX_AGE, UPLOAD_ASSET_PREFIX, UPLOAD_DIRECTORY, WFW_NAMESPACE, } from './web/index.ts';
|
|
40
|
+
export type { AcceptRange, AssetResponseOptions, AuthorContext, LinkLine, PublishedProfileLink, AuthorRequest, ConditionalHeaders, CreateRendererOptions, CommentFeedSource, Conversation, ConversationContext, ConversationReader, CreateTemplateEnvironmentOptions, DateFormat, DocumentContext, DocumentJson, DocumentJsonOptions, FeedComment, FeedFormat, FeedIdentity, FeedItem, FeedItemComments, FeedItemContext, FeedPath, FeedResponseOptions, FeedSource, FrontPageSlugs, JsonFeed, JsonFeedAuthor, JsonFeedGeekity, JsonFeedHub, Interaction, InteractionAuthor, InteractionCounts, InteractionKind, InteractionSource, InteractionStatus, JsonFeedItem, SiteInteraction, NotifyServer, Listing, MenuItem, MenuList, NavigationItem, NavigationMenuOptions, NavigationMenus, NavigationMenusOptions, NeighbourContext, PageContext, PaginateOptions, Pagination, RecentPostsSource, Renderer, Representation, RepresentationExtension, RepresentationResponseOptions, SearchJson, SearchJsonOptions, SearchPage, SearchResultJson, SiteData, SiteDataSource, SitemapResponseOptions, SitemapUrl, StaticAsset, Taxonomy, TaxonomyBaseProblems, TaxonomyBases, TaxonomyRedirect, TaxonomyTerm, Theme, ThemeArea, ThemeAsset, ThemeKind, ThemeRead, } from './web/index.ts';
|
|
41
|
+
export { classesOf, createWebmentionService, discoverEndpoint, DISCOVERY_MAX_BYTES, DISCOVERY_TIMEOUT_MS, elementsIn, endpointInHeader, endpointInHtml, externalLinks, innerHtmlOf, isElement, itemsIn, linksTo, parseHtml, rawTextOf, readCapped, SEND_TIMEOUT_MS, sourceEntry, textOf, WEBMENTION_USER_AGENT, createReplyContextService, fetchReplyContext, readReplyContext, REPLY_CONTEXTS_FILE, systemHostLookup, } from './webmention/index.ts';
|
|
42
|
+
export type { CreateReplyContextServiceOptions, HostLookup, ReplyContext, ReplyContextService, CreateWebmentionServiceOptions, HtmlElement, HtmlNode, HtmlText, MicroformatItem, MicroformatValue, SourceEntry, WebmentionKind, WebmentionLogger, WebmentionReport, } from './webmention/index.ts';
|
|
43
43
|
/**
|
|
44
44
|
* Where the scheduler's watermark lives in {@link AdminStore.getState}: the
|
|
45
45
|
* instant up to which scheduled documents have been announced.
|
|
@@ -97,6 +97,13 @@ export interface Cms {
|
|
|
97
97
|
* post's links again, or to wait for the ones in flight.
|
|
98
98
|
*/
|
|
99
99
|
readonly webmentions: WebmentionService;
|
|
100
|
+
/**
|
|
101
|
+
* What a reply shows of the post it answers (TASK-123): fetched when a reply
|
|
102
|
+
* is saved or synced, kept in `content/_data/replyContexts.json`, and read
|
|
103
|
+
* from there when a page is drawn. Already subscribed to the index; a site
|
|
104
|
+
* or a test reaches for it to wait for the fetches in flight.
|
|
105
|
+
*/
|
|
106
|
+
readonly replyContexts: ReplyContextService;
|
|
100
107
|
/**
|
|
101
108
|
* The site's rssCloud and WebSub client: what tells the notify server named
|
|
102
109
|
* in the settings that a feed changed, so a subscriber hears at once rather
|