Initial Version

This commit is contained in:
Zeddy 2018-04-09 19:18:15 -04:00
commit d23ada9594
18 changed files with 6911 additions and 0 deletions

5
.firebaserc Normal file
View File

@ -0,0 +1,5 @@
{
"projects": {
"default": "swimteammanager-179e8"
}
}

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
build/
.gradle/
node_modules/
.idea/
*.log

29
build.gradle Normal file
View File

@ -0,0 +1,29 @@
buildscript {
ext.kotlin_version = '1.2.30'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
group 'online.cinphart'
version '1.0-SNAPSHOT'
apply plugin: 'kotlin2js'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
}
compileKotlin2Js.kotlinOptions {
moduleKind = "commonjs"
outputFile = "functions/index.js"
}

7
firebase.json Normal file
View File

@ -0,0 +1,7 @@
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
}
}

123
functions/.eslintrc.json Normal file
View File

@ -0,0 +1,123 @@
{
"parserOptions": {
// Required for certain syntax usages
"ecmaVersion": 6
},
"plugins": [
"promise"
],
"extends": "eslint:recommended",
"rules": {
// Removed rule "disallow the use of console" from recommended eslint rules
"no-console": "off",
// Removed rule "disallow multiple spaces in regular expressions" from recommended eslint rules
"no-regex-spaces": "off",
// Removed rule "disallow the use of debugger" from recommended eslint rules
"no-debugger": "off",
// Removed rule "disallow unused variables" from recommended eslint rules
"no-unused-vars": "off",
// Removed rule "disallow mixed spaces and tabs for indentation" from recommended eslint rules
"no-mixed-spaces-and-tabs": "off",
// Removed rule "disallow the use of undeclared variables unless mentioned in /*global */ comments" from recommended eslint rules
"no-undef": "off",
// Warn against template literal placeholder syntax in regular strings
"no-template-curly-in-string": 1,
// Warn if return statements do not either always or never specify values
"consistent-return": 1,
// Warn if no return statements in callbacks of array methods
"array-callback-return": 1,
// Require the use of === and !==
"eqeqeq": 2,
// Disallow the use of alert, confirm, and prompt
"no-alert": 2,
// Disallow the use of arguments.caller or arguments.callee
"no-caller": 2,
// Disallow null comparisons without type-checking operators
"no-eq-null": 2,
// Disallow the use of eval()
"no-eval": 2,
// Warn against extending native types
"no-extend-native": 1,
// Warn against unnecessary calls to .bind()
"no-extra-bind": 1,
// Warn against unnecessary labels
"no-extra-label": 1,
// Disallow leading or trailing decimal points in numeric literals
"no-floating-decimal": 2,
// Warn against shorthand type conversions
"no-implicit-coercion": 1,
// Warn against function declarations and expressions inside loop statements
"no-loop-func": 1,
// Disallow new operators with the Function object
"no-new-func": 2,
// Warn against new operators with the String, Number, and Boolean objects
"no-new-wrappers": 1,
// Disallow throwing literals as exceptions
"no-throw-literal": 2,
// Require using Error objects as Promise rejection reasons
"prefer-promise-reject-errors": 2,
// Enforce for loop update clause moving the counter in the right direction
"for-direction": 2,
// Enforce return statements in getters
"getter-return": 2,
// Disallow await inside of loops
"no-await-in-loop": 2,
// Disallow comparing against -0
"no-compare-neg-zero": 2,
// Warn against catch clause parameters from shadowing variables in the outer scope
"no-catch-shadow": 1,
// Disallow identifiers from shadowing restricted names
"no-shadow-restricted-names": 2,
// Enforce return statements in callbacks of array methods
"callback-return": 2,
// Require error handling in callbacks
"handle-callback-err": 2,
// Warn against string concatenation with __dirname and __filename
"no-path-concat": 1,
// Prefer using arrow functions for callbacks
"prefer-arrow-callback": 1,
// Return inside each then() to create readable and reusable Promise chains.
// Forces developers to return console logs and http calls in promises.
"promise/always-return": 2,
//Enforces the use of catch() on un-returned promises
"promise/catch-or-return": 2,
// Warn against nested then() or catch() statements
"promise/no-nesting": 1
}
}

152
functions/index.js Normal file
View File

@ -0,0 +1,152 @@
(function (_, Kotlin) {
'use strict';
var Kind_CLASS = Kotlin.Kind.CLASS;
var listOf = Kotlin.kotlin.collections.listOf_i5x0yv$;
function get_cm($receiver) {
return $receiver / 2.54;
}
function get_asPoints($receiver) {
return $receiver * 72;
}
function SlipInfo(eventNbr, event, lane, heat, swimmer, team) {
this.eventNbr = eventNbr;
this.event = event;
this.lane = lane;
this.heat = heat;
this.swimmer = swimmer;
this.team = team;
}
SlipInfo.$metadata$ = {
kind: Kind_CLASS,
simpleName: 'SlipInfo',
interfaces: []
};
SlipInfo.prototype.component1 = function () {
return this.eventNbr;
};
SlipInfo.prototype.component2 = function () {
return this.event;
};
SlipInfo.prototype.component3 = function () {
return this.lane;
};
SlipInfo.prototype.component4 = function () {
return this.heat;
};
SlipInfo.prototype.component5 = function () {
return this.swimmer;
};
SlipInfo.prototype.component6 = function () {
return this.team;
};
SlipInfo.prototype.copy_cdqwiw$ = function (eventNbr, event, lane, heat, swimmer, team) {
return new SlipInfo(eventNbr === void 0 ? this.eventNbr : eventNbr, event === void 0 ? this.event : event, lane === void 0 ? this.lane : lane, heat === void 0 ? this.heat : heat, swimmer === void 0 ? this.swimmer : swimmer, team === void 0 ? this.team : team);
};
SlipInfo.prototype.toString = function () {
return 'SlipInfo(eventNbr=' + Kotlin.toString(this.eventNbr) + (', event=' + Kotlin.toString(this.event)) + (', lane=' + Kotlin.toString(this.lane)) + (', heat=' + Kotlin.toString(this.heat)) + (', swimmer=' + Kotlin.toString(this.swimmer)) + (', team=' + Kotlin.toString(this.team)) + ')';
};
SlipInfo.prototype.hashCode = function () {
var result = 0;
result = result * 31 + Kotlin.hashCode(this.eventNbr) | 0;
result = result * 31 + Kotlin.hashCode(this.event) | 0;
result = result * 31 + Kotlin.hashCode(this.lane) | 0;
result = result * 31 + Kotlin.hashCode(this.heat) | 0;
result = result * 31 + Kotlin.hashCode(this.swimmer) | 0;
result = result * 31 + Kotlin.hashCode(this.team) | 0;
return result;
};
SlipInfo.prototype.equals = function (other) {
return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.eventNbr, other.eventNbr) && Kotlin.equals(this.event, other.event) && Kotlin.equals(this.lane, other.lane) && Kotlin.equals(this.heat, other.heat) && Kotlin.equals(this.swimmer, other.swimmer) && Kotlin.equals(this.team, other.team)))));
};
function main$lambda(req, res) {
var doc = new (require('pdfkit'))();
res.setHeader('Content-Type', 'application/pdf');
var slips = listOf([new SlipInfo(1, 'Girls 8&U 100 Yd Medley Relay', 1, 1, 'A', 'Delshire'), new SlipInfo(1, 'Girls 8&U 100 Yd Medley Relay', 1, 3, 'B', 'Delshire'), new SlipInfo(19, 'Boys 15-18 50 Yd Freestyle', 3, 5, 'Jack Hart', 'Delshire'), new SlipInfo(19, 'Boys 15-18 50 Yd Freestyle', 6, 1, 'Joseph Obert', 'Delshire'), new SlipInfo(1, 'Girls 8&U 100 Yd Medley Relay', 1, 1, 'A', 'Delshire'), new SlipInfo(1, 'Girls 8&U 100 Yd Medley Relay', 1, 3, 'B', 'Delshire')]);
doc.pipe(res);
writeSlip(slips.get_za3lpa$(0), doc, 0, 0);
writeSlip(slips.get_za3lpa$(1), doc, 1, 0);
writeSlip(slips.get_za3lpa$(2), doc, 0, 1);
writeSlip(slips.get_za3lpa$(3), doc, 1, 1);
writeSlip(slips.get_za3lpa$(4), doc, 0, 2);
writeSlip(slips.get_za3lpa$(5), doc, 1, 2);
var dashOptions = {};
dashOptions.space = 10;
doc.moveTo(get_asPoints(get_cm(10.25)), get_asPoints(get_cm(1.0))).lineTo(get_asPoints(get_cm(10.25)), get_asPoints(get_cm(27.0))).dash(5, dashOptions).stroke();
doc.moveTo(get_asPoints(get_cm(1.0)), get_asPoints(get_cm(8.5))).lineTo(get_asPoints(get_cm(21.0)), get_asPoints(get_cm(8.5))).dash(5, dashOptions).stroke();
doc.moveTo(get_asPoints(get_cm(1.0)), get_asPoints(get_cm(16.5))).lineTo(get_asPoints(get_cm(21.0)), get_asPoints(get_cm(16.5))).dash(5, dashOptions).stroke();
return doc.end();
}
function main(args) {
var fireFunctions = require('firebase-functions');
fireFunctions.config();
exports.laneslips = fireFunctions.https.onRequest(main$lambda);
}
function writeSlip($receiver, doc, x, y) {
var xOffset = get_asPoints(get_cm(10.0)) * x;
var yOffset = get_asPoints(get_cm(8.0)) * y;
var leftMargin = get_asPoints(get_cm(1.0)) + xOffset;
var opts = {};
opts.width = get_asPoints(get_cm(8.5));
opts.align = 'center';
doc.fontSize(13);
doc.font('Helvetica-Bold');
doc.text('Southern Ohio Swim League', leftMargin, get_asPoints(get_cm(1.5)) + yOffset, opts);
doc.fontSize(11);
doc.font('Times-Roman');
var eventY = get_asPoints(get_cm(2.3)) + yOffset;
doc.text('EVENT #' + $receiver.eventNbr + ' - ' + $receiver.event, leftMargin, eventY);
var lineSeparation = get_asPoints(get_cm(0.6));
var laneY = eventY + lineSeparation;
doc.text('Lane:', leftMargin, laneY);
var colWidth = get_asPoints(get_cm(1.3));
doc.text('1', leftMargin + colWidth * 1, laneY);
doc.text('2', leftMargin + colWidth * 2, laneY);
doc.text('3', leftMargin + colWidth * 3, laneY);
doc.text('4', leftMargin + colWidth * 4, laneY);
doc.text('5', leftMargin + colWidth * 5, laneY);
doc.text('6', leftMargin + colWidth * 6, laneY);
doc.circle(leftMargin + colWidth * $receiver.lane + get_asPoints(get_cm(0.1)), laneY + get_asPoints(get_cm(0.15)), get_asPoints(get_cm(0.3)));
doc.stroke();
var heatY = laneY + lineSeparation;
doc.text('Heat:', leftMargin, heatY);
doc.text('1', leftMargin + colWidth * 1, heatY);
doc.text('2', leftMargin + colWidth * 2, heatY);
doc.text('3', leftMargin + colWidth * 3, heatY);
doc.text('4', leftMargin + colWidth * 4, heatY);
doc.text('5', leftMargin + colWidth * 5, heatY);
doc.text('6', leftMargin + colWidth * 6, heatY);
doc.circle(leftMargin + colWidth * $receiver.heat + get_asPoints(get_cm(0.1)), heatY + get_asPoints(get_cm(0.15)), get_asPoints(get_cm(0.3)));
doc.stroke();
var nameY = heatY + lineSeparation;
doc.text('Name: ' + $receiver.swimmer, leftMargin, nameY);
var teamY = nameY + lineSeparation;
doc.text('Team: ' + $receiver.team, leftMargin, teamY);
var timesY = teamY + lineSeparation * 1.5;
doc.text('Times:', leftMargin, timesY);
doc.moveTo(leftMargin + colWidth, timesY + 14).lineTo(leftMargin + colWidth + get_asPoints(get_cm(2.0)), timesY + 14).stroke();
doc.moveTo(leftMargin + colWidth + get_asPoints(get_cm(2.7)), timesY + 14).lineTo(leftMargin + colWidth + get_asPoints(get_cm(4.7)), timesY + 14).stroke();
doc.moveTo(leftMargin + colWidth + get_asPoints(get_cm(5.4)), timesY + 14).lineTo(leftMargin + colWidth + get_asPoints(get_cm(7.4)), timesY + 14).stroke();
var officialTimesY = timesY + lineSeparation * 1.5;
doc.text('Official Time:', leftMargin, officialTimesY);
doc.moveTo(leftMargin + colWidth * 2, officialTimesY + 14).lineTo(leftMargin + colWidth * 2 + get_asPoints(get_cm(4.0)), officialTimesY + 14).stroke();
var placeY = officialTimesY + lineSeparation * 1.25;
doc.text('Place:', leftMargin, placeY);
doc.text('1', leftMargin + colWidth * 1, placeY);
doc.text('2', leftMargin + colWidth * 2, placeY);
doc.text('3', leftMargin + colWidth * 3, placeY);
doc.text('4', leftMargin + colWidth * 4, placeY);
doc.text('5', leftMargin + colWidth * 5, placeY);
doc.text('6', leftMargin + colWidth * 6, placeY);
}
var package$online = _.online || (_.online = {});
var package$cinphart = package$online.cinphart || (package$online.cinphart = {});
var package$laneslips = package$cinphart.laneslips || (package$cinphart.laneslips = {});
package$laneslips.get_cm_yrwdxr$ = get_cm;
package$laneslips.get_asPoints_yrwdxr$ = get_asPoints;
package$laneslips.SlipInfo = SlipInfo;
package$laneslips.main_kand9s$ = main;
package$laneslips.writeSlip_xwsitz$ = writeSlip;
main([]);
Kotlin.defineModule('index', _);
return _;
}(module.exports, require('kotlin')));

1
functions/index.meta.js Normal file
View File

@ -0,0 +1 @@
// Kotlin.kotlin_module_metadata(513, "index", "H4sIAAAAAAAAAF2Ty27TQBSGfYs9OUnbwaU0mAIh3CuBjLmIbUtBaRdV5YLEgo3rDI1FPBPsCW32KA8AG9Z9Cp6AR8gL8CKccYYksPH/zZl/5sx/JBvE9r978NsCV/BBxhmQNOPDflJIqA8SzspBNiyBHKPs848C3E9Cog/sHT4Gwr4wLg9PCrD3uYRatQT3WBYZPwVHnQenzxIJXnmW5TkrwJEsyQFSkQ8FR/eTJY6W+OkSP1vi50v8ApxUDMfgss+jZFCCtyvEgCUcakL2sRfpJ2X/lehhKCn0ozx2PhSFRPMhmlTFnyV6vDfmSZ6lb8dD9Cflkcg42tw9MToZMLDSHJw8weTOO55JcJLitITaTlEkY/AKfEFWMHBz0Ruhu35WZJKpoYHdEymY52CO/Q9gUQMcYlATvybFoROL2i0D6w6yQ2vISj2tda1XtF7TekPrLa23W0ZwYQabtB1YYSNq0k5AfMe3Qi9s/iRGsEXvBNDe2nZaZlgL65FL76LR607aavcRvaeObVuhHa3S+/85H+Cei/pQKdo7GzRYtryffDVVeY1eRwfgLfDyzaxw85/CD2J1LiwyIS07ssLabui71FWXohL1HFTQ64bWpq6vKD2o01VV7/6yEdeqBBXSRfXSAv2FYf0vvqaXAxWT4OCr3hVV3SuCea0xp+Z8d2V2jXmwTjcQSUToZlCNoTtVbVpV86mJeLWyTs1YZ4t11lhni3XWWGeMdUac0zdigRHoH+0PWtUuxaEDAAA=");

5529
functions/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

23
functions/package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "~5.12.0",
"firebase-functions": "^1.0.1",
"kotlin": "^1.2.31",
"pdfkit": "^0.8.3"
},
"devDependencies": {
"eslint": "^4.12.0",
"eslint-plugin-promise": "^3.6.0"
},
"private": true
}

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Sun Apr 08 19:05:26 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

172
gradlew vendored Normal file
View File

@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

84
gradlew.bat vendored Normal file
View File

@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

577
package-lock.json generated Normal file
View File

@ -0,0 +1,577 @@
{
"name": "lane-slip-generator",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"acorn": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz",
"integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ=="
},
"amdefine": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
"optional": true
},
"ast-transform": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/ast-transform/-/ast-transform-0.0.0.tgz",
"integrity": "sha1-dJRAWIh9goPhidlUYAlHvJj+AGI=",
"requires": {
"escodegen": "1.2.0",
"esprima": "1.0.4",
"through": "2.3.8"
},
"dependencies": {
"escodegen": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.2.0.tgz",
"integrity": "sha1-Cd55Z3kcyVi3+Jot220jRRrzJ+E=",
"requires": {
"esprima": "1.0.4",
"estraverse": "1.5.1",
"esutils": "1.0.0",
"source-map": "0.1.43"
}
},
"esprima": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
"integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0="
},
"estraverse": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz",
"integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E="
},
"esutils": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz",
"integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA="
},
"source-map": {
"version": "0.1.43",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
"integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
"optional": true,
"requires": {
"amdefine": "1.0.1"
}
}
}
},
"ast-types": {
"version": "0.7.8",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.7.8.tgz",
"integrity": "sha1-kC0uDWDQcb3NRtwRXhgJ7RHBOKk="
},
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"requires": {
"core-js": "2.5.4",
"regenerator-runtime": "0.11.1"
}
},
"base64-js": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz",
"integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w=="
},
"brfs": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/brfs/-/brfs-1.5.0.tgz",
"integrity": "sha512-PscWJn5IGjcK5g5lqEeRPYJ5efZk93YbopLu6UXZcb9dPZUfMN/UMyyT/tddpi7A9yIDM9TEdCOA3A4WGST1hg==",
"requires": {
"quote-stream": "1.0.2",
"resolve": "1.7.0",
"static-module": "2.2.3",
"through2": "2.0.3"
}
},
"brotli": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.2.tgz",
"integrity": "sha1-UlqcrU/LqWR119OI9q7LE+7VL0Y=",
"requires": {
"base64-js": "1.2.3"
}
},
"browser-resolve": {
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz",
"integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=",
"requires": {
"resolve": "1.1.7"
},
"dependencies": {
"resolve": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
"integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs="
}
}
},
"browserify-optional": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/browserify-optional/-/browserify-optional-1.0.1.tgz",
"integrity": "sha1-HhNyLP3g2F8SFnbCpyztUzoBiGk=",
"requires": {
"ast-transform": "0.0.0",
"ast-types": "0.7.8",
"browser-resolve": "1.11.2"
}
},
"buffer-equal": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
"integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs="
},
"buffer-from": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz",
"integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA=="
},
"clone": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4="
},
"concat-stream": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"requires": {
"buffer-from": "1.0.0",
"inherits": "2.0.3",
"readable-stream": "2.3.6",
"typedarray": "0.0.6"
}
},
"convert-source-map": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz",
"integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU="
},
"core-js": {
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.4.tgz",
"integrity": "sha1-8si/GB8qgLkvNgEhQpzmOi8K6uA="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"deep-equal": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
"integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
},
"deep-is": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
},
"dfa": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/dfa/-/dfa-1.1.0.tgz",
"integrity": "sha1-0wIYvRDQMPpCHfPrvIIoVGOjF4E=",
"requires": {
"babel-runtime": "6.26.0"
}
},
"duplexer2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
"integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
"requires": {
"readable-stream": "2.3.6"
}
},
"escodegen": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz",
"integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==",
"requires": {
"esprima": "3.1.3",
"estraverse": "4.2.0",
"esutils": "2.0.2",
"optionator": "0.8.2",
"source-map": "0.6.1"
}
},
"esprima": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz",
"integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM="
},
"estraverse": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
"integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM="
},
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="
},
"falafel": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz",
"integrity": "sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw=",
"requires": {
"acorn": "5.5.3",
"foreach": "2.0.5",
"isarray": "0.0.1",
"object-keys": "1.0.11"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
}
}
},
"fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
},
"fontkit": {
"version": "1.7.7",
"resolved": "https://registry.npmjs.org/fontkit/-/fontkit-1.7.7.tgz",
"integrity": "sha1-668tjz/t8wKuPGS0vurdwkf827E=",
"requires": {
"babel-runtime": "6.26.0",
"brfs": "1.5.0",
"brotli": "1.3.2",
"browserify-optional": "1.0.1",
"clone": "1.0.4",
"deep-equal": "1.0.1",
"dfa": "1.1.0",
"restructure": "0.5.4",
"tiny-inflate": "1.0.2",
"unicode-properties": "1.1.0",
"unicode-trie": "0.3.1"
}
},
"foreach": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
"integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
},
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"has": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz",
"integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=",
"requires": {
"function-bind": "1.1.1"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"kotlin": {
"version": "1.2.31",
"resolved": "https://registry.npmjs.org/kotlin/-/kotlin-1.2.31.tgz",
"integrity": "sha1-1Fb8HvIvXI2rZIadl8bRgx5s0zk="
},
"levn": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
"integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
"requires": {
"prelude-ls": "1.1.2",
"type-check": "0.3.2"
}
},
"linebreak": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/linebreak/-/linebreak-0.3.0.tgz",
"integrity": "sha1-BSZICmLAW9Z58+nZmDDgnGp9DtY=",
"requires": {
"base64-js": "0.0.8",
"brfs": "1.5.0",
"unicode-trie": "0.3.1"
},
"dependencies": {
"base64-js": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz",
"integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg="
}
}
},
"magic-string": {
"version": "0.22.5",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz",
"integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==",
"requires": {
"vlq": "0.2.3"
}
},
"merge-source-map": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz",
"integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=",
"requires": {
"source-map": "0.5.7"
},
"dependencies": {
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
}
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"object-inspect": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.4.1.tgz",
"integrity": "sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw=="
},
"object-keys": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz",
"integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0="
},
"optionator": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
"integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
"requires": {
"deep-is": "0.1.3",
"fast-levenshtein": "2.0.6",
"levn": "0.3.0",
"prelude-ls": "1.1.2",
"type-check": "0.3.2",
"wordwrap": "1.0.0"
}
},
"pako": {
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
"integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU="
},
"path-parse": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME="
},
"pdfkit": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/pdfkit/-/pdfkit-0.8.3.tgz",
"integrity": "sha1-7Jmlf8Vcowlyb4VkVtoUQY9TMOM=",
"requires": {
"fontkit": "1.7.7",
"linebreak": "0.3.0",
"png-js": "0.1.1"
}
},
"png-js": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/png-js/-/png-js-0.1.1.tgz",
"integrity": "sha1-HMfCEjA6yr50Jj7DrHgAlYAkLZM="
},
"prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
},
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
},
"quote-stream": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/quote-stream/-/quote-stream-1.0.2.tgz",
"integrity": "sha1-hJY/jJwmuULhU/7rU6rnRlK34LI=",
"requires": {
"buffer-equal": "0.0.1",
"minimist": "1.2.0",
"through2": "2.0.3"
}
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.1",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
},
"resolve": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.0.tgz",
"integrity": "sha512-QdgZ5bjR1WAlpLaO5yHepFvC+o3rCr6wpfE2tpJNMkXdulf2jKomQBdNRQITF3ZKHNlT71syG98yQP03gasgnA==",
"requires": {
"path-parse": "1.0.5"
}
},
"restructure": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/restructure/-/restructure-0.5.4.tgz",
"integrity": "sha1-9U591WNZD7NP1r9Vh2EJrsyyjeg=",
"requires": {
"browserify-optional": "1.0.1"
}
},
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
},
"shallow-copy": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz",
"integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA="
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"optional": true
},
"static-eval": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.0.tgz",
"integrity": "sha512-6flshd3F1Gwm+Ksxq463LtFd1liC77N/PX1FVVc3OzL3hAmo2fwHFbuArkcfi7s9rTNsLEhcRmXGFZhlgy40uw==",
"requires": {
"escodegen": "1.9.1"
}
},
"static-module": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/static-module/-/static-module-2.2.3.tgz",
"integrity": "sha512-OdNOIoJGjYH2OW9KZoGg4RfiBmtKkGijUFTH8w9oCRe8Q+CfVUuY/nlPZmqdsCFWMz2Ho0euzaJA/a6pUpCmZA==",
"requires": {
"concat-stream": "1.6.2",
"convert-source-map": "1.5.1",
"duplexer2": "0.1.4",
"escodegen": "1.9.1",
"falafel": "2.1.0",
"has": "1.0.1",
"magic-string": "0.22.5",
"merge-source-map": "1.0.4",
"object-inspect": "1.4.1",
"quote-stream": "1.0.2",
"readable-stream": "2.3.6",
"shallow-copy": "0.0.1",
"static-eval": "2.0.0",
"through2": "2.0.3"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "5.1.1"
}
},
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
"integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
"requires": {
"readable-stream": "2.3.6",
"xtend": "4.0.1"
}
},
"tiny-inflate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.2.tgz",
"integrity": "sha1-k9nez/yIBb1X6uQxDwt0Xptvs6c="
},
"type-check": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
"integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
"requires": {
"prelude-ls": "1.1.2"
}
},
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"unicode-properties": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.1.0.tgz",
"integrity": "sha1-epbu9J91aC6mnSMV7smsQ//fAME=",
"requires": {
"brfs": "1.5.0",
"unicode-trie": "0.3.1"
}
},
"unicode-trie": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-0.3.1.tgz",
"integrity": "sha1-1nHd3YkQGgi6w3tqUWEBBgIFIIU=",
"requires": {
"pako": "0.2.9",
"tiny-inflate": "1.0.2"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"vlq": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz",
"integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow=="
},
"wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
}
}
}

16
package.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "lane-slip-generator",
"version": "1.0.0",
"description": "Lane Slip Generator",
"main": "index.js",
"dependencies": {
"kotlin": "^1.2.31",
"pdfkit": "^0.8.3"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}

2
settings.gradle Normal file
View File

@ -0,0 +1,2 @@
rootProject.name = 'lane-slip-generator'

View File

@ -0,0 +1,180 @@
package online.cinphart.laneslips
external fun require(module: String): dynamic
external val exports: dynamic
val Double.cm: Double
get() = this / 2.54
val Double.asPoints: Double
get() = this * 72
data class SlipInfo(
val eventNbr: Int,
val event: String,
val lane: Int,
val heat: Int,
val swimmer: String,
val team: String)
fun main(args: Array<String>) {
val fireFunctions = require("firebase-functions")
fireFunctions.config()
exports.laneslips = fireFunctions.https.onRequest { req, res ->
val doc = js("new (require('pdfkit'))()")
//res.setHeader("Content-Disposition", "attachment;filename=\"lane-slips.pdf\"")
res.setHeader("Content-Type", "application/pdf")
val slips = listOf(
SlipInfo(
eventNbr = 1,
event = "Girls 8&U 100 Yd Medley Relay",
lane = 1,
heat = 1,
swimmer = "A",
team = "Delshire"),
SlipInfo(
eventNbr = 1,
event = "Girls 8&U 100 Yd Medley Relay",
lane = 1,
heat = 3,
swimmer = "B",
team = "Delshire"),
SlipInfo(
eventNbr = 19,
event = "Boys 15-18 50 Yd Freestyle",
lane = 3,
heat = 5,
swimmer = "Jack Hart",
team = "Delshire"),
SlipInfo(
eventNbr = 19,
event = "Boys 15-18 50 Yd Freestyle",
lane = 6,
heat = 1,
swimmer = "Joseph Obert",
team = "Delshire"),
SlipInfo(
eventNbr = 1,
event = "Girls 8&U 100 Yd Medley Relay",
lane = 1,
heat = 1,
swimmer = "A",
team = "Delshire"),
SlipInfo(
eventNbr = 1,
event = "Girls 8&U 100 Yd Medley Relay",
lane = 1,
heat = 3,
swimmer = "B",
team = "Delshire")
)
doc.pipe(res)
slips[0].writeSlip(doc, 0, 0)
slips[1].writeSlip(doc, 1, 0)
slips[2].writeSlip(doc, 0, 1)
slips[3].writeSlip(doc, 1, 1)
slips[4].writeSlip(doc, 0, 2)
slips[5].writeSlip(doc, 1, 2)
val dashOptions = js("{}")
dashOptions.space = 10
doc.moveTo(10.25.cm.asPoints, 1.0.cm.asPoints).lineTo(10.25.cm.asPoints, 27.0.cm.asPoints).dash(5, dashOptions).stroke()
doc.moveTo(1.0.cm.asPoints, 8.5.cm.asPoints).lineTo(21.0.cm.asPoints, 8.5.cm.asPoints).dash(5, dashOptions).stroke()
doc.moveTo(1.0.cm.asPoints, 16.5.cm.asPoints).lineTo(21.0.cm.asPoints, 16.5.cm.asPoints).dash(5, dashOptions).stroke()
doc.end()
}
}
fun SlipInfo.writeSlip(doc: dynamic, x: Int, y: Int) {
val xOffset = 10.0.cm.asPoints * x
val yOffset = 8.0.cm.asPoints * y
val leftMargin = 1.0.cm.asPoints + xOffset
val opts = js("{}")
opts.width=8.5.cm.asPoints
opts.align="center"
doc.fontSize(13)
doc.font("Helvetica-Bold")
doc.text("Southern Ohio Swim League",
leftMargin,
1.5.cm.asPoints + yOffset,
opts)
doc.fontSize(11)
doc.font("Times-Roman")
val eventY = 2.3.cm.asPoints + yOffset
doc.text("EVENT #${eventNbr} - ${event}", leftMargin, eventY)
val lineSeparation = 0.6.cm.asPoints
val laneY = eventY + lineSeparation
doc.text("Lane:", leftMargin, laneY)
val colWidth = 1.3.cm.asPoints
doc.text("1", leftMargin + colWidth * 1, laneY)
doc.text("2", leftMargin + colWidth * 2, laneY)
doc.text("3", leftMargin + colWidth * 3, laneY)
doc.text("4", leftMargin + colWidth * 4, laneY)
doc.text("5", leftMargin + colWidth * 5, laneY)
doc.text("6", leftMargin + colWidth * 6, laneY)
doc.circle(leftMargin + colWidth * lane + 0.1.cm.asPoints, laneY + 0.15.cm.asPoints, 0.3.cm.asPoints)
doc.stroke()
val heatY = laneY + lineSeparation
doc.text("Heat:", leftMargin, heatY)
doc.text("1", leftMargin + colWidth * 1, heatY)
doc.text("2", leftMargin + colWidth * 2, heatY)
doc.text("3", leftMargin + colWidth * 3, heatY)
doc.text("4", leftMargin + colWidth * 4, heatY)
doc.text("5", leftMargin + colWidth * 5, heatY)
doc.text("6", leftMargin + colWidth * 6, heatY)
doc.circle(leftMargin + colWidth * heat + 0.1.cm.asPoints, heatY + 0.15.cm.asPoints, 0.3.cm.asPoints)
doc.stroke()
val nameY = heatY + lineSeparation
doc.text("Name: $swimmer", leftMargin, nameY)
val teamY = nameY + lineSeparation
doc.text("Team: $team", leftMargin, teamY)
val timesY = teamY + lineSeparation * 1.5
doc.text("Times:", leftMargin, timesY)
doc.moveTo(leftMargin + colWidth, timesY + 14)
.lineTo(leftMargin + colWidth + 2.0.cm.asPoints, timesY + 14)
.stroke()
doc.moveTo(leftMargin + colWidth + 2.7.cm.asPoints, timesY + 14)
.lineTo(leftMargin + colWidth + 4.7.cm.asPoints, timesY + 14)
.stroke()
doc.moveTo(leftMargin + colWidth + 5.4.cm.asPoints, timesY + 14)
.lineTo(leftMargin + colWidth + 7.4.cm.asPoints, timesY + 14)
.stroke()
val officialTimesY = timesY + lineSeparation * 1.5
doc.text("Official Time:", leftMargin, officialTimesY)
doc.moveTo(leftMargin + colWidth * 2, officialTimesY + 14)
.lineTo(leftMargin + colWidth * 2 + 4.0.cm.asPoints, officialTimesY + 14)
.stroke()
val placeY = officialTimesY + lineSeparation * 1.25
doc.text("Place:", leftMargin, placeY)
doc.text("1", leftMargin + colWidth * 1, placeY)
doc.text("2", leftMargin + colWidth * 2, placeY)
doc.text("3", leftMargin + colWidth * 3, placeY)
doc.text("4", leftMargin + colWidth * 4, placeY)
doc.text("5", leftMargin + colWidth * 5, placeY)
doc.text("6", leftMargin + colWidth * 6, placeY)
}