mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-22 18:03:17 +00:00
Modules
This commit is contained in:
parent
edfcc6f474
commit
30022c7634
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
node_modules/
|
||||
dev/
|
||||
.env
|
||||
.vscode/
|
||||
|
15
node_modules/.bin/compileProtos
generated
vendored
Normal file
15
node_modules/.bin/compileProtos
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../google-gax/build/tools/compileProtos.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../google-gax/build/tools/compileProtos.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/compileProtos.cmd
generated
vendored
Normal file
17
node_modules/.bin/compileProtos.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\google-gax\build\tools\compileProtos.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/compileProtos.ps1
generated
vendored
Normal file
18
node_modules/.bin/compileProtos.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../google-gax/build/tools/compileProtos.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../google-gax/build/tools/compileProtos.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/gcs-upload
generated
vendored
Normal file
15
node_modules/.bin/gcs-upload
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../gcs-resumable-upload/build/src/cli.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../gcs-resumable-upload/build/src/cli.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/gcs-upload.cmd
generated
vendored
Normal file
7
node_modules/.bin/gcs-upload.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\gcs-resumable-upload\build\src\cli.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\gcs-resumable-upload\build\src\cli.js" %*
|
||||
)
|
18
node_modules/.bin/gcs-upload.ps1
generated
vendored
Normal file
18
node_modules/.bin/gcs-upload.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../gcs-resumable-upload/build/src/cli.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../gcs-resumable-upload/build/src/cli.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/gp12-pem
generated
vendored
Normal file
15
node_modules/.bin/gp12-pem
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../google-p12-pem/build/src/bin/gp12-pem.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../google-p12-pem/build/src/bin/gp12-pem.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/gp12-pem.cmd
generated
vendored
Normal file
17
node_modules/.bin/gp12-pem.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\google-p12-pem\build\src\bin\gp12-pem.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/gp12-pem.ps1
generated
vendored
Normal file
18
node_modules/.bin/gp12-pem.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../google-p12-pem/build/src/bin/gp12-pem.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../google-p12-pem/build/src/bin/gp12-pem.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/he
generated
vendored
Normal file
15
node_modules/.bin/he
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../he/bin/he" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../he/bin/he" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/he.cmd
generated
vendored
Normal file
7
node_modules/.bin/he.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\he\bin\he" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\he\bin\he" %*
|
||||
)
|
15
node_modules/.bin/lzmajs
generated
vendored
Normal file
15
node_modules/.bin/lzmajs
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../lzma-native/bin/lzmajs" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../lzma-native/bin/lzmajs" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/lzmajs.cmd
generated
vendored
Normal file
17
node_modules/.bin/lzmajs.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\lzma-native\bin\lzmajs" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/lzmajs.ps1
generated
vendored
Normal file
18
node_modules/.bin/lzmajs.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../lzma-native/bin/lzmajs" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../lzma-native/bin/lzmajs" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/mime
generated
vendored
Normal file
15
node_modules/.bin/mime
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../mime/cli.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../mime/cli.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/mime.cmd
generated
vendored
Normal file
7
node_modules/.bin/mime.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\mime\cli.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\mime\cli.js" %*
|
||||
)
|
15
node_modules/.bin/pbjs
generated
vendored
Normal file
15
node_modules/.bin/pbjs
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../protobufjs/bin/pbjs" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../protobufjs/bin/pbjs" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/pbjs.cmd
generated
vendored
Normal file
7
node_modules/.bin/pbjs.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\protobufjs\bin\pbjs" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\protobufjs\bin\pbjs" %*
|
||||
)
|
15
node_modules/.bin/pbts
generated
vendored
Normal file
15
node_modules/.bin/pbts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../protobufjs/bin/pbts" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../protobufjs/bin/pbts" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/pbts.cmd
generated
vendored
Normal file
7
node_modules/.bin/pbts.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\protobufjs\bin\pbts" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\protobufjs\bin\pbts" %*
|
||||
)
|
15
node_modules/.bin/semver
generated
vendored
Normal file
15
node_modules/.bin/semver
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../semver/bin/semver.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/semver.cmd
generated
vendored
Normal file
17
node_modules/.bin/semver.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\semver\bin\semver.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/semver.ps1
generated
vendored
Normal file
18
node_modules/.bin/semver.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/sshpk-conv
generated
vendored
Normal file
15
node_modules/.bin/sshpk-conv
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../sshpk/bin/sshpk-conv" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/sshpk-conv.cmd
generated
vendored
Normal file
7
node_modules/.bin/sshpk-conv.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\sshpk\bin\sshpk-conv" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\sshpk\bin\sshpk-conv" %*
|
||||
)
|
15
node_modules/.bin/sshpk-sign
generated
vendored
Normal file
15
node_modules/.bin/sshpk-sign
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../sshpk/bin/sshpk-sign" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/sshpk-sign.cmd
generated
vendored
Normal file
7
node_modules/.bin/sshpk-sign.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\sshpk\bin\sshpk-sign" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\sshpk\bin\sshpk-sign" %*
|
||||
)
|
15
node_modules/.bin/sshpk-verify
generated
vendored
Normal file
15
node_modules/.bin/sshpk-verify
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../sshpk/bin/sshpk-verify" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../sshpk/bin/sshpk-verify" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/sshpk-verify.cmd
generated
vendored
Normal file
7
node_modules/.bin/sshpk-verify.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\sshpk\bin\sshpk-verify" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\sshpk\bin\sshpk-verify" %*
|
||||
)
|
15
node_modules/.bin/uuid
generated
vendored
Normal file
15
node_modules/.bin/uuid
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../uuid/bin/uuid" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../uuid/bin/uuid" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/uuid.cmd
generated
vendored
Normal file
7
node_modules/.bin/uuid.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\uuid\bin\uuid" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\uuid\bin\uuid" %*
|
||||
)
|
15
node_modules/.bin/window-size
generated
vendored
Normal file
15
node_modules/.bin/window-size
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../window-size/cli.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../window-size/cli.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
7
node_modules/.bin/window-size.cmd
generated
vendored
Normal file
7
node_modules/.bin/window-size.cmd
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\window-size\cli.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\window-size\cli.js" %*
|
||||
)
|
190
node_modules/@discordjs/collection/LICENSE
generated
vendored
Normal file
190
node_modules/@discordjs/collection/LICENSE
generated
vendored
Normal file
@ -0,0 +1,190 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright 2015 - 2019 Amish Shah
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
3
node_modules/@discordjs/collection/README.md
generated
vendored
Normal file
3
node_modules/@discordjs/collection/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Collection
|
||||
|
||||
Utility data structure used in Discord.js.
|
317
node_modules/@discordjs/collection/dist/index.d.ts
generated
vendored
Normal file
317
node_modules/@discordjs/collection/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,317 @@
|
||||
export interface CollectionConstructor {
|
||||
new (): Collection<unknown, unknown>;
|
||||
new <K, V>(entries?: ReadonlyArray<readonly [K, V]> | null): Collection<K, V>;
|
||||
new <K, V>(iterable: Iterable<readonly [K, V]>): Collection<K, V>;
|
||||
readonly prototype: Collection<unknown, unknown>;
|
||||
readonly [Symbol.species]: CollectionConstructor;
|
||||
}
|
||||
/**
|
||||
* A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has
|
||||
* an ID, for significantly improved performance and ease-of-use.
|
||||
* @extends {Map}
|
||||
* @property {number} size - The amount of elements in this collection.
|
||||
*/
|
||||
declare class Collection<K, V> extends Map<K, V> {
|
||||
private _array;
|
||||
private _keyArray;
|
||||
static readonly default: typeof Collection;
|
||||
['constructor']: typeof Collection;
|
||||
constructor(entries?: ReadonlyArray<readonly [K, V]> | null);
|
||||
/**
|
||||
* Identical to [Map.get()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get).
|
||||
* Gets an element with the specified key, and returns its value, or `undefined` if the element does not exist.
|
||||
* @param {*} key - The key to get from this collection
|
||||
* @returns {* | undefined}
|
||||
*/
|
||||
get(key: K): V | undefined;
|
||||
/**
|
||||
* Identical to [Map.set()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set).
|
||||
* Sets a new element in the collection with the specified key and value.
|
||||
* @param {*} key - The key of the element to add
|
||||
* @param {*} value - The value of the element to add
|
||||
* @returns {Collection}
|
||||
*/
|
||||
set(key: K, value: V): this;
|
||||
/**
|
||||
* Identical to [Map.has()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has).
|
||||
* Checks if an element exists in the collection.
|
||||
* @param {*} key - The key of the element to check for
|
||||
* @returns {boolean} `true` if the element exists, `false` if it does not exist.
|
||||
*/
|
||||
has(key: K): boolean;
|
||||
/**
|
||||
* Identical to [Map.delete()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete).
|
||||
* Deletes an element from the collection.
|
||||
* @param {*} key - The key to delete from the collection
|
||||
* @returns {boolean} `true` if the element was removed, `false` if the element does not exist.
|
||||
*/
|
||||
delete(key: K): boolean;
|
||||
/**
|
||||
* Identical to [Map.clear()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear).
|
||||
* Removes all elements from the collection.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
clear(): void;
|
||||
/**
|
||||
* Creates an ordered array of the values of this collection, and caches it internally. The array will only be
|
||||
* reconstructed if an item is added to or removed from the collection, or if you change the length of the array
|
||||
* itself. If you don't want this caching behavior, use `[...collection.values()]` or
|
||||
* `Array.from(collection.values())` instead.
|
||||
* @returns {Array}
|
||||
*/
|
||||
array(): V[];
|
||||
/**
|
||||
* Creates an ordered array of the keys of this collection, and caches it internally. The array will only be
|
||||
* reconstructed if an item is added to or removed from the collection, or if you change the length of the array
|
||||
* itself. If you don't want this caching behavior, use `[...collection.keys()]` or
|
||||
* `Array.from(collection.keys())` instead.
|
||||
* @returns {Array}
|
||||
*/
|
||||
keyArray(): K[];
|
||||
/**
|
||||
* Obtains the first value(s) in this collection.
|
||||
* @param {number} [amount] Amount of values to obtain from the beginning
|
||||
* @returns {*|Array<*>} A single value if no amount is provided or an array of values, starting from the end if
|
||||
* amount is negative
|
||||
*/
|
||||
first(): V | undefined;
|
||||
first(amount: number): V[];
|
||||
/**
|
||||
* Obtains the first key(s) in this collection.
|
||||
* @param {number} [amount] Amount of keys to obtain from the beginning
|
||||
* @returns {*|Array<*>} A single key if no amount is provided or an array of keys, starting from the end if
|
||||
* amount is negative
|
||||
*/
|
||||
firstKey(): K | undefined;
|
||||
firstKey(amount: number): K[];
|
||||
/**
|
||||
* Obtains the last value(s) in this collection. This relies on {@link Collection#array}, and thus the caching
|
||||
* mechanism applies here as well.
|
||||
* @param {number} [amount] Amount of values to obtain from the end
|
||||
* @returns {*|Array<*>} A single value if no amount is provided or an array of values, starting from the start if
|
||||
* amount is negative
|
||||
*/
|
||||
last(): V | undefined;
|
||||
last(amount: number): V[];
|
||||
/**
|
||||
* Obtains the last key(s) in this collection. This relies on {@link Collection#keyArray}, and thus the caching
|
||||
* mechanism applies here as well.
|
||||
* @param {number} [amount] Amount of keys to obtain from the end
|
||||
* @returns {*|Array<*>} A single key if no amount is provided or an array of keys, starting from the start if
|
||||
* amount is negative
|
||||
*/
|
||||
lastKey(): K | undefined;
|
||||
lastKey(amount: number): K[];
|
||||
/**
|
||||
* Obtains unique random value(s) from this collection. This relies on {@link Collection#array}, and thus the caching
|
||||
* mechanism applies here as well.
|
||||
* @param {number} [amount] Amount of values to obtain randomly
|
||||
* @returns {*|Array<*>} A single value if no amount is provided or an array of values
|
||||
*/
|
||||
random(): V;
|
||||
random(amount: number): V[];
|
||||
/**
|
||||
* Obtains unique random key(s) from this collection. This relies on {@link Collection#keyArray}, and thus the caching
|
||||
* mechanism applies here as well.
|
||||
* @param {number} [amount] Amount of keys to obtain randomly
|
||||
* @returns {*|Array<*>} A single key if no amount is provided or an array
|
||||
*/
|
||||
randomKey(): K;
|
||||
randomKey(amount: number): K[];
|
||||
/**
|
||||
* Searches for a single item where the given function returns a truthy value. This behaves like
|
||||
* [Array.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
|
||||
* <warn>All collections used in Discord.js are mapped using their `id` property, and if you want to find by id you
|
||||
* should use the `get` method. See
|
||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) for details.</warn>
|
||||
* @param {Function} fn The function to test with (should return boolean)
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {*}
|
||||
* @example collection.find(user => user.username === 'Bob');
|
||||
*/
|
||||
find(fn: (value: V, key: K, collection: this) => boolean): V | undefined;
|
||||
find<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): V | undefined;
|
||||
/**
|
||||
* Searches for the key of a single item where the given function returns a truthy value. This behaves like
|
||||
* [Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex),
|
||||
* but returns the key rather than the positional index.
|
||||
* @param {Function} fn The function to test with (should return boolean)
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {*}
|
||||
* @example collection.findKey(user => user.username === 'Bob');
|
||||
*/
|
||||
findKey(fn: (value: V, key: K, collection: this) => boolean): K | undefined;
|
||||
findKey<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): K | undefined;
|
||||
/**
|
||||
* Removes items that satisfy the provided filter function.
|
||||
* @param {Function} fn Function used to test (should return a boolean)
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {number} The number of removed entries
|
||||
*/
|
||||
sweep(fn: (value: V, key: K, collection: this) => boolean): number;
|
||||
sweep<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): number;
|
||||
/**
|
||||
* Identical to
|
||||
* [Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
|
||||
* but returns a Collection instead of an Array.
|
||||
* @param {Function} fn The function to test with (should return boolean)
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {Collection}
|
||||
* @example collection.filter(user => user.username === 'Bob');
|
||||
*/
|
||||
filter(fn: (value: V, key: K, collection: this) => boolean): this;
|
||||
filter<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): this;
|
||||
/**
|
||||
* Partitions the collection into two collections where the first collection
|
||||
* contains the items that passed and the second contains the items that failed.
|
||||
* @param {Function} fn Function used to test (should return a boolean)
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {Collection[]}
|
||||
* @example const [big, small] = collection.partition(guild => guild.memberCount > 250);
|
||||
*/
|
||||
partition(fn: (value: V, key: K, collection: this) => boolean): [this, this];
|
||||
partition<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): [this, this];
|
||||
/**
|
||||
* Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to
|
||||
* [Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap).
|
||||
* @param {Function} fn Function that produces a new Collection
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {Collection}
|
||||
* @example collection.flatMap(guild => guild.members);
|
||||
*/
|
||||
flatMap<T>(fn: (value: V, key: K, collection: this) => Collection<K, T>): Collection<K, T>;
|
||||
flatMap<T, This>(fn: (this: This, value: V, key: K, collection: this) => Collection<K, T>, thisArg: This): Collection<K, T>;
|
||||
/**
|
||||
* Maps each item to another value into an array. Identical in behavior to
|
||||
* [Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).
|
||||
* @param {Function} fn Function that produces an element of the new array, taking three arguments
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {Array}
|
||||
* @example collection.map(user => user.tag);
|
||||
*/
|
||||
map<T>(fn: (value: V, key: K, collection: this) => T): T[];
|
||||
map<This, T>(fn: (this: This, value: V, key: K, collection: this) => T, thisArg: This): T[];
|
||||
/**
|
||||
* Maps each item to another value into a collection. Identical in behavior to
|
||||
* [Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).
|
||||
* @param {Function} fn Function that produces an element of the new collection, taking three arguments
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {Collection}
|
||||
* @example collection.mapValues(user => user.tag);
|
||||
*/
|
||||
mapValues<T>(fn: (value: V, key: K, collection: this) => T): Collection<K, T>;
|
||||
mapValues<This, T>(fn: (this: This, value: V, key: K, collection: this) => T, thisArg: This): Collection<K, T>;
|
||||
/**
|
||||
* Checks if there exists an item that passes a test. Identical in behavior to
|
||||
* [Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).
|
||||
* @param {Function} fn Function used to test (should return a boolean)
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {boolean}
|
||||
* @example collection.some(user => user.discriminator === '0000');
|
||||
*/
|
||||
some(fn: (value: V, key: K, collection: this) => boolean): boolean;
|
||||
some<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): boolean;
|
||||
/**
|
||||
* Checks if all items passes a test. Identical in behavior to
|
||||
* [Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).
|
||||
* @param {Function} fn Function used to test (should return a boolean)
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {boolean}
|
||||
* @example collection.every(user => !user.bot);
|
||||
*/
|
||||
every(fn: (value: V, key: K, collection: this) => boolean): boolean;
|
||||
every<T>(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): boolean;
|
||||
/**
|
||||
* Applies a function to produce a single value. Identical in behavior to
|
||||
* [Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).
|
||||
* @param {Function} fn Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,
|
||||
* and `collection`
|
||||
* @param {*} [initialValue] Starting value for the accumulator
|
||||
* @returns {*}
|
||||
* @example collection.reduce((acc, guild) => acc + guild.memberCount, 0);
|
||||
*/
|
||||
reduce<T>(fn: (accumulator: T, value: V, key: K, collection: this) => T, initialValue?: T): T;
|
||||
/**
|
||||
* Identical to
|
||||
* [Map.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach),
|
||||
* but returns the collection instead of undefined.
|
||||
* @param {Function} fn Function to execute for each element
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {Collection}
|
||||
* @example
|
||||
* collection
|
||||
* .each(user => console.log(user.username))
|
||||
* .filter(user => user.bot)
|
||||
* .each(user => console.log(user.username));
|
||||
*/
|
||||
each(fn: (value: V, key: K, collection: this) => void): this;
|
||||
each<T>(fn: (this: T, value: V, key: K, collection: this) => void, thisArg: T): this;
|
||||
/**
|
||||
* Runs a function on the collection and returns the collection.
|
||||
* @param {Function} fn Function to execute
|
||||
* @param {*} [thisArg] Value to use as `this` when executing function
|
||||
* @returns {Collection}
|
||||
* @example
|
||||
* collection
|
||||
* .tap(coll => console.log(coll.size))
|
||||
* .filter(user => user.bot)
|
||||
* .tap(coll => console.log(coll.size))
|
||||
*/
|
||||
tap(fn: (collection: this) => void): this;
|
||||
tap<T>(fn: (this: T, collection: this) => void, thisArg: T): this;
|
||||
/**
|
||||
* Creates an identical shallow copy of this collection.
|
||||
* @returns {Collection}
|
||||
* @example const newColl = someColl.clone();
|
||||
*/
|
||||
clone(): this;
|
||||
/**
|
||||
* Combines this collection with others into a new collection. None of the source collections are modified.
|
||||
* @param {...Collection} collections Collections to merge
|
||||
* @returns {Collection}
|
||||
* @example const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);
|
||||
*/
|
||||
concat(...collections: Collection<K, V>[]): this;
|
||||
/**
|
||||
* Checks if this collection shares identical items with another.
|
||||
* This is different to checking for equality using equal-signs, because
|
||||
* the collections may be different objects, but contain the same data.
|
||||
* @param {Collection} collection Collection to compare with
|
||||
* @returns {boolean} Whether the collections have identical contents
|
||||
*/
|
||||
equals(collection: Collection<K, V>): boolean;
|
||||
/**
|
||||
* The sort method sorts the items of a collection in place and returns it.
|
||||
* The sort is not necessarily stable. The default sort order is according to string Unicode code points.
|
||||
* @param {Function} [compareFunction] Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value,
|
||||
* according to the string conversion of each element.
|
||||
* @returns {Collection}
|
||||
* @example collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
*/
|
||||
sort(compareFunction?: (firstValue: V, secondValue: V, firstKey: K, secondKey: K) => number): this;
|
||||
/**
|
||||
* The intersect method returns a new structure containing items where the keys are present in both original structures.
|
||||
* @param {Collection} other The other Collection to filter against
|
||||
* @returns {Collection}
|
||||
*/
|
||||
intersect(other: Collection<K, V>): Collection<K, V>;
|
||||
/**
|
||||
* The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.
|
||||
* @param {Collection} other The other Collection to filter against
|
||||
* @returns {Collection}
|
||||
*/
|
||||
difference(other: Collection<K, V>): Collection<K, V>;
|
||||
/**
|
||||
* The sorted method sorts the items of a collection and returns it.
|
||||
* The sort is not necessarily stable. The default sort order is according to string Unicode code points.
|
||||
* @param {Function} [compareFunction] Specifies a function that defines the sort order.
|
||||
* If omitted, the collection is sorted according to each character's Unicode code point value,
|
||||
* according to the string conversion of each element.
|
||||
* @returns {Collection}
|
||||
* @example collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
|
||||
*/
|
||||
sorted(compareFunction?: (firstValue: V, secondValue: V, firstKey: K, secondKey: K) => number): this;
|
||||
}
|
||||
export { Collection };
|
||||
export default Collection;
|
389
node_modules/@discordjs/collection/dist/index.js
generated
vendored
Normal file
389
node_modules/@discordjs/collection/dist/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
78
node_modules/@discordjs/collection/package.json
generated
vendored
Normal file
78
node_modules/@discordjs/collection/package.json
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
{
|
||||
"_from": "@discordjs/collection@^0.1.5",
|
||||
"_id": "@discordjs/collection@0.1.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw==",
|
||||
"_location": "/@discordjs/collection",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@discordjs/collection@^0.1.5",
|
||||
"name": "@discordjs/collection",
|
||||
"escapedName": "@discordjs%2fcollection",
|
||||
"scope": "@discordjs",
|
||||
"rawSpec": "^0.1.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^0.1.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/discord.js"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
||||
"_shasum": "1781c620b4c88d619bd0373a1548e5a6025e3d3a",
|
||||
"_spec": "@discordjs/collection@^0.1.5",
|
||||
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix-V3\\node_modules\\discord.js",
|
||||
"author": {
|
||||
"name": "Amish Shah",
|
||||
"email": "amishshah.2k@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/discordjs/collection/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Utility data structure used in Discord.js",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.8.4",
|
||||
"@babel/core": "^7.8.4",
|
||||
"@babel/preset-env": "^7.8.4",
|
||||
"@babel/preset-typescript": "^7.8.3",
|
||||
"@types/node": "^13.7.4",
|
||||
"@typescript-eslint/eslint-plugin": "^2.21.0",
|
||||
"@typescript-eslint/parser": "^2.21.0",
|
||||
"discord.js-docgen": "github:discordjs/docgen#ts-patch",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-marine": "^6.0.0",
|
||||
"jsdoc-babel": "^0.5.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^3.8.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "marine/node"
|
||||
},
|
||||
"homepage": "https://github.com/discordjs/collection#readme",
|
||||
"keywords": [
|
||||
"map",
|
||||
"collection",
|
||||
"utility"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "dist/index.js",
|
||||
"name": "@discordjs/collection",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/discordjs/collection.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf dist/ && tsc",
|
||||
"docs": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml --output docs/docs.json",
|
||||
"docs:test": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"prebuild": "npm run lint",
|
||||
"pretest": "npm run build",
|
||||
"test": "node test/index.js"
|
||||
},
|
||||
"types": "dist/index.d.ts",
|
||||
"version": "0.1.5"
|
||||
}
|
3
node_modules/@firebase/analytics-types/README.md
generated
vendored
Normal file
3
node_modules/@firebase/analytics-types/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# @firebase/analytics-types
|
||||
|
||||
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
|
209
node_modules/@firebase/analytics-types/index.d.ts
generated
vendored
Normal file
209
node_modules/@firebase/analytics-types/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,209 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FirebaseApp } from '@firebase/app-types';
|
||||
|
||||
export type GtagCommand = 'event' | 'set' | 'config';
|
||||
|
||||
export type DataLayer = Array<IArguments>;
|
||||
|
||||
/**
|
||||
* Additional options that can be passed to Firebase Analytics method
|
||||
* calls such as `logEvent`, `setCurrentScreen`, etc.
|
||||
*/
|
||||
export interface AnalyticsCallOptions {
|
||||
/**
|
||||
* If true, this config or event call applies globally to all
|
||||
* analytics properties on the page.
|
||||
*/
|
||||
global: boolean;
|
||||
}
|
||||
|
||||
export interface FirebaseAnalytics {
|
||||
app: FirebaseApp;
|
||||
|
||||
/**
|
||||
* Sends analytics event with given `eventParams`. This method
|
||||
* automatically associates this logged event with this Firebase web
|
||||
* app instance on this device.
|
||||
* List of official event parameters can be found in
|
||||
* {@link https://developers.google.com/gtagjs/reference/event
|
||||
* the gtag.js reference documentation}.
|
||||
*/
|
||||
logEvent(
|
||||
eventName: EventNameString,
|
||||
eventParams?: EventParams,
|
||||
options?: AnalyticsCallOptions
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Use gtag 'config' command to set 'screen_name'.
|
||||
*/
|
||||
setCurrentScreen(screenName: string, options?: AnalyticsCallOptions): void;
|
||||
|
||||
/**
|
||||
* Use gtag 'config' command to set 'user_id'.
|
||||
*/
|
||||
setUserId(id: string, options?: AnalyticsCallOptions): void;
|
||||
|
||||
/**
|
||||
* Use gtag 'config' command to set all params specified.
|
||||
*/
|
||||
setUserProperties(
|
||||
properties: { [key: string]: any },
|
||||
options?: AnalyticsCallOptions
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Sets whether analytics collection is enabled for this app on this device.
|
||||
* window['ga-disable-analyticsId'] = true;
|
||||
*/
|
||||
setAnalyticsCollectionEnabled(enabled: boolean): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies custom options for your Firebase Analytics instance.
|
||||
* You must set these before initializing `firebase.analytics()`.
|
||||
*/
|
||||
export interface SettingsOptions {
|
||||
/** Sets custom name for `gtag` function. */
|
||||
gtagName?: string;
|
||||
/** Sets custom name for `dataLayer` array used by gtag. */
|
||||
dataLayerName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard `gtag` function provided by gtag.js.
|
||||
*/
|
||||
export interface Gtag {
|
||||
(
|
||||
command: 'config',
|
||||
targetId: string,
|
||||
config?: ControlParams | EventParams | CustomParams
|
||||
): void;
|
||||
(command: 'set', config: CustomParams): void;
|
||||
(
|
||||
command: 'event',
|
||||
eventName: string,
|
||||
eventParams?: ControlParams | EventParams | CustomParams
|
||||
): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard gtag.js control parameters.
|
||||
* For more information, see
|
||||
* {@link https://developers.google.com/gtagjs/reference/parameter
|
||||
* the gtag.js documentation on parameters}.
|
||||
*/
|
||||
export interface ControlParams {
|
||||
groups?: string | string[];
|
||||
send_to?: string | string[];
|
||||
event_callback?: () => void;
|
||||
event_timeout?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard gtag.js event parameters.
|
||||
* For more information, see
|
||||
* {@link https://developers.google.com/gtagjs/reference/parameter
|
||||
* the gtag.js documentation on parameters}.
|
||||
*/
|
||||
export interface EventParams {
|
||||
checkout_option?: string;
|
||||
checkout_step?: number;
|
||||
content_id?: string;
|
||||
content_type?: string;
|
||||
coupon?: string;
|
||||
currency?: string;
|
||||
description?: string;
|
||||
fatal?: boolean;
|
||||
items?: Item[];
|
||||
method?: string;
|
||||
number?: string;
|
||||
promotions?: Promotion[];
|
||||
screen_name?: string;
|
||||
search_term?: string;
|
||||
shipping?: Currency;
|
||||
tax?: Currency;
|
||||
transaction_id?: string;
|
||||
value?: number;
|
||||
event_label?: string;
|
||||
event_category?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Any custom params the user may pass to gtag.js.
|
||||
*/
|
||||
export interface CustomParams {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type for standard gtag.js event names. `logEvent` also accepts any
|
||||
* custom string and interprets it as a custom event name.
|
||||
*/
|
||||
export type EventNameString =
|
||||
| 'add_payment_info'
|
||||
| 'add_to_cart'
|
||||
| 'add_to_wishlist'
|
||||
| 'begin_checkout'
|
||||
| 'checkout_progress'
|
||||
| 'exception'
|
||||
| 'generate_lead'
|
||||
| 'login'
|
||||
| 'page_view'
|
||||
| 'purchase'
|
||||
| 'refund'
|
||||
| 'remove_from_cart'
|
||||
| 'screen_view'
|
||||
| 'search'
|
||||
| 'select_content'
|
||||
| 'set_checkout_option'
|
||||
| 'share'
|
||||
| 'sign_up'
|
||||
| 'timing_complete'
|
||||
| 'view_item'
|
||||
| 'view_item_list'
|
||||
| 'view_promotion'
|
||||
| 'view_search_results';
|
||||
|
||||
export type Currency = string | number;
|
||||
|
||||
export interface Item {
|
||||
brand?: string;
|
||||
category?: string;
|
||||
creative_name?: string;
|
||||
creative_slot?: string;
|
||||
id?: string;
|
||||
location_id?: string;
|
||||
name?: string;
|
||||
price?: Currency;
|
||||
quantity?: number;
|
||||
}
|
||||
|
||||
export interface Promotion {
|
||||
creative_name?: string;
|
||||
creative_slot?: string;
|
||||
id?: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
declare module '@firebase/component' {
|
||||
interface NameServiceMapping {
|
||||
'analytics': FirebaseAnalytics;
|
||||
}
|
||||
}
|
55
node_modules/@firebase/analytics-types/package.json
generated
vendored
Normal file
55
node_modules/@firebase/analytics-types/package.json
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"_from": "@firebase/analytics-types@0.2.5",
|
||||
"_id": "@firebase/analytics-types@0.2.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-aa746gTiILMn9TPBJXaYhYqnCL4CQwd4aYTAZseI9RZ/hf117xJTNy9/ZTmG5gl2AqxV0LgtdHYqKAjRlNqPIQ==",
|
||||
"_location": "/@firebase/analytics-types",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@firebase/analytics-types@0.2.5",
|
||||
"name": "@firebase/analytics-types",
|
||||
"escapedName": "@firebase%2fanalytics-types",
|
||||
"scope": "@firebase",
|
||||
"rawSpec": "0.2.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.2.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@firebase/analytics"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.2.5.tgz",
|
||||
"_shasum": "18f4400482a445504b69d6b64c7d98f11fd3ea5e",
|
||||
"_spec": "@firebase/analytics-types@0.2.5",
|
||||
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix-V3\\node_modules\\@firebase\\analytics",
|
||||
"author": {
|
||||
"name": "Firebase",
|
||||
"email": "firebase-support@google.com",
|
||||
"url": "https://firebase.google.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/firebase/firebase-js-sdk/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "@firebase/analytics Types",
|
||||
"devDependencies": {
|
||||
"typescript": "3.7.3"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/firebase/firebase-js-sdk#readme",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@firebase/analytics-types",
|
||||
"repository": {
|
||||
"directory": "packages/analytics-types",
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tsc"
|
||||
},
|
||||
"version": "0.2.5"
|
||||
}
|
5
node_modules/@firebase/analytics/README.md
generated
vendored
Normal file
5
node_modules/@firebase/analytics/README.md
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# @firebase/analytics
|
||||
|
||||
This is the Firebase Analytics component of the Firebase JS SDK.
|
||||
|
||||
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
|
562
node_modules/@firebase/analytics/dist/index.cjs.js
generated
vendored
Normal file
562
node_modules/@firebase/analytics/dist/index.cjs.js
generated
vendored
Normal file
@ -0,0 +1,562 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var firebase = _interopDefault(require('@firebase/app'));
|
||||
require('@firebase/installations');
|
||||
var tslib = require('tslib');
|
||||
var util = require('@firebase/util');
|
||||
var component = require('@firebase/component');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var ANALYTICS_ID_FIELD = 'measurementId';
|
||||
// Key to attach FID to in gtag params.
|
||||
var GA_FID_KEY = 'firebase_id';
|
||||
var ORIGIN_KEY = 'origin';
|
||||
var GTAG_URL = 'https://www.googletagmanager.com/gtag/js';
|
||||
var GtagCommand;
|
||||
(function (GtagCommand) {
|
||||
GtagCommand["EVENT"] = "event";
|
||||
GtagCommand["SET"] = "set";
|
||||
GtagCommand["CONFIG"] = "config";
|
||||
})(GtagCommand || (GtagCommand = {}));
|
||||
/*
|
||||
* Officially recommended event names for gtag.js
|
||||
* Any other string is also allowed.
|
||||
*/
|
||||
var EventName;
|
||||
(function (EventName) {
|
||||
EventName["ADD_PAYMENT_INFO"] = "add_payment_info";
|
||||
EventName["ADD_TO_CART"] = "add_to_cart";
|
||||
EventName["ADD_TO_WISHLIST"] = "add_to_wishlist";
|
||||
EventName["BEGIN_CHECKOUT"] = "begin_checkout";
|
||||
EventName["CHECKOUT_PROGRESS"] = "checkout_progress";
|
||||
EventName["EXCEPTION"] = "exception";
|
||||
EventName["GENERATE_LEAD"] = "generate_lead";
|
||||
EventName["LOGIN"] = "login";
|
||||
EventName["PAGE_VIEW"] = "page_view";
|
||||
EventName["PURCHASE"] = "purchase";
|
||||
EventName["REFUND"] = "refund";
|
||||
EventName["REMOVE_FROM_CART"] = "remove_from_cart";
|
||||
EventName["SCREEN_VIEW"] = "screen_view";
|
||||
EventName["SEARCH"] = "search";
|
||||
EventName["SELECT_CONTENT"] = "select_content";
|
||||
EventName["SET_CHECKOUT_OPTION"] = "set_checkout_option";
|
||||
EventName["SHARE"] = "share";
|
||||
EventName["SIGN_UP"] = "sign_up";
|
||||
EventName["TIMING_COMPLETE"] = "timing_complete";
|
||||
EventName["VIEW_ITEM"] = "view_item";
|
||||
EventName["VIEW_ITEM_LIST"] = "view_item_list";
|
||||
EventName["VIEW_PROMOTION"] = "view_promotion";
|
||||
EventName["VIEW_SEARCH_RESULTS"] = "view_search_results";
|
||||
})(EventName || (EventName = {}));
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Logs an analytics event through the Firebase SDK.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param eventName Google Analytics event name, choose from standard list or use a custom string.
|
||||
* @param eventParams Analytics event parameters.
|
||||
*/
|
||||
function logEvent(gtagFunction, analyticsId, eventName, eventParams, options) {
|
||||
var params = eventParams || {};
|
||||
if (!options || !options.global) {
|
||||
params = tslib.__assign(tslib.__assign({}, eventParams), { 'send_to': analyticsId });
|
||||
}
|
||||
// Workaround for http://b/141370449 - third argument cannot be undefined.
|
||||
gtagFunction(GtagCommand.EVENT, eventName, params || {});
|
||||
}
|
||||
// TODO: Brad is going to add `screen_name` to GA Gold config parameter schema
|
||||
/**
|
||||
* Set screen_name parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param screenName Screen name string to set.
|
||||
*/
|
||||
function setCurrentScreen(gtagFunction, analyticsId, screenName, options) {
|
||||
if (options && options.global) {
|
||||
gtagFunction(GtagCommand.SET, { 'screen_name': screenName });
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'screen_name': screenName
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set user_id parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param id User ID string to set
|
||||
*/
|
||||
function setUserId(gtagFunction, analyticsId, id, options) {
|
||||
if (options && options.global) {
|
||||
gtagFunction(GtagCommand.SET, { 'user_id': id });
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'user_id': id
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set all other user properties other than user_id and screen_name.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param properties Map of user properties to set
|
||||
*/
|
||||
function setUserProperties(gtagFunction, analyticsId, properties, options) {
|
||||
if (options && options.global) {
|
||||
var flatProperties = {};
|
||||
for (var _i = 0, _a = Object.keys(properties); _i < _a.length; _i++) {
|
||||
var key = _a[_i];
|
||||
// use dot notation for merge behavior in gtag.js
|
||||
flatProperties["user_properties." + key] = properties[key];
|
||||
}
|
||||
gtagFunction(GtagCommand.SET, flatProperties);
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'user_properties': properties
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set whether collection is enabled for this ID.
|
||||
*
|
||||
* @param enabled If true, collection is enabled for this ID.
|
||||
*/
|
||||
function setAnalyticsCollectionEnabled(analyticsId, enabled) {
|
||||
window["ga-disable-" + analyticsId] = !enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Initialize the analytics instance in gtag.js by calling config command with fid.
|
||||
*
|
||||
* NOTE: We combine analytics initialization and setting fid together because we want fid to be
|
||||
* part of the `page_view` event that's sent during the initialization
|
||||
* @param app Firebase app
|
||||
* @param gtagCore The gtag function that's not wrapped.
|
||||
*/
|
||||
function initializeGAId(app, installations, gtagCore) {
|
||||
return tslib.__awaiter(this, void 0, void 0, function () {
|
||||
var fid;
|
||||
var _a;
|
||||
return tslib.__generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0: return [4 /*yield*/, installations.getId()];
|
||||
case 1:
|
||||
fid = _b.sent();
|
||||
// This command initializes gtag.js and only needs to be called once for the entire web app,
|
||||
// but since it is idempotent, we can call it multiple times.
|
||||
// We keep it together with other initialization logic for better code structure.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
gtagCore('js', new Date());
|
||||
// It should be the first config command called on this GA-ID
|
||||
// Initialize this GA-ID and set FID on it using the gtag config API.
|
||||
gtagCore(GtagCommand.CONFIG, app.options[ANALYTICS_ID_FIELD], (_a = {},
|
||||
_a[GA_FID_KEY] = fid,
|
||||
// guard against developers accidentally setting properties with prefix `firebase_`
|
||||
_a[ORIGIN_KEY] = 'firebase',
|
||||
_a.update = true,
|
||||
_a));
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function insertScriptTag(dataLayerName) {
|
||||
var script = document.createElement('script');
|
||||
// We are not providing an analyticsId in the URL because it would trigger a `page_view`
|
||||
// without fid. We will initialize ga-id using gtag (config) command together with fid.
|
||||
script.src = GTAG_URL + "?l=" + dataLayerName;
|
||||
script.async = true;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
/** Get reference to, or create, global datalayer.
|
||||
* @param dataLayerName Name of datalayer (most often the default, "_dataLayer")
|
||||
*/
|
||||
function getOrCreateDataLayer(dataLayerName) {
|
||||
// Check for existing dataLayer and create if needed.
|
||||
var dataLayer = [];
|
||||
if (Array.isArray(window[dataLayerName])) {
|
||||
dataLayer = window[dataLayerName];
|
||||
}
|
||||
else {
|
||||
window[dataLayerName] = dataLayer;
|
||||
}
|
||||
return dataLayer;
|
||||
}
|
||||
/**
|
||||
* Wraps a standard gtag function with extra code to wait for completion of
|
||||
* relevant initialization promises before sending requests.
|
||||
*
|
||||
* @param gtagCore Basic gtag function that just appends to dataLayer
|
||||
* @param initializedIdPromisesMap Map of gaIds to their initialization promises
|
||||
*/
|
||||
function wrapGtag(gtagCore, initializedIdPromisesMap) {
|
||||
return function (command, idOrNameOrParams, gtagParams) {
|
||||
// If event, check that relevant initialization promises have completed.
|
||||
if (command === GtagCommand.EVENT) {
|
||||
var initializationPromisesToWaitFor = [];
|
||||
// If there's a 'send_to' param, check if any ID specified matches
|
||||
// a FID we have begun a fetch on.
|
||||
if (gtagParams && gtagParams['send_to']) {
|
||||
var gaSendToList = gtagParams['send_to'];
|
||||
// Make it an array if is isn't, so it can be dealt with the same way.
|
||||
if (!Array.isArray(gaSendToList)) {
|
||||
gaSendToList = [gaSendToList];
|
||||
}
|
||||
for (var _i = 0, gaSendToList_1 = gaSendToList; _i < gaSendToList_1.length; _i++) {
|
||||
var sendToId = gaSendToList_1[_i];
|
||||
var initializationPromise = initializedIdPromisesMap[sendToId];
|
||||
// Groups will not be in the map.
|
||||
if (initializationPromise) {
|
||||
initializationPromisesToWaitFor.push(initializationPromise);
|
||||
}
|
||||
else {
|
||||
// There is an item in 'send_to' that is not associated
|
||||
// directly with an FID, possibly a group. Empty this array
|
||||
// and let it get populated below.
|
||||
initializationPromisesToWaitFor = [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// This will be unpopulated if there was no 'send_to' field , or
|
||||
// if not all entries in the 'send_to' field could be mapped to
|
||||
// a FID. In these cases, wait on all pending initialization promises.
|
||||
if (initializationPromisesToWaitFor.length === 0) {
|
||||
for (var _a = 0, _b = Object.values(initializedIdPromisesMap); _a < _b.length; _a++) {
|
||||
var idPromise = _b[_a];
|
||||
initializationPromisesToWaitFor.push(idPromise);
|
||||
}
|
||||
}
|
||||
// Run core gtag function with args after all relevant initialization
|
||||
// promises have been resolved.
|
||||
Promise.all(initializationPromisesToWaitFor)
|
||||
// Workaround for http://b/141370449 - third argument cannot be undefined.
|
||||
.then(function () {
|
||||
return gtagCore(GtagCommand.EVENT, idOrNameOrParams, gtagParams || {});
|
||||
})
|
||||
.catch(function (e) { return console.error(e); });
|
||||
}
|
||||
else if (command === GtagCommand.CONFIG) {
|
||||
var initializationPromiseToWait = initializedIdPromisesMap[idOrNameOrParams] ||
|
||||
Promise.resolve();
|
||||
initializationPromiseToWait
|
||||
.then(function () {
|
||||
gtagCore(GtagCommand.CONFIG, idOrNameOrParams, gtagParams);
|
||||
})
|
||||
.catch(function (e) { return console.error(e); });
|
||||
}
|
||||
else {
|
||||
// SET command.
|
||||
// Splitting calls for CONFIG and SET to make it clear which signature
|
||||
// Typescript is checking.
|
||||
gtagCore(GtagCommand.SET, idOrNameOrParams);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Creates global gtag function or wraps existing one if found.
|
||||
* This wrapped function attaches Firebase instance ID (FID) to gtag 'config' and
|
||||
* 'event' calls that belong to the GAID associated with this Firebase instance.
|
||||
*
|
||||
* @param initializedIdPromisesMap Map of gaId to initialization promises.
|
||||
* @param dataLayerName Name of global GA datalayer array.
|
||||
* @param gtagFunctionName Name of global gtag function ("gtag" if not user-specified)
|
||||
*/
|
||||
function wrapOrCreateGtag(initializedIdPromisesMap, dataLayerName, gtagFunctionName) {
|
||||
// Create a basic core gtag function
|
||||
var gtagCore = function () {
|
||||
var _args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_args[_i] = arguments[_i];
|
||||
}
|
||||
// Must push IArguments object, not an array.
|
||||
window[dataLayerName].push(arguments);
|
||||
};
|
||||
// Replace it with existing one if found
|
||||
if (window[gtagFunctionName] &&
|
||||
typeof window[gtagFunctionName] === 'function') {
|
||||
// @ts-ignore
|
||||
gtagCore = window[gtagFunctionName];
|
||||
}
|
||||
window[gtagFunctionName] = wrapGtag(gtagCore, initializedIdPromisesMap);
|
||||
return {
|
||||
gtagCore: gtagCore,
|
||||
wrappedGtag: window[gtagFunctionName]
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Returns first script tag in DOM matching our gtag url pattern.
|
||||
*/
|
||||
function findGtagScriptOnPage() {
|
||||
var scriptTags = window.document.getElementsByTagName('script');
|
||||
for (var _i = 0, _a = Object.values(scriptTags); _i < _a.length; _i++) {
|
||||
var tag = _a[_i];
|
||||
if (tag.src && tag.src.includes(GTAG_URL)) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-ga-id" /* NO_GA_ID */] = "\"" + ANALYTICS_ID_FIELD + "\" field is empty in " +
|
||||
'Firebase config. Firebase Analytics ' +
|
||||
'requires this field to contain a valid measurement ID.',
|
||||
_a["already-exists" /* ALREADY_EXISTS */] = 'A Firebase Analytics instance with the measurement ID ${id} ' +
|
||||
' already exists. ' +
|
||||
'Only one Firebase Analytics instance can be created for each measurement ID.',
|
||||
_a["already-initialized" /* ALREADY_INITIALIZED */] = 'Firebase Analytics has already been initialized.' +
|
||||
'settings() must be called before initializing any Analytics instance' +
|
||||
'or it will have no effect.',
|
||||
_a["interop-component-reg-failed" /* INTEROP_COMPONENT_REG_FAILED */] = 'Firebase Analytics Interop Component failed to instantiate',
|
||||
_a);
|
||||
var ERROR_FACTORY = new util.ErrorFactory('analytics', 'Analytics', ERRORS);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Maps gaId to FID fetch promises.
|
||||
*/
|
||||
var initializedIdPromisesMap = {};
|
||||
/**
|
||||
* Name for window global data layer array used by GA: defaults to 'dataLayer'.
|
||||
*/
|
||||
var dataLayerName = 'dataLayer';
|
||||
/**
|
||||
* Name for window global gtag function used by GA: defaults to 'gtag'.
|
||||
*/
|
||||
var gtagName = 'gtag';
|
||||
/**
|
||||
* Reproduction of standard gtag function or reference to existing
|
||||
* gtag function on window object.
|
||||
*/
|
||||
var gtagCoreFunction;
|
||||
/**
|
||||
* Wrapper around gtag function that ensures FID is sent with all
|
||||
* relevant event and config calls.
|
||||
*/
|
||||
var wrappedGtagFunction;
|
||||
/**
|
||||
* Flag to ensure page initialization steps (creation or wrapping of
|
||||
* dataLayer and gtag script) are only run once per page load.
|
||||
*/
|
||||
var globalInitDone = false;
|
||||
/**
|
||||
* For testing
|
||||
*/
|
||||
function resetGlobalVars(newGlobalInitDone, newGaInitializedPromise) {
|
||||
if (newGlobalInitDone === void 0) { newGlobalInitDone = false; }
|
||||
if (newGaInitializedPromise === void 0) { newGaInitializedPromise = {}; }
|
||||
globalInitDone = newGlobalInitDone;
|
||||
initializedIdPromisesMap = newGaInitializedPromise;
|
||||
dataLayerName = 'dataLayer';
|
||||
gtagName = 'gtag';
|
||||
}
|
||||
/**
|
||||
* This must be run before calling firebase.analytics() or it won't
|
||||
* have any effect.
|
||||
* @param options Custom gtag and dataLayer names.
|
||||
*/
|
||||
function settings(options) {
|
||||
if (globalInitDone) {
|
||||
throw ERROR_FACTORY.create("already-initialized" /* ALREADY_INITIALIZED */);
|
||||
}
|
||||
if (options.dataLayerName) {
|
||||
dataLayerName = options.dataLayerName;
|
||||
}
|
||||
if (options.gtagName) {
|
||||
gtagName = options.gtagName;
|
||||
}
|
||||
}
|
||||
function factory(app, installations) {
|
||||
var analyticsId = app.options[ANALYTICS_ID_FIELD];
|
||||
if (!analyticsId) {
|
||||
throw ERROR_FACTORY.create("no-ga-id" /* NO_GA_ID */);
|
||||
}
|
||||
if (initializedIdPromisesMap[analyticsId] != null) {
|
||||
throw ERROR_FACTORY.create("already-exists" /* ALREADY_EXISTS */, {
|
||||
id: analyticsId
|
||||
});
|
||||
}
|
||||
if (!globalInitDone) {
|
||||
// Steps here should only be done once per page: creation or wrapping
|
||||
// of dataLayer and global gtag function.
|
||||
// Detect if user has already put the gtag <script> tag on this page.
|
||||
if (!findGtagScriptOnPage()) {
|
||||
insertScriptTag(dataLayerName);
|
||||
}
|
||||
getOrCreateDataLayer(dataLayerName);
|
||||
var _a = wrapOrCreateGtag(initializedIdPromisesMap, dataLayerName, gtagName), wrappedGtag = _a.wrappedGtag, gtagCore = _a.gtagCore;
|
||||
wrappedGtagFunction = wrappedGtag;
|
||||
gtagCoreFunction = gtagCore;
|
||||
globalInitDone = true;
|
||||
}
|
||||
// Async but non-blocking.
|
||||
initializedIdPromisesMap[analyticsId] = initializeGAId(app, installations, gtagCoreFunction);
|
||||
var analyticsInstance = {
|
||||
app: app,
|
||||
logEvent: function (eventName, eventParams, options) {
|
||||
return logEvent(wrappedGtagFunction, analyticsId, eventName, eventParams, options);
|
||||
},
|
||||
setCurrentScreen: function (screenName, options) {
|
||||
return setCurrentScreen(wrappedGtagFunction, analyticsId, screenName, options);
|
||||
},
|
||||
setUserId: function (id, options) {
|
||||
return setUserId(wrappedGtagFunction, analyticsId, id, options);
|
||||
},
|
||||
setUserProperties: function (properties, options) {
|
||||
return setUserProperties(wrappedGtagFunction, analyticsId, properties, options);
|
||||
},
|
||||
setAnalyticsCollectionEnabled: function (enabled) {
|
||||
return setAnalyticsCollectionEnabled(analyticsId, enabled);
|
||||
}
|
||||
};
|
||||
return analyticsInstance;
|
||||
}
|
||||
|
||||
var name = "@firebase/analytics";
|
||||
var version = "0.2.12";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Type constant for Firebase Analytics.
|
||||
*/
|
||||
var ANALYTICS_TYPE = 'analytics';
|
||||
function registerAnalytics(instance) {
|
||||
instance.INTERNAL.registerComponent(new component.Component(ANALYTICS_TYPE, function (container) {
|
||||
// getImmediate for FirebaseApp will always succeed
|
||||
var app = container.getProvider('app').getImmediate();
|
||||
var installations = container
|
||||
.getProvider('installations')
|
||||
.getImmediate();
|
||||
return factory(app, installations);
|
||||
}, "PUBLIC" /* PUBLIC */).setServiceProps({
|
||||
settings: settings,
|
||||
EventName: EventName
|
||||
}));
|
||||
instance.INTERNAL.registerComponent(new component.Component('analytics-internal', internalFactory, "PRIVATE" /* PRIVATE */));
|
||||
instance.registerVersion(name, version);
|
||||
function internalFactory(container) {
|
||||
try {
|
||||
var analytics = container.getProvider(ANALYTICS_TYPE).getImmediate();
|
||||
return {
|
||||
logEvent: analytics.logEvent
|
||||
};
|
||||
}
|
||||
catch (e) {
|
||||
throw ERROR_FACTORY.create("interop-component-reg-failed" /* INTEROP_COMPONENT_REG_FAILED */, {
|
||||
reason: e
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
registerAnalytics(firebase);
|
||||
|
||||
exports.factory = factory;
|
||||
exports.registerAnalytics = registerAnalytics;
|
||||
exports.resetGlobalVars = resetGlobalVars;
|
||||
exports.settings = settings;
|
||||
//# sourceMappingURL=index.cjs.js.map
|
1
node_modules/@firebase/analytics/dist/index.cjs.js.map
generated
vendored
Normal file
1
node_modules/@firebase/analytics/dist/index.cjs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
22
node_modules/@firebase/analytics/dist/index.d.ts
generated
vendored
Normal file
22
node_modules/@firebase/analytics/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
import '@firebase/installations';
|
||||
import { FirebaseAnalytics } from '@firebase/analytics-types';
|
||||
import { _FirebaseNamespace } from '@firebase/app-types/private';
|
||||
import { factory, settings, resetGlobalVars } from './src/factory';
|
||||
declare global {
|
||||
interface Window {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
}
|
||||
export declare function registerAnalytics(instance: _FirebaseNamespace): void;
|
||||
export { factory, settings, resetGlobalVars };
|
||||
/**
|
||||
* Define extension behavior of `registerAnalytics`
|
||||
*/
|
||||
declare module '@firebase/app-types' {
|
||||
interface FirebaseNamespace {
|
||||
analytics(app?: FirebaseApp): FirebaseAnalytics;
|
||||
}
|
||||
interface FirebaseApp {
|
||||
analytics(): FirebaseAnalytics;
|
||||
}
|
||||
}
|
553
node_modules/@firebase/analytics/dist/index.esm.js
generated
vendored
Normal file
553
node_modules/@firebase/analytics/dist/index.esm.js
generated
vendored
Normal file
@ -0,0 +1,553 @@
|
||||
import firebase from '@firebase/app';
|
||||
import '@firebase/installations';
|
||||
import { __assign, __awaiter, __generator } from 'tslib';
|
||||
import { ErrorFactory } from '@firebase/util';
|
||||
import { Component } from '@firebase/component';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var ANALYTICS_ID_FIELD = 'measurementId';
|
||||
// Key to attach FID to in gtag params.
|
||||
var GA_FID_KEY = 'firebase_id';
|
||||
var ORIGIN_KEY = 'origin';
|
||||
var GTAG_URL = 'https://www.googletagmanager.com/gtag/js';
|
||||
var GtagCommand;
|
||||
(function (GtagCommand) {
|
||||
GtagCommand["EVENT"] = "event";
|
||||
GtagCommand["SET"] = "set";
|
||||
GtagCommand["CONFIG"] = "config";
|
||||
})(GtagCommand || (GtagCommand = {}));
|
||||
/*
|
||||
* Officially recommended event names for gtag.js
|
||||
* Any other string is also allowed.
|
||||
*/
|
||||
var EventName;
|
||||
(function (EventName) {
|
||||
EventName["ADD_PAYMENT_INFO"] = "add_payment_info";
|
||||
EventName["ADD_TO_CART"] = "add_to_cart";
|
||||
EventName["ADD_TO_WISHLIST"] = "add_to_wishlist";
|
||||
EventName["BEGIN_CHECKOUT"] = "begin_checkout";
|
||||
EventName["CHECKOUT_PROGRESS"] = "checkout_progress";
|
||||
EventName["EXCEPTION"] = "exception";
|
||||
EventName["GENERATE_LEAD"] = "generate_lead";
|
||||
EventName["LOGIN"] = "login";
|
||||
EventName["PAGE_VIEW"] = "page_view";
|
||||
EventName["PURCHASE"] = "purchase";
|
||||
EventName["REFUND"] = "refund";
|
||||
EventName["REMOVE_FROM_CART"] = "remove_from_cart";
|
||||
EventName["SCREEN_VIEW"] = "screen_view";
|
||||
EventName["SEARCH"] = "search";
|
||||
EventName["SELECT_CONTENT"] = "select_content";
|
||||
EventName["SET_CHECKOUT_OPTION"] = "set_checkout_option";
|
||||
EventName["SHARE"] = "share";
|
||||
EventName["SIGN_UP"] = "sign_up";
|
||||
EventName["TIMING_COMPLETE"] = "timing_complete";
|
||||
EventName["VIEW_ITEM"] = "view_item";
|
||||
EventName["VIEW_ITEM_LIST"] = "view_item_list";
|
||||
EventName["VIEW_PROMOTION"] = "view_promotion";
|
||||
EventName["VIEW_SEARCH_RESULTS"] = "view_search_results";
|
||||
})(EventName || (EventName = {}));
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Logs an analytics event through the Firebase SDK.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param eventName Google Analytics event name, choose from standard list or use a custom string.
|
||||
* @param eventParams Analytics event parameters.
|
||||
*/
|
||||
function logEvent(gtagFunction, analyticsId, eventName, eventParams, options) {
|
||||
var params = eventParams || {};
|
||||
if (!options || !options.global) {
|
||||
params = __assign(__assign({}, eventParams), { 'send_to': analyticsId });
|
||||
}
|
||||
// Workaround for http://b/141370449 - third argument cannot be undefined.
|
||||
gtagFunction(GtagCommand.EVENT, eventName, params || {});
|
||||
}
|
||||
// TODO: Brad is going to add `screen_name` to GA Gold config parameter schema
|
||||
/**
|
||||
* Set screen_name parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param screenName Screen name string to set.
|
||||
*/
|
||||
function setCurrentScreen(gtagFunction, analyticsId, screenName, options) {
|
||||
if (options && options.global) {
|
||||
gtagFunction(GtagCommand.SET, { 'screen_name': screenName });
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'screen_name': screenName
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set user_id parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param id User ID string to set
|
||||
*/
|
||||
function setUserId(gtagFunction, analyticsId, id, options) {
|
||||
if (options && options.global) {
|
||||
gtagFunction(GtagCommand.SET, { 'user_id': id });
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'user_id': id
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set all other user properties other than user_id and screen_name.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param properties Map of user properties to set
|
||||
*/
|
||||
function setUserProperties(gtagFunction, analyticsId, properties, options) {
|
||||
if (options && options.global) {
|
||||
var flatProperties = {};
|
||||
for (var _i = 0, _a = Object.keys(properties); _i < _a.length; _i++) {
|
||||
var key = _a[_i];
|
||||
// use dot notation for merge behavior in gtag.js
|
||||
flatProperties["user_properties." + key] = properties[key];
|
||||
}
|
||||
gtagFunction(GtagCommand.SET, flatProperties);
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'user_properties': properties
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set whether collection is enabled for this ID.
|
||||
*
|
||||
* @param enabled If true, collection is enabled for this ID.
|
||||
*/
|
||||
function setAnalyticsCollectionEnabled(analyticsId, enabled) {
|
||||
window["ga-disable-" + analyticsId] = !enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Initialize the analytics instance in gtag.js by calling config command with fid.
|
||||
*
|
||||
* NOTE: We combine analytics initialization and setting fid together because we want fid to be
|
||||
* part of the `page_view` event that's sent during the initialization
|
||||
* @param app Firebase app
|
||||
* @param gtagCore The gtag function that's not wrapped.
|
||||
*/
|
||||
function initializeGAId(app, installations, gtagCore) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var fid;
|
||||
var _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0: return [4 /*yield*/, installations.getId()];
|
||||
case 1:
|
||||
fid = _b.sent();
|
||||
// This command initializes gtag.js and only needs to be called once for the entire web app,
|
||||
// but since it is idempotent, we can call it multiple times.
|
||||
// We keep it together with other initialization logic for better code structure.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
gtagCore('js', new Date());
|
||||
// It should be the first config command called on this GA-ID
|
||||
// Initialize this GA-ID and set FID on it using the gtag config API.
|
||||
gtagCore(GtagCommand.CONFIG, app.options[ANALYTICS_ID_FIELD], (_a = {},
|
||||
_a[GA_FID_KEY] = fid,
|
||||
// guard against developers accidentally setting properties with prefix `firebase_`
|
||||
_a[ORIGIN_KEY] = 'firebase',
|
||||
_a.update = true,
|
||||
_a));
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function insertScriptTag(dataLayerName) {
|
||||
var script = document.createElement('script');
|
||||
// We are not providing an analyticsId in the URL because it would trigger a `page_view`
|
||||
// without fid. We will initialize ga-id using gtag (config) command together with fid.
|
||||
script.src = GTAG_URL + "?l=" + dataLayerName;
|
||||
script.async = true;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
/** Get reference to, or create, global datalayer.
|
||||
* @param dataLayerName Name of datalayer (most often the default, "_dataLayer")
|
||||
*/
|
||||
function getOrCreateDataLayer(dataLayerName) {
|
||||
// Check for existing dataLayer and create if needed.
|
||||
var dataLayer = [];
|
||||
if (Array.isArray(window[dataLayerName])) {
|
||||
dataLayer = window[dataLayerName];
|
||||
}
|
||||
else {
|
||||
window[dataLayerName] = dataLayer;
|
||||
}
|
||||
return dataLayer;
|
||||
}
|
||||
/**
|
||||
* Wraps a standard gtag function with extra code to wait for completion of
|
||||
* relevant initialization promises before sending requests.
|
||||
*
|
||||
* @param gtagCore Basic gtag function that just appends to dataLayer
|
||||
* @param initializedIdPromisesMap Map of gaIds to their initialization promises
|
||||
*/
|
||||
function wrapGtag(gtagCore, initializedIdPromisesMap) {
|
||||
return function (command, idOrNameOrParams, gtagParams) {
|
||||
// If event, check that relevant initialization promises have completed.
|
||||
if (command === GtagCommand.EVENT) {
|
||||
var initializationPromisesToWaitFor = [];
|
||||
// If there's a 'send_to' param, check if any ID specified matches
|
||||
// a FID we have begun a fetch on.
|
||||
if (gtagParams && gtagParams['send_to']) {
|
||||
var gaSendToList = gtagParams['send_to'];
|
||||
// Make it an array if is isn't, so it can be dealt with the same way.
|
||||
if (!Array.isArray(gaSendToList)) {
|
||||
gaSendToList = [gaSendToList];
|
||||
}
|
||||
for (var _i = 0, gaSendToList_1 = gaSendToList; _i < gaSendToList_1.length; _i++) {
|
||||
var sendToId = gaSendToList_1[_i];
|
||||
var initializationPromise = initializedIdPromisesMap[sendToId];
|
||||
// Groups will not be in the map.
|
||||
if (initializationPromise) {
|
||||
initializationPromisesToWaitFor.push(initializationPromise);
|
||||
}
|
||||
else {
|
||||
// There is an item in 'send_to' that is not associated
|
||||
// directly with an FID, possibly a group. Empty this array
|
||||
// and let it get populated below.
|
||||
initializationPromisesToWaitFor = [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// This will be unpopulated if there was no 'send_to' field , or
|
||||
// if not all entries in the 'send_to' field could be mapped to
|
||||
// a FID. In these cases, wait on all pending initialization promises.
|
||||
if (initializationPromisesToWaitFor.length === 0) {
|
||||
for (var _a = 0, _b = Object.values(initializedIdPromisesMap); _a < _b.length; _a++) {
|
||||
var idPromise = _b[_a];
|
||||
initializationPromisesToWaitFor.push(idPromise);
|
||||
}
|
||||
}
|
||||
// Run core gtag function with args after all relevant initialization
|
||||
// promises have been resolved.
|
||||
Promise.all(initializationPromisesToWaitFor)
|
||||
// Workaround for http://b/141370449 - third argument cannot be undefined.
|
||||
.then(function () {
|
||||
return gtagCore(GtagCommand.EVENT, idOrNameOrParams, gtagParams || {});
|
||||
})
|
||||
.catch(function (e) { return console.error(e); });
|
||||
}
|
||||
else if (command === GtagCommand.CONFIG) {
|
||||
var initializationPromiseToWait = initializedIdPromisesMap[idOrNameOrParams] ||
|
||||
Promise.resolve();
|
||||
initializationPromiseToWait
|
||||
.then(function () {
|
||||
gtagCore(GtagCommand.CONFIG, idOrNameOrParams, gtagParams);
|
||||
})
|
||||
.catch(function (e) { return console.error(e); });
|
||||
}
|
||||
else {
|
||||
// SET command.
|
||||
// Splitting calls for CONFIG and SET to make it clear which signature
|
||||
// Typescript is checking.
|
||||
gtagCore(GtagCommand.SET, idOrNameOrParams);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Creates global gtag function or wraps existing one if found.
|
||||
* This wrapped function attaches Firebase instance ID (FID) to gtag 'config' and
|
||||
* 'event' calls that belong to the GAID associated with this Firebase instance.
|
||||
*
|
||||
* @param initializedIdPromisesMap Map of gaId to initialization promises.
|
||||
* @param dataLayerName Name of global GA datalayer array.
|
||||
* @param gtagFunctionName Name of global gtag function ("gtag" if not user-specified)
|
||||
*/
|
||||
function wrapOrCreateGtag(initializedIdPromisesMap, dataLayerName, gtagFunctionName) {
|
||||
// Create a basic core gtag function
|
||||
var gtagCore = function () {
|
||||
var _args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_args[_i] = arguments[_i];
|
||||
}
|
||||
// Must push IArguments object, not an array.
|
||||
window[dataLayerName].push(arguments);
|
||||
};
|
||||
// Replace it with existing one if found
|
||||
if (window[gtagFunctionName] &&
|
||||
typeof window[gtagFunctionName] === 'function') {
|
||||
// @ts-ignore
|
||||
gtagCore = window[gtagFunctionName];
|
||||
}
|
||||
window[gtagFunctionName] = wrapGtag(gtagCore, initializedIdPromisesMap);
|
||||
return {
|
||||
gtagCore: gtagCore,
|
||||
wrappedGtag: window[gtagFunctionName]
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Returns first script tag in DOM matching our gtag url pattern.
|
||||
*/
|
||||
function findGtagScriptOnPage() {
|
||||
var scriptTags = window.document.getElementsByTagName('script');
|
||||
for (var _i = 0, _a = Object.values(scriptTags); _i < _a.length; _i++) {
|
||||
var tag = _a[_i];
|
||||
if (tag.src && tag.src.includes(GTAG_URL)) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-ga-id" /* NO_GA_ID */] = "\"" + ANALYTICS_ID_FIELD + "\" field is empty in " +
|
||||
'Firebase config. Firebase Analytics ' +
|
||||
'requires this field to contain a valid measurement ID.',
|
||||
_a["already-exists" /* ALREADY_EXISTS */] = 'A Firebase Analytics instance with the measurement ID ${id} ' +
|
||||
' already exists. ' +
|
||||
'Only one Firebase Analytics instance can be created for each measurement ID.',
|
||||
_a["already-initialized" /* ALREADY_INITIALIZED */] = 'Firebase Analytics has already been initialized.' +
|
||||
'settings() must be called before initializing any Analytics instance' +
|
||||
'or it will have no effect.',
|
||||
_a["interop-component-reg-failed" /* INTEROP_COMPONENT_REG_FAILED */] = 'Firebase Analytics Interop Component failed to instantiate',
|
||||
_a);
|
||||
var ERROR_FACTORY = new ErrorFactory('analytics', 'Analytics', ERRORS);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Maps gaId to FID fetch promises.
|
||||
*/
|
||||
var initializedIdPromisesMap = {};
|
||||
/**
|
||||
* Name for window global data layer array used by GA: defaults to 'dataLayer'.
|
||||
*/
|
||||
var dataLayerName = 'dataLayer';
|
||||
/**
|
||||
* Name for window global gtag function used by GA: defaults to 'gtag'.
|
||||
*/
|
||||
var gtagName = 'gtag';
|
||||
/**
|
||||
* Reproduction of standard gtag function or reference to existing
|
||||
* gtag function on window object.
|
||||
*/
|
||||
var gtagCoreFunction;
|
||||
/**
|
||||
* Wrapper around gtag function that ensures FID is sent with all
|
||||
* relevant event and config calls.
|
||||
*/
|
||||
var wrappedGtagFunction;
|
||||
/**
|
||||
* Flag to ensure page initialization steps (creation or wrapping of
|
||||
* dataLayer and gtag script) are only run once per page load.
|
||||
*/
|
||||
var globalInitDone = false;
|
||||
/**
|
||||
* For testing
|
||||
*/
|
||||
function resetGlobalVars(newGlobalInitDone, newGaInitializedPromise) {
|
||||
if (newGlobalInitDone === void 0) { newGlobalInitDone = false; }
|
||||
if (newGaInitializedPromise === void 0) { newGaInitializedPromise = {}; }
|
||||
globalInitDone = newGlobalInitDone;
|
||||
initializedIdPromisesMap = newGaInitializedPromise;
|
||||
dataLayerName = 'dataLayer';
|
||||
gtagName = 'gtag';
|
||||
}
|
||||
/**
|
||||
* This must be run before calling firebase.analytics() or it won't
|
||||
* have any effect.
|
||||
* @param options Custom gtag and dataLayer names.
|
||||
*/
|
||||
function settings(options) {
|
||||
if (globalInitDone) {
|
||||
throw ERROR_FACTORY.create("already-initialized" /* ALREADY_INITIALIZED */);
|
||||
}
|
||||
if (options.dataLayerName) {
|
||||
dataLayerName = options.dataLayerName;
|
||||
}
|
||||
if (options.gtagName) {
|
||||
gtagName = options.gtagName;
|
||||
}
|
||||
}
|
||||
function factory(app, installations) {
|
||||
var analyticsId = app.options[ANALYTICS_ID_FIELD];
|
||||
if (!analyticsId) {
|
||||
throw ERROR_FACTORY.create("no-ga-id" /* NO_GA_ID */);
|
||||
}
|
||||
if (initializedIdPromisesMap[analyticsId] != null) {
|
||||
throw ERROR_FACTORY.create("already-exists" /* ALREADY_EXISTS */, {
|
||||
id: analyticsId
|
||||
});
|
||||
}
|
||||
if (!globalInitDone) {
|
||||
// Steps here should only be done once per page: creation or wrapping
|
||||
// of dataLayer and global gtag function.
|
||||
// Detect if user has already put the gtag <script> tag on this page.
|
||||
if (!findGtagScriptOnPage()) {
|
||||
insertScriptTag(dataLayerName);
|
||||
}
|
||||
getOrCreateDataLayer(dataLayerName);
|
||||
var _a = wrapOrCreateGtag(initializedIdPromisesMap, dataLayerName, gtagName), wrappedGtag = _a.wrappedGtag, gtagCore = _a.gtagCore;
|
||||
wrappedGtagFunction = wrappedGtag;
|
||||
gtagCoreFunction = gtagCore;
|
||||
globalInitDone = true;
|
||||
}
|
||||
// Async but non-blocking.
|
||||
initializedIdPromisesMap[analyticsId] = initializeGAId(app, installations, gtagCoreFunction);
|
||||
var analyticsInstance = {
|
||||
app: app,
|
||||
logEvent: function (eventName, eventParams, options) {
|
||||
return logEvent(wrappedGtagFunction, analyticsId, eventName, eventParams, options);
|
||||
},
|
||||
setCurrentScreen: function (screenName, options) {
|
||||
return setCurrentScreen(wrappedGtagFunction, analyticsId, screenName, options);
|
||||
},
|
||||
setUserId: function (id, options) {
|
||||
return setUserId(wrappedGtagFunction, analyticsId, id, options);
|
||||
},
|
||||
setUserProperties: function (properties, options) {
|
||||
return setUserProperties(wrappedGtagFunction, analyticsId, properties, options);
|
||||
},
|
||||
setAnalyticsCollectionEnabled: function (enabled) {
|
||||
return setAnalyticsCollectionEnabled(analyticsId, enabled);
|
||||
}
|
||||
};
|
||||
return analyticsInstance;
|
||||
}
|
||||
|
||||
var name = "@firebase/analytics";
|
||||
var version = "0.2.12";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Type constant for Firebase Analytics.
|
||||
*/
|
||||
var ANALYTICS_TYPE = 'analytics';
|
||||
function registerAnalytics(instance) {
|
||||
instance.INTERNAL.registerComponent(new Component(ANALYTICS_TYPE, function (container) {
|
||||
// getImmediate for FirebaseApp will always succeed
|
||||
var app = container.getProvider('app').getImmediate();
|
||||
var installations = container
|
||||
.getProvider('installations')
|
||||
.getImmediate();
|
||||
return factory(app, installations);
|
||||
}, "PUBLIC" /* PUBLIC */).setServiceProps({
|
||||
settings: settings,
|
||||
EventName: EventName
|
||||
}));
|
||||
instance.INTERNAL.registerComponent(new Component('analytics-internal', internalFactory, "PRIVATE" /* PRIVATE */));
|
||||
instance.registerVersion(name, version);
|
||||
function internalFactory(container) {
|
||||
try {
|
||||
var analytics = container.getProvider(ANALYTICS_TYPE).getImmediate();
|
||||
return {
|
||||
logEvent: analytics.logEvent
|
||||
};
|
||||
}
|
||||
catch (e) {
|
||||
throw ERROR_FACTORY.create("interop-component-reg-failed" /* INTEROP_COMPONENT_REG_FAILED */, {
|
||||
reason: e
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
registerAnalytics(firebase);
|
||||
|
||||
export { factory, registerAnalytics, resetGlobalVars, settings };
|
||||
//# sourceMappingURL=index.esm.js.map
|
1
node_modules/@firebase/analytics/dist/index.esm.js.map
generated
vendored
Normal file
1
node_modules/@firebase/analytics/dist/index.esm.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
518
node_modules/@firebase/analytics/dist/index.esm2017.js
generated
vendored
Normal file
518
node_modules/@firebase/analytics/dist/index.esm2017.js
generated
vendored
Normal file
@ -0,0 +1,518 @@
|
||||
import firebase from '@firebase/app';
|
||||
import '@firebase/installations';
|
||||
import { ErrorFactory } from '@firebase/util';
|
||||
import { Component } from '@firebase/component';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const ANALYTICS_ID_FIELD = 'measurementId';
|
||||
// Key to attach FID to in gtag params.
|
||||
const GA_FID_KEY = 'firebase_id';
|
||||
const ORIGIN_KEY = 'origin';
|
||||
const GTAG_URL = 'https://www.googletagmanager.com/gtag/js';
|
||||
var GtagCommand;
|
||||
(function (GtagCommand) {
|
||||
GtagCommand["EVENT"] = "event";
|
||||
GtagCommand["SET"] = "set";
|
||||
GtagCommand["CONFIG"] = "config";
|
||||
})(GtagCommand || (GtagCommand = {}));
|
||||
/*
|
||||
* Officially recommended event names for gtag.js
|
||||
* Any other string is also allowed.
|
||||
*/
|
||||
var EventName;
|
||||
(function (EventName) {
|
||||
EventName["ADD_PAYMENT_INFO"] = "add_payment_info";
|
||||
EventName["ADD_TO_CART"] = "add_to_cart";
|
||||
EventName["ADD_TO_WISHLIST"] = "add_to_wishlist";
|
||||
EventName["BEGIN_CHECKOUT"] = "begin_checkout";
|
||||
EventName["CHECKOUT_PROGRESS"] = "checkout_progress";
|
||||
EventName["EXCEPTION"] = "exception";
|
||||
EventName["GENERATE_LEAD"] = "generate_lead";
|
||||
EventName["LOGIN"] = "login";
|
||||
EventName["PAGE_VIEW"] = "page_view";
|
||||
EventName["PURCHASE"] = "purchase";
|
||||
EventName["REFUND"] = "refund";
|
||||
EventName["REMOVE_FROM_CART"] = "remove_from_cart";
|
||||
EventName["SCREEN_VIEW"] = "screen_view";
|
||||
EventName["SEARCH"] = "search";
|
||||
EventName["SELECT_CONTENT"] = "select_content";
|
||||
EventName["SET_CHECKOUT_OPTION"] = "set_checkout_option";
|
||||
EventName["SHARE"] = "share";
|
||||
EventName["SIGN_UP"] = "sign_up";
|
||||
EventName["TIMING_COMPLETE"] = "timing_complete";
|
||||
EventName["VIEW_ITEM"] = "view_item";
|
||||
EventName["VIEW_ITEM_LIST"] = "view_item_list";
|
||||
EventName["VIEW_PROMOTION"] = "view_promotion";
|
||||
EventName["VIEW_SEARCH_RESULTS"] = "view_search_results";
|
||||
})(EventName || (EventName = {}));
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Logs an analytics event through the Firebase SDK.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param eventName Google Analytics event name, choose from standard list or use a custom string.
|
||||
* @param eventParams Analytics event parameters.
|
||||
*/
|
||||
function logEvent(gtagFunction, analyticsId, eventName, eventParams, options) {
|
||||
let params = eventParams || {};
|
||||
if (!options || !options.global) {
|
||||
params = Object.assign(Object.assign({}, eventParams), { 'send_to': analyticsId });
|
||||
}
|
||||
// Workaround for http://b/141370449 - third argument cannot be undefined.
|
||||
gtagFunction(GtagCommand.EVENT, eventName, params || {});
|
||||
}
|
||||
// TODO: Brad is going to add `screen_name` to GA Gold config parameter schema
|
||||
/**
|
||||
* Set screen_name parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param screenName Screen name string to set.
|
||||
*/
|
||||
function setCurrentScreen(gtagFunction, analyticsId, screenName, options) {
|
||||
if (options && options.global) {
|
||||
gtagFunction(GtagCommand.SET, { 'screen_name': screenName });
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'screen_name': screenName
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set user_id parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param id User ID string to set
|
||||
*/
|
||||
function setUserId(gtagFunction, analyticsId, id, options) {
|
||||
if (options && options.global) {
|
||||
gtagFunction(GtagCommand.SET, { 'user_id': id });
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'user_id': id
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set all other user properties other than user_id and screen_name.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param properties Map of user properties to set
|
||||
*/
|
||||
function setUserProperties(gtagFunction, analyticsId, properties, options) {
|
||||
if (options && options.global) {
|
||||
const flatProperties = {};
|
||||
for (const key of Object.keys(properties)) {
|
||||
// use dot notation for merge behavior in gtag.js
|
||||
flatProperties[`user_properties.${key}`] = properties[key];
|
||||
}
|
||||
gtagFunction(GtagCommand.SET, flatProperties);
|
||||
}
|
||||
else {
|
||||
gtagFunction(GtagCommand.CONFIG, analyticsId, {
|
||||
update: true,
|
||||
'user_properties': properties
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set whether collection is enabled for this ID.
|
||||
*
|
||||
* @param enabled If true, collection is enabled for this ID.
|
||||
*/
|
||||
function setAnalyticsCollectionEnabled(analyticsId, enabled) {
|
||||
window[`ga-disable-${analyticsId}`] = !enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Initialize the analytics instance in gtag.js by calling config command with fid.
|
||||
*
|
||||
* NOTE: We combine analytics initialization and setting fid together because we want fid to be
|
||||
* part of the `page_view` event that's sent during the initialization
|
||||
* @param app Firebase app
|
||||
* @param gtagCore The gtag function that's not wrapped.
|
||||
*/
|
||||
async function initializeGAId(app, installations, gtagCore) {
|
||||
const fid = await installations.getId();
|
||||
// This command initializes gtag.js and only needs to be called once for the entire web app,
|
||||
// but since it is idempotent, we can call it multiple times.
|
||||
// We keep it together with other initialization logic for better code structure.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
gtagCore('js', new Date());
|
||||
// It should be the first config command called on this GA-ID
|
||||
// Initialize this GA-ID and set FID on it using the gtag config API.
|
||||
gtagCore(GtagCommand.CONFIG, app.options[ANALYTICS_ID_FIELD], {
|
||||
[GA_FID_KEY]: fid,
|
||||
// guard against developers accidentally setting properties with prefix `firebase_`
|
||||
[ORIGIN_KEY]: 'firebase',
|
||||
update: true
|
||||
});
|
||||
}
|
||||
function insertScriptTag(dataLayerName) {
|
||||
const script = document.createElement('script');
|
||||
// We are not providing an analyticsId in the URL because it would trigger a `page_view`
|
||||
// without fid. We will initialize ga-id using gtag (config) command together with fid.
|
||||
script.src = `${GTAG_URL}?l=${dataLayerName}`;
|
||||
script.async = true;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
/** Get reference to, or create, global datalayer.
|
||||
* @param dataLayerName Name of datalayer (most often the default, "_dataLayer")
|
||||
*/
|
||||
function getOrCreateDataLayer(dataLayerName) {
|
||||
// Check for existing dataLayer and create if needed.
|
||||
let dataLayer = [];
|
||||
if (Array.isArray(window[dataLayerName])) {
|
||||
dataLayer = window[dataLayerName];
|
||||
}
|
||||
else {
|
||||
window[dataLayerName] = dataLayer;
|
||||
}
|
||||
return dataLayer;
|
||||
}
|
||||
/**
|
||||
* Wraps a standard gtag function with extra code to wait for completion of
|
||||
* relevant initialization promises before sending requests.
|
||||
*
|
||||
* @param gtagCore Basic gtag function that just appends to dataLayer
|
||||
* @param initializedIdPromisesMap Map of gaIds to their initialization promises
|
||||
*/
|
||||
function wrapGtag(gtagCore, initializedIdPromisesMap) {
|
||||
return (command, idOrNameOrParams, gtagParams) => {
|
||||
// If event, check that relevant initialization promises have completed.
|
||||
if (command === GtagCommand.EVENT) {
|
||||
let initializationPromisesToWaitFor = [];
|
||||
// If there's a 'send_to' param, check if any ID specified matches
|
||||
// a FID we have begun a fetch on.
|
||||
if (gtagParams && gtagParams['send_to']) {
|
||||
let gaSendToList = gtagParams['send_to'];
|
||||
// Make it an array if is isn't, so it can be dealt with the same way.
|
||||
if (!Array.isArray(gaSendToList)) {
|
||||
gaSendToList = [gaSendToList];
|
||||
}
|
||||
for (const sendToId of gaSendToList) {
|
||||
const initializationPromise = initializedIdPromisesMap[sendToId];
|
||||
// Groups will not be in the map.
|
||||
if (initializationPromise) {
|
||||
initializationPromisesToWaitFor.push(initializationPromise);
|
||||
}
|
||||
else {
|
||||
// There is an item in 'send_to' that is not associated
|
||||
// directly with an FID, possibly a group. Empty this array
|
||||
// and let it get populated below.
|
||||
initializationPromisesToWaitFor = [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// This will be unpopulated if there was no 'send_to' field , or
|
||||
// if not all entries in the 'send_to' field could be mapped to
|
||||
// a FID. In these cases, wait on all pending initialization promises.
|
||||
if (initializationPromisesToWaitFor.length === 0) {
|
||||
for (const idPromise of Object.values(initializedIdPromisesMap)) {
|
||||
initializationPromisesToWaitFor.push(idPromise);
|
||||
}
|
||||
}
|
||||
// Run core gtag function with args after all relevant initialization
|
||||
// promises have been resolved.
|
||||
Promise.all(initializationPromisesToWaitFor)
|
||||
// Workaround for http://b/141370449 - third argument cannot be undefined.
|
||||
.then(() => gtagCore(GtagCommand.EVENT, idOrNameOrParams, gtagParams || {}))
|
||||
.catch(e => console.error(e));
|
||||
}
|
||||
else if (command === GtagCommand.CONFIG) {
|
||||
const initializationPromiseToWait = initializedIdPromisesMap[idOrNameOrParams] ||
|
||||
Promise.resolve();
|
||||
initializationPromiseToWait
|
||||
.then(() => {
|
||||
gtagCore(GtagCommand.CONFIG, idOrNameOrParams, gtagParams);
|
||||
})
|
||||
.catch(e => console.error(e));
|
||||
}
|
||||
else {
|
||||
// SET command.
|
||||
// Splitting calls for CONFIG and SET to make it clear which signature
|
||||
// Typescript is checking.
|
||||
gtagCore(GtagCommand.SET, idOrNameOrParams);
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Creates global gtag function or wraps existing one if found.
|
||||
* This wrapped function attaches Firebase instance ID (FID) to gtag 'config' and
|
||||
* 'event' calls that belong to the GAID associated with this Firebase instance.
|
||||
*
|
||||
* @param initializedIdPromisesMap Map of gaId to initialization promises.
|
||||
* @param dataLayerName Name of global GA datalayer array.
|
||||
* @param gtagFunctionName Name of global gtag function ("gtag" if not user-specified)
|
||||
*/
|
||||
function wrapOrCreateGtag(initializedIdPromisesMap, dataLayerName, gtagFunctionName) {
|
||||
// Create a basic core gtag function
|
||||
let gtagCore = function (..._args) {
|
||||
// Must push IArguments object, not an array.
|
||||
window[dataLayerName].push(arguments);
|
||||
};
|
||||
// Replace it with existing one if found
|
||||
if (window[gtagFunctionName] &&
|
||||
typeof window[gtagFunctionName] === 'function') {
|
||||
// @ts-ignore
|
||||
gtagCore = window[gtagFunctionName];
|
||||
}
|
||||
window[gtagFunctionName] = wrapGtag(gtagCore, initializedIdPromisesMap);
|
||||
return {
|
||||
gtagCore,
|
||||
wrappedGtag: window[gtagFunctionName]
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Returns first script tag in DOM matching our gtag url pattern.
|
||||
*/
|
||||
function findGtagScriptOnPage() {
|
||||
const scriptTags = window.document.getElementsByTagName('script');
|
||||
for (const tag of Object.values(scriptTags)) {
|
||||
if (tag.src && tag.src.includes(GTAG_URL)) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const ERRORS = {
|
||||
["no-ga-id" /* NO_GA_ID */]: `"${ANALYTICS_ID_FIELD}" field is empty in ` +
|
||||
'Firebase config. Firebase Analytics ' +
|
||||
'requires this field to contain a valid measurement ID.',
|
||||
["already-exists" /* ALREADY_EXISTS */]: 'A Firebase Analytics instance with the measurement ID ${id} ' +
|
||||
' already exists. ' +
|
||||
'Only one Firebase Analytics instance can be created for each measurement ID.',
|
||||
["already-initialized" /* ALREADY_INITIALIZED */]: 'Firebase Analytics has already been initialized.' +
|
||||
'settings() must be called before initializing any Analytics instance' +
|
||||
'or it will have no effect.',
|
||||
["interop-component-reg-failed" /* INTEROP_COMPONENT_REG_FAILED */]: 'Firebase Analytics Interop Component failed to instantiate'
|
||||
};
|
||||
const ERROR_FACTORY = new ErrorFactory('analytics', 'Analytics', ERRORS);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Maps gaId to FID fetch promises.
|
||||
*/
|
||||
let initializedIdPromisesMap = {};
|
||||
/**
|
||||
* Name for window global data layer array used by GA: defaults to 'dataLayer'.
|
||||
*/
|
||||
let dataLayerName = 'dataLayer';
|
||||
/**
|
||||
* Name for window global gtag function used by GA: defaults to 'gtag'.
|
||||
*/
|
||||
let gtagName = 'gtag';
|
||||
/**
|
||||
* Reproduction of standard gtag function or reference to existing
|
||||
* gtag function on window object.
|
||||
*/
|
||||
let gtagCoreFunction;
|
||||
/**
|
||||
* Wrapper around gtag function that ensures FID is sent with all
|
||||
* relevant event and config calls.
|
||||
*/
|
||||
let wrappedGtagFunction;
|
||||
/**
|
||||
* Flag to ensure page initialization steps (creation or wrapping of
|
||||
* dataLayer and gtag script) are only run once per page load.
|
||||
*/
|
||||
let globalInitDone = false;
|
||||
/**
|
||||
* For testing
|
||||
*/
|
||||
function resetGlobalVars(newGlobalInitDone = false, newGaInitializedPromise = {}) {
|
||||
globalInitDone = newGlobalInitDone;
|
||||
initializedIdPromisesMap = newGaInitializedPromise;
|
||||
dataLayerName = 'dataLayer';
|
||||
gtagName = 'gtag';
|
||||
}
|
||||
/**
|
||||
* This must be run before calling firebase.analytics() or it won't
|
||||
* have any effect.
|
||||
* @param options Custom gtag and dataLayer names.
|
||||
*/
|
||||
function settings(options) {
|
||||
if (globalInitDone) {
|
||||
throw ERROR_FACTORY.create("already-initialized" /* ALREADY_INITIALIZED */);
|
||||
}
|
||||
if (options.dataLayerName) {
|
||||
dataLayerName = options.dataLayerName;
|
||||
}
|
||||
if (options.gtagName) {
|
||||
gtagName = options.gtagName;
|
||||
}
|
||||
}
|
||||
function factory(app, installations) {
|
||||
const analyticsId = app.options[ANALYTICS_ID_FIELD];
|
||||
if (!analyticsId) {
|
||||
throw ERROR_FACTORY.create("no-ga-id" /* NO_GA_ID */);
|
||||
}
|
||||
if (initializedIdPromisesMap[analyticsId] != null) {
|
||||
throw ERROR_FACTORY.create("already-exists" /* ALREADY_EXISTS */, {
|
||||
id: analyticsId
|
||||
});
|
||||
}
|
||||
if (!globalInitDone) {
|
||||
// Steps here should only be done once per page: creation or wrapping
|
||||
// of dataLayer and global gtag function.
|
||||
// Detect if user has already put the gtag <script> tag on this page.
|
||||
if (!findGtagScriptOnPage()) {
|
||||
insertScriptTag(dataLayerName);
|
||||
}
|
||||
getOrCreateDataLayer(dataLayerName);
|
||||
const { wrappedGtag, gtagCore } = wrapOrCreateGtag(initializedIdPromisesMap, dataLayerName, gtagName);
|
||||
wrappedGtagFunction = wrappedGtag;
|
||||
gtagCoreFunction = gtagCore;
|
||||
globalInitDone = true;
|
||||
}
|
||||
// Async but non-blocking.
|
||||
initializedIdPromisesMap[analyticsId] = initializeGAId(app, installations, gtagCoreFunction);
|
||||
const analyticsInstance = {
|
||||
app,
|
||||
logEvent: (eventName, eventParams, options) => logEvent(wrappedGtagFunction, analyticsId, eventName, eventParams, options),
|
||||
setCurrentScreen: (screenName, options) => setCurrentScreen(wrappedGtagFunction, analyticsId, screenName, options),
|
||||
setUserId: (id, options) => setUserId(wrappedGtagFunction, analyticsId, id, options),
|
||||
setUserProperties: (properties, options) => setUserProperties(wrappedGtagFunction, analyticsId, properties, options),
|
||||
setAnalyticsCollectionEnabled: enabled => setAnalyticsCollectionEnabled(analyticsId, enabled)
|
||||
};
|
||||
return analyticsInstance;
|
||||
}
|
||||
|
||||
const name = "@firebase/analytics";
|
||||
const version = "0.2.12";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Type constant for Firebase Analytics.
|
||||
*/
|
||||
const ANALYTICS_TYPE = 'analytics';
|
||||
function registerAnalytics(instance) {
|
||||
instance.INTERNAL.registerComponent(new Component(ANALYTICS_TYPE, container => {
|
||||
// getImmediate for FirebaseApp will always succeed
|
||||
const app = container.getProvider('app').getImmediate();
|
||||
const installations = container
|
||||
.getProvider('installations')
|
||||
.getImmediate();
|
||||
return factory(app, installations);
|
||||
}, "PUBLIC" /* PUBLIC */).setServiceProps({
|
||||
settings,
|
||||
EventName
|
||||
}));
|
||||
instance.INTERNAL.registerComponent(new Component('analytics-internal', internalFactory, "PRIVATE" /* PRIVATE */));
|
||||
instance.registerVersion(name, version);
|
||||
function internalFactory(container) {
|
||||
try {
|
||||
const analytics = container.getProvider(ANALYTICS_TYPE).getImmediate();
|
||||
return {
|
||||
logEvent: analytics.logEvent
|
||||
};
|
||||
}
|
||||
catch (e) {
|
||||
throw ERROR_FACTORY.create("interop-component-reg-failed" /* INTEROP_COMPONENT_REG_FAILED */, {
|
||||
reason: e
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
registerAnalytics(firebase);
|
||||
|
||||
export { factory, registerAnalytics, resetGlobalVars, settings };
|
||||
//# sourceMappingURL=index.esm2017.js.map
|
1
node_modules/@firebase/analytics/dist/index.esm2017.js.map
generated
vendored
Normal file
1
node_modules/@firebase/analytics/dist/index.esm2017.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17
node_modules/@firebase/analytics/dist/index.test.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/analytics/dist/index.test.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import './testing/setup';
|
50
node_modules/@firebase/analytics/dist/src/constants.d.ts
generated
vendored
Normal file
50
node_modules/@firebase/analytics/dist/src/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare const ANALYTICS_ID_FIELD = "measurementId";
|
||||
export declare const GA_FID_KEY = "firebase_id";
|
||||
export declare const ORIGIN_KEY = "origin";
|
||||
export declare const GTAG_URL = "https://www.googletagmanager.com/gtag/js";
|
||||
export declare enum GtagCommand {
|
||||
EVENT = "event",
|
||||
SET = "set",
|
||||
CONFIG = "config"
|
||||
}
|
||||
export declare enum EventName {
|
||||
ADD_PAYMENT_INFO = "add_payment_info",
|
||||
ADD_TO_CART = "add_to_cart",
|
||||
ADD_TO_WISHLIST = "add_to_wishlist",
|
||||
BEGIN_CHECKOUT = "begin_checkout",
|
||||
CHECKOUT_PROGRESS = "checkout_progress",
|
||||
EXCEPTION = "exception",
|
||||
GENERATE_LEAD = "generate_lead",
|
||||
LOGIN = "login",
|
||||
PAGE_VIEW = "page_view",
|
||||
PURCHASE = "purchase",
|
||||
REFUND = "refund",
|
||||
REMOVE_FROM_CART = "remove_from_cart",
|
||||
SCREEN_VIEW = "screen_view",
|
||||
SEARCH = "search",
|
||||
SELECT_CONTENT = "select_content",
|
||||
SET_CHECKOUT_OPTION = "set_checkout_option",
|
||||
SHARE = "share",
|
||||
SIGN_UP = "sign_up",
|
||||
TIMING_COMPLETE = "timing_complete",
|
||||
VIEW_ITEM = "view_item",
|
||||
VIEW_ITEM_LIST = "view_item_list",
|
||||
VIEW_PROMOTION = "view_promotion",
|
||||
VIEW_SEARCH_RESULTS = "view_search_results"
|
||||
}
|
33
node_modules/@firebase/analytics/dist/src/errors.d.ts
generated
vendored
Normal file
33
node_modules/@firebase/analytics/dist/src/errors.d.ts
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ErrorFactory } from '@firebase/util';
|
||||
export declare const enum AnalyticsError {
|
||||
NO_GA_ID = "no-ga-id",
|
||||
ALREADY_EXISTS = "already-exists",
|
||||
ALREADY_INITIALIZED = "already-initialized",
|
||||
INTEROP_COMPONENT_REG_FAILED = "interop-component-reg-failed"
|
||||
}
|
||||
interface ErrorParams {
|
||||
[AnalyticsError.ALREADY_EXISTS]: {
|
||||
id: string;
|
||||
};
|
||||
[AnalyticsError.INTEROP_COMPONENT_REG_FAILED]: {
|
||||
reason: Error;
|
||||
};
|
||||
}
|
||||
export declare const ERROR_FACTORY: ErrorFactory<AnalyticsError, ErrorParams>;
|
||||
export {};
|
30
node_modules/@firebase/analytics/dist/src/factory.d.ts
generated
vendored
Normal file
30
node_modules/@firebase/analytics/dist/src/factory.d.ts
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseAnalytics, SettingsOptions } from '@firebase/analytics-types';
|
||||
import { FirebaseApp } from '@firebase/app-types';
|
||||
import { FirebaseInstallations } from '@firebase/installations-types';
|
||||
/**
|
||||
* For testing
|
||||
*/
|
||||
export declare function resetGlobalVars(newGlobalInitDone?: boolean, newGaInitializedPromise?: {}): void;
|
||||
/**
|
||||
* This must be run before calling firebase.analytics() or it won't
|
||||
* have any effect.
|
||||
* @param options Custom gtag and dataLayer names.
|
||||
*/
|
||||
export declare function settings(options: SettingsOptions): void;
|
||||
export declare function factory(app: FirebaseApp, installations: FirebaseInstallations): FirebaseAnalytics;
|
52
node_modules/@firebase/analytics/dist/src/functions.d.ts
generated
vendored
Normal file
52
node_modules/@firebase/analytics/dist/src/functions.d.ts
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { AnalyticsCallOptions, Gtag, CustomParams, EventParams } from '@firebase/analytics-types';
|
||||
/**
|
||||
* Logs an analytics event through the Firebase SDK.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param eventName Google Analytics event name, choose from standard list or use a custom string.
|
||||
* @param eventParams Analytics event parameters.
|
||||
*/
|
||||
export declare function logEvent(gtagFunction: Gtag, analyticsId: string, eventName: string, eventParams?: EventParams, options?: AnalyticsCallOptions): void;
|
||||
/**
|
||||
* Set screen_name parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param screenName Screen name string to set.
|
||||
*/
|
||||
export declare function setCurrentScreen(gtagFunction: Gtag, analyticsId: string, screenName: string | null, options?: AnalyticsCallOptions): void;
|
||||
/**
|
||||
* Set user_id parameter for this Google Analytics ID.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param id User ID string to set
|
||||
*/
|
||||
export declare function setUserId(gtagFunction: Gtag, analyticsId: string, id: string | null, options?: AnalyticsCallOptions): void;
|
||||
/**
|
||||
* Set all other user properties other than user_id and screen_name.
|
||||
*
|
||||
* @param gtagFunction Wrapped gtag function that waits for fid to be set before sending an event
|
||||
* @param properties Map of user properties to set
|
||||
*/
|
||||
export declare function setUserProperties(gtagFunction: Gtag, analyticsId: string, properties: CustomParams, options?: AnalyticsCallOptions): void;
|
||||
/**
|
||||
* Set whether collection is enabled for this ID.
|
||||
*
|
||||
* @param enabled If true, collection is enabled for this ID.
|
||||
*/
|
||||
export declare function setAnalyticsCollectionEnabled(analyticsId: string, enabled: boolean): void;
|
17
node_modules/@firebase/analytics/dist/src/functions.test.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/analytics/dist/src/functions.test.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import '../testing/setup';
|
52
node_modules/@firebase/analytics/dist/src/helpers.d.ts
generated
vendored
Normal file
52
node_modules/@firebase/analytics/dist/src/helpers.d.ts
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseApp } from '@firebase/app-types';
|
||||
import { DataLayer, Gtag } from '@firebase/analytics-types';
|
||||
import { FirebaseInstallations } from '@firebase/installations-types';
|
||||
/**
|
||||
* Initialize the analytics instance in gtag.js by calling config command with fid.
|
||||
*
|
||||
* NOTE: We combine analytics initialization and setting fid together because we want fid to be
|
||||
* part of the `page_view` event that's sent during the initialization
|
||||
* @param app Firebase app
|
||||
* @param gtagCore The gtag function that's not wrapped.
|
||||
*/
|
||||
export declare function initializeGAId(app: FirebaseApp, installations: FirebaseInstallations, gtagCore: Gtag): Promise<void>;
|
||||
export declare function insertScriptTag(dataLayerName: string): void;
|
||||
/** Get reference to, or create, global datalayer.
|
||||
* @param dataLayerName Name of datalayer (most often the default, "_dataLayer")
|
||||
*/
|
||||
export declare function getOrCreateDataLayer(dataLayerName: string): DataLayer;
|
||||
/**
|
||||
* Creates global gtag function or wraps existing one if found.
|
||||
* This wrapped function attaches Firebase instance ID (FID) to gtag 'config' and
|
||||
* 'event' calls that belong to the GAID associated with this Firebase instance.
|
||||
*
|
||||
* @param initializedIdPromisesMap Map of gaId to initialization promises.
|
||||
* @param dataLayerName Name of global GA datalayer array.
|
||||
* @param gtagFunctionName Name of global gtag function ("gtag" if not user-specified)
|
||||
*/
|
||||
export declare function wrapOrCreateGtag(initializedIdPromisesMap: {
|
||||
[gaId: string]: Promise<void>;
|
||||
}, dataLayerName: string, gtagFunctionName: string): {
|
||||
gtagCore: Gtag;
|
||||
wrappedGtag: Gtag;
|
||||
};
|
||||
/**
|
||||
* Returns first script tag in DOM matching our gtag url pattern.
|
||||
*/
|
||||
export declare function findGtagScriptOnPage(): HTMLScriptElement | null;
|
17
node_modules/@firebase/analytics/dist/src/helpers.test.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/analytics/dist/src/helpers.test.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import '../testing/setup';
|
20
node_modules/@firebase/analytics/dist/testing/get-fake-firebase-services.d.ts
generated
vendored
Normal file
20
node_modules/@firebase/analytics/dist/testing/get-fake-firebase-services.d.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseApp } from '@firebase/app-types';
|
||||
import { FirebaseInstallations } from '@firebase/installations-types';
|
||||
export declare function getFakeApp(measurementId?: string): FirebaseApp;
|
||||
export declare function getFakeInstallations(fid?: string): FirebaseInstallations;
|
1
node_modules/@firebase/analytics/dist/testing/gtag-script-util.d.ts
generated
vendored
Normal file
1
node_modules/@firebase/analytics/dist/testing/gtag-script-util.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function removeGtagScript(): void;
|
17
node_modules/@firebase/analytics/dist/testing/setup.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/analytics/dist/testing/setup.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export {};
|
89
node_modules/@firebase/analytics/package.json
generated
vendored
Normal file
89
node_modules/@firebase/analytics/package.json
generated
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
{
|
||||
"_from": "@firebase/analytics@0.2.12",
|
||||
"_id": "@firebase/analytics@0.2.12",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-y/WwSNUOPJnAdYOxD+NCMwVbhfP/yrQrnGTn1zAAM1R8bBBmWay8HpHki7g5N3qQ+AQ+uMF6tKbp/JnJkini7A==",
|
||||
"_location": "/@firebase/analytics",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@firebase/analytics@0.2.12",
|
||||
"name": "@firebase/analytics",
|
||||
"escapedName": "@firebase%2fanalytics",
|
||||
"scope": "@firebase",
|
||||
"rawSpec": "0.2.12",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.2.12"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/firebase"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.2.12.tgz",
|
||||
"_shasum": "7bb6a1be2b385eede2a24170744be324ae9a903d",
|
||||
"_spec": "@firebase/analytics@0.2.12",
|
||||
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix-V3\\node_modules\\firebase",
|
||||
"author": {
|
||||
"name": "Firebase",
|
||||
"email": "firebase-support@google.com",
|
||||
"url": "https://firebase.google.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/firebase/firebase-js-sdk/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@firebase/analytics-types": "0.2.5",
|
||||
"@firebase/component": "0.1.4",
|
||||
"@firebase/installations": "0.4.1",
|
||||
"@firebase/util": "0.2.39",
|
||||
"tslib": "1.10.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A analytics package for new firebase packages",
|
||||
"devDependencies": {
|
||||
"rollup": "1.28.0",
|
||||
"rollup-plugin-commonjs": "10.1.0",
|
||||
"rollup-plugin-json": "4.0.0",
|
||||
"rollup-plugin-node-resolve": "5.2.0",
|
||||
"rollup-plugin-typescript2": "0.25.3",
|
||||
"rollup-plugin-uglify": "6.0.4",
|
||||
"typescript": "3.7.3"
|
||||
},
|
||||
"esm2017": "dist/index.esm2017.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"homepage": "https://github.com/firebase/firebase-js-sdk#readme",
|
||||
"license": "Apache-2.0",
|
||||
"main": "dist/index.cjs.js",
|
||||
"module": "dist/index.esm.js",
|
||||
"name": "@firebase/analytics",
|
||||
"nyc": {
|
||||
"extension": [
|
||||
".ts"
|
||||
],
|
||||
"reportDir": "./coverage/node"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@firebase/app": "0.x",
|
||||
"@firebase/app-types": "0.x"
|
||||
},
|
||||
"repository": {
|
||||
"directory": "packages/analytics",
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "rollup -c -w",
|
||||
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
||||
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
||||
"prepare": "yarn build",
|
||||
"test": "yarn type-check && yarn run-p lint test:browser",
|
||||
"test:browser": "karma start --single-run --nocache",
|
||||
"type-check": "tsc -p . --noEmit"
|
||||
},
|
||||
"typings": "dist/index.d.ts",
|
||||
"version": "0.2.12"
|
||||
}
|
3
node_modules/@firebase/app-types/README.md
generated
vendored
Normal file
3
node_modules/@firebase/app-types/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# @firebase/app-types
|
||||
|
||||
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
|
123
node_modules/@firebase/app-types/index.d.ts
generated
vendored
Normal file
123
node_modules/@firebase/app-types/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export type FirebaseOptions = {
|
||||
apiKey?: string;
|
||||
authDomain?: string;
|
||||
databaseURL?: string;
|
||||
projectId?: string;
|
||||
storageBucket?: string;
|
||||
messagingSenderId?: string;
|
||||
appId?: string;
|
||||
measurementId?: string;
|
||||
};
|
||||
|
||||
export interface FirebaseAppConfig {
|
||||
name?: string;
|
||||
automaticDataCollectionEnabled?: boolean;
|
||||
}
|
||||
|
||||
export class FirebaseApp {
|
||||
/**
|
||||
* The (read-only) name (identifier) for this App. '[DEFAULT]' is the default
|
||||
* App.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The (read-only) configuration options from the app initialization.
|
||||
*/
|
||||
options: FirebaseOptions;
|
||||
|
||||
/**
|
||||
* The settable config flag for GDPR opt-in/opt-out
|
||||
*/
|
||||
automaticDataCollectionEnabled: boolean;
|
||||
|
||||
/**
|
||||
* Make the given App unusable and free resources.
|
||||
*/
|
||||
delete(): Promise<void>;
|
||||
}
|
||||
|
||||
export interface FirebaseNamespace {
|
||||
/**
|
||||
* Create (and initialize) a FirebaseApp.
|
||||
*
|
||||
* @param options Options to configure the services used in the App.
|
||||
* @param config The optional config for your firebase app
|
||||
*/
|
||||
initializeApp(
|
||||
options: FirebaseOptions,
|
||||
config?: FirebaseAppConfig
|
||||
): FirebaseApp;
|
||||
/**
|
||||
* Create (and initialize) a FirebaseApp.
|
||||
*
|
||||
* @param options Options to configure the services used in the App.
|
||||
* @param name The optional name of the app to initialize ('[DEFAULT]' if
|
||||
* omitted)
|
||||
*/
|
||||
initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
|
||||
|
||||
app: {
|
||||
/**
|
||||
* Retrieve an instance of a FirebaseApp.
|
||||
*
|
||||
* Usage: firebase.app()
|
||||
*
|
||||
* @param name The optional name of the app to return ('[DEFAULT]' if omitted)
|
||||
*/
|
||||
(name?: string): FirebaseApp;
|
||||
|
||||
/**
|
||||
* For testing FirebaseApp instances:
|
||||
* app() instanceof firebase.app.App
|
||||
*
|
||||
* DO NOT call this constuctor directly (use firebase.app() instead).
|
||||
*/
|
||||
App: typeof FirebaseApp;
|
||||
};
|
||||
|
||||
/**
|
||||
* A (read-only) array of all the initialized Apps.
|
||||
*/
|
||||
apps: FirebaseApp[];
|
||||
|
||||
/**
|
||||
* Registers a library's name and version for platform logging purposes.
|
||||
* @param library Name of 1p or 3p library (e.g. firestore, angularfire)
|
||||
* @param version Current version of that library.
|
||||
*/
|
||||
registerVersion(library: string, version: string, variant?: string): void;
|
||||
|
||||
// The current SDK version.
|
||||
SDK_VERSION: string;
|
||||
}
|
||||
|
||||
export interface VersionService {
|
||||
library: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
declare module '@firebase/component' {
|
||||
interface NameServiceMapping {
|
||||
'app': FirebaseApp;
|
||||
'app-version': VersionService;
|
||||
'platform-identifier': VersionService;
|
||||
}
|
||||
}
|
61
node_modules/@firebase/app-types/package.json
generated
vendored
Normal file
61
node_modules/@firebase/app-types/package.json
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@firebase/app-types@0.5.0",
|
||||
"C:\\Users\\matia\\Documents\\GitHub\\Musix-V3"
|
||||
]
|
||||
],
|
||||
"_from": "@firebase/app-types@0.5.0",
|
||||
"_id": "@firebase/app-types@0.5.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-8j+vCXTpAkYGcFk86mPZ90V6HMFmn196RIEW9Opi0PN+VrPFC1l/eW0gptM8v7VXaQhECOxws3TN2g+dDaeSYA==",
|
||||
"_location": "/@firebase/app-types",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@firebase/app-types@0.5.0",
|
||||
"name": "@firebase/app-types",
|
||||
"escapedName": "@firebase%2fapp-types",
|
||||
"scope": "@firebase",
|
||||
"rawSpec": "0.5.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.5.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@firebase/app",
|
||||
"/@firebase/database-types",
|
||||
"/firebase"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.5.0.tgz",
|
||||
"_spec": "0.5.0",
|
||||
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix-V3",
|
||||
"author": {
|
||||
"name": "Firebase",
|
||||
"email": "firebase-support@google.com",
|
||||
"url": "https://firebase.google.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/firebase/firebase-js-sdk/issues"
|
||||
},
|
||||
"description": "@firebase/app Types",
|
||||
"devDependencies": {
|
||||
"typescript": "3.7.3"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"private.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/firebase/firebase-js-sdk#readme",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@firebase/app-types",
|
||||
"repository": {
|
||||
"directory": "packages/app-types",
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tsc"
|
||||
},
|
||||
"version": "0.5.0"
|
||||
}
|
165
node_modules/@firebase/app-types/private.d.ts
generated
vendored
Normal file
165
node_modules/@firebase/app-types/private.d.ts
generated
vendored
Normal file
@ -0,0 +1,165 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* THIS FILE IS FOR INTERNAL USAGE ONLY, IF YOU ARE NOT DEVELOPING THE FIREBASE
|
||||
* SDKs, PLEASE DO NOT REFERENCE THIS FILE AS IT MAY CHANGE WITHOUT WARNING
|
||||
*/
|
||||
|
||||
import { FirebaseApp, FirebaseNamespace } from '@firebase/app-types';
|
||||
import { Observer, Subscribe } from '@firebase/util';
|
||||
import { FirebaseError, ErrorFactory } from '@firebase/util';
|
||||
import { Component, ComponentContainer } from '@firebase/component';
|
||||
|
||||
export interface FirebaseServiceInternals {
|
||||
/**
|
||||
* Delete the service and free it's resources - called from
|
||||
* app.delete().
|
||||
*/
|
||||
delete(): Promise<void>;
|
||||
}
|
||||
|
||||
// Services are exposed through instances - each of which is associated with a
|
||||
// FirebaseApp.
|
||||
export interface FirebaseService {
|
||||
app: FirebaseApp;
|
||||
INTERNAL?: FirebaseServiceInternals;
|
||||
}
|
||||
|
||||
export type AppHook = (event: string, app: FirebaseApp) => void;
|
||||
|
||||
/**
|
||||
* Firebase Services create instances given a Firebase App instance and can
|
||||
* optionally add properties and methods to each FirebaseApp via the extendApp()
|
||||
* function.
|
||||
*/
|
||||
export interface FirebaseServiceFactory {
|
||||
(
|
||||
app: FirebaseApp,
|
||||
extendApp?: (props: { [prop: string]: any }) => void,
|
||||
instanceString?: string
|
||||
): FirebaseService;
|
||||
}
|
||||
|
||||
export interface PlatformLoggerService {
|
||||
getPlatformInfoString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* All ServiceNamespaces extend from FirebaseServiceNamespace
|
||||
*/
|
||||
export interface FirebaseServiceNamespace<T extends FirebaseService> {
|
||||
(app?: FirebaseApp): T;
|
||||
}
|
||||
|
||||
export interface FirebaseAuthTokenData {
|
||||
accessToken: string;
|
||||
}
|
||||
|
||||
export interface FirebaseAppInternals {
|
||||
getToken(refreshToken?: boolean): Promise<FirebaseAuthTokenData | null>;
|
||||
getUid(): string | null;
|
||||
addAuthTokenListener(fn: (token: string | null) => void): void;
|
||||
removeAuthTokenListener(fn: (token: string | null) => void): void;
|
||||
analytics: {
|
||||
logEvent: (
|
||||
eventName: string,
|
||||
eventParams: { [key: string]: any },
|
||||
options?: { global: boolean }
|
||||
) => void;
|
||||
};
|
||||
}
|
||||
|
||||
export interface _FirebaseApp extends FirebaseApp {
|
||||
container: ComponentContainer;
|
||||
_addComponent(component: Component): void;
|
||||
_addOrOverwriteComponent(component: Component): void;
|
||||
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
|
||||
}
|
||||
export interface _FirebaseNamespace extends FirebaseNamespace {
|
||||
INTERNAL: {
|
||||
/**
|
||||
* Internal API to register a Firebase Service into the firebase namespace.
|
||||
*
|
||||
* Each service will create a child namespace (firebase.<name>) which acts as
|
||||
* both a namespace for service specific properties, and also as a service
|
||||
* accessor function (firebase.<name>() or firebase.<name>(app)).
|
||||
*
|
||||
* @param name The Firebase Service being registered.
|
||||
* @param createService Factory function to create a service instance.
|
||||
* @param serviceProperties Properties to copy to the service's namespace.
|
||||
* @param appHook All appHooks called before initializeApp returns to caller.
|
||||
* @param allowMultipleInstances Whether the registered service supports
|
||||
* multiple instances per app. If not specified, the default is false.
|
||||
*/
|
||||
registerComponent(
|
||||
component: Component
|
||||
): FirebaseServiceNamespace<FirebaseService> | null;
|
||||
|
||||
/**
|
||||
* Just used for testing to start from a fresh namespace.
|
||||
*/
|
||||
createFirebaseNamespace(): FirebaseNamespace;
|
||||
|
||||
/**
|
||||
* Internal API to install properties on the top-level firebase namespace.
|
||||
* @prop props The top level properties of this object are copied to the
|
||||
* namespace.
|
||||
*/
|
||||
extendNamespace(props: { [prop: string]: any }): void;
|
||||
|
||||
/**
|
||||
* Create a Subscribe function. A proxy Observer is created so that
|
||||
* events can be sent to single Observer to be fanned out automatically.
|
||||
*/
|
||||
createSubscribe<T>(
|
||||
executor: (observer: Observer<T>) => void,
|
||||
onNoObservers?: (observer: Observer<T>) => void
|
||||
): Subscribe<T>;
|
||||
|
||||
/**
|
||||
* Utility exposed for internal testing.
|
||||
*/
|
||||
deepExtend(target: any, source: any): any;
|
||||
|
||||
/**
|
||||
* Internal API to remove an app from the list of registered apps.
|
||||
*/
|
||||
removeApp(name: string): void;
|
||||
|
||||
/**
|
||||
* registered components.
|
||||
*/
|
||||
components: Map<string, Component>;
|
||||
|
||||
/*
|
||||
* Convert service name to factory name to use.
|
||||
*/
|
||||
useAsService(app: FirebaseApp, serviceName: string): string | null;
|
||||
|
||||
/**
|
||||
* Use to construct all thrown FirebaseError's.
|
||||
*/
|
||||
ErrorFactory: typeof ErrorFactory;
|
||||
};
|
||||
}
|
||||
|
||||
declare module '@firebase/component' {
|
||||
interface NameServiceMapping {
|
||||
'platform-logger': PlatformLoggerService;
|
||||
}
|
||||
}
|
6
node_modules/@firebase/app/README.md
generated
vendored
Normal file
6
node_modules/@firebase/app/README.md
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
# @firebase/app
|
||||
|
||||
This package coordinates the communication between the different Firebase components and
|
||||
exposes the API surface to the user
|
||||
|
||||
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
|
664
node_modules/@firebase/app/dist/index.cjs.js
generated
vendored
Normal file
664
node_modules/@firebase/app/dist/index.cjs.js
generated
vendored
Normal file
@ -0,0 +1,664 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var tslib = require('tslib');
|
||||
var util = require('@firebase/util');
|
||||
var component = require('@firebase/component');
|
||||
var logger$1 = require('@firebase/logger');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new logger$1.Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = util.deepCopy(options);
|
||||
this.container = new component.ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component$1 = _c.value;
|
||||
this._addComponent(component$1);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
util.deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = tslib.__values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new component.Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = tslib.__assign(tslib.__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: util.createSubscribe,
|
||||
ErrorFactory: util.ErrorFactory,
|
||||
deepExtend: util.deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
util.deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new component.Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Firebase Lite detection
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (util.isBrowser() && self.firebase !== undefined) {
|
||||
logger.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");
|
||||
// eslint-disable-next-line
|
||||
var sdkVersion = self.firebase.SDK_VERSION;
|
||||
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
|
||||
logger.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ");
|
||||
}
|
||||
}
|
||||
var initializeApp = firebase.initializeApp;
|
||||
// TODO: This disable can be removed and the 'ignoreRestArgs' option added to
|
||||
// the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebase.initializeApp = function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
// Environment check before initializing app
|
||||
// Do the check in initializeApp, so people have a chance to disable it by setting logLevel
|
||||
// in @firebase/logger
|
||||
if (util.isNode()) {
|
||||
logger.warn("\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the \"main\" field in package.json.\n \n If you are using Webpack, you can specify \"main\" as the first item in\n \"resolve.mainFields\":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the rollup-plugin-node-resolve plugin and specify \"main\"\n as the first item in \"mainFields\", e.g. ['main', 'module'].\n https://github.com/rollup/rollup-plugin-node-resolve\n ");
|
||||
}
|
||||
return initializeApp.apply(undefined, args);
|
||||
};
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1);
|
||||
|
||||
exports.default = firebase$1;
|
||||
exports.firebase = firebase$1;
|
||||
//# sourceMappingURL=index.cjs.js.map
|
1
node_modules/@firebase/app/dist/index.cjs.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.cjs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
660
node_modules/@firebase/app/dist/index.esm.js
generated
vendored
Normal file
660
node_modules/@firebase/app/dist/index.esm.js
generated
vendored
Normal file
@ -0,0 +1,660 @@
|
||||
import { __values, __assign } from 'tslib';
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend, createSubscribe, isBrowser, isNode } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component = _c.value;
|
||||
this._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = __values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = __assign(__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: createSubscribe,
|
||||
ErrorFactory: ErrorFactory,
|
||||
deepExtend: deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Firebase Lite detection
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (isBrowser() && self.firebase !== undefined) {
|
||||
logger.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");
|
||||
// eslint-disable-next-line
|
||||
var sdkVersion = self.firebase.SDK_VERSION;
|
||||
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
|
||||
logger.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ");
|
||||
}
|
||||
}
|
||||
var initializeApp = firebase.initializeApp;
|
||||
// TODO: This disable can be removed and the 'ignoreRestArgs' option added to
|
||||
// the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebase.initializeApp = function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
// Environment check before initializing app
|
||||
// Do the check in initializeApp, so people have a chance to disable it by setting logLevel
|
||||
// in @firebase/logger
|
||||
if (isNode()) {
|
||||
logger.warn("\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the \"main\" field in package.json.\n \n If you are using Webpack, you can specify \"main\" as the first item in\n \"resolve.mainFields\":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the rollup-plugin-node-resolve plugin and specify \"main\"\n as the first item in \"mainFields\", e.g. ['main', 'module'].\n https://github.com/rollup/rollup-plugin-node-resolve\n ");
|
||||
}
|
||||
return initializeApp.apply(undefined, args);
|
||||
};
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1);
|
||||
|
||||
export default firebase$1;
|
||||
export { firebase$1 as firebase };
|
||||
//# sourceMappingURL=index.esm.js.map
|
1
node_modules/@firebase/app/dist/index.esm.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.esm.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
625
node_modules/@firebase/app/dist/index.esm2017.js
generated
vendored
Normal file
625
node_modules/@firebase/app/dist/index.esm2017.js
generated
vendored
Normal file
@ -0,0 +1,625 @@
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend, createSubscribe, isBrowser, isNode } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const ERRORS = {
|
||||
["no-app" /* NO_APP */]: "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
["bad-app-name" /* BAD_APP_NAME */]: "Illegal App name: '{$appName}",
|
||||
["duplicate-app" /* DUPLICATE_APP */]: "Firebase App named '{$appName}' already exists",
|
||||
["app-deleted" /* APP_DELETED */]: "Firebase App named '{$appName}' already deleted",
|
||||
["invalid-app-argument" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.'
|
||||
};
|
||||
const ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
const name = "@firebase/app";
|
||||
const version = "0.5.3";
|
||||
|
||||
const name$1 = "@firebase/analytics";
|
||||
|
||||
const name$2 = "@firebase/auth";
|
||||
|
||||
const name$3 = "@firebase/database";
|
||||
|
||||
const name$4 = "@firebase/functions";
|
||||
|
||||
const name$5 = "@firebase/installations";
|
||||
|
||||
const name$6 = "@firebase/messaging";
|
||||
|
||||
const name$7 = "@firebase/performance";
|
||||
|
||||
const name$8 = "@firebase/remote-config";
|
||||
|
||||
const name$9 = "@firebase/storage";
|
||||
|
||||
const name$a = "@firebase/firestore";
|
||||
|
||||
const name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
const PLATFORM_LOG_STRING = {
|
||||
[name]: 'fire-core',
|
||||
[name$1]: 'fire-analytics',
|
||||
[name$2]: 'fire-auth',
|
||||
[name$3]: 'fire-rtdb',
|
||||
[name$4]: 'fire-fn',
|
||||
[name$5]: 'fire-iid',
|
||||
[name$6]: 'fire-fcm',
|
||||
[name$7]: 'fire-perf',
|
||||
[name$8]: 'fire-rc',
|
||||
[name$9]: 'fire-gcs',
|
||||
[name$a]: 'fire-fst',
|
||||
'fire-js': 'fire-js',
|
||||
[name$b]: 'fire-js-all'
|
||||
};
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
class FirebaseAppImpl {
|
||||
constructor(options, config, firebase_) {
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
|
||||
// populate ComponentContainer with existing components
|
||||
for (const component of this.firebase_.INTERNAL.components.values()) {
|
||||
this._addComponent(component);
|
||||
}
|
||||
}
|
||||
get automaticDataCollectionEnabled() {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
}
|
||||
set automaticDataCollectionEnabled(val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
}
|
||||
get name() {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
}
|
||||
get options() {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
}
|
||||
delete() {
|
||||
return new Promise(resolve => {
|
||||
this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(() => {
|
||||
this.firebase_.INTERNAL.removeApp(this.name_);
|
||||
return Promise.all(this.container.getProviders().map(provider => provider.delete()));
|
||||
})
|
||||
.then(() => {
|
||||
this.isDeleted_ = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
_removeServiceInstance(name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
}
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
_addComponent(component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug(`Component ${component.name} failed to register with FirebaseApp ${this.name}`, e);
|
||||
}
|
||||
}
|
||||
_addOrOverwriteComponent(component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
}
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
checkDestroyed_() {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
}
|
||||
}
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
const version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
const apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
const namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp,
|
||||
// @ts-ignore
|
||||
app,
|
||||
registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent,
|
||||
removeApp,
|
||||
components,
|
||||
useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig = {}) {
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
const name = rawConfig;
|
||||
rawConfig = { name };
|
||||
}
|
||||
const config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
const { name } = config;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
const app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(name => apps[name]);
|
||||
}
|
||||
function registerComponent(component) {
|
||||
const componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug(`There were multiple attempts to register component ${componentName}.`);
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
const serviceNamespace = (appArg = app()) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function (...args) {
|
||||
const serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
// add the component to existing app instances
|
||||
for (const appName of Object.keys(apps)) {
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += `-${variant}`;
|
||||
}
|
||||
const libraryMismatch = library.match(/\s|\//);
|
||||
const versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
const warning = [
|
||||
`Unable to register library "${library}" with version "${version}":`
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(`${library}-version`, () => ({ library, version }), "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
const useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = Object.assign(Object.assign({}, namespace.INTERNAL), { createFirebaseNamespace,
|
||||
extendNamespace,
|
||||
createSubscribe,
|
||||
ErrorFactory,
|
||||
deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
const firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class PlatformLoggerService {
|
||||
constructor(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
getPlatformInfoString() {
|
||||
const providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(provider => {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
const service = provider.getImmediate();
|
||||
return `${service.library}/${service.version}`;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(logString => logString)
|
||||
.join(' ');
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
const component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', container => new PlatformLoggerService(container), "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Firebase Lite detection
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (isBrowser() && self.firebase !== undefined) {
|
||||
logger.warn(`
|
||||
Warning: Firebase is already defined in the global scope. Please make sure
|
||||
Firebase library is only loaded once.
|
||||
`);
|
||||
// eslint-disable-next-line
|
||||
const sdkVersion = self.firebase.SDK_VERSION;
|
||||
if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {
|
||||
logger.warn(`
|
||||
Warning: You are trying to load Firebase while using Firebase Performance standalone script.
|
||||
You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.
|
||||
`);
|
||||
}
|
||||
}
|
||||
const initializeApp = firebase.initializeApp;
|
||||
// TODO: This disable can be removed and the 'ignoreRestArgs' option added to
|
||||
// the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebase.initializeApp = function (...args) {
|
||||
// Environment check before initializing app
|
||||
// Do the check in initializeApp, so people have a chance to disable it by setting logLevel
|
||||
// in @firebase/logger
|
||||
if (isNode()) {
|
||||
logger.warn(`
|
||||
Warning: This is a browser-targeted Firebase bundle but it appears it is being
|
||||
run in a Node environment. If running in a Node environment, make sure you
|
||||
are using the bundle specified by the "main" field in package.json.
|
||||
|
||||
If you are using Webpack, you can specify "main" as the first item in
|
||||
"resolve.mainFields":
|
||||
https://webpack.js.org/configuration/resolve/#resolvemainfields
|
||||
|
||||
If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"
|
||||
as the first item in "mainFields", e.g. ['main', 'module'].
|
||||
https://github.com/rollup/rollup-plugin-node-resolve
|
||||
`);
|
||||
}
|
||||
return initializeApp.apply(undefined, args);
|
||||
};
|
||||
const firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1);
|
||||
|
||||
export default firebase$1;
|
||||
export { firebase$1 as firebase };
|
||||
//# sourceMappingURL=index.esm2017.js.map
|
1
node_modules/@firebase/app/dist/index.esm2017.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.esm2017.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
551
node_modules/@firebase/app/dist/index.lite.esm2017.js
generated
vendored
Normal file
551
node_modules/@firebase/app/dist/index.lite.esm2017.js
generated
vendored
Normal file
@ -0,0 +1,551 @@
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const ERRORS = {
|
||||
["no-app" /* NO_APP */]: "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
["bad-app-name" /* BAD_APP_NAME */]: "Illegal App name: '{$appName}",
|
||||
["duplicate-app" /* DUPLICATE_APP */]: "Firebase App named '{$appName}' already exists",
|
||||
["app-deleted" /* APP_DELETED */]: "Firebase App named '{$appName}' already deleted",
|
||||
["invalid-app-argument" /* INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.'
|
||||
};
|
||||
const ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
const name$1 = "@firebase/app";
|
||||
const version = "0.5.3";
|
||||
|
||||
const name$2 = "@firebase/analytics";
|
||||
|
||||
const name$3 = "@firebase/auth";
|
||||
|
||||
const name$4 = "@firebase/database";
|
||||
|
||||
const name$5 = "@firebase/functions";
|
||||
|
||||
const name$6 = "@firebase/installations";
|
||||
|
||||
const name$7 = "@firebase/messaging";
|
||||
|
||||
const name$8 = "@firebase/performance";
|
||||
|
||||
const name$9 = "@firebase/remote-config";
|
||||
|
||||
const name$a = "@firebase/storage";
|
||||
|
||||
const name$b = "@firebase/firestore";
|
||||
|
||||
const name$c = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
const PLATFORM_LOG_STRING = {
|
||||
[name$1]: 'fire-core',
|
||||
[name$2]: 'fire-analytics',
|
||||
[name$3]: 'fire-auth',
|
||||
[name$4]: 'fire-rtdb',
|
||||
[name$5]: 'fire-fn',
|
||||
[name$6]: 'fire-iid',
|
||||
[name$7]: 'fire-fcm',
|
||||
[name$8]: 'fire-perf',
|
||||
[name$9]: 'fire-rc',
|
||||
[name$a]: 'fire-gcs',
|
||||
[name$b]: 'fire-fst',
|
||||
'fire-js': 'fire-js',
|
||||
[name$c]: 'fire-js-all'
|
||||
};
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
class FirebaseAppLiteImpl {
|
||||
constructor(options, config, firebase_) {
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
// lite version has an empty INTERNAL namespace
|
||||
this.INTERNAL = {};
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this.container.addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
|
||||
// populate ComponentContainer with existing components
|
||||
for (const component of this.firebase_.INTERNAL.components.values()) {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
}
|
||||
get automaticDataCollectionEnabled() {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
}
|
||||
set automaticDataCollectionEnabled(val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
}
|
||||
get name() {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
}
|
||||
get options() {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
}
|
||||
delete() {
|
||||
return new Promise(resolve => {
|
||||
this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(() => {
|
||||
this.firebase_.INTERNAL.removeApp(this.name_);
|
||||
return Promise.all(this.container.getProviders().map(provider => provider.delete()));
|
||||
})
|
||||
.then(() => {
|
||||
this.isDeleted_ = true;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage is the only one that is leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
}
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
checkDestroyed_() {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
const apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
const namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp,
|
||||
// @ts-ignore
|
||||
app,
|
||||
registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent,
|
||||
removeApp,
|
||||
components,
|
||||
useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig = {}) {
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
const name = rawConfig;
|
||||
rawConfig = { name };
|
||||
}
|
||||
const config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
const { name } = config;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
const app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(name => apps[name]);
|
||||
}
|
||||
function registerComponent(component) {
|
||||
const componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug(`There were multiple attempts to register component ${componentName}.`);
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
const serviceNamespace = (appArg = app()) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function (...args) {
|
||||
const serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
// add the component to existing app instances
|
||||
for (const appName of Object.keys(apps)) {
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += `-${variant}`;
|
||||
}
|
||||
const libraryMismatch = library.match(/\s|\//);
|
||||
const versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
const warning = [
|
||||
`Unable to register library "${library}" with version "${version}":`
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`);
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(`${library}-version`, () => ({ library, version }), "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
const useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function createFirebaseNamespaceLite() {
|
||||
const namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);
|
||||
namespace.SDK_VERSION = `${namespace.SDK_VERSION}_LITE`;
|
||||
const registerComponent = namespace.INTERNAL
|
||||
.registerComponent;
|
||||
namespace.INTERNAL.registerComponent = registerComponentForLite;
|
||||
/**
|
||||
* This is a special implementation, so it only works with performance.
|
||||
* only allow performance SDK to register.
|
||||
*/
|
||||
function registerComponentForLite(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
component) {
|
||||
// only allow performance to register with firebase lite
|
||||
if (component.type === "PUBLIC" /* PUBLIC */ &&
|
||||
component.name !== 'performance' &&
|
||||
component.name !== 'installations') {
|
||||
throw Error(`${name} cannot register with the standalone perf instance`);
|
||||
}
|
||||
return registerComponent(component);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
class PlatformLoggerService {
|
||||
constructor(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
getPlatformInfoString() {
|
||||
const providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(provider => {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
const service = provider.getImmediate();
|
||||
return `${service.library}/${service.version}`;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(logString => logString)
|
||||
.join(' ');
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
const component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', container => new PlatformLoggerService(container), "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name$1, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const firebase = createFirebaseNamespaceLite();
|
||||
registerCoreComponents(firebase, 'lite');
|
||||
|
||||
export default firebase;
|
||||
export { firebase };
|
||||
//# sourceMappingURL=index.lite.esm2017.js.map
|
1
node_modules/@firebase/app/dist/index.lite.esm2017.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.lite.esm2017.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
599
node_modules/@firebase/app/dist/index.lite.js
generated
vendored
Normal file
599
node_modules/@firebase/app/dist/index.lite.js
generated
vendored
Normal file
@ -0,0 +1,599 @@
|
||||
import { __values } from 'tslib';
|
||||
import { ErrorFactory, deepCopy, contains, deepExtend } from '@firebase/util';
|
||||
import { ComponentContainer, Component } from '@firebase/component';
|
||||
import { Logger } from '@firebase/logger';
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name$1 = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$2 = "@firebase/analytics";
|
||||
|
||||
var name$3 = "@firebase/auth";
|
||||
|
||||
var name$4 = "@firebase/database";
|
||||
|
||||
var name$5 = "@firebase/functions";
|
||||
|
||||
var name$6 = "@firebase/installations";
|
||||
|
||||
var name$7 = "@firebase/messaging";
|
||||
|
||||
var name$8 = "@firebase/performance";
|
||||
|
||||
var name$9 = "@firebase/remote-config";
|
||||
|
||||
var name$a = "@firebase/storage";
|
||||
|
||||
var name$b = "@firebase/firestore";
|
||||
|
||||
var name$c = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name$1] = 'fire-core',
|
||||
_a$1[name$2] = 'fire-analytics',
|
||||
_a$1[name$3] = 'fire-auth',
|
||||
_a$1[name$4] = 'fire-rtdb',
|
||||
_a$1[name$5] = 'fire-fn',
|
||||
_a$1[name$6] = 'fire-iid',
|
||||
_a$1[name$7] = 'fire-fcm',
|
||||
_a$1[name$8] = 'fire-perf',
|
||||
_a$1[name$9] = 'fire-rc',
|
||||
_a$1[name$a] = 'fire-gcs',
|
||||
_a$1[name$b] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$c] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppLiteImpl = /** @class */ (function () {
|
||||
function FirebaseAppLiteImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
// lite version has an empty INTERNAL namespace
|
||||
this.INTERNAL = {};
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = deepCopy(options);
|
||||
this.container = new ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this.container.addComponent(new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component = _c.value;
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppLiteImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppLiteImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage is the only one that is leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppLiteImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppLiteImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppLiteImpl;
|
||||
}());
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = __values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function createFirebaseNamespaceLite() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppLiteImpl);
|
||||
namespace.SDK_VERSION = namespace.SDK_VERSION + "_LITE";
|
||||
var registerComponent = namespace.INTERNAL
|
||||
.registerComponent;
|
||||
namespace.INTERNAL.registerComponent = registerComponentForLite;
|
||||
/**
|
||||
* This is a special implementation, so it only works with performance.
|
||||
* only allow performance SDK to register.
|
||||
*/
|
||||
function registerComponentForLite(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
component) {
|
||||
// only allow performance to register with firebase lite
|
||||
if (component.type === "PUBLIC" /* PUBLIC */ &&
|
||||
component.name !== 'performance' &&
|
||||
component.name !== 'installations') {
|
||||
throw Error(name + " cannot register with the standalone perf instance");
|
||||
}
|
||||
return registerComponent(component);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name$1, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var firebase = createFirebaseNamespaceLite();
|
||||
registerCoreComponents(firebase, 'lite');
|
||||
|
||||
export default firebase;
|
||||
export { firebase };
|
||||
//# sourceMappingURL=index.lite.js.map
|
1
node_modules/@firebase/app/dist/index.lite.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.lite.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
650
node_modules/@firebase/app/dist/index.node.cjs.js
generated
vendored
Normal file
650
node_modules/@firebase/app/dist/index.node.cjs.js
generated
vendored
Normal file
@ -0,0 +1,650 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var tslib = require('tslib');
|
||||
var util = require('@firebase/util');
|
||||
var component = require('@firebase/component');
|
||||
var logger$1 = require('@firebase/logger');
|
||||
var Storage = _interopDefault(require('dom-storage'));
|
||||
var xmlhttprequest = require('xmlhttprequest');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new logger$1.Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = util.deepCopy(options);
|
||||
this.container = new component.ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component$1 = _c.value;
|
||||
this._addComponent(component$1);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
util.deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = tslib.__values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new component.Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = tslib.__assign(tslib.__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: util.createSubscribe,
|
||||
ErrorFactory: util.ErrorFactory,
|
||||
deepExtend: util.deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
util.deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new component.Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
firebase.INTERNAL.extendNamespace({
|
||||
INTERNAL: {
|
||||
node: {
|
||||
localStorage: new Storage(null, { strict: true }),
|
||||
sessionStorage: new Storage(null, { strict: true }),
|
||||
XMLHttpRequest: xmlhttprequest.XMLHttpRequest
|
||||
}
|
||||
}
|
||||
});
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1, 'node');
|
||||
|
||||
exports.default = firebase$1;
|
||||
exports.firebase = firebase$1;
|
||||
//# sourceMappingURL=index.node.cjs.js.map
|
1
node_modules/@firebase/app/dist/index.node.cjs.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.node.cjs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
651
node_modules/@firebase/app/dist/index.rn.cjs.js
generated
vendored
Normal file
651
node_modules/@firebase/app/dist/index.rn.cjs.js
generated
vendored
Normal file
@ -0,0 +1,651 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var tslib = require('tslib');
|
||||
var util = require('@firebase/util');
|
||||
var component = require('@firebase/component');
|
||||
var logger$1 = require('@firebase/logger');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
var ERRORS = (_a = {},
|
||||
_a["no-app" /* NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
||||
'call Firebase App.initializeApp()',
|
||||
_a["bad-app-name" /* BAD_APP_NAME */] = "Illegal App name: '{$appName}",
|
||||
_a["duplicate-app" /* DUPLICATE_APP */] = "Firebase App named '{$appName}' already exists",
|
||||
_a["app-deleted" /* APP_DELETED */] = "Firebase App named '{$appName}' already deleted",
|
||||
_a["invalid-app-argument" /* INVALID_APP_ARGUMENT */] = 'firebase.{$appName}() takes either no argument or a ' +
|
||||
'Firebase App instance.',
|
||||
_a);
|
||||
var ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
||||
|
||||
var name = "@firebase/app";
|
||||
var version = "0.5.3";
|
||||
|
||||
var name$1 = "@firebase/analytics";
|
||||
|
||||
var name$2 = "@firebase/auth";
|
||||
|
||||
var name$3 = "@firebase/database";
|
||||
|
||||
var name$4 = "@firebase/functions";
|
||||
|
||||
var name$5 = "@firebase/installations";
|
||||
|
||||
var name$6 = "@firebase/messaging";
|
||||
|
||||
var name$7 = "@firebase/performance";
|
||||
|
||||
var name$8 = "@firebase/remote-config";
|
||||
|
||||
var name$9 = "@firebase/storage";
|
||||
|
||||
var name$a = "@firebase/firestore";
|
||||
|
||||
var name$b = "firebase-wrapper";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a$1;
|
||||
var DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
||||
var PLATFORM_LOG_STRING = (_a$1 = {},
|
||||
_a$1[name] = 'fire-core',
|
||||
_a$1[name$1] = 'fire-analytics',
|
||||
_a$1[name$2] = 'fire-auth',
|
||||
_a$1[name$3] = 'fire-rtdb',
|
||||
_a$1[name$4] = 'fire-fn',
|
||||
_a$1[name$5] = 'fire-iid',
|
||||
_a$1[name$6] = 'fire-fcm',
|
||||
_a$1[name$7] = 'fire-perf',
|
||||
_a$1[name$8] = 'fire-rc',
|
||||
_a$1[name$9] = 'fire-gcs',
|
||||
_a$1[name$a] = 'fire-fst',
|
||||
_a$1['fire-js'] = 'fire-js',
|
||||
_a$1[name$b] = 'fire-js-all',
|
||||
_a$1);
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var logger = new logger$1.Logger('@firebase/app');
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
var FirebaseAppImpl = /** @class */ (function () {
|
||||
function FirebaseAppImpl(options, config, firebase_) {
|
||||
var e_1, _a;
|
||||
var _this = this;
|
||||
this.firebase_ = firebase_;
|
||||
this.isDeleted_ = false;
|
||||
this.name_ = config.name;
|
||||
this.automaticDataCollectionEnabled_ =
|
||||
config.automaticDataCollectionEnabled || false;
|
||||
this.options_ = util.deepCopy(options);
|
||||
this.container = new component.ComponentContainer(config.name);
|
||||
// add itself to container
|
||||
this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
|
||||
try {
|
||||
// populate ComponentContainer with existing components
|
||||
for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var component$1 = _c.value;
|
||||
this._addComponent(component$1);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.automaticDataCollectionEnabled_;
|
||||
},
|
||||
set: function (val) {
|
||||
this.checkDestroyed_();
|
||||
this.automaticDataCollectionEnabled_ = val;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.name_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
||||
get: function () {
|
||||
this.checkDestroyed_();
|
||||
return this.options_;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
FirebaseAppImpl.prototype.delete = function () {
|
||||
var _this = this;
|
||||
return new Promise(function (resolve) {
|
||||
_this.checkDestroyed_();
|
||||
resolve();
|
||||
})
|
||||
.then(function () {
|
||||
_this.firebase_.INTERNAL.removeApp(_this.name_);
|
||||
return Promise.all(_this.container.getProviders().map(function (provider) { return provider.delete(); }));
|
||||
})
|
||||
.then(function () {
|
||||
_this.isDeleted_ = true;
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._getService = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
this.checkDestroyed_();
|
||||
// getImmediate will always succeed because _getService is only called for registered components.
|
||||
return this.container.getProvider(name).getImmediate({
|
||||
identifier: instanceIdentifier
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
FirebaseAppImpl.prototype._removeServiceInstance = function (name, instanceIdentifier) {
|
||||
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
this.container.getProvider(name).clearInstance(instanceIdentifier);
|
||||
};
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
FirebaseAppImpl.prototype._addComponent = function (component) {
|
||||
try {
|
||||
this.container.addComponent(component);
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("Component " + component.name + " failed to register with FirebaseApp " + this.name, e);
|
||||
}
|
||||
};
|
||||
FirebaseAppImpl.prototype._addOrOverwriteComponent = function (component) {
|
||||
this.container.addOrOverwriteComponent(component);
|
||||
};
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
FirebaseAppImpl.prototype.checkDestroyed_ = function () {
|
||||
if (this.isDeleted_) {
|
||||
throw ERROR_FACTORY.create("app-deleted" /* APP_DELETED */, { appName: this.name_ });
|
||||
}
|
||||
};
|
||||
return FirebaseAppImpl;
|
||||
}());
|
||||
// Prevent dead-code elimination of these methods w/o invalid property
|
||||
// copying.
|
||||
(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||
|
||||
FirebaseAppImpl.prototype.delete ||
|
||||
console.log('dc');
|
||||
|
||||
var version$1 = "7.8.0";
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
function createFirebaseNamespaceCore(firebaseAppImpl) {
|
||||
var apps = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var components = new Map();
|
||||
// A namespace is a plain JavaScript Object.
|
||||
var namespace = {
|
||||
// Hack to prevent Babel from modifying the object returned
|
||||
// as the firebase namespace.
|
||||
// @ts-ignore
|
||||
__esModule: true,
|
||||
initializeApp: initializeApp,
|
||||
// @ts-ignore
|
||||
app: app,
|
||||
registerVersion: registerVersion,
|
||||
// @ts-ignore
|
||||
apps: null,
|
||||
SDK_VERSION: version$1,
|
||||
INTERNAL: {
|
||||
registerComponent: registerComponent,
|
||||
removeApp: removeApp,
|
||||
components: components,
|
||||
useAsService: useAsService
|
||||
}
|
||||
};
|
||||
// Inject a circular default export to allow Babel users who were previously
|
||||
// using:
|
||||
//
|
||||
// import firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase').default;
|
||||
//
|
||||
// instead of
|
||||
//
|
||||
// import * as firebase from 'firebase';
|
||||
// which becomes: var firebase = require('firebase');
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace['default'] = namespace;
|
||||
// firebase.apps is a read-only getter.
|
||||
Object.defineProperty(namespace, 'apps', {
|
||||
get: getApps
|
||||
});
|
||||
/**
|
||||
* Called by App.delete() - but before any services associated with the App
|
||||
* are deleted.
|
||||
*/
|
||||
function removeApp(name) {
|
||||
delete apps[name];
|
||||
}
|
||||
/**
|
||||
* Get the App object for a given name (or DEFAULT).
|
||||
*/
|
||||
function app(name) {
|
||||
name = name || DEFAULT_ENTRY_NAME;
|
||||
if (!util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("no-app" /* NO_APP */, { appName: name });
|
||||
}
|
||||
return apps[name];
|
||||
}
|
||||
// @ts-ignore
|
||||
app['App'] = firebaseAppImpl;
|
||||
function initializeApp(options, rawConfig) {
|
||||
if (rawConfig === void 0) { rawConfig = {}; }
|
||||
if (typeof rawConfig !== 'object' || rawConfig === null) {
|
||||
var name_1 = rawConfig;
|
||||
rawConfig = { name: name_1 };
|
||||
}
|
||||
var config = rawConfig;
|
||||
if (config.name === undefined) {
|
||||
config.name = DEFAULT_ENTRY_NAME;
|
||||
}
|
||||
var name = config.name;
|
||||
if (typeof name !== 'string' || !name) {
|
||||
throw ERROR_FACTORY.create("bad-app-name" /* BAD_APP_NAME */, {
|
||||
appName: String(name)
|
||||
});
|
||||
}
|
||||
if (util.contains(apps, name)) {
|
||||
throw ERROR_FACTORY.create("duplicate-app" /* DUPLICATE_APP */, { appName: name });
|
||||
}
|
||||
var app = new firebaseAppImpl(options, config, namespace);
|
||||
apps[name] = app;
|
||||
return app;
|
||||
}
|
||||
/*
|
||||
* Return an array of all the non-deleted FirebaseApps.
|
||||
*/
|
||||
function getApps() {
|
||||
// Make a copy so caller cannot mutate the apps list.
|
||||
return Object.keys(apps).map(function (name) { return apps[name]; });
|
||||
}
|
||||
function registerComponent(component) {
|
||||
var e_1, _a;
|
||||
var componentName = component.name;
|
||||
if (components.has(componentName)) {
|
||||
logger.debug("There were multiple attempts to register component " + componentName + ".");
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
components.set(componentName, component);
|
||||
// create service namespace for public components
|
||||
if (component.type === "PUBLIC" /* PUBLIC */) {
|
||||
// The Service namespace is an accessor function ...
|
||||
var serviceNamespace = function (appArg) {
|
||||
if (appArg === void 0) { appArg = app(); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (typeof appArg[componentName] !== 'function') {
|
||||
// Invalid argument.
|
||||
// This happens in the following case: firebase.storage('gs:/')
|
||||
throw ERROR_FACTORY.create("invalid-app-argument" /* INVALID_APP_ARGUMENT */, {
|
||||
appName: componentName
|
||||
});
|
||||
}
|
||||
// Forward service instance lookup to the FirebaseApp.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return appArg[componentName]();
|
||||
};
|
||||
// ... and a container for service-level properties.
|
||||
if (component.serviceProps !== undefined) {
|
||||
util.deepExtend(serviceNamespace, component.serviceProps);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName] = serviceNamespace;
|
||||
// Patch the FirebaseAppImpl prototype
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
firebaseAppImpl.prototype[componentName] =
|
||||
// TODO: The eslint disable can be removed and the 'ignoreRestArgs'
|
||||
// option added to the no-explicit-any rule when ESlint releases it.
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var serviceFxn = this._getService.bind(this, componentName);
|
||||
return serviceFxn.apply(this, component.multipleInstances ? args : []);
|
||||
};
|
||||
}
|
||||
try {
|
||||
// add the component to existing app instances
|
||||
for (var _b = tslib.__values(Object.keys(apps)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var appName = _c.value;
|
||||
apps[appName]._addComponent(component);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return component.type === "PUBLIC" /* PUBLIC */
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
namespace[componentName]
|
||||
: null;
|
||||
}
|
||||
function registerVersion(libraryKeyOrName, version, variant) {
|
||||
var _a;
|
||||
// TODO: We can use this check to whitelist strings when/if we set up
|
||||
// a good whitelist system.
|
||||
var library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName], (_a !== null && _a !== void 0 ? _a : libraryKeyOrName));
|
||||
if (variant) {
|
||||
library += "-" + variant;
|
||||
}
|
||||
var libraryMismatch = library.match(/\s|\//);
|
||||
var versionMismatch = version.match(/\s|\//);
|
||||
if (libraryMismatch || versionMismatch) {
|
||||
var warning = [
|
||||
"Unable to register library \"" + library + "\" with version \"" + version + "\":"
|
||||
];
|
||||
if (libraryMismatch) {
|
||||
warning.push("library name \"" + library + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
if (libraryMismatch && versionMismatch) {
|
||||
warning.push('and');
|
||||
}
|
||||
if (versionMismatch) {
|
||||
warning.push("version name \"" + version + "\" contains illegal characters (whitespace or \"/\")");
|
||||
}
|
||||
logger.warn(warning.join(' '));
|
||||
return;
|
||||
}
|
||||
registerComponent(new component.Component(library + "-version", function () { return ({ library: library, version: version }); }, "VERSION" /* VERSION */));
|
||||
}
|
||||
// Map the requested service to a registered service name
|
||||
// (used to map auth to serverAuth service when needed).
|
||||
function useAsService(app, name) {
|
||||
if (name === 'serverAuth') {
|
||||
return null;
|
||||
}
|
||||
var useService = name;
|
||||
return useService;
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
function createFirebaseNamespace() {
|
||||
var namespace = createFirebaseNamespaceCore(FirebaseAppImpl);
|
||||
namespace.INTERNAL = tslib.__assign(tslib.__assign({}, namespace.INTERNAL), { createFirebaseNamespace: createFirebaseNamespace,
|
||||
extendNamespace: extendNamespace,
|
||||
createSubscribe: util.createSubscribe,
|
||||
ErrorFactory: util.ErrorFactory,
|
||||
deepExtend: util.deepExtend });
|
||||
/**
|
||||
* Patch the top-level firebase namespace with additional properties.
|
||||
*
|
||||
* firebase.INTERNAL.extendNamespace()
|
||||
*/
|
||||
function extendNamespace(props) {
|
||||
util.deepExtend(namespace, props);
|
||||
}
|
||||
return namespace;
|
||||
}
|
||||
var firebase = createFirebaseNamespace();
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var PlatformLoggerService = /** @class */ (function () {
|
||||
function PlatformLoggerService(container) {
|
||||
this.container = container;
|
||||
}
|
||||
// In initial implementation, this will be called by installations on
|
||||
// auth token refresh, and installations will send this string.
|
||||
PlatformLoggerService.prototype.getPlatformInfoString = function () {
|
||||
var providers = this.container.getProviders();
|
||||
// Loop through providers and get library/version pairs from any that are
|
||||
// version components.
|
||||
return providers
|
||||
.map(function (provider) {
|
||||
if (isVersionServiceProvider(provider)) {
|
||||
var service = provider.getImmediate();
|
||||
return service.library + "/" + service.version;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(function (logString) { return logString; })
|
||||
.join(' ');
|
||||
};
|
||||
return PlatformLoggerService;
|
||||
}());
|
||||
/**
|
||||
*
|
||||
* @param provider check if this provider provides a VersionService
|
||||
*
|
||||
* NOTE: Using Provider<'app-version'> is a hack to indicate that the provider
|
||||
* provides VersionService. The provider is not necessarily a 'app-version'
|
||||
* provider.
|
||||
*/
|
||||
function isVersionServiceProvider(provider) {
|
||||
var _a;
|
||||
var component = provider.getComponent();
|
||||
return ((_a = component) === null || _a === void 0 ? void 0 : _a.type) === "VERSION" /* VERSION */;
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function registerCoreComponents(firebase, variant) {
|
||||
firebase.INTERNAL.registerComponent(new component.Component('platform-logger', function (container) { return new PlatformLoggerService(container); }, "PRIVATE" /* PRIVATE */));
|
||||
// Register `app` package.
|
||||
firebase.registerVersion(name, version, variant);
|
||||
// Register platform SDK identifier (no version).
|
||||
firebase.registerVersion('fire-js', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* To avoid having to include the @types/react-native package, which breaks
|
||||
* some of our tests because of duplicate symbols, we are using require syntax
|
||||
* here
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
var AsyncStorage = require('react-native').AsyncStorage;
|
||||
firebase.INTERNAL.extendNamespace({
|
||||
INTERNAL: {
|
||||
reactNative: {
|
||||
AsyncStorage: AsyncStorage
|
||||
}
|
||||
}
|
||||
});
|
||||
var firebase$1 = firebase;
|
||||
registerCoreComponents(firebase$1, 'rn');
|
||||
|
||||
exports.default = firebase$1;
|
||||
exports.firebase = firebase$1;
|
||||
//# sourceMappingURL=index.rn.cjs.js.map
|
1
node_modules/@firebase/app/dist/index.rn.cjs.js.map
generated
vendored
Normal file
1
node_modules/@firebase/app/dist/index.rn.cjs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/@firebase/app/dist/packages/app/index.d.ts
generated
vendored
Normal file
19
node_modules/@firebase/app/dist/packages/app/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare const firebase: FirebaseNamespace;
|
||||
export default firebase;
|
18
node_modules/@firebase/app/dist/packages/app/index.lite.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/index.lite.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare const firebase: import("@firebase/app-types").FirebaseNamespace;
|
||||
export default firebase;
|
19
node_modules/@firebase/app/dist/packages/app/index.node.d.ts
generated
vendored
Normal file
19
node_modules/@firebase/app/dist/packages/app/index.node.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare const firebase: FirebaseNamespace;
|
||||
export default firebase;
|
19
node_modules/@firebase/app/dist/packages/app/index.rn.d.ts
generated
vendored
Normal file
19
node_modules/@firebase/app/dist/packages/app/index.rn.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare const firebase: FirebaseNamespace;
|
||||
export default firebase;
|
21
node_modules/@firebase/app/dist/packages/app/src/constants.d.ts
generated
vendored
Normal file
21
node_modules/@firebase/app/dist/packages/app/src/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare const DEFAULT_ENTRY_NAME = "[DEFAULT]";
|
||||
export declare const PLATFORM_LOG_STRING: {
|
||||
readonly [x: string]: "fire-core" | "fire-analytics" | "fire-auth" | "fire-rtdb" | "fire-fn" | "fire-iid" | "fire-fcm" | "fire-perf" | "fire-rc" | "fire-gcs" | "fire-fst" | "fire-js" | "fire-js-all";
|
||||
readonly 'fire-js': "fire-js";
|
||||
};
|
31
node_modules/@firebase/app/dist/packages/app/src/errors.d.ts
generated
vendored
Normal file
31
node_modules/@firebase/app/dist/packages/app/src/errors.d.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ErrorFactory } from '@firebase/util';
|
||||
export declare const enum AppError {
|
||||
NO_APP = "no-app",
|
||||
BAD_APP_NAME = "bad-app-name",
|
||||
DUPLICATE_APP = "duplicate-app",
|
||||
APP_DELETED = "app-deleted",
|
||||
INVALID_APP_ARGUMENT = "invalid-app-argument"
|
||||
}
|
||||
declare type ErrorParams = {
|
||||
[key in AppError]: {
|
||||
appName: string;
|
||||
};
|
||||
};
|
||||
export declare const ERROR_FACTORY: ErrorFactory<AppError, ErrorParams>;
|
||||
export {};
|
73
node_modules/@firebase/app/dist/packages/app/src/firebaseApp.d.ts
generated
vendored
Normal file
73
node_modules/@firebase/app/dist/packages/app/src/firebaseApp.d.ts
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseApp, FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types';
|
||||
import { _FirebaseNamespace, FirebaseService } from '@firebase/app-types/private';
|
||||
import { Component } from '@firebase/component';
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
export declare class FirebaseAppImpl implements FirebaseApp {
|
||||
private readonly firebase_;
|
||||
private readonly options_;
|
||||
private readonly name_;
|
||||
private isDeleted_;
|
||||
private automaticDataCollectionEnabled_;
|
||||
private container;
|
||||
constructor(options: FirebaseOptions, config: FirebaseAppConfig, firebase_: _FirebaseNamespace);
|
||||
get automaticDataCollectionEnabled(): boolean;
|
||||
set automaticDataCollectionEnabled(val: boolean);
|
||||
get name(): string;
|
||||
get options(): FirebaseOptions;
|
||||
delete(): Promise<void>;
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage and functions are the only ones that are leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name: string, instanceIdentifier?: string): FirebaseService;
|
||||
/**
|
||||
* Remove a service instance from the cache, so we will create a new instance for this service
|
||||
* when people try to get this service again.
|
||||
*
|
||||
* NOTE: currently only firestore is using this functionality to support firestore shutdown.
|
||||
*
|
||||
* @param name The service name
|
||||
* @param instanceIdentifier instance identifier in case multiple instances are allowed
|
||||
* @internal
|
||||
*/
|
||||
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
|
||||
/**
|
||||
* @param component the component being added to this app's container
|
||||
*/
|
||||
_addComponent(component: Component): void;
|
||||
_addOrOverwriteComponent(component: Component): void;
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
private checkDestroyed_;
|
||||
}
|
26
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespace.d.ts
generated
vendored
Normal file
26
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespace.d.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
/**
|
||||
* Return a firebase namespace object.
|
||||
*
|
||||
* In production, this will be called exactly once and the result
|
||||
* assigned to the 'firebase' global. It may be called multiple times
|
||||
* in unit tests.
|
||||
*/
|
||||
export declare function createFirebaseNamespace(): FirebaseNamespace;
|
||||
export declare const firebase: FirebaseNamespace;
|
27
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespaceCore.d.ts
generated
vendored
Normal file
27
node_modules/@firebase/app/dist/packages/app/src/firebaseNamespaceCore.d.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
import { FirebaseAppImpl } from './firebaseApp';
|
||||
import { FirebaseAppLiteImpl } from './lite/firebaseAppLite';
|
||||
/**
|
||||
* Because auth can't share code with other components, we attach the utility functions
|
||||
* in an internal namespace to share code.
|
||||
* This function return a firebase namespace object without
|
||||
* any utility functions, so it can be shared between the regular firebaseNamespace and
|
||||
* the lite version.
|
||||
*/
|
||||
export declare function createFirebaseNamespaceCore(firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl): FirebaseNamespace;
|
57
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseAppLite.d.ts
generated
vendored
Normal file
57
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseAppLite.d.ts
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseApp, FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types';
|
||||
import { _FirebaseNamespace, FirebaseService } from '@firebase/app-types/private';
|
||||
/**
|
||||
* Global context object for a collection of services using
|
||||
* a shared authentication state.
|
||||
*/
|
||||
export declare class FirebaseAppLiteImpl implements FirebaseApp {
|
||||
private readonly firebase_;
|
||||
private readonly options_;
|
||||
private readonly name_;
|
||||
private isDeleted_;
|
||||
private automaticDataCollectionEnabled_;
|
||||
private container;
|
||||
readonly INTERNAL: {};
|
||||
constructor(options: FirebaseOptions, config: FirebaseAppConfig, firebase_: _FirebaseNamespace);
|
||||
get automaticDataCollectionEnabled(): boolean;
|
||||
set automaticDataCollectionEnabled(val: boolean);
|
||||
get name(): string;
|
||||
get options(): FirebaseOptions;
|
||||
delete(): Promise<void>;
|
||||
/**
|
||||
* Return a service instance associated with this app (creating it
|
||||
* on demand), identified by the passed instanceIdentifier.
|
||||
*
|
||||
* NOTE: Currently storage is the only one that is leveraging this
|
||||
* functionality. They invoke it by calling:
|
||||
*
|
||||
* ```javascript
|
||||
* firebase.app().storage('STORAGE BUCKET ID')
|
||||
* ```
|
||||
*
|
||||
* The service name is passed to this already
|
||||
* @internal
|
||||
*/
|
||||
_getService(name: string, instanceIdentifier?: string): FirebaseService;
|
||||
/**
|
||||
* This function will throw an Error if the App has already been deleted -
|
||||
* use before performing API actions on the App.
|
||||
*/
|
||||
private checkDestroyed_;
|
||||
}
|
18
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseNamespaceLite.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/src/lite/firebaseNamespaceLite.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare function createFirebaseNamespaceLite(): FirebaseNamespace;
|
18
node_modules/@firebase/app/dist/packages/app/src/logger.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/src/logger.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Logger } from '@firebase/logger';
|
||||
export declare const logger: Logger;
|
22
node_modules/@firebase/app/dist/packages/app/src/platformLoggerService.d.ts
generated
vendored
Normal file
22
node_modules/@firebase/app/dist/packages/app/src/platformLoggerService.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ComponentContainer } from '@firebase/component';
|
||||
export declare class PlatformLoggerService {
|
||||
private readonly container;
|
||||
constructor(container: ComponentContainer);
|
||||
getPlatformInfoString(): string;
|
||||
}
|
18
node_modules/@firebase/app/dist/packages/app/src/registerCoreComponents.d.ts
generated
vendored
Normal file
18
node_modules/@firebase/app/dist/packages/app/src/registerCoreComponents.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { FirebaseNamespace } from '@firebase/app-types';
|
||||
export declare function registerCoreComponents(firebase: FirebaseNamespace, variant?: string): void;
|
17
node_modules/@firebase/app/dist/packages/app/test/firebaseApp.test.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/app/dist/packages/app/test/firebaseApp.test.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import './setup';
|
25
node_modules/@firebase/app/dist/packages/app/test/platformLogger.test.d.ts
generated
vendored
Normal file
25
node_modules/@firebase/app/dist/packages/app/test/platformLogger.test.d.ts
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { VersionService } from '@firebase/app-types';
|
||||
import './setup';
|
||||
declare module '@firebase/component' {
|
||||
interface NameServiceMapping {
|
||||
'vs1': VersionService;
|
||||
'vs2': VersionService;
|
||||
'test-shell': Promise<void>;
|
||||
}
|
||||
}
|
17
node_modules/@firebase/app/dist/packages/app/test/setup.d.ts
generated
vendored
Normal file
17
node_modules/@firebase/app/dist/packages/app/test/setup.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export {};
|
91
node_modules/@firebase/app/package.json
generated
vendored
Normal file
91
node_modules/@firebase/app/package.json
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
{
|
||||
"_from": "@firebase/app@0.5.3",
|
||||
"_id": "@firebase/app@0.5.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-cQn8eQSJRMpyIRfBi2roIiw0weAorpdJ2Ssn7yDlkMo0ZSE56MgMSlX1mcDupXgNZtG+k3E+IEr+FfzD9SQBGg==",
|
||||
"_location": "/@firebase/app",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@firebase/app@0.5.3",
|
||||
"name": "@firebase/app",
|
||||
"escapedName": "@firebase%2fapp",
|
||||
"scope": "@firebase",
|
||||
"rawSpec": "0.5.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.5.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/firebase"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.5.3.tgz",
|
||||
"_shasum": "62d3575c618c020d6bc9fc4f59e4988e9e7fe4b2",
|
||||
"_spec": "@firebase/app@0.5.3",
|
||||
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix-V3\\node_modules\\firebase",
|
||||
"author": {
|
||||
"name": "Firebase",
|
||||
"email": "firebase-support@google.com",
|
||||
"url": "https://firebase.google.com/"
|
||||
},
|
||||
"browser": "dist/index.cjs.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/firebase/firebase-js-sdk/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@firebase/app-types": "0.5.0",
|
||||
"@firebase/component": "0.1.4",
|
||||
"@firebase/logger": "0.1.34",
|
||||
"@firebase/util": "0.2.39",
|
||||
"dom-storage": "2.1.0",
|
||||
"tslib": "1.10.0",
|
||||
"xmlhttprequest": "1.8.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "The primary entrypoint to the Firebase JS SDK",
|
||||
"devDependencies": {
|
||||
"rollup": "1.28.0",
|
||||
"rollup-plugin-json": "4.0.0",
|
||||
"rollup-plugin-replace": "2.2.0",
|
||||
"rollup-plugin-typescript2": "0.25.3",
|
||||
"typescript": "3.7.3"
|
||||
},
|
||||
"esm2017": "dist/index.esm2017.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"homepage": "https://github.com/firebase/firebase-js-sdk#readme",
|
||||
"license": "Apache-2.0",
|
||||
"lite": "dist/index.lite.js",
|
||||
"lite-esm2017": "dist/index.lite.esm2017.js",
|
||||
"main": "dist/index.node.cjs.js",
|
||||
"module": "dist/index.esm.js",
|
||||
"name": "@firebase/app",
|
||||
"nyc": {
|
||||
"extension": [
|
||||
".ts"
|
||||
],
|
||||
"reportDir": "./coverage/node"
|
||||
},
|
||||
"react-native": "dist/index.rn.cjs.js",
|
||||
"repository": {
|
||||
"directory": "packages/app",
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "rollup -c -w",
|
||||
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
||||
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
||||
"prepare": "yarn build",
|
||||
"test": "yarn type-check && run-p lint test:browser test:node",
|
||||
"test:browser": "karma start --single-run",
|
||||
"test:browser:debug": "karma start --browsers Chrome --auto-watch",
|
||||
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --opts ../../config/mocha.node.opts",
|
||||
"type-check": "tsc -p . --noEmit"
|
||||
},
|
||||
"typings": "dist/packages/app/index.d.ts",
|
||||
"version": "0.5.3"
|
||||
}
|
3
node_modules/@firebase/auth-interop-types/README.md
generated
vendored
Normal file
3
node_modules/@firebase/auth-interop-types/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# @firebase/auth-interop-types
|
||||
|
||||
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user