dineway 0.2.32 → 0.2.34
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-CfryM8jO.mjs → activity-CZnq5YlZ.mjs} +2 -2
- package/dist/{activity-events-BVo9rMUz.mjs → activity-events-D-yGV7cW.mjs} +1 -1
- package/dist/{actor-DrJJsvy6.mjs → actor-DxUAJgQX.mjs} +20 -6
- package/dist/{adapters-DHt3f2lu.d.mts → adapters-BQ8CQbBm.d.mts} +5 -7
- package/dist/after-BVaUn7bK.mjs +24 -0
- package/dist/{allowed-origins-DtBQa4JR.mjs → allowed-origins-DV3LWuWW.mjs} +1 -1
- package/dist/api/route-utils.d.mts +10 -10
- package/dist/api/route-utils.mjs +23 -19
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/{api-DF92r_un.mjs → api-CL4pG2zf.mjs} +55 -1215
- package/dist/api-tokens-D5K_Csub.mjs +3 -0
- package/dist/{api-tokens-CSomx-l3.mjs → api-tokens-_6tMD1W4.mjs} +1 -1
- package/dist/{apply-Bs2jXsms.mjs → apply-CYLUMiZg.mjs} +109 -93
- package/dist/astro/index.d.mts +16 -12
- package/dist/astro/index.mjs +50 -9
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.mjs +29 -8
- package/dist/astro/middleware/redirect.mjs +8 -7
- package/dist/astro/middleware/request-context.mjs +17 -10
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +93 -71
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware/workers.d.mts +6 -0
- package/dist/astro/middleware/workers.mjs +8 -0
- package/dist/astro/middleware.mjs +288 -159
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -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 +25 -23
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +11 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +11 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +11 -10
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -20
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -20
- package/dist/astro/routes/api/admin/bylines/index.mjs +22 -20
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +17 -16
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -7
- package/dist/astro/routes/api/admin/comments/bulk.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -7
- package/dist/astro/routes/api/admin/comments/index.mjs +14 -13
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +43 -31
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +43 -31
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +48 -36
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +48 -36
- package/dist/astro/routes/api/admin/context/diff.mjs +47 -35
- package/dist/astro/routes/api/admin/context/index.mjs +48 -36
- package/dist/astro/routes/api/admin/context/stale.mjs +47 -35
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +43 -31
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +47 -35
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +47 -35
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +44 -32
- 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 +72 -66
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +72 -66
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +71 -65
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +71 -65
- package/dist/astro/routes/api/admin/plugins/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +71 -65
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/updates.mjs +64 -58
- package/dist/astro/routes/api/admin/review-requests/_id_/image.mjs +26 -23
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +33 -25
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +56 -43
- package/dist/astro/routes/api/admin/review-requests/_id_/revoke.mjs +10 -9
- package/dist/astro/routes/api/admin/review-requests/index.mjs +54 -41
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +64 -58
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +64 -58
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +20 -12
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +40 -32
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +7 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -9
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -11
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +11 -11
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +5 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +5 -4
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -7
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/setup-token/index.mjs +32 -23
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +32 -26
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +21 -18
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +19 -16
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +24 -21
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +35 -22
- package/dist/astro/routes/api/content/_collection_/_id_/release-readiness.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +35 -22
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +23 -19
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +14 -13
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +14 -13
- package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
- package/dist/astro/routes/api/dashboard.mjs +16 -11
- 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 +25 -24
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +12 -11
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +51 -42
- package/dist/astro/routes/api/import/wordpress/media.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/media.mjs +14 -14
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +52 -40
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +50 -38
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +29 -27
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +56 -47
- package/dist/astro/routes/api/integration/artifact.mjs +11 -8
- package/dist/astro/routes/api/integration/dispatch.mjs +17 -14
- package/dist/astro/routes/api/integrations/_provider_.mjs +11 -8
- package/dist/astro/routes/api/integrations/index.mjs +10 -7
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.mjs +98 -88
- package/dist/astro/routes/api/media/_id_/confirm.mjs +12 -12
- package/dist/astro/routes/api/media/_id_.mjs +9 -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 +13 -13
- package/dist/astro/routes/api/media.mjs +16 -16
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_/items.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_/translations.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_.mjs +48 -36
- package/dist/astro/routes/api/menus/index.mjs +48 -36
- package/dist/astro/routes/api/oauth/authorize.mjs +9 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +11 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +10 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -6
- package/dist/astro/routes/api/oauth/token.mjs +8 -6
- package/dist/astro/routes/api/openapi.json.mjs +5 -5
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +15 -14
- package/dist/astro/routes/api/redirects/404s/summary.mjs +15 -14
- package/dist/astro/routes/api/redirects/_id_.mjs +48 -37
- package/dist/astro/routes/api/redirects/index.mjs +48 -37
- 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 +66 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +66 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +66 -60
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +66 -60
- package/dist/astro/routes/api/schema/collections/index.mjs +66 -60
- package/dist/astro/routes/api/schema/index.mjs +12 -11
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +64 -58
- package/dist/astro/routes/api/schema/orphans/index.mjs +64 -58
- package/dist/astro/routes/api/search/enable.mjs +15 -14
- package/dist/astro/routes/api/search/index.mjs +14 -13
- package/dist/astro/routes/api/search/rebuild.mjs +15 -14
- package/dist/astro/routes/api/search/stats.mjs +9 -8
- package/dist/astro/routes/api/search/suggest.mjs +14 -13
- package/dist/astro/routes/api/sections/_slug_.mjs +48 -36
- package/dist/astro/routes/api/sections/index.mjs +48 -36
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings/reviews.mjs +11 -10
- package/dist/astro/routes/api/settings.mjs +48 -36
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -14
- package/dist/astro/routes/api/setup/admin.mjs +12 -12
- package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -31
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +37 -33
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +11 -9
- package/dist/astro/routes/api/system/heartbeat.mjs +2 -2
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +51 -39
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +51 -39
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +51 -39
- package/dist/astro/routes/api/taxonomies/index.mjs +51 -39
- package/dist/astro/routes/api/themes/preview.mjs +8 -6
- 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 +47 -35
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +48 -36
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +48 -36
- package/dist/astro/routes/api/widget-areas/_name_.mjs +45 -33
- package/dist/astro/routes/api/widget-areas/index.mjs +48 -36
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +11 -10
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +20 -18
- package/dist/astro/routes/sitemap.xml.mjs +19 -17
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +4 -4
- package/dist/astro/types.d.mts +13 -13
- package/dist/atomic-authority-CnBQJ14T.mjs +33 -0
- package/dist/{audit-CYjfxG9i.mjs → audit-F5iWkbcJ.mjs} +11 -4
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-CITT8ZA_.mjs → auth-control-guard-D4WW-wFF.mjs} +1 -1
- package/dist/{authorize-KcI0pAfN.mjs → authorize-EnP57AQl.mjs} +1 -1
- package/dist/{briefing-r3hXCDQC.mjs → briefing-BXsVwd4P.mjs} +1 -1
- package/dist/{briefing-BgQTljQt.mjs → briefing-CkCi6S-W.mjs} +445 -447
- package/dist/{bundle-S6zx-V4D.mjs → bundle-Cgak1zGE.mjs} +3 -3
- package/dist/{byline-Ctil4rij.mjs → byline-DEZKlzD9.mjs} +107 -113
- package/dist/{byline-fields-QpmruT5r.mjs → byline-fields-BGEIA9dZ.mjs} +3 -3
- package/dist/{byline-fields-DNXKWUW9.d.mts → byline-fields-BmkhEDFF.d.mts} +2 -2
- package/dist/{byline-fields-DiCyW6eQ.mjs → byline-fields-Qg8TesxL.mjs} +1 -1
- package/dist/{byline-registry-rkr73qSE.mjs → byline-registry-CkuVVeJJ.mjs} +46 -76
- package/dist/{bylines-BcuBpzVi.mjs → bylines-7BQxRGyG.mjs} +4 -4
- package/dist/{bylines-v_ZUQnR-.mjs → bylines-LqNRjma2.mjs} +6 -6
- package/dist/{cache-V2BCplaY.mjs → cache-CSTy-R-K.mjs} +2 -2
- package/dist/{chunks-CnuL55JE.mjs → chunks-BnG3LPMN.mjs} +1 -1
- package/dist/cli/index.mjs +452 -263
- package/dist/cli/plugin-kit.d.mts +9 -9
- package/dist/cli/plugin-kit.mjs +2 -2
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +11 -11
- package/dist/client/index.mjs +2 -2
- package/dist/{client-factory-C-y9VZDX.mjs → client-factory-BLSkgsTg.mjs} +1 -1
- package/dist/{comment-_nvJSS-A.mjs → comment-Bi7cJ9SS.mjs} +2 -2
- package/dist/{comment-reaction-DhVgJ17S.mjs → comment-reaction-BLqIj5mx.mjs} +1 -1
- package/dist/{comments-D4mIDjvA.mjs → comments-Dg_gWBEB.mjs} +1 -1
- package/dist/content-De_XeXy_.mjs +1230 -0
- package/dist/{content-CVCrcuvD.mjs → content-NobcQti0.mjs} +240 -161
- package/dist/{content-refresh-QvBIyb_g.mjs → content-refresh-l4mPoGeX.mjs} +170 -193
- package/dist/{context-MftkHbWx.mjs → context-6uqzU-M9.mjs} +95 -77
- package/dist/{context-JjKucxBm.mjs → context-B0SG9Xkc.mjs} +2 -2
- package/dist/{context-route-helpers-e1APrqSm.mjs → context-route-helpers-C8s26uDT.mjs} +2 -2
- package/dist/{cron-mGVPQ5e6.mjs → cron-D7zB6m8i.mjs} +36 -32
- package/dist/d1-binding-D6HZa3ks.mjs +8 -0
- package/dist/d1-dialect-B1b8cmxX.mjs +48 -0
- package/dist/{dashboard-ZJ7sMcBI.mjs → dashboard-B-OybCMw.mjs} +5 -5
- package/dist/database/batch.d.mts +20 -0
- package/dist/database/batch.mjs +69 -0
- package/dist/database/d1/index.d.mts +18 -0
- package/dist/database/d1/index.mjs +8 -0
- package/dist/db/d1.d.mts +7 -0
- package/dist/db/d1.mjs +13 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +10 -7
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/libsql.mjs +46 -3
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{device-flow-eOcL5m0Q.mjs → device-flow-DhpCzMo0.mjs} +130 -94
- package/dist/{dialect-helpers-fk43GbDb.mjs → dialect-helpers-C6xtO-Ui.mjs} +1 -1
- package/dist/{discovery-CJkuHGhZ.mjs → discovery-CqXbN0WZ.mjs} +5 -5
- package/dist/{enrich-KErvJOuI.mjs → enrich-BjF-J4sF.mjs} +1 -1
- package/dist/{evidence-6IUv9ML3.mjs → evidence-xJf8hQgH.mjs} +7 -7
- package/dist/{field-defs-cache-CwrIyZFT.mjs → field-defs-cache-BKKFFf_V.mjs} +5 -5
- package/dist/{forgeway-account-lYJ8iX3G.mjs → forgeway-account-BeKJlKh1.mjs} +1 -1
- package/dist/{fts-manager-DX7ZkrCa.mjs → fts-manager-BeWtB7ZD.mjs} +72 -57
- package/dist/{hitl-requests-CmYVunm-.mjs → hitl-requests-evSsel48.mjs} +2 -2
- package/dist/{hitl-route-helpers-CRm537zS.mjs → hitl-route-helpers-D2kJSOFX.mjs} +5 -5
- package/dist/{import-DqRAgsKr.mjs → import-Jpta-CYE.mjs} +9 -9
- package/dist/{index-Co7xtjkd.d.mts → index-CSUSBfdD.d.mts} +7 -4
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +104 -96
- package/dist/{integration-credentials-qudN6yRr.mjs → integration-credentials-BrQr0fb_.mjs} +2 -2
- package/dist/{jsonld-DTd-AVWg.d.mts → jsonld-CqIVIeZK.d.mts} +2 -2
- package/dist/{load-fCOciq0Q.mjs → load-Dc5ttyg4.mjs} +1 -1
- package/dist/{loader-BDje8ME2.mjs → loader-Cgsx23wU.mjs} +4 -4
- package/dist/{manifest-schema-CfKD0thC.mjs → manifest-schema-DG29meRy.mjs} +1 -1
- package/dist/{mcp-reviewed-executor-DmhM3Cy6.mjs → mcp-reviewed-executor-DAZL3Ckt.mjs} +7 -7
- 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 +11 -11
- package/dist/media/local-runtime.mjs +3 -3
- package/dist/{media-dvRjj4po.mjs → media-3fK0u-bo.mjs} +1 -1
- package/dist/{media-allowlist-DaG6lNoy.mjs → media-allowlist-rN4qIF6W.mjs} +1 -1
- package/dist/{menus-CpuR4Qkm.mjs → menus-5liJusbp.mjs} +138 -90
- package/dist/{menus-CZbz5L_V.mjs → menus-CbR_J8cJ.mjs} +8 -8
- package/dist/migrations-CMdxWKx-.mjs +76 -0
- package/dist/oauth-authority-CCqo4eBm.mjs +43 -0
- package/dist/{oauth-authorization-Jf5e3azH.mjs → oauth-authorization--0UtTZpv.mjs} +89 -98
- package/dist/{oauth-clients-tovQ4D4h.mjs → oauth-clients-D4WBYaYW.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-D51qOseS.mjs → object-cache-BGjIlY9s.mjs} +1 -1
- package/dist/page/index.d.mts +10 -10
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-IsGn-5lt.mjs → parse--7nG62_h.mjs} +1 -1
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{plugins-DXyLI3Hb.mjs → plugins-DK1wLuao.mjs} +35 -84
- package/dist/{policy-950odoX_.mjs → policy-Dej7NJFD.mjs} +2 -2
- package/dist/{preview-BXmS1SXL.mjs → preview-q0pkibNO.mjs} +2 -2
- package/dist/{provider-loader-DDq7R_RN.d.mts → provider-loader-C0GaLwKB.d.mts} +1 -1
- package/dist/{public-url-CT-T1D_w.d.mts → public-url-B9zEdO8p.d.mts} +1 -1
- package/dist/{public-url-BQ9vf0AS.d.mts → public-url-BV-YQ_LF.d.mts} +2 -2
- package/dist/{publication-authorization-C-vYPGD8.mjs → publication-authorization-BrEZ2TsE.mjs} +459 -33
- package/dist/{query-CrW2yI6G.mjs → query-CEn9HXnf.mjs} +15 -15
- package/dist/{query-DcB9uGTW.mjs → query-DAS6VbMS.mjs} +4 -4
- package/dist/{rate-limit-DEkoxTsP.mjs → rate-limit-Dd1TnzZP.mjs} +2 -2
- package/dist/{redirect-DG-o0CKV.mjs → redirect-HLI3wT5Y.mjs} +26 -14
- package/dist/{redirects-Bjp4iKJU.mjs → redirects-DmOdfRjI.mjs} +5 -5
- package/dist/{redirects-N8gmWhVM.mjs → redirects-UCXyL0lP.mjs} +3 -3
- package/dist/{registry-D-IV_h50.mjs → registry-RD9qTnYL.mjs} +183 -186
- package/dist/release-BR08Slqf.mjs +5148 -0
- package/dist/request-context.d.mts +8 -0
- package/dist/{request-meta-BW0the1R.mjs → request-meta-BOcuHAXD.mjs} +1 -1
- package/dist/{resolve-pZ4NQM-X.mjs → resolve-C80Pm2DW.mjs} +1 -1
- package/dist/{review-payload-f1L4lzQg.mjs → review-payload-DEylbssM.mjs} +52 -4
- package/dist/{review-requests-DICrYH2-.mjs → review-requests-BF2eEKr8.mjs} +93 -37
- package/dist/{review-requests-BTKfeWlS.mjs → review-requests-CyfWbJ6W.mjs} +2 -2
- package/dist/{review-route-helpers-DaZBBps8.mjs → review-route-helpers-lKA-CXms.mjs} +2 -2
- package/dist/{revision-De7OmYVD.mjs → revision-090sZyGc.mjs} +28 -22
- package/dist/revocation-B7GL5fMl.mjs +53 -0
- package/dist/{runner-DJiRFyLI.mjs → runner-CVeq0266.mjs} +594 -491
- package/dist/{runner-Dye73myO.d.mts → runner-JnJSGXEB.d.mts} +1 -1
- package/dist/{runs-DEujUDOj.mjs → runs-B5BExdKO.mjs} +5 -5
- package/dist/runtime-env-CQVAWHzH.mjs +19 -0
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +5 -5
- package/dist/schema-DLMkODQc.mjs +8 -0
- package/dist/{search-DxUKN9Zz.mjs → search-CRzWNfxX.mjs} +4 -4
- package/dist/{secrets-AdCrGg1c.mjs → secrets-Cg0D2gQW.mjs} +10 -11
- package/dist/{sections-BPFOEMK6.mjs → sections-BwUjOGqn.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +29 -25
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +11 -10
- package/dist/{seo-DWHdo5aW.mjs → seo-BOTuCeh-.mjs} +25 -15
- package/dist/{seo-GfovzqpU.mjs → seo-B_tBFyud.mjs} +1 -1
- package/dist/{service-DbgjHWyW.mjs → service--bQht6oN.mjs} +2 -2
- package/dist/{service-BrNKVCjC.mjs → service-DilVsWGD.mjs} +3 -3
- package/dist/{session-user-DyqWGIh4.mjs → session-user-DeqTcAmR.mjs} +1 -1
- package/dist/{settings-CAsQLi0N.mjs → settings-DFzevIrU.mjs} +8 -8
- package/dist/{settings-BKEHw6Bu.mjs → settings-Deqx3Upy.mjs} +2 -2
- package/dist/{setup-complete-C8LTo8cO.mjs → setup-complete-BFqudwbW.mjs} +1 -1
- package/dist/{site-activity-7oezuHXK.mjs → site-activity-BrN2NviL.mjs} +11 -4
- package/dist/{site-context-CA7rbxux.mjs → site-context-vCiDRr4H.mjs} +50 -37
- package/dist/{site-url-DoZf_jVj.mjs → site-url-wXFqbm9c.mjs} +1 -1
- package/dist/state-jyNZ6-7L.mjs +30 -0
- 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 +3 -3
- package/dist/{store-c4qx3gVh.mjs → store-C1yDxxfv.mjs} +37 -12
- package/dist/submission-BsHNfHc7.mjs +155 -0
- package/dist/{taxonomies-ALDiRQ84.mjs → taxonomies-4cnTcbD6.mjs} +3 -3
- package/dist/{taxonomies-93DV-1QT.mjs → taxonomies-CllxqaH0.mjs} +7 -7
- package/dist/{taxonomy-BOBTJ_aE.mjs → taxonomy-DWxxLpp5.mjs} +3 -3
- package/dist/{tokens-c-qxNqzC.mjs → tokens-Bjuf1HID.mjs} +1 -1
- package/dist/{trusted-proxy-CdEl6g6B.mjs → trusted-proxy-CAW9o4Dw.mjs} +4 -12
- package/dist/{types-BRCUO8NR.d.mts → types-7Th6Mwz3.d.mts} +1 -0
- package/dist/{types-BpSTdH1H.mjs → types-BqxIv8Il.mjs} +2 -2
- package/dist/{types-6KmeXInJ.d.mts → types-CFgTpfPk.d.mts} +1 -1
- package/dist/{types-TpXK8km5.d.mts → types-QjOcidFc.d.mts} +300 -172
- package/dist/ui/server-runtime.d.mts +13 -13
- package/dist/ui/server-runtime.mjs +28 -26
- package/dist/{user-D0NJ7gYf.mjs → user-1-YV30lf.mjs} +2 -2
- package/dist/{utils-BK2efsHv.mjs → utils-Cglcqpm2.mjs} +2 -2
- package/dist/{validate-CDWVODvc.d.mts → validate-A27peRc4.d.mts} +3 -3
- package/dist/{validate-C9g9iX3q.mjs → validate-Wl4MSf3V.mjs} +3 -3
- package/dist/version-BWxyC5s4.mjs +6 -0
- package/dist/{widgets-Cm5Qx2Np.mjs → widgets-Di-6yDH7.mjs} +3 -3
- package/dist/{wordpress-slugs-WdPZaVXf.mjs → wordpress-slugs-vOx7R1dM.mjs} +1 -1
- package/dist/{worker-D7OccgB8.mjs → worker-RpaMP71d.mjs} +76 -47
- package/dist/workers-build-BaQCrSmf.mjs +36 -0
- package/dist/{zod-generator-DS5oZNaL.mjs → zod-generator-Cylvl_SM.mjs} +2 -2
- package/package.json +35 -9
- package/dist/after-BfniwgIf.mjs +0 -9
- package/dist/api-tokens-CmT83Bgj.mjs +0 -3
- package/dist/db/libsql-http.d.mts +0 -27
- package/dist/db/libsql-http.mjs +0 -29
- package/dist/libsql-dialect-CANq6UNI.mjs +0 -47
- package/dist/oauth-user-lookup-B451pZmd.mjs +0 -25
- package/dist/revocation-CkTOhdlw.mjs +0 -42
- package/dist/schema-IjuRxkqq.mjs +0 -8
- package/dist/submission-C47cHBIg.mjs +0 -67
- package/dist/transaction-BGQgnwUi.mjs +0 -28
- package/dist/version-9orir5LL.mjs +0 -6
- /package/dist/{base64-F8-DUraK.mjs → base64-Cz-aU0X1.mjs} +0 -0
- /package/dist/{challenge-store-CYrg4F4t.mjs → challenge-store-D-_-VavY.mjs} +0 -0
- /package/dist/{components-DAq_4iPX.mjs → components-BWQUCJEr.mjs} +0 -0
- /package/dist/{config-CVssduLe.mjs → config-XW5tMrH8.mjs} +0 -0
- /package/dist/{content-index-names-Bbu1FY1r.mjs → content-index-names-CDc2IQIx.mjs} +0 -0
- /package/dist/{context-types-CPWAJRs5.mjs → context-types-DqTo6C79.mjs} +0 -0
- /package/dist/{default-BeIzUa1e.mjs → default-D9zxuUU7.mjs} +0 -0
- /package/dist/{email-console-Bfi_exVg.mjs → email-console-BONByQiC.mjs} +0 -0
- /package/dist/{error-DLg1H2LT.mjs → error-Dd8LtpG5.mjs} +0 -0
- /package/dist/{escape-C6lkys0j.mjs → escape-BWC4s5bV.mjs} +0 -0
- /package/dist/{experimental-workflows-B9x8delL.mjs → experimental-workflows-M5D3RTFo.mjs} +0 -0
- /package/dist/{hash-jhbF98tT.mjs → hash-lNx3KJis.mjs} +0 -0
- /package/dist/{media-url-CL3NzgLh.mjs → media-url-B4YtTY6c.mjs} +0 -0
- /package/dist/{mime-CDTtL7jE.mjs → mime-D_ae-u_U.mjs} +0 -0
- /package/dist/{mode-D554vAgH.mjs → mode-CPf_KZ37.mjs} +0 -0
- /package/dist/{normalize-Ev3FiBMx.mjs → normalize-5rct_U0I.mjs} +0 -0
- /package/dist/{oauth-state-store-Do1a_o3H.mjs → oauth-state-store-CMgcimzA.mjs} +0 -0
- /package/dist/{options-1dBRkoCl.mjs → options-BcqHWpc-.mjs} +0 -0
- /package/dist/{output-8j9oltTf.mjs → output-BYpiVUBf.mjs} +0 -0
- /package/dist/{parser-C9rzPuSZ.mjs → parser-BV0wzQHo.mjs} +0 -0
- /package/dist/{passkey-config-CRN44T04.mjs → passkey-config-BG4GO4OO.mjs} +0 -0
- /package/dist/{patterns-3XE9bU4r.mjs → patterns-CZ7D4y_R.mjs} +0 -0
- /package/dist/{placeholder-D03pGvqM.d.mts → placeholder-BHTaoCYx.d.mts} +0 -0
- /package/dist/{portable-text-tIk9_uz_.mjs → portable-text-B9YuySom.mjs} +0 -0
- /package/dist/{portable-text-BdRm4uZq.d.mts → portable-text-FKf3IrPz.d.mts} +0 -0
- /package/dist/{process-cache-B-L-A9zg.mjs → process-cache-MHM4Sqzs.mjs} +0 -0
- /package/dist/{provider-loader-C4i82ll1.mjs → provider-loader-3MY1SjzA.mjs} +0 -0
- /package/dist/{public-discovery-CyDzK1-S.mjs → public-discovery-BAbOvKiR.mjs} +0 -0
- /package/dist/{public-url-oudwI7K0.mjs → public-url-C7pbmS_7.mjs} +0 -0
- /package/dist/{public-url-BVIjzMo3.mjs → public-url-D5Wjq0sy.mjs} +0 -0
- /package/dist/{redirect-Dp5u-8dH.mjs → redirect-Bx96u2nS.mjs} +0 -0
- /package/dist/{request-cache-BruBnFAR.mjs → request-cache-DPmV5nk4.mjs} +0 -0
- /package/dist/{seo-contributions-BAtRDXEQ.mjs → seo-contributions-Dt57p6Sq.mjs} +0 -0
- /package/dist/{service-DeX1PRNt.mjs → service-wYQ_ePZ4.mjs} +0 -0
- /package/dist/{setup-nonce-D-CEYlw7.mjs → setup-nonce-CAqDUxxU.mjs} +0 -0
- /package/dist/{sidecar-client-Bw2C0XTf.mjs → sidecar-client-CnpGTvYq.mjs} +0 -0
- /package/dist/{slugify-KSsVD_D3.mjs → slugify-Di8Q_MFq.mjs} +0 -0
- /package/dist/{ssrf-C7tTSD1r.mjs → ssrf-LN16WMip.mjs} +0 -0
- /package/dist/{stable-hash-DF7R5eN8.mjs → stable-hash-DEtJgcp7.mjs} +0 -0
- /package/dist/{status-Bba6RbkS.mjs → status-Bwkeuz8g.mjs} +0 -0
- /package/dist/{transport-BddGhTAI.mjs → transport-472KVGBe.mjs} +0 -0
- /package/dist/{transport-ktLL9r2O.d.mts → transport-C0jj-Nc8.d.mts} +0 -0
- /package/dist/{types-BQZFeZjd.mjs → types-BDq9t5lG.mjs} +0 -0
- /package/dist/{types-CKIt_jmM.d.mts → types-Bs-7Geuh.d.mts} +0 -0
- /package/dist/{types-CLMOusxP.d.mts → types-CwkJp6zr.d.mts} +0 -0
- /package/dist/{types-C0DPvhR5.mjs → types-CyBH89BS.mjs} +0 -0
- /package/dist/{types-BbkkkAb6.mjs → types-D17dJRht.mjs} +0 -0
- /package/dist/{types--3oJQ0hs.d.mts → types-DTjrkhKU.d.mts} +0 -0
- /package/dist/{types-CPaVj_GC.d.mts → types-DkXuBo8k.d.mts} +0 -0
- /package/dist/{types-CU3Wn2HC.d.mts → types-b2sq7ZDk.d.mts} +0 -0
- /package/dist/{url-C_pLSrGZ.mjs → url-D375-6LM.mjs} +0 -0
- /package/dist/{url-Dumsft7G.mjs → url-bv5i4JN0.mjs} +0 -0
- /package/dist/{validate-VPnKoIzW.mjs → validate-Co3j6T_K.mjs} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { o as
|
|
5
|
-
import { n as
|
|
6
|
-
import { t as
|
|
1
|
+
import { c as __exportAll } from "./runner-CVeq0266.mjs";
|
|
2
|
+
import { atomicBatch, rowUnchanged } from "./database/batch.mjs";
|
|
3
|
+
import { t as validateIdentifier } from "./validate-Co3j6T_K.mjs";
|
|
4
|
+
import { o as isPostgres } from "./dialect-helpers-C6xtO-Ui.mjs";
|
|
5
|
+
import { i as encodeCursor, n as ScheduledNotDueError, r as decodeCursor, t as DinewayValidationError } from "./types-BqxIv8Il.mjs";
|
|
6
|
+
import { t as contentWriteChecks } from "./atomic-authority-CnBQJ14T.mjs";
|
|
7
|
+
import { o as invalidateCollectionCache } from "./object-cache-BGjIlY9s.mjs";
|
|
8
|
+
import { n as slugify } from "./slugify-Di8Q_MFq.mjs";
|
|
9
|
+
import { t as RevisionRepository } from "./revision-090sZyGc.mjs";
|
|
7
10
|
import { sql } from "kysely";
|
|
8
11
|
import { ulid } from "ulidx";
|
|
9
12
|
|
|
@@ -89,17 +92,19 @@ var ContentRepository = class {
|
|
|
89
92
|
/**
|
|
90
93
|
* Create a new content item
|
|
91
94
|
*/
|
|
92
|
-
async
|
|
95
|
+
async prepareCreate(input) {
|
|
93
96
|
const id = ulid();
|
|
94
97
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
95
98
|
const { type, slug, data, status = "draft", authorId, primaryBylineId, locale, translationOf, publishedAt, createdAt } = input;
|
|
96
99
|
if (!type) throw new DinewayValidationError("Content type is required");
|
|
97
100
|
const tableName = getTableName(type);
|
|
101
|
+
const checks = [];
|
|
98
102
|
let translationGroup = id;
|
|
99
103
|
if (translationOf) {
|
|
100
|
-
const source = await
|
|
104
|
+
const source = (await sql`SELECT id, translation_group, deleted_at FROM ${sql.table(tableName)} WHERE id = ${translationOf} AND deleted_at IS NULL`.execute(this.db)).rows[0];
|
|
101
105
|
if (!source) throw new DinewayValidationError("Translation source content not found");
|
|
102
|
-
translationGroup = source.
|
|
106
|
+
translationGroup = String(source.translation_group || source.id);
|
|
107
|
+
checks.push(rowUnchanged(tableName, source));
|
|
103
108
|
}
|
|
104
109
|
const columns = [
|
|
105
110
|
"id",
|
|
@@ -136,15 +141,63 @@ var ContentRepository = class {
|
|
|
136
141
|
}
|
|
137
142
|
const columnRefs = columns.map((c) => sql.ref(c));
|
|
138
143
|
const valuePlaceholders = values.map((v) => v === null ? sql`NULL` : sql`${v}`);
|
|
139
|
-
|
|
144
|
+
return {
|
|
145
|
+
id,
|
|
146
|
+
batch: {
|
|
147
|
+
checks,
|
|
148
|
+
statements: [sql`
|
|
140
149
|
INSERT INTO ${sql.ref(tableName)} (${sql.join(columnRefs, sql`, `)})
|
|
141
150
|
VALUES (${sql.join(valuePlaceholders, sql`, `)})
|
|
142
|
-
`.
|
|
143
|
-
|
|
144
|
-
|
|
151
|
+
`.compile(this.db)]
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async create(input) {
|
|
156
|
+
const prepared = await this.prepareCreate(input);
|
|
157
|
+
await atomicBatch(this.db, prepared.batch);
|
|
158
|
+
invalidateCollectionCache(input.type);
|
|
159
|
+
const item = await this.findById(input.type, prepared.id);
|
|
145
160
|
if (!item) throw new Error("Failed to create content");
|
|
146
161
|
return item;
|
|
147
162
|
}
|
|
163
|
+
/** Capture database defaults and JSON values from the saved row inside the write batch. */
|
|
164
|
+
async prepareDraftSnapshot(type, id, authorId) {
|
|
165
|
+
const tableName = getTableName(type);
|
|
166
|
+
const checks = [];
|
|
167
|
+
let snapshot;
|
|
168
|
+
if (isPostgres(this.db)) snapshot = sql`(SELECT COALESCE(jsonb_object_agg(field.key, field.value), '{}'::jsonb)::text
|
|
169
|
+
FROM ${sql.table(tableName)} AS entry CROSS JOIN LATERAL jsonb_each(to_jsonb(entry)) AS field(key, value)
|
|
170
|
+
WHERE entry.id = ${id} AND field.value <> 'null'::jsonb
|
|
171
|
+
AND field.key NOT IN (${sql.join(Array.from(SYSTEM_COLUMNS, (name) => sql`${name}`))}))`;
|
|
172
|
+
else {
|
|
173
|
+
const schema = await sql`
|
|
174
|
+
SELECT m.sql AS definition, p.name FROM sqlite_master m
|
|
175
|
+
JOIN pragma_table_info(m.name) p WHERE m.name = ${tableName} AND m.type = 'table'
|
|
176
|
+
`.execute(this.db);
|
|
177
|
+
const definition = schema.rows[0]?.definition;
|
|
178
|
+
if (!definition) throw new DinewayValidationError("Content table not found");
|
|
179
|
+
const pairs = schema.rows.map((row) => row.name).filter((name) => !SYSTEM_COLUMNS.has(name)).map((name) => {
|
|
180
|
+
const column = sql.ref(name);
|
|
181
|
+
return sql`SELECT ${sql.lit(name)} AS name,
|
|
182
|
+
CASE WHEN typeof(${column}) = 'text' AND substr(${column}, 1, 1) IN ('{', '[') AND json_valid(${column})
|
|
183
|
+
THEN ${column} ELSE json_quote(${column}) END AS value
|
|
184
|
+
FROM candidate WHERE ${column} IS NOT NULL`;
|
|
185
|
+
});
|
|
186
|
+
snapshot = pairs.length ? sql`(WITH candidate AS (SELECT * FROM ${sql.table(tableName)} WHERE id = ${id})
|
|
187
|
+
SELECT json_group_object(name, json(value)) FROM (${sql.join(pairs, sql` UNION ALL `)}))` : sql`'{}'`;
|
|
188
|
+
checks.push(sql`EXISTS (SELECT 1 FROM sqlite_master WHERE name = ${tableName} AND sql = ${definition})`);
|
|
189
|
+
}
|
|
190
|
+
const revision = new RevisionRepository(this.db).prepareCreateSnapshot({
|
|
191
|
+
collection: type,
|
|
192
|
+
entryId: id,
|
|
193
|
+
data: snapshot,
|
|
194
|
+
authorId
|
|
195
|
+
});
|
|
196
|
+
return {
|
|
197
|
+
checks,
|
|
198
|
+
statements: [revision.statement, sql`UPDATE ${sql.table(tableName)} SET draft_revision_id = ${revision.id}, updated_at = ${(/* @__PURE__ */ new Date()).toISOString()} WHERE id = ${id}`.compile(this.db)]
|
|
199
|
+
};
|
|
200
|
+
}
|
|
148
201
|
/**
|
|
149
202
|
* Generate a unique slug for a content item within a collection.
|
|
150
203
|
*
|
|
@@ -193,21 +246,42 @@ var ContentRepository = class {
|
|
|
193
246
|
* Creates a new draft copy with "(Copy)" appended to the title.
|
|
194
247
|
* A slug is auto-generated from the new title by the handler layer.
|
|
195
248
|
*/
|
|
196
|
-
async
|
|
197
|
-
const
|
|
198
|
-
if (!
|
|
249
|
+
async prepareDuplicate(type, id, authorId) {
|
|
250
|
+
const snapshot = await this.snapshot(type, id);
|
|
251
|
+
if (!snapshot) throw new DinewayValidationError("Content item not found");
|
|
252
|
+
const original = snapshot.item;
|
|
199
253
|
const newData = { ...original.data };
|
|
200
254
|
if (typeof newData.title === "string") newData.title = `${newData.title} (Copy)`;
|
|
201
255
|
else if (typeof newData.name === "string") newData.name = `${newData.name} (Copy)`;
|
|
202
256
|
const slugSource = typeof newData.title === "string" ? newData.title : typeof newData.name === "string" ? newData.name : null;
|
|
203
257
|
const slug = slugSource ? await this.generateUniqueSlug(type, slugSource, original.locale ?? void 0) : null;
|
|
204
|
-
|
|
258
|
+
const prepared = await this.prepareCreate({
|
|
205
259
|
type,
|
|
206
260
|
slug,
|
|
207
261
|
data: newData,
|
|
208
262
|
status: "draft",
|
|
209
|
-
authorId: authorId || original.authorId || void 0
|
|
263
|
+
authorId: authorId || original.authorId || void 0,
|
|
264
|
+
locale: original.locale ?? void 0
|
|
210
265
|
});
|
|
266
|
+
return {
|
|
267
|
+
id: prepared.id,
|
|
268
|
+
batch: {
|
|
269
|
+
checks: [
|
|
270
|
+
snapshot.check,
|
|
271
|
+
...contentWriteChecks(type, id, "edit"),
|
|
272
|
+
...prepared.batch.checks ?? []
|
|
273
|
+
],
|
|
274
|
+
statements: prepared.batch.statements
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
async duplicate(type, id, authorId) {
|
|
279
|
+
const prepared = await this.prepareDuplicate(type, id, authorId);
|
|
280
|
+
await atomicBatch(this.db, prepared.batch);
|
|
281
|
+
invalidateCollectionCache(type);
|
|
282
|
+
const item = await this.findById(type, prepared.id);
|
|
283
|
+
if (!item) throw new Error("Failed to reload duplicate");
|
|
284
|
+
return item;
|
|
211
285
|
}
|
|
212
286
|
/**
|
|
213
287
|
* Find content by ID
|
|
@@ -343,7 +417,7 @@ var ContentRepository = class {
|
|
|
343
417
|
/**
|
|
344
418
|
* Update content
|
|
345
419
|
*/
|
|
346
|
-
|
|
420
|
+
prepareUpdate(type, id, input) {
|
|
347
421
|
const tableName = getTableName(type);
|
|
348
422
|
const updates = {
|
|
349
423
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -361,7 +435,21 @@ var ContentRepository = class {
|
|
|
361
435
|
updates[key] = serializeValue(value);
|
|
362
436
|
}
|
|
363
437
|
}
|
|
364
|
-
|
|
438
|
+
return this.db.updateTable(tableName).set(updates).where("id", "=", id).where("deleted_at", "is", null).compile();
|
|
439
|
+
}
|
|
440
|
+
async snapshot(type, id, includeTrashed = false) {
|
|
441
|
+
const row = (await sql`SELECT * FROM ${sql.table(getTableName(type))} WHERE id = ${id} AND ${includeTrashed ? sql`true` : sql`deleted_at IS NULL`}`.execute(this.db)).rows[0];
|
|
442
|
+
return row ? {
|
|
443
|
+
item: this.mapRow(type, row),
|
|
444
|
+
deleted: row.deleted_at !== null,
|
|
445
|
+
check: rowUnchanged(getTableName(type), row)
|
|
446
|
+
} : null;
|
|
447
|
+
}
|
|
448
|
+
async update(type, id, input) {
|
|
449
|
+
await atomicBatch(this.db, {
|
|
450
|
+
checks: contentWriteChecks(type, id, "edit"),
|
|
451
|
+
statements: [this.prepareUpdate(type, id, input)]
|
|
452
|
+
});
|
|
365
453
|
invalidateCollectionCache(type);
|
|
366
454
|
const updated = await this.findById(type, id);
|
|
367
455
|
if (!updated) throw new Error("Content not found");
|
|
@@ -370,15 +458,22 @@ var ContentRepository = class {
|
|
|
370
458
|
/**
|
|
371
459
|
* Delete content (soft delete - moves to trash)
|
|
372
460
|
*/
|
|
373
|
-
|
|
461
|
+
prepareDelete(type, id) {
|
|
374
462
|
const tableName = getTableName(type);
|
|
375
463
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
376
|
-
|
|
464
|
+
return {
|
|
465
|
+
checks: contentWriteChecks(type, id, "delete"),
|
|
466
|
+
statements: [sql`
|
|
377
467
|
UPDATE ${sql.ref(tableName)}
|
|
378
468
|
SET deleted_at = ${now}
|
|
379
469
|
WHERE id = ${id}
|
|
380
470
|
AND deleted_at IS NULL
|
|
381
|
-
`.
|
|
471
|
+
`.compile(this.db)]
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
async delete(type, id) {
|
|
475
|
+
const [result] = await atomicBatch(this.db, this.prepareDelete(type, id));
|
|
476
|
+
const changed = (result?.numAffectedRows ?? 0n) > 0n;
|
|
382
477
|
if (changed) invalidateCollectionCache(type);
|
|
383
478
|
return changed;
|
|
384
479
|
}
|
|
@@ -387,13 +482,17 @@ var ContentRepository = class {
|
|
|
387
482
|
*/
|
|
388
483
|
async restore(type, id) {
|
|
389
484
|
const tableName = getTableName(type);
|
|
390
|
-
const
|
|
485
|
+
const [result] = await atomicBatch(this.db, {
|
|
486
|
+
checks: contentWriteChecks(type, id, "edit"),
|
|
487
|
+
statements: [sql`
|
|
391
488
|
UPDATE ${sql.ref(tableName)}
|
|
392
489
|
SET deleted_at = NULL
|
|
393
490
|
WHERE id = ${id}
|
|
394
491
|
AND deleted_at IS NOT NULL
|
|
395
492
|
RETURNING *
|
|
396
|
-
`.
|
|
493
|
+
`.compile(this.db)]
|
|
494
|
+
});
|
|
495
|
+
const restored = result?.rows[0];
|
|
397
496
|
if (!restored) return null;
|
|
398
497
|
invalidateCollectionCache(type);
|
|
399
498
|
return this.mapRow(type, restored);
|
|
@@ -403,11 +502,15 @@ var ContentRepository = class {
|
|
|
403
502
|
*/
|
|
404
503
|
async permanentDelete(type, id) {
|
|
405
504
|
const tableName = getTableName(type);
|
|
406
|
-
const
|
|
505
|
+
const [result] = await atomicBatch(this.db, {
|
|
506
|
+
checks: contentWriteChecks(type, id, "permanent"),
|
|
507
|
+
statements: [sql`
|
|
407
508
|
DELETE FROM ${sql.ref(tableName)}
|
|
408
509
|
WHERE id = ${id}
|
|
409
510
|
AND deleted_at IS NOT NULL
|
|
410
|
-
`.
|
|
511
|
+
`.compile(this.db)]
|
|
512
|
+
});
|
|
513
|
+
const changed = (result?.numAffectedRows ?? 0n) > 0n;
|
|
411
514
|
if (changed) invalidateCollectionCache(type);
|
|
412
515
|
return changed;
|
|
413
516
|
}
|
|
@@ -528,17 +631,20 @@ var ContentRepository = class {
|
|
|
528
631
|
const scheduledDate = new Date(scheduledAt);
|
|
529
632
|
if (isNaN(scheduledDate.getTime())) throw new DinewayValidationError("Invalid scheduled date");
|
|
530
633
|
if (scheduledDate <= /* @__PURE__ */ new Date()) throw new DinewayValidationError("Scheduled date must be in the future");
|
|
531
|
-
const
|
|
532
|
-
if (!
|
|
533
|
-
const newStatus =
|
|
534
|
-
await
|
|
634
|
+
const snapshot = await this.snapshot(type, id);
|
|
635
|
+
if (!snapshot) throw new DinewayValidationError("Content item not found");
|
|
636
|
+
const newStatus = snapshot.item.status === "published" ? "published" : "scheduled";
|
|
637
|
+
await atomicBatch(this.db, {
|
|
638
|
+
checks: [snapshot.check, ...contentWriteChecks(type, id, "publish")],
|
|
639
|
+
statements: [sql`
|
|
535
640
|
UPDATE ${sql.ref(tableName)}
|
|
536
641
|
SET status = ${newStatus},
|
|
537
642
|
scheduled_at = ${scheduledAt},
|
|
538
643
|
updated_at = ${now}
|
|
539
644
|
WHERE id = ${id}
|
|
540
645
|
AND deleted_at IS NULL
|
|
541
|
-
`.
|
|
646
|
+
`.compile(this.db)]
|
|
647
|
+
});
|
|
542
648
|
invalidateCollectionCache(type);
|
|
543
649
|
const updated = await this.findById(type, id);
|
|
544
650
|
if (!updated) throw new Error("Content not found");
|
|
@@ -553,10 +659,12 @@ var ContentRepository = class {
|
|
|
553
659
|
async unschedule(type, id) {
|
|
554
660
|
const tableName = getTableName(type);
|
|
555
661
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
556
|
-
const
|
|
557
|
-
if (!
|
|
558
|
-
const newStatus =
|
|
559
|
-
await
|
|
662
|
+
const snapshot = await this.snapshot(type, id);
|
|
663
|
+
if (!snapshot) throw new DinewayValidationError("Content item not found");
|
|
664
|
+
const newStatus = snapshot.item.status === "published" ? "published" : "draft";
|
|
665
|
+
await atomicBatch(this.db, {
|
|
666
|
+
checks: [snapshot.check, ...contentWriteChecks(type, id, "publish")],
|
|
667
|
+
statements: [sql`
|
|
560
668
|
UPDATE ${sql.ref(tableName)}
|
|
561
669
|
SET status = ${newStatus},
|
|
562
670
|
scheduled_at = NULL,
|
|
@@ -564,7 +672,8 @@ var ContentRepository = class {
|
|
|
564
672
|
WHERE id = ${id}
|
|
565
673
|
AND scheduled_at IS NOT NULL
|
|
566
674
|
AND deleted_at IS NULL
|
|
567
|
-
`.
|
|
675
|
+
`.compile(this.db)]
|
|
676
|
+
});
|
|
568
677
|
invalidateCollectionCache(type);
|
|
569
678
|
const updated = await this.findById(type, id);
|
|
570
679
|
if (!updated) throw new Error("Content not found");
|
|
@@ -613,88 +722,55 @@ var ContentRepository = class {
|
|
|
613
722
|
* `publishedAt` overrides the publication timestamp. If omitted, an existing
|
|
614
723
|
* `published_at` is preserved and first publish falls back to the current time.
|
|
615
724
|
*/
|
|
616
|
-
async
|
|
725
|
+
async preparePublish(type, id, publishedAt, requireScheduledDue = false) {
|
|
617
726
|
const tableName = getTableName(type);
|
|
618
727
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
619
|
-
const
|
|
620
|
-
if (!
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
claimedScheduledAt = existing.scheduledAt;
|
|
635
|
-
claimedUpdatedAt = existing.updatedAt;
|
|
636
|
-
}
|
|
637
|
-
let publishCommitted = false;
|
|
638
|
-
try {
|
|
639
|
-
const revisionRepo = new RevisionRepository(this.db);
|
|
640
|
-
let revisionToPublish = existing.draftRevisionId || existing.liveRevisionId;
|
|
641
|
-
if (!revisionToPublish) revisionToPublish = (await revisionRepo.create({
|
|
728
|
+
const snapshot = await this.snapshot(type, id);
|
|
729
|
+
if (!snapshot) throw new DinewayValidationError("Content item not found");
|
|
730
|
+
const existing = snapshot.item;
|
|
731
|
+
if (requireScheduledDue && (!existing.scheduledAt || existing.scheduledAt > now)) throw new ScheduledNotDueError();
|
|
732
|
+
const checks = [snapshot.check];
|
|
733
|
+
const statements = [];
|
|
734
|
+
let revisionId = existing.draftRevisionId || existing.liveRevisionId;
|
|
735
|
+
let data = existing.data;
|
|
736
|
+
if (revisionId) {
|
|
737
|
+
const revision = await this.db.selectFrom("revisions").selectAll().where("id", "=", revisionId).executeTakeFirst();
|
|
738
|
+
if (!revision || revision.collection !== type || revision.entry_id !== id) throw new DinewayValidationError("Revision does not belong to the specified content item");
|
|
739
|
+
checks.push(rowUnchanged("revisions", revision));
|
|
740
|
+
data = JSON.parse(revision.data);
|
|
741
|
+
} else {
|
|
742
|
+
const revision = new RevisionRepository(this.db).prepareCreateSnapshot({
|
|
642
743
|
collection: type,
|
|
643
744
|
entryId: id,
|
|
644
|
-
data:
|
|
645
|
-
})
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
await this.syncDataColumns(type, id, revision.data);
|
|
649
|
-
if (typeof revision.data._slug === "string") await sql`
|
|
650
|
-
UPDATE ${sql.ref(tableName)}
|
|
651
|
-
SET slug = ${revision.data._slug}
|
|
652
|
-
WHERE id = ${id}
|
|
653
|
-
`.execute(this.db);
|
|
654
|
-
}
|
|
655
|
-
if (publishedAt !== void 0) await sql`
|
|
656
|
-
UPDATE ${sql.ref(tableName)}
|
|
657
|
-
SET live_revision_id = ${revisionToPublish},
|
|
658
|
-
draft_revision_id = NULL,
|
|
659
|
-
status = 'published',
|
|
660
|
-
scheduled_at = NULL,
|
|
661
|
-
published_at = ${publishedAt},
|
|
662
|
-
updated_at = ${now}
|
|
663
|
-
WHERE id = ${id}
|
|
664
|
-
AND deleted_at IS NULL
|
|
665
|
-
`.execute(this.db);
|
|
666
|
-
else await sql`
|
|
667
|
-
UPDATE ${sql.ref(tableName)}
|
|
668
|
-
SET live_revision_id = ${revisionToPublish},
|
|
669
|
-
draft_revision_id = NULL,
|
|
670
|
-
status = 'published',
|
|
671
|
-
scheduled_at = NULL,
|
|
672
|
-
published_at = COALESCE(published_at, ${now}),
|
|
673
|
-
updated_at = ${now}
|
|
674
|
-
WHERE id = ${id}
|
|
675
|
-
AND deleted_at IS NULL
|
|
676
|
-
`.execute(this.db);
|
|
677
|
-
publishCommitted = true;
|
|
678
|
-
const updated = await this.findById(type, id);
|
|
679
|
-
if (!updated) throw new Error("Content not found");
|
|
680
|
-
invalidateCollectionCache(type);
|
|
681
|
-
return updated;
|
|
682
|
-
} catch (error) {
|
|
683
|
-
if (requireScheduledDue && claimedScheduledAt && !publishCommitted) try {
|
|
684
|
-
await sql`
|
|
685
|
-
UPDATE ${sql.ref(tableName)}
|
|
686
|
-
SET scheduled_at = ${claimedScheduledAt},
|
|
687
|
-
updated_at = ${claimedUpdatedAt ?? now}
|
|
688
|
-
WHERE id = ${id}
|
|
689
|
-
AND scheduled_at IS NULL
|
|
690
|
-
AND deleted_at IS NULL
|
|
691
|
-
AND (status != 'published' OR draft_revision_id IS NOT NULL)
|
|
692
|
-
`.execute(this.db);
|
|
693
|
-
} catch (restoreError) {
|
|
694
|
-
console.error(`[content] Failed to restore schedule for ${type}/${id} after publish failure:`, restoreError);
|
|
695
|
-
}
|
|
696
|
-
throw error;
|
|
745
|
+
data: sql`${JSON.stringify(data)}`
|
|
746
|
+
});
|
|
747
|
+
revisionId = revision.id;
|
|
748
|
+
statements.push(revision.statement);
|
|
697
749
|
}
|
|
750
|
+
const sync = this.prepareSyncDataColumns(type, id, data);
|
|
751
|
+
if (sync) statements.push(sync);
|
|
752
|
+
const slug = typeof data._slug === "string" ? data._slug : existing.slug;
|
|
753
|
+
statements.push(sql`UPDATE ${sql.table(tableName)} SET slug = ${slug},
|
|
754
|
+
live_revision_id = ${revisionId}, draft_revision_id = NULL,
|
|
755
|
+
status = 'published', scheduled_at = NULL,
|
|
756
|
+
published_at = ${publishedAt !== void 0 ? sql`${publishedAt}` : sql`COALESCE(published_at, ${now})`}, updated_at = ${now}
|
|
757
|
+
WHERE id = ${id} AND deleted_at IS NULL`.compile(this.db));
|
|
758
|
+
return {
|
|
759
|
+
batch: {
|
|
760
|
+
checks,
|
|
761
|
+
statements
|
|
762
|
+
},
|
|
763
|
+
previous: existing,
|
|
764
|
+
slug
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
async publish(type, id, publishedAt, requireScheduledDue = false) {
|
|
768
|
+
const prepared = await this.preparePublish(type, id, publishedAt, requireScheduledDue);
|
|
769
|
+
await atomicBatch(this.db, prepared.batch);
|
|
770
|
+
invalidateCollectionCache(type);
|
|
771
|
+
const item = await this.findById(type, id);
|
|
772
|
+
if (!item) throw new Error("Content not found");
|
|
773
|
+
return item;
|
|
698
774
|
}
|
|
699
775
|
/**
|
|
700
776
|
* Stage an existing revision as the draft for a content item.
|
|
@@ -704,18 +780,19 @@ var ContentRepository = class {
|
|
|
704
780
|
*/
|
|
705
781
|
async setDraftRevision(type, id, revisionId) {
|
|
706
782
|
const tableName = getTableName(type);
|
|
707
|
-
const
|
|
708
|
-
if (!
|
|
709
|
-
const revision = await
|
|
783
|
+
const snapshot = await this.snapshot(type, id);
|
|
784
|
+
if (!snapshot) throw new DinewayValidationError("Content item not found");
|
|
785
|
+
const revision = await this.db.selectFrom("revisions").selectAll().where("id", "=", revisionId).executeTakeFirst();
|
|
710
786
|
if (!revision) throw new DinewayValidationError("Revision not found");
|
|
711
|
-
if (revision.collection !== type || revision.
|
|
712
|
-
await
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
`.
|
|
787
|
+
if (revision.collection !== type || revision.entry_id !== id) throw new DinewayValidationError("Revision does not belong to the specified content item");
|
|
788
|
+
await atomicBatch(this.db, {
|
|
789
|
+
checks: [
|
|
790
|
+
snapshot.check,
|
|
791
|
+
rowUnchanged("revisions", revision),
|
|
792
|
+
...contentWriteChecks(type, id, "edit")
|
|
793
|
+
],
|
|
794
|
+
statements: [sql`UPDATE ${sql.table(tableName)} SET draft_revision_id = ${revisionId}, updated_at = ${(/* @__PURE__ */ new Date()).toISOString()} WHERE id = ${id} AND deleted_at IS NULL`.compile(this.db)]
|
|
795
|
+
});
|
|
719
796
|
invalidateCollectionCache(type);
|
|
720
797
|
}
|
|
721
798
|
/**
|
|
@@ -726,37 +803,35 @@ var ContentRepository = class {
|
|
|
726
803
|
*/
|
|
727
804
|
async unpublish(type, id) {
|
|
728
805
|
const tableName = getTableName(type);
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}
|
|
806
|
+
const snapshot = await this.snapshot(type, id);
|
|
807
|
+
if (!snapshot) throw new DinewayValidationError("Content item not found");
|
|
808
|
+
const existing = snapshot.item;
|
|
809
|
+
const checks = [snapshot.check, ...contentWriteChecks(type, id, "publish")];
|
|
810
|
+
const statements = [];
|
|
811
|
+
let draftId = existing.draftRevisionId;
|
|
812
|
+
if (!draftId && existing.liveRevisionId) {
|
|
813
|
+
const live = await this.db.selectFrom("revisions").selectAll().where("id", "=", existing.liveRevisionId).executeTakeFirst();
|
|
814
|
+
if (!live || live.collection !== type || live.entry_id !== id) throw new DinewayValidationError("Live revision not found");
|
|
815
|
+
checks.push(rowUnchanged("revisions", live));
|
|
816
|
+
const draft = new RevisionRepository(this.db).prepareCreateSnapshot({
|
|
817
|
+
collection: type,
|
|
818
|
+
entryId: id,
|
|
819
|
+
data: sql`${live.data}`
|
|
820
|
+
});
|
|
821
|
+
draftId = draft.id;
|
|
822
|
+
statements.push(draft.statement);
|
|
747
823
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
`.execute(this.db);
|
|
824
|
+
statements.push(sql`UPDATE ${sql.table(tableName)} SET live_revision_id = NULL,
|
|
825
|
+
draft_revision_id = ${draftId}, status = 'draft', updated_at = ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
826
|
+
WHERE id = ${id} AND deleted_at IS NULL`.compile(this.db));
|
|
827
|
+
await atomicBatch(this.db, {
|
|
828
|
+
checks,
|
|
829
|
+
statements
|
|
830
|
+
});
|
|
756
831
|
invalidateCollectionCache(type);
|
|
757
|
-
const
|
|
758
|
-
if (!
|
|
759
|
-
return
|
|
832
|
+
const item = await this.findById(type, id);
|
|
833
|
+
if (!item) throw new Error("Content not found");
|
|
834
|
+
return item;
|
|
760
835
|
}
|
|
761
836
|
/**
|
|
762
837
|
* Discard pending draft changes
|
|
@@ -767,16 +842,20 @@ var ContentRepository = class {
|
|
|
767
842
|
async discardDraft(type, id) {
|
|
768
843
|
const tableName = getTableName(type);
|
|
769
844
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
770
|
-
const
|
|
771
|
-
if (!
|
|
845
|
+
const snapshot = await this.snapshot(type, id);
|
|
846
|
+
if (!snapshot) throw new DinewayValidationError("Content item not found");
|
|
847
|
+
const existing = snapshot.item;
|
|
772
848
|
if (!existing.draftRevisionId) return existing;
|
|
773
|
-
await
|
|
849
|
+
await atomicBatch(this.db, {
|
|
850
|
+
checks: [snapshot.check, ...contentWriteChecks(type, id, "edit")],
|
|
851
|
+
statements: [sql`
|
|
774
852
|
UPDATE ${sql.ref(tableName)}
|
|
775
853
|
SET draft_revision_id = NULL,
|
|
776
854
|
updated_at = ${now}
|
|
777
855
|
WHERE id = ${id}
|
|
778
856
|
AND deleted_at IS NULL
|
|
779
|
-
`.
|
|
857
|
+
`.compile(this.db)]
|
|
858
|
+
});
|
|
780
859
|
invalidateCollectionCache(type);
|
|
781
860
|
const updated = await this.findById(type, id);
|
|
782
861
|
if (!updated) throw new Error("Content not found");
|
|
@@ -787,7 +866,7 @@ var ContentRepository = class {
|
|
|
787
866
|
* Used to promote revision data into the content table on publish.
|
|
788
867
|
* Keys starting with _ are revision metadata (e.g. _slug) and are skipped.
|
|
789
868
|
*/
|
|
790
|
-
|
|
869
|
+
prepareSyncDataColumns(type, id, data) {
|
|
791
870
|
const tableName = getTableName(type);
|
|
792
871
|
const updates = {};
|
|
793
872
|
for (const [key, value] of Object.entries(data)) {
|
|
@@ -796,8 +875,8 @@ var ContentRepository = class {
|
|
|
796
875
|
validateIdentifier(key, "content field name");
|
|
797
876
|
updates[key] = serializeValue(value);
|
|
798
877
|
}
|
|
799
|
-
if (Object.keys(updates).length === 0) return;
|
|
800
|
-
|
|
878
|
+
if (Object.keys(updates).length === 0) return null;
|
|
879
|
+
return this.db.updateTable(tableName).set(updates).where("id", "=", id).compile();
|
|
801
880
|
}
|
|
802
881
|
/**
|
|
803
882
|
* Count content items with a pending schedule.
|