schema/wp-api
Type Aliases
'Read the “', Type Aliases, '” section'type Category = { count: number; description: string; id: number; link: string; meta: any[] | Record<string, any>; name: string; parent: number; slug: string; taxonomy: string;};
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:182
Represents a Category type derived from the output of the CategorySchema.
Type declaration
'Read the “', Type declaration, '” section'count: number;
description
'Read the “', description, '” section'description: string;
id: number;
link: string;
meta: any[] | Record<string, any>;
name: string;
parent: number;
slug: string;
taxonomy: string;
type Page = { author: number; comment_status: "" | "open" | "closed"; content: { protected: boolean; rendered: string; }; date: Date; date_gmt: Date; excerpt: { protected: boolean; rendered: string; }; featured_media: number; guid: { rendered: string; }; id: number; menu_order: number; meta: any[]; modified: Date; modified_gmt: Date; parent: number; ping_status: "" | "open" | "closed"; slug: string; status: "publish" | "future" | "draft" | "pending" | "private"; template: string; title: { rendered: string; }; type: string;};
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:165
Represents the type of a Page object as defined by the PageSchema. This type is derived from the output type of the PageSchema.
Type declaration
'Read the “', Type declaration, '” section'author: number;
comment_status
'Read the “', comment_status, '” section'comment_status: "" | "open" | "closed" = OpenClosedSchema;
content: { protected: boolean; rendered: string;};
content.protected
'Read the “', content.protected, '” section'protected: boolean;
content.rendered
'Read the “', content.rendered, '” section'rendered: string;
date: Date;
date_gmt: Date;
excerpt: { protected: boolean; rendered: string;};
excerpt.protected
'Read the “', excerpt.protected, '” section'protected: boolean;
excerpt.rendered
'Read the “', excerpt.rendered, '” section'rendered: string;
featured_media
'Read the “', featured_media, '” section'featured_media: number;
guid: { rendered: string;};
guid.rendered
'Read the “', guid.rendered, '” section'rendered: string;
id: number;
menu_order
'Read the “', menu_order, '” section'menu_order: number;
meta: any[];
modified: Date;
modified_gmt
'Read the “', modified_gmt, '” section'modified_gmt: Date;
parent: number;
ping_status
'Read the “', ping_status, '” section'ping_status: "" | "open" | "closed" = OpenClosedSchema;
slug: string;
status: "publish" | "future" | "draft" | "pending" | "private";
template: string;
title: { rendered: string;};
title.rendered
'Read the “', title.rendered, '” section'rendered: string;
type: string;
type Post = { author: number; categories: number[]; comment_status: "" | "open" | "closed"; content: { protected: boolean; rendered: string; }; date: Date; date_gmt: Date; excerpt: { protected: boolean; rendered: string; }; featured_media: number; format: | "" | "status" | "standard" | "aside" | "chat" | "gallery" | "link" | "image" | "quote" | "video" | "audio"; guid: { rendered: string; }; id: number; menu_order: number; meta: any[]; modified: Date; modified_gmt: Date; parent: number; ping_status: "" | "open" | "closed"; slug: string; status: "publish" | "future" | "draft" | "pending" | "private"; tags: number[]; template: string; title: { rendered: string; }; type: string;};
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:172
Represents a WordPress post based on the PostSchema.
This type is derived from the output type of the PostSchema.
Type declaration
'Read the “', Type declaration, '” section'author: number;
categories
'Read the “', categories, '” section'categories: number[];
comment_status
'Read the “', comment_status, '” section'comment_status: "" | "open" | "closed" = OpenClosedSchema;
content: { protected: boolean; rendered: string;};
content.protected
'Read the “', content.protected, '” section'protected: boolean;
content.rendered
'Read the “', content.rendered, '” section'rendered: string;
date: Date;
date_gmt: Date;
excerpt: { protected: boolean; rendered: string;};
excerpt.protected
'Read the “', excerpt.protected, '” section'protected: boolean;
excerpt.rendered
'Read the “', excerpt.rendered, '” section'rendered: string;
featured_media
'Read the “', featured_media, '” section'featured_media: number;
format: | "" | "status" | "standard" | "aside" | "chat" | "gallery" | "link" | "image" | "quote" | "video" | "audio";
guid: { rendered: string;};
guid.rendered
'Read the “', guid.rendered, '” section'rendered: string;
id: number;
menu_order
'Read the “', menu_order, '” section'menu_order: number;
meta: any[];
modified: Date;
modified_gmt
'Read the “', modified_gmt, '” section'modified_gmt: Date;
parent: number;
ping_status
'Read the “', ping_status, '” section'ping_status: "" | "open" | "closed" = OpenClosedSchema;
slug: string;
status: "publish" | "future" | "draft" | "pending" | "private";
tags: number[];
template: string;
title: { rendered: string;};
title.rendered
'Read the “', title.rendered, '” section'rendered: string;
type: string;
SiteSettings
'Read the “', SiteSettings, '” section'type SiteSettings = { description: string; gmt_offset: number; home: string; name: string; site_icon: number; site_icon_url: string; site_logo: number; timezone_string: string; url: string;};
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:189
Represents the settings for a site.
This type is derived from the output of the SiteSettingsSchema
.
Type declaration
'Read the “', Type declaration, '” section'description
'Read the “', description, '” section'description: string;
gmt_offset
'Read the “', gmt_offset, '” section'gmt_offset: number;
home: string;
name: string;
site_icon?
'Read the “', site_icon?, '” section'optional site_icon: number;
site_icon_url?
'Read the “', site_icon_url?, '” section'optional site_icon_url: string;
site_logo?
'Read the “', site_logo?, '” section'optional site_logo: number;
timezone_string
'Read the “', timezone_string, '” section'timezone_string: string;
url: string;
type Tag = { count: number; description: string; id: number; link: string; meta: any[] | Record<string, any>; name: string; slug: string; taxonomy: string;};
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:177
Represents a Tag type derived from the TagSchema’s output type.
Type declaration
'Read the “', Type declaration, '” section'count: number;
description
'Read the “', description, '” section'description: string;
id: number;
link: string;
meta: any[] | Record<string, any>;
name: string;
slug: string;
taxonomy: string;
Variables
'Read the “', Variables, '” section'CategorySchema
'Read the “', CategorySchema, '” section'const CategorySchema: ZodObject<Category>;
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:128
Extends the TagSchema to create a CategorySchema.
PageSchema
'Read the “', PageSchema, '” section'const PageSchema: ZodObject<Page>;
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:37
Schema definition for a WordPress Page object.
This schema validates the structure of a WordPress Page object, ensuring that all required fields are present and have the correct types.
Properties:
id
: The unique identifier for the page (number).date
: The date the page was created (Date).date_gmt
: The date the page was created in GMT (Date).guid
: The globally unique identifier for the page, containing a rendered string.modified
: The date the page was last modified (Date).modified_gmt
: The date the page was last modified in GMT (Date).slug
: The URL-friendly slug for the page (string).status
: The status of the page, which can be ‘publish’, ‘future’, ‘draft’, ‘pending’, or ‘private’.type
: The type of the page (string).title
: The title of the page, containing a rendered string.content
: The content of the page, containing a rendered string and a boolean indicating if it is protected.excerpt
: The excerpt of the page, containing a rendered string and a boolean indicating if it is protected.author
: The ID of the author of the page (number).featured_media
: The ID of the featured media for the page (number).parent
: The ID of the parent page (number).menu_order
: The order of the page in the menu (number).comment_status
: The comment status of the page, which can be ‘open’ or ‘closed’.ping_status
: The ping status of the page, which can be ‘open’ or ‘closed’.template
: The template used for the page (string).meta
: An array of metadata associated with the page, which can be any type or a record of any type.
PostSchema
'Read the “', PostSchema, '” section'const PostSchema: ZodObject<Post>;
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:79
Extends the PageSchema to define the schema for a WordPress Post.
Properties:
format
: Enum representing the format of the post. Possible values are:- ‘standard’
- ‘aside’
- ‘chat’
- ‘gallery’
- ‘link’
- ‘image’
- ‘quote’
- ‘status’
- ‘video’
- ‘audio’
- ”
categories
: Array of numbers representing the categories assigned to the post.tags
: Array of numbers representing the tags assigned to the post.
SiteSettingsSchema
'Read the “', SiteSettingsSchema, '” section'const SiteSettingsSchema: ZodObject<SiteSettings>;
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:149
Schema for site settings in the WordPress API.
This schema defines the structure of the site settings object, which includes various properties related to the site’s configuration.
Properties:
name
: The name of the site (string).description
: A brief description of the site (string).url
: The URL of the site (string).home
: The home URL of the site (string).gmt_offset
: The GMT offset for the site’s timezone (number).timezone_string
: The timezone string for the site (string).site_logo
: The ID of the site’s logo (optional number).site_icon
: The ID of the site’s icon (optional number).site_icon_url
: The URL of the site’s icon (optional string).
TagSchema
'Read the “', TagSchema, '” section'const TagSchema: ZodObject<Tag>;
Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:112
Schema for a WordPress Tag object.
This schema validates the structure of a WordPress Tag object, ensuring that it contains the following properties:
id
: A numeric identifier for the tag.count
: A numeric count of the number of posts associated with the tag.description
: A string description of the tag.link
: A URL string linking to the tag.name
: A string name of the tag.slug
: A string slug for the tag.taxonomy
: A string representing the taxonomy type.meta
: An array or record of any additional metadata associated with the tag.