mirror of
https://github.com/ChatGPTNextWeb/NextChat-Awesome-Plugins.git
synced 2026-07-08 01:32:03 +08:00
add npm search plugin
This commit is contained in:
@@ -17,4 +17,5 @@ This project stores [Plugins](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
|
||||
- [gapier](./plugins/gapier)
|
||||
- [Webpilot](./plugins/webpilot)
|
||||
- [FastGPT](./plugins/fastgpt)
|
||||
- [NPM Registry Search API](./plugins/npmsearch)
|
||||
|
||||
|
||||
27
plugins/npmsearch/README.md
Normal file
27
plugins/npmsearch/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# NPM Registry Search API
|
||||
|
||||
> Search for packages in the NPM registry.
|
||||
|
||||
## Schema
|
||||
[openapi.json](./openapi.json)
|
||||
|
||||
## Servers
|
||||
|
||||
`https://registry.npmjs.org`
|
||||
|
||||
## Operations
|
||||
|
||||
1. searchPackages
|
||||
> Search for packages in the NPM registry
|
||||
2. getPackageDetails
|
||||
> Get details of a specific package
|
||||
|
||||
## Authentication
|
||||
|
||||
type: none
|
||||
|
||||
## Preview
|
||||
|
||||

|
||||
|
||||
|
||||
214
plugins/npmsearch/openapi.json
Normal file
214
plugins/npmsearch/openapi.json
Normal file
@@ -0,0 +1,214 @@
|
||||
{
|
||||
"openapi": "3.1.0",
|
||||
"info": {
|
||||
"title": "NPM Registry Search API",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https://registry.npmjs.org"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/-/v1/search": {
|
||||
"get": {
|
||||
"operationId": "searchPackages",
|
||||
"x-openai-isConsequential": false,
|
||||
"summary": "Search for packages in the NPM registry",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "text",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Full-text search to apply"
|
||||
},
|
||||
{
|
||||
"name": "size",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "integer"
|
||||
},
|
||||
"description": "Number of results to return"
|
||||
},
|
||||
{
|
||||
"name": "from",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "integer"
|
||||
},
|
||||
"description": "Offset to return results from"
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
},
|
||||
"description": "Effect of quality on search results"
|
||||
},
|
||||
{
|
||||
"name": "popularity",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
},
|
||||
"description": "Effect of popularity on search results"
|
||||
},
|
||||
{
|
||||
"name": "maintenance",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "number",
|
||||
"format": "float"
|
||||
},
|
||||
"description": "Effect of maintenance on search results"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Successful response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"objects": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"package": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"keywords": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"links": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"npm": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"homepage": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"repository": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"bugs": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
}
|
||||
}
|
||||
},
|
||||
"publisher": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string",
|
||||
"format": "email"
|
||||
}
|
||||
}
|
||||
},
|
||||
"maintainers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string",
|
||||
"format": "email"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
},
|
||||
"time": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/{packageName}/latest": {
|
||||
"get": {
|
||||
"operationId": "getPackageDetails",
|
||||
"summary": "Get details of a specific package",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "packageName",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "The name of the package"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Successful response",
|
||||
"content": {
|
||||
"text/html": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"description": "HTML content of the package details"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request"
|
||||
},
|
||||
"404": {
|
||||
"description": "Package not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
plugins/npmsearch/preview.jpg
Normal file
BIN
plugins/npmsearch/preview.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 119 KiB |
Reference in New Issue
Block a user