scribe-cms 0.0.1

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 (96) hide show
  1. package/README.md +150 -0
  2. package/dist/cli/index.cjs +2303 -0
  3. package/dist/cli/index.cjs.map +1 -0
  4. package/dist/cli/index.d.ts +3 -0
  5. package/dist/cli/index.d.ts.map +1 -0
  6. package/dist/cli/index.js +2289 -0
  7. package/dist/cli/index.js.map +1 -0
  8. package/dist/index.cjs +2268 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.js +2238 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/runtime.cjs +1216 -0
  13. package/dist/runtime.cjs.map +1 -0
  14. package/dist/runtime.js +1207 -0
  15. package/dist/runtime.js.map +1 -0
  16. package/dist/src/config/load-config.d.ts +10 -0
  17. package/dist/src/config/load-config.d.ts.map +1 -0
  18. package/dist/src/config/load-env.d.ts +3 -0
  19. package/dist/src/config/load-env.d.ts.map +1 -0
  20. package/dist/src/config/resolve-config.d.ts +13 -0
  21. package/dist/src/config/resolve-config.d.ts.map +1 -0
  22. package/dist/src/core/alias-helpers.d.ts +7 -0
  23. package/dist/src/core/alias-helpers.d.ts.map +1 -0
  24. package/dist/src/core/builtin-fields.d.ts +38 -0
  25. package/dist/src/core/builtin-fields.d.ts.map +1 -0
  26. package/dist/src/core/field.d.ts +60 -0
  27. package/dist/src/core/field.d.ts.map +1 -0
  28. package/dist/src/core/introspect-schema.d.ts +20 -0
  29. package/dist/src/core/introspect-schema.d.ts.map +1 -0
  30. package/dist/src/core/slug-aliases.d.ts +27 -0
  31. package/dist/src/core/slug-aliases.d.ts.map +1 -0
  32. package/dist/src/core/types.d.ts +261 -0
  33. package/dist/src/core/types.d.ts.map +1 -0
  34. package/dist/src/create-project.d.ts +10 -0
  35. package/dist/src/create-project.d.ts.map +1 -0
  36. package/dist/src/create-scribe.d.ts +11 -0
  37. package/dist/src/create-scribe.d.ts.map +1 -0
  38. package/dist/src/hash/page-hash.d.ts +7 -0
  39. package/dist/src/hash/page-hash.d.ts.map +1 -0
  40. package/dist/src/history/record-revision.d.ts +12 -0
  41. package/dist/src/history/record-revision.d.ts.map +1 -0
  42. package/dist/src/i18n/build-url.d.ts +14 -0
  43. package/dist/src/i18n/build-url.d.ts.map +1 -0
  44. package/dist/src/i18n/resolve-document.d.ts +12 -0
  45. package/dist/src/i18n/resolve-document.d.ts.map +1 -0
  46. package/dist/src/i18n/translation-index.d.ts +7 -0
  47. package/dist/src/i18n/translation-index.d.ts.map +1 -0
  48. package/dist/src/index.d.ts +18 -0
  49. package/dist/src/index.d.ts.map +1 -0
  50. package/dist/src/loader/create-loader.d.ts +17 -0
  51. package/dist/src/loader/create-loader.d.ts.map +1 -0
  52. package/dist/src/loader/normalize-en.d.ts +3 -0
  53. package/dist/src/loader/normalize-en.d.ts.map +1 -0
  54. package/dist/src/loader/parse-mdx.d.ts +7 -0
  55. package/dist/src/loader/parse-mdx.d.ts.map +1 -0
  56. package/dist/src/redirects/build-redirects.d.ts +17 -0
  57. package/dist/src/redirects/build-redirects.d.ts.map +1 -0
  58. package/dist/src/redirects/translation-index.d.ts +4 -0
  59. package/dist/src/redirects/translation-index.d.ts.map +1 -0
  60. package/dist/src/redirects/types.d.ts +6 -0
  61. package/dist/src/redirects/types.d.ts.map +1 -0
  62. package/dist/src/runtime.d.ts +5 -0
  63. package/dist/src/runtime.d.ts.map +1 -0
  64. package/dist/src/sitemap/generate-sitemap.d.ts +5 -0
  65. package/dist/src/sitemap/generate-sitemap.d.ts.map +1 -0
  66. package/dist/src/sitemap/join-base-url.d.ts +3 -0
  67. package/dist/src/sitemap/join-base-url.d.ts.map +1 -0
  68. package/dist/src/sitemap/types.d.ts +39 -0
  69. package/dist/src/sitemap/types.d.ts.map +1 -0
  70. package/dist/src/storage/sqlite.d.ts +9 -0
  71. package/dist/src/storage/sqlite.d.ts.map +1 -0
  72. package/dist/src/storage/translations.d.ts +58 -0
  73. package/dist/src/storage/translations.d.ts.map +1 -0
  74. package/dist/src/translate/gemini-client.d.ts +15 -0
  75. package/dist/src/translate/gemini-client.d.ts.map +1 -0
  76. package/dist/src/translate/page-translator.d.ts +24 -0
  77. package/dist/src/translate/page-translator.d.ts.map +1 -0
  78. package/dist/src/translate/prompts/translation-prompt.d.ts +14 -0
  79. package/dist/src/translate/prompts/translation-prompt.d.ts.map +1 -0
  80. package/dist/src/translate/resolve-translate-config.d.ts +10 -0
  81. package/dist/src/translate/resolve-translate-config.d.ts.map +1 -0
  82. package/dist/src/translate/worklist.d.ts +19 -0
  83. package/dist/src/translate/worklist.d.ts.map +1 -0
  84. package/dist/src/validate/validate-project.d.ts +16 -0
  85. package/dist/src/validate/validate-project.d.ts.map +1 -0
  86. package/dist/src/validate/validate-relations.d.ts +19 -0
  87. package/dist/src/validate/validate-relations.d.ts.map +1 -0
  88. package/dist/src/validate/validate-slug-suffix.d.ts +12 -0
  89. package/dist/src/validate/validate-slug-suffix.d.ts.map +1 -0
  90. package/dist/studio/server.cjs +673 -0
  91. package/dist/studio/server.cjs.map +1 -0
  92. package/dist/studio/server.d.ts +7 -0
  93. package/dist/studio/server.d.ts.map +1 -0
  94. package/dist/studio/server.js +664 -0
  95. package/dist/studio/server.js.map +1 -0
  96. package/package.json +70 -0
@@ -0,0 +1,261 @@
1
+ import type { z } from "zod";
2
+ import type { RELATION_BRAND, RelationBrand } from "./field.js";
3
+ /**
4
+ * How document slugs behave across locales.
5
+ * - `"fixed"` — the EN slug is used for every locale.
6
+ * - `"localized"` — each locale gets its own translated slug.
7
+ */
8
+ export type SlugStrategy = "localized" | "fixed";
9
+ /**
10
+ * What `resolve()` returns when a locale has no translation for a slug.
11
+ * - `"en"` — fall back to the default-locale document.
12
+ * - `"none"` — return no document.
13
+ */
14
+ export type IndexFallback = "en" | "none";
15
+ /** Sort order for `list()`. Built-in keys sort by document metadata; pass a comparator for anything else. */
16
+ export type OrderBy<TDoc = ScribeDocument> = "slug" | "publishedAt" | "-publishedAt" | "updatedAt" | "-updatedAt" | ((a: TDoc, b: TDoc) => number);
17
+ export interface CrossValidateContext {
18
+ locale: string;
19
+ defaultLocale: string;
20
+ slug: string;
21
+ enSlug: string;
22
+ knownLocales: readonly string[];
23
+ englishSlugs?: ReadonlySet<string>;
24
+ }
25
+ export interface CrossValidateIssue {
26
+ field: string;
27
+ message: string;
28
+ level: "error" | "warning";
29
+ }
30
+ /** Named locale groups usable with `scribe translate --preset <name>`. */
31
+ export interface LocalePresets {
32
+ active?: string[];
33
+ ultraLight?: string[];
34
+ [name: string]: string[] | undefined;
35
+ }
36
+ /** Per-content-type translation settings (merged over the project-level defaults). */
37
+ export interface TranslateConfig {
38
+ /** Replace the default system prompt entirely. */
39
+ prompt?: string;
40
+ /** Brand/domain context prepended to every translation request. */
41
+ context?: string;
42
+ /** Extra rules appended to the default rules. */
43
+ rules?: string[];
44
+ /** Model override for this content type. */
45
+ model?: string;
46
+ }
47
+ /** Project-level translation defaults. */
48
+ export interface ScribeTranslateDefaults {
49
+ defaultModel?: string;
50
+ prompt?: string;
51
+ context?: string;
52
+ rules?: string[];
53
+ /** Lowercase terms preserved verbatim in localized slugs */
54
+ slugPreserveTerms?: string[];
55
+ }
56
+ /**
57
+ * A content type declaration as written in `scribe.config.ts`.
58
+ * Most fields are optional with sensible defaults — see each field's doc.
59
+ */
60
+ export interface ContentTypeInput<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {
61
+ /** Unique id. Becomes the typed accessor (`scribe.<id>`) and the default `contentDir`. */
62
+ id: string;
63
+ /** Zod schema for the EN frontmatter. Mark fields with `field.translatable()/structural()/relation()`. */
64
+ schema: TSchema;
65
+ /** Directory under the project content dir holding this type's `.mdx` files. Default: the type `id`. */
66
+ contentDir?: string;
67
+ /** URL template for routable types, e.g. `/blog/{slug}`. Must contain exactly one `{slug}`. Omit for reference-only types. */
68
+ path?: string;
69
+ /** Human label (studio UI). Default: capitalized `id`. */
70
+ label?: string;
71
+ /** Default: `"fixed"`. */
72
+ slugStrategy?: SlugStrategy;
73
+ /** Default: `"en"` when the type has a `path`, otherwise `"none"`. */
74
+ indexFallback?: IndexFallback;
75
+ /** Default sort for `list()`. Default: `"slug"`. */
76
+ orderBy?: OrderBy<ScribeDocument<z.infer<TSchema>>>;
77
+ /** Custom validation across fields, run by `scribe validate`. */
78
+ crossValidate?: (data: z.infer<TSchema>, ctx: CrossValidateContext) => CrossValidateIssue[];
79
+ translate?: TranslateConfig;
80
+ }
81
+ /** A content type with all defaults applied (what runtimes and the CLI consume). */
82
+ export interface ContentTypeConfig<TSchema extends z.ZodTypeAny = z.ZodTypeAny> extends ContentTypeInput<TSchema> {
83
+ contentDir: string;
84
+ label: string;
85
+ slugStrategy: SlugStrategy;
86
+ indexFallback: IndexFallback;
87
+ }
88
+ /**
89
+ * The shape accepted by `defineConfig()` / `createScribe()`.
90
+ * Relative paths (`contentDir`, `store`) resolve against `rootDir`.
91
+ */
92
+ export interface ScribeConfigInput<TTypes extends readonly ContentTypeInput<any>[] = readonly ContentTypeInput[]> {
93
+ /** Absolute project root (the directory holding `scribe.config.ts`). */
94
+ rootDir: string;
95
+ /** Directory containing the per-type content folders. Default: `"content"`. */
96
+ contentDir?: string;
97
+ /** Path to the SQLite translation store. Default: `".scribe/store.sqlite"`. */
98
+ store?: string;
99
+ /** All locales, including the default one. */
100
+ locales: string[];
101
+ /** Canonical source locale. Must be in `locales`. Default: `"en"`. */
102
+ defaultLocale?: string;
103
+ localePresets?: LocalePresets;
104
+ translate?: ScribeTranslateDefaults;
105
+ types: TTypes;
106
+ }
107
+ /**
108
+ * A fully resolved Scribe config (all defaults applied, paths absolute).
109
+ * Note: `rootDir` here is the absolute **content** root, not the project root.
110
+ */
111
+ export interface ScribeConfig {
112
+ /** Absolute content root (project `rootDir` + `contentDir`). */
113
+ rootDir: string;
114
+ /** Absolute path to the SQLite translation store. */
115
+ storePath: string;
116
+ locales: string[];
117
+ defaultLocale: string;
118
+ localePresets?: LocalePresets;
119
+ translate?: ScribeTranslateDefaults;
120
+ types: ContentTypeConfig[];
121
+ }
122
+ /** A loaded document (EN file or stored translation). */
123
+ export interface ScribeDocument<TFrontmatter = Record<string, unknown>> {
124
+ /** Slug in this document's locale (differs from `enSlug` for localized slugs). */
125
+ slug: string;
126
+ /** Slug of the EN (default-locale) parent. Equal to `slug` for EN documents. */
127
+ enSlug: string;
128
+ locale: string;
129
+ /** Inbound slug aliases (EN canonical docs only). */
130
+ aliases: string[];
131
+ /** Outbound retirement redirect, e.g. `/blog/successor-slug`. */
132
+ redirectTo?: string;
133
+ publishedAt?: string;
134
+ updatedAt?: string;
135
+ noindex: boolean;
136
+ /** Explicit EN frontmatter override for canonical URL path. */
137
+ canonicalPathOverride?: string;
138
+ frontmatter: TFrontmatter;
139
+ content: string;
140
+ filePath?: string;
141
+ }
142
+ export interface LocaleIndex<TDoc = ScribeDocument> {
143
+ bySlug: ReadonlyMap<string, TDoc>;
144
+ byEnSlug: ReadonlyMap<string, TDoc>;
145
+ }
146
+ export type AllDocuments<TDoc = ScribeDocument> = ReadonlyMap<string, LocaleIndex<TDoc>>;
147
+ /** Result of `resolve()`: the document plus redirect/canonical routing data. */
148
+ export interface ResolvedDocument<TDoc = ScribeDocument> {
149
+ document: TDoc | null;
150
+ /** Locale actually served (differs from the requested locale on EN fallback). */
151
+ actualLocale: string;
152
+ /** 301 target when the slug is an alias or belongs to another locale. */
153
+ shouldRedirectTo?: string;
154
+ /** Locale-aware pathname when the type has `path` and a document was found. */
155
+ canonicalPath?: string;
156
+ }
157
+ /** `{ locale, slug }` pairs for Next.js `generateStaticParams()`. */
158
+ export interface StaticParam {
159
+ locale: string;
160
+ slug: string;
161
+ }
162
+ export interface ListOptions<TDoc = ScribeDocument> {
163
+ /** Override the type's configured `orderBy` for this call. */
164
+ orderBy?: OrderBy<TDoc>;
165
+ limit?: number;
166
+ }
167
+ /** Untyped default for the `related()` field map. */
168
+ export type AnyRelatedMap = Record<string, ScribeDocument | ScribeDocument[] | null>;
169
+ /**
170
+ * Per-content-type runtime API.
171
+ *
172
+ * Reads: `list`, `get`, `resolve`. Routing: `staticParams`, `alternates`,
173
+ * `translation`, `url`. Relations: `related`. Low-level escape hatch: `load`.
174
+ */
175
+ export interface ContentTypeRuntime<TDoc extends ScribeDocument = ScribeDocument, TRelated extends Record<string, unknown> = AnyRelatedMap> {
176
+ id: string;
177
+ config: ContentTypeConfig;
178
+ /** All documents for a locale (default: the default locale), sorted by the type's `orderBy`. */
179
+ list: (locale?: string, options?: ListOptions<TDoc>) => TDoc[];
180
+ /** Exact slug lookup in one locale (default: the default locale). No fallback, no redirects. */
181
+ get: (slug: string, locale?: string) => TDoc | null;
182
+ /** Full resolution: aliases, cross-locale slug correction, EN fallback, redirects, canonical path. */
183
+ resolve: (slug: string, locale: string) => ResolvedDocument<TDoc>;
184
+ /** Every `{ locale, slug }` pair to prerender — one call in `generateStaticParams()`. */
185
+ staticParams: (options?: {
186
+ locales?: readonly string[];
187
+ }) => StaticParam[];
188
+ /** hreflang map: locale → relative path, for every locale with a translation (default locale always included). */
189
+ alternates: (doc: TDoc) => Record<string, string>;
190
+ /** The same document in another locale, or null when untranslated (callers typically do `?? doc`). */
191
+ translation: (doc: TDoc, targetLocale: string) => TDoc | null;
192
+ /** Pathname for a slug + locale from the type's `path` template. */
193
+ url: (slug: string, locale: string) => string;
194
+ /** Dereference a `field.relation()` frontmatter field into the target type's document(s). */
195
+ related: <K extends keyof TRelated & string>(doc: TDoc, field: K, locale?: string) => TRelated[K];
196
+ /** Low-level access to the full locale → index map. Prefer `list`/`get`/`resolve`. */
197
+ load: () => AllDocuments<TDoc>;
198
+ }
199
+ /** Infer the document type from a content type declaration. */
200
+ export type InferDocFromTypeConfig<T extends ContentTypeInput<any>> = ScribeDocument<z.infer<T["schema"]>>;
201
+ /** Map content type id → document type from a config types tuple. */
202
+ export type InferDocMap<TTypes extends readonly ContentTypeInput<any>[]> = {
203
+ [T in TTypes[number] as T["id"]]: InferDocFromTypeConfig<T>;
204
+ };
205
+ /** Document map (id → ScribeDocument) from a config object type. */
206
+ export type ScribeDocs<C extends {
207
+ types: readonly ContentTypeInput<any>[];
208
+ }> = InferDocMap<C["types"]>;
209
+ /** Single doc type by content-type id. */
210
+ export type ScribeDocOf<C extends {
211
+ types: readonly ContentTypeInput<any>[];
212
+ }, Id extends keyof ScribeDocs<C> & string> = ScribeDocs<C>[Id];
213
+ type RelationBrandOf<TField> = TField extends {
214
+ [RELATION_BRAND]: infer B extends RelationBrand<string, boolean, boolean>;
215
+ } ? B : never;
216
+ /** Top-level `field.relation()` fields of a schema, keyed by field name. */
217
+ export type RelationFieldsOf<TSchema extends z.ZodTypeAny> = TSchema extends z.ZodObject<infer Shape> ? {
218
+ [K in keyof Shape as [RelationBrandOf<Shape[K]>] extends [never] ? never : K]: RelationBrandOf<Shape[K]>;
219
+ } : {};
220
+ type RelatedDoc<B, TDocMap> = B extends RelationBrand<infer TTarget, infer TMultiple, infer TOptional> ? TTarget extends keyof TDocMap ? TMultiple extends true ? Array<TDocMap[TTarget]> : TOptional extends true ? TDocMap[TTarget] | null : TDocMap[TTarget] : never : never;
221
+ /** `related()` return types for a content type, derived from its schema's relation fields. */
222
+ export type RelatedMapFor<T extends ContentTypeInput<any>, TTypes extends readonly ContentTypeInput<any>[]> = {
223
+ [K in keyof RelationFieldsOf<T["schema"]> & string]: RelatedDoc<RelationFieldsOf<T["schema"]>[K], InferDocMap<TTypes>>;
224
+ };
225
+ /**
226
+ * The typed Scribe client returned by `createScribe()`.
227
+ * Each content type id becomes a typed accessor: `scribe.blog.list()`, `scribe.blog.related(doc, "author")`, …
228
+ */
229
+ export type Scribe<TTypes extends readonly ContentTypeInput<any>[]> = {
230
+ readonly [T in TTypes[number] as T["id"]]: ContentTypeRuntime<InferDocFromTypeConfig<T>, RelatedMapFor<T, TTypes>>;
231
+ } & {
232
+ /** Sitemap entries (with hreflang alternates) for all routable types. */
233
+ sitemap(options: import("../sitemap/types.js").GenerateSitemapOptions): Promise<import("../sitemap/types.js").SitemapEntry[]>;
234
+ /** The resolved config (defaults applied, paths absolute). */
235
+ config: ScribeConfig;
236
+ project: ScribeProject;
237
+ getType: ScribeProject["getType"];
238
+ listTypes: ScribeProject["listTypes"];
239
+ };
240
+ /** Typed client type from a config object type (for app-side type aliases). */
241
+ export type ScribeClient<C extends {
242
+ types: readonly ContentTypeInput<any>[];
243
+ }> = Scribe<C["types"]>;
244
+ /** Untyped project engine (CLI, validation, studio). Prefer `createScribe()` in apps. */
245
+ export interface ScribeProject {
246
+ config: ScribeConfig;
247
+ rootDir: string;
248
+ storePath: string;
249
+ getType: (id: string) => ContentTypeRuntime;
250
+ listTypes: () => ContentTypeRuntime[];
251
+ }
252
+ /** Identity helper that preserves content-type id and schema inference. */
253
+ export declare function defineConfig<const TTypes extends readonly ContentTypeInput<any>[]>(config: ScribeConfigInput<TTypes>): ScribeConfigInput<TTypes>;
254
+ /** Identity helper for a single content type entry. */
255
+ export declare function defineContentType<const TId extends string, TSchema extends z.ZodTypeAny>(config: ContentTypeInput<TSchema> & {
256
+ id: TId;
257
+ }): ContentTypeInput<TSchema> & {
258
+ id: TId;
259
+ };
260
+ export {};
261
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,MAAM,CAAC;AAE1C,6GAA6G;AAC7G,MAAM,MAAM,OAAO,CAAC,IAAI,GAAG,cAAc,IACrC,MAAM,GACN,aAAa,GACb,cAAc,GACd,WAAW,GACX,YAAY,GACZ,CAAC,CAAC,CA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yFAAyF;AACzF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,kBAAkB,CAAC;IAC5C,SAAS,EAAE,MAAM,kBAAkB,EAAE,CAAC;CACvC;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,CAAC,MAAM,SAAS,SAAS,gBAAgB,CAAC,GAAG,CAAC,EAAE,EAChF,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAChC,iBAAiB,CAAC,MAAM,CAAC,CAE3B;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,GAAG,SAAS,MAAM,EACxB,OAAO,SAAS,CAAC,CAAC,UAAU,EAE5B,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,GAC9C,gBAAgB,CAAC,OAAO,CAAC,GAAG;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,CAEzC"}
@@ -0,0 +1,10 @@
1
+ import type { ScribeConfig, ScribeProject } from "./core/types.js";
2
+ /**
3
+ * Create the untyped project engine (CLI, validation, studio).
4
+ * Apps should use `createScribe()` for typed per-type accessors.
5
+ * Expects a resolved config (`resolveConfig` / `loadConfigSync`).
6
+ *
7
+ * @internal
8
+ */
9
+ export declare function createProject(config: ScribeConfig): ScribeProject;
10
+ //# sourceMappingURL=create-project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../src/create-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,YAAY,EAEZ,aAAa,EAEd,MAAM,iBAAiB,CAAC;AAoLzB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAuBjE"}
@@ -0,0 +1,11 @@
1
+ import type { ContentTypeInput, Scribe, ScribeConfigInput } from "./core/types.js";
2
+ /**
3
+ * Create the typed Scribe client. Each content type id becomes a typed
4
+ * accessor (`scribe.blog.list()`, `scribe.blog.related(doc, "author")`, …),
5
+ * plus `scribe.sitemap()`.
6
+ *
7
+ * Pass the object returned by `defineConfig()`; defaults and path resolution
8
+ * are applied here.
9
+ */
10
+ export declare function createScribe<const TTypes extends readonly ContentTypeInput<any>[]>(input: ScribeConfigInput<TTypes>): Scribe<TTypes>;
11
+ //# sourceMappingURL=create-scribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-scribe.d.ts","sourceRoot":"","sources":["../../src/create-scribe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,MAAM,EACN,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAMzB;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,MAAM,SAAS,SAAS,gBAAgB,CAAC,GAAG,CAAC,EAAE,EAChF,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAC/B,MAAM,CAAC,MAAM,CAAC,CAmBhB"}
@@ -0,0 +1,7 @@
1
+ /** SHA-256 hex digest of a UTF-8 string. */
2
+ export declare function sha256(input: string): string;
3
+ /** Hash translatable frontmatter + body for translation staleness detection. */
4
+ export declare function computePageEnHash(translatableFrontmatter: Record<string, unknown>, body: string): string;
5
+ /** Hash MDX body content for revision tracking. */
6
+ export declare function computeBodyHash(body: string): string;
7
+ //# sourceMappingURL=page-hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-hash.d.ts","sourceRoot":"","sources":["../../../src/hash/page-hash.ts"],"names":[],"mappings":"AAEA,4CAA4C;AAC5C,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChD,IAAI,EAAE,MAAM,GACX,MAAM,CAGR;AAED,mDAAmD;AACnD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD"}
@@ -0,0 +1,12 @@
1
+ import type { ScribeConfig } from "../core/types.js";
2
+ /** Append a revision row to the SQLite store. */
3
+ export declare function recordRevision(config: ScribeConfig, input: {
4
+ contentType: string;
5
+ enSlug: string;
6
+ locale: string | null;
7
+ revisionKind: "translation" | "en_edit_detected" | "snapshot";
8
+ enHash: string;
9
+ body: string;
10
+ model?: string;
11
+ }): number;
12
+ //# sourceMappingURL=record-revision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-revision.d.ts","sourceRoot":"","sources":["../../../src/history/record-revision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,iDAAiD;AACjD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE;IACL,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,aAAa,GAAG,kBAAkB,GAAG,UAAU,CAAC;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,MAAM,CAeR"}
@@ -0,0 +1,14 @@
1
+ import type { ContentTypeConfig } from "../core/types.js";
2
+ /** Whether a content type has a public URL path template. */
3
+ export declare function isRoutableType(type: Pick<ContentTypeConfig, "path">): boolean;
4
+ /** Validate path template at project init. */
5
+ export declare function assertValidPathTemplate(path: string, typeId: string): void;
6
+ /** Segment before `{slug}` in the template, e.g. `/blog/` from `/blog/{slug}`. */
7
+ export declare function pathPrefix(template: string): string;
8
+ /** Segment after `{slug}` in the template, e.g. `/advanced` from `/blog/{slug}/advanced`. */
9
+ export declare function pathSuffix(template: string): string;
10
+ /** Build a locale-aware pathname from a path template and slug. */
11
+ export declare function resolvePath(template: string, slug: string, locale: string, defaultLocale: string): string;
12
+ /** Extract slug from a resolved path that matches the template. */
13
+ export declare function extractSlugFromResolvedPath(template: string, resolvedPath: string): string | null;
14
+ //# sourceMappingURL=build-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-url.d.ts","sourceRoot":"","sources":["../../../src/i18n/build-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,6DAA6D;AAC7D,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAAG,OAAO,CAE7E;AAED,8CAA8C;AAC9C,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAU1E;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAInD;AAED,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAInD;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACpB,MAAM,CAIR;AAED,mEAAmE;AACnE,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQjG"}
@@ -0,0 +1,12 @@
1
+ import type { ContentTypeConfig, ScribeDocument, ResolvedDocument } from "../core/types.js";
2
+ /** Resolve a document by slug and locale (fallback, aliases, redirects). */
3
+ export declare function resolveLocalizedDocument<TDoc extends ScribeDocument>(slug: string, locale: string, defaultLocale: string, allDocs: ReadonlyMap<string, {
4
+ bySlug: ReadonlyMap<string, TDoc>;
5
+ byEnSlug: ReadonlyMap<string, TDoc>;
6
+ }>, type: ContentTypeConfig): ResolvedDocument<TDoc>;
7
+ /** Map a document slug from one locale to another via the EN parent slug. */
8
+ export declare function getSlugForLocale<TDoc extends ScribeDocument>(document: TDoc, sourceLocale: string, targetLocale: string, allDocs: ReadonlyMap<string, {
9
+ bySlug: ReadonlyMap<string, TDoc>;
10
+ byEnSlug: ReadonlyMap<string, TDoc>;
11
+ }>, defaultLocale: string): string | null;
12
+ //# sourceMappingURL=resolve-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-document.d.ts","sourceRoot":"","sources":["../../../src/i18n/resolve-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAgE5F,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,IAAI,SAAS,cAAc,EAClE,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;CAAE,CAAC,EACxG,IAAI,EAAE,iBAAiB,GACtB,gBAAgB,CAAC,IAAI,CAAC,CA2FxB;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,cAAc,EAC1D,QAAQ,EAAE,IAAI,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;CAAE,CAAC,EACxG,aAAa,EAAE,MAAM,GACpB,MAAM,GAAG,IAAI,CAQf"}
@@ -0,0 +1,7 @@
1
+ import type { AllDocuments } from "../core/types.js";
2
+ /**
3
+ * Internal: locale → (en_slug → locale slug) map for all non-default locales.
4
+ * Consumed by `staticParams()`, `alternates()`, and redirect expansion.
5
+ */
6
+ export declare function buildTranslationIndex(allDocs: AllDocuments, locales: readonly string[], defaultLocale: string): Map<string, Map<string, string>>;
7
+ //# sourceMappingURL=translation-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation-index.d.ts","sourceRoot":"","sources":["../../../src/i18n/translation-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,aAAa,EAAE,MAAM,GACpB,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAalC"}
@@ -0,0 +1,18 @@
1
+ export { field, getRelationTarget, getFieldKind, unwrapSchema } from "./core/field.js";
2
+ export type { RelationBrand, RelationField, RelationFieldOptions, RelationMeta, } from "./core/field.js";
3
+ export { defineConfig, defineContentType } from "./core/types.js";
4
+ export type { ScribeConfigInput, ScribeConfig, ScribeProject, ScribeDocument, ContentTypeInput, ContentTypeConfig, ContentTypeRuntime, ListOptions, OrderBy, StaticParam, LocaleIndex, AllDocuments, ResolvedDocument, CrossValidateContext, CrossValidateIssue, TranslateConfig, ScribeTranslateDefaults, LocalePresets, SlugStrategy, IndexFallback, Scribe, InferDocMap, InferDocFromTypeConfig, RelationFieldsOf, RelatedMapFor, ScribeClient, ScribeDocs, ScribeDocOf, } from "./core/types.js";
5
+ export { createScribe } from "./create-scribe.js";
6
+ export { createProject } from "./create-project.js";
7
+ export { resolveConfig, isResolvedConfig } from "./config/resolve-config.js";
8
+ export { loadConfigSync, findConfigPath } from "./config/load-config.js";
9
+ export { validateProject } from "./validate/validate-project.js";
10
+ export type { ValidateIssue, ValidateResult } from "./validate/validate-project.js";
11
+ export { buildAllContentRedirects, getRedirectSourceSlugs, } from "./redirects/build-redirects.js";
12
+ export type { NextRedirectRule } from "./redirects/types.js";
13
+ export type { RedirectSourceSlugs } from "./redirects/build-redirects.js";
14
+ export { buildWorklist, resolveLocalesFromPreset } from "./translate/worklist.js";
15
+ export { translatePage, translateWorklist } from "./translate/page-translator.js";
16
+ export { generateSitemap } from "./sitemap/generate-sitemap.js";
17
+ export type { GenerateSitemapOptions, SitemapAlternateLanguages, SitemapChangeFrequency, SitemapEntry, SitemapTypeDefaults, } from "./sitemap/types.js";
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvF,YAAY,EACV,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,MAAM,EACN,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,YAAY,EACZ,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { AllDocuments, ContentTypeConfig, ScribeConfig, ScribeDocument } from "../core/types.js";
2
+ export interface ParseEnResult {
3
+ document: ScribeDocument | null;
4
+ issues: Array<{
5
+ field: string;
6
+ message: string;
7
+ level: "error" | "warning";
8
+ }>;
9
+ }
10
+ export declare function parseEnMdx(filePath: string, config: ScribeConfig, type: ContentTypeConfig): ParseEnResult;
11
+ export declare function createContentLoader(config: ScribeConfig, type: ContentTypeConfig): () => AllDocuments;
12
+ export declare function readEnDocument(config: ScribeConfig, type: ContentTypeConfig, enSlug: string): ScribeDocument | null;
13
+ export declare function getTranslatablePayload(doc: ScribeDocument, type: ContentTypeConfig): {
14
+ frontmatter: Record<string, unknown>;
15
+ body: string;
16
+ };
17
+ //# sourceMappingURL=create-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-loader.d.ts","sourceRoot":"","sources":["../../../src/loader/create-loader.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EAEjB,YAAY,EACZ,cAAc,EACf,MAAM,kBAAkB,CAAC;AAqB1B,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;CAC/E;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,iBAAiB,GACtB,aAAa,CA2Ef;AAwCD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,GAAG,MAAM,YAAY,CAoGrG;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,MAAM,GACb,cAAc,GAAG,IAAI,CASvB;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,iBAAiB,GACtB;IAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAKxD"}
@@ -0,0 +1,3 @@
1
+ export declare function normalizeEnFrontmatter(data: Record<string, unknown>): Record<string, unknown>;
2
+ export declare function isPublishableContentFile(name: string): boolean;
3
+ //# sourceMappingURL=normalize-en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-en.d.ts","sourceRoot":"","sources":["../../../src/loader/normalize-en.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY7F;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAI9D"}
@@ -0,0 +1,7 @@
1
+ export interface ParsedMdx {
2
+ frontmatter: Record<string, unknown>;
3
+ content: string;
4
+ }
5
+ export declare function parseMdx(raw: string): ParsedMdx;
6
+ export declare function serializeMdx(frontmatter: Record<string, unknown>, content: string): string;
7
+ //# sourceMappingURL=parse-mdx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-mdx.d.ts","sourceRoot":"","sources":["../../../src/loader/parse-mdx.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAM/C;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1F"}
@@ -0,0 +1,17 @@
1
+ import type { ScribeProject } from "../core/types.js";
2
+ import type { NextRedirectRule } from "./types.js";
3
+ export interface BuildRedirectsOptions {
4
+ /** Locales that use a URL prefix (excludes default locale). */
5
+ prefixedLocales: string[];
6
+ }
7
+ /** Build Next.js redirect rules from aliases, redirect_to, and locale slug fixes. */
8
+ export declare function buildAllContentRedirects(project: ScribeProject, options: BuildRedirectsOptions): NextRedirectRule[];
9
+ export interface RedirectSourceSlugs {
10
+ /** All alias slugs (inbound old slugs) — exclude from sitemap. */
11
+ aliasSlugs: Set<string>;
12
+ /** EN canonical slugs with outbound redirect_to — exclude from sitemap. */
13
+ outboundByType: Map<string, Set<string>>;
14
+ }
15
+ /** Slugs excluded from sitemap (aliases and outbound redirect_to sources). */
16
+ export declare function getRedirectSourceSlugs(project: ScribeProject): RedirectSourceSlugs;
17
+ //# sourceMappingURL=build-redirects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-redirects.d.ts","sourceRoot":"","sources":["../../../src/redirects/build-redirects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,MAAM,WAAW,qBAAqB;IACpC,+DAA+D;IAC/D,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AA6MD,qFAAqF;AACrF,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,qBAAqB,GAC7B,gBAAgB,EAAE,CAUpB;AAED,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,2EAA2E;IAC3E,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CAC1C;AAED,8EAA8E;AAC9E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,mBAAmB,CAiBlF"}
@@ -0,0 +1,4 @@
1
+ import type { ScribeProject } from "../core/types.js";
2
+ /** Merged en_slug → locale slug map for redirect expansion (loader + orphan sqlite alias rows). */
3
+ export declare function buildRedirectTranslationIndex(project: ScribeProject, typeId: string): Map<string, Map<string, string>>;
4
+ //# sourceMappingURL=translation-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation-index.d.ts","sourceRoot":"","sources":["../../../src/redirects/translation-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,mGAAmG;AACnG,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,GACb,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA6BlC"}
@@ -0,0 +1,6 @@
1
+ export interface NextRedirectRule {
2
+ source: string;
3
+ destination: string;
4
+ permanent: boolean;
5
+ }
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/redirects/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,5 @@
1
+ /** App-code entry — use instead of `scribe-cms` in bundled server code (Next.js, Astro, …) to keep CLI/translator code paths out of bundler tracing. */
2
+ export { createScribe } from "./create-scribe.js";
3
+ export type { ScribeConfigInput, ScribeConfig, ScribeDocument, ContentTypeInput, ContentTypeConfig, ContentTypeRuntime, ListOptions, OrderBy, StaticParam, ResolvedDocument, Scribe, InferDocMap, InferDocFromTypeConfig, ScribeClient, ScribeDocs, ScribeDocOf, } from "./core/types.js";
4
+ export type { SitemapEntry, SitemapChangeFrequency } from "./sitemap/types.js";
5
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA,wJAAwJ;AACxJ,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ScribeProject } from "../core/types.js";
2
+ import type { GenerateSitemapOptions, SitemapEntry } from "./types.js";
3
+ /** Build sitemap entries with hreflang alternates for routable content types. */
4
+ export declare function generateSitemap(project: ScribeProject, options: GenerateSitemapOptions): Promise<SitemapEntry[]>;
5
+ //# sourceMappingURL=generate-sitemap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-sitemap.d.ts","sourceRoot":"","sources":["../../../src/sitemap/generate-sitemap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIrH,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAuFvE,iFAAiF;AACjF,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,YAAY,EAAE,CAAC,CA8CzB"}
@@ -0,0 +1,3 @@
1
+ /** Join site origin and pathname without double slashes. */
2
+ export declare function joinBaseUrl(baseUrl: string, pathname: string): string;
3
+ //# sourceMappingURL=join-base-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-base-url.d.ts","sourceRoot":"","sources":["../../../src/sitemap/join-base-url.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIrE"}
@@ -0,0 +1,39 @@
1
+ import type { ContentTypeConfig, ScribeDocument } from "../core/types.js";
2
+ export type SitemapChangeFrequency = "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
3
+ export interface SitemapAlternateLanguages {
4
+ languages?: Record<string, string>;
5
+ }
6
+ /** JSON-serializable sitemap entry (Next.js-compatible shape). */
7
+ export interface SitemapEntry {
8
+ url: string;
9
+ /** ISO 8601 — sourced from Scribe `updatedAt`, falling back to `publishedAt`. */
10
+ lastModified?: string;
11
+ changeFrequency?: SitemapChangeFrequency;
12
+ priority?: number;
13
+ alternates?: SitemapAlternateLanguages;
14
+ }
15
+ export interface SitemapTypeDefaults {
16
+ changeFrequency?: SitemapChangeFrequency;
17
+ priority?: number;
18
+ }
19
+ export interface GenerateSitemapOptions {
20
+ /** Site origin, e.g. `https://example.com` (no trailing slash). */
21
+ baseUrl: string;
22
+ /**
23
+ * Resolve a locale-specific pathname to an absolute URL.
24
+ * `pathname` always starts with `/`.
25
+ * Default: `(locale, pathname) => joinBaseUrl(baseUrl, pathname)`.
26
+ */
27
+ resolveUrl?: (locale: string, pathname: string) => string | Promise<string>;
28
+ /** Routable content types to include. Defaults to every type with a `path`. */
29
+ contentTypes?: string[];
30
+ /** Per-type sitemap defaults. */
31
+ typeDefaults?: Record<string, SitemapTypeDefaults>;
32
+ /** Override pathname resolution for a loaded document. */
33
+ resolvePathname?: (type: ContentTypeConfig, doc: ScribeDocument, defaultLocale: string) => string;
34
+ /** Skip documents with `noindex: true`. Default true. */
35
+ excludeNoindex?: boolean;
36
+ /** Add `alternates.languages["x-default"]` pointing at the default locale URL. Default true. */
37
+ includeXDefault?: boolean;
38
+ }
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sitemap/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,MAAM,sBAAsB,GAC9B,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACxC;AAED,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5E,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACnD,0DAA0D;IAC1D,eAAe,CAAC,EAAE,CAChB,IAAI,EAAE,iBAAiB,EACvB,GAAG,EAAE,cAAc,EACnB,aAAa,EAAE,MAAM,KAClB,MAAM,CAAC;IACZ,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gGAAgG;IAChG,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
@@ -0,0 +1,9 @@
1
+ import Database from "better-sqlite3";
2
+ import type { ScribeConfig } from "../core/types.js";
3
+ export type SqliteMode = "readonly" | "readwrite";
4
+ /** Absolute path to the SQLite translation store (precomputed by `resolveConfig`). */
5
+ export declare function resolveStorePath(config: ScribeConfig): string;
6
+ /** Open the SQLite translation store (creates schema if missing). */
7
+ export declare function openStore(config: ScribeConfig, mode?: SqliteMode): Database.Database;
8
+ export declare function closeStore(db: Database.Database): void;
9
+ //# sourceMappingURL=sqlite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../../src/storage/sqlite.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAwDrD,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;AAElD,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE7D;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,UAAwB,GAAG,QAAQ,CAAC,QAAQ,CAQjG;AAYD,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAEtD"}