Coder Social home page Coder Social logo

Support TeamCity feeds about paket HOT 6 CLOSED

fsprojects avatar fsprojects commented on June 1, 2024
Support TeamCity feeds

from paket.

Comments (6)

forki avatar forki commented on June 1, 2024

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.

maartenba avatar maartenba commented on June 1, 2024

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 falseor IsPrerelease eq true.

from paket.

maartenba avatar maartenba commented on June 1, 2024

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.

forki avatar forki commented on June 1, 2024

OMG.

Thanks a lot.

from paket.

forki avatar forki commented on June 1, 2024

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:

from paket.

maartenba avatar maartenba commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.