Add free-text api_instructions field to Sites
For custom sites we'll post to via their own API — there's no wired-in publisher for these, so this is where the site owner documents how to actually post there (auth, endpoints, payload shape). Shown in the UI for non-WordPress sites, exposed via the JSON API, and pointed to from AI_API.md's "any other network/CMS" fallback section so an agent checks it before improvising. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,3 +46,15 @@ test('it includes WordPress fields in the site response', function () {
|
||||
->assertJsonPath('data.wp_username', 'admin')
|
||||
->assertJsonPath('data.wp_app_password', 'abcd 1234 efgh 5678');
|
||||
});
|
||||
|
||||
test('it includes api_instructions in the site response', function () {
|
||||
$site = Site::factory()->create([
|
||||
'cms_type' => 'custom',
|
||||
'api_instructions' => 'POST to /api/publish with a bearer token from .env',
|
||||
]);
|
||||
|
||||
$response = $this->getJson("/api/sites/{$site->id}");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonPath('data.api_instructions', 'POST to /api/publish with a bearer token from .env');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user