Skip to content

schema/wp-api

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.

count: number;

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.

author: number;

comment_status: "" | "open" | "closed" = OpenClosedSchema;

content: {
protected: boolean;
rendered: string;
};

protected: boolean;

rendered: string;

date: Date;

date_gmt: Date;

excerpt: {
protected: boolean;
rendered: string;
};

protected: boolean;

rendered: string;

featured_media: number;

guid: {
rendered: string;
};

rendered: string;

id: number;

menu_order: number;

meta: any[];

modified: Date;

modified_gmt: Date;

parent: number;

ping_status: "" | "open" | "closed" = OpenClosedSchema;

slug: string;

status: "publish" | "future" | "draft" | "pending" | "private";

template: string;

title: {
rendered: string;
};

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.

author: number;

categories: number[];

comment_status: "" | "open" | "closed" = OpenClosedSchema;

content: {
protected: boolean;
rendered: string;
};

protected: boolean;

rendered: string;

date: Date;

date_gmt: Date;

excerpt: {
protected: boolean;
rendered: string;
};

protected: boolean;

rendered: string;

featured_media: number;

format:
| ""
| "status"
| "standard"
| "aside"
| "chat"
| "gallery"
| "link"
| "image"
| "quote"
| "video"
| "audio";

guid: {
rendered: string;
};

rendered: string;

id: number;

menu_order: number;

meta: any[];

modified: Date;

modified_gmt: Date;

parent: number;

ping_status: "" | "open" | "closed" = OpenClosedSchema;

slug: string;

status: "publish" | "future" | "draft" | "pending" | "private";

tags: number[];

template: string;

title: {
rendered: string;
};

rendered: string;

type: string;

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.

description: string;

gmt_offset: number;

home: string;

name: string;

optional site_icon: number;

optional site_icon_url: string;

optional site_logo: number;

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.

count: number;

description: string;

id: number;

link: string;

meta: any[] | Record<string, any>;

name: string;

slug: string;

taxonomy: string;

const CategorySchema: ZodObject<Category>;

Defined in: studiocms/packages/studiocms_devapps/src/schema/wp-api.ts:128

Extends the TagSchema to create a CategorySchema.


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.

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.

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).

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.