Skip to content

Commit

Permalink
Update the schemas for WordPress 6.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Oct 5, 2023
1 parent 7b2fd5a commit a397822
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 19 deletions.
9 changes: 6 additions & 3 deletions packages/wp-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2291,16 +2291,19 @@ export interface WP_REST_API_Block {
*/
protected: boolean;
};
wp_pattern_sync_status: "" | "partial" | "unsynced";
/**
* The theme file to use to display the block.
*/
template?: string;
/**
* Meta fields.
*/
meta?: {
[k: string]: unknown;
};
meta?:
| EmptyArray
| {
[k: string]: unknown;
};
_links: WP_REST_API_Object_Links;
[k: string]: unknown;
}
Expand Down
18 changes: 17 additions & 1 deletion schemas/rest-api/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"type",
"title",
"content",
"wp_pattern_sync_status",
"_links"
],
"properties": {
Expand Down Expand Up @@ -152,13 +153,28 @@
},
"additionalProperties": false
},
"wp_pattern_sync_status": {
"type": "string",
"enum": [
"",
"partial",
"unsynced"
]
},
"template": {
"description": "The theme file to use to display the block.",
"type": "string"
},
"meta": {
"description": "Meta fields.",
"type": "object"
"anyOf": [
{
"$ref": "../../schema.json#/definitions/EmptyArray"
},
{
"type": "object"
}
]
},
"_links": {
"$ref": "properties/object-links.json"
Expand Down
2 changes: 1 addition & 1 deletion tests/data/rest-api/routes/wp-v2-blocks-id-autosaves.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"description": "Meta fields.",
"type": "object",
"properties": {
"sync_status": {
"wp_pattern_sync_status": {
"type": "string",
"description": "",
"default": "",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/rest-api/routes/wp-v2-blocks-id.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"description": "Meta fields.",
"type": "object",
"properties": {
"sync_status": {
"wp_pattern_sync_status": {
"type": "string",
"description": "",
"default": "",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/rest-api/routes/wp-v2-blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"description": "Meta fields.",
"type": "object",
"properties": {
"sync_status": {
"wp_pattern_sync_status": {
"type": "string",
"description": "",
"default": "",
Expand Down
12 changes: 8 additions & 4 deletions tests/data/rest-api/routes/wp-v2-navigation-id-autosaves.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"description": "Title for the post, as it exists in the database.",
"type": "string",
"context": [
"edit"
"edit",
"embed"
]
},
"rendered": {
Expand All @@ -110,23 +111,26 @@
"description": "Content for the post, as it exists in the database.",
"type": "string",
"context": [
"edit"
"edit",
"embed"
]
},
"rendered": {
"description": "HTML content for the post, transformed for display.",
"type": "string",
"context": [
"view",
"edit"
"edit",
"embed"
],
"readonly": true
},
"block_version": {
"description": "Version of the content block format used by the post.",
"type": "integer",
"context": [
"edit"
"edit",
"embed"
],
"readonly": true
},
Expand Down
12 changes: 8 additions & 4 deletions tests/data/rest-api/routes/wp-v2-navigation-id.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
"description": "Title for the post, as it exists in the database.",
"type": "string",
"context": [
"edit"
"edit",
"embed"
]
},
"rendered": {
Expand All @@ -126,23 +127,26 @@
"description": "Content for the post, as it exists in the database.",
"type": "string",
"context": [
"edit"
"edit",
"embed"
]
},
"rendered": {
"description": "HTML content for the post, transformed for display.",
"type": "string",
"context": [
"view",
"edit"
"edit",
"embed"
],
"readonly": true
},
"block_version": {
"description": "Version of the content block format used by the post.",
"type": "integer",
"context": [
"edit"
"edit",
"embed"
],
"readonly": true
},
Expand Down
12 changes: 8 additions & 4 deletions tests/data/rest-api/routes/wp-v2-navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@
"description": "Title for the post, as it exists in the database.",
"type": "string",
"context": [
"edit"
"edit",
"embed"
]
},
"rendered": {
Expand All @@ -247,23 +248,26 @@
"description": "Content for the post, as it exists in the database.",
"type": "string",
"context": [
"edit"
"edit",
"embed"
]
},
"rendered": {
"description": "HTML content for the post, transformed for display.",
"type": "string",
"context": [
"view",
"edit"
"edit",
"embed"
],
"readonly": true
},
"block_version": {
"description": "Version of the content block format used by the post.",
"type": "integer",
"context": [
"edit"
"edit",
"embed"
],
"readonly": true
},
Expand Down

0 comments on commit a397822

Please sign in to comment.