@notion-headless-cms/core 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cache/memory.d.mts +52 -0
  2. package/dist/cache/memory.mjs +112 -0
  3. package/dist/cache/memory.mjs.map +1 -0
  4. package/dist/cache/{noop.d.ts → noop.d.mts} +5 -3
  5. package/dist/cache/noop.mjs +44 -0
  6. package/dist/cache/noop.mjs.map +1 -0
  7. package/dist/cache-B-MG4yyg.d.mts +45 -0
  8. package/dist/content-BrwEY2_p.d.mts +53 -0
  9. package/dist/{errors.d.ts → errors.d.mts} +18 -16
  10. package/dist/errors.mjs +24 -0
  11. package/dist/errors.mjs.map +1 -0
  12. package/dist/hooks-DCSAQkST.d.mts +60 -0
  13. package/dist/hooks.d.mts +2 -0
  14. package/dist/hooks.mjs +75 -0
  15. package/dist/hooks.mjs.map +1 -0
  16. package/dist/index.d.mts +449 -0
  17. package/dist/index.mjs +616 -0
  18. package/dist/index.mjs.map +1 -0
  19. package/package.json +17 -16
  20. package/dist/cache/memory.d.ts +0 -54
  21. package/dist/cache/memory.js +0 -15
  22. package/dist/cache/memory.js.map +0 -1
  23. package/dist/cache/noop.js +0 -9
  24. package/dist/cache/noop.js.map +0 -1
  25. package/dist/cache-DvbyemBK.d.ts +0 -33
  26. package/dist/chunk-4KGKWKKI.js +0 -80
  27. package/dist/chunk-4KGKWKKI.js.map +0 -1
  28. package/dist/chunk-6DG63XUF.js +0 -42
  29. package/dist/chunk-6DG63XUF.js.map +0 -1
  30. package/dist/chunk-6LHROEPI.js +0 -104
  31. package/dist/chunk-6LHROEPI.js.map +0 -1
  32. package/dist/chunk-V6ML4QE5.js +0 -26
  33. package/dist/chunk-V6ML4QE5.js.map +0 -1
  34. package/dist/content-Biqf0l_o.d.ts +0 -51
  35. package/dist/errors.js +0 -11
  36. package/dist/errors.js.map +0 -1
  37. package/dist/hooks-B83RUclt.d.ts +0 -41
  38. package/dist/hooks.d.ts +0 -2
  39. package/dist/hooks.js +0 -9
  40. package/dist/hooks.js.map +0 -1
  41. package/dist/index.d.ts +0 -278
  42. package/dist/index.js +0 -598
  43. package/dist/index.js.map +0 -1
@@ -0,0 +1,449 @@
1
+ import { a as StorageBinary, i as CachedItemList, n as CMSSchemaProperties, r as CachedItem, t as BaseContentItem } from "./content-BrwEY2_p.mjs";
2
+ import { i as InvalidateScope, n as DocumentCacheAdapter, r as ImageCacheAdapter, t as CacheConfig } from "./cache-B-MG4yyg.mjs";
3
+ import { a as Logger, i as definePlugin, n as mergeLoggers, o as CMSHooks, r as CMSPlugin, s as MaybePromise, t as mergeHooks } from "./hooks-DCSAQkST.mjs";
4
+ import { MemoryDocumentCacheOptions, MemoryImageCacheOptions, memoryCache, memoryDocumentCache, memoryImageCache } from "./cache/memory.mjs";
5
+ import { noopDocumentCache, noopImageCache } from "./cache/noop.mjs";
6
+ import { CMSError, CMSErrorCode, CMSErrorContext, isCMSError, isCMSErrorInNamespace } from "./errors.mjs";
7
+
8
+ //#region src/content/blocks.d.ts
9
+ /**
10
+ * CMS 本文の中間表現 (AST)。
11
+ *
12
+ * DataSource が本文をこの配列にノーマライズして返す。
13
+ * レンダラー (`blocksToHtml`) やカスタム React コンポーネントは
14
+ * この型だけを扱えばよい。
15
+ *
16
+ * 対応が難しいブロック (Notion の column / synced block など) は
17
+ * `{ type: "raw", html }` にフォールバックする。
18
+ */
19
+ type ContentBlock = {
20
+ type: "paragraph";
21
+ children: InlineNode[];
22
+ } | {
23
+ type: "heading";
24
+ level: 1 | 2 | 3;
25
+ children: InlineNode[];
26
+ } | {
27
+ type: "image";
28
+ src: string;
29
+ alt?: string;
30
+ cachedHash?: string;
31
+ } | {
32
+ type: "code";
33
+ lang?: string;
34
+ value: string;
35
+ } | {
36
+ type: "list";
37
+ ordered: boolean;
38
+ items: ContentBlock[][];
39
+ } | {
40
+ type: "quote";
41
+ children: ContentBlock[];
42
+ } | {
43
+ type: "divider";
44
+ } | {
45
+ type: "raw";
46
+ html: string;
47
+ };
48
+ /** paragraph / heading 等の子に並ぶインラインノード。 */
49
+ type InlineNode = {
50
+ type: "text";
51
+ value: string;
52
+ bold?: boolean;
53
+ italic?: boolean;
54
+ code?: boolean;
55
+ } | {
56
+ type: "link";
57
+ url: string;
58
+ children: InlineNode[];
59
+ } | {
60
+ type: "break";
61
+ };
62
+ /**
63
+ * `getItem({ include: { content: true } })` で返される本文。
64
+ * blocks は常に同梱。html / markdown は遅延生成。
65
+ */
66
+ interface ContentResult {
67
+ /** 本文の AST (第一級)。 */
68
+ blocks: ContentBlock[];
69
+ /** 遅延 HTML。renderer が必要な場合のみ呼ぶ。 */
70
+ html(): Promise<string>;
71
+ /** 遅延 Markdown。 */
72
+ markdown(): Promise<string>;
73
+ }
74
+ /** 画像参照 (DataSource.resolveImageUrl に渡す)。 */
75
+ interface ImageRef {
76
+ /** 元の Notion 画像 URL (期限切れの可能性あり)。 */
77
+ originalUrl: string;
78
+ /** 関連するアイテム ID。 */
79
+ itemId?: string;
80
+ }
81
+ //#endregion
82
+ //#region src/types/collection.d.ts
83
+ /** 並び順指定。 */
84
+ interface SortOption<T extends BaseContentItem = BaseContentItem> {
85
+ /** ソートするプロパティ名。 */
86
+ by: keyof T & string;
87
+ /** 昇順 / 降順。デフォルト "desc"。 */
88
+ direction?: "asc" | "desc";
89
+ }
90
+ /** `getList` のフィルタ / ソート / ページング。 */
91
+ interface GetListOptions<T extends BaseContentItem = BaseContentItem> {
92
+ /** ステータス絞り込み (`publishedStatuses` を上書き)。 */
93
+ statuses?: string[];
94
+ /** プロパティ一致フィルタ (in-memory フィルタ)。 */
95
+ where?: Partial<Record<keyof T, unknown>>;
96
+ /** タグ絞り込み (schema に tags: string[] フィールドがある場合)。 */
97
+ tag?: string;
98
+ /** ソート。デフォルトは publishedAt の降順。 */
99
+ sort?: SortOption<T>;
100
+ /** 最大件数。 */
101
+ limit?: number;
102
+ /** スキップ件数。 */
103
+ skip?: number;
104
+ }
105
+ /** `adjacent` の並び順指定。 */
106
+ interface AdjacencyOptions<T extends BaseContentItem = BaseContentItem> {
107
+ sort?: SortOption<T>;
108
+ }
109
+ /** `getItem` の返り値 (本文常時同梱)。 */
110
+ type ItemWithContent<T extends BaseContentItem> = T & {
111
+ content: ContentResult;
112
+ };
113
+ /**
114
+ * コレクション別の CMS クライアント。
115
+ * `cms.posts.getItem(slug)` のようにアクセスする。
116
+ */
117
+ interface CollectionClient<T extends BaseContentItem = BaseContentItem> {
118
+ /** スラッグで単件取得 (本文込み)。キャッシュを経由 (SWR)。 */
119
+ getItem(slug: string): Promise<ItemWithContent<T> | null>;
120
+ /** 公開済みアイテム一覧 (本文なし、一覧ページ向け)。 */
121
+ getList(opts?: GetListOptions<T>): Promise<T[]>;
122
+ /** Next App Router の `generateStaticParams` 向け。 */
123
+ getStaticParams(): Promise<{
124
+ slug: string;
125
+ }[]>;
126
+ /** SSG のパス一覧 (スラッグ配列)。 */
127
+ getStaticPaths(): Promise<string[]>;
128
+ /** 前後記事のナビゲーション。 */
129
+ adjacent(slug: string, opts?: AdjacencyOptions<T>): Promise<{
130
+ prev: T | null;
131
+ next: T | null;
132
+ }>;
133
+ /** 指定スコープのキャッシュを無効化する。 */
134
+ revalidate(scope?: "all" | {
135
+ slug: string;
136
+ }): Promise<void>;
137
+ /** 全コンテンツをプリフェッチしてキャッシュに保存。 */
138
+ prefetch(opts?: {
139
+ concurrency?: number;
140
+ onProgress?: (done: number, total: number) => void;
141
+ }): Promise<{
142
+ ok: number;
143
+ failed: number;
144
+ }>;
145
+ }
146
+ //#endregion
147
+ //#region src/types/data-source.d.ts
148
+ /**
149
+ * キャッシュ無効化のスコープ (DataSource 層で参照する形)。
150
+ */
151
+ type InvalidateScope$1 = "all" | {
152
+ collection: string;
153
+ } | {
154
+ collection: string;
155
+ slug: string;
156
+ };
157
+ /**
158
+ * Webhook 受信時の検証設定。
159
+ */
160
+ interface WebhookConfig {
161
+ /** 署名検証用シークレット。 */
162
+ secret?: string;
163
+ }
164
+ /**
165
+ * コンテンツソースを抽象化する v1 インターフェース。
166
+ *
167
+ * ユーザーは直接実装しない。`notion-orm` 等の ORM パッケージが実装する。
168
+ * core は Notion 固有の知識を持たず、このインターフェース経由でのみデータを扱う。
169
+ * 将来 `googledocs-orm` 等の別ソースもこの I/F を満たせば差し替え可能。
170
+ */
171
+ interface DataSource<T extends BaseContentItem = BaseContentItem> {
172
+ /** ソース識別子 (ロギング・デバッグ用)。 */
173
+ readonly name: string;
174
+ /** 公開扱いするステータス値 (ORM 側デフォルト)。 */
175
+ readonly publishedStatuses?: readonly string[];
176
+ /** アクセス許可するステータス値 (ORM 側デフォルト)。 */
177
+ readonly accessibleStatuses?: readonly string[];
178
+ /** 公開済みアイテム一覧を取得する。 */
179
+ list(opts?: {
180
+ publishedStatuses?: readonly string[];
181
+ }): Promise<T[]>;
182
+ /** スラッグで単件取得。見つからなければ null。 */
183
+ findBySlug(slug: string): Promise<T | null>;
184
+ /** アイテム本文を ContentBlock 配列で返す。 */
185
+ loadBlocks(item: T): Promise<ContentBlock[]>;
186
+ /** アイテム本文を Markdown 文字列で返す (html() 生成の元ソース)。 */
187
+ loadMarkdown(item: T): Promise<string>;
188
+ /** SWR 鮮度判定用。item の最終更新タイムスタンプ。 */
189
+ getLastModified(item: T): string;
190
+ /** リスト全体のバージョン文字列 (例: 最新 last_edited_time)。 */
191
+ getListVersion(items: T[]): string;
192
+ /** 期限切れ画像 URL の再取得 (Notion の署名 URL 対応)。 */
193
+ resolveImageUrl?(ref: ImageRef): Promise<string>;
194
+ /**
195
+ * Webhook リクエストをパースして無効化スコープを返す。
196
+ * 実装していない場合は `$handler` が body の `{ slug }` にフォールバック。
197
+ */
198
+ parseWebhook?(req: Request, config: WebhookConfig): Promise<InvalidateScope$1>;
199
+ }
200
+ /**
201
+ * `nhcSchema` の各コレクション設定エントリ。
202
+ * ユーザーは CLI 生成の `nhcSchema` を渡すだけで、
203
+ * この型は `createCMS` 内部で DataSource のファクトリに渡される。
204
+ */
205
+ interface CollectionConfig<T extends BaseContentItem = BaseContentItem> {
206
+ /** Notion データソース (database) ID。 */
207
+ databaseId: string;
208
+ /** スキーマ情報 (ORM が解釈する不透明データ)。 */
209
+ schema?: any;
210
+ /** 公開扱いするステータス値。 */
211
+ publishedStatuses?: string[];
212
+ /** アクセス許可するステータス値。 */
213
+ accessibleStatuses?: string[];
214
+ /** `T` を型レベルで持ち回るためのマーカー (ランタイム値なし)。 */
215
+ __itemType?: T;
216
+ }
217
+ /**
218
+ * `nhc generate` が生成する `nhcSchema` の型。
219
+ * コレクション名をキーとして、各コレクションの設定を保持する。
220
+ */
221
+ type NHCSchema = Record<string, CollectionConfig<any>>;
222
+ /** `CollectionConfig<T>` から `T` を抽出するユーティリティ型。 */
223
+ type InferCollectionItem<C> = C extends CollectionConfig<infer T> ? T : BaseContentItem;
224
+ /**
225
+ * DataSource を生成するファクトリ関数の型。
226
+ * `createCMS` はコレクション名 → この関数 → DataSource の経路で組み立てる。
227
+ *
228
+ * ユーザーコードは直接呼ばない。`@notion-headless-cms/notion-orm` 等が provide する。
229
+ */
230
+ type DataSourceFactory = <T extends BaseContentItem>(args: {
231
+ collection: string;
232
+ config: CollectionConfig<T>;
233
+ notionToken: string;
234
+ }) => DataSource<T>;
235
+ //#endregion
236
+ //#region src/types/config.d.ts
237
+ /**
238
+ * renderer プラグインの不透明型。
239
+ * core は unified / remark / rehype に依存せず、このリストをそのまま renderer に渡すだけ。
240
+ */
241
+ type RendererPluginList = any[];
242
+ /**
243
+ * render() オプション。core は renderer の実装を知らず、この型だけを扱う。
244
+ * @notion-headless-cms/renderer の renderMarkdown() はこのシグネチャと構造的に互換。
245
+ */
246
+ interface RenderOptions {
247
+ imageProxyBase?: string;
248
+ cacheImage?: (url: string) => Promise<string>;
249
+ remarkPlugins?: RendererPluginList;
250
+ rehypePlugins?: RendererPluginList;
251
+ }
252
+ /** カスタムレンダラー関数の型。デフォルトは @notion-headless-cms/renderer の renderMarkdown。 */
253
+ type RendererFn = (markdown: string, opts?: RenderOptions) => Promise<string>;
254
+ /** レンダリング・コンテンツ処理設定。 */
255
+ interface ContentConfig {
256
+ /** 画像プロキシのベースURL。デフォルト: '/api/images' */
257
+ imageProxyBase?: string;
258
+ /** 追加する remark プラグイン。 */
259
+ remarkPlugins?: RendererPluginList;
260
+ /** 追加する rehype プラグイン。 */
261
+ rehypePlugins?: RendererPluginList;
262
+ }
263
+ /** レートリミット・リトライ設定。 */
264
+ interface RateLimiterConfig {
265
+ /** 同時実行数の上限。デフォルト: 3 */
266
+ maxConcurrent?: number;
267
+ /** リトライ対象の HTTP ステータスコード。デフォルト: [429, 502, 503] */
268
+ retryOn?: number[];
269
+ /** 最大リトライ回数。デフォルト: 4 */
270
+ maxRetries?: number;
271
+ /** リトライ時の基準待機時間(ミリ秒)。デフォルト: 1000 */
272
+ baseDelayMs?: number;
273
+ }
274
+ /** `createCMS({ dataSources })` の map 型。 */
275
+ type DataSourceMap = Record<string, DataSource<any>>;
276
+ /** `DataSourceMap` から各 T を抽出するユーティリティ型。 */
277
+ type InferDataSourceItem<D> = D extends DataSource<infer T> ? T : BaseContentItem;
278
+ /**
279
+ * `createCMS()` に渡すオプション。v1 の正式な入力シグネチャ。
280
+ * ユーザーは `nhc generate` が生成した `nhcDataSources` を渡すだけ。
281
+ */
282
+ interface CreateCMSOptions<D extends DataSourceMap = DataSourceMap> {
283
+ /** コレクション名 → DataSource のマップ (CLI 生成の `nhcDataSources`)。 */
284
+ dataSources: D;
285
+ /** レンダラー関数。未指定時は @notion-headless-cms/renderer の renderMarkdown を使用。 */
286
+ renderer?: RendererFn;
287
+ /** キャッシュ設定。未設定時はキャッシュなし。 */
288
+ cache?: CacheConfig;
289
+ /** レンダリング・コンテンツ処理設定。 */
290
+ content?: ContentConfig;
291
+ /** Cloudflare Workers の waitUntil に相当する非同期処理の登録関数。 */
292
+ waitUntil?: (p: Promise<unknown>) => void;
293
+ /** ライフサイクルフック (全コレクション共通)。 */
294
+ hooks?: CMSHooks<any>;
295
+ /** プラグイン配列。 */
296
+ plugins?: CMSPlugin<any>[];
297
+ /** ロガー。 */
298
+ logger?: Logger;
299
+ /** レートリミット・リトライ設定。 */
300
+ rateLimiter?: RateLimiterConfig;
301
+ }
302
+ //#endregion
303
+ //#region src/cache.d.ts
304
+ /** 文字列をSHA-256でハッシュ化し、16進数文字列として返す。画像キーの生成に使用。 */
305
+ declare function sha256Hex(input: string): Promise<string>;
306
+ /**
307
+ * キャッシュが有効期限切れかどうかを判定する。
308
+ * ttlMs が未指定の場合は常に false(無期限有効)を返す。
309
+ */
310
+ declare function isStale(cachedAt: number, ttlMs?: number): boolean;
311
+ //#endregion
312
+ //#region src/handler.d.ts
313
+ /** `$handler()` の挙動設定。 */
314
+ interface HandlerOptions {
315
+ /** マウントするベースパス。デフォルト `/api/cms`。 */
316
+ basePath?: string;
317
+ /** 画像プロキシのパス (basePath 相対)。デフォルト `/images/:hash`。 */
318
+ imagesPath?: string;
319
+ /** revalidate webhook のパス (basePath 相対)。デフォルト `/revalidate`。 */
320
+ revalidatePath?: string;
321
+ /** Webhook 署名検証用シークレット (未指定なら検証スキップ)。 */
322
+ webhookSecret?: string;
323
+ /** デフォルト実装を無効化する場合 true。 */
324
+ disabled?: boolean;
325
+ }
326
+ /** `$handler()` が内部で依存する CMS 機能の最小セット。 */
327
+ interface HandlerAdapter {
328
+ imageCache: ImageCacheAdapter;
329
+ /** コレクション名で DataSource を取り出し parseWebhook にフォワードする。 */
330
+ parseWebhook(req: Request, webhookSecret: string | undefined): Promise<InvalidateScope$1 | null>;
331
+ revalidate(scope: InvalidateScope$1): Promise<void>;
332
+ }
333
+ /**
334
+ * Web Standard な Request → Response ルーター。
335
+ * Next.js / React Router / Hono / Cloudflare Workers いずれでも使える。
336
+ *
337
+ * ルート:
338
+ * - GET `{basePath}/images/:hash` — 画像プロキシ
339
+ * - POST `{basePath}/revalidate` — Webhook 受信 + $revalidate()
340
+ */
341
+ declare function createHandler(adapter: HandlerAdapter, opts?: HandlerOptions): (req: Request) => Promise<Response>;
342
+ //#endregion
343
+ //#region src/cms.d.ts
344
+ /** `CMSClient<D>` — コレクション別アクセス + グローバル操作の合成型。 */
345
+ type CMSClient<D extends DataSourceMap> = { [K in keyof D]: CollectionClient<InferDataSourceItem<D[K]>> } & CMSGlobalOps<D>;
346
+ /** `CMSClient` のグローバル名前空間。`$` プレフィックス。 */
347
+ interface CMSGlobalOps<D extends DataSourceMap> {
348
+ /** 登録されているコレクション名の一覧。 */
349
+ readonly $collections: readonly (keyof D & string)[];
350
+ /** 全コレクションまたは特定コレクションのキャッシュを無効化する。 */
351
+ $revalidate(scope?: InvalidateScope$1): Promise<void>;
352
+ /** Web Standard なルーティングハンドラ (画像プロキシ / webhook) を生成する。 */
353
+ $handler(opts?: HandlerOptions): (req: Request) => Promise<Response>;
354
+ /** ハッシュキーでキャッシュ画像を取得する。 */
355
+ $getCachedImage(hash: string): ReturnType<ImageCacheAdapter["get"]>;
356
+ }
357
+ /**
358
+ * 複数の DataSource を束ねた CMS クライアントを生成する。
359
+ *
360
+ * @example
361
+ * const cms = createCMS({
362
+ * dataSources: {
363
+ * posts: createNotionCollection({ token, databaseId, schema }),
364
+ * },
365
+ * cache: { document, image, ttlMs: 60_000 },
366
+ * });
367
+ * const post = await cms.posts.getItem("my-slug");
368
+ */
369
+ declare function createCMS<D extends DataSourceMap>(opts: CreateCMSOptions<D>): CMSClient<D>;
370
+ //#endregion
371
+ //#region src/rendering.d.ts
372
+ /** `buildCachedItem` に必要な CMS の依存を束ねたコンテキスト。 */
373
+ interface RenderContext<T extends BaseContentItem> {
374
+ source: DataSource<T>;
375
+ rendererFn: RendererFn | undefined;
376
+ imgCache: ImageCacheAdapter;
377
+ hasImageCache: boolean;
378
+ imageProxyBase: string;
379
+ contentConfig: ContentConfig | undefined;
380
+ hooks: CMSHooks<T>;
381
+ logger: Logger | undefined;
382
+ }
383
+ //#endregion
384
+ //#region src/retry.d.ts
385
+ interface RetryConfig {
386
+ retryOn: number[];
387
+ maxRetries: number;
388
+ baseDelayMs: number;
389
+ /** true のとき指数バックオフにランダムジッターを加える(Thundering Herd 対策)。デフォルト: true */
390
+ jitter?: boolean;
391
+ onRetry?: (attempt: number, status: number) => void;
392
+ }
393
+ declare const DEFAULT_RETRY_CONFIG: RetryConfig;
394
+ /** 指数バックオフ(オプションでジッター付き)でリトライする。retryOn に含まれる HTTP エラーのみ対象。 */
395
+ declare function withRetry<T>(fn: () => Promise<T>, config: RetryConfig): Promise<T>;
396
+ //#endregion
397
+ //#region src/collection.d.ts
398
+ /**
399
+ * コレクション別キャッシュキーを生成する。
400
+ * item: `{collection}:{slug}` / list: `{collection}`
401
+ */
402
+ declare function collectionKey(collection: string, slug?: string): string;
403
+ /** 単一コレクションの DataSource + SWR キャッシュ依存を束ねたコンテキスト。 */
404
+ interface CollectionContext<T extends BaseContentItem> {
405
+ collection: string;
406
+ source: DataSource<T>;
407
+ docCache: DocumentCacheAdapter<T>;
408
+ render: RenderContext<T>;
409
+ hooks: CMSHooks<T>;
410
+ logger: Logger | undefined;
411
+ ttlMs: number | undefined;
412
+ publishedStatuses: string[];
413
+ accessibleStatuses: string[];
414
+ retryConfig: RetryConfig;
415
+ maxConcurrent: number;
416
+ waitUntil: ((p: Promise<unknown>) => void) | undefined;
417
+ }
418
+ /** CollectionClient の実装。ユーザーは `createCMS` 経由でインスタンスを受け取る。 */
419
+ declare class CollectionClientImpl<T extends BaseContentItem> implements CollectionClient<T> {
420
+ private readonly ctx;
421
+ constructor(ctx: CollectionContext<T>);
422
+ getItem(slug: string): Promise<ItemWithContent<T> | null>;
423
+ getList(opts?: GetListOptions<T>): Promise<T[]>;
424
+ getStaticParams(): Promise<{
425
+ slug: string;
426
+ }[]>;
427
+ getStaticPaths(): Promise<string[]>;
428
+ adjacent(slug: string, opts?: AdjacencyOptions<T>): Promise<{
429
+ prev: T | null;
430
+ next: T | null;
431
+ }>;
432
+ revalidate(scope?: "all" | {
433
+ slug: string;
434
+ }): Promise<void>;
435
+ prefetch(opts?: {
436
+ concurrency?: number;
437
+ onProgress?: (done: number, total: number) => void;
438
+ }): Promise<{
439
+ ok: number;
440
+ failed: number;
441
+ }>;
442
+ private attachContent;
443
+ private fetchList;
444
+ private fetchListRaw;
445
+ private findRaw;
446
+ }
447
+ //#endregion
448
+ export { type AdjacencyOptions, type BaseContentItem, type CMSClient, CMSError, type CMSErrorCode, type CMSErrorContext, type CMSGlobalOps, type CMSHooks, type CMSPlugin, type CMSSchemaProperties, type CacheConfig, type InvalidateScope as CacheInvalidateScope, type CachedItem, type CachedItemList, type CollectionClient, CollectionClientImpl, type CollectionConfig, type CollectionContext, type ContentBlock, type ContentConfig, type ContentResult, type CreateCMSOptions, DEFAULT_RETRY_CONFIG, type DataSource, type DataSourceFactory, type DataSourceMap, type DocumentCacheAdapter, type GetListOptions, type HandlerAdapter, type HandlerOptions, type ImageCacheAdapter, type ImageRef, type InferCollectionItem, type InferDataSourceItem, type InlineNode, type InvalidateScope$1 as InvalidateScope, type ItemWithContent, type Logger, type MaybePromise, type MemoryDocumentCacheOptions, type MemoryImageCacheOptions, type NHCSchema, type RateLimiterConfig, type RenderOptions, type RendererFn, type RendererPluginList, type RetryConfig, type SortOption, type StorageBinary, type WebhookConfig, collectionKey, createCMS, createHandler, definePlugin, isCMSError, isCMSErrorInNamespace, isStale, memoryCache, memoryDocumentCache, memoryImageCache, mergeHooks, mergeLoggers, noopDocumentCache, noopImageCache, sha256Hex, withRetry };
449
+ //# sourceMappingURL=index.d.mts.map