diff --git a/packages/wp-types/index.ts b/packages/wp-types/index.ts index 7097222..2598985 100644 --- a/packages/wp-types/index.ts +++ b/packages/wp-types/index.ts @@ -2291,6 +2291,7 @@ export interface WP_REST_API_Block { */ protected: boolean; }; + wp_pattern_sync_status: "" | "partial" | "unsynced"; /** * The theme file to use to display the block. */ @@ -2298,9 +2299,11 @@ export interface WP_REST_API_Block { /** * Meta fields. */ - meta?: { - [k: string]: unknown; - }; + meta?: + | EmptyArray + | { + [k: string]: unknown; + }; _links: WP_REST_API_Object_Links; [k: string]: unknown; } diff --git a/schemas/rest-api/block.json b/schemas/rest-api/block.json index 36d9011..489f9bf 100644 --- a/schemas/rest-api/block.json +++ b/schemas/rest-api/block.json @@ -17,6 +17,7 @@ "type", "title", "content", + "wp_pattern_sync_status", "_links" ], "properties": { @@ -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" diff --git a/tests/data/rest-api/routes/wp-v2-blocks-id-autosaves.json b/tests/data/rest-api/routes/wp-v2-blocks-id-autosaves.json index acaa75b..e5d4040 100644 --- a/tests/data/rest-api/routes/wp-v2-blocks-id-autosaves.json +++ b/tests/data/rest-api/routes/wp-v2-blocks-id-autosaves.json @@ -130,7 +130,7 @@ "description": "Meta fields.", "type": "object", "properties": { - "sync_status": { + "wp_pattern_sync_status": { "type": "string", "description": "", "default": "", diff --git a/tests/data/rest-api/routes/wp-v2-blocks-id.json b/tests/data/rest-api/routes/wp-v2-blocks-id.json index 98bc9b3..d96d8a0 100644 --- a/tests/data/rest-api/routes/wp-v2-blocks-id.json +++ b/tests/data/rest-api/routes/wp-v2-blocks-id.json @@ -146,7 +146,7 @@ "description": "Meta fields.", "type": "object", "properties": { - "sync_status": { + "wp_pattern_sync_status": { "type": "string", "description": "", "default": "", diff --git a/tests/data/rest-api/routes/wp-v2-blocks.json b/tests/data/rest-api/routes/wp-v2-blocks.json index aafda9e..b0351cb 100644 --- a/tests/data/rest-api/routes/wp-v2-blocks.json +++ b/tests/data/rest-api/routes/wp-v2-blocks.json @@ -267,7 +267,7 @@ "description": "Meta fields.", "type": "object", "properties": { - "sync_status": { + "wp_pattern_sync_status": { "type": "string", "description": "", "default": "", diff --git a/tests/data/rest-api/routes/wp-v2-navigation-id-autosaves.json b/tests/data/rest-api/routes/wp-v2-navigation-id-autosaves.json index 25bc7ab..173984d 100644 --- a/tests/data/rest-api/routes/wp-v2-navigation-id-autosaves.json +++ b/tests/data/rest-api/routes/wp-v2-navigation-id-autosaves.json @@ -86,7 +86,8 @@ "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ - "edit" + "edit", + "embed" ] }, "rendered": { @@ -110,7 +111,8 @@ "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ - "edit" + "edit", + "embed" ] }, "rendered": { @@ -118,7 +120,8 @@ "type": "string", "context": [ "view", - "edit" + "edit", + "embed" ], "readonly": true }, @@ -126,7 +129,8 @@ "description": "Version of the content block format used by the post.", "type": "integer", "context": [ - "edit" + "edit", + "embed" ], "readonly": true }, diff --git a/tests/data/rest-api/routes/wp-v2-navigation-id.json b/tests/data/rest-api/routes/wp-v2-navigation-id.json index b652c47..7118e5c 100644 --- a/tests/data/rest-api/routes/wp-v2-navigation-id.json +++ b/tests/data/rest-api/routes/wp-v2-navigation-id.json @@ -102,7 +102,8 @@ "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ - "edit" + "edit", + "embed" ] }, "rendered": { @@ -126,7 +127,8 @@ "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ - "edit" + "edit", + "embed" ] }, "rendered": { @@ -134,7 +136,8 @@ "type": "string", "context": [ "view", - "edit" + "edit", + "embed" ], "readonly": true }, @@ -142,7 +145,8 @@ "description": "Version of the content block format used by the post.", "type": "integer", "context": [ - "edit" + "edit", + "embed" ], "readonly": true }, diff --git a/tests/data/rest-api/routes/wp-v2-navigation.json b/tests/data/rest-api/routes/wp-v2-navigation.json index 632a23c..7f97a63 100644 --- a/tests/data/rest-api/routes/wp-v2-navigation.json +++ b/tests/data/rest-api/routes/wp-v2-navigation.json @@ -223,7 +223,8 @@ "description": "Title for the post, as it exists in the database.", "type": "string", "context": [ - "edit" + "edit", + "embed" ] }, "rendered": { @@ -247,7 +248,8 @@ "description": "Content for the post, as it exists in the database.", "type": "string", "context": [ - "edit" + "edit", + "embed" ] }, "rendered": { @@ -255,7 +257,8 @@ "type": "string", "context": [ "view", - "edit" + "edit", + "embed" ], "readonly": true }, @@ -263,7 +266,8 @@ "description": "Version of the content block format used by the post.", "type": "integer", "context": [ - "edit" + "edit", + "embed" ], "readonly": true },