@conloca/content-api 0.1.14 → 0.1.16
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/dist/asset-manifest.d.ts +23 -0
- package/dist/asset-manifest.d.ts.map +1 -0
- package/dist/asset-manifest.js +73 -0
- package/dist/asset-operations.d.ts +159 -0
- package/dist/asset-operations.d.ts.map +1 -0
- package/dist/asset-operations.js +736 -0
- package/dist/asset-types.d.ts +56 -0
- package/dist/asset-types.d.ts.map +1 -0
- package/dist/asset-types.js +7 -0
- package/dist/base-content-index.d.ts +57 -0
- package/dist/base-content-index.d.ts.map +1 -0
- package/dist/base-content-index.js +179 -0
- package/dist/block-index.d.ts +9 -0
- package/dist/block-index.d.ts.map +1 -0
- package/dist/block-index.js +11 -0
- package/dist/blocks.d.ts +16 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +103 -0
- package/dist/cf-access.d.ts +31 -0
- package/dist/cf-access.d.ts.map +1 -0
- package/dist/cf-access.js +66 -0
- package/dist/component-registry.d.ts +50 -0
- package/dist/component-registry.d.ts.map +1 -0
- package/dist/component-registry.js +120 -0
- package/dist/component-registry.types-C0ctF9nh.d.mts +71 -0
- package/dist/component-registry.types-C0ctF9nh.d.mts.map +1 -0
- package/dist/component-registry.types.d.ts +11 -0
- package/dist/component-registry.types.d.ts.map +1 -0
- package/dist/component-registry.types.js +1 -0
- package/dist/content-api.interface.d.ts +64 -0
- package/dist/content-api.interface.d.ts.map +1 -0
- package/dist/content-api.interface.js +1 -0
- package/dist/content-filters.d.ts +31 -0
- package/dist/content-filters.d.ts.map +1 -0
- package/dist/content-filters.js +246 -0
- package/dist/content-index-D092_vk1.mjs +629 -0
- package/dist/content-index-D092_vk1.mjs.map +1 -0
- package/dist/content-index-D6IVMmAB.d.mts +127 -0
- package/dist/content-index-D6IVMmAB.d.mts.map +1 -0
- package/dist/content-index.d.ts +126 -0
- package/dist/content-index.d.ts.map +1 -0
- package/dist/content-index.js +418 -0
- package/dist/content-operations-DIbsxG5A.d.mts +354 -0
- package/dist/content-operations-DIbsxG5A.d.mts.map +1 -0
- package/dist/content-operations.d.ts +93 -0
- package/dist/content-operations.d.ts.map +1 -0
- package/dist/content-operations.js +275 -0
- package/dist/content-reader.d.ts +10 -0
- package/dist/content-reader.d.ts.map +1 -0
- package/dist/content-reader.js +13 -0
- package/dist/content-utils-fWNHTrPy.mjs +280 -0
- package/dist/content-utils-fWNHTrPy.mjs.map +1 -0
- package/dist/content-utils.d.ts +132 -0
- package/dist/content-utils.d.ts.map +1 -0
- package/dist/content-utils.js +352 -0
- package/dist/content-watcher.d.ts +43 -0
- package/dist/content-watcher.d.ts.map +1 -0
- package/dist/content-watcher.js +83 -0
- package/dist/data-DquNIEnQ.mjs +62 -0
- package/dist/data-DquNIEnQ.mjs.map +1 -0
- package/dist/data-index.d.ts +8 -0
- package/dist/data-index.d.ts.map +1 -0
- package/dist/data-index.js +7 -0
- package/dist/data.d.ts +43 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +103 -0
- package/dist/etag-utils.d.ts +77 -0
- package/dist/etag-utils.d.ts.map +1 -0
- package/dist/etag-utils.js +160 -0
- package/dist/filesystem-content-api-B1KIQJfk.mjs +2 -0
- package/dist/filesystem-content-api-C0HIhqZi.mjs +1620 -0
- package/dist/filesystem-content-api-C0HIhqZi.mjs.map +1 -0
- package/dist/filesystem-content-api-DCdNi-co.d.mts +134 -0
- package/dist/filesystem-content-api-DCdNi-co.d.mts.map +1 -0
- package/dist/filesystem-content-api.d.ts +135 -0
- package/dist/filesystem-content-api.d.ts.map +1 -0
- package/dist/filesystem-content-api.js +2181 -0
- package/dist/git-operations.d.ts +49 -0
- package/dist/git-operations.d.ts.map +1 -0
- package/dist/git-operations.js +252 -0
- package/dist/header-parser.d.ts +37 -0
- package/dist/header-parser.d.ts.map +1 -0
- package/dist/header-parser.js +286 -0
- package/dist/in-memory-content-api.d.ts +35 -0
- package/dist/in-memory-content-api.d.ts.map +1 -0
- package/dist/in-memory-content-api.js +591 -0
- package/dist/index-DxVTFK66.d.mts +105 -0
- package/dist/index-DxVTFK66.d.mts.map +1 -0
- package/dist/index.d.mts +6 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.mjs +37 -5
- package/dist/index.mjs.map +1 -1
- package/dist/indexing.d.mts +152 -0
- package/dist/indexing.d.mts.map +1 -0
- package/dist/indexing.d.ts +5 -0
- package/dist/indexing.d.ts.map +1 -0
- package/dist/indexing.js +7 -0
- package/dist/indexing.mjs +255 -0
- package/dist/indexing.mjs.map +1 -0
- package/dist/json-whitespace-view.d.ts +32 -0
- package/dist/json-whitespace-view.d.ts.map +1 -0
- package/dist/json-whitespace-view.js +152 -0
- package/dist/middleware.d.ts +20 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +1031 -0
- package/dist/node.d.mts +28 -126
- package/dist/node.d.mts.map +1 -1
- package/dist/node.d.ts +25 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +24 -0
- package/dist/node.mjs +199 -2890
- package/dist/node.mjs.map +1 -1
- package/dist/reader.d.mts +15 -0
- package/dist/reader.d.mts.map +1 -0
- package/dist/reader.d.ts +15 -0
- package/dist/reader.d.ts.map +1 -0
- package/dist/reader.js +13 -0
- package/dist/reader.mjs +22 -0
- package/dist/reader.mjs.map +1 -0
- package/dist/schemas/index.d.mts +2 -90
- package/dist/schemas/index.d.ts +102 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +87 -0
- package/dist/schemas/index.mjs +2 -70
- package/dist/schemas-CFRD0FIQ.mjs +84 -0
- package/dist/schemas-CFRD0FIQ.mjs.map +1 -0
- package/dist/{types-BUG0Cfkg.mjs → site-8oaj1Q60.mjs} +20 -222
- package/dist/site-8oaj1Q60.mjs.map +1 -0
- package/dist/site-index-B_254bCc.d.mts +136 -0
- package/dist/site-index-B_254bCc.d.mts.map +1 -0
- package/dist/site-index.d.ts +60 -0
- package/dist/site-index.d.ts.map +1 -0
- package/dist/site-index.js +287 -0
- package/dist/site.d.ts +21 -0
- package/dist/site.d.ts.map +1 -0
- package/dist/site.js +168 -0
- package/dist/types-DOdldbfD.mjs +34 -0
- package/dist/types-DOdldbfD.mjs.map +1 -0
- package/dist/types-DjfhS272.d.mts +456 -0
- package/dist/types-DjfhS272.d.mts.map +1 -0
- package/dist/types.d.ts +453 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +36 -0
- package/dist/url-safe-base64.d.ts +12 -0
- package/dist/url-safe-base64.d.ts.map +1 -0
- package/dist/url-safe-base64.js +40 -0
- package/dist/url-validation.d.ts +14 -0
- package/dist/url-validation.d.ts.map +1 -0
- package/dist/url-validation.js +81 -0
- package/dist/utils/atomic-write.d.ts +6 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/atomic-write.js +20 -0
- package/dist/utils.d.ts +46 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +70 -0
- package/dist/vite-plugin.d.ts +12 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.js +29 -0
- package/dist/vxjson-qHrgLGip.mjs +555 -0
- package/dist/vxjson-qHrgLGip.mjs.map +1 -0
- package/dist/vxjson-serialize-geF6qvpn.mjs +34 -0
- package/dist/vxjson-serialize-geF6qvpn.mjs.map +1 -0
- package/dist/vxjson-serialize.d.mts +17 -0
- package/dist/vxjson-serialize.d.mts.map +1 -0
- package/dist/vxjson-serialize.d.ts +14 -0
- package/dist/vxjson-serialize.d.ts.map +1 -0
- package/dist/vxjson-serialize.js +50 -0
- package/dist/vxjson-serialize.mjs +2 -0
- package/dist/vxjson.d.ts +112 -0
- package/dist/vxjson.d.ts.map +1 -0
- package/dist/vxjson.js +391 -0
- package/dist/xxhash.d.ts +10 -0
- package/dist/xxhash.d.ts.map +1 -0
- package/dist/xxhash.js +31 -0
- package/package.json +88 -17
- package/dist/content-operations-BZLfJWqT.d.mts +0 -916
- package/dist/content-operations-BZLfJWqT.d.mts.map +0 -1
- package/dist/schemas/index.d.mts.map +0 -1
- package/dist/schemas/index.mjs.map +0 -1
- package/dist/types-BUG0Cfkg.mjs.map +0 -1
package/dist/node.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as AssetManifestData, c as FolderTreeNode, i as AssetEntry, l as ManifestEntryData, n as ComponentEntryWithId, o as AssetUsage, s as FolderListing, t as ComponentEntry } from "./component-registry.types-C0ctF9nh.mjs";
|
|
2
|
+
import { A as LocalizedEntry, B as VXJSONFile, C as ErrorCodes, D as LocalePathData, E as LocaleFileData, F as PageReference, I as SiteFilters, L as SitesConfig, M as MDXCompileResponse, N as MDXFrontmatter, O as LocaleUpdateData, P as MoveResult, R as UpdateLocaleInput, S as ErrorCode, T as GlobalFilters, V as WriteResult, _ as CreateResult, a as ContentAPIOptions, b as DeleteLocaleInput, c as ContentIdentity, d as ContentMeta, f as ContentProp, g as CreatePageInput, h as CreateContentInput, i as BlockFilters, j as LocalizedManifest, k as LocaleVersion, l as ContentListResult, m as CreateBlockInput, n as BatchOperationResult, o as ContentData, p as ContentType, r as BatchResult, s as ContentEntry, t as APIError, u as ContentManifest, v as DataCollectionEntry, w as FindOptions, x as DeleteResult, y as DataContext, z as UpdateResult } from "./types-DjfhS272.mjs";
|
|
3
|
+
import { A as serializeMdxWithFrontmatter, C as localesOf, D as normalizePathname, E as normalizeAndValidatePathname, M as ContentAPI, N as Site, O as parseDate, P as Data, S as isValidPathname, T as mapSiteNames, _ as getCurrentISODate, a as analyzeUpdateScope, b as isMetadataTooLarge, c as shouldUpdateModifiedTimestamp, d as validateCreateContent, f as PathnameValidationReason, g as generateContentId, h as formatFileSize, i as ValidationResult, j as Blocks, k as resolvePublishDate, l as updatePublishDates, m as extractBlockName, n as UPDATE_SCOPE, o as buildLocaleVersion, p as PathnameValidationResult, r as UpdateScope, s as buildPathnameHistory, t as CreateValidationResult, u as validateAndPrepareMetadata, v as getMetadataSize, w as mapLocales, x as isValidBlockName, y as isContentPublished } from "./content-operations-DIbsxG5A.mjs";
|
|
4
|
+
import { n as readSitesConfig, t as FileSystemContentAPI } from "./filesystem-content-api-DCdNi-co.mjs";
|
|
2
5
|
import { Hono } from "hono";
|
|
3
|
-
import * as hono_types0 from "hono/types";
|
|
4
6
|
import { Plugin } from "vite";
|
|
5
|
-
|
|
6
7
|
//#region src/asset-manifest.d.ts
|
|
7
8
|
declare class AssetManifest {
|
|
8
9
|
private manifestPath;
|
|
@@ -266,126 +267,8 @@ declare class ComponentRegistry {
|
|
|
266
267
|
delete(id: string): Promise<void>;
|
|
267
268
|
}
|
|
268
269
|
//#endregion
|
|
269
|
-
//#region src/filesystem-content-api.d.ts
|
|
270
|
-
interface ReindexResult {
|
|
271
|
-
filesProcessed: number;
|
|
272
|
-
filesSkipped: number;
|
|
273
|
-
filesDeleted?: number;
|
|
274
|
-
errors?: number;
|
|
275
|
-
updated: LocalizedManifest[];
|
|
276
|
-
deleted?: Array<{
|
|
277
|
-
id: string;
|
|
278
|
-
locale: string;
|
|
279
|
-
kind: 'page' | 'block' | 'data';
|
|
280
|
-
}>;
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* FileSystem-based Content API Implementation
|
|
284
|
-
*
|
|
285
|
-
* Stores content as files on disk in a git-friendly format:
|
|
286
|
-
* - Pages: /{site}/pages/{filename}.{locale}.vxjson
|
|
287
|
-
* - Blocks: /blocks/{collection}/{filename}.{locale}.{mdx|vxjson}
|
|
288
|
-
*
|
|
289
|
-
* ## Indexing
|
|
290
|
-
*
|
|
291
|
-
* Content is indexed at startup for performance. The index is cached per
|
|
292
|
-
* content root path and cleared when the process restarts.
|
|
293
|
-
*
|
|
294
|
-
* ## Read-Repair
|
|
295
|
-
*
|
|
296
|
-
* Since files can be modified externally (git, editors), this implementation:
|
|
297
|
-
*
|
|
298
|
-
* 1. Repairs invalid VXJSON files (ensures "content" field is last)
|
|
299
|
-
* 2. Adds missing required fields (id, created, modified)
|
|
300
|
-
* 3. Handles files added after initial indexing
|
|
301
|
-
* 4. Updates the index when files are repaired or discovered
|
|
302
|
-
*
|
|
303
|
-
* ## Performance
|
|
304
|
-
*
|
|
305
|
-
* - Initial indexing reads only first 4KB of each file
|
|
306
|
-
* - Full content is loaded on demand
|
|
307
|
-
* - ETags are calculated using streaming for efficiency
|
|
308
|
-
*/
|
|
309
|
-
declare class FileSystemContentAPI implements ContentAPI {
|
|
310
|
-
private contentRoot;
|
|
311
|
-
private absoluteContentRoot;
|
|
312
|
-
private contentIndex;
|
|
313
|
-
readonly sitesConfig: SitesConfig;
|
|
314
|
-
readonly blocks: Blocks;
|
|
315
|
-
readonly data: Data;
|
|
316
|
-
private readonly sites;
|
|
317
|
-
get normalizedContentRoot(): string;
|
|
318
|
-
private constructor();
|
|
319
|
-
static create(options: ContentAPIOptions): Promise<FileSystemContentAPI>;
|
|
320
|
-
/**
|
|
321
|
-
* Clear all caches - useful for testing
|
|
322
|
-
*/
|
|
323
|
-
static clearCaches(): void;
|
|
324
|
-
private indexAllContent;
|
|
325
|
-
private parseFileHeaderWithRepair;
|
|
326
|
-
/**
|
|
327
|
-
* Perform read-repair by writing back the file with missing fields
|
|
328
|
-
* This ensures stable IDs and timestamps across restarts
|
|
329
|
-
*/
|
|
330
|
-
private performReadRepair;
|
|
331
|
-
private scanContentFiles;
|
|
332
|
-
private getFilePath;
|
|
333
|
-
/**
|
|
334
|
-
* Parse a file path back into its components for checking against the path index
|
|
335
|
-
* Returns null if the path doesn't match expected patterns
|
|
336
|
-
*/
|
|
337
|
-
parseFilePath(filePath: string): {
|
|
338
|
-
kind: 'page' | 'block' | 'data';
|
|
339
|
-
site?: string;
|
|
340
|
-
collection: string;
|
|
341
|
-
pathname?: string;
|
|
342
|
-
name?: string;
|
|
343
|
-
locale: string;
|
|
344
|
-
} | null;
|
|
345
|
-
getContent(id: string): Promise<ContentEntry | null>;
|
|
346
|
-
getLocalized(id: string, locale: string): Promise<LocalizedEntry | null>;
|
|
347
|
-
private readLocaleFile;
|
|
348
|
-
createContent(data: CreateContentInput): Promise<CreateResult>;
|
|
349
|
-
updateLocalized(input: UpdateLocaleInput): Promise<UpdateResult>;
|
|
350
|
-
deleteContent(id: string, etag: string): Promise<DeleteResult>;
|
|
351
|
-
deleteLocalized(input: DeleteLocaleInput): Promise<DeleteResult>;
|
|
352
|
-
getSite(siteName: string): Site | null;
|
|
353
|
-
listAllContent(filters?: GlobalFilters): Generator<ContentManifest>;
|
|
354
|
-
findUntranslatedContent(targetLocale: string, options?: FindOptions): Generator<ContentManifest>;
|
|
355
|
-
/**
|
|
356
|
-
* Reindex files that were added or changed after initial creation
|
|
357
|
-
*
|
|
358
|
-
* This method:
|
|
359
|
-
* 1. Either scans for all content files or processes specific paths
|
|
360
|
-
* 2. Uses the path index to check if files are already indexed
|
|
361
|
-
* 3. Indexes new files or force-reindexes specified files
|
|
362
|
-
* 4. Optionally handles file deletions
|
|
363
|
-
*
|
|
364
|
-
* @param paths - Optional array of specific file paths to reindex. If not provided, scans all content files.
|
|
365
|
-
* @param options - Options for reindexing behavior
|
|
366
|
-
* @returns Statistics about the reindexing operation
|
|
367
|
-
*/
|
|
368
|
-
reindex(paths?: string[], options?: {
|
|
369
|
-
handleDeletions?: boolean;
|
|
370
|
-
}): Promise<ReindexResult>;
|
|
371
|
-
/**
|
|
372
|
-
* Read content directly from cache
|
|
373
|
-
* For testing purposes - returns null if not cached
|
|
374
|
-
*/
|
|
375
|
-
readFromCache(id: string, locale: string): Promise<ContentData | null>;
|
|
376
|
-
getContentAsBuffer(id: string, locale: string): Promise<{
|
|
377
|
-
buffer: Uint8Array;
|
|
378
|
-
etag: string;
|
|
379
|
-
contentType: 'application/json' | 'text/mdx';
|
|
380
|
-
} | null>;
|
|
381
|
-
batchUpdate(operations: UpdateLocaleInput[]): Promise<BatchResult>;
|
|
382
|
-
}
|
|
383
|
-
//#endregion
|
|
384
270
|
//#region src/content-watcher.d.ts
|
|
385
|
-
|
|
386
|
-
contentRoot: string;
|
|
387
|
-
canvasDir?: string;
|
|
388
|
-
}
|
|
271
|
+
type ContentWatcherOptions = ContentAPIOptions;
|
|
389
272
|
interface WebSocketSender {
|
|
390
273
|
send(payload: {
|
|
391
274
|
type: string;
|
|
@@ -393,6 +276,25 @@ interface WebSocketSender {
|
|
|
393
276
|
data: any;
|
|
394
277
|
}): void;
|
|
395
278
|
}
|
|
279
|
+
interface ContentWatchEvent {
|
|
280
|
+
file: string;
|
|
281
|
+
action: 'update' | 'create' | 'delete';
|
|
282
|
+
inMdxRoot: boolean;
|
|
283
|
+
inContentRoot: boolean;
|
|
284
|
+
}
|
|
285
|
+
interface ReindexResultLike {
|
|
286
|
+
updated: unknown[];
|
|
287
|
+
deleted?: {
|
|
288
|
+
id: string;
|
|
289
|
+
locale: string;
|
|
290
|
+
kind: 'page' | 'block' | 'data';
|
|
291
|
+
}[];
|
|
292
|
+
}
|
|
293
|
+
interface ReindexableContentAPI {
|
|
294
|
+
reindex(paths: string[], options?: {
|
|
295
|
+
handleDeletions?: boolean;
|
|
296
|
+
}): Promise<ReindexResultLike>;
|
|
297
|
+
}
|
|
396
298
|
/**
|
|
397
299
|
* Creates a content API instance for the given options
|
|
398
300
|
*/
|
|
@@ -400,7 +302,7 @@ declare function createContentAPI(options: ContentWatcherOptions): Promise<FileS
|
|
|
400
302
|
/**
|
|
401
303
|
* Creates file change handlers for content watching
|
|
402
304
|
*/
|
|
403
|
-
declare function createContentWatchHandlers(contentApi:
|
|
305
|
+
declare function createContentWatchHandlers(contentApi: ReindexableContentAPI, options: ContentWatcherOptions, ws: WebSocketSender, onReindexed?: (event: ContentWatchEvent) => void | Promise<void>): {
|
|
404
306
|
onChange: (file: string) => Promise<void>;
|
|
405
307
|
onAdd: (file: string) => Promise<void>;
|
|
406
308
|
onUnlink: (file: string) => Promise<void>;
|
|
@@ -448,12 +350,12 @@ interface ContentAPIRouterOptions {
|
|
|
448
350
|
/** Content root directory for asset usage tracking */
|
|
449
351
|
contentRoot?: string;
|
|
450
352
|
}
|
|
451
|
-
declare function createContentAPIRouter(api: ContentAPI, options?: ContentAPIRouterOptions): Hono<
|
|
353
|
+
declare function createContentAPIRouter(api: ContentAPI, options?: ContentAPIRouterOptions): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
452
354
|
/**
|
|
453
355
|
* Create middleware for backwards compatibility with existing code
|
|
454
356
|
* This wraps the Hono app to work with Node.js IncomingMessage/ServerResponse
|
|
455
357
|
*/
|
|
456
|
-
declare function createContentMiddleware(contentApi: ContentAPI): (req: any, res: any, next: () => void) => Promise<void>;
|
|
358
|
+
declare function createContentMiddleware(contentApi: ContentAPI, options?: ContentAPIRouterOptions): (req: any, res: any, next: () => void) => Promise<void>;
|
|
457
359
|
//#endregion
|
|
458
360
|
//#region src/vite-plugin.d.ts
|
|
459
361
|
interface ConlocaContentOptions {
|
|
@@ -467,5 +369,5 @@ interface ConlocaContentOptions {
|
|
|
467
369
|
*/
|
|
468
370
|
declare function conlocaContent(options: ConlocaContentOptions): Plugin;
|
|
469
371
|
//#endregion
|
|
470
|
-
export { APIError, type AssetConfig, type AssetEntry, AssetManifest, type AssetManifestData, AssetOperations, BatchOperationResult, BatchResult, BlockFilters, Blocks, type CFAccessResult, type CFAccessUser, ComponentEntry, ComponentEntryWithId, ComponentRegistry, type ConlocaContentOptions, type ContentAPI, ContentAPIOptions, ContentData, ContentEntry, ContentIdentity, ContentListResult, ContentManifest, ContentMeta, ContentProp, ContentType, type ContentWatcherOptions, CreateBlockInput, CreateContentInput, CreatePageInput, CreateResult, CreateValidationResult, DataCollectionEntry, DataContext, DeleteLocaleInput, DeleteResult, ErrorCode, ErrorCodes, FileSystemContentAPI, FindOptions, GlobalFilters, InMemoryContentAPI, LocaleFileData, LocalePathData, LocaleUpdateData, LocaleVersion, LocalizedEntry, LocalizedManifest, MDXFrontmatter, MoveResult, PageReference, Site, SiteFilters, SitesConfig, UPDATE_SCOPE, UpdateLocaleInput, UpdateResult, UpdateScope, VXJSONFile, ValidationResult, type WebSocketSender, WriteResult, analyzeUpdateScope, buildLocaleVersion, buildPathnameHistory, conlocaContent, createContentAPI, createContentAPIRouter, createContentMiddleware, createContentWatchHandlers, extractBlockName, extractCFAccessToken, formatFileSize, generateContentId, getCurrentISODate, getMetadataSize, isContentPublished, isMetadataTooLarge, isValidBlockName, isValidPathname, localesOf, mapLocales, mapSiteNames, normalizePathname, parseDate, resolvePublishDate, serializeMdxWithFrontmatter, shouldUpdateModifiedTimestamp, updatePublishDates, validateAndPrepareMetadata, validateCFAccessRequest, validateCreateContent };
|
|
372
|
+
export { APIError, type AssetConfig, type AssetEntry, AssetManifest, type AssetManifestData, AssetOperations, BatchOperationResult, BatchResult, BlockFilters, Blocks, type CFAccessResult, type CFAccessUser, ComponentEntry, ComponentEntryWithId, ComponentRegistry, type ConlocaContentOptions, type ContentAPI, ContentAPIOptions, ContentData, ContentEntry, ContentIdentity, ContentListResult, ContentManifest, ContentMeta, ContentProp, ContentType, type ContentWatcherOptions, CreateBlockInput, CreateContentInput, CreatePageInput, CreateResult, CreateValidationResult, DataCollectionEntry, DataContext, DeleteLocaleInput, DeleteResult, ErrorCode, ErrorCodes, FileSystemContentAPI, FindOptions, GlobalFilters, InMemoryContentAPI, LocaleFileData, LocalePathData, LocaleUpdateData, LocaleVersion, LocalizedEntry, LocalizedManifest, MDXCompileResponse, MDXFrontmatter, MoveResult, PageReference, PathnameValidationReason, PathnameValidationResult, Site, SiteFilters, SitesConfig, UPDATE_SCOPE, UpdateLocaleInput, UpdateResult, UpdateScope, VXJSONFile, ValidationResult, type WebSocketSender, WriteResult, analyzeUpdateScope, buildLocaleVersion, buildPathnameHistory, conlocaContent, createContentAPI, createContentAPIRouter, createContentMiddleware, createContentWatchHandlers, extractBlockName, extractCFAccessToken, formatFileSize, generateContentId, getCurrentISODate, getMetadataSize, isContentPublished, isMetadataTooLarge, isValidBlockName, isValidPathname, localesOf, mapLocales, mapSiteNames, normalizeAndValidatePathname, normalizePathname, parseDate, readSitesConfig, resolvePublishDate, serializeMdxWithFrontmatter, shouldUpdateModifiedTimestamp, updatePublishDates, validateAndPrepareMetadata, validateCFAccessRequest, validateCreateContent };
|
|
471
373
|
//# sourceMappingURL=node.d.mts.map
|
package/dist/node.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.mts","names":[],"sources":["../src/asset-manifest.ts","../src/asset-operations.ts","../src/cf-access.ts","../src/component-registry.ts","../src/
|
|
1
|
+
{"version":3,"file":"node.d.mts","names":[],"sources":["../src/asset-manifest.ts","../src/asset-operations.ts","../src/cf-access.ts","../src/component-registry.ts","../src/content-watcher.ts","../src/in-memory-content-api.ts","../src/middleware.ts","../src/vite-plugin.ts"],"mappings":"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"}
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js-specific exports for @conloca/content-api
|
|
3
|
+
*
|
|
4
|
+
* These exports require Node.js runtime APIs and should not be imported in browser environments.
|
|
5
|
+
* Use the main package exports for browser-compatible APIs.
|
|
6
|
+
*/
|
|
7
|
+
export { type AssetEntry, AssetManifest, type AssetManifestData } from './asset-manifest';
|
|
8
|
+
export { type AssetConfig, AssetOperations } from './asset-operations';
|
|
9
|
+
export { Blocks } from './blocks';
|
|
10
|
+
export { type CFAccessResult, type CFAccessUser, extractCFAccessToken, validateCFAccessRequest, } from './cf-access.js';
|
|
11
|
+
export { ComponentRegistry } from './component-registry';
|
|
12
|
+
export * from './component-registry.types';
|
|
13
|
+
export type { ContentAPI } from './content-api.interface';
|
|
14
|
+
export * from './content-operations';
|
|
15
|
+
export * from './content-utils';
|
|
16
|
+
export type { ContentWatcherOptions, WebSocketSender } from './content-watcher';
|
|
17
|
+
export { createContentAPI, createContentWatchHandlers } from './content-watcher';
|
|
18
|
+
export { FileSystemContentAPI, readSitesConfig } from './filesystem-content-api';
|
|
19
|
+
export { InMemoryContentAPI } from './in-memory-content-api';
|
|
20
|
+
export { createContentAPIRouter, createContentMiddleware } from './middleware';
|
|
21
|
+
export { Site } from './site';
|
|
22
|
+
export * from './types';
|
|
23
|
+
export type { ConlocaContentOptions } from './vite-plugin';
|
|
24
|
+
export { conlocaContent } from './vite-plugin';
|
|
25
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,KAAK,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,YAAY,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js-specific exports for @conloca/content-api
|
|
3
|
+
*
|
|
4
|
+
* These exports require Node.js runtime APIs and should not be imported in browser environments.
|
|
5
|
+
* Use the main package exports for browser-compatible APIs.
|
|
6
|
+
*/
|
|
7
|
+
export { AssetManifest } from './asset-manifest';
|
|
8
|
+
export { AssetOperations } from './asset-operations';
|
|
9
|
+
export { Blocks } from './blocks';
|
|
10
|
+
// CF Access authentication
|
|
11
|
+
export { extractCFAccessToken, validateCFAccessRequest, } from './cf-access.js';
|
|
12
|
+
export { ComponentRegistry } from './component-registry';
|
|
13
|
+
export * from './component-registry.types';
|
|
14
|
+
export * from './content-operations';
|
|
15
|
+
export * from './content-utils';
|
|
16
|
+
export { createContentAPI, createContentWatchHandlers } from './content-watcher';
|
|
17
|
+
// Node.js specific implementations (require fs, xxhash, etc.)
|
|
18
|
+
export { FileSystemContentAPI, readSitesConfig } from './filesystem-content-api';
|
|
19
|
+
export { InMemoryContentAPI } from './in-memory-content-api';
|
|
20
|
+
export { createContentAPIRouter, createContentMiddleware } from './middleware';
|
|
21
|
+
export { Site } from './site';
|
|
22
|
+
// Re-export types and utilities that are safe for Node.js environments
|
|
23
|
+
export * from './types';
|
|
24
|
+
export { conlocaContent } from './vite-plugin';
|