30 lines
1.0 KiB
PHP
30 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace NetBoxStore\Sync\Adapter;
|
|
|
|
interface SourceAdapter
|
|
{
|
|
/** @return list<array<string,mixed>> */
|
|
public function listRepositories(): array;
|
|
|
|
/** @param array<string,mixed> $repository */
|
|
public function getCommitSha(array $repository, ?string $ref = null): string;
|
|
|
|
/** @param array<string,mixed> $repository */
|
|
public function fetchText(array $repository, string $path, string $commitSha): ?string;
|
|
|
|
/** @param array<string,mixed> $repository @return list<string> */
|
|
public function listTree(array $repository, string $commitSha): array;
|
|
|
|
/** @param array<string,mixed> $repository */
|
|
public function rawFileUrl(array $repository, string $path, string $commitSha): string;
|
|
|
|
/** @param array<string,mixed> $repository @return list<array<string,mixed>> */
|
|
public function listReleases(array $repository): array;
|
|
|
|
/** @return array{sha256:string,artifactSize:int} */
|
|
public function hashArtifact(string $url, string $expectedSha256 = ''): array;
|
|
}
|