import * as _nuxt_schema from '@nuxt/schema'; import { EponymeLocaleDefinition } from '../dist/runtime/locales/index.js'; export { EponymeLocaleDefinition, EponymeMessageKey } from '../dist/runtime/locales/index.js'; import { EponymePublicationOption } from '../dist/runtime/utils/eponyme-publication.js'; import { EponymeCdnProvider, EponymeCdnDependency } from '../dist/runtime/types/cdn.js'; export { EponymeBlock, EponymeBlockDefinition, EponymeBlockOptions, EponymeBlockOverrides, collection, defineBlock, defineEponymeConfig, defineEponymeField, defineEponymeRoles, defineEponymeVariables, form, permission } from './eponyme.mjs'; export { field, toMs, today } from '../dist/runtime/fields/index.js'; export { EponymeResolvedSeo, EponymeSeoDefinition, EponymeSeoValue, SeoFieldOptions, isEponymeSeoExcludedFromSitemap, resolveEponymeSeo } from '../dist/runtime/fields/seo.js'; export { EponymeSeoHead, EponymeSeoHeadOptions, buildEponymeSeoHead } from '../dist/runtime/utils/eponyme-seo-head.js'; export { EPONYME_DEFAULT_ROLES, EPONYME_PERMISSION_ACTIONS, EPONYME_SYSTEM_RESOURCES } from '../dist/runtime/types/permissions.js'; export { eponymeMediaEmbedUrl, eponymeMediaThumbnailUrl, parseEponymeMediaUrl } from '../dist/runtime/utils/media-player.js'; export { EponymeImageAttrs, EponymeImageAttrsOptions, eponymeImageAttrs, eponymeImageObjectPosition, eponymeImageSrc, parseEponymeImageRatio, toEponymeImageValue } from '../dist/runtime/utils/image-value.js'; export { ArrayFieldDefinition, ArrayFieldOptions, ArrayItemDefinition, ArrayItemFieldDefinition, ArrayItemSchema, ArrayItemValue, BooleanFieldDefinition, BooleanFieldOptions, CheckboxGroupFieldDefinition, CheckboxGroupFieldOptions, CollectionSlugField, ColorFieldDefinition, ColorFieldOptions, DateFieldDefinition, DateFieldOptions, DateTimeFieldDefinition, DateTimeFieldOptions, DurationFieldDefinition, DurationFieldOptions, DurationInput, EmailFieldDefinition, EmailFieldOptions, EponymeAuthSession, EponymeAuthUser, EponymeCacheFailureContext, EponymeCacheOperation, EponymeCdnDependency, EponymeCdnProvider, EponymeCdnPurgeContext, EponymeCdnPurgeFailedContext, EponymeCdnPurgeRequest, EponymeCollectionDataByName, EponymeCollectionDefinition, EponymeCollectionDefinitionBase, EponymeCollectionName, EponymeCollectionOptions, EponymeConfig, EponymeCustomFieldComponentProps, EponymeCustomFieldDefinition, EponymeCustomFieldOptions, EponymeCustomFieldTypeDefinition, EponymeCustomFieldValues, EponymeData, EponymeDataByName, EponymeEntryBeforeSaveContext, EponymeEntryContext, EponymeEntryTrashContext, EponymeFormDataByName, EponymeFormDefinition, EponymeFormDefinitionBase, EponymeFormFieldDefinition, EponymeFormMode, EponymeFormName, EponymeFormOptions, EponymeFormSchema, EponymeFormSubmissionContext, EponymeHooks, EponymeImageCrop, EponymeImageFocal, EponymeImageInput, EponymeImageRatio, EponymeImageValue, EponymeManagedUserResult, EponymeName, EponymePermissionAction, EponymePermissionRule, EponymePermissionTarget, EponymeResource, EponymeResourceKind, EponymeRole, EponymeRoleDefinition, EponymeRoleDefinitions, EponymeRoleOption, EponymeSchema, EponymeSystemResource, EponymeVariableDefinition, EponymeVariableSummary, EponymeVariableValue, EponymeVariables, FieldDefinition, FieldValidationResult, FieldValidator, FieldVisibilityCondition, ImageFieldDefinition, ImageFieldOptions, ImageSource, InferEponymeCustomFieldOptions, InferEponymeCustomFieldValue, MediaPlayerFieldDefinition, MediaPlayerFieldOptions, MediaPlayerProvider, MediaPlayerValue, NormalizedDurationFieldOptions, NumberFieldDefinition, NumberFieldOptions, RadioFieldDefinition, RadioFieldOptions, RichTextFieldDefinition, RichTextFieldOptions, SectionFieldDefinition, SectionFieldOptions, SectionItemFieldDefinition, SectionItemValue, SectionSchema, SectionValue, SelectFieldDefinition, SelectFieldOptions, SelectOption, SlugFieldDefinition, SlugFieldOptions, StringFieldDefinition, StringFieldOptions, TabDefinition, TabFieldDefinition, TabFieldOptions, TabsSchema, TabsValue, TextareaFieldDefinition, TextareaFieldOptions, TodayDateDefault, UrlFieldDefinition, UrlFieldOptions, UrlType, UrlValue } from '../dist/runtime/types/index.js'; export { EponymePopulateDepth, EponymePopulatedData, EponymeReferrer, EponymeRelationTarget, EponymeSchemaByName } from '../dist/runtime/types/relations.js'; import '../dist/runtime/types/field.js'; import '../dist/runtime/types/variables.js'; /** * Options read from the `eponyme` key of `nuxt.config`. * * @example * ```ts * export default defineNuxtConfig({ * modules: ['@karibsen/eponyme'], * eponyme: { * prismaClient: '~~/server/utils/prisma', * previewPaths: { * homepage: '/', * articles: '/articles/:slug', * }, * }, * }) * ``` */ interface ModuleOptions { /** * Route the dashboard is served on. * * @default "/__eponyme" */ dashboardPath?: string; /** * Public route rendering each entry, keyed by singleton name or by collection name. A collection value * must contain `:slug`. * * @default {} * @example * ```ts * previewPaths: { * homepage: '/', * articles: '/articles/:slug', * } * ``` */ previewPaths?: Record; /** * Module specifier of a server file whose default export is an initialised `PrismaClient`. * * @example * ```ts * prismaClient: '~~/server/utils/prisma' * ``` * @see https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/introduction */ prismaClient: string; /** * Palette offered by every color field, which a field overrides with its own `presets`. * * @default [] * @example * ```ts * colorPresets: [ * { label: 'Ink', value: '#171714' }, * '#ffffff', * ] * ``` */ colorPresets?: Array; /** * Whether the editor offers the publication tab: current status, scheduling, unpublishing and reverting * to draft. * * @default true * @example * ```ts * publication: { * 'pages/homepage': false, * articles: false, * } * ``` */ publication?: EponymePublicationOption; auth?: { /** * Lifetime of an authenticated session, in days, counted from sign-in and never extended by activity. * * @default 7 */ sessionDurationDays?: number; }; /** Retention of the audit log. */ audit?: { /** Number of days audit events are retained. @default 365 */ retentionDays?: number; /** How often the cleanup job may run, whatever the schedule calls it. @default 24 */ pruneIntervalHours?: number; }; /** File storage: the media library, uploads, and what `field.file()` writes into. */ storage?: { /** * Path to the factory file, relative to the project root. * * @default "eponyme.storage.ts" */ driver?: string; /** * Key prefix every upload is written under, and the only part of the bucket the media routes can reach. * * @default "uploads" */ prefix?: string; /** * Largest accepted upload, in bytes. * * @default 26214400 – 25 MiB */ maxSize?: number; /** * Media types uploads are restricted to; `image/*` style wildcards are understood. Empty accepts * anything a browser does not run: SVG, HTML and the other active formats are always refused. * * @default [] * @example ['image/*', 'application/pdf'] */ accept?: string[]; /** * Serves every object through the application, to sessions holding `media.read`, and never caches it * publicly. The bucket itself must be private too: this closes the module's own read route, not a * public origin the driver may hand out. * * @default false */ private?: boolean; }; rateLimits?: { /** Login attempts per client address and minute. @default 10 */ loginPerIp?: number; /** Login attempts across the deployment and minute. @default 300 */ loginGlobal?: number; /** Failed login attempts per account and 15 minutes. @default 5 */ loginAccountFailures?: number; /** Managed-form submissions per client address, form and minute. @default 5 */ formPerIp?: number; /** Managed-form submissions per form across the deployment and minute. @default 100 */ formGlobal?: number; }; /** * How long content already read may be reused, in seconds. `0` disables it. Without `cacheStorage` this * is the window of the in-process cache; with it, the window of the shared one. * * @default 5 */ cacheSeconds?: number; /** * Name of a Nitro storage mount the content cache is shared through, typically Redis. Left out, the * cache stays in the memory of each instance. * * @see https://nitro.build/guide/storage */ cacheStorage?: string; /** * Whether the filterable index is rebuilt at startup when the configuration that produced it has changed. * * @default true */ autoReindex?: boolean; /** * How long a browser may reuse published content, in seconds. * * @default 30 * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control */ browserCacheSeconds?: number; /** * How long a CDN may reuse published content, in seconds. * * @default 300 * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control */ cdnCacheSeconds?: number; /** How far a read may resolve relations with `depth`. */ relations?: { /** * Deepest `depth` a read may ask for, server helpers included. A deeper request is refused rather than * silently cut short. At most 5. * * @default 3 */ maxDepth?: number; }; /** * Language of the dashboard interface, resolved once at build time. * * @default undefined – English * @example * ```ts * import { fr } from '@eponyme/locale/fr' * export default defineNuxtConfig({ * eponyme: { * locale: fr({ 'array.add': 'Ajouter un bloc' }), * }, * }) * ``` */ locale?: EponymeLocaleDefinition; /** * Public origin of the site, used to make canonical and sharing URLs absolute (`useEponymeSeo`). Falls * back to `runtimeConfig.public.siteUrl`, then to the origin of the request. * * @example 'https://example.com' */ siteUrl?: string; /** * Purges the CDN on its own when content changes: publication, unpublication, scheduling, restore, * trash and deletion. Off unless a provider is set. Credentials are read from the environment only: * `EPONYME_CDN_CLOUDFLARE_API_TOKEN` and `EPONYME_CDN_CLOUDFLARE_ZONE_ID` for Cloudflare, nothing for * Vercel, which hands its purge API to the function itself. * * @example * ```ts * cdn: { * provider: 'vercel', * dependencies: [ * { on: ['club'], routes: ['/**'] }, * { on: '*', routes: ['/sitemap.xml'] }, * ], * } * ``` */ cdn?: EponymeCdnOptions; } interface EponymeCdnOptions { /** `custom` sends every purge to the `eponyme:cdn:purge` Nitro hook instead of an API. */ provider: EponymeCdnProvider; /** Cached responses that show content without carrying its tags: layouts, listings, aggregates. */ dependencies?: EponymeCdnDependency[]; /** Tags purged on every change, whatever changed. */ alwaysPurge?: string[]; /** * Tags public responses at request time, from `previewPaths` and `dependencies`, and on Vercel tags the * ISR entry itself, which a response header does not do. * * @default true */ tagResponses?: boolean; /** How long a purge waits for others to merge with, in milliseconds. @default 250 */ debounceMs?: number; /** Further attempts after a failed purge. @default 2 */ retries?: number; /** Longest one attempt may take, in milliseconds. @default 10000 */ timeoutMs?: number; /** * Makes the write wait for its purge. Only useful on a serverless platform without `waitUntil`, where * the function would otherwise stop before the purge leaves; Vercel has one. * * @default false */ await?: boolean; vercel?: { /** `invalidate` serves the stale copy once while it regenerates; `delete` drops it. @default 'invalidate' */ mode?: 'invalidate' | 'delete'; }; cloudflare?: { /** Not a secret, so it may be written here. `EPONYME_CDN_CLOUDFLARE_ZONE_ID` takes precedence. */ zoneId?: string; }; } declare const _default: _nuxt_schema.NuxtModule; export { _default as default }; export type { EponymeCdnOptions, ModuleOptions };