@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.
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 +22 -8
  63. package/dist/module.d.mts +135 -812
  64. package/dist/module.json +1 -1
  65. package/dist/module.mjs +70 -27
  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 +1 -1
  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 +47 -102
  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 +8 -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,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
- * 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.
335
203
  */
336
- interface ParsedContentInternalMeta {
204
+ interface ContentFileMeta {
337
205
  /**
338
- * Stable unique id for the parsed source record.
206
+ * Backing source name when multiple content sources are configured.
339
207
  */
340
- _id: string;
208
+ source?: string;
341
209
  /**
342
- * 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).
343
215
  */
344
- _source?: string;
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
- _path?: string;
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
- _draft?: boolean;
294
+ draft?: boolean;
370
295
  /**
371
296
  * Marks the document as a partial that should not become a page by default.
372
297
  */
373
- _partial?: boolean;
298
+ partial?: boolean;
374
299
  /**
375
300
  * Locale code for the concrete variant.
376
301
  */
377
- _locale?: string;
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
- * 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.
412
307
  */
413
- _variantPaths?: Record<string, string>;
308
+ canonicalKey?: string;
414
309
  /**
415
- * 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.
416
314
  */
417
- _resolvedRefs?: Record<string, string>;
315
+ resolved?: ContentDocumentResolution;
418
316
  /**
419
317
  * Collection name, when matched by a configured collection glob.
420
318
  */
421
- _collection?: string;
319
+ collection?: string;
422
320
  /**
423
- * 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.
424
324
  */
425
- _navigation?: boolean;
325
+ navigationFile?: boolean;
426
326
  /**
427
327
  * Parsed document kind.
428
328
  */
429
- _type?: 'markdown' | 'yaml' | 'json' | 'csv';
329
+ type?: 'markdown' | 'yaml' | 'json' | 'csv';
430
330
  /**
431
- * Source file path relative to the content root.
331
+ * File-provenance metadata. Optional: absent for providers with no backing file.
432
332
  */
433
- _file?: string;
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
- _id?: string;
619
- _canonicalKey?: string;
620
- _locale?: string;
621
- _fallback?: boolean;
622
- _draft?: boolean;
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
- * Response envelope returned when a query resolves to a list.
633
- */
634
- interface ContentQueryFindResponse<T> {
635
- /**
636
- * Matched documents after filtering, sorting, and projection.
637
- */
638
- result: Array<T>;
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
- * Most application code should use the builder helpers (`.all()`, `.first()`,
674
- * `.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`.
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 { _draft: false, _partial: false }
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$1;
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$1['defaultLocale'];
1706
- locales: ContentContext$1['locales'];
1707
- provider: ContentContext$1['provider'];
1708
- providers: ContentContext$1['providers'];
1709
- links: ContentContext$1['links'];
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$1['localeFallback'];
1718
- translatedSlugs: ContentContext$1['translatedSlugs'];
1719
- strictTranslatedSlugs: ContentContext$1['strictTranslatedSlugs'];
1720
- markdown: MarkdownOptions$1;
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$1) => void | Promise<void>;
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$1;
1065
+ content: ModulePrivateRuntimeConfig & ContentContext;
1743
1066
  }
1744
1067
  }
1745
1068
  declare module 'nitropack' {
1746
1069
  interface NitroRuntimeHooks {
1747
1070
  'content:file:beforeParse': (file: {
1748
- _id: string;
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$1): void | Promise<void>;
1082
+ 'content:context'(ctx: ContentContext): void | Promise<void>;
1760
1083
  }
1761
1084
 
1762
- export { _default as default, normalizeContentConfigCollectionNames };
1763
- export type { AgentMetadataField, AgentMetadataFieldList, BacklinkFields, BacklinkSource, BacklinksOptions, BacklinksResult, CollectionQueryBuilder, CollectionQueryField, CollectionQueryFieldValue, CollectionQueryKey, CollectionQueryOperator, CollectionQueryValue, CollectionSchema, ContentAgentAppPageConfig, ContentAgentAppPageContext, ContentAgentCollectionConfig, ContentAgentConfig, ContentAgentLocalizedValue, ContentAgentMarkdownMetadataConfig, ContentAgentMarkdownOptions, ContentAgentMarkdownPolicyConfig, ContentAgentRouteOptions, ContentAgentRuntimeAppPageConfig, ContentAgentRuntimeConfig, 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 };