Expose InfoProvider capabilities via REST API
Some checks failed
Build assets artifact / Build assets artifact (push) Has been cancelled
Docker Image Build / build (linux/amd64, amd64, ubuntu-latest) (push) Has been cancelled
Docker Image Build / build (linux/arm/v7, armv7, ubuntu-24.04-arm) (push) Has been cancelled
Docker Image Build / build (linux/arm64, arm64, ubuntu-24.04-arm) (push) Has been cancelled
Docker Image Build (FrankenPHP) / build (linux/amd64, amd64, ubuntu-latest) (push) Has been cancelled
Docker Image Build (FrankenPHP) / build (linux/arm/v7, armv7, ubuntu-24.04-arm) (push) Has been cancelled
Docker Image Build (FrankenPHP) / build (linux/arm64, arm64, ubuntu-24.04-arm) (push) Has been cancelled
Static analysis / Static analysis (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, sqlite) (push) Has been cancelled
Docker Image Build / merge (push) Has been cancelled
Docker Image Build (FrankenPHP) / merge (push) Has been cancelled

This commit is contained in:
Jan Böhmer 2026-07-21 00:07:52 +02:00
parent 7e53c7ae9a
commit 77724a522b
5 changed files with 205 additions and 4 deletions

View file

@ -23,7 +23,9 @@ declare(strict_types=1);
namespace App\Services\InfoProviderSystem\DTOs;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\McpToolCollection;
use ApiPlatform\OpenApi\Model\Operation;
use App\Mcp\DTO\ListInfoProvidersInput;
use App\State\Mcp\ListInfoProvidersProcessor;
@ -32,8 +34,16 @@ use App\State\Mcp\ListInfoProvidersProcessor;
* searched via search_info_providers / get_info_provider_part_details).
*/
#[ApiResource(
uriTemplate: '/info_providers',
description: 'An info provider which can be used to search for parts and retrieve part details.',
operations: [],
operations: [
new GetCollection(
security: 'is_granted("@info_providers.create_parts")',
provider: ListInfoProvidersProcessor::class,
openapi: new Operation(summary: 'List the info providers which are currently active and can be used for searching parts.'),
),
],
paginationEnabled: false,
mcp: [
'list_info_providers' => new McpToolCollection(
title: 'List available info providers',

View file

@ -25,6 +25,8 @@ namespace App\Services\InfoProviderSystem\DTOs;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\McpTool;
use ApiPlatform\Metadata\Post;
use ApiPlatform\OpenApi\Model\Operation;
use App\Entity\Parts\ManufacturingStatus;
use App\Mcp\DTO\InfoProviderPartDetailsInput;
use App\State\Mcp\GetInfoProviderPartDetailsProcessor;
@ -34,7 +36,16 @@ use App\State\Mcp\GetInfoProviderPartDetailsProcessor;
*/
#[ApiResource(
description: 'Detailed information about a part from an external info provider (e.g. a distributor or manufacturer catalog), including datasheets, images, parameters and purchase information.',
operations: [],
operations: [
new Post(
uriTemplate: '/info_providers/details',
security: 'is_granted("@info_providers.create_parts")',
input: InfoProviderPartDetailsInput::class,
validate: true,
processor: GetInfoProviderPartDetailsProcessor::class,
openapi: new Operation(summary: 'Get full detailed information about a specific part from an external info provider.'),
),
],
mcp: [
'get_info_provider_part_details' => new McpTool(
title: 'Get part details from an info provider',

View file

@ -25,6 +25,8 @@ namespace App\Services\InfoProviderSystem\DTOs;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\McpToolCollection;
use ApiPlatform\Metadata\Post;
use ApiPlatform\OpenApi\Model\Operation;
use App\Entity\Parts\ManufacturingStatus;
use App\Mcp\DTO\InfoProviderSearchInput;
use App\State\Mcp\SearchInfoProvidersProcessor;
@ -35,7 +37,16 @@ use App\State\Mcp\SearchInfoProvidersProcessor;
*/
#[ApiResource(
description: 'A search result for a part from an external info provider (e.g. a distributor or manufacturer catalog).',
operations: [],
operations: [
new Post(
uriTemplate: '/info_providers/search',
security: 'is_granted("@info_providers.create_parts")',
input: InfoProviderSearchInput::class,
validate: true,
processor: SearchInfoProvidersProcessor::class,
openapi: new Operation(summary: 'Search external info providers (e.g. distributors like Digikey, Mouser, LCSC) for parts matching a keyword.'),
),
],
mcp: [
'search_info_providers' => new McpToolCollection(
title: 'Search external info providers',