lynkow 3.8.52 → 3.8.60
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/core-CqpK2E3_.d.mts +14 -0
- package/dist/core-CqpK2E3_.d.ts +14 -0
- package/dist/index.d.mts +130 -27
- package/dist/index.d.ts +130 -27
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/dist/middleware/next.d.mts +10 -0
- package/dist/middleware/next.d.ts +10 -0
- package/dist/middleware/next.js +3 -0
- package/dist/middleware/next.js.map +1 -0
- package/dist/middleware/next.mjs +3 -0
- package/dist/middleware/next.mjs.map +1 -0
- package/dist/visual-editor/index.d.mts +109 -0
- package/dist/visual-editor/index.d.ts +109 -0
- package/dist/visual-editor/index.js +64 -0
- package/dist/visual-editor/index.js.map +1 -0
- package/dist/visual-editor/index.mjs +64 -0
- package/dist/visual-editor/index.mjs.map +1 -0
- package/dist/visual-editor/react/index.d.mts +21 -0
- package/dist/visual-editor/react/index.d.ts +21 -0
- package/dist/visual-editor/react/index.js +64 -0
- package/dist/visual-editor/react/index.js.map +1 -0
- package/dist/visual-editor/react/index.mjs +64 -0
- package/dist/visual-editor/react/index.mjs.map +1 -0
- package/package.json +53 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type DataChangeCallback = (blockSlug: string, fieldKey: string, fieldPath: string, value: unknown, allData: Record<string, any>) => void;
|
|
2
|
+
|
|
3
|
+
interface VisualEditorConfig {
|
|
4
|
+
cmsOrigin: string;
|
|
5
|
+
}
|
|
6
|
+
interface VisualEditorInstance {
|
|
7
|
+
destroy: () => void;
|
|
8
|
+
isPreviewMode: () => boolean;
|
|
9
|
+
getBlockData: (blockSlug: string) => Record<string, any> | null;
|
|
10
|
+
onDataChange: (callback: DataChangeCallback) => () => void;
|
|
11
|
+
}
|
|
12
|
+
declare function initVisualEditor(config: VisualEditorConfig): VisualEditorInstance;
|
|
13
|
+
|
|
14
|
+
export { type DataChangeCallback as D, type VisualEditorConfig as V, type VisualEditorInstance as a, initVisualEditor as i };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type DataChangeCallback = (blockSlug: string, fieldKey: string, fieldPath: string, value: unknown, allData: Record<string, any>) => void;
|
|
2
|
+
|
|
3
|
+
interface VisualEditorConfig {
|
|
4
|
+
cmsOrigin: string;
|
|
5
|
+
}
|
|
6
|
+
interface VisualEditorInstance {
|
|
7
|
+
destroy: () => void;
|
|
8
|
+
isPreviewMode: () => boolean;
|
|
9
|
+
getBlockData: (blockSlug: string) => Record<string, any> | null;
|
|
10
|
+
onDataChange: (callback: DataChangeCallback) => () => void;
|
|
11
|
+
}
|
|
12
|
+
declare function initVisualEditor(config: VisualEditorConfig): VisualEditorInstance;
|
|
13
|
+
|
|
14
|
+
export { type DataChangeCallback as D, type VisualEditorConfig as V, type VisualEditorInstance as a, initVisualEditor as i };
|
package/dist/index.d.mts
CHANGED
|
@@ -627,43 +627,44 @@ declare class SeoService extends BaseService {
|
|
|
627
627
|
*/
|
|
628
628
|
llmsFullTxt(options?: BaseRequestOptions): Promise<string>;
|
|
629
629
|
/**
|
|
630
|
-
* Retrieves a single
|
|
630
|
+
* Retrieves a single content or page as Markdown by its path.
|
|
631
631
|
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
632
|
+
* The path is the same as the content's public URL path (available in
|
|
633
|
+
* `Content.path` or `Page.path`). The SDK appends `.md` automatically.
|
|
634
|
+
*
|
|
635
|
+
* @param contentPath - The content's public path.
|
|
636
|
+
* - For blog articles: use `Content.path` directly (includes locale prefix).
|
|
637
|
+
* - For pages in mono-language mode: use `Page.path` directly.
|
|
638
|
+
* - For pages in multi-language mode: prepend the locale manually,
|
|
639
|
+
* e.g., `/${page.locale}${page.path}`.
|
|
640
|
+
* @returns Markdown content
|
|
634
641
|
*
|
|
635
642
|
* @example
|
|
636
643
|
* ```typescript
|
|
637
|
-
* //
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* const md = await lynkow.seo.getContentMarkdown(slug)
|
|
641
|
-
* return new Response(md, {
|
|
642
|
-
* headers: { 'Content-Type': 'text/plain; charset=utf-8' }
|
|
643
|
-
* })
|
|
644
|
-
* }
|
|
645
|
-
* ```
|
|
646
|
-
*/
|
|
647
|
-
getContentMarkdown(slug: string, options?: BaseRequestOptions): Promise<string>;
|
|
648
|
-
/**
|
|
649
|
-
* Retrieves a single page as Markdown
|
|
644
|
+
* // Get a blog article as Markdown (path includes locale automatically)
|
|
645
|
+
* const article = await lynkow.contents.getBySlug('my-article')
|
|
646
|
+
* const md = await lynkow.seo.getMarkdown(article.path)
|
|
650
647
|
*
|
|
651
|
-
*
|
|
652
|
-
*
|
|
648
|
+
* // Get a page as Markdown (mono-language)
|
|
649
|
+
* const page = await lynkow.pages.getBySlug('about')
|
|
650
|
+
* const md = await lynkow.seo.getMarkdown(page.path!)
|
|
653
651
|
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
652
|
+
* // Get a page as Markdown (multi-language — prepend locale)
|
|
653
|
+
* const page = await lynkow.pages.getBySlug('about')
|
|
654
|
+
* const md = await lynkow.seo.getMarkdown(`/${page.locale}${page.path}`)
|
|
655
|
+
*
|
|
656
|
+
* // In a Next.js catch-all route handler
|
|
657
|
+
* export async function GET(req: Request) {
|
|
658
|
+
* const url = new URL(req.url)
|
|
659
|
+
* const path = url.pathname.replace(/\.md$/, '')
|
|
660
|
+
* const md = await lynkow.seo.getMarkdown(path)
|
|
660
661
|
* return new Response(md, {
|
|
661
|
-
* headers: { 'Content-Type': 'text/
|
|
662
|
+
* headers: { 'Content-Type': 'text/markdown; charset=utf-8' }
|
|
662
663
|
* })
|
|
663
664
|
* }
|
|
664
665
|
* ```
|
|
665
666
|
*/
|
|
666
|
-
|
|
667
|
+
getMarkdown(contentPath: string, options?: BaseRequestOptions): Promise<string>;
|
|
667
668
|
}
|
|
668
669
|
|
|
669
670
|
/**
|
|
@@ -808,6 +809,72 @@ interface ImageVariants {
|
|
|
808
809
|
full?: string;
|
|
809
810
|
}
|
|
810
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Schema types for structured content.
|
|
814
|
+
*
|
|
815
|
+
* Categories in 'structured' mode define a field schema that determines
|
|
816
|
+
* the custom fields available for content in that category. These types
|
|
817
|
+
* describe the schema structure returned by the API.
|
|
818
|
+
*/
|
|
819
|
+
/**
|
|
820
|
+
* Supported field types in a content schema
|
|
821
|
+
*/
|
|
822
|
+
type SchemaFieldType = 'string' | 'text' | 'richtext' | 'number' | 'boolean' | 'select' | 'multiselect' | 'image' | 'file' | 'url' | 'email' | 'date' | 'datetime' | 'color' | 'object' | 'array' | 'dataSource';
|
|
823
|
+
/**
|
|
824
|
+
* Option for select/multiselect fields
|
|
825
|
+
*/
|
|
826
|
+
interface SchemaFieldOption {
|
|
827
|
+
value: string;
|
|
828
|
+
label: string;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Validation rules for a schema field
|
|
832
|
+
*/
|
|
833
|
+
interface SchemaFieldValidation {
|
|
834
|
+
minLength?: number;
|
|
835
|
+
maxLength?: number;
|
|
836
|
+
min?: number;
|
|
837
|
+
max?: number;
|
|
838
|
+
pattern?: string;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* A single field definition in a content schema
|
|
842
|
+
*/
|
|
843
|
+
interface SchemaField {
|
|
844
|
+
/** Unique key (used as the property name in customData) */
|
|
845
|
+
key: string;
|
|
846
|
+
/** Field type */
|
|
847
|
+
type: SchemaFieldType;
|
|
848
|
+
/** Display label */
|
|
849
|
+
label: string;
|
|
850
|
+
/** Whether the field is required */
|
|
851
|
+
required?: boolean;
|
|
852
|
+
/** Placeholder text */
|
|
853
|
+
placeholder?: string;
|
|
854
|
+
/** Help text shown below the field */
|
|
855
|
+
helpText?: string;
|
|
856
|
+
/** Default value */
|
|
857
|
+
defaultValue?: unknown;
|
|
858
|
+
/** Validation rules */
|
|
859
|
+
validation?: SchemaFieldValidation;
|
|
860
|
+
/** Sub-fields for object/array types */
|
|
861
|
+
fields?: SchemaField[];
|
|
862
|
+
/** Label for array items */
|
|
863
|
+
itemLabel?: string;
|
|
864
|
+
/** Minimum number of array items */
|
|
865
|
+
minItems?: number;
|
|
866
|
+
/** Maximum number of array items */
|
|
867
|
+
maxItems?: number;
|
|
868
|
+
/** Options for select/multiselect types */
|
|
869
|
+
options?: SchemaFieldOption[];
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Complete content schema (list of field definitions)
|
|
873
|
+
*/
|
|
874
|
+
interface ContentSchema {
|
|
875
|
+
fields: SchemaField[];
|
|
876
|
+
}
|
|
877
|
+
|
|
811
878
|
/**
|
|
812
879
|
* Content category
|
|
813
880
|
*/
|
|
@@ -820,6 +887,14 @@ interface Category {
|
|
|
820
887
|
slug: string;
|
|
821
888
|
/** Locale */
|
|
822
889
|
locale: string;
|
|
890
|
+
/**
|
|
891
|
+
* Content mode.
|
|
892
|
+
* - `'standard'`: articles use the TipTap rich text editor (body field)
|
|
893
|
+
* - `'structured'`: articles use custom fields defined by the category schema (customData field)
|
|
894
|
+
*
|
|
895
|
+
* Only present in detail responses, not in list select projections.
|
|
896
|
+
*/
|
|
897
|
+
contentMode?: 'standard' | 'structured';
|
|
823
898
|
}
|
|
824
899
|
/**
|
|
825
900
|
* Category with path and counter
|
|
@@ -835,6 +910,18 @@ interface CategoryWithCount extends Category {
|
|
|
835
910
|
contentCount: number;
|
|
836
911
|
/** CDN image variants */
|
|
837
912
|
imageVariants?: ImageVariants;
|
|
913
|
+
/**
|
|
914
|
+
* Field schema for structured categories.
|
|
915
|
+
* Defines the custom fields available for content in this category.
|
|
916
|
+
* Only present when `contentMode` is `'structured'`.
|
|
917
|
+
*/
|
|
918
|
+
schema?: ContentSchema | null;
|
|
919
|
+
/**
|
|
920
|
+
* Schema source.
|
|
921
|
+
* - `'own'`: this category defines its own schema
|
|
922
|
+
* - `'inherit'`: schema is inherited from the parent category
|
|
923
|
+
*/
|
|
924
|
+
schemaSource?: 'own' | 'inherit' | null;
|
|
838
925
|
}
|
|
839
926
|
/**
|
|
840
927
|
* Detailed category (with all info)
|
|
@@ -1039,6 +1126,22 @@ interface Content extends ContentSummary {
|
|
|
1039
1126
|
categories: Category[];
|
|
1040
1127
|
/** Associated tags */
|
|
1041
1128
|
tags: Tag[];
|
|
1129
|
+
/**
|
|
1130
|
+
* Custom field data for structured content.
|
|
1131
|
+
* Populated when the content belongs to a category with `contentMode: 'structured'`.
|
|
1132
|
+
* Richtext fields are automatically converted to HTML by the API.
|
|
1133
|
+
* `null` for standard content (which uses `body` instead).
|
|
1134
|
+
*
|
|
1135
|
+
* @example
|
|
1136
|
+
* ```typescript
|
|
1137
|
+
* if (content.customData) {
|
|
1138
|
+
* console.log(content.customData.price) // number
|
|
1139
|
+
* console.log(content.customData.description) // HTML string (richtext)
|
|
1140
|
+
* console.log(content.customData.gallery) // array of objects
|
|
1141
|
+
* }
|
|
1142
|
+
* ```
|
|
1143
|
+
*/
|
|
1144
|
+
customData?: Record<string, any> | null;
|
|
1042
1145
|
}
|
|
1043
1146
|
|
|
1044
1147
|
/**
|
|
@@ -2405,4 +2508,4 @@ declare function browserOnly<T>(fn: () => T, fallback: T): T;
|
|
|
2405
2508
|
*/
|
|
2406
2509
|
declare function browserOnlyAsync<T>(fn: () => Promise<T>, fallback: T): Promise<T>;
|
|
2407
2510
|
|
|
2408
|
-
export { type Alternate, type ApiErrorDetail, type Author, type BaseRequestOptions, type CategoriesListResponse, type Category, type CategoryDetail, type CategoryDetailResponse, type CategoryOptions, type CategoryResolveResponse, type CategoryTreeNode, type CategoryTreeResponse, type CategoryWithCount, type Client, type ClientConfig, type ConsentCategories, type ConsentLogResponse, type Content, type ContentBody, type ContentResolveResponse, type ContentSummary, type ContentsFilters, type ContentsListResponse, type CookieCategory, type CookieConfig, type CookiePreferences, type CookieTexts, EnhancementsService, type ErrorCode, type EventData, type EventName, type Form, type FormField, type FormFieldOption, type FormFieldType, type FormFieldValidation, type FormSettings, type FormSubmitData, type FormSubmitResponse, type GlobalBlock, type GlobalBlockResponse, type ImageVariants, type LegalDocument, type LynkowClient, type LynkowConfig, LynkowError, type LynkowEvents, MediaHelperService, type Page, type PageSeo, type PageSummary, type PagesListResponse, type PageviewData, type PaginatedResponse, type PaginationMeta, type PaginationOptions, type Path, type PathsListResponse, type Redirect, type ResolveResponse, type Review, type ReviewResponse, type ReviewSettings, type ReviewSubmitData, type ReviewSubmitResponse, type ReviewsFilters, type ReviewsListResponse, type SiteConfig, type SiteConfigResponse, type SortOptions, type SrcsetOptions, type SubmitOptions, type Tag, type TagsListResponse, type TipTapMark, type TipTapNode, type TransformOptions, browserOnly, browserOnlyAsync, createClient, createLynkowClient, isBrowser, isCategoryResolve, isContentResolve, isLynkowError, isServer };
|
|
2511
|
+
export { type Alternate, type ApiErrorDetail, type Author, type BaseRequestOptions, type CategoriesListResponse, type Category, type CategoryDetail, type CategoryDetailResponse, type CategoryOptions, type CategoryResolveResponse, type CategoryTreeNode, type CategoryTreeResponse, type CategoryWithCount, type Client, type ClientConfig, type ConsentCategories, type ConsentLogResponse, type Content, type ContentBody, type ContentResolveResponse, type ContentSchema, type ContentSummary, type ContentsFilters, type ContentsListResponse, type CookieCategory, type CookieConfig, type CookiePreferences, type CookieTexts, EnhancementsService, type ErrorCode, type EventData, type EventName, type Form, type FormField, type FormFieldOption, type FormFieldType, type FormFieldValidation, type FormSettings, type FormSubmitData, type FormSubmitResponse, type GlobalBlock, type GlobalBlockResponse, type ImageVariants, type LegalDocument, type LynkowClient, type LynkowConfig, LynkowError, type LynkowEvents, MediaHelperService, type Page, type PageSeo, type PageSummary, type PagesListResponse, type PageviewData, type PaginatedResponse, type PaginationMeta, type PaginationOptions, type Path, type PathsListResponse, type Redirect, type ResolveResponse, type Review, type ReviewResponse, type ReviewSettings, type ReviewSubmitData, type ReviewSubmitResponse, type ReviewsFilters, type ReviewsListResponse, type SchemaField, type SchemaFieldOption, type SchemaFieldType, type SchemaFieldValidation, type SiteConfig, type SiteConfigResponse, type SortOptions, type SrcsetOptions, type SubmitOptions, type Tag, type TagsListResponse, type TipTapMark, type TipTapNode, type TransformOptions, browserOnly, browserOnlyAsync, createClient, createLynkowClient, isBrowser, isCategoryResolve, isContentResolve, isLynkowError, isServer };
|
package/dist/index.d.ts
CHANGED
|
@@ -627,43 +627,44 @@ declare class SeoService extends BaseService {
|
|
|
627
627
|
*/
|
|
628
628
|
llmsFullTxt(options?: BaseRequestOptions): Promise<string>;
|
|
629
629
|
/**
|
|
630
|
-
* Retrieves a single
|
|
630
|
+
* Retrieves a single content or page as Markdown by its path.
|
|
631
631
|
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
632
|
+
* The path is the same as the content's public URL path (available in
|
|
633
|
+
* `Content.path` or `Page.path`). The SDK appends `.md` automatically.
|
|
634
|
+
*
|
|
635
|
+
* @param contentPath - The content's public path.
|
|
636
|
+
* - For blog articles: use `Content.path` directly (includes locale prefix).
|
|
637
|
+
* - For pages in mono-language mode: use `Page.path` directly.
|
|
638
|
+
* - For pages in multi-language mode: prepend the locale manually,
|
|
639
|
+
* e.g., `/${page.locale}${page.path}`.
|
|
640
|
+
* @returns Markdown content
|
|
634
641
|
*
|
|
635
642
|
* @example
|
|
636
643
|
* ```typescript
|
|
637
|
-
* //
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* const md = await lynkow.seo.getContentMarkdown(slug)
|
|
641
|
-
* return new Response(md, {
|
|
642
|
-
* headers: { 'Content-Type': 'text/plain; charset=utf-8' }
|
|
643
|
-
* })
|
|
644
|
-
* }
|
|
645
|
-
* ```
|
|
646
|
-
*/
|
|
647
|
-
getContentMarkdown(slug: string, options?: BaseRequestOptions): Promise<string>;
|
|
648
|
-
/**
|
|
649
|
-
* Retrieves a single page as Markdown
|
|
644
|
+
* // Get a blog article as Markdown (path includes locale automatically)
|
|
645
|
+
* const article = await lynkow.contents.getBySlug('my-article')
|
|
646
|
+
* const md = await lynkow.seo.getMarkdown(article.path)
|
|
650
647
|
*
|
|
651
|
-
*
|
|
652
|
-
*
|
|
648
|
+
* // Get a page as Markdown (mono-language)
|
|
649
|
+
* const page = await lynkow.pages.getBySlug('about')
|
|
650
|
+
* const md = await lynkow.seo.getMarkdown(page.path!)
|
|
653
651
|
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
652
|
+
* // Get a page as Markdown (multi-language — prepend locale)
|
|
653
|
+
* const page = await lynkow.pages.getBySlug('about')
|
|
654
|
+
* const md = await lynkow.seo.getMarkdown(`/${page.locale}${page.path}`)
|
|
655
|
+
*
|
|
656
|
+
* // In a Next.js catch-all route handler
|
|
657
|
+
* export async function GET(req: Request) {
|
|
658
|
+
* const url = new URL(req.url)
|
|
659
|
+
* const path = url.pathname.replace(/\.md$/, '')
|
|
660
|
+
* const md = await lynkow.seo.getMarkdown(path)
|
|
660
661
|
* return new Response(md, {
|
|
661
|
-
* headers: { 'Content-Type': 'text/
|
|
662
|
+
* headers: { 'Content-Type': 'text/markdown; charset=utf-8' }
|
|
662
663
|
* })
|
|
663
664
|
* }
|
|
664
665
|
* ```
|
|
665
666
|
*/
|
|
666
|
-
|
|
667
|
+
getMarkdown(contentPath: string, options?: BaseRequestOptions): Promise<string>;
|
|
667
668
|
}
|
|
668
669
|
|
|
669
670
|
/**
|
|
@@ -808,6 +809,72 @@ interface ImageVariants {
|
|
|
808
809
|
full?: string;
|
|
809
810
|
}
|
|
810
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Schema types for structured content.
|
|
814
|
+
*
|
|
815
|
+
* Categories in 'structured' mode define a field schema that determines
|
|
816
|
+
* the custom fields available for content in that category. These types
|
|
817
|
+
* describe the schema structure returned by the API.
|
|
818
|
+
*/
|
|
819
|
+
/**
|
|
820
|
+
* Supported field types in a content schema
|
|
821
|
+
*/
|
|
822
|
+
type SchemaFieldType = 'string' | 'text' | 'richtext' | 'number' | 'boolean' | 'select' | 'multiselect' | 'image' | 'file' | 'url' | 'email' | 'date' | 'datetime' | 'color' | 'object' | 'array' | 'dataSource';
|
|
823
|
+
/**
|
|
824
|
+
* Option for select/multiselect fields
|
|
825
|
+
*/
|
|
826
|
+
interface SchemaFieldOption {
|
|
827
|
+
value: string;
|
|
828
|
+
label: string;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Validation rules for a schema field
|
|
832
|
+
*/
|
|
833
|
+
interface SchemaFieldValidation {
|
|
834
|
+
minLength?: number;
|
|
835
|
+
maxLength?: number;
|
|
836
|
+
min?: number;
|
|
837
|
+
max?: number;
|
|
838
|
+
pattern?: string;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* A single field definition in a content schema
|
|
842
|
+
*/
|
|
843
|
+
interface SchemaField {
|
|
844
|
+
/** Unique key (used as the property name in customData) */
|
|
845
|
+
key: string;
|
|
846
|
+
/** Field type */
|
|
847
|
+
type: SchemaFieldType;
|
|
848
|
+
/** Display label */
|
|
849
|
+
label: string;
|
|
850
|
+
/** Whether the field is required */
|
|
851
|
+
required?: boolean;
|
|
852
|
+
/** Placeholder text */
|
|
853
|
+
placeholder?: string;
|
|
854
|
+
/** Help text shown below the field */
|
|
855
|
+
helpText?: string;
|
|
856
|
+
/** Default value */
|
|
857
|
+
defaultValue?: unknown;
|
|
858
|
+
/** Validation rules */
|
|
859
|
+
validation?: SchemaFieldValidation;
|
|
860
|
+
/** Sub-fields for object/array types */
|
|
861
|
+
fields?: SchemaField[];
|
|
862
|
+
/** Label for array items */
|
|
863
|
+
itemLabel?: string;
|
|
864
|
+
/** Minimum number of array items */
|
|
865
|
+
minItems?: number;
|
|
866
|
+
/** Maximum number of array items */
|
|
867
|
+
maxItems?: number;
|
|
868
|
+
/** Options for select/multiselect types */
|
|
869
|
+
options?: SchemaFieldOption[];
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Complete content schema (list of field definitions)
|
|
873
|
+
*/
|
|
874
|
+
interface ContentSchema {
|
|
875
|
+
fields: SchemaField[];
|
|
876
|
+
}
|
|
877
|
+
|
|
811
878
|
/**
|
|
812
879
|
* Content category
|
|
813
880
|
*/
|
|
@@ -820,6 +887,14 @@ interface Category {
|
|
|
820
887
|
slug: string;
|
|
821
888
|
/** Locale */
|
|
822
889
|
locale: string;
|
|
890
|
+
/**
|
|
891
|
+
* Content mode.
|
|
892
|
+
* - `'standard'`: articles use the TipTap rich text editor (body field)
|
|
893
|
+
* - `'structured'`: articles use custom fields defined by the category schema (customData field)
|
|
894
|
+
*
|
|
895
|
+
* Only present in detail responses, not in list select projections.
|
|
896
|
+
*/
|
|
897
|
+
contentMode?: 'standard' | 'structured';
|
|
823
898
|
}
|
|
824
899
|
/**
|
|
825
900
|
* Category with path and counter
|
|
@@ -835,6 +910,18 @@ interface CategoryWithCount extends Category {
|
|
|
835
910
|
contentCount: number;
|
|
836
911
|
/** CDN image variants */
|
|
837
912
|
imageVariants?: ImageVariants;
|
|
913
|
+
/**
|
|
914
|
+
* Field schema for structured categories.
|
|
915
|
+
* Defines the custom fields available for content in this category.
|
|
916
|
+
* Only present when `contentMode` is `'structured'`.
|
|
917
|
+
*/
|
|
918
|
+
schema?: ContentSchema | null;
|
|
919
|
+
/**
|
|
920
|
+
* Schema source.
|
|
921
|
+
* - `'own'`: this category defines its own schema
|
|
922
|
+
* - `'inherit'`: schema is inherited from the parent category
|
|
923
|
+
*/
|
|
924
|
+
schemaSource?: 'own' | 'inherit' | null;
|
|
838
925
|
}
|
|
839
926
|
/**
|
|
840
927
|
* Detailed category (with all info)
|
|
@@ -1039,6 +1126,22 @@ interface Content extends ContentSummary {
|
|
|
1039
1126
|
categories: Category[];
|
|
1040
1127
|
/** Associated tags */
|
|
1041
1128
|
tags: Tag[];
|
|
1129
|
+
/**
|
|
1130
|
+
* Custom field data for structured content.
|
|
1131
|
+
* Populated when the content belongs to a category with `contentMode: 'structured'`.
|
|
1132
|
+
* Richtext fields are automatically converted to HTML by the API.
|
|
1133
|
+
* `null` for standard content (which uses `body` instead).
|
|
1134
|
+
*
|
|
1135
|
+
* @example
|
|
1136
|
+
* ```typescript
|
|
1137
|
+
* if (content.customData) {
|
|
1138
|
+
* console.log(content.customData.price) // number
|
|
1139
|
+
* console.log(content.customData.description) // HTML string (richtext)
|
|
1140
|
+
* console.log(content.customData.gallery) // array of objects
|
|
1141
|
+
* }
|
|
1142
|
+
* ```
|
|
1143
|
+
*/
|
|
1144
|
+
customData?: Record<string, any> | null;
|
|
1042
1145
|
}
|
|
1043
1146
|
|
|
1044
1147
|
/**
|
|
@@ -2405,4 +2508,4 @@ declare function browserOnly<T>(fn: () => T, fallback: T): T;
|
|
|
2405
2508
|
*/
|
|
2406
2509
|
declare function browserOnlyAsync<T>(fn: () => Promise<T>, fallback: T): Promise<T>;
|
|
2407
2510
|
|
|
2408
|
-
export { type Alternate, type ApiErrorDetail, type Author, type BaseRequestOptions, type CategoriesListResponse, type Category, type CategoryDetail, type CategoryDetailResponse, type CategoryOptions, type CategoryResolveResponse, type CategoryTreeNode, type CategoryTreeResponse, type CategoryWithCount, type Client, type ClientConfig, type ConsentCategories, type ConsentLogResponse, type Content, type ContentBody, type ContentResolveResponse, type ContentSummary, type ContentsFilters, type ContentsListResponse, type CookieCategory, type CookieConfig, type CookiePreferences, type CookieTexts, EnhancementsService, type ErrorCode, type EventData, type EventName, type Form, type FormField, type FormFieldOption, type FormFieldType, type FormFieldValidation, type FormSettings, type FormSubmitData, type FormSubmitResponse, type GlobalBlock, type GlobalBlockResponse, type ImageVariants, type LegalDocument, type LynkowClient, type LynkowConfig, LynkowError, type LynkowEvents, MediaHelperService, type Page, type PageSeo, type PageSummary, type PagesListResponse, type PageviewData, type PaginatedResponse, type PaginationMeta, type PaginationOptions, type Path, type PathsListResponse, type Redirect, type ResolveResponse, type Review, type ReviewResponse, type ReviewSettings, type ReviewSubmitData, type ReviewSubmitResponse, type ReviewsFilters, type ReviewsListResponse, type SiteConfig, type SiteConfigResponse, type SortOptions, type SrcsetOptions, type SubmitOptions, type Tag, type TagsListResponse, type TipTapMark, type TipTapNode, type TransformOptions, browserOnly, browserOnlyAsync, createClient, createLynkowClient, isBrowser, isCategoryResolve, isContentResolve, isLynkowError, isServer };
|
|
2511
|
+
export { type Alternate, type ApiErrorDetail, type Author, type BaseRequestOptions, type CategoriesListResponse, type Category, type CategoryDetail, type CategoryDetailResponse, type CategoryOptions, type CategoryResolveResponse, type CategoryTreeNode, type CategoryTreeResponse, type CategoryWithCount, type Client, type ClientConfig, type ConsentCategories, type ConsentLogResponse, type Content, type ContentBody, type ContentResolveResponse, type ContentSchema, type ContentSummary, type ContentsFilters, type ContentsListResponse, type CookieCategory, type CookieConfig, type CookiePreferences, type CookieTexts, EnhancementsService, type ErrorCode, type EventData, type EventName, type Form, type FormField, type FormFieldOption, type FormFieldType, type FormFieldValidation, type FormSettings, type FormSubmitData, type FormSubmitResponse, type GlobalBlock, type GlobalBlockResponse, type ImageVariants, type LegalDocument, type LynkowClient, type LynkowConfig, LynkowError, type LynkowEvents, MediaHelperService, type Page, type PageSeo, type PageSummary, type PagesListResponse, type PageviewData, type PaginatedResponse, type PaginationMeta, type PaginationOptions, type Path, type PathsListResponse, type Redirect, type ResolveResponse, type Review, type ReviewResponse, type ReviewSettings, type ReviewSubmitData, type ReviewSubmitResponse, type ReviewsFilters, type ReviewsListResponse, type SchemaField, type SchemaFieldOption, type SchemaFieldType, type SchemaFieldValidation, type SiteConfig, type SiteConfigResponse, type SortOptions, type SrcsetOptions, type SubmitOptions, type Tag, type TagsListResponse, type TipTapMark, type TipTapNode, type TransformOptions, browserOnly, browserOnlyAsync, createClient, createLynkowClient, isBrowser, isCategoryResolve, isContentResolve, isLynkowError, isServer };
|