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:
@@ -50,3 +50,20 @@ test('a site can be created as WordPress with credentials', function () {
|
||||
->wp_username->toBe('admin')
|
||||
->wp_app_password->toBe('abcd 1234 efgh 5678');
|
||||
});
|
||||
|
||||
test('a custom site can store free-text api_instructions', function () {
|
||||
$site = Site::create([
|
||||
'name' => 'Custom Site',
|
||||
'url' => 'https://custom.example.com',
|
||||
'cms_type' => 'custom',
|
||||
'api_instructions' => 'POST to /api/publish with a bearer token from .env',
|
||||
]);
|
||||
|
||||
expect($site->fresh()->api_instructions)->toBe('POST to /api/publish with a bearer token from .env');
|
||||
});
|
||||
|
||||
test('api_instructions defaults to null', function () {
|
||||
$site = Site::create(['name' => 'My Blog', 'url' => 'https://example.com']);
|
||||
|
||||
expect($site->fresh()->api_instructions)->toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user