-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update domain model to AVPRIndex package, add WIP AVPRClient support (#…
…90) * add avpr client and index * switch to AVPRIndex domain, rename ARC- to CachedValidationPackage * adapt test for new AVPRIndex package * correct type * fix lineendings and type reference * separate package cache in preview and release
- Loading branch information
Showing
23 changed files
with
197 additions
and
256 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace ARCValidationPackages | ||
|
||
open AVPRClient | ||
open ARCValidationPackages | ||
open AVPRIndex | ||
open System | ||
open System.Net.Http | ||
|
||
type AVPRAPI () = | ||
member private this.BaseUri = Uri("https://avpr.nfdi4plants.org") | ||
member private this.HttpClienHandler = new HttpClientHandler (UseCookies = false) | ||
member private this.HttpClient = new HttpClient(this.HttpClienHandler, true, BaseAddress=this.BaseUri) | ||
member this.Client = AVPRClient.Client(this.HttpClient) | ||
member this.GetAllPackages (): ValidationPackage [] = | ||
this.Client.GetAllPackagesAsync(System.Threading.CancellationToken.None) | ||
|> Async.AwaitTask | ||
|> Async.RunSynchronously | ||
|> Seq.toArray | ||
member this.GetPackageByName (packageName: string): ValidationPackage = | ||
this.Client.GetLatestPackageByNameAsync(packageName) | ||
|> Async.AwaitTask | ||
|> Async.RunSynchronously | ||
member this.GetPackageByNameAndVersion (packageName: string) (version: string): ValidationPackage = | ||
this.Client.GetPackageByNameAndVersionAsync(packageName, version) | ||
|> Async.AwaitTask | ||
|> Async.RunSynchronously | ||
|
||
//member this.downloadPackageScript (packageIndex: ValidationPackageIndex) = | ||
|
||
// let validationPackage = | ||
// this.GetPackageByNameAndVersion | ||
// packageIndex.Metadata.Name | ||
// (ValidationPackageMetadata.getSemanticVersionString packageIndex.Metadata) | ||
// Text.Encoding.UTF8.GetString validationPackage.PackageContent |
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
Oops, something went wrong.