| @@ -21,8 +21,18 @@ | ||
| 21 | 21 | final class Status_Controller extends WP_REST_Controller { |
| 22 | 22 | use Endpoint_Permissions; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | + * Named features this server supports, which a client may test for instead of comparing versions. | |
| 26 | + * | |
| 27 | + * - `products_id_fast_path`: `GET /wcpos/v2/products?per_page=-1&_fields=id,date_modified_gmt,stock_quantity,stock_status` | |
| 28 | + * is answered from one query (#2113). | |
| 29 | + * | |
| 30 | + * Append new names; never rename or remove one. | |
| 31 | + */ | |
| 32 | + private const CAPABILITIES = array( 'products_id_fast_path' ); | |
| 33 | + | |
| 34 | + /** | |
| 25 | 35 | * Register the sync status route. |
| 26 | 36 | */ |
| 27 | 37 | public function register_routes(): void { |
| 28 | 38 | register_rest_route( |
| @@ -48,8 +58,9 @@ | ||
| 48 | 58 | array( |
| 49 | 59 | 'healthy' => array() === $missing_tables, |
| 50 | 60 | 'missing_tables' => $missing_tables, |
| 51 | 61 | 'schema_version' => get_option( Api::SCHEMA_OPTION, null ), |
| 62 | + 'capabilities' => self::CAPABILITIES, | |
| 52 | 63 | ), |
| 53 | 64 | 200 |
| 54 | 65 | ); |
| 55 | 66 | } |