@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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* The one bit of progressive enhancement doc-5 asks for: the slug follows the
|
|
2
|
+
title until somebody types a slug of their own, and the permalink follows
|
|
3
|
+
the slug on the same terms. Without this the form still works — an empty
|
|
4
|
+
slug is derived from the title on the server.
|
|
5
|
+
|
|
6
|
+
It is a file rather than an inline <script> so the admin's
|
|
7
|
+
Content-Security-Policy can say `script-src 'self'` and mean it: no nonce,
|
|
8
|
+
no 'unsafe-inline', and nothing an HTML injection could ever get to run. It
|
|
9
|
+
is loaded with `defer`, so the form is in the document by the time it runs.
|
|
10
|
+
|
|
11
|
+
Plain ES5-shaped browser JavaScript, checked by eslint's browser config and
|
|
12
|
+
left alone by the TypeScript build: it is served as it is written. */
|
|
13
|
+
(function () {
|
|
14
|
+
var title = document.getElementById('editor-title');
|
|
15
|
+
var slug = document.getElementById('editor-slug');
|
|
16
|
+
var permalink = document.getElementById('editor-permalink');
|
|
17
|
+
if (!title || !slug) return;
|
|
18
|
+
|
|
19
|
+
var date = document.getElementById('editor-date');
|
|
20
|
+
var slugFollows = slug.value === '';
|
|
21
|
+
var permalinkFollows = !permalink || permalink.value === '';
|
|
22
|
+
|
|
23
|
+
function slugify(value) {
|
|
24
|
+
return value
|
|
25
|
+
.normalize('NFKD')
|
|
26
|
+
.toLowerCase()
|
|
27
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
28
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
29
|
+
.replace(/^-+|-+$/g, '');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* The same shape defaultPermalink() writes on the server: a post lives under
|
|
33
|
+
the year and month of its date, a page at the top level. */
|
|
34
|
+
function syncPermalink() {
|
|
35
|
+
if (!permalink || !permalinkFollows) return;
|
|
36
|
+
if (slug.value === '') {
|
|
37
|
+
permalink.value = '';
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
var month = date ? /^(\d{4})-(\d{2})/.exec(date.value) : null;
|
|
41
|
+
var prefix = month ? '/' + month[1] + '/' + month[2] + '/' : '/';
|
|
42
|
+
permalink.value = prefix + slug.value + '/';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
slug.addEventListener('input', function () {
|
|
46
|
+
slugFollows = false;
|
|
47
|
+
syncPermalink();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (permalink) {
|
|
51
|
+
permalink.addEventListener('input', function () {
|
|
52
|
+
permalinkFollows = false;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
title.addEventListener('input', function () {
|
|
57
|
+
if (!slugFollows) return;
|
|
58
|
+
slug.value = slugify(title.value);
|
|
59
|
+
syncPermalink();
|
|
60
|
+
});
|
|
61
|
+
})();
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { MiddlewareHandler } from 'hono';
|
|
2
|
+
import type { ResolvedConfig } from './config.ts';
|
|
3
|
+
import type { GeekityEnv } from './env.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Where one access-log line goes.
|
|
6
|
+
*
|
|
7
|
+
* The line arrives without a trailing newline; the sink decides the framing.
|
|
8
|
+
* The default sink is stdout — what a container collects, what dockge shows
|
|
9
|
+
* and what journald keeps — and a test hands in one that keeps the lines.
|
|
10
|
+
*/
|
|
11
|
+
export type AccessLogWriter = (line: string) => void;
|
|
12
|
+
/** What {@link createAccessLog} needs to know. */
|
|
13
|
+
export interface AccessLogOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Whether a client address goes on the line, and which one is right. Read
|
|
16
|
+
* once, at boot: the log is registered before the context is, so it cannot
|
|
17
|
+
* read the config off a request.
|
|
18
|
+
*/
|
|
19
|
+
config: Pick<ResolvedConfig, 'accessLogAddress' | 'trustProxy'>;
|
|
20
|
+
/** Where the lines go. Defaults to stdout. */
|
|
21
|
+
write?: AccessLogWriter;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* One line per request: what was asked, what was answered, and how long it
|
|
25
|
+
* took.
|
|
26
|
+
*
|
|
27
|
+
* ```
|
|
28
|
+
* GET /.well-known/webfinger?resource=acct:ada@example.com 200 3.1ms
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* The fields are in a fixed order and separated by spaces, so the status is
|
|
32
|
+
* always the third and a line is readable by eye, by `grep` and by `awk`
|
|
33
|
+
* alike. The client address, when the site asks for one, goes last for that
|
|
34
|
+
* reason — turning it on moves nothing else.
|
|
35
|
+
*
|
|
36
|
+
* Only the request line is ever read: no body is touched, so nothing is
|
|
37
|
+
* buffered and no password posted to the login form can reach the log, and no
|
|
38
|
+
* header but the forwarded address a site has said to believe is looked at, so
|
|
39
|
+
* no cookie and no `Authorization` can either. The query string is logged as
|
|
40
|
+
* it arrived, because it is what a peer's WebFinger lookup carries and what a
|
|
41
|
+
* question about who asked for what is answered with.
|
|
42
|
+
*/
|
|
43
|
+
export declare function createAccessLog(options: AccessLogOptions): MiddlewareHandler<GeekityEnv>;
|
|
44
|
+
//# sourceMappingURL=access-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-log.d.ts","sourceRoot":"","sources":["../src/access-log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAG9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAErD,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,YAAY,CAAC,CAAC;IAChE,8CAA8C;IAC9C,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAsBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAAC,UAAU,CAAC,CA4BxF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { clientAddress } from './admin/throttle.js';
|
|
2
|
+
/** The default sink: one write per line, the newline included, like the CLI's. */
|
|
3
|
+
function writeToStdout(line) {
|
|
4
|
+
process.stdout.write(`${line}\n`);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The path and query string of a request, taken out of its URL by hand.
|
|
8
|
+
*
|
|
9
|
+
* `new URL(...)` per request would parse and allocate the whole of an address
|
|
10
|
+
* this only ever wants the tail of, and this runs on every request the site
|
|
11
|
+
* answers. There is nothing to escape: Node's HTTP parser refuses a request
|
|
12
|
+
* target with a control character in it, so whatever survives to here is one
|
|
13
|
+
* line's worth of text.
|
|
14
|
+
*/
|
|
15
|
+
function requestTarget(url) {
|
|
16
|
+
const afterScheme = url.indexOf('://');
|
|
17
|
+
const start = afterScheme < 0 ? -1 : url.indexOf('/', afterScheme + 3);
|
|
18
|
+
return start < 0 ? '/' : url.slice(start);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One line per request: what was asked, what was answered, and how long it
|
|
22
|
+
* took.
|
|
23
|
+
*
|
|
24
|
+
* ```
|
|
25
|
+
* GET /.well-known/webfinger?resource=acct:ada@example.com 200 3.1ms
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* The fields are in a fixed order and separated by spaces, so the status is
|
|
29
|
+
* always the third and a line is readable by eye, by `grep` and by `awk`
|
|
30
|
+
* alike. The client address, when the site asks for one, goes last for that
|
|
31
|
+
* reason — turning it on moves nothing else.
|
|
32
|
+
*
|
|
33
|
+
* Only the request line is ever read: no body is touched, so nothing is
|
|
34
|
+
* buffered and no password posted to the login form can reach the log, and no
|
|
35
|
+
* header but the forwarded address a site has said to believe is looked at, so
|
|
36
|
+
* no cookie and no `Authorization` can either. The query string is logged as
|
|
37
|
+
* it arrived, because it is what a peer's WebFinger lookup carries and what a
|
|
38
|
+
* question about who asked for what is answered with.
|
|
39
|
+
*/
|
|
40
|
+
export function createAccessLog(options) {
|
|
41
|
+
const write = options.write ?? writeToStdout;
|
|
42
|
+
const { accessLogAddress, trustProxy } = options.config;
|
|
43
|
+
return async function accessLog(c, next) {
|
|
44
|
+
const started = performance.now();
|
|
45
|
+
let threw = false;
|
|
46
|
+
try {
|
|
47
|
+
await next();
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
// A handler that threw has no response of its own: the error is on its
|
|
51
|
+
// way up to Hono's error handler, which answers 500, and `c.res` would
|
|
52
|
+
// hand back a freshly made 200 if asked. A request that failed is the
|
|
53
|
+
// one most worth having a line for, so it gets the status it will be
|
|
54
|
+
// answered with rather than the one it never had.
|
|
55
|
+
threw = true;
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
const elapsed = (performance.now() - started).toFixed(1);
|
|
60
|
+
const status = threw ? 500 : c.res.status;
|
|
61
|
+
let line = `${c.req.method} ${requestTarget(c.req.url)} ${String(status)} ${elapsed}ms`;
|
|
62
|
+
if (accessLogAddress) {
|
|
63
|
+
const address = clientAddress(c, { trustProxy });
|
|
64
|
+
if (address !== undefined)
|
|
65
|
+
line += ` ${address}`;
|
|
66
|
+
}
|
|
67
|
+
write(line);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=access-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-log.js","sourceRoot":"","sources":["../src/access-log.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAyBpD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,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;YAC1C,IAAI,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,IAAI,CAAC;YACxF,IAAI,gBAAgB,EAAE,CAAC;gBACrB,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;gBACjD,IAAI,OAAO,KAAK,SAAS;oBAAE,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;YACnD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import type { AdminStore } from './store.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Who may sign in: `data/users.json`, and everything that reads or writes it.
|
|
4
|
+
*
|
|
5
|
+
* decision-9 puts every piece of irreducible state in a file, and a login is
|
|
6
|
+
* as irreducible as state gets — an account cannot be derived from anything,
|
|
7
|
+
* and a site that lost its users would fall back into first-run setup with the
|
|
8
|
+
* door open to whoever reached it first. So the file is the truth and the
|
|
9
|
+
* database is a cache: `data/geekity.db` may be deleted at rest, and the next
|
|
10
|
+
* boot still knows exactly who may sign in.
|
|
11
|
+
*
|
|
12
|
+
* It lives in `data/` rather than `content/`, unlike `site.json`, because
|
|
13
|
+
* `content/` is published with the site and in git, and an argon2 hash is not
|
|
14
|
+
* something to hand a reader or a mirror. The file is written 0600 for the
|
|
15
|
+
* same reason; it sits directly in `dataDir`, so there is no private directory
|
|
16
|
+
* around it to lean on.
|
|
17
|
+
*
|
|
18
|
+
* Reads are synchronous and per call, exactly as `readSiteSettings` reads
|
|
19
|
+
* `site.json` per call: the file is a few hundred bytes and nothing anywhere
|
|
20
|
+
* can then be holding a stale copy of who exists. Writes go through
|
|
21
|
+
* {@link updateFileAtomically}, which puts the read inside the same queue as
|
|
22
|
+
* the write, so the uniqueness rule that used to be a `UNIQUE` index is
|
|
23
|
+
* checked and acted on as one step.
|
|
24
|
+
*/
|
|
25
|
+
/** The file, relative to `dataDir`. */
|
|
26
|
+
export declare const USERS_FILE = "users.json";
|
|
27
|
+
/** The permissions the file is written with: nobody but the site's own user. */
|
|
28
|
+
export declare const USERS_FILE_MODE = 384;
|
|
29
|
+
/** Where the users file lives for a given data directory. */
|
|
30
|
+
export declare function usersFile(dataDir: string): string;
|
|
31
|
+
/** An admin user. There is one role, so there is nothing else to say about one. */
|
|
32
|
+
export interface User {
|
|
33
|
+
/** Its id, stable for the life of the user, and what a session names. */
|
|
34
|
+
readonly id: number;
|
|
35
|
+
/** Login name, unique and compared case sensitively. */
|
|
36
|
+
readonly username: string;
|
|
37
|
+
/**
|
|
38
|
+
* Where the site can reach this person, or `undefined` when nobody has said.
|
|
39
|
+
*
|
|
40
|
+
* Optional on purpose (TASK-54): a login is a username and a password, and a
|
|
41
|
+
* site that never sends email has no use for this. What it buys is a
|
|
42
|
+
* password that can be recovered without a shell, and, once TASK-55 lands,
|
|
43
|
+
* somewhere to send the notices an admin would otherwise have to go looking
|
|
44
|
+
* for. Not unique, and not a second login name: it is only ever matched
|
|
45
|
+
* against by the forgot-password form, which answers the same either way.
|
|
46
|
+
*/
|
|
47
|
+
readonly email?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Which notices this user has turned off, when they have turned any off
|
|
50
|
+
* (TASK-55).
|
|
51
|
+
*
|
|
52
|
+
* Absent for almost everybody, because it holds only what somebody actually
|
|
53
|
+
* changed: an event nothing says anything about is at the default
|
|
54
|
+
* `src/notifications/preferences.ts` gives it, which is what lets a new
|
|
55
|
+
* notice start working without anybody visiting the users screen. Keyed by
|
|
56
|
+
* event name, so adding an event adds no field here.
|
|
57
|
+
*/
|
|
58
|
+
readonly notifications?: Readonly<Record<string, boolean>> | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* How often each notice arrives, for the events that offer a choice and the
|
|
61
|
+
* users who have made one (TASK-60).
|
|
62
|
+
*
|
|
63
|
+
* A second map beside {@link User.notifications} rather than a widening of
|
|
64
|
+
* it, because the two answer different questions — whether, and how often —
|
|
65
|
+
* and a user who wants no notice at all is not a user with a delivery mode.
|
|
66
|
+
* Absent for almost everybody, on the same rule: `immediately` is the
|
|
67
|
+
* default and the default is never written down. Keyed by event name, so
|
|
68
|
+
* adding an event adds no field here either.
|
|
69
|
+
*/
|
|
70
|
+
readonly notificationModes?: Readonly<Record<string, string>> | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* What the public site says about this person, when somebody has filled any
|
|
73
|
+
* of it in (TASK-67).
|
|
74
|
+
*
|
|
75
|
+
* decision-14 makes a user an actor at their author URL, so the URL has to
|
|
76
|
+
* be a page before it can be an actor, and a page needs something to say.
|
|
77
|
+
* Absent for a user nobody has written a profile for, on the rule the two
|
|
78
|
+
* maps above follow: the file holds what somebody actually filled in, and a
|
|
79
|
+
* user with no profile still has an archive under their username.
|
|
80
|
+
*/
|
|
81
|
+
readonly profile?: UserProfile | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* The ActivityStreams id this person was published under somewhere else,
|
|
84
|
+
* when they were (TASK-69).
|
|
85
|
+
*
|
|
86
|
+
* decision-14 calls this identity rather than cache: a follower's server
|
|
87
|
+
* keys the account by it for as long as the follow lasts, and a document
|
|
88
|
+
* served under it with a different `id` reads as a different person, not as
|
|
89
|
+
* a moved one. So a site arriving from the WordPress ActivityPub plugin
|
|
90
|
+
* keeps the `https://example.com/?author=2` its followers already hold, for
|
|
91
|
+
* the life of the user.
|
|
92
|
+
*
|
|
93
|
+
* The CMS never mints one — a user born here is an actor at their author URL
|
|
94
|
+
* and has no second name to keep — and no screen writes one: it arrives with
|
|
95
|
+
* the import (TASK-71) or is typed into the file by hand. The whole URL is
|
|
96
|
+
* stored, query string and all, because that is what has to be matched.
|
|
97
|
+
*/
|
|
98
|
+
readonly actorId?: string | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* The number the WordPress ActivityPub plugin gave this person's actor, when
|
|
101
|
+
* they had one (TASK-70).
|
|
102
|
+
*
|
|
103
|
+
* The WordPress user id, which is what the plugin puts in the paths it
|
|
104
|
+
* publishes: `/wp-json/activitypub/1.0/actors/2/inbox` is user 2. Unlike
|
|
105
|
+
* {@link User.actorId} this is cache rather than identity — a follower's
|
|
106
|
+
* server replaces those paths the next time it refetches the actor — so it
|
|
107
|
+
* is only ever read behind the `wordpressActivityPub` site setting, and it
|
|
108
|
+
* is what maps a delivery arriving at one of those paths to a person.
|
|
109
|
+
*
|
|
110
|
+
* The CMS never mints one. It arrives with the import (TASK-71) or is typed
|
|
111
|
+
* into the file by hand, beside the stored actor id the same migration sets.
|
|
112
|
+
*/
|
|
113
|
+
readonly wordpressActorId?: number | undefined;
|
|
114
|
+
/** When the user was created, as an ISO 8601 instant. */
|
|
115
|
+
readonly createdAt: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* One thing a profile points at: somewhere else this person is.
|
|
119
|
+
*
|
|
120
|
+
* A label and a URL rather than a bare URL, because the label is what a theme
|
|
121
|
+
* prints and what an ActivityPub `attachment` calls the property (TASK-68).
|
|
122
|
+
*/
|
|
123
|
+
export interface ProfileLink {
|
|
124
|
+
/** What the link says. */
|
|
125
|
+
readonly label: string;
|
|
126
|
+
/** Where it goes. */
|
|
127
|
+
readonly href: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The public face of a user: what their archive is headed with and what their
|
|
131
|
+
* actor will carry.
|
|
132
|
+
*
|
|
133
|
+
* Every field is optional, and one that is empty is not stored at all: a
|
|
134
|
+
* profile is something somebody chose to write, and a user who has written
|
|
135
|
+
* none of it is not a user with four empty strings.
|
|
136
|
+
*/
|
|
137
|
+
export interface UserProfile {
|
|
138
|
+
/** The name to print instead of the username, when they gave one. */
|
|
139
|
+
readonly displayName?: string | undefined;
|
|
140
|
+
/** A few sentences about them. */
|
|
141
|
+
readonly bio?: string | undefined;
|
|
142
|
+
/** A picture, as the path or URL it is served at. */
|
|
143
|
+
readonly avatar?: string | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* What they do, when they said: the line a theme prints under the name in a
|
|
146
|
+
* bio, and the `jobTitle` of the JSON-LD `Person` it emits (decision-16).
|
|
147
|
+
*/
|
|
148
|
+
readonly jobTitle?: string | undefined;
|
|
149
|
+
/** Where they are, as they wrote it: "Madison, Wisconsin", "Somewhere wet". */
|
|
150
|
+
readonly location?: string | undefined;
|
|
151
|
+
/** Somewhere else they are, in the order they listed them. */
|
|
152
|
+
readonly links?: readonly ProfileLink[] | undefined;
|
|
153
|
+
}
|
|
154
|
+
/** A user with the field no screen may render: its password hash. */
|
|
155
|
+
export interface StoredUser extends User {
|
|
156
|
+
/** The PHC-encoded argon2id hash. */
|
|
157
|
+
readonly passwordHash: string;
|
|
158
|
+
}
|
|
159
|
+
/** What {@link createUser} is given. */
|
|
160
|
+
export interface CreateUserInput {
|
|
161
|
+
/** Which site's users file to add to. */
|
|
162
|
+
dataDir: string;
|
|
163
|
+
/** The name they will sign in with. Compared exactly, as it always was. */
|
|
164
|
+
username: string;
|
|
165
|
+
/** The plain password. It is hashed on the way in and never stored. */
|
|
166
|
+
password: string;
|
|
167
|
+
/** Where to reach them. Left off, or empty, is a user with no email. */
|
|
168
|
+
email?: string | undefined;
|
|
169
|
+
}
|
|
170
|
+
/** Thrown when a username is already taken. Usernames are the login key. */
|
|
171
|
+
export declare class DuplicateUsernameError extends Error {
|
|
172
|
+
readonly name = "DuplicateUsernameError";
|
|
173
|
+
/** The name that was already in use. */
|
|
174
|
+
readonly username: string;
|
|
175
|
+
constructor(username: string);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Every user, by name, without password hashes.
|
|
179
|
+
*
|
|
180
|
+
* Sorted by code unit rather than by locale, which is how the `ORDER BY
|
|
181
|
+
* username` over a `BINARY` column this replaces sorted them: a listing that
|
|
182
|
+
* changed order with the server's locale would be a listing nobody could
|
|
183
|
+
* describe.
|
|
184
|
+
*/
|
|
185
|
+
export declare function listUsers(dataDir: string): User[];
|
|
186
|
+
/**
|
|
187
|
+
* The site's first account: the lowest id, which is the one the first run
|
|
188
|
+
* made.
|
|
189
|
+
*
|
|
190
|
+
* decision-14 leaves the site with no actor of its own, and two things still
|
|
191
|
+
* have to be somebody's: a relay subscription, which is an instance-wide
|
|
192
|
+
* agreement rather than one person's, and a post whose `author` names nobody
|
|
193
|
+
* this site knows. Both fall to the first account, because a site's first
|
|
194
|
+
* account is the one that has always existed and the only one that can be
|
|
195
|
+
* chosen without asking. `undefined` before anybody has signed up, which is
|
|
196
|
+
* first-run setup and federates nothing.
|
|
197
|
+
*/
|
|
198
|
+
export declare function primaryUser(dataDir: string): User | undefined;
|
|
199
|
+
/** How many users exist. Zero is what puts the admin into first-run setup. */
|
|
200
|
+
export declare function countUsers(dataDir: string): number;
|
|
201
|
+
/**
|
|
202
|
+
* One user with its password hash, or `undefined`. For auth, not for screens.
|
|
203
|
+
*/
|
|
204
|
+
export declare function findUser(dataDir: string, username: string): StoredUser | undefined;
|
|
205
|
+
/** The user behind a session's `userId`, or `undefined`. */
|
|
206
|
+
export declare function findUserById(dataDir: string, id: number): User | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* The user a forgot-password form named, by either of the two things somebody
|
|
209
|
+
* might type: their username or their email address.
|
|
210
|
+
*
|
|
211
|
+
* The username is compared exactly, because that is how logging in compares it
|
|
212
|
+
* and a second, looser rule would let one person's name match another's
|
|
213
|
+
* account. The email is folded to lower case on both sides, because an address
|
|
214
|
+
* is case-insensitive in practice and nobody remembers how they capitalised
|
|
215
|
+
* one. A user is matched by username first, so a site where somebody's address
|
|
216
|
+
* happens to be another person's username still resolves the way logging in
|
|
217
|
+
* would. The empty string matches nobody, however many users have no email.
|
|
218
|
+
*/
|
|
219
|
+
export declare function findUserByIdentifier(dataDir: string, identifier: string): User | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* Hash the password and add the user to the file.
|
|
222
|
+
*
|
|
223
|
+
* Throws {@link DuplicateUsernameError} when the name is taken. The check is
|
|
224
|
+
* inside the write, not before it, which is what makes it the rule the
|
|
225
|
+
* `UNIQUE` index used to be: two requests adding the same name at the same
|
|
226
|
+
* moment queue behind one another on the file, so the second one reads the
|
|
227
|
+
* first one's work and is refused.
|
|
228
|
+
*/
|
|
229
|
+
export declare function createUser(input: CreateUserInput): Promise<User>;
|
|
230
|
+
/**
|
|
231
|
+
* Hash a new password and put it on a user, replacing the old one. Returns
|
|
232
|
+
* `false` when there is no such user. Sessions are left alone; deciding which
|
|
233
|
+
* of them a password change should end is the caller's business.
|
|
234
|
+
*/
|
|
235
|
+
export declare function setUserPassword(input: {
|
|
236
|
+
/** Which site's users file to write. */
|
|
237
|
+
dataDir: string;
|
|
238
|
+
/** Whose password. */
|
|
239
|
+
userId: number;
|
|
240
|
+
/** The new plain password, hashed on the way in. */
|
|
241
|
+
password: string;
|
|
242
|
+
}): Promise<boolean>;
|
|
243
|
+
/**
|
|
244
|
+
* Put an email address on a user, or take the one they had off.
|
|
245
|
+
*
|
|
246
|
+
* The empty string is how an address is removed, so one form field can do
|
|
247
|
+
* both: a box somebody cleared means "I do not want to be emailed", and there
|
|
248
|
+
* is nothing else it could mean. Returns `false` when there is no such user.
|
|
249
|
+
* The address is stored as it was typed, capitals and all — it is what a
|
|
250
|
+
* message is addressed to, and only the matching is case-insensitive.
|
|
251
|
+
*/
|
|
252
|
+
export declare function setUserEmail(input: {
|
|
253
|
+
/** Which site's users file to write. */
|
|
254
|
+
dataDir: string;
|
|
255
|
+
/** Whose address. */
|
|
256
|
+
userId: number;
|
|
257
|
+
/** The address, or the empty string to remove it. */
|
|
258
|
+
email: string;
|
|
259
|
+
}): Promise<boolean>;
|
|
260
|
+
/**
|
|
261
|
+
* Write a user's profile, replacing whatever was there.
|
|
262
|
+
*
|
|
263
|
+
* The whole profile at once rather than a field at a time, because that is
|
|
264
|
+
* what the form on the users screen submits: four boxes and a Save, and a
|
|
265
|
+
* field somebody cleared is a field they no longer want. {@link cleanProfile}
|
|
266
|
+
* drops the empties, so a profile with nothing left in it leaves the user with
|
|
267
|
+
* no `profile` key rather than with an empty object. Returns `false` when
|
|
268
|
+
* there is no such user.
|
|
269
|
+
*/
|
|
270
|
+
export declare function setUserProfile(input: {
|
|
271
|
+
/** Which site's users file to write. */
|
|
272
|
+
dataDir: string;
|
|
273
|
+
/** Whose profile. */
|
|
274
|
+
userId: number;
|
|
275
|
+
/** Everything the profile should say from now on. */
|
|
276
|
+
profile: UserProfile;
|
|
277
|
+
}): Promise<boolean>;
|
|
278
|
+
/**
|
|
279
|
+
* A profile with the empties taken out, or `undefined` when nothing is left.
|
|
280
|
+
*
|
|
281
|
+
* Trimming here rather than at the form is what makes a hand-edited file and a
|
|
282
|
+
* saved one read the same: a bio of three spaces is a bio nobody wrote, and a
|
|
283
|
+
* link with no URL is not somewhere this person is.
|
|
284
|
+
*/
|
|
285
|
+
export declare function cleanProfile(profile: UserProfile): UserProfile | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* Turn one notice on or off for one user.
|
|
288
|
+
*
|
|
289
|
+
* The map holds only what somebody changed, so this writes through
|
|
290
|
+
* {@link withNotification} and drops the key altogether when the answer is the
|
|
291
|
+
* default again. An event this version has never heard of changes nothing:
|
|
292
|
+
* there would be no switch to reach it with and no sender to read it. Returns
|
|
293
|
+
* `false` when there is no such user.
|
|
294
|
+
*/
|
|
295
|
+
export declare function setUserNotification(input: {
|
|
296
|
+
/** Which site's users file to write. */
|
|
297
|
+
dataDir: string;
|
|
298
|
+
/** Whose preference. */
|
|
299
|
+
userId: number;
|
|
300
|
+
/** Which notice, by its name in the registry. */
|
|
301
|
+
event: string;
|
|
302
|
+
/** Whether they want it. */
|
|
303
|
+
on: boolean;
|
|
304
|
+
}): Promise<boolean>;
|
|
305
|
+
/**
|
|
306
|
+
* Say how often one notice reaches one user.
|
|
307
|
+
*
|
|
308
|
+
* The twin of {@link setUserNotification}, and it writes on the same rule:
|
|
309
|
+
* through {@link withNotificationMode}, which drops the key when the answer is
|
|
310
|
+
* the default again, when the mode is one this version does not know, and when
|
|
311
|
+
* the event does not offer a choice at all. So a form submitting nonsense
|
|
312
|
+
* leaves the file saying nothing rather than saying something unreachable.
|
|
313
|
+
* Returns `false` when there is no such user.
|
|
314
|
+
*/
|
|
315
|
+
export declare function setUserNotificationMode(input: {
|
|
316
|
+
/** Which site's users file to write. */
|
|
317
|
+
dataDir: string;
|
|
318
|
+
/** Whose preference. */
|
|
319
|
+
userId: number;
|
|
320
|
+
/** Which notice, by its name in the registry. */
|
|
321
|
+
event: string;
|
|
322
|
+
/** How often they want it. */
|
|
323
|
+
mode: string;
|
|
324
|
+
}): Promise<boolean>;
|
|
325
|
+
/**
|
|
326
|
+
* Thrown when the id being imported already belongs to somebody else.
|
|
327
|
+
*
|
|
328
|
+
* Two accounts answering to one actor id is two people with one identity, and
|
|
329
|
+
* two carrying one WordPress number is a delivery to the plugin's old inbox
|
|
330
|
+
* that could go to either. Neither is something to pick a winner for, so the
|
|
331
|
+
* import stops and says whose it is.
|
|
332
|
+
*/
|
|
333
|
+
export declare class ConflictingActorIdError extends Error {
|
|
334
|
+
readonly name = "ConflictingActorIdError";
|
|
335
|
+
/** The user who already has it. */
|
|
336
|
+
readonly username: string;
|
|
337
|
+
constructor(username: string, what: string);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Write the two ids a site arriving from the WordPress ActivityPub plugin
|
|
341
|
+
* carries: the actor id its followers hold, and the number its paths are built
|
|
342
|
+
* from (TASK-69, TASK-70).
|
|
343
|
+
*
|
|
344
|
+
* The only writer of either field, and it is not a screen: doc-4 makes a
|
|
345
|
+
* stored actor id identity for the life of the account, and identity is not
|
|
346
|
+
* something a form should be able to retype. `geekity import wordpress-actor`
|
|
347
|
+
* is what calls this.
|
|
348
|
+
*
|
|
349
|
+
* Both ids have to be unique across the file, and the check is inside the
|
|
350
|
+
* write for the reason {@link createUser}'s duplicate check is: it is a rule
|
|
351
|
+
* about the file rather than about one user, so it is read and acted on as one
|
|
352
|
+
* step. Returns whether anything changed — a second run with the same ids
|
|
353
|
+
* writes nothing, which is what makes the import idempotent.
|
|
354
|
+
*/
|
|
355
|
+
export declare function setUserWordPressActor(input: {
|
|
356
|
+
/** Which site's users file to write. */
|
|
357
|
+
dataDir: string;
|
|
358
|
+
/** Whose record, by login name. */
|
|
359
|
+
username: string;
|
|
360
|
+
/** The id WordPress published them under, query string and all. */
|
|
361
|
+
actorId: string;
|
|
362
|
+
/** The WordPress user id. */
|
|
363
|
+
wordpressActorId: number;
|
|
364
|
+
}): Promise<boolean>;
|
|
365
|
+
/** Thrown when a command names a user this site does not have. */
|
|
366
|
+
export declare class UnknownUserError extends Error {
|
|
367
|
+
readonly name = "UnknownUserError";
|
|
368
|
+
/** The name that was asked for. */
|
|
369
|
+
readonly username: string;
|
|
370
|
+
constructor(username: string);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Take a user out of the file. Returns `false` when there was nothing to take.
|
|
374
|
+
*
|
|
375
|
+
* Their sessions are not ended here: sessions are in the database, and the
|
|
376
|
+
* screen that deletes a user ends them itself. A session that outlives this —
|
|
377
|
+
* one in a database restored from a backup, say — names a user the file no
|
|
378
|
+
* longer holds, and the admin guard turns that into no session at all.
|
|
379
|
+
*/
|
|
380
|
+
export declare function deleteUser(input: {
|
|
381
|
+
dataDir: string;
|
|
382
|
+
userId: number;
|
|
383
|
+
}): Promise<boolean>;
|
|
384
|
+
/**
|
|
385
|
+
* The user, when the password is theirs; `undefined` when it is not, or when
|
|
386
|
+
* there is no such user. The two failures are deliberately indistinguishable.
|
|
387
|
+
*/
|
|
388
|
+
export declare function verifyUserPassword(dataDir: string, username: string, password: string): User | undefined;
|
|
389
|
+
/**
|
|
390
|
+
* Turn an older site's users rows into `data/users.json`, once, and drop the
|
|
391
|
+
* table.
|
|
392
|
+
*
|
|
393
|
+
* TASK-9 put the accounts in SQLite; decision-9 made the database disposable,
|
|
394
|
+
* and a site upgrading across the two has rows nothing would ever read again.
|
|
395
|
+
* So the first boot of this version writes them out — ids and hashes exactly
|
|
396
|
+
* as they stand, because a session names its user by id and a hash is not
|
|
397
|
+
* something to re-encode on the way past.
|
|
398
|
+
*
|
|
399
|
+
* The file wins, as it does everywhere else: a `users.json` that is already
|
|
400
|
+
* there is left alone, so a database restored from a backup taken before the
|
|
401
|
+
* upgrade cannot bring deleted accounts back or undo a password change. The
|
|
402
|
+
* table is dropped either way, because a fresh database gets it from migration
|
|
403
|
+
* 1 — which has shipped, and so is never edited — and a site that has been
|
|
404
|
+
* migrated must not be asked again.
|
|
405
|
+
*
|
|
406
|
+
* Synchronous because `createCms` is: it runs before the server is listening
|
|
407
|
+
* and before anything else has touched the file.
|
|
408
|
+
*/
|
|
409
|
+
export declare function migrateUsersToFile(options: {
|
|
410
|
+
admin: AdminStore;
|
|
411
|
+
dataDir: string;
|
|
412
|
+
}): void;
|
|
413
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/admin/accounts.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,uCAAuC;AACvC,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,gFAAgF;AAChF,eAAO,MAAM,eAAe,MAAQ,CAAC;AAErC,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,mFAAmF;AACnF,MAAM,WAAW,IAAI;IACnB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,MA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