diff --git a/Dockerfile b/Dockerfile
index 626e138..cb64bce 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,3 @@
-FROM lambci/lambda:build-nodejs8.10
+FROM lambci/lambda:build-nodejs12.x
WORKDIR /build
diff --git a/Makefile b/Makefile
index 8818aeb..dbe4b37 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ bucket = ${CODE_BUCKET}
regions = us-east-1
image:
- docker build --tag redirection:lambci8.10 .
+ docker build --tag redirection:lambci12.x .
build: image
docker run --rm --volume ${PWD}/lambda/origin-request-function:/build redirection:lambci8.10 /bin/bash -c "npm init -f -y; npm install node-rules@3.2.0 --save; npm install underscore@1.9.1 --save; npm install --only=prod"
diff --git a/cloudformation/template.yaml b/cloudformation/template.yaml
index bb6d164..da910dd 100644
--- a/cloudformation/template.yaml
+++ b/cloudformation/template.yaml
@@ -104,7 +104,7 @@ Resources:
Handler: index.handler
Role: !GetAtt OriginRequestFunctionRole.Arn
Timeout: 5
- Runtime: nodejs8.10
+ Runtime: nodejs12.x
OriginRequestFunctionVersion:
Type: "AWS::Lambda::Version"
@@ -161,7 +161,7 @@ Resources:
Handler: index.handler
Role: !GetAtt DeployFunctionRole.Arn
Timeout: 300
- Runtime: nodejs8.10
+ Runtime: nodejs12.x
DeployArtifacts:
Type: 'Custom::LambdaCallout'
diff --git a/lambda/deploy-function/node_modules/.bin/mime b/lambda/deploy-function/node_modules/.bin/mime
new file mode 120000
index 0000000..fbb7ee0
--- /dev/null
+++ b/lambda/deploy-function/node_modules/.bin/mime
@@ -0,0 +1 @@
+../mime/cli.js
\ No newline at end of file
diff --git a/lambda/deploy-function/node_modules/adm-zip/README.md b/lambda/deploy-function/node_modules/adm-zip/README.md
new file mode 100644
index 0000000..bda0b06
--- /dev/null
+++ b/lambda/deploy-function/node_modules/adm-zip/README.md
@@ -0,0 +1,65 @@
+# ADM-ZIP for NodeJS with added support for electron original-fs
+
+ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/).
+
+# Installation
+
+With [npm](http://npmjs.org) do:
+
+ $ npm install adm-zip
+
+## What is it good for?
+The library allows you to:
+
+* decompress zip files directly to disk or in memory buffers
+* compress files and store them to disk in .zip format or in compressed buffers
+* update content of/add new/delete files from an existing .zip
+
+# Dependencies
+There are no other nodeJS libraries that ADM-ZIP is dependent of
+
+# Examples
+
+## Basic usage
+```javascript
+
+ var AdmZip = require('adm-zip');
+
+ // reading archives
+ var zip = new AdmZip("./my_file.zip");
+ var zipEntries = zip.getEntries(); // an array of ZipEntry records
+
+ zipEntries.forEach(function(zipEntry) {
+ console.log(zipEntry.toString()); // outputs zip entries information
+ if (zipEntry.entryName == "my_file.txt") {
+ console.log(zipEntry.getData().toString('utf8'));
+ }
+ });
+ // outputs the content of some_folder/my_file.txt
+ console.log(zip.readAsText("some_folder/my_file.txt"));
+ // extracts the specified file to the specified location
+ zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*maintainEntryPath*/false, /*overwrite*/true);
+ // extracts everything
+ zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true);
+
+
+ // creating archives
+ var zip = new AdmZip();
+
+ // add file directly
+ var content = "inner content of the file";
+ zip.addFile("test.txt", Buffer.alloc(content.length, content), "entry comment goes here");
+ // add local file
+ zip.addLocalFile("/home/me/some_picture.png");
+ // get everything as a buffer
+ var willSendthis = zip.toBuffer();
+ // or write everything to disk
+ zip.writeZip(/*target file name*/"/home/me/files.zip");
+
+
+ // ... more examples in the wiki
+```
+
+For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).
+
+[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip)
diff --git a/lambda/deploy-function/node_modules/adm-zip/adm-zip.js b/lambda/deploy-function/node_modules/adm-zip/adm-zip.js
new file mode 100644
index 0000000..b9f5d7e
--- /dev/null
+++ b/lambda/deploy-function/node_modules/adm-zip/adm-zip.js
@@ -0,0 +1,536 @@
+var Utils = require("./util");
+var fs = Utils.FileSystem.require(),
+ pth = require("path");
+
+fs.existsSync = fs.existsSync || pth.existsSync;
+
+var ZipEntry = require("./zipEntry"),
+ ZipFile = require("./zipFile");
+
+var isWin = /^win/.test(process.platform);
+
+
+module.exports = function (/*String*/input) {
+ var _zip = undefined,
+ _filename = "";
+
+ if (input && typeof input === "string") { // load zip file
+ if (fs.existsSync(input)) {
+ _filename = input;
+ _zip = new ZipFile(input, Utils.Constants.FILE);
+ } else {
+ throw Utils.Errors.INVALID_FILENAME;
+ }
+ } else if (input && Buffer.isBuffer(input)) { // load buffer
+ _zip = new ZipFile(input, Utils.Constants.BUFFER);
+ } else { // create new zip file
+ _zip = new ZipFile(null, Utils.Constants.NONE);
+ }
+
+ function sanitize(prefix, name) {
+ prefix = pth.resolve(pth.normalize(prefix));
+ var parts = name.split('/');
+ for (var i = 0, l = parts.length; i < l; i++) {
+ var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
+ if (path.indexOf(prefix) === 0) {
+ return path;
+ }
+ }
+ return pth.normalize(pth.join(prefix, pth.basename(name)));
+ }
+
+ function getEntry(/*Object*/entry) {
+ if (entry && _zip) {
+ var item;
+ // If entry was given as a file name
+ if (typeof entry === "string")
+ item = _zip.getEntry(entry);
+ // if entry was given as a ZipEntry object
+ if (typeof entry === "object" && typeof entry.entryName !== "undefined" && typeof entry.header !== "undefined")
+ item = _zip.getEntry(entry.entryName);
+
+ if (item) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ return {
+ /**
+ * Extracts the given entry from the archive and returns the content as a Buffer object
+ * @param entry ZipEntry object or String with the full path of the entry
+ *
+ * @return Buffer or Null in case of error
+ */
+ readFile: function (/*Object*/entry) {
+ var item = getEntry(entry);
+ return item && item.getData() || null;
+ },
+
+ /**
+ * Asynchronous readFile
+ * @param entry ZipEntry object or String with the full path of the entry
+ * @param callback
+ *
+ * @return Buffer or Null in case of error
+ */
+ readFileAsync: function (/*Object*/entry, /*Function*/callback) {
+ var item = getEntry(entry);
+ if (item) {
+ item.getDataAsync(callback);
+ } else {
+ callback(null, "getEntry failed for:" + entry)
+ }
+ },
+
+ /**
+ * Extracts the given entry from the archive and returns the content as plain text in the given encoding
+ * @param entry ZipEntry object or String with the full path of the entry
+ * @param encoding Optional. If no encoding is specified utf8 is used
+ *
+ * @return String
+ */
+ readAsText: function (/*Object*/entry, /*String - Optional*/encoding) {
+ var item = getEntry(entry);
+ if (item) {
+ var data = item.getData();
+ if (data && data.length) {
+ return data.toString(encoding || "utf8");
+ }
+ }
+ return "";
+ },
+
+ /**
+ * Asynchronous readAsText
+ * @param entry ZipEntry object or String with the full path of the entry
+ * @param callback
+ * @param encoding Optional. If no encoding is specified utf8 is used
+ *
+ * @return String
+ */
+ readAsTextAsync: function (/*Object*/entry, /*Function*/callback, /*String - Optional*/encoding) {
+ var item = getEntry(entry);
+ if (item) {
+ item.getDataAsync(function (data) {
+ if (data && data.length) {
+ callback(data.toString(encoding || "utf8"));
+ } else {
+ callback("");
+ }
+ })
+ } else {
+ callback("");
+ }
+ },
+
+ /**
+ * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory
+ *
+ * @param entry
+ */
+ deleteFile: function (/*Object*/entry) { // @TODO: test deleteFile
+ var item = getEntry(entry);
+ if (item) {
+ _zip.deleteEntry(item.entryName);
+ }
+ },
+
+ /**
+ * Adds a comment to the zip. The zip must be rewritten after adding the comment.
+ *
+ * @param comment
+ */
+ addZipComment: function (/*String*/comment) { // @TODO: test addZipComment
+ _zip.comment = comment;
+ },
+
+ /**
+ * Returns the zip comment
+ *
+ * @return String
+ */
+ getZipComment: function () {
+ return _zip.comment || '';
+ },
+
+ /**
+ * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment
+ * The comment cannot exceed 65535 characters in length
+ *
+ * @param entry
+ * @param comment
+ */
+ addZipEntryComment: function (/*Object*/entry, /*String*/comment) {
+ var item = getEntry(entry);
+ if (item) {
+ item.comment = comment;
+ }
+ },
+
+ /**
+ * Returns the comment of the specified entry
+ *
+ * @param entry
+ * @return String
+ */
+ getZipEntryComment: function (/*Object*/entry) {
+ var item = getEntry(entry);
+ if (item) {
+ return item.comment || '';
+ }
+ return ''
+ },
+
+ /**
+ * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content
+ *
+ * @param entry
+ * @param content
+ */
+ updateFile: function (/*Object*/entry, /*Buffer*/content) {
+ var item = getEntry(entry);
+ if (item) {
+ item.setData(content);
+ }
+ },
+
+ /**
+ * Adds a file from the disk to the archive
+ *
+ * @param localPath File to add to zip
+ * @param zipPath Optional path inside the zip
+ * @param zipName Optional name for the file
+ */
+ addLocalFile: function (/*String*/localPath, /*String*/zipPath, /*String*/zipName) {
+ if (fs.existsSync(localPath)) {
+ if (zipPath) {
+ zipPath = zipPath.split("\\").join("/");
+ if (zipPath.charAt(zipPath.length - 1) !== "/") {
+ zipPath += "/";
+ }
+ } else {
+ zipPath = "";
+ }
+ var p = localPath.split("\\").join("/").split("/").pop();
+
+ if (zipName) {
+ this.addFile(zipPath + zipName, fs.readFileSync(localPath), "", 0)
+ } else {
+ this.addFile(zipPath + p, fs.readFileSync(localPath), "", 0)
+ }
+ } else {
+ throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath);
+ }
+ },
+
+ /**
+ * Adds a local directory and all its nested files and directories to the archive
+ *
+ * @param localPath
+ * @param zipPath optional path inside zip
+ * @param filter optional RegExp or Function if files match will
+ * be included.
+ */
+ addLocalFolder: function (/*String*/localPath, /*String*/zipPath, /*RegExp|Function*/filter) {
+ if (filter === undefined) {
+ filter = function () {
+ return true;
+ };
+ } else if (filter instanceof RegExp) {
+ filter = function (filter) {
+ return function (filename) {
+ return filter.test(filename);
+ }
+ }(filter);
+ }
+
+ if (zipPath) {
+ zipPath = zipPath.split("\\").join("/");
+ if (zipPath.charAt(zipPath.length - 1) !== "/") {
+ zipPath += "/";
+ }
+ } else {
+ zipPath = "";
+ }
+ // normalize the path first
+ localPath = pth.normalize(localPath);
+ localPath = localPath.split("\\").join("/"); //windows fix
+ if (localPath.charAt(localPath.length - 1) !== "/")
+ localPath += "/";
+
+ if (fs.existsSync(localPath)) {
+
+ var items = Utils.findFiles(localPath),
+ self = this;
+
+ if (items.length) {
+ items.forEach(function (path) {
+ var p = path.split("\\").join("/").replace(new RegExp(localPath.replace(/(\(|\))/g, '\\$1'), 'i'), ""); //windows fix
+ if (filter(p)) {
+ if (p.charAt(p.length - 1) !== "/") {
+ self.addFile(zipPath + p, fs.readFileSync(path), "", 0)
+ } else {
+ self.addFile(zipPath + p, Buffer.alloc(0), "", 0)
+ }
+ }
+ });
+ }
+ } else {
+ throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath);
+ }
+ },
+
+ /**
+ * Allows you to create a entry (file or directory) in the zip file.
+ * If you want to create a directory the entryName must end in / and a null buffer should be provided.
+ * Comment and attributes are optional
+ *
+ * @param entryName
+ * @param content
+ * @param comment
+ * @param attr
+ */
+ addFile: function (/*String*/entryName, /*Buffer*/content, /*String*/comment, /*Number*/attr) {
+ var entry = new ZipEntry();
+ entry.entryName = entryName;
+ entry.comment = comment || "";
+
+ if (!attr) {
+ if (entry.isDirectory) {
+ attr = (0o40755 << 16) | 0x10; // (permissions drwxr-xr-x) + (MS-DOS directory flag)
+ } else {
+ attr = 0o644 << 16; // permissions -r-wr--r--
+ }
+ }
+
+ entry.attr = attr;
+
+ entry.setData(content);
+ _zip.setEntry(entry);
+ },
+
+ /**
+ * Returns an array of ZipEntry objects representing the files and folders inside the archive
+ *
+ * @return Array
+ */
+ getEntries: function () {
+ if (_zip) {
+ return _zip.entries;
+ } else {
+ return [];
+ }
+ },
+
+ /**
+ * Returns a ZipEntry object representing the file or folder specified by ``name``.
+ *
+ * @param name
+ * @return ZipEntry
+ */
+ getEntry: function (/*String*/name) {
+ return getEntry(name);
+ },
+
+ /**
+ * Extracts the given entry to the given targetPath
+ * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted
+ *
+ * @param entry ZipEntry object or String with the full path of the entry
+ * @param targetPath Target folder where to write the file
+ * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder
+ * will be created in targetPath as well. Default is TRUE
+ * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true.
+ * Default is FALSE
+ *
+ * @return Boolean
+ */
+ extractEntryTo: function (/*Object*/entry, /*String*/targetPath, /*Boolean*/maintainEntryPath, /*Boolean*/overwrite) {
+ overwrite = overwrite || false;
+ maintainEntryPath = typeof maintainEntryPath === "undefined" ? true : maintainEntryPath;
+
+ var item = getEntry(entry);
+ if (!item) {
+ throw Utils.Errors.NO_ENTRY;
+ }
+
+ var entryName = item.entryName;
+
+ var target = sanitize(targetPath, pth.resolve(targetPath, maintainEntryPath ? entryName : pth.basename(entryName)));
+
+ if (item.isDirectory) {
+ target = pth.resolve(target, "..");
+ var children = _zip.getEntryChildren(item);
+ children.forEach(function (child) {
+ if (child.isDirectory) return;
+ var content = child.getData();
+ if (!content) {
+ throw Utils.Errors.CANT_EXTRACT_FILE;
+ }
+ var childName = sanitize(targetPath, child.entryName);
+
+ Utils.writeFileTo(pth.resolve(targetPath, maintainEntryPath ? childName : childName.substr(entryName.length)), content, overwrite);
+ });
+ return true;
+ }
+
+ var content = item.getData();
+ if (!content) throw Utils.Errors.CANT_EXTRACT_FILE;
+
+ if (fs.existsSync(target) && !overwrite) {
+ throw Utils.Errors.CANT_OVERRIDE;
+ }
+ Utils.writeFileTo(target, content, overwrite);
+
+ return true;
+ },
+
+ /**
+ * Test the archive
+ *
+ */
+ test: function () {
+ if (!_zip) {
+ return false;
+ }
+
+ for (var entry in _zip.entries) {
+ try {
+ if (entry.isDirectory) {
+ continue;
+ }
+ var content = _zip.entries[entry].getData();
+ if (!content) {
+ return false;
+ }
+ } catch (err) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ /**
+ * Extracts the entire archive to the given location
+ *
+ * @param targetPath Target location
+ * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true.
+ * Default is FALSE
+ */
+ extractAllTo: function (/*String*/targetPath, /*Boolean*/overwrite) {
+ overwrite = overwrite || false;
+ if (!_zip) {
+ throw Utils.Errors.NO_ZIP;
+ }
+ _zip.entries.forEach(function (entry) {
+ var entryName = sanitize(targetPath, entry.entryName.toString());
+ if (entry.isDirectory) {
+ Utils.makeDir(entryName);
+ return;
+ }
+ var content = entry.getData();
+ if (!content) {
+ throw Utils.Errors.CANT_EXTRACT_FILE;
+ }
+ Utils.writeFileTo(entryName, content, overwrite);
+ fs.utimesSync(entryName, entry.header.time, entry.header.time)
+ })
+ },
+
+ /**
+ * Asynchronous extractAllTo
+ *
+ * @param targetPath Target location
+ * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true.
+ * Default is FALSE
+ * @param callback
+ */
+ extractAllToAsync: function (/*String*/targetPath, /*Boolean*/overwrite, /*Function*/callback) {
+ if (!callback) {
+ callback = function() {}
+ }
+ overwrite = overwrite || false;
+ if (!_zip) {
+ callback(new Error(Utils.Errors.NO_ZIP));
+ return;
+ }
+
+ var entries = _zip.entries;
+ var i = entries.length;
+ entries.forEach(function (entry) {
+ if (i <= 0) return; // Had an error already
+
+ var entryName = pth.normalize(entry.entryName.toString());
+
+ if (entry.isDirectory) {
+ Utils.makeDir(sanitize(targetPath, entryName));
+ if (--i === 0)
+ callback(undefined);
+ return;
+ }
+ entry.getDataAsync(function (content) {
+ if (i <= 0) return;
+ if (!content) {
+ i = 0;
+ callback(new Error(Utils.Errors.CANT_EXTRACT_FILE));
+ return;
+ }
+
+ Utils.writeFileToAsync(sanitize(targetPath, entryName), content, overwrite, function (succ) {
+ fs.utimesSync(pth.resolve(targetPath, entryName), entry.header.time, entry.header.time);
+ if (i <= 0) return;
+ if (!succ) {
+ i = 0;
+ callback(new Error('Unable to write'));
+ return;
+ }
+ if (--i === 0)
+ callback(undefined);
+ });
+ });
+ })
+ },
+
+ /**
+ * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip
+ *
+ * @param targetFileName
+ * @param callback
+ */
+ writeZip: function (/*String*/targetFileName, /*Function*/callback) {
+ if (arguments.length === 1) {
+ if (typeof targetFileName === "function") {
+ callback = targetFileName;
+ targetFileName = "";
+ }
+ }
+
+ if (!targetFileName && _filename) {
+ targetFileName = _filename;
+ }
+ if (!targetFileName) return;
+
+ var zipData = _zip.compressToBuffer();
+ if (zipData) {
+ var ok = Utils.writeFileTo(targetFileName, zipData, true);
+ if (typeof callback === 'function') callback(!ok ? new Error("failed") : null, "");
+ }
+ },
+
+ /**
+ * Returns the content of the entire zip file as a Buffer object
+ *
+ * @return Buffer
+ */
+ toBuffer: function (/*Function*/onSuccess, /*Function*/onFail, /*Function*/onItemStart, /*Function*/onItemEnd) {
+ this.valueOf = 2;
+ if (typeof onSuccess === "function") {
+ _zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd);
+ return null;
+ }
+ return _zip.compressToBuffer()
+ }
+ }
+};
diff --git a/lambda/deploy-function/node_modules/adm-zip/headers/entryHeader.js b/lambda/deploy-function/node_modules/adm-zip/headers/entryHeader.js
new file mode 100644
index 0000000..9a78295
--- /dev/null
+++ b/lambda/deploy-function/node_modules/adm-zip/headers/entryHeader.js
@@ -0,0 +1,261 @@
+var Utils = require("../util"),
+ Constants = Utils.Constants;
+
+/* The central directory file header */
+module.exports = function () {
+ var _verMade = 0x0A,
+ _version = 0x0A,
+ _flags = 0,
+ _method = 0,
+ _time = 0,
+ _crc = 0,
+ _compressedSize = 0,
+ _size = 0,
+ _fnameLen = 0,
+ _extraLen = 0,
+
+ _comLen = 0,
+ _diskStart = 0,
+ _inattr = 0,
+ _attr = 0,
+ _offset = 0;
+
+ var _dataHeader = {};
+
+ function setTime(val) {
+ val = new Date(val);
+ _time = (val.getFullYear() - 1980 & 0x7f) << 25 // b09-16 years from 1980
+ | (val.getMonth() + 1) << 21 // b05-08 month
+ | val.getDate() << 16 // b00-04 hour
+
+ // 2 bytes time
+ | val.getHours() << 11 // b11-15 hour
+ | val.getMinutes() << 5 // b05-10 minute
+ | val.getSeconds() >> 1; // b00-04 seconds divided by 2
+ }
+
+ setTime(+new Date());
+
+ return {
+ get made () { return _verMade; },
+ set made (val) { _verMade = val; },
+
+ get version () { return _version; },
+ set version (val) { _version = val },
+
+ get flags () { return _flags },
+ set flags (val) { _flags = val; },
+
+ get method () { return _method; },
+ set method (val) { _method = val; },
+
+ get time () { return new Date(
+ ((_time >> 25) & 0x7f) + 1980,
+ ((_time >> 21) & 0x0f) - 1,
+ (_time >> 16) & 0x1f,
+ (_time >> 11) & 0x1f,
+ (_time >> 5) & 0x3f,
+ (_time & 0x1f) << 1
+ );
+ },
+ set time (val) {
+ setTime(val);
+ },
+
+ get crc () { return _crc; },
+ set crc (val) { _crc = val; },
+
+ get compressedSize () { return _compressedSize; },
+ set compressedSize (val) { _compressedSize = val; },
+
+ get size () { return _size; },
+ set size (val) { _size = val; },
+
+ get fileNameLength () { return _fnameLen; },
+ set fileNameLength (val) { _fnameLen = val; },
+
+ get extraLength () { return _extraLen },
+ set extraLength (val) { _extraLen = val; },
+
+ get commentLength () { return _comLen },
+ set commentLength (val) { _comLen = val },
+
+ get diskNumStart () { return _diskStart },
+ set diskNumStart (val) { _diskStart = val },
+
+ get inAttr () { return _inattr },
+ set inAttr (val) { _inattr = val },
+
+ get attr () { return _attr },
+ set attr (val) { _attr = val },
+
+ get offset () { return _offset },
+ set offset (val) { _offset = val },
+
+ get encripted () { return (_flags & 1) === 1 },
+
+ get entryHeaderSize () {
+ return Constants.CENHDR + _fnameLen + _extraLen + _comLen;
+ },
+
+ get realDataOffset () {
+ return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen;
+ },
+
+ get dataHeader () {
+ return _dataHeader;
+ },
+
+ loadDataHeaderFromBinary : function(/*Buffer*/input) {
+ var data = input.slice(_offset, _offset + Constants.LOCHDR);
+ // 30 bytes and should start with "PK\003\004"
+ if (data.readUInt32LE(0) !== Constants.LOCSIG) {
+ throw Utils.Errors.INVALID_LOC;
+ }
+ _dataHeader = {
+ // version needed to extract
+ version : data.readUInt16LE(Constants.LOCVER),
+ // general purpose bit flag
+ flags : data.readUInt16LE(Constants.LOCFLG),
+ // compression method
+ method : data.readUInt16LE(Constants.LOCHOW),
+ // modification time (2 bytes time, 2 bytes date)
+ time : data.readUInt32LE(Constants.LOCTIM),
+ // uncompressed file crc-32 value
+ crc : data.readUInt32LE(Constants.LOCCRC),
+ // compressed size
+ compressedSize : data.readUInt32LE(Constants.LOCSIZ),
+ // uncompressed size
+ size : data.readUInt32LE(Constants.LOCLEN),
+ // filename length
+ fnameLen : data.readUInt16LE(Constants.LOCNAM),
+ // extra field length
+ extraLen : data.readUInt16LE(Constants.LOCEXT)
+ }
+ },
+
+ loadFromBinary : function(/*Buffer*/data) {
+ // data should be 46 bytes and start with "PK 01 02"
+ if (data.length !== Constants.CENHDR || data.readUInt32LE(0) !== Constants.CENSIG) {
+ throw Utils.Errors.INVALID_CEN;
+ }
+ // version made by
+ _verMade = data.readUInt16LE(Constants.CENVEM);
+ // version needed to extract
+ _version = data.readUInt16LE(Constants.CENVER);
+ // encrypt, decrypt flags
+ _flags = data.readUInt16LE(Constants.CENFLG);
+ // compression method
+ _method = data.readUInt16LE(Constants.CENHOW);
+ // modification time (2 bytes time, 2 bytes date)
+ _time = data.readUInt32LE(Constants.CENTIM);
+ // uncompressed file crc-32 value
+ _crc = data.readUInt32LE(Constants.CENCRC);
+ // compressed size
+ _compressedSize = data.readUInt32LE(Constants.CENSIZ);
+ // uncompressed size
+ _size = data.readUInt32LE(Constants.CENLEN);
+ // filename length
+ _fnameLen = data.readUInt16LE(Constants.CENNAM);
+ // extra field length
+ _extraLen = data.readUInt16LE(Constants.CENEXT);
+ // file comment length
+ _comLen = data.readUInt16LE(Constants.CENCOM);
+ // volume number start
+ _diskStart = data.readUInt16LE(Constants.CENDSK);
+ // internal file attributes
+ _inattr = data.readUInt16LE(Constants.CENATT);
+ // external file attributes
+ _attr = data.readUInt32LE(Constants.CENATX);
+ // LOC header offset
+ _offset = data.readUInt32LE(Constants.CENOFF);
+ },
+
+ dataHeaderToBinary : function() {
+ // LOC header size (30 bytes)
+ var data = Buffer.alloc(Constants.LOCHDR);
+ // "PK\003\004"
+ data.writeUInt32LE(Constants.LOCSIG, 0);
+ // version needed to extract
+ data.writeUInt16LE(_version, Constants.LOCVER);
+ // general purpose bit flag
+ data.writeUInt16LE(_flags, Constants.LOCFLG);
+ // compression method
+ data.writeUInt16LE(_method, Constants.LOCHOW);
+ // modification time (2 bytes time, 2 bytes date)
+ data.writeUInt32LE(_time, Constants.LOCTIM);
+ // uncompressed file crc-32 value
+ data.writeUInt32LE(_crc, Constants.LOCCRC);
+ // compressed size
+ data.writeUInt32LE(_compressedSize, Constants.LOCSIZ);
+ // uncompressed size
+ data.writeUInt32LE(_size, Constants.LOCLEN);
+ // filename length
+ data.writeUInt16LE(_fnameLen, Constants.LOCNAM);
+ // extra field length
+ data.writeUInt16LE(_extraLen, Constants.LOCEXT);
+ return data;
+ },
+
+ entryHeaderToBinary : function() {
+ // CEN header size (46 bytes)
+ var data = Buffer.alloc(Constants.CENHDR + _fnameLen + _extraLen + _comLen);
+ // "PK\001\002"
+ data.writeUInt32LE(Constants.CENSIG, 0);
+ // version made by
+ data.writeUInt16LE(_verMade, Constants.CENVEM);
+ // version needed to extract
+ data.writeUInt16LE(_version, Constants.CENVER);
+ // encrypt, decrypt flags
+ data.writeUInt16LE(_flags, Constants.CENFLG);
+ // compression method
+ data.writeUInt16LE(_method, Constants.CENHOW);
+ // modification time (2 bytes time, 2 bytes date)
+ data.writeUInt32LE(_time, Constants.CENTIM);
+ // uncompressed file crc-32 value
+ data.writeUInt32LE(_crc, Constants.CENCRC);
+ // compressed size
+ data.writeUInt32LE(_compressedSize, Constants.CENSIZ);
+ // uncompressed size
+ data.writeUInt32LE(_size, Constants.CENLEN);
+ // filename length
+ data.writeUInt16LE(_fnameLen, Constants.CENNAM);
+ // extra field length
+ data.writeUInt16LE(_extraLen, Constants.CENEXT);
+ // file comment length
+ data.writeUInt16LE(_comLen, Constants.CENCOM);
+ // volume number start
+ data.writeUInt16LE(_diskStart, Constants.CENDSK);
+ // internal file attributes
+ data.writeUInt16LE(_inattr, Constants.CENATT);
+ // external file attributes
+ data.writeUInt32LE(_attr, Constants.CENATX);
+ // LOC header offset
+ data.writeUInt32LE(_offset, Constants.CENOFF);
+ // fill all with
+ data.fill(0x00, Constants.CENHDR);
+ return data;
+ },
+
+ toString : function() {
+ return '{\n' +
+ '\t"made" : ' + _verMade + ",\n" +
+ '\t"version" : ' + _version + ",\n" +
+ '\t"flags" : ' + _flags + ",\n" +
+ '\t"method" : ' + Utils.methodToString(_method) + ",\n" +
+ '\t"time" : ' + this.time + ",\n" +
+ '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" +
+ '\t"compressedSize" : ' + _compressedSize + " bytes,\n" +
+ '\t"size" : ' + _size + " bytes,\n" +
+ '\t"fileNameLength" : ' + _fnameLen + ",\n" +
+ '\t"extraLength" : ' + _extraLen + " bytes,\n" +
+ '\t"commentLength" : ' + _comLen + " bytes,\n" +
+ '\t"diskNumStart" : ' + _diskStart + ",\n" +
+ '\t"inAttr" : ' + _inattr + ",\n" +
+ '\t"attr" : ' + _attr + ",\n" +
+ '\t"offset" : ' + _offset + ",\n" +
+ '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen) + " bytes\n" +
+ '}';
+ }
+ }
+};
diff --git a/lambda/deploy-function/node_modules/adm-zip/headers/index.js b/lambda/deploy-function/node_modules/adm-zip/headers/index.js
new file mode 100644
index 0000000..b8c67b9
--- /dev/null
+++ b/lambda/deploy-function/node_modules/adm-zip/headers/index.js
@@ -0,0 +1,2 @@
+exports.EntryHeader = require("./entryHeader");
+exports.MainHeader = require("./mainHeader");
diff --git a/lambda/deploy-function/node_modules/adm-zip/headers/mainHeader.js b/lambda/deploy-function/node_modules/adm-zip/headers/mainHeader.js
new file mode 100644
index 0000000..a2c3ca2
--- /dev/null
+++ b/lambda/deploy-function/node_modules/adm-zip/headers/mainHeader.js
@@ -0,0 +1,80 @@
+var Utils = require("../util"),
+ Constants = Utils.Constants;
+
+/* The entries in the end of central directory */
+module.exports = function () {
+ var _volumeEntries = 0,
+ _totalEntries = 0,
+ _size = 0,
+ _offset = 0,
+ _commentLength = 0;
+
+ return {
+ get diskEntries () { return _volumeEntries },
+ set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; },
+
+ get totalEntries () { return _totalEntries },
+ set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; },
+
+ get size () { return _size },
+ set size (/*Number*/val) { _size = val; },
+
+ get offset () { return _offset },
+ set offset (/*Number*/val) { _offset = val; },
+
+ get commentLength () { return _commentLength },
+ set commentLength (/*Number*/val) { _commentLength = val; },
+
+ get mainHeaderSize () {
+ return Constants.ENDHDR + _commentLength;
+ },
+
+ loadFromBinary : function(/*Buffer*/data) {
+ // data should be 22 bytes and start with "PK 05 06"
+ if (data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG)
+ throw Utils.Errors.INVALID_END;
+
+ // number of entries on this volume
+ _volumeEntries = data.readUInt16LE(Constants.ENDSUB);
+ // total number of entries
+ _totalEntries = data.readUInt16LE(Constants.ENDTOT);
+ // central directory size in bytes
+ _size = data.readUInt32LE(Constants.ENDSIZ);
+ // offset of first CEN header
+ _offset = data.readUInt32LE(Constants.ENDOFF);
+ // zip file comment length
+ _commentLength = data.readUInt16LE(Constants.ENDCOM);
+ },
+
+ toBinary : function() {
+ var b = Buffer.alloc(Constants.ENDHDR + _commentLength);
+ // "PK 05 06" signature
+ b.writeUInt32LE(Constants.ENDSIG, 0);
+ b.writeUInt32LE(0, 4);
+ // number of entries on this volume
+ b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
+ // total number of entries
+ b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
+ // central directory size in bytes
+ b.writeUInt32LE(_size, Constants.ENDSIZ);
+ // offset of first CEN header
+ b.writeUInt32LE(_offset, Constants.ENDOFF);
+ // zip file comment length
+ b.writeUInt16LE(_commentLength, Constants.ENDCOM);
+ // fill comment memory with spaces so no garbage is left there
+ b.fill(" ", Constants.ENDHDR);
+
+ return b;
+ },
+
+ toString : function() {
+ return '{\n' +
+ '\t"diskEntries" : ' + _volumeEntries + ",\n" +
+ '\t"totalEntries" : ' + _totalEntries + ",\n" +
+ '\t"size" : ' + _size + " bytes,\n" +
+ '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" +
+ '\t"commentLength" : 0x' + _commentLength + "\n" +
+ '}';
+ }
+ }
+};
\ No newline at end of file
diff --git a/lambda/deploy-function/node_modules/adm-zip/methods/deflater.js b/lambda/deploy-function/node_modules/adm-zip/methods/deflater.js
new file mode 100644
index 0000000..7a81ee6
--- /dev/null
+++ b/lambda/deploy-function/node_modules/adm-zip/methods/deflater.js
@@ -0,0 +1,1575 @@
+/*
+ * $Id: rawdeflate.js,v 0.5 2013/04/09 14:25:38 dankogai Exp dankogai $
+ *
+ * GNU General Public License, version 2 (GPL-2.0)
+ * http://opensource.org/licenses/GPL-2.0
+ * Original:
+ * http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt
+ */
+function JSDeflater(/*inbuff*/inbuf) {
+
+ /* Copyright (C) 1999 Masanao Izumo Please click on an element
+
+ Welcome to the home page
+
Cached Values
+Cache Info
+{{ $ctrl.log | json }}', + * controller: function() { + * var previousValue; + * this.log = []; + * this.$doCheck = function() { + * var currentValue = this.date && this.date.valueOf(); + * if (previousValue !== currentValue) { + * this.log.push('doCheck: date mutated: ' + this.date); + * previousValue = currentValue; + * } + * }; + * } + * }); + *
{{ items }}+ *
{{ $ctrl.log | json }}', + * controller: function() { + * this.log = []; + * + * this.$doCheck = function() { + * if (this.items_ref !== this.items) { + * this.log.push('doCheck: items changed'); + * this.items_ref = this.items; + * } + * if (!angular.equals(this.items_clone, this.items)) { + * this.log.push('doCheck: items mutated'); + * this.items_clone = angular.copy(this.items); + * } + * }; + * } + * }); + *