gosimplenpm/internal/serviceidos/responseidos.go

119 lines
4.9 KiB
Go
Raw Normal View History

package serviceidos
type IndexJsonAttachments struct {
ContentType string `json:"content_type"`
Data string `json:"data"`
Length int `json:"length"`
}
type IndexJsonDist struct {
2023-12-25 08:56:48 +00:00
Integrity string `json:"integrity"`
Shasum string `json:"shasum"`
Tarball string `json:"tarball"`
FileCount int `json:"fileCount"`
UnpackedSize int `json:"unpackedSize"`
}
2023-12-25 08:56:48 +00:00
type IndexJsonRepository struct {
Type string `json:"type"`
Url string `json:"url"`
// Only used if the package.json is not in the root folder of the url
Directory string `json:"directory"`
}
type IndexJsonEngines struct {
NodeVersion string `json:"node,omitempty"`
NpmVersion string `json:"npm,omitempty"`
}
type IndexJsonBugs struct {
Url string `json:"url,omitempty"`
Email string `json:"email,omitempty"`
}
type IndexJsonAuthor struct {
Url string `json:"url,omitempty"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
}
// https://docs.npmjs.com/cli/v10/configuring-npm/package-json
// https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
type IndexJsonVersions struct {
2023-12-25 08:56:48 +00:00
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Main string `json:"main,omitempty"`
Scripts map[string]string `json:"scripts,omitempty"`
Author string `json:"author,omitempty"`
License string `json:"license"`
Repository IndexJsonRepository `json:"repository,omitempty"`
Files []string `json:"files,omitempty"`
Homepage string `json:"homepage,omitempty"`
Readme string `json:"readme,omitempty"`
ReadmeFilename string `json:"readmeFilename,omitempty"`
Keywords []string `json:"keywords,omitempty"`
ID string `json:"_id"`
Contributors []IndexJsonAuthor `json:"contributors,omitempty"`
Maintainers []IndexJsonAuthor `json:"maintainers.omitempty"`
Bugs IndexJsonBugs `json:"bugs,omitempty"`
Bin map[string]string `json:"bin"`
OperatingSystem []string `json:"os,omitempty"`
Cpu []string `json:"cpu,omitempty"`
Engines IndexJsonEngines `json:"engines,omitempty"`
NodeVersion string `json:"_nodeVersion"`
NpmVersion string `json:"_npmVersion"`
Dist IndexJsonDist `json:"dist"`
Dependencies map[string]string `json:"dependencies,omitempty"`
DevDependencies map[string]string `json:"devDependencies,omitempty"`
PeerDependencies map[string]string `json:"peerDependencies,omitempty"`
PeerDependenciesMeta map[string]map[string]bool `json:"peerDependenciesMeta,omitempty"`
BundleDependencies []string `json:"bundleDependencies,omitempty"`
Resolutions map[string]string `json:"resolutions,omitempty"`
}
type IndexJson struct {
2023-12-25 08:56:48 +00:00
ID string `json:"_id"`
Name string `json:"name"`
Description string `json:"description"`
Readme string `json:"readme,omitempty"`
ReadmeFilename string `json:"readmeFilename,omitempty"`
DistTags map[string]string `json:"dist-tags"`
TimesPackage map[string]string `json:"time"`
Versions map[string]IndexJsonVersions `json:"versions"`
Access string `json:"access"`
Attachments map[string]IndexJsonAttachments `json:"_attachments"`
}
type IndexJsonAbridgedVersions struct {
HasShrinkWrap bool `json:"_hasShrinkwrap"`
Dist IndexJsonDist `json:"dist"`
Name string `json:"name"`
Version string `json:"version"`
}
// https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
type IndexJsonAbridged struct {
DistTags map[string]string `json:"dist-tags"`
Modified string `json:"modified"`
Name string `json:"name"`
Versions map[string]IndexJsonAbridgedVersions `json:"versions"`
}
type TagPutResponse struct {
Ok bool `json:"ok"`
ID string `json:"id"`
DistTags string `json:"dist-tags"`
}
type TagDeleteResponse struct {
Ok bool `json:"ok"`
ID string `json:"id"`
DistTags string `json:"dist-tags"`
}
2023-12-25 08:56:48 +00:00
type PublishPutResponse struct {
Ok bool `json:"ok"`
Name string `json:"package_name"`
}