@geekity/cms 0.3.0 → 0.5.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 +2217 -214
- package/admin/components/fields.njk +165 -0
- package/admin/layouts/base.njk +1 -1
- package/admin/layouts/settings-page.njk +26 -0
- package/admin/layouts/shell.njk +17 -3
- package/admin/pages/account/forgot.njk +47 -0
- package/admin/pages/account/login.njk +26 -0
- package/admin/pages/account/reset.njk +38 -0
- package/admin/pages/account/setup.njk +28 -0
- package/admin/pages/appearance/themes.njk +69 -0
- package/admin/pages/comments/all.njk +133 -0
- package/admin/{layouts/dashboard.njk → pages/dashboard/home.njk} +8 -15
- package/admin/{layouts/document-conflict.njk → pages/documents/conflict.njk} +1 -0
- package/admin/{layouts/document-editor.njk → pages/documents/editor.njk} +75 -59
- package/admin/{layouts/document-list.njk → pages/documents/list.njk} +19 -2
- package/admin/pages/documents/taxonomy.njk +95 -0
- package/admin/pages/federation/followers.njk +238 -0
- package/admin/pages/federation/settings.njk +77 -0
- package/admin/pages/media/library.njk +160 -0
- package/admin/pages/messages/all.njk +110 -0
- package/admin/pages/navigation/menus.njk +129 -0
- package/admin/{layouts → pages}/placeholder.njk +5 -1
- package/admin/pages/settings/discussion.njk +99 -0
- package/admin/pages/settings/email.njk +203 -0
- package/admin/pages/settings/general.njk +29 -0
- package/admin/pages/settings/permalinks.njk +50 -0
- package/admin/pages/settings/reading.njk +64 -0
- package/admin/pages/tools/content-index.njk +89 -0
- package/admin/pages/users/edit.njk +239 -0
- package/admin/pages/users/list.njk +51 -0
- package/admin/pages/users/new.njk +41 -0
- package/admin/static/admin.css +558 -3
- package/admin/static/copy.js +52 -0
- package/admin/static/editor.js +16 -16
- package/admin/static/slug.js +61 -0
- package/dist/access-log.d.ts +44 -0
- package/dist/access-log.d.ts.map +1 -0
- package/dist/access-log.js +71 -0
- package/dist/access-log.js.map +1 -0
- package/dist/admin/accounts.d.ts +413 -0
- package/dist/admin/accounts.d.ts.map +1 -0
- package/dist/admin/accounts.js +680 -0
- package/dist/admin/accounts.js.map +1 -0
- package/dist/admin/appearance.d.ts +80 -0
- package/dist/admin/appearance.d.ts.map +1 -0
- package/dist/admin/appearance.js +136 -0
- package/dist/admin/appearance.js.map +1 -0
- package/dist/admin/comments.d.ts +90 -0
- package/dist/admin/comments.d.ts.map +1 -0
- package/dist/admin/comments.js +244 -0
- package/dist/admin/comments.js.map +1 -0
- package/dist/admin/credentials.d.ts +26 -2
- package/dist/admin/credentials.d.ts.map +1 -1
- package/dist/admin/credentials.js +35 -2
- package/dist/admin/credentials.js.map +1 -1
- package/dist/admin/documents.d.ts +117 -10
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +328 -41
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/federation.d.ts +161 -50
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +235 -93
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/formatting.d.ts +20 -0
- package/dist/admin/formatting.d.ts.map +1 -0
- package/dist/admin/formatting.js +72 -0
- package/dist/admin/formatting.js.map +1 -0
- package/dist/admin/headers.d.ts +65 -0
- package/dist/admin/headers.d.ts.map +1 -0
- package/dist/admin/headers.js +104 -0
- package/dist/admin/headers.js.map +1 -0
- package/dist/admin/index.d.ts +38 -12
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +25 -7
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/media.d.ts +168 -0
- package/dist/admin/media.d.ts.map +1 -0
- package/dist/admin/media.js +295 -0
- package/dist/admin/media.js.map +1 -0
- package/dist/admin/menu.d.ts +79 -0
- package/dist/admin/menu.d.ts.map +1 -0
- package/dist/admin/menu.js +143 -0
- package/dist/admin/menu.js.map +1 -0
- package/dist/admin/messages.d.ts +80 -0
- package/dist/admin/messages.d.ts.map +1 -0
- package/dist/admin/messages.js +152 -0
- package/dist/admin/messages.js.map +1 -0
- package/dist/admin/navigation.d.ts +155 -0
- package/dist/admin/navigation.d.ts.map +1 -0
- package/dist/admin/navigation.js +292 -0
- package/dist/admin/navigation.js.map +1 -0
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +31 -7
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/recovery.d.ts +92 -0
- package/dist/admin/recovery.d.ts.map +1 -0
- package/dist/admin/recovery.js +229 -0
- package/dist/admin/recovery.js.map +1 -0
- package/dist/admin/routes.d.ts +0 -20
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +164 -105
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/session.d.ts +17 -3
- package/dist/admin/session.d.ts.map +1 -1
- package/dist/admin/session.js +19 -5
- package/dist/admin/session.js.map +1 -1
- package/dist/admin/settings-discussion.d.ts +37 -0
- package/dist/admin/settings-discussion.d.ts.map +1 -0
- package/dist/admin/settings-discussion.js +117 -0
- package/dist/admin/settings-discussion.js.map +1 -0
- package/dist/admin/settings-email.d.ts +54 -0
- package/dist/admin/settings-email.d.ts.map +1 -0
- package/dist/admin/settings-email.js +189 -0
- package/dist/admin/settings-email.js.map +1 -0
- package/dist/admin/settings-federation.d.ts +48 -0
- package/dist/admin/settings-federation.d.ts.map +1 -0
- package/dist/admin/settings-federation.js +123 -0
- package/dist/admin/settings-federation.js.map +1 -0
- package/dist/admin/settings-general.d.ts +12 -0
- package/dist/admin/settings-general.d.ts.map +1 -0
- package/dist/admin/settings-general.js +48 -0
- package/dist/admin/settings-general.js.map +1 -0
- package/dist/admin/settings-page.d.ts +119 -0
- package/dist/admin/settings-page.d.ts.map +1 -0
- package/dist/admin/settings-page.js +132 -0
- package/dist/admin/settings-page.js.map +1 -0
- package/dist/admin/settings-pages.d.ts +30 -0
- package/dist/admin/settings-pages.d.ts.map +1 -0
- package/dist/admin/settings-pages.js +43 -0
- package/dist/admin/settings-pages.js.map +1 -0
- package/dist/admin/settings-permalinks.d.ts +16 -0
- package/dist/admin/settings-permalinks.d.ts.map +1 -0
- package/dist/admin/settings-permalinks.js +32 -0
- package/dist/admin/settings-permalinks.js.map +1 -0
- package/dist/admin/settings-reading.d.ts +34 -0
- package/dist/admin/settings-reading.d.ts.map +1 -0
- package/dist/admin/settings-reading.js +49 -0
- package/dist/admin/settings-reading.js.map +1 -0
- package/dist/admin/settings.d.ts +339 -96
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +600 -308
- package/dist/admin/settings.js.map +1 -1
- package/dist/admin/store.d.ts +606 -152
- package/dist/admin/store.d.ts.map +1 -1
- package/dist/admin/store.js +863 -268
- package/dist/admin/store.js.map +1 -1
- package/dist/admin/taxonomy.d.ts +114 -0
- package/dist/admin/taxonomy.d.ts.map +1 -0
- package/dist/admin/taxonomy.js +289 -0
- package/dist/admin/taxonomy.js.map +1 -0
- package/dist/admin/templates.d.ts +46 -14
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +46 -14
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/throttle.d.ts +84 -0
- package/dist/admin/throttle.d.ts.map +1 -0
- package/dist/admin/throttle.js +143 -0
- package/dist/admin/throttle.js.map +1 -0
- package/dist/admin/tools.d.ts +111 -0
- package/dist/admin/tools.d.ts.map +1 -0
- package/dist/admin/tools.js +182 -0
- package/dist/admin/tools.js.map +1 -0
- package/dist/admin/uploads.d.ts +28 -2
- package/dist/admin/uploads.d.ts.map +1 -1
- package/dist/admin/uploads.js +43 -4
- package/dist/admin/uploads.js.map +1 -1
- package/dist/admin/users.d.ts +100 -13
- package/dist/admin/users.d.ts.map +1 -1
- package/dist/admin/users.js +412 -39
- package/dist/admin/users.js.map +1 -1
- package/dist/cache.d.ts +141 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +207 -0
- package/dist/cache.js.map +1 -0
- package/dist/cli.d.ts +14 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +429 -21
- package/dist/cli.js.map +1 -1
- package/dist/comments/akismet.d.ts +130 -0
- package/dist/comments/akismet.d.ts.map +1 -0
- package/dist/comments/akismet.js +274 -0
- package/dist/comments/akismet.js.map +1 -0
- package/dist/comments/conversation.d.ts +29 -0
- package/dist/comments/conversation.d.ts.map +1 -0
- package/dist/comments/conversation.js +60 -0
- package/dist/comments/conversation.js.map +1 -0
- package/dist/comments/form.d.ts +123 -0
- package/dist/comments/form.d.ts.map +1 -0
- package/dist/comments/form.js +79 -0
- package/dist/comments/form.js.map +1 -0
- package/dist/comments/index.d.ts +16 -0
- package/dist/comments/index.d.ts.map +1 -0
- package/dist/comments/index.js +10 -0
- package/dist/comments/index.js.map +1 -0
- package/dist/comments/markdown.d.ts +8 -0
- package/dist/comments/markdown.d.ts.map +1 -0
- package/dist/comments/markdown.js +85 -0
- package/dist/comments/markdown.js.map +1 -0
- package/dist/comments/moderate.d.ts +71 -0
- package/dist/comments/moderate.d.ts.map +1 -0
- package/dist/comments/moderate.js +88 -0
- package/dist/comments/moderate.js.map +1 -0
- package/dist/comments/policy.d.ts +57 -0
- package/dist/comments/policy.d.ts.map +1 -0
- package/dist/comments/policy.js +80 -0
- package/dist/comments/policy.js.map +1 -0
- package/dist/comments/records.d.ts +266 -0
- package/dist/comments/records.d.ts.map +1 -0
- package/dist/comments/records.js +487 -0
- package/dist/comments/records.js.map +1 -0
- package/dist/comments/routes.d.ts +60 -0
- package/dist/comments/routes.d.ts.map +1 -0
- package/dist/comments/routes.js +212 -0
- package/dist/comments/routes.js.map +1 -0
- package/dist/comments/submission.d.ts +297 -0
- package/dist/comments/submission.d.ts.map +1 -0
- package/dist/comments/submission.js +280 -0
- package/dist/comments/submission.js.map +1 -0
- package/dist/comments/viewer.d.ts +21 -0
- package/dist/comments/viewer.d.ts.map +1 -0
- package/dist/comments/viewer.js +45 -0
- package/dist/comments/viewer.js.map +1 -0
- package/dist/config.d.ts +225 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +121 -6
- package/dist/config.js.map +1 -1
- package/dist/contact/delivery.d.ts +60 -0
- package/dist/contact/delivery.d.ts.map +1 -0
- package/dist/contact/delivery.js +87 -0
- package/dist/contact/delivery.js.map +1 -0
- package/dist/contact/form.d.ts +130 -0
- package/dist/contact/form.d.ts.map +1 -0
- package/dist/contact/form.js +163 -0
- package/dist/contact/form.js.map +1 -0
- package/dist/contact/index.d.ts +17 -0
- package/dist/contact/index.d.ts.map +1 -0
- package/dist/contact/index.js +13 -0
- package/dist/contact/index.js.map +1 -0
- package/dist/contact/records.d.ts +124 -0
- package/dist/contact/records.d.ts.map +1 -0
- package/dist/contact/records.js +218 -0
- package/dist/contact/records.js.map +1 -0
- package/dist/contact/routes.d.ts +17 -0
- package/dist/contact/routes.d.ts.map +1 -0
- package/dist/contact/routes.js +127 -0
- package/dist/contact/routes.js.map +1 -0
- package/dist/contact/submission.d.ts +103 -0
- package/dist/contact/submission.d.ts.map +1 -0
- package/dist/contact/submission.js +166 -0
- package/dist/contact/submission.js.map +1 -0
- package/dist/content/document.d.ts +7 -2
- 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 +7 -2
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +4 -1
- package/dist/content/index.js.map +1 -1
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +24 -2
- package/dist/content/markdown.js.map +1 -1
- package/dist/content/parser.d.ts.map +1 -1
- package/dist/content/parser.js +11 -4
- package/dist/content/parser.js.map +1 -1
- package/dist/content/save.d.ts +5 -0
- package/dist/content/save.d.ts.map +1 -1
- package/dist/content/save.js +44 -1
- package/dist/content/save.js.map +1 -1
- package/dist/content/schedule.d.ts +125 -0
- package/dist/content/schedule.d.ts.map +1 -0
- package/dist/content/schedule.js +207 -0
- package/dist/content/schedule.js.map +1 -0
- package/dist/content/search.d.ts +64 -0
- package/dist/content/search.d.ts.map +1 -0
- package/dist/content/search.js +136 -0
- package/dist/content/search.js.map +1 -0
- package/dist/content/store.d.ts +220 -7
- package/dist/content/store.d.ts.map +1 -1
- package/dist/content/store.js +392 -67
- package/dist/content/store.js.map +1 -1
- package/dist/content/sync.d.ts +7 -1
- package/dist/content/sync.d.ts.map +1 -1
- package/dist/content/sync.js +18 -10
- package/dist/content/sync.js.map +1 -1
- package/dist/content/time.d.ts +56 -0
- package/dist/content/time.d.ts.map +1 -0
- package/dist/content/time.js +141 -0
- package/dist/content/time.js.map +1 -0
- package/dist/content/writer.d.ts.map +1 -1
- package/dist/content/writer.js +3 -0
- package/dist/content/writer.js.map +1 -1
- package/dist/env.d.ts +70 -5
- package/dist/env.d.ts.map +1 -1
- package/dist/federation/actor.d.ts +95 -41
- package/dist/federation/actor.d.ts.map +1 -1
- package/dist/federation/actor.js +180 -53
- package/dist/federation/actor.js.map +1 -1
- package/dist/federation/article.d.ts +44 -17
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +98 -46
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/delivery.d.ts +63 -15
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +154 -80
- package/dist/federation/delivery.js.map +1 -1
- package/dist/federation/federation.d.ts +22 -17
- package/dist/federation/federation.d.ts.map +1 -1
- package/dist/federation/federation.js +98 -77
- package/dist/federation/federation.js.map +1 -1
- package/dist/federation/followers.d.ts +3 -2
- package/dist/federation/followers.d.ts.map +1 -1
- package/dist/federation/followers.js +6 -5
- package/dist/federation/followers.js.map +1 -1
- package/dist/federation/import-wordpress.d.ts +128 -0
- package/dist/federation/import-wordpress.d.ts.map +1 -0
- package/dist/federation/import-wordpress.js +426 -0
- package/dist/federation/import-wordpress.js.map +1 -0
- package/dist/federation/inbox.d.ts +36 -13
- package/dist/federation/inbox.d.ts.map +1 -1
- package/dist/federation/inbox.js +120 -49
- package/dist/federation/inbox.js.map +1 -1
- package/dist/federation/index.d.ts +22 -10
- package/dist/federation/index.d.ts.map +1 -1
- package/dist/federation/index.js +13 -8
- package/dist/federation/index.js.map +1 -1
- package/dist/federation/keys.d.ts +98 -20
- package/dist/federation/keys.d.ts.map +1 -1
- package/dist/federation/keys.js +269 -39
- package/dist/federation/keys.js.map +1 -1
- package/dist/federation/mount.d.ts +46 -10
- package/dist/federation/mount.d.ts.map +1 -1
- package/dist/federation/mount.js +300 -28
- package/dist/federation/mount.js.map +1 -1
- package/dist/federation/paths.d.ts +23 -35
- package/dist/federation/paths.d.ts.map +1 -1
- package/dist/federation/paths.js +26 -39
- package/dist/federation/paths.js.map +1 -1
- package/dist/federation/records.d.ts +223 -0
- package/dist/federation/records.d.ts.map +1 -0
- package/dist/federation/records.js +506 -0
- package/dist/federation/records.js.map +1 -0
- package/dist/federation/relays.d.ts +114 -0
- package/dist/federation/relays.d.ts.map +1 -0
- package/dist/federation/relays.js +290 -0
- package/dist/federation/relays.js.map +1 -0
- package/dist/federation/replies.d.ts +80 -0
- package/dist/federation/replies.d.ts.map +1 -0
- package/dist/federation/replies.js +166 -0
- package/dist/federation/replies.js.map +1 -0
- package/dist/federation/wordpress.d.ts +131 -0
- package/dist/federation/wordpress.d.ts.map +1 -0
- package/dist/federation/wordpress.js +341 -0
- package/dist/federation/wordpress.js.map +1 -0
- package/dist/files/atomic.d.ts +103 -0
- package/dist/files/atomic.d.ts.map +1 -0
- package/dist/files/atomic.js +150 -0
- package/dist/files/atomic.js.map +1 -0
- package/dist/files/index.d.ts +3 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +2 -0
- package/dist/files/index.js.map +1 -0
- package/dist/forms/protection.d.ts +85 -0
- package/dist/forms/protection.d.ts.map +1 -0
- package/dist/forms/protection.js +116 -0
- package/dist/forms/protection.js.map +1 -0
- package/dist/images/icons.d.ts +59 -0
- package/dist/images/icons.d.ts.map +1 -0
- package/dist/images/icons.js +131 -0
- package/dist/images/icons.js.map +1 -0
- package/dist/images/index.d.ts +7 -0
- package/dist/images/index.d.ts.map +1 -0
- package/dist/images/index.js +4 -0
- package/dist/images/index.js.map +1 -0
- package/dist/images/markup.d.ts +47 -0
- package/dist/images/markup.d.ts.map +1 -0
- package/dist/images/markup.js +175 -0
- package/dist/images/markup.js.map +1 -0
- package/dist/images/paths.d.ts +34 -0
- package/dist/images/paths.d.ts.map +1 -0
- package/dist/images/paths.js +41 -0
- package/dist/images/paths.js.map +1 -0
- package/dist/images/variants.d.ts +104 -0
- package/dist/images/variants.d.ts.map +1 -0
- package/dist/images/variants.js +320 -0
- package/dist/images/variants.js.map +1 -0
- package/dist/index.d.ts +123 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +344 -25
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +18 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +34 -3
- package/dist/init.js.map +1 -1
- package/dist/mail/brevo.d.ts +35 -0
- package/dist/mail/brevo.d.ts.map +1 -0
- package/dist/mail/brevo.js +85 -0
- package/dist/mail/brevo.js.map +1 -0
- package/dist/mail/credentials.d.ts +62 -0
- package/dist/mail/credentials.d.ts.map +1 -0
- package/dist/mail/credentials.js +86 -0
- package/dist/mail/credentials.js.map +1 -0
- package/dist/mail/index.d.ts +15 -0
- package/dist/mail/index.d.ts.map +1 -0
- package/dist/mail/index.js +8 -0
- package/dist/mail/index.js.map +1 -0
- package/dist/mail/memory.d.ts +35 -0
- package/dist/mail/memory.d.ts.map +1 -0
- package/dist/mail/memory.js +29 -0
- package/dist/mail/memory.js.map +1 -0
- package/dist/mail/provider.d.ts +80 -0
- package/dist/mail/provider.d.ts.map +1 -0
- package/dist/mail/provider.js +23 -0
- package/dist/mail/provider.js.map +1 -0
- package/dist/mail/service.d.ts +156 -0
- package/dist/mail/service.d.ts.map +1 -0
- package/dist/mail/service.js +265 -0
- package/dist/mail/service.js.map +1 -0
- package/dist/mail/smtp.d.ts +39 -0
- package/dist/mail/smtp.d.ts.map +1 -0
- package/dist/mail/smtp.js +58 -0
- package/dist/mail/smtp.js.map +1 -0
- package/dist/mail/templates.d.ts +91 -0
- package/dist/mail/templates.d.ts.map +1 -0
- package/dist/mail/templates.js +69 -0
- package/dist/mail/templates.js.map +1 -0
- package/dist/notifications/comments.d.ts +66 -0
- package/dist/notifications/comments.d.ts.map +1 -0
- package/dist/notifications/comments.js +151 -0
- package/dist/notifications/comments.js.map +1 -0
- package/dist/notifications/digest.d.ts +135 -0
- package/dist/notifications/digest.d.ts.map +1 -0
- package/dist/notifications/digest.js +287 -0
- package/dist/notifications/digest.js.map +1 -0
- package/dist/notifications/index.d.ts +13 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +8 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/links.d.ts +60 -0
- package/dist/notifications/links.d.ts.map +1 -0
- package/dist/notifications/links.js +63 -0
- package/dist/notifications/links.js.map +1 -0
- package/dist/notifications/optouts.d.ts +48 -0
- package/dist/notifications/optouts.d.ts.map +1 -0
- package/dist/notifications/optouts.js +93 -0
- package/dist/notifications/optouts.js.map +1 -0
- package/dist/notifications/preferences.d.ts +158 -0
- package/dist/notifications/preferences.d.ts.map +1 -0
- package/dist/notifications/preferences.js +195 -0
- package/dist/notifications/preferences.js.map +1 -0
- package/dist/notifications/routes.d.ts +28 -0
- package/dist/notifications/routes.d.ts.map +1 -0
- package/dist/notifications/routes.js +184 -0
- package/dist/notifications/routes.js.map +1 -0
- package/dist/notifications/tokens.d.ts +60 -0
- package/dist/notifications/tokens.d.ts.map +1 -0
- package/dist/notifications/tokens.js +125 -0
- package/dist/notifications/tokens.js.map +1 -0
- package/dist/notify.d.ts +84 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +149 -0
- package/dist/notify.js.map +1 -0
- package/dist/web/archive.d.ts +49 -0
- package/dist/web/archive.d.ts.map +1 -0
- package/dist/web/archive.js +59 -0
- package/dist/web/archive.js.map +1 -0
- package/dist/web/assets.d.ts +6 -5
- package/dist/web/assets.d.ts.map +1 -1
- package/dist/web/assets.js +5 -7
- package/dist/web/assets.js.map +1 -1
- package/dist/web/authors.d.ts +143 -0
- package/dist/web/authors.d.ts.map +1 -0
- package/dist/web/authors.js +178 -0
- package/dist/web/authors.js.map +1 -0
- package/dist/web/comments.d.ts +60 -0
- package/dist/web/comments.d.ts.map +1 -0
- package/dist/web/comments.js +207 -0
- package/dist/web/comments.js.map +1 -0
- package/dist/web/context.d.ts +162 -28
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +123 -26
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts +209 -0
- package/dist/web/conversation.d.ts.map +1 -0
- package/dist/web/conversation.js +557 -0
- package/dist/web/conversation.js.map +1 -0
- package/dist/web/documents.d.ts +36 -6
- package/dist/web/documents.d.ts.map +1 -1
- package/dist/web/documents.js +52 -10
- package/dist/web/documents.js.map +1 -1
- package/dist/web/feed-atom.d.ts +22 -0
- package/dist/web/feed-atom.d.ts.map +1 -0
- package/dist/web/feed-atom.js +83 -0
- package/dist/web/feed-atom.js.map +1 -0
- package/dist/web/feed-item.d.ts +145 -0
- package/dist/web/feed-item.d.ts.map +1 -0
- package/dist/web/feed-item.js +120 -0
- package/dist/web/feed-item.js.map +1 -0
- package/dist/web/feed-json.d.ts +79 -0
- package/dist/web/feed-json.d.ts.map +1 -0
- package/dist/web/feed-json.js +53 -0
- package/dist/web/feed-json.js.map +1 -0
- package/dist/web/feed-rss.d.ts +26 -0
- package/dist/web/feed-rss.d.ts.map +1 -0
- package/dist/web/feed-rss.js +203 -0
- package/dist/web/feed-rss.js.map +1 -0
- package/dist/web/feed-source.d.ts +244 -0
- package/dist/web/feed-source.d.ts.map +1 -0
- package/dist/web/feed-source.js +201 -0
- package/dist/web/feed-source.js.map +1 -0
- package/dist/web/feed-xml.d.ts +63 -0
- package/dist/web/feed-xml.d.ts.map +1 -0
- package/dist/web/feed-xml.js +116 -0
- package/dist/web/feed-xml.js.map +1 -0
- package/dist/web/feeds.d.ts +31 -96
- package/dist/web/feeds.d.ts.map +1 -1
- package/dist/web/feeds.js +94 -198
- package/dist/web/feeds.js.map +1 -1
- package/dist/web/health.d.ts +31 -0
- package/dist/web/health.d.ts.map +1 -0
- package/dist/web/health.js +44 -0
- package/dist/web/health.js.map +1 -0
- package/dist/web/index.d.ts +30 -10
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +18 -7
- package/dist/web/index.js.map +1 -1
- package/dist/web/navigation.d.ts +195 -0
- package/dist/web/navigation.d.ts.map +1 -0
- package/dist/web/navigation.js +300 -0
- package/dist/web/navigation.js.map +1 -0
- package/dist/web/negotiate.d.ts +31 -0
- package/dist/web/negotiate.d.ts.map +1 -1
- package/dist/web/negotiate.js +31 -11
- package/dist/web/negotiate.js.map +1 -1
- package/dist/web/recent.d.ts +43 -0
- package/dist/web/recent.d.ts.map +1 -0
- package/dist/web/recent.js +37 -0
- package/dist/web/recent.js.map +1 -0
- package/dist/web/render.d.ts +203 -9
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +341 -17
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts +25 -8
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +854 -93
- package/dist/web/routes.js.map +1 -1
- package/dist/web/sanitize.d.ts +19 -0
- package/dist/web/sanitize.d.ts.map +1 -0
- package/dist/web/sanitize.js +272 -0
- package/dist/web/sanitize.js.map +1 -0
- package/dist/web/search.d.ts +79 -0
- package/dist/web/search.d.ts.map +1 -0
- package/dist/web/search.js +94 -0
- package/dist/web/search.js.map +1 -0
- package/dist/web/sitemap.d.ts +120 -0
- package/dist/web/sitemap.d.ts.map +1 -0
- package/dist/web/sitemap.js +199 -0
- package/dist/web/sitemap.js.map +1 -0
- package/dist/web/taxonomy.d.ts +152 -0
- package/dist/web/taxonomy.d.ts.map +1 -0
- package/dist/web/taxonomy.js +237 -0
- package/dist/web/taxonomy.js.map +1 -0
- package/dist/web/templates.d.ts +54 -16
- package/dist/web/templates.d.ts.map +1 -1
- package/dist/web/templates.js +109 -28
- package/dist/web/templates.js.map +1 -1
- package/dist/web/themes.d.ts +226 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +314 -0
- package/dist/web/themes.js.map +1 -0
- package/dist/webmention/discovery.d.ts +51 -0
- package/dist/webmention/discovery.d.ts.map +1 -0
- package/dist/webmention/discovery.js +176 -0
- package/dist/webmention/discovery.js.map +1 -0
- package/dist/webmention/html.d.ts +71 -0
- package/dist/webmention/html.d.ts.map +1 -0
- package/dist/webmention/html.js +285 -0
- package/dist/webmention/html.js.map +1 -0
- package/dist/webmention/index.d.ts +12 -0
- package/dist/webmention/index.d.ts.map +1 -0
- package/dist/webmention/index.js +8 -0
- package/dist/webmention/index.js.map +1 -0
- package/dist/webmention/links.d.ts +18 -0
- package/dist/webmention/links.d.ts.map +1 -0
- package/dist/webmention/links.js +64 -0
- package/dist/webmention/links.js.map +1 -0
- package/dist/webmention/microformats.d.ts +93 -0
- package/dist/webmention/microformats.d.ts.map +1 -0
- package/dist/webmention/microformats.js +376 -0
- package/dist/webmention/microformats.js.map +1 -0
- package/dist/webmention/receive.d.ts +141 -0
- package/dist/webmention/receive.d.ts.map +1 -0
- package/dist/webmention/receive.js +264 -0
- package/dist/webmention/receive.js.map +1 -0
- package/dist/webmention/routes.d.ts +37 -0
- package/dist/webmention/routes.d.ts.map +1 -0
- package/dist/webmention/routes.js +75 -0
- package/dist/webmention/routes.js.map +1 -0
- package/dist/webmention/service.d.ts +94 -0
- package/dist/webmention/service.d.ts.map +1 -0
- package/dist/webmention/service.js +207 -0
- package/dist/webmention/service.js.map +1 -0
- package/package.json +11 -6
- package/templates/site/content/_data/site.json +8 -0
- package/templates/site/content/pages/about.md +7 -0
- package/templates/site/content/posts/2026-01-01-hello-world.md +5 -3
- package/templates/site/geekity.config.ts +11 -1
- package/templates/site/tsconfig.json +1 -1
- package/themes/default/README.md +1216 -50
- package/themes/default/layouts/404.njk +2 -3
- package/themes/default/layouts/author.njk +36 -0
- package/themes/default/layouts/base.njk +161 -31
- package/themes/default/layouts/category.njk +27 -0
- package/themes/default/layouts/front-page.njk +56 -0
- package/themes/default/layouts/home.njk +17 -1
- package/themes/default/layouts/page.njk +57 -5
- package/themes/default/layouts/post.njk +78 -19
- package/themes/default/layouts/search.njk +57 -0
- package/themes/default/layouts/tag.njk +3 -6
- package/themes/default/mail/comment-digest.html.njk +37 -0
- package/themes/default/mail/comment-digest.subject.njk +3 -0
- package/themes/default/mail/comment-digest.txt.njk +40 -0
- package/themes/default/mail/comment-pending.html.njk +27 -0
- package/themes/default/mail/comment-pending.subject.njk +2 -0
- package/themes/default/mail/comment-pending.txt.njk +24 -0
- package/themes/default/mail/comment-reply.html.njk +21 -0
- package/themes/default/mail/comment-reply.subject.njk +2 -0
- package/themes/default/mail/comment-reply.txt.njk +22 -0
- package/themes/default/mail/contact-message.html.njk +24 -0
- package/themes/default/mail/contact-message.subject.njk +5 -0
- package/themes/default/mail/contact-message.txt.njk +20 -0
- package/themes/default/mail/password-changed.html.njk +18 -0
- package/themes/default/mail/password-changed.subject.njk +2 -0
- package/themes/default/mail/password-changed.txt.njk +17 -0
- package/themes/default/mail/password-reset.html.njk +22 -0
- package/themes/default/mail/password-reset.subject.njk +2 -0
- package/themes/default/mail/password-reset.txt.njk +18 -0
- package/themes/default/mail/test.html.njk +14 -0
- package/themes/default/mail/test.subject.njk +2 -0
- package/themes/default/mail/test.txt.njk +12 -0
- package/themes/default/partials/archive.njk +27 -0
- package/themes/default/partials/bio.njk +71 -0
- package/themes/default/partials/comment-form.njk +137 -0
- package/themes/default/partials/contact-form.njk +88 -0
- package/themes/default/partials/conversation.njk +139 -0
- package/themes/default/partials/feeds.njk +26 -0
- package/themes/default/partials/jsonld.njk +120 -0
- package/themes/default/partials/menu.njk +32 -0
- package/themes/default/partials/pagination.njk +12 -6
- package/themes/default/partials/post-list.njk +51 -18
- package/themes/default/partials/search-form.njk +22 -0
- package/themes/default/partials/tags.njk +26 -5
- package/themes/default/static/highlight.js +4 -0
- package/themes/default/static/style.css +1142 -194
- package/themes/default/theme.json +9 -0
- package/admin/layouts/federation.njk +0 -145
- package/admin/layouts/login.njk +0 -23
- package/admin/layouts/settings.njk +0 -116
- package/admin/layouts/setup.njk +0 -27
- package/admin/layouts/users.njk +0 -91
- /package/admin/{layouts/_flash.njk → components/flash.njk} +0 -0
package/dist/admin/store.d.ts
CHANGED
|
@@ -3,26 +3,6 @@ export interface OpenAdminStoreOptions {
|
|
|
3
3
|
/** Directory the database lives in. Created if it is missing. */
|
|
4
4
|
dataDir: string;
|
|
5
5
|
}
|
|
6
|
-
/** An admin user. There is one role, so there is no role column. */
|
|
7
|
-
export interface User {
|
|
8
|
-
/** Row id, stable for the life of the user. */
|
|
9
|
-
readonly id: number;
|
|
10
|
-
/** Login name, unique and compared case sensitively. */
|
|
11
|
-
readonly username: string;
|
|
12
|
-
/** When the user was created, as an ISO 8601 instant. */
|
|
13
|
-
readonly createdAt: string;
|
|
14
|
-
}
|
|
15
|
-
/** A user with the column no screen may render: its password hash. */
|
|
16
|
-
export interface StoredUser extends User {
|
|
17
|
-
/** The PHC-encoded argon2id hash. */
|
|
18
|
-
readonly passwordHash: string;
|
|
19
|
-
}
|
|
20
|
-
/** What {@link AdminStore.createUser} is given. */
|
|
21
|
-
export interface CreateUserInput {
|
|
22
|
-
username: string;
|
|
23
|
-
/** The plain password. It is hashed on the way in and never stored. */
|
|
24
|
-
password: string;
|
|
25
|
-
}
|
|
26
6
|
/**
|
|
27
7
|
* A login, or the anonymous session that carries a CSRF token to a visitor who
|
|
28
8
|
* has not logged in yet.
|
|
@@ -70,45 +50,59 @@ export interface CreateSessionInput {
|
|
|
70
50
|
/** How long a session id is, in bytes. 32 is the 256 bits doc-5 asks for. */
|
|
71
51
|
export declare const SESSION_ID_BYTES = 32;
|
|
72
52
|
/**
|
|
73
|
-
*
|
|
53
|
+
* One outstanding password reset: the right to set one user's password once,
|
|
54
|
+
* until it is used or it expires.
|
|
74
55
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* `generateCryptoKeyPair` without translation.
|
|
56
|
+
* The token is only ever in hand at the moment it is made, because the link is
|
|
57
|
+
* the only copy: the database keeps its SHA-256, so reading the table tells
|
|
58
|
+
* somebody that a reset was asked for and nothing more.
|
|
79
59
|
*/
|
|
80
|
-
export
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
export interface ActorKey {
|
|
85
|
-
/**
|
|
86
|
-
* Which actor the pair belongs to. The site actor's identifier is a
|
|
87
|
-
* constant, not the handle, so renaming the handle does not orphan the keys.
|
|
88
|
-
*/
|
|
89
|
-
readonly identifier: string;
|
|
90
|
-
/** Which algorithm the pair is for. */
|
|
91
|
-
readonly algorithm: ActorKeyAlgorithm;
|
|
92
|
-
/** The private key as JWK, JSON encoded. Never leaves the server. */
|
|
93
|
-
readonly privateJwk: string;
|
|
94
|
-
/** The public key as JWK, JSON encoded. This is what the actor publishes. */
|
|
95
|
-
readonly publicJwk: string;
|
|
96
|
-
/** When the pair was generated, as an ISO 8601 instant. */
|
|
60
|
+
export interface PasswordReset {
|
|
61
|
+
/** Whose password this sets. */
|
|
62
|
+
readonly userId: number;
|
|
63
|
+
/** When it was asked for, as an ISO 8601 instant. */
|
|
97
64
|
readonly createdAt: string;
|
|
65
|
+
/** When it stops working, as an ISO 8601 instant. */
|
|
66
|
+
readonly expiresAt: string;
|
|
67
|
+
}
|
|
68
|
+
/** A {@link PasswordReset} with the one thing the database never keeps. */
|
|
69
|
+
export interface IssuedPasswordReset extends PasswordReset {
|
|
70
|
+
/**
|
|
71
|
+
* The token itself, 256 random bits hex encoded, handed back exactly once.
|
|
72
|
+
* It goes in the link and nowhere else.
|
|
73
|
+
*/
|
|
74
|
+
readonly token: string;
|
|
75
|
+
}
|
|
76
|
+
/** What {@link AdminStore.createPasswordReset} is given. */
|
|
77
|
+
export interface CreatePasswordResetInput {
|
|
78
|
+
/** Whose password the link will set. */
|
|
79
|
+
userId: number;
|
|
80
|
+
/** How long the link lasts, in seconds. */
|
|
81
|
+
lifetimeSeconds: number;
|
|
82
|
+
/** The clock, injectable so expiry is testable. Defaults to now. */
|
|
83
|
+
now?: Date | undefined;
|
|
98
84
|
}
|
|
99
|
-
/** An {@link ActorKey} before the store has stamped it with a creation time. */
|
|
100
|
-
export type NewActorKey = Omit<ActorKey, 'createdAt'>;
|
|
101
85
|
/**
|
|
102
86
|
* A remote actor that follows this site.
|
|
103
87
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
88
|
+
* The followers are irreplaceable — an actor that followed and was forgotten
|
|
89
|
+
* never hears from the site again and has no way of noticing — so
|
|
90
|
+
* `content/_data/federation/followers.json` is where they are kept
|
|
91
|
+
* (decision-9), and this row is the index of that file, emptied and read back
|
|
92
|
+
* on every boot. The display columns are a copy of what the actor said about
|
|
93
|
+
* itself when it followed, so the admin can list its followers without
|
|
94
|
+
* dereferencing every one of them.
|
|
110
95
|
*/
|
|
111
96
|
export interface Follower {
|
|
97
|
+
/**
|
|
98
|
+
* Which user is followed (decision-14).
|
|
99
|
+
*
|
|
100
|
+
* Every user is an actor with followers of their own, so a follower is only
|
|
101
|
+
* ever a follower *of somebody*: the column is what makes one person's
|
|
102
|
+
* followers collection, and one person's delivery, theirs. It is the name of
|
|
103
|
+
* the directory the file came from rather than anything the file says.
|
|
104
|
+
*/
|
|
105
|
+
readonly username: string;
|
|
112
106
|
/** The follower's ActivityStreams id, which is what identifies it. */
|
|
113
107
|
readonly actorId: string;
|
|
114
108
|
/** Where an activity addressed to this follower is delivered. */
|
|
@@ -166,40 +160,48 @@ export interface InboxActivity {
|
|
|
166
160
|
readonly actorId: string;
|
|
167
161
|
/** What it was about — the post that was liked, the note replied to — or `null`. */
|
|
168
162
|
readonly objectId: string | null;
|
|
163
|
+
/**
|
|
164
|
+
* Which of this site's users it was addressed to, or `null` for one
|
|
165
|
+
* delivered to the shared inbox without naming one.
|
|
166
|
+
*
|
|
167
|
+
* decision-14 makes every user an actor, so the log records whose inbox was
|
|
168
|
+
* told as well as what it was told. Derived from the log line rather than
|
|
169
|
+
* from the activity, because the addressee is a fact about the delivery.
|
|
170
|
+
*/
|
|
171
|
+
readonly recipient: string | null;
|
|
172
|
+
/**
|
|
173
|
+
* The object this activity answers, for a `Create` that carried an
|
|
174
|
+
* `inReplyTo`, and `null` for everything else.
|
|
175
|
+
*
|
|
176
|
+
* Derived from {@link InboxActivity.json} by {@link replyTargetOf} rather
|
|
177
|
+
* than supplied, so an index rebuilt from the inbox log holds exactly what
|
|
178
|
+
* the live one holds. It is a column so a post's replies can be counted
|
|
179
|
+
* without reading every activity the site was ever sent.
|
|
180
|
+
*/
|
|
181
|
+
readonly inReplyTo: string | null;
|
|
169
182
|
/** When it arrived, as an ISO 8601 instant. */
|
|
170
183
|
readonly receivedAt: string;
|
|
171
184
|
/** The activity as compacted JSON-LD, exactly as it was received. */
|
|
172
185
|
readonly json: string;
|
|
173
186
|
}
|
|
174
|
-
/** An {@link InboxActivity} before the store has given it a row and a time. */
|
|
175
|
-
export type NewInboxActivity = Omit<InboxActivity, 'id' | 'receivedAt'>;
|
|
176
187
|
/**
|
|
177
|
-
*
|
|
188
|
+
* An {@link InboxActivity} before the store has given it a row and the reply
|
|
189
|
+
* target it derives.
|
|
178
190
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* post that is no longer there — so the compacted JSON-LD is stored as it went
|
|
184
|
-
* out.
|
|
191
|
+
* `receivedAt` is optional and defaults to now, exactly as a follower's
|
|
192
|
+
* `followedAt` is: naming one is what lets the boot rebuild put the log's own
|
|
193
|
+
* arrival times back rather than stamping every activity with the moment the
|
|
194
|
+
* index was rebuilt.
|
|
185
195
|
*/
|
|
186
|
-
export
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/** When the activity was first built, as an ISO 8601 instant. */
|
|
196
|
-
readonly createdAt: string;
|
|
197
|
-
/** The activity as compacted JSON-LD, exactly as it was delivered. */
|
|
198
|
-
readonly json: string;
|
|
199
|
-
}
|
|
200
|
-
/** An {@link OutboundActivity} before the store has timed it. */
|
|
201
|
-
export type NewOutboundActivity = Omit<OutboundActivity, 'createdAt'> & {
|
|
202
|
-
createdAt?: string | undefined;
|
|
196
|
+
export type NewInboxActivity = Omit<InboxActivity, 'id' | 'receivedAt' | 'inReplyTo' | 'recipient'> & {
|
|
197
|
+
receivedAt?: string | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Who it was addressed to, when the delivery said. Optional and `null` by
|
|
200
|
+
* default: an activity that reached the shared inbox without naming one of
|
|
201
|
+
* this site's actors is addressed to nobody in particular, and so is every
|
|
202
|
+
* line of a log written before decision-14.
|
|
203
|
+
*/
|
|
204
|
+
recipient?: string | null | undefined;
|
|
203
205
|
};
|
|
204
206
|
/** How one delivery of one activity to one follower ended. */
|
|
205
207
|
export declare const DELIVERY_STATUSES: readonly ['sent', 'queued', 'failed'];
|
|
@@ -212,11 +214,37 @@ export declare const DELIVERY_STATUSES: readonly ['sent', 'queued', 'failed'];
|
|
|
212
214
|
* `failed` is a delivery that threw, with the reason in the row.
|
|
213
215
|
*/
|
|
214
216
|
export type DeliveryStatus = (typeof DELIVERY_STATUSES)[number];
|
|
215
|
-
/**
|
|
217
|
+
/**
|
|
218
|
+
* How one attempt to deliver one activity to one recipient ended, and what the
|
|
219
|
+
* activity was.
|
|
220
|
+
*
|
|
221
|
+
* The whole of what SQLite keeps about anything the site has sent (decision-9).
|
|
222
|
+
* No payload goes with it: an activity is rebuilt from the post's file at the
|
|
223
|
+
* moment somebody asks for it to go again, so storing the bytes that went out
|
|
224
|
+
* last time would only be a second, staler answer to the same question. What
|
|
225
|
+
* is left is a cache of outcomes, and a site that deletes its database loses
|
|
226
|
+
* nothing but the record of how yesterday's delivery went.
|
|
227
|
+
*
|
|
228
|
+
* The activity's own columns are here rather than in a table of their own
|
|
229
|
+
* because there is no longer anything else to put in one: they are what the
|
|
230
|
+
* federation screen reads to say what went out and when.
|
|
231
|
+
*/
|
|
216
232
|
export interface Delivery {
|
|
217
|
-
/**
|
|
233
|
+
/** The id of the activity that was delivered. */
|
|
218
234
|
readonly activityId: string;
|
|
219
|
-
/**
|
|
235
|
+
/** `Create`, `Update` or `Delete`. */
|
|
236
|
+
readonly activityType: string;
|
|
237
|
+
/**
|
|
238
|
+
* The ActivityStreams id of what it was about: a post, or the site's own
|
|
239
|
+
* actor when the profile itself was what moved.
|
|
240
|
+
*/
|
|
241
|
+
readonly objectId: string;
|
|
242
|
+
/**
|
|
243
|
+
* The post's slug when the activity went out, or `null` for an activity
|
|
244
|
+
* about no post — which is what an actor `Update` is.
|
|
245
|
+
*/
|
|
246
|
+
readonly slug: string | null;
|
|
247
|
+
/** Which follower or relay it was delivered to. */
|
|
220
248
|
readonly actorId: string;
|
|
221
249
|
/** The inbox actually used, which is the shared one when the follower has one. */
|
|
222
250
|
readonly inboxId: string;
|
|
@@ -231,48 +259,237 @@ export interface Delivery {
|
|
|
231
259
|
export type NewDelivery = Omit<Delivery, 'attemptedAt'> & {
|
|
232
260
|
attemptedAt?: string | undefined;
|
|
233
261
|
};
|
|
262
|
+
/** Where a relay subscription stands (FEP-ae0c). */
|
|
263
|
+
export declare const RELAY_STATES: readonly ['pending', 'accepted', 'rejected'];
|
|
234
264
|
/**
|
|
235
|
-
*
|
|
265
|
+
* One of {@link RELAY_STATES}.
|
|
236
266
|
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
267
|
+
* `pending` is a `Follow` that has gone out and not been answered — which may
|
|
268
|
+
* take days, because a relay is allowed to hold one for a human to approve.
|
|
269
|
+
* `accepted` is one the relay answered `Accept` to, and the only state the
|
|
270
|
+
* site delivers to. `rejected` is one it answered `Reject` to, with whatever
|
|
271
|
+
* it said in {@link Relay.reason}.
|
|
242
272
|
*/
|
|
243
|
-
export
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
273
|
+
export type RelayState = (typeof RELAY_STATES)[number];
|
|
274
|
+
/**
|
|
275
|
+
* The site's subscription to one relay.
|
|
276
|
+
*
|
|
277
|
+
* The list of relays itself is a setting, and so lives in `site.json`; this is
|
|
278
|
+
* the state of the handshake with each of them, which is operational rather
|
|
279
|
+
* than editorial. Keyed by the inbox because that is the only thing known when the
|
|
280
|
+
* `Follow` goes out: a relay's actor id is not learned until it answers.
|
|
281
|
+
*/
|
|
282
|
+
export interface Relay {
|
|
283
|
+
/** The relay's inbox, which is what the site was given and what it delivers to. */
|
|
284
|
+
readonly inboxId: string;
|
|
285
|
+
/** The relay actor's id, once it has answered, and `null` until then. */
|
|
286
|
+
readonly actorId: string | null;
|
|
287
|
+
/** Where the subscription stands. */
|
|
288
|
+
readonly state: RelayState;
|
|
289
|
+
/** Why a `Reject` was a reject, when it gave a reason, or `null`. */
|
|
290
|
+
readonly reason: string | null;
|
|
291
|
+
/** The id of the `Follow` that was sent, which an `Accept` names. */
|
|
292
|
+
readonly followId: string | null;
|
|
293
|
+
/** When the site first subscribed, as an ISO 8601 instant. */
|
|
294
|
+
readonly createdAt: string;
|
|
295
|
+
/** When the subscription last moved — accepted, rejected, re-followed. */
|
|
296
|
+
readonly updatedAt: string;
|
|
297
|
+
}
|
|
298
|
+
/** A {@link Relay} before the store has timed it. */
|
|
299
|
+
export type NewRelay = Omit<Relay, 'createdAt' | 'updatedAt'> & {
|
|
300
|
+
createdAt?: string | undefined;
|
|
301
|
+
};
|
|
302
|
+
/** How one webmention this site sent to one page ended. */
|
|
303
|
+
export declare const WEBMENTION_SEND_STATUSES: readonly ['sent', 'none', 'failed'];
|
|
304
|
+
/**
|
|
305
|
+
* One of {@link WEBMENTION_SEND_STATUSES}.
|
|
306
|
+
*
|
|
307
|
+
* `sent` is an endpoint that accepted the notification. `none` is a page that
|
|
308
|
+
* advertises no endpoint, which is most of the web and is not a failure —
|
|
309
|
+
* recording it is what stops the sender asking the same page again on every
|
|
310
|
+
* edit and what tells a person why nothing went. `failed` is an endpoint that
|
|
311
|
+
* was there and refused, with the reason in the row.
|
|
312
|
+
*/
|
|
313
|
+
export type WebmentionSendStatus = (typeof WEBMENTION_SEND_STATUSES)[number];
|
|
314
|
+
/**
|
|
315
|
+
* How one attempt to tell one page that a post links to it ended.
|
|
316
|
+
*
|
|
317
|
+
* The whole of what SQLite keeps about the webmentions a site has sent, and a
|
|
318
|
+
* cache like every other outcome here (decision-9): the links are in the
|
|
319
|
+
* post's file, so a database thrown away costs the record of how yesterday's
|
|
320
|
+
* notification went and nothing else. One row per (post, target), because the
|
|
321
|
+
* question it answers is "where does this post stand with that page" and a
|
|
322
|
+
* resend moves that answer rather than adding a second one.
|
|
323
|
+
*/
|
|
324
|
+
export interface SentWebmention {
|
|
325
|
+
/** The post the links were in. */
|
|
326
|
+
readonly slug: string;
|
|
327
|
+
/** The post's absolute URL, which is the `source` that was sent. */
|
|
328
|
+
readonly source: string;
|
|
329
|
+
/** The page that was linked to, which is the `target` that was sent. */
|
|
330
|
+
readonly target: string;
|
|
331
|
+
/** The endpoint it was sent to, or `null` when the target advertised none. */
|
|
332
|
+
readonly endpoint: string | null;
|
|
333
|
+
/** How it went. */
|
|
334
|
+
readonly status: WebmentionSendStatus;
|
|
335
|
+
/** Why it failed, or `null`. */
|
|
336
|
+
readonly error: string | null;
|
|
337
|
+
/** When the attempt was made, as an ISO 8601 instant. */
|
|
338
|
+
readonly attemptedAt: string;
|
|
339
|
+
}
|
|
340
|
+
/** A {@link SentWebmention} before the store has timed it. */
|
|
341
|
+
export type NewSentWebmention = Omit<SentWebmention, 'attemptedAt'> & {
|
|
342
|
+
attemptedAt?: string | undefined;
|
|
343
|
+
};
|
|
344
|
+
/** Where a comment came from. */
|
|
345
|
+
export declare const COMMENT_SOURCES: readonly ['comment', 'webmention'];
|
|
346
|
+
/**
|
|
347
|
+
* One of {@link COMMENT_SOURCES}.
|
|
348
|
+
*
|
|
349
|
+
* `comment` is the form under the post. `webmention` is another site's post
|
|
350
|
+
* pointing at this one (TASK-51), which lands in the same file with the same
|
|
351
|
+
* shape and is told apart only by this.
|
|
352
|
+
*/
|
|
353
|
+
export type CommentSource = (typeof COMMENT_SOURCES)[number];
|
|
354
|
+
/** What a comment is: something written, or a wordless pointer at the post. */
|
|
355
|
+
export declare const COMMENT_KINDS: readonly ['reply', 'like', 'boost', 'mention', 'repost'];
|
|
356
|
+
/**
|
|
357
|
+
* One of {@link COMMENT_KINDS}. The same five a conversation knows.
|
|
358
|
+
*
|
|
359
|
+
* `reply`, `like` and `boost` are the fediverse's three. `repost` and
|
|
360
|
+
* `mention` are the webmention vocabulary's two extra: a repost is a boost by
|
|
361
|
+
* another name and is shown with them, and a mention is the one thing neither
|
|
362
|
+
* of the others is — somebody's page pointing at this one without answering
|
|
363
|
+
* it (TASK-51).
|
|
364
|
+
*/
|
|
365
|
+
export type CommentKind = (typeof COMMENT_KINDS)[number];
|
|
366
|
+
/** Where a comment stands with the moderator. */
|
|
367
|
+
export declare const COMMENT_STATUSES: readonly ['pending', 'approved', 'spam'];
|
|
368
|
+
/**
|
|
369
|
+
* One of {@link COMMENT_STATUSES}.
|
|
370
|
+
*
|
|
371
|
+
* `pending` is waiting for somebody to look at it, and is the state almost
|
|
372
|
+
* every comment starts in; `approved` is on the page and in the feeds; `spam`
|
|
373
|
+
* is kept rather than deleted, so a checker can be told it was wrong and so a
|
|
374
|
+
* mistake can be undone.
|
|
375
|
+
*/
|
|
376
|
+
export type CommentStatus = (typeof COMMENT_STATUSES)[number];
|
|
377
|
+
/** Who wrote a comment, as much as the site knows. */
|
|
378
|
+
export interface CommentAuthor {
|
|
379
|
+
/** The name they gave, which is what the page shows. */
|
|
380
|
+
name: string;
|
|
381
|
+
/** Their website, or `null`. Shown, and marked `nofollow ugc` like any link. */
|
|
382
|
+
url: string | null;
|
|
383
|
+
/**
|
|
384
|
+
* Their email, or `null`. **Never shown**: it is here for the moderator, for
|
|
385
|
+
* the auto-approval rule, and for the spam checker.
|
|
386
|
+
*/
|
|
387
|
+
email: string | null;
|
|
388
|
+
/**
|
|
389
|
+
* Their avatar, or `null`.
|
|
256
390
|
*
|
|
257
|
-
*
|
|
391
|
+
* Only a webmention ever has one, out of the `u-photo` of the source page's
|
|
392
|
+
* `h-card` (TASK-51): a form asks for no picture, and one it did ask for
|
|
393
|
+
* would be a stranger's file on somebody else's page. It is a URL on the
|
|
394
|
+
* author's own site, printed as an `<img>` exactly as a fediverse reply's is.
|
|
258
395
|
*/
|
|
259
|
-
|
|
396
|
+
avatar: string | null;
|
|
397
|
+
}
|
|
398
|
+
/** What a comment says, in both the forms the site keeps. */
|
|
399
|
+
export interface CommentContent {
|
|
400
|
+
/** What was typed, which is what a person wrote and the source of truth. */
|
|
401
|
+
markdown: string;
|
|
402
|
+
/** {@link CommentContent.markdown} through the restricted profile. */
|
|
403
|
+
html: string;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* One comment, as its post's file under `content/_data/comments/` holds it.
|
|
407
|
+
*
|
|
408
|
+
* The shape is deliberately wider than a form submission. A webmention
|
|
409
|
+
* (TASK-51) is somebody else's post pointing at this one: it has a `url` and no
|
|
410
|
+
* email, it may be a like rather than a reply, and it belongs in the same file
|
|
411
|
+
* and the same thread. So every entry says its `source` and its `kind`, and
|
|
412
|
+
* nothing assumes a person filled in a form.
|
|
413
|
+
*/
|
|
414
|
+
export interface CommentRecord {
|
|
415
|
+
/** Its name, unique across the site, and what a reply puts in `inReplyTo`. */
|
|
416
|
+
id: string;
|
|
417
|
+
/** Where it came from. */
|
|
418
|
+
source: CommentSource;
|
|
419
|
+
/** What it is. */
|
|
420
|
+
kind: CommentKind;
|
|
421
|
+
/** Where it stands with the moderator. */
|
|
422
|
+
status: CommentStatus;
|
|
423
|
+
/** Who wrote it. */
|
|
424
|
+
author: CommentAuthor;
|
|
425
|
+
/** What it says. */
|
|
426
|
+
content: CommentContent;
|
|
427
|
+
/** When it was submitted, as an ISO 8601 instant. */
|
|
428
|
+
submitted: string;
|
|
260
429
|
/**
|
|
261
|
-
*
|
|
262
|
-
*
|
|
430
|
+
* A salted hash of the address it came from, or `null`.
|
|
431
|
+
*
|
|
432
|
+
* The address itself is not kept: the file is published with the site and
|
|
433
|
+
* goes into git, and an IP address there would be a reader's home written
|
|
434
|
+
* into a public repository. The hash is enough to see that two comments came
|
|
435
|
+
* from one place, which is what a moderator is actually asking.
|
|
263
436
|
*/
|
|
264
|
-
|
|
437
|
+
addressHash: string | null;
|
|
438
|
+
/** The comment it answers, or `null` for one answering the post itself. */
|
|
439
|
+
inReplyTo: string | null;
|
|
265
440
|
/**
|
|
266
|
-
*
|
|
267
|
-
* `
|
|
268
|
-
*
|
|
441
|
+
* Where it lives when it lives somewhere else: the source page of a
|
|
442
|
+
* webmention, and `null` for a comment written on this site.
|
|
443
|
+
*
|
|
444
|
+
* It is what a later webmention from the same page is recognised by, which
|
|
445
|
+
* is how one updates the comment it made before instead of adding a second,
|
|
446
|
+
* and it is where the thread's permalink points for an entry this site did
|
|
447
|
+
* not host.
|
|
269
448
|
*/
|
|
270
|
-
|
|
449
|
+
url: string | null;
|
|
271
450
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
451
|
+
* Whether whoever wrote it asked to hear about replies to it (TASK-55).
|
|
452
|
+
*
|
|
453
|
+
* Only ever true for a comment that carries an `author.email`, because there
|
|
454
|
+
* would be nowhere to send it otherwise, and only ever set by somebody
|
|
455
|
+
* ticking the box on the form — a webmention has nobody to ask. What it buys
|
|
456
|
+
* is one message when a reply to this comment is approved, carrying an
|
|
457
|
+
* unsubscribe link that needs no login.
|
|
274
458
|
*/
|
|
275
|
-
|
|
459
|
+
notify: boolean;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* A {@link CommentRecord} with the post it is on.
|
|
463
|
+
*
|
|
464
|
+
* The file it lives in is named after the post's slug and records the post's
|
|
465
|
+
* permalink, so both are facts of the file rather than of the entry; the index
|
|
466
|
+
* carries them on the row because a query by id has no file to read them from.
|
|
467
|
+
*/
|
|
468
|
+
export interface PostComment extends CommentRecord {
|
|
469
|
+
/** The post's slug, which names the file the comment lives in. */
|
|
470
|
+
slug: string;
|
|
471
|
+
/** That post's permalink, for the moderation screen and the feeds. */
|
|
472
|
+
permalink: string;
|
|
473
|
+
}
|
|
474
|
+
/** How {@link AdminStore.listComments} narrows and pages. */
|
|
475
|
+
export interface ListCommentsOptions extends ListPageOptions {
|
|
476
|
+
/** Only comments at this status. Every status when it is not given. */
|
|
477
|
+
status?: CommentStatus | undefined;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Everything the database holds that is not the content index: the sessions,
|
|
481
|
+
* the followers and inbox indexes, the delivery outcomes, the relay handshake
|
|
482
|
+
* and the scheduler's watermark.
|
|
483
|
+
*
|
|
484
|
+
* All of it is a cache (decision-9). The followers and the inbox rows are read
|
|
485
|
+
* back from `content/_data/federation/` on every boot; the rest a site is free
|
|
486
|
+
* to lose, and the README says what losing it costs. It is deliberately not
|
|
487
|
+
* part of the {@link ContentStore}: the two share the file, one database per
|
|
488
|
+
* site with a migration ledger each, and nothing else.
|
|
489
|
+
*/
|
|
490
|
+
export interface AdminStore {
|
|
491
|
+
/** Absolute path of the SQLite file, the same one the content index uses. */
|
|
492
|
+
readonly file: string;
|
|
276
493
|
/** Start a session and hand back its id and CSRF token. */
|
|
277
494
|
createSession(input: CreateSessionInput): Session;
|
|
278
495
|
/**
|
|
@@ -294,35 +511,102 @@ export interface AdminStore {
|
|
|
294
511
|
except?: string;
|
|
295
512
|
}): number;
|
|
296
513
|
/**
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* `content/_data/site.json`.
|
|
514
|
+
* Issue a password reset link and hand back its token, which is the only
|
|
515
|
+
* time the token exists outside the link.
|
|
300
516
|
*/
|
|
301
|
-
|
|
517
|
+
createPasswordReset(input: CreatePasswordResetInput): IssuedPasswordReset;
|
|
302
518
|
/**
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
519
|
+
* What a token entitles its holder to, or `undefined` when it entitles them
|
|
520
|
+
* to nothing: no such token, or one that has expired. An expired row is
|
|
521
|
+
* deleted on the way past, as an expired session's is.
|
|
306
522
|
*/
|
|
307
|
-
|
|
523
|
+
getPasswordReset(token: string, now?: Date): PasswordReset | undefined;
|
|
524
|
+
/** Spend a token. Returns `false` when there was nothing to spend. */
|
|
525
|
+
deletePasswordReset(token: string): boolean;
|
|
308
526
|
/**
|
|
309
|
-
*
|
|
310
|
-
*
|
|
527
|
+
* Cancel every reset a user has outstanding, and say how many went.
|
|
528
|
+
*
|
|
529
|
+
* What a finished reset calls: the link that was used is spent, and so is
|
|
530
|
+
* every other one asked for in the meantime, because whoever set the
|
|
531
|
+
* password now owns the account and the others are only ways back in for
|
|
532
|
+
* somebody who does not.
|
|
311
533
|
*/
|
|
312
|
-
|
|
534
|
+
deletePasswordResetsForUser(userId: number): number;
|
|
535
|
+
/** Delete every expired reset. Returns how many went. */
|
|
536
|
+
prunePasswordResets(now?: Date): number;
|
|
313
537
|
/**
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
538
|
+
* Spend a one-click link's token, and say whether it had anything left.
|
|
539
|
+
*
|
|
540
|
+
* `true` the first time and `false` for ever after, which is what makes a
|
|
541
|
+
* link in an email single use (TASK-55). Only the token's SHA-256 is kept,
|
|
542
|
+
* as a password reset's is, so a copy of this file is not a list of the
|
|
543
|
+
* links a site has sent. `expiresAt` is the moment the token's own signature
|
|
544
|
+
* stops meaning anything, and is only there so the row can be swept.
|
|
317
545
|
*/
|
|
318
|
-
|
|
546
|
+
spendToken(token: string, expiresAt: string, now?: Date): boolean;
|
|
547
|
+
/** Delete every spent token that has expired. Returns how many went. */
|
|
548
|
+
pruneSpentTokens(now?: Date): number;
|
|
319
549
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
550
|
+
* The rows of the settings table an older version of this CMS wrote, or
|
|
551
|
+
* `undefined` when the table is gone — which it is on every site that has
|
|
552
|
+
* booted this version once.
|
|
553
|
+
*
|
|
554
|
+
* Settings live in `content/_data/site.json` now (decision-9). This is the
|
|
555
|
+
* one read left of the table they used to live in, so the first boot after
|
|
556
|
+
* the upgrade can write them out; `migrateSettingsToFile` in `settings.ts`
|
|
557
|
+
* is what decides what they mean.
|
|
322
558
|
*/
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
|
|
559
|
+
legacySettings(): LegacySetting[] | undefined;
|
|
560
|
+
/**
|
|
561
|
+
* The rows of the actor key table an older version of this CMS wrote, or
|
|
562
|
+
* `undefined` when the table is gone — which it is on every site that has
|
|
563
|
+
* booted this version once.
|
|
564
|
+
*
|
|
565
|
+
* Key pairs live in `data/keys` now (decision-9). This is the one read left
|
|
566
|
+
* of the table they used to live in, and the reason it exists at all is that
|
|
567
|
+
* losing an actor's private key is the one loss a federated site cannot
|
|
568
|
+
* recover from; `migrateActorKeysToFiles` in `federation/keys.ts` writes them
|
|
569
|
+
* out before the table is dropped.
|
|
570
|
+
*/
|
|
571
|
+
legacyActorKeys(): LegacyActorKey[] | undefined;
|
|
572
|
+
/**
|
|
573
|
+
* The rows of the users table an older version of this CMS wrote, or
|
|
574
|
+
* `undefined` when the table is gone — which it is on every site that has
|
|
575
|
+
* booted this version once.
|
|
576
|
+
*
|
|
577
|
+
* Accounts live in `data/users.json` now (decision-9). This is the one read
|
|
578
|
+
* left of the table they used to live in, so the first boot after the
|
|
579
|
+
* upgrade can write them out; `migrateUsersToFile` in `accounts.ts` is what
|
|
580
|
+
* does it, ids and all, so a session that names a user still finds them.
|
|
581
|
+
*/
|
|
582
|
+
legacyUsers(): LegacyUser[] | undefined;
|
|
583
|
+
/**
|
|
584
|
+
* Drop a table whose contents this version keeps in files instead.
|
|
585
|
+
*
|
|
586
|
+
* Called once the rows have been written out, and safe when the table is
|
|
587
|
+
* already gone. It is deliberately not a schema migration: a migration runs
|
|
588
|
+
* when the database is opened, which is before anything knows where the
|
|
589
|
+
* content directory is, and dropping the rows before they are written out is
|
|
590
|
+
* the one mistake this milestone cannot make.
|
|
591
|
+
*/
|
|
592
|
+
dropLegacyTable(name: string): void;
|
|
593
|
+
/**
|
|
594
|
+
* One piece of the CMS's own operational state, or `undefined`.
|
|
595
|
+
*
|
|
596
|
+
* Not a setting: nothing here is a site's choice and nothing here belongs in
|
|
597
|
+
* `content/_data/site.json`, which is where a setting lives. It is a cache
|
|
598
|
+
* like the rest of the database, and losing it costs a site nothing it
|
|
599
|
+
* cannot work out again. The scheduler's watermark — how far through the
|
|
600
|
+
* calendar it has got — lives here.
|
|
601
|
+
*/
|
|
602
|
+
getState(key: string): string | undefined;
|
|
603
|
+
/** Write one piece of that state. */
|
|
604
|
+
setState(key: string, value: string): void;
|
|
605
|
+
/**
|
|
606
|
+
* How many actors follow one user, or the whole site when no user is named.
|
|
607
|
+
* What a user's followers collection counts.
|
|
608
|
+
*/
|
|
609
|
+
countFollowers(username?: string): number;
|
|
326
610
|
/**
|
|
327
611
|
* Followers, newest follow first, optionally one page of them.
|
|
328
612
|
*
|
|
@@ -331,17 +615,26 @@ export interface AdminStore {
|
|
|
331
615
|
* arrives while somebody is walking the collection shifts the pages under
|
|
332
616
|
* them by one, which is the same trade the outbox makes.
|
|
333
617
|
*/
|
|
334
|
-
listFollowers(options?: ListPageOptions): Follower[];
|
|
335
|
-
/** One follower by actor id, or `undefined`. */
|
|
336
|
-
getFollower(actorId: string): Follower | undefined;
|
|
618
|
+
listFollowers(username?: string, options?: ListPageOptions): Follower[];
|
|
619
|
+
/** One user's follower by actor id, or `undefined`. */
|
|
620
|
+
getFollower(username: string, actorId: string): Follower | undefined;
|
|
337
621
|
/**
|
|
338
622
|
* Store a follower, replacing whatever was known about that actor. The
|
|
339
623
|
* original `followedAt` is kept, because a repeat `Follow` from an actor
|
|
340
624
|
* that already follows is a redelivery rather than a new follow.
|
|
341
625
|
*/
|
|
342
626
|
putFollower(follower: NewFollower): Follower;
|
|
343
|
-
/** Forget
|
|
344
|
-
deleteFollower(actorId: string): boolean;
|
|
627
|
+
/** Forget one user's follower. Returns `false` when there was nothing to forget. */
|
|
628
|
+
deleteFollower(username: string, actorId: string): boolean;
|
|
629
|
+
/**
|
|
630
|
+
* Make the followers index say exactly this, in one transaction.
|
|
631
|
+
*
|
|
632
|
+
* What a rebuild from every `content/_data/federation/{username}/followers.json` calls
|
|
633
|
+
* (decision-9): the file is the source, so a row it does not carry is a row
|
|
634
|
+
* that should not be delivered to, and replacing the lot is the only way to
|
|
635
|
+
* say that. Nothing outside a rebuild should reach for it.
|
|
636
|
+
*/
|
|
637
|
+
replaceFollowers(followers: readonly NewFollower[]): void;
|
|
345
638
|
/** How many activities the inbound log holds. */
|
|
346
639
|
countInboxActivities(): number;
|
|
347
640
|
/** Logged activities, newest first, optionally one page of them. */
|
|
@@ -353,27 +646,140 @@ export interface AdminStore {
|
|
|
353
646
|
* against.
|
|
354
647
|
*/
|
|
355
648
|
logInboxActivity(activity: NewInboxActivity): InboxActivity;
|
|
356
|
-
/** How many activities this site has sent. */
|
|
357
|
-
countOutboundActivities(): number;
|
|
358
|
-
/** Activities this site sent, newest first, optionally one page of them. */
|
|
359
|
-
listOutboundActivities(options?: ListPageOptions): OutboundActivity[];
|
|
360
|
-
/** One sent activity by its id, or `undefined`. */
|
|
361
|
-
getOutboundActivity(activityId: string): OutboundActivity | undefined;
|
|
362
649
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
650
|
+
* Make the inbound log index say exactly this, in one transaction, with the
|
|
651
|
+
* row ids starting again from one.
|
|
652
|
+
*
|
|
653
|
+
* The counterpart of {@link AdminStore.replaceFollowers} over
|
|
654
|
+
* `content/_data/federation/inbox/{yyyy}-{mm}.jsonl`. The ids restart
|
|
655
|
+
* because a row id is the order things arrived in and nothing else: letting
|
|
656
|
+
* them climb on every boot would give the same log different ids on two
|
|
657
|
+
* machines holding the same files.
|
|
365
658
|
*/
|
|
366
|
-
|
|
659
|
+
replaceInboxActivities(activities: readonly NewInboxActivity[]): void;
|
|
660
|
+
/** How many logged activities are replies to anything at all. */
|
|
661
|
+
countReplies(): number;
|
|
662
|
+
/** Every logged reply, newest first, optionally one page of them. */
|
|
663
|
+
listReplies(options?: ListPageOptions): InboxActivity[];
|
|
664
|
+
/** How many replies one object — a post's ActivityStreams id — has. */
|
|
665
|
+
countRepliesTo(objectId: string): number;
|
|
666
|
+
/** One object's replies, newest first, optionally one page of them. */
|
|
667
|
+
listRepliesTo(objectId: string, options?: ListPageOptions): InboxActivity[];
|
|
668
|
+
/**
|
|
669
|
+
* Every logged activity that names one of these objects — as what it is
|
|
670
|
+
* about, or as what it answers — oldest first.
|
|
671
|
+
*
|
|
672
|
+
* The query a conversation is built from: the likes and boosts of a post,
|
|
673
|
+
* the replies to it, and the `Delete` or `Undo` that takes one of those
|
|
674
|
+
* back, all name an object this side already knows the id of. Both columns
|
|
675
|
+
* are read because a `Create` is *about* the note it carries and only
|
|
676
|
+
* `in_reply_to` says which post that note answers.
|
|
677
|
+
*
|
|
678
|
+
* Oldest first, because that is the order a thread reads in; a caller
|
|
679
|
+
* wanting the newest can reverse a page it has. Naming nothing returns
|
|
680
|
+
* nothing rather than everything.
|
|
681
|
+
*/
|
|
682
|
+
listActivitiesAbout(objectIds: readonly string[]): InboxActivity[];
|
|
683
|
+
/** One post's comments, oldest first, whatever status they are at. */
|
|
684
|
+
listCommentsFor(slug: string): PostComment[];
|
|
685
|
+
/**
|
|
686
|
+
* How many of one post's comments stand at one status.
|
|
687
|
+
*
|
|
688
|
+
* A count rather than a list because that is what the feeds want: the RSS
|
|
689
|
+
* `source:comments` element carries a number per item, and reading every
|
|
690
|
+
* comment on every post of a feed page to arrive at it would be a page of
|
|
691
|
+
* text for a page of integers.
|
|
692
|
+
*/
|
|
693
|
+
countCommentsFor(slug: string, status: CommentStatus): number;
|
|
694
|
+
/**
|
|
695
|
+
* Comments across the site, newest first, optionally of one status and one
|
|
696
|
+
* page of them. What the moderation screen and the site-wide feed read.
|
|
697
|
+
*/
|
|
698
|
+
listComments(options: ListCommentsOptions): PostComment[];
|
|
699
|
+
/** One comment by id, or `undefined`. */
|
|
700
|
+
getComment(id: string): PostComment | undefined;
|
|
701
|
+
/** How many comments stand at each status. What the dashboard shows. */
|
|
702
|
+
countCommentsByStatus(): Record<CommentStatus, number>;
|
|
703
|
+
/**
|
|
704
|
+
* Whether this name and email have had a comment approved before.
|
|
705
|
+
*
|
|
706
|
+
* WordPress's rule, and the whole of the auto-approval decision: somebody a
|
|
707
|
+
* moderator has already let through does not queue again. Both have to
|
|
708
|
+
* match, so a stranger typing a regular's name is still held.
|
|
709
|
+
*/
|
|
710
|
+
hasApprovedAuthor(name: string, email: string | null): boolean;
|
|
711
|
+
/** Store a comment, replacing whatever was known about that id. */
|
|
712
|
+
putComment(comment: PostComment): PostComment;
|
|
713
|
+
/** Forget a comment. Returns `false` when there was nothing to forget. */
|
|
714
|
+
deleteComment(id: string): boolean;
|
|
715
|
+
/**
|
|
716
|
+
* Make the comment index say exactly this, in one transaction.
|
|
717
|
+
*
|
|
718
|
+
* What a rebuild from `content/_data/comments/` calls (decision-9): the
|
|
719
|
+
* files are the source, so a row they do not carry is a comment that should
|
|
720
|
+
* not be on the page. Nothing outside a rebuild should reach for it.
|
|
721
|
+
*/
|
|
722
|
+
replaceComments(comments: readonly PostComment[]): void;
|
|
367
723
|
/**
|
|
368
724
|
* Record how one delivery to one follower ended, replacing the previous
|
|
369
725
|
* outcome for that pair: the table answers "where does this activity stand
|
|
370
|
-
* with each follower", which a
|
|
726
|
+
* with each follower", which a resend moves rather than adds to.
|
|
371
727
|
*/
|
|
372
728
|
recordDelivery(delivery: NewDelivery): Delivery;
|
|
373
729
|
/** Every follower's outcome for one activity, in follower order. */
|
|
374
730
|
listDeliveries(activityId: string): Delivery[];
|
|
375
731
|
/** How many followers this activity stands at each status with. */
|
|
376
732
|
countDeliveriesByStatus(activityId: string): Record<DeliveryStatus, number>;
|
|
733
|
+
/**
|
|
734
|
+
* The most recent delivery to one inbox, whichever activity it carried, or
|
|
735
|
+
* `undefined` when nothing has ever gone there.
|
|
736
|
+
*
|
|
737
|
+
* Keyed by the inbox rather than by the actor because that is what a relay
|
|
738
|
+
* has: it is not a follower, so there is no follower row to look its
|
|
739
|
+
* outcomes up by, and the inbox is the thing the site was told to deliver to.
|
|
740
|
+
*/
|
|
741
|
+
lastDeliveryToInbox(inboxId: string): Delivery | undefined;
|
|
742
|
+
/**
|
|
743
|
+
* The most recent delivery about one object — a post's ActivityStreams id,
|
|
744
|
+
* or the site actor's — or `undefined` when nothing about it has ever gone
|
|
745
|
+
* out.
|
|
746
|
+
*
|
|
747
|
+
* What the federation screen's per-post row is filled in from. Keyed by the
|
|
748
|
+
* object rather than by the activity because a post is a series of
|
|
749
|
+
* activities and the row is about the post: the newest outcome is the one
|
|
750
|
+
* that says where the post currently stands with the fediverse.
|
|
751
|
+
*/
|
|
752
|
+
lastDeliveryToObject(objectId: string): Delivery | undefined;
|
|
753
|
+
/**
|
|
754
|
+
* Record how one webmention to one page ended, replacing the previous
|
|
755
|
+
* outcome for that (post, target): the table answers "where does this post
|
|
756
|
+
* stand with that page", which a resend moves rather than adds to.
|
|
757
|
+
*/
|
|
758
|
+
recordSentWebmention(sent: NewSentWebmention): SentWebmention;
|
|
759
|
+
/** What one post's links came to, target by target, in target order. */
|
|
760
|
+
listSentWebmentions(slug: string): SentWebmention[];
|
|
761
|
+
/** How many of one post's targets stand at each status. */
|
|
762
|
+
countSentWebmentionsByStatus(slug: string): Record<WebmentionSendStatus, number>;
|
|
763
|
+
/** Every relay subscription, oldest first, however it stands. */
|
|
764
|
+
listRelays(): Relay[];
|
|
765
|
+
/** One relay subscription by the inbox it was made to, or `undefined`. */
|
|
766
|
+
getRelay(inboxId: string): Relay | undefined;
|
|
767
|
+
/**
|
|
768
|
+
* The subscription one `Follow` established, or `undefined`.
|
|
769
|
+
*
|
|
770
|
+
* This is how an `Accept` or a `Reject` arriving later finds the relay it
|
|
771
|
+
* answers: the activity names the follow, and the follow names the record.
|
|
772
|
+
*/
|
|
773
|
+
getRelayByFollow(followId: string): Relay | undefined;
|
|
774
|
+
/**
|
|
775
|
+
* Store a relay subscription, replacing whatever was known about that inbox
|
|
776
|
+
* and leaving the original `createdAt` alone: a subscription that moves from
|
|
777
|
+
* pending to accepted is the same subscription, and when it began is a fact
|
|
778
|
+
* only the row remembers.
|
|
779
|
+
*/
|
|
780
|
+
putRelay(relay: NewRelay): Relay;
|
|
781
|
+
/** Forget a relay subscription. Returns `false` when there was nothing to forget. */
|
|
782
|
+
deleteRelay(inboxId: string): boolean;
|
|
377
783
|
/** Delete every expired session. Returns how many went. */
|
|
378
784
|
pruneSessions(now?: Date): number;
|
|
379
785
|
/**
|
|
@@ -389,13 +795,6 @@ export interface AdminStore {
|
|
|
389
795
|
/** Close the database. Safe to call twice. */
|
|
390
796
|
close(): void;
|
|
391
797
|
}
|
|
392
|
-
/** Thrown when a username is already taken. Usernames are the login key. */
|
|
393
|
-
export declare class DuplicateUsernameError extends Error {
|
|
394
|
-
readonly name = "DuplicateUsernameError";
|
|
395
|
-
/** The name that was already in use. */
|
|
396
|
-
readonly username: string;
|
|
397
|
-
constructor(username: string);
|
|
398
|
-
}
|
|
399
798
|
/**
|
|
400
799
|
* Open (and if needed create) the admin tables in `dataDir`, applying every
|
|
401
800
|
* migration the package ships. Applying them is idempotent.
|
|
@@ -404,4 +803,59 @@ export declare class DuplicateUsernameError extends Error {
|
|
|
404
803
|
* index holding a second one on the same file.
|
|
405
804
|
*/
|
|
406
805
|
export declare function openAdminStore(options: OpenAdminStoreOptions): AdminStore;
|
|
806
|
+
/**
|
|
807
|
+
* One row of the settings table TASK-14 wrote, for the one boot that reads it.
|
|
808
|
+
*
|
|
809
|
+
* Settings live in `content/_data/site.json` now (decision-9), so this shape
|
|
810
|
+
* exists only so `migrateSettingsToFile` can write the rows out before the
|
|
811
|
+
* table goes. `updatedAt` is what tells a row written by the settings screen
|
|
812
|
+
* from a `site.json` a person edited afterwards.
|
|
813
|
+
*/
|
|
814
|
+
export interface LegacySetting {
|
|
815
|
+
/** The setting's name, e.g. `title`. */
|
|
816
|
+
key: string;
|
|
817
|
+
/** Its value, always a string; numbers and lists were spelled as text. */
|
|
818
|
+
value: string;
|
|
819
|
+
/** When it was last written, as an ISO instant. */
|
|
820
|
+
updatedAt: string;
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* One row of the actor key table TASK-16 wrote, for the one boot that reads it.
|
|
824
|
+
*
|
|
825
|
+
* Key pairs live in `data/keys` as JWK files now (decision-9), so this shape
|
|
826
|
+
* exists only so `migrateActorKeysToFiles` can write the rows out before the
|
|
827
|
+
* table goes. The public half the table also held is not here: it is derived
|
|
828
|
+
* from the private one, and reading it would only invite the two to disagree.
|
|
829
|
+
*/
|
|
830
|
+
export interface LegacyActorKey {
|
|
831
|
+
/** Which actor the pair belonged to: the sentinel identifier, not a handle. */
|
|
832
|
+
identifier: string;
|
|
833
|
+
/**
|
|
834
|
+
* Which algorithm it is for, as the table spelled it. A bare string rather
|
|
835
|
+
* than one of the algorithms this version knows, on purpose: a row a later
|
|
836
|
+
* version wrote is still a key that must reach a file rather than go with
|
|
837
|
+
* the table.
|
|
838
|
+
*/
|
|
839
|
+
algorithm: string;
|
|
840
|
+
/** The private key as JWK, JSON encoded. What the file ends up holding. */
|
|
841
|
+
privateJwk: string;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* One row of the users table TASK-9 wrote, for the one boot that reads it.
|
|
845
|
+
*
|
|
846
|
+
* Accounts live in `data/users.json` now (decision-9), so this shape exists
|
|
847
|
+
* only so `migrateUsersToFile` can write the rows out before the table goes.
|
|
848
|
+
* The id comes with them: a session in the same database names its user by it,
|
|
849
|
+
* and a migration that renumbered everybody would sign the whole site out.
|
|
850
|
+
*/
|
|
851
|
+
export interface LegacyUser {
|
|
852
|
+
/** The row id, which the file keeps. */
|
|
853
|
+
id: number;
|
|
854
|
+
/** The login name. */
|
|
855
|
+
username: string;
|
|
856
|
+
/** The PHC-encoded argon2id hash, moved into the file as it stands. */
|
|
857
|
+
passwordHash: string;
|
|
858
|
+
/** When the user was created, as an ISO instant. */
|
|
859
|
+
createdAt: string;
|
|
860
|
+
}
|
|
407
861
|
//# sourceMappingURL=store.d.ts.map
|