@krantho/persistence 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/auth.d.ts +79 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +2 -0
- package/dist/auth.js.map +1 -0
- package/dist/content-contract.d.ts +36 -0
- package/dist/content-contract.d.ts.map +1 -0
- package/dist/content-contract.js +70 -0
- package/dist/content-contract.js.map +1 -0
- package/dist/content-query.d.ts +48 -0
- package/dist/content-query.d.ts.map +1 -0
- package/dist/content-query.js +5 -0
- package/dist/content-query.js.map +1 -0
- package/dist/content-row.d.ts +59 -0
- package/dist/content-row.d.ts.map +1 -0
- package/dist/content-row.js +60 -0
- package/dist/content-row.js.map +1 -0
- package/dist/index.d.ts +503 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/live-version.d.ts +44 -0
- package/dist/live-version.d.ts.map +1 -0
- package/dist/live-version.js +74 -0
- package/dist/live-version.js.map +1 -0
- package/dist/migration-utils.d.ts +35 -0
- package/dist/migration-utils.d.ts.map +1 -0
- package/dist/migration-utils.js +50 -0
- package/dist/migration-utils.js.map +1 -0
- package/dist/migrations.d.ts +119 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +2 -0
- package/dist/migrations.js.map +1 -0
- package/dist/page-cache.d.ts +77 -0
- package/dist/page-cache.d.ts.map +1 -0
- package/dist/page-cache.js +65 -0
- package/dist/page-cache.js.map +1 -0
- package/dist/repository-content.d.ts +45 -0
- package/dist/repository-content.d.ts.map +1 -0
- package/dist/repository-content.js +94 -0
- package/dist/repository-content.js.map +1 -0
- package/dist/sort-columns.d.ts +19 -0
- package/dist/sort-columns.d.ts.map +1 -0
- package/dist/sort-columns.js +21 -0
- package/dist/sort-columns.js.map +1 -0
- package/package.json +35 -3
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import type { AuthoredMetadata } from './content-contract.js';
|
|
2
|
+
export type { AuthoredMetadata, AuthoredWrite, ContentContract, ContractReference, DefaultProvenance, MetadataGroupContract, } from './content-contract.js';
|
|
3
|
+
export { authoredMetadata, authoredOf, ContentWriteConflict, documentSeoRow, nextAuthored, sameAuthoredValues, } from './content-contract.js';
|
|
4
|
+
import type { ContentMetadata, IContentLoader } from '@krantho/core';
|
|
5
|
+
import type { SeoConfigData } from '@krantho/seo-shared';
|
|
6
|
+
import type { ContentQuery, QueryPage, QueryProjection } from './content-query.js';
|
|
7
|
+
import type { Publication } from './live-version.js';
|
|
8
|
+
export type { CreateUserData, IAuthAdapter, RefreshTokenRecord, Role, UpdateUserData, UserPermission, UserRecord, } from './auth.js';
|
|
9
|
+
export type { ContentQuery, CurrentQuery, MatchTarget, PublishedQuery, QueryItem, QueryPage, QueryProjection, QueryReader, } from './content-query.js';
|
|
10
|
+
export { canQuery } from './content-query.js';
|
|
11
|
+
export type { NormalizedContentRow, NormalizedMetaRow, NormalizedSummaryRow, } from './content-row.js';
|
|
12
|
+
export { contentDocumentFromRow, contentSummaryFromRow, documentMetaFromRow, } from './content-row.js';
|
|
13
|
+
export type { LiveDirective, Publication } from './live-version.js';
|
|
14
|
+
export { currentIsLive, liveOnWrite, publicationOfFile, resolveLiveVersion, statusCondition, statusOf, storedStatus, } from './live-version.js';
|
|
15
|
+
export type { MigrationDecision, MigrationIdentity } from './migration-utils.js';
|
|
16
|
+
export { decideMigration, migrationFailedMessage, resolveCurrentVersion, validateChecksums, } from './migration-utils.js';
|
|
17
|
+
export type { AppliedMigration, CheckpointInfo, CheckpointTrigger, ConflictResolution, ContentConflict, ContentManifest, ContentManifestRecord, ICheckpointAdapter, IContentMigrationAdapter, Migration, MigrationApplyFn, MigrationResult, MigrationStatus, } from './migrations.js';
|
|
18
|
+
export type { DirectSortColumn } from './sort-columns.js';
|
|
19
|
+
export { DIRECT_SORT_COLUMNS, isDirectSortColumn, isSafeSortField, SORT_FIELD_PATTERN, } from './sort-columns.js';
|
|
20
|
+
export type { ContentMetadata, IContentLoader };
|
|
21
|
+
/** Content source — how this content entered the system */
|
|
22
|
+
export type ContentSource = 'filesystem' | 'api' | 'import';
|
|
23
|
+
/**
|
|
24
|
+
* A document's publication state as of a version: published while a version is
|
|
25
|
+
* live, draft when none is, archived (offline, kept), deleted (a tombstone)
|
|
26
|
+
*/
|
|
27
|
+
export type ContentStatus = 'draft' | 'published' | 'archived' | 'deleted';
|
|
28
|
+
/** System metadata — managed by the CMS runtime, not by content authors */
|
|
29
|
+
export interface DocumentMeta {
|
|
30
|
+
collection: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
locale: string;
|
|
33
|
+
version: number;
|
|
34
|
+
/** The live version as of this version — the document's live version when this is its current one; null when nothing is live */
|
|
35
|
+
liveVersion: number | null;
|
|
36
|
+
status: ContentStatus;
|
|
37
|
+
source: ContentSource;
|
|
38
|
+
changedBy: string | null;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
}
|
|
41
|
+
/** A content document in the CMS */
|
|
42
|
+
export interface ContentDocument extends AuthoredMetadata {
|
|
43
|
+
meta: DocumentMeta;
|
|
44
|
+
/** Schema-validated content fields (structured data, no system fields) */
|
|
45
|
+
fields: Record<string, unknown>;
|
|
46
|
+
/** Raw markdown body */
|
|
47
|
+
body: string;
|
|
48
|
+
/** Rendered HTML */
|
|
49
|
+
html: string;
|
|
50
|
+
/** Extracted h2 sections */
|
|
51
|
+
sections: Record<string, string>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A document without its content: the meta and the fields, and no body, HTML or
|
|
55
|
+
* sections. Lists that only name, order or filter documents read this much, which
|
|
56
|
+
* is a fraction of what a full document weighs on the wire.
|
|
57
|
+
*/
|
|
58
|
+
export interface ContentSummary {
|
|
59
|
+
meta: DocumentMeta;
|
|
60
|
+
fields: Record<string, unknown>;
|
|
61
|
+
/** The authored metadata groups, without the contract, defaults provenance, body or HTML */
|
|
62
|
+
metadata: AuthoredMetadata['metadata'];
|
|
63
|
+
}
|
|
64
|
+
/** Data for writing content to the persistence layer */
|
|
65
|
+
export interface WriteContentData extends Partial<AuthoredMetadata> {
|
|
66
|
+
/** Atomic compare-and-swap, zero requires a new document. */
|
|
67
|
+
expectedVersion?: number | undefined;
|
|
68
|
+
collection: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
fields: Record<string, unknown>;
|
|
71
|
+
body: string;
|
|
72
|
+
html?: string | undefined;
|
|
73
|
+
sections?: Record<string, string> | undefined;
|
|
74
|
+
/** What the write does to the live version; without one it is a save and the live version is kept */
|
|
75
|
+
publication?: Publication | undefined;
|
|
76
|
+
locale?: string | undefined;
|
|
77
|
+
}
|
|
78
|
+
export interface IPersistenceAdapter extends IContentLoader {
|
|
79
|
+
/** List all content slugs */
|
|
80
|
+
listSlugs(): Promise<string[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Write a document — appends a new version. A save keeps the live version;
|
|
83
|
+
* `publication` publishes the written version, unpublishes or archives.
|
|
84
|
+
*/
|
|
85
|
+
writeContent?(data: WriteContentData, changedBy?: string | undefined): Promise<void>;
|
|
86
|
+
/** Soft-delete content — creates a tombstone version */
|
|
87
|
+
deleteContent?(collection: string, slug: string, locale?: string | undefined, changedBy?: string | undefined): Promise<void>;
|
|
88
|
+
/** Get a single content document */
|
|
89
|
+
getContent?(collection: string, slug: string, locale?: string | undefined): Promise<ContentDocument | null>;
|
|
90
|
+
/** The live (published) version of a document, or null when nothing is live */
|
|
91
|
+
getPublished?(collection: string, slug: string, locale?: string | undefined): Promise<ContentDocument | null>;
|
|
92
|
+
/** The one read behind every content list: a declared projection over one or many collections, current or live, optionally matched on text, as one page */
|
|
93
|
+
query?<P extends QueryProjection>(spec: ContentQuery<P>): Promise<QueryPage<P>>;
|
|
94
|
+
/** List version history for a content item (newest first) */
|
|
95
|
+
listVersions?(collection: string, slug: string, locale?: string | undefined): Promise<DocumentMeta[]>;
|
|
96
|
+
/** Get a specific version of a content document */
|
|
97
|
+
getVersion?(collection: string, slug: string, version: number, locale?: string | undefined): Promise<ContentDocument | null>;
|
|
98
|
+
/** Restore content to a specific version — creates a new version from the old one */
|
|
99
|
+
restoreVersion?(collection: string, slug: string, version: number, changedBy?: string | undefined, locale?: string | undefined): Promise<boolean>;
|
|
100
|
+
/** Get runtime schema extensions for a collection */
|
|
101
|
+
getRuntimeSchema?(collection: string): Promise<RuntimeSchemaDefinition | null>;
|
|
102
|
+
/** Save runtime schema extensions for a collection — creates a new schema version */
|
|
103
|
+
saveRuntimeSchema?(collection: string, schema: RuntimeSchemaDefinition, changedBy?: string | undefined): Promise<void>;
|
|
104
|
+
}
|
|
105
|
+
/** Adapter that can read individual content documents. */
|
|
106
|
+
export type ContentGetter = IPersistenceAdapter & Required<Pick<IPersistenceAdapter, 'getContent'>>;
|
|
107
|
+
/** Adapter that can read the live (published) version of documents. */
|
|
108
|
+
export type PublishedReader = IPersistenceAdapter & Required<Pick<IPersistenceAdapter, 'getPublished' | 'query'>>;
|
|
109
|
+
/** Adapter that can write and delete content. */
|
|
110
|
+
export type ContentWriter = IPersistenceAdapter & Required<Pick<IPersistenceAdapter, 'writeContent' | 'deleteContent'>>;
|
|
111
|
+
/** Adapter with version history capabilities. */
|
|
112
|
+
export type VersioningAdapter = IPersistenceAdapter & Required<Pick<IPersistenceAdapter, 'listVersions' | 'getVersion' | 'restoreVersion'>>;
|
|
113
|
+
/** Adapter with runtime schema capabilities. */
|
|
114
|
+
export type SchemaAdapter = IPersistenceAdapter & Required<Pick<IPersistenceAdapter, 'getRuntimeSchema' | 'saveRuntimeSchema'>>;
|
|
115
|
+
/** Check if adapter can read individual documents. */
|
|
116
|
+
export declare function canGetContent(adapter: IPersistenceAdapter): adapter is ContentGetter;
|
|
117
|
+
/** Check if adapter can read the live (published) version of documents. */
|
|
118
|
+
export declare function canReadPublished(adapter: IPersistenceAdapter): adapter is PublishedReader;
|
|
119
|
+
/** Check if adapter can write and delete content. */
|
|
120
|
+
export declare function canWriteContent(adapter: IPersistenceAdapter): adapter is ContentWriter;
|
|
121
|
+
/** Check if adapter supports version history. */
|
|
122
|
+
export declare function hasVersioning(adapter: IPersistenceAdapter): adapter is VersioningAdapter;
|
|
123
|
+
/** Check if adapter supports runtime schema extensions. */
|
|
124
|
+
export declare function hasRuntimeSchema(adapter: IPersistenceAdapter): adapter is SchemaAdapter;
|
|
125
|
+
export interface PersistenceConfig {
|
|
126
|
+
/** Path to content pages directory (e.g., 'content/pages') */
|
|
127
|
+
contentPath: string;
|
|
128
|
+
/** Path to SEO data directory (e.g., 'content/seo') */
|
|
129
|
+
seoPath: string;
|
|
130
|
+
}
|
|
131
|
+
/** Crop region as percentages (0-100) */
|
|
132
|
+
export interface MediaCrop {
|
|
133
|
+
x: number;
|
|
134
|
+
y: number;
|
|
135
|
+
width: number;
|
|
136
|
+
height: number;
|
|
137
|
+
}
|
|
138
|
+
/** Hotspot center + ellipse for adaptive aspect-ratio cropping (0-100%) */
|
|
139
|
+
export interface MediaHotspot {
|
|
140
|
+
/** Center X as percentage of image width */
|
|
141
|
+
x: number;
|
|
142
|
+
/** Center Y as percentage of image height */
|
|
143
|
+
y: number;
|
|
144
|
+
/** Ellipse width as percentage of image width (for UI visualization) */
|
|
145
|
+
width: number;
|
|
146
|
+
/** Ellipse height as percentage of image height (for UI visualization) */
|
|
147
|
+
height: number;
|
|
148
|
+
}
|
|
149
|
+
/** Metadata for an uploaded media item */
|
|
150
|
+
export interface MediaItem {
|
|
151
|
+
id: string;
|
|
152
|
+
filename: string;
|
|
153
|
+
url: string;
|
|
154
|
+
altText: string;
|
|
155
|
+
mimeType: string;
|
|
156
|
+
size: number;
|
|
157
|
+
width: number | null;
|
|
158
|
+
height: number | null;
|
|
159
|
+
folder: string | null;
|
|
160
|
+
tags: string[];
|
|
161
|
+
crop: MediaCrop | null;
|
|
162
|
+
hotspot: MediaHotspot | null;
|
|
163
|
+
createdAt: string;
|
|
164
|
+
}
|
|
165
|
+
/** Options for listing media */
|
|
166
|
+
export interface MediaListOptions {
|
|
167
|
+
limit?: number | undefined;
|
|
168
|
+
offset?: number | undefined;
|
|
169
|
+
search?: string | undefined;
|
|
170
|
+
folder?: string | undefined;
|
|
171
|
+
tag?: string | undefined;
|
|
172
|
+
}
|
|
173
|
+
/** Updates accepted by the media update endpoint */
|
|
174
|
+
export interface MediaUpdateData {
|
|
175
|
+
altText?: string | undefined;
|
|
176
|
+
folder?: string | null | undefined;
|
|
177
|
+
tags?: string[] | undefined;
|
|
178
|
+
crop?: MediaCrop | null | undefined;
|
|
179
|
+
hotspot?: MediaHotspot | null | undefined;
|
|
180
|
+
filename?: string | undefined;
|
|
181
|
+
}
|
|
182
|
+
/** Result of a bulk delete operation */
|
|
183
|
+
export interface BulkDeleteResult {
|
|
184
|
+
deleted: string[];
|
|
185
|
+
skipped: Array<{
|
|
186
|
+
id: string;
|
|
187
|
+
reason: string;
|
|
188
|
+
}>;
|
|
189
|
+
}
|
|
190
|
+
/** Content item referencing a media item */
|
|
191
|
+
export interface MediaUsage {
|
|
192
|
+
collection: string;
|
|
193
|
+
slug: string;
|
|
194
|
+
field: string;
|
|
195
|
+
}
|
|
196
|
+
/** The media library's figures, over its current files */
|
|
197
|
+
export interface MediaStats {
|
|
198
|
+
/** How many files the library holds */
|
|
199
|
+
totalItems: number;
|
|
200
|
+
/** Their bytes, summed */
|
|
201
|
+
totalSize: number;
|
|
202
|
+
/** How many files each folder holds, by folder id; a folder with none is absent */
|
|
203
|
+
byFolder: Record<string, number>;
|
|
204
|
+
}
|
|
205
|
+
/** Pluggable media storage adapter */
|
|
206
|
+
export interface IMediaStorage {
|
|
207
|
+
/** Upload a file and store metadata */
|
|
208
|
+
upload(file: Uint8Array, filename: string, mimeType: string): Promise<MediaItem>;
|
|
209
|
+
/** Register an externally-uploaded file (e.g., after client-side cloud upload) */
|
|
210
|
+
register(item: {
|
|
211
|
+
filename: string;
|
|
212
|
+
url: string;
|
|
213
|
+
mimeType: string;
|
|
214
|
+
size: number;
|
|
215
|
+
width: number | null;
|
|
216
|
+
height: number | null;
|
|
217
|
+
altText?: string | undefined;
|
|
218
|
+
}): Promise<MediaItem>;
|
|
219
|
+
/** List media with pagination and search */
|
|
220
|
+
list(options?: MediaListOptions): Promise<{
|
|
221
|
+
items: MediaItem[];
|
|
222
|
+
total: number;
|
|
223
|
+
}>;
|
|
224
|
+
/** Get a single media item by ID */
|
|
225
|
+
get(id: string): Promise<MediaItem | null>;
|
|
226
|
+
/** Update metadata (alt text, folder, tags, crop, filename) */
|
|
227
|
+
update(id: string, updates: MediaUpdateData): Promise<MediaItem | null>;
|
|
228
|
+
/** Delete storage object + metadata */
|
|
229
|
+
delete(id: string): Promise<void>;
|
|
230
|
+
/** Bulk delete multiple items */
|
|
231
|
+
bulkDelete(ids: string[]): Promise<BulkDeleteResult>;
|
|
232
|
+
/** Bulk update alt text on multiple items */
|
|
233
|
+
bulkUpdateAltText(ids: string[], altText: string): Promise<number>;
|
|
234
|
+
/** Replace the file, keep the id; the url changes */
|
|
235
|
+
replace(id: string, file: Uint8Array, filename: string, mimeType: string): Promise<MediaItem | null>;
|
|
236
|
+
/** Duplicate a media item (new ID, copy file) */
|
|
237
|
+
duplicate(id: string): Promise<MediaItem | null>;
|
|
238
|
+
/** List distinct tags */
|
|
239
|
+
listTags(): Promise<string[]>;
|
|
240
|
+
/** The library's figures: how many files, their size and each folder's count */
|
|
241
|
+
stats(): Promise<MediaStats>;
|
|
242
|
+
/** The original file's bytes; null when the item or its file is gone */
|
|
243
|
+
readOriginal(id: string): Promise<Uint8Array | null>;
|
|
244
|
+
}
|
|
245
|
+
/** A media item as persisted, with the key of its file in the file store */
|
|
246
|
+
export interface MediaRecord extends MediaItem {
|
|
247
|
+
/** Object key in the file store; null for a registered external URL */
|
|
248
|
+
storageKey: string | null;
|
|
249
|
+
}
|
|
250
|
+
/** A media record before the metadata adapter stamps its creation time */
|
|
251
|
+
export type NewMediaRecord = Omit<MediaRecord, 'createdAt'>;
|
|
252
|
+
/** Fields a new version of a media record may change */
|
|
253
|
+
export type MediaRecordChanges = Partial<Omit<MediaRecord, 'id' | 'createdAt'>>;
|
|
254
|
+
/** Versioned media metadata, kept in the configured persistence */
|
|
255
|
+
export interface IMediaMetadataAdapter {
|
|
256
|
+
/** Insert the first version of a media record */
|
|
257
|
+
insert(record: NewMediaRecord): Promise<MediaRecord>;
|
|
258
|
+
/** The current version of a record; null when missing or deleted */
|
|
259
|
+
get(id: string): Promise<MediaRecord | null>;
|
|
260
|
+
/** Current records with pagination, search, folder and tag filters */
|
|
261
|
+
list(options?: MediaListOptions | undefined): Promise<{
|
|
262
|
+
items: MediaRecord[];
|
|
263
|
+
total: number;
|
|
264
|
+
}>;
|
|
265
|
+
/** Append a new current version; null when the id has no current row */
|
|
266
|
+
appendVersion(id: string, changes: MediaRecordChanges): Promise<MediaRecord | null>;
|
|
267
|
+
/** Append a deleted tombstone; returns the record it superseded */
|
|
268
|
+
markDeleted(id: string): Promise<MediaRecord | null>;
|
|
269
|
+
/** Distinct tags across current records */
|
|
270
|
+
listTags(): Promise<string[]>;
|
|
271
|
+
/** Count and size of current records, and the count in each folder */
|
|
272
|
+
stats(): Promise<MediaStats>;
|
|
273
|
+
}
|
|
274
|
+
/** Where a file store put an object */
|
|
275
|
+
export interface StoredFile {
|
|
276
|
+
key: string;
|
|
277
|
+
/** Public URL the object is served from */
|
|
278
|
+
url: string;
|
|
279
|
+
}
|
|
280
|
+
/** Pluggable store for media file bytes */
|
|
281
|
+
export interface IFileStore {
|
|
282
|
+
/** Human-readable store name, e.g. 'Local disk' or 'Vercel Blob' */
|
|
283
|
+
readonly label: string;
|
|
284
|
+
/** Directory or bucket the store writes to; null when it has none to show */
|
|
285
|
+
readonly location: string | null;
|
|
286
|
+
/** Write an object under a new key */
|
|
287
|
+
put(key: string, bytes: Uint8Array, contentType: string): Promise<StoredFile>;
|
|
288
|
+
/** Read an object; null when it does not exist */
|
|
289
|
+
get(key: string): Promise<Uint8Array | null>;
|
|
290
|
+
/** Copy an object to a new key */
|
|
291
|
+
copy(fromKey: string, toKey: string, contentType: string): Promise<StoredFile>;
|
|
292
|
+
/** Delete an object; no error when it is already gone */
|
|
293
|
+
delete(key: string): Promise<void>;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Pluggable vault for the secrets a site stores in its database, such as a pasted
|
|
297
|
+
* LLM key. Only the running system can open what it sealed: the database holds
|
|
298
|
+
* the sealed value, and the key lives with the deployment (an environment
|
|
299
|
+
* variable, or a cloud key service).
|
|
300
|
+
*/
|
|
301
|
+
export interface ISecretVault {
|
|
302
|
+
/** Human-readable vault name, e.g. 'Local key' */
|
|
303
|
+
readonly label: string;
|
|
304
|
+
/** Seal a secret under its setting name; the name is bound to the sealed value */
|
|
305
|
+
seal(name: string, plaintext: string): Promise<string>;
|
|
306
|
+
/** Open a sealed value; null when it is not this vault's, was sealed under another name, or was tampered with */
|
|
307
|
+
open(name: string, sealed: string): Promise<string | null>;
|
|
308
|
+
}
|
|
309
|
+
export type { IPageCacheStore, PageCacheEntry, PageCacheMarkOptions, PageCacheTagState, PageCacheValue, } from './page-cache.js';
|
|
310
|
+
export { decodePageCacheValue, encodePageCacheValue, uniquePageCacheTags, } from './page-cache.js';
|
|
311
|
+
/** Pluggable runtime site settings adapter */
|
|
312
|
+
export interface ISiteSettingsAdapter {
|
|
313
|
+
/** Get a setting value by key */
|
|
314
|
+
getSetting(key: string): Promise<string | null>;
|
|
315
|
+
/** Set a setting value */
|
|
316
|
+
setSetting(key: string, value: string): Promise<void>;
|
|
317
|
+
/** Get all settings as a map */
|
|
318
|
+
getAllSettings(): Promise<Record<string, string>>;
|
|
319
|
+
}
|
|
320
|
+
/** Escape special LIKE pattern characters (%, _, \) for safe prefix matching. */
|
|
321
|
+
export declare function escapeSqlLikePattern(prefix: string): string;
|
|
322
|
+
/** Scope of an SEO archetype configuration */
|
|
323
|
+
export type SeoConfigScope = 'site' | 'collection' | 'document' | 'route';
|
|
324
|
+
/** Stored SEO configuration for a site, collection, document, or route */
|
|
325
|
+
export interface SeoConfig {
|
|
326
|
+
id: string;
|
|
327
|
+
scope: SeoConfigScope;
|
|
328
|
+
config: SeoConfigData;
|
|
329
|
+
createdAt: string;
|
|
330
|
+
updatedAt: string;
|
|
331
|
+
}
|
|
332
|
+
export interface ISeoConfigAdapter {
|
|
333
|
+
/** Get SEO config by ID (e.g., 'site', 'collection:pages', 'doc:pages/home') */
|
|
334
|
+
getConfig(id: string): Promise<SeoConfig | null>;
|
|
335
|
+
/** Save SEO config (upsert) */
|
|
336
|
+
saveConfig(config: Omit<SeoConfig, 'createdAt' | 'updatedAt'>): Promise<void>;
|
|
337
|
+
/** Delete SEO config */
|
|
338
|
+
deleteConfig(id: string): Promise<void>;
|
|
339
|
+
/** List all configs by scope */
|
|
340
|
+
listConfigs(scope?: SeoConfigScope): Promise<SeoConfig[]>;
|
|
341
|
+
/** List configs matching an ID prefix (e.g., 'doc:pages/' for all page doc configs) */
|
|
342
|
+
listConfigsByPrefix(prefix: string): Promise<SeoConfig[]>;
|
|
343
|
+
/** Delete all SEO configs in a single operation. Returns the number deleted. */
|
|
344
|
+
deleteAllConfigs(): Promise<number>;
|
|
345
|
+
}
|
|
346
|
+
/** Result of a version purge operation */
|
|
347
|
+
export interface PurgeResult {
|
|
348
|
+
collection: string;
|
|
349
|
+
slug: string;
|
|
350
|
+
purged: number;
|
|
351
|
+
retained: number;
|
|
352
|
+
}
|
|
353
|
+
/** Pluggable version retention adapter */
|
|
354
|
+
export interface IRetentionAdapter {
|
|
355
|
+
/** Purge old versions, keeping the N most recent per item */
|
|
356
|
+
purgeVersions(maxVersionsPerItem: number): Promise<PurgeResult[]>;
|
|
357
|
+
/** Count total version rows across all content */
|
|
358
|
+
countVersions(): Promise<{
|
|
359
|
+
total: number;
|
|
360
|
+
current: number;
|
|
361
|
+
historical: number;
|
|
362
|
+
}>;
|
|
363
|
+
}
|
|
364
|
+
/** Lock info for a content item */
|
|
365
|
+
export interface ContentLock {
|
|
366
|
+
collection: string;
|
|
367
|
+
slug: string;
|
|
368
|
+
locale: string;
|
|
369
|
+
lockedBy: string;
|
|
370
|
+
lockedAt: string;
|
|
371
|
+
expiresAt: string;
|
|
372
|
+
}
|
|
373
|
+
/** Pluggable advisory lock adapter */
|
|
374
|
+
export interface ILockAdapter {
|
|
375
|
+
/** Get existing lock for a content item */
|
|
376
|
+
getLock(collection: string, slug: string, locale: string): Promise<ContentLock | null>;
|
|
377
|
+
/** Acquire or renew a lock */
|
|
378
|
+
acquireLock(collection: string, slug: string, locale: string, lockedBy: string, expiresAt: string): Promise<void>;
|
|
379
|
+
/** Release a lock */
|
|
380
|
+
releaseLock(collection: string, slug: string, locale: string): Promise<void>;
|
|
381
|
+
/** Every unexpired lock, by collection, slug and locale */
|
|
382
|
+
listLocks(): Promise<ContentLock[]>;
|
|
383
|
+
}
|
|
384
|
+
/** A webhook delivery record */
|
|
385
|
+
export interface WebhookDeliveryRecord {
|
|
386
|
+
id: number;
|
|
387
|
+
url: string;
|
|
388
|
+
event: string;
|
|
389
|
+
status: number | null;
|
|
390
|
+
attempts: number;
|
|
391
|
+
nextRetryAt: string | null;
|
|
392
|
+
createdAt: string;
|
|
393
|
+
deliveredAt: string | null;
|
|
394
|
+
}
|
|
395
|
+
/** A delivery with the body it sends: what a retry sends again */
|
|
396
|
+
export interface StoredWebhookDelivery extends WebhookDeliveryRecord {
|
|
397
|
+
payload: string;
|
|
398
|
+
}
|
|
399
|
+
/** A first send to put in the log */
|
|
400
|
+
export interface NewWebhookDelivery {
|
|
401
|
+
url: string;
|
|
402
|
+
event: string;
|
|
403
|
+
/** The JSON body that is sent */
|
|
404
|
+
payload: string;
|
|
405
|
+
/** When the delivery is due for a retry, were this send to record no outcome */
|
|
406
|
+
retryAt: Date;
|
|
407
|
+
}
|
|
408
|
+
/** Maximum delivery attempts before a webhook is considered failed */
|
|
409
|
+
export declare const MAX_WEBHOOK_ATTEMPTS = 5;
|
|
410
|
+
/** Pluggable webhook delivery adapter */
|
|
411
|
+
export interface IWebhookDeliveryAdapter {
|
|
412
|
+
/** List deliveries with optional status filter */
|
|
413
|
+
listDeliveries(options: {
|
|
414
|
+
limit: number;
|
|
415
|
+
offset: number;
|
|
416
|
+
status?: 'pending' | 'delivered' | 'failed' | undefined;
|
|
417
|
+
}): Promise<{
|
|
418
|
+
deliveries: WebhookDeliveryRecord[];
|
|
419
|
+
total: number;
|
|
420
|
+
}>;
|
|
421
|
+
/** One delivery with its payload; null when none has the id */
|
|
422
|
+
getDelivery(id: number): Promise<StoredWebhookDelivery | null>;
|
|
423
|
+
/**
|
|
424
|
+
* Put a failed delivery back in the queue with one attempt left
|
|
425
|
+
* (`MAX_WEBHOOK_ATTEMPTS - 1`), due at `dueAt`; null when no failed
|
|
426
|
+
* delivery has the id — none does, or it was delivered, or it is still
|
|
427
|
+
* pending
|
|
428
|
+
*/
|
|
429
|
+
requeueDelivery(id: number, dueAt: Date): Promise<WebhookDeliveryRecord | null>;
|
|
430
|
+
/** Log a first send: one attempt made, no outcome yet. Returns the delivery's id */
|
|
431
|
+
logDelivery(delivery: NewWebhookDelivery): Promise<number>;
|
|
432
|
+
/** Record that the webhook accepted the delivery, with its HTTP status */
|
|
433
|
+
markDelivered(id: number, status: number): Promise<void>;
|
|
434
|
+
/**
|
|
435
|
+
* Record a failed attempt: the status (0 when none came), one more attempt
|
|
436
|
+
* counted, and the time the delivery is due for the next
|
|
437
|
+
*/
|
|
438
|
+
markFailed(id: number, status: number, nextRetryAt: Date): Promise<void>;
|
|
439
|
+
/**
|
|
440
|
+
* Claim the deliveries to send again at `now`, oldest first: not delivered,
|
|
441
|
+
* with attempts left, no retry time or one that has passed, and sent to one
|
|
442
|
+
* of `urls`. Each claimed delivery is due again only at `leaseUntil`, in the
|
|
443
|
+
* same statement, so a sweep running at once elsewhere — another instance on
|
|
444
|
+
* the same database — never claims it too
|
|
445
|
+
*/
|
|
446
|
+
claimDueDeliveries(options: {
|
|
447
|
+
urls: readonly string[];
|
|
448
|
+
now: Date;
|
|
449
|
+
leaseUntil: Date;
|
|
450
|
+
limit: number;
|
|
451
|
+
}): Promise<StoredWebhookDelivery[]>;
|
|
452
|
+
}
|
|
453
|
+
/** A folder in the media library's hierarchical folder tree */
|
|
454
|
+
export interface MediaFolder {
|
|
455
|
+
id: string;
|
|
456
|
+
name: string;
|
|
457
|
+
parentId: string | null;
|
|
458
|
+
createdAt: string;
|
|
459
|
+
}
|
|
460
|
+
/** Pluggable media folder storage */
|
|
461
|
+
export interface IMediaFolderStorage {
|
|
462
|
+
/** List all folders as a flat array (caller builds tree) */
|
|
463
|
+
listFolders(): Promise<MediaFolder[]>;
|
|
464
|
+
/** Create a folder */
|
|
465
|
+
createFolder(name: string, parentId?: string | null): Promise<MediaFolder>;
|
|
466
|
+
/** Rename a folder */
|
|
467
|
+
renameFolder(id: string, name: string): Promise<MediaFolder | null>;
|
|
468
|
+
/** Delete an empty folder */
|
|
469
|
+
deleteFolder(id: string): Promise<void>;
|
|
470
|
+
}
|
|
471
|
+
/** Runtime field definition — stored in database, extends code-defined schemas */
|
|
472
|
+
export interface RuntimeFieldDefinition {
|
|
473
|
+
name: string;
|
|
474
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'enum' | 'url' | 'email' | 'textarea' | 'color' | 'reference';
|
|
475
|
+
required: boolean;
|
|
476
|
+
default?: unknown | undefined;
|
|
477
|
+
description?: string | undefined;
|
|
478
|
+
enumValues?: string[] | undefined;
|
|
479
|
+
refCollection?: string | undefined;
|
|
480
|
+
/** Whether this field holds an array of values (for reference arrays) */
|
|
481
|
+
isArray?: boolean | undefined;
|
|
482
|
+
min?: number | undefined;
|
|
483
|
+
max?: number | undefined;
|
|
484
|
+
pattern?: string | undefined;
|
|
485
|
+
}
|
|
486
|
+
/** A complete, named metadata definition added by an administrator. */
|
|
487
|
+
export interface RuntimeMetadataGroup {
|
|
488
|
+
slot: string;
|
|
489
|
+
id: string;
|
|
490
|
+
label: string;
|
|
491
|
+
required: boolean;
|
|
492
|
+
schema: Record<string, unknown>;
|
|
493
|
+
}
|
|
494
|
+
/** Runtime schema for a collection — runtime fields that extend the code-defined schema */
|
|
495
|
+
export interface RuntimeSchemaDefinition {
|
|
496
|
+
collection: string;
|
|
497
|
+
fields: RuntimeFieldDefinition[];
|
|
498
|
+
metadata?: RuntimeMetadataGroup[] | undefined;
|
|
499
|
+
updatedAt: string;
|
|
500
|
+
}
|
|
501
|
+
export type { RepositoryBasis, RepositoryDocument, RepositoryFileInput, } from './repository-content.js';
|
|
502
|
+
export { contractReferenceMatches, repositoryDocument, repositoryFile, repositoryFrontmatter, repositoryMarkdown, } from './repository-content.js';
|
|
503
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,kBAAkB,GACnB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAGpD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,IAAI,EACJ,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,WAAW,CAAA;AAClB,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AA;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IACjC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B;AAED,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC;AAED,2FAA2F;AAC3F,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,sBAAsB,EAAE,CAAA;IAChC,QAAQ,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAA;IAC7C,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { authoredMetadata, authoredOf, ContentWriteConflict, documentSeoRow, nextAuthored, sameAuthoredValues, } from './content-contract.js';
|
|
2
|
+
export { canQuery } from './content-query.js';
|
|
3
|
+
export { contentDocumentFromRow, contentSummaryFromRow, documentMetaFromRow, } from './content-row.js';
|
|
4
|
+
export { currentIsLive, liveOnWrite, publicationOfFile, resolveLiveVersion, statusCondition, statusOf, storedStatus, } from './live-version.js';
|
|
5
|
+
export { decideMigration, migrationFailedMessage, resolveCurrentVersion, validateChecksums, } from './migration-utils.js';
|
|
6
|
+
export { DIRECT_SORT_COLUMNS, isDirectSortColumn, isSafeSortField, SORT_FIELD_PATTERN, } from './sort-columns.js';
|
|
7
|
+
/** Check if adapter can read individual documents. */
|
|
8
|
+
export function canGetContent(adapter) {
|
|
9
|
+
return !!adapter.getContent;
|
|
10
|
+
}
|
|
11
|
+
/** Check if adapter can read the live (published) version of documents. */
|
|
12
|
+
export function canReadPublished(adapter) {
|
|
13
|
+
return !!adapter.getPublished && !!adapter.query;
|
|
14
|
+
}
|
|
15
|
+
/** Check if adapter can write and delete content. */
|
|
16
|
+
export function canWriteContent(adapter) {
|
|
17
|
+
return !!adapter.writeContent && !!adapter.deleteContent;
|
|
18
|
+
}
|
|
19
|
+
/** Check if adapter supports version history. */
|
|
20
|
+
export function hasVersioning(adapter) {
|
|
21
|
+
return !!adapter.listVersions && !!adapter.getVersion && !!adapter.restoreVersion;
|
|
22
|
+
}
|
|
23
|
+
/** Check if adapter supports runtime schema extensions. */
|
|
24
|
+
export function hasRuntimeSchema(adapter) {
|
|
25
|
+
return !!adapter.getRuntimeSchema && !!adapter.saveRuntimeSchema;
|
|
26
|
+
}
|
|
27
|
+
export { decodePageCacheValue, encodePageCacheValue, uniquePageCacheTags, } from './page-cache.js';
|
|
28
|
+
// --- SQL Utilities (shared across adapters) ---
|
|
29
|
+
/** Escape special LIKE pattern characters (%, _, \) for safe prefix matching. */
|
|
30
|
+
export function escapeSqlLikePattern(prefix) {
|
|
31
|
+
return prefix.replace(/[%_\\]/g, '\\$&');
|
|
32
|
+
}
|
|
33
|
+
/** Maximum delivery attempts before a webhook is considered failed */
|
|
34
|
+
export const MAX_WEBHOOK_ATTEMPTS = 5;
|
|
35
|
+
export { contractReferenceMatches, repositoryDocument, repositoryFile, repositoryFrontmatter, repositoryMarkdown, } from './repository-content.js';
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,kBAAkB,GACnB,MAAM,uBAAuB,CAAA;AA2B9B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAQ7C,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EACL,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,QAAQ,EACR,YAAY,GACb,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,sBAAsB,CAAA;AAoB7B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAA;AAkK1B,sDAAsD;AACtD,MAAM,UAAU,aAAa,CAAC,OAA4B;IACxD,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,CAAA;AAC7B,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,OAA4B;IAC3D,OAAO,CAAC,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAA;AAClD,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,eAAe,CAAC,OAA4B;IAC1D,OAAO,CAAC,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC,OAAO,CAAC,aAAa,CAAA;AAC1D,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,aAAa,CAAC,OAA4B;IACxD,OAAO,CAAC,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC,OAAO,CAAC,cAAc,CAAA;AACnF,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,gBAAgB,CAAC,OAA4B;IAC3D,OAAO,CAAC,CAAC,OAAO,CAAC,gBAAgB,IAAI,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAA;AAClE,CAAC;AAiND,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AAcxB,iDAAiD;AAEjD,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AAC1C,CAAC;AA4GD,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAmHrC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live-version rules shared by the adapters.
|
|
3
|
+
*
|
|
4
|
+
* A document has a current version (its newest row, what Studio edits) and
|
|
5
|
+
* at most one live version (what visitors see). Every appended row records
|
|
6
|
+
* `live_version`: the document's live version as of that row, or null when
|
|
7
|
+
* nothing is live. Only publishing changes what visitors see — a save appends
|
|
8
|
+
* a new current version and keeps the live one — and a document's publication
|
|
9
|
+
* state is read from its live version alone (see {@link statusOf}).
|
|
10
|
+
*/
|
|
11
|
+
import type { ContentStatus } from './index.js';
|
|
12
|
+
/** A write that changes what visitors see; a write without one is a save */
|
|
13
|
+
export type Publication = 'publish' | 'unpublish' | 'archive';
|
|
14
|
+
/** How an appended row's live version is set */
|
|
15
|
+
export type LiveDirective = 'self' | 'clear' | 'keep';
|
|
16
|
+
/** What a write does to the live version: publishing makes the new row live, unpublishing and archiving take the document offline, a save keeps it */
|
|
17
|
+
export declare function liveOnWrite(publication: Publication | undefined): LiveDirective;
|
|
18
|
+
/** The publication a file import makes: the file's status says whether the document is live */
|
|
19
|
+
export declare function publicationOfFile(status: string): Publication;
|
|
20
|
+
/** The live version an appended row records */
|
|
21
|
+
export declare function resolveLiveVersion(directive: LiveDirective, version: number, previous: number | null): number | null;
|
|
22
|
+
/**
|
|
23
|
+
* The status an appended row stores, consistent with how it is read: archived
|
|
24
|
+
* when archived (a save keeps an archived document archived), published while
|
|
25
|
+
* a version is live, draft otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export declare function storedStatus(publication: Publication | undefined, liveVersion: number | null, previousStatus: string | undefined): ContentStatus;
|
|
28
|
+
/**
|
|
29
|
+
* A row's publication state: a tombstone is deleted and an archived document
|
|
30
|
+
* archived; otherwise published while a version is live, draft when none is.
|
|
31
|
+
* Rows written before saves kept the live version read correctly too.
|
|
32
|
+
*/
|
|
33
|
+
export declare function statusOf(stored: string, liveVersion: number | null): ContentStatus;
|
|
34
|
+
/** Whether visitors see a document's current version — after a save, true only where saves are live (no history) */
|
|
35
|
+
export declare function currentIsLive(meta: {
|
|
36
|
+
version: number;
|
|
37
|
+
liveVersion: number | null;
|
|
38
|
+
}): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The SQL condition that selects current rows by publication state, the same
|
|
41
|
+
* on SQLite and Postgres (columns `status` and `live_version`).
|
|
42
|
+
*/
|
|
43
|
+
export declare function statusCondition(status: 'draft' | 'published' | 'archived'): string;
|
|
44
|
+
//# sourceMappingURL=live-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-version.d.ts","sourceRoot":"","sources":["../src/live-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAA;AAE7D,gDAAgD;AAChD,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