dineway 0.1.14 → 0.1.16
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-events-B4wp7CrU.mjs → activity-events-DbqJBNaY.mjs} +1 -1
- package/dist/{allowed-origins-C1AKK9AT.mjs → allowed-origins-D85wzUp6.mjs} +1 -1
- package/dist/api/route-utils.d.mts +10 -10
- package/dist/api/route-utils.mjs +15 -15
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +4 -4
- package/dist/{api-BTbpzvBq.mjs → api-B5xMY72-.mjs} +96 -17
- package/dist/{api-tokens-D7UjLbdt.mjs → api-tokens-CMmUPFae.mjs} +1 -1
- package/dist/{apply-Bm5QgdrE.mjs → apply-CGVHi2r7.mjs} +165 -85
- package/dist/astro/index.d.mts +11 -11
- package/dist/astro/index.mjs +3 -3
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +5 -5
- package/dist/astro/middleware/redirect.mjs +6 -6
- package/dist/astro/middleware/request-context.mjs +4 -4
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +119 -77
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/briefing.mjs +19 -19
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +12 -12
- package/dist/astro/routes/api/admin/bylines/index.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +13 -13
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +26 -26
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +26 -26
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +30 -30
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +30 -30
- package/dist/astro/routes/api/admin/context/diff.mjs +29 -29
- package/dist/astro/routes/api/admin/context/index.mjs +30 -30
- package/dist/astro/routes/api/admin/context/stale.mjs +29 -29
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +26 -26
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +29 -29
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +29 -29
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +27 -27
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +40 -40
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +46 -46
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +46 -46
- package/dist/astro/routes/api/admin/plugins/index.mjs +40 -40
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +40 -40
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +46 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +40 -40
- package/dist/astro/routes/api/admin/plugins/updates.mjs +40 -40
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +6 -6
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +29 -29
- package/dist/astro/routes/api/admin/review-requests/index.mjs +10 -10
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +40 -40
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +40 -40
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +5 -5
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +5 -5
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/request.mjs +9 -9
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +28 -28
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
- package/dist/astro/routes/api/dashboard.mjs +9 -9
- 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 +10 -10
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.mjs +29 -29
- package/dist/astro/routes/api/import/wordpress/media.mjs +7 -7
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +33 -33
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +48 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +124 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +32 -145
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +33 -33
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +277 -91
- package/dist/astro/routes/api/media/_id_/confirm.mjs +6 -6
- package/dist/astro/routes/api/media/_id_.mjs +6 -6
- 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 +11 -13
- package/dist/astro/routes/api/media.mjs +18 -18
- package/dist/astro/routes/api/menus/_name_/items.mjs +45 -36
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +34 -31
- package/dist/astro/routes/api/menus/_name_/translations.d.mts +8 -0
- package/dist/astro/routes/api/menus/_name_/translations.mjs +111 -0
- package/dist/astro/routes/api/menus/_name_.mjs +47 -36
- package/dist/astro/routes/api/menus/index.mjs +34 -32
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- 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 +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +3 -3
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/index.mjs +12 -12
- package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -12
- package/dist/astro/routes/api/redirects/_id_.mjs +31 -31
- package/dist/astro/routes/api/redirects/index.mjs +31 -31
- 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 +41 -41
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +41 -41
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +41 -41
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +41 -41
- package/dist/astro/routes/api/schema/collections/index.mjs +41 -41
- package/dist/astro/routes/api/schema/index.mjs +6 -6
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +40 -40
- package/dist/astro/routes/api/schema/orphans/index.mjs +40 -40
- package/dist/astro/routes/api/search/enable.mjs +12 -12
- package/dist/astro/routes/api/search/index.mjs +11 -11
- package/dist/astro/routes/api/search/rebuild.mjs +12 -12
- package/dist/astro/routes/api/search/stats.mjs +8 -8
- package/dist/astro/routes/api/search/suggest.mjs +11 -11
- package/dist/astro/routes/api/sections/_slug_.mjs +30 -30
- package/dist/astro/routes/api/sections/index.mjs +30 -30
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +30 -30
- package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
- package/dist/astro/routes/api/setup/admin.mjs +10 -10
- package/dist/astro/routes/api/setup/dev-bypass.mjs +25 -25
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +26 -26
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +7 -7
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +131 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +49 -41
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +36 -34
- package/dist/astro/routes/api/taxonomies/index.mjs +36 -34
- package/dist/astro/routes/api/themes/preview.mjs +6 -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 +29 -29
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +30 -30
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +30 -30
- package/dist/astro/routes/api/widget-areas/_name_.mjs +28 -28
- package/dist/astro/routes/api/widget-areas/index.mjs +30 -30
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +9 -9
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +10 -10
- package/dist/astro/types.d.mts +16 -14
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-DOZ3UCsP.mjs → auth-control-guard--r6LlNkX.mjs} +1 -1
- package/dist/{authorize-BAdbMCwC.mjs → authorize-wQDmXQJ1.mjs} +1 -1
- package/dist/{briefing-MVYe_Uyf.mjs → briefing-4k6R0KAr.mjs} +7 -7
- package/dist/{briefing-rty4O-wa.mjs → briefing-DM7e2yd3.mjs} +1 -1
- package/dist/{byline-naZxOPSa.mjs → byline-BxAf79s1.mjs} +4 -4
- package/dist/{bylines-DxXzWML_.d.mts → bylines-DE9bfDur.d.mts} +75 -13
- package/dist/{bylines-C4LIBOOO.mjs → bylines-DhCnhR70.mjs} +3 -3
- package/dist/{cache-DEbQ13c9.mjs → cache-inQvbrP5.mjs} +1 -1
- package/dist/{chunks-D_jVet6z.mjs → chunks-vkrCT4Ta.mjs} +7 -1
- package/dist/cli/index.mjs +357 -104
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/{comment-DFO-gWDH.mjs → comment-BmJXz3lc.mjs} +1 -1
- package/dist/{comments--BsZ9pqA.mjs → comments-BW1qFiTa.mjs} +1 -1
- package/dist/{content-CyLkb-qH.mjs → content-DvpMad_N.mjs} +4 -3
- package/dist/{context-DNfcm853.mjs → context-CGbVhAmd.mjs} +2 -2
- package/dist/{context-CNIkMzot.mjs → context-CT44ux1O.mjs} +10 -10
- package/dist/{context-route-helpers-MurhoxWF.mjs → context-route-helpers-CcvSXJtQ.mjs} +1 -1
- package/dist/{dashboard-DqnYU8EU.mjs → dashboard-6gH7SlPM.mjs} +9 -18
- package/dist/database/instrumentation.d.mts +1 -1
- package/dist/database/instrumentation.mjs +14 -4
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- 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-BGEH5jfn.mjs → device-flow-DaTBhALC.mjs} +5 -5
- package/dist/{dialect-helpers-DhTzaUxP.mjs → dialect-helpers-TkdbkFad.mjs} +7 -1
- package/dist/{fts-manager-B1pTNEG_.mjs → fts-manager-D7KVeBmg.mjs} +1 -1
- package/dist/{hitl-requests-ChT32Ilo.mjs → hitl-requests-CUnch_4e.mjs} +2 -2
- package/dist/{hitl-route-helpers-CSit54Ru.mjs → hitl-route-helpers-DcUCm57p.mjs} +4 -4
- package/dist/{import-BHRLhXAn.mjs → import-BVqG28WP.mjs} +3 -3
- package/dist/{import-CNcKWTbp.mjs → import-DE2ziezs.mjs} +2 -2
- package/dist/{index-CYfhYgXd.d.mts → index-DpMWSamU.d.mts} +2 -2
- package/dist/{index-EUAWaIxW.d.mts → index-JzJUzE4o.d.mts} +47 -47
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +65 -65
- package/dist/{jsonld-D2gUY4kA.d.mts → jsonld-BjsoTL5m.d.mts} +2 -2
- package/dist/{loader-PZnPxFLc.mjs → loader-CQFxFOt1.mjs} +2 -2
- package/dist/media/index.d.mts +2 -2
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +3 -3
- package/dist/{media-_7Fxdu45.mjs → media-Cg4zc9fq.mjs} +12 -9
- package/dist/media-allowlist-eS3AZ2L_.mjs +26 -0
- package/dist/{menus-DYW_UHjv.mjs → menus-BDW1yIdj.mjs} +80 -87
- package/dist/menus-CwI7DQJ5.mjs +569 -0
- package/dist/mime-DJOFDGux.mjs +35 -0
- package/dist/{oauth-authorization-DxGjiWKL.mjs → oauth-authorization-DcYRiDfi.mjs} +5 -5
- package/dist/{oauth-clients-DxO_NO7k.mjs → oauth-clients-CgKFA-VH.mjs} +2 -2
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-C9106ehs.mjs → parse-BBfZRZYb.mjs} +1 -1
- package/dist/{placeholder-Bh1dfUOd.d.mts → placeholder-DKMMLt42.d.mts} +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{plugins-D7-ILNib.mjs → plugins-DKceDtUM.mjs} +9 -7
- package/dist/{preview-DvYRU-Oy.mjs → preview-CIDYFBzd.mjs} +2 -2
- package/dist/{provider-loader-BiQ6lNmf.d.mts → provider-loader-D0F6E2qv.d.mts} +1 -1
- package/dist/{query-CsbOywSY.mjs → query-BtuwuZRd.mjs} +3 -3
- package/dist/{query-B9BO5goQ.mjs → query-CWPxZjGM.mjs} +11 -11
- package/dist/{rate-limit-DmVTHI5v.mjs → rate-limit-GN64_Jaw.mjs} +5 -5
- package/dist/{redirect-CGl64yOX.mjs → redirect-BHo9--Jz.mjs} +3 -3
- package/dist/{redirects-Cgi_cZfN.mjs → redirects-Bc40BgxA.mjs} +4 -4
- package/dist/{redirects-lrlmYXVE.mjs → redirects-xVDvj_yQ.mjs} +68 -15
- package/dist/{registry-C-_hxLqa.mjs → registry-DumDzFDn.mjs} +5 -5
- package/dist/{request-cache-DHMRr2Lf.mjs → request-cache-DmVyQUBh.mjs} +5 -1
- package/dist/request-context.d.mts +19 -1
- package/dist/request-context.mjs +15 -3
- package/dist/{request-meta-DixlNKKa.mjs → request-meta-BVx9KkL-.mjs} +1 -1
- package/dist/{review-requests-C2DIHwlJ.mjs → review-requests-BYuoyse0.mjs} +1 -1
- package/dist/{review-requests-DIyjw-K_.mjs → review-requests-vCw7_3DS.mjs} +1 -1
- package/dist/{runner-BU6Lo1ZS.d.mts → runner-CHR_W79l.d.mts} +1 -1
- package/dist/{runner-DWZm2KQm.mjs → runner-lqEiJbO-.mjs} +496 -181
- package/dist/{runtime-QuuFSlc6.d.mts → runtime-DY_XmE9Y.d.mts} +15 -14
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +5 -5
- package/dist/{schema-BECjUhP8.mjs → schema-D1z41cq_.mjs} +1 -1
- package/dist/{search-DqTHQqtV.mjs → search-CPcQGTHW.mjs} +2 -2
- package/dist/{secrets-CkoJ9zN0.mjs → secrets-AFKoqUXj.mjs} +2 -2
- package/dist/{sections-B61OxnfB.mjs → sections-B9RYyf3I.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +19 -19
- package/dist/seo/index.d.mts +1 -1
- package/dist/{seo-CUQctrog.mjs → seo-BPz1KkCq.mjs} +1 -1
- package/dist/{service-CyOsm0R6.mjs → service-DgiH1Yud.mjs} +2 -2
- package/dist/{settings-Dzgswvg4.mjs → settings-BGCo_c2y.mjs} +1 -1
- package/dist/{settings-DGtLLSaz.mjs → settings-qPzY2KIF.mjs} +4 -4
- package/dist/{setup-complete-BlcGZRYm.mjs → setup-complete-4EiBS1E5.mjs} +1 -1
- package/dist/{site-activity-B8FjLIVh.mjs → site-activity-lsCX_cqp.mjs} +1 -1
- package/dist/{site-context-WBxoD99D.mjs → site-context-DHRIU6x9.mjs} +58 -34
- package/dist/{site-url-BP7k7OCe.mjs → site-url-oyqzZtoL.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 +1 -1
- package/dist/taxonomies-BWmxbumf.mjs +350 -0
- package/dist/taxonomies-aQXvYVPm.mjs +507 -0
- package/dist/taxonomy-DI-0HgKe.mjs +217 -0
- package/dist/{tokens-BOJw-D9F.mjs → tokens-DB4dASZl.mjs} +1 -1
- package/dist/{types-DZPw8Rru.d.mts → types-CYBaBvtm.d.mts} +9 -0
- package/dist/{types-C0mmVRJN.d.mts → types-CsnHvu4J.d.mts} +1 -0
- package/dist/{types-Bs6lTBBW.mjs → types-D1DjBFA9.mjs} +8 -2
- package/dist/{types-Q616b2Hn.d.mts → types-DS5PYew4.d.mts} +1 -1
- package/dist/ui/server-runtime.d.mts +7 -7
- package/dist/ui/server-runtime.mjs +19 -19
- package/dist/{user-CcXq-zoL.mjs → user-2aI21yV1.mjs} +1 -1
- package/dist/{utils-C0ONdBul.mjs → utils-BJF19gfk.mjs} +1 -1
- package/dist/{validate-C7TzfamJ.mjs → validate-B8ZvLeOE.mjs} +12 -8
- package/dist/{validate-BwmQEbu8.d.mts → validate-BQ24E8rK.d.mts} +21 -4
- package/dist/version-HdNieFOD.mjs +6 -0
- package/dist/{widgets-B7DRpZvy.mjs → widgets-Cce2-2fM.mjs} +2 -2
- package/dist/{wordpress-slugs-CnporCYH.mjs → wordpress-slugs-C4EhE6fo.mjs} +1 -1
- package/dist/{zod-generator-DBVP8D0P.mjs → zod-generator-BKhtHT3e.mjs} +3 -3
- package/package.json +5 -5
- package/dist/menus-DS3_5nWY.mjs +0 -312
- package/dist/taxonomies-D2aZGuns.mjs +0 -270
- package/dist/taxonomies-z6Lz91BC.mjs +0 -355
- package/dist/taxonomy-D5cbhc8u.mjs +0 -165
- package/dist/version-B3z9Tv-J.mjs +0 -6
- /package/dist/{adapters-DuLQZhRY.d.mts → adapters-BPzUiHHm.d.mts} +0 -0
- /package/dist/{api-tokens-CPjC3zf8.mjs → api-tokens-B7fvbHM2.mjs} +0 -0
- /package/dist/{base64-Cz-aU0X1.mjs → base64-C1Q9yr0B.mjs} +0 -0
- /package/dist/{challenge-store-DDTbisbf.mjs → challenge-store-anhwVER0.mjs} +0 -0
- /package/dist/{components-BPknylYg.mjs → components-BQiBW_Ji.mjs} +0 -0
- /package/dist/{config-CAMFxGaV.mjs → config-XW5tMrH8.mjs} +0 -0
- /package/dist/{context-types-C-LwdAxx.mjs → context-types-DuiyY6xF.mjs} +0 -0
- /package/dist/{cron-CKxvBrRT.mjs → cron-fV9baRVc.mjs} +0 -0
- /package/dist/{db-errors-DyZkswzF.mjs → db-errors-BnUbfGsK.mjs} +0 -0
- /package/dist/{default-D4ngTpW8.mjs → default-2JDm1rj_.mjs} +0 -0
- /package/dist/{email-console-CuefUXfX.mjs → email-console-_pTim1bU.mjs} +0 -0
- /package/dist/{entity-aliases-C0v-yNET.mjs → entity-aliases-PJV8IxDq.mjs} +0 -0
- /package/dist/{error-BMUPwxgx.mjs → error-Dyf9fGZE.mjs} +0 -0
- /package/dist/{escape-BRVaw1Ai.mjs → escape-Bn168-uP.mjs} +0 -0
- /package/dist/{experimental-workflows-C9X7yblQ.mjs → experimental-workflows-CSRjuEwS.mjs} +0 -0
- /package/dist/{hash-CDX7M0ze.mjs → hash-V8oZo1W2.mjs} +0 -0
- /package/dist/{load-B2XtDw__.mjs → load-BvyvS_76.mjs} +0 -0
- /package/dist/{manifest-schema-CgFJAp0H.mjs → manifest-schema-CU0XL_ZK.mjs} +0 -0
- /package/dist/{mode-DUhxwUhv.mjs → mode-DWw2di1I.mjs} +0 -0
- /package/dist/{normalize-C49G_o1k.mjs → normalize-9GU-bv_T.mjs} +0 -0
- /package/dist/{oauth-state-store-C5UFhzwD.mjs → oauth-state-store-DhifLitQ.mjs} +0 -0
- /package/dist/{oauth-user-lookup-Bi0ek9eM.mjs → oauth-user-lookup-nyXQ2_6Q.mjs} +0 -0
- /package/dist/{options-z8VVg1Ll.mjs → options-BF11H_FD.mjs} +0 -0
- /package/dist/{passkey-config-BRSZx4pW.mjs → passkey-config-DZOjt0Hd.mjs} +0 -0
- /package/dist/{patterns-K0DLqWir.mjs → patterns-CW4n2PQs.mjs} +0 -0
- /package/dist/{placeholder-C2P5fKa4.mjs → placeholder-BJPmhjHP.mjs} +0 -0
- /package/dist/{provider-loader-C21b9OpH.mjs → provider-loader-Decn0Ktc.mjs} +0 -0
- /package/dist/{public-url-Cun8N3NU.mjs → public-url-5fFLJhjh.mjs} +0 -0
- /package/dist/{redirect-COZy-3iY.mjs → redirect-C077gVTf.mjs} +0 -0
- /package/dist/{seo-C007Luwn.mjs → seo-DJoop90w.mjs} +0 -0
- /package/dist/{seo-contributions-B1fWCnqY.mjs → seo-contributions-CQzUjJKY.mjs} +0 -0
- /package/dist/{setup-nonce-BpmLXAuu.mjs → setup-nonce-DN6BHIlP.mjs} +0 -0
- /package/dist/{sidecar-client-B1C6Cf80.mjs → sidecar-client-Dta0AELf.mjs} +0 -0
- /package/dist/{slugify-PDTDtMXp.mjs → slugify-BzGxlOFx.mjs} +0 -0
- /package/dist/{ssrf-DDwRxF6B.mjs → ssrf-BOSGjXxb.mjs} +0 -0
- /package/dist/{transaction-x2tJQ-A1.mjs → transaction-qfqpPVpu.mjs} +0 -0
- /package/dist/{transport-CSyZ02_i.mjs → transport-B3jxvfio.mjs} +0 -0
- /package/dist/{transport-BXe1AM79.d.mts → transport-CyOHECBA.d.mts} +0 -0
- /package/dist/{trusted-proxy-BbaZfkT9.mjs → trusted-proxy-8N8sX1D1.mjs} +0 -0
- /package/dist/{types-DJlpx5Ay.d.mts → types-6N-00csp.d.mts} +0 -0
- /package/dist/{types-BFmjniC2.d.mts → types-B45uSz1j.d.mts} +0 -0
- /package/dist/{types-B7kpsMJ3.d.mts → types-BDm7Ipoq.d.mts} +0 -0
- /package/dist/{types-0Vr68fc2.d.mts → types-BeYn-Yf0.d.mts} +0 -0
- /package/dist/{types-OPs5Q_sX.d.mts → types-D_wGrwiY.d.mts} +0 -0
- /package/dist/{types-DL7Y8D_t.mjs → types-Dz2EKzsX.mjs} +0 -0
- /package/dist/{types-fAInWQDO.mjs → types-iNqHe2-V.mjs} +0 -0
- /package/dist/{url-DNjT2abR.mjs → url-DOS4RGym.mjs} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as __exportAll } from "../chunk-ClPoSABd.mjs";
|
|
3
3
|
import { n as createDatabase } from "../connection-BCNICDWN.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as runMigrations, t as getMigrationStatus } from "../runner-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "../
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import { t as
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import
|
|
15
|
-
import "../
|
|
16
|
-
import
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import
|
|
21
|
-
import "../
|
|
22
|
-
import
|
|
23
|
-
import { t as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
4
|
+
import { c as listTablesLike } from "../dialect-helpers-TkdbkFad.mjs";
|
|
5
|
+
import { r as runMigrations, t as getMigrationStatus } from "../runner-lqEiJbO-.mjs";
|
|
6
|
+
import { r as isI18nEnabled } from "../config-XW5tMrH8.mjs";
|
|
7
|
+
import { n as slugify } from "../slugify-BzGxlOFx.mjs";
|
|
8
|
+
import { t as ContentRepository } from "../content-DvpMad_N.mjs";
|
|
9
|
+
import { i as encodeBase64url } from "../base64-C1Q9yr0B.mjs";
|
|
10
|
+
import "../types-D1DjBFA9.mjs";
|
|
11
|
+
import { t as MediaRepository } from "../media-Cg4zc9fq.mjs";
|
|
12
|
+
import { t as TaxonomyRepository } from "../taxonomy-DI-0HgKe.mjs";
|
|
13
|
+
import { t as OptionsRepository } from "../options-BF11H_FD.mjs";
|
|
14
|
+
import "../redirect-BHo9--Jz.mjs";
|
|
15
|
+
import "../byline-BxAf79s1.mjs";
|
|
16
|
+
import "../request-cache-DmVyQUBh.mjs";
|
|
17
|
+
import "../fts-manager-D7KVeBmg.mjs";
|
|
18
|
+
import { n as SchemaRegistry } from "../registry-DumDzFDn.mjs";
|
|
19
|
+
import "../loader-CQFxFOt1.mjs";
|
|
20
|
+
import "../settings-qPzY2KIF.mjs";
|
|
21
|
+
import { i as pluginManifestSchema } from "../manifest-schema-CU0XL_ZK.mjs";
|
|
22
|
+
import "../ssrf-BOSGjXxb.mjs";
|
|
23
|
+
import { t as validateSeed } from "../validate-B8ZvLeOE.mjs";
|
|
24
|
+
import { t as applySeed } from "../apply-CGVHi2r7.mjs";
|
|
25
|
+
import { n as fingerprintKey, r as generateEncryptionKey, t as DinewaySecretsError } from "../secrets-AFKoqUXj.mjs";
|
|
26
|
+
import { o as convertDataForRead } from "../transport-B3jxvfio.mjs";
|
|
26
27
|
import { createHeaderAwareFetch, customHeadersInterceptor, isRedirectResponse, resolveCustomHeaders } from "../client/external-auth-headers.mjs";
|
|
27
28
|
import { DinewayClient } from "../client/index.mjs";
|
|
28
29
|
import { LocalStorage } from "../storage/local.mjs";
|
|
@@ -1448,6 +1449,7 @@ const RAILWAY_URL_RE = /https:\/\/[^\s"]+\.up\.railway\.app[^\s"]*/;
|
|
|
1448
1449
|
const INVALID_RAILWAY_PROJECT_CHARS_RE = /[^a-z0-9-]+/g;
|
|
1449
1450
|
const REPEATED_HYPHENS_RE = /-+/g;
|
|
1450
1451
|
const EDGE_HYPHENS_RE = /^-|-$/g;
|
|
1452
|
+
const RAILWAY_BUILDER = "RAILPACK";
|
|
1451
1453
|
async function fileExists$5(path) {
|
|
1452
1454
|
try {
|
|
1453
1455
|
await access(path);
|
|
@@ -1514,10 +1516,27 @@ const railwayTarget = {
|
|
|
1514
1516
|
return (await runCommand$1("railway", ["status"], { cwd })).code === 0;
|
|
1515
1517
|
},
|
|
1516
1518
|
async link(cwd) {
|
|
1519
|
+
const name = await defaultRailwayProjectName(cwd);
|
|
1517
1520
|
await runCommandOrThrow("railway", [
|
|
1518
1521
|
"init",
|
|
1519
1522
|
"--name",
|
|
1520
|
-
|
|
1523
|
+
name
|
|
1524
|
+
], {
|
|
1525
|
+
cwd,
|
|
1526
|
+
stdio: "inherit"
|
|
1527
|
+
});
|
|
1528
|
+
await runCommandOrThrow("railway", [
|
|
1529
|
+
"add",
|
|
1530
|
+
"--service",
|
|
1531
|
+
name
|
|
1532
|
+
], {
|
|
1533
|
+
cwd,
|
|
1534
|
+
stdio: "inherit"
|
|
1535
|
+
});
|
|
1536
|
+
await runCommandOrThrow("railway", [
|
|
1537
|
+
"service",
|
|
1538
|
+
"link",
|
|
1539
|
+
name
|
|
1521
1540
|
], {
|
|
1522
1541
|
cwd,
|
|
1523
1542
|
stdio: "inherit"
|
|
@@ -1532,7 +1551,7 @@ const railwayTarget = {
|
|
|
1532
1551
|
const config = {
|
|
1533
1552
|
$schema: "https://railway.app/railway.schema.json",
|
|
1534
1553
|
build: {
|
|
1535
|
-
builder:
|
|
1554
|
+
builder: RAILWAY_BUILDER,
|
|
1536
1555
|
buildCommand: (await detectBuildCommand(cwd)).display
|
|
1537
1556
|
},
|
|
1538
1557
|
deploy: {
|
|
@@ -2217,49 +2236,96 @@ async function exportCollections(db) {
|
|
|
2217
2236
|
* Export taxonomy definitions and terms
|
|
2218
2237
|
*/
|
|
2219
2238
|
async function exportTaxonomies(db) {
|
|
2220
|
-
const
|
|
2239
|
+
const i18nEnabled = isI18nEnabled();
|
|
2240
|
+
const defs = await db.selectFrom("_dineway_taxonomy_defs").selectAll().orderBy(["name", "locale"]).execute();
|
|
2221
2241
|
const result = [];
|
|
2222
2242
|
const termRepo = new TaxonomyRepository(db);
|
|
2243
|
+
const defGroupToSeedId = /* @__PURE__ */ new Map();
|
|
2223
2244
|
for (const def of defs) {
|
|
2224
|
-
const
|
|
2225
|
-
const
|
|
2245
|
+
const defSeedId = i18nEnabled && def.locale ? `tax:${def.name}:${def.locale}` : `tax:${def.name}`;
|
|
2246
|
+
const terms = await termRepo.findByName(def.name, { locale: def.locale });
|
|
2226
2247
|
const idToSlug = /* @__PURE__ */ new Map();
|
|
2227
2248
|
for (const term of terms) idToSlug.set(term.id, term.slug);
|
|
2249
|
+
const termGroupToSeedId = /* @__PURE__ */ new Map();
|
|
2250
|
+
const seedTerms = [];
|
|
2228
2251
|
for (const term of terms) {
|
|
2252
|
+
const termSeedId = i18nEnabled && term.locale ? `term:${def.name}:${term.slug}:${term.locale}` : `term:${def.name}:${term.slug}`;
|
|
2229
2253
|
const seedTerm = {
|
|
2254
|
+
id: termSeedId,
|
|
2230
2255
|
slug: term.slug,
|
|
2231
2256
|
label: term.label,
|
|
2232
2257
|
description: typeof term.data?.description === "string" ? term.data.description : void 0
|
|
2233
2258
|
};
|
|
2234
2259
|
if (term.parentId) seedTerm.parent = idToSlug.get(term.parentId);
|
|
2260
|
+
if (i18nEnabled && term.locale) {
|
|
2261
|
+
seedTerm.locale = term.locale;
|
|
2262
|
+
if (term.translationGroup) {
|
|
2263
|
+
const anchor = termGroupToSeedId.get(term.translationGroup);
|
|
2264
|
+
if (anchor) seedTerm.translationOf = anchor;
|
|
2265
|
+
else termGroupToSeedId.set(term.translationGroup, termSeedId);
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2235
2268
|
seedTerms.push(seedTerm);
|
|
2236
2269
|
}
|
|
2270
|
+
seedTerms.sort((a, b) => Number(!!a.translationOf) - Number(!!b.translationOf));
|
|
2237
2271
|
const taxonomy = {
|
|
2272
|
+
id: defSeedId,
|
|
2238
2273
|
name: def.name,
|
|
2239
2274
|
label: def.label,
|
|
2240
2275
|
labelSingular: def.label_singular || void 0,
|
|
2241
2276
|
hierarchical: def.hierarchical === 1,
|
|
2242
2277
|
collections: def.collections ? JSON.parse(def.collections) : []
|
|
2243
2278
|
};
|
|
2279
|
+
if (i18nEnabled && def.locale) {
|
|
2280
|
+
taxonomy.locale = def.locale;
|
|
2281
|
+
if (def.translation_group) {
|
|
2282
|
+
const anchor = defGroupToSeedId.get(def.translation_group);
|
|
2283
|
+
if (anchor) taxonomy.translationOf = anchor;
|
|
2284
|
+
else defGroupToSeedId.set(def.translation_group, defSeedId);
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2244
2287
|
if (seedTerms.length > 0) taxonomy.terms = seedTerms;
|
|
2245
2288
|
result.push(taxonomy);
|
|
2246
2289
|
}
|
|
2290
|
+
result.sort((a, b) => Number(!!a.translationOf) - Number(!!b.translationOf));
|
|
2247
2291
|
return result;
|
|
2248
2292
|
}
|
|
2249
2293
|
/**
|
|
2250
2294
|
* Export menus with their items
|
|
2251
2295
|
*/
|
|
2252
2296
|
async function exportMenus(db) {
|
|
2253
|
-
const
|
|
2297
|
+
const i18nEnabled = isI18nEnabled();
|
|
2298
|
+
const menus = await db.selectFrom("_dineway_menus").selectAll().orderBy(["name", "locale"]).execute();
|
|
2254
2299
|
const result = [];
|
|
2300
|
+
const groupToSeedId = /* @__PURE__ */ new Map();
|
|
2301
|
+
const itemGroupToSeedId = /* @__PURE__ */ new Map();
|
|
2302
|
+
const usedItemSeedIds = /* @__PURE__ */ new Set();
|
|
2255
2303
|
for (const menu of menus) {
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2304
|
+
const seedId = i18nEnabled && menu.locale ? `menu:${menu.name}:${menu.locale}` : `menu:${menu.name}`;
|
|
2305
|
+
const seedItems = buildMenuItemTree(await db.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", menu.id).orderBy("sort_order", "asc").execute(), {
|
|
2306
|
+
i18nEnabled,
|
|
2307
|
+
menuName: menu.name,
|
|
2308
|
+
menuLocale: menu.locale ?? null,
|
|
2309
|
+
itemGroupToSeedId,
|
|
2310
|
+
usedItemSeedIds
|
|
2311
|
+
});
|
|
2312
|
+
const seedMenu = {
|
|
2313
|
+
id: seedId,
|
|
2258
2314
|
name: menu.name,
|
|
2259
2315
|
label: menu.label,
|
|
2260
2316
|
items: seedItems
|
|
2261
|
-
}
|
|
2317
|
+
};
|
|
2318
|
+
if (i18nEnabled && menu.locale) {
|
|
2319
|
+
seedMenu.locale = menu.locale;
|
|
2320
|
+
if (menu.translation_group) {
|
|
2321
|
+
const anchor = groupToSeedId.get(menu.translation_group);
|
|
2322
|
+
if (anchor) seedMenu.translationOf = anchor;
|
|
2323
|
+
else groupToSeedId.set(menu.translation_group, seedId);
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
result.push(seedMenu);
|
|
2262
2327
|
}
|
|
2328
|
+
result.sort((a, b) => Number(!!a.translationOf) - Number(!!b.translationOf));
|
|
2263
2329
|
return result;
|
|
2264
2330
|
}
|
|
2265
2331
|
/** Type guard for valid widget types */
|
|
@@ -2269,13 +2335,25 @@ function isWidgetType(t) {
|
|
|
2269
2335
|
/**
|
|
2270
2336
|
* Build hierarchical menu item tree from flat array
|
|
2271
2337
|
*/
|
|
2272
|
-
function buildMenuItemTree(items) {
|
|
2338
|
+
function buildMenuItemTree(items, i18nCtx) {
|
|
2273
2339
|
const childMap = /* @__PURE__ */ new Map();
|
|
2274
2340
|
for (const item of items) {
|
|
2275
2341
|
const parentId = item.parent_id;
|
|
2276
2342
|
if (!childMap.has(parentId)) childMap.set(parentId, []);
|
|
2277
2343
|
childMap.get(parentId).push(item);
|
|
2278
2344
|
}
|
|
2345
|
+
function makeSeedId(item) {
|
|
2346
|
+
const base = slugify(item.label || "") || item.id;
|
|
2347
|
+
const locale = i18nCtx.i18nEnabled ? item.locale ?? i18nCtx.menuLocale : null;
|
|
2348
|
+
const candidate = locale ? `item:${i18nCtx.menuName}:${base}:${locale}` : `item:${i18nCtx.menuName}:${base}`;
|
|
2349
|
+
if (!i18nCtx.usedItemSeedIds.has(candidate)) {
|
|
2350
|
+
i18nCtx.usedItemSeedIds.add(candidate);
|
|
2351
|
+
return candidate;
|
|
2352
|
+
}
|
|
2353
|
+
const fallback = locale ? `item:${i18nCtx.menuName}:${base}:${item.id}:${locale}` : `item:${i18nCtx.menuName}:${base}:${item.id}`;
|
|
2354
|
+
i18nCtx.usedItemSeedIds.add(fallback);
|
|
2355
|
+
return fallback;
|
|
2356
|
+
}
|
|
2279
2357
|
function buildLevel(parentId) {
|
|
2280
2358
|
return (childMap.get(parentId) || []).map((item) => {
|
|
2281
2359
|
const seedItem = {
|
|
@@ -2290,6 +2368,17 @@ function buildMenuItemTree(items) {
|
|
|
2290
2368
|
if (item.target === "_blank") seedItem.target = "_blank";
|
|
2291
2369
|
if (item.title_attr) seedItem.titleAttr = item.title_attr;
|
|
2292
2370
|
if (item.css_classes) seedItem.cssClasses = item.css_classes;
|
|
2371
|
+
if (i18nCtx.i18nEnabled) {
|
|
2372
|
+
const itemLocale = item.locale ?? i18nCtx.menuLocale;
|
|
2373
|
+
const seedId = makeSeedId(item);
|
|
2374
|
+
seedItem.id = seedId;
|
|
2375
|
+
if (itemLocale) seedItem.locale = itemLocale;
|
|
2376
|
+
if (item.translation_group) {
|
|
2377
|
+
const anchor = i18nCtx.itemGroupToSeedId.get(item.translation_group);
|
|
2378
|
+
if (anchor && anchor !== seedId) seedItem.translationOf = anchor;
|
|
2379
|
+
else if (!anchor) i18nCtx.itemGroupToSeedId.set(item.translation_group, seedId);
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2293
2382
|
const itemChildren = buildLevel(item.id);
|
|
2294
2383
|
if (itemChildren.length > 0) seedItem.children = itemChildren;
|
|
2295
2384
|
return seedItem;
|
|
@@ -3097,7 +3186,9 @@ const menuCommand = defineCommand({
|
|
|
3097
3186
|
* Shared logic extracted from the bundle command so it can be tested
|
|
3098
3187
|
* without the CLI harness and tsdown dependency.
|
|
3099
3188
|
*/
|
|
3100
|
-
const MAX_BUNDLE_SIZE =
|
|
3189
|
+
const MAX_BUNDLE_SIZE = 256 * 1024;
|
|
3190
|
+
const MAX_FILE_SIZE = 128 * 1024;
|
|
3191
|
+
const MAX_FILE_COUNT = 20;
|
|
3101
3192
|
const MAX_SCREENSHOTS = 5;
|
|
3102
3193
|
const MAX_SCREENSHOT_WIDTH = 1920;
|
|
3103
3194
|
const MAX_SCREENSHOT_HEIGHT = 1080;
|
|
@@ -3264,21 +3355,52 @@ function findSourceExports(exports) {
|
|
|
3264
3355
|
return issues;
|
|
3265
3356
|
}
|
|
3266
3357
|
/**
|
|
3267
|
-
* Recursively
|
|
3358
|
+
* Recursively walk a staging directory and return all regular files with
|
|
3359
|
+
* tarball-relative names.
|
|
3268
3360
|
*/
|
|
3269
|
-
async function
|
|
3270
|
-
|
|
3361
|
+
async function collectBundleEntries(dir) {
|
|
3362
|
+
const entries = [];
|
|
3363
|
+
await walkBundle(dir, "", entries);
|
|
3364
|
+
return entries;
|
|
3365
|
+
}
|
|
3366
|
+
async function walkBundle(dir, prefix, into) {
|
|
3271
3367
|
const items = await readdir(dir, { withFileTypes: true });
|
|
3272
3368
|
for (const item of items) {
|
|
3273
3369
|
const fullPath = join(dir, item.name);
|
|
3370
|
+
const relPath = prefix ? `${prefix}/${item.name}` : item.name;
|
|
3274
3371
|
if (item.isFile()) {
|
|
3275
3372
|
const s = await stat(fullPath);
|
|
3276
|
-
|
|
3277
|
-
|
|
3373
|
+
into.push({
|
|
3374
|
+
name: relPath,
|
|
3375
|
+
bytes: s.size
|
|
3376
|
+
});
|
|
3377
|
+
} else if (item.isDirectory()) await walkBundle(fullPath, relPath, into);
|
|
3278
3378
|
}
|
|
3379
|
+
}
|
|
3380
|
+
function totalBundleBytes(entries) {
|
|
3381
|
+
let total = 0;
|
|
3382
|
+
for (const entry of entries) total += entry.bytes;
|
|
3279
3383
|
return total;
|
|
3280
3384
|
}
|
|
3281
3385
|
/**
|
|
3386
|
+
* Enforce sandboxed plugin caps against decompressed bundle files:
|
|
3387
|
+
* total size, per-file size, and file count.
|
|
3388
|
+
*/
|
|
3389
|
+
function validateBundleSize(entries) {
|
|
3390
|
+
const violations = [];
|
|
3391
|
+
const total = totalBundleBytes(entries);
|
|
3392
|
+
if (total > MAX_BUNDLE_SIZE) violations.push(`Bundle size ${formatBytes(total)} exceeds maximum of ${formatBytes(MAX_BUNDLE_SIZE)}.`);
|
|
3393
|
+
if (entries.length > MAX_FILE_COUNT) violations.push(`Bundle contains ${entries.length} files, exceeds maximum of ${MAX_FILE_COUNT}.`);
|
|
3394
|
+
const oversized = entries.filter((entry) => entry.bytes > MAX_FILE_SIZE).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
3395
|
+
for (const entry of oversized) violations.push(`File ${entry.name} is ${formatBytes(entry.bytes)}, exceeds per-file maximum of ${formatBytes(MAX_FILE_SIZE)}.`);
|
|
3396
|
+
return violations;
|
|
3397
|
+
}
|
|
3398
|
+
function formatBytes(bytes) {
|
|
3399
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
3400
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
3401
|
+
return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
3402
|
+
}
|
|
3403
|
+
/**
|
|
3282
3404
|
* Create a gzipped tarball from a directory.
|
|
3283
3405
|
*/
|
|
3284
3406
|
async function createTarball(sourceDir, outputPath) {
|
|
@@ -3378,6 +3500,7 @@ const bundleCommand = defineCommand({
|
|
|
3378
3500
|
const tmpDir = join(pluginDir, ".dineway-bundle-tmp");
|
|
3379
3501
|
try {
|
|
3380
3502
|
await mkdir(tmpDir, { recursive: true });
|
|
3503
|
+
await copyFile(pkgPath, join(tmpDir, "package.json"));
|
|
3381
3504
|
const mainOutDir = join(tmpDir, "main");
|
|
3382
3505
|
await build({
|
|
3383
3506
|
config: false,
|
|
@@ -3607,15 +3730,12 @@ const bundleCommand = defineCommand({
|
|
|
3607
3730
|
hasErrors = true;
|
|
3608
3731
|
}
|
|
3609
3732
|
}
|
|
3610
|
-
const
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3733
|
+
const bundleEntries = await collectBundleEntries(bundleDir);
|
|
3734
|
+
const sizeViolations = validateBundleSize(bundleEntries);
|
|
3735
|
+
if (sizeViolations.length > 0) {
|
|
3736
|
+
for (const violation of sizeViolations) consola.error(violation);
|
|
3614
3737
|
hasErrors = true;
|
|
3615
|
-
} else {
|
|
3616
|
-
const sizeKB = (totalSize / 1024).toFixed(1);
|
|
3617
|
-
consola.info(`Bundle size: ${sizeKB}KB`);
|
|
3618
|
-
}
|
|
3738
|
+
} else consola.info(`Bundle size: ${formatBytes(totalBundleBytes(bundleEntries))} across ${bundleEntries.length} file${bundleEntries.length === 1 ? "" : "s"}`);
|
|
3619
3739
|
if (hasErrors) {
|
|
3620
3740
|
consola.error("Bundle validation failed");
|
|
3621
3741
|
process.exit(1);
|
|
@@ -3647,17 +3767,34 @@ const bundleCommand = defineCommand({
|
|
|
3647
3767
|
/**
|
|
3648
3768
|
* dineway plugin init
|
|
3649
3769
|
*
|
|
3650
|
-
* Scaffold a new Dineway plugin. Generates the
|
|
3770
|
+
* Scaffold a new Dineway plugin. Generates the sandboxed-format boilerplate:
|
|
3651
3771
|
* src/index.ts -- descriptor factory
|
|
3652
3772
|
* src/sandbox-entry.ts -- definePlugin({ hooks, routes })
|
|
3653
3773
|
* package.json
|
|
3654
3774
|
* tsconfig.json
|
|
3655
3775
|
*
|
|
3656
|
-
* Use --native to generate native-format boilerplate
|
|
3657
|
-
*
|
|
3776
|
+
* Use --format=native (or --native) to generate native-format boilerplate
|
|
3777
|
+
* instead (createPlugin + React admin). When neither is passed and stdout
|
|
3778
|
+
* is a TTY, the user is prompted to choose.
|
|
3658
3779
|
*/
|
|
3659
3780
|
const SLUG_RE = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
3660
3781
|
const SCOPE_RE = /^@[^/]+\//;
|
|
3782
|
+
const TSDOWN_VERSION = "^0.20.0";
|
|
3783
|
+
const TYPESCRIPT_VERSION = "^5.9.0";
|
|
3784
|
+
const TSCONFIG = {
|
|
3785
|
+
compilerOptions: {
|
|
3786
|
+
target: "ES2022",
|
|
3787
|
+
module: "preserve",
|
|
3788
|
+
moduleResolution: "bundler",
|
|
3789
|
+
strict: true,
|
|
3790
|
+
esModuleInterop: true,
|
|
3791
|
+
declaration: true,
|
|
3792
|
+
outDir: "./dist",
|
|
3793
|
+
rootDir: "./src"
|
|
3794
|
+
},
|
|
3795
|
+
include: ["src/**/*"],
|
|
3796
|
+
exclude: ["node_modules", "dist"]
|
|
3797
|
+
};
|
|
3661
3798
|
const pluginInitCommand = defineCommand({
|
|
3662
3799
|
meta: {
|
|
3663
3800
|
name: "init",
|
|
@@ -3673,15 +3810,25 @@ const pluginInitCommand = defineCommand({
|
|
|
3673
3810
|
type: "string",
|
|
3674
3811
|
description: "Plugin name/id (e.g. my-plugin or @org/my-plugin)"
|
|
3675
3812
|
},
|
|
3813
|
+
format: {
|
|
3814
|
+
type: "string",
|
|
3815
|
+
description: "Plugin format: sandboxed or native. Prompts when running interactively if not set.",
|
|
3816
|
+
valueHint: "sandboxed|native"
|
|
3817
|
+
},
|
|
3676
3818
|
native: {
|
|
3677
3819
|
type: "boolean",
|
|
3678
|
-
description: "
|
|
3820
|
+
description: "Shortcut for --format=native",
|
|
3679
3821
|
default: false
|
|
3680
3822
|
}
|
|
3681
3823
|
},
|
|
3682
3824
|
async run({ args }) {
|
|
3683
3825
|
const targetDir = resolve(args.dir);
|
|
3684
|
-
const
|
|
3826
|
+
const format = await resolveFormat(args.format, args.native);
|
|
3827
|
+
if (!format) {
|
|
3828
|
+
consola.info("Cancelled");
|
|
3829
|
+
return;
|
|
3830
|
+
}
|
|
3831
|
+
const isNative = format === "native";
|
|
3685
3832
|
let pluginName = args.name || basename(targetDir);
|
|
3686
3833
|
if (!pluginName || pluginName === ".") pluginName = basename(resolve("."));
|
|
3687
3834
|
const slug = pluginName.replace(SCOPE_RE, "");
|
|
@@ -3694,69 +3841,146 @@ const pluginInitCommand = defineCommand({
|
|
|
3694
3841
|
consola.error(`package.json already exists in ${targetDir}`);
|
|
3695
3842
|
process.exit(1);
|
|
3696
3843
|
}
|
|
3697
|
-
consola.start(`Scaffolding ${isNative ? "native" : "
|
|
3844
|
+
consola.start(`Scaffolding ${isNative ? "native" : "sandboxed"} plugin: ${pluginName}`);
|
|
3698
3845
|
await mkdir(srcDir, { recursive: true });
|
|
3699
3846
|
if (isNative) await scaffoldNative(targetDir, srcDir, pluginName, slug);
|
|
3700
3847
|
else await scaffoldStandard(targetDir, srcDir, pluginName, slug);
|
|
3701
3848
|
consola.success(`Plugin scaffolded in ${targetDir}`);
|
|
3702
3849
|
consola.info("Next steps:");
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3850
|
+
const steps = [];
|
|
3851
|
+
if (args.dir !== ".") steps.push(`cd ${args.dir}`);
|
|
3852
|
+
steps.push("pnpm install");
|
|
3853
|
+
steps.push(isNative ? "Edit src/index.ts to add hooks and routes" : "Edit src/sandbox-entry.ts to add hooks and routes");
|
|
3854
|
+
steps.push("pnpm build");
|
|
3855
|
+
if (!isNative) steps.push("dineway plugin validate --dir .");
|
|
3856
|
+
steps.forEach((step, index) => consola.info(` ${index + 1}. ${step}`));
|
|
3708
3857
|
}
|
|
3709
3858
|
});
|
|
3859
|
+
async function resolveFormat(formatArg, nativeFlag) {
|
|
3860
|
+
if (formatArg) {
|
|
3861
|
+
const normalized = formatArg.toLowerCase();
|
|
3862
|
+
let parsed;
|
|
3863
|
+
if (normalized === "native") parsed = "native";
|
|
3864
|
+
else if (normalized === "sandboxed" || normalized === "standard") parsed = "standard";
|
|
3865
|
+
else {
|
|
3866
|
+
consola.error(`Invalid --format "${formatArg}". Use "sandboxed" or "native".`);
|
|
3867
|
+
process.exit(1);
|
|
3868
|
+
}
|
|
3869
|
+
if (nativeFlag && parsed !== "native") {
|
|
3870
|
+
consola.error(`Conflicting flags: --native and --format=${formatArg}. Pass only one.`);
|
|
3871
|
+
process.exit(1);
|
|
3872
|
+
}
|
|
3873
|
+
return parsed;
|
|
3874
|
+
}
|
|
3875
|
+
if (nativeFlag) return "native";
|
|
3876
|
+
if (!process.stdout.isTTY) return "standard";
|
|
3877
|
+
const choice = await consola.prompt("Which plugin format?", {
|
|
3878
|
+
type: "select",
|
|
3879
|
+
initial: "standard",
|
|
3880
|
+
options: [{
|
|
3881
|
+
label: "Sandboxed",
|
|
3882
|
+
value: "standard",
|
|
3883
|
+
hint: "runs in an isolated sandbox; safe to install from the marketplace"
|
|
3884
|
+
}, {
|
|
3885
|
+
label: "Native",
|
|
3886
|
+
value: "native",
|
|
3887
|
+
hint: "full runtime access; install from npm"
|
|
3888
|
+
}],
|
|
3889
|
+
cancel: "null"
|
|
3890
|
+
});
|
|
3891
|
+
if (choice === null) return null;
|
|
3892
|
+
return choice;
|
|
3893
|
+
}
|
|
3894
|
+
function camelCase(slug) {
|
|
3895
|
+
return slug.split("-").map((part, index) => index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
3896
|
+
}
|
|
3897
|
+
function pascalCase(slug) {
|
|
3898
|
+
return slug.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
3899
|
+
}
|
|
3710
3900
|
async function scaffoldStandard(targetDir, srcDir, pluginName, slug) {
|
|
3711
|
-
const fnName = slug
|
|
3901
|
+
const fnName = camelCase(slug);
|
|
3712
3902
|
await writeFile(join(targetDir, "package.json"), JSON.stringify({
|
|
3713
3903
|
name: pluginName,
|
|
3714
3904
|
version: "0.1.0",
|
|
3715
3905
|
type: "module",
|
|
3906
|
+
main: "./dist/index.mjs",
|
|
3716
3907
|
exports: {
|
|
3717
|
-
".":
|
|
3718
|
-
|
|
3908
|
+
".": {
|
|
3909
|
+
types: "./dist/index.d.mts",
|
|
3910
|
+
import: "./dist/index.mjs"
|
|
3911
|
+
},
|
|
3912
|
+
"./sandbox": {
|
|
3913
|
+
types: "./dist/sandbox-entry.d.mts",
|
|
3914
|
+
import: "./dist/sandbox-entry.mjs"
|
|
3915
|
+
}
|
|
3719
3916
|
},
|
|
3720
|
-
files: ["
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
target: "ES2022",
|
|
3726
|
-
module: "preserve",
|
|
3727
|
-
moduleResolution: "bundler",
|
|
3728
|
-
strict: true,
|
|
3729
|
-
esModuleInterop: true,
|
|
3730
|
-
declaration: true,
|
|
3731
|
-
outDir: "./dist",
|
|
3732
|
-
rootDir: "./src"
|
|
3917
|
+
files: ["dist"],
|
|
3918
|
+
scripts: {
|
|
3919
|
+
build: "tsdown src/index.ts src/sandbox-entry.ts --format esm --dts --clean",
|
|
3920
|
+
dev: "tsdown src/index.ts src/sandbox-entry.ts --format esm --dts --watch",
|
|
3921
|
+
typecheck: "tsc --noEmit"
|
|
3733
3922
|
},
|
|
3734
|
-
|
|
3735
|
-
|
|
3923
|
+
keywords: ["dineway", "dineway-plugin"],
|
|
3924
|
+
license: "MIT",
|
|
3925
|
+
peerDependencies: { dineway: "*" },
|
|
3926
|
+
devDependencies: {
|
|
3927
|
+
dineway: "*",
|
|
3928
|
+
tsdown: TSDOWN_VERSION,
|
|
3929
|
+
typescript: TYPESCRIPT_VERSION
|
|
3930
|
+
}
|
|
3736
3931
|
}, null, " ") + "\n");
|
|
3932
|
+
await writeFile(join(targetDir, "tsconfig.json"), JSON.stringify(TSCONFIG, null, " ") + "\n");
|
|
3737
3933
|
await writeFile(join(srcDir, "index.ts"), `import type { PluginDescriptor } from "dineway";
|
|
3738
3934
|
|
|
3739
3935
|
export function ${fnName}Plugin(): PluginDescriptor {
|
|
3740
3936
|
\treturn {
|
|
3741
|
-
\t\tid: "${
|
|
3937
|
+
\t\tid: "${slug}",
|
|
3742
3938
|
\t\tversion: "0.1.0",
|
|
3743
3939
|
\t\tformat: "standard",
|
|
3744
3940
|
\t\tentrypoint: "${pluginName}/sandbox",
|
|
3745
|
-
|
|
3941
|
+
|
|
3942
|
+
\t\tcapabilities: ["content:read"],
|
|
3943
|
+
\t\tstorage: {
|
|
3944
|
+
\t\t\tevents: { indexes: ["timestamp"] },
|
|
3945
|
+
\t\t},
|
|
3746
3946
|
\t};
|
|
3747
3947
|
}
|
|
3748
3948
|
`);
|
|
3749
3949
|
await writeFile(join(srcDir, "sandbox-entry.ts"), `import { definePlugin } from "dineway";
|
|
3750
3950
|
import type { PluginContext } from "dineway";
|
|
3751
3951
|
|
|
3952
|
+
interface ContentSaveEvent {
|
|
3953
|
+
\tcollection: string;
|
|
3954
|
+
\tcontent: { id: string };
|
|
3955
|
+
\tisNew: boolean;
|
|
3956
|
+
}
|
|
3957
|
+
|
|
3752
3958
|
export default definePlugin({
|
|
3753
3959
|
\thooks: {
|
|
3754
3960
|
\t\t"content:afterSave": {
|
|
3755
|
-
\t\t\thandler: async (event:
|
|
3961
|
+
\t\t\thandler: async (event: ContentSaveEvent, ctx: PluginContext) => {
|
|
3756
3962
|
\t\t\t\tctx.log.info("Content saved", {
|
|
3757
3963
|
\t\t\t\t\tcollection: event.collection,
|
|
3758
3964
|
\t\t\t\t\tid: event.content.id,
|
|
3759
3965
|
\t\t\t\t});
|
|
3966
|
+
|
|
3967
|
+
\t\t\t\tawait ctx.storage.events.put(\`save-\${Date.now()}\`, {
|
|
3968
|
+
\t\t\t\t\ttimestamp: new Date().toISOString(),
|
|
3969
|
+
\t\t\t\t\tcollection: event.collection,
|
|
3970
|
+
\t\t\t\t\tcontentId: event.content.id,
|
|
3971
|
+
\t\t\t\t});
|
|
3972
|
+
\t\t\t},
|
|
3973
|
+
\t\t},
|
|
3974
|
+
\t},
|
|
3975
|
+
|
|
3976
|
+
\troutes: {
|
|
3977
|
+
\t\trecent: {
|
|
3978
|
+
\t\t\thandler: async (_routeCtx: unknown, ctx: PluginContext) => {
|
|
3979
|
+
\t\t\t\tconst result = await ctx.storage.events.query({
|
|
3980
|
+
\t\t\t\t\torderBy: { timestamp: "desc" },
|
|
3981
|
+
\t\t\t\t\tlimit: 10,
|
|
3982
|
+
\t\t\t\t});
|
|
3983
|
+
\t\t\t\treturn { events: result.items };
|
|
3760
3984
|
\t\t\t},
|
|
3761
3985
|
\t\t},
|
|
3762
3986
|
\t},
|
|
@@ -3764,55 +3988,84 @@ export default definePlugin({
|
|
|
3764
3988
|
`);
|
|
3765
3989
|
}
|
|
3766
3990
|
async function scaffoldNative(targetDir, srcDir, pluginName, slug) {
|
|
3767
|
-
const fnName = slug
|
|
3991
|
+
const fnName = camelCase(slug);
|
|
3992
|
+
const typeName = pascalCase(slug);
|
|
3768
3993
|
await writeFile(join(targetDir, "package.json"), JSON.stringify({
|
|
3769
3994
|
name: pluginName,
|
|
3770
3995
|
version: "0.1.0",
|
|
3771
3996
|
type: "module",
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
esModuleInterop: true,
|
|
3783
|
-
declaration: true,
|
|
3784
|
-
outDir: "./dist",
|
|
3785
|
-
rootDir: "./src"
|
|
3997
|
+
main: "./dist/index.mjs",
|
|
3998
|
+
exports: { ".": {
|
|
3999
|
+
types: "./dist/index.d.mts",
|
|
4000
|
+
import: "./dist/index.mjs"
|
|
4001
|
+
} },
|
|
4002
|
+
files: ["dist"],
|
|
4003
|
+
scripts: {
|
|
4004
|
+
build: "tsdown src/index.ts --format esm --dts --clean",
|
|
4005
|
+
dev: "tsdown src/index.ts --format esm --dts --watch",
|
|
4006
|
+
typecheck: "tsc --noEmit"
|
|
3786
4007
|
},
|
|
3787
|
-
|
|
3788
|
-
|
|
4008
|
+
keywords: ["dineway", "dineway-plugin"],
|
|
4009
|
+
license: "MIT",
|
|
4010
|
+
peerDependencies: { dineway: "*" },
|
|
4011
|
+
devDependencies: {
|
|
4012
|
+
dineway: "*",
|
|
4013
|
+
tsdown: TSDOWN_VERSION,
|
|
4014
|
+
typescript: TYPESCRIPT_VERSION
|
|
4015
|
+
}
|
|
3789
4016
|
}, null, " ") + "\n");
|
|
4017
|
+
await writeFile(join(targetDir, "tsconfig.json"), JSON.stringify(TSCONFIG, null, " ") + "\n");
|
|
3790
4018
|
await writeFile(join(srcDir, "index.ts"), `import { definePlugin } from "dineway";
|
|
3791
|
-
import type { PluginDescriptor } from "dineway";
|
|
4019
|
+
import type { ContentHookEvent, PluginContext, PluginDescriptor, RouteContext } from "dineway";
|
|
3792
4020
|
|
|
3793
|
-
export
|
|
4021
|
+
export interface ${typeName}Options {
|
|
4022
|
+
\tenabled?: boolean;
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
export function ${fnName}Plugin(
|
|
4026
|
+
\toptions: ${typeName}Options = {},
|
|
4027
|
+
): PluginDescriptor<${typeName}Options> {
|
|
3794
4028
|
\treturn {
|
|
3795
|
-
\t\tid: "${
|
|
4029
|
+
\t\tid: "${slug}",
|
|
3796
4030
|
\t\tversion: "0.1.0",
|
|
3797
4031
|
\t\tformat: "native",
|
|
3798
4032
|
\t\tentrypoint: "${pluginName}",
|
|
3799
|
-
\t\toptions
|
|
4033
|
+
\t\toptions,
|
|
3800
4034
|
\t};
|
|
3801
4035
|
}
|
|
3802
4036
|
|
|
3803
|
-
export function createPlugin() {
|
|
4037
|
+
export function createPlugin(options: ${typeName}Options = {}) {
|
|
3804
4038
|
\treturn definePlugin({
|
|
3805
|
-
\t\tid: "${
|
|
4039
|
+
\t\tid: "${slug}",
|
|
3806
4040
|
\t\tversion: "0.1.0",
|
|
3807
4041
|
|
|
4042
|
+
\t\tcapabilities: ["content:read"],
|
|
4043
|
+
\t\tstorage: {
|
|
4044
|
+
\t\t\tevents: { indexes: ["createdAt"] },
|
|
4045
|
+
\t\t},
|
|
4046
|
+
|
|
3808
4047
|
\t\thooks: {
|
|
3809
|
-
\t\t\t"content:afterSave": async (event, ctx) => {
|
|
3810
|
-
\t\t\t\
|
|
4048
|
+
\t\t\t"content:afterSave": async (event: ContentHookEvent, ctx: PluginContext) => {
|
|
4049
|
+
\t\t\t\tif (options.enabled === false) return;
|
|
4050
|
+
\t\t\t\tawait ctx.storage.events.put(\`evt_\${Date.now()}\`, {
|
|
3811
4051
|
\t\t\t\t\tcollection: event.collection,
|
|
3812
|
-
\t\t\t\t\
|
|
4052
|
+
\t\t\t\t\tcontentId: event.content.id,
|
|
4053
|
+
\t\t\t\t\tcreatedAt: new Date().toISOString(),
|
|
3813
4054
|
\t\t\t\t});
|
|
3814
4055
|
\t\t\t},
|
|
3815
4056
|
\t\t},
|
|
4057
|
+
|
|
4058
|
+
\t\troutes: {
|
|
4059
|
+
\t\t\trecent: {
|
|
4060
|
+
\t\t\t\thandler: async (ctx: RouteContext) => {
|
|
4061
|
+
\t\t\t\t\tconst result = await ctx.storage.events.query({
|
|
4062
|
+
\t\t\t\t\t\torderBy: { createdAt: "desc" },
|
|
4063
|
+
\t\t\t\t\t\tlimit: 10,
|
|
4064
|
+
\t\t\t\t\t});
|
|
4065
|
+
\t\t\t\t\treturn { events: result.items };
|
|
4066
|
+
\t\t\t\t},
|
|
4067
|
+
\t\t\t},
|
|
4068
|
+
\t\t},
|
|
3816
4069
|
\t});
|
|
3817
4070
|
}
|
|
3818
4071
|
|