Comments (6)
TeamCity doesn't support
http://teamcity/guestAuth/app/nuget/v1/FeedService.svc/package-versions/Microsoft.Rtc.Collaboration-2010
We need to use OData here. What's the correct url to get all package versions?
from paket.
NuGet is an interesting API :-)
The above approach is the fastest, but there are two more depending on what the server supports. The fastest fallback after the above is using the FindPackagesById
service:
/FindPackagesById()?id='PackageId'
Opionally, filters can be added, for example to get only prerelease versions:
/FindPackagesById()?id='PackageId'&$filter=IsPrerelease eq true&$top=1
When that call does not exist, the next (and last) fallback is using the OData Packages collection. This one gets all packages for a given ID:
/Packages?$filter=Id eq 'PackagIdHere'
If you want to narrow it down to a range of versions (>= 1.0.0 and < 2.0.0). Do note some NuGet server implemenations treat the Version property as the wrong datatype and may not return what you'd expect for a range query.
/Packages?$filter=Id eq 'PackagIdHere' and Version ge '1.0.0' and Version lt '2.0.0'
You may also want to filter on prerelease versions by adding IsPrerelease eq false
or IsPrerelease eq true
.
from paket.
On a side note: by querying the '/$metadata' URL, you can see if the FindPackagesById method is supported or not (or just try and fallback to the last option if it is not there).
from paket.
OMG.
Thanks a lot.
from paket.
Seems I can detect the versions now.
Next question: where is the download url?
match source with
| "http://nuget.org/api/v2" -> sprintf "http://packages.nuget.org/v1/Package/Download/%s/%s" name version
| _ ->
// TODO: How can we discover the download link?
failwithf "unknown package source %s - can't download package %s %s" source name version
The following don't work:
- http://teamcity/guestAuth/app/nuget/v1/Package/[package]/[version]
- http://teamcity/guestAuth/app/nuget/v1/FeedService.svc/Package/[package]/[version]
from paket.
You'll have to parse the returned XML/Atom from the query. Each package has the download link available, e.g. <content type="application/zip" src="http://www.nuget.org/api/v2/package/_infrastructure.TypeScript.DefinitelyTyped/0.0.1" />
from paket.
Related Issues (20)
- CVE-2018-8292 : System.Net.Http [referenced by Steeltoe.Management.CloudFoundryCore(3.2.3)]
- Dependency wrongly parsed
- dotnet pack --symbols fails with error about Compile entry not containing Update or Include attribute
- Paket Restore Targets doesn't work with .NET 6+ HOT 3
- .Net-Framework 4.8.1 not selectable
- Paket does not respect compatible versions of .Net Standard when adding references
- References to delisted versions of Nuget.Packaging
- Paket failing when trying to install dependencies `OpenSslCryptographicException` HOT 2
- Allow updating a transitive dependency HOT 1
- feat!(Paket.restore.targets): Support `dotnet restore` without `paket restore`; avoid null git diffs
- Empty response is not trusted?
- Paket Simplify Removing FSharp.Core from paket.references
- improve use case of `restore` that would not restore anything due to framework restriction and project being with wrong/lower framework version HOT 3
- plans for .NET 9 HOT 1
- Could not detect any platforms warning HOT 2
- concurrent package restores sometimes fail
- Visual studio not restoring packages for projects that target net8.0-windows
- find-packages command fails when using UNC paths
- Install.sh fails on macos with 'could not find a paket source on nuget.org'
- Paket pack fails when building/creating packages for Windows on Linux (docker), even using --build-platform flag HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paket.