@plumix/core 0.6.0 → 0.7.0
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/cache/embedded-tags.d.ts +5 -0
- package/dist/cache/embedded-tags.d.ts.map +1 -0
- package/dist/cache/embedded-tags.js +30 -0
- package/dist/cache/embedded-tags.js.map +1 -0
- package/dist/entries/read-service.d.ts.map +1 -1
- package/dist/entries/read-service.js +5 -3
- package/dist/entries/read-service.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/errors.d.ts +7 -1
- package/dist/plugin/errors.d.ts.map +1 -1
- package/dist/plugin/errors.js +5 -0
- package/dist/plugin/errors.js.map +1 -1
- package/dist/plugin/fields/builder.d.ts +106 -0
- package/dist/plugin/fields/builder.d.ts.map +1 -0
- package/dist/plugin/fields/builder.js +162 -0
- package/dist/plugin/fields/builder.js.map +1 -0
- package/dist/plugin/fields/color.d.ts +78 -18
- package/dist/plugin/fields/color.d.ts.map +1 -1
- package/dist/plugin/fields/color.js +116 -25
- package/dist/plugin/fields/color.js.map +1 -1
- package/dist/plugin/fields/condition.d.ts +40 -0
- package/dist/plugin/fields/condition.d.ts.map +1 -0
- package/dist/plugin/fields/condition.js +115 -0
- package/dist/plugin/fields/condition.js.map +1 -0
- package/dist/plugin/fields/contributions.d.ts +233 -0
- package/dist/plugin/fields/contributions.d.ts.map +1 -0
- package/dist/plugin/fields/contributions.js +1 -0
- package/dist/plugin/fields/contributions.js.map +1 -0
- package/dist/plugin/fields/entry.d.ts +18 -22
- package/dist/plugin/fields/entry.d.ts.map +1 -1
- package/dist/plugin/fields/entry.js +13 -21
- package/dist/plugin/fields/entry.js.map +1 -1
- package/dist/plugin/fields/errors.d.ts +23 -11
- package/dist/plugin/fields/errors.d.ts.map +1 -1
- package/dist/plugin/fields/errors.js +20 -13
- package/dist/plugin/fields/errors.js.map +1 -1
- package/dist/plugin/fields/group.d.ts +90 -0
- package/dist/plugin/fields/group.d.ts.map +1 -0
- package/dist/plugin/fields/group.js +124 -0
- package/dist/plugin/fields/group.js.map +1 -0
- package/dist/plugin/fields/index.d.ts +22 -45
- package/dist/plugin/fields/index.d.ts.map +1 -1
- package/dist/plugin/fields/index.js +25 -30
- package/dist/plugin/fields/index.js.map +1 -1
- package/dist/plugin/fields/json.d.ts +71 -9
- package/dist/plugin/fields/json.d.ts.map +1 -1
- package/dist/plugin/fields/json.js +110 -16
- package/dist/plugin/fields/json.js.map +1 -1
- package/dist/plugin/fields/link.d.ts +96 -0
- package/dist/plugin/fields/link.d.ts.map +1 -0
- package/dist/plugin/fields/link.js +160 -0
- package/dist/plugin/fields/link.js.map +1 -0
- package/dist/plugin/fields/number.d.ts +86 -13
- package/dist/plugin/fields/number.d.ts.map +1 -1
- package/dist/plugin/fields/number.js +133 -20
- package/dist/plugin/fields/number.js.map +1 -1
- package/dist/plugin/fields/range.d.ts +101 -17
- package/dist/plugin/fields/range.d.ts.map +1 -1
- package/dist/plugin/fields/range.js +153 -38
- package/dist/plugin/fields/range.js.map +1 -1
- package/dist/plugin/fields/reference.d.ts +171 -0
- package/dist/plugin/fields/reference.d.ts.map +1 -0
- package/dist/plugin/fields/reference.js +193 -0
- package/dist/plugin/fields/reference.js.map +1 -0
- package/dist/plugin/fields/repeater.d.ts +111 -8
- package/dist/plugin/fields/repeater.d.ts.map +1 -1
- package/dist/plugin/fields/repeater.js +157 -66
- package/dist/plugin/fields/repeater.js.map +1 -1
- package/dist/plugin/fields/richtext-validate.d.ts +7 -0
- package/dist/plugin/fields/richtext-validate.d.ts.map +1 -1
- package/dist/plugin/fields/richtext-validate.js +11 -5
- package/dist/plugin/fields/richtext-validate.js.map +1 -1
- package/dist/plugin/fields/richtext.d.ts +78 -12
- package/dist/plugin/fields/richtext.d.ts.map +1 -1
- package/dist/plugin/fields/richtext.js +121 -26
- package/dist/plugin/fields/richtext.js.map +1 -1
- package/dist/plugin/fields/select.d.ts +150 -10
- package/dist/plugin/fields/select.d.ts.map +1 -1
- package/dist/plugin/fields/select.js +205 -17
- package/dist/plugin/fields/select.js.map +1 -1
- package/dist/plugin/fields/sub-fields.d.ts +12 -0
- package/dist/plugin/fields/sub-fields.d.ts.map +1 -0
- package/dist/plugin/fields/sub-fields.js +62 -0
- package/dist/plugin/fields/sub-fields.js.map +1 -0
- package/dist/plugin/fields/temporal.d.ts +124 -0
- package/dist/plugin/fields/temporal.d.ts.map +1 -0
- package/dist/plugin/fields/temporal.js +180 -0
- package/dist/plugin/fields/temporal.js.map +1 -0
- package/dist/plugin/fields/term.d.ts +11 -16
- package/dist/plugin/fields/term.d.ts.map +1 -1
- package/dist/plugin/fields/term.js +11 -19
- package/dist/plugin/fields/term.js.map +1 -1
- package/dist/plugin/fields/toggle.d.ts +97 -0
- package/dist/plugin/fields/toggle.d.ts.map +1 -0
- package/dist/plugin/fields/toggle.js +135 -0
- package/dist/plugin/fields/toggle.js.map +1 -0
- package/dist/plugin/fields/user.d.ts +14 -26
- package/dist/plugin/fields/user.d.ts.map +1 -1
- package/dist/plugin/fields/user.js +11 -25
- package/dist/plugin/fields/user.js.map +1 -1
- package/dist/plugin/lookup.d.ts +70 -1
- package/dist/plugin/lookup.d.ts.map +1 -1
- package/dist/plugin/manifest.d.ts +308 -128
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +94 -4
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/setup-context.d.ts +5 -4
- package/dist/plugin/setup-context.d.ts.map +1 -1
- package/dist/plugin/setup-context.js +10 -3
- package/dist/plugin/setup-context.js.map +1 -1
- package/dist/plugin/validation/meta-box-fields.d.ts.map +1 -1
- package/dist/plugin/validation/meta-box-fields.js +16 -0
- package/dist/plugin/validation/meta-box-fields.js.map +1 -1
- package/dist/route/render/build-resolved-entries.d.ts.map +1 -1
- package/dist/route/render/build-resolved-entries.js +7 -2
- package/dist/route/render/build-resolved-entries.js.map +1 -1
- package/dist/route/render/render-template.d.ts.map +1 -1
- package/dist/route/render/render-template.js +12 -2
- package/dist/route/render/render-template.js.map +1 -1
- package/dist/route/render/template-builders.d.ts +15 -10
- package/dist/route/render/template-builders.d.ts.map +1 -1
- package/dist/route/render/template-builders.js.map +1 -1
- package/dist/rpc/base.d.ts +7 -0
- package/dist/rpc/base.d.ts.map +1 -1
- package/dist/rpc/errors.d.ts +7 -0
- package/dist/rpc/errors.d.ts.map +1 -1
- package/dist/rpc/errors.js +16 -0
- package/dist/rpc/errors.js.map +1 -1
- package/dist/rpc/meta/core.d.ts +89 -10
- package/dist/rpc/meta/core.d.ts.map +1 -1
- package/dist/rpc/meta/core.js +465 -282
- package/dist/rpc/meta/core.js.map +1 -1
- package/dist/rpc/meta/field-messages.d.ts +67 -0
- package/dist/rpc/meta/field-messages.d.ts.map +1 -0
- package/dist/rpc/meta/field-messages.js +67 -0
- package/dist/rpc/meta/field-messages.js.map +1 -0
- package/dist/rpc/meta/field-pipeline.d.ts +52 -0
- package/dist/rpc/meta/field-pipeline.d.ts.map +1 -0
- package/dist/rpc/meta/field-pipeline.js +501 -0
- package/dist/rpc/meta/field-pipeline.js.map +1 -0
- package/dist/rpc/procedures/auth/allowed-domains/create.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/create.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/delete.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/index.d.ts +28 -0
- package/dist/rpc/procedures/auth/allowed-domains/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/allowed-domains/update.d.ts +7 -0
- package/dist/rpc/procedures/auth/allowed-domains/update.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/admin-list.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/admin-list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/admin-revoke.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/admin-revoke.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/create.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/create.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/index.d.ts +35 -0
- package/dist/rpc/procedures/auth/api-tokens/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/api-tokens/revoke.d.ts +7 -0
- package/dist/rpc/procedures/auth/api-tokens/revoke.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/delete.d.ts +7 -0
- package/dist/rpc/procedures/auth/credentials/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/index.d.ts +21 -0
- package/dist/rpc/procedures/auth/credentials/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/credentials/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/credentials/rename.d.ts +7 -0
- package/dist/rpc/procedures/auth/credentials/rename.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/approve.d.ts +7 -0
- package/dist/rpc/procedures/auth/device-flow/approve.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/deny.d.ts +7 -0
- package/dist/rpc/procedures/auth/device-flow/deny.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/index.d.ts +21 -0
- package/dist/rpc/procedures/auth/device-flow/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/device-flow/lookup.d.ts +7 -0
- package/dist/rpc/procedures/auth/device-flow/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/index.d.ts +154 -0
- package/dist/rpc/procedures/auth/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/login-links.d.ts +7 -0
- package/dist/rpc/procedures/auth/login-links.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/mailer/index.d.ts +7 -0
- package/dist/rpc/procedures/auth/mailer/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/mailer/test-send.d.ts +7 -0
- package/dist/rpc/procedures/auth/mailer/test-send.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/oauth-providers.d.ts +7 -0
- package/dist/rpc/procedures/auth/oauth-providers.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/session.d.ts +7 -0
- package/dist/rpc/procedures/auth/session.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/index.d.ts +21 -0
- package/dist/rpc/procedures/auth/sessions/index.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/list.d.ts +7 -0
- package/dist/rpc/procedures/auth/sessions/list.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/revoke-others.d.ts +7 -0
- package/dist/rpc/procedures/auth/sessions/revoke-others.d.ts.map +1 -1
- package/dist/rpc/procedures/auth/sessions/revoke.d.ts +7 -0
- package/dist/rpc/procedures/auth/sessions/revoke.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/activity.d.ts +7 -0
- package/dist/rpc/procedures/entry/activity.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/bulk.d.ts +21 -0
- package/dist/rpc/procedures/entry/bulk.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/create-preview-link.d.ts +7 -0
- package/dist/rpc/procedures/entry/create-preview-link.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/create.d.ts +8 -1
- package/dist/rpc/procedures/entry/create.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/create.js +8 -8
- package/dist/rpc/procedures/entry/create.js.map +1 -1
- package/dist/rpc/procedures/entry/dashboard.d.ts +14 -0
- package/dist/rpc/procedures/entry/dashboard.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/delete-permanent.d.ts +7 -0
- package/dist/rpc/procedures/entry/delete-permanent.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/discard-draft.d.ts +7 -0
- package/dist/rpc/procedures/entry/discard-draft.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/duplicate.d.ts +7 -0
- package/dist/rpc/procedures/entry/duplicate.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/duplicate.js +2 -2
- package/dist/rpc/procedures/entry/duplicate.js.map +1 -1
- package/dist/rpc/procedures/entry/get.d.ts +7 -0
- package/dist/rpc/procedures/entry/get.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/get.js +2 -2
- package/dist/rpc/procedures/entry/get.js.map +1 -1
- package/dist/rpc/procedures/entry/index.d.ts +156 -2
- package/dist/rpc/procedures/entry/index.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/list.d.ts +7 -0
- package/dist/rpc/procedures/entry/list.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/lookup.d.ts +8 -2
- package/dist/rpc/procedures/entry/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/lookup.js +60 -1
- package/dist/rpc/procedures/entry/lookup.js.map +1 -1
- package/dist/rpc/procedures/entry/meta.d.ts +37 -3
- package/dist/rpc/procedures/entry/meta.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/meta.js +63 -7
- package/dist/rpc/procedures/entry/meta.js.map +1 -1
- package/dist/rpc/procedures/entry/publish.d.ts +7 -0
- package/dist/rpc/procedures/entry/publish.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/publish.js +6 -4
- package/dist/rpc/procedures/entry/publish.js.map +1 -1
- package/dist/rpc/procedures/entry/refresh-block-loader.d.ts +7 -0
- package/dist/rpc/procedures/entry/refresh-block-loader.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/restore.d.ts +7 -0
- package/dist/rpc/procedures/entry/restore.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/revisions.d.ts +56 -0
- package/dist/rpc/procedures/entry/revisions.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/schemas.d.ts +2 -2
- package/dist/rpc/procedures/entry/schemas.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/schemas.js +9 -2
- package/dist/rpc/procedures/entry/schemas.js.map +1 -1
- package/dist/rpc/procedures/entry/trash.d.ts +7 -0
- package/dist/rpc/procedures/entry/trash.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/update.d.ts +8 -1
- package/dist/rpc/procedures/entry/update.d.ts.map +1 -1
- package/dist/rpc/procedures/entry/update.js +77 -18
- package/dist/rpc/procedures/entry/update.js.map +1 -1
- package/dist/rpc/procedures/lookup/index.d.ts +14 -0
- package/dist/rpc/procedures/lookup/index.d.ts.map +1 -1
- package/dist/rpc/procedures/lookup/list.d.ts +7 -0
- package/dist/rpc/procedures/lookup/list.d.ts.map +1 -1
- package/dist/rpc/procedures/lookup/resolve.d.ts +7 -0
- package/dist/rpc/procedures/lookup/resolve.d.ts.map +1 -1
- package/dist/rpc/procedures/lookup/resolve.js +1 -1
- package/dist/rpc/procedures/lookup/resolve.js.map +1 -1
- package/dist/rpc/procedures/search/index.d.ts +7 -0
- package/dist/rpc/procedures/search/index.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/get.d.ts +7 -0
- package/dist/rpc/procedures/settings/get.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/index.d.ts +14 -0
- package/dist/rpc/procedures/settings/index.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/upsert.d.ts +7 -0
- package/dist/rpc/procedures/settings/upsert.d.ts.map +1 -1
- package/dist/rpc/procedures/settings/upsert.js +9 -0
- package/dist/rpc/procedures/settings/upsert.js.map +1 -1
- package/dist/rpc/procedures/term/create.d.ts +7 -0
- package/dist/rpc/procedures/term/create.d.ts.map +1 -1
- package/dist/rpc/procedures/term/create.js +3 -3
- package/dist/rpc/procedures/term/create.js.map +1 -1
- package/dist/rpc/procedures/term/delete.d.ts +7 -0
- package/dist/rpc/procedures/term/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/term/get.d.ts +7 -0
- package/dist/rpc/procedures/term/get.d.ts.map +1 -1
- package/dist/rpc/procedures/term/index.d.ts +35 -0
- package/dist/rpc/procedures/term/index.d.ts.map +1 -1
- package/dist/rpc/procedures/term/list.d.ts +7 -0
- package/dist/rpc/procedures/term/list.d.ts.map +1 -1
- package/dist/rpc/procedures/term/lookup.d.ts +7 -2
- package/dist/rpc/procedures/term/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/term/lookup.js +26 -0
- package/dist/rpc/procedures/term/lookup.js.map +1 -1
- package/dist/rpc/procedures/term/meta.d.ts +3 -2
- package/dist/rpc/procedures/term/meta.d.ts.map +1 -1
- package/dist/rpc/procedures/term/meta.js +7 -5
- package/dist/rpc/procedures/term/meta.js.map +1 -1
- package/dist/rpc/procedures/term/update.d.ts +7 -0
- package/dist/rpc/procedures/term/update.d.ts.map +1 -1
- package/dist/rpc/procedures/term/update.js +4 -4
- package/dist/rpc/procedures/term/update.js.map +1 -1
- package/dist/rpc/procedures/user/cancel-email-change.d.ts +7 -0
- package/dist/rpc/procedures/user/cancel-email-change.d.ts.map +1 -1
- package/dist/rpc/procedures/user/delete.d.ts +7 -0
- package/dist/rpc/procedures/user/delete.d.ts.map +1 -1
- package/dist/rpc/procedures/user/disable.d.ts +7 -0
- package/dist/rpc/procedures/user/disable.d.ts.map +1 -1
- package/dist/rpc/procedures/user/enable.d.ts +7 -0
- package/dist/rpc/procedures/user/enable.d.ts.map +1 -1
- package/dist/rpc/procedures/user/get.d.ts +7 -0
- package/dist/rpc/procedures/user/get.d.ts.map +1 -1
- package/dist/rpc/procedures/user/get.js +2 -2
- package/dist/rpc/procedures/user/get.js.map +1 -1
- package/dist/rpc/procedures/user/index.d.ts +77 -0
- package/dist/rpc/procedures/user/index.d.ts.map +1 -1
- package/dist/rpc/procedures/user/invite.d.ts +7 -0
- package/dist/rpc/procedures/user/invite.d.ts.map +1 -1
- package/dist/rpc/procedures/user/list.d.ts +7 -0
- package/dist/rpc/procedures/user/list.d.ts.map +1 -1
- package/dist/rpc/procedures/user/lookup.d.ts +6 -2
- package/dist/rpc/procedures/user/lookup.d.ts.map +1 -1
- package/dist/rpc/procedures/user/lookup.js +29 -0
- package/dist/rpc/procedures/user/lookup.js.map +1 -1
- package/dist/rpc/procedures/user/meta.d.ts +3 -2
- package/dist/rpc/procedures/user/meta.d.ts.map +1 -1
- package/dist/rpc/procedures/user/meta.js +7 -5
- package/dist/rpc/procedures/user/meta.js.map +1 -1
- package/dist/rpc/procedures/user/pending-email-change.d.ts +7 -0
- package/dist/rpc/procedures/user/pending-email-change.d.ts.map +1 -1
- package/dist/rpc/procedures/user/request-email-change.d.ts +7 -0
- package/dist/rpc/procedures/user/request-email-change.d.ts.map +1 -1
- package/dist/rpc/procedures/user/set-locale.d.ts +7 -0
- package/dist/rpc/procedures/user/set-locale.d.ts.map +1 -1
- package/dist/rpc/procedures/user/update.d.ts +7 -0
- package/dist/rpc/procedures/user/update.d.ts.map +1 -1
- package/dist/rpc/procedures/user/update.js +4 -4
- package/dist/rpc/procedures/user/update.js.map +1 -1
- package/dist/rpc/router.d.ts +457 -2
- package/dist/rpc/router.d.ts.map +1 -1
- package/dist/rpc/validation.d.ts +1 -0
- package/dist/rpc/validation.d.ts.map +1 -1
- package/dist/rpc/validation.js +1 -0
- package/dist/rpc/validation.js.map +1 -1
- package/dist/runtime/dispatcher.d.ts.map +1 -1
- package/dist/runtime/dispatcher.js +20 -10
- package/dist/runtime/dispatcher.js.map +1 -1
- package/dist/seo/feed.d.ts.map +1 -1
- package/dist/seo/feed.js +7 -1
- package/dist/seo/feed.js.map +1 -1
- package/dist/settings-core.js +1 -1
- package/dist/settings-core.js.map +1 -1
- package/dist/template-registry.d.ts +0 -16
- package/dist/template-registry.d.ts.map +1 -1
- package/dist/terms/read-service.js +2 -2
- package/dist/terms/read-service.js.map +1 -1
- package/dist/test/traced-context.d.ts +1 -1
- package/dist/test/traced-context.d.ts.map +1 -1
- package/dist/test/traced-context.js +2 -2
- package/dist/test/traced-context.js.map +1 -1
- package/package.json +2 -2
- package/dist/plugin/fields/checkbox.d.ts +0 -19
- package/dist/plugin/fields/checkbox.d.ts.map +0 -1
- package/dist/plugin/fields/checkbox.js +0 -20
- package/dist/plugin/fields/checkbox.js.map +0 -1
- package/dist/plugin/fields/date.d.ts +0 -24
- package/dist/plugin/fields/date.d.ts.map +0 -1
- package/dist/plugin/fields/date.js +0 -23
- package/dist/plugin/fields/date.js.map +0 -1
- package/dist/plugin/fields/datetime.d.ts +0 -26
- package/dist/plugin/fields/datetime.d.ts.map +0 -1
- package/dist/plugin/fields/datetime.js +0 -25
- package/dist/plugin/fields/datetime.js.map +0 -1
- package/dist/plugin/fields/email.d.ts +0 -17
- package/dist/plugin/fields/email.d.ts.map +0 -1
- package/dist/plugin/fields/email.js +0 -18
- package/dist/plugin/fields/email.js.map +0 -1
- package/dist/plugin/fields/entry-list.d.ts +0 -28
- package/dist/plugin/fields/entry-list.d.ts.map +0 -1
- package/dist/plugin/fields/entry-list.js +0 -31
- package/dist/plugin/fields/entry-list.js.map +0 -1
- package/dist/plugin/fields/multiselect.d.ts +0 -21
- package/dist/plugin/fields/multiselect.d.ts.map +0 -1
- package/dist/plugin/fields/multiselect.js +0 -43
- package/dist/plugin/fields/multiselect.js.map +0 -1
- package/dist/plugin/fields/password.d.ts +0 -24
- package/dist/plugin/fields/password.d.ts.map +0 -1
- package/dist/plugin/fields/password.js +0 -25
- package/dist/plugin/fields/password.js.map +0 -1
- package/dist/plugin/fields/radio.d.ts +0 -16
- package/dist/plugin/fields/radio.d.ts.map +0 -1
- package/dist/plugin/fields/radio.js +0 -17
- package/dist/plugin/fields/radio.js.map +0 -1
- package/dist/plugin/fields/repeater-validate.d.ts +0 -34
- package/dist/plugin/fields/repeater-validate.d.ts.map +0 -1
- package/dist/plugin/fields/repeater-validate.js +0 -104
- package/dist/plugin/fields/repeater-validate.js.map +0 -1
- package/dist/plugin/fields/term-list.d.ts +0 -27
- package/dist/plugin/fields/term-list.d.ts.map +0 -1
- package/dist/plugin/fields/term-list.js +0 -30
- package/dist/plugin/fields/term-list.js.map +0 -1
- package/dist/plugin/fields/text.d.ts +0 -37
- package/dist/plugin/fields/text.d.ts.map +0 -1
- package/dist/plugin/fields/text.js +0 -31
- package/dist/plugin/fields/text.js.map +0 -1
- package/dist/plugin/fields/textarea.d.ts +0 -20
- package/dist/plugin/fields/textarea.d.ts.map +0 -1
- package/dist/plugin/fields/textarea.js +0 -21
- package/dist/plugin/fields/textarea.js.map +0 -1
- package/dist/plugin/fields/time.d.ts +0 -24
- package/dist/plugin/fields/time.d.ts.map +0 -1
- package/dist/plugin/fields/time.js +0 -23
- package/dist/plugin/fields/time.js.map +0 -1
- package/dist/plugin/fields/url.d.ts +0 -17
- package/dist/plugin/fields/url.d.ts.map +0 -1
- package/dist/plugin/fields/url.js +0 -18
- package/dist/plugin/fields/url.js.map +0 -1
- package/dist/plugin/fields/user-list.d.ts +0 -29
- package/dist/plugin/fields/user-list.d.ts.map +0 -1
- package/dist/plugin/fields/user-list.js +0 -31
- package/dist/plugin/fields/user-list.js.map +0 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { humanizeFieldKey } from "./builder.js";
|
|
3
|
+
/**
|
|
4
|
+
* Fluent chain for the boolean switch field. Immutable — every call
|
|
5
|
+
* returns a fresh instance, so a shared base chain can be forked
|
|
6
|
+
* without aliasing. `V` is the phantom read type: `boolean |
|
|
7
|
+
* undefined` unadorned, narrowed to `boolean` by `.required()` /
|
|
8
|
+
* `.default()`. Purely type-level — nothing at runtime carries it.
|
|
9
|
+
*/
|
|
10
|
+
export class ToggleFieldBuilder {
|
|
11
|
+
#key;
|
|
12
|
+
#state;
|
|
13
|
+
constructor(key, state = {}) {
|
|
14
|
+
this.#key = key;
|
|
15
|
+
this.#state = state;
|
|
16
|
+
}
|
|
17
|
+
#fork(patch) {
|
|
18
|
+
return new _a(this.#key, {
|
|
19
|
+
...this.#state,
|
|
20
|
+
...patch,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** Label shown beside the switch while it is on. */
|
|
24
|
+
onText(onText) {
|
|
25
|
+
return this.#fork({ onText });
|
|
26
|
+
}
|
|
27
|
+
/** Label shown beside the switch while it is off. */
|
|
28
|
+
offText(offText) {
|
|
29
|
+
return this.#fork({ offText });
|
|
30
|
+
}
|
|
31
|
+
/** Override the derived (humanized-key) label. */
|
|
32
|
+
label(label) {
|
|
33
|
+
return this.#fork({ label });
|
|
34
|
+
}
|
|
35
|
+
/** Help text rendered under the label. */
|
|
36
|
+
description(description) {
|
|
37
|
+
return this.#fork({ description });
|
|
38
|
+
}
|
|
39
|
+
/** Admin-form prefill for unsaved keys — narrows the read type to `boolean`. */
|
|
40
|
+
default(value) {
|
|
41
|
+
return this.#fork({ default: value });
|
|
42
|
+
}
|
|
43
|
+
/** Mark the field required — narrows the read type to `boolean`. */
|
|
44
|
+
required() {
|
|
45
|
+
return this.#fork({ required: true });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Column span within the box's 12-column grid — a universal layout
|
|
49
|
+
* hint; surfaces that can't honor it (the entry editor rail) ignore it.
|
|
50
|
+
*/
|
|
51
|
+
span(span) {
|
|
52
|
+
return this.#fork({ span });
|
|
53
|
+
}
|
|
54
|
+
/** Capability gate for this field — see `MetaBoxFieldBase.capability`. */
|
|
55
|
+
capability(capability) {
|
|
56
|
+
return this.#fork({ capability });
|
|
57
|
+
}
|
|
58
|
+
/** Opt this field's value into public REST responses (default-deny). */
|
|
59
|
+
showInApi() {
|
|
60
|
+
return this.#fork({ showInApi: true });
|
|
61
|
+
}
|
|
62
|
+
/** Rule factory: this field's value equals `value` — pass the rule
|
|
63
|
+
* to a dependent field's `.visibleWhen()`. */
|
|
64
|
+
is(value) {
|
|
65
|
+
return { key: this.#key, op: "eq", value };
|
|
66
|
+
}
|
|
67
|
+
/** Rule factory: this field's value differs from `value`. */
|
|
68
|
+
isNot(value) {
|
|
69
|
+
return { key: this.#key, op: "neq", value };
|
|
70
|
+
}
|
|
71
|
+
/** Rule factory: this field has no value (unset or cleared). */
|
|
72
|
+
isEmpty() {
|
|
73
|
+
return { key: this.#key, op: "empty" };
|
|
74
|
+
}
|
|
75
|
+
/** Rule factory: this field has a value. */
|
|
76
|
+
isNotEmpty() {
|
|
77
|
+
return { key: this.#key, op: "not_empty" };
|
|
78
|
+
}
|
|
79
|
+
/** Rule factory: the switch is on. */
|
|
80
|
+
isOn() {
|
|
81
|
+
return { key: this.#key, op: "eq", value: true };
|
|
82
|
+
}
|
|
83
|
+
/** Rule factory: the switch is off. `neq true` rather than
|
|
84
|
+
* `eq false`, so an unset toggle (which renders as off) counts. */
|
|
85
|
+
isOff() {
|
|
86
|
+
return { key: this.#key, op: "neq", value: true };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Show this field only when every rule passes (one AND group) —
|
|
90
|
+
* rules come from sibling fields' condition factories. Replaces any
|
|
91
|
+
* previously declared condition; `.orVisibleWhen()` adds
|
|
92
|
+
* alternatives.
|
|
93
|
+
*/
|
|
94
|
+
visibleWhen(...rules) {
|
|
95
|
+
return this.#fork({ visibleWhen: [rules] });
|
|
96
|
+
}
|
|
97
|
+
/** Add an OR alternative — one more AND group of rules. */
|
|
98
|
+
orVisibleWhen(...rules) {
|
|
99
|
+
return this.#fork({
|
|
100
|
+
visibleWhen: [...(this.#state.visibleWhen ?? []), rules],
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** Normalising transform, applied after coercion and before persistence. */
|
|
104
|
+
sanitize(sanitize) {
|
|
105
|
+
return this.#fork({ sanitize: sanitize });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Custom validation — `true` for valid, or an i18n-able failure
|
|
109
|
+
* message (sync or async). Runs after `.sanitize()` and the
|
|
110
|
+
* declarative constraints.
|
|
111
|
+
*/
|
|
112
|
+
validate(validate) {
|
|
113
|
+
return this.#fork({ validate: validate });
|
|
114
|
+
}
|
|
115
|
+
/** Compile the chain into the wire/manifest field definition. */
|
|
116
|
+
build() {
|
|
117
|
+
return {
|
|
118
|
+
...this.#state,
|
|
119
|
+
key: this.#key,
|
|
120
|
+
label: this.#state.label ?? humanizeFieldKey(this.#key),
|
|
121
|
+
type: "boolean",
|
|
122
|
+
inputType: "toggle",
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
_a = ToggleFieldBuilder;
|
|
127
|
+
/**
|
|
128
|
+
* Boolean switch field — `toggle("featured").onText("Yes").offText("No")`.
|
|
129
|
+
* Reads as `boolean | undefined`, narrowed by `.required()` /
|
|
130
|
+
* `.default()`.
|
|
131
|
+
*/
|
|
132
|
+
export function toggle(key) {
|
|
133
|
+
return new ToggleFieldBuilder(key);
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../../src/plugin/fields/toggle.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAiBhD;;;;;;GAMG;AACH,MAAM,OAAO,kBAAkB;IAapB,IAAI,CAAI;IACR,MAAM,CAAmB;IAElC,YAAY,GAAM,EAAE,QAA0B,EAAE;QAC9C,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,KAAK,CACH,KAAgC;QAEhC,OAAO,IAAI,EAAkB,CAAY,IAAI,CAAC,IAAI,EAAE;YAClD,GAAG,IAAI,CAAC,MAAM;YACd,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;IAED,oDAAoD;IACpD,MAAM,CAAC,MAAa;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,qDAAq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AG,EAAE,IAAI,CAAC,IAAI;YACd,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;YACvD,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,QAAQ;SACpB,CAAC;IACJ,CAAC;CACF;;AAED;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAmB,GAAM;IAC7C,OAAO,IAAI,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { UserRole } from "../../db/schema/users.js";
|
|
2
|
-
import
|
|
3
|
-
import type { MetaBoxFieldSpan, UserMetaBoxField } from "../manifest.js";
|
|
2
|
+
import { ReferenceFieldBuilder } from "./reference.js";
|
|
4
3
|
/**
|
|
5
4
|
* Public scope shape for the `user()` reference field. Carried on
|
|
6
5
|
* the field's `referenceTarget.scope`; the user `LookupAdapter`
|
|
@@ -8,36 +7,25 @@ import type { MetaBoxFieldSpan, UserMetaBoxField } from "../manifest.js";
|
|
|
8
7
|
* read-time orphan resolution.
|
|
9
8
|
*/
|
|
10
9
|
export interface UserFieldScope {
|
|
11
|
-
/** Restrict matches to these roles. Empty/absent → any role. */
|
|
10
|
+
/** Restrict matches to these roles. Empty/absent → any role. Set via `.roles()`. */
|
|
12
11
|
readonly roles?: readonly UserRole[];
|
|
13
12
|
/**
|
|
14
|
-
* Whether to surface disabled accounts. Default `false` —
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* Whether to surface disabled accounts. Default `false` — disabled
|
|
14
|
+
* users are usually invalid reference targets even though the row
|
|
15
|
+
* still exists. Set via `.includeDisabled()`.
|
|
17
16
|
*/
|
|
18
17
|
readonly includeDisabled?: boolean;
|
|
19
18
|
}
|
|
20
|
-
export interface UserFieldOptions {
|
|
21
|
-
readonly key: string;
|
|
22
|
-
readonly label: Label;
|
|
23
|
-
readonly required?: boolean;
|
|
24
|
-
readonly description?: Label;
|
|
25
|
-
readonly default?: string;
|
|
26
|
-
readonly span?: MetaBoxFieldSpan;
|
|
27
|
-
readonly capability?: string;
|
|
28
|
-
readonly roles?: readonly UserRole[];
|
|
29
|
-
readonly includeDisabled?: boolean;
|
|
30
|
-
}
|
|
31
19
|
/**
|
|
32
|
-
* Build a typed `user` reference field
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* scope). The admin renders a picker that calls the lookup RPC with
|
|
36
|
-
* `{ kind: "user", scope: { roles, includeDisabled } }`.
|
|
20
|
+
* Build a typed `user` reference field — `user("owner")`. Scope is
|
|
21
|
+
* optional and chained (`.roles([...])`, `.includeDisabled()`);
|
|
22
|
+
* `.multiple()` flips to an id array.
|
|
37
23
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* `
|
|
24
|
+
* Storage is the bare user id as a string (an id array under
|
|
25
|
+
* `.multiple()`). Reads hydrate to the user summary by default
|
|
26
|
+
* (`.returns("id")` opts back to the bare id); single reads stay
|
|
27
|
+
* optional (a target can orphan). The admin renders a picker that
|
|
28
|
+
* calls the lookup RPC with `{ kind: "user", scope }`.
|
|
41
29
|
*/
|
|
42
|
-
export declare function user(
|
|
30
|
+
export declare function user<K extends string>(key: K): ReferenceFieldBuilder<"user", K>;
|
|
43
31
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/plugin/fields/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EACnC,GAAG,EAAE,CAAC,GACL,qBAAqB,CAAC,MAAM,EAAE,CAAC,CAAC,CAElC"}
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
+
import { ReferenceFieldBuilder } from "./reference.js";
|
|
1
2
|
/**
|
|
2
|
-
* Build a typed `user` reference field
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* scope). The admin renders a picker that calls the lookup RPC with
|
|
6
|
-
* `{ kind: "user", scope: { roles, includeDisabled } }`.
|
|
3
|
+
* Build a typed `user` reference field — `user("owner")`. Scope is
|
|
4
|
+
* optional and chained (`.roles([...])`, `.includeDisabled()`);
|
|
5
|
+
* `.multiple()` flips to an id array.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
7
|
+
* Storage is the bare user id as a string (an id array under
|
|
8
|
+
* `.multiple()`). Reads hydrate to the user summary by default
|
|
9
|
+
* (`.returns("id")` opts back to the bare id); single reads stay
|
|
10
|
+
* optional (a target can orphan). The admin renders a picker that
|
|
11
|
+
* calls the lookup RPC with `{ kind: "user", scope }`.
|
|
11
12
|
*/
|
|
12
|
-
export function user(
|
|
13
|
-
|
|
14
|
-
roles: options.roles,
|
|
15
|
-
includeDisabled: options.includeDisabled,
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
key: options.key,
|
|
19
|
-
label: options.label,
|
|
20
|
-
type: "string",
|
|
21
|
-
inputType: "user",
|
|
22
|
-
referenceTarget: { kind: "user", scope },
|
|
23
|
-
required: options.required,
|
|
24
|
-
description: options.description,
|
|
25
|
-
default: options.default,
|
|
26
|
-
span: options.span,
|
|
27
|
-
capability: options.capability,
|
|
28
|
-
};
|
|
13
|
+
export function user(key) {
|
|
14
|
+
return new ReferenceFieldBuilder("user", key, {});
|
|
29
15
|
}
|
|
30
16
|
//# sourceMappingURL=user.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/plugin/fields/user.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/plugin/fields/user.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAmBvD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,IAAI,CAClB,GAAM;IAEN,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/plugin/lookup.d.ts
CHANGED
|
@@ -26,6 +26,54 @@ export interface LookupResult {
|
|
|
26
26
|
*/
|
|
27
27
|
readonly href?: string;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Minimum shape of a batched-hydration payload. `id` is the stored
|
|
31
|
+
* reference id (string form) so a hydrated value posted back through
|
|
32
|
+
* a meta write self-heals to the plain id — the same `{ id, ... }`
|
|
33
|
+
* extraction that migrates legacy snapshot values.
|
|
34
|
+
*/
|
|
35
|
+
export interface HydratedReference {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
}
|
|
38
|
+
export interface LookupHydrateOptions<TScope = unknown> {
|
|
39
|
+
readonly ids: readonly string[];
|
|
40
|
+
readonly scope?: TScope;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Read-shape registry for reference kinds, keyed by adapter `kind`.
|
|
44
|
+
* Core declares its own kinds; plugins augment via declaration
|
|
45
|
+
* merging (`declare module "plumix/plugin"`), so the typed-meta layer
|
|
46
|
+
* can resolve a reference field's hydrated value without core knowing
|
|
47
|
+
* plugin-provided kinds.
|
|
48
|
+
*/
|
|
49
|
+
export interface ReferenceHydrationShapes {
|
|
50
|
+
readonly entry: EntryReferenceSummary;
|
|
51
|
+
readonly term: TermReferenceSummary;
|
|
52
|
+
readonly user: UserReferenceSummary;
|
|
53
|
+
}
|
|
54
|
+
/** Hydrated shape of an `entry` reference — enough to render a link. */
|
|
55
|
+
export interface EntryReferenceSummary extends HydratedReference {
|
|
56
|
+
readonly type: string;
|
|
57
|
+
/** `null` mirrors `LookupResult.label`: no human-authored title. */
|
|
58
|
+
readonly title: string | null;
|
|
59
|
+
readonly slug: string;
|
|
60
|
+
/** Permalink; `null` when the entry has no public URL. */
|
|
61
|
+
readonly url: string | null;
|
|
62
|
+
}
|
|
63
|
+
/** Hydrated shape of a `term` reference. */
|
|
64
|
+
export interface TermReferenceSummary extends HydratedReference {
|
|
65
|
+
readonly taxonomy: string;
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly slug: string;
|
|
68
|
+
/** Archive URL; `null` for private taxonomies / nested terms. */
|
|
69
|
+
readonly url: string | null;
|
|
70
|
+
}
|
|
71
|
+
/** Hydrated shape of a `user` reference — public-safe columns only. */
|
|
72
|
+
export interface UserReferenceSummary extends HydratedReference {
|
|
73
|
+
readonly name: string | null;
|
|
74
|
+
readonly slug: string;
|
|
75
|
+
readonly avatarUrl: string | null;
|
|
76
|
+
}
|
|
29
77
|
export interface LookupListOptions<TScope = unknown> {
|
|
30
78
|
readonly query?: string;
|
|
31
79
|
readonly scope?: TScope;
|
|
@@ -49,7 +97,7 @@ export interface LookupListOptions<TScope = unknown> {
|
|
|
49
97
|
* Two methods, one round-trip per call regardless of selection size:
|
|
50
98
|
* - `list` covers search/browse (no `ids`, optional `query`) and
|
|
51
99
|
* resolve-by-id batch (`ids` set, `query` ignored). The meta
|
|
52
|
-
* pipeline (`validateMetaReferences` + `
|
|
100
|
+
* pipeline (`validateMetaReferences` + `hydrateMetaBags`)
|
|
53
101
|
* groups all reference fields by `(kind, scope)` and issues one
|
|
54
102
|
* `list({ ids })` per group, eliminating per-field N+1 on both
|
|
55
103
|
* reads and writes. The `MultiReferencePicker` batches the same
|
|
@@ -62,6 +110,27 @@ export interface LookupAdapter<TScope = unknown> {
|
|
|
62
110
|
list(ctx: AppContext, options: LookupListOptions<TScope>): Promise<readonly LookupResult[]>;
|
|
63
111
|
/** Returns `null` when the target is gone or no longer matches scope (orphan). */
|
|
64
112
|
resolve(ctx: AppContext, id: string, scope?: TScope): Promise<LookupResult | null>;
|
|
113
|
+
/**
|
|
114
|
+
* Batched read-time hydration: resolve `ids` (subject to `scope`)
|
|
115
|
+
* into this kind's hydrated shape (`ReferenceHydrationShapes[kind]`)
|
|
116
|
+
* in one query. Ids that are gone or out of scope are simply absent
|
|
117
|
+
* from the result — the meta pipeline reads absence as an orphan.
|
|
118
|
+
* Optional: kinds without it read as plain ids (orphan-stripped via
|
|
119
|
+
* `list({ ids })`, the pre-hydration behavior).
|
|
120
|
+
*/
|
|
121
|
+
hydrate?(ctx: AppContext, options: LookupHydrateOptions<TScope>): Promise<readonly HydratedReference[]>;
|
|
122
|
+
/**
|
|
123
|
+
* Cache tags a hydrated payload contributes to the page that embeds it,
|
|
124
|
+
* so editing or deleting the referenced entity purges the pages that
|
|
125
|
+
* hydrated it (#1508). Called once per hydrated payload during
|
|
126
|
+
* read-time hydration; the tags fold into the embedding page's stored
|
|
127
|
+
* cache tags. Return the same tag the entity's own purge enqueues —
|
|
128
|
+
* the entry adapter returns `e:<id>`, the precise per-entity tag. Kinds
|
|
129
|
+
* whose entities carry no per-entity purge identity (e.g. `user`) omit
|
|
130
|
+
* this method; their references embed without a cache-tag dependency.
|
|
131
|
+
* Optional.
|
|
132
|
+
*/
|
|
133
|
+
embeddedCacheTags?(payload: HydratedReference): readonly string[];
|
|
65
134
|
}
|
|
66
135
|
export interface RegisteredLookupAdapter<TScope = unknown> extends LookupAdapterOptions<TScope> {
|
|
67
136
|
readonly kind: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/plugin/lookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AASpD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB,CAAC,MAAM,GAAG,OAAO;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa,CAAC,MAAM,GAAG,OAAO;IAC7C,IAAI,CACF,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,GACjC,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAAC;IAEpC,kFAAkF;IAClF,OAAO,CACL,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/plugin/lookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AASpD,MAAM,WAAW,YAAY;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