Semantic Versioning in Artifactory Generic Repositories: Range Query

1.6k Views Asked by At

I would like to know if the generic repositories in JFrog Artifactory have support for something similar as NodeJS's ~ and ^ operator in the package.json.

Let say I am uploading the following artifacts to a generic repository:

  • foo-1.0.0 # stable release for 1.0 series
  • foo-1.0.1 # first bug fix release for 1.0 series
  • foo-1.1.0 # stable release for 1.1 series
  • foo-1.1.1 # first bug fix release for 1.1 series

Is there some REST API or AQL query that I can use to specify a particular version based on a query, e.g.: ~1.0.0 would get me 1.0.1 and if later I upload 1.0.2 it would give me 1.0.2?

See What's the difference between tilde(~) and caret(^) in package.json? for a description about NodeJS ~ and ^ operators.

1

There are 1 best solutions below

1
Dror Bereznitsky On BEST ANSWER

There is no built in support for such semver operators in AQL or the REST API.
You can get the latest version of an artifact in a generic repository, you can use the Artifact Latest Version Search Based on Properties API method (which requires annotating the artifacts with a version property).