├── .gitignore ├── .well-known ├── ai-plugin-todos.json └── ai-plugin.json ├── index-todos.js ├── index.js ├── logo.png ├── openapi-todos.yaml ├── openapi.yaml ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.well-known/ai-plugin-todos.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema_version": "v1", 3 | "name_for_human": "To Do Plugin", 4 | "name_for_model": "todo", 5 | "description_for_human": "Manage a ToDo List", 6 | "description_for_model": "Plugin for managing a ToDo List for ChatGPT. You can add, remove, view and edit items", 7 | "auth": { 8 | "type": "none" 9 | }, 10 | "api": { 11 | "type": "openapi", 12 | "url": "http://localhost:3000/openapi.yaml", 13 | "is_user_authenticated": false 14 | }, 15 | "logo_url": "http://localhost:3000/logo.png", 16 | "contact_email": "midudev@gmail.com", 17 | "legal_info_url": "https://midu.dev/legal" 18 | } -------------------------------------------------------------------------------- /.well-known/ai-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema_version": "v1", 3 | "name_for_human": "GitHub Search Repositories", 4 | "name_for_model": "github_search_repositories", 5 | "description_for_human": "Search repositories on GitHub using ChatGPT", 6 | "description_for_model": "Plugin for searching repositories on GitHub", 7 | "auth": { 8 | "type": "none" 9 | }, 10 | "api": { 11 | "type": "openapi", 12 | "url": "http://localhost:3000/openapi.yaml", 13 | "is_user_authenticated": false 14 | }, 15 | "logo_url": "http://localhost:3000/logo.png", 16 | "contact_email": "midudev@gmail.com", 17 | "legal_info_url": "https://midu.dev/legal" 18 | } -------------------------------------------------------------------------------- /index-todos.js: -------------------------------------------------------------------------------- 1 | import express, { json } from 'express' 2 | import cors from 'cors' 3 | import fs from 'node:fs/promises' // fs -> file system -> sistema de archivos (leer) 4 | import path from 'node:path' 5 | import crypto from 'node:crypto' 6 | 7 | const PORT = process.env.PORT ?? 3000 8 | const app = express() 9 | 10 | app.use(cors( 11 | { 12 | methods: ['GET'], 13 | origin: [`https://localhost:${PORT}`, 'https://chat.openai.com'] 14 | } 15 | )) 16 | app.use(json()) 17 | 18 | app.use((req, res, next) => { 19 | console.log(`Request received: ${req.method} ${req.url}`) 20 | next() 21 | }) 22 | 23 | // 1. Preparar los endpoints para servir la información 24 | // que necesita el Plugin de ChatGPT 25 | app.get('/openapi.yaml', async (req, res, next) => { 26 | try { 27 | const filePath = path.join(process.cwd(), 'openapi.yaml') 28 | const yamlData = await fs.readFile(filePath, 'utf-8') 29 | res.setHeader('Content-Type', 'text/yaml') 30 | res.send(yamlData) 31 | } catch (e) { 32 | console.error(e.message) 33 | // esto no lo hagáis normalmente 34 | res.status(500).send({ error: 'Unable to fetch openapi.yaml manifest'}) 35 | } 36 | }) 37 | 38 | app.get('/.well-known/ai-plugin.json', (req, res) => { 39 | res.sendFile(path.join(process.cwd(), '.well-known/ai-plugin.json')) 40 | }) 41 | 42 | app.get('/logo.png', (req, res) => { 43 | res.sendFile(path.join(process.cwd(), 'logo.png')) 44 | }) 45 | 46 | // 2. Los endpoints de la API 47 | // para que funcione el plugin de ChatGPT con los todos 48 | let TODOS = [ 49 | { id: crypto.randomUUID(), title: 'Ver el Twitch de midudev' }, 50 | { id: crypto.randomUUID(), title: 'Enviar el proyecto Hackathon InfoJobs' }, 51 | { id: crypto.randomUUID(), title: 'Crear plugin de ChatGPT' }, 52 | { id: crypto.randomUUID(), title: 'Mejorar el rendimiento de la web' }, 53 | ] 54 | 55 | app.get('/todos', (req, res) => { 56 | res.json({ todos: TODOS }) 57 | }) 58 | 59 | app.post('/todos', (req, res) => { 60 | const { title } = req.body 61 | const newTodo = { id: crypto.randomUUID(), title } 62 | 63 | TODOS.push(newTodo) // lo podrías hacer en una base de datos 64 | 65 | res.json(newTodo) 66 | }) 67 | 68 | app.get('/todos/:id', (req, res) => { 69 | const { id } = req.params 70 | const todo = TODOS.find(todo => todo.id === id) 71 | return res.json(todo) 72 | }) 73 | 74 | app.put('/todos/:id', (req, res) => { 75 | const { id } = req.params 76 | const { title } = req.body 77 | 78 | let newTodo = null 79 | 80 | TODOS.forEach((todo, index) => { 81 | if (todo.id === id) { 82 | newTodo = { ...todo, title } 83 | TODOS[index] = newTodo 84 | } 85 | }) 86 | 87 | return res.json(newTodo) 88 | }) 89 | 90 | app.delete('/todos/:id', (req, res) => { 91 | const { id } = req.params 92 | 93 | TODOS = TODOS.filter(todo => todo.id !== id) 94 | 95 | return res.json({ ok: true }) 96 | }) 97 | 98 | // 3. Iniciar el servidor 99 | app.listen(PORT, () => { 100 | console.log('ChatGPT Plugin is listening on port', PORT) 101 | }) -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import express, { json } from 'express' 2 | import cors from 'cors' 3 | import fs from 'node:fs/promises' // fs -> file system -> sistema de archivos (leer) 4 | import path from 'node:path' 5 | import crypto from 'node:crypto' 6 | 7 | const PORT = process.env.PORT ?? 3000 8 | const app = express() 9 | 10 | app.use(cors( 11 | { 12 | methods: ['GET'], 13 | origin: [`https://localhost:${PORT}`, 'https://chat.openai.com'] 14 | } 15 | )) 16 | app.use(json()) 17 | 18 | app.use((req, res, next) => { 19 | console.log(`Request received: ${req.method} ${req.url}`) 20 | next() 21 | }) 22 | 23 | // 1. Preparar los endpoints para servir la información 24 | // que necesita el Plugin de ChatGPT 25 | app.get('/openapi.yaml', async (req, res, next) => { 26 | try { 27 | const filePath = path.join(process.cwd(), 'openapi.yaml') 28 | const yamlData = await fs.readFile(filePath, 'utf-8') 29 | res.setHeader('Content-Type', 'text/yaml') 30 | res.send(yamlData) 31 | } catch (e) { 32 | console.error(e.message) 33 | // esto no lo hagáis normalmente 34 | res.status(500).send({ error: 'Unable to fetch openapi.yaml manifest'}) 35 | } 36 | }) 37 | 38 | app.get('/.well-known/ai-plugin.json', (req, res) => { 39 | res.sendFile(path.join(process.cwd(), '.well-known/ai-plugin.json')) 40 | }) 41 | 42 | app.get('/logo.png', (req, res) => { 43 | res.sendFile(path.join(process.cwd(), 'logo.png')) 44 | }) 45 | 46 | // 2. Los endpoints de la API 47 | // para que funcione el plugin de ChatGPT con GitHub 48 | app.get('/search', async (req, res) => { 49 | const { q } = req.query 50 | 51 | const apiURL = `https://api.github.com/search/repositories?q=${q}` 52 | const apiResponse = await fetch(apiURL, { 53 | headers: { 54 | 'User-Agent': 'ChatGPT Plugin v.1.0.0 - @midudev', 55 | 'Accept': 'application/vnd.github.v3+json' 56 | } 57 | }) 58 | 59 | if (!apiResponse.ok) { 60 | return res.sendStatus(apiResponse.status) 61 | } 62 | 63 | console.log('te quedan:', apiResponse.headers.get('X-RateLimit-Remaining')) 64 | 65 | const json = await apiResponse.json() 66 | 67 | const repos = json.items.map(item => ({ 68 | name: item.name, 69 | description: item.description, 70 | stars: item.stargazers_count, 71 | url: item.html_url 72 | })) 73 | 74 | return res.json({ repos }) 75 | 76 | }) 77 | 78 | // 3. Iniciar el servidor 79 | app.listen(PORT, () => { 80 | console.log('ChatGPT Plugin is listening on port', PORT) 81 | }) -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/midudev/chat-gpt-plugins-javascript/dd8a36f5506434fa4d59746163ecabdd130a947c/logo.png -------------------------------------------------------------------------------- /openapi-todos.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.1 2 | 3 | info: 4 | title: ChatGPT Plugin ToDo API 5 | version: 1.0.0 6 | description: API Specification for ChatGPT Plugin ToDo API 7 | 8 | paths: 9 | /todos: 10 | get: 11 | summary: Get all todos 12 | operationId: getTodos 13 | tags: 14 | - todos 15 | responses: 16 | '200': 17 | description: Succesful response 18 | content: 19 | application/json: 20 | schema: 21 | type: object 22 | properties: 23 | todos: 24 | type: array 25 | items: 26 | $ref: '#/components/schemas/Todo' 27 | post: 28 | summary: Create a todo 29 | operationId: createTodo 30 | tags: 31 | - todos 32 | requestBody: 33 | required: true 34 | description: Todo object to be created 35 | content: 36 | application/json: 37 | schema: 38 | $ref: '#/components/schemas/TodoInput' 39 | responses: 40 | '200': 41 | description: Succesful response 42 | content: 43 | application/json: 44 | schema: 45 | $ref: '#/components/schemas/Todo' 46 | 47 | /todos/{id}: 48 | get: 49 | summary: Get a todo by id 50 | operationId: getTodo 51 | tags: 52 | - todos 53 | parameters: 54 | - name: id 55 | in: path 56 | required: true 57 | description: Id of the todo to be retrieved 58 | schema: 59 | type: string 60 | responses: 61 | '200': 62 | description: Succesful response 63 | content: 64 | application/json: 65 | schema: 66 | $ref: '#/components/schemas/Todo' 67 | 68 | put: 69 | summary: Update a todo by id 70 | operationId: updateTodo 71 | tags: 72 | - todos 73 | parameters: 74 | - name: id 75 | in: path 76 | required: true 77 | description: Id of the todo to be updated 78 | schema: 79 | type: string 80 | requestBody: 81 | required: true 82 | description: Todo object to be updated 83 | content: 84 | application/json: 85 | schema: 86 | $ref: '#/components/schemas/TodoInput' 87 | responses: 88 | '200': 89 | description: Succesful response 90 | content: 91 | application/json: 92 | schema: 93 | $ref: '#/components/schemas/Todo' 94 | delete: 95 | summary: Delete a todo by id 96 | operationId: deleteTodo 97 | tags: 98 | - todos 99 | parameters: 100 | - name: id 101 | in: path 102 | required: true 103 | description: Id of the todo to be deleted 104 | schema: 105 | type: string 106 | responses: 107 | '200': 108 | description: Succesful response 109 | content: 110 | application/json: 111 | type: object 112 | properties: 113 | ok: 114 | type: boolean 115 | 116 | components: 117 | schemas: 118 | Todo: 119 | type: object 120 | properties: 121 | id: 122 | type: string 123 | title: 124 | type: string 125 | required: 126 | - id 127 | - title 128 | 129 | TodoInput: 130 | type: object 131 | properties: 132 | title: 133 | type: string 134 | required: 135 | - title -------------------------------------------------------------------------------- /openapi.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.1 2 | 3 | info: 4 | title: ChatGPT Plugin GitHub Search Repositories API 5 | version: 1.0.0 6 | description: API Specification for ChatGPT Plugin GitHub Search Repositories API 7 | 8 | paths: 9 | /search: 10 | get: 11 | summary: Search GitHub Repositories using a query 12 | operationId: searchGitHub 13 | tags: 14 | - github 15 | parameters: 16 | - in: query 17 | name: q 18 | required: true 19 | description: Query to search GitHub Repositories 20 | schema: 21 | type: string 22 | responses: 23 | '200': 24 | description: Successful response 25 | content: 26 | application/json: 27 | schema: 28 | type: object 29 | properties: 30 | repos: 31 | type: array 32 | items: 33 | $ref: '#/components/schemas/Repository' 34 | 35 | components: 36 | schemas: 37 | Repository: 38 | type: object 39 | properties: 40 | name: 41 | type: string 42 | stars: 43 | type: integer 44 | url: 45 | type: string 46 | description: 47 | type: string 48 | required: 49 | - name 50 | - stars 51 | - url 52 | - description -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-first-midu-chatgpt-plugin", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "my-first-midu-chatgpt-plugin", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "cors": "2.8.5", 13 | "express": "4.18.2" 14 | } 15 | }, 16 | "node_modules/accepts": { 17 | "version": "1.3.8", 18 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 19 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 20 | "dependencies": { 21 | "mime-types": "~2.1.34", 22 | "negotiator": "0.6.3" 23 | }, 24 | "engines": { 25 | "node": ">= 0.6" 26 | } 27 | }, 28 | "node_modules/array-flatten": { 29 | "version": "1.1.1", 30 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 31 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 32 | }, 33 | "node_modules/body-parser": { 34 | "version": "1.20.1", 35 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 36 | "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", 37 | "dependencies": { 38 | "bytes": "3.1.2", 39 | "content-type": "~1.0.4", 40 | "debug": "2.6.9", 41 | "depd": "2.0.0", 42 | "destroy": "1.2.0", 43 | "http-errors": "2.0.0", 44 | "iconv-lite": "0.4.24", 45 | "on-finished": "2.4.1", 46 | "qs": "6.11.0", 47 | "raw-body": "2.5.1", 48 | "type-is": "~1.6.18", 49 | "unpipe": "1.0.0" 50 | }, 51 | "engines": { 52 | "node": ">= 0.8", 53 | "npm": "1.2.8000 || >= 1.4.16" 54 | } 55 | }, 56 | "node_modules/bytes": { 57 | "version": "3.1.2", 58 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 59 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 60 | "engines": { 61 | "node": ">= 0.8" 62 | } 63 | }, 64 | "node_modules/call-bind": { 65 | "version": "1.0.2", 66 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 67 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 68 | "dependencies": { 69 | "function-bind": "^1.1.1", 70 | "get-intrinsic": "^1.0.2" 71 | }, 72 | "funding": { 73 | "url": "https://github.com/sponsors/ljharb" 74 | } 75 | }, 76 | "node_modules/content-disposition": { 77 | "version": "0.5.4", 78 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 79 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 80 | "dependencies": { 81 | "safe-buffer": "5.2.1" 82 | }, 83 | "engines": { 84 | "node": ">= 0.6" 85 | } 86 | }, 87 | "node_modules/content-type": { 88 | "version": "1.0.5", 89 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 90 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 91 | "engines": { 92 | "node": ">= 0.6" 93 | } 94 | }, 95 | "node_modules/cookie": { 96 | "version": "0.5.0", 97 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", 98 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", 99 | "engines": { 100 | "node": ">= 0.6" 101 | } 102 | }, 103 | "node_modules/cookie-signature": { 104 | "version": "1.0.6", 105 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 106 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 107 | }, 108 | "node_modules/cors": { 109 | "version": "2.8.5", 110 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 111 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 112 | "dependencies": { 113 | "object-assign": "^4", 114 | "vary": "^1" 115 | }, 116 | "engines": { 117 | "node": ">= 0.10" 118 | } 119 | }, 120 | "node_modules/debug": { 121 | "version": "2.6.9", 122 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 123 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 124 | "dependencies": { 125 | "ms": "2.0.0" 126 | } 127 | }, 128 | "node_modules/depd": { 129 | "version": "2.0.0", 130 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 131 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 132 | "engines": { 133 | "node": ">= 0.8" 134 | } 135 | }, 136 | "node_modules/destroy": { 137 | "version": "1.2.0", 138 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 139 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", 140 | "engines": { 141 | "node": ">= 0.8", 142 | "npm": "1.2.8000 || >= 1.4.16" 143 | } 144 | }, 145 | "node_modules/ee-first": { 146 | "version": "1.1.1", 147 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 148 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" 149 | }, 150 | "node_modules/encodeurl": { 151 | "version": "1.0.2", 152 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 153 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", 154 | "engines": { 155 | "node": ">= 0.8" 156 | } 157 | }, 158 | "node_modules/escape-html": { 159 | "version": "1.0.3", 160 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 161 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" 162 | }, 163 | "node_modules/etag": { 164 | "version": "1.8.1", 165 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 166 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 167 | "engines": { 168 | "node": ">= 0.6" 169 | } 170 | }, 171 | "node_modules/express": { 172 | "version": "4.18.2", 173 | "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", 174 | "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", 175 | "dependencies": { 176 | "accepts": "~1.3.8", 177 | "array-flatten": "1.1.1", 178 | "body-parser": "1.20.1", 179 | "content-disposition": "0.5.4", 180 | "content-type": "~1.0.4", 181 | "cookie": "0.5.0", 182 | "cookie-signature": "1.0.6", 183 | "debug": "2.6.9", 184 | "depd": "2.0.0", 185 | "encodeurl": "~1.0.2", 186 | "escape-html": "~1.0.3", 187 | "etag": "~1.8.1", 188 | "finalhandler": "1.2.0", 189 | "fresh": "0.5.2", 190 | "http-errors": "2.0.0", 191 | "merge-descriptors": "1.0.1", 192 | "methods": "~1.1.2", 193 | "on-finished": "2.4.1", 194 | "parseurl": "~1.3.3", 195 | "path-to-regexp": "0.1.7", 196 | "proxy-addr": "~2.0.7", 197 | "qs": "6.11.0", 198 | "range-parser": "~1.2.1", 199 | "safe-buffer": "5.2.1", 200 | "send": "0.18.0", 201 | "serve-static": "1.15.0", 202 | "setprototypeof": "1.2.0", 203 | "statuses": "2.0.1", 204 | "type-is": "~1.6.18", 205 | "utils-merge": "1.0.1", 206 | "vary": "~1.1.2" 207 | }, 208 | "engines": { 209 | "node": ">= 0.10.0" 210 | } 211 | }, 212 | "node_modules/finalhandler": { 213 | "version": "1.2.0", 214 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 215 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", 216 | "dependencies": { 217 | "debug": "2.6.9", 218 | "encodeurl": "~1.0.2", 219 | "escape-html": "~1.0.3", 220 | "on-finished": "2.4.1", 221 | "parseurl": "~1.3.3", 222 | "statuses": "2.0.1", 223 | "unpipe": "~1.0.0" 224 | }, 225 | "engines": { 226 | "node": ">= 0.8" 227 | } 228 | }, 229 | "node_modules/forwarded": { 230 | "version": "0.2.0", 231 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 232 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 233 | "engines": { 234 | "node": ">= 0.6" 235 | } 236 | }, 237 | "node_modules/fresh": { 238 | "version": "0.5.2", 239 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 240 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", 241 | "engines": { 242 | "node": ">= 0.6" 243 | } 244 | }, 245 | "node_modules/function-bind": { 246 | "version": "1.1.1", 247 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 248 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 249 | }, 250 | "node_modules/get-intrinsic": { 251 | "version": "1.2.1", 252 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", 253 | "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", 254 | "dependencies": { 255 | "function-bind": "^1.1.1", 256 | "has": "^1.0.3", 257 | "has-proto": "^1.0.1", 258 | "has-symbols": "^1.0.3" 259 | }, 260 | "funding": { 261 | "url": "https://github.com/sponsors/ljharb" 262 | } 263 | }, 264 | "node_modules/has": { 265 | "version": "1.0.3", 266 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 267 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 268 | "dependencies": { 269 | "function-bind": "^1.1.1" 270 | }, 271 | "engines": { 272 | "node": ">= 0.4.0" 273 | } 274 | }, 275 | "node_modules/has-proto": { 276 | "version": "1.0.1", 277 | "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", 278 | "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", 279 | "engines": { 280 | "node": ">= 0.4" 281 | }, 282 | "funding": { 283 | "url": "https://github.com/sponsors/ljharb" 284 | } 285 | }, 286 | "node_modules/has-symbols": { 287 | "version": "1.0.3", 288 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 289 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 290 | "engines": { 291 | "node": ">= 0.4" 292 | }, 293 | "funding": { 294 | "url": "https://github.com/sponsors/ljharb" 295 | } 296 | }, 297 | "node_modules/http-errors": { 298 | "version": "2.0.0", 299 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 300 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 301 | "dependencies": { 302 | "depd": "2.0.0", 303 | "inherits": "2.0.4", 304 | "setprototypeof": "1.2.0", 305 | "statuses": "2.0.1", 306 | "toidentifier": "1.0.1" 307 | }, 308 | "engines": { 309 | "node": ">= 0.8" 310 | } 311 | }, 312 | "node_modules/iconv-lite": { 313 | "version": "0.4.24", 314 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 315 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 316 | "dependencies": { 317 | "safer-buffer": ">= 2.1.2 < 3" 318 | }, 319 | "engines": { 320 | "node": ">=0.10.0" 321 | } 322 | }, 323 | "node_modules/inherits": { 324 | "version": "2.0.4", 325 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 326 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 327 | }, 328 | "node_modules/ipaddr.js": { 329 | "version": "1.9.1", 330 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 331 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 332 | "engines": { 333 | "node": ">= 0.10" 334 | } 335 | }, 336 | "node_modules/media-typer": { 337 | "version": "0.3.0", 338 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 339 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", 340 | "engines": { 341 | "node": ">= 0.6" 342 | } 343 | }, 344 | "node_modules/merge-descriptors": { 345 | "version": "1.0.1", 346 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 347 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" 348 | }, 349 | "node_modules/methods": { 350 | "version": "1.1.2", 351 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 352 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", 353 | "engines": { 354 | "node": ">= 0.6" 355 | } 356 | }, 357 | "node_modules/mime": { 358 | "version": "1.6.0", 359 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 360 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 361 | "bin": { 362 | "mime": "cli.js" 363 | }, 364 | "engines": { 365 | "node": ">=4" 366 | } 367 | }, 368 | "node_modules/mime-db": { 369 | "version": "1.52.0", 370 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 371 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 372 | "engines": { 373 | "node": ">= 0.6" 374 | } 375 | }, 376 | "node_modules/mime-types": { 377 | "version": "2.1.35", 378 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 379 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 380 | "dependencies": { 381 | "mime-db": "1.52.0" 382 | }, 383 | "engines": { 384 | "node": ">= 0.6" 385 | } 386 | }, 387 | "node_modules/ms": { 388 | "version": "2.0.0", 389 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 390 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" 391 | }, 392 | "node_modules/negotiator": { 393 | "version": "0.6.3", 394 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 395 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", 396 | "engines": { 397 | "node": ">= 0.6" 398 | } 399 | }, 400 | "node_modules/object-assign": { 401 | "version": "4.1.1", 402 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 403 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", 404 | "engines": { 405 | "node": ">=0.10.0" 406 | } 407 | }, 408 | "node_modules/object-inspect": { 409 | "version": "1.12.3", 410 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", 411 | "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", 412 | "funding": { 413 | "url": "https://github.com/sponsors/ljharb" 414 | } 415 | }, 416 | "node_modules/on-finished": { 417 | "version": "2.4.1", 418 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 419 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 420 | "dependencies": { 421 | "ee-first": "1.1.1" 422 | }, 423 | "engines": { 424 | "node": ">= 0.8" 425 | } 426 | }, 427 | "node_modules/parseurl": { 428 | "version": "1.3.3", 429 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 430 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 431 | "engines": { 432 | "node": ">= 0.8" 433 | } 434 | }, 435 | "node_modules/path-to-regexp": { 436 | "version": "0.1.7", 437 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 438 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 439 | }, 440 | "node_modules/proxy-addr": { 441 | "version": "2.0.7", 442 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 443 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 444 | "dependencies": { 445 | "forwarded": "0.2.0", 446 | "ipaddr.js": "1.9.1" 447 | }, 448 | "engines": { 449 | "node": ">= 0.10" 450 | } 451 | }, 452 | "node_modules/qs": { 453 | "version": "6.11.0", 454 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 455 | "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", 456 | "dependencies": { 457 | "side-channel": "^1.0.4" 458 | }, 459 | "engines": { 460 | "node": ">=0.6" 461 | }, 462 | "funding": { 463 | "url": "https://github.com/sponsors/ljharb" 464 | } 465 | }, 466 | "node_modules/range-parser": { 467 | "version": "1.2.1", 468 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 469 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 470 | "engines": { 471 | "node": ">= 0.6" 472 | } 473 | }, 474 | "node_modules/raw-body": { 475 | "version": "2.5.1", 476 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", 477 | "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", 478 | "dependencies": { 479 | "bytes": "3.1.2", 480 | "http-errors": "2.0.0", 481 | "iconv-lite": "0.4.24", 482 | "unpipe": "1.0.0" 483 | }, 484 | "engines": { 485 | "node": ">= 0.8" 486 | } 487 | }, 488 | "node_modules/safe-buffer": { 489 | "version": "5.2.1", 490 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 491 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 492 | "funding": [ 493 | { 494 | "type": "github", 495 | "url": "https://github.com/sponsors/feross" 496 | }, 497 | { 498 | "type": "patreon", 499 | "url": "https://www.patreon.com/feross" 500 | }, 501 | { 502 | "type": "consulting", 503 | "url": "https://feross.org/support" 504 | } 505 | ] 506 | }, 507 | "node_modules/safer-buffer": { 508 | "version": "2.1.2", 509 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 510 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 511 | }, 512 | "node_modules/send": { 513 | "version": "0.18.0", 514 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 515 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", 516 | "dependencies": { 517 | "debug": "2.6.9", 518 | "depd": "2.0.0", 519 | "destroy": "1.2.0", 520 | "encodeurl": "~1.0.2", 521 | "escape-html": "~1.0.3", 522 | "etag": "~1.8.1", 523 | "fresh": "0.5.2", 524 | "http-errors": "2.0.0", 525 | "mime": "1.6.0", 526 | "ms": "2.1.3", 527 | "on-finished": "2.4.1", 528 | "range-parser": "~1.2.1", 529 | "statuses": "2.0.1" 530 | }, 531 | "engines": { 532 | "node": ">= 0.8.0" 533 | } 534 | }, 535 | "node_modules/send/node_modules/ms": { 536 | "version": "2.1.3", 537 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 538 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 539 | }, 540 | "node_modules/serve-static": { 541 | "version": "1.15.0", 542 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", 543 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", 544 | "dependencies": { 545 | "encodeurl": "~1.0.2", 546 | "escape-html": "~1.0.3", 547 | "parseurl": "~1.3.3", 548 | "send": "0.18.0" 549 | }, 550 | "engines": { 551 | "node": ">= 0.8.0" 552 | } 553 | }, 554 | "node_modules/setprototypeof": { 555 | "version": "1.2.0", 556 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 557 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 558 | }, 559 | "node_modules/side-channel": { 560 | "version": "1.0.4", 561 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 562 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 563 | "dependencies": { 564 | "call-bind": "^1.0.0", 565 | "get-intrinsic": "^1.0.2", 566 | "object-inspect": "^1.9.0" 567 | }, 568 | "funding": { 569 | "url": "https://github.com/sponsors/ljharb" 570 | } 571 | }, 572 | "node_modules/statuses": { 573 | "version": "2.0.1", 574 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 575 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 576 | "engines": { 577 | "node": ">= 0.8" 578 | } 579 | }, 580 | "node_modules/toidentifier": { 581 | "version": "1.0.1", 582 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 583 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 584 | "engines": { 585 | "node": ">=0.6" 586 | } 587 | }, 588 | "node_modules/type-is": { 589 | "version": "1.6.18", 590 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 591 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 592 | "dependencies": { 593 | "media-typer": "0.3.0", 594 | "mime-types": "~2.1.24" 595 | }, 596 | "engines": { 597 | "node": ">= 0.6" 598 | } 599 | }, 600 | "node_modules/unpipe": { 601 | "version": "1.0.0", 602 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 603 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 604 | "engines": { 605 | "node": ">= 0.8" 606 | } 607 | }, 608 | "node_modules/utils-merge": { 609 | "version": "1.0.1", 610 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 611 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", 612 | "engines": { 613 | "node": ">= 0.4.0" 614 | } 615 | }, 616 | "node_modules/vary": { 617 | "version": "1.1.2", 618 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 619 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 620 | "engines": { 621 | "node": ">= 0.8" 622 | } 623 | } 624 | } 625 | } 626 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-first-midu-chatgpt-plugin", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "type": "module", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "cors": "2.8.5", 15 | "express": "4.18.2" 16 | } 17 | } 18 | --------------------------------------------------------------------------------