@lupinum/ginko 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +161 -0
- package/README.md +2 -2
- package/dist/basics.d.mts +492 -0
- package/dist/basics.d.ts +492 -0
- package/dist/basics.mjs +416 -0
- package/dist/cli/index.mjs +59 -56
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +3 -3
- package/dist/internal/search.mjs +6 -3
- package/dist/internal.d.mts +387 -41
- package/dist/internal.d.ts +387 -41
- package/dist/internal.mjs +267 -101
- package/dist/nuxt/module.d.mts +2 -2
- package/dist/nuxt/module.d.ts +2 -2
- package/dist/nuxt/module.mjs +108 -15
- package/dist/nuxt/runtime/GinkoImage.d.mts +1 -1
- package/dist/nuxt/runtime/GinkoMarkdown.mjs +2 -2
- package/dist/nuxt/runtime/composables.d.mts +4 -3
- package/dist/nuxt/runtime/composables.mjs +19 -15
- package/dist/nuxt/runtime/fetch.d.mts +3 -1
- package/dist/nuxt/runtime/fetch.mjs +12 -6
- package/dist/nuxt/runtime/markdown.d.mts +3 -0
- package/dist/nuxt/runtime/markdown.mjs +15 -3
- package/dist/nuxt/runtime/plugin.mjs +6 -35
- package/dist/nuxt/runtime/preview-listener.d.mts +13 -0
- package/dist/nuxt/runtime/preview-listener.mjs +37 -0
- package/dist/nuxt/runtime/preview.vue +3 -1
- package/dist/nuxt/runtime/schema.d.ts +6 -0
- package/dist/nuxt/runtime/server/bundles.d.ts +4 -0
- package/dist/nuxt/runtime/server/files-md.d.ts +2 -0
- package/dist/nuxt/runtime/server/files.d.ts +2 -0
- package/dist/nuxt/runtime/server/headers.d.ts +2 -0
- package/dist/nuxt/runtime/server/items.d.mts +12 -0
- package/dist/nuxt/runtime/server/items.d.ts +12 -0
- package/dist/nuxt/runtime/server/items.mjs +17 -0
- package/dist/nuxt/runtime/server/llms-full.d.ts +2 -0
- package/dist/nuxt/runtime/server/llms.d.ts +2 -0
- package/dist/nuxt/runtime/server/markdown-trees.d.ts +2 -0
- package/dist/nuxt/runtime/server/markdown.d.ts +2 -0
- package/dist/nuxt/runtime/server/markdown.mjs +1 -1
- package/dist/nuxt/runtime/server/platform-md.d.mts +3 -0
- package/dist/nuxt/runtime/server/platform-md.d.ts +3 -0
- package/dist/nuxt/runtime/server/platform-md.mjs +71 -0
- package/dist/nuxt/runtime/server/redirects.d.ts +2 -0
- package/dist/nuxt/runtime/server/robots.d.ts +2 -0
- package/dist/nuxt/runtime/server/search.d.ts +2 -0
- package/dist/nuxt/runtime/server/site-config.d.ts +14 -0
- package/dist/nuxt/runtime/server/sitemap-source.d.ts +2 -0
- package/dist/nuxt/runtime/server/sitemap-xml.d.ts +24 -0
- package/dist/nuxt/runtime/server/sitemap.d.ts +2 -0
- package/dist/nuxt/runtime/shared.d.mts +10 -3
- package/dist/nuxt/runtime/shared.mjs +2 -2
- package/dist/shared/{ginko.BBkZW2nW.d.ts → ginko.6cI8KXZP.d.mts} +2 -2
- package/dist/shared/{ginko.CrNRBkS5.mjs → ginko.B1-DoOea.mjs} +253 -309
- package/dist/shared/ginko.BNVC-g9n.mjs +10389 -0
- package/dist/shared/{ginko.Bwan3BB-.d.mts → ginko.B_pACpVU.d.ts} +2 -2
- package/dist/shared/ginko.BaFweQcB.d.mts +91 -0
- package/dist/shared/ginko.BiDXgjLy.d.ts +91 -0
- package/dist/shared/ginko.C-oz8wwI.mjs +95 -0
- package/dist/shared/{ginko.BDF3bW0C.d.ts → ginko.CLzVaDi4.d.ts} +56 -5
- package/dist/shared/ginko.C_nq6vk7.d.mts +1622 -0
- package/dist/shared/ginko.CjWB8N7f.d.ts +128 -0
- package/dist/shared/ginko.D1PeQ3ds.mjs +36 -0
- package/dist/shared/ginko.D2oht0Kx.d.ts +1622 -0
- package/dist/shared/ginko.DCHGkQ7P.mjs +116 -0
- package/dist/shared/ginko.DIl7l-75.mjs +26 -0
- package/dist/shared/{ginko.akHewCGt.d.mts → ginko.DkIc0ZZk.d.mts} +56 -5
- package/dist/shared/{ginko.D-fNojn9.d.mts → ginko.DrkUeYFP.d.mts} +824 -10
- package/dist/shared/{ginko.D-fNojn9.d.ts → ginko.DrkUeYFP.d.ts} +824 -10
- package/dist/shared/ginko.WAfoMhv1.mjs +601 -0
- package/dist/shared/ginko.o1yIKlgj.d.mts +128 -0
- package/dist/shared/{ginko.Dht0xxE5.mjs → ginko.raCzOPYC.mjs} +1 -2
- package/dist/shared/{ginko.C90fPpMP.mjs → ginko.t-gbwzxh.mjs} +128 -101
- package/dist/shared/ginko.yKMIjJ68.mjs +84 -0
- package/dist/vue.d.mts +5 -4
- package/dist/vue.d.ts +5 -4
- package/dist/vue.mjs +1 -1
- package/i18n/ar.json +212 -0
- package/i18n/de.json +9 -1
- package/i18n/en.json +9 -1
- package/i18n/es.json +12 -4
- package/i18n/fr.json +212 -0
- package/i18n/it.json +212 -0
- package/package.json +7 -3
- package/dist/shared/ginko.BTUfZCfa.d.mts +0 -172
- package/dist/shared/ginko.C-QjDn3O.mjs +0 -4944
- package/dist/shared/ginko.CQvxhyez.mjs +0 -40
- package/dist/shared/ginko.Dc0oNcDv.d.ts +0 -172
- package/dist/shared/ginko.Mn30dmlm.mjs +0 -20
package/dist/internal.d.mts
CHANGED
|
@@ -1,19 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { S as SiteInput } from './shared/ginko.
|
|
4
|
-
export { C as CheckLinksOptions, E as ExternalLink, L as LinkConfig, a as LinkIssue, M as Migration, b as MigrationContext,
|
|
5
|
-
import { M as MarkdownTrees, B as Bundle, a as BundleItem } from './shared/ginko.
|
|
6
|
-
export { b as BUNDLE_FORMAT, c as BundleBrick, d as bundleFits, i as isBundle, k as knownBricks, m as markdownTrees, w as withFileBricks } from './shared/ginko.
|
|
7
|
-
export { C as Condition,
|
|
1
|
+
import { C as Currency, L as Locale, c as Label, B as Brick, S as Schema, F as Fields, p as Field, J as Json, P as ParseOptions, E as Issue, x as FileField, G as Described, a as Msg, f as CollectionBrick, M as MarkdownTree, T as Task, W as WeekInfo, b as ComponentRegistry } from './shared/ginko.DrkUeYFP.mjs';
|
|
2
|
+
export { K as ALT_INVISIBLE, O as ALT_MAX, A as AttributeRegistry, o as BooleanField, d as BrickSource, Q as BrickStatus, U as BrickValue, X as CALENDAR_NAMES, r as ChoiceField, Y as ChoiceOption, Z as ChoicesField, e as CollectionStatus, _ as ComponentDef, $ as ComponentSlot, a0 as CoreKey, a1 as DEFAULT_WEEK, a2 as DataOf, D as DateField, k as DateRangeField, a3 as FieldType, a4 as FileValue, a5 as GINKO_COMPONENTS_KEY, a6 as GINKO_TOC_KEY, s as Holiday, t as HolidayCalendar, y as HolidayCalendarName, H as HolidaysOption, I as ImageField, a7 as ImageValue, a8 as ItemOf, v as ListField, a9 as Localized, w as LongTextField, aa as MARKDOWN_PROFILES, m as MarkdownField, ab as MarkdownProfile, ac as MarkdownToc, ad as MarkdownValue, ae as MigrationDescriptor, af as Money, n as MoneyField, N as NumberField, ag as PREFILL_TOKENS, ah as ParsedMarkdown, ai as PrefillToken, q as RefField, R as RetiredRule, aj as STORED_HOLIDAYS, h as SingleBrick, g as SingleStatus, j as SlugField, u as StoredHolidays, ak as TextBlock, i as TextField, l as TimeField, al as TocLink, am as UNSAFE_LINK, an as URL_PROPS, ao as UnknownChoice, ap as ValueOf, V as Visibility, aq as addDays, z as calendarOfCountry, ar as componentProblems, as as componentPropMessage, at as componentPropProblem, au as coreCatalogs, av as coreMessage, aw as defineComponents, ax as describeProfile, ay as effectiveAlt, az as effectiveMax, aA as effectiveProfile, aB as f, aC as firstDayShown, aD as holidaysOf, aE as isPrefillToken, aF as isShown, aG as isTranslatable, aH as msg, aI as parseMarkdown, aJ as plainText, aK as profileCovers, aL as resolveToken, aM as startOfWeek, aN as textBlocks, aO as todayIn, aP as weekInfoOf, aQ as wordsOf, aR as workWeekOf, aS as zoneOffset, aT as zonedDateTime } from './shared/ginko.DrkUeYFP.mjs';
|
|
3
|
+
import { S as SiteInput } from './shared/ginko.DkIc0ZZk.mjs';
|
|
4
|
+
export { C as CheckLinksOptions, E as ExternalLink, L as LinkConfig, a as LinkIssue, M as Migration, b as MigrationContext, c as Redirect, R as RouteTemplate, W as WithoutFiles, d as checkLinks, e as collection, f as defineSite, g as entryRedirects, h as externalLinks, i as findRedirect, l as linkTargets, m as matchRedirect, r as redirectProblems, j as resolveRouteLinks, s as single, k as siteForContent, w as withoutFiles } from './shared/ginko.DkIc0ZZk.mjs';
|
|
5
|
+
import { M as MarkdownTrees, B as Bundle, a as BundleItem } from './shared/ginko.6cI8KXZP.mjs';
|
|
6
|
+
export { b as BUNDLE_FORMAT, c as BundleBrick, d as bundleFits, i as isBundle, k as knownBricks, m as markdownTrees, w as withFileBricks } from './shared/ginko.6cI8KXZP.mjs';
|
|
7
|
+
export { C as Condition, Q as Query, a as QueryOrder, b as QueryResult, c as QuerySchema, f as formatMoney, i as isSafeHref, m as minorDigits, n as neighbors, q as query, s as safeHref } from './shared/ginko.BaFweQcB.mjs';
|
|
8
|
+
export { A as ArticleLdInput, N as NavNode, a as ORGANIZATION_TYPES, O as OrganizationLdInput, S as SeoHead, b as SeoImage, c as SeoInput, d as articleLd, e as breadcrumbJsonLd, f as breadcrumbs, g as faqLd, i as isPreviewHost, n as navTree, o as organizationLd, r as robotsTxt, s as seoHead, h as siteHeaders, w as websiteLd, j as withCountry } from './shared/ginko.o1yIKlgj.mjs';
|
|
9
|
+
export { g as HourPlan, i as HoursLine, j as HoursLineContext, Z as HoursTexts, _ as NoticeTask, $ as PostalAddressInput, a0 as WeekRow, a1 as eventsBrick, a2 as hourPlansBrick, a3 as hoursBrick, z as hoursLine, a4 as noticesBrick, a5 as offerPrice, a6 as postalAddress, a7 as weekdays } from './shared/ginko.C_nq6vk7.mjs';
|
|
8
10
|
import '@lupinum/ginko-i18n/core';
|
|
9
11
|
import 'comark';
|
|
10
12
|
|
|
11
|
-
/**
|
|
12
|
-
declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/** Most content languages one site can have. */
|
|
14
|
+
declare const MAX_LOCALES = 20;
|
|
15
|
+
/**
|
|
16
|
+
* A content language: a BCP-47 tag that `Intl.getCanonicalLocales` accepts and that is already canonical
|
|
17
|
+
* (`es`, `pt-BR`, `zh-Hant`; not `EN-us` or `pt_BR`). Runtime check for `Locale`, which is a plain string.
|
|
18
|
+
*/
|
|
19
|
+
declare function isLocale(value: unknown): value is Locale;
|
|
20
|
+
/** An ISO-4217 code (`EUR`, `JPY`, `SGD`) that this runtime's `Intl` knows. */
|
|
21
|
+
declare function isCurrency(value: unknown): value is Currency;
|
|
22
|
+
/**
|
|
23
|
+
* The text of a label in `locale`: that language, else the main language, else English, else the first one given.
|
|
24
|
+
* A plain string is the main language's text and is shown in every language.
|
|
25
|
+
*/
|
|
26
|
+
declare function labelOf(label: Label, locale: string, main: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* A schema label in the Studio's languages (German, English, Spanish, French), for factories that ship ready-made
|
|
29
|
+
* bricks. The stored schema keeps the record; `labelOf` picks the editor's language and falls back to English.
|
|
30
|
+
*/
|
|
31
|
+
declare const studioLabel: (de: string, en: string, es: string, fr: string) => Record<Locale, string>;
|
|
32
|
+
/**
|
|
33
|
+
* `brick` with every label, hint, group, item label, option label and task label written as its plain text in
|
|
34
|
+
* `locale`. For a package that shares a factory but keeps the one-language labels its sites already store
|
|
35
|
+
* (ginko-docs): a changed label is a schema change on every such site.
|
|
36
|
+
*/
|
|
37
|
+
declare function labelsIn<B extends Brick>(brick: B, locale: Locale): B;
|
|
38
|
+
|
|
17
39
|
declare const SCHEMA_LIMITS: {
|
|
18
40
|
readonly bytes: number;
|
|
19
41
|
readonly bricks: 30;
|
|
@@ -31,6 +53,16 @@ declare function platformSchema(schema: Schema): Schema;
|
|
|
31
53
|
declare function ordered<T extends {
|
|
32
54
|
pos?: number;
|
|
33
55
|
}>(record: Record<string, T>): [string, T][];
|
|
56
|
+
/**
|
|
57
|
+
* A staff member's rights (`brick.task` grants, SPEC 2.7) by area: the live bricks in schema order, each with the
|
|
58
|
+
* labels of its granted tasks in task order. A grant whose brick or task is gone or retired grants nothing and is
|
|
59
|
+
* left out. The one reading of grants for the Team page, the invite mail and the invite page.
|
|
60
|
+
*/
|
|
61
|
+
declare function grantGroups(schema: Pick<Schema, 'bricks'>, grants: readonly string[]): {
|
|
62
|
+
brick: string;
|
|
63
|
+
label: Label;
|
|
64
|
+
tasks: Label[];
|
|
65
|
+
}[];
|
|
34
66
|
/** Exact source text: a changed literal inside the function must change the fingerprint. */
|
|
35
67
|
declare function migrationFingerprint(brick: string, fills: string, compute: (...args: never[]) => unknown): string;
|
|
36
68
|
declare function mainLocale(schema: Pick<Schema, 'locales'>): Locale;
|
|
@@ -45,9 +77,49 @@ declare function checkSite(site: SiteInput, schema?: Schema): string[];
|
|
|
45
77
|
* schemas from the network (release, devPush), so any value is a problem list, never a crash.
|
|
46
78
|
*/
|
|
47
79
|
declare function checkSchema(schema: unknown): string[];
|
|
80
|
+
/** True when `brick` is a live collection with the live fields of `hourPlans()`. */
|
|
81
|
+
declare function isHourPlans(brick: Brick): boolean;
|
|
48
82
|
/** An IANA time zone name this runtime's `Intl` knows, e.g. `Europe/Vienna`. */
|
|
49
83
|
declare function isTimeZone(timeZone: unknown): timeZone is string;
|
|
50
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Content budget per site (SPEC 3): one rule for the platform's writes, imports and releases, the CLI's checks and
|
|
87
|
+
* the Studio's meters. Bytes are the stored text, the JSON of an entry's `data` and `prints`. Markdown trees are
|
|
88
|
+
* derived from that text and do not count; `treeBytes` only bounds their total, so the public bundle a site reads
|
|
89
|
+
* stays inside Convex's read limit even for text that is almost all formatting.
|
|
90
|
+
*
|
|
91
|
+
* `entryBytes` is 480 KiB, not 512: a history row holds the before and after of a changed field, and two values of
|
|
92
|
+
* 512 KiB would pass Convex's 1 MiB document limit. `trashBytes` caps the removed entries, which count apart from the
|
|
93
|
+
* site: a removal past it deletes the oldest removed entries early, and an import past it is refused.
|
|
94
|
+
*
|
|
95
|
+
* The Studio's list queries (ginko-server entries.list, titles, ofBricks) read a whole brick per run, which these
|
|
96
|
+
* limits keep inside Convex's per-query read limits. Raising `siteBytes` above about 8 MiB needs index pagination.
|
|
97
|
+
*/
|
|
98
|
+
declare const SITE_BUDGET: {
|
|
99
|
+
readonly siteBytes: number;
|
|
100
|
+
readonly entries: 2000;
|
|
101
|
+
readonly entryBytes: number;
|
|
102
|
+
readonly treeBytes: number;
|
|
103
|
+
readonly trashBytes: number;
|
|
104
|
+
};
|
|
105
|
+
/** UTF-8 bytes of `value` as JSON, the way the budget counts. */
|
|
106
|
+
declare function byteSize(value: unknown): number;
|
|
107
|
+
/** The bytes one entry counts against the budget: its text, not its derived trees. */
|
|
108
|
+
declare function entryBytes(data: unknown, prints?: unknown): number;
|
|
109
|
+
/**
|
|
110
|
+
* Whether a write keeps a byte count within `limit`. A write that does not grow the count always passes, so an
|
|
111
|
+
* entry or a site that is over its limit (after an import, or a lowered limit) can still be shortened.
|
|
112
|
+
*/
|
|
113
|
+
declare function fitsBudget(after: number, before: number, limit: number): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* About how many bytes a full value of `field` takes: every text at its max in every language, every list at its max
|
|
116
|
+
* rows. One byte per character, as for Latin text (worst-case UTF-8 would flag almost every schema). Several refs
|
|
117
|
+
* without a `max` count 0. An estimate for `ginko check`; the platform's exact count stays the authority.
|
|
118
|
+
*/
|
|
119
|
+
declare function largestFieldBytes(field: Field, locales: readonly string[]): number;
|
|
120
|
+
/** About how many bytes an entry with every field full takes (largestFieldBytes summed), to compare with SITE_BUDGET.entryBytes. */
|
|
121
|
+
declare function largestEntryBytes(fields: Fields, locales: readonly string[]): number;
|
|
122
|
+
|
|
51
123
|
/**
|
|
52
124
|
* The source of one or more neighbouring top-level nodes. One block has one node, except where the
|
|
53
125
|
* text cannot be cut between them (`# Title` directly followed by a line of text) or where a piece
|
|
@@ -97,19 +169,38 @@ declare function serializeMarkdown(nodes: readonly Json[], options?: SerializeOp
|
|
|
97
169
|
* True when `text` survives a trip through comark's renderer: parse, render the whole tree, parse
|
|
98
170
|
* again gives the same nodes. The editor opens a text in source mode when this is false. The
|
|
99
171
|
* `<!-- more -->` line is not part of the nodes, so it does not count here (serializeMarkdown with
|
|
100
|
-
* `original` keeps it).
|
|
172
|
+
* `original` keeps it). A text with parts the tree does not show (`hidden`) is never stable: written
|
|
173
|
+
* from the tree, it would lose them. Frontmatter is read and ignored.
|
|
101
174
|
*/
|
|
102
175
|
declare function isStableMarkdown(text: string, options?: ParseOptions): Promise<boolean>;
|
|
103
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Codes of values the Studio and the site cannot read at all (wrong shape, unknown names). A `restore` refuses only
|
|
179
|
+
* these: a backup brings back what the platform once stored, even where a rule became stricter since.
|
|
180
|
+
*/
|
|
181
|
+
declare const SHAPE_CODES: ReadonlySet<string>;
|
|
104
182
|
interface ValidateOptions {
|
|
105
|
-
/**
|
|
106
|
-
|
|
183
|
+
/**
|
|
184
|
+
* create/release: everything strict. patch: only paths under `changed` are errors, the rest are warnings.
|
|
185
|
+
* restore (backup import, never a Studio path): only SHAPE_CODES are errors, the rest are warnings.
|
|
186
|
+
* The rules across fields (`ruleIssues`: a plan set by halves, a week that does not start on its first day) bind
|
|
187
|
+
* what is written now: errors in create, and in patch when the save touches one of their fields. Stored data that
|
|
188
|
+
* breaks one (release, restore) only warns.
|
|
189
|
+
*/
|
|
190
|
+
mode: 'create' | 'patch' | 'release' | 'restore';
|
|
107
191
|
/** Leaf paths changed by a patch, e.g. `closedNote` or `days.k3Fd9aZ0qx.dish`. */
|
|
108
192
|
changed?: ReadonlySet<string>;
|
|
109
193
|
/** Whether entry `id` exists in collection brick `brick`. Without it, referenced IDs are not looked up. */
|
|
110
194
|
refs?: (brick: string, id: string) => boolean;
|
|
111
195
|
/** The description text a file has in the Files library, per language. Without it an image field must carry its own main-language alt. */
|
|
112
196
|
fileAlt?: (file: string) => Record<string, string> | undefined;
|
|
197
|
+
/**
|
|
198
|
+
* Platform texts: the kind of the ready upload of the site, not in the trash, that a `$file.<id>` in a Markdown text
|
|
199
|
+
* names (`image`, or `file` for a PDF); undefined when there is none. With it, every such reference must name one, a
|
|
200
|
+
* picture must name an image, and every Markdown image needs a description (its own, else the library's in
|
|
201
|
+
* `fileAlt`), the rule of image fields. Without it (file content) none of this is checked.
|
|
202
|
+
*/
|
|
203
|
+
uploads?: (file: string) => 'image' | 'file' | undefined;
|
|
113
204
|
}
|
|
114
205
|
interface ValidationResult {
|
|
115
206
|
errors: Issue[];
|
|
@@ -150,6 +241,34 @@ interface SchemaDiff {
|
|
|
150
241
|
*/
|
|
151
242
|
declare function diffSchema(prod: Schema, next: Schema): SchemaDiff;
|
|
152
243
|
|
|
244
|
+
type Row = Record<string, Json>;
|
|
245
|
+
interface RowDiff {
|
|
246
|
+
/** The row's `_id`; `#<index>` for a row without one (legacy data). */
|
|
247
|
+
id: string;
|
|
248
|
+
change: 'added' | 'removed' | 'changed';
|
|
249
|
+
before: Json | null;
|
|
250
|
+
after: Json | null;
|
|
251
|
+
/** Keys of the row whose value differs (only for `changed`). */
|
|
252
|
+
fields?: string[];
|
|
253
|
+
}
|
|
254
|
+
/** Added, removed and changed rows of a list by `_id`, and whether the rows both sides keep moved. */
|
|
255
|
+
declare function rowDiffs(before: Json | null | undefined, after: Json | null | undefined): {
|
|
256
|
+
rows: RowDiff[];
|
|
257
|
+
reordered?: true;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* Both people's row changes of one list since `base`: their list in their order, my edits on rows
|
|
261
|
+
* they left as they were, my removals of rows they did not change, and my new rows after the row
|
|
262
|
+
* before them in my list (after their new rows there). `clashes` are the ids of rows both changed
|
|
263
|
+
* differently, or one changed and the other removed. A moved row, or a row without `_id`, cannot be
|
|
264
|
+
* merged row by row: `reordered` says so, and the person chooses one version.
|
|
265
|
+
*/
|
|
266
|
+
declare function mergeRows(base: Json | null | undefined, mine: Json | null | undefined, theirs: Json | null | undefined): {
|
|
267
|
+
rows: Row[];
|
|
268
|
+
clashes: string[];
|
|
269
|
+
reordered: boolean;
|
|
270
|
+
};
|
|
271
|
+
|
|
153
272
|
/**
|
|
154
273
|
* The data an existing entry gets in a release: the defaults of new required fields, the defaults of
|
|
155
274
|
* new required list columns in every row that lacks them, then the migration writes. `roots` names
|
|
@@ -207,10 +326,24 @@ interface ResolveContext {
|
|
|
207
326
|
}
|
|
208
327
|
interface ResolvedEntry {
|
|
209
328
|
data: Record<string, unknown>;
|
|
329
|
+
/** Leaves delivered in the main language because their translation is missing. */
|
|
210
330
|
fallback: string[];
|
|
211
|
-
/**
|
|
331
|
+
/**
|
|
332
|
+
* Leaves whose translation was made for an older main-language text. They are delivered as they are, until someone
|
|
333
|
+
* translates them again or confirms them (D6); the Studio lists them.
|
|
334
|
+
*/
|
|
335
|
+
outdated: string[];
|
|
336
|
+
/**
|
|
337
|
+
* The required translatable leaves without text in this locale (an outdated one counts as translated): while there
|
|
338
|
+
* is one, the entry has no page in this locale. Never for the main locale or an unknown one; slugs and image
|
|
339
|
+
* descriptions never count, they fall back by design.
|
|
340
|
+
*/
|
|
341
|
+
blocking: string[];
|
|
342
|
+
/** `blocking` is not empty in a collection whose mode is `'hide'` (`untranslatedMode`): the bundle leaves the entry out of this locale. */
|
|
212
343
|
hidden: boolean;
|
|
213
344
|
}
|
|
345
|
+
/** Pages (collections with a route) leave an untranslated entry out of that language; parts of pages fall back to the main language. */
|
|
346
|
+
declare function untranslatedMode(brick: CollectionBrick): 'hide' | 'fallback';
|
|
214
347
|
/** The print that marks a translation as fresh for the current main-language value. */
|
|
215
348
|
declare function printOf(mainValue: unknown): string;
|
|
216
349
|
/** Stored entry → bundle form for one locale (SPEC part 6). */
|
|
@@ -226,7 +359,14 @@ declare function isVisible(brick: Brick, data: Record<string, unknown>, today: s
|
|
|
226
359
|
declare function visibleUntil(brick: Brick, data: Record<string, unknown>): string | undefined;
|
|
227
360
|
/** Whether the platform deletes the entries of this brick that no longer show (`visible.deleteExpired`). */
|
|
228
361
|
declare const deletesExpired: (brick: Brick) => boolean;
|
|
229
|
-
|
|
362
|
+
/**
|
|
363
|
+
* The entries in the brick's order. With `languages`, a translatable field (a title) sorts by its text in `locale`,
|
|
364
|
+
* else in the main language, so every language's list is in its own alphabetical order.
|
|
365
|
+
*/
|
|
366
|
+
declare function sortEntries(brick: CollectionBrick, entries: StoredEntry[], languages?: {
|
|
367
|
+
locale: Locale;
|
|
368
|
+
main: Locale;
|
|
369
|
+
}): StoredEntry[];
|
|
230
370
|
interface BuildBundleInput {
|
|
231
371
|
schema: Schema;
|
|
232
372
|
requestedLocale: string;
|
|
@@ -240,13 +380,23 @@ interface BuildBundleInput {
|
|
|
240
380
|
today: string;
|
|
241
381
|
}
|
|
242
382
|
/**
|
|
243
|
-
* The bundle a site receives: `buildBundle` with every Markdown text as its tree
|
|
244
|
-
*
|
|
383
|
+
* The bundle a site receives: `buildBundle` with every Markdown text as its tree, its `$file.<id>` references
|
|
384
|
+
* resolved to the files' URLs and its route links to paths. The platform's bundle endpoint, the Studio preview and
|
|
385
|
+
* the contract fixtures all serve this, never `buildBundle` alone. In another language, links to entries left out of
|
|
386
|
+
* it go to their main-language page (`resolveRouteLinks`).
|
|
245
387
|
*/
|
|
246
388
|
declare function servedBundle(input: BuildBundleInput): Promise<Bundle>;
|
|
247
389
|
declare function buildBundle(input: BuildBundleInput): Bundle;
|
|
248
|
-
/**
|
|
249
|
-
|
|
390
|
+
/**
|
|
391
|
+
* Every locale's address of the entry from the route and slug (a locale without its own slug takes the main one),
|
|
392
|
+
* translated or not: for cache refresh and URL clash checks.
|
|
393
|
+
*/
|
|
394
|
+
declare function routeUrls(schema: Schema, brick: CollectionBrick, entry: StoredEntry): Partial<Record<Locale, string>>;
|
|
395
|
+
/**
|
|
396
|
+
* The URLs where the entry is a page: `routeUrls` without the locales where it is untranslated, whatever the
|
|
397
|
+
* mode. In `'fallback'` mode such an entry stays in that locale's lists but has no page there.
|
|
398
|
+
*/
|
|
399
|
+
declare function urlsFor(schema: Schema, key: string, brick: CollectionBrick, entry: StoredEntry): Partial<Record<Locale, string>>;
|
|
250
400
|
/** Two entries that resolve to the same URL in one locale. `first` comes earlier in the input. */
|
|
251
401
|
interface UrlClash {
|
|
252
402
|
url: string;
|
|
@@ -255,9 +405,9 @@ interface UrlClash {
|
|
|
255
405
|
second: string;
|
|
256
406
|
}
|
|
257
407
|
/**
|
|
258
|
-
* Entries that share a URL in one locale. Takes the `
|
|
408
|
+
* Entries that share a URL in one locale. Takes the `routeUrls` results of all entries (of all bricks:
|
|
259
409
|
* two bricks with `route: '/[slug]'` clash too); this catches clashes that slugs alone miss, because
|
|
260
|
-
* `
|
|
410
|
+
* `routeUrls` lets a locale without its own slug fall back to the main slug. One clash per later entry and URL.
|
|
261
411
|
*/
|
|
262
412
|
declare function urlClashes(entries: Iterable<{
|
|
263
413
|
id: string;
|
|
@@ -278,12 +428,100 @@ declare function blockedSlugs(schema: Schema, brickKey: string, locale: Locale,
|
|
|
278
428
|
*/
|
|
279
429
|
declare function applyDefaults(bundle: Bundle, schema: Schema): Bundle;
|
|
280
430
|
|
|
431
|
+
/** The ref of one markdown field: `brick` and `id` name the entry (a single's id is its brick), `field` the field. */
|
|
432
|
+
type MarkdownRefOf = (brick: string, id: string, field: string) => string;
|
|
433
|
+
/** The site path that serves a tree of a file brick, from the build (`/__ginko/files/<locale>/md/…`). */
|
|
434
|
+
declare function fileMarkdownRef(locale: Locale, brick: string, id: string, field: string): string;
|
|
435
|
+
/**
|
|
436
|
+
* The site path that serves a tree of a platform brick at content revision `rev` (`<schemaRev>.<contentRev>`).
|
|
437
|
+
* The rev in the path lets the site's route keep one copy of the platform's trees per revision.
|
|
438
|
+
*/
|
|
439
|
+
declare function platformMarkdownRef(locale: Locale, rev: string, brick: string, id: string, field: string): string;
|
|
440
|
+
/**
|
|
441
|
+
* The bundle for page state: every markdown field that holds its tree becomes `{ ref, words }` (values that are refs
|
|
442
|
+
* already stay). `trees` collects the trees by their ref, for the route that serves them. The tree keeps its own
|
|
443
|
+
* toc, so a page reads the toc of the text it loaded; `words` lets a list show a reading time without the tree.
|
|
444
|
+
* Markdown inside `list` fields stays inline.
|
|
445
|
+
*/
|
|
446
|
+
declare function withMarkdownRefs(bundle: Bundle, schema: Pick<Schema, 'bricks'>, trees: Map<string, MarkdownTree>, refOf: MarkdownRefOf): Bundle;
|
|
447
|
+
|
|
281
448
|
/** German-friendly URL slug: "Über uns & Team" → "ueber-uns-team". Empty input gives "eintrag". */
|
|
282
449
|
declare function slugify(input: string): string;
|
|
283
450
|
declare const SLUG_PATTERN: RegExp;
|
|
451
|
+
/**
|
|
452
|
+
* The slug of a new entry per locale before it is made unique (SPEC 2.2), from the text of its `from` field in that
|
|
453
|
+
* locale: the main locale (the first) always gets one; another locale gets one from its own text, or `undefined`
|
|
454
|
+
* when it has none and takes the main locale's slug. The platform makes these unique; the Studio's preview of a new
|
|
455
|
+
* entry uses them as they are.
|
|
456
|
+
*/
|
|
457
|
+
declare function slugBases(locales: readonly string[], texts: Readonly<Record<string, string | undefined>>): Record<string, string | undefined>;
|
|
284
458
|
/** First free slug: base, base-2, base-3, … */
|
|
285
459
|
declare function uniqueSlug(base: string, taken: (slug: string) => boolean): string;
|
|
286
460
|
|
|
461
|
+
/**
|
|
462
|
+
* Today's opening hours of a single with `status: { hours: true }`: closed (with the owner's reason or the public
|
|
463
|
+
* holiday's name, when there is one), open in `ranges` (`['11:30', '14:30']`), or unknown (the rules give no answer for
|
|
464
|
+
* today, which makes the section due).
|
|
465
|
+
*/
|
|
466
|
+
type HoursToday = {
|
|
467
|
+
closed: true;
|
|
468
|
+
reason?: Label;
|
|
469
|
+
} | {
|
|
470
|
+
ranges: readonly (readonly [string, string])[];
|
|
471
|
+
} | {
|
|
472
|
+
unknown: true;
|
|
473
|
+
};
|
|
474
|
+
/**
|
|
475
|
+
* What the status line says. Titles are in the site's main language (null while an entry has none: the Studio shows the
|
|
476
|
+
* brick's label), dates are `YYYY-MM-DD`, `field` is the field's name.
|
|
477
|
+
*/
|
|
478
|
+
type StatusLine = {
|
|
479
|
+
kind: 'next';
|
|
480
|
+
title: string | null;
|
|
481
|
+
date: string;
|
|
482
|
+
} | {
|
|
483
|
+
kind: 'count';
|
|
484
|
+
ending: number;
|
|
485
|
+
online: number;
|
|
486
|
+
} | {
|
|
487
|
+
kind: 'missing';
|
|
488
|
+
count: number;
|
|
489
|
+
field: string;
|
|
490
|
+
} | {
|
|
491
|
+
kind: 'age';
|
|
492
|
+
title: string | null;
|
|
493
|
+
date: string;
|
|
494
|
+
weeks: number;
|
|
495
|
+
} | {
|
|
496
|
+
kind: 'hours';
|
|
497
|
+
today: HoursToday;
|
|
498
|
+
} | {
|
|
499
|
+
kind: 'drafts';
|
|
500
|
+
drafts: number;
|
|
501
|
+
scheduled: number;
|
|
502
|
+
};
|
|
503
|
+
/** An entry as the status reads it: its data, and for a draft its state and when it goes live. */
|
|
504
|
+
interface StatusEntry {
|
|
505
|
+
data: Record<string, Json>;
|
|
506
|
+
state?: 'draft' | 'live';
|
|
507
|
+
publishAt?: number;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* The status line of `brick` and whether its section is due (`due`), from the brick's entries (removed ones left out;
|
|
511
|
+
* drafts count only for the drafts line). `hours` is today's answer of the hours rules for `{ hours: true }`; without
|
|
512
|
+
* it (null) the brick shows no hours line. Due: entries end within 7 days, entries miss the `missing` field, the next
|
|
513
|
+
* entry starts within 7 days with a required text empty in a site language, or today's hours are unknown. The weekly
|
|
514
|
+
* upkeep rule (`staleOf`) is the caller's: it needs the other bricks.
|
|
515
|
+
*/
|
|
516
|
+
declare function brickStatus(brick: Brick, entries: readonly StatusEntry[], site: {
|
|
517
|
+
today: string;
|
|
518
|
+
locales: readonly Locale[];
|
|
519
|
+
hours?: HoursToday | null;
|
|
520
|
+
}): {
|
|
521
|
+
line: StatusLine | null;
|
|
522
|
+
due: boolean;
|
|
523
|
+
};
|
|
524
|
+
|
|
287
525
|
interface WeekState {
|
|
288
526
|
/** The edit task that fixes it. */
|
|
289
527
|
task: Extract<Task, {
|
|
@@ -315,6 +553,21 @@ declare function weeklyTask(brick: {
|
|
|
315
553
|
}>;
|
|
316
554
|
tasks?: readonly Task[];
|
|
317
555
|
}): Pick<WeekState, 'task' | 'field'> | undefined;
|
|
556
|
+
/**
|
|
557
|
+
* The date field of a brick that holds the first day of a week: `plans.field` of a collection that plans weeks, else
|
|
558
|
+
* the field of the weekly task (`weeklyTask`), else the first date field a task presets to `@workWeek` or
|
|
559
|
+
* `@nextWorkWeek`. Validation wants a week start there (a week stored as a Thursday never shows), and the Studio offers
|
|
560
|
+
* week shortcuts for it.
|
|
561
|
+
*/
|
|
562
|
+
declare function weekStartField(brick: {
|
|
563
|
+
fields: Record<string, {
|
|
564
|
+
type: string;
|
|
565
|
+
}>;
|
|
566
|
+
tasks?: readonly Task[];
|
|
567
|
+
plans?: {
|
|
568
|
+
field: string;
|
|
569
|
+
};
|
|
570
|
+
}): string | undefined;
|
|
318
571
|
/**
|
|
319
572
|
* The week starts planned ahead for the single brick `singleKey`: the `plans.field` of every entry of the
|
|
320
573
|
* collections that plan it. The caller passes only live entries (no drafts, nothing deleted).
|
|
@@ -329,25 +582,62 @@ declare function plannedWeeks(schema: Pick<Schema, 'bricks'>, singleKey: string,
|
|
|
329
582
|
* live entries only and `thisWeek` from `workWeekOf` in the site's time zone.
|
|
330
583
|
*/
|
|
331
584
|
declare function plansThisWeek(schema: Pick<Schema, 'bricks'>, singleKey: string, task: Task, entryBrick: string, data: Record<string, Json>, thisWeek: string): boolean;
|
|
585
|
+
/**
|
|
586
|
+
* The value of a planned change (`planned`) once its day has come: `next` when `from` is `today` or earlier, else
|
|
587
|
+
* undefined. From that day the site shows it in place of `field`, so a task opens on it and the Studio lists it.
|
|
588
|
+
* `today` is in the site's time zone.
|
|
589
|
+
*/
|
|
590
|
+
declare function duePlan(brick: Pick<Brick, 'planned'>, data: Record<string, Json>, today: string): Json | undefined;
|
|
591
|
+
/**
|
|
592
|
+
* Whether a create task asks for `key`. With `task.fields`: only those fields. Without: every field of the brick. Never
|
|
593
|
+
* the address (made from the title) or the plan of a planned change (`planned`), which needs a value in effect to
|
|
594
|
+
* replace. The Studio's sheet and the agent door's tool both use this rule.
|
|
595
|
+
*/
|
|
596
|
+
declare function createAsks(brick: Pick<Brick, 'fields' | 'planned'>, key: string, task?: Pick<Extract<Task, {
|
|
597
|
+
kind: 'create';
|
|
598
|
+
}>, 'fields'>): boolean;
|
|
599
|
+
/**
|
|
600
|
+
* The day a save shows on the website when that is later than `today` (the site's time zone), else undefined (it shows
|
|
601
|
+
* at once): a week planned ahead (`plans`) from its first shown day (`firstDayShown`); a save that changed only the
|
|
602
|
+
* plan of a planned change (`planned`) from the plan's date. `changed` are the root fields the save wrote.
|
|
603
|
+
*/
|
|
604
|
+
declare function liveFrom(schema: Pick<Schema, 'bricks' | 'week'>, brickKey: string, data: Record<string, Json>, changed: readonly string[], today: string): string | undefined;
|
|
332
605
|
|
|
333
606
|
declare function sha256(input: string): string;
|
|
334
607
|
/** Stable JSON: object keys sorted, so equal values always hash the same. */
|
|
335
608
|
declare function stableJson(value: unknown): string;
|
|
336
609
|
|
|
337
|
-
/**
|
|
338
|
-
|
|
610
|
+
/** Translation prints: leaf path → locale → print of the main-language value the translation was made from. */
|
|
611
|
+
type Prints = Record<string, Record<string, string>>;
|
|
612
|
+
/** Every translatable leaf of a root field: path → value per locale. Paths match resolveEntry's fallback paths. */
|
|
613
|
+
declare function leavesOf(field: Field, value: Json | undefined, path: string, out?: Map<string, Record<string, Json>>): Map<string, Record<string, Json>>;
|
|
339
614
|
/**
|
|
340
|
-
*
|
|
341
|
-
*
|
|
615
|
+
* Prints after a rewrite that keeps the meaning, such as the file IDs that replace image paths in a text on export, or
|
|
616
|
+
* the new IDs an import gives those files: a translation that was current for the old main-language value stays
|
|
617
|
+
* current for the new one. Other prints stay as they are.
|
|
342
618
|
*/
|
|
343
|
-
declare function
|
|
344
|
-
|
|
345
|
-
|
|
619
|
+
declare function carryPrints(fields: Fields, before: Record<string, Json>, after: Record<string, Json>, prints: Prints, main: Locale): Prints;
|
|
620
|
+
|
|
621
|
+
type Data = Record<string, unknown>;
|
|
622
|
+
/** The text of a translatable value in one locale, or the plain value when it is not localized. */
|
|
623
|
+
declare function textIn(value: unknown, locale: Locale): string;
|
|
624
|
+
/** Lower case without accents, so "schnitz" finds "Schnitzel" and "kase" finds "Käse". */
|
|
625
|
+
declare function searchable(text: string): string;
|
|
346
626
|
/**
|
|
347
|
-
* The
|
|
348
|
-
*
|
|
627
|
+
* The name the entry's own input gives it: a week planned ahead by its week ("Woche ab 19.10.2026"), else its first
|
|
628
|
+
* filled text or longtext field in `locale`; undefined while nothing is typed. `label` words the week's field label
|
|
629
|
+
* for the reader (default: in `locale`).
|
|
349
630
|
*/
|
|
350
|
-
declare function
|
|
631
|
+
declare function entryTitle(brick: Brick, data: Data, locale: Locale, label?: (label: Label) => string): string | undefined;
|
|
632
|
+
/** All words of an entry's text and longtext fields in every language, in `searchable` form: what a list search matches. */
|
|
633
|
+
declare function listHaystack(brick: Brick, data: Data, locales: readonly string[]): string;
|
|
634
|
+
/** A list sorted by one field (a saved view's sort), as a copy. Entries without a value come last, in either direction. */
|
|
635
|
+
declare function listSort<T extends {
|
|
636
|
+
data: Data;
|
|
637
|
+
}>(rows: readonly T[], brick: Brick, sort: {
|
|
638
|
+
field: string;
|
|
639
|
+
dir: 'asc' | 'desc';
|
|
640
|
+
}, main: string): T[];
|
|
351
641
|
|
|
352
642
|
/** The JSON Schema subset the tools use. */
|
|
353
643
|
interface JsonSchema {
|
|
@@ -416,11 +706,6 @@ declare const UPLOAD_TYPES: {
|
|
|
416
706
|
readonly kind: "image";
|
|
417
707
|
readonly limit: number;
|
|
418
708
|
};
|
|
419
|
-
readonly 'image/heic': {
|
|
420
|
-
readonly label: "HEIC";
|
|
421
|
-
readonly kind: "image";
|
|
422
|
-
readonly limit: number;
|
|
423
|
-
};
|
|
424
709
|
readonly 'application/pdf': {
|
|
425
710
|
readonly label: "PDF";
|
|
426
711
|
readonly kind: "file";
|
|
@@ -435,6 +720,58 @@ declare function limitOf(kind: 'image' | 'file'): number;
|
|
|
435
720
|
/** Megabytes the German way: 1,5. */
|
|
436
721
|
declare function formatMb(bytes: number): string;
|
|
437
722
|
|
|
723
|
+
/**
|
|
724
|
+
* A reference to a library file in a Markdown text; group 1 is the upload ID. Only where a text can name a file: a
|
|
725
|
+
* link or image destination (`]($file.x)`, `[ref]: $file.x`, also inside `<…>`), a component attribute value
|
|
726
|
+
* (`{src="$file.x"}`) and a prop in the YAML block of a component (`src: $file.x`), which the editor writes for a
|
|
727
|
+
* component with more than three props. The same words elsewhere are text: `mv "$file" "$file.bak"` in a shell
|
|
728
|
+
* example names no file. A prose line that looks like a YAML prop (`Hinweis: $file.x`) matches too; the server keeps
|
|
729
|
+
* only IDs that have the form of an upload ID. The match is the reference alone, so a replace keeps what stands before it.
|
|
730
|
+
*/
|
|
731
|
+
declare const FILE_REF: RegExp;
|
|
732
|
+
/** The upload ID when the whole `value` is a file reference (`$file.<id>`), else undefined. */
|
|
733
|
+
declare const fileRefOf: (value: string) => string | undefined;
|
|
734
|
+
/** The upload IDs a text references; code is text. */
|
|
735
|
+
declare function fileRefsIn(text: string): Set<string>;
|
|
736
|
+
/** The upload IDs of the Markdown images in a text (``) that have no description of their own. */
|
|
737
|
+
declare function fileImagesWithoutAlt(text: string): Set<string>;
|
|
738
|
+
/** The text with every reference whose ID is in `map` pointing at its new ID. Unknown IDs, and words in code, stay as they are. */
|
|
739
|
+
declare function rewriteFileRefs(text: string, map: ReadonlyMap<string, string>): string;
|
|
740
|
+
/** The entry IDs and slugs that a text links to (`$authors.<ref>`); page links and words in code are left out. */
|
|
741
|
+
declare function entryLinkRefs(text: string): Set<string>;
|
|
742
|
+
/** The text with every link to an entry whose ID is in `map` pointing at its new ID. Slugs, unknown IDs and words in code stay as they are. */
|
|
743
|
+
declare function rewriteEntryLinks(text: string, map: ReadonlyMap<string, string>): string;
|
|
744
|
+
/**
|
|
745
|
+
* The data with every upload ID found in `map` replaced by its new ID: in image and file fields (`{ file }`) and in the
|
|
746
|
+
* `$file.<id>` references of Markdown texts, also in list rows. Unknown IDs stay as they are. One walk for the import of
|
|
747
|
+
* a backup (platform) and for `local:files-export` (public paths to file IDs).
|
|
748
|
+
*/
|
|
749
|
+
declare function remapFileIds(fields: Fields, data: Record<string, Json>, map: ReadonlyMap<string, string>): Record<string, Json>;
|
|
750
|
+
/** The data with `fn` applied to every Markdown text: each language, list rows included. Other values stay as they are. */
|
|
751
|
+
declare function mapMarkdownTexts(fields: Fields, data: Record<string, Json>, fn: (text: string) => string): Record<string, Json>;
|
|
752
|
+
type Node = [string, Record<string, Json>, ...Json[]];
|
|
753
|
+
/** The image props a component declares (`f.image`), by tag. */
|
|
754
|
+
declare function imagePropsOf(components: ComponentRegistry | undefined): Record<string, string[]>;
|
|
755
|
+
/** One place in a tree that names a library file: an `img` source, a declared component image prop or a link. */
|
|
756
|
+
interface FileRefUse {
|
|
757
|
+
id: string;
|
|
758
|
+
kind: 'img' | 'prop' | 'link';
|
|
759
|
+
node: Node;
|
|
760
|
+
prop: string;
|
|
761
|
+
}
|
|
762
|
+
/** Every `$file.<id>` that a tree uses as a whole `img` source, component image prop or link `href`. */
|
|
763
|
+
declare function fileRefUses(nodes: readonly Json[], components: ComponentRegistry | undefined): FileRefUse[];
|
|
764
|
+
/**
|
|
765
|
+
* The bundle with every `$file.<id>` of its Markdown trees resolved through `files` (the bundle's ready uploads):
|
|
766
|
+
* - `img`: the file's URL, its pixel size, a `srcset` of its variants and the original, and the library description
|
|
767
|
+
* of the bundle's language when the image has none of its own (`effectiveAlt`).
|
|
768
|
+
* - a component image prop: the URL; for `src` also the file's `width` and `height` when the author set neither (and
|
|
769
|
+
* the component declares both), and an empty `alt` (when it declares one) from the library.
|
|
770
|
+
* - a link: the file's URL.
|
|
771
|
+
* An unknown or not yet ready file loses its URL and gets `data-broken: true`, like a route link that cannot be resolved.
|
|
772
|
+
*/
|
|
773
|
+
declare function resolveFileRefs(bundle: Bundle, schema: Pick<Schema, 'components'>, files: (id: string) => FileInfo | undefined): Bundle;
|
|
774
|
+
|
|
438
775
|
interface AgentOptions {
|
|
439
776
|
/** Tells which fields are markdown and text, and the labels of the bricks. */
|
|
440
777
|
schema: Pick<Schema, 'bricks'>;
|
|
@@ -464,6 +801,7 @@ declare function llmsFullTxt(bundle: Bundle, options: AgentOptions & {
|
|
|
464
801
|
declare function markdownNotFound(bundle: Bundle, path: string, options: {
|
|
465
802
|
origin: string;
|
|
466
803
|
limit?: number;
|
|
804
|
+
schema?: AgentOptions['schema'];
|
|
467
805
|
}): string;
|
|
468
806
|
|
|
469
807
|
interface EntryMatch {
|
|
@@ -492,5 +830,13 @@ type ImageInfo = {
|
|
|
492
830
|
/** Returns undefined when the bytes are not a recognised image, or when the header is truncated. */
|
|
493
831
|
declare function imageInfo(bytes: Uint8Array): ImageInfo | undefined;
|
|
494
832
|
|
|
495
|
-
|
|
496
|
-
|
|
833
|
+
/** The folder `ginko export` writes to when no folder is given: `ginko-export-<site>-<YYYY-MM-DD>` (UTC). */
|
|
834
|
+
declare function defaultDir(site: string, now: Date): string;
|
|
835
|
+
/** Where a file lies in the export folder, relative to it. */
|
|
836
|
+
declare function pathOf(file: {
|
|
837
|
+
id: string;
|
|
838
|
+
mime: string;
|
|
839
|
+
}): string;
|
|
840
|
+
|
|
841
|
+
export { Brick, Bundle, BundleItem, CollectionBrick, ComponentRegistry, Currency, Described, FILE_REF, Field, Fields, FileField, Issue, Json, Label, Locale, MAX_LOCALES, MarkdownTree, MarkdownTrees, Msg, ParseOptions, SCHEMA_LIMITS, SHAPE_CODES, SITE_BUDGET, SLUG_PATTERN, Schema, SiteInput, Task, UPLOAD_TYPES, WeekInfo, acceptOf, applyDefaults, blockedSlugs, brickStatus, buildBundle, byteSize, carryPrints, checkSchema, checkSite, createAsks, defaultDir, defaultsFor, deletesExpired, diffSchema, duePlan, entryBytes, entryLinkRefs, entryMarkdown, entryTitle, fieldsChanged, fileImagesWithoutAlt, fileMarkdownRef, fileProblem, fileRefOf, fileRefUses, fileRefsIn, findEntryByPath, fitsBudget, formatMb, fromToolInput, grantGroups, imageInfo, imagePropsOf, isCurrency, isDate, isHourPlans, isLocale, isStableMarkdown, isTimeZone, isVisible, labelOf, labelsIn, largestEntryBytes, largestFieldBytes, leavesOf, limitOf, listHaystack, listSort, liveFrom, llmsFullTxt, llmsTxt, mainLocale, mapMarkdownTexts, markdownBlocks, markdownNotFound, markdownRequestPath, mergeRows, migrationFingerprint, ordered, pathOf, plannedWeeks, plansThisWeek, platformMarkdownRef, platformSchema, printOf, releaseData, remapFileIds, resolveEntry, resolveFileRefs, rewriteEntryLinks, rewriteFileRefs, routeUrls, rowDiffs, searchable, serializeMarkdown, serializeSchema, servedBundle, sha256, slugBases, slugify, sortEntries, stableJson, staleOf, studioLabel, taskInputSchema, textIn, uniqueSlug, untranslatedMode, urlClashes, urlsFor, validate, visibleUntil, weekStartField, weeklyTask, withMarkdownRefs };
|
|
842
|
+
export type { AgentOptions, BuildBundleInput, EntryMatch, FileInfo, FileRefUse, HoursToday, ImageInfo, ImageType, JsonSchema, JsonSchemaObject, MarkdownBlock, MarkdownBlocks, MarkdownRefOf, Prints, ResolveContext, RowDiff, SchemaChange, SchemaDiff, SerializeOptions, StatusEntry, StatusLine, StoredEntry, ToolInputContext, ToolSchemaContext, UploadType, UrlClash, ValidateOptions, ValidationResult, WeekState };
|