generated from CommonGateway/PetStoreBundle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from OpenCatalogi/feature/componentencatalogus
Github api, componentencatalogus and developer.overheid bronnen
- Loading branch information
Showing
20 changed files
with
836 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace OpenCatalogi\OpenCatalogiBundle\Command; | ||
|
||
use OpenCatalogi\OpenCatalogiBundle\Service\GithubPubliccodeService; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Style\SymfonyStyle; | ||
|
||
/** | ||
* Command to execute the GithubService. | ||
*/ | ||
class GithubApiGetPubliccodeRepositoriesCommand extends Command | ||
{ | ||
// the name of the command (the part after "bin/console") | ||
protected static $defaultName = 'opencatalogi:githubapi:repositories'; | ||
private GithubPubliccodeService $githubPubliccodeService; | ||
|
||
public function __construct(GithubPubliccodeService $githubPubliccodeService) | ||
{ | ||
$this->githubPubliccodeService = $githubPubliccodeService; | ||
parent::__construct(); | ||
} | ||
|
||
protected function configure(): void | ||
{ | ||
$this | ||
->setDescription('This command triggers OpenCatalogi GithubPubliccodeService') | ||
->setHelp('This command allows you to get all repositories or one repository from https://api.github.com/search/code') | ||
->addOption('repository', 'r', InputOption::VALUE_OPTIONAL, 'Get a single repository by id'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$io = new SymfonyStyle($input, $output); | ||
$this->githubPubliccodeService->setStyle($io); | ||
|
||
// Handle the command optiosn | ||
$repositoryId = $input->getOption('repository', false); | ||
|
||
if (!$repositoryId) { | ||
$this->githubPubliccodeService->getRepositories(); | ||
} elseif (!$this->githubPubliccodeService->getRepository($repositoryId)) { | ||
return Command::FAILURE; | ||
} | ||
|
||
return Command::SUCCES; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Mapping/ComponentenCatalogusComponentToOpenCatalogiComponent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"title": "ComponentenCatalogusComponentToOpenCatalogiComponent", | ||
"$id": "https://componentencatalogus.commonground.nl/api/components", | ||
"$schema": "https://json-schema.org/draft/2020-12/mapping", | ||
"version": "0.0.1", | ||
"passTrough": false, | ||
"mapping": { | ||
"name": "{{ name }}", | ||
"description.localisedName": "{{ name }}", | ||
"description.shortDescription": "{{ description }}", | ||
"description.longDescription": "{{ description }}", | ||
"legal.repoOwner.name": "{{ owner.fullName }}", | ||
"legal.repoOwner.email": "{{ owner.email }}", | ||
"nl.commonground.layerType": "{{ layerType }}", | ||
"landingURL": "{{ repositoryUrl }}", | ||
"developmentStatus": "{{ status }}", | ||
"url.url": "{{ repositoryUrl }}", | ||
"url.organisation.name": "{{ organisationName }}" | ||
}, | ||
"unset": [ | ||
"layerType", | ||
"owner", | ||
"status", | ||
"expectedQuarter", | ||
"expectedYear", | ||
"developedBy", | ||
"createdAt", | ||
"reuseType", | ||
"organisationName", | ||
"repositoryUrl", | ||
"contact" | ||
], | ||
"cast": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"title": "DeveloperOverheidApisToComponent", | ||
"$id": "https://api.github.com/search/code", | ||
"$schema": "https://json-schema.org/draft/2020-12/mapping", | ||
"version": "0.0.1", | ||
"passTrough": false, | ||
"mapping": { | ||
"name": "{{ repository.name }}", | ||
"url": "{{ repository.html_url }}", | ||
"publiccode_url": "{{ html_url }}", | ||
"organisation.name": "{{ repository.owner.login }}", | ||
"organisation.logo": "{{ repository.owner.avatar_url }}", | ||
"organisation.github": "{{ repository.owner.url }}", | ||
"organisation.type": "{{ repository.owner.type }}" | ||
}, | ||
"unset": [ | ||
"path", | ||
"sha", | ||
"git_url", | ||
"html_url", | ||
"score", | ||
"repository" | ||
], | ||
"cast": [] | ||
} |
Oops, something went wrong.