parent
7033ee476e
commit
4bd78f84eb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,34 @@
|
||||
import sys
|
||||
from flask import Flask, jsonify
|
||||
from flask_cors import CORS
|
||||
import subprocess # 用于启动 MainProgram.py
|
||||
|
||||
app = Flask(__name__)
|
||||
CORS(app)
|
||||
|
||||
yolo_process = None # 全局跟踪 YOLO 进程
|
||||
|
||||
@app.route('/start_yolo', methods=['GET'])
|
||||
def start_yolo():
|
||||
global yolo_process
|
||||
if yolo_process and yolo_process.poll() is None:
|
||||
return jsonify({'status': 'YOLO already running'})
|
||||
|
||||
yolo_path = '/home/qinxinqi/桌面/ros_master/rosmaster/src/YOLOv8face1/MainProgram.py'
|
||||
try:
|
||||
yolo_process = subprocess.Popen(['python', yolo_path])
|
||||
return jsonify({'status': 'YOLO started successfully'})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)})
|
||||
|
||||
@app.route('/stop_yolo', methods=['GET'])
|
||||
def stop_yolo():
|
||||
global yolo_process
|
||||
if yolo_process and yolo_process.poll() is None:
|
||||
yolo_process.terminate()
|
||||
yolo_process = None
|
||||
return jsonify({'status': 'YOLO stopped'})
|
||||
return jsonify({'status': 'No YOLO process running'})
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, port=5000, host='0.0.0.0')
|
||||
@ -0,0 +1,495 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
{ # this ensures the entire script is downloaded #
|
||||
|
||||
nvm_has() {
|
||||
type "$1" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
nvm_echo() {
|
||||
command printf %s\\n "$*" 2>/dev/null
|
||||
}
|
||||
|
||||
if [ -z "${BASH_VERSION}" ] || [ -n "${ZSH_VERSION}" ]; then
|
||||
# shellcheck disable=SC2016
|
||||
nvm_echo >&2 'Error: the install instructions explicitly say to pipe the install script to `bash`; please follow them'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nvm_grep() {
|
||||
GREP_OPTIONS='' command grep "$@"
|
||||
}
|
||||
|
||||
nvm_default_install_dir() {
|
||||
[ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm"
|
||||
}
|
||||
|
||||
nvm_install_dir() {
|
||||
if [ -n "$NVM_DIR" ]; then
|
||||
printf %s "${NVM_DIR}"
|
||||
else
|
||||
nvm_default_install_dir
|
||||
fi
|
||||
}
|
||||
|
||||
nvm_latest_version() {
|
||||
nvm_echo "v0.39.7"
|
||||
}
|
||||
|
||||
nvm_profile_is_bash_or_zsh() {
|
||||
local TEST_PROFILE
|
||||
TEST_PROFILE="${1-}"
|
||||
case "${TEST_PROFILE-}" in
|
||||
*"/.bashrc" | *"/.bash_profile" | *"/.zshrc" | *"/.zprofile")
|
||||
return
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
#
|
||||
# Outputs the location to NVM depending on:
|
||||
# * The availability of $NVM_SOURCE
|
||||
# * The presence of $NVM_INSTALL_GITHUB_REPO
|
||||
# * The method used ("script" or "git" in the script, defaults to "git")
|
||||
# NVM_SOURCE always takes precedence unless the method is "script-nvm-exec"
|
||||
#
|
||||
nvm_source() {
|
||||
local NVM_GITHUB_REPO
|
||||
NVM_GITHUB_REPO="${NVM_INSTALL_GITHUB_REPO:-nvm-sh/nvm}"
|
||||
if [ "${NVM_GITHUB_REPO}" != 'nvm-sh/nvm' ]; then
|
||||
{ nvm_echo >&2 "$(cat)" ; } << EOF
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@ WARNING: REMOTE REPO IDENTIFICATION HAS CHANGED! @
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
|
||||
|
||||
The default repository for this install is \`nvm-sh/nvm\`,
|
||||
but the environment variables \`\$NVM_INSTALL_GITHUB_REPO\` is
|
||||
currently set to \`${NVM_GITHUB_REPO}\`.
|
||||
|
||||
If this is not intentional, interrupt this installation and
|
||||
verify your environment variables.
|
||||
EOF
|
||||
fi
|
||||
local NVM_VERSION
|
||||
NVM_VERSION="${NVM_INSTALL_VERSION:-$(nvm_latest_version)}"
|
||||
local NVM_METHOD
|
||||
NVM_METHOD="$1"
|
||||
local NVM_SOURCE_URL
|
||||
NVM_SOURCE_URL="$NVM_SOURCE"
|
||||
if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then
|
||||
NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm-exec"
|
||||
elif [ "_$NVM_METHOD" = "_script-nvm-bash-completion" ]; then
|
||||
NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/bash_completion"
|
||||
elif [ -z "$NVM_SOURCE_URL" ]; then
|
||||
if [ "_$NVM_METHOD" = "_script" ]; then
|
||||
NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm.sh"
|
||||
elif [ "_$NVM_METHOD" = "_git" ] || [ -z "$NVM_METHOD" ]; then
|
||||
NVM_SOURCE_URL="https://github.com/${NVM_GITHUB_REPO}.git"
|
||||
else
|
||||
nvm_echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
nvm_echo "$NVM_SOURCE_URL"
|
||||
}
|
||||
|
||||
#
|
||||
# Node.js version to install
|
||||
#
|
||||
nvm_node_version() {
|
||||
nvm_echo "$NODE_VERSION"
|
||||
}
|
||||
|
||||
nvm_download() {
|
||||
if nvm_has "curl"; then
|
||||
curl --fail --compressed -q "$@"
|
||||
elif nvm_has "wget"; then
|
||||
# Emulate curl with wget
|
||||
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
|
||||
-e 's/--compressed //' \
|
||||
-e 's/--fail //' \
|
||||
-e 's/-L //' \
|
||||
-e 's/-I /--server-response /' \
|
||||
-e 's/-s /-q /' \
|
||||
-e 's/-sS /-nv /' \
|
||||
-e 's/-o /-O /' \
|
||||
-e 's/-C - /-c /')
|
||||
# shellcheck disable=SC2086
|
||||
eval wget $ARGS
|
||||
fi
|
||||
}
|
||||
|
||||
install_nvm_from_git() {
|
||||
local INSTALL_DIR
|
||||
INSTALL_DIR="$(nvm_install_dir)"
|
||||
local NVM_VERSION
|
||||
NVM_VERSION="${NVM_INSTALL_VERSION:-$(nvm_latest_version)}"
|
||||
if [ -n "${NVM_INSTALL_VERSION:-}" ]; then
|
||||
# Check if version is an existing ref
|
||||
if command git ls-remote "$(nvm_source "git")" "$NVM_VERSION" | nvm_grep -q "$NVM_VERSION" ; then
|
||||
:
|
||||
# Check if version is an existing changeset
|
||||
elif ! nvm_download -o /dev/null "$(nvm_source "script-nvm-exec")"; then
|
||||
nvm_echo >&2 "Failed to find '$NVM_VERSION' version."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
local fetch_error
|
||||
if [ -d "$INSTALL_DIR/.git" ]; then
|
||||
# Updating repo
|
||||
nvm_echo "=> nvm is already installed in $INSTALL_DIR, trying to update using git"
|
||||
command printf '\r=> '
|
||||
fetch_error="Failed to update nvm with $NVM_VERSION, run 'git fetch' in $INSTALL_DIR yourself."
|
||||
else
|
||||
fetch_error="Failed to fetch origin with $NVM_VERSION. Please report this!"
|
||||
nvm_echo "=> Downloading nvm from git to '$INSTALL_DIR'"
|
||||
command printf '\r=> '
|
||||
mkdir -p "${INSTALL_DIR}"
|
||||
if [ "$(ls -A "${INSTALL_DIR}")" ]; then
|
||||
# Initializing repo
|
||||
command git init "${INSTALL_DIR}" || {
|
||||
nvm_echo >&2 'Failed to initialize nvm repo. Please report this!'
|
||||
exit 2
|
||||
}
|
||||
command git --git-dir="${INSTALL_DIR}/.git" remote add origin "$(nvm_source)" 2> /dev/null \
|
||||
|| command git --git-dir="${INSTALL_DIR}/.git" remote set-url origin "$(nvm_source)" || {
|
||||
nvm_echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!'
|
||||
exit 2
|
||||
}
|
||||
else
|
||||
# Cloning repo
|
||||
command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
|
||||
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
|
||||
exit 2
|
||||
}
|
||||
fi
|
||||
fi
|
||||
# Try to fetch tag
|
||||
if command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin tag "$NVM_VERSION" --depth=1 2>/dev/null; then
|
||||
:
|
||||
# Fetch given version
|
||||
elif ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch origin "$NVM_VERSION" --depth=1; then
|
||||
nvm_echo >&2 "$fetch_error"
|
||||
exit 1
|
||||
fi
|
||||
command git -c advice.detachedHead=false --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" checkout -f --quiet FETCH_HEAD || {
|
||||
nvm_echo >&2 "Failed to checkout the given version $NVM_VERSION. Please report this!"
|
||||
exit 2
|
||||
}
|
||||
if [ -n "$(command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" show-ref refs/heads/master)" ]; then
|
||||
if command git --no-pager --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet 2>/dev/null; then
|
||||
command git --no-pager --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet -D master >/dev/null 2>&1
|
||||
else
|
||||
nvm_echo >&2 "Your version of git is out of date. Please update it!"
|
||||
command git --no-pager --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch -D master >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
nvm_echo "=> Compressing and cleaning up git repository"
|
||||
if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" reflog expire --expire=now --all; then
|
||||
nvm_echo >&2 "Your version of git is out of date. Please update it!"
|
||||
fi
|
||||
if ! command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" gc --auto --aggressive --prune=now ; then
|
||||
nvm_echo >&2 "Your version of git is out of date. Please update it!"
|
||||
fi
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# Automatically install Node.js
|
||||
#
|
||||
nvm_install_node() {
|
||||
local NODE_VERSION_LOCAL
|
||||
NODE_VERSION_LOCAL="$(nvm_node_version)"
|
||||
|
||||
if [ -z "$NODE_VERSION_LOCAL" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
nvm_echo "=> Installing Node.js version $NODE_VERSION_LOCAL"
|
||||
nvm install "$NODE_VERSION_LOCAL"
|
||||
local CURRENT_NVM_NODE
|
||||
|
||||
CURRENT_NVM_NODE="$(nvm_version current)"
|
||||
if [ "$(nvm_version "$NODE_VERSION_LOCAL")" == "$CURRENT_NVM_NODE" ]; then
|
||||
nvm_echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed"
|
||||
else
|
||||
nvm_echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL"
|
||||
fi
|
||||
}
|
||||
|
||||
install_nvm_as_script() {
|
||||
local INSTALL_DIR
|
||||
INSTALL_DIR="$(nvm_install_dir)"
|
||||
local NVM_SOURCE_LOCAL
|
||||
NVM_SOURCE_LOCAL="$(nvm_source script)"
|
||||
local NVM_EXEC_SOURCE
|
||||
NVM_EXEC_SOURCE="$(nvm_source script-nvm-exec)"
|
||||
local NVM_BASH_COMPLETION_SOURCE
|
||||
NVM_BASH_COMPLETION_SOURCE="$(nvm_source script-nvm-bash-completion)"
|
||||
|
||||
# Downloading to $INSTALL_DIR
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
if [ -f "$INSTALL_DIR/nvm.sh" ]; then
|
||||
nvm_echo "=> nvm is already installed in $INSTALL_DIR, trying to update the script"
|
||||
else
|
||||
nvm_echo "=> Downloading nvm as script to '$INSTALL_DIR'"
|
||||
fi
|
||||
nvm_download -s "$NVM_SOURCE_LOCAL" -o "$INSTALL_DIR/nvm.sh" || {
|
||||
nvm_echo >&2 "Failed to download '$NVM_SOURCE_LOCAL'"
|
||||
return 1
|
||||
} &
|
||||
nvm_download -s "$NVM_EXEC_SOURCE" -o "$INSTALL_DIR/nvm-exec" || {
|
||||
nvm_echo >&2 "Failed to download '$NVM_EXEC_SOURCE'"
|
||||
return 2
|
||||
} &
|
||||
nvm_download -s "$NVM_BASH_COMPLETION_SOURCE" -o "$INSTALL_DIR/bash_completion" || {
|
||||
nvm_echo >&2 "Failed to download '$NVM_BASH_COMPLETION_SOURCE'"
|
||||
return 2
|
||||
} &
|
||||
for job in $(jobs -p | command sort)
|
||||
do
|
||||
wait "$job" || return $?
|
||||
done
|
||||
chmod a+x "$INSTALL_DIR/nvm-exec" || {
|
||||
nvm_echo >&2 "Failed to mark '$INSTALL_DIR/nvm-exec' as executable"
|
||||
return 3
|
||||
}
|
||||
}
|
||||
|
||||
nvm_try_profile() {
|
||||
if [ -z "${1-}" ] || [ ! -f "${1}" ]; then
|
||||
return 1
|
||||
fi
|
||||
nvm_echo "${1}"
|
||||
}
|
||||
|
||||
#
|
||||
# Detect profile file if not specified as environment variable
|
||||
# (eg: PROFILE=~/.myprofile)
|
||||
# The echo'ed path is guaranteed to be an existing file
|
||||
# Otherwise, an empty string is returned
|
||||
#
|
||||
nvm_detect_profile() {
|
||||
if [ "${PROFILE-}" = '/dev/null' ]; then
|
||||
# the user has specifically requested NOT to have nvm touch their profile
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -n "${PROFILE}" ] && [ -f "${PROFILE}" ]; then
|
||||
nvm_echo "${PROFILE}"
|
||||
return
|
||||
fi
|
||||
|
||||
local DETECTED_PROFILE
|
||||
DETECTED_PROFILE=''
|
||||
|
||||
if [ "${SHELL#*bash}" != "$SHELL" ]; then
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
DETECTED_PROFILE="$HOME/.bashrc"
|
||||
elif [ -f "$HOME/.bash_profile" ]; then
|
||||
DETECTED_PROFILE="$HOME/.bash_profile"
|
||||
fi
|
||||
elif [ "${SHELL#*zsh}" != "$SHELL" ]; then
|
||||
if [ -f "$HOME/.zshrc" ]; then
|
||||
DETECTED_PROFILE="$HOME/.zshrc"
|
||||
elif [ -f "$HOME/.zprofile" ]; then
|
||||
DETECTED_PROFILE="$HOME/.zprofile"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$DETECTED_PROFILE" ]; then
|
||||
for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zprofile" ".zshrc"
|
||||
do
|
||||
if DETECTED_PROFILE="$(nvm_try_profile "${HOME}/${EACH_PROFILE}")"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$DETECTED_PROFILE" ]; then
|
||||
nvm_echo "$DETECTED_PROFILE"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Check whether the user has any globally-installed npm modules in their system
|
||||
# Node, and warn them if so.
|
||||
#
|
||||
nvm_check_global_modules() {
|
||||
local NPM_COMMAND
|
||||
NPM_COMMAND="$(command -v npm 2>/dev/null)" || return 0
|
||||
[ -n "${NVM_DIR}" ] && [ -z "${NPM_COMMAND%%"$NVM_DIR"/*}" ] && return 0
|
||||
|
||||
local NPM_VERSION
|
||||
NPM_VERSION="$(npm --version)"
|
||||
NPM_VERSION="${NPM_VERSION:--1}"
|
||||
[ "${NPM_VERSION%%[!-0-9]*}" -gt 0 ] || return 0
|
||||
|
||||
local NPM_GLOBAL_MODULES
|
||||
NPM_GLOBAL_MODULES="$(
|
||||
npm list -g --depth=0 |
|
||||
command sed -e '/ npm@/d' -e '/ (empty)$/d'
|
||||
)"
|
||||
|
||||
local MODULE_COUNT
|
||||
MODULE_COUNT="$(
|
||||
command printf %s\\n "$NPM_GLOBAL_MODULES" |
|
||||
command sed -ne '1!p' | # Remove the first line
|
||||
wc -l | command tr -d ' ' # Count entries
|
||||
)"
|
||||
|
||||
if [ "${MODULE_COUNT}" != '0' ]; then
|
||||
# shellcheck disable=SC2016
|
||||
nvm_echo '=> You currently have modules installed globally with `npm`. These will no'
|
||||
# shellcheck disable=SC2016
|
||||
nvm_echo '=> longer be linked to the active version of Node when you install a new node'
|
||||
# shellcheck disable=SC2016
|
||||
nvm_echo '=> with `nvm`; and they may (depending on how you construct your `$PATH`)'
|
||||
# shellcheck disable=SC2016
|
||||
nvm_echo '=> override the binaries of modules installed with `nvm`:'
|
||||
nvm_echo
|
||||
|
||||
command printf %s\\n "$NPM_GLOBAL_MODULES"
|
||||
nvm_echo '=> If you wish to uninstall them at a later point (or re-install them under your'
|
||||
# shellcheck disable=SC2016
|
||||
nvm_echo '=> `nvm` Nodes), you can remove them from the system Node as follows:'
|
||||
nvm_echo
|
||||
nvm_echo ' $ nvm use system'
|
||||
nvm_echo ' $ npm uninstall -g a_module'
|
||||
nvm_echo
|
||||
fi
|
||||
}
|
||||
|
||||
nvm_do_install() {
|
||||
if [ -n "${NVM_DIR-}" ] && ! [ -d "${NVM_DIR}" ]; then
|
||||
if [ -e "${NVM_DIR}" ]; then
|
||||
nvm_echo >&2 "File \"${NVM_DIR}\" has the same name as installation directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${NVM_DIR}" = "$(nvm_default_install_dir)" ]; then
|
||||
mkdir "${NVM_DIR}"
|
||||
else
|
||||
nvm_echo >&2 "You have \$NVM_DIR set to \"${NVM_DIR}\", but that directory does not exist. Check your profile files and environment."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Disable the optional which check, https://www.shellcheck.net/wiki/SC2230
|
||||
# shellcheck disable=SC2230
|
||||
if nvm_has xcode-select && [ "$(xcode-select -p >/dev/null 2>/dev/null ; echo $?)" = '2' ] && [ "$(which git)" = '/usr/bin/git' ] && [ "$(which curl)" = '/usr/bin/curl' ]; then
|
||||
nvm_echo >&2 'You may be on a Mac, and need to install the Xcode Command Line Developer Tools.'
|
||||
# shellcheck disable=SC2016
|
||||
nvm_echo >&2 'If so, run `xcode-select --install` and try again. If not, please report this!'
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${METHOD}" ]; then
|
||||
# Autodetect install method
|
||||
if nvm_has git; then
|
||||
install_nvm_from_git
|
||||
elif nvm_has curl || nvm_has wget; then
|
||||
install_nvm_as_script
|
||||
else
|
||||
nvm_echo >&2 'You need git, curl, or wget to install nvm'
|
||||
exit 1
|
||||
fi
|
||||
elif [ "${METHOD}" = 'git' ]; then
|
||||
if ! nvm_has git; then
|
||||
nvm_echo >&2 "You need git to install nvm"
|
||||
exit 1
|
||||
fi
|
||||
install_nvm_from_git
|
||||
elif [ "${METHOD}" = 'script' ]; then
|
||||
if ! nvm_has curl && ! nvm_has wget; then
|
||||
nvm_echo >&2 "You need curl or wget to install nvm"
|
||||
exit 1
|
||||
fi
|
||||
install_nvm_as_script
|
||||
else
|
||||
nvm_echo >&2 "The environment variable \$METHOD is set to \"${METHOD}\", which is not recognized as a valid installation method."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nvm_echo
|
||||
|
||||
local NVM_PROFILE
|
||||
NVM_PROFILE="$(nvm_detect_profile)"
|
||||
local PROFILE_INSTALL_DIR
|
||||
PROFILE_INSTALL_DIR="$(nvm_install_dir | command sed "s:^$HOME:\$HOME:")"
|
||||
|
||||
SOURCE_STR="\\nexport NVM_DIR=\"${PROFILE_INSTALL_DIR}\"\\n[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" # This loads nvm\\n"
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
COMPLETION_STR='[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion\n'
|
||||
BASH_OR_ZSH=false
|
||||
|
||||
if [ -z "${NVM_PROFILE-}" ] ; then
|
||||
local TRIED_PROFILE
|
||||
if [ -n "${PROFILE}" ]; then
|
||||
TRIED_PROFILE="${NVM_PROFILE} (as defined in \$PROFILE), "
|
||||
fi
|
||||
nvm_echo "=> Profile not found. Tried ${TRIED_PROFILE-}~/.bashrc, ~/.bash_profile, ~/.zprofile, ~/.zshrc, and ~/.profile."
|
||||
nvm_echo "=> Create one of them and run this script again"
|
||||
nvm_echo " OR"
|
||||
nvm_echo "=> Append the following lines to the correct file yourself:"
|
||||
command printf "${SOURCE_STR}"
|
||||
nvm_echo
|
||||
else
|
||||
if nvm_profile_is_bash_or_zsh "${NVM_PROFILE-}"; then
|
||||
BASH_OR_ZSH=true
|
||||
fi
|
||||
if ! command grep -qc '/nvm.sh' "$NVM_PROFILE"; then
|
||||
nvm_echo "=> Appending nvm source string to $NVM_PROFILE"
|
||||
command printf "${SOURCE_STR}" >> "$NVM_PROFILE"
|
||||
else
|
||||
nvm_echo "=> nvm source string already in ${NVM_PROFILE}"
|
||||
fi
|
||||
# shellcheck disable=SC2016
|
||||
if ${BASH_OR_ZSH} && ! command grep -qc '$NVM_DIR/bash_completion' "$NVM_PROFILE"; then
|
||||
nvm_echo "=> Appending bash_completion source string to $NVM_PROFILE"
|
||||
command printf "$COMPLETION_STR" >> "$NVM_PROFILE"
|
||||
else
|
||||
nvm_echo "=> bash_completion source string already in ${NVM_PROFILE}"
|
||||
fi
|
||||
fi
|
||||
if ${BASH_OR_ZSH} && [ -z "${NVM_PROFILE-}" ] ; then
|
||||
nvm_echo "=> Please also append the following lines to the if you are using bash/zsh shell:"
|
||||
command printf "${COMPLETION_STR}"
|
||||
fi
|
||||
|
||||
# Source nvm
|
||||
# shellcheck source=/dev/null
|
||||
\. "$(nvm_install_dir)/nvm.sh"
|
||||
|
||||
nvm_check_global_modules
|
||||
|
||||
nvm_install_node
|
||||
|
||||
nvm_reset
|
||||
|
||||
nvm_echo "=> Close and reopen your terminal to start using nvm or run the following to use it now:"
|
||||
command printf "${SOURCE_STR}"
|
||||
if ${BASH_OR_ZSH} ; then
|
||||
command printf "${COMPLETION_STR}"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Unsets the various functions defined
|
||||
# during the execution of the install script
|
||||
#
|
||||
nvm_reset() {
|
||||
unset -f nvm_has nvm_install_dir nvm_latest_version nvm_profile_is_bash_or_zsh \
|
||||
nvm_source nvm_node_version nvm_download install_nvm_from_git nvm_install_node \
|
||||
install_nvm_as_script nvm_try_profile nvm_detect_profile nvm_check_global_modules \
|
||||
nvm_do_install nvm_reset nvm_default_install_dir nvm_grep
|
||||
}
|
||||
|
||||
[ "_$NVM_ENV" = "_testing" ] || nvm_do_install
|
||||
|
||||
} # this ensures the entire script is downloaded #
|
||||
@ -0,0 +1 @@
|
||||
../acorn/bin/acorn
|
||||
@ -0,0 +1 @@
|
||||
../ansi-html-community/bin/ansi-html
|
||||
@ -0,0 +1 @@
|
||||
../autoprefixer/bin/autoprefixer
|
||||
@ -0,0 +1 @@
|
||||
../baseline-browser-mapping/dist/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../browserslist/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../cssesc/bin/cssesc
|
||||
@ -0,0 +1 @@
|
||||
../flat/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../he/bin/he
|
||||
@ -0,0 +1 @@
|
||||
../cli-highlight/bin/highlight
|
||||
@ -0,0 +1 @@
|
||||
../html-minifier-terser/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../is-docker/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../json5/lib/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../mime/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../multicast-dns/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../nanoid/bin/nanoid.cjs
|
||||
@ -0,0 +1 @@
|
||||
../@nuxt/opencollective/bin/opencollective.js
|
||||
@ -0,0 +1 @@
|
||||
../opener/bin/opener-bin.js
|
||||
@ -0,0 +1 @@
|
||||
../@babel/parser/bin/babel-parser.js
|
||||
@ -0,0 +1 @@
|
||||
../prettier/bin-prettier.js
|
||||
@ -0,0 +1 @@
|
||||
../resolve/bin/resolve
|
||||
@ -0,0 +1 @@
|
||||
../rimraf/bin.js
|
||||
@ -0,0 +1 @@
|
||||
../semver/bin/semver.js
|
||||
@ -0,0 +1 @@
|
||||
../svgo/bin/svgo
|
||||
@ -0,0 +1 @@
|
||||
../terser/bin/terser
|
||||
@ -0,0 +1 @@
|
||||
../update-browserslist-db/cli.js
|
||||
@ -0,0 +1 @@
|
||||
../uuid/dist/bin/uuid
|
||||
@ -0,0 +1 @@
|
||||
../@vue/cli-service/bin/vue-cli-service.js
|
||||
@ -0,0 +1 @@
|
||||
../vue-demi/bin/vue-demi-fix.js
|
||||
@ -0,0 +1 @@
|
||||
../vue-demi/bin/vue-demi-switch.js
|
||||
@ -0,0 +1 @@
|
||||
../webpack/bin/webpack.js
|
||||
@ -0,0 +1 @@
|
||||
../webpack-bundle-analyzer/lib/bin/analyzer.js
|
||||
@ -0,0 +1 @@
|
||||
../webpack-dev-server/bin/webpack-dev-server.js
|
||||
@ -0,0 +1 @@
|
||||
../which/bin/which
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,136 @@
|
||||
// @ts-nocheck
|
||||
export {};
|
||||
|
||||
; declare global {
|
||||
const __VLS_directiveBindingRestFields: { instance: null, oldValue: null, modifiers: any, dir: any };
|
||||
const __VLS_unref: typeof import('vue').unref;
|
||||
const __VLS_placeholder: any;
|
||||
const __VLS_intrinsics: import('vue/jsx-runtime').JSX.IntrinsicElements;
|
||||
|
||||
type __VLS_Elements = __VLS_SpreadMerge<SVGElementTagNameMap, HTMLElementTagNameMap>;
|
||||
type __VLS_GlobalComponents = import('vue').GlobalComponents;
|
||||
type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
|
||||
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
|
||||
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
||||
type __VLS_SpreadMerge<A, B> = Omit<A, keyof B> & B;
|
||||
type __VLS_WithComponent<N0 extends string, LocalComponents, Self, N1 extends string, N2 extends string, N3 extends string> =
|
||||
N1 extends keyof LocalComponents ? { [K in N0]: LocalComponents[N1] } :
|
||||
N2 extends keyof LocalComponents ? { [K in N0]: LocalComponents[N2] } :
|
||||
N3 extends keyof LocalComponents ? { [K in N0]: LocalComponents[N3] } :
|
||||
Self extends object ? { [K in N0]: Self } :
|
||||
N1 extends keyof __VLS_GlobalComponents ? { [K in N0]: __VLS_GlobalComponents[N1] } :
|
||||
N2 extends keyof __VLS_GlobalComponents ? { [K in N0]: __VLS_GlobalComponents[N2] } :
|
||||
N3 extends keyof __VLS_GlobalComponents ? { [K in N0]: __VLS_GlobalComponents[N3] } :
|
||||
{};
|
||||
type __VLS_FunctionalComponentCtx<T, K> = __VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}>
|
||||
? K extends { __ctx?: infer Ctx } ? NonNullable<Ctx> : never : any
|
||||
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
|
||||
>;
|
||||
type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}>
|
||||
? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
|
||||
: T extends (props: infer P, ...args: any) => any ? P
|
||||
: {};
|
||||
type __VLS_FunctionalComponent<T> = (props: (T extends { $props: infer Props } ? Props : {}) & Record<string, unknown>, ctx?: any) => import('vue/jsx-runtime').JSX.Element & {
|
||||
__ctx?: {
|
||||
attrs?: any;
|
||||
slots?: T extends { $slots: infer Slots } ? Slots : Record<string, any>;
|
||||
emit?: T extends { $emit: infer Emit } ? Emit : {};
|
||||
props?: (T extends { $props: infer Props } ? Props : {}) & Record<string, unknown>;
|
||||
expose?: (exposed: T) => void;
|
||||
};
|
||||
};
|
||||
type __VLS_IsFunction<T, K> = K extends keyof T
|
||||
? __VLS_IsAny<T[K]> extends false
|
||||
? unknown extends T[K]
|
||||
? false
|
||||
: true
|
||||
: false
|
||||
: false;
|
||||
type __VLS_NormalizeComponentEvent<
|
||||
Props,
|
||||
Emits,
|
||||
onEvent extends keyof Props,
|
||||
Event extends keyof Emits,
|
||||
CamelizedEvent extends keyof Emits,
|
||||
> = __VLS_IsFunction<Props, onEvent> extends true
|
||||
? Props
|
||||
: __VLS_IsFunction<Emits, Event> extends true
|
||||
? { [K in onEvent]?: Emits[Event] }
|
||||
: __VLS_IsFunction<Emits, CamelizedEvent> extends true
|
||||
? { [K in onEvent]?: Emits[CamelizedEvent] }
|
||||
: Props;
|
||||
// fix https://github.com/vuejs/language-tools/issues/926
|
||||
type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
|
||||
type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R
|
||||
? U extends T
|
||||
? never
|
||||
: __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R)
|
||||
: never;
|
||||
type __VLS_OverloadUnion<T> = Exclude<
|
||||
__VLS_OverloadUnionInner<(() => never) & T>,
|
||||
T extends () => never ? never : () => never
|
||||
>;
|
||||
type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F
|
||||
? F extends (event: infer E, ...args: infer A) => any
|
||||
? { [K in E & string]: (...args: A) => void; }
|
||||
: never
|
||||
: never;
|
||||
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<
|
||||
__VLS_UnionToIntersection<
|
||||
__VLS_ConstructorOverloads<T> & {
|
||||
[K in keyof T]: T[K] extends any[] ? { (...args: T[K]): void } : never
|
||||
}
|
||||
>
|
||||
>;
|
||||
type __VLS_EmitsToProps<T> = __VLS_PrettifyGlobal<{
|
||||
[K in string & keyof T as `on${Capitalize<K>}`]?:
|
||||
(...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : never) => any;
|
||||
}>;
|
||||
type __VLS_ResolveEmits<
|
||||
Comp,
|
||||
Emits,
|
||||
TypeEmits = Comp extends { __typeEmits?: infer T } ? unknown extends T ? {} : import('vue').ShortEmitsToObject<T> : {},
|
||||
NormalizedEmits = __VLS_NormalizeEmits<Emits> extends infer E ? string extends keyof E ? {} : E : never,
|
||||
> = __VLS_SpreadMerge<NormalizedEmits, TypeEmits>;
|
||||
type __VLS_ResolveDirectives<T> = {
|
||||
[K in keyof T & string as `v${Capitalize<K>}`]: T[K];
|
||||
};
|
||||
type __VLS_PrettifyGlobal<T> = { [K in keyof T as K]: T[K]; } & {};
|
||||
type __VLS_WithDefaultsGlobal<P, D> = {
|
||||
[K in keyof P as K extends keyof D ? K : never]-?: P[K];
|
||||
} & {
|
||||
[K in keyof P as K extends keyof D ? never : K]: P[K];
|
||||
};
|
||||
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
|
||||
type __VLS_ProxyRefs<T> = import('vue').ShallowUnwrapRef<T>;
|
||||
|
||||
function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
|
||||
item: T extends number ? number
|
||||
: T extends string ? string
|
||||
: T extends any[] ? T[number]
|
||||
: T extends Iterable<infer T1> ? T1
|
||||
: any,
|
||||
index: number,
|
||||
][];
|
||||
function __VLS_getVForSourceType<T>(source: T): [
|
||||
item: T[keyof T],
|
||||
key: keyof T,
|
||||
index: number,
|
||||
][];
|
||||
function __VLS_getSlotParameters<S, D extends S>(slot: S, decl?: D):
|
||||
D extends (...args: infer P) => any ? P : any[];
|
||||
function __VLS_asFunctionalDirective<T>(dir: T): T extends import('vue').ObjectDirective
|
||||
? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>
|
||||
: T extends (...args: any) => any
|
||||
? T
|
||||
: (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
|
||||
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
|
||||
T extends new (...args: any) => any ? __VLS_FunctionalComponent<K>
|
||||
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
|
||||
: T extends (...args: any) => any ? T
|
||||
: __VLS_FunctionalComponent<{}>;
|
||||
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
|
||||
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (attrs: T & Record<string, unknown>) => void;
|
||||
function __VLS_asFunctionalSlot<S>(slot: S): S extends () => infer R ? (props: {}) => R : NonNullable<S>;
|
||||
function __VLS_tryAsConstant<const T>(t: T): T;
|
||||
}
|
||||
@ -0,0 +1,758 @@
|
||||
# @achrinza/node-ipc
|
||||
|
||||
> **NOTE:** This is a maintenance fork of `node-ipc` This is intended for
|
||||
> packages that directly or indirectly depend on `node-ipc` where maintainers
|
||||
> need a drop-in replacement.
|
||||
>
|
||||
> See https://github.com/achrinza/node-ipc/issues/1 for more details.
|
||||
|
||||
[](code_of_conduct.md)
|
||||
[](https://coveralls.io/github/achrinza/node-ipc?branch=main)
|
||||
|
||||
_a nodejs module for local and remote Inter Process Communication_ with full support for Linux, Mac and Windows. It also supports all forms of socket communication from low level unix and windows sockets to UDP and secure TLS and TCP sockets.
|
||||
|
||||
A great solution for complex multiprocess **Neural Networking** in Node.JS
|
||||
|
||||
**npm install @achrinza/node-ipc**
|
||||
|
||||
#### Older versions of node
|
||||
|
||||
the latest versions of `@achrinza/node-ipc` may work with the --harmony flag. Officially though, we support node v4 and newer with es5 and es6
|
||||
|
||||
#### Testing
|
||||
|
||||
`npm test` will run the jasmine tests with istanbul for @achrinza/node-ipc and generate a coverage report in the spec folder.
|
||||
|
||||
You may want to install jasmine and istanbul globally with `sudo npm install -g jasmine istanbul`
|
||||
|
||||
---
|
||||
|
||||
#### Contents
|
||||
|
||||
1. [Types of IPC Sockets and Supporting OS](#types-of-ipc-sockets)
|
||||
1. [IPC Config](#ipc-config)
|
||||
1. [IPC Methods](#ipc-methods)
|
||||
1. [log](#log)
|
||||
2. [connectTo](#connectto)
|
||||
3. [connectToNet](#connecttonet)
|
||||
4. [disconnect](#disconnect)
|
||||
5. [serve](#serve)
|
||||
6. [serveNet](#servenet)
|
||||
1. [IPC Stores and Default Variables](#ipc-stores-and-default-variables)
|
||||
1. [IPC Events](#ipc-events)
|
||||
1. [Multiple IPC instances](#multiple-ipc-instances)
|
||||
1. [Basic Examples](#basic-examples)
|
||||
1. [Server for Unix||Windows Sockets & TCP Sockets](#server-for-unix-sockets-windows-sockets--tcp-sockets)
|
||||
2. [Client for Unix||Windows Sockets & TCP Sockets](#client-for-unix-sockets--tcp-sockets)
|
||||
3. [Server & Client for UDP Sockets](#server--client-for-udp-sockets)
|
||||
4. [Raw Buffers, Real Time and / or Binary Sockets](#raw-buffer-or-binary-sockets)
|
||||
1. [Working with TLS/SSL Socket Servers & Clients](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example/TLSSocket)
|
||||
1. [Node Code Examples](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example)
|
||||
|
||||
---
|
||||
|
||||
#### Types of IPC Sockets
|
||||
|
||||
| Type | Stability | Definition |
|
||||
| ----------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Unix Socket or Windows Socket | Stable | Gives Linux, Mac, and Windows lightning fast communication and avoids the network card to reduce overhead and latency. [Local Unix and Windows Socket examples ](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example/unixWindowsSocket/ "Unix and Windows Socket Node IPC examples") |
|
||||
| TCP Socket | Stable | Gives the most reliable communication across the network. Can be used for local IPC as well, but is slower than #1's Unix Socket Implementation because TCP sockets go through the network card while Unix Sockets and Windows Sockets do not. [Local or remote network TCP Socket examples ](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example/TCPSocket/ "TCP Socket Node IPC examples") |
|
||||
| TLS Socket | Stable | Configurable and secure network socket over SSL. Equivalent to https. [TLS/SSL documentation](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example/TLSSocket) |
|
||||
| UDP Sockets | Stable | Gives the **fastest network communication**. UDP is less reliable but much faster than TCP. It is best used for streaming non critical data like sound, video, or multiplayer game data as it can drop packets depending on network connectivity and other factors. UDP can be used for local IPC as well, but is slower than #1's Unix Socket or Windows Socket Implementation because UDP sockets go through the network card while Unix and Windows Sockets do not. [Local or remote network UDP Socket examples ](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example/UDPSocket/ "UDP Socket Node IPC examples") |
|
||||
|
||||
| OS | Supported Sockets |
|
||||
| ----- | -------------------------- |
|
||||
| Linux | Unix, Posix, TCP, TLS, UDP |
|
||||
| Mac | Unix, Posix, TCP, TLS, UDP |
|
||||
| Win | Windows, TCP, TLS, UDP |
|
||||
|
||||
---
|
||||
|
||||
#### IPC Config
|
||||
|
||||
`ipc.config`
|
||||
|
||||
Set these variables in the `ipc.config` scope to overwrite or set default values.
|
||||
|
||||
```javascript
|
||||
|
||||
{
|
||||
appspace : 'app.',
|
||||
socketRoot : '/tmp/',
|
||||
id : os.hostname(),
|
||||
networkHost : 'localhost', //should resolve to 127.0.0.1 or ::1 see the table below related to this
|
||||
networkPort : 8000,
|
||||
readableAll : false,
|
||||
writableAll : false,
|
||||
encoding : 'utf8',
|
||||
rawBuffer : false,
|
||||
delimiter : '\f',
|
||||
sync : false,
|
||||
silent : false,
|
||||
logInColor : true,
|
||||
logDepth : 5,
|
||||
logger : console.log,
|
||||
maxConnections : 100,
|
||||
retry : 500,
|
||||
maxRetries : false,
|
||||
stopRetrying : false,
|
||||
unlink : true,
|
||||
interfaces : {
|
||||
localAddress: false,
|
||||
localPort : false,
|
||||
family : false,
|
||||
hints : false,
|
||||
lookup : false
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
| variable | documentation |
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| appspace | used for Unix Socket (Unix Domain Socket) namespacing. If not set specifically, the Unix Domain Socket will combine the socketRoot, appspace, and id to form the Unix Socket Path for creation or binding. This is available in case you have many apps running on your system, you may have several sockets with the same id, but if you change the appspace, you will still have app specic unique sockets. |
|
||||
| socketRoot | the directory in which to create or bind to a Unix Socket |
|
||||
| id | the id of this socket or service |
|
||||
| networkHost | the local or remote host on which TCP, TLS or UDP Sockets should connect |
|
||||
| networkPort | the default port on which TCP, TLS, or UDP sockets should connect |
|
||||
| readableAll | makes the pipe readable for all users including windows services |
|
||||
| writableAll | makes the pipe writable for all users including windows services |
|
||||
| encoding | the default encoding for data sent on sockets. Mostly used if rawBuffer is set to true. Valid values are : ` ascii` `utf8` ` utf16le` ` ucs2` ` base64` `hex` . |
|
||||
| rawBuffer | if true, data will be sent and received as a raw node `Buffer` **NOT** an `Object` as JSON. This is great for Binary or hex IPC, and communicating with other processes in languages like C and C++ |
|
||||
| delimiter | the delimiter at the end of each data packet. |
|
||||
| sync | synchronous requests. Clients will not send new requests until the server answers. |
|
||||
| silent | turn on/off logging default is false which means logging is on |
|
||||
| logInColor | turn on/off util.inspect colors for ipc.log |
|
||||
| logDepth | set the depth for util.inspect during ipc.log |
|
||||
| logger | the function which receives the output from ipc.log; should take a single string argument |
|
||||
| maxConnections | this is the max number of connections allowed to a socket. It is currently only being set on Unix Sockets. Other Socket types are using the system defaults. |
|
||||
| retry | this is the time in milliseconds a client will wait before trying to reconnect to a server if the connection is lost. This does not effect UDP sockets since they do not have a client server relationship like Unix Sockets and TCP Sockets. |
|
||||
| maxRetries | if set, it represents the maximum number of retries after each disconnect before giving up and completely killing a specific connection |
|
||||
| stopRetrying | Defaults to false meaning clients will continue to retry to connect to servers indefinitely at the retry interval. If set to any number the client will stop retrying when that number is exceeded after each disconnect. If set to true in real time it will immediately stop trying to connect regardless of maxRetries. If set to 0, the client will **_NOT_** try to reconnect. |
|
||||
| unlink | Defaults to true meaning that the module will take care of deleting the IPC socket prior to startup. If you use `@achrinza/node-ipc` in a clustered environment where there will be multiple listeners on the same socket, you must set this to `false` and then take care of deleting the socket in your own code. |
|
||||
| interfaces | primarily used when specifying which interface a client should connect through. see the [socket.connect documentation in the node.js api](https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener) |
|
||||
|
||||
---
|
||||
|
||||
#### IPC Methods
|
||||
|
||||
These methods are available in the IPC Scope.
|
||||
|
||||
---
|
||||
|
||||
##### log
|
||||
|
||||
`ipc.log(a,b,c,d,e...);`
|
||||
|
||||
ipc.log will accept any number of arguments and if `ipc.config.silent` is not set, it will concat them all with a single space ' ' between them and then log them to the console. This is fast because it prevents any concatenation from happening if the ipc.config.silent is set `true`. That way if you leave your logging in place it should have almost no effect on performance.
|
||||
|
||||
The log also uses util.inspect You can control if it should log in color, the log depth, and the destination via `ipc.config`
|
||||
|
||||
```javascript
|
||||
ipc.config.logInColor = true; //default
|
||||
ipc.config.logDepth = 5; //default
|
||||
ipc.config.logger = console.log.bind(console); // default
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
##### connectTo
|
||||
|
||||
`ipc.connectTo(id,path,callback);`
|
||||
|
||||
Used for connecting as a client to local Unix Sockets and Windows Sockets. **_This is the fastest way for processes on the same machine to communicate_** because it bypasses the network card which TCP and UDP must both use.
|
||||
|
||||
| variable | required | definition |
|
||||
| -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| id | required | is the string id of the socket being connected to. The socket with this id is added to the ipc.of object when created. |
|
||||
| path | optional | is the path of the Unix Domain Socket File, if the System is Windows, this will automatically be converted to an appropriate pipe with the same information as the Unix Domain Socket File. If not set this will default to `ipc.config.socketRoot`+`ipc.config.appspace`+`id` |
|
||||
| callback | optional | this is the function to execute when the socket has been created. |
|
||||
|
||||
**examples** arguments can be ommitted so long as they are still in order.
|
||||
|
||||
```javascript
|
||||
ipc.connectTo("world");
|
||||
```
|
||||
|
||||
or using just an id and a callback
|
||||
|
||||
```javascript
|
||||
ipc.connectTo("world", function () {
|
||||
ipc.of.world.on("hello", function (data) {
|
||||
ipc.log(data.debug);
|
||||
//if data was a string, it would have the color set to the debug style applied to it
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
or explicitly setting the path
|
||||
|
||||
```javascript
|
||||
ipc.connectTo("world", "myapp.world");
|
||||
```
|
||||
|
||||
or explicitly setting the path with callback
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.connectTo(
|
||||
'world',
|
||||
'myapp.world',
|
||||
function(){
|
||||
...
|
||||
}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
##### connectToNet
|
||||
|
||||
`ipc.connectToNet(id,host,port,callback)`
|
||||
|
||||
Used to connect as a client to a TCP or [TLS socket](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example/TLSSocket) via the network card. This can be local or remote, if local, it is recommended that you use the Unix and Windows Socket Implementaion of `connectTo` instead as it is much faster since it avoids the network card altogether.
|
||||
|
||||
For TLS and SSL Sockets see the [@achrinza/node-ipc TLS and SSL docs](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example/TLSSocket). They have a few additional requirements, and things to know about and so have their own doc.
|
||||
|
||||
| variable | required | definition |
|
||||
| -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| id | required | is the string id of the socket being connected to. For TCP & TLS sockets, this id is added to the `ipc.of` object when the socket is created with a reference to the socket. |
|
||||
| host | optional | is the host on which the TCP or TLS socket resides. This will default to `ipc.config.networkHost` if not specified. |
|
||||
| port | optional | the port on which the TCP or TLS socket resides. |
|
||||
| callback | optional | this is the function to execute when the socket has been created. |
|
||||
|
||||
**examples** arguments can be ommitted so long as they are still in order.
|
||||
So while the default is : (id,host,port,callback), the following examples will still work because they are still in order (id,port,callback) or (id,host,callback) or (id,port) etc.
|
||||
|
||||
```javascript
|
||||
ipc.connectToNet("world");
|
||||
```
|
||||
|
||||
or using just an id and a callback
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.connectToNet(
|
||||
'world',
|
||||
function(){
|
||||
...
|
||||
}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
or explicitly setting the host and path
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.connectToNet(
|
||||
'world',
|
||||
'myapp.com',serve(path,callback)
|
||||
3435
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
or only explicitly setting port and callback
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.connectToNet(
|
||||
'world',
|
||||
3435,
|
||||
function(){
|
||||
...
|
||||
}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
##### disconnect
|
||||
|
||||
`ipc.disconnect(id)`
|
||||
|
||||
Used to disconnect a client from a Unix, Windows, TCP or TLS socket. The socket and its refrence will be removed from memory and the `ipc.of` scope. This can be local or remote. UDP clients do not maintain connections and so there are no Clients and this method has no value to them.
|
||||
|
||||
| variable | required | definition |
|
||||
| -------- | -------- | -------------------------------------------------------- |
|
||||
| id | required | is the string id of the socket from which to disconnect. |
|
||||
|
||||
**examples**
|
||||
|
||||
```javascript
|
||||
ipc.disconnect("world");
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
##### serve
|
||||
|
||||
`ipc.serve(path,callback);`
|
||||
|
||||
Used to create local Unix Socket Server or Windows Socket Server to which Clients can bind. The server can `emit` events to specific Client Sockets, or `broadcast` events to all known Client Sockets.
|
||||
|
||||
| variable | required | definition |
|
||||
| -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| path | optional | This is the path of the Unix Domain Socket File, if the System is Windows, this will automatically be converted to an appropriate pipe with the same information as the Unix Domain Socket File. If not set this will default to `ipc.config.socketRoot`+`ipc.config.appspace`+`id` |
|
||||
| callback | optional | This is a function to be called after the Server has started. This can also be done by binding an event to the start event like `ipc.server.on('start',function(){});` |
|
||||
|
||||
**_examples_** arguments can be omitted so long as they are still in order.
|
||||
|
||||
```javascript
|
||||
ipc.serve();
|
||||
```
|
||||
|
||||
or specifying callback
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.serve(
|
||||
function(){...}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
or specify path
|
||||
|
||||
```javascript
|
||||
ipc.serve("/tmp/myapp.myservice");
|
||||
```
|
||||
|
||||
or specifying everything
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.serve(
|
||||
'/tmp/myapp.myservice',
|
||||
function(){...}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
##### serveNet
|
||||
|
||||
`serveNet(host,port,UDPType,callback)`
|
||||
|
||||
Used to create TCP, TLS or UDP Socket Server to which Clients can bind or other servers can send data to. The server can `emit` events to specific Client Sockets, or `broadcast` events to all known Client Sockets.
|
||||
|
||||
| variable | required | definition |
|
||||
| -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| host | optional | If not specified this defaults to the first address in os.networkInterfaces(). For TCP, TLS & UDP servers this is most likely going to be 127.0.0.1 or ::1 |
|
||||
| port | optional | The port on which the TCP, UDP, or TLS Socket server will be bound, this defaults to 8000 if not specified |
|
||||
| UDPType | optional | If set this will create the server as a UDP socket. 'udp4' or 'udp6' are valid values. This defaults to not being set. When using udp6 make sure to specify a valid IPv6 host, like `::1` |
|
||||
| callback | optional | Function to be called when the server is created |
|
||||
|
||||
**_examples_** arguments can be ommitted solong as they are still in order.
|
||||
|
||||
default tcp server
|
||||
|
||||
```javascript
|
||||
ipc.serveNet();
|
||||
```
|
||||
|
||||
default udp server
|
||||
|
||||
```javascript
|
||||
ipc.serveNet("udp4");
|
||||
```
|
||||
|
||||
or specifying TCP server with callback
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.serveNet(
|
||||
function(){...}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
or specifying UDP server with callback
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.serveNet(
|
||||
'udp4',
|
||||
function(){...}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
or specify port
|
||||
|
||||
```javascript
|
||||
ipc.serveNet(3435);
|
||||
```
|
||||
|
||||
or specifying everything TCP
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.serveNet(
|
||||
'MyMostAwesomeApp.com',
|
||||
3435,
|
||||
function(){...}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
or specifying everything UDP
|
||||
|
||||
```javascript
|
||||
|
||||
ipc.serveNet(
|
||||
'MyMostAwesomeApp.com',
|
||||
3435,
|
||||
'udp4',
|
||||
function(){...}
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### IPC Stores and Default Variables
|
||||
|
||||
| variable | definition |
|
||||
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ipc.of | This is where socket connection refrences will be stored when connecting to them as a client via the `ipc.connectTo` or `iupc.connectToNet`. They will be stored based on the ID used to create them, eg : ipc.of.mySocket |
|
||||
| ipc.server | This is a refrence to the server created by `ipc.serve` or `ipc.serveNet` |
|
||||
|
||||
---
|
||||
|
||||
### IPC Server Methods
|
||||
|
||||
| method | definition |
|
||||
| ------ | --------------------------------------------------------------------------- |
|
||||
| start | start serving need to call `serve` or `serveNet` first to set up the server |
|
||||
| stop | close the server and stop serving |
|
||||
|
||||
---
|
||||
|
||||
### IPC Events
|
||||
|
||||
| event name | params | definition |
|
||||
| --------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| error | err obj | triggered when an error has occured |
|
||||
| connect | | triggered when socket connected |
|
||||
| disconnect | | triggered by client when socket has disconnected from server |
|
||||
| socket.disconnected | socket destroyedSocketID | triggered by server when a client socket has disconnected |
|
||||
| destroy | | triggered when socket has been totally destroyed, no further auto retries will happen and all references are gone. |
|
||||
| data | buffer | triggered when ipc.config.rawBuffer is true and a message is received. |
|
||||
| **_your event type_** | **_your event data_** | triggered when a JSON message is received. The event name will be the type string from your message and the param will be the data object from your message eg : `{ type:'myEvent',data:{a:1}}` |
|
||||
|
||||
### Multiple IPC Instances
|
||||
|
||||
Sometimes you might need explicit and independent instances of @achrinza/node-ipc. Just for such scenarios we have exposed the core IPC class on the IPC singleton.
|
||||
|
||||
```javascript
|
||||
const RawIPC = require("@achrinza/node-ipc").IPC;
|
||||
const ipc = new RawIPC();
|
||||
const someOtherExplicitIPC = new RawIPC();
|
||||
|
||||
//OR
|
||||
|
||||
const ipc = require("@achrinza/node-ipc");
|
||||
const someOtherExplicitIPC = new ipc.IPC();
|
||||
|
||||
//setting explicit configs
|
||||
|
||||
//keep one silent and the other verbose
|
||||
ipc.config.silent = true;
|
||||
someOtherExplicitIPC.config.silent = true;
|
||||
|
||||
//make one a raw binary and the other json based ipc
|
||||
ipc.config.rawBuffer = false;
|
||||
|
||||
someOtherExplicitIPC.config.rawBuffer = true;
|
||||
someOtherExplicitIPC.config.encoding = "hex";
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Basic Examples
|
||||
|
||||
You can find [Advanced Examples](https://github.com/RIAEvangelist/@achrinza/node-ipc/tree/master/example) in the examples folder. In the examples you will find more complex demos including multi client examples.
|
||||
|
||||
#### Server for Unix Sockets, Windows Sockets & TCP Sockets
|
||||
|
||||
The server is the process keeping a socket for IPC open. Multiple sockets can connect to this server and talk to it. It can also broadcast to all clients or emit to a specific client. This is the most basic example which will work for local Unix and Windows Sockets as well as local or remote network TCP Sockets.
|
||||
|
||||
```javascript
|
||||
var ipc = require("@achrinza/node-ipc");
|
||||
|
||||
ipc.config.id = "world";
|
||||
ipc.config.retry = 1500;
|
||||
|
||||
ipc.serve(function () {
|
||||
ipc.server.on("message", function (data, socket) {
|
||||
ipc.log("got a message : ".debug, data);
|
||||
ipc.server.emit(
|
||||
socket,
|
||||
"message", //this can be anything you want so long as
|
||||
//your client knows.
|
||||
data + " world!"
|
||||
);
|
||||
});
|
||||
ipc.server.on("socket.disconnected", function (socket, destroyedSocketID) {
|
||||
ipc.log("client " + destroyedSocketID + " has disconnected!");
|
||||
});
|
||||
});
|
||||
|
||||
ipc.server.start();
|
||||
```
|
||||
|
||||
#### Client for Unix Sockets & TCP Sockets
|
||||
|
||||
The client connects to the servers socket for Inter Process Communication. The socket will receive events emitted to it specifically as well as events which are broadcast out on the socket by the server. This is the most basic example which will work for both local Unix Sockets and local or remote network TCP Sockets.
|
||||
|
||||
```javascript
|
||||
var ipc = require("@achrinza/node-ipc");
|
||||
|
||||
ipc.config.id = "hello";
|
||||
ipc.config.retry = 1500;
|
||||
|
||||
ipc.connectTo("world", function () {
|
||||
ipc.of.world.on("connect", function () {
|
||||
ipc.log("## connected to world ##".rainbow, ipc.config.delay);
|
||||
ipc.of.world.emit(
|
||||
"message", //any event or message type your server listens for
|
||||
"hello"
|
||||
);
|
||||
});
|
||||
ipc.of.world.on("disconnect", function () {
|
||||
ipc.log("disconnected from world".notice);
|
||||
});
|
||||
ipc.of.world.on(
|
||||
"message", //any event or message type your server listens for
|
||||
function (data) {
|
||||
ipc.log("got a message from world : ".debug, data);
|
||||
}
|
||||
);
|
||||
});
|
||||
```
|
||||
|
||||
#### Server & Client for UDP Sockets
|
||||
|
||||
UDP Sockets are different than Unix, Windows & TCP Sockets because they must be bound to a unique port on their machine to receive messages. For example, A TCP, Unix, or Windows Socket client could just connect to a separate TCP, Unix, or Windows Socket sever. That client could then exchange, both send and receive, data on the servers port or location. UDP Sockets can not do this. They must bind to a port to receive or send data.
|
||||
|
||||
This means a UDP Client and Server are the same thing because in order to receive data, a UDP Socket must have its own port to receive data on, and only one process can use this port at a time. It also means that in order to `emit` or `broadcast` data the UDP server will need to know the host and port of the Socket it intends to broadcast the data to.
|
||||
|
||||
This is the most basic example which will work for both local and remote UDP Sockets.
|
||||
|
||||
##### UDP Server 1 - "World"
|
||||
|
||||
```javascript
|
||||
var ipc = require("../../../@achrinza/node-ipc");
|
||||
|
||||
ipc.config.id = "world";
|
||||
ipc.config.retry = 1500;
|
||||
|
||||
ipc.serveNet("udp4", function () {
|
||||
console.log(123);
|
||||
ipc.server.on("message", function (data, socket) {
|
||||
ipc.log(
|
||||
"got a message from ".debug,
|
||||
data.from.variable,
|
||||
" : ".debug,
|
||||
data.message.variable
|
||||
);
|
||||
ipc.server.emit(socket, "message", {
|
||||
from: ipc.config.id,
|
||||
message: data.message + " world!",
|
||||
});
|
||||
});
|
||||
|
||||
console.log(ipc.server);
|
||||
});
|
||||
|
||||
ipc.server.start();
|
||||
```
|
||||
|
||||
##### UDP Server 2 - "Hello"
|
||||
|
||||
_note_ we set the port here to 8001 because the world server is already using the default ipc.config.networkPort of 8000. So we can not bind to 8000 while world is using it.
|
||||
|
||||
```javascript
|
||||
ipc.config.id = "hello";
|
||||
ipc.config.retry = 1500;
|
||||
|
||||
ipc.serveNet(8001, "udp4", function () {
|
||||
ipc.server.on("message", function (data) {
|
||||
ipc.log("got Data");
|
||||
ipc.log(
|
||||
"got a message from ".debug,
|
||||
data.from.variable,
|
||||
" : ".debug,
|
||||
data.message.variable
|
||||
);
|
||||
});
|
||||
ipc.server.emit(
|
||||
{
|
||||
address: "127.0.0.1", //any hostname will work
|
||||
port: ipc.config.networkPort,
|
||||
},
|
||||
"message",
|
||||
{
|
||||
from: ipc.config.id,
|
||||
message: "Hello",
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
ipc.server.start();
|
||||
```
|
||||
|
||||
#### Raw Buffer or Binary Sockets
|
||||
|
||||
Binary or Buffer sockets can be used with any of the above socket types, however the way data events are emit is **_slightly_** different. These may come in handy if working with embedded systems or C / C++ processes. You can even make sure to match C or C++ string typing.
|
||||
|
||||
When setting up a rawBuffer socket you must specify it as such :
|
||||
|
||||
```javascript
|
||||
ipc.config.rawBuffer = true;
|
||||
```
|
||||
|
||||
You can also specify its encoding type. The default is `utf8`
|
||||
|
||||
```javascript
|
||||
ipc.config.encoding = "utf8";
|
||||
```
|
||||
|
||||
emit string buffer :
|
||||
|
||||
```javascript
|
||||
//server
|
||||
ipc.server.emit(socket, "hello");
|
||||
|
||||
//client
|
||||
ipc.of.world.emit("hello");
|
||||
```
|
||||
|
||||
emit byte array buffer :
|
||||
|
||||
```javascript
|
||||
//hex encoding may work best for this.
|
||||
ipc.config.encoding = "hex";
|
||||
|
||||
//server
|
||||
ipc.server.emit(socket, [10, 20, 30]);
|
||||
|
||||
//client
|
||||
ipc.server.emit([10, 20, 30]);
|
||||
```
|
||||
|
||||
emit binary or hex array buffer, this is best for real time data transfer, especially whan connecting to C or C++ processes, or embedded systems :
|
||||
|
||||
```javascript
|
||||
ipc.config.encoding = "hex";
|
||||
|
||||
//server
|
||||
ipc.server.emit(socket, [0x05, 0x6d, 0x5c]);
|
||||
|
||||
//client
|
||||
ipc.server.emit([0x05, 0x6d, 0x5c]);
|
||||
```
|
||||
|
||||
Writing explicit buffers, int types, doubles, floats etc. as well as big endian and little endian data to raw buffer nostly valuable when connecting to C or C++ processes, or embedded systems (see more detailed info on buffers as well as UInt, Int, double etc. here)[https://nodejs.org/api/buffer.html]:
|
||||
|
||||
```javascript
|
||||
ipc.config.encoding = "hex";
|
||||
|
||||
//make a 6 byte buffer for example
|
||||
const myBuffer = Buffer.alloc(6).fill(0);
|
||||
|
||||
//fill the first 2 bytes with a 16 bit (2 byte) short unsigned int
|
||||
|
||||
//write a UInt16 (2 byte or short) as Big Endian
|
||||
myBuffer.writeUInt16BE(
|
||||
2, //value to write
|
||||
0 //offset in bytes
|
||||
);
|
||||
//OR
|
||||
myBuffer.writeUInt16LE(0x2, 0);
|
||||
//OR
|
||||
myBuffer.writeUInt16LE(0x02, 0);
|
||||
|
||||
//fill the remaining 4 bytes with a 32 bit (4 byte) long unsigned int
|
||||
|
||||
//write a UInt32 (4 byte or long) as Big Endian
|
||||
myBuffer.writeUInt32BE(
|
||||
16772812, //value to write
|
||||
2 //offset in bytes
|
||||
);
|
||||
//OR
|
||||
myBuffer.writeUInt32BE(0xffeecc, 0);
|
||||
|
||||
//server
|
||||
ipc.server.emit(socket, myBuffer);
|
||||
|
||||
//client
|
||||
ipc.server.emit(myBuffer);
|
||||
```
|
||||
|
||||
#### Server with the `cluster` Module
|
||||
|
||||
`@achrinza/node-ipc` can be used with Node.js' [cluster module](https://nodejs.org/api/cluster.html) to provide the ability to have multiple readers for a single socket. Doing so simply requires you to set the `unlink` property in the config to `false` and take care of unlinking the socket path in the master process:
|
||||
|
||||
##### Server
|
||||
|
||||
```javascript
|
||||
const fs = require("fs");
|
||||
const ipc = require("../../../@achrinza/node-ipc");
|
||||
const cpuCount = require("os").cpus().length;
|
||||
const cluster = require("cluster");
|
||||
const socketPath = "/tmp/ipc.sock";
|
||||
|
||||
ipc.config.unlink = false;
|
||||
|
||||
if (cluster.isMaster) {
|
||||
if (fs.existsSync(socketPath)) {
|
||||
fs.unlinkSync(socketPath);
|
||||
}
|
||||
|
||||
for (let i = 0; i < cpuCount; i++) {
|
||||
cluster.fork();
|
||||
}
|
||||
} else {
|
||||
ipc.serve(socketPath, function () {
|
||||
ipc.server.on("currentDate", function (data, socket) {
|
||||
console.log(`pid ${process.pid} got: `, data);
|
||||
});
|
||||
});
|
||||
|
||||
ipc.server.start();
|
||||
console.log(`pid ${process.pid} listening on ${socketPath}`);
|
||||
}
|
||||
```
|
||||
|
||||
##### Client
|
||||
|
||||
```javascript
|
||||
const fs = require("fs");
|
||||
const ipc = require("../../@achrinza/node-ipc");
|
||||
|
||||
const socketPath = "/tmp/ipc.sock";
|
||||
|
||||
//loop forever so you can see the pid of the cluster sever change in the logs
|
||||
setInterval(function () {
|
||||
ipc.connectTo("world", socketPath, connecting);
|
||||
}, 2000);
|
||||
|
||||
function connecting(socket) {
|
||||
ipc.of.world.on("connect", function () {
|
||||
ipc.of.world.emit("currentDate", {
|
||||
message: new Date().toISOString(),
|
||||
});
|
||||
ipc.disconnect("world");
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
#### Licensed under MIT license
|
||||
|
||||
See the [MIT license](https://github.com/RIAEvangelist/@achrinza/node-ipc/blob/master/license) file.
|
||||
@ -0,0 +1,256 @@
|
||||
'use strict';
|
||||
|
||||
const net = require('net'),
|
||||
tls = require('tls'),
|
||||
EventParser = require('../entities/EventParser.js'),
|
||||
Message = require('js-message'),
|
||||
fs = require('fs'),
|
||||
Queue = require('@node-ipc/js-queue'),
|
||||
Events = require('event-pubsub');
|
||||
|
||||
let eventParser = new EventParser();
|
||||
|
||||
class Client extends Events{
|
||||
constructor(config,log){
|
||||
super();
|
||||
Object.assign(
|
||||
this,
|
||||
{
|
||||
Client : Client,
|
||||
config : config,
|
||||
queue : new Queue,
|
||||
socket : false,
|
||||
connect : connect,
|
||||
emit : emit,
|
||||
log : log,
|
||||
retriesRemaining:config.maxRetries||0,
|
||||
explicitlyDisconnected: false
|
||||
}
|
||||
);
|
||||
|
||||
eventParser=new EventParser(this.config);
|
||||
}
|
||||
}
|
||||
|
||||
function emit(type,data){
|
||||
this.log('dispatching event to ', this.id, this.path, ' : ', type, ',', data);
|
||||
|
||||
let message=new Message;
|
||||
message.type=type;
|
||||
message.data=data;
|
||||
|
||||
if(this.config.rawBuffer){
|
||||
message=Buffer.from(type,this.config.encoding);
|
||||
}else{
|
||||
message=eventParser.format(message);
|
||||
}
|
||||
|
||||
if(!this.config.sync){
|
||||
this.socket.write(message);
|
||||
return;
|
||||
}
|
||||
|
||||
this.queue.add(
|
||||
syncEmit.bind(this,message)
|
||||
);
|
||||
}
|
||||
|
||||
function syncEmit(message){
|
||||
this.log('dispatching event to ', this.id, this.path, ' : ', message);
|
||||
this.socket.write(message);
|
||||
}
|
||||
|
||||
function connect(){
|
||||
//init client object for scope persistance especially inside of socket events.
|
||||
let client=this;
|
||||
|
||||
client.log('requested connection to ', client.id, client.path);
|
||||
if(!this.path){
|
||||
client.log('\n\n######\nerror: ', client.id ,' client has not specified socket path it wishes to connect to.');
|
||||
return;
|
||||
}
|
||||
|
||||
const options={};
|
||||
|
||||
if(!client.port){
|
||||
client.log('Connecting client on Unix Socket :', client.path);
|
||||
|
||||
options.path=client.path;
|
||||
|
||||
if (process.platform ==='win32' && !client.path.startsWith('\\\\.\\pipe\\')){
|
||||
options.path = options.path.replace(/^\//, '');
|
||||
options.path = options.path.replace(/\//g, '-');
|
||||
options.path= `\\\\.\\pipe\\${options.path}`;
|
||||
}
|
||||
|
||||
client.socket = net.connect(options);
|
||||
}else{
|
||||
options.host=client.path;
|
||||
options.port=client.port;
|
||||
|
||||
if(client.config.interface.localAddress){
|
||||
options.localAddress=client.config.interface.localAddress;
|
||||
}
|
||||
|
||||
if(client.config.interface.localPort){
|
||||
options.localPort=client.config.interface.localPort;
|
||||
}
|
||||
|
||||
if(client.config.interface.family){
|
||||
options.family=client.config.interface.family;
|
||||
}
|
||||
|
||||
if(client.config.interface.hints){
|
||||
options.hints=client.config.interface.hints;
|
||||
}
|
||||
|
||||
if(client.config.interface.lookup){
|
||||
options.lookup=client.config.interface.lookup;
|
||||
}
|
||||
|
||||
if(!client.config.tls){
|
||||
client.log('Connecting client via TCP to', options);
|
||||
client.socket = net.connect(options);
|
||||
}else{
|
||||
client.log('Connecting client via TLS to', client.path ,client.port,client.config.tls);
|
||||
if(client.config.tls.private){
|
||||
client.config.tls.key=fs.readFileSync(client.config.tls.private);
|
||||
}
|
||||
if(client.config.tls.public){
|
||||
client.config.tls.cert=fs.readFileSync(client.config.tls.public);
|
||||
}
|
||||
if(client.config.tls.trustedConnections){
|
||||
if(typeof client.config.tls.trustedConnections === 'string'){
|
||||
client.config.tls.trustedConnections=[client.config.tls.trustedConnections];
|
||||
}
|
||||
client.config.tls.ca=[];
|
||||
for(let i=0; i<client.config.tls.trustedConnections.length; i++){
|
||||
client.config.tls.ca.push(
|
||||
fs.readFileSync(client.config.tls.trustedConnections[i])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(client.config.tls,options);
|
||||
|
||||
client.socket = tls.connect(
|
||||
client.config.tls
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
client.socket.setEncoding(this.config.encoding);
|
||||
|
||||
client.socket.on(
|
||||
'error',
|
||||
function(err){
|
||||
client.log('\n\n######\nerror: ', err);
|
||||
client.publish('error', err);
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
client.socket.on(
|
||||
'connect',
|
||||
function connectionMade(){
|
||||
client.publish('connect');
|
||||
client.retriesRemaining=client.config.maxRetries;
|
||||
client.log('retrying reset');
|
||||
}
|
||||
);
|
||||
|
||||
client.socket.on(
|
||||
'close',
|
||||
function connectionClosed(){
|
||||
client.log('connection closed' ,client.id , client.path,
|
||||
client.retriesRemaining, 'tries remaining of', client.config.maxRetries
|
||||
);
|
||||
|
||||
if(
|
||||
client.config.stopRetrying ||
|
||||
client.retriesRemaining<1 ||
|
||||
client.explicitlyDisconnected
|
||||
|
||||
){
|
||||
client.publish('disconnect');
|
||||
client.log(
|
||||
(client.config.id),
|
||||
'exceeded connection rety amount of',
|
||||
' or stopRetrying flag set.'
|
||||
);
|
||||
|
||||
client.socket.destroy();
|
||||
client.publish('destroy');
|
||||
client=undefined;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(
|
||||
function retryTimeout(){
|
||||
if (client.explicitlyDisconnected) {
|
||||
return;
|
||||
}
|
||||
client.retriesRemaining--;
|
||||
client.connect();
|
||||
}.bind(null,client),
|
||||
client.config.retry
|
||||
);
|
||||
|
||||
client.publish('disconnect');
|
||||
}
|
||||
);
|
||||
|
||||
client.socket.on(
|
||||
'data',
|
||||
function(data) {
|
||||
client.log('## received events ##');
|
||||
if(client.config.rawBuffer){
|
||||
client.publish(
|
||||
'data',
|
||||
Buffer.from(data,client.config.encoding)
|
||||
);
|
||||
if(!client.config.sync){
|
||||
return;
|
||||
}
|
||||
|
||||
client.queue.next();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this.ipcBuffer){
|
||||
this.ipcBuffer='';
|
||||
}
|
||||
|
||||
data=(this.ipcBuffer+=data);
|
||||
|
||||
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
|
||||
client.log('Messages are large, You may want to consider smaller messages.');
|
||||
return;
|
||||
}
|
||||
|
||||
this.ipcBuffer='';
|
||||
|
||||
const events = eventParser.parse(data);
|
||||
const eCount = events.length;
|
||||
for(let i=0; i<eCount; i++){
|
||||
let message=new Message;
|
||||
message.load(events[i]);
|
||||
|
||||
client.log('detected event', message.type, message.data);
|
||||
client.publish(
|
||||
message.type,
|
||||
message.data
|
||||
);
|
||||
}
|
||||
|
||||
if(!client.config.sync){
|
||||
return;
|
||||
}
|
||||
|
||||
client.queue.next();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
module.exports=Client;
|
||||
@ -0,0 +1,399 @@
|
||||
'use strict';
|
||||
|
||||
const net = require('net'),
|
||||
tls = require('tls'),
|
||||
fs = require('fs'),
|
||||
dgram = require('dgram'),
|
||||
EventParser = require('../entities/EventParser.js'),
|
||||
Message = require('js-message'),
|
||||
Events = require('event-pubsub');
|
||||
|
||||
let eventParser = new EventParser();
|
||||
|
||||
class Server extends Events{
|
||||
constructor(path,config,log,port){
|
||||
super();
|
||||
Object.assign(
|
||||
this,
|
||||
{
|
||||
config : config,
|
||||
path : path,
|
||||
port : port,
|
||||
udp4 : false,
|
||||
udp6 : false,
|
||||
log : log,
|
||||
server : false,
|
||||
sockets : [],
|
||||
emit : emit,
|
||||
broadcast : broadcast
|
||||
}
|
||||
);
|
||||
|
||||
eventParser=new EventParser(this.config);
|
||||
|
||||
this.on(
|
||||
'close',
|
||||
serverClosed.bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
onStart(socket){
|
||||
this.trigger(
|
||||
'start',
|
||||
socket
|
||||
);
|
||||
}
|
||||
|
||||
stop(){
|
||||
this.server.close();
|
||||
}
|
||||
|
||||
start(){
|
||||
if(!this.path){
|
||||
this.log('Socket Server Path not specified, refusing to start');
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.config.unlink){
|
||||
fs.unlink(
|
||||
this.path,
|
||||
startServer.bind(this)
|
||||
);
|
||||
}else{
|
||||
startServer.bind(this)();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function emit(socket, type, data){
|
||||
this.log('dispatching event to socket', ' : ', type, data);
|
||||
|
||||
let message=new Message;
|
||||
message.type=type;
|
||||
message.data=data;
|
||||
|
||||
if(this.config.rawBuffer){
|
||||
this.log(this.config.encoding)
|
||||
message=Buffer.from(type,this.config.encoding);
|
||||
}else{
|
||||
message=eventParser.format(message);
|
||||
}
|
||||
|
||||
if(this.udp4 || this.udp6){
|
||||
|
||||
if(!socket.address || !socket.port){
|
||||
this.log('Attempting to emit to a single UDP socket without supplying socket address or port. Redispatching event as broadcast to all connected sockets');
|
||||
this.broadcast(type,data);
|
||||
return;
|
||||
}
|
||||
|
||||
this.server.write(
|
||||
message,
|
||||
socket
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
socket.write(message);
|
||||
}
|
||||
|
||||
function broadcast(type,data){
|
||||
this.log('broadcasting event to all known sockets listening to ', this.path,' : ', ((this.port)?this.port:''), type, data);
|
||||
let message=new Message;
|
||||
message.type=type;
|
||||
message.data=data;
|
||||
|
||||
if(this.config.rawBuffer){
|
||||
message=Buffer.from(type,this.config.encoding);
|
||||
}else{
|
||||
message=eventParser.format(message);
|
||||
}
|
||||
|
||||
if(this.udp4 || this.udp6){
|
||||
for(let i=1, count=this.sockets.length; i<count; i++){
|
||||
this.server.write(message,this.sockets[i]);
|
||||
}
|
||||
}else{
|
||||
for(let i=0, count=this.sockets.length; i<count; i++){
|
||||
this.sockets[i].write(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function serverClosed(){
|
||||
for(let i=0, count=this.sockets.length; i<count; i++){
|
||||
let socket=this.sockets[i];
|
||||
let destroyedSocketId=false;
|
||||
|
||||
if(socket){
|
||||
if(socket.readable){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(socket.id){
|
||||
destroyedSocketId=socket.id;
|
||||
}
|
||||
|
||||
this.log('socket disconnected',destroyedSocketId.toString());
|
||||
|
||||
if(socket && socket.destroy){
|
||||
socket.destroy();
|
||||
}
|
||||
|
||||
this.sockets.splice(i,1);
|
||||
|
||||
this.publish('socket.disconnected', socket, destroyedSocketId);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function gotData(socket,data,UDPSocket){
|
||||
let sock=((this.udp4 || this.udp6)? UDPSocket : socket);
|
||||
if(this.config.rawBuffer){
|
||||
data=Buffer.from(data,this.config.encoding);
|
||||
this.publish(
|
||||
'data',
|
||||
data,
|
||||
sock
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!sock.ipcBuffer){
|
||||
sock.ipcBuffer='';
|
||||
}
|
||||
|
||||
data=(sock.ipcBuffer+=data);
|
||||
|
||||
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
|
||||
this.log('Messages are large, You may want to consider smaller messages.');
|
||||
return;
|
||||
}
|
||||
|
||||
sock.ipcBuffer='';
|
||||
|
||||
data=eventParser.parse(data);
|
||||
|
||||
while(data.length>0){
|
||||
let message=new Message;
|
||||
message.load(data.shift());
|
||||
|
||||
// Only set the sock id if it is specified.
|
||||
if (message.data && message.data.id){
|
||||
sock.id=message.data.id;
|
||||
}
|
||||
|
||||
this.log('received event of : ',message.type,message.data);
|
||||
|
||||
this.publish(
|
||||
message.type,
|
||||
message.data,
|
||||
sock
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function socketClosed(socket){
|
||||
this.publish(
|
||||
'close',
|
||||
socket
|
||||
);
|
||||
}
|
||||
|
||||
function serverCreated(socket) {
|
||||
this.sockets.push(socket);
|
||||
|
||||
if(socket.setEncoding){
|
||||
socket.setEncoding(this.config.encoding);
|
||||
}
|
||||
|
||||
this.log('## socket connection to server detected ##');
|
||||
socket.on(
|
||||
'close',
|
||||
socketClosed.bind(this)
|
||||
);
|
||||
|
||||
socket.on(
|
||||
'error',
|
||||
function(err){
|
||||
this.log('server socket error',err);
|
||||
|
||||
this.publish('error',err);
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
socket.on(
|
||||
'data',
|
||||
gotData.bind(this,socket)
|
||||
);
|
||||
|
||||
socket.on(
|
||||
'message',
|
||||
function(msg,rinfo) {
|
||||
if (!rinfo){
|
||||
return;
|
||||
}
|
||||
|
||||
this.log('Received UDP message from ', rinfo.address, rinfo.port);
|
||||
let data;
|
||||
|
||||
if(this.config.rawSocket){
|
||||
data=Buffer.from(msg,this.config.encoding);
|
||||
}else{
|
||||
data=msg.toString();
|
||||
}
|
||||
socket.emit('data',data,rinfo);
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
this.publish(
|
||||
'connect',
|
||||
socket
|
||||
);
|
||||
|
||||
if(this.config.rawBuffer){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function startServer() {
|
||||
this.log(
|
||||
'starting server on ',this.path,
|
||||
((this.port)?`:${this.port}`:'')
|
||||
);
|
||||
|
||||
if(!this.udp4 && !this.udp6){
|
||||
this.log('starting TLS server',this.config.tls);
|
||||
if(!this.config.tls){
|
||||
this.server=net.createServer(
|
||||
serverCreated.bind(this)
|
||||
);
|
||||
}else{
|
||||
startTLSServer.bind(this)();
|
||||
}
|
||||
}else{
|
||||
this.server=dgram.createSocket(
|
||||
((this.udp4)? 'udp4':'udp6')
|
||||
);
|
||||
this.server.write=UDPWrite.bind(this);
|
||||
this.server.on(
|
||||
'listening',
|
||||
function UDPServerStarted() {
|
||||
serverCreated.bind(this)(this.server);
|
||||
}.bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
this.server.on(
|
||||
'error',
|
||||
function(err){
|
||||
this.log('server error',err);
|
||||
|
||||
this.publish(
|
||||
'error',
|
||||
err
|
||||
);
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
this.server.maxConnections=this.config.maxConnections;
|
||||
|
||||
if(!this.port){
|
||||
this.log('starting server as', 'Unix || Windows Socket');
|
||||
if (process.platform ==='win32'){
|
||||
this.path = this.path.replace(/^\//, '');
|
||||
this.path = this.path.replace(/\//g, '-');
|
||||
this.path= `\\\\.\\pipe\\${this.path}`;
|
||||
}
|
||||
|
||||
this.server.listen({
|
||||
path: this.path,
|
||||
readableAll: this.config.readableAll,
|
||||
writableAll: this.config.writableAll
|
||||
}, this.onStart.bind(this));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this.udp4 && !this.udp6){
|
||||
this.log('starting server as', (this.config.tls?'TLS':'TCP'));
|
||||
this.server.listen(
|
||||
this.port,
|
||||
this.path,
|
||||
this.onStart.bind(this)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.log('starting server as',((this.udp4)? 'udp4':'udp6'));
|
||||
|
||||
this.server.bind(
|
||||
this.port,
|
||||
this.path
|
||||
);
|
||||
|
||||
this.onStart(
|
||||
{
|
||||
address : this.path,
|
||||
port : this.port
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function startTLSServer(){
|
||||
this.log('starting TLS server',this.config.tls);
|
||||
if(this.config.tls.private){
|
||||
this.config.tls.key=fs.readFileSync(this.config.tls.private);
|
||||
}else{
|
||||
this.config.tls.key=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`);
|
||||
}
|
||||
if(this.config.tls.public){
|
||||
this.config.tls.cert=fs.readFileSync(this.config.tls.public);
|
||||
}else{
|
||||
this.config.tls.cert=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`);
|
||||
}
|
||||
if(this.config.tls.dhparam){
|
||||
this.config.tls.dhparam=fs.readFileSync(this.config.tls.dhparam);
|
||||
}
|
||||
if(this.config.tls.trustedConnections){
|
||||
if(typeof this.config.tls.trustedConnections === 'string'){
|
||||
this.config.tls.trustedConnections=[this.config.tls.trustedConnections];
|
||||
}
|
||||
this.config.tls.ca=[];
|
||||
for(let i=0; i<this.config.tls.trustedConnections.length; i++){
|
||||
this.config.tls.ca.push(
|
||||
fs.readFileSync(this.config.tls.trustedConnections[i])
|
||||
);
|
||||
}
|
||||
}
|
||||
this.server=tls.createServer(
|
||||
this.config.tls,
|
||||
serverCreated.bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
function UDPWrite(message,socket){
|
||||
let data=Buffer.from(message, this.config.encoding);
|
||||
this.server.send(
|
||||
data,
|
||||
0,
|
||||
data.length,
|
||||
socket.port,
|
||||
socket.address,
|
||||
function(err, bytes) {
|
||||
if(err){
|
||||
this.log('error writing data to socket',err);
|
||||
this.publish(
|
||||
'error',
|
||||
function(err){
|
||||
this.publish('error',err);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
module.exports=Server;
|
||||
@ -0,0 +1,83 @@
|
||||
'use strict';
|
||||
|
||||
/*eslint no-magic-numbers: ["error", { "ignore": [ 0] }]*/
|
||||
|
||||
/**
|
||||
* @module entities
|
||||
*/
|
||||
|
||||
const os = require('os');
|
||||
|
||||
/**
|
||||
* @class Defaults
|
||||
* @description Defaults Entity
|
||||
*/
|
||||
class Defaults{
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @method constructor
|
||||
* @return {void}
|
||||
*/
|
||||
constructor(){
|
||||
|
||||
this.appspace='app.';
|
||||
this.socketRoot='/tmp/';
|
||||
this.id=os.hostname();
|
||||
|
||||
this.encoding='utf8';
|
||||
this.rawBuffer=false;
|
||||
this.sync=false;
|
||||
this.unlink=true;
|
||||
|
||||
this.delimiter='\f';
|
||||
|
||||
this.silent=false;
|
||||
this.logDepth=5;
|
||||
this.logInColor=true;
|
||||
this.logger=console.log.bind(console);
|
||||
|
||||
this.maxConnections=100;
|
||||
this.retry=500;
|
||||
this.maxRetries=Infinity;
|
||||
this.stopRetrying=false;
|
||||
|
||||
this.IPType=getIPType();
|
||||
this.tls=false;
|
||||
this.networkHost = (this.IPType == 'IPv6') ? '::1' : '127.0.0.1';
|
||||
this.networkPort = 8000;
|
||||
|
||||
this.readableAll = false;
|
||||
this.writableAll = false;
|
||||
|
||||
this.interface={
|
||||
localAddress:false,
|
||||
localPort:false,
|
||||
family:false,
|
||||
hints:false,
|
||||
lookup:false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* method to get ip type
|
||||
*
|
||||
* @method getIPType
|
||||
* @return {string} ip type
|
||||
*/
|
||||
function getIPType() {
|
||||
const networkInterfaces = os.networkInterfaces();
|
||||
let IPType = '';
|
||||
if (networkInterfaces
|
||||
&& Array.isArray(networkInterfaces)
|
||||
&& networkInterfaces.length > 0) {
|
||||
// getting the family of first network interface available
|
||||
IPType = networkInterfaces [
|
||||
Object.keys( networkInterfaces )[0]
|
||||
][0].family;
|
||||
}
|
||||
return IPType;
|
||||
}
|
||||
|
||||
module.exports=Defaults;
|
||||
32
src/web_control/frontend/node_modules/@achrinza/node-ipc/entities/EventParser.js
generated
vendored
32
src/web_control/frontend/node_modules/@achrinza/node-ipc/entities/EventParser.js
generated
vendored
@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
const Defaults = require('./Defaults.js');
|
||||
|
||||
class Parser{
|
||||
constructor(config){
|
||||
if(!config){
|
||||
config=new Defaults;
|
||||
}
|
||||
this.delimiter=config.delimiter;
|
||||
}
|
||||
|
||||
format(message){
|
||||
if(!message.data && message.data!==false && message.data!==0){
|
||||
message.data={};
|
||||
}
|
||||
if(message.data['_maxListeners']){
|
||||
message.data={};
|
||||
}
|
||||
|
||||
message=message.JSON+this.delimiter;
|
||||
return message;
|
||||
}
|
||||
|
||||
parse(data){
|
||||
let events=data.split(this.delimiter);
|
||||
events.pop();
|
||||
return events;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports=Parser;
|
||||
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Brandon Nozaki Miller
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
24
src/web_control/frontend/node_modules/@achrinza/node-ipc/local-node-ipc-certs/client.pub
generated
vendored
24
src/web_control/frontend/node_modules/@achrinza/node-ipc/local-node-ipc-certs/client.pub
generated
vendored
@ -0,0 +1,24 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID+zCCAuOgAwIBAgIJAKUVVihb00q/MA0GCSqGSIb3DQEBCwUAMIGTMQswCQYD
|
||||
VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNVGhvdXNhbmQg
|
||||
T2FrczEUMBIGA1UECgwLRGlnaU5vdyBpbmMxDDAKBgNVBAsMA1JuRDEQMA4GA1UE
|
||||
AwwHRGlnaU5vdzEhMB8GCSqGSIb3DQEJARYSYnJhbmRvbkBkaWdpbm93Lml0MB4X
|
||||
DTE2MDkxMDIxNTk0NloXDTE3MDkxMDIxNTk0NlowgZMxCzAJBgNVBAYTAlVTMRMw
|
||||
EQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1UaG91c2FuZCBPYWtzMRQwEgYD
|
||||
VQQKDAtEaWdpTm93IGluYzEMMAoGA1UECwwDUm5EMRAwDgYDVQQDDAdEaWdpTm93
|
||||
MSEwHwYJKoZIhvcNAQkBFhJicmFuZG9uQGRpZ2lub3cuaXQwggEiMA0GCSqGSIb3
|
||||
DQEBAQUAA4IBDwAwggEKAoIBAQCrNHWbbaMvlyK3ENevYeb+y5gWtOf5T8HS5k0E
|
||||
7fub8jU4f4j7poxhvAYgaMeuUUigR3YZOSGc3N8yXFLFrrU8WQyK7KAwWcyUvqWK
|
||||
7mvj6dQANtnGvnkt+q2pjMO1nxVPuXgov0GIaWHc7gL4rfuohBct6lbxOXaUxWHe
|
||||
FbQoWlqxs+lYaNMIMn7PgNwPDINoJeADKkVFXlNG9/YnT5j7TQegmzFxBBdko8EN
|
||||
W8Y91RG+/YHhtEPyKeQGrm3Ntl85JokT/GUsUUfUjXkuKrJsrLhwMVLPD23ucy7J
|
||||
zBcec0Vgpu99Bks51w/do6f80rIlAhI+iesZlPJjpDIYhmEXAgMBAAGjUDBOMB0G
|
||||
A1UdDgQWBBSOFk2HqjDTBqUuxOZvW0npEVRxCjAfBgNVHSMEGDAWgBSOFk2HqjDT
|
||||
BqUuxOZvW0npEVRxCjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAz
|
||||
FYxwSSbJ6wOX4yRNUU3XW0iGzoHwMtJhbYe3WRNLHRzHaRC+hg5VgBDEBcC9aYNB
|
||||
+dfNXfrQ+2uooe082twGqSyGVFYEytsTrhlzxvftunF0rMLXfI8wHkiqxWSupPYM
|
||||
nn2gFEVrJIpvyBnL6tAQpVRpn5aCBdQnmSApZVvDhogac0tQMH9GrjizrmDWtMoH
|
||||
V4zRA0UGzHfQoj+YKex7e9rPdDEx+mah0Ol1fzlmkZlOFInXJQ+t4F11bNNdHWje
|
||||
7lyi0pFB9egtDUxwoHkzniMvef94cCIRsph+Vjisf7OQxnx65s+aPYcjrba+Kks3
|
||||
58ANS3VkbXXzB3MeNGoB
|
||||
-----END CERTIFICATE-----
|
||||
352
src/web_control/frontend/node_modules/@achrinza/node-ipc/local-node-ipc-certs/openssl.cnf
generated
vendored
352
src/web_control/frontend/node_modules/@achrinza/node-ipc/local-node-ipc-certs/openssl.cnf
generated
vendored
@ -0,0 +1,352 @@
|
||||
#
|
||||
# OpenSSL example configuration file.
|
||||
# This is mostly being used for generation of certificate requests.
|
||||
#
|
||||
|
||||
# This definition stops the following lines choking if HOME isn't
|
||||
# defined.
|
||||
HOME = .
|
||||
RANDFILE = $ENV::HOME/.rnd
|
||||
|
||||
# Extra OBJECT IDENTIFIER info:
|
||||
#oid_file = $ENV::HOME/.oid
|
||||
oid_section = new_oids
|
||||
|
||||
# To use this configuration file with the "-extfile" option of the
|
||||
# "openssl x509" utility, name here the section containing the
|
||||
# X.509v3 extensions to use:
|
||||
# extensions =
|
||||
# (Alternatively, use a configuration file that has only
|
||||
# X.509v3 extensions in its main [= default] section.)
|
||||
|
||||
[ new_oids ]
|
||||
|
||||
# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
|
||||
# Add a simple OID like this:
|
||||
# testoid1=1.2.3.4
|
||||
# Or use config file substitution like this:
|
||||
# testoid2=${testoid1}.5.6
|
||||
|
||||
# Policies used by the TSA examples.
|
||||
tsa_policy1 = 1.2.3.4.1
|
||||
tsa_policy2 = 1.2.3.4.5.6
|
||||
tsa_policy3 = 1.2.3.4.5.7
|
||||
|
||||
####################################################################
|
||||
[ ca ]
|
||||
default_ca = CA_default # The default ca section
|
||||
|
||||
####################################################################
|
||||
[ CA_default ]
|
||||
|
||||
dir = ./demoCA # Where everything is kept
|
||||
certs = $dir/certs # Where the issued certs are kept
|
||||
crl_dir = $dir/crl # Where the issued crl are kept
|
||||
database = $dir/index.txt # database index file.
|
||||
#unique_subject = no # Set to 'no' to allow creation of
|
||||
# several ctificates with same subject.
|
||||
new_certs_dir = $dir/newcerts # default place for new certs.
|
||||
|
||||
certificate = $dir/cacert.pem # The CA certificate
|
||||
serial = $dir/serial # The current serial number
|
||||
crlnumber = $dir/crlnumber # the current crl number
|
||||
# must be commented out to leave a V1 CRL
|
||||
crl = $dir/crl.pem # The current CRL
|
||||
private_key = $dir/private/cakey.pem# The private key
|
||||
RANDFILE = $dir/private/.rand # private random number file
|
||||
|
||||
x509_extensions = usr_cert # The extentions to add to the cert
|
||||
|
||||
# Comment out the following two lines for the "traditional"
|
||||
# (and highly broken) format.
|
||||
name_opt = ca_default # Subject Name options
|
||||
cert_opt = ca_default # Certificate field options
|
||||
|
||||
# Extension copying option: use with caution.
|
||||
# copy_extensions = copy
|
||||
|
||||
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
||||
# so this is commented out by default to leave a V1 CRL.
|
||||
# crlnumber must also be commented out to leave a V1 CRL.
|
||||
# crl_extensions = crl_ext
|
||||
|
||||
default_days = 365 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = default # use public key default MD
|
||||
preserve = no # keep passed DN ordering
|
||||
|
||||
# A few difference way of specifying how similar the request should look
|
||||
# For type CA, the listed attributes must be the same, and the optional
|
||||
# and supplied fields are just that :-)
|
||||
policy = policy_match
|
||||
|
||||
# For the CA policy
|
||||
[ policy_match ]
|
||||
countryName = match
|
||||
stateOrProvinceName = match
|
||||
organizationName = match
|
||||
organizationalUnitName = optional
|
||||
commonName = supplied
|
||||
emailAddress = optional
|
||||
|
||||
# For the 'anything' policy
|
||||
# At this point in time, you must list all acceptable 'object'
|
||||
# types.
|
||||
[ policy_anything ]
|
||||
countryName = optional
|
||||
stateOrProvinceName = optional
|
||||
localityName = optional
|
||||
organizationName = optional
|
||||
organizationalUnitName = optional
|
||||
commonName = supplied
|
||||
emailAddress = optional
|
||||
|
||||
####################################################################
|
||||
[ req ]
|
||||
default_bits = 2048
|
||||
default_keyfile = privkey.pem
|
||||
distinguished_name = req_distinguished_name
|
||||
attributes = req_attributes
|
||||
x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
|
||||
# Passwords for private keys if not present they will be prompted for
|
||||
# input_password = secret
|
||||
# output_password = secret
|
||||
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString (PKIX recommendation before 2004)
|
||||
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
|
||||
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
|
||||
# MASK:XXXX a literal mask value.
|
||||
# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
|
||||
string_mask = utf8only
|
||||
|
||||
req_extensions = v3_req # The extensions to add to a certificate request
|
||||
|
||||
[ req_distinguished_name ]
|
||||
countryName = Country Name (2 letter code)
|
||||
countryName_default = AU
|
||||
countryName_min = 2
|
||||
countryName_max = 2
|
||||
|
||||
stateOrProvinceName = State or Province Name (full name)
|
||||
stateOrProvinceName_default = Some-State
|
||||
|
||||
localityName = Locality Name (eg, city)
|
||||
|
||||
0.organizationName = Organization Name (eg, company)
|
||||
0.organizationName_default = Internet Widgits Pty Ltd
|
||||
|
||||
# we can do this but it is not needed normally :-)
|
||||
#1.organizationName = Second Organization Name (eg, company)
|
||||
#1.organizationName_default = World Wide Web Pty Ltd
|
||||
|
||||
organizationalUnitName = Organizational Unit Name (eg, section)
|
||||
#organizationalUnitName_default =
|
||||
|
||||
commonName = Common Name (e.g. server FQDN or YOUR name)
|
||||
commonName_max = 64
|
||||
|
||||
emailAddress = Email Address
|
||||
emailAddress_max = 64
|
||||
|
||||
# SET-ex3 = SET extension number 3
|
||||
|
||||
[ req_attributes ]
|
||||
challengePassword = A challenge password
|
||||
challengePassword_min = 4
|
||||
challengePassword_max = 20
|
||||
|
||||
unstructuredName = An optional company name
|
||||
|
||||
[ usr_cert ]
|
||||
|
||||
# These extensions are added when 'ca' signs a request.
|
||||
|
||||
# This goes against PKIX guidelines but some CAs do it and some software
|
||||
# requires this to avoid interpreting an end user certificate as a CA.
|
||||
|
||||
basicConstraints=CA:FALSE
|
||||
|
||||
# Here are some examples of the usage of nsCertType. If it is omitted
|
||||
# the certificate can be used for anything *except* object signing.
|
||||
|
||||
# This is OK for an SSL server.
|
||||
# nsCertType = server
|
||||
|
||||
# For an object signing certificate this would be used.
|
||||
# nsCertType = objsign
|
||||
|
||||
# For normal client use this is typical
|
||||
# nsCertType = client, email
|
||||
|
||||
# and for everything including object signing:
|
||||
# nsCertType = client, email, objsign
|
||||
|
||||
# This is typical in keyUsage for a client certificate.
|
||||
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
|
||||
# This will be displayed in Netscape's comment listbox.
|
||||
nsComment = "OpenSSL Generated Certificate"
|
||||
|
||||
# PKIX recommendations harmless if included in all certificates.
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid,issuer
|
||||
|
||||
# This stuff is for subjectAltName and issuerAltname.
|
||||
# Import the email address.
|
||||
# subjectAltName=email:copy
|
||||
# An alternative to produce certificates that aren't
|
||||
# deprecated according to PKIX.
|
||||
# subjectAltName=email:move
|
||||
|
||||
# Copy subject details
|
||||
# issuerAltName=issuer:copy
|
||||
|
||||
#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
|
||||
#nsBaseUrl
|
||||
#nsRevocationUrl
|
||||
#nsRenewalUrl
|
||||
#nsCaPolicyUrl
|
||||
#nsSslServerName
|
||||
|
||||
# This is required for TSA certificates.
|
||||
# extendedKeyUsage = critical,timeStamping
|
||||
|
||||
[ v3_req ]
|
||||
|
||||
subjectAltName="DNS:localhost,IP:127.0.0.1"
|
||||
|
||||
# Extensions to add to a certificate request
|
||||
|
||||
basicConstraints = CA:FALSE
|
||||
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
|
||||
[ v3_ca ]
|
||||
|
||||
|
||||
# Extensions for a typical CA
|
||||
|
||||
|
||||
# PKIX recommendation.
|
||||
|
||||
subjectKeyIdentifier=hash
|
||||
|
||||
authorityKeyIdentifier=keyid:always,issuer
|
||||
|
||||
# This is what PKIX recommends but some broken software chokes on critical
|
||||
# extensions.
|
||||
#basicConstraints = critical,CA:true
|
||||
# So we do this instead.
|
||||
basicConstraints = CA:true
|
||||
|
||||
# Key usage: this is typical for a CA certificate. However since it will
|
||||
# prevent it being used as an test self-signed certificate it is best
|
||||
# left out by default.
|
||||
# keyUsage = cRLSign, keyCertSign
|
||||
|
||||
# Some might want this also
|
||||
# nsCertType = sslCA, emailCA
|
||||
|
||||
# Include email address in subject alt name: another PKIX recommendation
|
||||
# subjectAltName=email:copy
|
||||
# Copy issuer details
|
||||
# issuerAltName=issuer:copy
|
||||
|
||||
# DER hex encoding of an extension: beware experts only!
|
||||
# obj=DER:02:03
|
||||
# Where 'obj' is a standard or added object
|
||||
# You can even override a supported extension:
|
||||
# basicConstraints= critical, DER:30:03:01:01:FF
|
||||
|
||||
[ crl_ext ]
|
||||
|
||||
# CRL extensions.
|
||||
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
|
||||
|
||||
# issuerAltName=issuer:copy
|
||||
authorityKeyIdentifier=keyid:always
|
||||
|
||||
[ proxy_cert_ext ]
|
||||
# These extensions should be added when creating a proxy certificate
|
||||
|
||||
# This goes against PKIX guidelines but some CAs do it and some software
|
||||
# requires this to avoid interpreting an end user certificate as a CA.
|
||||
|
||||
basicConstraints=CA:FALSE
|
||||
|
||||
# Here are some examples of the usage of nsCertType. If it is omitted
|
||||
# the certificate can be used for anything *except* object signing.
|
||||
|
||||
# This is OK for an SSL server.
|
||||
# nsCertType = server
|
||||
|
||||
# For an object signing certificate this would be used.
|
||||
# nsCertType = objsign
|
||||
|
||||
# For normal client use this is typical
|
||||
# nsCertType = client, email
|
||||
|
||||
# and for everything including object signing:
|
||||
# nsCertType = client, email, objsign
|
||||
|
||||
# This is typical in keyUsage for a client certificate.
|
||||
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
|
||||
# This will be displayed in Netscape's comment listbox.
|
||||
nsComment = "OpenSSL Generated Certificate"
|
||||
|
||||
# PKIX recommendations harmless if included in all certificates.
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid,issuer
|
||||
|
||||
# This stuff is for subjectAltName and issuerAltname.
|
||||
# Import the email address.
|
||||
# subjectAltName=email:copy
|
||||
# An alternative to produce certificates that aren't
|
||||
# deprecated according to PKIX.
|
||||
# subjectAltName=email:move
|
||||
|
||||
# Copy subject details
|
||||
# issuerAltName=issuer:copy
|
||||
|
||||
#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
|
||||
#nsBaseUrl
|
||||
#nsRevocationUrl
|
||||
#nsRenewalUrl
|
||||
#nsCaPolicyUrl
|
||||
#nsSslServerName
|
||||
|
||||
# This really needs to be in place for it to be a proxy certificate.
|
||||
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
|
||||
|
||||
####################################################################
|
||||
[ tsa ]
|
||||
|
||||
default_tsa = tsa_config1 # the default TSA section
|
||||
|
||||
[ tsa_config1 ]
|
||||
|
||||
# These are used by the TSA reply generation only.
|
||||
dir = ./demoCA # TSA root directory
|
||||
serial = $dir/tsaserial # The current serial number (mandatory)
|
||||
crypto_device = builtin # OpenSSL engine to use for signing
|
||||
signer_cert = $dir/tsacert.pem # The TSA signing certificate
|
||||
# (optional)
|
||||
certs = $dir/cacert.pem # Certificate chain to include in reply
|
||||
# (optional)
|
||||
signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
|
||||
|
||||
default_policy = tsa_policy1 # Policy if request did not specify it
|
||||
# (optional)
|
||||
other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)
|
||||
digests = md5, sha1 # Acceptable message digests (mandatory)
|
||||
accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
|
||||
clock_precision_digits = 0 # number of digits after dot. (optional)
|
||||
ordering = yes # Is ordering defined for timestamps?
|
||||
# (optional, default: no)
|
||||
tsa_name = yes # Must the TSA name be included in the reply?
|
||||
# (optional, default: no)
|
||||
ess_cert_id_chain = no # Must the ESS cert id chain be included?
|
||||
# (optional, default: no)
|
||||
@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAqzR1m22jL5citxDXr2Hm/suYFrTn+U/B0uZNBO37m/I1OH+I
|
||||
+6aMYbwGIGjHrlFIoEd2GTkhnNzfMlxSxa61PFkMiuygMFnMlL6liu5r4+nUADbZ
|
||||
xr55LfqtqYzDtZ8VT7l4KL9BiGlh3O4C+K37qIQXLepW8Tl2lMVh3hW0KFpasbPp
|
||||
WGjTCDJ+z4DcDwyDaCXgAypFRV5TRvf2J0+Y+00HoJsxcQQXZKPBDVvGPdURvv2B
|
||||
4bRD8inkBq5tzbZfOSaJE/xlLFFH1I15LiqybKy4cDFSzw9t7nMuycwXHnNFYKbv
|
||||
fQZLOdcP3aOn/NKyJQISPonrGZTyY6QyGIZhFwIDAQABAoIBAHpxZ1dE/zuvFLXm
|
||||
xsr48vLxexFqSqnEv/NsoFLRPWzXufZxR+/qumW/yoXtSjpCifWPhkgd0wtT8BEd
|
||||
dFlLTPUfHthQyXQrFSSggNavE9yJxARvNits2E/pA8DKGsJPRzeghu5lcqHz9HjE
|
||||
hL2D+QMZjVZaTdnx5fwaepcR4KomYTUupci0HoMWyoKPhIfItVueiHVo4d60dIRz
|
||||
OpkSGCAZ/Czv5CJrmK/5e+roKti4ChF/n28hUu7OGzvkG+qYep08tf48MyZCPHgO
|
||||
Vj+kuxMRkjIP0iXLmiF32lZXzpOFvjtXovI46dYiINCE9tNyKqDWYUJf9qNqwAsm
|
||||
OuOfXtkCgYEA18Ywabu/Z4vYUhWtTFrP6iSLVcXd0rZuWud7kwv/G4DMrNh7oi1s
|
||||
0AVvphaEqEn8OsgcuyIlyjtJl60aQzvYwdu2KEcTjcqvUX7p/41t5O/LzaYwZ3hh
|
||||
9oFIWXXFpskg7Kh0EGCGG/yvAdTai5M0lO9XQ1DUK0MWc1KQ5yKd0mUCgYEAyx80
|
||||
dgIZTyHl0ZgF712mRda5KfQlmgWoo0zu/IFSFuINEMC/3laYEJCowOnUb8VZ8mbJ
|
||||
Wd/FhOTadv7joY0eAhfSNAItaubuZWo91bbD2vwpi/U2OEfy0LzF7BNXHCpH69wk
|
||||
vujKBxmRTGvBLbabcWA97UPFM2K33rsM72DAL8sCgYB03SOFcKk3BLfRpWnpy9mF
|
||||
/+rzNqpwoFveojb8qmet1rGD/+/eI2omtHsG4nVQzFlu4Mkm1VTQVhICsz9hIL3C
|
||||
KSRcZjqB9j/EDM/hmBDoCLRCGntm3v13zAeKZE37ij1pz8akxBJ+f/mtLUJ8i+rT
|
||||
q1mA3Ps8vyYeqZ5PgSEnPQKBgD6szEU1dJXEQeOgYwRvAyU9kjjtysRxxo1M6dkk
|
||||
Fi5VZe6rawix84349PlBrXknjg+Lw8llkM7mxro9AAQTRRUkQIonudfoldrZI2dU
|
||||
U664bCFxcl9/Y98gwHmNpi1cpoCSlwwJTH1QWFMaVKtEU0ZyiekyJiEq7s1dLiqW
|
||||
0fZtAoGABvAOikMmOn6ewt+NyYd6HkwgcvI0R0aHxOQz8aldW4gwrkuvuOOHdfah
|
||||
RAcc8LiZFqhNFN7DMkRt1crtP5v3vh2Nbyf9Zg2ZizsIupsNlvSlh/aTueVozVuM
|
||||
hc/wEVlrqeJInf4jkxYna6G6CoTfPVyQCjNcvlI3kMfIoyXS+vc=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@ -0,0 +1,8 @@
|
||||
-----BEGIN DH PARAMETERS-----
|
||||
MIIBCAKCAQEAhDA93df5Qa7pMWiqJ8IeCDw4fCIJCNbzRklS2saOeQRkUY/kPy07
|
||||
EByFWUDNtgtWRx7YndJKwyFepHXxI3P0DDuSPYKq/bfiWDr/cUmTBJcpPmg6w/SU
|
||||
ReOB6vORXyF9iytyLCKk1Pyo2nXOdpADcTflhi+zxTSpGLtPAU2XIYENtmC4HKJm
|
||||
y6nbSIbe4BA74bxyqzp6RVuMvyHAgCjPDwvHlp5UV1Mjtr1aNqgzpLQSjK4VwiJ+
|
||||
DZ48/1D9IYksDl8NWJopFpudyPD1WFou/CZ6PYsjprFrTKVPqoFD5Zj6zPey9C70
|
||||
Go0uHRNPr9UrhwCqDEKNszulME8heSVSQwIBAg==
|
||||
-----END DH PARAMETERS-----
|
||||
@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAvmw4yTAd5EdNxksnKEx+ky8XgEqTJVAvcrgF1jaPrC0QNr94
|
||||
EfEHouiEyqWlf4kDzksIA9HcuGhVPZ9gsjjgLvi1pwT+e2vfyOHOWOf96NDlfW02
|
||||
Fx6d92k1zEfhfVmTJU0j6ANG2eNMfF5rhK+xKzH3FC0Vm5e7np9wVuRD4CjggJJL
|
||||
fBm6xJPSBWeY1gum3m5sH4Ec3X0zacZXeBOdjMx1a5I2gfTHJe5fizDfw1vgsYhh
|
||||
I3z6OEXEg5kFtOiz34y4SVCDRZGDVXiAdx8uVXXPdryFybjiZGWGEeTFDZfCAuZp
|
||||
h0I04cqfniD5FbSPIdVVAImH9Nm1sbpLafyuXwIDAQABAoIBADTd8OoSXMoq7bHW
|
||||
3Zk3m5Cba2fnzHB4kaPE6YHuhfbkT/MTN2+rvlYBPhTQ5mDBFnhopmIBGslr1faU
|
||||
0BDK75q63BvxrAFyEqA/6L0QM5M2o/AtqO3ER1EQOapsbnMRsmORxh09A6esjmid
|
||||
AjbFXGfEqHdGiRA4kRNZ6qOFHj8WP4FZ3/elIerl4W86FtMeuza6PUMYm1ePFG/h
|
||||
vTGROXibW2/qrfzgsocKgdjc06Szi95hjloHlpPo3OVLywSNYuJ6dxOj11tKBIjr
|
||||
U126cdza/2OeyWasY4tl4WVeG1Mojtya2ObvMNMOyESPzKaVzb2LIN6feH7toxdK
|
||||
5CEbzfkCgYEA5kZzFWLvUAkK/Oi0bK9b1WhmNUOcfZmPOBJenurfKSQo2R4ugvAM
|
||||
zMupVs/Mum0Hl1+cvTPZDAwHx0qM3E8+Ute7SqLOMxlx7b1XCFB03RN1UN4BCSy4
|
||||
hCQPi+f3YjAF/Zpduquq9qS4gcIwhlo3FHGWWFFIGDesWfJrsTsssNUCgYEA07IM
|
||||
K5+AsvdrHMShMMbys4rOitY9JKUMKV1BdsyRw9z/rsWoDcqupuFTPwWrlc3D3a/i
|
||||
/b/cM3Wm8907fPPrauU3LF11tOkIhsP8/xRkK9BZGkjJCSLO5UvWxmlcZreGvHh+
|
||||
QAwPWKh8MsatyFBFmn7SGFXSu88LQL+TGilpHGMCgYAOwBiDGDFIKSwhAy77f0gc
|
||||
pXFWnBwcF4gLCXIyL81Xr09GiR5lmMbZH3qbavgsQOupkKBTpkyS7vpYk7fuLM1L
|
||||
NTJ0F3Wp5Eld9zDqAW1a8/Ih2farBchT/pNYXOWFzpmzov26BWEQJ4ECHtRI5uJ8
|
||||
VsJQqfQ6SOarZFHtqmK0eQKBgQCPwWCyXuYuogWCy6QKU4+MjL4lWca7k7jmfgVu
|
||||
fwydTP3z2RV+CB0CBhFZwqf6Wnifmkkyt475AvQUti8ncxxywqTs46qC55x6p6yu
|
||||
K1K6zgkz6Clcot6Mpyt6ISI2PnqokcpqA8aIFiIA+RoZ5Sje+TAChoVMNBUYKv/h
|
||||
zC0ssQKBgEXyFNRGHul7ku8Ss6ZZBZjQEOFdpu7npbZWcqy273tKOdV6uOG93rQX
|
||||
6Ez6yxuBepSdwP716CT7o8EaSPBy+QjDH/e2qI3rIUHzfPwAwf4kGbNa6relTCVR
|
||||
fLrzEICSbFZKST/zeKvrY0ACOCIn8b6LiiP7GJfnV8bvvpTWXyil
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAyHKCBWzkf58gKkqRIBjJR8cSXlsiuOuirlbBQ1K+recVbh2b
|
||||
MdDoqBCk3ibeGw4p/smOxJiH/9rxpcCQ0XrSeNGasLxGB8RcNgenRFonyBPmTAjS
|
||||
O85Aa74g8CUBXaYSgk0hMWQNxkkHecGuu9F6LtN5TM7XG6Td7OTRB+bDEGdwfny4
|
||||
bqc2ELUsj99CVNxSNc5h0dJE9M6ejvIjdRQFFtfNKGgT3O7inEdDSpPZfeM+JmTB
|
||||
r/vz2jnHaSsD7d9hWKYo7Kp74rL0QJSH97ugb+g8kDAkqV1bQaVdzp+nC74/GbVL
|
||||
B9E+YH+zzvs2x9nLYPJHknia5KRfOmRjPnCdVwIDAQABAoIBACdNXHUX3s2vM61X
|
||||
JZF3iq/KNq3NjMdZXHJ2jDpZFQ4gCzGmGHHyFkwtx0XPtSj05AMTHi0qAzCFi3AG
|
||||
i96nCHGsF3qjz89iDvqBEajzTG2MiVFLQX18eWEmzGqJtvTXxTVLTkDS72h7lT2o
|
||||
XkxxTFW2HUiUHdVLxD/Ytauo8YJbjGJM5pdCxEp+uJbYWYwsvvfE4IHb8LJmqtOP
|
||||
fUG/wR3mjmHYYcYXKEqiDkSnxJL9vWb2lYKht1NFUyeVkv6q5dkr0JeSD6jw84by
|
||||
MiHoXsxjXmjn3JPtNfid92kIsMjsZ54oZ5ep2iUW7WpTZJnideyZCa4mIRn3BZZ6
|
||||
TPpIKVECgYEA/m7kwNG+WamLLGmgUkq9xWngHvkKaHsjnGuDGi8bYObtzAiOzoPi
|
||||
Bav0V/cJeTjZJJ3uW4HGhzmkJCDq+R3kJ9lEBYy9N0cq0tQf/IRorri7SbHm+eP3
|
||||
+B26z91Vkn0sqV3Htg+78jnjLYV6Nfy4pBvs3u7O91EM7kj3Q8A/xOUCgYEAya6B
|
||||
1fsngVVfkdQ6OmsibpWWCksBbN1Ko+bnY8ZoyTWeS2LkPFVn5lihJ9XzTTV+b/s2
|
||||
6urtTpCiQo/WAT62ATI2J5xHLBVS46CJj6HP9jPsyIxSEAor7wmKXqCaQDG1J7Zt
|
||||
2IszGtg3WYRWgrNSPtYdeB14fGhbpMphigZvkYsCgYAZUvpLwtSaYgirK/w8FJpc
|
||||
2tPm4UzK52688+qBoays8W87vqJQJcpKXDoew0TbHvBl954w13LmJLOUsP4SO4po
|
||||
+PQPRVnT9a5qe5iPbrJoqZRimmVt++XDeVoNtG7+/JyEYwQst9YyHtbgwgdO9k9+
|
||||
bhUef1B0R0ntMbACu1DdjQKBgGEzq/vXmkipPvBn2tCBBg1KJxA66irv1KN+DBN4
|
||||
ctRW9T3cIag6eWL5YGJ0qViS6adK6kL6ivkMmEeAT2I2OT4GVzdsCJlkhZiTrPj+
|
||||
wd4lVH+rsXltjZMdhATrXqyFyIulTvfIzw6nGrYYJCHGD2OdioJzobhEC7c2myAM
|
||||
zgTVAoGADfGqbgq8wSv+nLtOnY+s5ajwMVAyld/JqDXm5829CTI/Kd1ch6BxWYZr
|
||||
V06PY9mJ8k39GAOab7YWcKX90E85cN7YMSjsQhdMgVAsBCv25eot4BWc8EO8WeCJ
|
||||
76aC7LlmX9WlHqaZV/GNcj3PhKao5mIk77BKySxINRaflRiCWjI=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAw+YwIWPQAh8WlhPAaasfUyb13Fcg0P0y+UmtAHpAxnUKAxc1
|
||||
/bkl4FNjbS+kkTGkIvRE4NHJh4DMqEDBsf7mwhfaOl8bTCoustyh14bzxJKdM1Cx
|
||||
Q/L2GsTIwF1vZCvqOvrV1glLruRrw8PvSFaWt1JAZ8CUhtyddR3itkSF+suTORxh
|
||||
+aUjUreyfuaWx0dfIQLYOxMeTa/g94Ar9Q7KPCXgxmDqu8DVCmurDH2jz6iFktbp
|
||||
+iNvrUfs88Y3I0E8/QRBAK37j7fEp296QcYIDJKkS2z2lenJykAdaqF9qLhb3zrM
|
||||
UpGt5VUUSNdHeXzCQr7J9wA7TWjCXnQh3d/xlwIDAQABAoIBACUSQHVxIAHmxC1u
|
||||
W3Ejsu/XZZtm2Yzy/VxzdsuqVuu3ZkejctIq4WIMJbqZ03iufjMnKomo6Yw88X29
|
||||
k2oNpLmCLgfxy4akTOYIHpBct3CxlhIJ6SHErpHuP1c310aLkO3MXf79D1dvXn1T
|
||||
bMqxqB/U7t8zcGf9A8cP+sEnQnttCdj2ayUlDqfPV06sDRPndIS2LFkzIswwHED8
|
||||
Z9jRk6tWg+APsEgFAo58lIEYM2iR04c2ffWBvffIEWotYM4YH1pdgvVtILLzky8C
|
||||
IogcF/LWe4mFKgBi8O3cS03YowoPgkPBh/4lXBiCXio5rkKJaMJrJMNDmoQTSzqU
|
||||
80r8zuECgYEA8PqoY3p6lpUIxR1i4jrDzcmnFJ8vNoehr4SySR8G5EkPloltT0OK
|
||||
o1d7g/b19RbulR7XnMq/H4Ic5GDiP2EEI5zM093JbV5luQZHwKrqTykXVdlgiDan
|
||||
GAxsJ9Q31ASAixCA92una1+08Xe8N7aNBuJNPuvaPB2603dO30hIlQkCgYEA0Bwu
|
||||
oqZMh8Td4pB3nUQM08NiLrYy1vwzbAHhOx3VxRGiF7x8X32NSnAzQmusqYuT6j02
|
||||
o4Jg0Jyn+XV67AD4f0D8+4urQEnrfnf32GxSvefucFbekypGLR8w3WR18mkBhVst
|
||||
WTkKqZwoJtmyJlbSRRpDZ6ewQqZ/a79NmMkxmZ8CgYEAwQQ0jgGTYTucW64u/v+M
|
||||
yC8l2dmrCmVW92w1FWZ5sa5ngu8uk9eIm06+CzRrS1WD4gNjNh4bOdSQ6chET/mY
|
||||
RCIa2fSCm0yJ88p4/HSp2qASJdxIerIz4opIsxpDYVn9z+V3NzaOUe3F08dRBdr9
|
||||
WK84qhZlpdM2Spz8mtGd+WkCgYBCV3mWaCUlcuC5BQzcmYDtUO/PrE1ws11BJShD
|
||||
zDMFa6Wco32Sg1ezTylIF0MnmVNB7NmqLjnmxsnVgFn7OiP9jR4YomGpUOc9ncjo
|
||||
uT93QqSEM20oxOUyJStSqF/hMxBFDtfaBZEcmKdEG0nrZuoJFWI/fPl3hdRA6O83
|
||||
sYuaSQKBgQCGTN1vEshVEu2Sbdpw+9p/JpHOWT4HuTU78EGfjd4wDtWgme3WgbB4
|
||||
geixhSTsoGdb95Da5Wp81nEUN7P/VE9VTX74qcXD3AseCYmhmbFaZTOi0kjYEbAQ
|
||||
wGuBa8CDIzttKhBsBQWZpG7YQq3pOqKLgKOuwwf6kJk1eh+HMS7ktQ==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
24
src/web_control/frontend/node_modules/@achrinza/node-ipc/local-node-ipc-certs/server.pub
generated
vendored
24
src/web_control/frontend/node_modules/@achrinza/node-ipc/local-node-ipc-certs/server.pub
generated
vendored
@ -0,0 +1,24 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID+zCCAuOgAwIBAgIJANhisawO7GXuMA0GCSqGSIb3DQEBCwUAMIGTMQswCQYD
|
||||
VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNVGhvdXNhbmQg
|
||||
T2FrczEUMBIGA1UECgwLRGlnaU5vdyBJbmMxDDAKBgNVBAsMA1JuRDEQMA4GA1UE
|
||||
AwwHRGlnaU5vdzEhMB8GCSqGSIb3DQEJARYSYnJhbmRvbkBkaWdpbm93Lml0MB4X
|
||||
DTE2MDkxMDIxMDIwNFoXDTE3MDkxMDIxMDIwNFowgZMxCzAJBgNVBAYTAlVTMRMw
|
||||
EQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1UaG91c2FuZCBPYWtzMRQwEgYD
|
||||
VQQKDAtEaWdpTm93IEluYzEMMAoGA1UECwwDUm5EMRAwDgYDVQQDDAdEaWdpTm93
|
||||
MSEwHwYJKoZIhvcNAQkBFhJicmFuZG9uQGRpZ2lub3cuaXQwggEiMA0GCSqGSIb3
|
||||
DQEBAQUAA4IBDwAwggEKAoIBAQDD5jAhY9ACHxaWE8Bpqx9TJvXcVyDQ/TL5Sa0A
|
||||
ekDGdQoDFzX9uSXgU2NtL6SRMaQi9ETg0cmHgMyoQMGx/ubCF9o6XxtMKi6y3KHX
|
||||
hvPEkp0zULFD8vYaxMjAXW9kK+o6+tXWCUuu5GvDw+9IVpa3UkBnwJSG3J11HeK2
|
||||
RIX6y5M5HGH5pSNSt7J+5pbHR18hAtg7Ex5Nr+D3gCv1Dso8JeDGYOq7wNUKa6sM
|
||||
faPPqIWS1un6I2+tR+zzxjcjQTz9BEEArfuPt8Snb3pBxggMkqRLbPaV6cnKQB1q
|
||||
oX2ouFvfOsxSka3lVRRI10d5fMJCvsn3ADtNaMJedCHd3/GXAgMBAAGjUDBOMB0G
|
||||
A1UdDgQWBBSWtsrqQGryJVSJER5int40YIpuxjAfBgNVHSMEGDAWgBSWtsrqQGry
|
||||
JVSJER5int40YIpuxjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDA
|
||||
NySrqGBF+h/UCph/YEXTTea8MQIvihLecZ0VpZ/0VDZfwxzZns5oV0znoZEQcyYZ
|
||||
olTr40jyCt0Ex59VRWRUUfdR1JgZtaMd29iYxUvGy+tK5pw75mIl3upc8hEe2uzN
|
||||
c8hynlLSh9y75GM3RUkUlkSIrIRQIvOTW1+lhqBzhesvYjScCbH8MXL5e6qCkbhZ
|
||||
tP5xuTjQlY38oJxDmMHmIxholxCxQtnEVTpKn0lp2diPMXU9qbsTuZ9eYTwZabSk
|
||||
+CXrtjYtaZPkHGDSldWdMdbHw/+81ViMA3CA2f61aqTcIYyAZz8o9b+4IghLLicZ
|
||||
C84hYbMbCAz0rp6bt+PJ
|
||||
-----END CERTIFICATE-----
|
||||
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const IPC = require('./services/IPC.js');
|
||||
|
||||
class IPCModule extends IPC{
|
||||
constructor(){
|
||||
super();
|
||||
//include IPC to make extensible
|
||||
Object.defineProperty(
|
||||
this,
|
||||
'IPC',
|
||||
{
|
||||
enumerable:true,
|
||||
writable:false,
|
||||
value:IPC
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports=new IPCModule;
|
||||
@ -0,0 +1,66 @@
|
||||
{
|
||||
"name": "@achrinza/node-ipc",
|
||||
"version": "9.2.9",
|
||||
"description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.",
|
||||
"main": "node-ipc.js",
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"engines": {
|
||||
"node": "8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 || 18 || 19 || 20 || 21 || 22"
|
||||
},
|
||||
"dependencies": {
|
||||
"@node-ipc/js-queue": "2.0.3",
|
||||
"event-pubsub": "4.3.0",
|
||||
"js-message": "1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"istanbul": "0.4.1",
|
||||
"jasmine": "2.4.1",
|
||||
"lockfile-lint": "^4.7.4",
|
||||
"node-cmd": "2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"istanbul": "istanbul cover -x ./spec/**",
|
||||
"test-windows": "npm run-script istanbul -- ./node_modules/jasmine/bin/jasmine.js",
|
||||
"test": "npm run-script istanbul -- jasmine"
|
||||
},
|
||||
"keywords": [
|
||||
"IPC",
|
||||
"Neural Networking",
|
||||
"Machine Learning",
|
||||
"inter",
|
||||
"process",
|
||||
"communication",
|
||||
"unix",
|
||||
"windows",
|
||||
"win",
|
||||
"socket",
|
||||
"TCP",
|
||||
"UDP",
|
||||
"domain",
|
||||
"sockets",
|
||||
"threaded",
|
||||
"communication",
|
||||
"multi",
|
||||
"process",
|
||||
"shared",
|
||||
"memory"
|
||||
],
|
||||
"author": "Brandon Nozaki Miller",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/achrinza/node-ipc.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/achrinza/node-ipc/issues"
|
||||
},
|
||||
"files": [
|
||||
"dao",
|
||||
"entities",
|
||||
"local-node-ipc-certs",
|
||||
"services"
|
||||
],
|
||||
"homepage": "https://github.com/achrinza/node-ipc"
|
||||
}
|
||||
@ -0,0 +1,338 @@
|
||||
'use strict';
|
||||
|
||||
const Defaults = require('../entities/Defaults.js'),
|
||||
Client = require('../dao/client.js'),
|
||||
Server = require('../dao/socketServer.js'),
|
||||
util = require('util');
|
||||
|
||||
class IPC{
|
||||
constructor(){
|
||||
Object.defineProperties(
|
||||
this,
|
||||
{
|
||||
config : {
|
||||
enumerable:true,
|
||||
writable:true,
|
||||
value:new Defaults
|
||||
},
|
||||
connectTo : {
|
||||
enumerable:true,
|
||||
writable:false,
|
||||
value:connect
|
||||
},
|
||||
connectToNet: {
|
||||
enumerable:true,
|
||||
writable:false,
|
||||
value:connectNet
|
||||
},
|
||||
disconnect : {
|
||||
enumerable:true,
|
||||
writable:false,
|
||||
value:disconnect
|
||||
},
|
||||
serve : {
|
||||
enumerable:true,
|
||||
writable:false,
|
||||
value:serve
|
||||
},
|
||||
serveNet : {
|
||||
enumerable:true,
|
||||
writable:false,
|
||||
value:serveNet
|
||||
},
|
||||
of : {
|
||||
enumerable:true,
|
||||
writable:true,
|
||||
value:{}
|
||||
},
|
||||
server : {
|
||||
enumerable:true,
|
||||
writable:true,
|
||||
configurable:true,
|
||||
value:false
|
||||
},
|
||||
log : {
|
||||
enumerable:true,
|
||||
writable:false,
|
||||
value:log
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function log(...args){
|
||||
if(this.config.silent){
|
||||
return;
|
||||
}
|
||||
|
||||
for(let i=0, count=args.length; i<count; i++){
|
||||
if(typeof args[i] != 'object'){
|
||||
continue;
|
||||
}
|
||||
|
||||
args[i]=util.inspect(
|
||||
args[i],
|
||||
{
|
||||
depth:this.config.logDepth,
|
||||
colors:this.config.logInColor
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
this.config.logger(
|
||||
args.join(' ')
|
||||
);
|
||||
}
|
||||
|
||||
function disconnect(id){
|
||||
if(!this.of[id]){
|
||||
return;
|
||||
}
|
||||
|
||||
this.of[id].explicitlyDisconnected=true;
|
||||
|
||||
this.of[id].off('*','*');
|
||||
if(this.of[id].socket){
|
||||
if(this.of[id].socket.destroy){
|
||||
this.of[id].socket.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
delete this.of[id];
|
||||
}
|
||||
|
||||
function serve(path,callback){
|
||||
if(typeof path=='function'){
|
||||
callback=path;
|
||||
path=false;
|
||||
}
|
||||
if(!path){
|
||||
this.log(
|
||||
'Server path not specified, so defaulting to',
|
||||
'ipc.config.socketRoot + ipc.config.appspace + ipc.config.id',
|
||||
this.config.socketRoot+this.config.appspace+this.config.id
|
||||
);
|
||||
path=this.config.socketRoot+this.config.appspace+this.config.id;
|
||||
}
|
||||
|
||||
if(!callback){
|
||||
callback=emptyCallback;
|
||||
}
|
||||
|
||||
this.server=new Server(
|
||||
path,
|
||||
this.config,
|
||||
log
|
||||
);
|
||||
|
||||
this.server.on(
|
||||
'start',
|
||||
callback
|
||||
);
|
||||
}
|
||||
|
||||
function emptyCallback(){
|
||||
//Do Nothing
|
||||
}
|
||||
|
||||
function serveNet(host,port,UDPType,callback){
|
||||
if(typeof host=='number'){
|
||||
callback=UDPType;
|
||||
UDPType=port;
|
||||
port=host;
|
||||
host=false;
|
||||
}
|
||||
if(typeof host=='function'){
|
||||
callback=host;
|
||||
UDPType=false;
|
||||
host=false;
|
||||
port=false;
|
||||
}
|
||||
if(!host){
|
||||
this.log(
|
||||
'Server host not specified, so defaulting to',
|
||||
'ipc.config.networkHost',
|
||||
this.config.networkHost
|
||||
);
|
||||
host=this.config.networkHost;
|
||||
}
|
||||
if(host.toLowerCase()=='udp4' || host.toLowerCase()=='udp6'){
|
||||
callback=port;
|
||||
UDPType=host.toLowerCase();
|
||||
port=false;
|
||||
host=this.config.networkHost;
|
||||
}
|
||||
|
||||
if(typeof port=='string'){
|
||||
callback=UDPType;
|
||||
UDPType=port;
|
||||
port=false;
|
||||
}
|
||||
if(typeof port=='function'){
|
||||
callback=port;
|
||||
UDPType=false;
|
||||
port=false;
|
||||
}
|
||||
if(!port){
|
||||
this.log(
|
||||
'Server port not specified, so defaulting to',
|
||||
'ipc.config.networkPort',
|
||||
this.config.networkPort
|
||||
);
|
||||
port=this.config.networkPort;
|
||||
}
|
||||
|
||||
if(typeof UDPType=='function'){
|
||||
callback=UDPType;
|
||||
UDPType=false;
|
||||
}
|
||||
|
||||
if(!callback){
|
||||
callback=emptyCallback;
|
||||
}
|
||||
|
||||
this.server=new Server(
|
||||
host,
|
||||
this.config,
|
||||
log,
|
||||
port
|
||||
);
|
||||
|
||||
if(UDPType){
|
||||
this.server[UDPType]=true;
|
||||
if(UDPType === "udp4" && host === "::1") {
|
||||
// bind udp4 socket to an ipv4 address
|
||||
this.server.path = "127.0.0.1";
|
||||
}
|
||||
}
|
||||
|
||||
this.server.on(
|
||||
'start',
|
||||
callback
|
||||
);
|
||||
}
|
||||
|
||||
function connect(id,path,callback){
|
||||
if(typeof path == 'function'){
|
||||
callback=path;
|
||||
path=false;
|
||||
}
|
||||
|
||||
if(!callback){
|
||||
callback=emptyCallback;
|
||||
}
|
||||
|
||||
if(!id){
|
||||
this.log(
|
||||
'Service id required',
|
||||
'Requested service connection without specifying service id. Aborting connection attempt'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!path){
|
||||
this.log(
|
||||
'Service path not specified, so defaulting to',
|
||||
'ipc.config.socketRoot + ipc.config.appspace + id',
|
||||
(this.config.socketRoot+this.config.appspace+id).data
|
||||
);
|
||||
path=this.config.socketRoot+this.config.appspace+id;
|
||||
}
|
||||
|
||||
if(this.of[id]){
|
||||
if(!this.of[id].socket.destroyed){
|
||||
this.log(
|
||||
'Already Connected to',
|
||||
id,
|
||||
'- So executing success without connection'
|
||||
);
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
this.of[id].socket.destroy();
|
||||
}
|
||||
|
||||
this.of[id] = new Client(this.config,this.log);
|
||||
this.of[id].id = id;
|
||||
this.of[id].path = path;
|
||||
|
||||
this.of[id].connect();
|
||||
|
||||
callback(this);
|
||||
}
|
||||
|
||||
function connectNet(id,host,port,callback){
|
||||
if(!id){
|
||||
this.log(
|
||||
'Service id required',
|
||||
'Requested service connection without specifying service id. Aborting connection attempt'
|
||||
);
|
||||
return;
|
||||
}
|
||||
if(typeof host=='number'){
|
||||
callback=port;
|
||||
port=host;
|
||||
host=false;
|
||||
}
|
||||
if(typeof host=='function'){
|
||||
callback=host;
|
||||
host=false;
|
||||
port=false;
|
||||
}
|
||||
if(!host){
|
||||
this.log(
|
||||
'Server host not specified, so defaulting to',
|
||||
'ipc.config.networkHost',
|
||||
this.config.networkHost
|
||||
);
|
||||
host=this.config.networkHost;
|
||||
}
|
||||
|
||||
if(typeof port=='function'){
|
||||
callback=port;
|
||||
port=false;
|
||||
}
|
||||
if(!port){
|
||||
this.log(
|
||||
'Server port not specified, so defaulting to',
|
||||
'ipc.config.networkPort',
|
||||
this.config.networkPort
|
||||
);
|
||||
port=this.config.networkPort;
|
||||
}
|
||||
|
||||
if(typeof callback == 'string'){
|
||||
UDPType=callback;
|
||||
callback=false;
|
||||
}
|
||||
if(!callback){
|
||||
callback=emptyCallback;
|
||||
}
|
||||
|
||||
if(this.of[id]){
|
||||
if(!this.of[id].socket.destroyed){
|
||||
|
||||
this.log(
|
||||
'Already Connected to',
|
||||
id,
|
||||
'- So executing success without connection'
|
||||
);
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
this.of[id].socket.destroy();
|
||||
}
|
||||
|
||||
this.of[id] = new Client(this.config,this.log);
|
||||
this.of[id].id = id;
|
||||
(this.of[id].socket)? this.of[id].socket.id=id:null;
|
||||
this.of[id].path = host;
|
||||
this.of[id].port = port;
|
||||
|
||||
this.of[id].connect();
|
||||
|
||||
callback(this);
|
||||
}
|
||||
|
||||
module.exports=IPC;
|
||||
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -0,0 +1,19 @@
|
||||
# @babel/code-frame
|
||||
|
||||
> Generate errors that contain a code frame that point to source locations.
|
||||
|
||||
See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/code-frame
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/code-frame --dev
|
||||
```
|
||||
@ -0,0 +1,216 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var picocolors = require('picocolors');
|
||||
var jsTokens = require('js-tokens');
|
||||
var helperValidatorIdentifier = require('@babel/helper-validator-identifier');
|
||||
|
||||
function isColorSupported() {
|
||||
return (typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported
|
||||
);
|
||||
}
|
||||
const compose = (f, g) => v => f(g(v));
|
||||
function buildDefs(colors) {
|
||||
return {
|
||||
keyword: colors.cyan,
|
||||
capitalized: colors.yellow,
|
||||
jsxIdentifier: colors.yellow,
|
||||
punctuator: colors.yellow,
|
||||
number: colors.magenta,
|
||||
string: colors.green,
|
||||
regex: colors.magenta,
|
||||
comment: colors.gray,
|
||||
invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
|
||||
gutter: colors.gray,
|
||||
marker: compose(colors.red, colors.bold),
|
||||
message: compose(colors.red, colors.bold),
|
||||
reset: colors.reset
|
||||
};
|
||||
}
|
||||
const defsOn = buildDefs(picocolors.createColors(true));
|
||||
const defsOff = buildDefs(picocolors.createColors(false));
|
||||
function getDefs(enabled) {
|
||||
return enabled ? defsOn : defsOff;
|
||||
}
|
||||
|
||||
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
||||
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
||||
const BRACKET = /^[()[\]{}]$/;
|
||||
let tokenize;
|
||||
{
|
||||
const JSX_TAG = /^[a-z][\w-]*$/i;
|
||||
const getTokenType = function (token, offset, text) {
|
||||
if (token.type === "name") {
|
||||
if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {
|
||||
return "keyword";
|
||||
}
|
||||
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
||||
return "jsxIdentifier";
|
||||
}
|
||||
if (token.value[0] !== token.value[0].toLowerCase()) {
|
||||
return "capitalized";
|
||||
}
|
||||
}
|
||||
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
||||
return "bracket";
|
||||
}
|
||||
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
||||
return "punctuator";
|
||||
}
|
||||
return token.type;
|
||||
};
|
||||
tokenize = function* (text) {
|
||||
let match;
|
||||
while (match = jsTokens.default.exec(text)) {
|
||||
const token = jsTokens.matchToToken(match);
|
||||
yield {
|
||||
type: getTokenType(token, match.index, text),
|
||||
value: token.value
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
function highlight(text) {
|
||||
if (text === "") return "";
|
||||
const defs = getDefs(true);
|
||||
let highlighted = "";
|
||||
for (const {
|
||||
type,
|
||||
value
|
||||
} of tokenize(text)) {
|
||||
if (type in defs) {
|
||||
highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join("\n");
|
||||
} else {
|
||||
highlighted += value;
|
||||
}
|
||||
}
|
||||
return highlighted;
|
||||
}
|
||||
|
||||
let deprecationWarningShown = false;
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
function getMarkerLines(loc, source, opts) {
|
||||
const startLoc = Object.assign({
|
||||
column: 0,
|
||||
line: -1
|
||||
}, loc.start);
|
||||
const endLoc = Object.assign({}, startLoc, loc.end);
|
||||
const {
|
||||
linesAbove = 2,
|
||||
linesBelow = 3
|
||||
} = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
const endLine = endLoc.line;
|
||||
const endColumn = endLoc.column;
|
||||
let start = Math.max(startLine - (linesAbove + 1), 0);
|
||||
let end = Math.min(source.length, endLine + linesBelow);
|
||||
if (startLine === -1) {
|
||||
start = 0;
|
||||
}
|
||||
if (endLine === -1) {
|
||||
end = source.length;
|
||||
}
|
||||
const lineDiff = endLine - startLine;
|
||||
const markerLines = {};
|
||||
if (lineDiff) {
|
||||
for (let i = 0; i <= lineDiff; i++) {
|
||||
const lineNumber = i + startLine;
|
||||
if (!startColumn) {
|
||||
markerLines[lineNumber] = true;
|
||||
} else if (i === 0) {
|
||||
const sourceLength = source[lineNumber - 1].length;
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||
} else if (i === lineDiff) {
|
||||
markerLines[lineNumber] = [0, endColumn];
|
||||
} else {
|
||||
const sourceLength = source[lineNumber - i].length;
|
||||
markerLines[lineNumber] = [0, sourceLength];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (startColumn === endColumn) {
|
||||
if (startColumn) {
|
||||
markerLines[startLine] = [startColumn, 0];
|
||||
} else {
|
||||
markerLines[startLine] = true;
|
||||
}
|
||||
} else {
|
||||
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
||||
}
|
||||
}
|
||||
return {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
};
|
||||
}
|
||||
function codeFrameColumns(rawLines, loc, opts = {}) {
|
||||
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
||||
const defs = getDefs(shouldHighlight);
|
||||
const lines = rawLines.split(NEWLINE);
|
||||
const {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
} = getMarkerLines(loc, lines, opts);
|
||||
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||
const numberMaxWidth = String(end).length;
|
||||
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
||||
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
||||
const number = start + 1 + index;
|
||||
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
||||
const gutter = ` ${paddedNumber} |`;
|
||||
const hasMarker = markerLines[number];
|
||||
const lastMarkerLine = !markerLines[number + 1];
|
||||
if (hasMarker) {
|
||||
let markerLine = "";
|
||||
if (Array.isArray(hasMarker)) {
|
||||
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
||||
const numberOfMarkers = hasMarker[1] || 1;
|
||||
markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
|
||||
if (lastMarkerLine && opts.message) {
|
||||
markerLine += " " + defs.message(opts.message);
|
||||
}
|
||||
}
|
||||
return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
||||
} else {
|
||||
return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
||||
}
|
||||
}).join("\n");
|
||||
if (opts.message && !hasColumns) {
|
||||
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
||||
}
|
||||
if (shouldHighlight) {
|
||||
return defs.reset(frame);
|
||||
} else {
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
function index (rawLines, lineNumber, colNumber, opts = {}) {
|
||||
if (!deprecationWarningShown) {
|
||||
deprecationWarningShown = true;
|
||||
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
||||
if (process.emitWarning) {
|
||||
process.emitWarning(message, "DeprecationWarning");
|
||||
} else {
|
||||
const deprecationError = new Error(message);
|
||||
deprecationError.name = "DeprecationWarning";
|
||||
console.warn(new Error(message));
|
||||
}
|
||||
}
|
||||
colNumber = Math.max(colNumber, 0);
|
||||
const location = {
|
||||
start: {
|
||||
column: colNumber,
|
||||
line: lineNumber
|
||||
}
|
||||
};
|
||||
return codeFrameColumns(rawLines, location, opts);
|
||||
}
|
||||
|
||||
exports.codeFrameColumns = codeFrameColumns;
|
||||
exports.default = index;
|
||||
exports.highlight = highlight;
|
||||
//# sourceMappingURL=index.js.map
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@babel/code-frame",
|
||||
"version": "7.27.1",
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-code-frame",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-code-frame"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.27.1",
|
||||
"js-tokens": "^4.0.0",
|
||||
"picocolors": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"import-meta-resolve": "^4.1.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -0,0 +1,19 @@
|
||||
# @babel/compat-data
|
||||
|
||||
> The compat-data to determine required Babel plugins
|
||||
|
||||
See our website [@babel/compat-data](https://babeljs.io/docs/babel-compat-data) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/compat-data
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/compat-data
|
||||
```
|
||||
@ -0,0 +1,2 @@
|
||||
// Todo (Babel 8): remove this file as Babel 8 drop support of core-js 2
|
||||
module.exports = require("./data/corejs2-built-ins.json");
|
||||
@ -0,0 +1,2 @@
|
||||
// Todo (Babel 8): remove this file now that it is included in babel-plugin-polyfill-corejs3
|
||||
module.exports = require("./data/corejs3-shipped-proposals.json");
|
||||
2106
src/web_control/frontend/node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
2106
src/web_control/frontend/node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
||||
[
|
||||
"esnext.promise.all-settled",
|
||||
"esnext.string.match-all",
|
||||
"esnext.global-this"
|
||||
]
|
||||
18
src/web_control/frontend/node_modules/@babel/compat-data/data/native-modules.json
generated
vendored
18
src/web_control/frontend/node_modules/@babel/compat-data/data/native-modules.json
generated
vendored
@ -0,0 +1,18 @@
|
||||
{
|
||||
"es6.module": {
|
||||
"chrome": "61",
|
||||
"and_chr": "61",
|
||||
"edge": "16",
|
||||
"firefox": "60",
|
||||
"and_ff": "60",
|
||||
"node": "13.2.0",
|
||||
"opera": "48",
|
||||
"op_mob": "45",
|
||||
"safari": "10.1",
|
||||
"ios": "10.3",
|
||||
"samsung": "8.2",
|
||||
"android": "61",
|
||||
"electron": "2.0",
|
||||
"ios_saf": "10.3"
|
||||
}
|
||||
}
|
||||
35
src/web_control/frontend/node_modules/@babel/compat-data/data/overlapping-plugins.json
generated
vendored
35
src/web_control/frontend/node_modules/@babel/compat-data/data/overlapping-plugins.json
generated
vendored
@ -0,0 +1,35 @@
|
||||
{
|
||||
"transform-async-to-generator": [
|
||||
"bugfix/transform-async-arrows-in-class"
|
||||
],
|
||||
"transform-parameters": [
|
||||
"bugfix/transform-edge-default-parameters",
|
||||
"bugfix/transform-safari-id-destructuring-collision-in-function-expression"
|
||||
],
|
||||
"transform-function-name": [
|
||||
"bugfix/transform-edge-function-name"
|
||||
],
|
||||
"transform-block-scoping": [
|
||||
"bugfix/transform-safari-block-shadowing",
|
||||
"bugfix/transform-safari-for-shadowing"
|
||||
],
|
||||
"transform-template-literals": [
|
||||
"bugfix/transform-tagged-template-caching"
|
||||
],
|
||||
"transform-optional-chaining": [
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
|
||||
],
|
||||
"proposal-optional-chaining": [
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
|
||||
],
|
||||
"transform-class-properties": [
|
||||
"bugfix/transform-v8-static-class-fields-redefine-readonly",
|
||||
"bugfix/transform-firefox-class-in-computed-class-key",
|
||||
"bugfix/transform-safari-class-field-initializer-scope"
|
||||
],
|
||||
"proposal-class-properties": [
|
||||
"bugfix/transform-v8-static-class-fields-redefine-readonly",
|
||||
"bugfix/transform-firefox-class-in-computed-class-key",
|
||||
"bugfix/transform-safari-class-field-initializer-scope"
|
||||
]
|
||||
}
|
||||
203
src/web_control/frontend/node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
203
src/web_control/frontend/node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
@ -0,0 +1,203 @@
|
||||
{
|
||||
"bugfix/transform-async-arrows-in-class": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "11",
|
||||
"node": "7.6",
|
||||
"deno": "1",
|
||||
"ios": "11",
|
||||
"samsung": "6",
|
||||
"opera_mobile": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"bugfix/transform-edge-default-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "18",
|
||||
"firefox": "52",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-edge-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "79",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"bugfix/transform-safari-block-shadowing": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "12",
|
||||
"firefox": "44",
|
||||
"safari": "11",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ie": "11",
|
||||
"ios": "11",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-safari-for-shadowing": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "11",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ie": "11",
|
||||
"ios": "11",
|
||||
"samsung": "5",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-safari-id-destructuring-collision-in-function-expression": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "14",
|
||||
"firefox": "2",
|
||||
"safari": "16.3",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "16.3",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-tagged-template-caching": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "13",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "3.4",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "13.4",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"transform-optional-chaining": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"rhino": "1.8",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"proposal-optional-chaining": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"rhino": "1.8",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"transform-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-async-to-generator": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "10.1",
|
||||
"node": "7.6",
|
||||
"deno": "1",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"opera_mobile": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"transform-template-literals": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "13",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"transform-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,838 @@
|
||||
{
|
||||
"transform-explicit-resource-management": {
|
||||
"chrome": "134",
|
||||
"edge": "134",
|
||||
"firefox": "141",
|
||||
"node": "24",
|
||||
"electron": "35.0"
|
||||
},
|
||||
"transform-duplicate-named-capturing-groups-regex": {
|
||||
"chrome": "126",
|
||||
"opera": "112",
|
||||
"edge": "126",
|
||||
"firefox": "129",
|
||||
"safari": "17.4",
|
||||
"node": "23",
|
||||
"ios": "17.4",
|
||||
"electron": "31.0"
|
||||
},
|
||||
"transform-regexp-modifiers": {
|
||||
"chrome": "125",
|
||||
"opera": "111",
|
||||
"edge": "125",
|
||||
"firefox": "132",
|
||||
"node": "23",
|
||||
"samsung": "27",
|
||||
"electron": "31.0"
|
||||
},
|
||||
"transform-unicode-sets-regex": {
|
||||
"chrome": "112",
|
||||
"opera": "98",
|
||||
"edge": "112",
|
||||
"firefox": "116",
|
||||
"safari": "17",
|
||||
"node": "20",
|
||||
"deno": "1.32",
|
||||
"ios": "17",
|
||||
"samsung": "23",
|
||||
"opera_mobile": "75",
|
||||
"electron": "24.0"
|
||||
},
|
||||
"bugfix/transform-v8-static-class-fields-redefine-readonly": {
|
||||
"chrome": "98",
|
||||
"opera": "84",
|
||||
"edge": "98",
|
||||
"firefox": "75",
|
||||
"safari": "15",
|
||||
"node": "12",
|
||||
"deno": "1.18",
|
||||
"ios": "15",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "52",
|
||||
"electron": "17.0"
|
||||
},
|
||||
"bugfix/transform-firefox-class-in-computed-class-key": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "126",
|
||||
"safari": "16",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "16",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"bugfix/transform-safari-class-field-initializer-scope": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "69",
|
||||
"safari": "16",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "16",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"transform-class-static-block": {
|
||||
"chrome": "94",
|
||||
"opera": "80",
|
||||
"edge": "94",
|
||||
"firefox": "93",
|
||||
"safari": "16.4",
|
||||
"node": "16.11",
|
||||
"deno": "1.14",
|
||||
"ios": "16.4",
|
||||
"samsung": "17",
|
||||
"opera_mobile": "66",
|
||||
"electron": "15.0"
|
||||
},
|
||||
"proposal-class-static-block": {
|
||||
"chrome": "94",
|
||||
"opera": "80",
|
||||
"edge": "94",
|
||||
"firefox": "93",
|
||||
"safari": "16.4",
|
||||
"node": "16.11",
|
||||
"deno": "1.14",
|
||||
"ios": "16.4",
|
||||
"samsung": "17",
|
||||
"opera_mobile": "66",
|
||||
"electron": "15.0"
|
||||
},
|
||||
"transform-private-property-in-object": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "15",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"proposal-private-property-in-object": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "15",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"transform-class-properties": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "90",
|
||||
"safari": "14.1",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"proposal-class-properties": {
|
||||
"chrome": "74",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "90",
|
||||
"safari": "14.1",
|
||||
"node": "12",
|
||||
"deno": "1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11",
|
||||
"opera_mobile": "53",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"transform-private-methods": {
|
||||
"chrome": "84",
|
||||
"opera": "70",
|
||||
"edge": "84",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "14.6",
|
||||
"deno": "1",
|
||||
"ios": "15",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"proposal-private-methods": {
|
||||
"chrome": "84",
|
||||
"opera": "70",
|
||||
"edge": "84",
|
||||
"firefox": "90",
|
||||
"safari": "15",
|
||||
"node": "14.6",
|
||||
"deno": "1",
|
||||
"ios": "15",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"transform-numeric-separator": {
|
||||
"chrome": "75",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "70",
|
||||
"safari": "13",
|
||||
"node": "12.5",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "11",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "54",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"proposal-numeric-separator": {
|
||||
"chrome": "75",
|
||||
"opera": "62",
|
||||
"edge": "79",
|
||||
"firefox": "70",
|
||||
"safari": "13",
|
||||
"node": "12.5",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "11",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "54",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"transform-logical-assignment-operators": {
|
||||
"chrome": "85",
|
||||
"opera": "71",
|
||||
"edge": "85",
|
||||
"firefox": "79",
|
||||
"safari": "14",
|
||||
"node": "15",
|
||||
"deno": "1.2",
|
||||
"ios": "14",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"proposal-logical-assignment-operators": {
|
||||
"chrome": "85",
|
||||
"opera": "71",
|
||||
"edge": "85",
|
||||
"firefox": "79",
|
||||
"safari": "14",
|
||||
"node": "15",
|
||||
"deno": "1.2",
|
||||
"ios": "14",
|
||||
"samsung": "14",
|
||||
"opera_mobile": "60",
|
||||
"electron": "10.0"
|
||||
},
|
||||
"transform-nullish-coalescing-operator": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "72",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"rhino": "1.8",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"proposal-nullish-coalescing-operator": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
"edge": "80",
|
||||
"firefox": "72",
|
||||
"safari": "13.1",
|
||||
"node": "14",
|
||||
"deno": "1",
|
||||
"ios": "13.4",
|
||||
"samsung": "13",
|
||||
"rhino": "1.8",
|
||||
"opera_mobile": "57",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"transform-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "13.4",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"proposal-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"deno": "1.9",
|
||||
"ios": "13.4",
|
||||
"samsung": "16",
|
||||
"opera_mobile": "64",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"transform-json-strings": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "62",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "9",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-json-strings": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "62",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "9",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-optional-catch-binding": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "58",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-optional-catch-binding": {
|
||||
"chrome": "66",
|
||||
"opera": "53",
|
||||
"edge": "79",
|
||||
"firefox": "58",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "18",
|
||||
"firefox": "52",
|
||||
"safari": "16.3",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "16.3",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-async-generator-functions": {
|
||||
"chrome": "63",
|
||||
"opera": "50",
|
||||
"edge": "79",
|
||||
"firefox": "57",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "46",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-async-generator-functions": {
|
||||
"chrome": "63",
|
||||
"opera": "50",
|
||||
"edge": "79",
|
||||
"firefox": "57",
|
||||
"safari": "12",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "46",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-object-rest-spread": {
|
||||
"chrome": "60",
|
||||
"opera": "47",
|
||||
"edge": "79",
|
||||
"firefox": "55",
|
||||
"safari": "11.1",
|
||||
"node": "8.3",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "44",
|
||||
"electron": "2.0"
|
||||
},
|
||||
"proposal-object-rest-spread": {
|
||||
"chrome": "60",
|
||||
"opera": "47",
|
||||
"edge": "79",
|
||||
"firefox": "55",
|
||||
"safari": "11.1",
|
||||
"node": "8.3",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "8",
|
||||
"opera_mobile": "44",
|
||||
"electron": "2.0"
|
||||
},
|
||||
"transform-dotall-regex": {
|
||||
"chrome": "62",
|
||||
"opera": "49",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "8.10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "8",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "46",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-unicode-property-regex": {
|
||||
"chrome": "64",
|
||||
"opera": "51",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-unicode-property-regex": {
|
||||
"chrome": "64",
|
||||
"opera": "51",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-named-capturing-groups-regex": {
|
||||
"chrome": "64",
|
||||
"opera": "51",
|
||||
"edge": "79",
|
||||
"firefox": "78",
|
||||
"safari": "11.1",
|
||||
"node": "10",
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"transform-async-to-generator": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "11",
|
||||
"node": "7.6",
|
||||
"deno": "1",
|
||||
"ios": "11",
|
||||
"samsung": "6",
|
||||
"opera_mobile": "42",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"transform-exponentiation-operator": {
|
||||
"chrome": "52",
|
||||
"opera": "39",
|
||||
"edge": "14",
|
||||
"firefox": "52",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"deno": "1",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.3"
|
||||
},
|
||||
"transform-template-literals": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "13",
|
||||
"firefox": "34",
|
||||
"safari": "13",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"transform-literals": {
|
||||
"chrome": "44",
|
||||
"opera": "31",
|
||||
"edge": "12",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "32",
|
||||
"electron": "0.30"
|
||||
},
|
||||
"transform-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "79",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-arrow-functions": {
|
||||
"chrome": "47",
|
||||
"opera": "34",
|
||||
"edge": "13",
|
||||
"firefox": "43",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "34",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-block-scoped-functions": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "12",
|
||||
"firefox": "46",
|
||||
"safari": "10",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ie": "11",
|
||||
"ios": "10",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"transform-classes": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-object-super": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-shorthand-properties": {
|
||||
"chrome": "43",
|
||||
"opera": "30",
|
||||
"edge": "12",
|
||||
"firefox": "33",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"rhino": "1.7.14",
|
||||
"opera_mobile": "30",
|
||||
"electron": "0.27"
|
||||
},
|
||||
"transform-duplicate-keys": {
|
||||
"chrome": "42",
|
||||
"opera": "29",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"opera_mobile": "29",
|
||||
"electron": "0.25"
|
||||
},
|
||||
"transform-computed-properties": {
|
||||
"chrome": "44",
|
||||
"opera": "31",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "8",
|
||||
"samsung": "4",
|
||||
"rhino": "1.8",
|
||||
"opera_mobile": "32",
|
||||
"electron": "0.30"
|
||||
},
|
||||
"transform-for-of": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-sticky-regex": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "13",
|
||||
"firefox": "3",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-unicode-escapes": {
|
||||
"chrome": "44",
|
||||
"opera": "31",
|
||||
"edge": "12",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "32",
|
||||
"electron": "0.30"
|
||||
},
|
||||
"transform-unicode-regex": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "13",
|
||||
"firefox": "46",
|
||||
"safari": "12",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "12",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-spread": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-destructuring": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "11",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "11",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-typeof-symbol": {
|
||||
"chrome": "48",
|
||||
"opera": "35",
|
||||
"edge": "12",
|
||||
"firefox": "36",
|
||||
"safari": "9",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "5",
|
||||
"rhino": "1.8",
|
||||
"opera_mobile": "35",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-new-target": {
|
||||
"chrome": "46",
|
||||
"opera": "33",
|
||||
"edge": "14",
|
||||
"firefox": "41",
|
||||
"safari": "10",
|
||||
"node": "5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "33",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"transform-regenerator": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
"edge": "13",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"transform-member-expression-literals": {
|
||||
"chrome": "7",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.4",
|
||||
"deno": "1",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "12",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"transform-property-literals": {
|
||||
"chrome": "7",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.4",
|
||||
"deno": "1",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "12",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"transform-reserved-words": {
|
||||
"chrome": "13",
|
||||
"opera": "10.50",
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.6",
|
||||
"deno": "1",
|
||||
"ie": "9",
|
||||
"android": "4.4",
|
||||
"ios": "6",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"opera_mobile": "10.1",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"transform-export-namespace-from": {
|
||||
"chrome": "72",
|
||||
"deno": "1.0",
|
||||
"edge": "79",
|
||||
"firefox": "80",
|
||||
"node": "13.2.0",
|
||||
"opera": "60",
|
||||
"opera_mobile": "51",
|
||||
"safari": "14.1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11.0",
|
||||
"android": "72",
|
||||
"electron": "5.0"
|
||||
},
|
||||
"proposal-export-namespace-from": {
|
||||
"chrome": "72",
|
||||
"deno": "1.0",
|
||||
"edge": "79",
|
||||
"firefox": "80",
|
||||
"node": "13.2.0",
|
||||
"opera": "60",
|
||||
"opera_mobile": "51",
|
||||
"safari": "14.1",
|
||||
"ios": "14.5",
|
||||
"samsung": "11.0",
|
||||
"android": "72",
|
||||
"electron": "5.0"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/native-modules.json");
|
||||
2
src/web_control/frontend/node_modules/@babel/compat-data/overlapping-plugins.js
generated
vendored
2
src/web_control/frontend/node_modules/@babel/compat-data/overlapping-plugins.js
generated
vendored
@ -0,0 +1,2 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/overlapping-plugins.json");
|
||||
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "@babel/compat-data",
|
||||
"version": "7.28.5",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "The compat-data to determine required Babel plugins",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-compat-data"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"exports": {
|
||||
"./plugins": "./plugins.js",
|
||||
"./native-modules": "./native-modules.js",
|
||||
"./corejs2-built-ins": "./corejs2-built-ins.js",
|
||||
"./corejs3-shipped-proposals": "./corejs3-shipped-proposals.js",
|
||||
"./overlapping-plugins": "./overlapping-plugins.js",
|
||||
"./plugin-bugfixes": "./plugin-bugfixes.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.mjs && node ./scripts/build-modules-support.mjs && node ./scripts/build-bugfixes-targets.mjs"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"compat-table",
|
||||
"compat-data"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@mdn/browser-compat-data": "^6.0.8",
|
||||
"core-js-compat": "^3.43.0",
|
||||
"electron-to-chromium": "^1.5.140"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/plugin-bugfixes.json");
|
||||
@ -0,0 +1,2 @@
|
||||
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||
module.exports = require("./data/plugins.json");
|
||||
22
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/LICENSE
generated
vendored
22
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/LICENSE
generated
vendored
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
19
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/README.md
generated
vendored
19
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/README.md
generated
vendored
@ -0,0 +1,19 @@
|
||||
# @babel/helper-compilation-targets
|
||||
|
||||
> Helper functions on Babel compilation targets
|
||||
|
||||
See our website [@babel/helper-compilation-targets](https://babeljs.io/docs/babel-helper-compilation-targets) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-compilation-targets
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-compilation-targets
|
||||
```
|
||||
28
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/debug.js
generated
vendored
28
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/debug.js
generated
vendored
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getInclusionReasons = getInclusionReasons;
|
||||
var _semver = require("semver");
|
||||
var _pretty = require("./pretty.js");
|
||||
var _utils = require("./utils.js");
|
||||
function getInclusionReasons(item, targetVersions, list) {
|
||||
const minVersions = list[item] || {};
|
||||
return Object.keys(targetVersions).reduce((result, env) => {
|
||||
const minVersion = (0, _utils.getLowestImplementedVersion)(minVersions, env);
|
||||
const targetVersion = targetVersions[env];
|
||||
if (!minVersion) {
|
||||
result[env] = (0, _pretty.prettifyVersion)(targetVersion);
|
||||
} else {
|
||||
const minIsUnreleased = (0, _utils.isUnreleasedVersion)(minVersion, env);
|
||||
const targetIsUnreleased = (0, _utils.isUnreleasedVersion)(targetVersion, env);
|
||||
if (!targetIsUnreleased && (minIsUnreleased || _semver.lt(targetVersion.toString(), (0, _utils.semverify)(minVersion)))) {
|
||||
result[env] = (0, _pretty.prettifyVersion)(targetVersion);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}, {});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=debug.js.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"names":["_semver","require","_pretty","_utils","getInclusionReasons","item","targetVersions","list","minVersions","Object","keys","reduce","result","env","minVersion","getLowestImplementedVersion","targetVersion","prettifyVersion","minIsUnreleased","isUnreleasedVersion","targetIsUnreleased","semver","lt","toString","semverify"],"sources":["../src/debug.ts"],"sourcesContent":["import semver from \"semver\";\nimport { prettifyVersion } from \"./pretty.ts\";\nimport {\n semverify,\n isUnreleasedVersion,\n getLowestImplementedVersion,\n} from \"./utils.ts\";\nimport type { Target, Targets } from \"./types.ts\";\n\nexport function getInclusionReasons(\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) {\n const minVersions = list[item] || {};\n\n return (Object.keys(targetVersions) as Target[]).reduce(\n (result, env) => {\n const minVersion = getLowestImplementedVersion(minVersions, env);\n const targetVersion = targetVersions[env];\n\n if (!minVersion) {\n result[env] = prettifyVersion(targetVersion);\n } else {\n const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n if (\n !targetIsUnreleased &&\n (minIsUnreleased ||\n semver.lt(targetVersion.toString(), semverify(minVersion)))\n ) {\n result[env] = prettifyVersion(targetVersion);\n }\n }\n\n return result;\n },\n {} as Partial<Record<Target, string>>,\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOO,SAASG,mBAAmBA,CACjCC,IAAY,EACZC,cAAuB,EACvBC,IAAgC,EAChC;EACA,MAAMC,WAAW,GAAGD,IAAI,CAACF,IAAI,CAAC,IAAI,CAAC,CAAC;EAEpC,OAAQI,MAAM,CAACC,IAAI,CAACJ,cAAc,CAAC,CAAcK,MAAM,CACrD,CAACC,MAAM,EAAEC,GAAG,KAAK;IACf,MAAMC,UAAU,GAAG,IAAAC,kCAA2B,EAACP,WAAW,EAAEK,GAAG,CAAC;IAChE,MAAMG,aAAa,GAAGV,cAAc,CAACO,GAAG,CAAC;IAEzC,IAAI,CAACC,UAAU,EAAE;MACfF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;IAC9C,CAAC,MAAM;MACL,MAAME,eAAe,GAAG,IAAAC,0BAAmB,EAACL,UAAU,EAAED,GAAG,CAAC;MAC5D,MAAMO,kBAAkB,GAAG,IAAAD,0BAAmB,EAACH,aAAa,EAAEH,GAAG,CAAC;MAElE,IACE,CAACO,kBAAkB,KAClBF,eAAe,IACdG,OAAM,CAACC,EAAE,CAACN,aAAa,CAACO,QAAQ,CAAC,CAAC,EAAE,IAAAC,gBAAS,EAACV,UAAU,CAAC,CAAC,CAAC,EAC7D;QACAF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;MAC9C;IACF;IAEA,OAAOJ,MAAM;EACf,CAAC,EACD,CAAC,CACH,CAAC;AACH","ignoreList":[]}
|
||||
@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = filterItems;
|
||||
exports.isRequired = isRequired;
|
||||
exports.targetsSupported = targetsSupported;
|
||||
var _semver = require("semver");
|
||||
var _utils = require("./utils.js");
|
||||
const pluginsCompatData = require("@babel/compat-data/plugins");
|
||||
function targetsSupported(target, support) {
|
||||
const targetEnvironments = Object.keys(target);
|
||||
if (targetEnvironments.length === 0) {
|
||||
return false;
|
||||
}
|
||||
const unsupportedEnvironments = targetEnvironments.filter(environment => {
|
||||
const lowestImplementedVersion = (0, _utils.getLowestImplementedVersion)(support, environment);
|
||||
if (!lowestImplementedVersion) {
|
||||
return true;
|
||||
}
|
||||
const lowestTargetedVersion = target[environment];
|
||||
if ((0, _utils.isUnreleasedVersion)(lowestTargetedVersion, environment)) {
|
||||
return false;
|
||||
}
|
||||
if ((0, _utils.isUnreleasedVersion)(lowestImplementedVersion, environment)) {
|
||||
return true;
|
||||
}
|
||||
if (!_semver.valid(lowestTargetedVersion.toString())) {
|
||||
throw new Error(`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". ` + "Versions must be in semver format (major.minor.patch)");
|
||||
}
|
||||
return _semver.gt((0, _utils.semverify)(lowestImplementedVersion), lowestTargetedVersion.toString());
|
||||
});
|
||||
return unsupportedEnvironments.length === 0;
|
||||
}
|
||||
function isRequired(name, targets, {
|
||||
compatData = pluginsCompatData,
|
||||
includes,
|
||||
excludes
|
||||
} = {}) {
|
||||
if (excludes != null && excludes.has(name)) return false;
|
||||
if (includes != null && includes.has(name)) return true;
|
||||
return !targetsSupported(targets, compatData[name]);
|
||||
}
|
||||
function filterItems(list, includes, excludes, targets, defaultIncludes, defaultExcludes, pluginSyntaxMap) {
|
||||
const result = new Set();
|
||||
const options = {
|
||||
compatData: list,
|
||||
includes,
|
||||
excludes
|
||||
};
|
||||
for (const item in list) {
|
||||
if (isRequired(item, targets, options)) {
|
||||
result.add(item);
|
||||
} else if (pluginSyntaxMap) {
|
||||
const shippedProposalsSyntax = pluginSyntaxMap.get(item);
|
||||
if (shippedProposalsSyntax) {
|
||||
result.add(shippedProposalsSyntax);
|
||||
}
|
||||
}
|
||||
}
|
||||
defaultIncludes == null || defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));
|
||||
defaultExcludes == null || defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));
|
||||
return result;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=filter-items.js.map
|
||||
File diff suppressed because one or more lines are too long
232
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/index.js
generated
vendored
232
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/index.js
generated
vendored
@ -0,0 +1,232 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "TargetNames", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _options.TargetNames;
|
||||
}
|
||||
});
|
||||
exports.default = getTargets;
|
||||
Object.defineProperty(exports, "filterItems", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _filterItems.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "getInclusionReasons", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _debug.getInclusionReasons;
|
||||
}
|
||||
});
|
||||
exports.isBrowsersQueryValid = isBrowsersQueryValid;
|
||||
Object.defineProperty(exports, "isRequired", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _filterItems.isRequired;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "prettifyTargets", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _pretty.prettifyTargets;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "unreleasedLabels", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _targets.unreleasedLabels;
|
||||
}
|
||||
});
|
||||
var _browserslist = require("browserslist");
|
||||
var _helperValidatorOption = require("@babel/helper-validator-option");
|
||||
var _lruCache = require("lru-cache");
|
||||
var _utils = require("./utils.js");
|
||||
var _targets = require("./targets.js");
|
||||
var _options = require("./options.js");
|
||||
var _pretty = require("./pretty.js");
|
||||
var _debug = require("./debug.js");
|
||||
var _filterItems = require("./filter-items.js");
|
||||
const browserModulesData = require("@babel/compat-data/native-modules");
|
||||
const ESM_SUPPORT = browserModulesData["es6.module"];
|
||||
const v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets");
|
||||
function validateTargetNames(targets) {
|
||||
const validTargets = Object.keys(_options.TargetNames);
|
||||
for (const target of Object.keys(targets)) {
|
||||
if (!(target in _options.TargetNames)) {
|
||||
throw new Error(v.formatMessage(`'${target}' is not a valid target
|
||||
- Did you mean '${(0, _helperValidatorOption.findSuggestion)(target, validTargets)}'?`));
|
||||
}
|
||||
}
|
||||
return targets;
|
||||
}
|
||||
function isBrowsersQueryValid(browsers) {
|
||||
return typeof browsers === "string" || Array.isArray(browsers) && browsers.every(b => typeof b === "string");
|
||||
}
|
||||
function validateBrowsers(browsers) {
|
||||
v.invariant(browsers === undefined || isBrowsersQueryValid(browsers), `'${String(browsers)}' is not a valid browserslist query`);
|
||||
return browsers;
|
||||
}
|
||||
function getLowestVersions(browsers) {
|
||||
return browsers.reduce((all, browser) => {
|
||||
const [browserName, browserVersion] = browser.split(" ");
|
||||
const target = _targets.browserNameMap[browserName];
|
||||
if (!target) {
|
||||
return all;
|
||||
}
|
||||
try {
|
||||
const splitVersion = browserVersion.split("-")[0].toLowerCase();
|
||||
const isSplitUnreleased = (0, _utils.isUnreleasedVersion)(splitVersion, target);
|
||||
if (!all[target]) {
|
||||
all[target] = isSplitUnreleased ? splitVersion : (0, _utils.semverify)(splitVersion);
|
||||
return all;
|
||||
}
|
||||
const version = all[target];
|
||||
const isUnreleased = (0, _utils.isUnreleasedVersion)(version, target);
|
||||
if (isUnreleased && isSplitUnreleased) {
|
||||
all[target] = (0, _utils.getLowestUnreleased)(version, splitVersion, target);
|
||||
} else if (isUnreleased) {
|
||||
all[target] = (0, _utils.semverify)(splitVersion);
|
||||
} else if (!isUnreleased && !isSplitUnreleased) {
|
||||
const parsedBrowserVersion = (0, _utils.semverify)(splitVersion);
|
||||
all[target] = (0, _utils.semverMin)(version, parsedBrowserVersion);
|
||||
}
|
||||
} catch (_) {}
|
||||
return all;
|
||||
}, {});
|
||||
}
|
||||
function outputDecimalWarning(decimalTargets) {
|
||||
if (!decimalTargets.length) {
|
||||
return;
|
||||
}
|
||||
console.warn("Warning, the following targets are using a decimal version:\n");
|
||||
decimalTargets.forEach(({
|
||||
target,
|
||||
value
|
||||
}) => console.warn(` ${target}: ${value}`));
|
||||
console.warn(`
|
||||
We recommend using a string for minor/patch versions to avoid numbers like 6.10
|
||||
getting parsed as 6.1, which can lead to unexpected behavior.
|
||||
`);
|
||||
}
|
||||
function semverifyTarget(target, value) {
|
||||
try {
|
||||
return (0, _utils.semverify)(value);
|
||||
} catch (_) {
|
||||
throw new Error(v.formatMessage(`'${value}' is not a valid value for 'targets.${target}'.`));
|
||||
}
|
||||
}
|
||||
function nodeTargetParser(value) {
|
||||
const parsed = value === true || value === "current" ? process.versions.node.split("-")[0] : semverifyTarget("node", value);
|
||||
return ["node", parsed];
|
||||
}
|
||||
function defaultTargetParser(target, value) {
|
||||
const version = (0, _utils.isUnreleasedVersion)(value, target) ? value.toLowerCase() : semverifyTarget(target, value);
|
||||
return [target, version];
|
||||
}
|
||||
function generateTargets(inputTargets) {
|
||||
const input = Object.assign({}, inputTargets);
|
||||
delete input.esmodules;
|
||||
delete input.browsers;
|
||||
return input;
|
||||
}
|
||||
function resolveTargets(queries, env) {
|
||||
const resolved = _browserslist(queries, {
|
||||
mobileToDesktop: true,
|
||||
env
|
||||
});
|
||||
return getLowestVersions(resolved);
|
||||
}
|
||||
const targetsCache = new _lruCache({
|
||||
max: 64
|
||||
});
|
||||
function resolveTargetsCached(queries, env) {
|
||||
const cacheKey = typeof queries === "string" ? queries : queries.join() + env;
|
||||
let cached = targetsCache.get(cacheKey);
|
||||
if (!cached) {
|
||||
cached = resolveTargets(queries, env);
|
||||
targetsCache.set(cacheKey, cached);
|
||||
}
|
||||
return Object.assign({}, cached);
|
||||
}
|
||||
function getTargets(inputTargets = {}, options = {}) {
|
||||
var _browsers, _browsers2;
|
||||
let {
|
||||
browsers,
|
||||
esmodules
|
||||
} = inputTargets;
|
||||
const {
|
||||
configPath = ".",
|
||||
onBrowserslistConfigFound
|
||||
} = options;
|
||||
validateBrowsers(browsers);
|
||||
const input = generateTargets(inputTargets);
|
||||
let targets = validateTargetNames(input);
|
||||
const shouldParseBrowsers = !!browsers;
|
||||
const hasTargets = shouldParseBrowsers || Object.keys(targets).length > 0;
|
||||
const shouldSearchForConfig = !options.ignoreBrowserslistConfig && !hasTargets;
|
||||
if (!browsers && shouldSearchForConfig) {
|
||||
browsers = process.env.BROWSERSLIST;
|
||||
if (!browsers) {
|
||||
const configFile = options.configFile || process.env.BROWSERSLIST_CONFIG || _browserslist.findConfigFile(configPath);
|
||||
if (configFile != null) {
|
||||
onBrowserslistConfigFound == null || onBrowserslistConfigFound(configFile);
|
||||
browsers = _browserslist.loadConfig({
|
||||
config: configFile,
|
||||
env: options.browserslistEnv
|
||||
});
|
||||
}
|
||||
}
|
||||
if (browsers == null) {
|
||||
{
|
||||
browsers = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
if (esmodules && (esmodules !== "intersect" || !((_browsers = browsers) != null && _browsers.length))) {
|
||||
browsers = Object.keys(ESM_SUPPORT).map(browser => `${browser} >= ${ESM_SUPPORT[browser]}`).join(", ");
|
||||
esmodules = false;
|
||||
}
|
||||
if ((_browsers2 = browsers) != null && _browsers2.length) {
|
||||
const queryBrowsers = resolveTargetsCached(browsers, options.browserslistEnv);
|
||||
if (esmodules === "intersect") {
|
||||
for (const browser of Object.keys(queryBrowsers)) {
|
||||
if (browser !== "deno" && browser !== "ie") {
|
||||
const esmSupportVersion = ESM_SUPPORT[browser === "opera_mobile" ? "op_mob" : browser];
|
||||
if (esmSupportVersion) {
|
||||
const version = queryBrowsers[browser];
|
||||
queryBrowsers[browser] = (0, _utils.getHighestUnreleased)(version, (0, _utils.semverify)(esmSupportVersion), browser);
|
||||
} else {
|
||||
delete queryBrowsers[browser];
|
||||
}
|
||||
} else {
|
||||
delete queryBrowsers[browser];
|
||||
}
|
||||
}
|
||||
}
|
||||
targets = Object.assign(queryBrowsers, targets);
|
||||
}
|
||||
const result = {};
|
||||
const decimalWarnings = [];
|
||||
for (const target of Object.keys(targets).sort()) {
|
||||
const value = targets[target];
|
||||
if (typeof value === "number" && value % 1 !== 0) {
|
||||
decimalWarnings.push({
|
||||
target,
|
||||
value
|
||||
});
|
||||
}
|
||||
const [parsedTarget, parsedValue] = target === "node" ? nodeTargetParser(value) : defaultTargetParser(target, value);
|
||||
if (parsedValue) {
|
||||
result[parsedTarget] = parsedValue;
|
||||
}
|
||||
}
|
||||
outputDecimalWarning(decimalWarnings);
|
||||
return result;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
File diff suppressed because one or more lines are too long
24
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/options.js
generated
vendored
24
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/options.js
generated
vendored
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TargetNames = void 0;
|
||||
const TargetNames = exports.TargetNames = {
|
||||
node: "node",
|
||||
deno: "deno",
|
||||
chrome: "chrome",
|
||||
opera: "opera",
|
||||
edge: "edge",
|
||||
firefox: "firefox",
|
||||
safari: "safari",
|
||||
ie: "ie",
|
||||
ios: "ios",
|
||||
android: "android",
|
||||
electron: "electron",
|
||||
samsung: "samsung",
|
||||
rhino: "rhino",
|
||||
opera_mobile: "opera_mobile"
|
||||
};
|
||||
|
||||
//# sourceMappingURL=options.js.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"names":["TargetNames","exports","node","deno","chrome","opera","edge","firefox","safari","ie","ios","android","electron","samsung","rhino","opera_mobile"],"sources":["../src/options.ts"],"sourcesContent":["export const TargetNames = {\n node: \"node\",\n deno: \"deno\",\n chrome: \"chrome\",\n opera: \"opera\",\n edge: \"edge\",\n firefox: \"firefox\",\n safari: \"safari\",\n ie: \"ie\",\n ios: \"ios\",\n android: \"android\",\n electron: \"electron\",\n samsung: \"samsung\",\n rhino: \"rhino\",\n opera_mobile: \"opera_mobile\",\n};\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzBE,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,EAAE,EAAE,IAAI;EACRC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,YAAY,EAAE;AAChB,CAAC","ignoreList":[]}
|
||||
40
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/pretty.js
generated
vendored
40
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/pretty.js
generated
vendored
@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prettifyTargets = prettifyTargets;
|
||||
exports.prettifyVersion = prettifyVersion;
|
||||
var _semver = require("semver");
|
||||
var _targets = require("./targets.js");
|
||||
function prettifyVersion(version) {
|
||||
if (typeof version !== "string") {
|
||||
return version;
|
||||
}
|
||||
const {
|
||||
major,
|
||||
minor,
|
||||
patch
|
||||
} = _semver.parse(version);
|
||||
const parts = [major];
|
||||
if (minor || patch) {
|
||||
parts.push(minor);
|
||||
}
|
||||
if (patch) {
|
||||
parts.push(patch);
|
||||
}
|
||||
return parts.join(".");
|
||||
}
|
||||
function prettifyTargets(targets) {
|
||||
return Object.keys(targets).reduce((results, target) => {
|
||||
let value = targets[target];
|
||||
const unreleasedLabel = _targets.unreleasedLabels[target];
|
||||
if (typeof value === "string" && unreleasedLabel !== value) {
|
||||
value = prettifyVersion(value);
|
||||
}
|
||||
results[target] = value;
|
||||
return results;
|
||||
}, {});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=pretty.js.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"names":["_semver","require","_targets","prettifyVersion","version","major","minor","patch","semver","parse","parts","push","join","prettifyTargets","targets","Object","keys","reduce","results","target","value","unreleasedLabel","unreleasedLabels"],"sources":["../src/pretty.ts"],"sourcesContent":["import semver from \"semver\";\nimport { unreleasedLabels } from \"./targets.ts\";\nimport type { Targets, Target } from \"./types.ts\";\n\nexport function prettifyVersion(version: string) {\n if (typeof version !== \"string\") {\n return version;\n }\n\n const { major, minor, patch } = semver.parse(version);\n\n const parts = [major];\n\n if (minor || patch) {\n parts.push(minor);\n }\n\n if (patch) {\n parts.push(patch);\n }\n\n return parts.join(\".\");\n}\n\nexport function prettifyTargets(targets: Targets): Targets {\n return Object.keys(targets).reduce((results, target: Target) => {\n let value = targets[target];\n\n const unreleasedLabel =\n // @ts-expect-error undefined is strictly compared with string later\n unreleasedLabels[target];\n if (typeof value === \"string\" && unreleasedLabel !== value) {\n value = prettifyVersion(value);\n }\n\n results[target] = value;\n return results;\n }, {} as Targets);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAGO,SAASE,eAAeA,CAACC,OAAe,EAAE;EAC/C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;EAChB;EAEA,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGC,OAAM,CAACC,KAAK,CAACL,OAAO,CAAC;EAErD,MAAMM,KAAK,GAAG,CAACL,KAAK,CAAC;EAErB,IAAIC,KAAK,IAAIC,KAAK,EAAE;IAClBG,KAAK,CAACC,IAAI,CAACL,KAAK,CAAC;EACnB;EAEA,IAAIC,KAAK,EAAE;IACTG,KAAK,CAACC,IAAI,CAACJ,KAAK,CAAC;EACnB;EAEA,OAAOG,KAAK,CAACE,IAAI,CAAC,GAAG,CAAC;AACxB;AAEO,SAASC,eAAeA,CAACC,OAAgB,EAAW;EACzD,OAAOC,MAAM,CAACC,IAAI,CAACF,OAAO,CAAC,CAACG,MAAM,CAAC,CAACC,OAAO,EAAEC,MAAc,KAAK;IAC9D,IAAIC,KAAK,GAAGN,OAAO,CAACK,MAAM,CAAC;IAE3B,MAAME,eAAe,GAEnBC,yBAAgB,CAACH,MAAM,CAAC;IAC1B,IAAI,OAAOC,KAAK,KAAK,QAAQ,IAAIC,eAAe,KAAKD,KAAK,EAAE;MAC1DA,KAAK,GAAGjB,eAAe,CAACiB,KAAK,CAAC;IAChC;IAEAF,OAAO,CAACC,MAAM,CAAC,GAAGC,KAAK;IACvB,OAAOF,OAAO;EAChB,CAAC,EAAE,CAAC,CAAY,CAAC;AACnB","ignoreList":[]}
|
||||
28
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/targets.js
generated
vendored
28
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/targets.js
generated
vendored
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unreleasedLabels = exports.browserNameMap = void 0;
|
||||
const unreleasedLabels = exports.unreleasedLabels = {
|
||||
safari: "tp"
|
||||
};
|
||||
const browserNameMap = exports.browserNameMap = {
|
||||
and_chr: "chrome",
|
||||
and_ff: "firefox",
|
||||
android: "android",
|
||||
chrome: "chrome",
|
||||
edge: "edge",
|
||||
firefox: "firefox",
|
||||
ie: "ie",
|
||||
ie_mob: "ie",
|
||||
ios_saf: "ios",
|
||||
node: "node",
|
||||
deno: "deno",
|
||||
op_mob: "opera_mobile",
|
||||
opera: "opera",
|
||||
safari: "safari",
|
||||
samsung: "samsung"
|
||||
};
|
||||
|
||||
//# sourceMappingURL=targets.js.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"names":["unreleasedLabels","exports","safari","browserNameMap","and_chr","and_ff","android","chrome","edge","firefox","ie","ie_mob","ios_saf","node","deno","op_mob","opera","samsung"],"sources":["../src/targets.ts"],"sourcesContent":["export const unreleasedLabels = {\n safari: \"tp\",\n} as const;\n\n// Map from browserslist|@mdn/browser-compat-data browser names to @kangax/compat-table browser names\nexport const browserNameMap = {\n and_chr: \"chrome\",\n and_ff: \"firefox\",\n android: \"android\",\n chrome: \"chrome\",\n edge: \"edge\",\n firefox: \"firefox\",\n ie: \"ie\",\n ie_mob: \"ie\",\n ios_saf: \"ios\",\n node: \"node\",\n deno: \"deno\",\n op_mob: \"opera_mobile\",\n opera: \"opera\",\n safari: \"safari\",\n samsung: \"samsung\",\n} as const;\n\nexport type BrowserslistBrowserName = keyof typeof browserNameMap;\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9BE,MAAM,EAAE;AACV,CAAU;AAGH,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG;EAC5BC,OAAO,EAAE,QAAQ;EACjBC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,SAAS;EAClBC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAE,KAAK;EACdC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,cAAc;EACtBC,KAAK,EAAE,OAAO;EACdd,MAAM,EAAE,QAAQ;EAChBe,OAAO,EAAE;AACX,CAAU","ignoreList":[]}
|
||||
58
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/utils.js
generated
vendored
58
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/lib/utils.js
generated
vendored
@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getHighestUnreleased = getHighestUnreleased;
|
||||
exports.getLowestImplementedVersion = getLowestImplementedVersion;
|
||||
exports.getLowestUnreleased = getLowestUnreleased;
|
||||
exports.isUnreleasedVersion = isUnreleasedVersion;
|
||||
exports.semverMin = semverMin;
|
||||
exports.semverify = semverify;
|
||||
var _semver = require("semver");
|
||||
var _helperValidatorOption = require("@babel/helper-validator-option");
|
||||
var _targets = require("./targets.js");
|
||||
const versionRegExp = /^(?:\d+|\d(?:\d?[^\d\n\r\u2028\u2029]\d+|\d{2,}(?:[^\d\n\r\u2028\u2029]\d+)?))$/;
|
||||
const v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets");
|
||||
function semverMin(first, second) {
|
||||
return first && _semver.lt(first, second) ? first : second;
|
||||
}
|
||||
function semverify(version) {
|
||||
if (typeof version === "string" && _semver.valid(version)) {
|
||||
return version;
|
||||
}
|
||||
v.invariant(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), `'${version}' is not a valid version`);
|
||||
version = version.toString();
|
||||
let pos = 0;
|
||||
let num = 0;
|
||||
while ((pos = version.indexOf(".", pos + 1)) > 0) {
|
||||
num++;
|
||||
}
|
||||
return version + ".0".repeat(2 - num);
|
||||
}
|
||||
function isUnreleasedVersion(version, env) {
|
||||
const unreleasedLabel = _targets.unreleasedLabels[env];
|
||||
return !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase();
|
||||
}
|
||||
function getLowestUnreleased(a, b, env) {
|
||||
const unreleasedLabel = _targets.unreleasedLabels[env];
|
||||
if (a === unreleasedLabel) {
|
||||
return b;
|
||||
}
|
||||
if (b === unreleasedLabel) {
|
||||
return a;
|
||||
}
|
||||
return semverMin(a, b);
|
||||
}
|
||||
function getHighestUnreleased(a, b, env) {
|
||||
return getLowestUnreleased(a, b, env) === a ? b : a;
|
||||
}
|
||||
function getLowestImplementedVersion(plugin, environment) {
|
||||
const result = plugin[environment];
|
||||
if (!result && environment === "android") {
|
||||
return plugin.chrome;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"names":["_semver","require","_helperValidatorOption","_targets","versionRegExp","v","OptionValidator","semverMin","first","second","semver","lt","semverify","version","valid","invariant","test","toString","pos","num","indexOf","repeat","isUnreleasedVersion","env","unreleasedLabel","unreleasedLabels","toLowerCase","getLowestUnreleased","a","b","getHighestUnreleased","getLowestImplementedVersion","plugin","environment","result","chrome"],"sources":["../src/utils.ts"],"sourcesContent":["import semver from \"semver\";\nimport { OptionValidator } from \"@babel/helper-validator-option\";\nimport { unreleasedLabels } from \"./targets.ts\";\nimport type { Target, Targets } from \"./types.ts\";\n\nconst versionRegExp =\n /^(?:\\d+|\\d(?:\\d?[^\\d\\n\\r\\u2028\\u2029]\\d+|\\d{2,}(?:[^\\d\\n\\r\\u2028\\u2029]\\d+)?))$/;\n\nconst v = new OptionValidator(PACKAGE_JSON.name);\n\nexport function semverMin(\n first: string | undefined | null,\n second: string,\n): string {\n return first && semver.lt(first, second) ? first : second;\n}\n\n// Convert version to a semver value.\n// 2.5 -> 2.5.0; 1 -> 1.0.0;\nexport function semverify(version: number | string): string {\n if (typeof version === \"string\" && semver.valid(version)) {\n return version;\n }\n\n v.invariant(\n typeof version === \"number\" ||\n (typeof version === \"string\" && versionRegExp.test(version)),\n `'${version}' is not a valid version`,\n );\n\n version = version.toString();\n\n let pos = 0;\n let num = 0;\n while ((pos = version.indexOf(\".\", pos + 1)) > 0) {\n num++;\n }\n return version + \".0\".repeat(2 - num);\n}\n\nexport function isUnreleasedVersion(\n version: string | number,\n env: Target,\n): boolean {\n const unreleasedLabel =\n // @ts-expect-error unreleasedLabel will be guarded later\n unreleasedLabels[env];\n return (\n !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase()\n );\n}\n\nexport function getLowestUnreleased(a: string, b: string, env: Target): string {\n const unreleasedLabel:\n | (typeof unreleasedLabels)[keyof typeof unreleasedLabels]\n | undefined =\n // @ts-expect-error unreleasedLabel is undefined when env is not safari\n unreleasedLabels[env];\n if (a === unreleasedLabel) {\n return b;\n }\n if (b === unreleasedLabel) {\n return a;\n }\n return semverMin(a, b);\n}\n\nexport function getHighestUnreleased(\n a: string,\n b: string,\n env: Target,\n): string {\n return getLowestUnreleased(a, b, env) === a ? b : a;\n}\n\nexport function getLowestImplementedVersion(\n plugin: Targets,\n environment: Target,\n): string {\n const result = plugin[environment];\n // When Android support data is absent, use Chrome data as fallback\n if (!result && environment === \"android\") {\n return plugin.chrome;\n }\n return result;\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAGA,MAAMG,aAAa,GACjB,iFAAiF;AAEnF,MAAMC,CAAC,GAAG,IAAIC,sCAAe,oCAAkB,CAAC;AAEzC,SAASC,SAASA,CACvBC,KAAgC,EAChCC,MAAc,EACN;EACR,OAAOD,KAAK,IAAIE,OAAM,CAACC,EAAE,CAACH,KAAK,EAAEC,MAAM,CAAC,GAAGD,KAAK,GAAGC,MAAM;AAC3D;AAIO,SAASG,SAASA,CAACC,OAAwB,EAAU;EAC1D,IAAI,OAAOA,OAAO,KAAK,QAAQ,IAAIH,OAAM,CAACI,KAAK,CAACD,OAAO,CAAC,EAAE;IACxD,OAAOA,OAAO;EAChB;EAEAR,CAAC,CAACU,SAAS,CACT,OAAOF,OAAO,KAAK,QAAQ,IACxB,OAAOA,OAAO,KAAK,QAAQ,IAAIT,aAAa,CAACY,IAAI,CAACH,OAAO,CAAE,EAC9D,IAAIA,OAAO,0BACb,CAAC;EAEDA,OAAO,GAAGA,OAAO,CAACI,QAAQ,CAAC,CAAC;EAE5B,IAAIC,GAAG,GAAG,CAAC;EACX,IAAIC,GAAG,GAAG,CAAC;EACX,OAAO,CAACD,GAAG,GAAGL,OAAO,CAACO,OAAO,CAAC,GAAG,EAAEF,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE;IAChDC,GAAG,EAAE;EACP;EACA,OAAON,OAAO,GAAG,IAAI,CAACQ,MAAM,CAAC,CAAC,GAAGF,GAAG,CAAC;AACvC;AAEO,SAASG,mBAAmBA,CACjCT,OAAwB,EACxBU,GAAW,EACF;EACT,MAAMC,eAAe,GAEnBC,yBAAgB,CAACF,GAAG,CAAC;EACvB,OACE,CAAC,CAACC,eAAe,IAAIA,eAAe,KAAKX,OAAO,CAACI,QAAQ,CAAC,CAAC,CAACS,WAAW,CAAC,CAAC;AAE7E;AAEO,SAASC,mBAAmBA,CAACC,CAAS,EAAEC,CAAS,EAAEN,GAAW,EAAU;EAC7E,MAAMC,eAEO,GAEXC,yBAAgB,CAACF,GAAG,CAAC;EACvB,IAAIK,CAAC,KAAKJ,eAAe,EAAE;IACzB,OAAOK,CAAC;EACV;EACA,IAAIA,CAAC,KAAKL,eAAe,EAAE;IACzB,OAAOI,CAAC;EACV;EACA,OAAOrB,SAAS,CAACqB,CAAC,EAAEC,CAAC,CAAC;AACxB;AAEO,SAASC,oBAAoBA,CAClCF,CAAS,EACTC,CAAS,EACTN,GAAW,EACH;EACR,OAAOI,mBAAmB,CAACC,CAAC,EAAEC,CAAC,EAAEN,GAAG,CAAC,KAAKK,CAAC,GAAGC,CAAC,GAAGD,CAAC;AACrD;AAEO,SAASG,2BAA2BA,CACzCC,MAAe,EACfC,WAAmB,EACX;EACR,MAAMC,MAAM,GAAGF,MAAM,CAACC,WAAW,CAAC;EAElC,IAAI,CAACC,MAAM,IAAID,WAAW,KAAK,SAAS,EAAE;IACxC,OAAOD,MAAM,CAACG,MAAM;EACtB;EACA,OAAOD,MAAM;AACf","ignoreList":[]}
|
||||
43
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/package.json
generated
vendored
43
src/web_control/frontend/node_modules/@babel/helper-compilation-targets/package.json
generated
vendored
@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@babel/helper-compilation-targets",
|
||||
"version": "7.27.2",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "Helper functions on Babel compilation targets",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-compilation-targets"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/compat-data": "^7.27.2",
|
||||
"@babel/helper-validator-option": "^7.27.1",
|
||||
"browserslist": "^4.24.0",
|
||||
"lru-cache": "^5.1.1",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@types/lru-cache": "^5.1.1",
|
||||
"@types/semver": "^5.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -0,0 +1,19 @@
|
||||
# @babel/helper-string-parser
|
||||
|
||||
> A utility package to parse strings
|
||||
|
||||
See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-string-parser
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-string-parser
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue