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