@lupinum/ginko-content 0.1.6 → 0.2.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/compatibility.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cms-contract/build.js +15 -20
- package/dist/cms-contract/types.d.ts +12 -7
- package/dist/core/content/document +1 -0
- package/dist/core/content/document.d.ts +16 -0
- package/dist/core/content/document.js +2 -0
- package/dist/core/content/graph.d.ts +3 -1
- package/dist/core/content/graph.js +21 -20
- package/dist/core/content/locale.d.ts +6 -1
- package/dist/core/content/locale.js +17 -6
- package/dist/core/content/path.d.ts +5 -5
- package/dist/core/content/path.js +8 -8
- package/dist/core/content/snapshot +1 -0
- package/dist/core/content/snapshot.d.ts +25 -0
- package/dist/core/content/snapshot.js +99 -0
- package/dist/core/provider-errors.d.ts +1 -1
- package/dist/core/provider-errors.js +1 -0
- package/dist/core/query/builder.js +3 -3
- package/dist/core/query/execute.js +75 -36
- package/dist/core/query/filter.js +2 -2
- package/dist/core/query/lower.js +79 -3
- package/dist/core/query/params.js +7 -7
- package/dist/core/query/plan.d.ts +18 -0
- package/dist/core/query/plan.js +7 -0
- package/dist/core/references/resolve.js +6 -9
- package/dist/features/agent/agent-markdown +1 -0
- package/dist/features/agent/agent-markdown.d.ts +116 -0
- package/dist/features/agent/agent-markdown.js +138 -0
- package/dist/features/agent/walker +1 -0
- package/dist/features/agent/walker.d.ts +10 -0
- package/dist/features/agent/walker.js +174 -0
- package/dist/features/collections/resolve.d.ts +2 -2
- package/dist/features/collections/resolve.js +19 -16
- package/dist/features/localization/links.js +1 -1
- package/dist/features/localization/results.d.ts +3 -3
- package/dist/features/localization/results.js +46 -41
- package/dist/features/localization/translated-slugs.js +5 -5
- package/dist/features/navigation/build.d.ts +2 -2
- package/dist/features/navigation/build.js +23 -26
- package/dist/features/navigation/canonical.d.ts +10 -11
- package/dist/features/navigation/canonical.js +26 -21
- package/dist/features/navigation/resolve.js +4 -4
- package/dist/features/navigation/tree.js +3 -3
- package/dist/{runtime → features}/query/backlinks.js +3 -5
- package/dist/{runtime → features}/query/documents.js +1 -1
- package/dist/{runtime → features}/query/localized-docs.d.ts +1 -1
- package/dist/{runtime → features}/query/localized-docs.js +3 -6
- package/dist/{runtime → features}/query/navigation.d.ts +1 -1
- package/dist/{runtime → features}/query/navigation.js +8 -8
- package/dist/{runtime → features}/query/populate.js +6 -14
- package/dist/{runtime → features}/query/unified.d.ts +4 -4
- package/dist/{runtime → features}/query/unified.js +4 -2
- package/dist/{runtime → features}/query/variants.js +4 -4
- package/dist/features/search/navigation.js +2 -2
- package/dist/features/search/sections.d.ts +1 -1
- package/dist/features/search/sections.js +1 -1
- package/dist/features/sitemap/query.d.ts +5 -5
- package/dist/features/sitemap/query.js +6 -6
- package/dist/integrations/nitro/ingest.js +9 -20
- package/dist/integrations/nitro/storage.d.ts +1 -0
- package/dist/integrations/nitro/storage.js +22 -8
- package/dist/module.d.mts +135 -812
- package/dist/module.json +1 -1
- package/dist/module.mjs +70 -27
- package/dist/parsers/csv.js +3 -3
- package/dist/parsers/index.js +3 -3
- package/dist/parsers/json.js +8 -6
- package/dist/parsers/markdown-plugins.js +9 -5
- package/dist/parsers/markdown.js +7 -6
- package/dist/parsers/path-meta.js +21 -19
- package/dist/parsers/reserved +1 -0
- package/dist/parsers/reserved.d.ts +15 -0
- package/dist/parsers/reserved.js +35 -0
- package/dist/parsers/yaml.js +6 -4
- package/dist/public/agent +1 -0
- package/dist/public/agent.d.ts +17 -0
- package/dist/public/agent.js +34 -0
- package/dist/public/client.d.ts +2 -3
- package/dist/public/client.js +1 -2
- package/dist/public/provider-query +1 -0
- package/dist/public/provider-query.d.ts +58 -0
- package/dist/public/provider-query.js +5 -0
- package/dist/public/provider.d.ts +8 -3
- package/dist/public/provider.js +2 -0
- package/dist/public/server.d.ts +7 -12
- package/dist/public/server.js +5 -36
- package/dist/runtime/app/components/ContentRenderer.d.vue.ts +3 -3
- package/dist/runtime/app/components/ContentRenderer.vue +2 -2
- package/dist/runtime/app/components/ContentRenderer.vue.d.ts +3 -3
- package/dist/runtime/app/components/ContentRendererInline.d.vue.ts +1 -1
- package/dist/runtime/app/components/ContentRendererInline.vue.d.ts +1 -1
- package/dist/runtime/app/components/Prose/ProseImg.d.vue.ts +4 -4
- package/dist/runtime/app/components/Prose/ProseImg.vue.d.ts +4 -4
- package/dist/runtime/app/components/Prose/ProsePre.d.vue.ts +1 -1
- package/dist/runtime/app/components/Prose/ProsePre.vue.d.ts +1 -1
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.d.vue.ts +1 -1
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue +4 -4
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue.d.ts +1 -1
- package/dist/runtime/app/components/internal/MarkdownRenderer.d.ts +3 -3
- package/dist/runtime/app/composables/preview.d.ts +1 -1
- package/dist/runtime/app/composables/query-api.d.ts +5 -5
- package/dist/runtime/app/composables/query-api.js +5 -3
- package/dist/runtime/app/composables/route.d.ts +1 -1
- package/dist/runtime/app/composables/route.js +4 -4
- package/dist/runtime/app/composables/search.js +1 -1
- package/dist/runtime/app/composables/use-content-document.js +1 -1
- package/dist/runtime/app/composables/use-content-list.js +1 -1
- package/dist/runtime/app/composables/use-content-navigation.js +2 -2
- package/dist/runtime/app/composables/use-content-page.js +4 -4
- package/dist/runtime/app/pages/content.vue +2 -1
- package/dist/runtime/markdown/plugins.js +6 -8
- package/dist/runtime/server/agent-markdown.d.ts +5 -65
- package/dist/runtime/server/agent-markdown.js +40 -315
- package/dist/runtime/server/agent-site.js +1 -1
- package/dist/runtime/server/api/agent-raw.js +1 -1
- package/dist/runtime/server/api/cache.d.ts +1 -1
- package/dist/runtime/server/api/cache.js +43 -4
- package/dist/runtime/server/api/locales.js +3 -3
- package/dist/runtime/server/api/navigation.d.ts +1 -1
- package/dist/runtime/server/api/navigation.js +3 -1
- package/dist/runtime/server/api/query.js +2 -2
- package/dist/runtime/server/api/search-index.d.ts +1 -1
- package/dist/runtime/server/api/sitemap.d.ts +1 -1
- package/dist/runtime/server/cache-adapters.d.ts +18 -0
- package/dist/runtime/server/cache-adapters.js +12 -0
- package/dist/runtime/server/collection-helpers.d.ts +2 -2
- package/dist/runtime/server/collection-helpers.js +15 -11
- package/dist/runtime/server/index.d.ts +6 -4
- package/dist/runtime/server/index.js +10 -3
- package/dist/runtime/server/middleware/agent-link-headers.js +1 -1
- package/dist/runtime/server/middleware/agent-markdown.js +1 -1
- package/dist/runtime/server/navigation-query.d.ts +2 -2
- package/dist/runtime/server/navigation-query.js +52 -7
- package/dist/runtime/server/navigation.d.ts +1 -1
- package/dist/runtime/server/provider-document +1 -0
- package/dist/runtime/server/provider-document.d.ts +59 -0
- package/dist/runtime/server/provider-document.js +48 -0
- package/dist/runtime/server/provider-query-wire +1 -0
- package/dist/runtime/server/provider-query-wire.d.ts +32 -0
- package/dist/runtime/server/provider-query-wire.js +27 -0
- package/dist/runtime/server/provider-query.d.ts +18 -9
- package/dist/runtime/server/provider-query.js +62 -28
- package/dist/runtime/server/provider-result.d.ts +4 -4
- package/dist/runtime/server/providers/filesystem.js +3 -11
- package/dist/runtime/server/providers/index.d.ts +18 -1
- package/dist/runtime/server/providers/index.js +72 -20
- package/dist/runtime/server/query-api.d.ts +5 -5
- package/dist/runtime/server/query-api.js +9 -6
- package/dist/runtime/server/query-executor.d.ts +3 -3
- package/dist/runtime/server/query-executor.js +43 -59
- package/dist/runtime/server/search.d.ts +1 -1
- package/dist/runtime/server/search.js +4 -4
- package/dist/runtime/server/sitemap.js +5 -5
- package/dist/runtime/server/storage-access.d.ts +4 -1
- package/dist/runtime/server/storage-access.js +27 -2
- package/dist/runtime/transformers/component-resolver.d.ts +1 -1
- package/dist/storage/content.d.ts +2 -6
- package/dist/storage/content.js +19 -8
- package/dist/storage/contents.d.ts +9 -1
- package/dist/storage/contents.js +26 -19
- package/dist/storage/driver.d.ts +2 -2
- package/dist/storage/driver.js +2 -1
- package/dist/storage/graph.js +4 -0
- package/dist/storage/manifest.js +3 -1
- package/dist/storage/references.js +9 -5
- package/dist/storage/snapshot-runtime +1 -0
- package/dist/storage/snapshot-runtime.d.ts +11 -0
- package/dist/storage/snapshot-runtime.js +46 -0
- package/dist/storage/validation.d.ts +1 -1
- package/dist/storage/validation.js +47 -102
- package/dist/testing/provider-contract.d.ts +14 -4
- package/dist/testing/provider-contract.js +121 -68
- package/dist/testing/provider-fixture.d.ts +1 -1
- package/dist/testing/provider-fixture.js +124 -120
- package/dist/types/config.d.ts +8 -4
- package/dist/types/content.d.ts +104 -70
- package/dist/types/fields.js +1 -1
- package/dist/types/module.d.ts +1 -1
- package/dist/types/query-parts/public.d.ts +14 -5
- package/dist/types/query-parts/results.d.ts +6 -2
- package/dist/types/query-parts/transport.d.ts +19 -0
- package/dist/types/virtual.d.ts +6 -0
- package/dist/types.d.mts +2 -2
- package/dist/web-types.json +1 -1
- package/package.json +39 -9
- package/dist/runtime/app/plugins/markdown-components +0 -1
- package/dist/runtime/app/plugins/markdown-components.d.ts +0 -2
- package/dist/runtime/app/plugins/markdown-components.js +0 -19
- /package/dist/{runtime → features/agent}/agent-paths +0 -0
- /package/dist/{runtime → features/agent}/agent-paths.d.ts +0 -0
- /package/dist/{runtime → features/agent}/agent-paths.js +0 -0
- /package/dist/{runtime → features}/query/backlinks +0 -0
- /package/dist/{runtime → features}/query/backlinks.d.ts +0 -0
- /package/dist/{runtime → features}/query/context +0 -0
- /package/dist/{runtime → features}/query/context.d.ts +0 -0
- /package/dist/{runtime → features}/query/context.js +0 -0
- /package/dist/{runtime → features}/query/documents +0 -0
- /package/dist/{runtime → features}/query/documents.d.ts +0 -0
- /package/dist/{runtime → features}/query/errors +0 -0
- /package/dist/{runtime → features}/query/errors.d.ts +0 -0
- /package/dist/{runtime → features}/query/errors.js +0 -0
- /package/dist/{runtime → features}/query/handles +0 -0
- /package/dist/{runtime → features}/query/handles.d.ts +0 -0
- /package/dist/{runtime → features}/query/handles.js +0 -0
- /package/dist/{runtime → features}/query/locale-options +0 -0
- /package/dist/{runtime → features}/query/locale-options.d.ts +0 -0
- /package/dist/{runtime → features}/query/locale-options.js +0 -0
- /package/dist/{runtime → features}/query/localized-docs +0 -0
- /package/dist/{runtime → features}/query/navigation +0 -0
- /package/dist/{runtime → features}/query/pagination +0 -0
- /package/dist/{runtime → features}/query/pagination.d.ts +0 -0
- /package/dist/{runtime → features}/query/pagination.js +0 -0
- /package/dist/{runtime → features}/query/populate +0 -0
- /package/dist/{runtime → features}/query/populate.d.ts +0 -0
- /package/dist/{runtime → features}/query/public-limits +0 -0
- /package/dist/{runtime → features}/query/public-limits.d.ts +0 -0
- /package/dist/{runtime → features}/query/public-limits.js +0 -0
- /package/dist/{runtime → features}/query/resolve +0 -0
- /package/dist/{runtime → features}/query/resolve.d.ts +0 -0
- /package/dist/{runtime → features}/query/resolve.js +0 -0
- /package/dist/{runtime → features}/query/responses +0 -0
- /package/dist/{runtime → features}/query/responses.d.ts +0 -0
- /package/dist/{runtime → features}/query/responses.js +0 -0
- /package/dist/{runtime → features}/query/routes +0 -0
- /package/dist/{runtime → features}/query/routes.d.ts +0 -0
- /package/dist/{runtime → features}/query/routes.js +0 -0
- /package/dist/{runtime → features}/query/unified +0 -0
- /package/dist/{runtime → features}/query/variants +0 -0
- /package/dist/{runtime → features}/query/variants.d.ts +0 -0
package/dist/module.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { ModuleOptions as ModuleOptions$1, ContentContext
|
|
2
|
+
import { ModuleOptions as ModuleOptions$1, ContentContext, ContentRevalidateOptions as ContentRevalidateOptions$1 } from '../dist/types/module';
|
|
3
3
|
import { StorageValue } from 'unstorage';
|
|
4
|
-
import { MarkdownOptions
|
|
4
|
+
import { MarkdownOptions, ParsedContent as ParsedContent$1 } from '../dist/types/content';
|
|
5
5
|
import { ContentCollectionConfig as ContentCollectionConfig$1, ContentCollectionI18nConfig as ContentCollectionI18nConfig$1 } from '../dist/types/config';
|
|
6
6
|
export { agentMetadataFields, defineAgentAppPage, defineAgentMarkdownPolicy, defineAgentMetadataFields, defineAgentSection, defineCollection, defineContentConfig, reference } from '../dist/types/config';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { ContentSearchPublicRuntimeConfig } from '../dist/types/search';
|
|
8
|
+
import { ZodType } from 'zod';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Locale settings for a collection that ships translated variants.
|
|
@@ -40,14 +40,10 @@ interface ContentCmsFieldConfig {
|
|
|
40
40
|
description?: string | null;
|
|
41
41
|
required?: boolean;
|
|
42
42
|
localized?: boolean;
|
|
43
|
-
hidden?: boolean;
|
|
44
43
|
searchable?: boolean;
|
|
45
44
|
sortable?: boolean;
|
|
46
|
-
order?: number;
|
|
47
|
-
width?: 'full' | 'half';
|
|
48
45
|
defaultValue?: unknown;
|
|
49
46
|
validation?: Record<string, unknown> | null;
|
|
50
|
-
condition?: Record<string, unknown> | null;
|
|
51
47
|
options?: string[] | null;
|
|
52
48
|
relation?: ContentCmsRelationConfig | null;
|
|
53
49
|
fields?: Record<string, ContentCmsFieldConfig> | ContentCmsFieldConfig[] | null;
|
|
@@ -56,6 +52,14 @@ interface ContentCmsFieldConfig {
|
|
|
56
52
|
step?: number | null;
|
|
57
53
|
slugFrom?: string | null;
|
|
58
54
|
language?: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Opaque editor-layout passthrough. ginko-content does not type or interpret
|
|
57
|
+
* this bag; it stores and forwards it byte-for-byte through `buildCmsContract`
|
|
58
|
+
* to the CMS field contract. Pure layout policy (field width, display order,
|
|
59
|
+
* hidden state, conditional visibility, etc.) belongs here — its schema is
|
|
60
|
+
* owned entirely by the consuming CMS (e.g. `@lupinum/ginko-cms`).
|
|
61
|
+
*/
|
|
62
|
+
editor?: Record<string, unknown>;
|
|
59
63
|
}
|
|
60
64
|
interface ContentCmsCollectionConfig {
|
|
61
65
|
label?: string | Record<string, string>;
|
|
@@ -83,77 +87,6 @@ interface ContentAgentCollectionConfig {
|
|
|
83
87
|
section?: string;
|
|
84
88
|
markdown?: boolean | ContentAgentMarkdownOptions;
|
|
85
89
|
}
|
|
86
|
-
type ContentAgentLocalizedValue = string | Record<string, string>;
|
|
87
|
-
interface ContentAgentSiteConfig {
|
|
88
|
-
title: ContentAgentLocalizedValue;
|
|
89
|
-
description: ContentAgentLocalizedValue;
|
|
90
|
-
url?: string;
|
|
91
|
-
defaultLocale?: string;
|
|
92
|
-
locales?: string[];
|
|
93
|
-
profile?: string;
|
|
94
|
-
contentSignals?: {
|
|
95
|
-
search?: boolean;
|
|
96
|
-
aiInput?: boolean;
|
|
97
|
-
aiTrain?: boolean;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
interface ContentAgentMarkdownMetadataConfig {
|
|
101
|
-
enabled?: boolean;
|
|
102
|
-
defaultFields?: AgentMetadataFieldList;
|
|
103
|
-
}
|
|
104
|
-
interface ContentAgentMarkdownPolicyConfig {
|
|
105
|
-
metadata?: boolean | AgentMetadataFieldList | ContentAgentMarkdownMetadataConfig;
|
|
106
|
-
}
|
|
107
|
-
interface ContentAgentSectionConfig {
|
|
108
|
-
id: string;
|
|
109
|
-
title: ContentAgentLocalizedValue;
|
|
110
|
-
order?: number;
|
|
111
|
-
}
|
|
112
|
-
interface ContentAgentAppPageContext {
|
|
113
|
-
locale: string;
|
|
114
|
-
defaultLocale?: string;
|
|
115
|
-
siteUrl: string;
|
|
116
|
-
}
|
|
117
|
-
interface ContentAgentAppPageConfig {
|
|
118
|
-
id: string;
|
|
119
|
-
route: ContentAgentLocalizedValue;
|
|
120
|
-
section: string;
|
|
121
|
-
title: ContentAgentLocalizedValue | ((ctx: ContentAgentAppPageContext) => string | Promise<string>);
|
|
122
|
-
description: ContentAgentLocalizedValue | ((ctx: ContentAgentAppPageContext) => string | Promise<string>);
|
|
123
|
-
updated?: string;
|
|
124
|
-
includeInIndex?: boolean;
|
|
125
|
-
includeInFull?: boolean;
|
|
126
|
-
metadata?: AgentMetadataFieldList;
|
|
127
|
-
render: (ctx: ContentAgentAppPageContext) => string | Promise<string>;
|
|
128
|
-
}
|
|
129
|
-
interface ContentAgentConfig {
|
|
130
|
-
site?: ContentAgentSiteConfig;
|
|
131
|
-
markdown?: ContentAgentMarkdownPolicyConfig;
|
|
132
|
-
sections?: ContentAgentSectionConfig[];
|
|
133
|
-
pages?: ContentAgentAppPageConfig[];
|
|
134
|
-
}
|
|
135
|
-
interface ContentAgentRuntimeAppPageConfig extends Omit<ContentAgentAppPageConfig, 'title' | 'description' | 'render'> {
|
|
136
|
-
title: ContentAgentLocalizedValue;
|
|
137
|
-
description: ContentAgentLocalizedValue;
|
|
138
|
-
markdown: ContentAgentLocalizedValue;
|
|
139
|
-
render?: ContentAgentAppPageConfig['render'];
|
|
140
|
-
}
|
|
141
|
-
interface ContentAgentRuntimeConfig extends Omit<ContentAgentConfig, 'pages'> {
|
|
142
|
-
pages?: ContentAgentRuntimeAppPageConfig[];
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Object source shape accepted for Nuxt Content v3 migration.
|
|
146
|
-
*/
|
|
147
|
-
interface ContentCollectionSourceObject {
|
|
148
|
-
/**
|
|
149
|
-
* Source glob or globs included in the collection.
|
|
150
|
-
*/
|
|
151
|
-
include: ContentCollectionSource;
|
|
152
|
-
/**
|
|
153
|
-
* Source glob or globs excluded from the collection.
|
|
154
|
-
*/
|
|
155
|
-
exclude?: ContentCollectionSource;
|
|
156
|
-
}
|
|
157
90
|
/**
|
|
158
91
|
* Declarative collection definition used by `content.config.ts`.
|
|
159
92
|
*/
|
|
@@ -222,61 +155,6 @@ interface ContentCollectionConfig<TSchema extends ZodType | undefined = ZodType
|
|
|
222
155
|
agent?: ContentAgentCollectionConfig;
|
|
223
156
|
}
|
|
224
157
|
type ContentProviderName = 'filesystem' | (string & {});
|
|
225
|
-
type DefineCollectionOptions<TSchema extends ZodType | undefined = ZodType | undefined> = Omit<ContentCollectionConfig<TSchema>, 'source' | 'exclude'>;
|
|
226
|
-
interface DefineCollectionObject<TSchema extends ZodType | undefined = ZodType | undefined> extends DefineCollectionOptions<TSchema> {
|
|
227
|
-
/**
|
|
228
|
-
* Nuxt Content v3-compatible collection kind. Ginko does not keep separate
|
|
229
|
-
* page/data query builders, but the kind remains canonical metadata at runtime.
|
|
230
|
-
* `data` collections default to `sitemap: false`.
|
|
231
|
-
*/
|
|
232
|
-
type: ContentCollectionKind;
|
|
233
|
-
/**
|
|
234
|
-
* Source glob, globs, or v3-compatible `{ include, exclude }` object.
|
|
235
|
-
* Required for filesystem-backed collections; optional for CMS-backed
|
|
236
|
-
* collections.
|
|
237
|
-
*/
|
|
238
|
-
source?: ContentCollectionSource | ContentCollectionSourceObject;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Root object returned from `defineContentConfig`.
|
|
242
|
-
*/
|
|
243
|
-
interface ContentConfig<TCollections extends Record<string, ContentCollectionConfig> = Record<string, ContentCollectionConfig>> {
|
|
244
|
-
/**
|
|
245
|
-
* Content backing implementation. `filesystem` is the default. Provider
|
|
246
|
-
* modules can register named implementations, for example `cms`.
|
|
247
|
-
*/
|
|
248
|
-
provider?: ContentProviderName;
|
|
249
|
-
/**
|
|
250
|
-
* External provider modules keyed by provider name. First-party provider
|
|
251
|
-
* modules register themselves, so app configs usually do not need this.
|
|
252
|
-
*/
|
|
253
|
-
providers?: Record<string, string>;
|
|
254
|
-
/**
|
|
255
|
-
* Agent-facing site map and markdown output. Ginko owns the repetitive
|
|
256
|
-
* `/llms.txt`, raw markdown, and static route plumbing; apps provide site
|
|
257
|
-
* facts and app-owned page renderers here.
|
|
258
|
-
*/
|
|
259
|
-
agent?: ContentAgentConfig;
|
|
260
|
-
/**
|
|
261
|
-
* Named content collections keyed by the identifier used at query time.
|
|
262
|
-
*/
|
|
263
|
-
collections?: TCollections;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Infer the runtime data shape for a collection from its Zod schema.
|
|
267
|
-
*/
|
|
268
|
-
type CollectionSchema<TCollection> = TCollection extends {
|
|
269
|
-
schema?: infer TSchema;
|
|
270
|
-
} ? TSchema extends ZodType ? z.infer<TSchema> : Record<string, unknown> : Record<string, unknown>;
|
|
271
|
-
/**
|
|
272
|
-
* Zod string schema tagged as a Nuxt Content reference field.
|
|
273
|
-
*/
|
|
274
|
-
interface ContentReferenceSchema extends z.ZodString {
|
|
275
|
-
/**
|
|
276
|
-
* Serialized descriptor in the form `__nuxt_content_ref__:<collection>`.
|
|
277
|
-
*/
|
|
278
|
-
description: string;
|
|
279
|
-
}
|
|
280
158
|
/**
|
|
281
159
|
* Typed handle returned by `defineCollection`. Carries the collection's name
|
|
282
160
|
* and i18n discriminator at the type level so the unified query API
|
|
@@ -306,17 +184,6 @@ interface ContentCollectionHandle<Name extends string = string, TSchema extends
|
|
|
306
184
|
*/
|
|
307
185
|
readonly __schema: TSchema;
|
|
308
186
|
}
|
|
309
|
-
type IsI18nConfig<TConfig> = TConfig extends {
|
|
310
|
-
i18n: true | ContentCollectionI18nConfig;
|
|
311
|
-
} ? TConfig['i18n'] extends false ? false : true : false;
|
|
312
|
-
type CollectionNameFromConfigKey<Key extends string, TCollection> = TCollection extends ContentCollectionHandle<infer Name, ZodType | undefined, boolean> ? [Name] extends [never] ? Key : Name : Key;
|
|
313
|
-
type NamedContentCollection<Key extends string, TCollection> = TCollection extends ContentCollectionHandle<infer Name, infer TSchema, infer TI18n> ? Omit<TCollection, 'name' | '__schema' | '__i18n'> & ContentCollectionHandle<[
|
|
314
|
-
Name
|
|
315
|
-
] extends [never] ? Key : Name, TSchema, TI18n> : TCollection extends ContentCollectionConfig<infer TSchema> ? Omit<TCollection, 'name' | '__schema' | '__i18n'> & ContentCollectionHandle<CollectionNameFromConfigKey<Key, TCollection>, TSchema, IsI18nConfig<TCollection>> : TCollection;
|
|
316
|
-
type NamedContentCollections<TCollections extends Record<string, ContentCollectionConfig>> = {
|
|
317
|
-
[Key in keyof TCollections]: Key extends string ? NamedContentCollection<Key, TCollections[Key]> : TCollections[Key];
|
|
318
|
-
};
|
|
319
|
-
declare function normalizeContentConfigCollectionNames<TCollections extends Record<string, ContentCollectionConfig>>(collections: TCollections): NamedContentCollections<TCollections>;
|
|
320
187
|
|
|
321
188
|
type LayoutKey = string;
|
|
322
189
|
interface ContentSeoImage {
|
|
@@ -331,22 +198,80 @@ interface ContentSeoMeta {
|
|
|
331
198
|
image?: string | ContentSeoImage;
|
|
332
199
|
}
|
|
333
200
|
/**
|
|
334
|
-
*
|
|
201
|
+
* Optional file-provenance metadata. Absent for non-filesystem providers
|
|
202
|
+
* (e.g. CMS-backed documents) that have no backing file.
|
|
335
203
|
*/
|
|
336
|
-
interface
|
|
204
|
+
interface ContentFileMeta {
|
|
337
205
|
/**
|
|
338
|
-
*
|
|
206
|
+
* Backing source name when multiple content sources are configured.
|
|
339
207
|
*/
|
|
340
|
-
|
|
208
|
+
source?: string;
|
|
341
209
|
/**
|
|
342
|
-
*
|
|
210
|
+
* Source file path relative to the content root.
|
|
211
|
+
*/
|
|
212
|
+
path?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Path stem (the source path without its extension).
|
|
343
215
|
*/
|
|
344
|
-
|
|
216
|
+
stem?: string;
|
|
217
|
+
/**
|
|
218
|
+
* Parent directory segment of the source file.
|
|
219
|
+
*/
|
|
220
|
+
dir?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Source file basename without extension.
|
|
223
|
+
*/
|
|
224
|
+
basename?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Source file extension.
|
|
227
|
+
*/
|
|
228
|
+
extension?: 'md' | 'yaml' | 'yml' | 'json' | 'json5' | 'csv';
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Per-request locale/reference resolution carrier.
|
|
232
|
+
*
|
|
233
|
+
* Folded from the legacy underscore resolution meta into one object. It is the
|
|
234
|
+
* pre-shaping form of the modern `resolved`/`localePaths`/`variants` envelope:
|
|
235
|
+
* the query pipeline attaches it, and result shaping reads it to build
|
|
236
|
+
* `ContentRouteMeta`. Field names mirror `ContentResolvedMeta` so a consumer
|
|
237
|
+
* can read `resolved.locale`/`resolved.requestedRoute`/… off either a raw
|
|
238
|
+
* document or a fully shaped result.
|
|
239
|
+
*/
|
|
240
|
+
interface ContentDocumentResolution {
|
|
241
|
+
/** Resolved locale after locale fallback. */
|
|
242
|
+
locale?: string;
|
|
243
|
+
/** Requested locale before locale fallback. */
|
|
244
|
+
requestedLocale?: string;
|
|
245
|
+
/** Whether the returned content was resolved through fallback. */
|
|
246
|
+
fallback?: boolean;
|
|
247
|
+
/** Locales that have a concrete variant for this document. */
|
|
248
|
+
availableLocales?: string[];
|
|
249
|
+
/** Map of available locale code to its locale-specific path. */
|
|
250
|
+
variantPaths?: Record<string, string>;
|
|
251
|
+
/** Requested route path before locale fallback. */
|
|
252
|
+
requestedPath?: string;
|
|
253
|
+
/** Requested public route before locale fallback. */
|
|
254
|
+
requestedRoute?: string;
|
|
255
|
+
/** Requested authored reference before locale fallback. */
|
|
256
|
+
requestedRef?: string;
|
|
257
|
+
/** Resolved markdown `$ref` links for the current runtime locale. */
|
|
258
|
+
resolvedRefs?: Record<string, string>;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Internal metadata attached to every parsed content record.
|
|
262
|
+
*/
|
|
263
|
+
interface ParsedContentInternalMeta {
|
|
264
|
+
/**
|
|
265
|
+
* Stable, fully-qualified, locale-suffixed system id for the parsed record.
|
|
266
|
+
* System-computed and reserved: user frontmatter `id` does not override it —
|
|
267
|
+
* use `ref` for a stable authored alias.
|
|
268
|
+
*/
|
|
269
|
+
id: string;
|
|
345
270
|
/**
|
|
346
271
|
* Canonical content path. This is source-agnostic, so the same route can be
|
|
347
272
|
* backed by local files, remote storage, or generated data.
|
|
348
273
|
*/
|
|
349
|
-
|
|
274
|
+
path?: string;
|
|
350
275
|
/**
|
|
351
276
|
* Human-readable title resolved from frontmatter or generated metadata.
|
|
352
277
|
*/
|
|
@@ -366,75 +291,46 @@ interface ParsedContentInternalMeta {
|
|
|
366
291
|
/**
|
|
367
292
|
* Marks the document as a draft.
|
|
368
293
|
*/
|
|
369
|
-
|
|
294
|
+
draft?: boolean;
|
|
370
295
|
/**
|
|
371
296
|
* Marks the document as a partial that should not become a page by default.
|
|
372
297
|
*/
|
|
373
|
-
|
|
298
|
+
partial?: boolean;
|
|
374
299
|
/**
|
|
375
300
|
* Locale code for the concrete variant.
|
|
376
301
|
*/
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Locale-agnostic content identity used to resolve variants.
|
|
380
|
-
*/
|
|
381
|
-
_canonicalKey?: string;
|
|
382
|
-
/**
|
|
383
|
-
* Requested route path before locale fallback.
|
|
384
|
-
*/
|
|
385
|
-
_requestedPath?: string;
|
|
386
|
-
/**
|
|
387
|
-
* Requested public route before locale fallback.
|
|
388
|
-
*/
|
|
389
|
-
_requestedRoute?: string;
|
|
390
|
-
/**
|
|
391
|
-
* Requested authored reference before locale fallback.
|
|
392
|
-
*/
|
|
393
|
-
_requestedRef?: string;
|
|
394
|
-
/**
|
|
395
|
-
* Requested locale before locale fallback.
|
|
396
|
-
*/
|
|
397
|
-
_requestedLocale?: string;
|
|
398
|
-
/**
|
|
399
|
-
* Resolved locale after locale fallback.
|
|
400
|
-
*/
|
|
401
|
-
_resolvedLocale?: string;
|
|
402
|
-
/**
|
|
403
|
-
* Whether the returned content was resolved through fallback.
|
|
404
|
-
*/
|
|
405
|
-
_fallback?: boolean;
|
|
406
|
-
/**
|
|
407
|
-
* Locales that have a concrete variant for this document.
|
|
408
|
-
*/
|
|
409
|
-
_availableLocales?: string[];
|
|
302
|
+
locale?: string;
|
|
410
303
|
/**
|
|
411
|
-
*
|
|
304
|
+
* Opaque, locale-agnostic content identity join key used to resolve variants.
|
|
305
|
+
* Never parse or render this as a URL — under translated slugs it is a numeric
|
|
306
|
+
* identity (e.g. `1/1`), not a path.
|
|
412
307
|
*/
|
|
413
|
-
|
|
308
|
+
canonicalKey?: string;
|
|
414
309
|
/**
|
|
415
|
-
*
|
|
310
|
+
* Per-request locale/reference resolution carrier (folded from the legacy
|
|
311
|
+
* underscore resolution meta). Absent until the query pipeline resolves a
|
|
312
|
+
* variant; shaping reads it to build the `resolved`/`localePaths`/`variants`
|
|
313
|
+
* route envelope.
|
|
416
314
|
*/
|
|
417
|
-
|
|
315
|
+
resolved?: ContentDocumentResolution;
|
|
418
316
|
/**
|
|
419
317
|
* Collection name, when matched by a configured collection glob.
|
|
420
318
|
*/
|
|
421
|
-
|
|
319
|
+
collection?: string;
|
|
422
320
|
/**
|
|
423
|
-
*
|
|
321
|
+
* Internal marker: this parsed record is a folder-scoped `.navigation.yml`
|
|
322
|
+
* configuration document, not a routable page. Providers may expose it so
|
|
323
|
+
* generic filtering can consistently exclude navigation config records.
|
|
424
324
|
*/
|
|
425
|
-
|
|
325
|
+
navigationFile?: boolean;
|
|
426
326
|
/**
|
|
427
327
|
* Parsed document kind.
|
|
428
328
|
*/
|
|
429
|
-
|
|
329
|
+
type?: 'markdown' | 'yaml' | 'json' | 'csv';
|
|
430
330
|
/**
|
|
431
|
-
*
|
|
331
|
+
* File-provenance metadata. Optional: absent for providers with no backing file.
|
|
432
332
|
*/
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Source file extension.
|
|
436
|
-
*/
|
|
437
|
-
_extension?: 'md' | 'yaml' | 'yml' | 'json' | 'json5' | 'csv';
|
|
333
|
+
file?: ContentFileMeta;
|
|
438
334
|
}
|
|
439
335
|
/**
|
|
440
336
|
* One entry in a generated table of contents.
|
|
@@ -462,13 +358,6 @@ type MarkdownPluginOptions = Record<string, unknown>;
|
|
|
462
358
|
* User-authored plugin declaration in module options.
|
|
463
359
|
*/
|
|
464
360
|
type MarkdownPluginDescriptor = string | [string, MarkdownPluginOptions];
|
|
465
|
-
/**
|
|
466
|
-
* Normalized plugin declaration after resolution.
|
|
467
|
-
*/
|
|
468
|
-
type ResolvedMarkdownPlugin = {
|
|
469
|
-
name: string;
|
|
470
|
-
options: MarkdownPluginOptions;
|
|
471
|
-
};
|
|
472
361
|
/**
|
|
473
362
|
* Object-shaped markdown AST node.
|
|
474
363
|
*/
|
|
@@ -491,18 +380,6 @@ interface MarkdownRoot {
|
|
|
491
380
|
props?: Record<string, any>;
|
|
492
381
|
toc?: Toc;
|
|
493
382
|
}
|
|
494
|
-
/**
|
|
495
|
-
* Resolved markdown runtime options.
|
|
496
|
-
*/
|
|
497
|
-
interface MarkdownOptions {
|
|
498
|
-
plugins: ResolvedMarkdownPlugin[];
|
|
499
|
-
tags: Record<string, string>;
|
|
500
|
-
anchorLinks: {
|
|
501
|
-
depth: number;
|
|
502
|
-
exclude: number[];
|
|
503
|
-
};
|
|
504
|
-
image?: 'auto' | 'img' | 'nuxt-image';
|
|
505
|
-
}
|
|
506
383
|
/**
|
|
507
384
|
* Flexible parsed content shape that allows user-defined frontmatter fields.
|
|
508
385
|
*/
|
|
@@ -548,58 +425,6 @@ interface StrictParsedContent extends StrictParsedContentMeta {
|
|
|
548
425
|
*/
|
|
549
426
|
body: MarkdownRoot | null;
|
|
550
427
|
}
|
|
551
|
-
/**
|
|
552
|
-
* Specialized parsed content shape for markdown sources.
|
|
553
|
-
*/
|
|
554
|
-
interface MarkdownParsedContent extends ParsedContent {
|
|
555
|
-
_type: 'markdown';
|
|
556
|
-
/**
|
|
557
|
-
* Whether the markdown source rendered no meaningful body content.
|
|
558
|
-
*/
|
|
559
|
-
_empty: boolean;
|
|
560
|
-
/**
|
|
561
|
-
* Description resolved from frontmatter or excerpt generation.
|
|
562
|
-
*/
|
|
563
|
-
description: string;
|
|
564
|
-
/**
|
|
565
|
-
* Object AST excerpt generated from the markdown body.
|
|
566
|
-
*/
|
|
567
|
-
excerpt?: MarkdownRoot;
|
|
568
|
-
/**
|
|
569
|
-
* Parsed Markdown body with included table of contents.
|
|
570
|
-
*/
|
|
571
|
-
body: MarkdownRoot & {
|
|
572
|
-
toc?: Toc;
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Transformer hook used during ingestion.
|
|
577
|
-
*/
|
|
578
|
-
interface ContentTransformer {
|
|
579
|
-
/**
|
|
580
|
-
* Stable transformer name used in logs and generated manifests.
|
|
581
|
-
*/
|
|
582
|
-
name: string;
|
|
583
|
-
/**
|
|
584
|
-
* File extensions handled by the transformer.
|
|
585
|
-
*/
|
|
586
|
-
extensions: string[];
|
|
587
|
-
/**
|
|
588
|
-
* Optional parse hook that turns raw source content into a parsed document.
|
|
589
|
-
*/
|
|
590
|
-
parse?(id: string, content: StorageValue, options: unknown): Promise<ParsedContent> | ParsedContent;
|
|
591
|
-
/**
|
|
592
|
-
* Optional post-parse hook that mutates or enriches a parsed document.
|
|
593
|
-
*/
|
|
594
|
-
transform?(content: ParsedContent, options: unknown): Promise<ParsedContent> | ParsedContent;
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Ingestion options passed to the transform pipeline.
|
|
598
|
-
*/
|
|
599
|
-
interface TransformContentOptions {
|
|
600
|
-
transformers?: ContentTransformer[];
|
|
601
|
-
[key: string]: unknown;
|
|
602
|
-
}
|
|
603
428
|
/**
|
|
604
429
|
* Navigation node returned by content navigation helpers.
|
|
605
430
|
*/
|
|
@@ -609,17 +434,13 @@ interface NavItem {
|
|
|
609
434
|
* Nuxt Content compatible route path used by Nuxt UI content components.
|
|
610
435
|
*/
|
|
611
436
|
path: string;
|
|
612
|
-
/**
|
|
613
|
-
* Canonical content route without locale prefix.
|
|
614
|
-
*/
|
|
615
|
-
_path: string;
|
|
616
437
|
stem?: string;
|
|
617
438
|
page?: false;
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
439
|
+
id?: string;
|
|
440
|
+
canonicalKey?: string;
|
|
441
|
+
locale?: string;
|
|
442
|
+
fallback?: boolean;
|
|
443
|
+
draft?: boolean;
|
|
623
444
|
children?: NavItem[];
|
|
624
445
|
[key: string]: unknown;
|
|
625
446
|
}
|
|
@@ -629,62 +450,25 @@ interface NavItem {
|
|
|
629
450
|
type ContentNavigationItem = NavItem;
|
|
630
451
|
|
|
631
452
|
/**
|
|
632
|
-
*
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* Number of records skipped before the returned page.
|
|
641
|
-
*/
|
|
642
|
-
skip: number;
|
|
643
|
-
/**
|
|
644
|
-
* Requested page size.
|
|
645
|
-
*/
|
|
646
|
-
limit: number;
|
|
647
|
-
/**
|
|
648
|
-
* Total match count before paging is applied.
|
|
649
|
-
*/
|
|
650
|
-
total: number;
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Response envelope returned when a query resolves to one document.
|
|
654
|
-
*/
|
|
655
|
-
interface ContentQueryFindOneResponse<T> {
|
|
656
|
-
/**
|
|
657
|
-
* First matched document, or `undefined` when nothing matched.
|
|
658
|
-
*/
|
|
659
|
-
result: T | undefined;
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* Response envelope returned when a query resolves to a count.
|
|
663
|
-
*/
|
|
664
|
-
interface ContentQueryCountResponse {
|
|
665
|
-
/**
|
|
666
|
-
* Number of matched documents.
|
|
667
|
-
*/
|
|
668
|
-
result: number;
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* Low-level transport response for the content query engine.
|
|
453
|
+
* Internal query IR — NOT public, NOT the provider wire contract.
|
|
454
|
+
*
|
|
455
|
+
* `ContentQueryBuilderParams` / `ContentQueryBuilderWhere` and the fluent
|
|
456
|
+
* `ContentQueryBuilder` are the intermediate representation the unified query
|
|
457
|
+
* grammar (`src/types/query-parts/public.ts`, the public API) lowers through on
|
|
458
|
+
* its way to the `ContentQueryPlan` AST (`src/core/query/plan.ts`). They are a
|
|
459
|
+
* compiler IR: fine as internal plumbing, but not part of any boundary.
|
|
672
460
|
*
|
|
673
|
-
*
|
|
674
|
-
*
|
|
461
|
+
* - The public query vocabulary is the unified API (`one`/`many`/`paginate`/…
|
|
462
|
+
* with `QueryWhere`/`QueryOperators`).
|
|
463
|
+
* - The provider wire contract is `ContentProviderQuery`
|
|
464
|
+
* (`src/public/provider-query.ts`).
|
|
465
|
+
*
|
|
466
|
+
* Nothing in this file is exported from `#content/server` or `#content/client`.
|
|
467
|
+
* Do not re-add these to `meta/public-surface.json`. A future full fluent+IR
|
|
468
|
+
* cutover (retiring the string-operator API and this IR) is deferred post-0.2.0
|
|
469
|
+
* — see `future-decisions.md`.
|
|
675
470
|
*/
|
|
676
|
-
type ContentQueryResponse<T> = ContentQueryFindResponse<T> | ContentQueryFindOneResponse<T> | ContentQueryCountResponse;
|
|
677
471
|
|
|
678
|
-
interface ContentQuerySortParams {
|
|
679
|
-
$locale?: string;
|
|
680
|
-
$numeric?: boolean;
|
|
681
|
-
$caseFirst?: 'upper' | 'lower' | 'false';
|
|
682
|
-
$sensitivity?: 'base' | 'accent' | 'case' | 'variant';
|
|
683
|
-
}
|
|
684
|
-
interface ContentQuerySortFields {
|
|
685
|
-
[field: string]: -1 | 1;
|
|
686
|
-
}
|
|
687
|
-
type ContentQuerySortOptions = ContentQuerySortParams | ContentQuerySortFields;
|
|
688
472
|
interface ContentQueryBuilderWhere extends Partial<Record<keyof ParsedContentInternalMeta, string | number | boolean | RegExp | ContentQueryBuilderWhere>> {
|
|
689
473
|
$and?: ContentQueryBuilderWhere[];
|
|
690
474
|
$or?: ContentQueryBuilderWhere[];
|
|
@@ -705,76 +489,6 @@ interface ContentQueryBuilderWhere extends Partial<Record<keyof ParsedContentInt
|
|
|
705
489
|
$in?: Array<string | number | boolean>;
|
|
706
490
|
[key: string]: string | number | boolean | RegExp | ContentQueryBuilderWhere | Array<string | number | boolean | ContentQueryBuilderWhere> | undefined;
|
|
707
491
|
}
|
|
708
|
-
interface ContentQueryBuilderParams {
|
|
709
|
-
collection?: string;
|
|
710
|
-
first?: boolean;
|
|
711
|
-
skip?: number;
|
|
712
|
-
limit?: number;
|
|
713
|
-
only?: string[];
|
|
714
|
-
without?: string[];
|
|
715
|
-
sort?: ContentQuerySortOptions[];
|
|
716
|
-
where?: ContentQueryBuilderWhere[] | ContentQueryBuilderWhere;
|
|
717
|
-
canonical?: boolean;
|
|
718
|
-
navigationFields?: string[];
|
|
719
|
-
resolveLocale?: {
|
|
720
|
-
locale?: string;
|
|
721
|
-
fallback?: string[] | boolean;
|
|
722
|
-
exact?: boolean;
|
|
723
|
-
};
|
|
724
|
-
[key: string]: unknown;
|
|
725
|
-
}
|
|
726
|
-
type QueryScalar = string | number | boolean | Date;
|
|
727
|
-
type InternalQueryKeys = Extract<keyof ParsedContentInternalMeta, `_${string}`>;
|
|
728
|
-
type CollectionQueryKey<T> = Extract<keyof T, string> | InternalQueryKeys;
|
|
729
|
-
type CollectionQueryField<T> = CollectionQueryKey<T>;
|
|
730
|
-
type CollectionQueryFieldValue<T, K extends CollectionQueryField<T>> = K extends keyof T ? NonNullable<T[K]> : K extends InternalQueryKeys ? NonNullable<ParsedContentInternalMeta[K]> : never;
|
|
731
|
-
type EqualityValue<T> = T extends QueryScalar ? T | RegExp : T;
|
|
732
|
-
type ComparableValue<T> = T extends string | number | Date ? T : never;
|
|
733
|
-
type MembershipValue<T> = T extends Array<infer U> ? Array<U> : T extends QueryScalar ? Array<T> : never;
|
|
734
|
-
type ContainsValue<T> = T extends string ? string : T extends Array<infer U> ? U | Array<U> : never;
|
|
735
|
-
type ContainsAnyValue<T> = T extends Array<infer U> ? Array<U> : never;
|
|
736
|
-
type RegexValue<T> = T extends string ? RegExp | string : never;
|
|
737
|
-
type IContainsValue<T> = T extends string ? string : never;
|
|
738
|
-
type TypeValue = 'string' | 'number' | 'boolean' | 'object' | 'undefined';
|
|
739
|
-
type CollectionQueryOperator<T> = '=' | '!=' | 'EXISTS' | 'TYPE' | (ComparableValue<T> extends never ? never : '>' | '>=' | '<' | '<=') | (MembershipValue<T> extends never ? never : 'IN' | 'NOT IN') | (ContainsValue<T> extends never ? never : 'CONTAINS') | (ContainsAnyValue<T> extends never ? never : 'CONTAINS_ANY') | (RegexValue<T> extends never ? never : 'REGEX') | (IContainsValue<T> extends never ? never : 'ICONTAINS');
|
|
740
|
-
type CollectionQueryValue<T, O extends CollectionQueryOperator<T>> = O extends '=' | '!=' ? EqualityValue<T> : O extends '>' | '>=' | '<' | '<=' ? ComparableValue<T> : O extends 'IN' | 'NOT IN' ? MembershipValue<T> : O extends 'CONTAINS' ? ContainsValue<T> : O extends 'CONTAINS_ANY' ? ContainsAnyValue<T> : O extends 'REGEX' ? RegexValue<T> : O extends 'ICONTAINS' ? IContainsValue<T> : O extends 'EXISTS' ? boolean | undefined : O extends 'TYPE' ? TypeValue : never;
|
|
741
|
-
type QueryOrderDirection = 'ASC' | 'DESC';
|
|
742
|
-
interface QueryOrderOptions {
|
|
743
|
-
locale?: string;
|
|
744
|
-
numeric?: boolean;
|
|
745
|
-
caseFirst?: ContentQuerySortParams['$caseFirst'];
|
|
746
|
-
sensitivity?: ContentQuerySortParams['$sensitivity'];
|
|
747
|
-
}
|
|
748
|
-
interface QueryGroupBuilder<T = ParsedContentMeta> {
|
|
749
|
-
where<K extends CollectionQueryField<T>, O extends CollectionQueryOperator<CollectionQueryFieldValue<T, K>>>(field: K, operator: O, value?: CollectionQueryValue<CollectionQueryFieldValue<T, K>, O>): QueryGroupBuilder<T>;
|
|
750
|
-
andWhere(groupFactory: QueryGroupFunction<T>): QueryGroupBuilder<T>;
|
|
751
|
-
orWhere(groupFactory: QueryGroupFunction<T>): QueryGroupBuilder<T>;
|
|
752
|
-
}
|
|
753
|
-
type QueryGroupFunction<T = ParsedContentMeta> = (group: QueryGroupBuilder<T>) => QueryGroupBuilder<T>;
|
|
754
|
-
interface ContentQueryBuilder<T = ParsedContentMeta> {
|
|
755
|
-
where<K extends CollectionQueryField<T>, O extends CollectionQueryOperator<CollectionQueryFieldValue<T, K>>>(field: K, operator: O, value?: CollectionQueryValue<CollectionQueryFieldValue<T, K>, O>): ContentQueryBuilder<T>;
|
|
756
|
-
andWhere(groupFactory: QueryGroupFunction<T>): ContentQueryBuilder<T>;
|
|
757
|
-
orWhere(groupFactory: QueryGroupFunction<T>): ContentQueryBuilder<T>;
|
|
758
|
-
select<const K extends readonly Extract<keyof T, string>[]>(...fields: K): ContentQueryBuilder<Pick<T, K[number]>>;
|
|
759
|
-
order<K extends CollectionQueryField<T>>(field: K, direction: QueryOrderDirection, options?: QueryOrderOptions): ContentQueryBuilder<T>;
|
|
760
|
-
limit(count: number): ContentQueryBuilder<T>;
|
|
761
|
-
skip(count: number): ContentQueryBuilder<T>;
|
|
762
|
-
params: () => ContentQueryBuilderParams;
|
|
763
|
-
locale(locale: string, options?: {
|
|
764
|
-
fallback?: boolean | string[];
|
|
765
|
-
}): ContentQueryBuilder<T>;
|
|
766
|
-
all(): Promise<Array<T>>;
|
|
767
|
-
first(): Promise<T | undefined>;
|
|
768
|
-
count(): Promise<number>;
|
|
769
|
-
}
|
|
770
|
-
interface CollectionQueryBuilder<T = ParsedContentMeta> extends ContentQueryBuilder<T> {
|
|
771
|
-
select<const K extends readonly Extract<keyof T, string>[]>(...fields: K): CollectionQueryBuilder<Pick<T, K[number]>>;
|
|
772
|
-
}
|
|
773
|
-
interface ContentQueryRequest {
|
|
774
|
-
params(): ContentQueryBuilderParams;
|
|
775
|
-
}
|
|
776
|
-
type ContentQueryFetcher<T> = (query: ContentQueryRequest) => Promise<ContentQueryResponse<T>>;
|
|
777
|
-
type QueryMatchOperator = (item: unknown, condition: unknown) => boolean;
|
|
778
492
|
|
|
779
493
|
declare global {
|
|
780
494
|
interface GinkoContentCollectionMap {
|
|
@@ -786,304 +500,6 @@ interface ContentCollectionMap extends GinkoContentCollectionMap {
|
|
|
786
500
|
}
|
|
787
501
|
interface ContentCollectionI18nMap extends GinkoContentCollectionI18nMap {
|
|
788
502
|
}
|
|
789
|
-
type ContentCollectionName = keyof GinkoContentCollectionMap & string;
|
|
790
|
-
type ContentCollectionItem<K extends ContentCollectionName> = ContentCollectionMap[K];
|
|
791
|
-
type ContentCollectionStringName = [ContentCollectionName] extends [never] ? string : ContentCollectionName;
|
|
792
|
-
type ContentCollectionTarget = ContentCollectionHandle | ContentCollectionStringName;
|
|
793
|
-
|
|
794
|
-
interface ContentCollectionNavigationOptions<TField extends string = string> {
|
|
795
|
-
fields?: TField[];
|
|
796
|
-
locale?: string;
|
|
797
|
-
canonical?: boolean;
|
|
798
|
-
}
|
|
799
|
-
type ContentCollectionItemSurroundingsOptions<TField extends string = string> = ContentCollectionNavigationOptions<TField>;
|
|
800
|
-
interface ContentCollectionSearchSectionsOptions {
|
|
801
|
-
ignoredTags?: string[];
|
|
802
|
-
extraFields?: string[];
|
|
803
|
-
filterQuery?: ContentQueryBuilderWhere;
|
|
804
|
-
minHeading?: `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
|
805
|
-
maxHeading?: `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
|
806
|
-
locale?: string;
|
|
807
|
-
canonical?: boolean;
|
|
808
|
-
}
|
|
809
|
-
interface ContentCollectionPageOptions {
|
|
810
|
-
locale?: string;
|
|
811
|
-
fallback?: string[] | boolean;
|
|
812
|
-
exact?: boolean;
|
|
813
|
-
canonical?: boolean;
|
|
814
|
-
}
|
|
815
|
-
interface ContentCollectionRouteMetaOptions {
|
|
816
|
-
locale?: string;
|
|
817
|
-
fallback?: string[] | boolean;
|
|
818
|
-
exact?: boolean;
|
|
819
|
-
}
|
|
820
|
-
interface ResolveContentReferenceOptions {
|
|
821
|
-
locale?: string;
|
|
822
|
-
fallback?: string[] | boolean;
|
|
823
|
-
exact?: boolean;
|
|
824
|
-
collection?: string;
|
|
825
|
-
}
|
|
826
|
-
interface ContentLocaleEntry {
|
|
827
|
-
canonicalKey: string;
|
|
828
|
-
locale: string;
|
|
829
|
-
path?: string;
|
|
830
|
-
}
|
|
831
|
-
interface ContentLocaleRoute {
|
|
832
|
-
locale: string;
|
|
833
|
-
path: string;
|
|
834
|
-
canonicalPath: string;
|
|
835
|
-
}
|
|
836
|
-
interface LocalePathEntry {
|
|
837
|
-
path: string;
|
|
838
|
-
translated: boolean;
|
|
839
|
-
fallback?: string;
|
|
840
|
-
}
|
|
841
|
-
interface ContentResolvedMeta {
|
|
842
|
-
locale: string;
|
|
843
|
-
requestedLocale?: string;
|
|
844
|
-
fallback: boolean;
|
|
845
|
-
fallbackLocale?: string;
|
|
846
|
-
path: string;
|
|
847
|
-
requestedPath?: string;
|
|
848
|
-
requestedRoute?: string;
|
|
849
|
-
requestedRef?: string;
|
|
850
|
-
availableLocales: string[];
|
|
851
|
-
}
|
|
852
|
-
interface ContentRouteMeta {
|
|
853
|
-
locale: string;
|
|
854
|
-
defaultLocale: string;
|
|
855
|
-
path: string;
|
|
856
|
-
canonicalPath: string;
|
|
857
|
-
variants: ContentLocaleRoute[];
|
|
858
|
-
localePaths: Record<string, LocalePathEntry>;
|
|
859
|
-
resolved: ContentResolvedMeta;
|
|
860
|
-
}
|
|
861
|
-
type ContentPageResult<T = ParsedContentMeta> = T & ContentRouteMeta & {
|
|
862
|
-
stem: string;
|
|
863
|
-
extension?: string;
|
|
864
|
-
};
|
|
865
|
-
interface ContentSitemapAlternative {
|
|
866
|
-
hreflang: string;
|
|
867
|
-
href: string;
|
|
868
|
-
}
|
|
869
|
-
interface ContentSitemapImage {
|
|
870
|
-
loc: string;
|
|
871
|
-
}
|
|
872
|
-
interface ContentSitemapEntry {
|
|
873
|
-
loc: string;
|
|
874
|
-
_sitemap?: string;
|
|
875
|
-
lastmod?: string;
|
|
876
|
-
alternatives?: ContentSitemapAlternative[];
|
|
877
|
-
images?: ContentSitemapImage[];
|
|
878
|
-
}
|
|
879
|
-
interface ContentSearchSection {
|
|
880
|
-
id: string;
|
|
881
|
-
title: string;
|
|
882
|
-
titles: string[];
|
|
883
|
-
level: number;
|
|
884
|
-
content: string;
|
|
885
|
-
[key: string]: unknown;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
interface QueryOperators<TValue = unknown> {
|
|
889
|
-
$eq?: TValue;
|
|
890
|
-
$ne?: TValue;
|
|
891
|
-
$gt?: TValue;
|
|
892
|
-
$gte?: TValue;
|
|
893
|
-
$lt?: TValue;
|
|
894
|
-
$lte?: TValue;
|
|
895
|
-
$in?: TValue[];
|
|
896
|
-
$nin?: TValue[];
|
|
897
|
-
$exists?: boolean;
|
|
898
|
-
$contains?: TValue | TValue[];
|
|
899
|
-
$containsAny?: TValue[];
|
|
900
|
-
$icontains?: string;
|
|
901
|
-
$type?: 'string' | 'number' | 'boolean' | 'object' | 'undefined';
|
|
902
|
-
$prefix?: TValue extends string ? string : never;
|
|
903
|
-
$not?: TValue | QueryOperators<TValue>;
|
|
904
|
-
}
|
|
905
|
-
type ContentSelector = {
|
|
906
|
-
path: string;
|
|
907
|
-
route?: never;
|
|
908
|
-
ref?: never;
|
|
909
|
-
} | {
|
|
910
|
-
route: string;
|
|
911
|
-
path?: never;
|
|
912
|
-
ref?: never;
|
|
913
|
-
} | {
|
|
914
|
-
ref: string;
|
|
915
|
-
path?: never;
|
|
916
|
-
route?: never;
|
|
917
|
-
};
|
|
918
|
-
type WhereValue<T> = T | QueryOperators<T>;
|
|
919
|
-
type PathWhere = string | QueryOperators<string>;
|
|
920
|
-
type QueryWhere<T = ParsedContentMeta> = {
|
|
921
|
-
path?: PathWhere;
|
|
922
|
-
$and?: QueryWhere<T>[];
|
|
923
|
-
$or?: QueryWhere<T>[];
|
|
924
|
-
$not?: QueryWhere<T>;
|
|
925
|
-
} & {
|
|
926
|
-
[K in Exclude<keyof T, 'path'>]?: WhereValue<NonNullable<T[K]>>;
|
|
927
|
-
};
|
|
928
|
-
type SortDirection = 'asc' | 'desc' | 1 | -1;
|
|
929
|
-
type SortSpec<T = ParsedContentMeta> = string extends keyof T ? {
|
|
930
|
-
[key: string]: SortDirection | undefined;
|
|
931
|
-
} : {
|
|
932
|
-
[K in keyof T]?: SortDirection;
|
|
933
|
-
};
|
|
934
|
-
type HandleSchema<H> = H extends {
|
|
935
|
-
__schema: infer S;
|
|
936
|
-
} ? S extends {
|
|
937
|
-
_output: infer O;
|
|
938
|
-
} ? O & StrictParsedContentMeta : StrictParsedContentMeta : H extends ContentCollectionName ? ContentCollectionMap[H] & StrictParsedContentMeta : StrictParsedContentMeta;
|
|
939
|
-
type SelectFields<H> = string extends H ? ReadonlyArray<string> : ReadonlyArray<Extract<keyof HandleSchema<H>, string>>;
|
|
940
|
-
type DocumentFromHandle<H> = H extends {
|
|
941
|
-
__schema: {
|
|
942
|
-
_output: infer O;
|
|
943
|
-
};
|
|
944
|
-
} ? O & StrictParsedContent : H extends ContentCollectionName ? ContentCollectionMap[H] : ParsedContent;
|
|
945
|
-
type PopulateSpec = Record<string, ContentCollectionTarget>;
|
|
946
|
-
type PopulatedDocument<T, P> = P extends undefined ? T : P extends PopulateSpec ? string extends keyof P ? T : Omit<T, keyof P> & {
|
|
947
|
-
[K in keyof P & keyof T]: T[K] extends ReadonlyArray<unknown> ? Array<LocalizedDoc<DocumentFromHandle<P[K]>>> : LocalizedDoc<DocumentFromHandle<P[K]>> | null;
|
|
948
|
-
} : T;
|
|
949
|
-
type PopulateFromOptions<O> = O extends {
|
|
950
|
-
populate?: infer P;
|
|
951
|
-
} ? P : undefined;
|
|
952
|
-
type PopulateOption<P extends PopulateSpec | undefined = undefined> = {
|
|
953
|
-
populate?: P;
|
|
954
|
-
};
|
|
955
|
-
type HandleIsI18n<H> = H extends {
|
|
956
|
-
__i18n: infer I;
|
|
957
|
-
} ? I extends true ? true : false : H extends keyof ContentCollectionI18nMap ? true : false;
|
|
958
|
-
type LocaleOption<H, OptKey extends string = 'locale'> = HandleIsI18n<H> extends true ? {
|
|
959
|
-
[K in OptKey]: string;
|
|
960
|
-
} : {
|
|
961
|
-
[K in OptKey]?: string;
|
|
962
|
-
};
|
|
963
|
-
type SourceIsI18n<S> = S extends ReadonlyArray<infer I> ? true extends HandleIsI18n<I> ? true : false : HandleIsI18n<S>;
|
|
964
|
-
type BacklinksLocaleOption<Target, Source> = HandleIsI18n<Target> extends true ? {
|
|
965
|
-
locale: string;
|
|
966
|
-
} : SourceIsI18n<Source> extends true ? {
|
|
967
|
-
locale: string;
|
|
968
|
-
} : {
|
|
969
|
-
locale?: string;
|
|
970
|
-
};
|
|
971
|
-
type LocaleFallback = false | true | 'default' | string | string[];
|
|
972
|
-
type LocalizedContentDocument<T = ParsedContentMeta> = T & ContentRouteMeta & {
|
|
973
|
-
locale: string;
|
|
974
|
-
path: string;
|
|
975
|
-
canonicalPath: string;
|
|
976
|
-
localePaths: Record<string, LocalePathEntry>;
|
|
977
|
-
stem?: string;
|
|
978
|
-
extension?: string;
|
|
979
|
-
};
|
|
980
|
-
type LocalizedDoc<T = ParsedContentMeta> = LocalizedContentDocument<T>;
|
|
981
|
-
interface ResolutionEnvelope {
|
|
982
|
-
requested: {
|
|
983
|
-
collection: string;
|
|
984
|
-
by: ContentSelector;
|
|
985
|
-
locale?: string;
|
|
986
|
-
fallback?: LocaleFallback;
|
|
987
|
-
};
|
|
988
|
-
normalized: {
|
|
989
|
-
by: ContentSelector;
|
|
990
|
-
};
|
|
991
|
-
matched: {
|
|
992
|
-
found: boolean;
|
|
993
|
-
collection: string;
|
|
994
|
-
path?: string;
|
|
995
|
-
canonicalPath?: string;
|
|
996
|
-
ref?: string;
|
|
997
|
-
locale?: string;
|
|
998
|
-
};
|
|
999
|
-
fallback: {
|
|
1000
|
-
used: boolean;
|
|
1001
|
-
locale?: string;
|
|
1002
|
-
};
|
|
1003
|
-
}
|
|
1004
|
-
interface ResolveOneResult<T = ParsedContentMeta> {
|
|
1005
|
-
doc: LocalizedDoc<T> | null;
|
|
1006
|
-
explain: ResolutionEnvelope;
|
|
1007
|
-
}
|
|
1008
|
-
type ResolveOneOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = {
|
|
1009
|
-
by: ContentSelector;
|
|
1010
|
-
fallback?: LocaleFallback;
|
|
1011
|
-
select?: SelectFields<H>;
|
|
1012
|
-
} & LocaleOption<H> & PopulateOption<P>;
|
|
1013
|
-
type OneOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = ResolveOneOptions<H, P>;
|
|
1014
|
-
type ManyOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = {
|
|
1015
|
-
where?: QueryWhere<HandleSchema<H>>;
|
|
1016
|
-
sort?: SortSpec<HandleSchema<H>>;
|
|
1017
|
-
limit?: number;
|
|
1018
|
-
skip?: number;
|
|
1019
|
-
fallback?: LocaleFallback;
|
|
1020
|
-
select?: SelectFields<H>;
|
|
1021
|
-
} & LocaleOption<H> & PopulateOption<P>;
|
|
1022
|
-
type PaginationOptions<H = unknown, P extends PopulateSpec | undefined = undefined> = Omit<ManyOptions<H, P>, 'skip' | 'limit'> & {
|
|
1023
|
-
page?: number;
|
|
1024
|
-
limit?: number;
|
|
1025
|
-
};
|
|
1026
|
-
interface PaginationResult<T = ParsedContentMeta> {
|
|
1027
|
-
data: Array<LocalizedDoc<T>>;
|
|
1028
|
-
page: number;
|
|
1029
|
-
limit: number;
|
|
1030
|
-
total: number;
|
|
1031
|
-
pageCount: number;
|
|
1032
|
-
hasNext: boolean;
|
|
1033
|
-
hasPrev: boolean;
|
|
1034
|
-
nextPage: number | null;
|
|
1035
|
-
prevPage: number | null;
|
|
1036
|
-
}
|
|
1037
|
-
type BacklinkSource = ContentCollectionTarget;
|
|
1038
|
-
type SourceName<S> = S extends string ? S : S extends {
|
|
1039
|
-
name: infer N;
|
|
1040
|
-
} ? Extract<N, string> : string;
|
|
1041
|
-
type BacklinkFields<S = BacklinkSource | ReadonlyArray<BacklinkSource>> = ReadonlyArray<string> | Partial<Record<SourceName<S extends ReadonlyArray<infer I> ? I : S>, ReadonlyArray<string>>>;
|
|
1042
|
-
type DocumentFromSource<S> = S extends ReadonlyArray<infer I> ? DocumentFromHandle<I> : DocumentFromHandle<S>;
|
|
1043
|
-
type BacklinksOptions<Target = unknown, Source extends BacklinkSource | ReadonlyArray<BacklinkSource> = BacklinkSource | ReadonlyArray<BacklinkSource>, P extends PopulateSpec | undefined = undefined> = {
|
|
1044
|
-
by: ContentSelector;
|
|
1045
|
-
from: Source;
|
|
1046
|
-
fields?: BacklinkFields<Source>;
|
|
1047
|
-
sort?: SortSpec<DocumentFromSource<Source>>;
|
|
1048
|
-
limit?: number;
|
|
1049
|
-
skip?: number;
|
|
1050
|
-
fallback?: LocaleFallback;
|
|
1051
|
-
select?: string extends Source ? ReadonlyArray<string> : ReadonlyArray<Extract<keyof DocumentFromSource<Source>, string>>;
|
|
1052
|
-
} & BacklinksLocaleOption<Target, Source> & PopulateOption<P>;
|
|
1053
|
-
type BacklinksResult<Source extends BacklinkSource | ReadonlyArray<BacklinkSource> = BacklinkSource | ReadonlyArray<BacklinkSource>, P extends PopulateSpec | undefined = undefined> = Array<LocalizedDoc<PopulatedDocument<DocumentFromSource<Source>, P>>>;
|
|
1054
|
-
type VariantsOptions<H = unknown> = {
|
|
1055
|
-
by: ContentSelector;
|
|
1056
|
-
locales?: string[];
|
|
1057
|
-
} & LocaleOption<H>;
|
|
1058
|
-
interface ContentVariant<_T = ParsedContentMeta> {
|
|
1059
|
-
locale: string;
|
|
1060
|
-
path: string;
|
|
1061
|
-
translated: boolean;
|
|
1062
|
-
fallback?: string;
|
|
1063
|
-
}
|
|
1064
|
-
type TreeOptions<H = unknown, Fields extends ReadonlyArray<keyof HandleSchema<H> | string> | undefined = undefined> = {
|
|
1065
|
-
where?: QueryWhere<HandleSchema<H>>;
|
|
1066
|
-
sort?: SortSpec<HandleSchema<H>>;
|
|
1067
|
-
fields?: Fields;
|
|
1068
|
-
fallback?: LocaleFallback;
|
|
1069
|
-
locale?: string;
|
|
1070
|
-
};
|
|
1071
|
-
type ContentTreeItem<T = ParsedContentMeta, Fields extends ReadonlyArray<keyof T | string> | undefined = undefined> = {
|
|
1072
|
-
title: string;
|
|
1073
|
-
path: string;
|
|
1074
|
-
_path?: string;
|
|
1075
|
-
children?: Array<ContentTreeItem<T, Fields>>;
|
|
1076
|
-
} & (Fields extends ReadonlyArray<infer K> ? Pick<T, Extract<K, keyof T>> : Record<never, never>);
|
|
1077
|
-
|
|
1078
|
-
type NeighborsOptions<H = unknown> = {
|
|
1079
|
-
by: ContentSelector;
|
|
1080
|
-
fallback?: LocaleFallback;
|
|
1081
|
-
fields?: SelectFields<H>;
|
|
1082
|
-
} & LocaleOption<H>;
|
|
1083
|
-
interface NeighborsResult<T = ParsedContentMeta> {
|
|
1084
|
-
prev: ContentTreeItem<T> | null;
|
|
1085
|
-
next: ContentTreeItem<T> | null;
|
|
1086
|
-
}
|
|
1087
503
|
|
|
1088
504
|
type ContentSearchEngine = 'minisearch' | 'pagefind' | 'cms';
|
|
1089
505
|
interface ContentMiniSearchOptions {
|
|
@@ -1118,39 +534,6 @@ interface ContentMiniSearchOptions {
|
|
|
1118
534
|
*/
|
|
1119
535
|
prefix: boolean;
|
|
1120
536
|
}
|
|
1121
|
-
interface ContentSearchPublicRuntimeConfig {
|
|
1122
|
-
apiBaseURL: string;
|
|
1123
|
-
indexURL: string;
|
|
1124
|
-
engine: ContentSearchEngine;
|
|
1125
|
-
minisearch: ContentMiniSearchOptions;
|
|
1126
|
-
}
|
|
1127
|
-
interface ContentSearchIndexRecord {
|
|
1128
|
-
id: string;
|
|
1129
|
-
collection: string;
|
|
1130
|
-
path: string;
|
|
1131
|
-
title: string;
|
|
1132
|
-
excerpt: string;
|
|
1133
|
-
content: string;
|
|
1134
|
-
headings: string[];
|
|
1135
|
-
anchor?: string;
|
|
1136
|
-
locale?: string;
|
|
1137
|
-
[field: string]: unknown;
|
|
1138
|
-
}
|
|
1139
|
-
interface ContentSearchResult {
|
|
1140
|
-
collection: string;
|
|
1141
|
-
path: string;
|
|
1142
|
-
title: string;
|
|
1143
|
-
excerpt: string;
|
|
1144
|
-
score: number;
|
|
1145
|
-
anchor?: string;
|
|
1146
|
-
locale?: string;
|
|
1147
|
-
[field: string]: unknown;
|
|
1148
|
-
}
|
|
1149
|
-
interface ContentProviderSearchRequest {
|
|
1150
|
-
term: string;
|
|
1151
|
-
locale?: string;
|
|
1152
|
-
collections?: string[];
|
|
1153
|
-
}
|
|
1154
537
|
|
|
1155
538
|
type MountOptions = {
|
|
1156
539
|
driver: 'fs' | 'http' | string;
|
|
@@ -1368,7 +751,7 @@ interface ContentSearchOptions {
|
|
|
1368
751
|
/**
|
|
1369
752
|
* Query predicate applied before records are indexed.
|
|
1370
753
|
*
|
|
1371
|
-
* @default {
|
|
754
|
+
* @default { draft: false, partial: false }
|
|
1372
755
|
*/
|
|
1373
756
|
filterQuery?: ContentQueryBuilderWhere;
|
|
1374
757
|
/**
|
|
@@ -1624,68 +1007,8 @@ interface ModuleOptions {
|
|
|
1624
1007
|
stripQueryParameters?: boolean;
|
|
1625
1008
|
};
|
|
1626
1009
|
}
|
|
1627
|
-
interface ResolvedContentI18nOptions {
|
|
1628
|
-
locales: string[];
|
|
1629
|
-
defaultLocale?: string;
|
|
1630
|
-
fallback: Record<string, string[]>;
|
|
1631
|
-
translatedSlugs: boolean;
|
|
1632
|
-
strictTranslatedSlugs: boolean;
|
|
1633
|
-
}
|
|
1634
|
-
interface ContentContext extends ModuleOptions {
|
|
1635
|
-
transformers: Array<string>;
|
|
1636
|
-
sitemap: false | ContentSitemapOptions;
|
|
1637
|
-
locales: string[];
|
|
1638
|
-
defaultLocale?: string;
|
|
1639
|
-
localeFallback: Record<string, string[]>;
|
|
1640
|
-
translatedSlugs: boolean;
|
|
1641
|
-
strictTranslatedSlugs: boolean;
|
|
1642
|
-
}
|
|
1643
|
-
type ResolvedContentContext = Omit<ContentContext, 'markdown'> & {
|
|
1644
|
-
markdown: MarkdownOptions;
|
|
1645
|
-
};
|
|
1646
|
-
|
|
1647
|
-
interface ContentCacheArtifact<T = ParsedContent> {
|
|
1648
|
-
parsed: T;
|
|
1649
|
-
hash: string;
|
|
1650
|
-
}
|
|
1651
|
-
interface ManifestVariant {
|
|
1652
|
-
canonicalKey: string;
|
|
1653
|
-
contentId: string;
|
|
1654
|
-
locale: string;
|
|
1655
|
-
path?: string;
|
|
1656
|
-
}
|
|
1657
|
-
interface ContentManifest {
|
|
1658
|
-
byCanonical: Record<string, Record<string, ManifestVariant>>;
|
|
1659
|
-
byRef: Record<string, string>;
|
|
1660
|
-
byRoute: Record<string, string>;
|
|
1661
|
-
paths: Record<string, string[]>;
|
|
1662
|
-
collections: Record<string, string[]>;
|
|
1663
|
-
}
|
|
1664
|
-
interface ResolvedVariant extends ManifestVariant {
|
|
1665
|
-
requestedLocale?: string;
|
|
1666
|
-
resolvedLocale?: string;
|
|
1667
|
-
fallback: boolean;
|
|
1668
|
-
availableLocales: string[];
|
|
1669
|
-
}
|
|
1670
|
-
interface ParseContentOptions {
|
|
1671
|
-
validate?: boolean;
|
|
1672
|
-
csv?: ModuleOptions['csv'];
|
|
1673
|
-
yaml?: ModuleOptions['yaml'];
|
|
1674
|
-
markdown?: ModuleOptions['markdown'] | MarkdownOptions;
|
|
1675
|
-
transformers?: ContentTransformer[];
|
|
1676
|
-
pathMeta?: {
|
|
1677
|
-
locales?: ContentContext['locales'];
|
|
1678
|
-
defaultLocale?: ContentContext['defaultLocale'];
|
|
1679
|
-
translatedSlugs?: ContentContext['translatedSlugs'];
|
|
1680
|
-
respectPathCase?: ModuleOptions['respectPathCase'];
|
|
1681
|
-
collections?: Record<string, ContentCollectionConfig>;
|
|
1682
|
-
collectionResolver?: (file: string) => string | undefined;
|
|
1683
|
-
};
|
|
1684
|
-
[key: string]: unknown;
|
|
1685
|
-
}
|
|
1686
|
-
type TransformContentSource = string | StorageValue;
|
|
1687
1010
|
|
|
1688
|
-
declare function createSearchRuntimeConfig(search: Exclude<ModuleOptions$1['search'], false>, apiBaseURL: string): ContentSearchPublicRuntimeConfig
|
|
1011
|
+
declare function createSearchRuntimeConfig(search: Exclude<ModuleOptions$1['search'], false>, apiBaseURL: string): ContentSearchPublicRuntimeConfig;
|
|
1689
1012
|
|
|
1690
1013
|
interface ModulePublicRuntimeConfig {
|
|
1691
1014
|
experimental: {
|
|
@@ -1702,11 +1025,11 @@ interface ModulePublicRuntimeConfig {
|
|
|
1702
1025
|
} | false;
|
|
1703
1026
|
integrity: number | undefined;
|
|
1704
1027
|
respectPathCase: boolean;
|
|
1705
|
-
defaultLocale: ContentContext
|
|
1706
|
-
locales: ContentContext
|
|
1707
|
-
provider: ContentContext
|
|
1708
|
-
providers: ContentContext
|
|
1709
|
-
links: ContentContext
|
|
1028
|
+
defaultLocale: ContentContext['defaultLocale'];
|
|
1029
|
+
locales: ContentContext['locales'];
|
|
1030
|
+
provider: ContentContext['provider'];
|
|
1031
|
+
providers: ContentContext['providers'];
|
|
1032
|
+
links: ContentContext['links'];
|
|
1710
1033
|
collections: Record<string, {
|
|
1711
1034
|
source: ContentCollectionConfig$1['source'];
|
|
1712
1035
|
exclude?: ContentCollectionConfig$1['exclude'];
|
|
@@ -1714,10 +1037,10 @@ interface ModulePublicRuntimeConfig {
|
|
|
1714
1037
|
i18n?: ContentCollectionI18nConfig$1;
|
|
1715
1038
|
sitemap?: boolean;
|
|
1716
1039
|
}>;
|
|
1717
|
-
localeFallback: ContentContext
|
|
1718
|
-
translatedSlugs: ContentContext
|
|
1719
|
-
strictTranslatedSlugs: ContentContext
|
|
1720
|
-
markdown: MarkdownOptions
|
|
1040
|
+
localeFallback: ContentContext['localeFallback'];
|
|
1041
|
+
translatedSlugs: ContentContext['translatedSlugs'];
|
|
1042
|
+
strictTranslatedSlugs: ContentContext['strictTranslatedSlugs'];
|
|
1043
|
+
markdown: MarkdownOptions;
|
|
1721
1044
|
navigation: ModuleOptions$1['navigation'];
|
|
1722
1045
|
search: ReturnType<typeof createSearchRuntimeConfig> | false;
|
|
1723
1046
|
contentHead: ModuleOptions$1['contentHead'];
|
|
@@ -1733,19 +1056,19 @@ interface ModulePrivateRuntimeConfig {
|
|
|
1733
1056
|
}
|
|
1734
1057
|
declare module '@nuxt/schema' {
|
|
1735
1058
|
interface NuxtHooks {
|
|
1736
|
-
'content:context': (ctx: ContentContext
|
|
1059
|
+
'content:context': (ctx: ContentContext) => void | Promise<void>;
|
|
1737
1060
|
}
|
|
1738
1061
|
interface PublicRuntimeConfig {
|
|
1739
1062
|
content: ModulePublicRuntimeConfig;
|
|
1740
1063
|
}
|
|
1741
1064
|
interface PrivateRuntimeConfig {
|
|
1742
|
-
content: ModulePrivateRuntimeConfig & ContentContext
|
|
1065
|
+
content: ModulePrivateRuntimeConfig & ContentContext;
|
|
1743
1066
|
}
|
|
1744
1067
|
}
|
|
1745
1068
|
declare module 'nitropack' {
|
|
1746
1069
|
interface NitroRuntimeHooks {
|
|
1747
1070
|
'content:file:beforeParse': (file: {
|
|
1748
|
-
|
|
1071
|
+
id: string;
|
|
1749
1072
|
body: StorageValue;
|
|
1750
1073
|
}) => void;
|
|
1751
1074
|
'content:file:afterParse': (file: ParsedContent$1) => void;
|
|
@@ -1756,8 +1079,8 @@ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions$1, ModuleOptions$1
|
|
|
1756
1079
|
|
|
1757
1080
|
interface ModuleHooks {
|
|
1758
1081
|
'content:providers'(providers: Record<string, string>): void | Promise<void>;
|
|
1759
|
-
'content:context'(ctx: ContentContext
|
|
1082
|
+
'content:context'(ctx: ContentContext): void | Promise<void>;
|
|
1760
1083
|
}
|
|
1761
1084
|
|
|
1762
|
-
export { _default as default
|
|
1763
|
-
export type {
|
|
1085
|
+
export { _default as default };
|
|
1086
|
+
export type { ContentCollectionHandle, ContentCollectionI18nMap, ContentCollectionMap, ContentNavigationItem, ModuleHooks, ModuleOptions, NavItem, ParsedContent, StrictParsedContent, Toc, TocLink };
|