@voltro/cms 0.80.0 → 0.82.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 +1610 -6
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/extensionManifest-ghuSj4ND.js +2782 -0
- package/dist/index.d.ts +3658 -158
- package/dist/index.js +3783 -246
- package/dist/web.d.ts +1447 -26
- package/dist/web.js +2 -2
- package/package.json +5 -4
- package/dist/ContentForm-DUW_rb_m.js +0 -278
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,171 @@
|
|
|
1
1
|
import { DataStore } from '@voltro/database';
|
|
2
|
-
import { Effect } from 'effect';
|
|
2
|
+
import { Effect } from 'effect/Effect';
|
|
3
|
+
import { Effect as Effect_2 } from 'effect';
|
|
3
4
|
import { ReactNode } from 'react';
|
|
4
5
|
import { Row } from '@voltro/database';
|
|
5
6
|
import { Schema as Schema_2 } from 'effect';
|
|
6
7
|
import { TableLike } from '@voltro/database';
|
|
7
8
|
|
|
9
|
+
/** Effect form of {@link addRedirect}. */
|
|
10
|
+
export declare const addRedirect: (...args: Parameters<typeof addRedirect_2>) => Effect<void, never, never>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Point a former address at a document — an address from before an import, a
|
|
14
|
+
* vanity path. Replaces an earlier redirect from the same path. A live page at
|
|
15
|
+
* `fromPath` still wins over it (`cms.route` tries the tree first). In the
|
|
16
|
+
* caller's transaction.
|
|
17
|
+
*/
|
|
18
|
+
declare const addRedirect_2: (tx: DataStore, type: ContentType, scope: CmsScope, fromPath: string, documentId: string, tenantId?: unknown) => Promise<void>;
|
|
19
|
+
|
|
20
|
+
/** Effect form of {@link addToRelease}. */
|
|
21
|
+
export declare const addToRelease: (...args: Parameters<typeof addToRelease_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound | ReleaseNotEditable, never>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Put one variant into a draft release: `publish` pins a revision (default:
|
|
25
|
+
* the variant's current revision), `unpublish` takes it down. A variant is in
|
|
26
|
+
* a release at most once — adding it again replaces its entry. Throws
|
|
27
|
+
* `ReleaseNotEditable` unless the release is still a draft, and
|
|
28
|
+
* `ContentNotFound` when the variant is not the caller's.
|
|
29
|
+
*/
|
|
30
|
+
declare const addToRelease_2: (store: DataStore, releaseId: string, item: {
|
|
31
|
+
readonly type: ContentType;
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly locale: string;
|
|
34
|
+
readonly action?: "publish" | "unpublish";
|
|
35
|
+
readonly revisionId?: string;
|
|
36
|
+
}) => Promise<Row>;
|
|
37
|
+
|
|
38
|
+
/** Effect form of {@link adoptWinner}. */
|
|
39
|
+
export declare const adoptWinner: (...args: Parameters<typeof adoptWinner_2>) => Effect<AdoptWinnerResult, ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch | ReleaseNotEditable, never>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Take version B live the way every change goes live: stop the experiment
|
|
43
|
+
* (if it still runs), save B's text over the page's draft as a new draft
|
|
44
|
+
* revision, and pin that revision in a new draft release named after the
|
|
45
|
+
* experiment. Nothing is published here — the release is, by whoever may,
|
|
46
|
+
* through the review gate, a schedule, or by hand; and it rolls back like any
|
|
47
|
+
* other. Runs in the caller's transaction.
|
|
48
|
+
*/
|
|
49
|
+
declare const adoptWinner_2: (tx: DataStore, type: ContentType, experimentId: string, now?: Date) => Promise<AdoptWinnerResult>;
|
|
50
|
+
|
|
51
|
+
export declare type AdoptWinnerResult = {
|
|
52
|
+
readonly ok: true;
|
|
53
|
+
readonly releaseId: string;
|
|
54
|
+
readonly revisionId: string;
|
|
55
|
+
} | {
|
|
56
|
+
readonly ok: false;
|
|
57
|
+
readonly reason: 'notFound' | 'alreadyAdopted' | 'noDraft';
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** Effect form of {@link advanceSeries}. */
|
|
61
|
+
export declare const advanceSeries: (...args: Parameters<typeof advanceSeries_2>) => Effect<readonly string[], ContentValidationFailed | ContentNotFound, never>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Arm the next occurrence of every running series of `type` whose draft has
|
|
65
|
+
* nothing pending any more (the armed occurrence went live and came down), and
|
|
66
|
+
* end the series after its last. Returns the draft ids that were armed. Run it
|
|
67
|
+
* after `publishDue` and `unpublishDue` in the same schedule; a store outside a
|
|
68
|
+
* transaction sweeps every tenant.
|
|
69
|
+
*/
|
|
70
|
+
declare const advanceSeries_2: (store: DataStore, type: ContentType, now?: Date) => Promise<ReadonlyArray<string>>;
|
|
71
|
+
|
|
72
|
+
export declare const AI_OUTCOMES: readonly ["suggested", "failed", "applied", "discarded"];
|
|
73
|
+
|
|
74
|
+
/** Effect form of {@link aiBudgetLeft}. */
|
|
75
|
+
export declare const aiBudgetLeft: (...args: Parameters<typeof aiBudgetLeft_2>) => Effect<number | null, never, never>;
|
|
76
|
+
|
|
77
|
+
/** What is left of the workspace's monthly budget: a number of tokens, or null (no limit). */
|
|
78
|
+
declare const aiBudgetLeft_2: (store: DataStore, tenantId: string, now?: Date) => Promise<number | null>;
|
|
79
|
+
|
|
80
|
+
export declare interface AiOperation {
|
|
81
|
+
readonly id: string;
|
|
82
|
+
readonly operation: string;
|
|
83
|
+
readonly version: string;
|
|
84
|
+
readonly provider: string;
|
|
85
|
+
readonly model: string;
|
|
86
|
+
readonly field: string | null;
|
|
87
|
+
readonly revisionId: string | null;
|
|
88
|
+
readonly outcome: AiOutcome;
|
|
89
|
+
readonly inputTokens: number | null;
|
|
90
|
+
readonly outputTokens: number | null;
|
|
91
|
+
readonly at: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export declare interface AiOperationInput {
|
|
95
|
+
readonly operation: string;
|
|
96
|
+
readonly version: string;
|
|
97
|
+
readonly provider: string;
|
|
98
|
+
readonly model: string;
|
|
99
|
+
readonly contentType: string;
|
|
100
|
+
readonly variantId: string;
|
|
101
|
+
readonly revisionId?: string | null;
|
|
102
|
+
readonly field?: string | null;
|
|
103
|
+
readonly prompt: string;
|
|
104
|
+
readonly usage?: {
|
|
105
|
+
readonly inputTokens?: number;
|
|
106
|
+
readonly outputTokens?: number;
|
|
107
|
+
};
|
|
108
|
+
readonly outcome: 'suggested' | 'failed';
|
|
109
|
+
readonly error?: string | null;
|
|
110
|
+
readonly actor?: string | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Effect form of {@link aiOperationsFor}. */
|
|
114
|
+
export declare const aiOperationsFor: (...args: Parameters<typeof aiOperationsFor_2>) => Effect<readonly AiOperation[], never, never>;
|
|
115
|
+
|
|
116
|
+
/** A variant's AI operations, newest first. */
|
|
117
|
+
declare const aiOperationsFor_2: (store: DataStore, contentType: string, variantId: string) => Promise<ReadonlyArray<AiOperation>>;
|
|
118
|
+
|
|
119
|
+
export declare type AiOutcome = (typeof AI_OUTCOMES)[number];
|
|
120
|
+
|
|
121
|
+
export declare interface AiSettings {
|
|
122
|
+
/** Null: the deployment's provider and model (only a budget is set). */
|
|
123
|
+
readonly provider: string | null;
|
|
124
|
+
readonly model: string | null;
|
|
125
|
+
/** The workspace's own key — for the server's call only. */
|
|
126
|
+
readonly apiKey: string | null;
|
|
127
|
+
/** Tokens per calendar month (UTC), or null: no limit. */
|
|
128
|
+
readonly monthlyTokens: number | null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Effect form of {@link aiSettings}. */
|
|
132
|
+
export declare const aiSettings: (...args: Parameters<typeof aiSettings_2>) => Effect<AiSettings | null, never, never>;
|
|
133
|
+
|
|
134
|
+
/** How the workspace reaches a model, or null: the deployment's default. */
|
|
135
|
+
declare const aiSettings_2: (store: DataStore, tenantId: string) => Promise<AiSettings | null>;
|
|
136
|
+
|
|
137
|
+
/** Effect form of {@link aiTokensUsed}. */
|
|
138
|
+
export declare const aiTokensUsed: (...args: Parameters<typeof aiTokensUsed_2>) => Effect<number, never, never>;
|
|
139
|
+
|
|
140
|
+
/** Tokens (in + out) the workspace's AI calls used since `since` (default: this month). */
|
|
141
|
+
declare const aiTokensUsed_2: (store: DataStore, tenantId: string, since?: Date) => Promise<number>;
|
|
142
|
+
|
|
143
|
+
/** A document's address in every language it has its own variant in. */
|
|
144
|
+
export declare const alternatesOf: (trees: ReadonlyArray<LocalizedTree>, documentId: string) => ReadonlyArray<PageAlternate>;
|
|
145
|
+
|
|
146
|
+
/** Effect form of {@link applyBlueprint}. */
|
|
147
|
+
export declare const applyBlueprint: (...args: Parameters<typeof applyBlueprint_2>) => Effect<BlueprintPlan, ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch | ReviewRequired | ReferenceUnavailable | BlueprintInvalid, never>;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Provision `blueprint` into `target`: every step the plan calls `create` is
|
|
151
|
+
* saved (and published unless the entry says otherwise or its type needs a
|
|
152
|
+
* review); present documents stay exactly as they are. Running it again
|
|
153
|
+
* creates nothing. Runs in the caller's transaction — all of it or none;
|
|
154
|
+
* a save's `ContentValidationFailed` or a publish's `ReferenceUnavailable`
|
|
155
|
+
* (a referenced document that is not live) aborts it.
|
|
156
|
+
*/
|
|
157
|
+
declare const applyBlueprint_2: (tx: DataStore, types: ReadonlyArray<ContentType>, blueprint: Blueprint, target: BlueprintTarget) => Promise<BlueprintPlan>;
|
|
158
|
+
|
|
159
|
+
/** Effect form of {@link applyBlueprintTeam}. */
|
|
160
|
+
export declare const applyBlueprintTeam: (...args: Parameters<typeof applyBlueprintTeam_2>) => Effect<TeamPlan, never, never>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Provision the team, in the caller's transaction: a default role only where
|
|
164
|
+
* the workspace has none, an invitation only for an address not invited yet —
|
|
165
|
+
* running it again changes nothing, and nothing an admin changed is undone.
|
|
166
|
+
*/
|
|
167
|
+
declare const applyBlueprintTeam_2: (tx: DataStore, tenantId: string, team: BlueprintTeam) => Promise<TeamPlan>;
|
|
168
|
+
|
|
8
169
|
/**
|
|
9
170
|
* Compute every `derivedFrom` field from its source value. Returns a NEW
|
|
10
171
|
* row — the input is not mutated. A caller-provided value for a derived
|
|
@@ -13,24 +174,358 @@ import { TableLike } from '@voltro/database';
|
|
|
13
174
|
* declaration order against the progressively-updated row, so a derived
|
|
14
175
|
* field may source another, earlier-declared derived field.
|
|
15
176
|
*/
|
|
16
|
-
export declare const applyDerivations: (type: Pick<ContentType, "fields" | "derivedFields"
|
|
177
|
+
export declare const applyDerivations: (type: Pick<ContentType, "fields" | "derivedFields"> & Partial<Pick<ContentType, "taxonomy">>, row: Readonly<Record<string, unknown>>) => Record<string, unknown>;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The source values with each unit's target in place — what a translation
|
|
181
|
+
* draft saves. A unit without a target keeps the source text; an id that
|
|
182
|
+
* names no text in the source is ignored (see `missing` from `matchUnits`).
|
|
183
|
+
*/
|
|
184
|
+
export declare const applyTranslation: (fields: Readonly<Record<string, FieldSchema>>, source: Readonly<Record<string, unknown>>, units: ReadonlyArray<TranslationUnit>) => Record<string, unknown>;
|
|
185
|
+
|
|
186
|
+
/** The values a reader of `variant` sees: version B's text over the published values. */
|
|
187
|
+
export declare const applyVariant: (values: Readonly<Record<string, unknown>>, experiment: Pick<Experiment, "overrides">, variant: Variant) => Readonly<Record<string, unknown>>;
|
|
188
|
+
|
|
189
|
+
/** Effect form of {@link approveReview}. */
|
|
190
|
+
export declare const approveReview: (...args: Parameters<typeof approveReview_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound | RevisionMismatch | ReviewStepRefused, never>;
|
|
17
191
|
|
|
18
192
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Atomic per row. Throws `ContentNotFound` when the id exists in neither
|
|
23
|
-
* table within the caller's scope.
|
|
193
|
+
* Approve the revision in review. Throws `RevisionMismatch` when the draft
|
|
194
|
+
* moved on since the reviewer looked, `ReviewStepRefused` when nothing is in
|
|
195
|
+
* review for that revision or the approver asked for it themselves.
|
|
24
196
|
*/
|
|
25
|
-
|
|
197
|
+
declare const approveReview_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope, options: DecideOptions) => Promise<Row>;
|
|
26
198
|
|
|
27
199
|
/** Effect-native `archive` (see {@link saveDraftEffect}). */
|
|
28
|
-
export declare const
|
|
200
|
+
export declare const archive: (store: DataStore, type: ContentType, id: string, scope: CmsScope) => Effect_2.Effect<void, ContentNotFound>;
|
|
201
|
+
|
|
202
|
+
/** Effect form of {@link assertApproved}. */
|
|
203
|
+
export declare const assertApproved: (...args: Parameters<typeof assertApproved_2>) => Effect<void, ReviewRequired, never>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The publish gate: for a type that requires review, `revisionId` must carry
|
|
207
|
+
* an approval. Called by `publishRevision` — so single publishes, releases,
|
|
208
|
+
* rollbacks and scheduled publishing all pass the same gate.
|
|
209
|
+
*/
|
|
210
|
+
declare const assertApproved_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope, revisionId: string) => Promise<void>;
|
|
211
|
+
|
|
212
|
+
/** Effect form of {@link assertReferencesAvailable}. */
|
|
213
|
+
export declare const assertReferencesAvailable: (...args: Parameters<typeof assertReferencesAvailable_2>) => Effect<void, ReferenceUnavailable, never>;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The publish gate: a revision whose values reference an unavailable
|
|
217
|
+
* document is refused with `ReferenceUnavailable`, naming each one.
|
|
218
|
+
*/
|
|
219
|
+
declare const assertReferencesAvailable_2: (tx: DataStore, type: ContentType, variantId: string, values: Readonly<Record<string, unknown>>, scope: CmsScope, now?: Date) => Promise<void>;
|
|
220
|
+
|
|
221
|
+
/** The version a reader is shown: the same reader, the same version, every time. */
|
|
222
|
+
export declare const assignVariant: (experimentId: string, readerId: string, share: number) => Variant;
|
|
223
|
+
|
|
224
|
+
export declare interface Audience {
|
|
225
|
+
readonly id: string;
|
|
226
|
+
/** Raise it when the rule changes meaning; a variant records the version it was written for. */
|
|
227
|
+
readonly version: number;
|
|
228
|
+
readonly displayName: string;
|
|
229
|
+
readonly rule: AudienceRule;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** A rule: every condition given must hold. */
|
|
233
|
+
export declare interface AudienceRule {
|
|
234
|
+
/** The preferred language starts with one of these (`de` matches `de-AT`). */
|
|
235
|
+
readonly languages?: ReadonlyArray<string>;
|
|
236
|
+
/** The request comes from one of these countries. */
|
|
237
|
+
readonly countries?: ReadonlyArray<string>;
|
|
238
|
+
/** The reader has (true) or has not (false) been here before. */
|
|
239
|
+
readonly returning?: boolean;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** What the server knows about the request, declared — nothing else is consulted. */
|
|
243
|
+
export declare interface AudienceSignals {
|
|
244
|
+
/** Accept-Language, in order of preference (`de-AT`, `de`, `en`). */
|
|
245
|
+
readonly languages?: ReadonlyArray<string>;
|
|
246
|
+
/** ISO 3166-1 alpha-2, from a proxy the app trusts to set it. */
|
|
247
|
+
readonly country?: string | null;
|
|
248
|
+
/** The reader allowed being recognised, and was here before. */
|
|
249
|
+
readonly returning?: boolean;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Which fields carry a type's availability. Validated by `defineContentType`. */
|
|
253
|
+
export declare interface AvailabilityConfig {
|
|
254
|
+
/** A date or datetime field: usable up to (excluding) this moment. */
|
|
255
|
+
readonly until?: string;
|
|
256
|
+
/** A boolean field: `true` withdraws the document at once. */
|
|
257
|
+
readonly blocked?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** Effect form of {@link bindExtensionSecret}. */
|
|
261
|
+
export declare const bindExtensionSecret: (...args: Parameters<typeof bindExtensionSecret_2>) => Effect<SecretBinding, never, never>;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Set (or, with `value: null`, remove) the secret `name` for an extension.
|
|
265
|
+
* Only a secret its running or waiting version asks for (`secret:<name>`).
|
|
266
|
+
*/
|
|
267
|
+
declare const bindExtensionSecret_2: (tx: DataStore, extensionId: string, name: string, value: string | null) => Promise<SecretBinding>;
|
|
268
|
+
|
|
269
|
+
export declare type BlockReason = 'notFound' | 'reviewRequired' | 'incomplete' | 'referenceUnavailable' | 'notPublished' | 'unknownType' | 'invalid' | 'revisionMoved';
|
|
270
|
+
|
|
271
|
+
export declare interface Blueprint {
|
|
272
|
+
readonly id: string;
|
|
273
|
+
readonly displayName: string;
|
|
274
|
+
/** The language `values` are written in. */
|
|
275
|
+
readonly locale: string;
|
|
276
|
+
readonly entries: ReadonlyArray<BlueprintEntry>;
|
|
277
|
+
/** The team the workspace starts with: the default role and people invited with a role (team.ts). */
|
|
278
|
+
readonly team?: BlueprintTeam;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** One document a blueprint provisions. */
|
|
282
|
+
export declare interface BlueprintEntry {
|
|
283
|
+
/** Unique within the blueprint; another entry points at this one with `blueprintRef(key)`. */
|
|
284
|
+
readonly key: string;
|
|
285
|
+
/** The content type's name. */
|
|
286
|
+
readonly type: string;
|
|
287
|
+
/**
|
|
288
|
+
* The field that says the workspace already has this document (e.g. `slug`),
|
|
289
|
+
* compared after derivations. Omitted: any document of the type counts — for
|
|
290
|
+
* a type a workspace holds one of, like its site document.
|
|
291
|
+
*/
|
|
292
|
+
readonly match?: string;
|
|
293
|
+
/** A template of the type the document is built from; `values` go over it. */
|
|
294
|
+
readonly template?: string;
|
|
295
|
+
/** Field values in the blueprint's language. `blueprintRef(key)` anywhere stands for that entry's document id. */
|
|
296
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
297
|
+
/** The same document in further languages: the values that differ from `values`. */
|
|
298
|
+
readonly translations?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
299
|
+
/** Publish what is created (default true). A type that needs review stays a draft. */
|
|
300
|
+
readonly publish?: boolean;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** The declaration or its target does not fit: an unknown key, type, field, template or a cycle. */
|
|
304
|
+
export declare class BlueprintInvalid extends Error {
|
|
305
|
+
readonly reason: string;
|
|
306
|
+
readonly _tag = "BlueprintInvalid";
|
|
307
|
+
constructor(reason: string);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export declare interface BlueprintPlan {
|
|
311
|
+
readonly blueprint: string;
|
|
312
|
+
readonly steps: ReadonlyArray<BlueprintStep>;
|
|
313
|
+
/** New documents a create would start (translations of them not counted). */
|
|
314
|
+
readonly documents: number;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** A value that stands for another entry's document id. */
|
|
318
|
+
export declare const blueprintRef: (key: string) => {
|
|
319
|
+
readonly $entry: string;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/** One language variant of one entry. */
|
|
323
|
+
export declare interface BlueprintStep {
|
|
324
|
+
readonly key: string;
|
|
325
|
+
readonly type: string;
|
|
326
|
+
readonly locale: string;
|
|
327
|
+
/** What the step is about: the document's title (the one there already, for a present step), else its `match` value, else the key. */
|
|
328
|
+
readonly label: string;
|
|
329
|
+
readonly action: 'create' | 'present';
|
|
330
|
+
/** The document: the one there already, or (after applying) the one created. Null for a planned create. */
|
|
331
|
+
readonly documentId: string | null;
|
|
332
|
+
/** Its variant in `locale`, likewise. */
|
|
333
|
+
readonly variantId: string | null;
|
|
334
|
+
/** For a create: `live` is published, `draft` is not meant to be, `review` needs an approval first. */
|
|
335
|
+
readonly outcome: 'live' | 'draft' | 'review' | null;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** Where a blueprint is provisioned: a site and environment of the caller's tenant. */
|
|
339
|
+
export declare interface BlueprintTarget {
|
|
340
|
+
readonly site: string;
|
|
341
|
+
readonly environment: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/** A blueprint's team: the default role and the people invited with a role. */
|
|
345
|
+
export declare interface BlueprintTeam {
|
|
346
|
+
readonly defaultRole?: string;
|
|
347
|
+
readonly members?: ReadonlyArray<{
|
|
348
|
+
readonly email: string;
|
|
349
|
+
readonly role: string;
|
|
350
|
+
}>;
|
|
351
|
+
/** Content types (with `review.required: 'workspace'`) whose publishing needs a review in the workspace. */
|
|
352
|
+
readonly reviewRequired?: ReadonlyArray<string>;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Arrange one variant per document into a tree. `entries` holds at most one
|
|
357
|
+
* entry per `documentId` (the first one wins). A node without a segment is
|
|
358
|
+
* not routable and counts as an orphan, and so does everything below it.
|
|
359
|
+
*/
|
|
360
|
+
export declare const buildTree: (entries: ReadonlyArray<TreeEntry>, config: TreeConfig) => CmsTree;
|
|
361
|
+
|
|
362
|
+
/** What to do to every item. */
|
|
363
|
+
export declare type BulkAction = {
|
|
364
|
+
readonly kind: 'publish';
|
|
365
|
+
} | {
|
|
366
|
+
readonly kind: 'unpublish';
|
|
367
|
+
} | {
|
|
368
|
+
readonly kind: 'setOwner';
|
|
369
|
+
readonly owner: string | null;
|
|
370
|
+
}
|
|
371
|
+
/** Save a new draft revision of each item with one field changed (null
|
|
372
|
+
* clears it) — a field a person edits: not derived, not rich text or components. */
|
|
373
|
+
| {
|
|
374
|
+
readonly kind: 'setField';
|
|
375
|
+
readonly field: string;
|
|
376
|
+
readonly value: unknown;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
/** One locale variant (a draft id) of a document. */
|
|
380
|
+
export declare interface BulkItem {
|
|
381
|
+
readonly type: string;
|
|
382
|
+
readonly id: string;
|
|
383
|
+
readonly locale: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export declare interface BulkResult extends BulkItem {
|
|
387
|
+
readonly title: string;
|
|
388
|
+
readonly outcome: 'done' | 'unchanged' | 'failed';
|
|
389
|
+
readonly reason: BlockReason | 'failed' | null;
|
|
390
|
+
readonly detail: ReadonlyArray<string>;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** Effect form of {@link cancelSeries}. */
|
|
394
|
+
export declare const cancelSeries: (...args: Parameters<typeof cancelSeries_2>) => Effect<boolean, ContentValidationFailed | ContentNotFound, never>;
|
|
395
|
+
|
|
396
|
+
/** End a draft's series and clear what it armed. True when there was one. In the caller's transaction. */
|
|
397
|
+
declare const cancelSeries_2: (tx: DataStore, type: ContentType, draftId: string) => Promise<boolean>;
|
|
398
|
+
|
|
399
|
+
/** The declared fields whose values differ between `before` and `after`, in declaration order. */
|
|
400
|
+
export declare const changedFields: (fields: Readonly<Record<string, unknown>>, before: Readonly<Record<string, unknown>>, after: Readonly<Record<string, unknown>>) => ReadonlyArray<string>;
|
|
401
|
+
|
|
402
|
+
export declare interface ChangeEntry {
|
|
403
|
+
readonly id: string;
|
|
404
|
+
/** Epoch milliseconds. */
|
|
405
|
+
readonly at: number;
|
|
406
|
+
readonly locale: string;
|
|
407
|
+
readonly contentType: string;
|
|
408
|
+
readonly documentId: string;
|
|
409
|
+
readonly variantId: string;
|
|
410
|
+
readonly action: 'published' | 'unpublished';
|
|
411
|
+
readonly revision: number | null;
|
|
412
|
+
readonly releaseId: string | null;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export declare interface ChangeOrigin {
|
|
416
|
+
/** The release applying this change. */
|
|
417
|
+
readonly releaseId?: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Throws when a declaration cannot work: fields missing or of the wrong kind, a component the field does not allow. */
|
|
421
|
+
export declare const checkTemplates: (name: string, fields: Readonly<Record<string, FieldSchema>>, config: TemplatesConfig) => void;
|
|
422
|
+
|
|
423
|
+
export declare const CMS_AI_OPERATIONS_TABLE = "cms_ai_operations";
|
|
424
|
+
|
|
425
|
+
export declare const CMS_AI_SETTINGS_TABLE = "cms_ai_settings";
|
|
426
|
+
|
|
427
|
+
/** The system table holding the availability of published documents. */
|
|
428
|
+
export declare const CMS_AVAILABILITY_TABLE = "cms_availability";
|
|
429
|
+
|
|
430
|
+
export declare const CMS_CHANGES_TABLE = "cms_changes";
|
|
431
|
+
|
|
432
|
+
export declare const CMS_DRAFT_TEXTS_TABLE = "cms_draft_texts";
|
|
433
|
+
|
|
434
|
+
export declare const CMS_EXPERIMENT_EVENTS_TABLE = "cms_experiment_events";
|
|
435
|
+
|
|
436
|
+
export declare const CMS_EXPERIMENTS_TABLE = "cms_experiments";
|
|
437
|
+
|
|
438
|
+
export declare const CMS_EXTENSION_DATA_TABLE = "cms_extension_data";
|
|
439
|
+
|
|
440
|
+
export declare const CMS_EXTENSION_SECRETS_TABLE = "cms_extension_secrets";
|
|
441
|
+
|
|
442
|
+
export declare const CMS_EXTENSIONS_TABLE = "cms_extensions";
|
|
443
|
+
|
|
444
|
+
export declare const CMS_GLOSSARY_TABLE = "cms_glossary";
|
|
445
|
+
|
|
446
|
+
export declare const CMS_PATHS_TABLE = "cms_paths";
|
|
447
|
+
|
|
448
|
+
/** The system table holding preview shares. */
|
|
449
|
+
export declare const CMS_PREVIEW_SHARES_TABLE = "cms_preview_shares";
|
|
450
|
+
|
|
451
|
+
export declare const CMS_PUBLISH_SERIES_TABLE = "cms_publish_series";
|
|
452
|
+
|
|
453
|
+
export declare const CMS_QUALITY_EXCEPTIONS_TABLE = "cms_quality_exceptions";
|
|
454
|
+
|
|
455
|
+
export declare const CMS_REDIRECTS_TABLE = "cms_redirects";
|
|
456
|
+
|
|
457
|
+
/** The system table holding the reference edges of every published variant. */
|
|
458
|
+
export declare const CMS_REFERENCES_TABLE = "cms_references";
|
|
459
|
+
|
|
460
|
+
export declare const CMS_RELEASE_ITEMS_TABLE = "cms_release_items";
|
|
461
|
+
|
|
462
|
+
export declare const CMS_RELEASES_TABLE = "cms_releases";
|
|
463
|
+
|
|
464
|
+
/** The system table holding every review step. */
|
|
465
|
+
export declare const CMS_REVIEWS_TABLE = "cms_reviews";
|
|
466
|
+
|
|
467
|
+
/** The system table holding every saved revision of every content type. */
|
|
468
|
+
export declare const CMS_REVISIONS_TABLE = "cms_revisions";
|
|
469
|
+
|
|
470
|
+
/** The scope columns, in the order they lead every scoped key. */
|
|
471
|
+
export declare const CMS_SCOPE_COLUMNS: readonly ["site", "environment", "locale"];
|
|
472
|
+
|
|
473
|
+
export declare const CMS_SEARCH_TABLE = "cms_search";
|
|
474
|
+
|
|
475
|
+
export declare const CMS_STEWARDSHIP_TABLE = "cms_stewardship";
|
|
476
|
+
|
|
477
|
+
export declare const CMS_TEAM_INVITATIONS_TABLE = "cms_team_invitations";
|
|
478
|
+
|
|
479
|
+
export declare const CMS_TEAM_TABLE = "cms_team";
|
|
480
|
+
|
|
481
|
+
/** One AI call on a document, and what became of it. */
|
|
482
|
+
export declare const cmsAiOperationsTable: TableLike;
|
|
483
|
+
|
|
484
|
+
/** One row per workspace: how it reaches a model. */
|
|
485
|
+
export declare const cmsAiSettingsTable: TableLike;
|
|
29
486
|
|
|
30
487
|
/** The CMS read surface attached to `ctx.cms` (and the standalone client). */
|
|
31
488
|
export declare interface CmsApi {
|
|
32
489
|
/** Open a query over a content type's PUBLISHED rows (archived excluded). */
|
|
33
490
|
contentType(name: string): ContentQuery;
|
|
491
|
+
/**
|
|
492
|
+
* Find one published entry in the surface's locale, else along `fallback`
|
|
493
|
+
* (ADR-CMS-002). A key found in a fallback locale whose document DOES have a
|
|
494
|
+
* variant in the requested locale resolves to that variant — so the result
|
|
495
|
+
* may carry a different key value (its canonical address). Otherwise the
|
|
496
|
+
* fallback variant is returned with `fallback: true`. Null when nothing
|
|
497
|
+
* matches in any locale.
|
|
498
|
+
*/
|
|
499
|
+
resolve(type: string, options: ResolveOptions): Promise<ResolvedEntry | null>;
|
|
500
|
+
/**
|
|
501
|
+
* The type's published documents as a tree (the type must declare
|
|
502
|
+
* `tree`), one variant per document: the surface's locale, else the first
|
|
503
|
+
* `fallback` locale that has one. Reads every published row of the type in
|
|
504
|
+
* those locales.
|
|
505
|
+
*/
|
|
506
|
+
tree(type: string, options?: TreeOptions): Promise<CmsTree>;
|
|
507
|
+
/**
|
|
508
|
+
* Find the document at `path` (segments joined with `/`) in the tree. A
|
|
509
|
+
* path that only exists in a fallback locale's tree answers with the
|
|
510
|
+
* requested locale's node of the same document. A path no live page has
|
|
511
|
+
* but a published page had before it moved answers with that page at its
|
|
512
|
+
* current address (ADR-CMS-023). Null when none of these match.
|
|
513
|
+
*/
|
|
514
|
+
route(type: string, path: string, options?: TreeOptions): Promise<RouteMatch | null>;
|
|
515
|
+
/**
|
|
516
|
+
* Whether `path` is GONE: no live page answers it ({@link CmsApi.route}
|
|
517
|
+
* finds nothing), but a published page had it — its address before it was
|
|
518
|
+
* taken down or archived, or a former address pointing at such a page — in
|
|
519
|
+
* the surface's locale or along `fallback`. A site answers it with 410
|
|
520
|
+
* rather than 404.
|
|
521
|
+
*/
|
|
522
|
+
gone(type: string, path: string, options?: TreeOptions): Promise<boolean>;
|
|
523
|
+
/**
|
|
524
|
+
* Where a document is used by published content in the surface's site and
|
|
525
|
+
* environment, across locales (the `cms_references` edges publishing
|
|
526
|
+
* writes). A draft that references it is not a use until it is published.
|
|
527
|
+
*/
|
|
528
|
+
usedBy(type: string, documentId: string): Promise<ReadonlyArray<ReferenceUse>>;
|
|
34
529
|
/**
|
|
35
530
|
* Resolve a single row honouring a preview token. With a valid token
|
|
36
531
|
* for `{type, id}`, reads the DRAFT row; otherwise reads the published
|
|
@@ -40,13 +535,92 @@ export declare interface CmsApi {
|
|
|
40
535
|
}
|
|
41
536
|
|
|
42
537
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
538
|
+
* One row per published document of a type that declares `availability`.
|
|
539
|
+
* Register it in the app's `databaseHandle` when any type declares it.
|
|
45
540
|
*/
|
|
46
|
-
export declare const
|
|
47
|
-
|
|
541
|
+
export declare const cmsAvailabilityTable: TableLike;
|
|
542
|
+
|
|
543
|
+
export declare const cmsChangesTable: TableLike;
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Build the `ctx.cms` surface over a request-scoped store, confined to one
|
|
547
|
+
* `scope` (site, environment, locale). Attach the result to your
|
|
548
|
+
* `AppContext` slot (or read it via `useCms(ctx)`).
|
|
549
|
+
*/
|
|
550
|
+
export declare const cmsContext: (store: DataStore, types: ReadonlyArray<ContentType>, options: {
|
|
551
|
+
readonly scope: CmsScope;
|
|
552
|
+
readonly secret?: string;
|
|
48
553
|
}) => CmsApi;
|
|
49
554
|
|
|
555
|
+
/** One text field of one draft (a document in one language), as a CRDT text. */
|
|
556
|
+
export declare const cmsDraftTextsTable: TableLike;
|
|
557
|
+
|
|
558
|
+
export declare const cmsExperimentEventsTable: TableLike;
|
|
559
|
+
|
|
560
|
+
export declare const cmsExperimentsTable: TableLike;
|
|
561
|
+
|
|
562
|
+
/** An extension's own data, by key, in its namespace. */
|
|
563
|
+
export declare const cmsExtensionDataTable: TableLike;
|
|
564
|
+
|
|
565
|
+
export declare interface CmsExtensionManifest {
|
|
566
|
+
/** Lowercase letters, digits and dashes: `reading-time`. */
|
|
567
|
+
readonly id: string;
|
|
568
|
+
readonly name: string;
|
|
569
|
+
/** `major.minor.patch`. */
|
|
570
|
+
readonly version: string;
|
|
571
|
+
readonly publisher: string;
|
|
572
|
+
readonly capabilities: ReadonlyArray<ExtensionCapability>;
|
|
573
|
+
readonly slots: ReadonlyArray<ExtensionSlot>;
|
|
574
|
+
/** With the `fieldWidget` slot: the fields it shows beside (field names of the content types). */
|
|
575
|
+
readonly fields?: ReadonlyArray<string>;
|
|
576
|
+
/** What an admin can set for it (the `settings` slot): each setting's key, kind, bounds and default. */
|
|
577
|
+
readonly settings?: ReadonlyArray<ExtensionSetting>;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/** The secrets an admin bound for an extension: encrypted at rest, never sent to a client. */
|
|
581
|
+
export declare const cmsExtensionSecretsTable: TableLike;
|
|
582
|
+
|
|
583
|
+
/** One row per installed extension: its version, what it was granted, and a newer version waiting for consent. */
|
|
584
|
+
export declare const cmsExtensionsTable: TableLike;
|
|
585
|
+
|
|
586
|
+
/** One entry per workspace, term (lower case) and target language. */
|
|
587
|
+
export declare const cmsGlossaryTable: TableLike;
|
|
588
|
+
|
|
589
|
+
/** The address each published document of a tree type had at its last publish, per locale. */
|
|
590
|
+
export declare const cmsPathsTable: TableLike;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* One preview share: which variant, which revision (null = always the
|
|
594
|
+
* latest), until when, and whether it was revoked. Register it in the app's
|
|
595
|
+
* `databaseHandle` beside `cmsRevisionsTable`.
|
|
596
|
+
*/
|
|
597
|
+
export declare const cmsPreviewSharesTable: TableLike;
|
|
598
|
+
|
|
599
|
+
/** One repeating live window per draft: its rule, and the occurrence armed last (-1: none yet). */
|
|
600
|
+
export declare const cmsPublishSeriesTable: TableLike;
|
|
601
|
+
|
|
602
|
+
export declare const cmsQualityExceptionsTable: TableLike;
|
|
603
|
+
|
|
604
|
+
/** A former address and the document now answering it. */
|
|
605
|
+
export declare const cmsRedirectsTable: TableLike;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* One row per reference a published variant makes: the source (type,
|
|
609
|
+
* document, variant, scope), where in its values the reference sits (`path`)
|
|
610
|
+
* and the target document. Tenant-scoped. Register it in the app's
|
|
611
|
+
* `databaseHandle` beside `cmsRevisionsTable`.
|
|
612
|
+
*/
|
|
613
|
+
export declare const cmsReferencesTable: TableLike;
|
|
614
|
+
|
|
615
|
+
/** One variant in a release: publish its pinned revision, or unpublish it. */
|
|
616
|
+
export declare const cmsReleaseItemsTable: TableLike;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* A named set of pinned revisions for ONE site and environment. Register it
|
|
620
|
+
* (with `cmsReleaseItemsTable`) in the app's `databaseHandle`.
|
|
621
|
+
*/
|
|
622
|
+
export declare const cmsReleasesTable: TableLike;
|
|
623
|
+
|
|
50
624
|
export declare interface CmsRestOptions {
|
|
51
625
|
readonly cms: CmsApi;
|
|
52
626
|
readonly types: ReadonlyArray<ContentType>;
|
|
@@ -80,8 +654,123 @@ export declare interface CmsRestResponse {
|
|
|
80
654
|
readonly body: unknown;
|
|
81
655
|
}
|
|
82
656
|
|
|
657
|
+
/**
|
|
658
|
+
* One review step on one variant and revision. `actorId` is who took the
|
|
659
|
+
* step. Register it in the app's `databaseHandle` beside `cmsRevisionsTable`
|
|
660
|
+
* when a content type requires review.
|
|
661
|
+
*/
|
|
662
|
+
export declare const cmsReviewsTable: TableLike;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Every successful save of a draft writes ONE immutable row here: the
|
|
666
|
+
* validated field values, the content type, the document, the variant's scope
|
|
667
|
+
* and a number per variant (document + scope) starting at 1. Rows are never updated or
|
|
668
|
+
* deleted — a restore or a later edit writes a new revision. Tenant-scoped
|
|
669
|
+
* with the audit columns, like the content tables; the unique key makes a
|
|
670
|
+
* second writer of the same number fail instead of forking the history.
|
|
671
|
+
*
|
|
672
|
+
* Register it in the app's `databaseHandle` beside the content tables.
|
|
673
|
+
*/
|
|
674
|
+
export declare const cmsRevisionsTable: TableLike;
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Where a content row lives besides its tenant: the site it belongs to, the
|
|
678
|
+
* content environment (e.g. `production`, `staging`) and its locale. Three
|
|
679
|
+
* separate axes, stored on every draft, published row and revision, and
|
|
680
|
+
* required by every write and read — never taken from a caller's free-form
|
|
681
|
+
* filter. The tenant comes from the request subject (`tenant()`).
|
|
682
|
+
*/
|
|
683
|
+
export declare interface CmsScope {
|
|
684
|
+
readonly site: string;
|
|
685
|
+
readonly environment: string;
|
|
686
|
+
/** A BCP 47 tag, e.g. `en-GB`. */
|
|
687
|
+
readonly locale: string;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export declare const cmsSearchTable: TableLike;
|
|
691
|
+
|
|
692
|
+
export declare const cmsStewardshipTable: TableLike;
|
|
693
|
+
|
|
694
|
+
/** Who is invited with which role. */
|
|
695
|
+
export declare const cmsTeamInvitationsTable: TableLike;
|
|
696
|
+
|
|
697
|
+
/** One row per workspace: the role a new editor gets, and the types whose publishing needs a review here. */
|
|
698
|
+
export declare const cmsTeamTable: TableLike;
|
|
699
|
+
|
|
700
|
+
/** A built tree: every routable node, depth-first, siblings in order. */
|
|
701
|
+
export declare interface CmsTree {
|
|
702
|
+
readonly nodes: ReadonlyArray<TreeNode>;
|
|
703
|
+
/**
|
|
704
|
+
* Documents whose chain never reaches the root — the parent is not
|
|
705
|
+
* published in any locale the reader accepts, or the parents form a
|
|
706
|
+
* cycle. They are not routable; they are never hung under the root.
|
|
707
|
+
*/
|
|
708
|
+
readonly orphans: ReadonlyArray<string>;
|
|
709
|
+
}
|
|
710
|
+
|
|
83
711
|
/** Everything the write pipeline can fail with on the typed channel. */
|
|
84
|
-
export declare type CmsWriteError = ContentValidationFailed | ContentNotFound | ContentIdConflict;
|
|
712
|
+
export declare type CmsWriteError = ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch;
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* The fields two editors can type in together: plain text (`text` or
|
|
716
|
+
* `textarea`) the editor writes itself — not a derived or unique field (a
|
|
717
|
+
* slug), not a choice (a template), not rich text.
|
|
718
|
+
*/
|
|
719
|
+
export declare const collaborativeFields: (type: ContentType) => ReadonlyArray<string>;
|
|
720
|
+
|
|
721
|
+
/** Effect form of {@link compareEnvironments}. */
|
|
722
|
+
export declare const compareEnvironments: (...args: Parameters<typeof compareEnvironments_2>) => Effect<readonly EnvironmentDifference[], never, never>;
|
|
723
|
+
|
|
724
|
+
/** How `to` differs from `from`, type by type. */
|
|
725
|
+
declare const compareEnvironments_2: (store: DataStore, types: ReadonlyArray<ContentType>, pair: EnvironmentPair) => Promise<ReadonlyArray<EnvironmentDifference>>;
|
|
726
|
+
|
|
727
|
+
/** Order of two `major.minor.patch` versions: negative, 0 or positive. */
|
|
728
|
+
export declare const compareVersions: (a: string, b: string) => number;
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* A component editors compose pages from (ADR-CMS-015): a stable `id`, a
|
|
732
|
+
* display name and typed props. The frontend renders it; the CMS validates
|
|
733
|
+
* and stores instances of it. `fingerprint` changes whenever the prop contract
|
|
734
|
+
* does, so a stored instance can tell which definition it was written against.
|
|
735
|
+
*/
|
|
736
|
+
export declare interface ComponentDefinition {
|
|
737
|
+
readonly id: string;
|
|
738
|
+
readonly displayName: string;
|
|
739
|
+
readonly props: Readonly<Record<string, FieldSchema>>;
|
|
740
|
+
readonly fingerprint: string;
|
|
741
|
+
/** The consent purpose a reader must grant before this component's props reach them (`gateConsent`). */
|
|
742
|
+
readonly consent?: string;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/** One placed component in a `components` field, as stored. */
|
|
746
|
+
export declare interface ComponentInstance {
|
|
747
|
+
/** Stable across saves, reorders and translations of the same placement. */
|
|
748
|
+
readonly instanceId: string;
|
|
749
|
+
readonly componentId: string;
|
|
750
|
+
/** The definition's fingerprint when this instance was last saved. */
|
|
751
|
+
readonly fingerprint: string;
|
|
752
|
+
readonly props: Readonly<Record<string, unknown>>;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/** A reader's choices: purpose id → the version they allowed. */
|
|
756
|
+
export declare type ConsentChoices = Readonly<Record<string, number>>;
|
|
757
|
+
|
|
758
|
+
/** Something a reader can allow or refuse. */
|
|
759
|
+
export declare interface ConsentPurpose {
|
|
760
|
+
readonly id: string;
|
|
761
|
+
/** Raise it when what the reader agrees to changes. */
|
|
762
|
+
readonly version: number;
|
|
763
|
+
readonly displayName: string;
|
|
764
|
+
readonly description: string;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/** Effect form of {@link consentToUpgrade}. */
|
|
768
|
+
export declare const consentToUpgrade: (...args: Parameters<typeof consentToUpgrade_2>) => Effect<ExtensionChange, never, never>;
|
|
769
|
+
|
|
770
|
+
/** Consent to what the waiting version adds, and move to it. */
|
|
771
|
+
declare const consentToUpgrade_2: (tx: DataStore, extensionId: string, consent: ReadonlyArray<ExtensionCapability>) => Promise<ExtensionChange>;
|
|
772
|
+
|
|
773
|
+
export declare const CONTENT_FORM_STRINGS: ContentFormStrings;
|
|
85
774
|
|
|
86
775
|
/** The lifecycle states a content row moves through. */
|
|
87
776
|
export declare const CONTENT_STATUSES: readonly ["draft", "published", "archived"];
|
|
@@ -103,28 +792,168 @@ export declare interface ContentFormProps {
|
|
|
103
792
|
readonly contentType: ContentFormType;
|
|
104
793
|
readonly value: ContentValue;
|
|
105
794
|
readonly onChange: (next: ContentValue) => void;
|
|
795
|
+
/**
|
|
796
|
+
* Override the widget of one field by its name — a select for a string
|
|
797
|
+
* field only some values make sense in. Wins over `widgets`.
|
|
798
|
+
*/
|
|
799
|
+
readonly fieldWidgets?: Readonly<Record<string, Widget>>;
|
|
106
800
|
/** Override the widget for one or more editor hints (e.g. a TipTap richText). */
|
|
107
801
|
readonly widgets?: Partial<Record<EditorHint, Widget>>;
|
|
802
|
+
/**
|
|
803
|
+
* Renders a control that picks one document of a type — how the rich-text
|
|
804
|
+
* editor inserts an image asset or a link target. Without it, rich text
|
|
805
|
+
* offers neither.
|
|
806
|
+
*/
|
|
807
|
+
readonly renderPicker?: RichDocumentPicker;
|
|
808
|
+
/**
|
|
809
|
+
* Renders beside one field, after its control — what the app keeps about
|
|
810
|
+
* that field (its comments, a hint, who is editing it). `null` renders
|
|
811
|
+
* nothing. Called once per field on every render.
|
|
812
|
+
*/
|
|
813
|
+
readonly renderFieldAside?: (name: string) => ReactNode;
|
|
814
|
+
/**
|
|
815
|
+
* Renders inside one block of a rich-text field (the built-in editor), after
|
|
816
|
+
* its actions: `blockId` is the block's stable id, `label` its legend.
|
|
817
|
+
*/
|
|
818
|
+
readonly renderBlockAside?: (field: string, blockId: string, label: string) => ReactNode;
|
|
819
|
+
/**
|
|
820
|
+
* The label a person reads for a field, instead of its name in code: `path`
|
|
821
|
+
* is the field's name (`title`), or for a component's prop the component id
|
|
822
|
+
* and the prop (`hero.heading`). `undefined` keeps the name. An app answers
|
|
823
|
+
* from its message catalog, so the labels follow the editor's language.
|
|
824
|
+
*/
|
|
825
|
+
readonly fieldLabel?: (path: string) => string | undefined;
|
|
826
|
+
/** The words of the form's own controls (block and component actions, the
|
|
827
|
+
* block editor); English by default. Pass the editor's language. */
|
|
828
|
+
readonly strings?: ContentFormStringsInput;
|
|
829
|
+
/** How rich text's paragraphs and headings are edited — see `RichDocumentEditorProps.surface`. */
|
|
830
|
+
readonly richTextSurface?: 'markup' | 'visual';
|
|
108
831
|
}
|
|
109
832
|
|
|
833
|
+
export declare interface ContentFormStrings {
|
|
834
|
+
/** A block's kind, in its legend (`Paragraph 2`) and the "add" picker. */
|
|
835
|
+
readonly blockNames: Readonly<Record<RichBlock['type'], string>>;
|
|
836
|
+
readonly moveUp: string;
|
|
837
|
+
readonly moveDown: string;
|
|
838
|
+
readonly remove: string;
|
|
839
|
+
/** The accessible names of the three actions, naming what they act on (`Paragraph 2`). */
|
|
840
|
+
readonly moveUpLabel: (label: string) => string;
|
|
841
|
+
readonly moveDownLabel: (label: string) => string;
|
|
842
|
+
readonly removeLabel: (label: string) => string;
|
|
843
|
+
readonly add: string;
|
|
844
|
+
readonly addBlock: string;
|
|
845
|
+
readonly addComponent: string;
|
|
846
|
+
readonly unknownComponent: (componentId: string) => string;
|
|
847
|
+
readonly level: string;
|
|
848
|
+
readonly numbered: string;
|
|
849
|
+
/** A nested depth of a list numbered on its own (`depth` 2: the lists one level in). */
|
|
850
|
+
readonly numberedAt: (depth: number) => string;
|
|
851
|
+
readonly headerRow: string;
|
|
852
|
+
readonly image: string;
|
|
853
|
+
readonly caption: string;
|
|
854
|
+
readonly text: string;
|
|
855
|
+
readonly listItems: string;
|
|
856
|
+
readonly tableRows: string;
|
|
857
|
+
readonly linkTo: string;
|
|
858
|
+
readonly linkText: string;
|
|
859
|
+
readonly insertLink: string;
|
|
860
|
+
/** A list field's entry, in its legend: the field's label and the position (`Categories 2`). */
|
|
861
|
+
readonly item: (label: string, position: number) => string;
|
|
862
|
+
/** The button adding an entry to a list field. */
|
|
863
|
+
readonly addItem: string;
|
|
864
|
+
/** The accessible names of the mark buttons of visual text editing. */
|
|
865
|
+
readonly bold: string;
|
|
866
|
+
readonly italic: string;
|
|
867
|
+
readonly underline: string;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/** The defaults with an app's words over them. */
|
|
871
|
+
export declare const contentFormStrings: (strings?: ContentFormStringsInput) => ContentFormStrings;
|
|
872
|
+
|
|
873
|
+
/** What an app passes: any of the words, and any of the block names. */
|
|
874
|
+
export declare type ContentFormStringsInput = Partial<Omit<ContentFormStrings, 'blockNames'>> & {
|
|
875
|
+
readonly blockNames?: Partial<ContentFormStrings['blockNames']>;
|
|
876
|
+
};
|
|
877
|
+
|
|
110
878
|
/** The content-type shape ContentForm reads (structural — avoids a value import). */
|
|
111
879
|
export declare interface ContentFormType {
|
|
112
880
|
readonly fields: Readonly<Record<string, FieldSchema>>;
|
|
113
881
|
}
|
|
114
882
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
export declare class ContentIdConflict extends ContentIdConflict_base {
|
|
883
|
+
export declare interface ContentfulImportOptions {
|
|
884
|
+
/** The document an entry id became, or null. */
|
|
885
|
+
readonly resolveEntry?: (entryId: string) => string | null;
|
|
886
|
+
/** The image asset document an asset id became, or null. */
|
|
887
|
+
readonly resolveAsset?: (assetId: string) => string | null;
|
|
888
|
+
readonly newId?: () => string;
|
|
122
889
|
}
|
|
123
890
|
|
|
124
|
-
declare
|
|
125
|
-
readonly
|
|
126
|
-
|
|
127
|
-
|
|
891
|
+
export declare interface ContentfulImportResult {
|
|
892
|
+
readonly document: RichDocument;
|
|
893
|
+
readonly findings: ReadonlyArray<HtmlImportFinding>;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/** A node of Contentful's rich-text document, as the export writes it. */
|
|
897
|
+
export declare interface ContentfulNode {
|
|
898
|
+
readonly nodeType: string;
|
|
899
|
+
readonly value?: string;
|
|
900
|
+
readonly marks?: ReadonlyArray<{
|
|
901
|
+
readonly type: string;
|
|
902
|
+
}>;
|
|
903
|
+
readonly data?: {
|
|
904
|
+
readonly uri?: string;
|
|
905
|
+
readonly target?: {
|
|
906
|
+
readonly sys?: {
|
|
907
|
+
readonly id?: string;
|
|
908
|
+
readonly linkType?: string;
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
readonly content?: ReadonlyArray<ContentfulNode>;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* A published document had this address and is no longer live — taken down
|
|
917
|
+
* or archived, with no live page at the address now. A site answers it with
|
|
918
|
+
* 410 Gone rather than 404, so the address is dropped rather than retried.
|
|
919
|
+
*/
|
|
920
|
+
export declare class ContentGone extends ContentGone_base {
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
declare const ContentGone_base: Schema_2.TaggedErrorClass<ContentGone, "ContentGone", {
|
|
924
|
+
readonly _tag: Schema_2.tag<"ContentGone">;
|
|
925
|
+
} & {
|
|
926
|
+
contentType: typeof Schema_2.String;
|
|
927
|
+
/** The address asked for. */
|
|
928
|
+
path: typeof Schema_2.String;
|
|
929
|
+
}>;
|
|
930
|
+
|
|
931
|
+
/** Effect form of {@link contentHealth}. */
|
|
932
|
+
export declare const contentHealth: (...args: Parameters<typeof contentHealth_2>) => Effect<readonly HealthFinding[], never, never>;
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* What needs attention among the PUBLISHED documents of `types` in a site and
|
|
936
|
+
* environment: documents without an owner, reviews that are due, live
|
|
937
|
+
* variants linking to a document that is not live in that language, and
|
|
938
|
+
* languages missing or behind the source. Read through the caller's store, so
|
|
939
|
+
* a request store answers for its tenant. Reads every published row of the
|
|
940
|
+
* types — a report, not a hot path.
|
|
941
|
+
*/
|
|
942
|
+
declare const contentHealth_2: (store: DataStore, types: ReadonlyArray<ContentType>, place: Place_2, options: HealthOptions) => Promise<ReadonlyArray<HealthFinding>>;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Raised by `saveDraft` when the caller supplies an explicit `id` that
|
|
946
|
+
* already exists OUTSIDE the caller's scope (another tenant's row).
|
|
947
|
+
* Refusing here keeps a caller-pinned id from ever updating — or, on a
|
|
948
|
+
* store without DB-enforced PKs, overwriting — a foreign row.
|
|
949
|
+
*/
|
|
950
|
+
export declare class ContentIdConflict extends ContentIdConflict_base {
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
declare const ContentIdConflict_base: Schema_2.TaggedErrorClass<ContentIdConflict, "ContentIdConflict", {
|
|
954
|
+
readonly _tag: Schema_2.tag<"ContentIdConflict">;
|
|
955
|
+
} & {
|
|
956
|
+
contentType: typeof Schema_2.String;
|
|
128
957
|
id: typeof Schema_2.String;
|
|
129
958
|
}>;
|
|
130
959
|
|
|
@@ -142,8 +971,10 @@ declare const ContentNotFound_base: Schema_2.TaggedErrorClass<ContentNotFound, "
|
|
|
142
971
|
} & {
|
|
143
972
|
contentType: typeof Schema_2.String;
|
|
144
973
|
id: typeof Schema_2.String;
|
|
145
|
-
/** Which lifecycle table the id was looked up in
|
|
146
|
-
|
|
974
|
+
/** Which lifecycle table the id was looked up in (`revision`: the
|
|
975
|
+
* revision to publish is not one of this variant's; `share`: a preview
|
|
976
|
+
* share of the caller's). */
|
|
977
|
+
stage: Schema_2.Literal<["draft", "published", "revision", "share"]>;
|
|
147
978
|
}>;
|
|
148
979
|
|
|
149
980
|
/** A chainable read over one content type's published rows. */
|
|
@@ -156,6 +987,17 @@ export declare interface ContentQuery {
|
|
|
156
987
|
all(): Promise<ReadonlyArray<Row>>;
|
|
157
988
|
/** Resolve the first matching row, or null. */
|
|
158
989
|
one(): Promise<Row | null>;
|
|
990
|
+
/**
|
|
991
|
+
* One page of matching rows in `id` order, after the row whose id is
|
|
992
|
+
* `after`. `next` is the id to pass for the following page, null on the
|
|
993
|
+
* last. Keyset, not offset: a row published or taken down between two
|
|
994
|
+
* requests neither repeats nor skips another. Replaces any `orderBy`,
|
|
995
|
+
* `limit` and `offset` on the query.
|
|
996
|
+
*/
|
|
997
|
+
page(limit: number, after?: string): Promise<{
|
|
998
|
+
readonly items: ReadonlyArray<Row>;
|
|
999
|
+
readonly next: string | null;
|
|
1000
|
+
}>;
|
|
159
1001
|
}
|
|
160
1002
|
|
|
161
1003
|
export declare type ContentStatus = (typeof CONTENT_STATUSES)[number];
|
|
@@ -168,9 +1010,31 @@ export declare interface ContentType {
|
|
|
168
1010
|
readonly fields: Readonly<Record<string, FieldSchema>>;
|
|
169
1011
|
readonly list?: ListConfig;
|
|
170
1012
|
readonly idPrefix?: string;
|
|
171
|
-
/** Declared ISR revalidations fired
|
|
1013
|
+
/** Declared ISR revalidations fired by `revalidateContent` — see
|
|
172
1014
|
* `ContentTypeSpec.revalidate`. */
|
|
173
1015
|
readonly revalidate?: ContentTypeSpec['revalidate'];
|
|
1016
|
+
/** How the documents form a tree — see `ContentTypeSpec.tree`. */
|
|
1017
|
+
readonly tree?: TreeConfig;
|
|
1018
|
+
/** The field a document outside a tree is addressed by — see `ContentTypeSpec.address`. */
|
|
1019
|
+
readonly address?: string;
|
|
1020
|
+
/** Whether publishing needs an approved revision — see `ContentTypeSpec.review`. */
|
|
1021
|
+
readonly review?: {
|
|
1022
|
+
readonly required: boolean | 'workspace';
|
|
1023
|
+
};
|
|
1024
|
+
/** When documents may be used — see `ContentTypeSpec.availability`. */
|
|
1025
|
+
readonly availability?: AvailabilityConfig;
|
|
1026
|
+
/** The review cycle — see `ContentTypeSpec.lifecycle`. */
|
|
1027
|
+
readonly lifecycle?: LifecycleConfig;
|
|
1028
|
+
/** Templates and their rules — see `ContentTypeSpec.templates`. */
|
|
1029
|
+
readonly templates?: TemplatesConfig;
|
|
1030
|
+
/** Whether publishes land in the change feed — see `ContentTypeSpec.changeFeed`. */
|
|
1031
|
+
readonly changeFeed?: boolean;
|
|
1032
|
+
/** What makes a document findable — see `ContentTypeSpec.search`. */
|
|
1033
|
+
readonly search?: SearchConfig;
|
|
1034
|
+
/** What its documents are checked for — see `ContentTypeSpec.quality`. */
|
|
1035
|
+
readonly quality?: ReadonlyArray<QualityRule>;
|
|
1036
|
+
/** The vocabulary of a list field — see `ContentTypeSpec.taxonomy`. */
|
|
1037
|
+
readonly taxonomy?: TaxonomyConfig;
|
|
174
1038
|
/** Field names whose value is computed-on-save (derivedFrom). */
|
|
175
1039
|
readonly derivedFields: ReadonlyArray<string>;
|
|
176
1040
|
/** Field names marked unique-per-tenant (composite `(tenantId, field)` UNIQUE). */
|
|
@@ -186,11 +1050,86 @@ export declare interface ContentTypeSpec {
|
|
|
186
1050
|
readonly list?: ListConfig;
|
|
187
1051
|
/** Override the TypeID prefix for awkward plurals / long names. */
|
|
188
1052
|
readonly idPrefix?: string;
|
|
1053
|
+
/**
|
|
1054
|
+
* Arrange this type's documents in a tree (pages under pages): `parent` is
|
|
1055
|
+
* an optional `Schema.Reference` to this same type, `order` an optional
|
|
1056
|
+
* number field ordering siblings, `segment` the string field that forms the
|
|
1057
|
+
* path (the slug). Read it with `cms.tree` / `cms.route`.
|
|
1058
|
+
*/
|
|
1059
|
+
readonly tree?: TreeConfig;
|
|
1060
|
+
/**
|
|
1061
|
+
* For a type outside a tree whose documents have an address of their own
|
|
1062
|
+
* (a blog post's slug): the string field that is it. Every publish records
|
|
1063
|
+
* it, and a changed address leaves a redirect to the document — as moving a
|
|
1064
|
+
* page in a tree does. Read it with `redirectTarget(store, type, path, scope)`.
|
|
1065
|
+
*/
|
|
1066
|
+
readonly address?: string;
|
|
1067
|
+
/**
|
|
1068
|
+
* `required: true` publishes only revisions another editor approved
|
|
1069
|
+
* (`approveReview`) — for every path that publishes: single, release,
|
|
1070
|
+
* rollback, schedule. Register `cmsReviewsTable` when set. `'workspace'`:
|
|
1071
|
+
* each workspace decides (team.ts `setReviewRequired`, or a blueprint's
|
|
1072
|
+
* `team.reviewRequired`) — register `cmsTeamTable` too.
|
|
1073
|
+
*/
|
|
1074
|
+
readonly review?: {
|
|
1075
|
+
readonly required: boolean | 'workspace';
|
|
1076
|
+
};
|
|
1077
|
+
/**
|
|
1078
|
+
* When this type's documents may be used (`until`: a date/datetime field,
|
|
1079
|
+
* `blocked`: a boolean field). Publishing one records it; publishing
|
|
1080
|
+
* anything referencing a blocked or expired one is refused
|
|
1081
|
+
* (`ReferenceUnavailable`), and readers can leave it out
|
|
1082
|
+
* (`unavailableAmong`). Register `cmsAvailabilityTable` when set.
|
|
1083
|
+
*/
|
|
1084
|
+
readonly availability?: AvailabilityConfig;
|
|
1085
|
+
/**
|
|
1086
|
+
* How often a published document is checked again: its first publish sets
|
|
1087
|
+
* a review date `reviewEveryDays` ahead, `recertify` moves it on. Register
|
|
1088
|
+
* `cmsStewardshipTable` (it also holds each document's owner).
|
|
1089
|
+
*/
|
|
1090
|
+
readonly lifecycle?: LifecycleConfig;
|
|
1091
|
+
/**
|
|
1092
|
+
* Templates a new document can start from, and the rules a document built
|
|
1093
|
+
* from one keeps on every save (required components, the first one, at
|
|
1094
|
+
* most N of one). `field` stores the template id.
|
|
1095
|
+
*/
|
|
1096
|
+
readonly templates?: TemplatesConfig;
|
|
1097
|
+
/**
|
|
1098
|
+
* Append every publish and take-down of this type to the change feed
|
|
1099
|
+
* (`cms_changes`, read with `readChanges`), in the same transaction. Register
|
|
1100
|
+
* `cmsChangesTable` when set.
|
|
1101
|
+
*/
|
|
1102
|
+
readonly changeFeed?: boolean;
|
|
1103
|
+
/**
|
|
1104
|
+
* Make this type findable (`searchContent`): every save and publish writes
|
|
1105
|
+
* the variant's text to `cms_search` in the same transaction — `title`
|
|
1106
|
+
* ranked first, all other text (strings, rich text, component props) as the
|
|
1107
|
+
* body. Register `cmsSearchTable` when set.
|
|
1108
|
+
*/
|
|
1109
|
+
readonly search?: SearchConfig;
|
|
1110
|
+
/**
|
|
1111
|
+
* Quality rules (quality.ts): each names the causing field, the words an
|
|
1112
|
+
* editor reads, and whether publishing waits for it (`blocking`, default
|
|
1113
|
+
* true). A blocking finding is repaired at its field or excepted — one rule,
|
|
1114
|
+
* one variant, a reason, an end date, approved by someone else
|
|
1115
|
+
* (`requestQualityException` / `decideQualityException`). Register
|
|
1116
|
+
* `cmsQualityExceptionsTable` when set.
|
|
1117
|
+
*/
|
|
1118
|
+
readonly quality?: ReadonlyArray<QualityRule>;
|
|
1119
|
+
/**
|
|
1120
|
+
* A controlled vocabulary for one `Schema.Array(Schema.String)` field
|
|
1121
|
+
* (taxonomy.ts): every save folds case and spacing, maps synonyms to their
|
|
1122
|
+
* term and drops repeats; a term outside the vocabulary fails the save
|
|
1123
|
+
* (`unknown: 'keep'` keeps it).
|
|
1124
|
+
*/
|
|
1125
|
+
readonly taxonomy?: TaxonomyConfig;
|
|
189
1126
|
/**
|
|
190
1127
|
* ISR routes to drop when content of this type is published or
|
|
191
|
-
* unpublished
|
|
192
|
-
* `revalidateTag` (from `@voltro/runtime`) for each entry
|
|
193
|
-
*
|
|
1128
|
+
* unpublished. `revalidateContent(type)` calls `revalidatePath` /
|
|
1129
|
+
* `revalidateTag` (from `@voltro/runtime`) for each entry, reaching every
|
|
1130
|
+
* `voltro start` replica — `publishDue` after its commits, a mutation from
|
|
1131
|
+
* a post-commit subscriber on `<type>_published` (the write ops run inside
|
|
1132
|
+
* the caller's transaction, so they cannot know when it commits).
|
|
194
1133
|
*
|
|
195
1134
|
* You DON'T need this on postgres for the plain publish case: a route
|
|
196
1135
|
* declaring `cacheInvalidatesOn: ['<type>_published']` is already dropped
|
|
@@ -212,12 +1151,24 @@ export declare interface ContentTypeSpec {
|
|
|
212
1151
|
* published table (the one the rest of the app reads). Both carry the
|
|
213
1152
|
* lifecycle `status` column + audit timestamps and are reactive so
|
|
214
1153
|
* a publish wakes live consumer subscriptions. The draft table also
|
|
215
|
-
* carries
|
|
1154
|
+
* carries nullable `publishAt` and `unpublishAt` (scheduled publishing and
|
|
1155
|
+
* take-down). A field marked
|
|
216
1156
|
* `unique()` adds a composite `(tenantId, field)` DB UNIQUE to BOTH
|
|
217
1157
|
* tables — per-tenant uniqueness enforced by the database.
|
|
218
1158
|
*/
|
|
219
1159
|
export declare const contentTypeToEntities: (ct: ContentType) => ContentEntities;
|
|
220
1160
|
|
|
1161
|
+
export declare interface ContentUsage {
|
|
1162
|
+
readonly documents: number;
|
|
1163
|
+
readonly documentsByType: Readonly<Record<string, number>>;
|
|
1164
|
+
readonly environments: ReadonlyArray<string>;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
/** Effect form of {@link contentUsage}. */
|
|
1168
|
+
export declare const contentUsage: (...args: Parameters<typeof contentUsage_2>) => Effect<ContentUsage, never, never>;
|
|
1169
|
+
|
|
1170
|
+
declare const contentUsage_2: (store: DataStore, types: ReadonlyArray<ContentType>, site: string) => Promise<ContentUsage>;
|
|
1171
|
+
|
|
221
1172
|
/**
|
|
222
1173
|
* Raised by `validateContent` / `saveDraft` when a row violates the
|
|
223
1174
|
* content type's field rules (pattern / maxLength / typed kinds /
|
|
@@ -243,9 +1194,9 @@ export declare type ContentValue = Record<string, unknown>;
|
|
|
243
1194
|
/**
|
|
244
1195
|
* Collect every save-time rule violation for `row` against `type` —
|
|
245
1196
|
* required presence, per-kind type checks, `maxLength`, `pattern`,
|
|
246
|
-
* `Literal` value sets, and
|
|
247
|
-
*
|
|
248
|
-
*
|
|
1197
|
+
* `Literal` value sets, component instances, and rich documents (their
|
|
1198
|
+
* structure, and image / link nodes only where the field names a type for
|
|
1199
|
+
* them).
|
|
249
1200
|
*
|
|
250
1201
|
* Pure and never throws — usable in a browser form ("annotate every
|
|
251
1202
|
* invalid field") as well as on the server. `id` is allowed (must be a
|
|
@@ -258,7 +1209,27 @@ export declare type ContentValue = Record<string, unknown>;
|
|
|
258
1209
|
* that is about to be written — a derived field's rules apply to the
|
|
259
1210
|
* derived value, not to a caller value that's about to be overwritten.
|
|
260
1211
|
*/
|
|
261
|
-
export declare const contentViolations: (type: Pick<ContentType, "name" | "fields"
|
|
1212
|
+
export declare const contentViolations: (type: Pick<ContentType, "name" | "fields"> & Partial<Pick<ContentType, "taxonomy">>, row: Readonly<Record<string, unknown>>) => ReadonlyArray<FieldViolation>;
|
|
1213
|
+
|
|
1214
|
+
/** Effect form of {@link copyEnvironment}. */
|
|
1215
|
+
export declare const copyEnvironment: (...args: Parameters<typeof copyEnvironment_2>) => Effect<CopyEnvironmentResult, never, never>;
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Fill `to` from `from`, within one site. Refused unless `to` holds no variant
|
|
1219
|
+
* of these types yet — a copy never merges into, or overwrites, content that
|
|
1220
|
+
* is already there.
|
|
1221
|
+
*/
|
|
1222
|
+
declare const copyEnvironment_2: (tx: DataStore, types: ReadonlyArray<ContentType>, pair: EnvironmentPair) => Promise<CopyEnvironmentResult>;
|
|
1223
|
+
|
|
1224
|
+
export declare type CopyEnvironmentResult = {
|
|
1225
|
+
readonly ok: true;
|
|
1226
|
+
readonly variants: number;
|
|
1227
|
+
readonly published: number;
|
|
1228
|
+
} | {
|
|
1229
|
+
readonly ok: false;
|
|
1230
|
+
readonly reason: 'targetNotEmpty' | 'sameEnvironment';
|
|
1231
|
+
readonly variants: number;
|
|
1232
|
+
};
|
|
262
1233
|
|
|
263
1234
|
/**
|
|
264
1235
|
* A standalone CMS client for build-time consumption (the blog
|
|
@@ -268,9 +1239,101 @@ export declare const contentViolations: (type: Pick<ContentType, "name" | "field
|
|
|
268
1239
|
export declare const createCmsClient: (config: {
|
|
269
1240
|
store: DataStore;
|
|
270
1241
|
types: ReadonlyArray<ContentType>;
|
|
1242
|
+
scope: CmsScope;
|
|
271
1243
|
secret?: string;
|
|
272
1244
|
}) => CmsApi;
|
|
273
1245
|
|
|
1246
|
+
/** Effect form of {@link createPreviewShare}. */
|
|
1247
|
+
export declare const createPreviewShare: (...args: Parameters<typeof createPreviewShare_2>) => Effect<{
|
|
1248
|
+
readonly share: Row;
|
|
1249
|
+
readonly token: string;
|
|
1250
|
+
}, ContentNotFound | PreviewShareRejected, never>;
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Share one of the caller's drafts. Returns the stored share and the link
|
|
1254
|
+
* token — the only time the token exists in the clear; hand it to the visitor
|
|
1255
|
+
* as part of a URL. Throws `ContentNotFound` when the draft is not the
|
|
1256
|
+
* caller's in `scope`, and `PreviewShareRejected` for an expiry that is not in
|
|
1257
|
+
* the future or lies more than `MAX_PREVIEW_SHARE_DAYS` ahead.
|
|
1258
|
+
*/
|
|
1259
|
+
declare const createPreviewShare_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope, options: CreatePreviewShareOptions) => Promise<{
|
|
1260
|
+
readonly share: Row;
|
|
1261
|
+
readonly token: string;
|
|
1262
|
+
}>;
|
|
1263
|
+
|
|
1264
|
+
export declare interface CreatePreviewShareOptions {
|
|
1265
|
+
/** `pinned` shows the revision the draft has now; `latest` follows every save. */
|
|
1266
|
+
readonly revision: 'pinned' | 'latest';
|
|
1267
|
+
readonly expiresAt: Date;
|
|
1268
|
+
readonly label?: string;
|
|
1269
|
+
/** The clock (tests). */
|
|
1270
|
+
readonly now?: Date;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
/** Effect form of {@link createRelease}. */
|
|
1274
|
+
export declare const createRelease: (...args: Parameters<typeof createRelease_2>) => Effect<Readonly<Record<string, unknown>>, never, never>;
|
|
1275
|
+
|
|
1276
|
+
/** Create an empty release for one site and environment. */
|
|
1277
|
+
declare const createRelease_2: (store: DataStore, input: {
|
|
1278
|
+
readonly name: string;
|
|
1279
|
+
readonly site: string;
|
|
1280
|
+
readonly environment: string;
|
|
1281
|
+
}) => Promise<Row>;
|
|
1282
|
+
|
|
1283
|
+
export declare type DecideExceptionResult = {
|
|
1284
|
+
readonly ok: true;
|
|
1285
|
+
readonly state: 'approved' | 'rejected' | 'withdrawn';
|
|
1286
|
+
} | {
|
|
1287
|
+
readonly ok: false;
|
|
1288
|
+
readonly reason: 'notFound' | 'notOpen' | 'selfApproval' | 'notRequester';
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
export declare interface DecideOptions {
|
|
1292
|
+
/** The revision the reviewer looked at. */
|
|
1293
|
+
readonly revisionId: string;
|
|
1294
|
+
readonly actorId: string;
|
|
1295
|
+
readonly note?: string;
|
|
1296
|
+
/** Let the person who asked approve their own request. Off by default. */
|
|
1297
|
+
readonly allowSelfApproval?: boolean;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/** Effect form of {@link decideQualityException}. */
|
|
1301
|
+
export declare const decideQualityException: (...args: Parameters<typeof decideQualityException_2>) => Effect<DecideExceptionResult, never, never>;
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Decide on an exception: approve or reject an open request (never your own),
|
|
1305
|
+
* or withdraw one — the requester their open request, anyone an approved one
|
|
1306
|
+
* (the finding blocks again at once).
|
|
1307
|
+
*/
|
|
1308
|
+
declare const decideQualityException_2: (tx: DataStore, exceptionId: string, input: {
|
|
1309
|
+
readonly decision: "approve" | "reject" | "withdraw";
|
|
1310
|
+
readonly actorId: string;
|
|
1311
|
+
readonly note?: string;
|
|
1312
|
+
}, now?: Date) => Promise<DecideExceptionResult>;
|
|
1313
|
+
|
|
1314
|
+
/** Decode character references (`&`, `’`, `—`). */
|
|
1315
|
+
export declare const decodeEntities: (text: string) => string;
|
|
1316
|
+
|
|
1317
|
+
/** Define an audience; a rule with no condition would match everyone and is refused. */
|
|
1318
|
+
export declare const defineAudience: (audience: Audience) => Audience;
|
|
1319
|
+
|
|
1320
|
+
/**
|
|
1321
|
+
* Check a blueprint and order its entries so every referenced entry comes
|
|
1322
|
+
* before the entries that reference it. Throws `BlueprintInvalid` for a key
|
|
1323
|
+
* used twice, a reference to no entry, or entries that reference each other
|
|
1324
|
+
* in a circle.
|
|
1325
|
+
*/
|
|
1326
|
+
export declare const defineBlueprint: (spec: Blueprint) => Blueprint;
|
|
1327
|
+
|
|
1328
|
+
/** Declare a component editors can place in a `Schema.Components` field. */
|
|
1329
|
+
export declare const defineComponent: (spec: {
|
|
1330
|
+
readonly id: string;
|
|
1331
|
+
readonly displayName: string;
|
|
1332
|
+
readonly props: Readonly<Record<string, FieldSchema | PipeableField>>;
|
|
1333
|
+
/** A consent purpose the reader must grant first — an embed that loads a third party. */
|
|
1334
|
+
readonly consent?: string;
|
|
1335
|
+
}) => ComponentDefinition;
|
|
1336
|
+
|
|
274
1337
|
export declare const defineContentType: (spec: ContentTypeSpec) => ContentType;
|
|
275
1338
|
|
|
276
1339
|
/**
|
|
@@ -292,11 +1355,404 @@ export declare interface DerivedSpec {
|
|
|
292
1355
|
readonly transform: (value: unknown, row: Record<string, unknown>) => unknown;
|
|
293
1356
|
}
|
|
294
1357
|
|
|
1358
|
+
/**
|
|
1359
|
+
* Name the change from `before` to `after`, or null when nothing declared
|
|
1360
|
+
* changed. A component or block list names the item added, removed, moved or
|
|
1361
|
+
* edited; any other field is "edit <field>".
|
|
1362
|
+
*/
|
|
1363
|
+
export declare const describeEdit: (fields: Readonly<Record<string, FieldSchema>>, before: Readonly<Record<string, unknown>>, after: Readonly<Record<string, unknown>>, words: EditWords) => EditDescription | null;
|
|
1364
|
+
|
|
1365
|
+
export declare const describeFailure: (err: unknown) => string;
|
|
1366
|
+
|
|
1367
|
+
/** One run of a word diff: text both sides share, or text only one side has. */
|
|
1368
|
+
export declare interface DiffSegment {
|
|
1369
|
+
readonly op: 'same' | 'removed' | 'added';
|
|
1370
|
+
readonly text: string;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* The word diff of two texts: the longest common run of words kept as `same`,
|
|
1375
|
+
* the rest as `removed` (only before) and `added` (only after), adjacent runs
|
|
1376
|
+
* of one kind merged. Two very long texts come back as one removed and one
|
|
1377
|
+
* added run.
|
|
1378
|
+
*/
|
|
1379
|
+
export declare const diffWords: (before: string, after: string) => ReadonlyArray<DiffSegment>;
|
|
1380
|
+
|
|
1381
|
+
/** Effect form of {@link dropFromSearch}. */
|
|
1382
|
+
export declare const dropFromSearch: (...args: Parameters<typeof dropFromSearch_2>) => Effect<void, never, never>;
|
|
1383
|
+
|
|
1384
|
+
/** Remove a variant from the search, for the given stages. */
|
|
1385
|
+
declare const dropFromSearch_2: (tx: DataStore, type: ContentType, variantId: string, stages: ReadonlyArray<"draft" | "published">) => Promise<void>;
|
|
1386
|
+
|
|
1387
|
+
export declare interface DuplicateDocument {
|
|
1388
|
+
readonly id: string;
|
|
1389
|
+
readonly documentId: string;
|
|
1390
|
+
readonly title: string;
|
|
1391
|
+
readonly status: string;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
export declare interface DuplicateGroup {
|
|
1395
|
+
readonly fingerprint: string;
|
|
1396
|
+
/** Oldest first: the first is the one to keep unless someone decides otherwise. */
|
|
1397
|
+
readonly documents: ReadonlyArray<DuplicateDocument>;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
/** Effect form of {@link duplicateGroups}. */
|
|
1401
|
+
export declare const duplicateGroups: (...args: Parameters<typeof duplicateGroups_2>) => Effect<readonly DuplicateGroup[], never, never>;
|
|
1402
|
+
|
|
1403
|
+
/** The drafts of `type` in `scope` whose `field` holds the same file, grouped. Archived drafts are left out. */
|
|
1404
|
+
declare const duplicateGroups_2: (store: DataStore, type: ContentType, scope: CmsScope, options: {
|
|
1405
|
+
readonly field: string;
|
|
1406
|
+
readonly fingerprint: Fingerprint;
|
|
1407
|
+
readonly titleField?: string;
|
|
1408
|
+
}) => Promise<ReadonlyArray<DuplicateGroup>>;
|
|
1409
|
+
|
|
1410
|
+
/** What one change did, and a key that tells whether the next change continues it. */
|
|
1411
|
+
export declare interface EditDescription {
|
|
1412
|
+
readonly label: string;
|
|
1413
|
+
/** Changes with the same key in quick succession are one step (typing). */
|
|
1414
|
+
readonly key: string;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
export declare interface EditHistory {
|
|
1418
|
+
/** Oldest first; the last one is undone next. */
|
|
1419
|
+
readonly past: ReadonlyArray<EditStep>;
|
|
1420
|
+
/** Next first: what redo does. */
|
|
1421
|
+
readonly future: ReadonlyArray<EditStep>;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
295
1424
|
/** The widget the editor renders for a field — drives ContentForm. */
|
|
296
|
-
export declare type EditorHint = 'text' | 'textarea' | 'number' | 'boolean' | 'date' | 'datetime' | 'select' | 'richText' | 'media' | 'reference' | 'array' | 'struct';
|
|
1425
|
+
export declare type EditorHint = 'text' | 'textarea' | 'number' | 'boolean' | 'date' | 'datetime' | 'select' | 'richText' | 'media' | 'reference' | 'array' | 'struct' | 'components';
|
|
1426
|
+
|
|
1427
|
+
/** What the editor sends the preview. */
|
|
1428
|
+
export declare interface EditorMessage {
|
|
1429
|
+
readonly protocol: typeof VISUAL_EDITING_PROTOCOL;
|
|
1430
|
+
readonly nonce: string;
|
|
1431
|
+
readonly kind: 'values';
|
|
1432
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
/** One step: the form as it was before it, and its name. */
|
|
1436
|
+
export declare interface EditStep {
|
|
1437
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
1438
|
+
readonly label: string;
|
|
1439
|
+
readonly key: string;
|
|
1440
|
+
readonly at: number;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
/** The words a step is named with, in the editor's language. */
|
|
1444
|
+
export declare interface EditWords {
|
|
1445
|
+
readonly fieldLabel: (name: string) => string;
|
|
1446
|
+
readonly componentLabel: (componentId: string) => string;
|
|
1447
|
+
readonly blockLabel: (type: RichBlock['type']) => string;
|
|
1448
|
+
readonly edit: (what: string) => string;
|
|
1449
|
+
readonly add: (what: string) => string;
|
|
1450
|
+
readonly remove: (what: string) => string;
|
|
1451
|
+
readonly moveUp: (what: string) => string;
|
|
1452
|
+
readonly moveDown: (what: string) => string;
|
|
1453
|
+
/** Two neighbours that changed places — which of them was moved cannot be told from the result. */
|
|
1454
|
+
readonly swap: (first: string, second: string) => string;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
/** The tools on for the last step of `chain`, and why each tool is as it is. */
|
|
1458
|
+
export declare const effectiveExposure: (input: ExposureInput) => ExposureResult;
|
|
1459
|
+
|
|
1460
|
+
export declare const EMPTY_EDIT_HISTORY: EditHistory;
|
|
1461
|
+
|
|
1462
|
+
/** An empty document. */
|
|
1463
|
+
export declare const emptyRichDocument: () => RichDocument;
|
|
1464
|
+
|
|
1465
|
+
export declare interface EnvironmentDifference {
|
|
1466
|
+
readonly contentType: string;
|
|
1467
|
+
/** Documents (with a variant) in `from` only, and in `to` only. */
|
|
1468
|
+
readonly onlyInFrom: number;
|
|
1469
|
+
readonly onlyInTo: number;
|
|
1470
|
+
/** Live in both, with different published values. */
|
|
1471
|
+
readonly differing: ReadonlyArray<{
|
|
1472
|
+
readonly documentId: string;
|
|
1473
|
+
readonly locale: string;
|
|
1474
|
+
readonly title: string;
|
|
1475
|
+
}>;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
export declare interface EnvironmentPair {
|
|
1479
|
+
readonly site: string;
|
|
1480
|
+
readonly from: string;
|
|
1481
|
+
readonly to: string;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
export declare type ExceptionState = 'requested' | 'approved' | 'rejected' | 'withdrawn' | 'expired';
|
|
1485
|
+
|
|
1486
|
+
export declare interface Experiment {
|
|
1487
|
+
readonly id: string;
|
|
1488
|
+
readonly name: string;
|
|
1489
|
+
readonly contentType: string;
|
|
1490
|
+
readonly documentId: string;
|
|
1491
|
+
readonly locale: string;
|
|
1492
|
+
readonly status: 'running' | 'stopped';
|
|
1493
|
+
readonly share: number;
|
|
1494
|
+
readonly overrides: Readonly<Record<string, string>>;
|
|
1495
|
+
readonly goal: string;
|
|
1496
|
+
/** Null for an experiment started before hypotheses were asked for. */
|
|
1497
|
+
readonly hypothesis: string | null;
|
|
1498
|
+
readonly guardrailMaxDrop: number | null;
|
|
1499
|
+
readonly startedAt: Date;
|
|
1500
|
+
readonly stoppedAt: Date | null;
|
|
1501
|
+
/** Version A: the published revision it was started on (null before lineage was recorded). */
|
|
1502
|
+
readonly revisionId: string | null;
|
|
1503
|
+
readonly adoptedReleaseId: string | null;
|
|
1504
|
+
readonly adoptedRevisionId: string | null;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/** Effect form of {@link experimentById}. */
|
|
1508
|
+
export declare const experimentById: (...args: Parameters<typeof experimentById_2>) => Effect<Experiment | null, never, never>;
|
|
1509
|
+
|
|
1510
|
+
/** One experiment by id, or null. */
|
|
1511
|
+
declare const experimentById_2: (store: DataStore, experimentId: string) => Promise<Experiment | null>;
|
|
1512
|
+
|
|
1513
|
+
/** Fields version B may override: the type's own text fields, not derived ones (a slug follows its title). */
|
|
1514
|
+
export declare const experimentFields: (type: ContentType) => ReadonlyArray<string>;
|
|
1515
|
+
|
|
1516
|
+
export declare interface ExperimentLineage {
|
|
1517
|
+
/** Version A: the published revision the experiment was started on. */
|
|
1518
|
+
readonly startedOn: string | null;
|
|
1519
|
+
/** Version B: that revision with these fields replaced. */
|
|
1520
|
+
readonly overrides: Readonly<Record<string, string>>;
|
|
1521
|
+
/** Per delivered revision and version, the readers counted (a publish during the experiment adds a row). */
|
|
1522
|
+
readonly delivered: ReadonlyArray<{
|
|
1523
|
+
readonly revisionId: string | null;
|
|
1524
|
+
readonly variant: Variant;
|
|
1525
|
+
readonly readers: number;
|
|
1526
|
+
}>;
|
|
1527
|
+
/** The adoption, when version B went into a release; `releaseStatus` follows the release. */
|
|
1528
|
+
readonly adopted: {
|
|
1529
|
+
readonly releaseId: string;
|
|
1530
|
+
readonly revisionId: string;
|
|
1531
|
+
readonly releaseStatus: string;
|
|
1532
|
+
} | null;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
/** Effect form of {@link experimentLineage}. */
|
|
1536
|
+
export declare const experimentLineage: (...args: Parameters<typeof experimentLineage_2>) => Effect<ExperimentLineage | null, never, never>;
|
|
1537
|
+
|
|
1538
|
+
/** Where every delivery of an experiment came from — revision, version, adoption. */
|
|
1539
|
+
declare const experimentLineage_2: (store: DataStore, experimentId: string) => Promise<ExperimentLineage | null>;
|
|
1540
|
+
|
|
1541
|
+
export declare interface ExperimentResults {
|
|
1542
|
+
readonly A: VariantResult;
|
|
1543
|
+
readonly B: VariantResult;
|
|
1544
|
+
/** B's rate relative to A's (0.25 = a quarter more); null while A has no conversions. */
|
|
1545
|
+
readonly lift: number | null;
|
|
1546
|
+
/** Two-sided p-value of the difference in rates (two-proportion z-test); null without readers in both. */
|
|
1547
|
+
readonly pValue: number | null;
|
|
1548
|
+
/** At least `MIN_READERS` per version and p below 0.05 — before that the difference may be noise. */
|
|
1549
|
+
readonly conclusive: boolean;
|
|
1550
|
+
/** The guardrail, and whether B fell below it (judged from `MIN_READERS` per version on). */
|
|
1551
|
+
readonly guardrail: {
|
|
1552
|
+
readonly maxDrop: number | null;
|
|
1553
|
+
readonly breached: boolean;
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
/** Effect form of {@link experimentResults}. */
|
|
1558
|
+
export declare const experimentResults: (...args: Parameters<typeof experimentResults_2>) => Effect<ExperimentResults, never, never>;
|
|
1559
|
+
|
|
1560
|
+
/** Per version: readers, conversions and rate, the lift of B, and whether the difference is yet more than noise. */
|
|
1561
|
+
declare const experimentResults_2: (store: DataStore, experimentId: string) => Promise<ExperimentResults>;
|
|
1562
|
+
|
|
1563
|
+
export declare interface ExposureInput {
|
|
1564
|
+
readonly ceiling: ReadonlyArray<string>;
|
|
1565
|
+
readonly defaults: ReadonlyArray<string>;
|
|
1566
|
+
/** From the root down to the page. */
|
|
1567
|
+
readonly chain: ReadonlyArray<ExposureStep>;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
export declare interface ExposureResult {
|
|
1571
|
+
/** The tools on here, in the ceiling's order. */
|
|
1572
|
+
readonly tools: ReadonlyArray<string>;
|
|
1573
|
+
/** Every tool of the ceiling and why it is as it is. */
|
|
1574
|
+
readonly explained: ReadonlyArray<ToolExposure>;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
/** One level of the tree: tool names turned on, off, or locked off here. A value that is not a list of names counts as unset. */
|
|
1578
|
+
export declare interface ExposureStep {
|
|
1579
|
+
readonly on?: unknown;
|
|
1580
|
+
readonly off?: unknown;
|
|
1581
|
+
readonly locked?: unknown;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
/** The places in the editor an extension can show itself. */
|
|
1585
|
+
export declare const EXTENSION_SLOTS: readonly ["dashboard", "sidebar", "fieldWidget", "entryTab", "releaseCheck", "assetAction", "settings"];
|
|
1586
|
+
|
|
1587
|
+
/** An extension reached for a capability it was not granted. */
|
|
1588
|
+
export declare class ExtensionAccessDenied extends ExtensionAccessDenied_base {
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
declare const ExtensionAccessDenied_base: Schema_2.TaggedErrorClass<ExtensionAccessDenied, "ExtensionAccessDenied", {
|
|
1592
|
+
readonly _tag: Schema_2.tag<"ExtensionAccessDenied">;
|
|
1593
|
+
} & {
|
|
1594
|
+
extensionId: typeof Schema_2.String;
|
|
1595
|
+
capability: typeof Schema_2.String;
|
|
1596
|
+
}>;
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* What an extension may do; everything else is refused.
|
|
1600
|
+
*
|
|
1601
|
+
* content:read / content:write — documents, through the CMS, never its tables;
|
|
1602
|
+
* egress:<host> — HTTPS requests to exactly that host;
|
|
1603
|
+
* secret:<NAME> — that one secret, as the host binds it.
|
|
1604
|
+
*
|
|
1605
|
+
* Its own data (`data` in the sandbox) needs no capability: it lives in the
|
|
1606
|
+
* extension's namespace and leaves with it.
|
|
1607
|
+
*/
|
|
1608
|
+
export declare type ExtensionCapability = 'content:read' | 'content:write' | `egress:${string}` | `secret:${string}`;
|
|
1609
|
+
|
|
1610
|
+
export declare type ExtensionChange = {
|
|
1611
|
+
readonly ok: true;
|
|
1612
|
+
readonly installed: InstalledExtension;
|
|
1613
|
+
} | {
|
|
1614
|
+
readonly ok: false;
|
|
1615
|
+
readonly reason: 'invalidManifest';
|
|
1616
|
+
readonly problems: ReadonlyArray<string>;
|
|
1617
|
+
} | {
|
|
1618
|
+
readonly ok: false;
|
|
1619
|
+
readonly reason: 'consentIncomplete';
|
|
1620
|
+
readonly missing: ReadonlyArray<ExtensionCapability>;
|
|
1621
|
+
} | {
|
|
1622
|
+
readonly ok: false;
|
|
1623
|
+
readonly reason: 'alreadyInstalled' | 'notInstalled' | 'notNewer' | 'nothingPending' | 'nothingToRollBack';
|
|
1624
|
+
};
|
|
1625
|
+
|
|
1626
|
+
/** What the host lends an extension; the sandbox decides whether it may use it. */
|
|
1627
|
+
export declare interface ExtensionHost {
|
|
1628
|
+
readonly readContent: (type: string, id: string) => Promise<Readonly<Record<string, unknown>> | null>;
|
|
1629
|
+
/** A type's drafts as the host lends them (it decides how many). */
|
|
1630
|
+
readonly listContent: (type: string) => Promise<ReadonlyArray<Readonly<Record<string, unknown>>>>;
|
|
1631
|
+
/** How many drafts a type has — all of them, where `listContent` may lend only some. */
|
|
1632
|
+
readonly countContent: (type: string) => Promise<number>;
|
|
1633
|
+
/** The values a revision holds (what a release publishes), or null. */
|
|
1634
|
+
readonly readRevision: (revisionId: string) => Promise<Readonly<Record<string, unknown>> | null>;
|
|
1635
|
+
readonly writeContent: (type: string, id: string, values: Readonly<Record<string, unknown>>) => Promise<void>;
|
|
1636
|
+
readonly fetch: (url: string, init?: RequestInit) => Promise<Response>;
|
|
1637
|
+
/** The secret bound under `name`, or undefined. */
|
|
1638
|
+
readonly secret: (name: string) => Promise<string | undefined>;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
/** A manifest on the wire — for a descriptor's input or output. */
|
|
1642
|
+
export declare const ExtensionManifestSchema: Schema_2.Struct<{
|
|
1643
|
+
id: typeof Schema_2.String;
|
|
1644
|
+
name: typeof Schema_2.String;
|
|
1645
|
+
version: typeof Schema_2.String;
|
|
1646
|
+
publisher: typeof Schema_2.String;
|
|
1647
|
+
capabilities: Schema_2.Array$<typeof Schema_2.String>;
|
|
1648
|
+
slots: Schema_2.Array$<typeof Schema_2.String>;
|
|
1649
|
+
fields: Schema_2.optional<Schema_2.Array$<typeof Schema_2.String>>;
|
|
1650
|
+
settings: Schema_2.optional<Schema_2.Array$<Schema_2.Union<[Schema_2.Struct<{
|
|
1651
|
+
key: typeof Schema_2.String;
|
|
1652
|
+
label: typeof Schema_2.String;
|
|
1653
|
+
kind: Schema_2.Literal<["number"]>;
|
|
1654
|
+
default: typeof Schema_2.Number;
|
|
1655
|
+
min: Schema_2.optional<typeof Schema_2.Number>;
|
|
1656
|
+
max: Schema_2.optional<typeof Schema_2.Number>;
|
|
1657
|
+
}>, Schema_2.Struct<{
|
|
1658
|
+
key: typeof Schema_2.String;
|
|
1659
|
+
label: typeof Schema_2.String;
|
|
1660
|
+
kind: Schema_2.Literal<["boolean"]>;
|
|
1661
|
+
default: typeof Schema_2.Boolean;
|
|
1662
|
+
}>, Schema_2.Struct<{
|
|
1663
|
+
key: typeof Schema_2.String;
|
|
1664
|
+
label: typeof Schema_2.String;
|
|
1665
|
+
kind: Schema_2.Literal<["choice"]>;
|
|
1666
|
+
default: typeof Schema_2.String;
|
|
1667
|
+
options: Schema_2.Array$<typeof Schema_2.String>;
|
|
1668
|
+
}>]>>>;
|
|
1669
|
+
}>;
|
|
1670
|
+
|
|
1671
|
+
export declare type ExtensionRemoval = {
|
|
1672
|
+
readonly ok: true;
|
|
1673
|
+
readonly data: ReadonlyArray<{
|
|
1674
|
+
readonly key: string;
|
|
1675
|
+
readonly value: unknown;
|
|
1676
|
+
}>;
|
|
1677
|
+
} | {
|
|
1678
|
+
readonly ok: false;
|
|
1679
|
+
readonly reason: 'notInstalled';
|
|
1680
|
+
};
|
|
1681
|
+
|
|
1682
|
+
/** What an installed extension's code gets. */
|
|
1683
|
+
export declare interface ExtensionSandbox {
|
|
1684
|
+
readonly extensionId: string;
|
|
1685
|
+
readonly readContent: ExtensionHost['readContent'];
|
|
1686
|
+
readonly listContent: ExtensionHost['listContent'];
|
|
1687
|
+
readonly countContent: ExtensionHost['countContent'];
|
|
1688
|
+
readonly readRevision: ExtensionHost['readRevision'];
|
|
1689
|
+
readonly writeContent: ExtensionHost['writeContent'];
|
|
1690
|
+
readonly fetch: ExtensionHost['fetch'];
|
|
1691
|
+
readonly secret: (name: string) => Promise<string | undefined>;
|
|
1692
|
+
/** Its settings as the admin set them (defaults for the rest). */
|
|
1693
|
+
readonly settings: () => Promise<Readonly<Record<string, ExtensionSettingValue>>>;
|
|
1694
|
+
/** Its own data. */
|
|
1695
|
+
readonly data: {
|
|
1696
|
+
readonly get: (key: string) => Promise<unknown>;
|
|
1697
|
+
readonly set: (key: string, value: unknown) => Promise<void>;
|
|
1698
|
+
};
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
/**
|
|
1702
|
+
* The sandbox for `installed`: content, the network and secrets through the
|
|
1703
|
+
* host, each only when granted; every refusal is `ExtensionAccessDenied`
|
|
1704
|
+
* (thrown). Egress is HTTPS to a granted host only.
|
|
1705
|
+
*/
|
|
1706
|
+
export declare const extensionSandbox: (store: DataStore, installed: InstalledExtension, host: ExtensionHost) => ExtensionSandbox;
|
|
1707
|
+
|
|
1708
|
+
/** Effect form of {@link extensionSecret}. */
|
|
1709
|
+
export declare const extensionSecret: (...args: Parameters<typeof extensionSecret_2>) => Effect<string | undefined, never, never>;
|
|
1710
|
+
|
|
1711
|
+
/** The value of a bound secret, for the host — never for a client. */
|
|
1712
|
+
declare const extensionSecret_2: (store: DataStore, extensionId: string, name: string) => Promise<string | undefined>;
|
|
1713
|
+
|
|
1714
|
+
/** One setting of an extension. A number may have bounds; a choice lists its options. */
|
|
1715
|
+
export declare type ExtensionSetting = {
|
|
1716
|
+
readonly key: string;
|
|
1717
|
+
readonly label: string;
|
|
1718
|
+
readonly kind: 'number';
|
|
1719
|
+
readonly default: number;
|
|
1720
|
+
readonly min?: number;
|
|
1721
|
+
readonly max?: number;
|
|
1722
|
+
} | {
|
|
1723
|
+
readonly key: string;
|
|
1724
|
+
readonly label: string;
|
|
1725
|
+
readonly kind: 'boolean';
|
|
1726
|
+
readonly default: boolean;
|
|
1727
|
+
} | {
|
|
1728
|
+
readonly key: string;
|
|
1729
|
+
readonly label: string;
|
|
1730
|
+
readonly kind: 'choice';
|
|
1731
|
+
readonly default: string;
|
|
1732
|
+
readonly options: ReadonlyArray<string>;
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
/** Effect form of {@link extensionSettings}. */
|
|
1736
|
+
export declare const extensionSettings: (...args: Parameters<typeof extensionSettings_2>) => Effect<Readonly<Record<string, ExtensionSettingValue>> | null, never, never>;
|
|
1737
|
+
|
|
1738
|
+
/** An installed extension's settings, with defaults for what was never set. */
|
|
1739
|
+
declare const extensionSettings_2: (store: DataStore, extensionId: string) => Promise<Readonly<Record<string, ExtensionSettingValue>> | null>;
|
|
1740
|
+
|
|
1741
|
+
export declare type ExtensionSettingValue = number | boolean | string;
|
|
1742
|
+
|
|
1743
|
+
export declare type ExtensionSlot = (typeof EXTENSION_SLOTS)[number];
|
|
1744
|
+
|
|
1745
|
+
/** One changed field, as a word diff of its text before and after. */
|
|
1746
|
+
export declare interface FieldDiff {
|
|
1747
|
+
readonly field: string;
|
|
1748
|
+
readonly segments: ReadonlyArray<DiffSegment>;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
/** How each declared field that changed between `before` and `after` changed, in declaration order. */
|
|
1752
|
+
export declare const fieldDiffs: (fields: Readonly<Record<string, unknown>>, before: Readonly<Record<string, unknown>>, after: Readonly<Record<string, unknown>>) => ReadonlyArray<FieldDiff>;
|
|
297
1753
|
|
|
298
1754
|
/** Discriminator for how a field compiles to a column + serialises. */
|
|
299
|
-
export declare type FieldKind = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'literal' | 'richText' | 'media' | 'reference' | 'array' | 'struct';
|
|
1755
|
+
export declare type FieldKind = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'literal' | 'richText' | 'media' | 'reference' | 'array' | 'struct' | 'components';
|
|
300
1756
|
|
|
301
1757
|
/** A refinement applied through `.pipe(...)`. */
|
|
302
1758
|
export declare type FieldRefinement = (field: FieldSchema) => FieldSchema;
|
|
@@ -307,12 +1763,20 @@ export declare interface FieldSchema {
|
|
|
307
1763
|
readonly editorHint: EditorHint;
|
|
308
1764
|
/** When true the field is nullable in the DB + optional in the editor. */
|
|
309
1765
|
readonly isOptional: boolean;
|
|
1766
|
+
/**
|
|
1767
|
+
* Set by `.requiredToPublish()`: a draft may leave it empty; publishing
|
|
1768
|
+
* needs it (`publishViolations`, checked by every publish). Implies
|
|
1769
|
+
* `isOptional` — the column is nullable.
|
|
1770
|
+
*/
|
|
1771
|
+
readonly publishRequired?: boolean;
|
|
310
1772
|
/** Max string length — drives textarea-vs-input + save-time validation. */
|
|
311
1773
|
readonly maxLength?: number;
|
|
312
1774
|
/** Source-form regex (string) for save-time validation. */
|
|
313
1775
|
readonly pattern?: string;
|
|
314
1776
|
/** Closed value set for `literal` fields → `<select>` + CHECK constraint. */
|
|
315
1777
|
readonly literals?: ReadonlyArray<string>;
|
|
1778
|
+
/** A `number` field that takes fractions (a `real` column); without it a number is whole. */
|
|
1779
|
+
readonly fraction?: boolean;
|
|
316
1780
|
/**
|
|
317
1781
|
* When true, the field is unique PER TENANT — the derived tables carry a
|
|
318
1782
|
* composite `(tenantId, <field>)` DB UNIQUE constraint (see contentType.ts).
|
|
@@ -327,10 +1791,29 @@ export declare interface FieldSchema {
|
|
|
327
1791
|
readonly element?: FieldSchema;
|
|
328
1792
|
/** Nested field map for `struct` fields. */
|
|
329
1793
|
readonly struct?: Readonly<Record<string, FieldSchema>>;
|
|
1794
|
+
/** The components a `components` field may hold, in the order editors see them. */
|
|
1795
|
+
readonly components?: ReadonlyArray<ComponentDefinition>;
|
|
330
1796
|
/** Computed-on-save derivation (set via `derivedFrom`). */
|
|
331
1797
|
readonly derived?: DerivedSpec;
|
|
332
1798
|
}
|
|
333
1799
|
|
|
1800
|
+
/** One value a field held, from the revision that introduced it. */
|
|
1801
|
+
export declare interface FieldVersion {
|
|
1802
|
+
readonly value: unknown;
|
|
1803
|
+
readonly revisionId: string;
|
|
1804
|
+
readonly number: number;
|
|
1805
|
+
readonly createdAt: unknown;
|
|
1806
|
+
readonly createdBy: unknown;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* The versions of one field across a document's revisions, newest first: a
|
|
1811
|
+
* new entry wherever the value changed. For an image asset's `file` it is the
|
|
1812
|
+
* file history — a revision that only fixed the alt text adds no version.
|
|
1813
|
+
* `revisions` are `cms_revisions` rows (e.g. from `listRevisions`), in any order.
|
|
1814
|
+
*/
|
|
1815
|
+
export declare const fieldVersions: (revisions: ReadonlyArray<Readonly<Record<string, unknown>>>, field: string) => ReadonlyArray<FieldVersion>;
|
|
1816
|
+
|
|
334
1817
|
/** One save-time rule violation, addressed to a field path. */
|
|
335
1818
|
export declare interface FieldViolation {
|
|
336
1819
|
/** Dotted/indexed field path, e.g. `title`, `meta.ogTitle`, `tags[2]`. */
|
|
@@ -340,6 +1823,75 @@ export declare interface FieldViolation {
|
|
|
340
1823
|
readonly message: string;
|
|
341
1824
|
}
|
|
342
1825
|
|
|
1826
|
+
/** How to fingerprint a stored value (a media key); null when it cannot be read. */
|
|
1827
|
+
export declare type Fingerprint = (value: string) => Promise<string | null>;
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* The part of a `ContentForm` a path names — a field's container, or one
|
|
1831
|
+
* placed component of a components field — or null.
|
|
1832
|
+
*/
|
|
1833
|
+
export declare const formPartOf: (form: ParentNode, path: string) => Element | null;
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* The values with every component that needs an ungranted purpose replaced
|
|
1837
|
+
* by a {@link WithheldInstance}. Values without such components come back
|
|
1838
|
+
* unchanged. Apply it wherever content leaves for a reader.
|
|
1839
|
+
*/
|
|
1840
|
+
export declare const gateConsent: (type: {
|
|
1841
|
+
readonly fields: Readonly<Record<string, FieldSchema>>;
|
|
1842
|
+
}, values: Readonly<Record<string, unknown>>, granted: ReadonlySet<string>) => Record<string, unknown>;
|
|
1843
|
+
|
|
1844
|
+
/** Effect form of {@link glossary}. */
|
|
1845
|
+
export declare const glossary: (...args: Parameters<typeof glossary_2>) => Effect<readonly GlossaryEntry[], never, never>;
|
|
1846
|
+
|
|
1847
|
+
/** The workspace's entries, by term; for one target language when given. */
|
|
1848
|
+
declare const glossary_2: (store: DataStore, tenantId: string, locale?: string) => Promise<ReadonlyArray<GlossaryEntry>>;
|
|
1849
|
+
|
|
1850
|
+
export declare interface GlossaryEntry {
|
|
1851
|
+
readonly id: string;
|
|
1852
|
+
/** The term as written in the source language. */
|
|
1853
|
+
readonly term: string;
|
|
1854
|
+
/** The target language. */
|
|
1855
|
+
readonly locale: string;
|
|
1856
|
+
/** How it is written there; null: it stays as it is (a brand name). */
|
|
1857
|
+
readonly translation: string | null;
|
|
1858
|
+
/** Translations that must not be used. */
|
|
1859
|
+
readonly forbidden: ReadonlyArray<string>;
|
|
1860
|
+
readonly note: string | null;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
export declare interface GlossaryInput {
|
|
1864
|
+
readonly term: string;
|
|
1865
|
+
readonly locale: string;
|
|
1866
|
+
readonly translation?: string | null;
|
|
1867
|
+
readonly forbidden?: ReadonlyArray<string>;
|
|
1868
|
+
readonly note?: string | null;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/** What is wrong with an entry; empty when nothing is. */
|
|
1872
|
+
export declare const glossaryInputProblems: (input: GlossaryInput) => ReadonlyArray<string>;
|
|
1873
|
+
|
|
1874
|
+
/** The forbidden translations `text` (in the target language) uses, per term. */
|
|
1875
|
+
export declare const glossaryProblems: (text: string, entries: ReadonlyArray<GlossaryEntry>) => ReadonlyArray<{
|
|
1876
|
+
readonly term: string;
|
|
1877
|
+
readonly found: string;
|
|
1878
|
+
readonly use: string | null;
|
|
1879
|
+
}>;
|
|
1880
|
+
|
|
1881
|
+
/** The purposes whose current version the reader allowed. */
|
|
1882
|
+
export declare const grantedPurposes: (purposes: ReadonlyArray<ConsentPurpose>, choices: ConsentChoices) => ReadonlySet<string>;
|
|
1883
|
+
|
|
1884
|
+
/** Effect form of {@link hadAddress}. */
|
|
1885
|
+
export declare const hadAddress: (...args: Parameters<typeof hadAddress_2>) => Effect<boolean, never, never>;
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* Whether `path` was an address of a document of `type` in `scope` — its last
|
|
1889
|
+
* published address, or one a redirect points from — whatever answers it now.
|
|
1890
|
+
* Ask it once `cms.route` found no live page: then the document is no longer
|
|
1891
|
+
* live and the address is gone.
|
|
1892
|
+
*/
|
|
1893
|
+
declare const hadAddress_2: (store: DataStore, type: string, path: string, scope: CmsScope, tenantId?: unknown) => Promise<boolean>;
|
|
1894
|
+
|
|
343
1895
|
/**
|
|
344
1896
|
* Handle one CMS REST request. Returns 401 on a missing/unknown key,
|
|
345
1897
|
* 403 when the key isn't scoped to the requested type, 404 for unknown
|
|
@@ -348,152 +1900,1482 @@ export declare interface FieldViolation {
|
|
|
348
1900
|
*/
|
|
349
1901
|
export declare const handleCmsRest: (req: CmsRestRequest, options: CmsRestOptions) => Promise<CmsRestResponse>;
|
|
350
1902
|
|
|
351
|
-
/**
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
readonly
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
1903
|
+
/** Whether every character of text in `[start, end)` carries `mark` (links never do). */
|
|
1904
|
+
export declare const hasMark: (content: ReadonlyArray<RichInline>, start: number, end: number, mark: RichMark) => boolean;
|
|
1905
|
+
|
|
1906
|
+
/** One thing that needs attention. */
|
|
1907
|
+
export declare interface HealthFinding {
|
|
1908
|
+
readonly kind: 'noOwner' | 'reviewDue' | 'linksToUnpublished' | 'translationMissing' | 'translationOutdated';
|
|
1909
|
+
readonly contentType: string;
|
|
1910
|
+
readonly documentId: string;
|
|
1911
|
+
/** The language it concerns; null when it concerns the whole document. */
|
|
1912
|
+
readonly locale: string | null;
|
|
1913
|
+
/** The document's title in the source language (else any), for a list. */
|
|
1914
|
+
readonly title: string;
|
|
1915
|
+
/** `linksToUnpublished`: the fields holding the links; `translationOutdated`: the source fields changed since. */
|
|
1916
|
+
readonly detail: ReadonlyArray<string>;
|
|
364
1917
|
}
|
|
365
1918
|
|
|
366
|
-
|
|
367
|
-
|
|
1919
|
+
export declare interface HealthOptions {
|
|
1920
|
+
readonly sourceLocale: string;
|
|
1921
|
+
/** Every language the site has, the source included. */
|
|
1922
|
+
readonly locales: ReadonlyArray<string>;
|
|
1923
|
+
readonly now?: Date;
|
|
1924
|
+
}
|
|
368
1925
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
1926
|
+
export declare interface HtmlImportFinding {
|
|
1927
|
+
readonly kind: 'unsupportedTag' | 'externalLink' | 'image';
|
|
1928
|
+
/** The tag, the link's address or the image's source. */
|
|
1929
|
+
readonly detail: string;
|
|
1930
|
+
}
|
|
372
1931
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
*/
|
|
379
|
-
|
|
1932
|
+
export declare interface HtmlImportOptions {
|
|
1933
|
+
/** The document an address points to, or null when it is not one of ours. */
|
|
1934
|
+
readonly resolveLink?: (href: string) => string | null;
|
|
1935
|
+
/** The image asset document an image source became (an import that brought the file in), or null. */
|
|
1936
|
+
readonly resolveImage?: (src: string) => string | null;
|
|
1937
|
+
/** Block ids; defaults to a counter, so a test reads stable ids. */
|
|
1938
|
+
readonly newId?: () => string;
|
|
1939
|
+
}
|
|
380
1940
|
|
|
381
|
-
|
|
382
|
-
|
|
1941
|
+
export declare interface HtmlImportResult {
|
|
1942
|
+
readonly document: RichDocument;
|
|
1943
|
+
readonly findings: ReadonlyArray<HtmlImportFinding>;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/** Effect form of {@link indexForSearch}. */
|
|
1947
|
+
export declare const indexForSearch: (...args: Parameters<typeof indexForSearch_2>) => Effect<void, never, never>;
|
|
1948
|
+
|
|
1949
|
+
/** Write a variant's text for one stage, in the caller's transaction. A type without `search` writes nothing. */
|
|
1950
|
+
declare const indexForSearch_2: (tx: DataStore, type: ContentType, row: Row, scope: CmsScope, stage: "draft" | "published") => Promise<void>;
|
|
1951
|
+
|
|
1952
|
+
/** Where an inherited value came from. */
|
|
1953
|
+
export declare interface Inherited {
|
|
1954
|
+
/** The value; undefined when neither the page nor an ancestor sets it. */
|
|
1955
|
+
readonly value: unknown;
|
|
1956
|
+
/** The document that set it: the page itself, an ancestor, or null for none. */
|
|
1957
|
+
readonly from: string | null;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
/**
|
|
1961
|
+
* The value of an inherited field for `node`: its own when set, else the
|
|
1962
|
+
* nearest ancestor's in `tree` (the same locale's variants the tree was built
|
|
1963
|
+
* from). Pass `{ ancestorsOnly: true }` for what the page would show without
|
|
1964
|
+
* its own value — the "reset to inherited" preview.
|
|
1965
|
+
*/
|
|
1966
|
+
export declare const inheritedValue: (tree: CmsTree, node: TreeNode, field: string, options?: {
|
|
1967
|
+
readonly ancestorsOnly?: boolean;
|
|
1968
|
+
}) => Inherited;
|
|
1969
|
+
|
|
1970
|
+
/** How one inherited field may be set. */
|
|
1971
|
+
export declare interface InheritRule {
|
|
1972
|
+
/** No page may set the field; saving one that does is refused (`locked`). */
|
|
1973
|
+
readonly locked?: boolean;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
/** The minimal DOM a surface is read from (a browser element, or jsdom's). */
|
|
1977
|
+
export declare interface InlineDomNode {
|
|
1978
|
+
readonly nodeType: number;
|
|
1979
|
+
readonly nodeName: string;
|
|
1980
|
+
readonly textContent: string | null;
|
|
1981
|
+
readonly childNodes: ArrayLike<InlineDomNode>;
|
|
1982
|
+
getAttribute?(name: string): string | null;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
/**
|
|
1986
|
+
* Read a surface's DOM back into a run: text, `strong`/`b` as bold, `em`/`i` as
|
|
1987
|
+
* italic, `a[data-target]` as a link to that document, `br` as a line break.
|
|
1988
|
+
* Anything else a browser or a paste put there contributes its text only.
|
|
1989
|
+
*/
|
|
1990
|
+
export declare const inlineFromDom: (root: InlineDomNode) => ReadonlyArray<RichInline>;
|
|
1991
|
+
|
|
1992
|
+
/** A run as the HTML a visual surface shows: `strong`, `em`, `u`, `a[data-target]`, escaped text. */
|
|
1993
|
+
export declare const inlineHtml: (content: ReadonlyArray<RichInline>) => string;
|
|
1994
|
+
|
|
1995
|
+
/** Inline nodes back to the editor's markup (the inverse of `parseInlineMarkup`). */
|
|
1996
|
+
export declare const inlineMarkupOf: (content: ReadonlyArray<RichInline>) => string;
|
|
1997
|
+
|
|
1998
|
+
/** The plain text of a run. */
|
|
1999
|
+
export declare const inlineText: (content: ReadonlyArray<RichInline>) => string;
|
|
2000
|
+
|
|
2001
|
+
/** An installed extension as the editor shows it. */
|
|
2002
|
+
export declare interface InstalledExtension {
|
|
2003
|
+
readonly extensionId: string;
|
|
2004
|
+
/** The version running now. */
|
|
2005
|
+
readonly manifest: CmsExtensionManifest;
|
|
2006
|
+
readonly granted: ReadonlyArray<ExtensionCapability>;
|
|
2007
|
+
/** A newer version waiting for consent, and what it would add. */
|
|
2008
|
+
readonly pending: {
|
|
2009
|
+
readonly manifest: CmsExtensionManifest;
|
|
2010
|
+
readonly adds: ReadonlyArray<ExtensionCapability>;
|
|
2011
|
+
} | null;
|
|
2012
|
+
/** The version a rollback returns to, or null. */
|
|
2013
|
+
readonly previous: CmsExtensionManifest | null;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
/** Effect form of {@link installedExtension}. */
|
|
2017
|
+
export declare const installedExtension: (...args: Parameters<typeof installedExtension_2>) => Effect<InstalledExtension | null, never, never>;
|
|
2018
|
+
|
|
2019
|
+
/** One installed extension, or null. */
|
|
2020
|
+
declare const installedExtension_2: (store: DataStore, extensionId: string) => Promise<InstalledExtension | null>;
|
|
2021
|
+
|
|
2022
|
+
/** Effect form of {@link installedExtensions}. */
|
|
2023
|
+
export declare const installedExtensions: (...args: Parameters<typeof installedExtensions_2>) => Effect<readonly InstalledExtension[], never, never>;
|
|
2024
|
+
|
|
2025
|
+
/** Every installed extension, by id. */
|
|
2026
|
+
declare const installedExtensions_2: (store: DataStore) => Promise<ReadonlyArray<InstalledExtension>>;
|
|
2027
|
+
|
|
2028
|
+
/** Effect form of {@link installExtension}. */
|
|
2029
|
+
export declare const installExtension: (...args: Parameters<typeof installExtension_2>) => Effect<ExtensionChange, never, never>;
|
|
2030
|
+
|
|
2031
|
+
/** Install `manifest`, granting it `consent` — which must cover every capability it asks for. */
|
|
2032
|
+
declare const installExtension_2: (tx: DataStore, manifest: CmsExtensionManifest, consent: ReadonlyArray<ExtensionCapability>) => Promise<ExtensionChange>;
|
|
2033
|
+
|
|
2034
|
+
/** Effect form of {@link invitedRole}. */
|
|
2035
|
+
export declare const invitedRole: (...args: Parameters<typeof invitedRole_2>) => Effect<string | null, never, never>;
|
|
2036
|
+
|
|
2037
|
+
/** The role `email` was invited with, or null. */
|
|
2038
|
+
declare const invitedRole_2: (store: DataStore, tenantId: string, email: string) => Promise<string | null>;
|
|
2039
|
+
|
|
2040
|
+
/** Effect form of {@link inviteToTeam}. */
|
|
2041
|
+
export declare const inviteToTeam: (...args: Parameters<typeof inviteToTeam_2>) => Effect<"present" | "changed" | "invited", never, never>;
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
* Invite `email` with `role`, in the caller's transaction: `invited` for a new
|
|
2045
|
+
* address, `changed` when it was invited with another role, `present` when
|
|
2046
|
+
* nothing changed. Check it with `teamProblems({ members: [{ email, role }] })` first.
|
|
2047
|
+
*/
|
|
2048
|
+
declare const inviteToTeam_2: (tx: DataStore, tenantId: string, email: string, role: string) => Promise<"invited" | "changed" | "present">;
|
|
2049
|
+
|
|
2050
|
+
/** Whether `value` is a capability an extension can ask for. */
|
|
2051
|
+
export declare const isExtensionCapability: (value: string) => value is ExtensionCapability;
|
|
2052
|
+
|
|
2053
|
+
/** Whether `zone` is an IANA zone this runtime knows. */
|
|
2054
|
+
export declare const isKnownZone: (zone: string) => boolean;
|
|
2055
|
+
|
|
2056
|
+
/** Accept-Language → languages in order of preference (quality factors honoured). */
|
|
2057
|
+
export declare const languagesOf: (acceptLanguage: string | undefined) => ReadonlyArray<string>;
|
|
2058
|
+
|
|
2059
|
+
/** How often a type's documents are checked again, declared on the type. */
|
|
2060
|
+
export declare interface LifecycleConfig {
|
|
2061
|
+
/** Days from a publish or a recertification to the next review. */
|
|
2062
|
+
readonly reviewEveryDays: number;
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
* List-view configuration for the consuming editor/template: which
|
|
2067
|
+
* columns its list page shows and the default sort. Validated by
|
|
2068
|
+
* `defineContentType` — every referenced name must be a declared field
|
|
2069
|
+
* or a lifecycle column, so a typo fails at definition time instead of
|
|
2070
|
+
* rendering an empty column.
|
|
2071
|
+
*/
|
|
2072
|
+
export declare interface ListConfig {
|
|
2073
|
+
readonly columns: ReadonlyArray<string>;
|
|
2074
|
+
readonly defaultSort?: {
|
|
2075
|
+
readonly field: string;
|
|
2076
|
+
readonly dir: 'asc' | 'desc';
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
/** Effect form of {@link listExperiments}. */
|
|
2081
|
+
export declare const listExperiments: (...args: Parameters<typeof listExperiments_2>) => Effect<readonly Experiment[], never, never>;
|
|
2082
|
+
|
|
2083
|
+
/** Every experiment of the caller's tenant, newest first. */
|
|
2084
|
+
declare const listExperiments_2: (store: DataStore) => Promise<ReadonlyArray<Experiment>>;
|
|
2085
|
+
|
|
2086
|
+
/** Whether a (nested) list is numbered. */
|
|
2087
|
+
export declare type ListKind = 'ordered' | 'unordered';
|
|
2088
|
+
|
|
2089
|
+
/** Whether the list's items at `depth` (0: the top) are numbered. */
|
|
2090
|
+
export declare const listNumberedAt: (block: {
|
|
2091
|
+
readonly ordered: boolean;
|
|
2092
|
+
readonly sublists?: ReadonlyArray<ListKind>;
|
|
2093
|
+
}, depth: number) => boolean;
|
|
2094
|
+
|
|
2095
|
+
/** Effect form of {@link listPreviewShares}. */
|
|
2096
|
+
export declare const listPreviewShares: (...args: Parameters<typeof listPreviewShares_2>) => Effect<readonly Readonly<Record<string, unknown>>[], ContentNotFound | PreviewShareRejected, never>;
|
|
2097
|
+
|
|
2098
|
+
/** The caller's shares of one document (every variant), newest first. */
|
|
2099
|
+
declare const listPreviewShares_2: (store: DataStore, type: ContentType, documentId: string) => Promise<ReadonlyArray<Row>>;
|
|
2100
|
+
|
|
2101
|
+
/** Effect form of {@link listRedirects}. */
|
|
2102
|
+
export declare const listRedirects: (...args: Parameters<typeof listRedirects_2>) => Effect<readonly Readonly<Record<string, unknown>>[], never, never>;
|
|
2103
|
+
|
|
2104
|
+
/** Every redirect in `scope`, for inspection. */
|
|
2105
|
+
declare const listRedirects_2: (store: DataStore, type: string, scope: CmsScope) => Promise<ReadonlyArray<Row>>;
|
|
2106
|
+
|
|
2107
|
+
/** Effect form of {@link listReleaseItems}. */
|
|
2108
|
+
export declare const listReleaseItems: (...args: Parameters<typeof listReleaseItems_2>) => Effect<readonly Readonly<Record<string, unknown>>[], never, never>;
|
|
2109
|
+
|
|
2110
|
+
/** A release's entries in the order they apply. */
|
|
2111
|
+
declare const listReleaseItems_2: (store: DataStore, releaseId: string) => Promise<ReadonlyArray<Row>>;
|
|
2112
|
+
|
|
2113
|
+
/** Effect form of {@link listReleases}. */
|
|
2114
|
+
export declare const listReleases: (...args: Parameters<typeof listReleases_2>) => Effect<readonly Readonly<Record<string, unknown>>[], never, never>;
|
|
2115
|
+
|
|
2116
|
+
/** The releases of one site and environment, newest first. */
|
|
2117
|
+
declare const listReleases_2: (store: DataStore, where: {
|
|
2118
|
+
readonly site: string;
|
|
2119
|
+
readonly environment: string;
|
|
2120
|
+
}) => Promise<ReadonlyArray<Row>>;
|
|
2121
|
+
|
|
2122
|
+
/** Effect form of {@link listRevisions}. */
|
|
2123
|
+
export declare const listRevisions: (...args: Parameters<typeof listRevisions_2>) => Effect_2.Effect<readonly Readonly<Record<string, unknown>>[], never, never>;
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Every saved revision of one document's variant in `scope`, newest first.
|
|
2127
|
+
* Revisions are immutable: a later save or a restore appends, it never
|
|
2128
|
+
* rewrites.
|
|
2129
|
+
*/
|
|
2130
|
+
declare const listRevisions_2: (store: DataStore, type: ContentType, documentId: string, scope: CmsScope) => Promise<ReadonlyArray<Row>>;
|
|
2131
|
+
|
|
2132
|
+
/** The texts a save materializes: those belonging to the draft's current revision. */
|
|
2133
|
+
export declare interface LiveDraftTexts {
|
|
2134
|
+
/** Field → the merged text. */
|
|
2135
|
+
readonly values: ReadonlyMap<string, string>;
|
|
2136
|
+
readonly rows: ReadonlyArray<Row>;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
/** Effect form of {@link liveDraftTexts}. */
|
|
2140
|
+
export declare const liveDraftTexts: (...args: Parameters<typeof liveDraftTexts_2>) => Effect<LiveDraftTexts, ContentNotFound, never>;
|
|
2141
|
+
|
|
2142
|
+
declare const liveDraftTexts_2: (store: DataStore, draft: Row) => Promise<LiveDraftTexts>;
|
|
2143
|
+
|
|
2144
|
+
/** One language's published page tree. */
|
|
2145
|
+
export declare interface LocalizedTree {
|
|
2146
|
+
readonly locale: string;
|
|
2147
|
+
readonly tree: CmsTree;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
/** What is wrong with a manifest; empty when nothing is. */
|
|
2151
|
+
export declare const manifestProblems: (manifest: CmsExtensionManifest) => ReadonlyArray<string>;
|
|
2152
|
+
|
|
2153
|
+
/** Whether the request's signals meet the rule. */
|
|
2154
|
+
export declare const matchesAudience: (rule: AudienceRule, signals: AudienceSignals) => boolean;
|
|
2155
|
+
|
|
2156
|
+
/** How a returned file's units line up with the source's: translated, left as source, unknown, and missing. */
|
|
2157
|
+
export declare const matchUnits: (source: ReadonlyArray<TranslationUnit>, returned: ReadonlyArray<TranslationUnit>) => {
|
|
2158
|
+
readonly translated: number;
|
|
2159
|
+
readonly untranslated: number;
|
|
2160
|
+
readonly unknown: ReadonlyArray<string>;
|
|
2161
|
+
readonly missing: ReadonlyArray<string>;
|
|
2162
|
+
};
|
|
2163
|
+
|
|
2164
|
+
/** The longest an exception may run. */
|
|
2165
|
+
export declare const MAX_EXCEPTION_DAYS = 90;
|
|
2166
|
+
|
|
2167
|
+
/** The deepest a list item may sit (0 is the top). */
|
|
2168
|
+
export declare const MAX_LIST_LEVEL = 3;
|
|
2169
|
+
|
|
2170
|
+
export declare const MAX_OCCURRENCES = 100;
|
|
2171
|
+
|
|
2172
|
+
/** The longest a preview link may live. */
|
|
2173
|
+
export declare const MAX_PREVIEW_SHARE_DAYS = 30;
|
|
2174
|
+
|
|
2175
|
+
/** Cap a string field's length. Past `value` the editor renders a textarea. */
|
|
2176
|
+
export declare const maxLength: (value: number) => FieldRefinement;
|
|
2177
|
+
|
|
2178
|
+
/** The media field names on a content type (top level) — handy for a
|
|
2179
|
+
* consumer that wants to know whether resolution is even needed. */
|
|
2180
|
+
export declare const mediaFields: (type: Pick<ContentType, "fields">) => ReadonlyArray<string>;
|
|
2181
|
+
|
|
2182
|
+
/**
|
|
2183
|
+
* Resolve a stored media KEY to a served URL. The app builds this from its
|
|
2184
|
+
* storage layer, e.g. `(key) => Effect.runPromise(storage.getUrl(key, { tenantId }))`
|
|
2185
|
+
* or, for an access-checked URL, `(key) => Effect.runPromise(storage.mintUrl(key, subject))`.
|
|
2186
|
+
* Returning `null` leaves the field as its stored key (unresolved).
|
|
2187
|
+
*/
|
|
2188
|
+
export declare type MediaResolver = (key: string) => Promise<string | null>;
|
|
2189
|
+
|
|
2190
|
+
/** Adjacent text runs with the same marks become one; empty text runs go. */
|
|
2191
|
+
export declare const mergeInline: (content: ReadonlyArray<RichInline>) => ReadonlyArray<RichInline>;
|
|
2192
|
+
|
|
2193
|
+
/** Readers per version before a result is called at all. */
|
|
2194
|
+
export declare const MIN_READERS = 100;
|
|
2195
|
+
|
|
2196
|
+
/** Where this calendar month (UTC) began. */
|
|
2197
|
+
export declare const monthStart: (now?: Date) => Date;
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* The fields a draft typed in together may have moved on in without anyone
|
|
2201
|
+
* losing an edit: the texts in `shared`, and every field derived from one of
|
|
2202
|
+
* them (a slug from its title).
|
|
2203
|
+
*/
|
|
2204
|
+
export declare const movedTogether: (type: ContentType, shared: ReadonlySet<string>) => ReadonlySet<string>;
|
|
2205
|
+
|
|
2206
|
+
/** `list` with the entry at `from` moved to `to` (clamped); the same list when nothing moves. */
|
|
2207
|
+
export declare const moveEntry: <T>(list: ReadonlyArray<T>, from: number, to: number) => ReadonlyArray<T>;
|
|
2208
|
+
|
|
2209
|
+
/** A fresh block id. */
|
|
2210
|
+
export declare const newBlockId: () => string;
|
|
2211
|
+
|
|
2212
|
+
/** The capabilities `requested` asks for beyond `granted` — what needs a new consent. */
|
|
2213
|
+
export declare const newCapabilities: (granted: ReadonlyArray<ExtensionCapability>, requested: ReadonlyArray<ExtensionCapability>) => ReadonlyArray<ExtensionCapability>;
|
|
2214
|
+
|
|
2215
|
+
/** A nonce for one editing session (unguessable; 128 bits). */
|
|
2216
|
+
export declare const newVisualNonce: () => string;
|
|
2217
|
+
|
|
2218
|
+
/**
|
|
2219
|
+
* The canonical form of a stored value: a plain string becomes paragraphs (a
|
|
2220
|
+
* blank line starts a new one), a document keeps its blocks and gets an id on
|
|
2221
|
+
* every block that lacks one, anything else is returned as is for the
|
|
2222
|
+
* validator to reject.
|
|
2223
|
+
*/
|
|
2224
|
+
export declare const normalizeRichDocument: (value: unknown) => unknown;
|
|
2225
|
+
|
|
2226
|
+
/** The vocabulary's terms for `input`, in first-seen order, and what it does not know. */
|
|
2227
|
+
export declare const normalizeTerms: (config: Pick<TaxonomyConfig, "terms">, input: ReadonlyArray<unknown>) => {
|
|
2228
|
+
readonly terms: ReadonlyArray<string>;
|
|
2229
|
+
readonly unknown: ReadonlyArray<string>;
|
|
2230
|
+
};
|
|
2231
|
+
|
|
2232
|
+
export declare interface Occurrence {
|
|
2233
|
+
/** Its position in the series, from 0 (counting excepted ones). */
|
|
2234
|
+
readonly index: number;
|
|
2235
|
+
/** The local wall time it was meant for. */
|
|
2236
|
+
readonly local: string;
|
|
2237
|
+
readonly startsAt: Date;
|
|
2238
|
+
readonly endsAt: Date;
|
|
2239
|
+
/** `gap`: the wall time did not exist, moved after it; `fold`: it existed twice, the first; `clamped`: the month had no such day. */
|
|
2240
|
+
readonly adjusted?: 'gap' | 'fold' | 'clamped';
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
/** The occurrences of a rule, in order; throws `RangeError` for a rule with problems. */
|
|
2244
|
+
export declare const occurrencesOf: (rule: RecurrenceRule) => ReadonlyArray<Occurrence>;
|
|
2245
|
+
|
|
2246
|
+
/** Effect form of {@link openDraftTexts}. */
|
|
2247
|
+
export declare const openDraftTexts: (...args: Parameters<typeof openDraftTexts_2>) => Effect<readonly Readonly<Record<string, unknown>>[], ContentNotFound, never>;
|
|
2248
|
+
|
|
2249
|
+
/**
|
|
2250
|
+
* Start typing together in a draft: every collaborative field gets a text
|
|
2251
|
+
* that belongs to the draft's current revision — kept where there is one,
|
|
2252
|
+
* started from the draft's value where there is none or where the draft moved
|
|
2253
|
+
* on without it. Idempotent; two editors opening at once end with one text per
|
|
2254
|
+
* field. `ContentNotFound` for a draft the caller cannot see. In the caller's
|
|
2255
|
+
* transaction.
|
|
2256
|
+
*/
|
|
2257
|
+
declare const openDraftTexts_2: (tx: DataStore, type: ContentType, draftId: string) => Promise<ReadonlyArray<Row>>;
|
|
2258
|
+
|
|
2259
|
+
/** Where a document lives in one language. */
|
|
2260
|
+
export declare interface PageAlternate {
|
|
2261
|
+
readonly locale: string;
|
|
2262
|
+
readonly path: string;
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
/** One template a content type offers. */
|
|
2266
|
+
export declare interface PageTemplate {
|
|
2267
|
+
/** Stable id, stored on the document. */
|
|
2268
|
+
readonly id: string;
|
|
2269
|
+
readonly displayName: string;
|
|
2270
|
+
/** Field values a new document starts with (e.g. a layout). */
|
|
2271
|
+
readonly values?: Readonly<Record<string, unknown>>;
|
|
2272
|
+
/** The components a new document starts with, in order. */
|
|
2273
|
+
readonly sections?: ReadonlyArray<{
|
|
2274
|
+
readonly component: ComponentDefinition;
|
|
2275
|
+
readonly props?: Readonly<Record<string, unknown>>;
|
|
2276
|
+
}>;
|
|
2277
|
+
/** Components the document must always hold at least once. */
|
|
2278
|
+
readonly required?: ReadonlyArray<ComponentDefinition>;
|
|
2279
|
+
/** The component that must come first. */
|
|
2280
|
+
readonly first?: ComponentDefinition;
|
|
2281
|
+
/** The most of one component the document may hold. */
|
|
2282
|
+
readonly max?: ReadonlyArray<{
|
|
2283
|
+
readonly component: ComponentDefinition;
|
|
2284
|
+
readonly count: number;
|
|
2285
|
+
}>;
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
/** Parse the editor's inline markup into inline nodes. Unclosed markers stay text. */
|
|
2289
|
+
export declare const parseInlineMarkup: (input: string) => ReadonlyArray<RichInline>;
|
|
2290
|
+
|
|
2291
|
+
/** `sections.2` → `{ field: 'sections', index: 2 }`; `title` → `{ field: 'title' }`. */
|
|
2292
|
+
export declare const parseSourcePath: (path: string) => {
|
|
2293
|
+
readonly field: string;
|
|
2294
|
+
readonly index?: number;
|
|
2295
|
+
};
|
|
2296
|
+
|
|
2297
|
+
/** Read an XLIFF 2.x file with one `<file>`: languages, notes and each unit's source and target. */
|
|
2298
|
+
export declare const parseXliff: (xml: string) => XliffExchange;
|
|
2299
|
+
|
|
2300
|
+
/** Constrain a string field to a regex (source form, validated on save). */
|
|
2301
|
+
export declare const pattern: (re: RegExp) => FieldRefinement;
|
|
2302
|
+
|
|
2303
|
+
/** The first variant whose audience matches, or null for the original. Variants naming an unknown audience never match. */
|
|
2304
|
+
export declare const pickVariant: <V extends {
|
|
2305
|
+
readonly audience: string;
|
|
2306
|
+
}>(variants: ReadonlyArray<V>, audiences: ReadonlyArray<Audience>, signals: AudienceSignals) => V | null;
|
|
2307
|
+
|
|
2308
|
+
export declare interface PipeableField extends FieldSchema {
|
|
2309
|
+
readonly isOptional: boolean;
|
|
2310
|
+
pipe(...refinements: ReadonlyArray<FieldRefinement>): PipeableField;
|
|
2311
|
+
/** Mark the field optional → nullable column + non-required editor input. */
|
|
2312
|
+
optional(): PipeableField;
|
|
2313
|
+
/**
|
|
2314
|
+
* Let a draft be saved without it, and refuse to publish until it is set —
|
|
2315
|
+
* an image uploaded in bulk before anyone wrote its alt text. The column is
|
|
2316
|
+
* nullable, like `optional()`.
|
|
2317
|
+
*/
|
|
2318
|
+
requiredToPublish(): PipeableField;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
declare type Place = Pick<CmsScope, 'site' | 'environment'>;
|
|
2322
|
+
|
|
2323
|
+
declare type Place_2 = Pick<CmsScope, 'site' | 'environment'>;
|
|
2324
|
+
|
|
2325
|
+
/** The document's text, one line per block — for excerpts and search. */
|
|
2326
|
+
export declare const plainTextOf: (doc: RichDocument) => string;
|
|
2327
|
+
|
|
2328
|
+
/** Effect form of {@link planBlueprint}. */
|
|
2329
|
+
export declare const planBlueprint: (...args: Parameters<typeof planBlueprint_2>) => Effect<BlueprintPlan, ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch | ReviewRequired | ReferenceUnavailable | BlueprintInvalid, never>;
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* What provisioning `blueprint` into `target` would do, step by step: which
|
|
2333
|
+
* documents the workspace has already and which would be created (and
|
|
2334
|
+
* whether published). Reads only. Throws `BlueprintInvalid` when an entry
|
|
2335
|
+
* names a type, field or template the app does not have.
|
|
2336
|
+
*/
|
|
2337
|
+
declare const planBlueprint_2: (store: DataStore, types: ReadonlyArray<ContentType>, blueprint: Blueprint, target: BlueprintTarget) => Promise<BlueprintPlan>;
|
|
2338
|
+
|
|
2339
|
+
/** Effect form of {@link planBlueprintTeam}. */
|
|
2340
|
+
export declare const planBlueprintTeam: (...args: Parameters<typeof planBlueprintTeam_2>) => Effect<TeamPlan, never, never>;
|
|
2341
|
+
|
|
2342
|
+
/** What provisioning the team would do. Reads only. */
|
|
2343
|
+
declare const planBlueprintTeam_2: (store: DataStore, tenantId: string, team: BlueprintTeam) => Promise<TeamPlan>;
|
|
2344
|
+
|
|
2345
|
+
/** Effect form of {@link planBulk}. */
|
|
2346
|
+
export declare const planBulk: (...args: Parameters<typeof planBulk_2>) => Effect<readonly PlannedItem[], ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch | ReviewRequired | ReferenceUnavailable, never>;
|
|
2347
|
+
|
|
2348
|
+
/** The dry run: what `action` would do to each item, changing nothing. */
|
|
2349
|
+
declare const planBulk_2: (store: DataStore, types: ReadonlyArray<ContentType>, place: Place, action: BulkAction, items: ReadonlyArray<BulkItem>) => Promise<ReadonlyArray<PlannedItem>>;
|
|
2350
|
+
|
|
2351
|
+
export declare interface PlannedItem extends BulkItem {
|
|
2352
|
+
readonly documentId: string | null;
|
|
2353
|
+
readonly title: string;
|
|
2354
|
+
/** For a publish: the revision the dry run saw, which the run publishes. */
|
|
2355
|
+
readonly revisionId: string | null;
|
|
2356
|
+
readonly disposition: 'ready' | 'unchanged' | 'blocked';
|
|
2357
|
+
readonly reason: BlockReason | null;
|
|
2358
|
+
/** For `referenceUnavailable`: the fields and why (`sections[0].props.image: blocked`); for
|
|
2359
|
+
* `incomplete`: the empty fields publishing needs. */
|
|
2360
|
+
readonly detail: ReadonlyArray<string>;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
/** Effect form of {@link planPromotion}. */
|
|
2364
|
+
export declare const planPromotion: (...args: Parameters<typeof planPromotion_2>) => Effect<readonly PromotionItem[], ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch | ReleaseNotEditable | ReviewRequired | ReferenceUnavailable, never>;
|
|
2365
|
+
|
|
2366
|
+
/** What promoting `from` into `to` would change, per document and language. */
|
|
2367
|
+
declare const planPromotion_2: (store: DataStore, types: ReadonlyArray<ContentType>, pair: EnvironmentPair) => Promise<ReadonlyArray<PromotionItem>>;
|
|
2368
|
+
|
|
2369
|
+
/** A verified preview claim. */
|
|
2370
|
+
export declare interface PreviewClaim {
|
|
2371
|
+
readonly type: string;
|
|
2372
|
+
readonly id: string;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
/** What the preview sends the editor. `path` is a field (`title`) or a component (`sections.2`). */
|
|
2376
|
+
export declare type PreviewMessage = {
|
|
2377
|
+
readonly protocol: typeof VISUAL_EDITING_PROTOCOL;
|
|
2378
|
+
readonly nonce: string;
|
|
2379
|
+
readonly kind: 'ready';
|
|
2380
|
+
} | {
|
|
2381
|
+
readonly protocol: typeof VISUAL_EDITING_PROTOCOL;
|
|
2382
|
+
readonly nonce: string;
|
|
2383
|
+
readonly kind: 'select';
|
|
2384
|
+
readonly path: string;
|
|
2385
|
+
} | {
|
|
2386
|
+
readonly protocol: typeof VISUAL_EDITING_PROTOCOL;
|
|
2387
|
+
readonly nonce: string;
|
|
2388
|
+
readonly kind: 'move';
|
|
2389
|
+
readonly path: string;
|
|
2390
|
+
readonly to: number;
|
|
2391
|
+
};
|
|
2392
|
+
|
|
2393
|
+
/**
|
|
2394
|
+
* Raised by `createPreviewShare` when the requested expiry is not in the
|
|
2395
|
+
* future or lies beyond the longest a preview link may live.
|
|
2396
|
+
*/
|
|
2397
|
+
export declare class PreviewShareRejected extends PreviewShareRejected_base {
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
declare const PreviewShareRejected_base: Schema_2.TaggedErrorClass<PreviewShareRejected, "PreviewShareRejected", {
|
|
2401
|
+
readonly _tag: Schema_2.tag<"PreviewShareRejected">;
|
|
2402
|
+
} & {
|
|
2403
|
+
reason: Schema_2.Literal<["expiryInPast", "expiryTooFar"]>;
|
|
2404
|
+
}>;
|
|
2405
|
+
|
|
2406
|
+
/** Mint a signed preview token for a draft row. */
|
|
2407
|
+
export declare const previewToken: (type: string, id: string, options?: {
|
|
2408
|
+
ttlSeconds?: number;
|
|
2409
|
+
secret?: string;
|
|
2410
|
+
}) => string;
|
|
2411
|
+
|
|
2412
|
+
/** Effect form of {@link promote}. */
|
|
2413
|
+
export declare const promote: (...args: Parameters<typeof promote_2>) => Effect<PromotionResult, ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch | ReleaseNotEditable | ReviewRequired | ReferenceUnavailable, never>;
|
|
2414
|
+
|
|
2415
|
+
/**
|
|
2416
|
+
* Promote the chosen documents from `pair.from` into `pair.to` as one release
|
|
2417
|
+
* named `name`. Refuses (writing nothing) when an item is blocked, or not in
|
|
2418
|
+
* the plan (not live in `from`, or live there unchanged); a failing check inside the release (review, availability,
|
|
2419
|
+
* required fields) throws like any release publish — run it in a transaction.
|
|
2420
|
+
*/
|
|
2421
|
+
declare const promote_2: (tx: DataStore, types: ReadonlyArray<ContentType>, pair: EnvironmentPair, selections: ReadonlyArray<PromotionSelection>, options: {
|
|
2422
|
+
readonly name: string;
|
|
2423
|
+
}) => Promise<PromotionResult>;
|
|
2424
|
+
|
|
2425
|
+
export declare interface PromotionItem {
|
|
2426
|
+
readonly contentType: string;
|
|
2427
|
+
readonly documentId: string;
|
|
2428
|
+
readonly locale: string;
|
|
2429
|
+
readonly title: string;
|
|
2430
|
+
readonly change: 'new' | 'changed' | 'blocked';
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
export declare type PromotionResult = {
|
|
2434
|
+
readonly ok: true;
|
|
2435
|
+
readonly releaseId: string;
|
|
2436
|
+
readonly promoted: number;
|
|
2437
|
+
} | {
|
|
2438
|
+
readonly ok: false;
|
|
2439
|
+
readonly reason: 'nothingSelected' | 'blocked' | 'notInPlan';
|
|
2440
|
+
readonly items: ReadonlyArray<PromotionSelection>;
|
|
2441
|
+
};
|
|
2442
|
+
|
|
2443
|
+
export declare interface PromotionSelection {
|
|
2444
|
+
readonly contentType: string;
|
|
2445
|
+
readonly documentId: string;
|
|
2446
|
+
readonly locale: string;
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
/** The hash an operation keeps of its prompt: enough to tell two prompts apart, nothing to read back. */
|
|
2450
|
+
export declare const promptHash: (prompt: string) => string;
|
|
2451
|
+
|
|
2452
|
+
/** Effect-native `publish` (see {@link saveDraftEffect}). */
|
|
2453
|
+
export declare const publish: (store: DataStore, type: ContentType, id: string, scope: CmsScope, options?: PublishOptions) => Effect_2.Effect<Row, ContentNotFound | RevisionMismatch | ReviewRequired | ReferenceUnavailable | ContentValidationFailed>;
|
|
2454
|
+
|
|
2455
|
+
/** Effect form of {@link publishDue}. */
|
|
2456
|
+
export declare const publishDue: (...args: Parameters<typeof publishDue_2>) => Effect<readonly string[], never, never>;
|
|
2457
|
+
|
|
2458
|
+
/**
|
|
2459
|
+
* Publish every draft of `type` whose scheduled `publishAt` has passed
|
|
2460
|
+
* (and that is still a draft). Returns the ids that were published. A
|
|
2461
|
+
* driver calls this on an interval from a `*.cron.tsx` schedule (see the
|
|
2462
|
+
* README/docs recipe) — it is idempotent: `publish` flips the draft
|
|
2463
|
+
* `status` to `'published'`, so a row is never double-published, and
|
|
2464
|
+
* `publishAt` is cleared so a later re-save doesn't spuriously re-fire.
|
|
2465
|
+
*
|
|
2466
|
+
* Runs over the store it is handed: a request-scoped store publishes one
|
|
2467
|
+
* tenant's due drafts; a background/root store sweeps every tenant. It opens
|
|
2468
|
+
* one transaction per row, so hand it a store that is NOT already inside a
|
|
2469
|
+
* transaction (a schedule's `app.store`, not a mutation's `ctx.store`).
|
|
2470
|
+
*/
|
|
2471
|
+
declare const publishDue_2: (store: DataStore, type: ContentType, now?: Date) => Promise<ReadonlyArray<string>>;
|
|
2472
|
+
|
|
2473
|
+
/** Effect form of {@link publishDueReleases} — a failing release is marked `failed`, never an error. */
|
|
2474
|
+
export declare const publishDueReleases: (...args: Parameters<typeof publishDueReleases_2>) => Effect<readonly string[], never, never>;
|
|
2475
|
+
|
|
2476
|
+
/**
|
|
2477
|
+
* Take every scheduled release that is due live, each in its own transaction.
|
|
2478
|
+
* A release is CLAIMED by a conditional update (`scheduled` → a fresh fencing
|
|
2479
|
+
* token) inside that transaction, so a second scheduler run — another replica,
|
|
2480
|
+
* a retry — finds nothing to take. A release that fails is marked `failed`
|
|
2481
|
+
* with the reason and its pinned content stays as it was. Returns the ids
|
|
2482
|
+
* that went live. Hand it a store outside any transaction (a schedule's
|
|
2483
|
+
* `app.store`).
|
|
2484
|
+
*/
|
|
2485
|
+
declare const publishDueReleases_2: (store: DataStore, types: ReadonlyArray<ContentType>, now?: Date) => Promise<ReadonlyArray<string>>;
|
|
2486
|
+
|
|
2487
|
+
/** Options for {@link publish}. */
|
|
2488
|
+
export declare interface PublishOptions {
|
|
2489
|
+
/** Publish only if the draft still points at THIS revision — the one the
|
|
2490
|
+
* editor reviewed. A newer save in between throws `RevisionMismatch`
|
|
2491
|
+
* instead of publishing content nobody looked at. */
|
|
2492
|
+
readonly revisionId?: string;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/** Effect form of {@link publishRelease}. */
|
|
2496
|
+
export declare const publishRelease: (...args: Parameters<typeof publishRelease_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound | ReleaseNotEditable | ReviewRequired | ReferenceUnavailable, never>;
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* Publish every entry of a release — in the CALLER'S transaction, so either
|
|
2500
|
+
* all of them go live or, when one fails, none does. Records what each variant
|
|
2501
|
+
* showed before (for rollback) and marks the release `published`. Throws
|
|
2502
|
+
* `ReleaseNotEditable` for a release that is already published or failed.
|
|
2503
|
+
*/
|
|
2504
|
+
declare const publishRelease_2: (tx: DataStore, types: ReadonlyArray<ContentType>, releaseId: string, now?: Date) => Promise<Row>;
|
|
2505
|
+
|
|
2506
|
+
/** Effect-native `publishRevision` (see {@link saveDraftEffect}). */
|
|
2507
|
+
export declare const publishRevision: (tx: DataStore, type: ContentType, id: string, scope: CmsScope, revisionId: string, origin?: ChangeOrigin) => Effect_2.Effect<Row, ContentNotFound | RevisionMismatch | ReviewRequired | ReferenceUnavailable | ContentValidationFailed>;
|
|
2508
|
+
|
|
2509
|
+
/** A series as the editor shows it. */
|
|
2510
|
+
export declare interface PublishSeries {
|
|
2511
|
+
readonly id: string;
|
|
2512
|
+
readonly rule: RecurrenceRule;
|
|
2513
|
+
readonly occurrences: ReadonlyArray<Occurrence>;
|
|
2514
|
+
/** The index (into `occurrences`) armed on the draft now, or -1. */
|
|
2515
|
+
readonly armed: number;
|
|
2516
|
+
readonly state: 'running' | 'done';
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* What stops these values from being published: every `requiredToPublish()`
|
|
2521
|
+
* field that is empty (absent, null, or a blank string). Browser-safe, so an
|
|
2522
|
+
* editor can say so before the publish is refused.
|
|
2523
|
+
*/
|
|
2524
|
+
export declare const publishViolations: (type: Pick<ContentType, "fields">, values: Readonly<Record<string, unknown>>) => ReadonlyArray<FieldViolation>;
|
|
2525
|
+
|
|
2526
|
+
/** The purposes the components of `type` need, for a banner to ask about. */
|
|
2527
|
+
export declare const purposesUsedBy: (type: {
|
|
2528
|
+
readonly fields: Readonly<Record<string, FieldSchema>>;
|
|
2529
|
+
}) => ReadonlySet<string>;
|
|
2530
|
+
|
|
2531
|
+
export declare interface QualityException {
|
|
2532
|
+
readonly id: string;
|
|
2533
|
+
readonly ruleId: string;
|
|
2534
|
+
readonly reason: string;
|
|
2535
|
+
readonly state: ExceptionState;
|
|
2536
|
+
readonly requestedBy: string;
|
|
2537
|
+
readonly requestedAt: Date;
|
|
2538
|
+
readonly decidedBy: string | null;
|
|
2539
|
+
readonly note: string | null;
|
|
2540
|
+
readonly expiresAt: Date;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
/** Effect form of {@link qualityExceptions}. */
|
|
2544
|
+
export declare const qualityExceptions: (...args: Parameters<typeof qualityExceptions_2>) => Effect<readonly QualityException[], never, never>;
|
|
2545
|
+
|
|
2546
|
+
/** Every exception asked for on a variant, newest first, with its state today. */
|
|
2547
|
+
declare const qualityExceptions_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope, now?: Date) => Promise<ReadonlyArray<QualityException>>;
|
|
2548
|
+
|
|
2549
|
+
export declare interface QualityFinding {
|
|
2550
|
+
readonly ruleId: string;
|
|
2551
|
+
readonly field: string;
|
|
2552
|
+
readonly message: string;
|
|
2553
|
+
readonly blocking: boolean;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
/** What a type's rules find in these values — pure, for the editor as for the gate. */
|
|
2557
|
+
export declare const qualityFindings: (type: Pick<ContentType, "quality">, values: Readonly<Record<string, unknown>>) => ReadonlyArray<QualityFinding>;
|
|
2558
|
+
|
|
2559
|
+
/** One quality check of a type — see `ContentTypeSpec.quality`. */
|
|
2560
|
+
export declare interface QualityRule {
|
|
2561
|
+
/** Stable id (letters, digits, `.`, `-`), unique in the type — exceptions name it. */
|
|
2562
|
+
readonly id: string;
|
|
2563
|
+
/** The field that causes the finding and where it is repaired. */
|
|
2564
|
+
readonly field: string;
|
|
2565
|
+
/** What is wrong, in the editor's words. */
|
|
2566
|
+
readonly message: string;
|
|
2567
|
+
/** Whether publishing waits for a repair or an approved exception. Default true. */
|
|
2568
|
+
readonly blocking?: boolean;
|
|
2569
|
+
/** True when the values have the finding. Pure. */
|
|
2570
|
+
readonly check: (values: Readonly<Record<string, unknown>>) => boolean;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
/** Effect form of {@link qualityViolations}. */
|
|
2574
|
+
export declare const qualityViolations: (...args: Parameters<typeof qualityViolations_2>) => Effect<readonly FieldViolation[], never, never>;
|
|
2575
|
+
|
|
2576
|
+
/**
|
|
2577
|
+
* The publish gate: blocking findings in `values` without an approved,
|
|
2578
|
+
* unexpired exception, as violations (`rule: quality.<id>`). Empty for a type
|
|
2579
|
+
* without rules — no read at all.
|
|
2580
|
+
*/
|
|
2581
|
+
declare const qualityViolations_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope, values: Readonly<Record<string, unknown>>, now?: Date) => Promise<ReadonlyArray<FieldViolation>>;
|
|
2582
|
+
|
|
2583
|
+
/**
|
|
2584
|
+
* Raised when a create would take a tenant past a limit its app set — more
|
|
2585
|
+
* documents, keys or environments than it may hold. Nothing was written;
|
|
2586
|
+
* `used` is what the tenant holds now.
|
|
2587
|
+
*/
|
|
2588
|
+
export declare class QuotaExceeded extends QuotaExceeded_base {
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
declare const QuotaExceeded_base: Schema_2.TaggedErrorClass<QuotaExceeded, "QuotaExceeded", {
|
|
2592
|
+
readonly _tag: Schema_2.tag<"QuotaExceeded">;
|
|
2593
|
+
} & {
|
|
2594
|
+
quota: typeof Schema_2.String;
|
|
2595
|
+
limit: typeof Schema_2.Number;
|
|
2596
|
+
used: typeof Schema_2.Number;
|
|
2597
|
+
}>;
|
|
2598
|
+
|
|
2599
|
+
/** Effect form of {@link readChanges}. */
|
|
2600
|
+
export declare const readChanges: (...args: Parameters<typeof readChanges_2>) => Effect<{
|
|
2601
|
+
readonly items: ReadonlyArray<ChangeEntry>;
|
|
2602
|
+
readonly next: string | null;
|
|
2603
|
+
}, never, never>;
|
|
2604
|
+
|
|
2605
|
+
/**
|
|
2606
|
+
* The changes in a site and environment after `after`, oldest first. Keep
|
|
2607
|
+
* `next` and pass it as `after` next time; it stays put when nothing new has
|
|
2608
|
+
* settled, so polling with it never skips.
|
|
2609
|
+
*/
|
|
2610
|
+
declare const readChanges_2: (store: DataStore, place: Pick<CmsScope, "site" | "environment">, options?: ReadChangesOptions) => Promise<{
|
|
2611
|
+
readonly items: ReadonlyArray<ChangeEntry>;
|
|
2612
|
+
readonly next: string | null;
|
|
2613
|
+
}>;
|
|
2614
|
+
|
|
2615
|
+
export declare interface ReadChangesOptions {
|
|
2616
|
+
/** The `next` of the previous read; omit to start at the beginning. */
|
|
2617
|
+
readonly after?: string;
|
|
2618
|
+
/** At most this many (default 100). */
|
|
2619
|
+
readonly limit?: number;
|
|
2620
|
+
/** Leave out changes younger than this (default 2000 ms) — see the file header. */
|
|
2621
|
+
readonly settleMs?: number;
|
|
2622
|
+
/** Equality filters, e.g. the tenant for a reader that carries none. */
|
|
2623
|
+
readonly filter?: Readonly<Record<string, unknown>>;
|
|
2624
|
+
readonly now?: number;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
/** Effect form of {@link readDraftTexts}. */
|
|
2628
|
+
export declare const readDraftTexts: (...args: Parameters<typeof readDraftTexts_2>) => Effect<readonly Readonly<Record<string, unknown>>[], ContentNotFound, never>;
|
|
2629
|
+
|
|
2630
|
+
/** The text rows of a draft, whatever revision they belong to. */
|
|
2631
|
+
declare const readDraftTexts_2: (store: DataStore, draftId: string) => Promise<ReadonlyArray<Row>>;
|
|
2632
|
+
|
|
2633
|
+
/** The editor's message, or null for anything else. */
|
|
2634
|
+
export declare const readEditorMessage: (event: VisualMessageEvent, session: VisualSession) => EditorMessage | null;
|
|
2635
|
+
|
|
2636
|
+
/** The preview's message, or null for anything else (another origin, another session, another shape). */
|
|
2637
|
+
export declare const readPreviewMessage: (event: VisualMessageEvent, session: VisualSession) => PreviewMessage | null;
|
|
2638
|
+
|
|
2639
|
+
/** Effect form of {@link rebaseDraftTexts}. */
|
|
2640
|
+
export declare const rebaseDraftTexts: (...args: Parameters<typeof rebaseDraftTexts_2>) => Effect<void, ContentNotFound, never>;
|
|
2641
|
+
|
|
2642
|
+
/** After a save: the texts belong to the new revision. In the caller's transaction. */
|
|
2643
|
+
declare const rebaseDraftTexts_2: (tx: DataStore, rows: ReadonlyArray<Row>, revisionId: string) => Promise<void>;
|
|
2644
|
+
|
|
2645
|
+
/** Effect form of {@link rebuildSearch}. */
|
|
2646
|
+
export declare const rebuildSearch: (...args: Parameters<typeof rebuildSearch_2>) => Effect<number, never, never>;
|
|
2647
|
+
|
|
2648
|
+
/**
|
|
2649
|
+
* Index every variant of a type again from its derived tables — for content
|
|
2650
|
+
* written before the type declared `search`, or after the search rules
|
|
2651
|
+
* changed. Runs over the store it is handed: a request store rebuilds one
|
|
2652
|
+
* tenant, the root store all of them. Returns how many rows it wrote.
|
|
2653
|
+
*/
|
|
2654
|
+
declare const rebuildSearch_2: (store: DataStore, type: ContentType) => Promise<number>;
|
|
2655
|
+
|
|
2656
|
+
/** Effect form of {@link recertify}. */
|
|
2657
|
+
export declare const recertify: (...args: Parameters<typeof recertify_2>) => Effect<Stewardship, never, never>;
|
|
2658
|
+
|
|
2659
|
+
/**
|
|
2660
|
+
* Record that `by` checked `revisionId` of the document and it is still
|
|
2661
|
+
* right: the next review is `reviewEveryDays` from `now` (none when the type
|
|
2662
|
+
* declares no cycle).
|
|
2663
|
+
*/
|
|
2664
|
+
declare const recertify_2: (store: DataStore, type: ContentType, documentId: string, place: Place_2, options: {
|
|
2665
|
+
readonly revisionId: string;
|
|
2666
|
+
readonly by: string;
|
|
2667
|
+
readonly now?: Date;
|
|
2668
|
+
}) => Promise<Stewardship>;
|
|
2669
|
+
|
|
2670
|
+
/** Effect form of {@link recordAiOperation}. */
|
|
2671
|
+
export declare const recordAiOperation: (...args: Parameters<typeof recordAiOperation_2>) => Effect<string, never, never>;
|
|
2672
|
+
|
|
2673
|
+
/** Record one call, in the caller's transaction; its id. */
|
|
2674
|
+
declare const recordAiOperation_2: (tx: DataStore, input: AiOperationInput) => Promise<string>;
|
|
2675
|
+
|
|
2676
|
+
/** Effect form of {@link recordChange}. */
|
|
2677
|
+
export declare const recordChange: (...args: Parameters<typeof recordChange_2>) => Effect<void, never, never>;
|
|
2678
|
+
|
|
2679
|
+
/** Append one change, in the caller's transaction. A type without `changeFeed` writes nothing. */
|
|
2680
|
+
declare const recordChange_2: (tx: DataStore, type: ContentType, row: Row, scope: CmsScope, action: "published" | "unpublished", origin?: ChangeOrigin) => Promise<void>;
|
|
2681
|
+
|
|
2682
|
+
/**
|
|
2683
|
+
* Record a change: `before` is the form as it was. A change with the same key
|
|
2684
|
+
* within `mergeMs` of the last step continues it (typing is one step). The
|
|
2685
|
+
* redo branch goes; at most `limit` steps are kept.
|
|
2686
|
+
*/
|
|
2687
|
+
export declare const recordEdit: (history: EditHistory, before: Readonly<Record<string, unknown>>, edit: EditDescription, at: number, options?: {
|
|
2688
|
+
readonly mergeMs?: number;
|
|
2689
|
+
readonly limit?: number;
|
|
2690
|
+
}) => EditHistory;
|
|
2691
|
+
|
|
2692
|
+
/** Effect form of {@link recordExperimentEvent}. */
|
|
2693
|
+
export declare const recordExperimentEvent: (...args: Parameters<typeof recordExperimentEvent_2>) => Effect<boolean, never, never>;
|
|
2694
|
+
|
|
2695
|
+
/**
|
|
2696
|
+
* Count a reader once per kind: `exposure` when they were shown the page,
|
|
2697
|
+
* `conversion` when they reached the goal. Only while the experiment runs; a
|
|
2698
|
+
* conversion only after an exposure (a reader who never saw a version cannot
|
|
2699
|
+
* be converted by it). Returns whether this call counted.
|
|
2700
|
+
*/
|
|
2701
|
+
declare const recordExperimentEvent_2: (store: DataStore, experiment: Experiment, readerId: string, kind: "exposure" | "conversion", now?: Date) => Promise<boolean>;
|
|
2702
|
+
|
|
2703
|
+
/** Effect form of {@link recordPaths}. */
|
|
2704
|
+
export declare const recordPaths: (...args: Parameters<typeof recordPaths_2>) => Effect<void, never, never>;
|
|
2705
|
+
|
|
2706
|
+
/**
|
|
2707
|
+
* Record the paths of a tree type's published documents in `scope` — or, for
|
|
2708
|
+
* a type with an `address` field, each document's address — turning every
|
|
2709
|
+
* changed one into a redirect. Runs after a publish or unpublish, in the
|
|
2710
|
+
* caller's transaction. A type with neither is left alone.
|
|
2711
|
+
*/
|
|
2712
|
+
declare const recordPaths_2: (tx: DataStore, type: ContentType, scope: CmsScope, tenantId: unknown) => Promise<void>;
|
|
2713
|
+
|
|
2714
|
+
export declare type RecurrenceEvery = 'day' | 'week' | 'month';
|
|
2715
|
+
|
|
2716
|
+
/** What is wrong with a rule, in words; empty when it can be scheduled. */
|
|
2717
|
+
export declare const recurrenceProblems: (rule: RecurrenceRule) => ReadonlyArray<string>;
|
|
2718
|
+
|
|
2719
|
+
export declare interface RecurrenceRule {
|
|
2720
|
+
/** The first occurrence, as a local wall time: `YYYY-MM-DDTHH:mm`. */
|
|
2721
|
+
readonly start: string;
|
|
2722
|
+
/** The IANA zone the wall time is in (`Europe/Berlin`). */
|
|
2723
|
+
readonly zone: string;
|
|
2724
|
+
readonly every: RecurrenceEvery;
|
|
2725
|
+
/** Every how many days / weeks / months (default 1). */
|
|
2726
|
+
readonly interval?: number;
|
|
2727
|
+
/** How many positions the series has (1–100); an excepted one is left out. */
|
|
2728
|
+
readonly count: number;
|
|
2729
|
+
/** How long each occurrence is live, in minutes; shorter than one step. */
|
|
2730
|
+
readonly durationMinutes: number;
|
|
2731
|
+
/** Local dates (`YYYY-MM-DD`) that are left out. */
|
|
2732
|
+
readonly except?: ReadonlyArray<string>;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
/** Effect form of {@link redirectTarget}. */
|
|
2736
|
+
export declare const redirectTarget: (...args: Parameters<typeof redirectTarget_2>) => Effect<string | null, never, never>;
|
|
2737
|
+
|
|
2738
|
+
/** The document a former `path` now points at in `scope` (and `tenantId`, when given), or null. */
|
|
2739
|
+
declare const redirectTarget_2: (store: DataStore, type: string, path: string, scope: CmsScope, tenantId?: unknown) => Promise<string | null>;
|
|
2740
|
+
|
|
2741
|
+
/** Redo the step undone last; null when there is nothing to redo. */
|
|
2742
|
+
export declare const redoEdit: (history: EditHistory, current: Readonly<Record<string, unknown>>) => {
|
|
2743
|
+
readonly history: EditHistory;
|
|
2744
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
2745
|
+
readonly label: string;
|
|
2746
|
+
} | null;
|
|
2747
|
+
|
|
2748
|
+
/** A reference found in a variant's values. */
|
|
2749
|
+
export declare interface ReferenceOccurrence {
|
|
2750
|
+
readonly path: string;
|
|
2751
|
+
readonly targetType: string;
|
|
2752
|
+
readonly targetDocumentId: string;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
/** Every reference the values make, by the content type's declared fields. */
|
|
2756
|
+
export declare const referencesOf: (type: ContentType, values: Readonly<Record<string, unknown>>) => ReadonlyArray<ReferenceOccurrence>;
|
|
2757
|
+
|
|
2758
|
+
/**
|
|
2759
|
+
* Raised when a revision references documents that may not be used — blocked
|
|
2760
|
+
* or past their availability — naming each and where it is referenced.
|
|
2761
|
+
*/
|
|
2762
|
+
export declare class ReferenceUnavailable extends ReferenceUnavailable_base {
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
declare const ReferenceUnavailable_base: Schema_2.TaggedErrorClass<ReferenceUnavailable, "ReferenceUnavailable", {
|
|
2766
|
+
readonly _tag: Schema_2.tag<"ReferenceUnavailable">;
|
|
2767
|
+
} & {
|
|
2768
|
+
contentType: typeof Schema_2.String;
|
|
2769
|
+
id: typeof Schema_2.String;
|
|
2770
|
+
targets: Schema_2.Array$<Schema_2.Struct<{
|
|
2771
|
+
path: typeof Schema_2.String;
|
|
2772
|
+
contentType: typeof Schema_2.String;
|
|
2773
|
+
documentId: typeof Schema_2.String;
|
|
2774
|
+
reason: Schema_2.Literal<["blocked", "expired"]>;
|
|
2775
|
+
}>>;
|
|
2776
|
+
}>;
|
|
2777
|
+
|
|
2778
|
+
/** One live use of a document. */
|
|
2779
|
+
export declare interface ReferenceUse {
|
|
2780
|
+
readonly sourceType: string;
|
|
2781
|
+
readonly sourceDocumentId: string;
|
|
2782
|
+
readonly sourceVariantId: string;
|
|
2783
|
+
readonly locale: string;
|
|
2784
|
+
readonly path: string;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
/** Effect form of {@link regrantExtension}. */
|
|
2788
|
+
export declare const regrantExtension: (...args: Parameters<typeof regrantExtension_2>) => Effect<ExtensionChange, never, never>;
|
|
2789
|
+
|
|
2790
|
+
/** Grant a revoked extension again — `consent` must cover everything its version asks for. */
|
|
2791
|
+
declare const regrantExtension_2: (tx: DataStore, extensionId: string, consent: ReadonlyArray<ExtensionCapability>) => Promise<ExtensionChange>;
|
|
2792
|
+
|
|
2793
|
+
/** The lifecycle of a release. */
|
|
2794
|
+
export declare const RELEASE_STATUSES: readonly ["draft", "scheduled", "published", "failed"];
|
|
2795
|
+
|
|
2796
|
+
/**
|
|
2797
|
+
* Raised when a release is asked to change in a state that does not allow it:
|
|
2798
|
+
* adding to or scheduling a release that is no longer a draft, publishing one
|
|
2799
|
+
* that is already published or failed, rolling back one that is not published.
|
|
2800
|
+
*/
|
|
2801
|
+
export declare class ReleaseNotEditable extends ReleaseNotEditable_base {
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
declare const ReleaseNotEditable_base: Schema_2.TaggedErrorClass<ReleaseNotEditable, "ReleaseNotEditable", {
|
|
2805
|
+
readonly _tag: Schema_2.tag<"ReleaseNotEditable">;
|
|
2806
|
+
} & {
|
|
2807
|
+
id: typeof Schema_2.String;
|
|
2808
|
+
status: typeof Schema_2.String;
|
|
2809
|
+
}>;
|
|
2810
|
+
|
|
2811
|
+
export declare type ReleaseStatus = (typeof RELEASE_STATUSES)[number];
|
|
2812
|
+
|
|
2813
|
+
/** Effect form of {@link releaseStatusOf}. */
|
|
2814
|
+
export declare const releaseStatusOf: (...args: Parameters<typeof releaseStatusOf_2>) => Effect<string | null, never, never>;
|
|
2815
|
+
|
|
2816
|
+
/** A release's status (`draft`, `scheduled`, `published`, …), or null when there is none of that id. */
|
|
2817
|
+
declare const releaseStatusOf_2: (store: DataStore, releaseId: string) => Promise<string | null>;
|
|
2818
|
+
|
|
2819
|
+
/** Effect form of {@link removeGlossaryTerm}. */
|
|
2820
|
+
export declare const removeGlossaryTerm: (...args: Parameters<typeof removeGlossaryTerm_2>) => Effect<boolean, never, never>;
|
|
2821
|
+
|
|
2822
|
+
/** Remove an entry; false when there was none in this workspace. */
|
|
2823
|
+
declare const removeGlossaryTerm_2: (tx: DataStore, tenantId: string, entryId: string) => Promise<boolean>;
|
|
2824
|
+
|
|
2825
|
+
/** Effect form of {@link removeRedirect}. */
|
|
2826
|
+
export declare const removeRedirect: (...args: Parameters<typeof removeRedirect_2>) => Effect<boolean, never, never>;
|
|
2827
|
+
|
|
2828
|
+
/**
|
|
2829
|
+
* Remove the redirect from `fromPath` in `scope`. True when there was one. A
|
|
2830
|
+
* page that had the address and is no longer live still answers it as gone
|
|
2831
|
+
* (`goneAt`). In the caller's transaction.
|
|
2832
|
+
*/
|
|
2833
|
+
declare const removeRedirect_2: (tx: DataStore, type: ContentType, scope: CmsScope, fromPath: string) => Promise<boolean>;
|
|
2834
|
+
|
|
2835
|
+
/**
|
|
2836
|
+
* Replace the text in `[start, end)` with `text` (a paste, a typed line
|
|
2837
|
+
* break). It takes the marks of the first character it replaces, or — where
|
|
2838
|
+
* nothing is selected — of the character before it.
|
|
2839
|
+
*/
|
|
2840
|
+
export declare const replaceText: (content: ReadonlyArray<RichInline>, start: number, end: number, text: string) => ReadonlyArray<RichInline>;
|
|
2841
|
+
|
|
2842
|
+
/** Effect form of {@link requestChanges}. */
|
|
2843
|
+
export declare const requestChanges: (...args: Parameters<typeof requestChanges_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound | RevisionMismatch | ReviewStepRefused, never>;
|
|
2844
|
+
|
|
2845
|
+
/** Send the revision in review back with a note. Same checks as approving, minus self-approval. */
|
|
2846
|
+
declare const requestChanges_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope, options: Omit<DecideOptions, "allowSelfApproval">) => Promise<Row>;
|
|
2847
|
+
|
|
2848
|
+
export declare type RequestExceptionResult = {
|
|
2849
|
+
readonly ok: true;
|
|
2850
|
+
readonly id: string;
|
|
2851
|
+
} | {
|
|
2852
|
+
readonly ok: false;
|
|
2853
|
+
readonly reason: 'unknownRule' | 'notBlocking' | 'noReason' | 'badExpiry' | 'alreadyOpen';
|
|
2854
|
+
};
|
|
2855
|
+
|
|
2856
|
+
/** Effect form of {@link requestQualityException}. */
|
|
2857
|
+
export declare const requestQualityException: (...args: Parameters<typeof requestQualityException_2>) => Effect<RequestExceptionResult, ContentNotFound, never>;
|
|
2858
|
+
|
|
2859
|
+
/** Ask for an exception to one blocking rule on one variant, until `expiresAt`. */
|
|
2860
|
+
declare const requestQualityException_2: (tx: DataStore, type: ContentType, variantId: string, scope: CmsScope, input: {
|
|
2861
|
+
readonly ruleId: string;
|
|
2862
|
+
readonly reason: string;
|
|
2863
|
+
readonly expiresAt: Date;
|
|
2864
|
+
readonly actorId: string;
|
|
2865
|
+
}, now?: Date) => Promise<RequestExceptionResult>;
|
|
2866
|
+
|
|
2867
|
+
/** Effect form of {@link requestReview}. */
|
|
2868
|
+
export declare const requestReview: (...args: Parameters<typeof requestReview_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound, never>;
|
|
2869
|
+
|
|
2870
|
+
/** Ask for review of the revision the draft shows now. */
|
|
2871
|
+
declare const requestReview_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope, options: {
|
|
2872
|
+
readonly actorId: string;
|
|
2873
|
+
readonly note?: string;
|
|
2874
|
+
}) => Promise<Row>;
|
|
2875
|
+
|
|
2876
|
+
/** One published entry found by {@link CmsApi.resolve}, with where it came from. */
|
|
2877
|
+
export declare interface ResolvedEntry {
|
|
2878
|
+
/** The published row that answers the request. */
|
|
2879
|
+
readonly row: Row;
|
|
2880
|
+
/** The locale of `row`. */
|
|
2881
|
+
readonly locale: string;
|
|
2882
|
+
/** The locale the surface was asked for (its scope's locale). */
|
|
2883
|
+
readonly requestedLocale: string;
|
|
2884
|
+
/** True when `row` is a fallback locale's variant — the requested locale
|
|
2885
|
+
* has none for this document. Resolved at read time, never stored. */
|
|
2886
|
+
readonly fallback: boolean;
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2889
|
+
/** What a preview link shows. */
|
|
2890
|
+
export declare type ResolvedPreviewShare = {
|
|
2891
|
+
readonly ok: true;
|
|
2892
|
+
readonly share: Row;
|
|
2893
|
+
readonly contentType: string;
|
|
2894
|
+
readonly locale: string;
|
|
2895
|
+
/** The revision shown, and its values. */
|
|
2896
|
+
readonly revisionId: string;
|
|
2897
|
+
readonly revision: number;
|
|
2898
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
2899
|
+
}
|
|
2900
|
+
/** `unknown` also answers a token that never existed — no oracle for guessing. */
|
|
2901
|
+
| {
|
|
2902
|
+
readonly ok: false;
|
|
2903
|
+
readonly reason: 'unknown' | 'expired' | 'revoked';
|
|
2904
|
+
};
|
|
2905
|
+
|
|
2906
|
+
/** Effect form of {@link resolveMedia}. */
|
|
2907
|
+
export declare const resolveMedia: (...args: Parameters<typeof resolveMedia_2>) => Effect<Record<string, unknown>, never, never>;
|
|
2908
|
+
|
|
2909
|
+
/**
|
|
2910
|
+
* Resolve every `media` field on ONE row (including media nested inside
|
|
2911
|
+
* `Array` / `Struct` fields) from its stored storage key to a served URL,
|
|
2912
|
+
* using the caller-supplied `resolve`. Returns a NEW row; the input is not
|
|
2913
|
+
* mutated. A key the resolver returns `null` for is left as-is.
|
|
2914
|
+
*
|
|
2915
|
+
* A content type with no media fields returns the row unchanged (no work).
|
|
2916
|
+
*/
|
|
2917
|
+
declare const resolveMedia_2: (type: Pick<ContentType, "fields">, row: Readonly<Record<string, unknown>>, resolve: MediaResolver) => Promise<Record<string, unknown>>;
|
|
2918
|
+
|
|
2919
|
+
/** Effect form of {@link resolveMediaAll}. */
|
|
2920
|
+
export declare const resolveMediaAll: (...args: Parameters<typeof resolveMediaAll_2>) => Effect<readonly Record<string, unknown>[], never, never>;
|
|
2921
|
+
|
|
2922
|
+
/** Resolve media across MANY rows in one call (the list-read case). */
|
|
2923
|
+
declare const resolveMediaAll_2: (type: Pick<ContentType, "fields">, rows: ReadonlyArray<Readonly<Record<string, unknown>>>, resolve: MediaResolver) => Promise<ReadonlyArray<Record<string, unknown>>>;
|
|
2924
|
+
|
|
2925
|
+
/** What {@link CmsApi.resolve} looks up. */
|
|
2926
|
+
export declare interface ResolveOptions {
|
|
2927
|
+
/** The column and value that identify the entry, e.g. `{ field: 'slug', value }`. */
|
|
2928
|
+
readonly key: {
|
|
2929
|
+
readonly field: string;
|
|
2930
|
+
readonly value: unknown;
|
|
2931
|
+
};
|
|
2932
|
+
/** Equality filters applied to every lookup (e.g. the site's tenant). */
|
|
2933
|
+
readonly filter?: Readonly<Record<string, unknown>>;
|
|
2934
|
+
/** Locales to try, in order, when the requested one has no match. */
|
|
2935
|
+
readonly fallback?: ReadonlyArray<string>;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
/** Effect form of {@link resolvePreviewShare}. */
|
|
2939
|
+
export declare const resolvePreviewShare: (...args: Parameters<typeof resolvePreviewShare_2>) => Effect<ResolvedPreviewShare, ContentNotFound | PreviewShareRejected, never>;
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* Resolve a preview link's token. The only cross-tenant read here: the token
|
|
2943
|
+
* is the authorization, and everything read is confined to the share's own
|
|
2944
|
+
* tenant and variant. A draft that no longer exists answers `unknown`.
|
|
2945
|
+
*/
|
|
2946
|
+
declare const resolvePreviewShare_2: (store: DataStore, token: string, now?: Date) => Promise<ResolvedPreviewShare>;
|
|
2947
|
+
|
|
2948
|
+
/** Effect-native `restoreRevision` (see {@link saveDraftEffect}). */
|
|
2949
|
+
export declare const restoreRevision: (store: DataStore, type: ContentType, id: string, scope: CmsScope, revisionId: string) => Effect_2.Effect<Row, ContentValidationFailed | ContentNotFound>;
|
|
2950
|
+
|
|
2951
|
+
/** Effect form of {@link retireDuplicate}. */
|
|
2952
|
+
export declare const retireDuplicate: (...args: Parameters<typeof retireDuplicate_2>) => Effect<RetireDuplicateResult, ContentNotFound, never>;
|
|
2953
|
+
|
|
2954
|
+
/**
|
|
2955
|
+
* Retire `copyId` in favour of `keepId` — both drafts of `type` in `scope`
|
|
2956
|
+
* holding the same file. Archived when no published content references the
|
|
2957
|
+
* copy (`usedBy`); refused with those references otherwise.
|
|
2958
|
+
*/
|
|
2959
|
+
declare const retireDuplicate_2: (tx: DataStore, type: ContentType, scope: CmsScope, input: {
|
|
2960
|
+
readonly copyId: string;
|
|
2961
|
+
readonly keepId: string;
|
|
2962
|
+
readonly field: string;
|
|
2963
|
+
readonly fingerprint: Fingerprint;
|
|
2964
|
+
}) => Promise<RetireDuplicateResult>;
|
|
2965
|
+
|
|
2966
|
+
export declare type RetireDuplicateResult = {
|
|
2967
|
+
readonly ok: true;
|
|
2968
|
+
} | {
|
|
2969
|
+
readonly ok: false;
|
|
2970
|
+
readonly reason: 'notDuplicate';
|
|
2971
|
+
} | {
|
|
2972
|
+
readonly ok: false;
|
|
2973
|
+
readonly reason: 'inUse';
|
|
2974
|
+
readonly usedBy: ReadonlyArray<ReferenceUse>;
|
|
2975
|
+
};
|
|
2976
|
+
|
|
2977
|
+
/** Effect form of {@link retryRelease}. */
|
|
2978
|
+
export declare const retryRelease: (...args: Parameters<typeof retryRelease_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound | ReleaseNotEditable | ReviewRequired | ReferenceUnavailable, never>;
|
|
2979
|
+
|
|
2980
|
+
/**
|
|
2981
|
+
* Take a failed release back to draft, so it can be published or scheduled
|
|
2982
|
+
* again once its cause is fixed (an approval given, a blocked asset
|
|
2983
|
+
* replaced). Its entries stay as they were; the failure is cleared. Throws
|
|
2984
|
+
* `ReleaseNotEditable` for a release that did not fail.
|
|
2985
|
+
*/
|
|
2986
|
+
declare const retryRelease_2: (store: DataStore, releaseId: string) => Promise<Row>;
|
|
2987
|
+
|
|
2988
|
+
/**
|
|
2989
|
+
* Fire the content type's DECLARED revalidations (`revalidate: { paths,
|
|
2990
|
+
* tags }`). Call it AFTER the publish/unpublish has committed — a web replica
|
|
2991
|
+
* re-rendering on the purge must read the committed state, which is why the
|
|
2992
|
+
* write ops themselves never fire it (they run inside the caller's open
|
|
2993
|
+
* transaction). `publishDue` calls it after each of its commits; a mutation
|
|
2994
|
+
* fires it from a post-commit subscriber on `<type>_published`.
|
|
2995
|
+
* Best-effort by design (the entry also expires by its own TTL): a transport
|
|
2996
|
+
* failure is logged and never reaches the caller.
|
|
2997
|
+
*/
|
|
2998
|
+
export declare const revalidateContent: (type: ContentType) => void;
|
|
2999
|
+
|
|
3000
|
+
export declare const REVIEW_ACTIONS: readonly ["requested", "approved", "changesRequested"];
|
|
3001
|
+
|
|
3002
|
+
export declare type ReviewAction = (typeof REVIEW_ACTIONS)[number];
|
|
3003
|
+
|
|
3004
|
+
/** Effect form of {@link reviewLog}. */
|
|
3005
|
+
export declare const reviewLog: (...args: Parameters<typeof reviewLog_2>) => Effect<readonly Readonly<Record<string, unknown>>[], never, never>;
|
|
3006
|
+
|
|
3007
|
+
/** The variant's review steps, newest first. */
|
|
3008
|
+
declare const reviewLog_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope) => Promise<ReadonlyArray<Row>>;
|
|
3009
|
+
|
|
3010
|
+
/**
|
|
3011
|
+
* Raised when a revision of a content type that requires review is published
|
|
3012
|
+
* without an approval of exactly that revision.
|
|
3013
|
+
*/
|
|
3014
|
+
export declare class ReviewRequired extends ReviewRequired_base {
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
declare const ReviewRequired_base: Schema_2.TaggedErrorClass<ReviewRequired, "ReviewRequired", {
|
|
3018
|
+
readonly _tag: Schema_2.tag<"ReviewRequired">;
|
|
3019
|
+
} & {
|
|
3020
|
+
contentType: typeof Schema_2.String;
|
|
3021
|
+
id: typeof Schema_2.String;
|
|
3022
|
+
revisionId: typeof Schema_2.String;
|
|
3023
|
+
}>;
|
|
3024
|
+
|
|
3025
|
+
/** Effect form of {@link reviewRequiredFor}. */
|
|
3026
|
+
export declare const reviewRequiredFor: (...args: Parameters<typeof reviewRequiredFor_2>) => Effect<boolean, never, never>;
|
|
3027
|
+
|
|
3028
|
+
/**
|
|
3029
|
+
* Whether publishing `type` needs an approval: always, never, or — for a type
|
|
3030
|
+
* left to the workspace — when the workspace of `variantId` requires it.
|
|
3031
|
+
*/
|
|
3032
|
+
declare const reviewRequiredFor_2: (store: DataStore, type: ContentType, variantId?: string) => Promise<boolean>;
|
|
3033
|
+
|
|
3034
|
+
/** `notRequired`: the type declares no review cycle, or the document was never published. */
|
|
3035
|
+
export declare type ReviewState = 'notRequired' | 'scheduled' | 'due';
|
|
3036
|
+
|
|
3037
|
+
/** Where a variant's review stands. */
|
|
3038
|
+
export declare interface ReviewStatus {
|
|
3039
|
+
/** `none` also when the last step concerns a revision the draft no longer shows. */
|
|
3040
|
+
readonly state: 'none' | 'inReview' | 'approved' | 'changesRequested';
|
|
3041
|
+
/** The revision the last step concerns (null without any step). */
|
|
3042
|
+
readonly revisionId: string | null;
|
|
3043
|
+
/** True when the draft moved on since the last step. */
|
|
3044
|
+
readonly stale: boolean;
|
|
3045
|
+
readonly lastStep: Row | null;
|
|
3046
|
+
}
|
|
3047
|
+
|
|
3048
|
+
/** Effect form of {@link reviewStatus}. */
|
|
3049
|
+
export declare const reviewStatus: (...args: Parameters<typeof reviewStatus_2>) => Effect<ReviewStatus, ContentNotFound, never>;
|
|
3050
|
+
|
|
3051
|
+
declare const reviewStatus_2: (store: DataStore, type: ContentType, variantId: string, scope: CmsScope) => Promise<ReviewStatus>;
|
|
3052
|
+
|
|
3053
|
+
/**
|
|
3054
|
+
* Raised by the review steps when the step does not fit the variant's review:
|
|
3055
|
+
* nothing is in review, or the approver is the person who asked for it.
|
|
3056
|
+
*/
|
|
3057
|
+
export declare class ReviewStepRefused extends ReviewStepRefused_base {
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
declare const ReviewStepRefused_base: Schema_2.TaggedErrorClass<ReviewStepRefused, "ReviewStepRefused", {
|
|
3061
|
+
readonly _tag: Schema_2.tag<"ReviewStepRefused">;
|
|
3062
|
+
} & {
|
|
3063
|
+
contentType: typeof Schema_2.String;
|
|
3064
|
+
id: typeof Schema_2.String;
|
|
3065
|
+
reason: Schema_2.Literal<["notInReview", "selfApproval"]>;
|
|
3066
|
+
}>;
|
|
3067
|
+
|
|
3068
|
+
/**
|
|
3069
|
+
* Raised by `publish` when the caller pinned a revision (`{ revisionId }`)
|
|
3070
|
+
* and the draft has moved on to another one — publishing would release
|
|
3071
|
+
* content that was not the reviewed revision.
|
|
3072
|
+
*/
|
|
3073
|
+
export declare class RevisionMismatch extends RevisionMismatch_base {
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
declare const RevisionMismatch_base: Schema_2.TaggedErrorClass<RevisionMismatch, "RevisionMismatch", {
|
|
3077
|
+
readonly _tag: Schema_2.tag<"RevisionMismatch">;
|
|
3078
|
+
} & {
|
|
3079
|
+
contentType: typeof Schema_2.String;
|
|
3080
|
+
id: typeof Schema_2.String;
|
|
3081
|
+
expected: typeof Schema_2.String;
|
|
3082
|
+
actual: typeof Schema_2.String;
|
|
3083
|
+
}>;
|
|
3084
|
+
|
|
3085
|
+
/** Effect form of {@link revokeExtension}. */
|
|
3086
|
+
export declare const revokeExtension: (...args: Parameters<typeof revokeExtension_2>) => Effect<ExtensionChange, never, never>;
|
|
3087
|
+
|
|
3088
|
+
/** Take every capability away; the install and its data stay. */
|
|
3089
|
+
declare const revokeExtension_2: (tx: DataStore, extensionId: string) => Promise<ExtensionChange>;
|
|
3090
|
+
|
|
3091
|
+
/** Effect form of {@link revokePreviewShare}. */
|
|
3092
|
+
export declare const revokePreviewShare: (...args: Parameters<typeof revokePreviewShare_2>) => Effect<void, ContentNotFound | PreviewShareRejected, never>;
|
|
3093
|
+
|
|
3094
|
+
/** Revoke one of the caller's shares; the link stops working at once. */
|
|
3095
|
+
declare const revokePreviewShare_2: (store: DataStore, shareId: string, now?: Date) => Promise<void>;
|
|
3096
|
+
|
|
3097
|
+
/** A top-level block. `id` is stable across edits, moves and translations. */
|
|
3098
|
+
export declare type RichBlock = {
|
|
3099
|
+
readonly id: string;
|
|
3100
|
+
readonly type: 'paragraph';
|
|
3101
|
+
readonly content: ReadonlyArray<RichInline>;
|
|
3102
|
+
} | {
|
|
3103
|
+
readonly id: string;
|
|
3104
|
+
readonly type: 'heading';
|
|
3105
|
+
readonly level: 2 | 3;
|
|
3106
|
+
readonly content: ReadonlyArray<RichInline>;
|
|
3107
|
+
} | {
|
|
3108
|
+
readonly id: string;
|
|
3109
|
+
readonly type: 'list';
|
|
3110
|
+
readonly ordered: boolean;
|
|
3111
|
+
readonly items: ReadonlyArray<ReadonlyArray<RichInline>>;
|
|
3112
|
+
/** How deep each item sits (0 at the top, at most `MAX_LIST_LEVEL`), one per item; absent: all at the top.
|
|
3113
|
+
* An item is at most one level deeper than the one before it. */
|
|
3114
|
+
readonly levels?: ReadonlyArray<number>;
|
|
3115
|
+
/** The kind of the lists nested in it, by depth — index 0 for the lists one level in. Absent (or
|
|
3116
|
+
* shorter than the depth): numbered like the list itself. At most `MAX_LIST_LEVEL` entries. */
|
|
3117
|
+
readonly sublists?: ReadonlyArray<ListKind>;
|
|
3118
|
+
} | {
|
|
3119
|
+
readonly id: string;
|
|
3120
|
+
readonly type: 'table';
|
|
3121
|
+
/** True when the first row holds the column headers. */
|
|
3122
|
+
readonly header: boolean;
|
|
3123
|
+
readonly rows: ReadonlyArray<ReadonlyArray<ReadonlyArray<RichInline>>>;
|
|
3124
|
+
}
|
|
3125
|
+
/** An image asset (by its documentId) with an optional caption. */
|
|
3126
|
+
| {
|
|
3127
|
+
readonly id: string;
|
|
3128
|
+
readonly type: 'image';
|
|
3129
|
+
readonly asset: string;
|
|
3130
|
+
readonly caption?: string;
|
|
3131
|
+
};
|
|
3132
|
+
|
|
3133
|
+
/** A rich document. */
|
|
3134
|
+
export declare interface RichDocument {
|
|
3135
|
+
readonly type: 'doc';
|
|
3136
|
+
readonly blocks: ReadonlyArray<RichBlock>;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
export declare const RichDocumentEditor: (props: RichDocumentEditorProps) => ReactNode;
|
|
3140
|
+
|
|
3141
|
+
export declare interface RichDocumentEditorProps extends WidgetProps {
|
|
3142
|
+
readonly renderPicker?: RichDocumentPicker;
|
|
3143
|
+
/** Renders inside one block's group, after its actions — its comments, say.
|
|
3144
|
+
* `blockId` is the block's stable id (it survives moves and new revisions);
|
|
3145
|
+
* `label` names it as its legend does (`Paragraph 2`). */
|
|
3146
|
+
readonly renderBlockAside?: (blockId: string, label: string) => ReactNode;
|
|
3147
|
+
/** The words of the controls; English by default (see `ContentFormStrings`). */
|
|
3148
|
+
readonly strings?: ContentFormStringsInput;
|
|
3149
|
+
/**
|
|
3150
|
+
* How a paragraph's or a heading's text is edited: `markup` (default) is a
|
|
3151
|
+
* text area with the small inline syntax; `visual` edits it as it looks —
|
|
3152
|
+
* bold as bold, links as links — with Bold and Italic buttons. Lists and
|
|
3153
|
+
* tables keep their lines either way.
|
|
3154
|
+
*/
|
|
3155
|
+
readonly surface?: 'markup' | 'visual';
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
/** Translate a Contentful rich-text document, and say what could not be translated. */
|
|
3159
|
+
export declare const richDocumentFromContentful: (root: ContentfulNode | null | undefined, options?: ContentfulImportOptions) => ContentfulImportResult;
|
|
3160
|
+
|
|
3161
|
+
/**
|
|
3162
|
+
* Translate HTML into a rich document, and say what could not be translated.
|
|
3163
|
+
* Links resolve through `resolveLink`; everything else is text or a finding.
|
|
3164
|
+
*/
|
|
3165
|
+
export declare const richDocumentFromHtml: (html: string, options?: HtmlImportOptions) => HtmlImportResult;
|
|
3166
|
+
|
|
3167
|
+
/** Renders a control that picks one document of `type`. */
|
|
3168
|
+
export declare type RichDocumentPicker = (props: {
|
|
3169
|
+
readonly id: string;
|
|
3170
|
+
readonly type: string;
|
|
3171
|
+
readonly value: string;
|
|
3172
|
+
readonly onChange: (documentId: string) => void;
|
|
3173
|
+
}) => ReactNode;
|
|
3174
|
+
|
|
3175
|
+
/** One problem with a rich document, at a path below the field. */
|
|
3176
|
+
export declare interface RichDocumentProblem {
|
|
3177
|
+
readonly path: string;
|
|
3178
|
+
readonly rule: string;
|
|
3179
|
+
readonly message: string;
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
/** Everything wrong with `value` as a rich document under `options`. */
|
|
3183
|
+
export declare const richDocumentProblems: (path: string, value: unknown, options: RichTextOptions) => ReadonlyArray<RichDocumentProblem>;
|
|
3184
|
+
|
|
3185
|
+
/** A document reference found in a rich document. */
|
|
3186
|
+
export declare interface RichDocumentReference {
|
|
3187
|
+
readonly path: string;
|
|
3188
|
+
readonly targetType: string;
|
|
3189
|
+
readonly targetDocumentId: string;
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
/** Every image and link reference in a (valid) document, with its path. */
|
|
3193
|
+
export declare const richDocumentReferences: (path: string, doc: RichDocument, options: RichTextOptions) => ReadonlyArray<RichDocumentReference>;
|
|
383
3194
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
3195
|
+
/** The document's blocks, in order. Renders nothing for a value that is not a rich document. */
|
|
3196
|
+
export declare const RichDocumentView: ({ document, hrefOf, renderImage }: RichDocumentViewProps) => ReactNode;
|
|
3197
|
+
|
|
3198
|
+
export declare interface RichDocumentViewProps {
|
|
3199
|
+
/** A stored `Schema.RichText()` value (a plain string renders as paragraphs). */
|
|
3200
|
+
readonly document: unknown;
|
|
3201
|
+
/** The address of a linked document, or undefined when it has none (not live). */
|
|
3202
|
+
readonly hrefOf?: (documentId: string) => string | undefined;
|
|
3203
|
+
/** Render an image block; without it, images are left out. */
|
|
3204
|
+
readonly renderImage?: (block: {
|
|
3205
|
+
readonly asset: string;
|
|
3206
|
+
readonly caption?: string;
|
|
3207
|
+
}) => ReactNode;
|
|
389
3208
|
}
|
|
390
3209
|
|
|
391
|
-
/** A
|
|
392
|
-
export declare
|
|
393
|
-
readonly type:
|
|
394
|
-
readonly
|
|
3210
|
+
/** A run of text inside a block. */
|
|
3211
|
+
export declare type RichInline = {
|
|
3212
|
+
readonly type: 'text';
|
|
3213
|
+
readonly text: string;
|
|
3214
|
+
readonly marks?: ReadonlyArray<RichMark>;
|
|
395
3215
|
}
|
|
3216
|
+
/** A link to a document (by its documentId) — the site resolves its address. */
|
|
3217
|
+
| {
|
|
3218
|
+
readonly type: 'link';
|
|
3219
|
+
readonly target: string;
|
|
3220
|
+
readonly text: string;
|
|
3221
|
+
};
|
|
396
3222
|
|
|
397
|
-
/**
|
|
398
|
-
export declare
|
|
399
|
-
ttlSeconds?: number;
|
|
400
|
-
secret?: string;
|
|
401
|
-
}) => string;
|
|
3223
|
+
/** An inline mark. */
|
|
3224
|
+
export declare type RichMark = 'bold' | 'italic' | 'underline';
|
|
402
3225
|
|
|
403
3226
|
/**
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
* 'published'`. Runs inside `store.transactional`, so the copy + the
|
|
408
|
-
* draft status flip land atomically per row. Both tables are
|
|
409
|
-
* reactive, so the publish wakes live consumer subscriptions.
|
|
410
|
-
*
|
|
411
|
-
* A missing draft id — including another tenant's draft, which a scoped
|
|
412
|
-
* store reads as absent — throws `ContentNotFound`.
|
|
413
|
-
*
|
|
414
|
-
* Returns the published row.
|
|
3227
|
+
* Which resources a rich-text field may hold: `images` names the content type
|
|
3228
|
+
* an image block references (an asset type), `links` the type a link
|
|
3229
|
+
* references (a page type). Unset → that node is not allowed.
|
|
415
3230
|
*/
|
|
416
|
-
export declare
|
|
3231
|
+
export declare interface RichTextOptions {
|
|
3232
|
+
readonly images?: string;
|
|
3233
|
+
readonly links?: string;
|
|
3234
|
+
}
|
|
417
3235
|
|
|
418
|
-
|
|
419
|
-
* Publish every draft of `type` whose scheduled `publishAt` has passed
|
|
420
|
-
* (and that is still a draft). Returns the ids that were published. A
|
|
421
|
-
* driver calls this on an interval from a `*.cron.tsx` schedule (see the
|
|
422
|
-
* README/docs recipe) — it is idempotent: `publish` flips the draft
|
|
423
|
-
* `status` to `'published'`, so a row is never double-published, and
|
|
424
|
-
* `publishAt` is cleared so a later re-save doesn't spuriously re-fire.
|
|
425
|
-
*
|
|
426
|
-
* Runs over the store it is handed: a request-scoped store publishes one
|
|
427
|
-
* tenant's due drafts; a background/root store sweeps every tenant.
|
|
428
|
-
*/
|
|
429
|
-
export declare const publishDue: (store: DataStore, type: ContentType, now?: Date) => Promise<ReadonlyArray<string>>;
|
|
3236
|
+
export declare const RichTextSurface: (props: RichTextSurfaceProps) => ReactNode;
|
|
430
3237
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
3238
|
+
export declare interface RichTextSurfaceProps {
|
|
3239
|
+
readonly id: string;
|
|
3240
|
+
/** The id of the element naming the text box (its label). */
|
|
3241
|
+
readonly labelledBy: string;
|
|
3242
|
+
readonly content: ReadonlyArray<RichInline>;
|
|
3243
|
+
readonly onChange: (content: ReadonlyArray<RichInline>) => void;
|
|
3244
|
+
/** The words of the mark buttons, and their accessible names. */
|
|
3245
|
+
readonly words: {
|
|
3246
|
+
readonly bold: string;
|
|
3247
|
+
readonly italic: string;
|
|
3248
|
+
readonly underline: string;
|
|
3249
|
+
};
|
|
3250
|
+
}
|
|
434
3251
|
|
|
435
|
-
/** Effect
|
|
436
|
-
export declare const
|
|
3252
|
+
/** Effect form of {@link rollbackExtension}. */
|
|
3253
|
+
export declare const rollbackExtension: (...args: Parameters<typeof rollbackExtension_2>) => Effect<ExtensionChange, never, never>;
|
|
437
3254
|
|
|
438
3255
|
/**
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
* mutated. A key the resolver returns `null` for is left as-is.
|
|
443
|
-
*
|
|
444
|
-
* A content type with no media fields returns the row unchanged (no work).
|
|
3256
|
+
* Back to the version that ran before the last move, with the grant it had
|
|
3257
|
+
* then — one step; a waiting version is dropped. A rollback never widens the
|
|
3258
|
+
* grant beyond what was consented to for that version.
|
|
445
3259
|
*/
|
|
446
|
-
|
|
3260
|
+
declare const rollbackExtension_2: (tx: DataStore, extensionId: string) => Promise<ExtensionChange>;
|
|
447
3261
|
|
|
448
|
-
/**
|
|
449
|
-
export declare const
|
|
3262
|
+
/** Effect form of {@link rollbackRelease}. */
|
|
3263
|
+
export declare const rollbackRelease: (...args: Parameters<typeof rollbackRelease_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound | ReleaseNotEditable | ReviewRequired | ReferenceUnavailable, never>;
|
|
450
3264
|
|
|
451
3265
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
3266
|
+
* Roll a published release back: a NEW release that puts back what each of
|
|
3267
|
+
* its variants showed before it (unpublishing the ones that were not live),
|
|
3268
|
+
* published in the caller's transaction. The rolled-back release is left as it
|
|
3269
|
+
* was. Returns the new release.
|
|
456
3270
|
*/
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
3271
|
+
declare const rollbackRelease_2: (tx: DataStore, types: ReadonlyArray<ContentType>, releaseId: string, now?: Date) => Promise<Row>;
|
|
3272
|
+
|
|
3273
|
+
/** A path found by {@link CmsApi.route}. */
|
|
3274
|
+
export declare interface RouteMatch {
|
|
3275
|
+
/** The node for the path's document, in the requested locale's tree. Its
|
|
3276
|
+
* `path` is the canonical address — it differs from the path asked for
|
|
3277
|
+
* when that was a fallback locale's path of a translated page, or a
|
|
3278
|
+
* former address of a page that moved (redirect to `node.path`). */
|
|
3279
|
+
readonly node: TreeNode;
|
|
3280
|
+
/** The tree the node belongs to — for navigation and link resolution. */
|
|
3281
|
+
readonly tree: CmsTree;
|
|
3282
|
+
/** How the path was found: the page's own address, another locale's
|
|
3283
|
+
* address of it, or an address it had before it moved (answer that one
|
|
3284
|
+
* with a permanent redirect). */
|
|
3285
|
+
readonly via: 'path' | 'fallback' | 'redirect';
|
|
460
3286
|
}
|
|
461
3287
|
|
|
3288
|
+
/** Effect form of {@link runBulk}. */
|
|
3289
|
+
export declare const runBulk: (...args: Parameters<typeof runBulk_2>) => Effect<readonly BulkResult[], ContentValidationFailed | ContentNotFound | ContentIdConflict | RevisionMismatch | ReviewRequired | ReferenceUnavailable, never>;
|
|
3290
|
+
|
|
462
3291
|
/**
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
* Without `row.id` a new draft is inserted (the id scheme generates the
|
|
469
|
-
* TypeID). With `row.id`, the caller's OWN draft is updated in place; an
|
|
470
|
-
* id that exists only outside the caller's tenant scope throws
|
|
471
|
-
* `ContentIdConflict` — it is never updated or overwritten. The row is
|
|
472
|
-
* written with `status: 'draft'`; through a request-scoped `ctx.store`
|
|
473
|
-
* the tenant/audit columns are stamped by the store spine.
|
|
474
|
-
*
|
|
475
|
-
* Returns the written draft row.
|
|
3292
|
+
* Execute a plan: each `ready` item in its own transaction (hand it a store
|
|
3293
|
+
* that is not already inside one), a publish with the revision the plan
|
|
3294
|
+
* pinned. A gate that closed since the dry run fails that item with its
|
|
3295
|
+
* reason; the others still go through.
|
|
476
3296
|
*/
|
|
477
|
-
|
|
3297
|
+
declare const runBulk_2: (store: DataStore, types: ReadonlyArray<ContentType>, place: Place, action: BulkAction, plan: ReadonlyArray<PlannedItem>) => Promise<ReadonlyArray<BulkResult>>;
|
|
3298
|
+
|
|
3299
|
+
/** Effect form of {@link runningExperiment}. */
|
|
3300
|
+
export declare const runningExperiment: (...args: Parameters<typeof runningExperiment_2>) => Effect<Experiment | null, never, never>;
|
|
3301
|
+
|
|
3302
|
+
/** The experiment running on a page in this place, or null. */
|
|
3303
|
+
declare const runningExperiment_2: (store: DataStore, type: ContentType, scope: CmsScope, documentId: string) => Promise<Experiment | null>;
|
|
478
3304
|
|
|
479
3305
|
/** Effect-native `saveDraft` for handlers written in `Effect.gen` — the
|
|
480
3306
|
* typed failures ride the error channel (`Effect.catchTag('ContentValidationFailed', …)`). */
|
|
481
|
-
export declare const
|
|
3307
|
+
export declare const saveDraft: (store: DataStore, type: ContentType, row: Readonly<Record<string, unknown>>, scope: CmsScope, options?: SaveDraftOptions) => Effect_2.Effect<Row, ContentValidationFailed | ContentIdConflict | ContentNotFound | RevisionMismatch>;
|
|
3308
|
+
|
|
3309
|
+
export declare interface SaveDraftOptions {
|
|
3310
|
+
/** The revisionId the editor last saw; a draft that moved on is not overwritten. */
|
|
3311
|
+
readonly expectedRevision?: string;
|
|
3312
|
+
/**
|
|
3313
|
+
* For a translation: the source-language revision it now reflects. Omitted
|
|
3314
|
+
* on an update, the previous revision's basis carries over — fixing a typo
|
|
3315
|
+
* does not claim the translation caught up with its source.
|
|
3316
|
+
*/
|
|
3317
|
+
readonly basedOn?: string;
|
|
3318
|
+
/**
|
|
3319
|
+
* The draft is typed in together (draftTexts.ts): its collaborative fields
|
|
3320
|
+
* are taken from the merged texts on the server, not from `row`, and a
|
|
3321
|
+
* draft that moved on since `expectedRevision` only in those fields is no
|
|
3322
|
+
* conflict.
|
|
3323
|
+
*/
|
|
3324
|
+
readonly collaborative?: boolean;
|
|
3325
|
+
/**
|
|
3326
|
+
* With `collaborative`: the editor's own states of the shared texts (each an
|
|
3327
|
+
* encoded CRDT update, by text id), merged in before the save reads them — so
|
|
3328
|
+
* an edit still on its way to the server is not left out of the save.
|
|
3329
|
+
*/
|
|
3330
|
+
readonly texts?: ReadonlyArray<{
|
|
3331
|
+
readonly id: string;
|
|
3332
|
+
readonly update: Uint8Array;
|
|
3333
|
+
}>;
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
/** Effect form of {@link schedulePublish}. */
|
|
3337
|
+
export declare const schedulePublish: (...args: Parameters<typeof schedulePublish_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound, never>;
|
|
482
3338
|
|
|
483
3339
|
/**
|
|
484
3340
|
* Mark a draft to publish automatically at `at`. Sets the draft's
|
|
485
3341
|
* `publishAt` timestamp WITHOUT publishing now — a later `publishDue`
|
|
486
|
-
* sweep flips it live once `at` has passed. Keys off the caller's own
|
|
487
|
-
* draft (a foreign / missing id throws `ContentNotFound`); the draft's
|
|
3342
|
+
* sweep flips it live once `at` has passed. `null` cancels the schedule. Keys off the caller's own
|
|
3343
|
+
* draft in `scope` (a foreign / missing id throws `ContentNotFound`); the draft's
|
|
488
3344
|
* `status` stays `'draft'` until it goes live.
|
|
489
3345
|
*
|
|
490
3346
|
* Returns the updated draft row.
|
|
491
3347
|
*/
|
|
492
|
-
|
|
3348
|
+
declare const schedulePublish_2: (store: DataStore, type: ContentType, id: string, at: Date | null, scope: CmsScope) => Promise<Row>;
|
|
3349
|
+
|
|
3350
|
+
/** Effect form of {@link scheduleRelease}. */
|
|
3351
|
+
export declare const scheduleRelease: (...args: Parameters<typeof scheduleRelease_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound | ReleaseNotEditable | ReviewRequired | ReferenceUnavailable, never>;
|
|
3352
|
+
|
|
3353
|
+
/** Plan a draft release for `at`; `publishDueReleases` takes it live. */
|
|
3354
|
+
declare const scheduleRelease_2: (store: DataStore, releaseId: string, at: Date) => Promise<Row>;
|
|
3355
|
+
|
|
3356
|
+
/** Effect form of {@link scheduleSeries}. */
|
|
3357
|
+
export declare const scheduleSeries: (...args: Parameters<typeof scheduleSeries_2>) => Effect<PublishSeries, ContentValidationFailed | ContentNotFound, never>;
|
|
3358
|
+
|
|
3359
|
+
/**
|
|
3360
|
+
* Give a draft a repeating live window, replacing any series it had, and arm
|
|
3361
|
+
* its first occurrence that has not ended yet. `ContentValidationFailed`
|
|
3362
|
+
* (field `repeat`) for a rule with problems or with no occurrence left;
|
|
3363
|
+
* `ContentNotFound` for a draft the caller cannot see in `scope`. In the
|
|
3364
|
+
* caller's transaction.
|
|
3365
|
+
*/
|
|
3366
|
+
declare const scheduleSeries_2: (tx: DataStore, type: ContentType, draftId: string, scope: CmsScope, rule: RecurrenceRule, now?: Date) => Promise<PublishSeries>;
|
|
493
3367
|
|
|
494
|
-
/** Effect
|
|
495
|
-
|
|
496
|
-
|
|
3368
|
+
/** Effect form of {@link scheduleUnpublish}. */
|
|
3369
|
+
export declare const scheduleUnpublish: (...args: Parameters<typeof scheduleUnpublish_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound, never>;
|
|
3370
|
+
|
|
3371
|
+
/**
|
|
3372
|
+
* Mark an entry to be taken down automatically at `at` — the end of a
|
|
3373
|
+
* campaign, an offer that expires. Stamps the draft's `unpublishAt`; a later
|
|
3374
|
+
* `unpublishDue` sweep unpublishes it once `at` has passed, if it is live
|
|
3375
|
+
* then. It may be set before the entry is live (publish at nine, take down at
|
|
3376
|
+
* five). `null` cancels it. A foreign / missing id throws `ContentNotFound`.
|
|
3377
|
+
*/
|
|
3378
|
+
declare const scheduleUnpublish_2: (store: DataStore, type: ContentType, id: string, at: Date | null, scope: CmsScope) => Promise<Row>;
|
|
497
3379
|
|
|
498
3380
|
/**
|
|
499
3381
|
* The CMS field namespace. Scalars mirror the effect/Schema names the
|
|
@@ -505,7 +3387,10 @@ export declare const Schema: {
|
|
|
505
3387
|
/** Single-line text. `.pipe(maxLength(N>120))` switches it to a textarea. */
|
|
506
3388
|
readonly String: PipeableField;
|
|
507
3389
|
/** Numeric input. */
|
|
3390
|
+
/** A whole number (an integer column); a fraction is refused on save. */
|
|
508
3391
|
readonly Number: PipeableField;
|
|
3392
|
+
/** A number with a fractional part (a `real` column), e.g. a focal point's 0.25. */
|
|
3393
|
+
readonly Fraction: PipeableField;
|
|
509
3394
|
/** Toggle. */
|
|
510
3395
|
readonly Boolean: PipeableField;
|
|
511
3396
|
/** Date-only picker. */
|
|
@@ -518,10 +3403,12 @@ export declare const Schema: {
|
|
|
518
3403
|
/** Closed value set → `<select>` widget + a CHECK constraint. */
|
|
519
3404
|
readonly Literal: (values_0: string, ...values: string[]) => PipeableField;
|
|
520
3405
|
/**
|
|
521
|
-
* Rich text, stored as a
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
3406
|
+
* Rich text, stored as a `RichDocument` (see richDocument.ts): blocks with
|
|
3407
|
+
* stable ids — paragraph, heading, list, table, image — and inline text
|
|
3408
|
+
* with marks and links. `images` / `links` name the content types an image
|
|
3409
|
+
* block and a link reference; unset, that node is refused at save time. A
|
|
3410
|
+
* plain string is saved as paragraphs. The editor widget is
|
|
3411
|
+
* `RichDocumentEditor`.
|
|
525
3412
|
*/
|
|
526
3413
|
readonly RichText: (options?: RichTextOptions) => PipeableField;
|
|
527
3414
|
/**
|
|
@@ -538,11 +3425,492 @@ export declare const Schema: {
|
|
|
538
3425
|
readonly Array: (element: FieldSchema) => PipeableField;
|
|
539
3426
|
/** Nested object. Stored as a JSON document. */
|
|
540
3427
|
readonly Struct: (fields: Readonly<Record<string, FieldSchema>>) => PipeableField;
|
|
3428
|
+
/**
|
|
3429
|
+
* An ordered list of placed components (ADR-CMS-015), stored as a JSON array
|
|
3430
|
+
* of `ComponentInstance`. Only the listed definitions may be placed; each
|
|
3431
|
+
* instance's props are validated against its definition on save.
|
|
3432
|
+
*/
|
|
3433
|
+
readonly Components: (definitions: ReadonlyArray<ComponentDefinition>) => PipeableField;
|
|
3434
|
+
};
|
|
3435
|
+
|
|
3436
|
+
/** What makes a type findable. */
|
|
3437
|
+
export declare interface SearchConfig {
|
|
3438
|
+
/** The string field ranked first — usually the title. */
|
|
3439
|
+
readonly title: string;
|
|
3440
|
+
}
|
|
3441
|
+
|
|
3442
|
+
/** Effect form of {@link searchContent}. */
|
|
3443
|
+
export declare const searchContent: (...args: Parameters<typeof searchContent_2>) => Effect<readonly SearchHit[], never, never>;
|
|
3444
|
+
|
|
3445
|
+
/**
|
|
3446
|
+
* Find documents in a site and environment by the words of `query`, best
|
|
3447
|
+
* first; a hit in the title outranks one in the body. Every word must match,
|
|
3448
|
+
* as a word beginning — `tomato` finds `tomatoes` — on postgres, mysql,
|
|
3449
|
+
* sqlite and the in-memory store (mssql: the whole query as a substring).
|
|
3450
|
+
* An empty query finds nothing.
|
|
3451
|
+
*/
|
|
3452
|
+
declare const searchContent_2: (store: DataStore, place: Pick<CmsScope, "site" | "environment">, query: string, options: SearchOptions) => Promise<ReadonlyArray<SearchHit>>;
|
|
3453
|
+
|
|
3454
|
+
export declare interface SearchHit {
|
|
3455
|
+
readonly contentType: string;
|
|
3456
|
+
readonly documentId: string;
|
|
3457
|
+
readonly variantId: string;
|
|
3458
|
+
readonly locale: string;
|
|
3459
|
+
readonly title: string;
|
|
3460
|
+
readonly snippet: SearchSnippet;
|
|
3461
|
+
/** Higher is more relevant; only comparable within one result. */
|
|
3462
|
+
readonly rank: number;
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
export declare interface SearchOptions {
|
|
3466
|
+
/** `published` for readers, `draft` for editors (every document, in its newest state). */
|
|
3467
|
+
readonly stage: 'draft' | 'published';
|
|
3468
|
+
/** Only this language's variants. */
|
|
3469
|
+
readonly locale?: string;
|
|
3470
|
+
/** Only these content types. */
|
|
3471
|
+
readonly types?: ReadonlyArray<string>;
|
|
3472
|
+
/** At most this many hits (default 20, at most 100). */
|
|
3473
|
+
readonly limit?: number;
|
|
3474
|
+
/** Equality filters, e.g. the tenant for a reader that carries none. */
|
|
3475
|
+
readonly filter?: Readonly<Record<string, unknown>>;
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
/** A passage of the body around the first hit, and where the hits are in it. */
|
|
3479
|
+
export declare interface SearchSnippet {
|
|
3480
|
+
readonly text: string;
|
|
3481
|
+
/** `[start, end)` offsets into `text` of each word that matched. */
|
|
3482
|
+
readonly marks: ReadonlyArray<readonly [number, number]>;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
/** The title and body a row is found by: the title field, and the text of every other field that is not derived. */
|
|
3486
|
+
export declare const searchTextOf: (type: ContentType, values: Readonly<Record<string, unknown>>) => {
|
|
3487
|
+
readonly title: string;
|
|
3488
|
+
readonly body: string;
|
|
3489
|
+
};
|
|
3490
|
+
|
|
3491
|
+
export declare type SecretBinding = {
|
|
3492
|
+
readonly ok: true;
|
|
3493
|
+
} | {
|
|
3494
|
+
readonly ok: false;
|
|
3495
|
+
readonly reason: 'notInstalled' | 'notAsked';
|
|
3496
|
+
};
|
|
3497
|
+
|
|
3498
|
+
/** Effect form of {@link seriesOf}. */
|
|
3499
|
+
export declare const seriesOf: (...args: Parameters<typeof seriesOf_2>) => Effect<PublishSeries | null, ContentValidationFailed | ContentNotFound, never>;
|
|
3500
|
+
|
|
3501
|
+
/** The series of a draft, or null. */
|
|
3502
|
+
declare const seriesOf_2: (store: DataStore, draftId: string) => Promise<PublishSeries | null>;
|
|
3503
|
+
|
|
3504
|
+
/** Effect form of {@link setAiBudget}. */
|
|
3505
|
+
export declare const setAiBudget: (...args: Parameters<typeof setAiBudget_2>) => Effect<void, never, never>;
|
|
3506
|
+
|
|
3507
|
+
/** Set the workspace's monthly token budget; null: no limit. */
|
|
3508
|
+
declare const setAiBudget_2: (tx: DataStore, tenantId: string, monthlyTokens: number | null) => Promise<void>;
|
|
3509
|
+
|
|
3510
|
+
/** Effect form of {@link setAiSettings}. */
|
|
3511
|
+
export declare const setAiSettings: (...args: Parameters<typeof setAiSettings_2>) => Effect<void, never, never>;
|
|
3512
|
+
|
|
3513
|
+
/**
|
|
3514
|
+
* Set the workspace's provider and model, and its own key: a string sets it,
|
|
3515
|
+
* `null` removes it (back to the deployment's), `undefined` keeps it.
|
|
3516
|
+
* `settings: null` goes back to the deployment's provider (a budget stays).
|
|
3517
|
+
*/
|
|
3518
|
+
declare const setAiSettings_2: (tx: DataStore, tenantId: string, settings: {
|
|
3519
|
+
readonly provider: string;
|
|
3520
|
+
readonly model: string;
|
|
3521
|
+
readonly apiKey?: string | null;
|
|
3522
|
+
} | null) => Promise<void>;
|
|
3523
|
+
|
|
3524
|
+
/** Effect form of {@link setExtensionSettings}. */
|
|
3525
|
+
export declare const setExtensionSettings: (...args: Parameters<typeof setExtensionSettings_2>) => Effect<SettingsChange, never, never>;
|
|
3526
|
+
|
|
3527
|
+
/** Set some of an installed extension's settings; every value is checked against its manifest. */
|
|
3528
|
+
declare const setExtensionSettings_2: (tx: DataStore, extensionId: string, values: Readonly<Record<string, unknown>>) => Promise<SettingsChange>;
|
|
3529
|
+
|
|
3530
|
+
/** Effect form of {@link setGlossaryTerm}. */
|
|
3531
|
+
export declare const setGlossaryTerm: (...args: Parameters<typeof setGlossaryTerm_2>) => Effect<"added" | "replaced", never, never>;
|
|
3532
|
+
|
|
3533
|
+
/** Set the entry for a term and language, in the caller's transaction; `added` or `replaced`. */
|
|
3534
|
+
declare const setGlossaryTerm_2: (tx: DataStore, tenantId: string, input: GlossaryInput) => Promise<"added" | "replaced">;
|
|
3535
|
+
|
|
3536
|
+
/** Effect form of {@link setOwner}. */
|
|
3537
|
+
export declare const setOwner: (...args: Parameters<typeof setOwner_2>) => Effect<Stewardship, never, never>;
|
|
3538
|
+
|
|
3539
|
+
/** Make `owner` (an account id) responsible for the document, or nobody (`null`). */
|
|
3540
|
+
declare const setOwner_2: (store: DataStore, type: ContentType, documentId: string, place: Place_2, owner: string | null) => Promise<Stewardship>;
|
|
3541
|
+
|
|
3542
|
+
/** Effect form of {@link setReviewRequired}. */
|
|
3543
|
+
export declare const setReviewRequired: (...args: Parameters<typeof setReviewRequired_2>) => Effect<readonly string[], never, never>;
|
|
3544
|
+
|
|
3545
|
+
/** Turn the workspace's review requirement for `typeName` on or off, in the caller's transaction. */
|
|
3546
|
+
declare const setReviewRequired_2: (tx: DataStore, tenantId: string, typeName: string, required: boolean) => Promise<ReadonlyArray<string>>;
|
|
3547
|
+
|
|
3548
|
+
export declare type SettingsChange = {
|
|
3549
|
+
readonly ok: true;
|
|
3550
|
+
readonly settings: Readonly<Record<string, ExtensionSettingValue>>;
|
|
3551
|
+
} | {
|
|
3552
|
+
readonly ok: false;
|
|
3553
|
+
readonly reason: 'notInstalled';
|
|
3554
|
+
} | {
|
|
3555
|
+
readonly ok: false;
|
|
3556
|
+
readonly reason: 'invalid';
|
|
3557
|
+
readonly problems: ReadonlyArray<string>;
|
|
541
3558
|
};
|
|
542
3559
|
|
|
543
|
-
/**
|
|
3560
|
+
/** What is wrong with values for a manifest's settings; empty when nothing is. Unknown keys are refused. */
|
|
3561
|
+
export declare const settingsProblems: (manifest: CmsExtensionManifest, values: Readonly<Record<string, unknown>>) => ReadonlyArray<string>;
|
|
3562
|
+
|
|
3563
|
+
/** The settings with their defaults filled in, dropping keys the manifest no longer has. */
|
|
3564
|
+
export declare const settingsWithDefaults: (manifest: CmsExtensionManifest, stored: Readonly<Record<string, unknown>>) => Readonly<Record<string, ExtensionSettingValue>>;
|
|
3565
|
+
|
|
3566
|
+
/** Effect form of {@link settleAiOperation}. */
|
|
3567
|
+
export declare const settleAiOperation: (...args: Parameters<typeof settleAiOperation_2>) => Effect<boolean, never, never>;
|
|
3568
|
+
|
|
3569
|
+
/** What the person did with a proposal; false when it is not a pending proposal. */
|
|
3570
|
+
declare const settleAiOperation_2: (tx: DataStore, operationId: string, outcome: "applied" | "discarded") => Promise<boolean>;
|
|
3571
|
+
|
|
3572
|
+
export declare interface SitemapUrl extends PageAlternate {
|
|
3573
|
+
readonly documentId: string;
|
|
3574
|
+
/** ISO date of the variant's last change, when known. */
|
|
3575
|
+
readonly lastmod: string | null;
|
|
3576
|
+
/** The document in every language it has its own variant in, this one included. */
|
|
3577
|
+
readonly alternates: ReadonlyArray<PageAlternate>;
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3580
|
+
/**
|
|
3581
|
+
* Every page the sitemap lists: each language's own variants (never a
|
|
3582
|
+
* fallback), those `include` accepts (leave out pages not for search
|
|
3583
|
+
* engines), with their alternates.
|
|
3584
|
+
*/
|
|
3585
|
+
export declare const sitemapUrls: (trees: ReadonlyArray<LocalizedTree>, include?: (node: TreeNode) => boolean) => ReadonlyArray<SitemapUrl>;
|
|
3586
|
+
|
|
3587
|
+
/**
|
|
3588
|
+
* The sitemap document. `href(locale, path)` makes a page's absolute URL;
|
|
3589
|
+
* `xDefault` names the language an unmatched reader gets.
|
|
3590
|
+
*/
|
|
3591
|
+
export declare const sitemapXml: (urls: ReadonlyArray<SitemapUrl>, href: (locale: string, path: string) => string, xDefault?: string) => string;
|
|
3592
|
+
|
|
3593
|
+
/**
|
|
3594
|
+
* The canonical slug helper: lowercase, letters with accents folded to their
|
|
3595
|
+
* base letter (umlauts spelled out, `ß` as `ss`), hyphenate, strip every
|
|
3596
|
+
* other non-url character.
|
|
3597
|
+
*/
|
|
544
3598
|
export declare const slugify: (value: unknown) => string;
|
|
545
3599
|
|
|
3600
|
+
/** The passage of `body` around the first word that starts with a query word. */
|
|
3601
|
+
export declare const snippetOf: (body: string, query: string) => SearchSnippet;
|
|
3602
|
+
|
|
3603
|
+
/** Mark an element of the preview with the field path it renders. */
|
|
3604
|
+
export declare const sourceAttributes: (path: string) => {
|
|
3605
|
+
readonly "data-cms-source": string;
|
|
3606
|
+
};
|
|
3607
|
+
|
|
3608
|
+
/** The field path behind a clicked element of the preview, or null. */
|
|
3609
|
+
export declare const sourcePathOf: (target: unknown) => string | null;
|
|
3610
|
+
|
|
3611
|
+
/** Effect form of {@link startExperiment}. */
|
|
3612
|
+
export declare const startExperiment: (...args: Parameters<typeof startExperiment_2>) => Effect<StartExperimentResult, never, never>;
|
|
3613
|
+
|
|
3614
|
+
/** Start an experiment on a live page, in the caller's transaction. */
|
|
3615
|
+
declare const startExperiment_2: (tx: DataStore, type: ContentType, scope: CmsScope, input: StartExperimentInput, now?: Date) => Promise<StartExperimentResult>;
|
|
3616
|
+
|
|
3617
|
+
export declare interface StartExperimentInput {
|
|
3618
|
+
readonly documentId: string;
|
|
3619
|
+
readonly name: string;
|
|
3620
|
+
/** Percent of readers shown version B (1–99). */
|
|
3621
|
+
readonly share: number;
|
|
3622
|
+
readonly overrides: Readonly<Record<string, string>>;
|
|
3623
|
+
readonly goal: string;
|
|
3624
|
+
/** Required: what B is expected to change, and why (at most 500 characters). */
|
|
3625
|
+
readonly hypothesis: string;
|
|
3626
|
+
/** Optional guardrail, 1–50 percentage points. */
|
|
3627
|
+
readonly guardrailMaxDrop?: number | null;
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
export declare type StartExperimentResult = {
|
|
3631
|
+
readonly ok: true;
|
|
3632
|
+
readonly id: string;
|
|
3633
|
+
} | {
|
|
3634
|
+
readonly ok: false;
|
|
3635
|
+
readonly reason: 'notLive' | 'alreadyRunning' | 'noOverrides' | 'badShare' | 'unknownField' | 'noHypothesis' | 'badGuardrail';
|
|
3636
|
+
readonly fields?: ReadonlyArray<string>;
|
|
3637
|
+
};
|
|
3638
|
+
|
|
3639
|
+
/** Effect form of {@link startStewardship}. */
|
|
3640
|
+
export declare const startStewardship: (...args: Parameters<typeof startStewardship_2>) => Effect<void, never, never>;
|
|
3641
|
+
|
|
3642
|
+
/**
|
|
3643
|
+
* On a publish, in the caller's transaction: for a type that declares a
|
|
3644
|
+
* review cycle, the document's first publish in this site and environment
|
|
3645
|
+
* starts it. Later publishes leave the date alone — a review is a decision,
|
|
3646
|
+
* not a side effect of saving. A type without `lifecycle` writes nothing.
|
|
3647
|
+
*/
|
|
3648
|
+
declare const startStewardship_2: (tx: DataStore, type: ContentType, documentId: string, place: Place_2, tenantId: unknown, now?: Date) => Promise<void>;
|
|
3649
|
+
|
|
3650
|
+
export declare interface Stewardship {
|
|
3651
|
+
readonly owner: string | null;
|
|
3652
|
+
readonly reviewDue: Date | null;
|
|
3653
|
+
readonly reviewedAt: Date | null;
|
|
3654
|
+
readonly reviewedBy: string | null;
|
|
3655
|
+
readonly reviewedRevision: string | null;
|
|
3656
|
+
readonly review: ReviewState;
|
|
3657
|
+
}
|
|
3658
|
+
|
|
3659
|
+
/** Effect form of {@link stewardshipOf}. */
|
|
3660
|
+
export declare const stewardshipOf: (...args: Parameters<typeof stewardshipOf_2>) => Effect<Stewardship, never, never>;
|
|
3661
|
+
|
|
3662
|
+
/** The document's owner and review state. A document never published has neither. */
|
|
3663
|
+
declare const stewardshipOf_2: (store: DataStore, type: ContentType, documentId: string, place: Place_2, now?: Date) => Promise<Stewardship>;
|
|
3664
|
+
|
|
3665
|
+
/** Effect form of {@link stopExperiment}. */
|
|
3666
|
+
export declare const stopExperiment: (...args: Parameters<typeof stopExperiment_2>) => Effect<boolean, never, never>;
|
|
3667
|
+
|
|
3668
|
+
/** Stop a running experiment; its counts stay. False when there is none of that id running. */
|
|
3669
|
+
declare const stopExperiment_2: (tx: DataStore, experimentId: string, now?: Date) => Promise<boolean>;
|
|
3670
|
+
|
|
3671
|
+
/** A type's taxonomy — see `ContentTypeSpec.taxonomy`. */
|
|
3672
|
+
export declare interface TaxonomyConfig {
|
|
3673
|
+
/** A declared `Schema.Array(Schema.String)` field. */
|
|
3674
|
+
readonly field: string;
|
|
3675
|
+
readonly terms: ReadonlyArray<VocabularyTerm>;
|
|
3676
|
+
/** A term outside the vocabulary: `refuse` (default) fails the save, `keep` keeps it as typed. */
|
|
3677
|
+
readonly unknown?: 'refuse' | 'keep';
|
|
3678
|
+
}
|
|
3679
|
+
|
|
3680
|
+
/** The value a save stores: the normalised terms, then the unknown ones (refused by validation unless kept). */
|
|
3681
|
+
export declare const taxonomyValue: (config: Pick<TaxonomyConfig, "terms">, input: ReadonlyArray<unknown>) => ReadonlyArray<string>;
|
|
3682
|
+
|
|
3683
|
+
/** Effect form of {@link teamDefaultRole}. */
|
|
3684
|
+
export declare const teamDefaultRole: (...args: Parameters<typeof teamDefaultRole_2>) => Effect<string | null, never, never>;
|
|
3685
|
+
|
|
3686
|
+
/** The role a new editor of the workspace gets, or null (the app's own default). */
|
|
3687
|
+
declare const teamDefaultRole_2: (store: DataStore, tenantId: string) => Promise<string | null>;
|
|
3688
|
+
|
|
3689
|
+
/** Effect form of {@link teamInvitations}. */
|
|
3690
|
+
export declare const teamInvitations: (...args: Parameters<typeof teamInvitations_2>) => Effect<readonly {
|
|
3691
|
+
readonly email: string;
|
|
3692
|
+
readonly role: string;
|
|
3693
|
+
}[], never, never>;
|
|
3694
|
+
|
|
3695
|
+
/** Everyone invited to the workspace, by address. */
|
|
3696
|
+
declare const teamInvitations_2: (store: DataStore, tenantId: string) => Promise<ReadonlyArray<{
|
|
3697
|
+
readonly email: string;
|
|
3698
|
+
readonly role: string;
|
|
3699
|
+
}>>;
|
|
3700
|
+
|
|
3701
|
+
export declare interface TeamPlan {
|
|
3702
|
+
/** `set`: the workspace gets it; `kept`: it has one already; null: the blueprint names none. */
|
|
3703
|
+
readonly defaultRole: {
|
|
3704
|
+
readonly role: string;
|
|
3705
|
+
readonly action: 'set' | 'kept';
|
|
3706
|
+
} | null;
|
|
3707
|
+
readonly members: ReadonlyArray<{
|
|
3708
|
+
readonly email: string;
|
|
3709
|
+
readonly role: string;
|
|
3710
|
+
readonly action: 'invite' | 'present';
|
|
3711
|
+
}>;
|
|
3712
|
+
/** Types that need a review: `require` is new for the workspace, `present` it had already. */
|
|
3713
|
+
readonly reviewRequired: ReadonlyArray<{
|
|
3714
|
+
readonly type: string;
|
|
3715
|
+
readonly action: 'require' | 'present';
|
|
3716
|
+
}>;
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
/** What is wrong with a blueprint's team; empty when nothing is. */
|
|
3720
|
+
export declare const teamProblems: (team: BlueprintTeam) => ReadonlyArray<string>;
|
|
3721
|
+
|
|
3722
|
+
/** The template a row names, if any (undefined for none, null for an unknown id). */
|
|
3723
|
+
export declare const templateOf: (type: Typed, row: Readonly<Record<string, unknown>>) => PageTemplate | null | undefined;
|
|
3724
|
+
|
|
3725
|
+
/** Declared on a content type as `templates`. */
|
|
3726
|
+
export declare interface TemplatesConfig {
|
|
3727
|
+
/** An optional string field that stores the template's id. */
|
|
3728
|
+
readonly field: string;
|
|
3729
|
+
/** The `Schema.Components` field the rules apply to. */
|
|
3730
|
+
readonly components: string;
|
|
3731
|
+
readonly list: ReadonlyArray<PageTemplate>;
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3734
|
+
/**
|
|
3735
|
+
* The values a new document built from `templateId` starts with: the
|
|
3736
|
+
* template's id, its preset values and its components (the save stamps each
|
|
3737
|
+
* component's instance id). Null for an unknown template.
|
|
3738
|
+
*/
|
|
3739
|
+
export declare const templateValues: (type: Typed, templateId: string) => Record<string, unknown> | null;
|
|
3740
|
+
|
|
3741
|
+
/** Where a row breaks the rules of the template it names. Empty when it keeps them. */
|
|
3742
|
+
export declare const templateViolations: (type: Typed, row: Readonly<Record<string, unknown>>) => ReadonlyArray<FieldViolation>;
|
|
3743
|
+
|
|
3744
|
+
/** The entries whose term `text` (in the source language) contains. */
|
|
3745
|
+
export declare const termsIn: (text: string, entries: ReadonlyArray<GlossaryEntry>) => ReadonlyArray<GlossaryEntry>;
|
|
3746
|
+
|
|
3747
|
+
/**
|
|
3748
|
+
* Put `mark` on the text in `[start, end)`, or take it off when all of it
|
|
3749
|
+
* already carries it. Text runs are split at the edges; a link is left as it
|
|
3750
|
+
* is (a link carries no marks).
|
|
3751
|
+
*/
|
|
3752
|
+
export declare const toggleMark: (content: ReadonlyArray<RichInline>, start: number, end: number, mark: RichMark) => ReadonlyArray<RichInline>;
|
|
3753
|
+
|
|
3754
|
+
export declare interface ToolExposure {
|
|
3755
|
+
readonly tool: string;
|
|
3756
|
+
readonly state: 'on' | 'off' | 'locked';
|
|
3757
|
+
/** The step of the chain that decided it; null for the site's default. */
|
|
3758
|
+
readonly decidedAt: number | null;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
/** An XLIFF 2.1 core document for one file. */
|
|
3762
|
+
export declare const toXliff: (exchange: XliffExchange) => string;
|
|
3763
|
+
|
|
3764
|
+
/** Where one language stands against the source. */
|
|
3765
|
+
export declare interface TranslationState {
|
|
3766
|
+
readonly locale: string;
|
|
3767
|
+
/**
|
|
3768
|
+
* `missing` — no variant; `upToDate` — based on the source's current
|
|
3769
|
+
* revision; `outdated` — based on an older one (see `changed`);
|
|
3770
|
+
* `unknown` — the variant never said what it was based on.
|
|
3771
|
+
*/
|
|
3772
|
+
readonly state: 'missing' | 'upToDate' | 'outdated' | 'unknown';
|
|
3773
|
+
readonly variantId: string | null;
|
|
3774
|
+
/** For `outdated`: the source fields that changed since its basis. */
|
|
3775
|
+
readonly changed: ReadonlyArray<string>;
|
|
3776
|
+
}
|
|
3777
|
+
|
|
3778
|
+
/** The source's variant and each target language's state. */
|
|
3779
|
+
export declare interface TranslationStatus {
|
|
3780
|
+
/** The source variant (null when the document has none in the source language). */
|
|
3781
|
+
readonly source: {
|
|
3782
|
+
readonly variantId: string;
|
|
3783
|
+
readonly revisionId: string;
|
|
3784
|
+
} | null;
|
|
3785
|
+
readonly targets: ReadonlyArray<TranslationState>;
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
/** Effect form of {@link translationStatus}. */
|
|
3789
|
+
export declare const translationStatus: (...args: Parameters<typeof translationStatus_2>) => Effect<TranslationStatus, never, never>;
|
|
3790
|
+
|
|
3791
|
+
/** The translation status of one document; `translationStatuses` for many. */
|
|
3792
|
+
declare const translationStatus_2: (store: DataStore, type: ContentType, documentId: string, scope: Pick<CmsScope, "site" | "environment">, sourceLocale: string, targetLocales: ReadonlyArray<string>) => Promise<TranslationStatus>;
|
|
3793
|
+
|
|
3794
|
+
/** Effect form of {@link translationStatuses}. */
|
|
3795
|
+
export declare const translationStatuses: (...args: Parameters<typeof translationStatuses_2>) => Effect<ReadonlyMap<string, TranslationStatus>, never, never>;
|
|
3796
|
+
|
|
3797
|
+
/**
|
|
3798
|
+
* The translation status of each of `documentIds`, read together: three
|
|
3799
|
+
* reads per 500 documents (their variants, those revisions, the revisions
|
|
3800
|
+
* they were based on), not three per document.
|
|
3801
|
+
*/
|
|
3802
|
+
declare const translationStatuses_2: (store: DataStore, type: ContentType, documentIds: ReadonlyArray<string>, scope: Pick<CmsScope, "site" | "environment">, sourceLocale: string, targetLocales: ReadonlyArray<string>) => Promise<ReadonlyMap<string, TranslationStatus>>;
|
|
3803
|
+
|
|
3804
|
+
export declare interface TranslationUnit {
|
|
3805
|
+
/** Where the text lives: `title`, `body/<blockId>`, `body/<blockId>/<item>`,
|
|
3806
|
+
* `body/<blockId>/<row>.<cell>`, `body/<blockId>/caption`,
|
|
3807
|
+
* `sections/<instanceId>/<prop>`. */
|
|
3808
|
+
readonly id: string;
|
|
3809
|
+
readonly source: string;
|
|
3810
|
+
/** The translation, when there is one. */
|
|
3811
|
+
readonly target?: string;
|
|
3812
|
+
/** XLIFF segment state. */
|
|
3813
|
+
readonly state?: 'initial' | 'translated' | 'reviewed' | 'final';
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
/** The translatable text of a document's values, one unit per piece, in field order. Empty text is left out. */
|
|
3817
|
+
export declare const translationUnits: (fields: Readonly<Record<string, FieldSchema>>, values: Readonly<Record<string, unknown>>, prefix?: string) => ReadonlyArray<TranslationUnit>;
|
|
3818
|
+
|
|
3819
|
+
/** How a content type forms a tree. Validated by `defineContentType`. */
|
|
3820
|
+
export declare interface TreeConfig {
|
|
3821
|
+
/** An optional `Schema.Reference(<this type>)` field: the parent document. */
|
|
3822
|
+
readonly parent: string;
|
|
3823
|
+
/** An optional number field ordering siblings (ascending; unset sorts last). */
|
|
3824
|
+
readonly order?: string;
|
|
3825
|
+
/** The string field that is this node's path segment — usually the slug. */
|
|
3826
|
+
readonly segment: string;
|
|
3827
|
+
/**
|
|
3828
|
+
* Optional fields a page takes from the nearest ancestor that sets them
|
|
3829
|
+
* (a header, a footer): read with {@link inheritedValue}. `locked: true`
|
|
3830
|
+
* means no page may set it — only whatever the app supplies above the
|
|
3831
|
+
* tree (a site default).
|
|
3832
|
+
*/
|
|
3833
|
+
readonly inherit?: Readonly<Record<string, InheritRule>>;
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
/** One published variant offered to {@link buildTree}. */
|
|
3837
|
+
export declare interface TreeEntry {
|
|
3838
|
+
readonly row: Row;
|
|
3839
|
+
readonly locale: string;
|
|
3840
|
+
readonly fallback: boolean;
|
|
3841
|
+
}
|
|
3842
|
+
|
|
3843
|
+
/** One published document placed in the tree. */
|
|
3844
|
+
export declare interface TreeNode {
|
|
3845
|
+
readonly documentId: string;
|
|
3846
|
+
/** The parent's documentId; null at the root. */
|
|
3847
|
+
readonly parent: string | null;
|
|
3848
|
+
/** 0 at the root. */
|
|
3849
|
+
readonly depth: number;
|
|
3850
|
+
/** The segments from the root down to this node. */
|
|
3851
|
+
readonly segments: ReadonlyArray<string>;
|
|
3852
|
+
/** `segments` joined with `/`. */
|
|
3853
|
+
readonly path: string;
|
|
3854
|
+
/** The published variant that answers for this document. */
|
|
3855
|
+
readonly row: Row;
|
|
3856
|
+
/** The locale of `row`. */
|
|
3857
|
+
readonly locale: string;
|
|
3858
|
+
/** True when `row` is a fallback locale's variant. */
|
|
3859
|
+
readonly fallback: boolean;
|
|
3860
|
+
}
|
|
3861
|
+
|
|
3862
|
+
/** What {@link CmsApi.tree} and {@link CmsApi.route} read. */
|
|
3863
|
+
export declare interface TreeOptions {
|
|
3864
|
+
/** Locales to take a document's variant from, in order, when the requested
|
|
3865
|
+
* locale has none. */
|
|
3866
|
+
readonly fallback?: ReadonlyArray<string>;
|
|
3867
|
+
/** Equality filters applied to every row read (e.g. the site's tenant). */
|
|
3868
|
+
readonly filter?: Readonly<Record<string, unknown>>;
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
declare type Typed = {
|
|
3872
|
+
readonly name: string;
|
|
3873
|
+
readonly fields: Readonly<Record<string, FieldSchema>>;
|
|
3874
|
+
readonly templates?: TemplatesConfig;
|
|
3875
|
+
};
|
|
3876
|
+
|
|
3877
|
+
/** Effect form of {@link typeDraftText}. */
|
|
3878
|
+
export declare const typeDraftText: (...args: Parameters<typeof typeDraftText_2>) => Effect<Readonly<Record<string, unknown>>, ContentNotFound, never>;
|
|
3879
|
+
|
|
3880
|
+
/**
|
|
3881
|
+
* Merge one editor's edit (an encoded CRDT update) into a text. The merge is
|
|
3882
|
+
* order-independent, so edits that cross on the wire both survive.
|
|
3883
|
+
* `ContentNotFound` for a text the caller cannot see. In the caller's
|
|
3884
|
+
* transaction.
|
|
3885
|
+
*/
|
|
3886
|
+
declare const typeDraftText_2: (tx: DataStore, textId: string, update: Uint8Array) => Promise<Row>;
|
|
3887
|
+
|
|
3888
|
+
/** Effect form of {@link unavailableAmong}. */
|
|
3889
|
+
export declare const unavailableAmong: (...args: Parameters<typeof unavailableAmong_2>) => Effect<ReadonlyMap<string, UnavailableReason>, ReferenceUnavailable, never>;
|
|
3890
|
+
|
|
3891
|
+
/**
|
|
3892
|
+
* The documents among `documentIds` that may not be used at `now`, with why.
|
|
3893
|
+
* A document without a record (a type without availability, not published
|
|
3894
|
+
* yet) is not listed.
|
|
3895
|
+
*/
|
|
3896
|
+
declare const unavailableAmong_2: (store: DataStore, documentIds: ReadonlyArray<string>, scope: Pick<CmsScope, "site" | "environment">, now?: Date) => Promise<ReadonlyMap<string, UnavailableReason>>;
|
|
3897
|
+
|
|
3898
|
+
/** Why a referenced document may not be used. */
|
|
3899
|
+
export declare type UnavailableReason = 'blocked' | 'expired';
|
|
3900
|
+
|
|
3901
|
+
/** Undo the last step: the form to show, and the history after it; null when there is nothing to undo. */
|
|
3902
|
+
export declare const undoEdit: (history: EditHistory, current: Readonly<Record<string, unknown>>) => {
|
|
3903
|
+
readonly history: EditHistory;
|
|
3904
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
3905
|
+
readonly label: string;
|
|
3906
|
+
} | null;
|
|
3907
|
+
|
|
3908
|
+
/** Effect form of {@link uninstallExtension}. */
|
|
3909
|
+
export declare const uninstallExtension: (...args: Parameters<typeof uninstallExtension_2>) => Effect<ExtensionRemoval, never, never>;
|
|
3910
|
+
|
|
3911
|
+
/** Remove an extension and its data; the data comes back as the export. */
|
|
3912
|
+
declare const uninstallExtension_2: (tx: DataStore, extensionId: string) => Promise<ExtensionRemoval>;
|
|
3913
|
+
|
|
546
3914
|
/**
|
|
547
3915
|
* Mark a string field unique PER TENANT. The derived `<type>_drafts` +
|
|
548
3916
|
* `<type>_published` tables get a real composite `(tenantId, <field>)`
|
|
@@ -553,16 +3921,35 @@ export declare const slugify: (value: unknown) => string;
|
|
|
553
3921
|
*/
|
|
554
3922
|
export declare const unique: () => FieldRefinement;
|
|
555
3923
|
|
|
3924
|
+
/** A stable fingerprint of the units' ids and source text — the import checks the source has not changed since. */
|
|
3925
|
+
export declare const unitsHash: (units: ReadonlyArray<TranslationUnit>) => string;
|
|
3926
|
+
|
|
3927
|
+
/** Effect-native `unpublish` (see {@link saveDraftEffect}). */
|
|
3928
|
+
export declare const unpublish: (store: DataStore, type: ContentType, id: string, scope: CmsScope) => Effect_2.Effect<void, ContentNotFound>;
|
|
3929
|
+
|
|
3930
|
+
/** Effect form of {@link unpublishDue}. */
|
|
3931
|
+
export declare const unpublishDue: (...args: Parameters<typeof unpublishDue_2>) => Effect<readonly string[], never, never>;
|
|
3932
|
+
|
|
556
3933
|
/**
|
|
557
|
-
* Take
|
|
558
|
-
* the
|
|
559
|
-
*
|
|
560
|
-
*
|
|
3934
|
+
* Take down every entry of `type` whose scheduled `unpublishAt` has passed.
|
|
3935
|
+
* Returns the ids that were unpublished. Each in its own transaction: the
|
|
3936
|
+
* published copy goes (with its references and search entry, as `unpublish`
|
|
3937
|
+
* does) and `unpublishAt` is cleared together. An entry that is not live when
|
|
3938
|
+
* its time comes only has the marker cleared — there is nothing to take down.
|
|
3939
|
+
* Idempotent; hand it a store outside any transaction (a schedule's
|
|
3940
|
+
* `app.store`), which sweeps every tenant, or a request store for one.
|
|
561
3941
|
*/
|
|
562
|
-
|
|
3942
|
+
declare const unpublishDue_2: (store: DataStore, type: ContentType, now?: Date) => Promise<ReadonlyArray<string>>;
|
|
563
3943
|
|
|
564
|
-
/** Effect
|
|
565
|
-
export declare const
|
|
3944
|
+
/** Effect form of {@link upgradeExtension}. */
|
|
3945
|
+
export declare const upgradeExtension: (...args: Parameters<typeof upgradeExtension_2>) => Effect<ExtensionChange, never, never>;
|
|
3946
|
+
|
|
3947
|
+
/**
|
|
3948
|
+
* Move an installed extension to a newer `manifest`. Nothing new asked for:
|
|
3949
|
+
* applied now, and the grant becomes exactly what the new version asks for.
|
|
3950
|
+
* Anything new: it waits (`pending`), the installed version keeps running.
|
|
3951
|
+
*/
|
|
3952
|
+
declare const upgradeExtension_2: (tx: DataStore, manifest: CmsExtensionManifest) => Promise<ExtensionChange>;
|
|
566
3953
|
|
|
567
3954
|
/**
|
|
568
3955
|
* Typed accessor for handlers — reads the `cms` slot the app attached to
|
|
@@ -574,13 +3961,42 @@ export declare const useCms: (ctx: {
|
|
|
574
3961
|
readonly cms?: unknown;
|
|
575
3962
|
}) => CmsApi;
|
|
576
3963
|
|
|
3964
|
+
/** Effect form of {@link usedBy}. */
|
|
3965
|
+
export declare const usedBy: (...args: Parameters<typeof usedBy_2>) => Effect<readonly ReferenceUse[], never, never>;
|
|
3966
|
+
|
|
3967
|
+
/**
|
|
3968
|
+
* Where a document is used by published content, in one site and
|
|
3969
|
+
* environment, across locales. The store's tenant scoping applies: a request
|
|
3970
|
+
* store sees its own tenant's uses only.
|
|
3971
|
+
*/
|
|
3972
|
+
declare const usedBy_2: (store: DataStore, target: {
|
|
3973
|
+
readonly type: string;
|
|
3974
|
+
readonly documentId: string;
|
|
3975
|
+
}, scope: Pick<CmsScope, "site" | "environment">) => Promise<ReadonlyArray<ReferenceUse>>;
|
|
3976
|
+
|
|
577
3977
|
/**
|
|
578
3978
|
* Validate a row against a content type's save-time rules. Throws
|
|
579
3979
|
* `ContentValidationFailed` carrying EVERY violation (per-field detail)
|
|
580
3980
|
* when any rule breaks; returns nothing on success. The throwing face of
|
|
581
3981
|
* `contentViolations` — `saveDraft` calls this after derivation.
|
|
582
3982
|
*/
|
|
583
|
-
export declare const validateContent: (type: Pick<ContentType, "name" | "fields"
|
|
3983
|
+
export declare const validateContent: (type: Pick<ContentType, "name" | "fields"> & Partial<Pick<ContentType, "taxonomy">>, row: Readonly<Record<string, unknown>>) => void;
|
|
3984
|
+
|
|
3985
|
+
/**
|
|
3986
|
+
* A field's value as the text a person compares: a rich document's text (one
|
|
3987
|
+
* line per block), a component list one line per component with its text
|
|
3988
|
+
* props, a date as its ISO time, anything else structured as compact JSON.
|
|
3989
|
+
*/
|
|
3990
|
+
export declare const valueText: (value: unknown) => string;
|
|
3991
|
+
|
|
3992
|
+
export declare type Variant = 'A' | 'B';
|
|
3993
|
+
|
|
3994
|
+
export declare interface VariantResult {
|
|
3995
|
+
readonly readers: number;
|
|
3996
|
+
readonly conversions: number;
|
|
3997
|
+
/** conversions / readers; 0 without readers. */
|
|
3998
|
+
readonly rate: number;
|
|
3999
|
+
}
|
|
584
4000
|
|
|
585
4001
|
/**
|
|
586
4002
|
* Verify a preview token. Returns the `{ type, id }` claim on success,
|
|
@@ -591,6 +4007,34 @@ export declare const verifyPreviewToken: (token: string, options?: {
|
|
|
591
4007
|
secret?: string;
|
|
592
4008
|
}) => PreviewClaim | null;
|
|
593
4009
|
|
|
4010
|
+
export declare const VISUAL_EDITING_PROTOCOL = "voltro.cms.visual/1";
|
|
4011
|
+
|
|
4012
|
+
/** A message for the other side of `session`. */
|
|
4013
|
+
export declare const visualMessage: <M extends {
|
|
4014
|
+
readonly kind: string;
|
|
4015
|
+
}>(session: VisualSession, message: M) => M & {
|
|
4016
|
+
protocol: typeof VISUAL_EDITING_PROTOCOL;
|
|
4017
|
+
nonce: string;
|
|
4018
|
+
};
|
|
4019
|
+
|
|
4020
|
+
/** A message event as far as these checks read it. */
|
|
4021
|
+
export declare interface VisualMessageEvent {
|
|
4022
|
+
readonly origin: string;
|
|
4023
|
+
readonly data: unknown;
|
|
4024
|
+
}
|
|
4025
|
+
|
|
4026
|
+
/** Who may talk: the one origin, with the nonce of this session. */
|
|
4027
|
+
export declare interface VisualSession {
|
|
4028
|
+
readonly origin: string;
|
|
4029
|
+
readonly nonce: string;
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
/** One term and the spellings that mean it. */
|
|
4033
|
+
export declare interface VocabularyTerm {
|
|
4034
|
+
readonly term: string;
|
|
4035
|
+
readonly synonyms?: ReadonlyArray<string>;
|
|
4036
|
+
}
|
|
4037
|
+
|
|
594
4038
|
/** Comparison operators accepted by `.where(field, op, value)`. */
|
|
595
4039
|
export declare type WhereOp = '=' | '!=' | '<' | '<=' | '>' | '>=';
|
|
596
4040
|
|
|
@@ -601,10 +4045,66 @@ export declare const widgetFor: (hint: EditorHint, overrides?: Partial<Record<Ed
|
|
|
601
4045
|
|
|
602
4046
|
/** Props for a single field widget. */
|
|
603
4047
|
export declare interface WidgetProps {
|
|
4048
|
+
/** The control's element id — the field's `<label>` points at it, so a
|
|
4049
|
+
* widget that renders its own control must put it on that control. */
|
|
4050
|
+
readonly id: string;
|
|
604
4051
|
readonly name: string;
|
|
605
4052
|
readonly field: FieldSchema;
|
|
606
4053
|
readonly value: unknown;
|
|
607
4054
|
readonly onChange: (value: unknown) => void;
|
|
608
4055
|
}
|
|
609
4056
|
|
|
4057
|
+
/** Effect form of {@link withdrawInvitation}. */
|
|
4058
|
+
export declare const withdrawInvitation: (...args: Parameters<typeof withdrawInvitation_2>) => Effect<boolean, never, never>;
|
|
4059
|
+
|
|
4060
|
+
/** Withdraw the invitation of `email`; false when there was none. */
|
|
4061
|
+
declare const withdrawInvitation_2: (tx: DataStore, tenantId: string, email: string) => Promise<boolean>;
|
|
4062
|
+
|
|
4063
|
+
/** A component withheld for want of consent: which purpose would release it. */
|
|
4064
|
+
export declare interface WithheldInstance {
|
|
4065
|
+
readonly instanceId: string;
|
|
4066
|
+
readonly componentId: string;
|
|
4067
|
+
readonly consentRequired: string;
|
|
4068
|
+
readonly props: Readonly<Record<string, never>>;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
/** Effect form of {@link workspaceReviewTypes}. */
|
|
4072
|
+
export declare const workspaceReviewTypes: (...args: Parameters<typeof workspaceReviewTypes_2>) => Effect<readonly string[], never, never>;
|
|
4073
|
+
|
|
4074
|
+
/** The content types whose publishing needs a review in the workspace (those left to it). */
|
|
4075
|
+
declare const workspaceReviewTypes_2: (store: DataStore, tenantId: string) => Promise<ReadonlyArray<string>>;
|
|
4076
|
+
|
|
4077
|
+
/** Effect form of {@link writeAvailability}. */
|
|
4078
|
+
export declare const writeAvailability: (...args: Parameters<typeof writeAvailability_2>) => Effect<void, ReferenceUnavailable, never>;
|
|
4079
|
+
|
|
4080
|
+
/** Record the availability a published document of `type` now has. */
|
|
4081
|
+
declare const writeAvailability_2: (tx: DataStore, type: ContentType, published: Row, scope: CmsScope) => Promise<void>;
|
|
4082
|
+
|
|
4083
|
+
export declare interface XliffExchange {
|
|
4084
|
+
readonly srcLang: string;
|
|
4085
|
+
readonly trgLang: string;
|
|
4086
|
+
/** The `<file id>` — which document and revision this is. */
|
|
4087
|
+
readonly fileId: string;
|
|
4088
|
+
/** `<note category>` → text: what the importer checks (source hash, type, revision). */
|
|
4089
|
+
readonly notes: Readonly<Record<string, string>>;
|
|
4090
|
+
readonly units: ReadonlyArray<TranslationUnit>;
|
|
4091
|
+
}
|
|
4092
|
+
|
|
4093
|
+
/** An XLIFF file that cannot be read, or would be unsafe to. */
|
|
4094
|
+
export declare class XliffInvalid extends Error {
|
|
4095
|
+
readonly reason: string;
|
|
4096
|
+
readonly _tag = "XliffInvalid";
|
|
4097
|
+
constructor(reason: string);
|
|
4098
|
+
}
|
|
4099
|
+
|
|
4100
|
+
/**
|
|
4101
|
+
* The instant a local wall time means in `zone`. A wall time in a gap moves
|
|
4102
|
+
* to the first moment after it (`gap`); one in a fold takes the earlier of
|
|
4103
|
+
* its two instants (`fold`).
|
|
4104
|
+
*/
|
|
4105
|
+
export declare const zonedInstant: (local: string, zone: string) => {
|
|
4106
|
+
readonly instant: Date;
|
|
4107
|
+
readonly adjusted?: "gap" | "fold";
|
|
4108
|
+
};
|
|
4109
|
+
|
|
610
4110
|
export { }
|