NPM Package Registry search API endpoint (#20280)
Close #20098, in the NPM registry API, implemented to match what's described by https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-v1search Currently have only implemented the bare minimum to work with the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html). Co-authored-by: Jack Vine <jackv@jack-lemur-suse.cat-prometheus.ts.net> Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		
							parent
							
								
									da0a9ec811
								
							
						
					
					
						commit
						83680c97a7
					
				
					 6 changed files with 134 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -96,6 +96,34 @@ type PackageDistribution struct {
 | 
			
		|||
	NpmSignature string `json:"npm-signature,omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type PackageSearch struct {
 | 
			
		||||
	Objects []*PackageSearchObject `json:"objects"`
 | 
			
		||||
	Total   int64                  `json:"total"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type PackageSearchObject struct {
 | 
			
		||||
	Package *PackageSearchPackage `json:"package"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type PackageSearchPackage struct {
 | 
			
		||||
	Scope       string                     `json:"scope"`
 | 
			
		||||
	Name        string                     `json:"name"`
 | 
			
		||||
	Version     string                     `json:"version"`
 | 
			
		||||
	Date        time.Time                  `json:"date"`
 | 
			
		||||
	Description string                     `json:"description"`
 | 
			
		||||
	Author      User                       `json:"author"`
 | 
			
		||||
	Publisher   User                       `json:"publisher"`
 | 
			
		||||
	Maintainers []User                     `json:"maintainers"`
 | 
			
		||||
	Keywords    []string                   `json:"keywords,omitempty"`
 | 
			
		||||
	Links       *PackageSearchPackageLinks `json:"links"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type PackageSearchPackageLinks struct {
 | 
			
		||||
	Registry   string `json:"npm"`
 | 
			
		||||
	Homepage   string `json:"homepage,omitempty"`
 | 
			
		||||
	Repository string `json:"repository,omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// User https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#package
 | 
			
		||||
type User struct {
 | 
			
		||||
	Username string `json:"username,omitempty"`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue