????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.142.43.53
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/lib/node_modules/npm/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/lib/node_modules/npm/lib/team.js
const columns = require('cli-columns')
const libteam = require('libnpmteam')

const otplease = require('./utils/otplease.js')

const BaseCommand = require('./base-command.js')
class Team extends BaseCommand {
  static get description () {
    return 'Manage organization teams and team memberships'
  }

  /* istanbul ignore next - see test/lib/load-all-commands.js */
  static get name () {
    return 'team'
  }

  /* istanbul ignore next - see test/lib/load-all-commands.js */
  static get usage () {
    return [
      'create <scope:team> [--otp <otpcode>]',
      'destroy <scope:team> [--otp <otpcode>]',
      'add <scope:team> <user> [--otp <otpcode>]',
      'rm <scope:team> <user> [--otp <otpcode>]',
      'ls <scope>|<scope:team>',
    ]
  }

  /* istanbul ignore next - see test/lib/load-all-commands.js */
  static get params () {
    return [
      'registry',
      'otp',
      'parseable',
      'json',
    ]
  }

  async completion (opts) {
    const { conf: { argv: { remain: argv } } } = opts
    const subcommands = ['create', 'destroy', 'add', 'rm', 'ls']

    if (argv.length === 2)
      return subcommands

    if (subcommands.includes(argv[2]))
      return []

    throw new Error(argv[2] + ' not recognized')
  }

  exec (args, cb) {
    this.team(args).then(() => cb()).catch(cb)
  }

  async team ([cmd, entity = '', user = '']) {
    // Entities are in the format <scope>:<team>
    // XXX: "description" option to libnpmteam is used as a description of the
    // team, but in npm's options, this is a boolean meaning "show the
    // description in npm search output".  Hence its being set to null here.
    await otplease(this.npm.flatOptions, opts => {
      entity = entity.replace(/^@/, '')
      switch (cmd) {
        case 'create': return this.create(entity, opts)
        case 'destroy': return this.destroy(entity, opts)
        case 'add': return this.add(entity, user, opts)
        case 'rm': return this.rm(entity, user, opts)
        case 'ls': {
          const match = entity.match(/[^:]+:.+/)
          if (match)
            return this.listUsers(entity, opts)
          else
            return this.listTeams(entity, opts)
        }
        default:
          throw this.usage
      }
    })
  }

  async create (entity, opts) {
    await libteam.create(entity, opts)
    if (opts.json) {
      this.npm.output(JSON.stringify({
        created: true,
        team: entity,
      }))
    } else if (opts.parseable)
      this.npm.output(`${entity}\tcreated`)
    else if (!opts.silent && opts.loglevel !== 'silent')
      this.npm.output(`+@${entity}`)
  }

  async destroy (entity, opts) {
    await libteam.destroy(entity, opts)
    if (opts.json) {
      this.npm.output(JSON.stringify({
        deleted: true,
        team: entity,
      }))
    } else if (opts.parseable)
      this.npm.output(`${entity}\tdeleted`)
    else if (!opts.silent && opts.loglevel !== 'silent')
      this.npm.output(`-@${entity}`)
  }

  async add (entity, user, opts) {
    await libteam.add(user, entity, opts)
    if (opts.json) {
      this.npm.output(JSON.stringify({
        added: true,
        team: entity,
        user,
      }))
    } else if (opts.parseable)
      this.npm.output(`${user}\t${entity}\tadded`)
    else if (!opts.silent && opts.loglevel !== 'silent')
      this.npm.output(`${user} added to @${entity}`)
  }

  async rm (entity, user, opts) {
    await libteam.rm(user, entity, opts)
    if (opts.json) {
      this.npm.output(JSON.stringify({
        removed: true,
        team: entity,
        user,
      }))
    } else if (opts.parseable)
      this.npm.output(`${user}\t${entity}\tremoved`)
    else if (!opts.silent && opts.loglevel !== 'silent')
      this.npm.output(`${user} removed from @${entity}`)
  }

  async listUsers (entity, opts) {
    const users = (await libteam.lsUsers(entity, opts)).sort()
    if (opts.json)
      this.npm.output(JSON.stringify(users, null, 2))
    else if (opts.parseable)
      this.npm.output(users.join('\n'))
    else if (!opts.silent && opts.loglevel !== 'silent') {
      const plural = users.length === 1 ? '' : 's'
      const more = users.length === 0 ? '' : ':\n'
      this.npm.output(`\n@${entity} has ${users.length} user${plural}${more}`)
      this.npm.output(columns(users, { padding: 1 }))
    }
  }

  async listTeams (entity, opts) {
    const teams = (await libteam.lsTeams(entity, opts)).sort()
    if (opts.json)
      this.npm.output(JSON.stringify(teams, null, 2))
    else if (opts.parseable)
      this.npm.output(teams.join('\n'))
    else if (!opts.silent && opts.loglevel !== 'silent') {
      const plural = teams.length === 1 ? '' : 's'
      const more = teams.length === 0 ? '' : ':\n'
      this.npm.output(`\n@${entity} has ${teams.length} team${plural}${more}`)
      this.npm.output(columns(teams.map(t => `@${t}`), { padding: 1 }))
    }
  }
}
module.exports = Team

Youez - 2016 - github.com/yon3zu
LinuXploit