dineway 0.2.40 → 0.2.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{activity-LXZdjKwI.mjs → activity-BuhkMdv8.mjs} +2 -2
- package/dist/{activity-events-DoqeOM8x.mjs → activity-events-DkHsy7Y0.mjs} +1 -1
- package/dist/{allowed-origins-B4zstd2d.mjs → allowed-origins-DASdFW-l.mjs} +1 -1
- package/dist/api/route-utils.d.mts +15 -12
- package/dist/api/route-utils.mjs +27 -20
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +10 -5
- package/dist/{api-CQishNjZ.mjs → api-BBXfpMJw.mjs} +41 -13
- package/dist/{api-tokens-CNHnKO57.mjs → api-tokens-ciHNTdN2.mjs} +1 -1
- package/dist/{apply-D4rZHDyg.mjs → apply-CZDKUvZ4.mjs} +62 -18
- package/dist/astro/index.d.mts +16 -13
- package/dist/astro/index.mjs +31 -5
- package/dist/astro/middleware/auth.d.mts +14 -11
- package/dist/astro/middleware/auth.mjs +8 -8
- package/dist/astro/middleware/redirect.mjs +10 -6
- package/dist/astro/middleware/request-context.mjs +5 -5
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +2 -2
- package/dist/astro/middleware.mjs +266 -176
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +12 -7
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +12 -7
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
- package/dist/astro/routes/api/admin/briefing.mjs +41 -22
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +14 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +14 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +14 -10
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/index.mjs +25 -19
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +20 -16
- package/dist/astro/routes/api/admin/comments/_id_.mjs +10 -7
- package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -13
- package/dist/astro/routes/api/admin/comments/counts.mjs +10 -7
- package/dist/astro/routes/api/admin/comments/index.mjs +18 -13
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +51 -39
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +51 -39
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +57 -44
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +57 -44
- package/dist/astro/routes/api/admin/context/diff.mjs +56 -43
- package/dist/astro/routes/api/admin/context/index.mjs +57 -44
- package/dist/astro/routes/api/admin/context/stale.mjs +56 -43
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +51 -39
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +56 -43
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +56 -43
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +52 -40
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +7 -7
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +7 -7
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +78 -68
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +78 -68
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +78 -67
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +78 -67
- package/dist/astro/routes/api/admin/plugins/index.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +78 -67
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/updates.mjs +71 -60
- package/dist/astro/routes/api/admin/review-requests/_id_/image.mjs +38 -23
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +46 -36
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +63 -52
- package/dist/astro/routes/api/admin/review-requests/_id_/revoke.mjs +9 -9
- package/dist/astro/routes/api/admin/review-requests/index.mjs +61 -50
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +71 -60
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +71 -60
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +11 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +12 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +17 -12
- package/dist/astro/routes/api/auth/invite/index.mjs +14 -9
- package/dist/astro/routes/api/auth/invite/register-options.mjs +16 -11
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +17 -12
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +14 -11
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +12 -7
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +19 -14
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +16 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +17 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs +17 -12
- package/dist/astro/routes/api/auth/setup-token/index.mjs +6 -6
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/signup/complete.mjs +17 -12
- package/dist/astro/routes/api/auth/signup/request.mjs +17 -12
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts +14 -11
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +23 -19
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +23 -18
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +25 -20
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +41 -31
- package/dist/astro/routes/api/content/_collection_/_id_/release-readiness.mjs +14 -9
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +41 -31
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +30 -20
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +25 -14
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +25 -14
- package/dist/astro/routes/api/content/_collection_/trash.mjs +13 -8
- package/dist/astro/routes/api/dashboard.mjs +21 -13
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/health.mjs +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +30 -23
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +13 -10
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +14 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +58 -47
- package/dist/astro/routes/api/import/wordpress/media.d.mts +14 -11
- package/dist/astro/routes/api/import/wordpress/media.mjs +17 -14
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +61 -48
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +15 -12
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +58 -45
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +32 -26
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +14 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +63 -52
- package/dist/astro/routes/api/integration/artifact.mjs +9 -9
- package/dist/astro/routes/api/integration/dispatch.mjs +14 -14
- package/dist/astro/routes/api/integrations/_provider_.mjs +9 -9
- package/dist/astro/routes/api/integrations/index.mjs +8 -8
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.mjs +141 -93
- package/dist/astro/routes/api/media/_id_/confirm.mjs +15 -12
- package/dist/astro/routes/api/media/_id_.mjs +14 -9
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +16 -13
- package/dist/astro/routes/api/media.mjs +19 -16
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +57 -44
- package/dist/astro/routes/api/menus/_name_/items.mjs +57 -44
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +57 -44
- package/dist/astro/routes/api/menus/_name_/translations.mjs +57 -44
- package/dist/astro/routes/api/menus/_name_.mjs +57 -44
- package/dist/astro/routes/api/menus/index.mjs +57 -44
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +10 -5
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +15 -13
- package/dist/astro/routes/api/redirects/404s/summary.mjs +15 -13
- package/dist/astro/routes/api/redirects/_id_.mjs +57 -44
- package/dist/astro/routes/api/redirects/index.mjs +57 -44
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +73 -62
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +73 -62
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +73 -62
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +73 -62
- package/dist/astro/routes/api/schema/collections/index.mjs +73 -62
- package/dist/astro/routes/api/schema/index.mjs +13 -10
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +71 -60
- package/dist/astro/routes/api/schema/orphans/index.mjs +71 -60
- package/dist/astro/routes/api/search/enable.mjs +20 -13
- package/dist/astro/routes/api/search/index.mjs +19 -12
- package/dist/astro/routes/api/search/rebuild.mjs +20 -13
- package/dist/astro/routes/api/search/stats.mjs +12 -7
- package/dist/astro/routes/api/search/suggest.mjs +19 -12
- package/dist/astro/routes/api/sections/_slug_.mjs +57 -44
- package/dist/astro/routes/api/sections/index.mjs +57 -44
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings/reviews.mjs +11 -11
- package/dist/astro/routes/api/settings.mjs +57 -44
- package/dist/astro/routes/api/setup/admin-verify.mjs +19 -14
- package/dist/astro/routes/api/setup/admin.mjs +17 -12
- package/dist/astro/routes/api/setup/dev-bypass.mjs +44 -32
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +47 -34
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +9 -9
- package/dist/astro/routes/api/system/heartbeat.mjs +2 -2
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +60 -47
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +60 -47
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +60 -47
- package/dist/astro/routes/api/taxonomies/index.mjs +60 -47
- package/dist/astro/routes/api/themes/preview.mjs +7 -7
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +56 -43
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +57 -44
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +57 -44
- package/dist/astro/routes/api/widget-areas/_name_.mjs +53 -41
- package/dist/astro/routes/api/widget-areas/index.mjs +57 -44
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +14 -9
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +20 -16
- package/dist/astro/routes/sitemap.xml.mjs +19 -15
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +8 -3
- package/dist/astro/types.d.mts +21 -14
- package/dist/{atomic-authority-CnBQJ14T.mjs → atomic-authority-Bf5QZboB.mjs} +2 -2
- package/dist/{audit-Cl495Ze3.mjs → audit-hXJBTPY0.mjs} +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-DbjgJdlo.mjs → auth-control-guard-DpUP6Fs_.mjs} +1 -1
- package/dist/{authorize-DDmgmnW-.mjs → authorize-DWNOqMKq.mjs} +1 -1
- package/dist/{briefing-DsD-Ouwc.mjs → briefing-BShyAm_Z.mjs} +1 -1
- package/dist/{briefing-COw-WcYz.mjs → briefing-CaeEFvkD.mjs} +995 -7
- package/dist/{bundle-bhiszAui.mjs → bundle-DWn5eFKz.mjs} +2 -2
- package/dist/{byline-fields-D-b9CWux.d.mts → byline-fields-B7pQ3LMi.d.mts} +14 -10
- package/dist/{byline-fields-BKj5f3Ub.mjs → byline-fields-DRMCc0V_.mjs} +1 -1
- package/dist/{byline-fields-DZ46DF10.mjs → byline-fields-wWu2Cb3l.mjs} +3 -3
- package/dist/{byline-registry-CJihchD1.mjs → byline-registry-Caj0_gbU.mjs} +1 -1
- package/dist/{byline-TYk2kad6.mjs → byline-uuVB2B3E.mjs} +65 -14
- package/dist/{bylines-6T9iVC9j.mjs → bylines-PLlsL31L.mjs} +3 -3
- package/dist/{bylines-CvTSCAw9.mjs → bylines-XGlNK0Lo.mjs} +5 -5
- package/dist/{patterns-Ay-4KImK.mjs → cache-DsEbwFVE.mjs} +51 -1
- package/dist/{chunks-C8vSD_5L.mjs → chunks-Bb56aCtB.mjs} +1 -1
- package/dist/cli/index.mjs +486 -48
- package/dist/cli/plugin-kit.d.mts +14 -11
- package/dist/cli/plugin-kit.mjs +2 -2
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +16 -13
- package/dist/client/index.mjs +2 -2
- package/dist/{client-factory-C1ZQCMog.mjs → client-factory-BLbm250o.mjs} +1 -1
- package/dist/{comment-DAQfUjqt.mjs → comment-BWDG1nQm.mjs} +2 -2
- package/dist/{comment-reaction-Dp3G7UZc.mjs → comment-reaction-B7pLTlQ7.mjs} +1 -1
- package/dist/{comments-BrvIaRAx.mjs → comments-xkten8nV.mjs} +1 -1
- package/dist/config-6R0bchVE.mjs +125 -0
- package/dist/{content-CIKsrvU9.mjs → content-BNeuaVCS.mjs} +302 -45
- package/dist/content-Dr22fzA_.mjs +390 -0
- package/dist/{content-refresh-BilzqcLt.mjs → content-refresh-D7wpVFJ_.mjs} +14 -8
- package/dist/content-storage/index.d.mts +193 -0
- package/dist/content-storage/index.mjs +29 -0
- package/dist/content-storage/store.d.mts +3 -0
- package/dist/content-storage/store.mjs +5 -0
- package/dist/{review-payload-Bap86e75.mjs → content-write-43KZZ7dz.mjs} +838 -131
- package/dist/{context-DAs_MZjJ.mjs → context-Cjz0y4Al.mjs} +292 -23
- package/dist/{context-DVTvucNb.mjs → context-DuYXPlfZ.mjs} +2 -2
- package/dist/{context-route-helpers-BP-UJ4u8.mjs → context-route-helpers-TP3EqxRQ.mjs} +2 -2
- package/dist/{dashboard-BAjWCGCP.mjs → dashboard-BquGX1ue.mjs} +4 -4
- package/dist/database/batch.d.mts +1 -1
- package/dist/database/batch.mjs +1 -1
- package/dist/database/d1/index.d.mts +14 -11
- package/dist/database/d1/index.mjs +4 -4
- package/dist/database/instrumentation.mjs +3 -2
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{device-flow-Dh0rNlh1.mjs → device-flow-SoZh-HvN.mjs} +3 -3
- package/dist/{discovery-V0e0Gg8j.mjs → discovery-BwCZFUXm.mjs} +4 -4
- package/dist/{enrich-B7PIJ8Iy.mjs → enrich-CAMsD1aT.mjs} +1 -1
- package/dist/{error-B5a45Tfb.mjs → error-sL4aemcW.mjs} +2 -0
- package/dist/{evidence-Vnp_fQbC.mjs → evidence-1Gr8TlTf.mjs} +7 -7
- package/dist/{field-defs-cache-aXUeXJdC.mjs → field-defs-cache-dn5Tw79A.mjs} +4 -4
- package/dist/{fts-manager-BrPpYtK0.mjs → fts-manager-Zu5ITic0.mjs} +1 -1
- package/dist/{hitl-requests-BxMMON3s.mjs → hitl-requests-Bdab4DhO.mjs} +2 -2
- package/dist/{hitl-route-helpers-sdnjpx2k.mjs → hitl-route-helpers-DGMLQajA.mjs} +5 -5
- package/dist/hook-events-BQw73jc7.d.mts +32 -0
- package/dist/{import-C2-v4FCs.mjs → import-DJFlvQey.mjs} +9 -9
- package/dist/{index-BVGe04wF.d.mts → index-CLj17kW9.d.mts} +12 -5
- package/dist/index.d.mts +19 -16
- package/dist/index.mjs +107 -98
- package/dist/{integration-credentials-DMEXZU2J.mjs → integration-credentials-DpuRw1kx.mjs} +2 -2
- package/dist/{jsonld-wRF85RXo.d.mts → jsonld-CPijKSUe.d.mts} +2 -2
- package/dist/{load-DvCVppOF.mjs → load-CiRTddkJ.mjs} +1 -1
- package/dist/{loader-Dp6zLmQm.mjs → loader-Bq1aW12P.mjs} +16 -5
- package/dist/{manifest-schema-CCvogfrP.mjs → manifest-schema-DaQpgyTB.mjs} +1 -1
- package/dist/{mcp-reviewed-executor-B8Gbin3T.mjs → mcp-reviewed-executor-DtTnFcqC.mjs} +6 -6
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +16 -13
- package/dist/media/local-runtime.mjs +3 -3
- package/dist/{media-C5ba8fvI.mjs → media-BjH5OD-A.mjs} +1 -1
- package/dist/{media-allowlist-DQvscVkS.mjs → media-allowlist-C8HJ2O61.mjs} +1 -1
- package/dist/{menus-w5xwT-f5.mjs → menus-BXkfzNR1.mjs} +7 -7
- package/dist/{menus-CyNpBQrX.mjs → menus-CbBi7Ad7.mjs} +2 -2
- package/dist/migration-D9OY6vI9.mjs +526 -0
- package/dist/{migrations-CLlX25HO.mjs → migrations-BAjF60cl.mjs} +1 -1
- package/dist/{oauth-authorization-CdqJZUMf.mjs → oauth-authorization-CSSRMOKn.mjs} +4 -4
- package/dist/{oauth-clients-CHNb9MAZ.mjs → oauth-clients-DX5HIJJv.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-mxCW-Rpt.mjs → object-cache-DyI1SOBK.mjs} +3 -1
- package/dist/owned-metadata-C99DzQuq.mjs +69 -0
- package/dist/page/index.d.mts +15 -12
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-THHCpJLB.mjs → parse-C6kCR1OT.mjs} +1 -1
- package/dist/plugin-utils.d.mts +14 -11
- package/dist/plugins/adapt-sandbox-entry.d.mts +14 -11
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{plugins-pfraURNp.mjs → plugins-LtyuDuIb.mjs} +16 -962
- package/dist/{policy-D2USlibj.mjs → policy-Drg5yr1-.mjs} +2 -2
- package/dist/{preview-Bh7D7F27.mjs → preview-CWiIjMDi.mjs} +2 -2
- package/dist/{provider-loader-DT7vQ5FI.d.mts → provider-loader-oLKm1AU8.d.mts} +1 -1
- package/dist/{public-url-Ccv0Xmue.d.mts → public-url-CEC1vj02.d.mts} +2 -2
- package/dist/{public-url-CG5YbNqB.d.mts → public-url-cMnsBUZB.d.mts} +1 -1
- package/dist/{publication-authorization-B_HJSnzR.mjs → publication-authorization-CJ4Jr5Hg.mjs} +43 -17
- package/dist/{query-xspvw7Ui.mjs → query-CLWTwcTr.mjs} +14 -14
- package/dist/{query-DLeahg3x.mjs → query-CP9M8xxX.mjs} +4 -4
- package/dist/{rate-limit-BsBr_U9g.mjs → rate-limit-DeVLLe4z.mjs} +2 -2
- package/dist/{redirect-BQFa1THe.mjs → redirect-CJ-FAbNK.mjs} +2 -2
- package/dist/{redirects-DJcsgz_X.mjs → redirects-BKi6mek4.mjs} +4 -5
- package/dist/{redirects-CVfxefrz.mjs → redirects-I78-ZYLV.mjs} +5 -386
- package/dist/{registry-Dclv9iHv.mjs → registry-B-HULaJI.mjs} +7 -7
- package/dist/{release-Da2UFygt.mjs → release-D615eKav.mjs} +173 -22
- package/dist/request-context.d.mts +30 -0
- package/dist/{request-meta-CjORiJQ_.mjs → request-meta-DZYuLXx_.mjs} +1 -1
- package/dist/review-payload-Bhi52CbI.mjs +112 -0
- package/dist/{review-requests-CcSUTm_l.mjs → review-requests-CGQ1u7uY.mjs} +2 -2
- package/dist/{review-requests-CUVn0RBl.mjs → review-requests-DZYM51yI.mjs} +2 -2
- package/dist/{review-route-helpers-CKBfGKCi.mjs → review-route-helpers-DXNDyx_q.mjs} +2 -2
- package/dist/{revision-W6FDfDqx.mjs → revision-DlxUfOD5.mjs} +42 -7
- package/dist/revisions-qNkae-Dq.mjs +57 -0
- package/dist/{revocation-C_ZQvGRT.mjs → revocation-4we8kfBg.mjs} +2 -2
- package/dist/{runner-CRU7BXjr.mjs → runner-CuG8o1uW.mjs} +558 -487
- package/dist/{runner-SoP1rphP.d.mts → runner-DXQkyPeX.d.mts} +1 -1
- package/dist/{runs-BtaAiLTw.mjs → runs-BjgLfqCn.mjs} +5 -5
- package/dist/runtime-Bs2JMbb2.d.mts +45 -0
- package/dist/runtime-Ch5G-tnG.mjs +400 -0
- package/dist/runtime.d.mts +15 -12
- package/dist/runtime.mjs +9 -4
- package/dist/schema-DVeOJpqA.mjs +8 -0
- package/dist/{search-BI9uKr7U.mjs → search-zMoM2_uq.mjs} +4 -98
- package/dist/{secrets-D_pergcD.mjs → secrets-CIYcw9T9.mjs} +4 -4
- package/dist/{sections-BqqYq9RW.mjs → sections-BtO0Zdv5.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +38 -26
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +12 -9
- package/dist/{seo-B-5PsaJO.mjs → seo-DwcULb78.mjs} +1 -1
- package/dist/{seo-Bs_DUxJf.mjs → seo-uliFa7s-.mjs} +44 -5
- package/dist/{service-W2xuGLgw.mjs → service-BBJM08uD.mjs} +2 -2
- package/dist/{service-B65aJsN7.mjs → service-CkMuD5AE.mjs} +3 -3
- package/dist/{settings-CyJ2-MKx.mjs → settings-D31Y4msD.mjs} +2 -2
- package/dist/{settings-DsBzKeUQ.mjs → settings-DDOB3gW1.mjs} +7 -7
- package/dist/{setup-complete-t9yamqBb.mjs → setup-complete-5GxB7hiF.mjs} +1 -1
- package/dist/{site-activity-DU0UPDji.mjs → site-activity-hpfJkmxQ.mjs} +1 -1
- package/dist/{site-context-Dic2jHuw.mjs → site-context-D3AmDdpQ.mjs} +15 -15
- package/dist/{site-url-Tw6CfBB2.mjs → site-url-CYatfe3q.mjs} +1 -1
- package/dist/{state-jx6Yiwsm.mjs → state-ClG1I4wl.mjs} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +2 -2
- package/dist/{store-32e6dfD-.mjs → store-BzaAtszy.mjs} +3 -3
- package/dist/submission-DgLES24O.mjs +205 -0
- package/dist/{taxonomies-BFsUR7kc.mjs → taxonomies-B4hE8Yb3.mjs} +3 -3
- package/dist/{taxonomies-lWGNLKgn.mjs → taxonomies-BI26Bk-M.mjs} +7 -7
- package/dist/{taxonomy-DN6i1upz.mjs → taxonomy-B8w8F2Cs.mjs} +53 -3
- package/dist/terms-EskuqbKE.mjs +104 -0
- package/dist/text-extraction-CdqMGYQK.mjs +96 -0
- package/dist/{tokens-D-StaTAQ.mjs → tokens-D8HEH277.mjs} +1 -1
- package/dist/{trusted-proxy-hYufGFPK.mjs → trusted-proxy-Dg3U9Lrv.mjs} +1 -1
- package/dist/{types-D5JfvPvx.d.mts → types-0gRlZbhN.d.mts} +88 -32
- package/dist/{types-RFzE_V1M.mjs → types-BI3ULB3A.mjs} +2 -2
- package/dist/{types-B--VyN3n.d.mts → types-Dpv_MvwZ.d.mts} +1 -1
- package/dist/{types-CgcOeaiQ.d.mts → types-ex-UrNlz.d.mts} +1 -1
- package/dist/types-qOEot0UQ.d.mts +83 -0
- package/dist/ui/server-runtime.d.mts +18 -15
- package/dist/ui/server-runtime.mjs +29 -25
- package/dist/{user-Btai9rl3.mjs → user-Bl2_8rhJ.mjs} +2 -2
- package/dist/{utils-CYxGuO_P.mjs → utils-CklSLz9F.mjs} +2 -2
- package/dist/{validate-C05z0m7M.mjs → validate-C-yk7mmX.mjs} +3 -3
- package/dist/{validate-kmN2lS8H.d.mts → validate-DUscf6VG.d.mts} +3 -3
- package/dist/version-Co258u70.mjs +6 -0
- package/dist/version-store-BXv2D0de.mjs +208 -0
- package/dist/version-store-B_THJCc0.d.mts +98 -0
- package/dist/{widgets-BOrDZdQ3.mjs → widgets-B99mnftw.mjs} +3 -3
- package/dist/{wordpress-slugs-ROzITIBK.mjs → wordpress-slugs-yaeD7cxn.mjs} +1 -1
- package/dist/{worker-CKU70ODm.mjs → worker-DdI-KtvF.mjs} +10 -10
- package/dist/write-intent-DuHVqks9.mjs +108 -0
- package/dist/{zod-generator-DkrWuID7.mjs → zod-generator-B5Pt8fv0.mjs} +2 -2
- package/package.json +16 -4
- package/dist/cache-B5NSHhxG.mjs +0 -52
- package/dist/cron-C7HCJPPl.mjs +0 -271
- package/dist/schema-CosVhHJt.mjs +0 -8
- package/dist/submission-DJmRejGR.mjs +0 -411
- package/dist/version-CISd4wX_.mjs +0 -6
- /package/dist/{actor-DxUAJgQX.mjs → actor-D0AW80ld.mjs} +0 -0
- /package/dist/{adapter-symbols-Bq3JsWGM.d.mts → adapter-symbols-B9mi-BUh.d.mts} +0 -0
- /package/dist/{adapters-C8nRpUuj.d.mts → adapters-lDnJjNDz.d.mts} +0 -0
- /package/dist/{api-tokens-0N3nafqZ.mjs → api-tokens-CdfsE9PL.mjs} +0 -0
- /package/dist/{base64-Cz-aU0X1.mjs → base64-qvSs0Gxy.mjs} +0 -0
- /package/dist/{challenge-store-DFGsDtCj.mjs → challenge-store-Dq5HiMO3.mjs} +0 -0
- /package/dist/{components-rFN8NH3N.mjs → components-JA6tFHmE.mjs} +0 -0
- /package/dist/{context-types-CPWAJRs5.mjs → context-types-DDIJhGLs.mjs} +0 -0
- /package/dist/{default-BS6VQRkB.mjs → default-C2azCFSB.mjs} +0 -0
- /package/dist/{email-console-GqK6hgMJ.mjs → email-console-BYQp_5Qr.mjs} +0 -0
- /package/dist/{escape-CE7xOWzJ.mjs → escape-4_NNa6GR.mjs} +0 -0
- /package/dist/{experimental-workflows-BbxpWwBy.mjs → experimental-workflows-CPNiI2EL.mjs} +0 -0
- /package/dist/{forgeway-account-DcTxh3Gw.mjs → forgeway-account-7N-3srH-.mjs} +0 -0
- /package/dist/{hash-D2Rqd2J2.mjs → hash-qSYPMJ8w.mjs} +0 -0
- /package/dist/{media-url-D9kdpoLS.mjs → media-url-D5E1a47B.mjs} +0 -0
- /package/dist/{mime-BnVhH671.mjs → mime-FkfazULS.mjs} +0 -0
- /package/dist/{mode-BJwb_MgK.mjs → mode-B_m1BGFh.mjs} +0 -0
- /package/dist/{normalize-aTwryvvi.mjs → normalize-DrmlLn40.mjs} +0 -0
- /package/dist/{oauth-authority-P5YMSk2z.mjs → oauth-authority-DVlLFhsZ.mjs} +0 -0
- /package/dist/{oauth-state-store-CMqLdo4I.mjs → oauth-state-store-nf-78RbK.mjs} +0 -0
- /package/dist/{options-JiLWB6Bt.mjs → options-yFkLUuTw.mjs} +0 -0
- /package/dist/{output-7HDrYTSQ.mjs → output-B1GiXeT8.mjs} +0 -0
- /package/dist/{parser-kettsjWc.mjs → parser-CTlxybRo.mjs} +0 -0
- /package/dist/{passkey-config-DVzQ3dv3.mjs → passkey-config-BLon3ct9.mjs} +0 -0
- /package/dist/{placeholder-DJLP_HY7.d.mts → placeholder-DdZV3I8x.d.mts} +0 -0
- /package/dist/{portable-text-BE7nszX6.d.mts → portable-text-HNmwL-7L.d.mts} +0 -0
- /package/dist/{portable-text-tQhvPLf1.mjs → portable-text-p0Ojfpfo.mjs} +0 -0
- /package/dist/{process-cache-C19OA3am.mjs → process-cache-CMy5M80h.mjs} +0 -0
- /package/dist/{provider-loader-DERzBMUz.mjs → provider-loader-DlaT1usE.mjs} +0 -0
- /package/dist/{public-discovery-BGyhuD5U.mjs → public-discovery-BnqYofSK.mjs} +0 -0
- /package/dist/{public-url-DFXUU6Wp.mjs → public-url-BHjYWuaN.mjs} +0 -0
- /package/dist/{public-url-sR8SVmTt.mjs → public-url-GQygrYmg.mjs} +0 -0
- /package/dist/{redirect-BxacnBYL.mjs → redirect-CokmLN5o.mjs} +0 -0
- /package/dist/{request-cache-8_ifFzVw.mjs → request-cache-CizvDoxV.mjs} +0 -0
- /package/dist/{resolve-DEKC4qVa.mjs → resolve-BxFGSKYu.mjs} +0 -0
- /package/dist/{runtime-env-CPTzh0mZ.mjs → runtime-env-DpYGy4pT.mjs} +0 -0
- /package/dist/{scheduled-publish-BxdShRGs.d.mts → scheduled-publish-eCNGpvNm.d.mts} +0 -0
- /package/dist/{seo-contributions-LEFs1d7w.mjs → seo-contributions-ZKqrqsdT.mjs} +0 -0
- /package/dist/{service-kQ5ljRzX.mjs → service-DeX1PRNt.mjs} +0 -0
- /package/dist/{session-user-B8yYh0g5.mjs → session-user-B0XMp1GC.mjs} +0 -0
- /package/dist/{setup-nonce-B6A5Y1ea.mjs → setup-nonce-B9IO7PbK.mjs} +0 -0
- /package/dist/{sidecar-client-BwPhhz-F.mjs → sidecar-client-2hx5G46s.mjs} +0 -0
- /package/dist/{slugify-kD31VIv2.mjs → slugify-DvoaEPtL.mjs} +0 -0
- /package/dist/{ssrf-C9dyjU8O.mjs → ssrf-DcD8vn3E.mjs} +0 -0
- /package/dist/{stable-hash-B9Tbb2f_.mjs → stable-hash-9RDJgfif.mjs} +0 -0
- /package/dist/{status-Bjf_uSrW.mjs → status-B2xUokyJ.mjs} +0 -0
- /package/dist/{transport-BrU1aDY5.mjs → transport-BK_me2MZ.mjs} +0 -0
- /package/dist/{transport-CZbtxgKZ.d.mts → transport-CVU5rp7W.d.mts} +0 -0
- /package/dist/{types-DNBL-4Sn.mjs → types-B3Uq7Czg.mjs} +0 -0
- /package/dist/{types-DsJTXStN.d.mts → types-BJztoTbF.d.mts} +0 -0
- /package/dist/{types-COvyXIp7.mjs → types-BgUxCuwu.mjs} +0 -0
- /package/dist/{types-KFzuijKE.d.mts → types-C0heD9oI.d.mts} +0 -0
- /package/dist/{types-B03h5jt_.d.mts → types-DheoByey.d.mts} +0 -0
- /package/dist/{types-SlLXjRpg.d.mts → types-I5LHzk_M.d.mts} +0 -0
- /package/dist/{types-PLJ9hlhh.mjs → types-Nm0cMxEh.mjs} +0 -0
- /package/dist/{types-CtGSEKEJ.d.mts → types-PxxPTFSl.d.mts} +0 -0
- /package/dist/{url-DGG3hw_h.mjs → url-Coamqvs4.mjs} +0 -0
- /package/dist/{url-DUz3LbCs.mjs → url-dn4mFfCI.mjs} +0 -0
- /package/dist/{workers-build-BkmPhclj.mjs → workers-build-XNBt1wGF.mjs} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getRequestContext, runWithContext } from "./request-context.mjs";
|
|
2
2
|
import { AtomicWriteConflict, atomicBatch, isD1Database, rowUnchanged } from "./database/batch.mjs";
|
|
3
|
-
import { t as ContentRepository } from "./content-
|
|
4
|
-
import { t as SiteActivityRepository } from "./site-activity-
|
|
5
|
-
import { t as buildStableHash } from "./stable-hash-
|
|
6
|
-
import { r as ReviewRequestRepository } from "./review-requests-
|
|
7
|
-
import { t as PublicationAuthorizationError } from "./publication-authorization-
|
|
8
|
-
import { t as ReviewPayloadBuilder } from "./review-payload-
|
|
9
|
-
import { t as DinewayToolsError } from "./service-
|
|
10
|
-
import { i as REVIEW_MODEL, o as matchesDecisionModel } from "./runs-
|
|
11
|
-
import { i as reviewDraft, n as loadReviewContext, r as loadReviewImages, t as ReviewEvidenceError } from "./evidence-
|
|
12
|
-
import { a as reviewQuestions, n as classifyReview, r as getReviewPolicy, t as REVIEW_THRESHOLDS } from "./policy-
|
|
3
|
+
import { t as ContentRepository } from "./content-BNeuaVCS.mjs";
|
|
4
|
+
import { t as SiteActivityRepository } from "./site-activity-hpfJkmxQ.mjs";
|
|
5
|
+
import { t as buildStableHash } from "./stable-hash-9RDJgfif.mjs";
|
|
6
|
+
import { r as ReviewRequestRepository } from "./review-requests-DZYM51yI.mjs";
|
|
7
|
+
import { t as PublicationAuthorizationError } from "./publication-authorization-CJ4Jr5Hg.mjs";
|
|
8
|
+
import { t as ReviewPayloadBuilder } from "./review-payload-Bhi52CbI.mjs";
|
|
9
|
+
import { t as DinewayToolsError } from "./service-DeX1PRNt.mjs";
|
|
10
|
+
import { i as REVIEW_MODEL, o as matchesDecisionModel } from "./runs-BjgLfqCn.mjs";
|
|
11
|
+
import { i as reviewDraft, n as loadReviewContext, r as loadReviewImages, t as ReviewEvidenceError } from "./evidence-1Gr8TlTf.mjs";
|
|
12
|
+
import { a as reviewQuestions, n as classifyReview, r as getReviewPolicy, t as REVIEW_THRESHOLDS } from "./policy-Drg5yr1-.mjs";
|
|
13
13
|
import { sql } from "kysely";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { getRequestContext, runWithContext } from "./request-context.mjs";
|
|
2
|
+
import { atomicBatch } from "./database/batch.mjs";
|
|
3
|
+
import { n as contentDigest, o as ContentStorageError, s as ContentStorageReplay } from "./config-6R0bchVE.mjs";
|
|
4
|
+
import { r as getContentStorage } from "./runtime-Ch5G-tnG.mjs";
|
|
5
|
+
import { t as contentWriteChecks } from "./atomic-authority-Bf5QZboB.mjs";
|
|
6
|
+
import { a as contentVersionSchema } from "./version-store-BXv2D0de.mjs";
|
|
7
|
+
import { sql } from "kysely";
|
|
8
|
+
import { ulid } from "ulidx";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
|
|
11
|
+
//#region src/content-storage/write-intent.ts
|
|
12
|
+
const seedSchema = z.object({
|
|
13
|
+
entryId: z.string(),
|
|
14
|
+
revisionId: z.string(),
|
|
15
|
+
rootVersion: z.string(),
|
|
16
|
+
now: z.string(),
|
|
17
|
+
publishAuthority: z.boolean()
|
|
18
|
+
});
|
|
19
|
+
/** Persist generated identities before staging, so a process restart can resume the same write. */
|
|
20
|
+
async function beginContentWriteIntent(db, collection, input, request) {
|
|
21
|
+
const principal = getRequestContext()?.writePrincipal?.id ?? "system";
|
|
22
|
+
const key = input.operationId ?? ulid();
|
|
23
|
+
if (!key || key.length > 256) throw new ContentStorageError("CONFLICT", "Content operation identifiers must contain 1 to 256 characters.");
|
|
24
|
+
const operationId = await contentDigest({
|
|
25
|
+
principal,
|
|
26
|
+
collection,
|
|
27
|
+
key
|
|
28
|
+
});
|
|
29
|
+
const context = getRequestContext()?.contentWriteRequest;
|
|
30
|
+
const requestDigest = context && context.operationId === input.operationId ? context.digest : await contentDigest(request);
|
|
31
|
+
const generated = {
|
|
32
|
+
entryId: input.id ?? ulid(),
|
|
33
|
+
revisionId: ulid(),
|
|
34
|
+
rootVersion: ulid(),
|
|
35
|
+
now: (/* @__PURE__ */ new Date()).toISOString(),
|
|
36
|
+
publishAuthority: !!(input.publish || input.unpublish)
|
|
37
|
+
};
|
|
38
|
+
await atomicBatch(db, {
|
|
39
|
+
checks: [sql`NOT EXISTS (SELECT 1 FROM _dineway_content_write_intents WHERE id=${operationId} AND request_digest<>${requestDigest})`],
|
|
40
|
+
statements: [sql`INSERT INTO _dineway_content_write_intents (id,collection,entry_id,principal_id,request_digest,seed,created_at) VALUES (${operationId},${collection},${generated.entryId},${principal},${requestDigest},${JSON.stringify(generated)},${generated.now}) ON CONFLICT (id) DO NOTHING`.compile(db)]
|
|
41
|
+
});
|
|
42
|
+
const row = (await sql`SELECT seed FROM _dineway_content_write_intents WHERE id=${operationId}`.execute(db)).rows[0];
|
|
43
|
+
const seed = seedSchema.parse(JSON.parse(row.seed));
|
|
44
|
+
const operation = (await sql`SELECT state,command FROM _dineway_content_operations WHERE id=${operationId}`.execute(db)).rows[0];
|
|
45
|
+
if (operation?.state === "committed") {
|
|
46
|
+
await atomicBatch(db, {
|
|
47
|
+
checks: [...contentWriteChecks(collection, seed.entryId, "edit"), ...input.publish || input.unpublish ? contentWriteChecks(collection, seed.entryId, "publish") : []],
|
|
48
|
+
statements: []
|
|
49
|
+
});
|
|
50
|
+
throw new ContentStorageReplay(contentVersionSchema.shape.command.parse(JSON.parse(operation.command)));
|
|
51
|
+
}
|
|
52
|
+
if (operation?.state === "aborted") throw new ContentStorageError("ROUTE_CHANGED", "This save was interrupted by a routing migration. Reload the entry before saving again.");
|
|
53
|
+
return {
|
|
54
|
+
...seed,
|
|
55
|
+
operationId
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const REPLAYS = Symbol.for("dineway:content-write-replays");
|
|
59
|
+
const shared = globalThis;
|
|
60
|
+
const replayResults = shared[REPLAYS] ??= /* @__PURE__ */ new WeakSet();
|
|
61
|
+
function markContentWriteReplay(result) {
|
|
62
|
+
replayResults.add(result);
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
function isContentWriteReplay(result) {
|
|
66
|
+
return replayResults.has(result);
|
|
67
|
+
}
|
|
68
|
+
/** A committed retry returns the current entry without rerunning hooks or business actions. */
|
|
69
|
+
async function runIdempotentContentWrite(db, collection, key, request, operation, read) {
|
|
70
|
+
if (!key || !getContentStorage(db, collection)) return operation();
|
|
71
|
+
try {
|
|
72
|
+
if (key.length > 256) throw new ContentStorageError("CONFLICT", "Content operation identifiers must contain 1 to 256 characters.");
|
|
73
|
+
const operationId = await contentDigest({
|
|
74
|
+
principal: getRequestContext()?.writePrincipal?.id ?? "system",
|
|
75
|
+
collection,
|
|
76
|
+
key
|
|
77
|
+
});
|
|
78
|
+
const digest = await contentDigest(JSON.parse(JSON.stringify(request)));
|
|
79
|
+
const previous = (await sql`SELECT i.entry_id,i.request_digest,o.state,i.seed FROM _dineway_content_write_intents i LEFT JOIN _dineway_content_operations o ON o.id=i.id WHERE i.id=${operationId}`.execute(db)).rows[0];
|
|
80
|
+
if (previous && previous.request_digest !== digest) throw new ContentStorageError("CONFLICT", "This operation identifier belongs to a different save.");
|
|
81
|
+
if (previous?.state === "committed") {
|
|
82
|
+
await atomicBatch(db, {
|
|
83
|
+
checks: [...contentWriteChecks(collection, previous.entry_id, "edit"), ...seedSchema.parse(JSON.parse(previous.seed)).publishAuthority ? contentWriteChecks(collection, previous.entry_id, "publish") : []],
|
|
84
|
+
statements: []
|
|
85
|
+
});
|
|
86
|
+
return markContentWriteReplay(await read(previous.entry_id));
|
|
87
|
+
}
|
|
88
|
+
return await runWithContext({
|
|
89
|
+
editMode: false,
|
|
90
|
+
...getRequestContext(),
|
|
91
|
+
contentWriteRequest: {
|
|
92
|
+
operationId: key,
|
|
93
|
+
digest
|
|
94
|
+
}
|
|
95
|
+
}, operation);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
return {
|
|
98
|
+
success: false,
|
|
99
|
+
error: {
|
|
100
|
+
code: error instanceof ContentStorageError ? error.code : "CONFLICT",
|
|
101
|
+
message: error instanceof ContentStorageError ? error.message : "The save could not be resumed. Reload the entry and retry."
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
export { runIdempotentContentWrite as i, isContentWriteReplay as n, markContentWriteReplay as r, beginContentWriteIntent as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as __exportAll } from "./runner-
|
|
2
|
-
import { n as hashString } from "./hash-
|
|
1
|
+
import { c as __exportAll } from "./runner-CuG8o1uW.mjs";
|
|
2
|
+
import { n as hashString } from "./hash-qSYPMJ8w.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/schema/zod-generator.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dineway",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.42",
|
|
4
4
|
"description": "Agentic Website builder for restaurants — structured content meets AI via the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -198,6 +198,10 @@
|
|
|
198
198
|
"types": "./dist/database/batch.d.mts",
|
|
199
199
|
"default": "./dist/database/batch.mjs"
|
|
200
200
|
},
|
|
201
|
+
"./content-storage": {
|
|
202
|
+
"types": "./dist/content-storage/index.d.mts",
|
|
203
|
+
"default": "./dist/content-storage/index.mjs"
|
|
204
|
+
},
|
|
201
205
|
"./db/d1-migrations": {
|
|
202
206
|
"types": "./dist/database/d1/index.d.mts",
|
|
203
207
|
"default": "./dist/database/d1/index.mjs"
|
|
@@ -205,6 +209,10 @@
|
|
|
205
209
|
"./after": {
|
|
206
210
|
"types": "./dist/after.d.mts",
|
|
207
211
|
"default": "./dist/after.mjs"
|
|
212
|
+
},
|
|
213
|
+
"./content-storage/store": {
|
|
214
|
+
"types": "./dist/content-storage/store.d.mts",
|
|
215
|
+
"default": "./dist/content-storage/store.mjs"
|
|
208
216
|
}
|
|
209
217
|
},
|
|
210
218
|
"imports": {
|
|
@@ -234,6 +242,7 @@
|
|
|
234
242
|
"#dineway-tools/*": "./src/dineway-tools/*",
|
|
235
243
|
"#integration-credentials/*": "./src/integration-credentials/*",
|
|
236
244
|
"#comments/*": "./src/comments/*",
|
|
245
|
+
"#content-storage/*": "./src/content-storage/*",
|
|
237
246
|
"#config/*": "./src/config/*",
|
|
238
247
|
"#site-context/*": "./src/site-context/*",
|
|
239
248
|
"#types": "./src/astro/types.js"
|
|
@@ -363,6 +372,9 @@
|
|
|
363
372
|
"db/batch": [
|
|
364
373
|
"dist/database/batch.d.mts"
|
|
365
374
|
],
|
|
375
|
+
"content-storage": [
|
|
376
|
+
"dist/content-storage/index.d.mts"
|
|
377
|
+
],
|
|
366
378
|
"db/d1-migrations": [
|
|
367
379
|
"dist/database/d1/index.d.mts"
|
|
368
380
|
],
|
|
@@ -412,9 +424,9 @@
|
|
|
412
424
|
"ulidx": "^2.4.1",
|
|
413
425
|
"upng-js": "^2.1.0",
|
|
414
426
|
"zod": "^4.4.1",
|
|
415
|
-
"@dineway-ai/admin": "^0.2.
|
|
416
|
-
"@dineway-ai/
|
|
417
|
-
"@dineway-ai/
|
|
427
|
+
"@dineway-ai/admin": "^0.2.14",
|
|
428
|
+
"@dineway-ai/gutenberg-to-portable-text": "^0.2.3",
|
|
429
|
+
"@dineway-ai/auth": "^0.2.7"
|
|
418
430
|
},
|
|
419
431
|
"optionalDependencies": {
|
|
420
432
|
"@aws-sdk/client-s3": "^3.1049.0",
|
package/dist/cache-B5NSHhxG.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { c as __exportAll } from "./runner-CRU7BXjr.mjs";
|
|
2
|
-
import { i as matchPattern, n as interpolateDestination, t as compilePattern } from "./patterns-Ay-4KImK.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/redirects/cache.ts
|
|
5
|
-
var cache_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
-
compileRedirectRules: () => compileRedirectRules,
|
|
7
|
-
getCachedRedirects: () => getCachedRedirects,
|
|
8
|
-
invalidateRedirectCache: () => invalidateRedirectCache,
|
|
9
|
-
matchCachedPatterns: () => matchCachedPatterns,
|
|
10
|
-
setCachedRedirects: () => setCachedRedirects
|
|
11
|
-
});
|
|
12
|
-
let cachedRedirects = null;
|
|
13
|
-
function invalidateRedirectCache() {
|
|
14
|
-
cachedRedirects = null;
|
|
15
|
-
}
|
|
16
|
-
function getCachedRedirects() {
|
|
17
|
-
return cachedRedirects;
|
|
18
|
-
}
|
|
19
|
-
function compileRedirectRules(redirects) {
|
|
20
|
-
return redirects.map((redirect) => ({
|
|
21
|
-
redirect,
|
|
22
|
-
compiled: compilePattern(redirect.source)
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
function setCachedRedirects(redirects) {
|
|
26
|
-
const exact = /* @__PURE__ */ new Map();
|
|
27
|
-
const patterns = [];
|
|
28
|
-
for (const redirect of redirects) if (redirect.isPattern) patterns.push({
|
|
29
|
-
redirect,
|
|
30
|
-
compiled: compilePattern(redirect.source)
|
|
31
|
-
});
|
|
32
|
-
else exact.set(redirect.source, redirect);
|
|
33
|
-
cachedRedirects = {
|
|
34
|
-
exact,
|
|
35
|
-
patterns
|
|
36
|
-
};
|
|
37
|
-
return cachedRedirects;
|
|
38
|
-
}
|
|
39
|
-
function matchCachedPatterns(rules, pathname) {
|
|
40
|
-
for (const { redirect, compiled } of rules) {
|
|
41
|
-
const params = matchPattern(compiled, pathname);
|
|
42
|
-
if (!params) continue;
|
|
43
|
-
return {
|
|
44
|
-
redirect,
|
|
45
|
-
destination: interpolateDestination(redirect.destination, params)
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { matchCachedPatterns as a, invalidateRedirectCache as i, compileRedirectRules as n, setCachedRedirects as o, getCachedRedirects as r, cache_exports as t };
|
package/dist/cron-C7HCJPPl.mjs
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { sql } from "kysely";
|
|
2
|
-
import { ulid } from "ulidx";
|
|
3
|
-
import { Cron } from "croner";
|
|
4
|
-
|
|
5
|
-
//#region src/plugins/cron.ts
|
|
6
|
-
/**
|
|
7
|
-
* Plugin Cron System
|
|
8
|
-
*
|
|
9
|
-
* Provides scheduled task execution for plugins:
|
|
10
|
-
* - CronExecutor: claims overdue tasks, invokes per-plugin cron hook, updates next run.
|
|
11
|
-
* - CronAccessImpl: per-plugin API for schedule/cancel/list.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
/** Stale lock threshold in minutes */
|
|
15
|
-
const STALE_LOCK_MINUTES = 10;
|
|
16
|
-
const MAX_ONESHOT_RETRIES = 5;
|
|
17
|
-
/**
|
|
18
|
-
* Executes overdue cron tasks.
|
|
19
|
-
*
|
|
20
|
-
* Called by schedulers (NodeCronScheduler, PiggybackScheduler). Stateless —
|
|
21
|
-
* all state lives in the database.
|
|
22
|
-
*/
|
|
23
|
-
var CronExecutor = class {
|
|
24
|
-
resolveDb;
|
|
25
|
-
constructor(db, invokeCronHook) {
|
|
26
|
-
this.invokeCronHook = invokeCronHook;
|
|
27
|
-
this.resolveDb = typeof db === "function" ? db : () => db;
|
|
28
|
-
}
|
|
29
|
-
get db() {
|
|
30
|
-
return this.resolveDb();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Process all overdue tasks.
|
|
34
|
-
*
|
|
35
|
-
* 1. Atomically claim tasks whose next_run_at <= now, status = idle, enabled = 1.
|
|
36
|
-
* 2. For each claimed task, invoke the plugin's cron hook.
|
|
37
|
-
* 3. On success: compute next_run_at and reset to idle, or delete one-shots.
|
|
38
|
-
* 4. On failure: reset to idle (retry on next tick).
|
|
39
|
-
*/
|
|
40
|
-
async tick() {
|
|
41
|
-
let processed = 0;
|
|
42
|
-
for (let index = 0; index < 10; index++) {
|
|
43
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
44
|
-
const lease = ulid();
|
|
45
|
-
const task = (await sql`
|
|
46
|
-
UPDATE _dineway_cron_tasks
|
|
47
|
-
SET status = 'running', locked_at = ${now}, lease_token = ${lease}
|
|
48
|
-
WHERE status = 'idle' AND enabled = 1 AND next_run_at <= ${now} AND id IN (
|
|
49
|
-
SELECT id FROM _dineway_cron_tasks
|
|
50
|
-
WHERE next_run_at <= ${now}
|
|
51
|
-
AND status = 'idle'
|
|
52
|
-
AND enabled = 1
|
|
53
|
-
ORDER BY next_run_at ASC
|
|
54
|
-
LIMIT 1
|
|
55
|
-
)
|
|
56
|
-
RETURNING id, plugin_id, task_name, schedule, is_oneshot, data, next_run_at
|
|
57
|
-
`.execute(this.db)).rows[0];
|
|
58
|
-
if (!task) break;
|
|
59
|
-
const ownedOccurrence = sql`id = ${task.id} AND status = 'running' AND enabled = 1 AND lease_token = ${lease}
|
|
60
|
-
AND schedule = ${task.schedule} AND next_run_at = ${task.next_run_at} AND data IS NOT DISTINCT FROM ${task.data}`;
|
|
61
|
-
let parsedData;
|
|
62
|
-
if (task.data) try {
|
|
63
|
-
parsedData = JSON.parse(task.data);
|
|
64
|
-
} catch {
|
|
65
|
-
console.error(`[cron] Invalid JSON data for ${task.plugin_id}:${task.task_name}, skipping`);
|
|
66
|
-
await sql`
|
|
67
|
-
UPDATE _dineway_cron_tasks
|
|
68
|
-
SET status = 'failed', enabled = 0, locked_at = NULL, lease_token = NULL
|
|
69
|
-
WHERE ${ownedOccurrence}
|
|
70
|
-
`.execute(this.db);
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
const event = {
|
|
74
|
-
executionId: `${task.id}:${task.is_oneshot ? task.schedule : task.next_run_at}`,
|
|
75
|
-
name: task.task_name,
|
|
76
|
-
data: parsedData,
|
|
77
|
-
scheduledAt: task.next_run_at
|
|
78
|
-
};
|
|
79
|
-
let hookFailed = false;
|
|
80
|
-
try {
|
|
81
|
-
await this.invokeCronHook(task.plugin_id, event);
|
|
82
|
-
} catch (error) {
|
|
83
|
-
hookFailed = true;
|
|
84
|
-
console.error(`[cron] Hook failed for ${task.plugin_id}:${task.task_name}:`, error);
|
|
85
|
-
}
|
|
86
|
-
if (task.is_oneshot) if (hookFailed) {
|
|
87
|
-
const retryMeta = parsedData?.__dineway != null && typeof parsedData.__dineway === "object" ? parsedData.__dineway : void 0;
|
|
88
|
-
const rawRetryCount = retryMeta?.retryCount;
|
|
89
|
-
const retryCount = typeof rawRetryCount === "number" && Number.isFinite(rawRetryCount) && rawRetryCount > 0 ? Math.floor(rawRetryCount) : 0;
|
|
90
|
-
if (retryCount >= MAX_ONESHOT_RETRIES) {
|
|
91
|
-
console.error(`[cron] One-shot task ${task.plugin_id}:${task.task_name} exceeded ${MAX_ONESHOT_RETRIES} retries, retaining failed task`);
|
|
92
|
-
await sql`
|
|
93
|
-
UPDATE _dineway_cron_tasks SET status = 'failed', enabled = 0, locked_at = NULL, lease_token = NULL WHERE ${ownedOccurrence}
|
|
94
|
-
`.execute(this.db);
|
|
95
|
-
} else {
|
|
96
|
-
const backoffMs = 6e4 * Math.pow(2, retryCount);
|
|
97
|
-
await sql`
|
|
98
|
-
UPDATE _dineway_cron_tasks
|
|
99
|
-
SET status = 'idle', locked_at = NULL, lease_token = NULL, next_run_at = ${new Date(Date.now() + backoffMs).toISOString()}, data = ${JSON.stringify({
|
|
100
|
-
...parsedData,
|
|
101
|
-
__dineway: {
|
|
102
|
-
...retryMeta,
|
|
103
|
-
retryCount: retryCount + 1
|
|
104
|
-
}
|
|
105
|
-
})}
|
|
106
|
-
WHERE ${ownedOccurrence}
|
|
107
|
-
`.execute(this.db);
|
|
108
|
-
}
|
|
109
|
-
} else await sql`
|
|
110
|
-
DELETE FROM _dineway_cron_tasks WHERE ${ownedOccurrence}
|
|
111
|
-
`.execute(this.db);
|
|
112
|
-
else await sql`
|
|
113
|
-
UPDATE _dineway_cron_tasks
|
|
114
|
-
SET status = 'idle',
|
|
115
|
-
locked_at = NULL, lease_token = NULL,
|
|
116
|
-
last_run_at = ${now},
|
|
117
|
-
next_run_at = ${nextCronTime(task.schedule)}
|
|
118
|
-
WHERE ${ownedOccurrence}
|
|
119
|
-
`.execute(this.db);
|
|
120
|
-
await sql`UPDATE _dineway_cron_tasks SET status = 'idle', locked_at = NULL, lease_token = NULL
|
|
121
|
-
WHERE id = ${task.id} AND status = 'running' AND lease_token = ${lease}`.execute(this.db);
|
|
122
|
-
processed++;
|
|
123
|
-
}
|
|
124
|
-
return processed;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Recover tasks stuck in 'running' for more than STALE_LOCK_MINUTES.
|
|
128
|
-
* These likely crashed mid-execution.
|
|
129
|
-
*/
|
|
130
|
-
async recoverStaleLocks() {
|
|
131
|
-
const result = await sql`
|
|
132
|
-
UPDATE _dineway_cron_tasks
|
|
133
|
-
SET status = 'idle', locked_at = NULL, lease_token = NULL
|
|
134
|
-
WHERE status = 'running'
|
|
135
|
-
AND locked_at < ${(/* @__PURE__ */ new Date(Date.now() - STALE_LOCK_MINUTES * 60 * 1e3)).toISOString()}
|
|
136
|
-
`.execute(this.db);
|
|
137
|
-
return Number(result.numAffectedRows ?? 0);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Get the next due time across all enabled tasks.
|
|
141
|
-
* Returns null if no tasks are scheduled.
|
|
142
|
-
*/
|
|
143
|
-
async getNextDueTime() {
|
|
144
|
-
return (await sql`
|
|
145
|
-
SELECT MIN(next_run_at) as next
|
|
146
|
-
FROM _dineway_cron_tasks
|
|
147
|
-
WHERE status = 'idle' AND enabled = 1
|
|
148
|
-
`.execute(this.db)).rows[0]?.next ?? null;
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Per-plugin cron API implementation.
|
|
153
|
-
* Scoped to a single plugin ID — plugins cannot see or modify other plugins' tasks.
|
|
154
|
-
*/
|
|
155
|
-
var CronAccessImpl = class {
|
|
156
|
-
constructor(db, pluginId, reschedule) {
|
|
157
|
-
this.db = db;
|
|
158
|
-
this.pluginId = pluginId;
|
|
159
|
-
this.reschedule = reschedule;
|
|
160
|
-
}
|
|
161
|
-
async schedule(name, opts) {
|
|
162
|
-
validateTaskName(name);
|
|
163
|
-
validateSchedule(opts.schedule);
|
|
164
|
-
const oneshot = isOneShot(opts.schedule);
|
|
165
|
-
const schedule = oneshot ? new Date(opts.schedule).toISOString() : opts.schedule;
|
|
166
|
-
const nextRun = oneshot ? schedule : nextCronTime(schedule);
|
|
167
|
-
const dataJson = opts.data ? JSON.stringify(opts.data) : null;
|
|
168
|
-
await sql`
|
|
169
|
-
INSERT INTO _dineway_cron_tasks (id, plugin_id, task_name, schedule, is_oneshot, data, next_run_at, status, enabled)
|
|
170
|
-
VALUES (${ulid()}, ${this.pluginId}, ${name}, ${schedule}, ${oneshot ? 1 : 0}, ${dataJson}, ${nextRun}, 'idle', 1)
|
|
171
|
-
ON CONFLICT (plugin_id, task_name) DO UPDATE SET
|
|
172
|
-
schedule = ${schedule},
|
|
173
|
-
is_oneshot = ${oneshot ? 1 : 0},
|
|
174
|
-
data = ${dataJson},
|
|
175
|
-
next_run_at = ${nextRun},
|
|
176
|
-
status = CASE WHEN _dineway_cron_tasks.status = 'running' THEN 'running' ELSE 'idle' END,
|
|
177
|
-
locked_at = CASE WHEN _dineway_cron_tasks.status = 'running' THEN _dineway_cron_tasks.locked_at ELSE NULL END,
|
|
178
|
-
lease_token = CASE WHEN _dineway_cron_tasks.status = 'running' THEN _dineway_cron_tasks.lease_token ELSE NULL END,
|
|
179
|
-
enabled = 1
|
|
180
|
-
`.execute(this.db);
|
|
181
|
-
this.reschedule();
|
|
182
|
-
}
|
|
183
|
-
async cancel(name) {
|
|
184
|
-
await sql`
|
|
185
|
-
DELETE FROM _dineway_cron_tasks
|
|
186
|
-
WHERE plugin_id = ${this.pluginId} AND task_name = ${name}
|
|
187
|
-
`.execute(this.db);
|
|
188
|
-
this.reschedule();
|
|
189
|
-
}
|
|
190
|
-
async list() {
|
|
191
|
-
return (await sql`
|
|
192
|
-
SELECT task_name, schedule, next_run_at, last_run_at, status
|
|
193
|
-
FROM _dineway_cron_tasks
|
|
194
|
-
WHERE plugin_id = ${this.pluginId} AND (enabled = 1 OR status = 'failed')
|
|
195
|
-
ORDER BY next_run_at ASC
|
|
196
|
-
`.execute(this.db)).rows.map((row) => ({
|
|
197
|
-
name: row.task_name,
|
|
198
|
-
status: row.status,
|
|
199
|
-
schedule: row.schedule,
|
|
200
|
-
nextRunAt: row.next_run_at,
|
|
201
|
-
lastRunAt: row.last_run_at
|
|
202
|
-
}));
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Enable or disable all cron tasks for a plugin.
|
|
207
|
-
* Called by admin disable/enable endpoints and PluginManager lifecycle.
|
|
208
|
-
* Gracefully handles the cron table not existing yet (pre-migration).
|
|
209
|
-
*/
|
|
210
|
-
async function setCronTasksEnabled(db, pluginId, enabled) {
|
|
211
|
-
try {
|
|
212
|
-
await sql`
|
|
213
|
-
UPDATE _dineway_cron_tasks
|
|
214
|
-
SET enabled = ${enabled ? 1 : 0}
|
|
215
|
-
WHERE plugin_id = ${pluginId}
|
|
216
|
-
`.execute(db);
|
|
217
|
-
} catch {}
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Compute the next fire time for a cron expression.
|
|
221
|
-
* Supports standard cron (5-field), extended (6-field with seconds), and
|
|
222
|
-
* aliases like @daily, @weekly, @hourly, @monthly, @yearly.
|
|
223
|
-
*/
|
|
224
|
-
function nextCronTime(expression) {
|
|
225
|
-
const next = new Cron(expression).nextRun();
|
|
226
|
-
if (!next) throw new Error(`Invalid cron expression or no future run: "${expression}"`);
|
|
227
|
-
return next.toISOString();
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Check whether a string is a valid cron expression.
|
|
231
|
-
*/
|
|
232
|
-
function isCronExpression(schedule) {
|
|
233
|
-
try {
|
|
234
|
-
new Cron(schedule);
|
|
235
|
-
return true;
|
|
236
|
-
} catch {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
const ISO_DATETIME = /^\d{4}-\d{2}-\d{2}T/;
|
|
241
|
-
/** Croner accepts ISO timestamps too; distinguish those before testing cron patterns. */
|
|
242
|
-
function isOneShot(schedule) {
|
|
243
|
-
if (ISO_DATETIME.test(schedule)) return !isNaN(Date.parse(schedule));
|
|
244
|
-
if (schedule.startsWith("@") || isCronExpression(schedule)) return false;
|
|
245
|
-
return !isNaN(Date.parse(schedule));
|
|
246
|
-
}
|
|
247
|
-
/** Max length for a task name */
|
|
248
|
-
const MAX_TASK_NAME_LENGTH = 128;
|
|
249
|
-
/** Task name pattern: alphanumeric, dashes, underscores */
|
|
250
|
-
const TASK_NAME_RE = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
|
|
251
|
-
/**
|
|
252
|
-
* Validate a cron task name.
|
|
253
|
-
* Must be non-empty, ≤128 chars, alphanumeric with dashes/underscores.
|
|
254
|
-
*/
|
|
255
|
-
function validateTaskName(name) {
|
|
256
|
-
if (!name || name.length > MAX_TASK_NAME_LENGTH) throw new Error(`Invalid task name: must be 1-${MAX_TASK_NAME_LENGTH} characters, got ${name.length}`);
|
|
257
|
-
if (!TASK_NAME_RE.test(name)) throw new Error(`Invalid task name "${name}": must start with a letter and contain only letters, numbers, dashes, or underscores`);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Validate a schedule string at registration time.
|
|
261
|
-
* Must be a valid cron expression or a parseable ISO 8601 datetime.
|
|
262
|
-
*/
|
|
263
|
-
function validateSchedule(schedule) {
|
|
264
|
-
if (!schedule || schedule.length > 256) throw new Error(`Invalid schedule: must be 1-256 characters, got ${schedule.length}`);
|
|
265
|
-
if (isCronExpression(schedule)) return;
|
|
266
|
-
const parsed = Date.parse(schedule);
|
|
267
|
-
if (isNaN(parsed)) throw new Error(`Invalid schedule "${schedule}": must be a valid cron expression or ISO 8601 datetime`);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
//#endregion
|
|
271
|
-
export { CronExecutor as n, setCronTasksEnabled as r, CronAccessImpl as t };
|
package/dist/schema-CosVhHJt.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { c as __exportAll } from "./runner-CRU7BXjr.mjs";
|
|
2
|
-
import { n as SchemaRegistry } from "./registry-Dclv9iHv.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/schema/index.ts
|
|
5
|
-
var schema_exports = /* @__PURE__ */ __exportAll({ SchemaRegistry: () => SchemaRegistry });
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { schema_exports as t };
|