dineway 0.2.0 → 0.2.1
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-DUaz_w7p.mjs +79 -0
- package/dist/{activity-events-y6eT8UW6.mjs → activity-events-CJDvE2uc.mjs} +1 -77
- package/dist/{actor-CrObAPV0.mjs → actor-0QJ1Gbtf.mjs} +1 -1
- package/dist/{allowed-origins-_oeyP6x-.mjs → allowed-origins--OwHHiY8.mjs} +1 -1
- package/dist/api/route-utils.d.mts +9 -10
- package/dist/api/route-utils.mjs +14 -14
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/{api-ByrU2q-Z.mjs → api-B4PHIF4V.mjs} +51 -23
- package/dist/{api-tokens-CjVMQT-X.mjs → api-tokens-tbK_sORH.mjs} +1 -1
- package/dist/{apply-bZswmZPm.mjs → apply-DjTqq6Ae.mjs} +19 -19
- package/dist/astro/index.d.mts +10 -11
- package/dist/astro/index.mjs +10 -5
- package/dist/astro/middleware/auth.d.mts +9 -19
- package/dist/astro/middleware/auth.mjs +6 -6
- package/dist/astro/middleware/redirect.mjs +5 -5
- package/dist/astro/middleware/request-context.mjs +2 -2
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +140 -98
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
- 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 +18 -18
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +16 -16
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +16 -16
- package/dist/astro/routes/api/admin/bylines/index.mjs +16 -16
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +25 -24
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +25 -24
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +30 -29
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +30 -29
- package/dist/astro/routes/api/admin/context/diff.mjs +29 -28
- package/dist/astro/routes/api/admin/context/index.mjs +30 -29
- package/dist/astro/routes/api/admin/context/stale.mjs +29 -28
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +25 -24
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +29 -28
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +29 -28
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +26 -25
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
- 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 +52 -51
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +52 -51
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +44 -44
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +51 -50
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +51 -50
- package/dist/astro/routes/api/admin/plugins/index.mjs +44 -44
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +44 -44
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +51 -50
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +44 -44
- package/dist/astro/routes/api/admin/plugins/updates.mjs +44 -44
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +30 -65
- package/dist/astro/routes/api/admin/review-requests/index.d.mts +2 -1
- package/dist/astro/routes/api/admin/review-requests/index.mjs +58 -11
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +44 -44
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +44 -44
- 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 +7 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +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 +8 -8
- 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 +6 -6
- 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/setup-token/index.mjs +5 -5
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- 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 +13 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +49 -21
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +67 -33
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +14 -14
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- 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 +19 -19
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +8 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +35 -34
- package/dist/astro/routes/api/import/wordpress/media.d.mts +8 -9
- package/dist/astro/routes/api/import/wordpress/media.mjs +12 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +34 -33
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +9 -10
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +31 -30
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +22 -22
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +8 -9
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +40 -39
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +554 -167
- package/dist/astro/routes/api/media/_id_/confirm.mjs +10 -10
- package/dist/astro/routes/api/media/_id_.mjs +8 -8
- 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 -11
- package/dist/astro/routes/api/media.mjs +14 -14
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_/items.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_/translations.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_.mjs +30 -29
- package/dist/astro/routes/api/menus/index.mjs +30 -29
- 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 +4 -4
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +20 -5
- package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +31 -30
- package/dist/astro/routes/api/redirects/index.mjs +31 -30
- 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 +46 -45
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +46 -45
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +46 -45
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +46 -45
- package/dist/astro/routes/api/schema/collections/index.mjs +46 -45
- package/dist/astro/routes/api/schema/index.mjs +8 -8
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +44 -44
- package/dist/astro/routes/api/schema/orphans/index.mjs +44 -44
- package/dist/astro/routes/api/search/enable.mjs +11 -11
- package/dist/astro/routes/api/search/index.mjs +10 -10
- package/dist/astro/routes/api/search/rebuild.mjs +11 -11
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +10 -10
- package/dist/astro/routes/api/sections/_slug_.mjs +30 -29
- package/dist/astro/routes/api/sections/index.mjs +30 -29
- package/dist/astro/routes/api/settings/email.mjs +3 -3
- package/dist/astro/routes/api/settings.mjs +30 -29
- 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 +1 -1
- package/dist/astro/routes/api/setup/index.mjs +27 -27
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +33 -32
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +33 -32
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +33 -32
- package/dist/astro/routes/api/taxonomies/index.mjs +33 -32
- package/dist/astro/routes/api/themes/preview.mjs +4 -4
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- 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 -28
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +30 -29
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +30 -29
- package/dist/astro/routes/api/widget-areas/_name_.mjs +27 -26
- package/dist/astro/routes/api/widget-areas/index.mjs +30 -29
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +2 -2
- package/dist/astro/types.d.mts +13 -12
- package/dist/{audit-ByVKIwWF.mjs → audit-B2pRxZ20.mjs} +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-CqeUmQsv.mjs → auth-control-guard-D71jourk.mjs} +1 -1
- package/dist/{authorize-CcBxcHtz.mjs → authorize-ZXPGPwKn.mjs} +1 -1
- package/dist/{briefing-CawZ59CY.mjs → briefing-0rf-su3-.mjs} +7 -7
- package/dist/{briefing-BJaJI8dm.mjs → briefing-kRhegBoF.mjs} +1 -1
- package/dist/{bundle-7C_DpkEq.mjs → bundle-CEcdUa1s.mjs} +2 -2
- package/dist/{byline-e51-fWRs.mjs → byline-7xR185Ly.mjs} +6 -6
- package/dist/{byline-fields-D-N5qVIG.mjs → byline-fields-BKzA0fJU.mjs} +1 -1
- package/dist/{byline-fields-CUvbslGc.d.mts → byline-fields-Ckeqd1OY.d.mts} +57 -47
- package/dist/{byline-fields-DOJO16Gm.mjs → byline-fields-WN7RQT4q.mjs} +10 -4
- package/dist/{byline-registry-87nNnYl4.mjs → byline-registry-Ba54M74c.mjs} +2 -2
- package/dist/{bylines-CMQNCNFh.mjs → bylines-C-EL6dh3.mjs} +3 -3
- package/dist/{bylines-y4LO-dTj.mjs → bylines-CmZFCMr0.mjs} +5 -5
- package/dist/{cache-C-FNTFYK.mjs → cache-DkVCKGio.mjs} +2 -2
- package/dist/{chunks-CxBt-GxR.mjs → chunks-ChGNDY8r.mjs} +1 -1
- package/dist/cli/index.d.mts +29 -1
- package/dist/cli/index.mjs +1391 -1123
- package/dist/cli/plugin-kit.d.mts +75 -0
- package/dist/cli/plugin-kit.mjs +4 -0
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +27 -52
- package/dist/client/index.mjs +34 -7
- package/dist/client-factory-BDD9azPJ.mjs +233 -0
- package/dist/{comment-DlA4iChg.mjs → comment-DFALgsJD.mjs} +1 -1
- package/dist/{comment-reaction-DfFao1ST.mjs → comment-reaction-C37bf99u.mjs} +1 -1
- package/dist/{comments-DApFGMsP.mjs → comments-B3NwDBxl.mjs} +1 -1
- package/dist/{content-Bh4BDjv8.mjs → content-DJcAYFhz.mjs} +2 -2
- package/dist/{content-refresh-CgutSUfO.mjs → content-refresh-B4ZCmxgd.mjs} +5 -5
- package/dist/{context-CK4ym2Sf.mjs → context-DnpXcp6Y.mjs} +2 -2
- package/dist/{context-C5W3G18y.mjs → context-fSCYLL3c.mjs} +24 -13
- package/dist/{context-route-helpers-MASyGgWf.mjs → context-route-helpers-CI8XzcsK.mjs} +2 -2
- package/dist/{dashboard-DQkVT7Ei.mjs → dashboard-D0nj5oWg.mjs} +4 -4
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{device-flow-BnqRH-T9.mjs → device-flow-BJe6VEhP.mjs} +5 -5
- package/dist/{enrich-DIFIFA8O.mjs → enrich-Ck9tfMqe.mjs} +1 -1
- package/dist/{experimental-workflows-BMsUnIAw.mjs → experimental-workflows-GVhUgzEs.mjs} +1 -1
- package/dist/{field-defs-cache-DRNdhBJv.mjs → field-defs-cache-DL-T2XVS.mjs} +4 -4
- package/dist/forgeway-seo-client-G5ddhVHd.mjs +456 -0
- package/dist/{fts-manager-Crzypjqu.mjs → fts-manager-ewTGohf4.mjs} +1 -1
- package/dist/{hitl-requests-B4Vbcmaq.mjs → hitl-requests-DEFj8e6u.mjs} +2 -2
- package/dist/{hitl-route-helpers-hEVzvP8l.mjs → hitl-route-helpers-C23JHaWz.mjs} +5 -5
- package/dist/{import-Bh9biJfx.mjs → import-CXXL5pip.mjs} +7 -7
- package/dist/{index-D4y6NGiy.d.mts → index-DcnOCD1e.d.mts} +79 -3
- package/dist/index.d.mts +15 -17
- package/dist/index.mjs +81 -78
- package/dist/{jsonld-Dq0gsnOH.d.mts → jsonld-DzKbhRZ4.d.mts} +2 -2
- package/dist/{load-DmYeniXl.mjs → load-CFtJRT3c.mjs} +1 -1
- package/dist/{loader-CjWqjweO.mjs → loader-aWkkc1_o.mjs} +2 -2
- package/dist/{manifest-schema-BxVPYMJR.mjs → manifest-schema-uA6pRFXi.mjs} +6 -2
- package/dist/{mcp-reviewed-executor-TwVbMzG6.mjs → mcp-reviewed-executor-Dn52L_yY.mjs} +6 -3
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +10 -11
- package/dist/media/local-runtime.mjs +2 -2
- package/dist/{media-DMj0grzC.mjs → media-CVMOoywq.mjs} +1 -1
- package/dist/{media-allowlist-BlVCSzHx.mjs → media-allowlist-zDNJmXCo.mjs} +1 -1
- package/dist/{menus-xvsnVZXw.mjs → menus-CCG2z5um.mjs} +6 -6
- package/dist/{menus-TaW1gKnk.mjs → menus-CmyIkRG5.mjs} +2 -2
- package/dist/{oauth-authorization-DiaGvRVz.mjs → oauth-authorization-B9H7X85L.mjs} +5 -5
- package/dist/{oauth-clients-Dl9E8dEM.mjs → oauth-clients-Dwl32-Uj.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/output-DhBe5_Pi.mjs +68 -0
- package/dist/page/index.d.mts +9 -3
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-CbymENaR.mjs → parse-i15EFSAE.mjs} +1 -1
- package/dist/plugin-utils.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +3 -1
- package/dist/{plugins-BolVa-tl.mjs → plugins-CPA2PtfY.mjs} +95 -10
- package/dist/portable-text-E79LyjGo.d.mts +45 -0
- package/dist/{preview-vSVg6fwG.mjs → preview-BjedZm8G.mjs} +2 -2
- package/dist/project-env-DKibmuP8.mjs +95 -0
- package/dist/{provider-loader-MD8zAbnH.d.mts → provider-loader-DC2JdWeO.d.mts} +1 -1
- package/dist/{public-url-gsp3oUbu.d.mts → public-url-DQJCnYi9.d.mts} +1 -1
- package/dist/publication-authorization-RKiHXKtq.mjs +985 -0
- package/dist/{query-jaAmw8E1.mjs → query-C2U5u5_p.mjs} +3 -3
- package/dist/{query-CfRCdaL3.mjs → query-DEv5x6yB.mjs} +13 -13
- package/dist/{rate-limit-ZLdyWoZF.mjs → rate-limit-DglsAJSw.mjs} +2 -2
- package/dist/{redirect-BAjt4Z6b.mjs → redirect-ubhEqQCQ.mjs} +2 -2
- package/dist/{redirects-CA-xylPG.mjs → redirects-Bhpm8bRe.mjs} +18 -10
- package/dist/{redirects-BTdwpQtE.mjs → redirects-xs2yahLq.mjs} +4 -4
- package/dist/{registry-CtyVedcN.mjs → registry-BYYyb2tF.mjs} +24 -10
- package/dist/{request-meta-CUypToDJ.mjs → request-meta-CFe1tW2M.mjs} +1 -1
- package/dist/review-payload-BysRWpxS.mjs +111 -0
- package/dist/{review-requests-DUyEmtmG.mjs → review-requests-CTWGnWUt.mjs} +1 -1
- package/dist/review-requests-D42VEP1l.mjs +142 -0
- package/dist/review-route-helpers-C31vO6SI.mjs +41 -0
- package/dist/{runner-DB7CRfOF.mjs → runner-BgmttQmD.mjs} +1151 -447
- package/dist/{runner-1tC2tIRV.d.mts → runner-D6hzs8L9.d.mts} +1 -1
- package/dist/runtime.d.mts +9 -10
- package/dist/runtime.mjs +3 -3
- package/dist/schema-DUtnZxjZ.mjs +8 -0
- package/dist/{search-DSaLgEFI.mjs → search-DUKgZUlm.mjs} +3 -3
- package/dist/{secrets-CDZo2k8L.mjs → secrets-ZV5rd8yV.mjs} +1 -1
- package/dist/{sections-PVVXHGfp.mjs → sections-DvFgsnda.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/index.mjs +1 -1
- package/dist/{seo-CQG3GCHQ.mjs → seo-BU8MLCS9.mjs} +1 -1
- package/dist/{service-DiN4ZuPp.mjs → service-FL3fB0Rx.mjs} +2 -2
- package/dist/{settings-BbqgHWpU.mjs → settings-BECcAIRH.mjs} +5 -5
- package/dist/{settings-i4VPP8bT.mjs → settings-EzADu-dd.mjs} +2 -2
- package/dist/{site-activity-Dy3FROs0.mjs → site-activity-h8smOlYI.mjs} +1 -1
- package/dist/{site-context-DQiL8Fl5.mjs → site-context-B8T1kpUP.mjs} +565 -129
- package/dist/stable-hash-DshcXvRE.mjs +19 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-9s-v03H-.mjs → taxonomies-BiM9NtgW.mjs} +3 -3
- package/dist/{taxonomies-DRiixp_E.mjs → taxonomies-DSnY5nOa.mjs} +6 -6
- package/dist/{taxonomy-Dvsw6BOs.mjs → taxonomy-0k_vRVsD.mjs} +2 -2
- package/dist/{types-4garmdWa.mjs → types-A8fPOJnl.mjs} +5 -2
- package/dist/{types-DW_-sFyz.d.mts → types-B_FlxIIl.d.mts} +2 -0
- package/dist/{types-Dq1qT19x.mjs → types-ChxYDRvx.mjs} +1 -1
- package/dist/{types-DU0bU2Wu.d.mts → types-DuQn1G7-.d.mts} +583 -2
- package/dist/{runtime-BOeiQsCv.d.mts → types-DwoUifGE.d.mts} +3560 -1355
- package/dist/{types-C_ly5eTp.d.mts → types-opjX_kz6.d.mts} +1 -1
- package/dist/ui/server-runtime.d.mts +12 -14
- package/dist/ui/server-runtime.mjs +21 -21
- package/dist/{user-BIZPzCb9.mjs → user-BH-n01y3.mjs} +2 -2
- package/dist/{utils-CMDhr5Xd.mjs → utils-D1SrKGtP.mjs} +1 -1
- package/dist/{validate-CZvb-BKB.d.mts → validate-CbVFoJgc.d.mts} +59 -5
- package/dist/{validate-DNs0pTSc.mjs → validate-D1HL-oLR.mjs} +2 -2
- package/dist/version-C3iVRuaF.mjs +6 -0
- package/dist/{widgets-f0ibZUIq.mjs → widgets-BZrLrNgS.mjs} +3 -3
- package/dist/{wordpress-slugs-BhHJX8XE.mjs → wordpress-slugs-C3PWcowq.mjs} +1 -1
- package/dist/{zod-generator-B7TMjyFJ.mjs → zod-generator-C7AsLpSB.mjs} +2 -2
- package/package.json +13 -5
- package/dist/hitl-Hw1RmWOq.mjs +0 -677
- package/dist/review-requests-C9Ff11Vq.mjs +0 -79
- package/dist/schema-DXdYj4R3.mjs +0 -8
- package/dist/types-C46EvNdc.d.mts +0 -56
- package/dist/types-C8XW6L19.d.mts +0 -1468
- package/dist/version-BTvfRGc6.mjs +0 -6
- /package/dist/{adapters-NVSs4UH7.d.mts → adapters-BiRymx02.d.mts} +0 -0
- /package/dist/{api-tokens-2r7OWi_I.mjs → api-tokens-Ypaly90d.mjs} +0 -0
- /package/dist/{challenge-store-Bjlepa2E.mjs → challenge-store-D5pSY2S1.mjs} +0 -0
- /package/dist/{components-Bclf98Be.mjs → components-DImzlLhb.mjs} +0 -0
- /package/dist/{context-types-DqTo6C79.mjs → context-types-eBuMDAg-.mjs} +0 -0
- /package/dist/{cron-cKcNTix_.mjs → cron-B1SL_lsb.mjs} +0 -0
- /package/dist/{default--K40jqm0.mjs → default-D4Vygcy_.mjs} +0 -0
- /package/dist/{email-console-ChgKFO8-.mjs → email-console-Bp0r68iF.mjs} +0 -0
- /package/dist/{error-CytFlgcd.mjs → error-CSVaQNZy.mjs} +0 -0
- /package/dist/{escape-Bd4P_xKg.mjs → escape-DN4Qmjsl.mjs} +0 -0
- /package/dist/{hash-BPmX6P8I.mjs → hash-mxxx2oPW.mjs} +0 -0
- /package/dist/{media-url-lEKSrpr9.mjs → media-url-BdoLPvg8.mjs} +0 -0
- /package/dist/{mime-CA7Lgovc.mjs → mime-C0vOHFm7.mjs} +0 -0
- /package/dist/{mode-C4CIyjtR.mjs → mode-C8yZnIlR.mjs} +0 -0
- /package/dist/{normalize-5ek_z7de.mjs → normalize-Cyt7JdF7.mjs} +0 -0
- /package/dist/{oauth-state-store-CNoXafF7.mjs → oauth-state-store-CndT35iw.mjs} +0 -0
- /package/dist/{oauth-user-lookup-Ygw4bNyt.mjs → oauth-user-lookup-CMehAaKs.mjs} +0 -0
- /package/dist/{parser-C1nYd-81.mjs → parser-06LLLL4E.mjs} +0 -0
- /package/dist/{passkey-config-BUwu8BA3.mjs → passkey-config-NYukYGed.mjs} +0 -0
- /package/dist/{patterns-BhAvqO0S.mjs → patterns-CoqlXUvk.mjs} +0 -0
- /package/dist/{placeholder-uvNRZBX9.d.mts → placeholder-DkWkXfDI.d.mts} +0 -0
- /package/dist/{portable-text-dA_UlJwW.mjs → portable-text-BASHceim.mjs} +0 -0
- /package/dist/{process-cache-7xgAO9JY.mjs → process-cache-CCDgti7j.mjs} +0 -0
- /package/dist/{provider-loader-D0w9dqjm.mjs → provider-loader-BtfrrzfD.mjs} +0 -0
- /package/dist/{public-url-BEz_sM9n.mjs → public-url-Cp6hyjVR.mjs} +0 -0
- /package/dist/{redirect-wphRBv4y.mjs → redirect-DrbEmU9a.mjs} +0 -0
- /package/dist/{request-cache-D9GQBxMP.mjs → request-cache-CBFjCwSt.mjs} +0 -0
- /package/dist/{resolve-Cb6Dbz-C.mjs → resolve-DE71WcL9.mjs} +0 -0
- /package/dist/{seo-qa7Dn0jK.mjs → seo-BLszyJxd.mjs} +0 -0
- /package/dist/{seo-contributions-C1EnikHB.mjs → seo-contributions-GnCuL1ML.mjs} +0 -0
- /package/dist/{session-user-CAKImna3.mjs → session-user-Ct6GBLvn.mjs} +0 -0
- /package/dist/{setup-complete-B8fl-mjV.mjs → setup-complete-Da0axZEE.mjs} +0 -0
- /package/dist/{setup-nonce-CoyjILvW.mjs → setup-nonce-BtkKnvxQ.mjs} +0 -0
- /package/dist/{sidecar-client-C3mqXg4C.mjs → sidecar-client-Ctzfyyp-.mjs} +0 -0
- /package/dist/{site-url-BML3GQYm.mjs → site-url-DJEid0ml.mjs} +0 -0
- /package/dist/{ssrf-DWe8jwAp.mjs → ssrf-FJqwQzj4.mjs} +0 -0
- /package/dist/{status-DANd8ERo.mjs → status-NqWOSFAD.mjs} +0 -0
- /package/dist/{tokens-1RK1n6ED.mjs → tokens-BDQU29Vd.mjs} +0 -0
- /package/dist/{transaction-C2EOMTJA.mjs → transaction-0LEAAy8R.mjs} +0 -0
- /package/dist/{transport-BNmCqLu7.mjs → transport-C46KHLMP.mjs} +0 -0
- /package/dist/{transport-CcJu3Co8.d.mts → transport-D9pKAzFP.d.mts} +0 -0
- /package/dist/{trusted-proxy-DTXQ2IMv.mjs → trusted-proxy-Dm7Mxvt6.mjs} +0 -0
- /package/dist/{types-B3t5cxhU.mjs → types-B7TDDFMG.mjs} +0 -0
- /package/dist/{types-DF7ZuGGk.d.mts → types-BLQCz46p.d.mts} +0 -0
- /package/dist/{types-CDpH6MA4.d.mts → types-Cw0PeCT_.d.mts} +0 -0
- /package/dist/{types-Rc3gQqqw.d.mts → types-g0zMtraY.d.mts} +0 -0
- /package/dist/{types-C5CVgwsV.mjs → types-mVVgRPaU.mjs} +0 -0
- /package/dist/{types-POH8PQZh.d.mts → types-wFu80FrO.d.mts} +0 -0
- /package/dist/{url-CpyFDFpO.mjs → url-EMAguGVk.mjs} +0 -0
- /package/dist/{url-Cac7a9QZ.mjs → url-guoXQQcV.mjs} +0 -0
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { t as Database } from "../types-
|
|
3
|
-
import "../
|
|
4
|
-
import
|
|
5
|
-
import "../
|
|
6
|
-
import
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../byline-fields-
|
|
10
|
-
import "../types-
|
|
11
|
-
import "../validate-CZvb-BKB.mjs";
|
|
1
|
+
import "../types-DwoUifGE.mjs";
|
|
2
|
+
import { t as Database } from "../types-DuQn1G7-.mjs";
|
|
3
|
+
import { h as MediaProviderItem, o as CreateMediaProviderFn } from "../placeholder-DkWkXfDI.mjs";
|
|
4
|
+
import "../runner-D6hzs8L9.mjs";
|
|
5
|
+
import "../index-DcnOCD1e.mjs";
|
|
6
|
+
import "../types-g0zMtraY.mjs";
|
|
7
|
+
import { d as Storage } from "../types-wFu80FrO.mjs";
|
|
8
|
+
import "../validate-CbVFoJgc.mjs";
|
|
9
|
+
import "../byline-fields-Ckeqd1OY.mjs";
|
|
10
|
+
import "../types-Cw0PeCT_.mjs";
|
|
12
11
|
import "../index.mjs";
|
|
13
12
|
import { Kysely } from "kysely";
|
|
14
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../base64-F8-DUraK.mjs";
|
|
2
|
-
import "../types-
|
|
3
|
-
import { t as MediaRepository } from "../media-
|
|
2
|
+
import "../types-ChxYDRvx.mjs";
|
|
3
|
+
import { t as MediaRepository } from "../media-CVMOoywq.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/media/local-runtime.ts
|
|
6
6
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as validateIdentifier } from "./validate-VPnKoIzW.mjs";
|
|
2
|
-
import { r as getDb } from "./loader-
|
|
2
|
+
import { r as getDb } from "./loader-aWkkc1_o.mjs";
|
|
3
3
|
import { n as cachedQuery, t as CacheNamespace } from "./object-cache-D51qOseS.mjs";
|
|
4
|
-
import { t as CommentRepository } from "./comment-
|
|
5
|
-
import { r as requestCached } from "./request-cache-
|
|
6
|
-
import { i as resolveLocaleChain, r as resolveLocale } from "./resolve-
|
|
7
|
-
import { n as sanitizeHref } from "./url-
|
|
8
|
-
import { t as CommentReactionRepository } from "./comment-reaction-
|
|
4
|
+
import { t as CommentRepository } from "./comment-DFALgsJD.mjs";
|
|
5
|
+
import { r as requestCached } from "./request-cache-CBFjCwSt.mjs";
|
|
6
|
+
import { i as resolveLocaleChain, r as resolveLocale } from "./resolve-DE71WcL9.mjs";
|
|
7
|
+
import { n as sanitizeHref } from "./url-EMAguGVk.mjs";
|
|
8
|
+
import { t as CommentReactionRepository } from "./comment-reaction-C37bf99u.mjs";
|
|
9
9
|
import { sql } from "kysely";
|
|
10
10
|
|
|
11
11
|
//#region src/comments/ranking.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as __exportAll } from "./runner-
|
|
1
|
+
import { a as __exportAll } from "./runner-BgmttQmD.mjs";
|
|
2
2
|
import { n as getI18nConfig } from "./config-CVssduLe.mjs";
|
|
3
3
|
import { c as invalidateMenuObjectCache } from "./object-cache-D51qOseS.mjs";
|
|
4
|
-
import { t as withTransaction } from "./transaction-
|
|
4
|
+
import { t as withTransaction } from "./transaction-0LEAAy8R.mjs";
|
|
5
5
|
import { ulid } from "ulidx";
|
|
6
6
|
|
|
7
7
|
//#region src/database/repositories/menu.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as withTransaction } from "./transaction-
|
|
2
|
-
import { a as hashApiToken, n as TOKEN_PREFIXES, r as generatePrefixedToken, t as ALL_VALID_SCOPES } from "./api-tokens-
|
|
3
|
-
import { a as filterExperimentalSiteContextWorkflowScopes, i as experimentalSiteContextWorkflowsEnabled, o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-
|
|
4
|
-
import { c as validateRedirectUri, o as lookupOAuthClient, s as validateClientRedirectUri } from "./oauth-clients-
|
|
5
|
-
import { t as lookupUserRoleAndStatus } from "./oauth-user-lookup-
|
|
1
|
+
import { t as withTransaction } from "./transaction-0LEAAy8R.mjs";
|
|
2
|
+
import { a as hashApiToken, n as TOKEN_PREFIXES, r as generatePrefixedToken, t as ALL_VALID_SCOPES } from "./api-tokens-Ypaly90d.mjs";
|
|
3
|
+
import { a as filterExperimentalSiteContextWorkflowScopes, i as experimentalSiteContextWorkflowsEnabled, o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-GVhUgzEs.mjs";
|
|
4
|
+
import { c as validateRedirectUri, o as lookupOAuthClient, s as validateClientRedirectUri } from "./oauth-clients-Dwl32-Uj.mjs";
|
|
5
|
+
import { t as lookupUserRoleAndStatus } from "./oauth-user-lookup-CMehAaKs.mjs";
|
|
6
6
|
import { clampScopes, computeS256Challenge, secureCompare } from "@dineway-ai/auth";
|
|
7
7
|
import { generateCodeVerifier } from "arctic";
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as validateScopes } from "./api-tokens-
|
|
2
|
-
import { o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-
|
|
1
|
+
import { s as validateScopes } from "./api-tokens-Ypaly90d.mjs";
|
|
2
|
+
import { o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-GVhUgzEs.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/oauth/redirect-uri.ts
|
|
5
5
|
/**
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { consola as consola$1 } from "consola";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/output.ts
|
|
4
|
+
/**
|
|
5
|
+
* Redirect consola output to stderr so it doesn't pollute JSON on stdout.
|
|
6
|
+
*
|
|
7
|
+
* Call this early in any command that uses `output()` with `--json`.
|
|
8
|
+
* Safe to call multiple times — only applies the redirect once.
|
|
9
|
+
*/
|
|
10
|
+
function configureOutputMode(args) {
|
|
11
|
+
if (args.json || !process.stdout.isTTY) {
|
|
12
|
+
consola$1.options.stdout = process.stderr;
|
|
13
|
+
consola$1.options.stderr = process.stderr;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Output data as JSON or pretty-printed.
|
|
18
|
+
*
|
|
19
|
+
* If stdout is not a TTY or --json is set, outputs JSON.
|
|
20
|
+
* Otherwise, outputs a formatted representation.
|
|
21
|
+
*/
|
|
22
|
+
function output(data, args) {
|
|
23
|
+
if (args.json || !process.stdout.isTTY) process.stdout.write(JSON.stringify(data, null, 2) + "\n");
|
|
24
|
+
else prettyPrint(data);
|
|
25
|
+
}
|
|
26
|
+
function prettyPrint(data, indent = 0) {
|
|
27
|
+
if (data === null || data === void 0) {
|
|
28
|
+
consola$1.log("(empty)");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(data)) {
|
|
32
|
+
if (data.length === 0) {
|
|
33
|
+
consola$1.log("(no items)");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
for (const item of data) {
|
|
37
|
+
prettyPrint(item, indent);
|
|
38
|
+
if (indent === 0) consola$1.log("---");
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (typeof data === "object") {
|
|
43
|
+
const obj = Object(data);
|
|
44
|
+
if ("items" in obj && Array.isArray(obj.items)) {
|
|
45
|
+
prettyPrint(obj.items, indent);
|
|
46
|
+
if (typeof obj.nextCursor === "string") consola$1.log(`\nNext cursor: ${obj.nextCursor}`);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const prefix = " ".repeat(indent);
|
|
50
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
51
|
+
if (value === null || value === void 0) continue;
|
|
52
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
53
|
+
consola$1.log(`${prefix}${key}:`);
|
|
54
|
+
prettyPrint(value, indent + 1);
|
|
55
|
+
} else if (Array.isArray(value)) consola$1.log(`${prefix}${key}: [${value.length} items]`);
|
|
56
|
+
else {
|
|
57
|
+
const str = typeof value === "string" ? value : JSON.stringify(value);
|
|
58
|
+
const display = str.length > 80 ? str.slice(0, 77) + "..." : str;
|
|
59
|
+
consola$1.log(`${prefix}${key}: ${display}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
consola$1.log(typeof data === "string" ? data : JSON.stringify(data));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { output as n, configureOutputMode as t };
|
package/dist/page/index.d.mts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import "../types-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { D as PageMetadataContribution, gt as PublicPageContext, w as PageFragmentContribution } from "../types-DwoUifGE.mjs";
|
|
2
|
+
import "../types-DuQn1G7-.mjs";
|
|
3
|
+
import "../runner-D6hzs8L9.mjs";
|
|
4
|
+
import "../index-DcnOCD1e.mjs";
|
|
5
|
+
import "../types-g0zMtraY.mjs";
|
|
6
|
+
import "../validate-CbVFoJgc.mjs";
|
|
7
|
+
import "../byline-fields-Ckeqd1OY.mjs";
|
|
8
|
+
import "../types-Cw0PeCT_.mjs";
|
|
9
|
+
import { a as generateSiteSeoContributions, c as ResolvedPageMetadata, d as renderPageMetadata, f as resolvePageMetadata, h as createPublicPageContext, i as generateBaseSeoContributions, l as createSha256CspHash, m as CreatePublicPageContextInput, n as buildWebSiteJsonLd, o as renderFragments, p as safeJsonLdSerialize, r as cleanJsonLd, s as resolveFragments, t as buildBlogPostingJsonLd, u as escapeHtmlAttr } from "../jsonld-DzKbhRZ4.mjs";
|
|
4
10
|
|
|
5
11
|
//#region src/page/index.d.ts
|
|
6
12
|
/**
|
package/dist/page/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as cleanJsonLd, c as createSha256CspHash, d as resolvePageMetadata, f as safeJsonLdSerialize, i as buildWebSiteJsonLd, l as escapeHtmlAttr, n as generateSiteSeoContributions, o as renderFragments, p as createPublicPageContext, r as buildBlogPostingJsonLd, s as resolveFragments, t as generateBaseSeoContributions, u as renderPageMetadata } from "../seo-contributions-
|
|
1
|
+
import { a as cleanJsonLd, c as createSha256CspHash, d as resolvePageMetadata, f as safeJsonLdSerialize, i as buildWebSiteJsonLd, l as escapeHtmlAttr, n as generateSiteSeoContributions, o as renderFragments, p as createPublicPageContext, r as buildBlogPostingJsonLd, s as resolveFragments, t as generateBaseSeoContributions, u as renderPageMetadata } from "../seo-contributions-GnCuL1ML.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/page/index.ts
|
|
4
4
|
/**
|
package/dist/plugin-utils.d.mts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./types-
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
1
|
+
import "./types-DwoUifGE.mjs";
|
|
2
|
+
import "./types-DuQn1G7-.mjs";
|
|
3
|
+
import "./runner-D6hzs8L9.mjs";
|
|
4
|
+
import "./index-DcnOCD1e.mjs";
|
|
5
|
+
import "./types-g0zMtraY.mjs";
|
|
6
|
+
import "./validate-CbVFoJgc.mjs";
|
|
7
|
+
import "./byline-fields-Ckeqd1OY.mjs";
|
|
8
|
+
import "./types-Cw0PeCT_.mjs";
|
|
7
9
|
import { DinewayHandlers } from "./astro/types.mjs";
|
|
8
|
-
import "./byline-fields-CUvbslGc.mjs";
|
|
9
|
-
import "./types-CDpH6MA4.mjs";
|
|
10
|
-
import "./validate-CZvb-BKB.mjs";
|
|
11
10
|
|
|
12
11
|
//#region src/plugin-utils.d.ts
|
|
13
12
|
type PublicPluginApiRouteHandler = DinewayHandlers["handlePublicPluginApiRoute"];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../types-
|
|
3
|
-
import
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import "../byline-fields-
|
|
8
|
-
import "../types-
|
|
9
|
-
import "../validate-CZvb-BKB.mjs";
|
|
1
|
+
import { io as PluginDescriptor, vt as ResolvedPlugin, wt as StandardPluginDefinition } from "../types-DwoUifGE.mjs";
|
|
2
|
+
import "../types-DuQn1G7-.mjs";
|
|
3
|
+
import "../runner-D6hzs8L9.mjs";
|
|
4
|
+
import "../index-DcnOCD1e.mjs";
|
|
5
|
+
import "../types-g0zMtraY.mjs";
|
|
6
|
+
import "../validate-CbVFoJgc.mjs";
|
|
7
|
+
import "../byline-fields-Ckeqd1OY.mjs";
|
|
8
|
+
import "../types-Cw0PeCT_.mjs";
|
|
10
9
|
|
|
11
10
|
//#region src/plugins/adapt-sandbox-entry.d.ts
|
|
12
11
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PLUGIN_CAPABILITIES, t as HOOK_NAMES } from "../manifest-schema-
|
|
1
|
+
import { n as PLUGIN_CAPABILITIES, t as HOOK_NAMES } from "../manifest-schema-uA6pRFXi.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/adapt-sandbox-entry.ts
|
|
4
4
|
/**
|
|
@@ -90,6 +90,7 @@ function adaptSandboxEntry(definition, descriptor) {
|
|
|
90
90
|
if (capabilities.includes("content:write") && !capabilities.includes("content:read")) capabilities.push("content:read");
|
|
91
91
|
if (capabilities.includes("media:write") && !capabilities.includes("media:read")) capabilities.push("media:read");
|
|
92
92
|
if (capabilities.includes("network:request:unrestricted") && !capabilities.includes("network:request")) capabilities.push("network:request");
|
|
93
|
+
if (capabilities.includes("network:request:development-loopback") && !capabilities.includes("network:request:unrestricted")) throw new Error(`Plugin "${pluginId}" must also declare "network:request:unrestricted" when using "network:request:development-loopback".`);
|
|
93
94
|
const rawStorage = descriptor.storage ?? {};
|
|
94
95
|
const storage = {};
|
|
95
96
|
for (const [name, config] of Object.entries(rawStorage)) storage[name] = {
|
|
@@ -107,6 +108,7 @@ function adaptSandboxEntry(definition, descriptor) {
|
|
|
107
108
|
capabilities,
|
|
108
109
|
allowedHosts,
|
|
109
110
|
storage,
|
|
111
|
+
migrations: {},
|
|
110
112
|
hooks: resolvedHooks,
|
|
111
113
|
routes: resolvedRoutes,
|
|
112
114
|
mcp: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as validatePluginIdentifier, t as validateIdentifier } from "./validate-VPnKoIzW.mjs";
|
|
2
2
|
import { i as encodeBase64url, n as decodeBase64url } from "./base64-F8-DUraK.mjs";
|
|
3
|
-
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-
|
|
3
|
+
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-ChGNDY8r.mjs";
|
|
4
4
|
import { t as OptionsRepository } from "./options-DQPTH5n0.mjs";
|
|
5
|
-
import { n as createPluginContext, t as PluginContextFactory } from "./context-
|
|
6
|
-
import { t as extractRequestMeta } from "./request-meta-
|
|
7
|
-
import { r as setCronTasksEnabled } from "./cron-
|
|
8
|
-
import { i as parseEncryptionKeys, t as DinewaySecretsError } from "./secrets-
|
|
9
|
-
import { sql } from "kysely";
|
|
5
|
+
import { n as createPluginContext, t as PluginContextFactory } from "./context-fSCYLL3c.mjs";
|
|
6
|
+
import { t as extractRequestMeta } from "./request-meta-CFe1tW2M.mjs";
|
|
7
|
+
import { r as setCronTasksEnabled } from "./cron-B1SL_lsb.mjs";
|
|
8
|
+
import { i as parseEncryptionKeys, t as DinewaySecretsError } from "./secrets-ZV5rd8yV.mjs";
|
|
9
|
+
import { Migrator, sql } from "kysely";
|
|
10
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11
11
|
import { ulid } from "ulidx";
|
|
12
12
|
import { z } from "astro/zod";
|
|
@@ -1249,14 +1249,17 @@ function defineNativePlugin(definition) {
|
|
|
1249
1249
|
const SIMPLE_ID = /^[a-z0-9-]+$/;
|
|
1250
1250
|
const SCOPED_ID = /^@[a-z0-9-]+\/[a-z0-9-]+$/;
|
|
1251
1251
|
const SEMVER_PATTERN = /^\d+\.\d+\.\d+/;
|
|
1252
|
-
const
|
|
1252
|
+
const MIGRATION_NAME_PATTERN = /^\d{3}_[a-z][a-z0-9_]*$/;
|
|
1253
|
+
const { id, version, capabilities = [], allowedHosts = [], migrations = {}, hooks = {}, routes = {}, publicationReleasePolicies = [], admin = {} } = definition;
|
|
1253
1254
|
const mcp = resolveMcp(definition.mcp, id);
|
|
1254
1255
|
const storage = definition.storage ?? {};
|
|
1256
|
+
const normalizedMigrations = Object.fromEntries(Object.entries(migrations).toSorted(([left], [right]) => left.localeCompare(right)));
|
|
1255
1257
|
if (!SIMPLE_ID.test(id) && !SCOPED_ID.test(id)) throw new Error(`Invalid plugin id "${id}". Must be lowercase alphanumeric with dashes (e.g., "my-plugin" or "@scope/my-plugin").`);
|
|
1256
1258
|
if (!SEMVER_PATTERN.test(version)) throw new Error(`Invalid plugin version "${version}". Must be semver format (e.g., "1.0.0").`);
|
|
1257
1259
|
const validCapabilities = new Set([
|
|
1258
1260
|
"network:request",
|
|
1259
1261
|
"network:request:unrestricted",
|
|
1262
|
+
"network:request:development-loopback",
|
|
1260
1263
|
"content:read",
|
|
1261
1264
|
"content:write",
|
|
1262
1265
|
"media:read",
|
|
@@ -1268,30 +1271,47 @@ function defineNativePlugin(definition) {
|
|
|
1268
1271
|
"hooks.page-fragments:register"
|
|
1269
1272
|
]);
|
|
1270
1273
|
for (const cap of capabilities) if (!validCapabilities.has(cap)) throw new Error(`Invalid capability "${cap}" in plugin "${id}".`);
|
|
1274
|
+
for (const [name, migration] of Object.entries(normalizedMigrations)) {
|
|
1275
|
+
if (!MIGRATION_NAME_PATTERN.test(name)) throw new Error(`Invalid migration name "${name}" in plugin "${id}". Use NNN_descriptive_name.`);
|
|
1276
|
+
if (typeof migration.up !== "function") throw new Error(`Plugin "${id}" migration "${name}" requires an up function.`);
|
|
1277
|
+
if (migration.down !== void 0 && typeof migration.down !== "function") throw new Error(`Plugin "${id}" migration "${name}" has an invalid down function.`);
|
|
1278
|
+
}
|
|
1271
1279
|
const normalizedCapabilities = [...capabilities];
|
|
1272
1280
|
if (capabilities.includes("content:write") && !capabilities.includes("content:read")) normalizedCapabilities.push("content:read");
|
|
1273
1281
|
if (capabilities.includes("media:write") && !capabilities.includes("media:read")) normalizedCapabilities.push("media:read");
|
|
1274
1282
|
if (capabilities.includes("network:request:unrestricted") && !capabilities.includes("network:request")) normalizedCapabilities.push("network:request");
|
|
1283
|
+
if (capabilities.includes("network:request:development-loopback") && !capabilities.includes("network:request:unrestricted")) throw new Error(`Plugin "${id}" must also declare "network:request:unrestricted" when using "network:request:development-loopback".`);
|
|
1275
1284
|
for (const [routeName, route] of Object.entries(routes)) {
|
|
1276
1285
|
if (route.body !== void 0 && route.body !== "json" && route.body !== "raw") throw new Error(`Plugin "${id}" route "${routeName}" has an invalid body mode.`);
|
|
1277
1286
|
if (route.body === "raw" && route.input) throw new Error(`Plugin "${id}" raw-body route "${routeName}" cannot declare an input schema.`);
|
|
1278
1287
|
if (route.body !== "raw" && route.maxBodyBytes !== void 0) throw new Error(`Plugin "${id}" JSON route "${routeName}" cannot declare a raw body-size limit.`);
|
|
1279
1288
|
if (route.body === "raw" && route.maxBodyBytes !== void 0 && (!Number.isSafeInteger(route.maxBodyBytes) || route.maxBodyBytes < 1 || route.maxBodyBytes > MAX_PLUGIN_RAW_BODY_LIMIT_BYTES)) throw new Error(`Plugin "${id}" raw-body route "${routeName}" has an invalid body-size limit.`);
|
|
1280
1289
|
if (route.public === true && route.authorization) throw new Error(`Plugin "${id}" public route "${routeName}" cannot declare private authorization.`);
|
|
1290
|
+
if (route.apiTokenPolicy && (route.public === true || !route.authorization)) throw new Error(`Plugin "${id}" route "${routeName}" API-token policy requires private authorization.`);
|
|
1291
|
+
if (route.apiTokenPolicy?.effect === "write" && (route.apiTokenPolicy.idempotencyField.trim().length === 0 || !route.input)) throw new Error(`Plugin "${id}" route "${routeName}" API-token write policy requires a parsed input schema and idempotency field.`);
|
|
1281
1292
|
if (route.authorization && (route.authorization.anyOfTokenScopes.length === 0 || route.authorization.anyOfTokenScopes.some((scope) => scope.trim().length === 0))) throw new Error(`Plugin "${id}" route "${routeName}" requires at least one valid token scope.`);
|
|
1282
1293
|
const restaurantPermission = route.authorization?.restaurantPermission;
|
|
1283
1294
|
if (restaurantPermission !== void 0 && (restaurantPermission.trim().length === 0 || typeof route.resolveTarget !== "function" || typeof route.authorizeTarget !== "function")) throw new Error(`Plugin "${id}" route "${routeName}" requires a restaurant target resolver and authorizer.`);
|
|
1284
1295
|
if (!restaurantPermission && (route.resolveTarget || route.authorizeTarget)) throw new Error(`Plugin "${id}" route "${routeName}" cannot declare target authorization without a restaurant permission.`);
|
|
1285
1296
|
}
|
|
1297
|
+
const resolvedHooks = resolveHooks(hooks, id);
|
|
1298
|
+
const releasePolicyIds = /* @__PURE__ */ new Set();
|
|
1299
|
+
for (const policy of publicationReleasePolicies) {
|
|
1300
|
+
if (!policy.id.trim()) throw new Error(`Plugin "${id}" publication release policy requires an ID.`);
|
|
1301
|
+
if (releasePolicyIds.has(policy.id)) throw new Error(`Plugin "${id}" has duplicate publication release policy "${policy.id}".`);
|
|
1302
|
+
releasePolicyIds.add(policy.id);
|
|
1303
|
+
}
|
|
1286
1304
|
return {
|
|
1287
1305
|
id,
|
|
1288
1306
|
version,
|
|
1289
1307
|
capabilities: normalizedCapabilities,
|
|
1290
1308
|
allowedHosts,
|
|
1291
1309
|
storage,
|
|
1292
|
-
|
|
1310
|
+
migrations: Object.freeze(normalizedMigrations),
|
|
1311
|
+
hooks: resolvedHooks,
|
|
1293
1312
|
routes,
|
|
1294
1313
|
mcp,
|
|
1314
|
+
publicationReleasePolicies: [...publicationReleasePolicies].toSorted((left, right) => left.id.localeCompare(right.id)),
|
|
1295
1315
|
admin
|
|
1296
1316
|
};
|
|
1297
1317
|
}
|
|
@@ -1418,6 +1438,69 @@ function resolveHook(hook, pluginId) {
|
|
|
1418
1438
|
};
|
|
1419
1439
|
}
|
|
1420
1440
|
|
|
1441
|
+
//#endregion
|
|
1442
|
+
//#region src/plugins/migrations.ts
|
|
1443
|
+
const LEADING_AT = /^@/;
|
|
1444
|
+
var StaticPluginMigrationProvider = class {
|
|
1445
|
+
constructor(migrations) {
|
|
1446
|
+
this.migrations = migrations;
|
|
1447
|
+
}
|
|
1448
|
+
async getMigrations() {
|
|
1449
|
+
return this.migrations;
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
/**
|
|
1453
|
+
* Run migrations contributed by configured trusted native plugins.
|
|
1454
|
+
*
|
|
1455
|
+
* Each plugin receives isolated Kysely migration and lock tables. This keeps migration history valid
|
|
1456
|
+
* when another plugin is removed and lets different plugins safely reuse local migration names.
|
|
1457
|
+
*/
|
|
1458
|
+
async function runPluginMigrations(db, plugins) {
|
|
1459
|
+
const applied = [];
|
|
1460
|
+
for (const plugin of [...plugins].toSorted((left, right) => left.id.localeCompare(right.id))) {
|
|
1461
|
+
if (Object.keys(plugin.migrations).length === 0) continue;
|
|
1462
|
+
const tables = pluginMigrationTableNames(plugin.id);
|
|
1463
|
+
const { error, results } = await new Migrator({
|
|
1464
|
+
db,
|
|
1465
|
+
provider: new StaticPluginMigrationProvider(plugin.migrations),
|
|
1466
|
+
migrationTableName: tables.migrations,
|
|
1467
|
+
migrationLockTableName: tables.lock
|
|
1468
|
+
}).migrateToLatest();
|
|
1469
|
+
const successful = results?.filter((result) => result.status === "Success").map((result) => result.migrationName) ?? [];
|
|
1470
|
+
if (error) {
|
|
1471
|
+
const failed = results?.find((result) => result.status === "Error")?.migrationName;
|
|
1472
|
+
throw new Error(`Plugin migration failed for ${plugin.id}${failed ? ` (${failed})` : ""}: ${errorMessage(error)}`, { cause: error });
|
|
1473
|
+
}
|
|
1474
|
+
applied.push({
|
|
1475
|
+
pluginId: plugin.id,
|
|
1476
|
+
applied: successful
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
return applied;
|
|
1480
|
+
}
|
|
1481
|
+
function pluginMigrationTableNames(pluginId) {
|
|
1482
|
+
const slug = pluginId.replace(LEADING_AT, "").replaceAll("/", "_").replaceAll("-", "_").slice(0, 20);
|
|
1483
|
+
const suffix = fnv1a(pluginId);
|
|
1484
|
+
return {
|
|
1485
|
+
migrations: `_dineway_plugin_migration_${slug}_${suffix}`,
|
|
1486
|
+
lock: `_dineway_plugin_migration_lock_${slug}_${suffix}`
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
function fnv1a(value) {
|
|
1490
|
+
let hash = 2166136261;
|
|
1491
|
+
for (let index = 0; index < value.length; index++) {
|
|
1492
|
+
hash ^= value.charCodeAt(index);
|
|
1493
|
+
hash = Math.imul(hash, 16777619);
|
|
1494
|
+
}
|
|
1495
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
1496
|
+
}
|
|
1497
|
+
function errorMessage(error) {
|
|
1498
|
+
if (!(error instanceof Error)) return JSON.stringify(error);
|
|
1499
|
+
if (error.message) return error.message;
|
|
1500
|
+
if (error.cause instanceof Error && error.cause.message) return error.cause.message;
|
|
1501
|
+
return "unknown error";
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1421
1504
|
//#endregion
|
|
1422
1505
|
//#region src/plugins/hooks.ts
|
|
1423
1506
|
/**
|
|
@@ -2696,7 +2779,8 @@ var PluginRouteHandler = class {
|
|
|
2696
2779
|
public: route.public === true,
|
|
2697
2780
|
body: route.body ?? "json",
|
|
2698
2781
|
...route.body === "raw" ? { maxBodyBytes: route.maxBodyBytes ?? DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES } : {},
|
|
2699
|
-
authorization: route.authorization
|
|
2782
|
+
authorization: route.authorization,
|
|
2783
|
+
apiTokenPolicy: route.apiTokenPolicy
|
|
2700
2784
|
};
|
|
2701
2785
|
}
|
|
2702
2786
|
};
|
|
@@ -3815,6 +3899,7 @@ function createResolvedPluginFromManifest(manifest) {
|
|
|
3815
3899
|
capabilities: normalizeCapabilities(manifest.capabilities),
|
|
3816
3900
|
allowedHosts: manifest.allowedHosts,
|
|
3817
3901
|
storage: manifest.storage,
|
|
3902
|
+
migrations: {},
|
|
3818
3903
|
hooks: {},
|
|
3819
3904
|
routes: {},
|
|
3820
3905
|
mcp: {
|
|
@@ -4235,4 +4320,4 @@ function createNodeSandboxRunner(options) {
|
|
|
4235
4320
|
}
|
|
4236
4321
|
|
|
4237
4322
|
//#endregion
|
|
4238
|
-
export {
|
|
4323
|
+
export { portableTextToProsemirror as C, image as D, reference as E, RelationRepository as O, verifyGuestAccessToken as S, portableText as T, DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES as _, createNoopSandboxRunner as a, hashGuestAccessToken as b, PluginSecretStore as c, EmailPipeline as d, HookPipeline as f, definePlugin as g, runPluginMigrations as h, SandboxNotAvailableError as i, PluginRouteError as l, resolveExclusiveHooks as m, createNodeSandboxRunner as n, PluginManager as o, createHookPipeline as p, NoopSandboxRunner as r, createPluginManager as s, NodeSandboxRunner as t, PluginRouteRegistry as u, readBoundedPluginRouteBody as v, prosemirrorToPortableText as w, issueGuestAccessToken as x, GuestAccessTokenConfigurationError as y };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region src/client/portable-text.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Portable Text <-> Markdown conversion layer.
|
|
4
|
+
*
|
|
5
|
+
* Three tiers of block handling:
|
|
6
|
+
* Tier 1: Standard PT blocks <-> standard Markdown (headings, paragraphs, lists, etc.)
|
|
7
|
+
* Tier 2: Dineway custom blocks <-> Markdown directives (future)
|
|
8
|
+
* Tier 3: Unknown blocks <-> opaque HTML comment fences (preserved, not editable)
|
|
9
|
+
*/
|
|
10
|
+
/** Minimal Portable Text block shape */
|
|
11
|
+
interface PortableTextBlock {
|
|
12
|
+
_type: string;
|
|
13
|
+
_key?: string;
|
|
14
|
+
style?: string;
|
|
15
|
+
level?: number;
|
|
16
|
+
listItem?: string;
|
|
17
|
+
markDefs?: MarkDef[];
|
|
18
|
+
children?: PortableTextSpan[];
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
interface PortableTextSpan {
|
|
22
|
+
_type: string;
|
|
23
|
+
_key?: string;
|
|
24
|
+
text?: string;
|
|
25
|
+
marks?: string[];
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
interface MarkDef {
|
|
29
|
+
_key: string;
|
|
30
|
+
_type: string;
|
|
31
|
+
href?: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Convert Portable Text blocks to Markdown.
|
|
36
|
+
* Unknown block types are serialized as opaque fences.
|
|
37
|
+
*/
|
|
38
|
+
declare function portableTextToMarkdown(blocks: PortableTextBlock[]): string;
|
|
39
|
+
/**
|
|
40
|
+
* Convert Markdown to Portable Text blocks.
|
|
41
|
+
* Opaque fences (<!--ec:block ... -->) are deserialized and spliced back in.
|
|
42
|
+
*/
|
|
43
|
+
declare function markdownToPortableText(markdown: string): PortableTextBlock[];
|
|
44
|
+
//#endregion
|
|
45
|
+
export { markdownToPortableText as n, portableTextToMarkdown as r, PortableTextBlock as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as loadBetterSqlite3, t as createDatabase } from "./connection-CiJWiWya.mjs";
|
|
2
2
|
import { runWithContext } from "./request-context.mjs";
|
|
3
|
-
import { a as verifyPreviewSignature, t as buildPreviewSignatureHeader } from "./sidecar-client-
|
|
4
|
-
import { t as generatePreviewToken } from "./tokens-
|
|
3
|
+
import { a as verifyPreviewSignature, t as buildPreviewSignatureHeader } from "./sidecar-client-Ctzfyyp-.mjs";
|
|
4
|
+
import { t as generatePreviewToken } from "./tokens-BDQU29Vd.mjs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { sql } from "kysely";
|
|
7
7
|
import { ulid } from "ulidx";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
4
|
+
|
|
5
|
+
//#region src/cli/project-env.ts
|
|
6
|
+
const DEFAULT_DINEWAY_URL = "http://localhost:4321";
|
|
7
|
+
const ENV_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
8
|
+
const LINE_SPLIT_PATTERN = /\r?\n/;
|
|
9
|
+
const DINEWAY_LOCAL_STATE_GITIGNORE_COMMENT = "# Dineway local state";
|
|
10
|
+
const DINEWAY_LOCAL_STATE_GITIGNORE_ENTRIES = [
|
|
11
|
+
".dineway/deploy.json",
|
|
12
|
+
".dineway/forgeway.json",
|
|
13
|
+
".dineway/types.ts",
|
|
14
|
+
".dineway/schema.json",
|
|
15
|
+
".dineway/uploads/"
|
|
16
|
+
];
|
|
17
|
+
const NEWLINE_PATTERN = /\r?\n/g;
|
|
18
|
+
function parseDotenvValue(value) {
|
|
19
|
+
const trimmed = value.trim();
|
|
20
|
+
if (trimmed.startsWith("\"") && trimmed.endsWith("\"") || trimmed.startsWith("'") && trimmed.endsWith("'")) return trimmed.slice(1, -1);
|
|
21
|
+
return trimmed;
|
|
22
|
+
}
|
|
23
|
+
function parseDotenv(text) {
|
|
24
|
+
const env = {};
|
|
25
|
+
for (const line of text.split(LINE_SPLIT_PATTERN)) {
|
|
26
|
+
const trimmed = line.trim();
|
|
27
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
28
|
+
const normalized = trimmed.startsWith("export ") ? trimmed.slice(7).trim() : trimmed;
|
|
29
|
+
const equalsIndex = normalized.indexOf("=");
|
|
30
|
+
if (equalsIndex <= 0) continue;
|
|
31
|
+
const key = normalized.slice(0, equalsIndex).trim();
|
|
32
|
+
if (!ENV_KEY_PATTERN.test(key)) continue;
|
|
33
|
+
env[key] = parseDotenvValue(normalized.slice(equalsIndex + 1));
|
|
34
|
+
}
|
|
35
|
+
return env;
|
|
36
|
+
}
|
|
37
|
+
function readProjectEnv(cwd = process.cwd()) {
|
|
38
|
+
const envPath = join(cwd, ".env");
|
|
39
|
+
if (!existsSync(envPath)) return {};
|
|
40
|
+
return parseDotenv(readFileSync(envPath, "utf-8"));
|
|
41
|
+
}
|
|
42
|
+
function getProjectEnvValue(name, cwd = process.cwd()) {
|
|
43
|
+
return process.env[name] ?? readProjectEnv(cwd)[name];
|
|
44
|
+
}
|
|
45
|
+
function resolveDinewayBaseUrl(url, cwd = process.cwd()) {
|
|
46
|
+
if (url && url !== DEFAULT_DINEWAY_URL) return url;
|
|
47
|
+
const projectEnv = readProjectEnv(cwd);
|
|
48
|
+
return process.env["DINEWAY_URL"] ?? process.env["DINEWAY_SITE_URL"] ?? projectEnv["DINEWAY_SITE_URL"] ?? projectEnv["DINEWAY_URL"] ?? url ?? DEFAULT_DINEWAY_URL;
|
|
49
|
+
}
|
|
50
|
+
function resolveDinewayToken(token, cwd = process.cwd()) {
|
|
51
|
+
return token ?? getProjectEnvValue("DINEWAY_TOKEN", cwd);
|
|
52
|
+
}
|
|
53
|
+
function formatEnvValue(value) {
|
|
54
|
+
return value.replace(NEWLINE_PATTERN, "");
|
|
55
|
+
}
|
|
56
|
+
async function upsertProjectEnv(cwd, values) {
|
|
57
|
+
const envPath = join(cwd, ".env");
|
|
58
|
+
const existing = await readFile(envPath, "utf-8").catch(() => "");
|
|
59
|
+
const lines = existing ? existing.split(LINE_SPLIT_PATTERN) : [];
|
|
60
|
+
const seen = /* @__PURE__ */ new Set();
|
|
61
|
+
const nextLines = lines.map((line) => {
|
|
62
|
+
const trimmed = line.trim();
|
|
63
|
+
const normalized = trimmed.startsWith("export ") ? trimmed.slice(7).trim() : trimmed;
|
|
64
|
+
const equalsIndex = normalized.indexOf("=");
|
|
65
|
+
if (equalsIndex <= 0) return line;
|
|
66
|
+
const key = normalized.slice(0, equalsIndex).trim();
|
|
67
|
+
const value = values[key];
|
|
68
|
+
if (!(key in values) || value === void 0) return line;
|
|
69
|
+
seen.add(key);
|
|
70
|
+
return `${key}=${formatEnvValue(value)}`;
|
|
71
|
+
});
|
|
72
|
+
for (const [key, value] of Object.entries(values)) {
|
|
73
|
+
if (value === void 0 || seen.has(key)) continue;
|
|
74
|
+
nextLines.push(`${key}=${formatEnvValue(value)}`);
|
|
75
|
+
}
|
|
76
|
+
await writeFile(envPath, `${nextLines.filter((line, index) => line || index < nextLines.length - 1).join("\n")}\n`, "utf-8");
|
|
77
|
+
}
|
|
78
|
+
async function ensureProjectGitignoreEntry(cwd, entry) {
|
|
79
|
+
const gitignorePath = join(cwd, ".gitignore");
|
|
80
|
+
const existing = await readFile(gitignorePath, "utf-8").catch(() => "");
|
|
81
|
+
if (existing.split(LINE_SPLIT_PATTERN).map((line) => line.trim()).includes(entry)) return;
|
|
82
|
+
await writeFile(gitignorePath, `${existing}${existing && !existing.endsWith("\n") ? "\n" : ""}${entry}\n`, "utf-8");
|
|
83
|
+
}
|
|
84
|
+
async function ensureProjectGitignoreDinewayLocalState(cwd) {
|
|
85
|
+
const gitignorePath = join(cwd, ".gitignore");
|
|
86
|
+
const existing = await readFile(gitignorePath, "utf-8").catch(() => "");
|
|
87
|
+
const lines = new Set(existing.split(LINE_SPLIT_PATTERN).map((line) => line.trim()));
|
|
88
|
+
const missingEntries = DINEWAY_LOCAL_STATE_GITIGNORE_ENTRIES.filter((entry) => !lines.has(entry));
|
|
89
|
+
if (missingEntries.length === 0) return;
|
|
90
|
+
const block = [DINEWAY_LOCAL_STATE_GITIGNORE_COMMENT, ...missingEntries].join("\n");
|
|
91
|
+
await writeFile(gitignorePath, `${existing}${existing.trim() ? existing.endsWith("\n") ? "\n" : "\n\n" : ""}${block}\n`, "utf-8");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
//#endregion
|
|
95
|
+
export { resolveDinewayBaseUrl as a, getProjectEnvValue as i, ensureProjectGitignoreDinewayLocalState as n, resolveDinewayToken as o, ensureProjectGitignoreEntry as r, upsertProjectEnv as s, DEFAULT_DINEWAY_URL as t };
|