UNPKG

@contentstack/live-preview-utils

Version:

Contentstack provides the Live Preview SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane.

1 lines 8.42 kB
{"version":3,"sources":["../../../../src/cms/types/contentTypeSchema.types.ts"],"sourcesContent":["interface IContentTypeSchemaCommonData {\n uid: string;\n display_name: string;\n mandatory: boolean;\n max_instance?: number;\n min_instance?: number;\n multiple: boolean;\n non_localizable: boolean;\n unique: boolean;\n}\n\nexport interface ITitleContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"text\";\n field_metadata: {\n _default: true;\n version: number;\n };\n mandatory: true;\n unique: true;\n}\n\nexport interface ISingleLineTextBoxContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"text\";\n field_metadata: {\n description: string;\n default_value: string;\n version: number;\n };\n format: string;\n error_messages: {\n format: string;\n };\n}\n\nexport interface IMultiLineTextBoxContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"text\";\n field_metadata: {\n description: string;\n default_value: string;\n multiline: true;\n version: number;\n };\n format: string;\n error_messages: {\n format: string;\n };\n}\n\nexport interface IHTMLRTEContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"text\";\n field_metadata: {\n allow_rich_text: true; // TODO: confirm whether this value is static.\n description: string;\n multiline: false; // TODO: confirm whether this value is static.\n rich_text_type: \"advanced\" | \"basic\" | \"custom\";\n options: [];\n version: number;\n };\n}\n\nexport interface IJSONRTEContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"json\";\n field_metadata: {\n allow_json_rte: true;\n embed_entry: boolean;\n description: string;\n default_value: string;\n multiline: false; // TODO: confirm whether this value is static.\n rich_text_type: \"advanced\" | \"basic\" | \"custom\";\n options: [];\n };\n format: string;\n error_messages: {\n format: string;\n };\n reference_to: [\"sys_assets\"]; // TODO: confirm if the value is static.\n}\n\nexport interface IURLContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"text\";\n uid: \"url\";\n field_metadata: {\n _default: true;\n version: number;\n };\n}\n\nexport interface IMarkdownContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"text\";\n field_metadata: {\n description: string;\n markdown: true;\n version: number;\n };\n}\n\nexport interface ICustomFieldContentTypeSchema\n extends IContentTypeSchemaCommonData {\n extension_uid: string;\n field_metadata: {\n extension: true;\n is_asset?: boolean;\n };\n config: Record<string, unknown>;\n data_type:\n | \"text\"\n | \"number\"\n | \"isodate\"\n | \"boolean\"\n | \"json\"\n | \"reference\"\n | \"file\";\n}\n\nexport interface ISelectContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"text\";\n display_type: \"dropdown\" | \"radio\";\n enum: {\n advanced: boolean;\n choices: { value: string }[];\n };\n field_metadata: {\n description: string;\n default_value: string;\n version: number;\n };\n}\n\nexport interface INumberContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"number\";\n field_metadata: {\n description: string;\n default_value: string;\n };\n}\n\nexport interface IBooleanContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"boolean\";\n field_metadata: {\n description: string;\n default_value: boolean;\n };\n}\n\nexport interface IDateContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"isodate\";\n startDate: null | string;\n endDate: null | string;\n field_metadata: {\n description: string;\n };\n}\n\nexport interface IFileContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"file\";\n extensions: string[];\n field_metadata: {\n description: string;\n rich_text_type: \"standard\";\n };\n}\n\nexport interface ILinkContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"link\";\n field_metadata: {\n description: string;\n default_value: {\n title: string;\n url: string;\n };\n };\n}\n\nexport interface IReferenceContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"reference\";\n reference_to: string[];\n field_metadata: {\n ref_multiple: boolean;\n ref_multiple_content_types: boolean;\n };\n}\n\nexport interface IExperienceContainerContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"experience_container\";\n field_metadata: {\n experience_uid: string;\n project_uid: string;\n enableDefaultVariation: boolean;\n };\n schema: IContentTypeCommonBlocks[];\n}\nexport interface ITaxononmy {\n taxonomy_uid: string;\n non_localizable: boolean;\n mandatory: boolean;\n max_terms: number;\n}\n\nexport interface ITaxanonmyContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"taxonomy\";\n field_metadata: {\n description: string;\n default_value: string;\n version: number;\n };\n taxanomies: ITaxononmy[];\n format: string;\n error_messages: {\n format: string;\n };\n}\n\nexport type IContentTypeCommonBlocks =\n | ISingleLineTextBoxContentTypeSchema\n | IMultiLineTextBoxContentTypeSchema\n | IHTMLRTEContentTypeSchema\n | IJSONRTEContentTypeSchema\n | IMarkdownContentTypeSchema\n | ISelectContentTypeSchema\n | INumberContentTypeSchema\n | IBooleanContentTypeSchema\n | IDateContentTypeSchema\n | IFileContentTypeSchema\n | ICustomFieldContentTypeSchema\n | ILinkContentTypeSchema\n | IModularBlocksContentTypeSchema\n | IGroupContentTypeSchema\n | IReferenceContentTypeSchema\n | IGlobalFieldContentTypeSchema\n | IExperienceContainerContentTypeSchema;\n\nexport type IContentTypeRootBlocks =\n | ISingleLineTextBoxContentTypeSchema\n | IMultiLineTextBoxContentTypeSchema\n | IHTMLRTEContentTypeSchema\n | IJSONRTEContentTypeSchema\n | IMarkdownContentTypeSchema\n | ISelectContentTypeSchema\n | ICustomFieldContentTypeSchema\n | INumberContentTypeSchema\n | IBooleanContentTypeSchema\n | IDateContentTypeSchema\n | IFileContentTypeSchema\n | ILinkContentTypeSchema\n | IModularBlocksContentTypeSchema\n | IGroupContentTypeSchema\n | IReferenceContentTypeSchema\n | IGlobalFieldContentTypeSchema\n | IExperienceContainerContentTypeSchema\n | ITitleContentTypeSchema\n | IURLContentTypeSchema\n | ITaxanonmyContentTypeSchema;\n\nexport interface IModularBlockSingleBlock {\n title: string;\n uid: string;\n schema: IContentTypeCommonBlocks[];\n}\n\nexport interface IModularBlocksContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"blocks\";\n blocks: IModularBlockSingleBlock[];\n field_metadata: {\n instruction: string;\n description: string;\n };\n}\n\nexport interface IGroupContentTypeSchema extends IContentTypeSchemaCommonData {\n data_type: \"group\";\n field_metadata: {\n description: string;\n instruction: string;\n };\n schema: IContentTypeCommonBlocks[];\n}\n\nexport interface IGlobalFieldContentTypeSchema\n extends IContentTypeSchemaCommonData {\n data_type: \"global_field\";\n reference_to: string;\n field_metadata: {\n description: string;\n };\n schema: IContentTypeRootBlocks[];\n}\n\nexport interface IPageSchema {\n created_at: string;\n updated_at: string;\n title: string;\n description: string;\n uid: string;\n _version: number;\n inbuilt_class: false;\n options: {\n is_page: boolean;\n singleton: boolean;\n title: string;\n };\n schema: IContentTypeRootBlocks[];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}