'use strict'
!(function(require, directRequire) {
  const a = require('./common/locales/index.js'),
    b = a => (...b) =>
      JSON.stringify({ code: a.code, error: a.error.format(b) })
  module.exports = {
    SUCCESS: a => JSON.stringify({ code: 2e4, data: a }),
    ERROR: {
      GENERIC_ERROR: b({ code: 4e4, error: a.config.CLI_GENERIC_ERROR }),
      BAD_REQUEST: b({ code: 4e4, error: a.config.CLI_BAD_REQUEST }),
      BAD_NETWORK: b({ code: 4e4, error: a.config.CLI_BAD_NETWORK }),
      NEED_LOGIN: b({ code: 400001, error: a.config.CLI_NEED_LOGIN }),
      NEED_PROJECTPATH: b({
        code: 400002,
        error: a.config.CLI_NEED_PROJECTPATH
      }),
      NEED_VERSION: b({ code: 400002, error: a.config.CLI_NEED_VERSION }),
      FORMAT_NOT_SUPPORT: b({
        code: 400002,
        error: a.config.CLI_FORMAT_NOT_SUPPORT
      }),
      QR_PATH_NOT_VALID_OR_NOT_EXIST: b({
        code: 400002,
        error: a.config.CLI_QR_PATH_NOT_VALID_OR_NOT_EXIST
      }),
      PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST: b({
        code: 400002,
        error: a.config.CLI_PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST
      }),
      NOT_FOUND_IN_PROJECT_CONFIG_JSON: b({
        code: 400002,
        error: a.config.CLI_NOT_FOUND_IN_PROJECT_CONFIG_JSON
      }),
      APPID_NOT_BOUND: b({ code: 400002, error: a.config.CLI_APPID_NOT_BOUND }),
      INVALID_APPID: b({ code: 400002, error: a.config.CLI_INVALID_APPID }),
      GET_APP_INFO_ERROR: b({
        code: 400003,
        error: a.config.CLI_GET_APP_INFO_ERROR
      }),
      QR_OUTDATED: b({ code: 400003, error: a.config.CLI_QR_OUTDATED }),
      LOGIN_RETRY: b({ code: 400003, error: a.config.CLI_LOGIN_RETRY }),
      DUPLICATE_PROJECT_ID: b({
        code: 400003,
        error: a.config.CLI_DUPLICATE_PROJECT_ID
      })
    }
  }
})(require('lazyload'), require)
