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

16
server/node_modules/purest/lib/alias.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
module.exports = ({options, methods}) => {
Object.keys(methods).forEach((key) => {
if (!options[key]) {
var alias = methods[key].find((alias) => Object.keys(options).includes(alias))
if (alias) {
options[key] = options[alias]
delete options[alias]
}
}
})
return options
}

50
server/node_modules/purest/lib/auth.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
var cache = []
var replacer = () => {
return (key, value) => {
if (typeof value === 'object' && value.constructor.name !== 'Object') {
cache.push(value)
return '$token'
}
else {
return value
}
}
}
var reviver = () => {
var index = 0
return (key, value) => {
if (value === '$token') {
return cache[index++]
}
else {
return value
}
}
}
module.exports = (options) => {
cache = []
if (typeof options.auth === 'string' || options.auth instanceof Array) {
var index = 0
var auth = [].concat(options.auth)
options = JSON.parse(
JSON.stringify(options, replacer())
.replace(/{auth}/g, (match, offset, string) => auth[index++]),
reviver())
if (options._auth) {
options.auth = options._auth
}
else {
// conflicts with request-compose auth
delete options.auth
}
}
return options
}

45
server/node_modules/purest/lib/client.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
var compose = require('request-compose')
var oauth = require('request-oauth')
var multipart = require('request-multipart')
var qs = require('qs')
var parse = () => ({options, res, res: {headers}, body, raw}) => {
raw = body
var header = Object.keys(headers)
.find((name) => name.toLowerCase() === 'content-type')
if (/json|javascript/.test(headers[header])) {
try {
body = JSON.parse(body)
}
catch (err) {}
}
else if (/application\/x-www-form-urlencoded/.test(headers[header])) {
try {
body = qs.parse(body) // use qs instead of querystring for nested objects
}
catch (err) {}
}
log({parse: {res, body}})
return {options, res, body, raw}
}
var log = (data) => {
if (process.env.DEBUG) {
try {
require('request-logs')(data)
}
catch (err) {}
}
}
module.exports = compose.extend({
Request: {oauth, multipart},
Response: {parse}
})

27
server/node_modules/purest/lib/endpoint.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
var extend = require('@simov/deep-extend')
var def = require('../config/methods')
module.exports = (ctor, req) => {
var endpoint = (() => {
var all = extend({}, ctor.defaults || {}, req)
var aliases = (ctor.methods || {}).endpoint || def.purest.endpoint
var alias = ['endpoint'].concat(aliases).find((key) => all[key] !== undefined)
return all[alias] || 'default'
})()
var options = (ctor.config[ctor.provider] || {})[endpoint] || {}
if (options.auth) {
options._auth = options.auth
}
options = extend({}, options, ctor.defaults || {}, req)
var methods = Object.assign({}, def.methods, def.http, def.url, def.purest, ctor.methods || {})
return {options, methods}
}

15
server/node_modules/purest/lib/method.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
var def = require('../config/methods')
module.exports = (options) => {
options.method = options.method ||
Object.keys(options).find((key) => Object.keys(def.methods).includes(key))
if (options.method) {
options.method = options.method.toUpperCase()
}
return options
}

26
server/node_modules/purest/lib/url.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
var def = require('../config/methods')
module.exports = (options) => {
if (options.url) {
return options
}
var method = Object.keys(options)
.find((key) => Object.keys(def.methods).includes(key))
if (/^https?/.test(options[method])) {
options.url = options[method]
return options
}
options.url = `${options.origin}/${options.path}`
.replace('{path}', options[method] || '')
.replace('{subdomain}', options.subdomain || '')
.replace('{version}', options.version || '')
.replace('{type}', options.type || '')
return options
}