Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/purest/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type:
var extend = require('extend')
var api = require('@request/api')
var _methods = require('../config/methods')
module.exports = (ctor, config, request) => {
if (ctor.api === 'basic') {
return api({
type: 'basic',
define: {
request: request
}
})
}
var define = {
alias: (options, name) => {
options.alias = name
},
auth: (options, arg1, arg2) => {
if (typeof arg1 === 'object') {
// TODO: implement
// options.auth = {basic: arg1}
// options.auth = {bearer: arg1}
}
else {
var alias = (options.alias || ctor.alias || '__default')
config.endpoint.auth(alias, options, arg1, arg2)
}
},
oauth: (options, opts) => {
// TODO: it should be
// options.auth = {oauth: opts}
options.oauth = opts
},
options: (options, opts) => {
extend(true, options, opts)
},
request: (options, callback) => {
if (callback) {
options.callback = callback
}
return request(options)
}
}
ctor.methods = ctor.methods || {}
var custom = {}
extend(custom, define, ctor.methods.define)
delete ctor.methods.define
var methods = {}
extend(true, methods, _methods, ctor.methods)
return api({
type: 'chain',
config: methods,
define: custom
})
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0126 ]-- |