node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

11
server/node_modules/request-compose/request/auth.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
module.exports = (auth) => ({options, options: {headers}, body}) => {
if (typeof auth === 'object') {
headers.Authorization =
`Basic ${Buffer.from(`${auth.user}:${auth.pass || ''}`, 'utf8').toString('base64')}`
delete options.auth
}
return {options, body}
}

4
server/node_modules/request-compose/request/body.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
module.exports = (body) => ({options}) => {
return {options, body}
}

View File

@@ -0,0 +1,64 @@
var options = [
// https://nodejs.org/dist/latest-v14.x/docs/api/http.html#http_http_request_options_callback
'agent',
'auth',
'createConnection',
'defaultPort',
'family',
'headers',
'host',
'hostname',
'insecureHTTPParser',
'localAddress',
'lookup',
'maxHeaderSize',
'method',
'path',
'port',
'protocol',
'setHost',
'socketPath',
'timeout',
// https://nodejs.org/dist/latest-v14.x/docs/api/https.html#https_https_request_options_callback
'ca',
'cert',
'ciphers',
'clientCertEngine',
'crl',
'dhparam',
'ecdhCurve',
'honorCipherOrder',
'key',
'passphrase',
'pfx',
'rejectUnauthorized',
'secureOptions',
'secureProtocol',
'servername',
'sessionIdContext',
'highWaterMark',
]
module.exports = (_args = {}) => (args = _args) => {
var defaults = {
protocol: args.protocol || 'http:',
hostname: args.hostname || 'localhost',
port: args.port || 80,
method: (args.method || 'GET').toUpperCase(),
path: args.path || '/',
headers: args.headers ? JSON.parse(JSON.stringify(args.headers)) : {},
timeout: args.timeout || 5000,
}
return {
options: options.reduce((http, option) => (
defaults[option] !== undefined ? http[option] = defaults[option] :
args[option] !== undefined ? http[option] = args[option] :
null,
http
), {})
}
}

25
server/node_modules/request-compose/request/form.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
var querystring = require('querystring')
module.exports = (form) => ({options, options: {headers}}) => {
var header = Object.keys(headers)
.find((name) => name.toLowerCase() === 'content-type')
if (!header) {
headers['content-type'] = 'application/x-www-form-urlencoded'
}
var body =
typeof form === 'string'
? form :
typeof form === 'object'
? rfc3986(querystring.stringify(JSON.parse(JSON.stringify(form)))) :
''
return {options, body}
}
var rfc3986 = (str) => str.replace(
/[!'()*]/g, (c) => '%' + c.charCodeAt(0).toString(16).toUpperCase())

14
server/node_modules/request-compose/request/json.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
module.exports = (json) => ({options, options: {headers}}) => {
json = typeof json === 'object' ? JSON.stringify(json) : (json || '')
var header = Object.keys(headers)
.find((name) => name.toLowerCase() === 'content-type')
if (!header) {
headers['content-type'] = 'application/json'
}
return {options, body: json}
}

78
server/node_modules/request-compose/request/length.js generated vendored Normal file
View File

@@ -0,0 +1,78 @@
var fs = require('fs')
var stream = require('stream')
module.exports = () => ({options, options: {headers}, body}) => new Promise((resolve) =>{
var length = Object.keys(headers)
.find((name) => name.toLowerCase() === 'content-length')
var encoding = Object.keys(headers)
.find((name) => name.toLowerCase() === 'transfer-encoding')
if (headers[length] || headers[encoding] === 'chunked') {
resolve({options, body})
return
}
var getLength = (body, length, done) => {
if (typeof body === 'string') {
done(null, Buffer.byteLength(body))
}
else if (body instanceof Buffer) {
done(null, body.length)
}
// request-multipart
else if (body && body.constructor && body.constructor.name === 'BufferListStream') {
done(null, body.length)
}
else if (body instanceof stream.Stream) {
// fs.ReadStream
if (body.hasOwnProperty('fd')) {
fs.stat(body.path, (err, stats) => done(err, stats && stats.size))
}
// http.IncomingMessage
else if (body.hasOwnProperty('httpVersion')) {
done(!body.headers['content-length'], parseInt(body.headers['content-length']))
}
// request-multipart
else if (body._items) {
;(function loop (index) {
if (index === body._items.length) {
done(null, length)
return
}
var item = body._items[index]
if (item._knownLength) {
length += parseInt(item._knownLength)
loop(++index)
}
else {
getLength(item, length, (err, len) => {
if (err) {
done(err)
return
}
length += len
loop(++index)
})
}
})(0)
}
else {
done(true)
}
}
else {
done(true)
}
}
getLength(body, 0, (err, length) => {
err
? headers['transfer-encoding'] = 'chunked'
: headers['content-length'] = length
resolve({options, body})
})
})

24
server/node_modules/request-compose/request/proxy.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
var url = require('url')
module.exports = (proxy) => ({options}) => {
options.path = (() => {
var path = `${options.protocol}//${options.hostname}`
if (options.port && !/^(?:80|443)$/.test(options.port)) {
path += `:${options.port}`
}
path += options.path
return path
})()
options.headers.host = options.hostname
var uri = typeof proxy === 'string' ? url.parse(proxy) : proxy
options.protocol = uri.protocol
options.hostname = uri.hostname
options.port = uri.port
return {options}
}

28
server/node_modules/request-compose/request/qs.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
var querystring = require('querystring')
module.exports = (qs, redirect = {}) => ({options}) => {
if (redirect.followed) {
return {options}
}
if (typeof qs === 'object') {
qs = JSON.parse(JSON.stringify(qs))
var [path, query] = options.path.split('?')
query = querystring.parse(query)
qs = rfc3986(querystring.stringify(Object.assign(query, qs)))
options.path = path + (qs ? `?${qs}` : '')
}
else if (typeof qs === 'string') {
var [path, query] = options.path.split('?')
options.path = path + (query ? `?${query}&${qs}` : `?${qs}`)
}
return {options}
}
var rfc3986 = (str) => str.replace(
/[!'()*]/g, (c) => '%' + c.charCodeAt(0).toString(16).toUpperCase())

37
server/node_modules/request-compose/request/send.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
var http = require('http')
var https = require('https')
var stream = require('stream')
var crypto = require('crypto')
var log = require('../utils/log')
module.exports = () => ({options, body}) => new Promise((resolve, reject) => {
var id = crypto.randomBytes(20).toString('hex')
var req =
(/https/.test(options.protocol) ? https : http)
.request(options)
.on('response', (res) => {
res.id = id
log({send: {res}})
resolve({options, res})
})
.on('error', reject)
.on('timeout', () => {
var err = new Error('request-compose: timeout')
err.code = 'ETIMEDOUT'
req.emit('error', err)
req.abort()
})
.setTimeout(options.timeout)
;(body instanceof stream.Stream)
? body.pipe(req)
: req.end(body)
req.id = id
log({send: {req, body, options}})
})

15
server/node_modules/request-compose/request/url.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
var url = require('url')
module.exports = (uri) => ({options}) => {
uri = typeof uri === 'string' ? url.parse(uri) : uri
options.protocol = uri.protocol
options.hostname = uri.hostname
options.port = uri.port
options.path = uri.path
return {options}
}