dineway 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- 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-DX6X_a82.mjs → api-CgxdfUg4.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-DCvz5gtm.d.mts → bylines--KurdDQK.d.mts} +84 -22
- 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 +337 -102
- 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-B5hJAnKF.d.mts} +17 -16
- 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-ChilE-da.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-CjsyxeBD.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-DzWaHle7.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-D3i4yWRE.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/menus-DS3_5nWY.mjs
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import { t as withTransaction } from "./transaction-x2tJQ-A1.mjs";
|
|
2
|
-
import { ulid } from "ulidx";
|
|
3
|
-
|
|
4
|
-
//#region src/api/handlers/menus.ts
|
|
5
|
-
/**
|
|
6
|
-
* List all menus with item counts.
|
|
7
|
-
*/
|
|
8
|
-
async function handleMenuList(db) {
|
|
9
|
-
try {
|
|
10
|
-
const menus = await db.selectFrom("_dineway_menus").select([
|
|
11
|
-
"id",
|
|
12
|
-
"name",
|
|
13
|
-
"label",
|
|
14
|
-
"created_at",
|
|
15
|
-
"updated_at"
|
|
16
|
-
]).orderBy("name", "asc").execute();
|
|
17
|
-
return {
|
|
18
|
-
success: true,
|
|
19
|
-
data: await Promise.all(menus.map(async (menu) => {
|
|
20
|
-
const { count } = await db.selectFrom("_dineway_menu_items").select(({ fn }) => fn.countAll().as("count")).where("menu_id", "=", menu.id).executeTakeFirstOrThrow();
|
|
21
|
-
return {
|
|
22
|
-
...menu,
|
|
23
|
-
itemCount: count
|
|
24
|
-
};
|
|
25
|
-
}))
|
|
26
|
-
};
|
|
27
|
-
} catch {
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
error: {
|
|
31
|
-
code: "MENU_LIST_ERROR",
|
|
32
|
-
message: "Failed to fetch menus"
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Create a new menu.
|
|
39
|
-
*/
|
|
40
|
-
async function handleMenuCreate(db, input) {
|
|
41
|
-
try {
|
|
42
|
-
if (await db.selectFrom("_dineway_menus").select("id").where("name", "=", input.name).executeTakeFirst()) return {
|
|
43
|
-
success: false,
|
|
44
|
-
error: {
|
|
45
|
-
code: "CONFLICT",
|
|
46
|
-
message: `Menu with name "${input.name}" already exists`
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const id = ulid();
|
|
50
|
-
await db.insertInto("_dineway_menus").values({
|
|
51
|
-
id,
|
|
52
|
-
name: input.name,
|
|
53
|
-
label: input.label
|
|
54
|
-
}).execute();
|
|
55
|
-
return {
|
|
56
|
-
success: true,
|
|
57
|
-
data: await db.selectFrom("_dineway_menus").selectAll().where("id", "=", id).executeTakeFirstOrThrow()
|
|
58
|
-
};
|
|
59
|
-
} catch {
|
|
60
|
-
return {
|
|
61
|
-
success: false,
|
|
62
|
-
error: {
|
|
63
|
-
code: "MENU_CREATE_ERROR",
|
|
64
|
-
message: "Failed to create menu"
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Get a single menu with all its items.
|
|
71
|
-
*/
|
|
72
|
-
async function handleMenuGet(db, name) {
|
|
73
|
-
try {
|
|
74
|
-
const menu = await db.selectFrom("_dineway_menus").selectAll().where("name", "=", name).executeTakeFirst();
|
|
75
|
-
if (!menu) return {
|
|
76
|
-
success: false,
|
|
77
|
-
error: {
|
|
78
|
-
code: "NOT_FOUND",
|
|
79
|
-
message: "Menu not found"
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const items = await db.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", menu.id).orderBy("sort_order", "asc").execute();
|
|
83
|
-
return {
|
|
84
|
-
success: true,
|
|
85
|
-
data: {
|
|
86
|
-
...menu,
|
|
87
|
-
items
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
} catch {
|
|
91
|
-
return {
|
|
92
|
-
success: false,
|
|
93
|
-
error: {
|
|
94
|
-
code: "MENU_GET_ERROR",
|
|
95
|
-
message: "Failed to fetch menu"
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Update a menu's metadata.
|
|
102
|
-
*/
|
|
103
|
-
async function handleMenuUpdate(db, name, input) {
|
|
104
|
-
try {
|
|
105
|
-
const menu = await db.selectFrom("_dineway_menus").select("id").where("name", "=", name).executeTakeFirst();
|
|
106
|
-
if (!menu) return {
|
|
107
|
-
success: false,
|
|
108
|
-
error: {
|
|
109
|
-
code: "NOT_FOUND",
|
|
110
|
-
message: "Menu not found"
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
if (input.label) await db.updateTable("_dineway_menus").set({ label: input.label }).where("id", "=", menu.id).execute();
|
|
114
|
-
return {
|
|
115
|
-
success: true,
|
|
116
|
-
data: await db.selectFrom("_dineway_menus").selectAll().where("id", "=", menu.id).executeTakeFirstOrThrow()
|
|
117
|
-
};
|
|
118
|
-
} catch {
|
|
119
|
-
return {
|
|
120
|
-
success: false,
|
|
121
|
-
error: {
|
|
122
|
-
code: "MENU_UPDATE_ERROR",
|
|
123
|
-
message: "Failed to update menu"
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Delete a menu and its items (cascade).
|
|
130
|
-
*/
|
|
131
|
-
async function handleMenuDelete(db, name) {
|
|
132
|
-
try {
|
|
133
|
-
const menu = await db.selectFrom("_dineway_menus").select("id").where("name", "=", name).executeTakeFirst();
|
|
134
|
-
if (!menu) return {
|
|
135
|
-
success: false,
|
|
136
|
-
error: {
|
|
137
|
-
code: "NOT_FOUND",
|
|
138
|
-
message: "Menu not found"
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
await db.deleteFrom("_dineway_menus").where("id", "=", menu.id).execute();
|
|
142
|
-
return {
|
|
143
|
-
success: true,
|
|
144
|
-
data: { deleted: true }
|
|
145
|
-
};
|
|
146
|
-
} catch {
|
|
147
|
-
return {
|
|
148
|
-
success: false,
|
|
149
|
-
error: {
|
|
150
|
-
code: "MENU_DELETE_ERROR",
|
|
151
|
-
message: "Failed to delete menu"
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Add an item to a menu.
|
|
158
|
-
*/
|
|
159
|
-
async function handleMenuItemCreate(db, menuName, input) {
|
|
160
|
-
try {
|
|
161
|
-
const menu = await db.selectFrom("_dineway_menus").select("id").where("name", "=", menuName).executeTakeFirst();
|
|
162
|
-
if (!menu) return {
|
|
163
|
-
success: false,
|
|
164
|
-
error: {
|
|
165
|
-
code: "NOT_FOUND",
|
|
166
|
-
message: "Menu not found"
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
let sortOrder = input.sortOrder ?? 0;
|
|
170
|
-
if (input.sortOrder === void 0) sortOrder = ((await db.selectFrom("_dineway_menu_items").select(({ fn }) => fn.max("sort_order").as("max")).where("menu_id", "=", menu.id).where("parent_id", "is", input.parentId ?? null).executeTakeFirst())?.max ?? -1) + 1;
|
|
171
|
-
const id = ulid();
|
|
172
|
-
await db.insertInto("_dineway_menu_items").values({
|
|
173
|
-
id,
|
|
174
|
-
menu_id: menu.id,
|
|
175
|
-
parent_id: input.parentId ?? null,
|
|
176
|
-
sort_order: sortOrder,
|
|
177
|
-
type: input.type,
|
|
178
|
-
reference_collection: input.referenceCollection ?? null,
|
|
179
|
-
reference_id: input.referenceId ?? null,
|
|
180
|
-
custom_url: input.customUrl ?? null,
|
|
181
|
-
label: input.label,
|
|
182
|
-
title_attr: input.titleAttr ?? null,
|
|
183
|
-
target: input.target ?? null,
|
|
184
|
-
css_classes: input.cssClasses ?? null
|
|
185
|
-
}).execute();
|
|
186
|
-
return {
|
|
187
|
-
success: true,
|
|
188
|
-
data: await db.selectFrom("_dineway_menu_items").selectAll().where("id", "=", id).executeTakeFirstOrThrow()
|
|
189
|
-
};
|
|
190
|
-
} catch {
|
|
191
|
-
return {
|
|
192
|
-
success: false,
|
|
193
|
-
error: {
|
|
194
|
-
code: "MENU_ITEM_CREATE_ERROR",
|
|
195
|
-
message: "Failed to create menu item"
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Update a menu item.
|
|
202
|
-
*/
|
|
203
|
-
async function handleMenuItemUpdate(db, menuName, itemId, input) {
|
|
204
|
-
try {
|
|
205
|
-
const menu = await db.selectFrom("_dineway_menus").select("id").where("name", "=", menuName).executeTakeFirst();
|
|
206
|
-
if (!menu) return {
|
|
207
|
-
success: false,
|
|
208
|
-
error: {
|
|
209
|
-
code: "NOT_FOUND",
|
|
210
|
-
message: "Menu not found"
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
if (!await db.selectFrom("_dineway_menu_items").select("id").where("id", "=", itemId).where("menu_id", "=", menu.id).executeTakeFirst()) return {
|
|
214
|
-
success: false,
|
|
215
|
-
error: {
|
|
216
|
-
code: "NOT_FOUND",
|
|
217
|
-
message: "Menu item not found"
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
const updates = {};
|
|
221
|
-
if (input.label !== void 0) updates.label = input.label;
|
|
222
|
-
if (input.customUrl !== void 0) updates.custom_url = input.customUrl;
|
|
223
|
-
if (input.target !== void 0) updates.target = input.target;
|
|
224
|
-
if (input.titleAttr !== void 0) updates.title_attr = input.titleAttr;
|
|
225
|
-
if (input.cssClasses !== void 0) updates.css_classes = input.cssClasses;
|
|
226
|
-
if (input.parentId !== void 0) updates.parent_id = input.parentId;
|
|
227
|
-
if (input.sortOrder !== void 0) updates.sort_order = input.sortOrder;
|
|
228
|
-
if (Object.keys(updates).length > 0) await db.updateTable("_dineway_menu_items").set(updates).where("id", "=", itemId).execute();
|
|
229
|
-
return {
|
|
230
|
-
success: true,
|
|
231
|
-
data: await db.selectFrom("_dineway_menu_items").selectAll().where("id", "=", itemId).executeTakeFirstOrThrow()
|
|
232
|
-
};
|
|
233
|
-
} catch {
|
|
234
|
-
return {
|
|
235
|
-
success: false,
|
|
236
|
-
error: {
|
|
237
|
-
code: "MENU_ITEM_UPDATE_ERROR",
|
|
238
|
-
message: "Failed to update menu item"
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Delete a menu item.
|
|
245
|
-
*/
|
|
246
|
-
async function handleMenuItemDelete(db, menuName, itemId) {
|
|
247
|
-
try {
|
|
248
|
-
const menu = await db.selectFrom("_dineway_menus").select("id").where("name", "=", menuName).executeTakeFirst();
|
|
249
|
-
if (!menu) return {
|
|
250
|
-
success: false,
|
|
251
|
-
error: {
|
|
252
|
-
code: "NOT_FOUND",
|
|
253
|
-
message: "Menu not found"
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
if ((await db.deleteFrom("_dineway_menu_items").where("id", "=", itemId).where("menu_id", "=", menu.id).execute())[0]?.numDeletedRows === 0n) return {
|
|
257
|
-
success: false,
|
|
258
|
-
error: {
|
|
259
|
-
code: "NOT_FOUND",
|
|
260
|
-
message: "Menu item not found"
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
return {
|
|
264
|
-
success: true,
|
|
265
|
-
data: { deleted: true }
|
|
266
|
-
};
|
|
267
|
-
} catch {
|
|
268
|
-
return {
|
|
269
|
-
success: false,
|
|
270
|
-
error: {
|
|
271
|
-
code: "MENU_ITEM_DELETE_ERROR",
|
|
272
|
-
message: "Failed to delete menu item"
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Batch reorder menu items.
|
|
279
|
-
*/
|
|
280
|
-
async function handleMenuItemReorder(db, menuName, items) {
|
|
281
|
-
try {
|
|
282
|
-
const menu = await db.selectFrom("_dineway_menus").select("id").where("name", "=", menuName).executeTakeFirst();
|
|
283
|
-
if (!menu) return {
|
|
284
|
-
success: false,
|
|
285
|
-
error: {
|
|
286
|
-
code: "NOT_FOUND",
|
|
287
|
-
message: "Menu not found"
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
return {
|
|
291
|
-
success: true,
|
|
292
|
-
data: await withTransaction(db, async (trx) => {
|
|
293
|
-
for (const item of items) await trx.updateTable("_dineway_menu_items").set({
|
|
294
|
-
parent_id: item.parentId,
|
|
295
|
-
sort_order: item.sortOrder
|
|
296
|
-
}).where("id", "=", item.id).where("menu_id", "=", menu.id).execute();
|
|
297
|
-
return trx.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", menu.id).orderBy("sort_order", "asc").execute();
|
|
298
|
-
})
|
|
299
|
-
};
|
|
300
|
-
} catch {
|
|
301
|
-
return {
|
|
302
|
-
success: false,
|
|
303
|
-
error: {
|
|
304
|
-
code: "MENU_REORDER_ERROR",
|
|
305
|
-
message: "Failed to reorder menu items"
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
//#endregion
|
|
312
|
-
export { handleMenuItemDelete as a, handleMenuList as c, handleMenuItemCreate as i, handleMenuUpdate as l, handleMenuDelete as n, handleMenuItemReorder as o, handleMenuGet as r, handleMenuItemUpdate as s, handleMenuCreate as t };
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-ClPoSABd.mjs";
|
|
2
|
-
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-D_jVet6z.mjs";
|
|
3
|
-
import { r as getDb } from "./loader-PZnPxFLc.mjs";
|
|
4
|
-
import { n as requestCached, r as setRequestCacheEntry, t as peekRequestCache } from "./request-cache-DHMRr2Lf.mjs";
|
|
5
|
-
import { t as isMissingTableError } from "./db-errors-DyZkswzF.mjs";
|
|
6
|
-
|
|
7
|
-
//#region src/taxonomies/index.ts
|
|
8
|
-
/**
|
|
9
|
-
* Runtime API for taxonomies
|
|
10
|
-
*
|
|
11
|
-
* Provides functions to query taxonomy definitions and terms.
|
|
12
|
-
*/
|
|
13
|
-
var taxonomies_exports = /* @__PURE__ */ __exportAll({
|
|
14
|
-
getAllTermsForEntries: () => getAllTermsForEntries,
|
|
15
|
-
getEntriesByTerm: () => getEntriesByTerm,
|
|
16
|
-
getEntryTerms: () => getEntryTerms,
|
|
17
|
-
getTaxonomyDef: () => getTaxonomyDef,
|
|
18
|
-
getTaxonomyDefs: () => getTaxonomyDefs,
|
|
19
|
-
getTaxonomyTerms: () => getTaxonomyTerms,
|
|
20
|
-
getTerm: () => getTerm,
|
|
21
|
-
getTermsForEntries: () => getTermsForEntries,
|
|
22
|
-
invalidateTermCache: () => invalidateTermCache
|
|
23
|
-
});
|
|
24
|
-
function invalidateTermCache() {}
|
|
25
|
-
/**
|
|
26
|
-
* Get all taxonomy definitions
|
|
27
|
-
*/
|
|
28
|
-
async function getTaxonomyDefs() {
|
|
29
|
-
return requestCached("taxonomy-defs:all", async () => {
|
|
30
|
-
return (await (await getDb()).selectFrom("_dineway_taxonomy_defs").selectAll().execute()).map((row) => ({
|
|
31
|
-
id: row.id,
|
|
32
|
-
name: row.name,
|
|
33
|
-
label: row.label,
|
|
34
|
-
labelSingular: row.label_singular ?? void 0,
|
|
35
|
-
hierarchical: row.hierarchical === 1,
|
|
36
|
-
collections: row.collections ? JSON.parse(row.collections) : []
|
|
37
|
-
}));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get a single taxonomy definition by name
|
|
42
|
-
*/
|
|
43
|
-
async function getTaxonomyDef(name) {
|
|
44
|
-
const allDefs = peekRequestCache("taxonomy-defs:all");
|
|
45
|
-
if (allDefs) return (await allDefs).find((def) => def.name === name) ?? null;
|
|
46
|
-
return requestCached(`taxonomy-def:${name}`, async () => {
|
|
47
|
-
const row = await (await getDb()).selectFrom("_dineway_taxonomy_defs").selectAll().where("name", "=", name).executeTakeFirst();
|
|
48
|
-
if (!row) return null;
|
|
49
|
-
return {
|
|
50
|
-
id: row.id,
|
|
51
|
-
name: row.name,
|
|
52
|
-
label: row.label,
|
|
53
|
-
labelSingular: row.label_singular ?? void 0,
|
|
54
|
-
hierarchical: row.hierarchical === 1,
|
|
55
|
-
collections: row.collections ? JSON.parse(row.collections) : []
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Get all terms for a taxonomy (as tree for hierarchical, flat for tags)
|
|
61
|
-
*/
|
|
62
|
-
async function getTaxonomyTerms(taxonomyName) {
|
|
63
|
-
return requestCached(`taxonomy-terms:${taxonomyName}`, async () => {
|
|
64
|
-
const db = await getDb();
|
|
65
|
-
const def = await getTaxonomyDef(taxonomyName);
|
|
66
|
-
if (!def) return [];
|
|
67
|
-
const rows = await db.selectFrom("taxonomies").selectAll().where("name", "=", taxonomyName).orderBy("label", "asc").execute();
|
|
68
|
-
const countsResult = await db.selectFrom("content_taxonomies").select(["taxonomy_id"]).select((eb) => eb.fn.count("entry_id").as("count")).groupBy("taxonomy_id").execute();
|
|
69
|
-
const counts = /* @__PURE__ */ new Map();
|
|
70
|
-
for (const row of countsResult) counts.set(row.taxonomy_id, row.count);
|
|
71
|
-
const flatTerms = rows.map((row) => ({
|
|
72
|
-
id: row.id,
|
|
73
|
-
name: row.name,
|
|
74
|
-
slug: row.slug,
|
|
75
|
-
label: row.label,
|
|
76
|
-
parent_id: row.parent_id,
|
|
77
|
-
data: row.data
|
|
78
|
-
}));
|
|
79
|
-
if (def.hierarchical) return buildTree(flatTerms, counts);
|
|
80
|
-
return flatTerms.map((term) => ({
|
|
81
|
-
id: term.id,
|
|
82
|
-
name: term.name,
|
|
83
|
-
slug: term.slug,
|
|
84
|
-
label: term.label,
|
|
85
|
-
children: [],
|
|
86
|
-
count: counts.get(term.id) ?? 0
|
|
87
|
-
}));
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Get a single term by taxonomy and slug
|
|
92
|
-
*/
|
|
93
|
-
async function getTerm(taxonomyName, slug) {
|
|
94
|
-
const db = await getDb();
|
|
95
|
-
const row = await db.selectFrom("taxonomies").selectAll().where("name", "=", taxonomyName).where("slug", "=", slug).executeTakeFirst();
|
|
96
|
-
if (!row) return null;
|
|
97
|
-
const count = (await db.selectFrom("content_taxonomies").select((eb) => eb.fn.count("entry_id").as("count")).where("taxonomy_id", "=", row.id).executeTakeFirst())?.count ?? 0;
|
|
98
|
-
const children = (await db.selectFrom("taxonomies").selectAll().where("parent_id", "=", row.id).orderBy("label", "asc").execute()).map((child) => ({
|
|
99
|
-
id: child.id,
|
|
100
|
-
name: child.name,
|
|
101
|
-
slug: child.slug,
|
|
102
|
-
label: child.label,
|
|
103
|
-
parentId: child.parent_id ?? void 0,
|
|
104
|
-
children: []
|
|
105
|
-
}));
|
|
106
|
-
return {
|
|
107
|
-
id: row.id,
|
|
108
|
-
name: row.name,
|
|
109
|
-
slug: row.slug,
|
|
110
|
-
label: row.label,
|
|
111
|
-
parentId: row.parent_id ?? void 0,
|
|
112
|
-
description: row.data ? JSON.parse(row.data).description : void 0,
|
|
113
|
-
children,
|
|
114
|
-
count
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Get terms assigned to an entry
|
|
119
|
-
*/
|
|
120
|
-
function getEntryTerms(collection, entryId, taxonomyName) {
|
|
121
|
-
return requestCached(`terms:${collection}:${entryId}:${taxonomyName ?? "*"}`, async () => {
|
|
122
|
-
let query = (await getDb()).selectFrom("content_taxonomies").innerJoin("taxonomies", "taxonomies.id", "content_taxonomies.taxonomy_id").selectAll("taxonomies").where("content_taxonomies.collection", "=", collection).where("content_taxonomies.entry_id", "=", entryId);
|
|
123
|
-
if (taxonomyName) query = query.where("taxonomies.name", "=", taxonomyName);
|
|
124
|
-
return (await query.execute()).map((row) => ({
|
|
125
|
-
id: row.id,
|
|
126
|
-
name: row.name,
|
|
127
|
-
slug: row.slug,
|
|
128
|
-
label: row.label,
|
|
129
|
-
parentId: row.parent_id ?? void 0,
|
|
130
|
-
children: []
|
|
131
|
-
}));
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Get terms for multiple entries in a single query (batched API)
|
|
136
|
-
*
|
|
137
|
-
* This is more efficient than calling getEntryTerms for each entry
|
|
138
|
-
* when you need terms for a list of entries.
|
|
139
|
-
*
|
|
140
|
-
* @param collection - The collection type (e.g., "posts")
|
|
141
|
-
* @param entryIds - Array of entry IDs
|
|
142
|
-
* @param taxonomyName - The taxonomy name (e.g., "categories")
|
|
143
|
-
* @returns Map from entry ID to array of terms
|
|
144
|
-
*/
|
|
145
|
-
async function getTermsForEntries(collection, entryIds, taxonomyName) {
|
|
146
|
-
const result = /* @__PURE__ */ new Map();
|
|
147
|
-
const uniqueIds = [...new Set(entryIds)];
|
|
148
|
-
for (const id of uniqueIds) result.set(id, []);
|
|
149
|
-
if (uniqueIds.length === 0) return result;
|
|
150
|
-
const db = await getDb();
|
|
151
|
-
for (const chunk of chunks(uniqueIds, SQL_BATCH_SIZE)) {
|
|
152
|
-
let rows;
|
|
153
|
-
try {
|
|
154
|
-
rows = await db.selectFrom("content_taxonomies").innerJoin("taxonomies", "taxonomies.id", "content_taxonomies.taxonomy_id").select([
|
|
155
|
-
"content_taxonomies.entry_id",
|
|
156
|
-
"taxonomies.id",
|
|
157
|
-
"taxonomies.name",
|
|
158
|
-
"taxonomies.slug",
|
|
159
|
-
"taxonomies.label",
|
|
160
|
-
"taxonomies.parent_id"
|
|
161
|
-
]).where("content_taxonomies.collection", "=", collection).where("content_taxonomies.entry_id", "in", chunk).where("taxonomies.name", "=", taxonomyName).execute();
|
|
162
|
-
} catch (error) {
|
|
163
|
-
if (isMissingTableError(error)) return result;
|
|
164
|
-
throw error;
|
|
165
|
-
}
|
|
166
|
-
for (const row of rows) {
|
|
167
|
-
const entryId = row.entry_id;
|
|
168
|
-
const term = {
|
|
169
|
-
id: row.id,
|
|
170
|
-
name: row.name,
|
|
171
|
-
slug: row.slug,
|
|
172
|
-
label: row.label,
|
|
173
|
-
parentId: row.parent_id ?? void 0,
|
|
174
|
-
children: []
|
|
175
|
-
};
|
|
176
|
-
const terms = result.get(entryId);
|
|
177
|
-
if (terms) terms.push(term);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return result;
|
|
181
|
-
}
|
|
182
|
-
async function getAllTermsForEntries(collection, entryIds) {
|
|
183
|
-
const result = /* @__PURE__ */ new Map();
|
|
184
|
-
const uniqueIds = [...new Set(entryIds)];
|
|
185
|
-
for (const id of uniqueIds) result.set(id, {});
|
|
186
|
-
if (uniqueIds.length === 0) return result;
|
|
187
|
-
const db = await getDb();
|
|
188
|
-
const applicableTaxonomyNames = await getCollectionTaxonomyNames(collection);
|
|
189
|
-
for (const chunk of chunks(uniqueIds, SQL_BATCH_SIZE)) {
|
|
190
|
-
let rows;
|
|
191
|
-
try {
|
|
192
|
-
rows = await db.selectFrom("content_taxonomies").innerJoin("taxonomies", "taxonomies.id", "content_taxonomies.taxonomy_id").select([
|
|
193
|
-
"content_taxonomies.entry_id",
|
|
194
|
-
"taxonomies.id",
|
|
195
|
-
"taxonomies.name",
|
|
196
|
-
"taxonomies.slug",
|
|
197
|
-
"taxonomies.label",
|
|
198
|
-
"taxonomies.parent_id"
|
|
199
|
-
]).where("content_taxonomies.collection", "=", collection).where("content_taxonomies.entry_id", "in", chunk).orderBy("taxonomies.label", "asc").execute();
|
|
200
|
-
} catch (error) {
|
|
201
|
-
if (isMissingTableError(error)) {
|
|
202
|
-
for (const id of uniqueIds) primeEntryTermsCache(collection, id, {}, applicableTaxonomyNames);
|
|
203
|
-
return result;
|
|
204
|
-
}
|
|
205
|
-
throw error;
|
|
206
|
-
}
|
|
207
|
-
for (const row of rows) {
|
|
208
|
-
const entryId = row.entry_id;
|
|
209
|
-
const term = {
|
|
210
|
-
id: row.id,
|
|
211
|
-
name: row.name,
|
|
212
|
-
slug: row.slug,
|
|
213
|
-
label: row.label,
|
|
214
|
-
parentId: row.parent_id ?? void 0,
|
|
215
|
-
children: []
|
|
216
|
-
};
|
|
217
|
-
const byTaxonomy = result.get(entryId);
|
|
218
|
-
if (!byTaxonomy) continue;
|
|
219
|
-
const existing = byTaxonomy[row.name];
|
|
220
|
-
if (existing) existing.push(term);
|
|
221
|
-
else byTaxonomy[row.name] = [term];
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
for (const [entryId, byTaxonomy] of result) primeEntryTermsCache(collection, entryId, byTaxonomy, applicableTaxonomyNames);
|
|
225
|
-
return result;
|
|
226
|
-
}
|
|
227
|
-
async function getCollectionTaxonomyNames(collection) {
|
|
228
|
-
try {
|
|
229
|
-
return (await getTaxonomyDefs()).filter((def) => def.collections.includes(collection)).map((def) => def.name);
|
|
230
|
-
} catch (error) {
|
|
231
|
-
if (isMissingTableError(error)) return [];
|
|
232
|
-
throw error;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
function primeEntryTermsCache(collection, entryId, byTaxonomy, applicableTaxonomyNames) {
|
|
236
|
-
for (const name of applicableTaxonomyNames) setRequestCacheEntry(`terms:${collection}:${entryId}:${name}`, byTaxonomy[name] ?? []);
|
|
237
|
-
for (const [name, terms] of Object.entries(byTaxonomy)) setRequestCacheEntry(`terms:${collection}:${entryId}:${name}`, terms);
|
|
238
|
-
setRequestCacheEntry(`terms:${collection}:${entryId}:*`, Object.values(byTaxonomy).flat());
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Get entries by term (wraps getDinewayCollection)
|
|
242
|
-
*/
|
|
243
|
-
async function getEntriesByTerm(collection, taxonomyName, termSlug) {
|
|
244
|
-
const { getDinewayCollection } = await import("./query-B9BO5goQ.mjs").then((n) => n.o);
|
|
245
|
-
const { entries } = await getDinewayCollection(collection, { where: { [taxonomyName]: termSlug } });
|
|
246
|
-
return entries;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Build tree structure from flat terms
|
|
250
|
-
*/
|
|
251
|
-
function buildTree(flatTerms, counts) {
|
|
252
|
-
const map = /* @__PURE__ */ new Map();
|
|
253
|
-
const roots = [];
|
|
254
|
-
for (const term of flatTerms) map.set(term.id, {
|
|
255
|
-
id: term.id,
|
|
256
|
-
name: term.name,
|
|
257
|
-
slug: term.slug,
|
|
258
|
-
label: term.label,
|
|
259
|
-
parentId: term.parent_id ?? void 0,
|
|
260
|
-
description: term.data ? JSON.parse(term.data).description : void 0,
|
|
261
|
-
children: [],
|
|
262
|
-
count: counts.get(term.id) ?? 0
|
|
263
|
-
});
|
|
264
|
-
for (const term of map.values()) if (term.parentId && map.has(term.parentId)) map.get(term.parentId).children.push(term);
|
|
265
|
-
else roots.push(term);
|
|
266
|
-
return roots;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
//#endregion
|
|
270
|
-
export { getTaxonomyTerms as a, invalidateTermCache as c, getTaxonomyDefs as i, taxonomies_exports as l, getEntryTerms as n, getTerm as o, getTaxonomyDef as r, getTermsForEntries as s, getEntriesByTerm as t };
|